From d3c8470492ac43b2a95a3f16af4be34cb15e802a Mon Sep 17 00:00:00 2001 From: TanYibin <5491541@qq.com> Date: Tue, 10 Oct 2023 17:33:45 +0800 Subject: [PATCH] 盘点问题修正 --- ant-design-vue-jeecg/src/api/api.js | 4 ++++ huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java | 30 ++++++++++++++++++++++-------- huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/dto/CycleCountDetailByInventoryDto.java | 30 ++++++++++++++++++++++++++++++ huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java | 4 ++-- huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java | 2 +- 5 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/dto/CycleCountDetailByInventoryDto.java diff --git a/ant-design-vue-jeecg/src/api/api.js b/ant-design-vue-jeecg/src/api/api.js index 82c1aa8..97e159a 100644 --- a/ant-design-vue-jeecg/src/api/api.js +++ b/ant-design-vue-jeecg/src/api/api.js @@ -137,6 +137,10 @@ export const completeTaskByWMS = (params) => postAction('/task/taskHeader/comple export const execute = (params) => postAction('/task/taskHeader/execute', params); //取消任务 export const cancelTask = (params) => postAction('/task/taskHeader/cancelTask?ids=' + params, params); + +//盘点任务创建 +export const createCycleCountDetailByInventory = (params) => postAction('/cycleCountDetail/cycleCountDetail/createCycleCountDetailByInventory', params); + //切换任务 export const switchTask = (params) => postAction('/task/taskHeader/switchTask?ids=' + params, params); //自动配盘 diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java index 42b4764..05ccb4b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java +++ b/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; import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl; import org.jeecg.modules.wms.framework.controller.HuahengBaseController; import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; +import org.jeecg.modules.wms.stocktaking.cycleCountDetail.dto.CycleCountDetailByInventoryDto; import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail; import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetailChild; import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailChildService; @@ -52,6 +53,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -222,17 +226,27 @@ public class CycleCountDetailController extends HuahengBaseController { /** * 添加盘点 */ - @AutoLog(value = "盘点添加") - @ApiOperation(value = "盘点添加", notes = "盘点添加") - @PostMapping(value = "/stockTakeTask") - public Result<?> stockTakeTask(@RequestParam(name = "ids") String ids, @RequestParam(name = "headerId") int headerId, @RequestParam(name = "code") String code) { - if (StringUtils.isEmpty(ids)) { - return Result.error("taskId不能为空"); + @AutoLog(value = "盘点明细新增") + @ApiOperation(value = "盘点明细新增-根据选取的库存新增", notes = "盘点明细新增-根据选取的库存新增") + @PostMapping(value = "/createCycleCountDetailByInventory") + public Result<?> createCycleCountDetailByInventory(@RequestBody CycleCountDetailByInventoryDto cycleCountDetailByInventoryDto) { + List<Integer> inventoryHeaderIds = cycleCountDetailByInventoryDto.getInventoryHeaderIds(); + if (CollUtil.isEmpty(inventoryHeaderIds)) { + return Result.error("库存id不能为空"); } - Result<?> result = handleMultiProcess("stockTakeTask", new HuahengBaseController.MultiProcessListener() { + Integer cycleCountHeaderId = cycleCountDetailByInventoryDto.getCycleCountHeaderId(); + if (ObjectUtil.isNull(cycleCountHeaderId)) { + return Result.error("盘点单id不能为空"); + } + String cycleCountHeaderCode = cycleCountDetailByInventoryDto.getCycleCountHeaderCode(); + if (StrUtil.isBlank(cycleCountHeaderCode)) { + return Result.error("盘点单编码不能为空"); + } + Result<?> result = handleMultiProcess("createCycleCountDetailByInventory", new HuahengBaseController.MultiProcessListener() { + @Override public Result<?> doProcess() { - return cycleCountDetailService.stockDetailAdd(ConvertUtils.toIntArray(ids), headerId, code); + return cycleCountDetailService.stockDetailAdd(inventoryHeaderIds, cycleCountHeaderId, cycleCountHeaderCode); } }); return result; diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/dto/CycleCountDetailByInventoryDto.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/dto/CycleCountDetailByInventoryDto.java new file mode 100644 index 0000000..a7990f9 --- /dev/null +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/dto/CycleCountDetailByInventoryDto.java @@ -0,0 +1,30 @@ +package org.jeecg.modules.wms.stocktaking.cycleCountDetail.dto; + +import java.io.Serializable; +import java.util.List; + +import lombok.Data; + +/** + * 根据库存新增盘点明细类 + */ +@Data +public class CycleCountDetailByInventoryDto implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 库存头id + */ + private List<Integer> inventoryHeaderIds; + + /** + * 盘点单id + */ + private Integer cycleCountHeaderId; + + /** + * 盘点单编码 + */ + private String cycleCountHeaderCode; +} \ No newline at end of file diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java index 7065cb7..10c051e 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java +++ b/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> { */ public void delBatchMain(Collection<? extends Serializable> idList); - Result stockDetailAdd(Integer[] taskIdList, Integer headerId, String code); - Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, String toPort, String warehouseCode); Result increaseInInventoryGain(CycleCountDetailChild cycleCountDetailChild); + + Result stockDetailAdd(List<Integer> taskIdList, Integer headerId, String code); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java index 0991c89..7d83560 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java +++ b/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 @Override @Transactional - public Result stockDetailAdd(Integer[] taskIdList, Integer headerId, String code) { + public Result stockDetailAdd(List<Integer> taskIdList, Integer headerId, String code) { for (Integer taskId : taskIdList) { LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId, taskId); -- libgit2 0.22.2