From 9ae6c73104dde876d0dba401f3c10ac2e53b68ff Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 22 Mar 2024 23:44:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=202.=E8=80=81=E7=B3=BB=E7=BB=9F=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=89=93=E6=89=98=E6=95=B0=E6=8D=AE=E9=87=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/WarehouseAbnormalRecordEntity.java | 7 ++ .../feign/IWarehouseAbnormalRecordClient.java | 2 - .../mapper/TrunklineCarsLoadScanMapper.java | 2 + .../mapper/TrunklineCarsLoadScanMapper.xml | 9 ++ .../service/ICarsLoadAsyncService.java | 6 ++ .../ITrunklineCarsLoadScanService.java | 2 + .../impl/CarsLoadAsyncServiceImpl.java | 86 +++++++++++++++++++ .../TrunklineCarsLoadScanServiceImpl.java | 9 ++ .../impl/TrunklineCarsLoadServiceImpl.java | 38 +++++--- .../controller/OldSystemPushController.java | 15 +--- .../feign/WarehouseAbnormalRecordClient.java | 1 + .../service/impl/AsyncDataServiceImpl.java | 58 ++++++++++++- 12 files changed, 204 insertions(+), 31 deletions(-) diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseAbnormalRecordEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseAbnormalRecordEntity.java index e34428481..b5bc7ccbc 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseAbnormalRecordEntity.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseAbnormalRecordEntity.java @@ -87,4 +87,11 @@ public class WarehouseAbnormalRecordEntity extends TenantEntity { @ApiModelProperty(name = "备注",notes = "") private String remark; + @ApiModelProperty(name = "关联id",notes = "") + private Long associationId; + + @ApiModelProperty(name = "关联类型",notes = "") + private Integer associationType; + + } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseAbnormalRecordClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseAbnormalRecordClient.java index 4bd599bef..3fc3f05c6 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseAbnormalRecordClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseAbnormalRecordClient.java @@ -39,6 +39,4 @@ public interface IWarehouseAbnormalRecordClient { @PostMapping(API_PREFIX+"/addAbnormalRecord") void addAbnormalRecord(@RequestBody WarehouseAbnormalRecordEntity warehouseAbnormalRecordEntity); - - } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java index 77afddf19..e720c239d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java @@ -100,4 +100,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper findListByLoadIdOrderByCreateTimeAsc(@Param("loadId") Long loadId); IPage abnormalList(IPage page, @Param("loadCarsDTO") LoadCarsDTO loadCarsDTO); + + List abnormalListStartCarByLoadIdAndWarehouseId(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index f5857e744..d3a4d36c1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -469,4 +469,13 @@ and (ltcls.is_data = 0 or ltcls.loading_abnormal = 1 or ltcls.unload_abnormal = 1) + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java index 6ed538acf..f76c98808 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java @@ -11,4 +11,10 @@ public interface ICarsLoadAsyncService { void costShareByLoadId(Long loadId,TrunklineCarsLoadEntity carsLoadEntity); + void abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId,Long userId,Long deptId,String nickName,String tenantId,String warehouseName); + + void abnormalListUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String warehouseName, Long loadScanId, String tenantId, Long userId, String nickName, Long firstLong); + + void abnormalListUnloadCheckByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String nodeName, String tenantId, Long userId, String nickName, Long firstLong); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java index d883f0c61..b53aa6318 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java @@ -95,4 +95,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService findListByLoadIdOrderByCreateTimeAsc(Long loadId); IPage abnormalList(IPage page, LoadCarsDTO loadCarsDTO); + + List abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java index 89a444536..3bb9228b5 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java @@ -6,7 +6,9 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.feign.IDistributionStockArticleClient; import com.logpm.trunkline.entity.*; import com.logpm.trunkline.service.*; +import com.logpm.warehouse.entity.WarehouseAbnormalRecordEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity; +import com.logpm.warehouse.feign.IWarehouseAbnormalRecordClient; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; @@ -41,6 +43,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { private IDistributionStockArticleClient distributionStockArticleClient; @Autowired private IBasicdataWarehouseClient warehouseClient; + @Autowired + private IWarehouseAbnormalRecordClient abnormalRecordClient; @Async @Override @@ -318,4 +322,86 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService { } + @Async + @Override + public void abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId,Long userId,Long deptId,String nickName,String tenantId,String warehouseName) { + + //先查询 + List ls = trunklineCarsLoadScanService.abnormalListStartCarByLoadIdAndWarehouseId(loadId,warehouseId); + for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : ls) { + Integer isData = trunklineCarsLoadScanEntity.getIsData(); + if(isData == 1){ + String loadCode = trunklineCarsLoadScanEntity.getLoadCode(); + String waybillNo = trunklineCarsLoadScanEntity.getWaybillNo(); + String orderCode = trunklineCarsLoadScanEntity.getOrderCode(); + String scanCode = trunklineCarsLoadScanEntity.getScanCode(); + Long scanId = trunklineCarsLoadScanEntity.getId(); + //无装车计划 + WarehouseAbnormalRecordEntity abnormalRecordEntity = new WarehouseAbnormalRecordEntity(); + abnormalRecordEntity.setTenantId(tenantId); + abnormalRecordEntity.setCreateUser(userId); + abnormalRecordEntity.setUpdateUser(userId); + abnormalRecordEntity.setCreateDept(deptId); + abnormalRecordEntity.setType("2"); + abnormalRecordEntity.setAbnormalType("2"); + abnormalRecordEntity.setCarType("1"); + abnormalRecordEntity.setUpWarehouseId(warehouseId); + abnormalRecordEntity.setUpWarehouseName(warehouseName); + abnormalRecordEntity.setCarsNo(loadCode); + abnormalRecordEntity.setWaybillNo(waybillNo); + abnormalRecordEntity.setOrderCode(orderCode); + abnormalRecordEntity.setOrderPackageCode(scanCode); + abnormalRecordEntity.setUpUserId(userId); + abnormalRecordEntity.setUpUserName(nickName); + abnormalRecordEntity.setAbnormalStatus(0); + abnormalRecordEntity.setUpTime(new Date()); + abnormalRecordEntity.setAssociationId(scanId); + abnormalRecordEntity.setAssociationType(1); + abnormalRecordEntity.setRemark("无计划装车"); + abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity); + } + } + } + + @Async + @Override + public void abnormalListUnloadByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String warehouseName, Long loadScanId, String tenantId, Long userId, String nickName, Long deptId) { + TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(loadScanId); + if(!Objects.isNull(carsLoadScanEntity)){ + String loadCode = carsLoadScanEntity.getLoadCode(); + String waybillNo = carsLoadScanEntity.getWaybillNo(); + String orderCode = carsLoadScanEntity.getOrderCode(); + String scanCode = carsLoadScanEntity.getScanCode(); + //无装车记录 + WarehouseAbnormalRecordEntity abnormalRecordEntity = new WarehouseAbnormalRecordEntity(); + abnormalRecordEntity.setTenantId(tenantId); + abnormalRecordEntity.setCreateUser(userId); + abnormalRecordEntity.setUpdateUser(userId); + abnormalRecordEntity.setCreateDept(deptId); + abnormalRecordEntity.setType("1"); + abnormalRecordEntity.setAbnormalType("3"); + abnormalRecordEntity.setCarType("1"); + abnormalRecordEntity.setUpWarehouseId(warehouseId); + abnormalRecordEntity.setUpWarehouseName(warehouseName); + abnormalRecordEntity.setCarsNo(loadCode); + abnormalRecordEntity.setWaybillNo(waybillNo); + abnormalRecordEntity.setOrderCode(orderCode); + abnormalRecordEntity.setOrderPackageCode(scanCode); + abnormalRecordEntity.setUpUserId(userId); + abnormalRecordEntity.setUpUserName(nickName); + abnormalRecordEntity.setAbnormalStatus(0); + abnormalRecordEntity.setUpTime(new Date()); + abnormalRecordEntity.setAssociationId(loadScanId); + abnormalRecordEntity.setAssociationType(1); + abnormalRecordEntity.setRemark("无装车记录"); + abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity); + } + } + + @Async + @Override + public void abnormalListUnloadCheckByLoadIdAndWarehouseId(Long loadId, Long warehouseId, String nodeName, String tenantId, Long userId, String nickName, Long firstLong) { + + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java index ba03dcbdf..fbbb05ce1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java @@ -7,6 +7,7 @@ import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; import com.logpm.trunkline.mapper.TrunklineCarsLoadScanMapper; import com.logpm.trunkline.service.ITrunklineCarsLoadScanService; import com.logpm.trunkline.vo.*; +import com.logpm.warehouse.feign.IWarehouseAbnormalRecordClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; @@ -19,6 +20,9 @@ import java.util.Map; @Service @AllArgsConstructor public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl implements ITrunklineCarsLoadScanService { + + private final IWarehouseAbnormalRecordClient warehouseAbnormalRecordClient; + @Override public Integer findNumByLoadId(Long loadId) { return baseMapper.findNumByLoadId(loadId); @@ -232,4 +236,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId) { + return baseMapper.abnormalListStartCarByLoadIdAndWarehouseId(loadId,warehouseId); + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index bfe71038b..0f093456e 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -39,6 +39,7 @@ import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.cache.DictBizCache; import org.springblade.system.entity.DictBiz; @@ -84,7 +85,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl loadCarsPageList(LoadCarsDTO loadCarsDTO) { @@ -286,6 +286,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl