Commit d3c8470492ac43b2a95a3f16af4be34cb15e802a
1 parent
f798a3a5
盘点问题修正
Signed-off-by: TanYibin <5491541@qq.com>
Showing
5 changed files
with
59 additions
and
11 deletions
ant-design-vue-jeecg/src/api/api.js
@@ -137,6 +137,10 @@ export const completeTaskByWMS = (params) => postAction('/task/taskHeader/comple | @@ -137,6 +137,10 @@ export const completeTaskByWMS = (params) => postAction('/task/taskHeader/comple | ||
137 | export const execute = (params) => postAction('/task/taskHeader/execute', params); | 137 | export const execute = (params) => postAction('/task/taskHeader/execute', params); |
138 | //取消任务 | 138 | //取消任务 |
139 | export const cancelTask = (params) => postAction('/task/taskHeader/cancelTask?ids=' + params, params); | 139 | export const cancelTask = (params) => postAction('/task/taskHeader/cancelTask?ids=' + params, params); |
140 | + | ||
141 | +//盘点任务创建 | ||
142 | +export const createCycleCountDetailByInventory = (params) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCountDetailByInventory', params); | ||
143 | + | ||
140 | //切换任务 | 144 | //切换任务 |
141 | export const switchTask = (params) => postAction('/task/taskHeader/switchTask?ids=' + params, params); | 145 | export const switchTask = (params) => postAction('/task/taskHeader/switchTask?ids=' + params, params); |
142 | //自动配盘 | 146 | //自动配盘 |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
@@ -25,6 +25,7 @@ import org.jeecg.modules.wms.config.zone.entity.Zone; | @@ -25,6 +25,7 @@ import org.jeecg.modules.wms.config.zone.entity.Zone; | ||
25 | import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl; | 25 | import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl; |
26 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; | 26 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
27 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | 27 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
28 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.dto.CycleCountDetailByInventoryDto; | ||
28 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; | 29 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; |
29 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; | 30 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; |
30 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService; | 31 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService; |
@@ -52,6 +53,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | @@ -52,6 +53,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ||
52 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 53 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
53 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 54 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
54 | 55 | ||
56 | +import cn.hutool.core.collection.CollUtil; | ||
57 | +import cn.hutool.core.util.ObjectUtil; | ||
58 | +import cn.hutool.core.util.StrUtil; | ||
55 | import io.swagger.annotations.Api; | 59 | import io.swagger.annotations.Api; |
56 | import io.swagger.annotations.ApiOperation; | 60 | import io.swagger.annotations.ApiOperation; |
57 | import lombok.extern.slf4j.Slf4j; | 61 | import lombok.extern.slf4j.Slf4j; |
@@ -222,17 +226,27 @@ public class CycleCountDetailController extends HuahengBaseController { | @@ -222,17 +226,27 @@ public class CycleCountDetailController extends HuahengBaseController { | ||
222 | /** | 226 | /** |
223 | * 添加盘点 | 227 | * 添加盘点 |
224 | */ | 228 | */ |
225 | - @AutoLog(value = "盘点添加") | ||
226 | - @ApiOperation(value = "盘点添加", notes = "盘点添加") | ||
227 | - @PostMapping(value = "/stockTakeTask") | ||
228 | - public Result<?> stockTakeTask(@RequestParam(name = "ids") String ids, @RequestParam(name = "headerId") int headerId, @RequestParam(name = "code") String code) { | ||
229 | - if (StringUtils.isEmpty(ids)) { | ||
230 | - return Result.error("taskId不能为空"); | 229 | + @AutoLog(value = "盘点明细新增") |
230 | + @ApiOperation(value = "盘点明细新增-根据选取的库存新增", notes = "盘点明细新增-根据选取的库存新增") | ||
231 | + @PostMapping(value = "/createCycleCountDetailByInventory") | ||
232 | + public Result<?> createCycleCountDetailByInventory(@RequestBody CycleCountDetailByInventoryDto cycleCountDetailByInventoryDto) { | ||
233 | + List<Integer> inventoryHeaderIds = cycleCountDetailByInventoryDto.getInventoryHeaderIds(); | ||
234 | + if (CollUtil.isEmpty(inventoryHeaderIds)) { | ||
235 | + return Result.error("库存id不能为空"); | ||
231 | } | 236 | } |
232 | - Result<?> result = handleMultiProcess("stockTakeTask", new HuahengBaseController.MultiProcessListener() { | 237 | + Integer cycleCountHeaderId = cycleCountDetailByInventoryDto.getCycleCountHeaderId(); |
238 | + if (ObjectUtil.isNull(cycleCountHeaderId)) { | ||
239 | + return Result.error("盘点单id不能为空"); | ||
240 | + } | ||
241 | + String cycleCountHeaderCode = cycleCountDetailByInventoryDto.getCycleCountHeaderCode(); | ||
242 | + if (StrUtil.isBlank(cycleCountHeaderCode)) { | ||
243 | + return Result.error("盘点单编码不能为空"); | ||
244 | + } | ||
245 | + Result<?> result = handleMultiProcess("createCycleCountDetailByInventory", new HuahengBaseController.MultiProcessListener() { | ||
246 | + | ||
233 | @Override | 247 | @Override |
234 | public Result<?> doProcess() { | 248 | public Result<?> doProcess() { |
235 | - return cycleCountDetailService.stockDetailAdd(ConvertUtils.toIntArray(ids), headerId, code); | 249 | + return cycleCountDetailService.stockDetailAdd(inventoryHeaderIds, cycleCountHeaderId, cycleCountHeaderCode); |
236 | } | 250 | } |
237 | }); | 251 | }); |
238 | return result; | 252 | return result; |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/dto/CycleCountDetailByInventoryDto.java
0 → 100644
1 | +package org.jeecg.modules.wms.stocktaking.cycleCountDetail.dto; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.List; | ||
5 | + | ||
6 | +import lombok.Data; | ||
7 | + | ||
8 | +/** | ||
9 | + * 根据库存新增盘点明细类 | ||
10 | + */ | ||
11 | +@Data | ||
12 | +public class CycleCountDetailByInventoryDto implements Serializable { | ||
13 | + | ||
14 | + private static final long serialVersionUID = 1L; | ||
15 | + | ||
16 | + /** | ||
17 | + * 库存头id | ||
18 | + */ | ||
19 | + private List<Integer> inventoryHeaderIds; | ||
20 | + | ||
21 | + /** | ||
22 | + * 盘点单id | ||
23 | + */ | ||
24 | + private Integer cycleCountHeaderId; | ||
25 | + | ||
26 | + /** | ||
27 | + * 盘点单编码 | ||
28 | + */ | ||
29 | + private String cycleCountHeaderCode; | ||
30 | +} | ||
0 | \ No newline at end of file | 31 | \ No newline at end of file |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
@@ -36,9 +36,9 @@ public interface ICycleCountDetailService extends IService<CycleCountDetail> { | @@ -36,9 +36,9 @@ public interface ICycleCountDetailService extends IService<CycleCountDetail> { | ||
36 | */ | 36 | */ |
37 | public void delBatchMain(Collection<? extends Serializable> idList); | 37 | public void delBatchMain(Collection<? extends Serializable> idList); |
38 | 38 | ||
39 | - Result stockDetailAdd(Integer[] taskIdList, Integer headerId, String code); | ||
40 | - | ||
41 | Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, String toPort, String warehouseCode); | 39 | Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, String toPort, String warehouseCode); |
42 | 40 | ||
43 | Result increaseInInventoryGain(CycleCountDetailChild cycleCountDetailChild); | 41 | Result increaseInInventoryGain(CycleCountDetailChild cycleCountDetailChild); |
42 | + | ||
43 | + Result stockDetailAdd(List<Integer> taskIdList, Integer headerId, String code); | ||
44 | } | 44 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
@@ -141,7 +141,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap | @@ -141,7 +141,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap | ||
141 | 141 | ||
142 | @Override | 142 | @Override |
143 | @Transactional | 143 | @Transactional |
144 | - public Result stockDetailAdd(Integer[] taskIdList, Integer headerId, String code) { | 144 | + public Result stockDetailAdd(List<Integer> taskIdList, Integer headerId, String code) { |
145 | for (Integer taskId : taskIdList) { | 145 | for (Integer taskId : taskIdList) { |
146 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | 146 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
147 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId, taskId); | 147 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId, taskId); |