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 | 137 | export const execute = (params) => postAction('/task/taskHeader/execute', params); |
138 | 138 | //取消任务 |
139 | 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 | 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 | 25 | import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl; |
26 | 26 | import org.jeecg.modules.wms.framework.controller.HuahengBaseController; |
27 | 27 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
28 | +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.dto.CycleCountDetailByInventoryDto; | |
28 | 29 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; |
29 | 30 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; |
30 | 31 | import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService; |
... | ... | @@ -52,6 +53,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
52 | 53 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
53 | 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 | 59 | import io.swagger.annotations.Api; |
56 | 60 | import io.swagger.annotations.ApiOperation; |
57 | 61 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -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 | 247 | @Override |
234 | 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 | 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 | 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 | 36 | */ |
37 | 37 | public void delBatchMain(Collection<? extends Serializable> idList); |
38 | 38 | |
39 | - Result stockDetailAdd(Integer[] taskIdList, Integer headerId, String code); | |
40 | - | |
41 | 39 | Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, String toPort, String warehouseCode); |
42 | 40 | |
43 | 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 | 141 | |
142 | 142 | @Override |
143 | 143 | @Transactional |
144 | - public Result stockDetailAdd(Integer[] taskIdList, Integer headerId, String code) { | |
144 | + public Result stockDetailAdd(List<Integer> taskIdList, Integer headerId, String code) { | |
145 | 145 | for (Integer taskId : taskIdList) { |
146 | 146 | LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); |
147 | 147 | inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId, taskId); |
... | ... |