From 181b0d38709904335fffbab9985698fe77b304a1 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sun, 15 Oct 2023 22:24:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=AE=8C=E6=88=90=E7=9B=98=E7=82=B9=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse/entity/QuestDetailEntity.java | 16 ++ .../api/WarehouseTaskApiController.java | 68 +++++++++ .../logpm/warehouse/dto/TaskSearchDTO.java | 8 + .../mapper/WarehouseUpdownGoodsMapper.xml | 9 +- .../warehouse/service/ITaskQuestService.java | 1 + .../service/impl/TaskQuestServiceImpl.java | 138 +++++++++++++++++- 6 files changed, 233 insertions(+), 7 deletions(-) diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java index f76dd69e3..c82495dd2 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java @@ -160,4 +160,20 @@ public class QuestDetailEntity extends TenantEntity { @ApiModelProperty(value = "上架后的完整库位") private String groundingPositionCode; + /** + * 物料编码 + */ + private String materialCode; + + /** + * 商场名称 + */ + private String marketName; + + /** + * 批次号 + */ + private String incomingBatch; + + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java index ebb17aa5b..f9bac997f 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java @@ -20,6 +20,7 @@ import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.web.bind.annotation.*; import java.util.*; @@ -389,6 +390,73 @@ public class WarehouseTaskApiController { } + @PostMapping("/saveNewQuestDetail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "保存新的盘点数据", notes = "code,type") + public R saveNewQuestDetail(@RequestBody TaskSearchDTO taskSearchDTO) { + String method = "###########saveNewQuestDetail: "; + log.info(method+"保存新的盘点数据 参数:{}",taskSearchDTO); + Long questId = taskSearchDTO.getQuestId();//盘点任务id + Integer questType = taskSearchDTO.getQuestType();//盘点方式 + Integer questTarget = taskSearchDTO.getQuestTarget();//盘点对象 + String trayCode = taskSearchDTO.getTrayCode();//托盘 + Long allocationId = taskSearchDTO.getAllocationId();//库位 + QuestDetailDTO questDetail = taskSearchDTO.getQuestDetail(); + + + try{ + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(403,"仓库信息为空"); + } + taskSearchDTO.setWarehouseId(myCurrentWarehouse.getId()); + + if(Objects.isNull(questId)){ + log.warn(method+"盘点任务id为空 questId={}",questId); + return R.fail(403,"盘点任务id为空"); + } + if(Objects.isNull(questType)){ + log.warn(method+"盘点方式为空 questType={}",questType); + return R.fail(403,"盘点方式为空"); + } + if(Objects.isNull(questTarget)){ + log.warn(method+"盘点对象为空 questTarget={}",questTarget); + return R.fail(403,"盘点对象为空"); + } + + if(questType == 2 && Objects.isNull(allocationId)){ + log.warn(method+"库位id为空 allocationId={}",allocationId); + return R.fail(403,"库位id为空"); + } + if(questType == 4 && StringUtil.isBlank(trayCode)){ + log.warn(method+"托盘码为空 trayCode={}",trayCode); + return R.fail(403,"托盘码为空"); + } + +// if(Objects.isNull(num) || num == 0){ +// log.warn(method+"数量不正确 num={}",num); +// return R.fail(403,"数量不正确"); +// } + + if(Objects.isNull(questDetail)){ + log.warn(method+"新增对象为空 questDetail={}",questDetail); + return R.fail(403,"新增对象为空"); + } + + taskQuestService.saveNewQuestDetail(taskSearchDTO); + return R.success("新增成功"); + }catch (CustomerException e){ + log.warn(e.message); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常,联系管理员",e); + return R.fail(500,"系统异常,联系管理员"); + } + } + + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java index f1218f7a2..3aab82a87 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java @@ -71,5 +71,13 @@ public class TaskSearchDTO { private List questDetailList = new ArrayList<>(); + private Integer questType;//盘点方式;1. 随机 2 库位3 订单 4 托盘 + + private Integer questTarget;//盘点对象;1.定制品 2零担 3 库存品 + + private Integer num;//数量 + + private QuestDetailDTO questDetail; + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml index ecacb2548..a1b5385c0 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsMapper.xml @@ -297,7 +297,7 @@ - select ldpl.order_code orderCode, ldpl.stock_article_id orderId, 2 questType, @@ -329,7 +329,7 @@ - select ldsa.order_code orderCode, ldsa.id orderId, 2 questType, @@ -358,7 +358,7 @@ - SELECT ldsl.order_code orderCode, ldsl.id stockId, @@ -371,6 +371,9 @@ lwta.tray_id trayId, lwt.tray_code trayCode, lwug.allocation_id allocationId, + ldsl.cargo_number materialCode, + ldsl.market_name marketName, + ldsl.incoming_batch incomingBatch, 0 isNew FROM logpm_warehouse_updown_goods lwug diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java index 082dcdb1e..0551905f8 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java @@ -95,4 +95,5 @@ public interface ITaskQuestService extends BaseService { * @return */ R trayListInfo(IPage page, TaskSearchDTO taskSearchDTO); + void saveNewQuestDetail(TaskSearchDTO taskSearchDTO); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index f8e85d337..28a367635 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -39,10 +39,7 @@ import com.logpm.warehouse.excel.TaskQuestExcel; import com.logpm.warehouse.mapper.TaskQuestMapper; import com.logpm.warehouse.mapper.WarehouseTrayGoodsMapper; import com.logpm.warehouse.mapper.WarehouseUpdownGoodsMapper; -import com.logpm.warehouse.service.IQuestDetailChildService; -import com.logpm.warehouse.service.IQuestDetailService; -import com.logpm.warehouse.service.ITaskQuestChildService; -import com.logpm.warehouse.service.ITaskQuestService; +import com.logpm.warehouse.service.*; import com.logpm.warehouse.vo.*; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; @@ -50,6 +47,7 @@ import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -91,6 +89,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl