From 3fd27876360bf5789ed516bbdecab0433a2e4917 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 8 Dec 2023 16:34:23 +0800 Subject: [PATCH 01/15] =?UTF-8?q?PDA=E4=BF=9D=E5=AD=98=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesAbnormalPackageEntity.java | 41 ++++ .../vo/AftersalesAbnormalPackageVO.java | 10 + .../logpm-distribution-api/pom.xml | 8 + .../IDistributionDeliveryListClient.java | 11 + blade-service/logpm-aftersales/pom.xml | 11 + .../AftersalesWorkOrderAppController.java | 41 +++- .../java/com/logpm/aftersales/bean/Res.java | 30 +++ .../java/com/logpm/aftersales/bean/Resp.java | 36 +++ .../dto/AftersalesPackageScanDTO.java | 46 ++++ .../dto/AftersalesWorkOrderDTO.java | 18 ++ .../service/IAftersalesWorkOrderService.java | 22 ++ .../impl/AftersalesWorkOrderServiceImpl.java | 53 ++++- .../feign/DistributionDeliveryListClient.java | 7 + .../mapper/DistributionDeliveryListMapper.xml | 4 +- .../IDistributionDeliveryListService.java | 16 ++ .../DistributionDeliveryListServiceImpl.java | 212 ++++++++++++++---- 16 files changed, 515 insertions(+), 51 deletions(-) create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Res.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Resp.java create mode 100644 blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesPackageScanDTO.java diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java index 115fc13ea..59ba0c25c 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalPackageEntity.java @@ -92,4 +92,45 @@ public class AftersalesAbnormalPackageEntity extends TenantEntity { @ApiModelProperty(value = "类型;窜货,少货") private String typesOf; + /** + * 运单号 + */ + @ApiModelProperty(value = "运单号") + private String waybillNumber; + + /** + * 运单ID + */ + @ApiModelProperty(value = "运单ID") + private Long waybillId; + + /** + * 订单自编码 + */ + @ApiModelProperty(value = "订单自编码") + private String orderCode; + + /** + * 订单ID + */ + @ApiModelProperty(value = "订单ID") + private Long orderId; + + /** + * 订单自编码 + */ + @ApiModelProperty(value = "订单自编码") + private Integer conditions; + + /** + * 物料编码(库存品) + */ + @ApiModelProperty(value = "物料编码(库存品)") + private String cargoNumber; + /** + * 入库批次号(库存品) + */ + @ApiModelProperty(value = "入库批次号(库存品)") + private String incomingBatch; + } diff --git a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesAbnormalPackageVO.java b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesAbnormalPackageVO.java index c53b6dacf..3d4fc6db7 100644 --- a/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesAbnormalPackageVO.java +++ b/blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/vo/AftersalesAbnormalPackageVO.java @@ -32,4 +32,14 @@ import lombok.EqualsAndHashCode; public class AftersalesAbnormalPackageVO extends AftersalesAbnormalPackageEntity { private static final long serialVersionUID = 1L; + private Integer maxQuantity; + + + private Integer isAbnormalLoading; + + + private Integer isAbnormalSinging; + + + } diff --git a/blade-service-api/logpm-distribution-api/pom.xml b/blade-service-api/logpm-distribution-api/pom.xml index a217852eb..86ba95620 100644 --- a/blade-service-api/logpm-distribution-api/pom.xml +++ b/blade-service-api/logpm-distribution-api/pom.xml @@ -13,6 +13,14 @@ org.springblade logpm-distribution-api 3.2.0.RELEASE + + + org.springblade + logpm-aftersales-api + 3.2.0.RELEASE + compile + + diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java index 786cd9dde..9c911fe4e 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.feign; +import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity; import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.logpm.distribution.vo.DistributionDeliveryListVO; @@ -100,6 +101,16 @@ public interface IDistributionDeliveryListClient { @GetMapping(TOP+"/getRetentionDelivery") DistributionDeliveryListVO getRetentionDelivery(@RequestParam("deliveryId")Long deliveryId); + /** + * 查询配送任务下的包件信息 + * @param deliveryId + * @param scanBarCode + * @return + */ + @GetMapping(TOP+"/aftersalesPackageScan") + List aftersalesPackageScan(@RequestParam("deliveryId")Long deliveryId,@RequestParam("scanBarCode")String scanBarCode); + + // /** // * 根据配送任务ID查询配送司机信息 diff --git a/blade-service/logpm-aftersales/pom.xml b/blade-service/logpm-aftersales/pom.xml index 9a3ffa1da..5fa0bb176 100644 --- a/blade-service/logpm-aftersales/pom.xml +++ b/blade-service/logpm-aftersales/pom.xml @@ -62,6 +62,17 @@ 3.2.0.RELEASE compile + + org.springblade + logpm-distribution-api + ${bladex.project.version} + compile + + + org.springblade + blade-biz-common + ${bladex.project.version} + diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java index ab712a86c..bbee62746 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/apicontroller/AftersalesWorkOrderAppController.java @@ -1,15 +1,18 @@ package com.logpm.aftersales.apicontroller; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.aftersales.dto.AftersalesPackageScanDTO; import com.logpm.aftersales.dto.AftersalesWorkOrderDTO; import com.logpm.aftersales.service.IAftersalesWorkOrderService; +import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.apache.xmlbeans.impl.xb.xsdschema.Public; import org.springblade.core.tool.api.R; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; @RestController @AllArgsConstructor @@ -18,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; public class AftersalesWorkOrderAppController { private final IAftersalesWorkOrderService aftersalesWorkOrderService; + @PostMapping("/addWorkOrder") public R addWorkOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){ aftersalesWorkOrderDTO.setInitiationIdentification("PDA"); @@ -25,4 +29,33 @@ public class AftersalesWorkOrderAppController { } + @PostMapping("/aftersalesPackageScan") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "工单包件扫描", notes = "传入aftersalesAppeal") + public R> aftersalesPackageScan(@RequestBody AftersalesPackageScanDTO aftersalesPackageScanDTO){ + return R.data(aftersalesWorkOrderService.aftersalesPackageScan(aftersalesPackageScanDTO)); + } + + + @PostMapping("/saveAfterSalesOrder") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "PDA保存异常工单", notes = "传入aftersalesAppeal") + public R saveAfterSalesOrder(@RequestBody AftersalesWorkOrderDTO aftersalesWorkOrderDTO){ + return aftersalesWorkOrderService.saveAfterSalesOrder(aftersalesWorkOrderDTO); + } + + + + + + + + + + + + + + + } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Res.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Res.java new file mode 100644 index 000000000..c8a4ced81 --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Res.java @@ -0,0 +1,30 @@ +package com.logpm.aftersales.bean; + +import lombok.Data; +import org.springblade.core.tool.api.R; + +@Data +public class Res extends R { + + private String audio; + + private Object obj; + + public static Res scanSuccess(String msg, String audio,Object obj){ + Res resp = new Res(); + resp.setCode(200); + resp.setMsg(msg); + resp.setAudio(audio); + resp.setObj(obj); + return resp; + } + +// public static Res scanFail(String msg, String audio){ +// Res resp = new Res(); +// resp.setCode(3001); +// resp.setMsg(msg); +// resp.setAudio(audio); +// return resp; +// } + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Resp.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Resp.java new file mode 100644 index 000000000..8d58552e4 --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/bean/Resp.java @@ -0,0 +1,36 @@ +package com.logpm.aftersales.bean; + +import lombok.Data; +import org.springblade.core.tool.api.R; + +@Data +public class Resp extends R { + + private String audio; + + public static Resp scanSuccess(String msg,String audio){ + Resp resp = new Resp(); + resp.setCode(200); + resp.setMsg(msg); + resp.setAudio(audio); + return resp; + } + + public static Resp scanFail(String msg,String audio){ + Resp resp = new Resp(); + resp.setCode(3001); + resp.setMsg(msg); + resp.setAudio(audio); + return resp; + } + + public static Resp scanFail(int code,String msg,String audio,Object data){ + Resp resp = new Resp(); + resp.setCode(code); + resp.setMsg(msg); + resp.setData(data); + resp.setAudio(audio); + return resp; + } + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesPackageScanDTO.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesPackageScanDTO.java new file mode 100644 index 000000000..d669a2c4a --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesPackageScanDTO.java @@ -0,0 +1,46 @@ +package com.logpm.aftersales.dto; + + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 配送装车签收发起工单包件扫描DTO + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class AftersalesPackageScanDTO { + + /** + * 配送任务ID + */ + private Long deliveryId; + + /** + * 预约客户ID + */ + private Long reservationId; + +// /** +// * 司机名称 +// */ +// private String driverName; +// +// /** +// * 车牌号 +// */ +// private String vehicleNub; +// +// /** +// * 配送任务ID +// */ +// private String vehicleNub; + + + /** + * 扫描码值 + */ + private String scanBarCode; + + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java index 8e11918dc..7946ded35 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java @@ -17,6 +17,7 @@ package com.logpm.aftersales.dto; import com.logpm.aftersales.entity.*; +import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import lombok.Data; import lombok.EqualsAndHashCode; @@ -74,4 +75,21 @@ public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity { + /** + * 工单指派 ID + */ + private List packageList; + + /** + * 配送任务Id + */ + private Long deliveryId; + + + + + + + + } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java index ed85367ea..786045669 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java @@ -16,8 +16,10 @@ */ package com.logpm.aftersales.service; +import com.logpm.aftersales.dto.AftersalesPackageScanDTO; import com.logpm.aftersales.dto.AftersalesWorkOrderDTO; import com.logpm.aftersales.entity.AftersalesWorkOrderEntity; +import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import com.logpm.aftersales.vo.AftersalesWorkOrderVO; import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -131,6 +133,26 @@ public interface IAftersalesWorkOrderService extends BaseService data, Boolean isCovered); + /** + * PDA扫描工单关联包件 + * @param aftersalesPackageScanDTO + * @return + */ + List aftersalesPackageScan(AftersalesPackageScanDTO aftersalesPackageScanDTO); + + /** + * PDA工单签收包件扫描 + * @param aftersalesPackageScanDTO + * @return + */ + + /** + * PDA保存异常工单 + * @param aftersalesWorkOrderDTO + * @return + */ + R saveAfterSalesOrder(AftersalesWorkOrderDTO aftersalesWorkOrderDTO); + /** * 查询客服信息 * @return diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index 1d7b8e383..e0388a562 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -22,6 +22,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.aftersales.bean.Resp; +import com.logpm.aftersales.dto.AftersalesPackageScanDTO; +import com.logpm.aftersales.dto.AftersalesProcessingResultsDTO; import com.logpm.aftersales.dto.AftersalesWorkOrderDTO; import com.logpm.aftersales.entity.*; import com.logpm.aftersales.service.*; @@ -30,6 +33,8 @@ import com.logpm.aftersales.excel.AftersalesWorkOrderExcel; import com.logpm.aftersales.mapper.AftersalesWorkOrderMapper; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import com.logpm.distribution.feign.IDistributionDeliveryListClient; +import com.logpm.distribution.vo.DistributionDeliveryListVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; @@ -41,6 +46,7 @@ import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; import org.springblade.system.cache.DictBizCache; import org.springblade.system.entity.DictBiz; import org.springblade.system.entity.User; @@ -84,6 +90,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl aftersalesPackageScan(AftersalesPackageScanDTO aftersalesPackageScanDTO) { + List abnormalPackageVO = distributionDeliveryListClient.aftersalesPackageScan(aftersalesPackageScanDTO.getDeliveryId(),aftersalesPackageScanDTO.getScanBarCode()); + if (Func.isEmpty(abnormalPackageVO)){ + //查询此配送送任务下无此包件信息 + + } + return abnormalPackageVO; + } + + + @Override + @Transactional + public R saveAfterSalesOrder(AftersalesWorkOrderDTO aftersalesWorkOrderDTO) { + DistributionDeliveryListVO deliveryDriverInfo = distributionDeliveryListClient.getDeliveryDriverInfo(aftersalesWorkOrderDTO.getDeliveryId()); + if (Func.isEmpty(deliveryDriverInfo)){ + log.info("#############查询配送任务错误,ID:{}",aftersalesWorkOrderDTO.getDeliveryId()); + return Resp.scanFail("配送任务有误","配送任务有误"); + } + AftersalesWorkOrderDTO saveAftersalesWorkOrderDTO = new AftersalesWorkOrderDTO(); + List packageList = aftersalesWorkOrderDTO.getPackageList(); + if (Func.isEmpty(packageList)){ + return Resp.scanFail("请扫描包件信息","请扫描包件信息"); + } + List aftersalesAbnormalPackageEntities = new ArrayList<>(); + for (AftersalesAbnormalPackageVO abnormalPackageVO : packageList) { + AftersalesAbnormalPackageEntity aftersalesAbnormalPackageEntity = Func.copy(abnormalPackageVO, AftersalesAbnormalPackageEntity.class); + aftersalesAbnormalPackageEntities.add(aftersalesAbnormalPackageEntity); + } + //工单关联包件信息 + saveAftersalesWorkOrderDTO.setPackageEntityList(aftersalesAbnormalPackageEntities); + //保存工单所需责任人 + saveAftersalesWorkOrderDTO.setProcessorEntityList(aftersalesWorkOrderDTO.getProcessorEntityList()); + //工单图片 + saveAftersalesWorkOrderDTO.setDecreaseImageEntityList(aftersalesWorkOrderDTO.getDecreaseImageEntityList()); + //设置工单提交标识 + saveAftersalesWorkOrderDTO.setInitiationIdentification("PDA"); + //保存工单 + boolean b = saveOrUpdateOwn(saveAftersalesWorkOrderDTO); + + return Resp.scanSuccess("提交成功","提交成功"); + } + /** * 查询客服信息 * @return diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java index 8786de4fd..78f897f10 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java @@ -17,6 +17,7 @@ package com.logpm.distribution.feign; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import com.logpm.distribution.entity.DistributionDeliveryListEntity; import com.logpm.distribution.service.IDistributionDeliveryListService; import com.logpm.distribution.vo.DistributionDeliveryListVO; @@ -82,5 +83,11 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList return distributionDeliveryListService.getRetentionDelivery(deliveryId); } + @Override + public List aftersalesPackageScan(Long deliveryId, String scanBarCode) { + + return distributionDeliveryListService.aftersalesPackageScan(deliveryId,scanBarCode); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 83174df74..0563fd8eb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1579,12 +1579,14 @@ @@ -66,6 +67,7 @@ where ltco.load_id = #{loadId} and ltco.final_node_id = #{warehouseId} and ltcls.tray_code = #{trayCode} + and ltcls.scan_status = '1' + + + + delete from logpm_trunkline_cars_load_scan + where id = #{carsLoadScanId} + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.java new file mode 100644 index 000000000..6b24a49aa --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.java @@ -0,0 +1,12 @@ +package com.logpm.trunkline.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.trunkline.entity.TrunklineCarsLoadingLogEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface TrunklineCarsLoadingLogMapper extends BaseMapper { + + + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml new file mode 100644 index 000000000..00715c3a6 --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java index 4be62d33b..4e5e4ddf3 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java @@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.entity.TrunklineCarsOrderEntity; -import com.logpm.trunkline.vo.CarsLoadAllOrderVO; -import com.logpm.trunkline.vo.LoadZeroListVO; -import com.logpm.trunkline.vo.NodeNumDataVO; -import com.logpm.trunkline.vo.UnloadZeroVO; +import com.logpm.trunkline.vo.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -25,4 +22,7 @@ public interface TrunklineCarsOrderMapper extends BaseMapper findUnloadZeroList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); + List findLoadScanPackageWithOrder(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); + + void deleteByCarsOrderId(@Param("carsOrderId") Long carsOrderId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml index d4ef6aaa2..eae6331d7 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml @@ -49,7 +49,8 @@ + + + + delete from logpm_trunkline_cars_order + where id = #{carsOrderId} + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.java similarity index 75% rename from blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java rename to blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.java index c44cb0b7e..deaac99c8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.java @@ -1,12 +1,15 @@ package com.logpm.trunkline.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.logpm.trunkline.entity.TrunklineCarsUnloadScanEntity; +import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity; +import com.logpm.trunkline.vo.UnloadScanOrderVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + @Mapper -public interface TrunklineCarsUnloadScanMapper extends BaseMapper { +public interface TrunklineCarsUnloadLogMapper extends BaseMapper { Integer findNumByLoadId(@Param("loadId") Long loadId); Integer findAbnormalNumByLoadId(@Param("loadId") Long loadId); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml similarity index 91% rename from blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.xml rename to blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml index bf9bae47b..c0504682b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml @@ -1,6 +1,6 @@ - + + + + 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 2a87b61d2..70a4d128c 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 @@ -4,10 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.dto.ProductInfoDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; +import com.logpm.trunkline.vo.OrderScanDetailVO; import com.logpm.trunkline.vo.ProductUnloadInfoVO; +import com.logpm.trunkline.vo.UnloadPackageVO; +import com.logpm.trunkline.vo.UnloadScanOrderVO; import org.springblade.core.mp.base.BaseService; import java.util.List; +import java.util.Map; public interface ITrunklineCarsLoadScanService extends BaseService { Integer findNumByLoadId(Long loadId); @@ -30,4 +34,21 @@ public interface ITrunklineCarsLoadScanService extends BaseService findProductInfoList(Long loadId, String trayCode, String waybillNo); IPage loadingDetail(IPage page, LoadCarsDTO loadCarsDTO); + + List findCarsLoadingOrderDetail(Long loadId, String orderCode, Long warehouseId); + + boolean deleteEntityByCarsLoadScanId(Long carsLoadScanId); + + TrunklineCarsLoadScanEntity findEntityByParam(Map param); + + List findPackageWithOrderList(Long loadId, Long warehouseId); + + List findUnloadPackageList(Long loadId, Long warehouseId, String waybillNo, String orderCode); + + Integer findUnloadNumByLoadId(Long loadId); + + Integer findUnloadNumByLoadIdAndNodeId(Long loadId, Long nodeId); + + Integer findUnloadNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java index 1fb6b5c62..41013980a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java @@ -2,7 +2,6 @@ package com.logpm.trunkline.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.LoadCarsDTO; -import com.logpm.trunkline.dto.ProductInfoDTO; import com.logpm.trunkline.dto.TrunklineCarsLoadDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; import com.logpm.trunkline.vo.TripartiteTransferVO; @@ -12,7 +11,6 @@ import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; import java.math.BigDecimal; -import java.util.List; public interface ITrunklineCarsLoadService extends BaseService { @@ -66,7 +64,7 @@ public interface ITrunklineCarsLoadService extends BaseService productInfoList); + R loadingZero(Long loadId, Long warehouseId, String waybillNo,String orderCode, String trayCode, Integer enterNum,String remark); R findZeroAllocation(String orderCode, Long warehouseId); @@ -92,11 +90,11 @@ public interface ITrunklineCarsLoadService extends BaseService productInfoList, Long warehouseId,Integer unbindTray); + R unloadZero(Long loadId, String waybillNo,Integer enterNum, Long warehouseId,Integer unbindTray,String trayCode,String orderCode,String remark); - R findLoadScanWaybillDetailList(Long loadId, String waybillNo, Long warehouseId); + R findLoadScanWaybillDetailList(Long loadId, String orderCode, Long warehouseId); R unloadCarsDetail(Long loadId, Long warehouseId); @@ -113,4 +111,6 @@ public interface ITrunklineCarsLoadService extends BaseService { + + void savaLoadingLog(Long warehouseId,String warehouseName,Long loadId,String loadCode,Long waybillId,String waybillNo,String orderCode,String scanCode,Integer num,Integer type,Integer isData,Integer isAbnormal,Long trayId,String trayCode,String trayName,Long fromWarehouseId,Long loadScanId,String remark); + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java index ce4ec9fcb..dc71a1ab8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java @@ -3,10 +3,7 @@ package com.logpm.trunkline.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.entity.TrunklineCarsOrderEntity; -import com.logpm.trunkline.vo.CarsLoadAllOrderVO; -import com.logpm.trunkline.vo.LoadZeroListVO; -import com.logpm.trunkline.vo.NodeNumDataVO; -import com.logpm.trunkline.vo.UnloadZeroVO; +import com.logpm.trunkline.vo.*; import org.springblade.core.mp.base.BaseService; import java.util.List; @@ -23,4 +20,6 @@ public interface ITrunklineCarsOrderService extends BaseService findZeroList(Long loadId, Long warehouseId); List findUnloadZeroList(Long loadId, Long warehouseId); + + List findLoadScanPackageWithOrder(Long loadId, Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadLogService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadLogService.java new file mode 100644 index 000000000..1b66ee6be --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadLogService.java @@ -0,0 +1,24 @@ +package com.logpm.trunkline.service; + +import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity; +import com.logpm.trunkline.vo.UnloadScanOrderVO; +import org.springblade.core.mp.base.BaseService; + +import java.util.List; + +public interface ITrunklineCarsUnloadLogService extends BaseService { + Integer findNumByLoadId(Long loadId); + + Integer findAbnormalNumByLoadId(Long loadId); + + Integer findNumByLoadIdAndNodeId(Long loadId, Long nodeId); + + Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId); + + Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo); + + + + void savaUnloadLog(Long warehouseId,String warehouseName,Long loadId,String loadCode,Long waybillId,String waybillNo,String orderCode,String scanCode,Integer num,Integer type,Integer isData,Integer isAbnormal,Long trayId,String trayCode,String trayName,Long fromWarehouseId,Long loadScanId,String remark); + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java deleted file mode 100644 index 30ef2dd56..000000000 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.logpm.trunkline.service; - -import com.logpm.trunkline.entity.TrunklineCarsUnloadScanEntity; -import org.springblade.core.mp.base.BaseService; - -public interface ITrunklineCarsUnloadScanService extends BaseService { - Integer findNumByLoadId(Long loadId); - - Integer findAbnormalNumByLoadId(Long loadId); - - Integer findNumByLoadIdAndNodeId(Long loadId, Long nodeId); - - Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId); - - Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo); -} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 65823bc43..09e78b07f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -538,6 +538,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setAgentId(AuthUtil.getUserId()); Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity); + waybillEntity.setId(waybillId); if(!Objects.isNull(waybillId)){ log.info("#################openZeroWaybill: 运单保存成功"); //保存运单货物明细 @@ -545,6 +546,13 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List details = new ArrayList<>(); for (WaybillDetailDTO waybillDetailDTO:waybillDetailList){ WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail(); + warehouseWayBillDetail.setCreateUser(AuthUtil.getUserId()); + warehouseWayBillDetail.setUpdateUser(AuthUtil.getUserId()); + Date date = new Date(); + warehouseWayBillDetail.setCreateTime(date); + warehouseWayBillDetail.setUpdateTime(date); + warehouseWayBillDetail.setStatus(1); + warehouseWayBillDetail.setIsDeleted(0); warehouseWayBillDetail.setWaybillId(waybillId); warehouseWayBillDetail.setWaybillNo(waybillEntity.getWaybillNo()); Long goodsId = waybillDetailDTO.getGoodsId(); 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 bd669514f..dabdf8f4e 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 @@ -6,13 +6,17 @@ import com.logpm.trunkline.dto.ProductInfoDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; import com.logpm.trunkline.mapper.TrunklineCarsLoadScanMapper; import com.logpm.trunkline.service.ITrunklineCarsLoadScanService; +import com.logpm.trunkline.vo.OrderScanDetailVO; import com.logpm.trunkline.vo.ProductUnloadInfoVO; +import com.logpm.trunkline.vo.UnloadPackageVO; +import com.logpm.trunkline.vo.UnloadScanOrderVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; @Slf4j @Service @@ -67,4 +71,45 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl loadingDetail(IPage page, LoadCarsDTO loadCarsDTO) { return baseMapper.loadingDetail(page,loadCarsDTO); } + + @Override + public List findCarsLoadingOrderDetail(Long loadId, String orderCode, Long warehouseId) { + return baseMapper.findCarsLoadingOrderDetail(loadId,orderCode,warehouseId); + } + + @Override + public boolean deleteEntityByCarsLoadScanId(Long carsLoadScanId) { + return baseMapper.deleteEntityByCarsLoadScanId(carsLoadScanId); + } + + @Override + public TrunklineCarsLoadScanEntity findEntityByParam(Map param) { + return baseMapper.findEntityByParam(param); + } + + @Override + public List findPackageWithOrderList(Long loadId, Long warehouseId) { + return baseMapper.findPackageWithOrderList(loadId,warehouseId); + } + + @Override + public List findUnloadPackageList(Long loadId, Long warehouseId, String waybillNo, String orderCode) { + return baseMapper.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode); + } + + @Override + public Integer findUnloadNumByLoadId(Long loadId) { + return baseMapper.findUnloadNumByLoadId(loadId); + } + + @Override + public Integer findUnloadNumByLoadIdAndNodeId(Long loadId, Long nodeId) { + return baseMapper.findUnloadNumByLoadIdAndNodeId(loadId,nodeId); + } + + @Override + public Integer findUnloadNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo) { + return baseMapper.findUnloadNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo); + } + } 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 e2851be1e..411382555 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 @@ -1,11 +1,13 @@ package com.logpm.trunkline.service.impl; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.basicdata.entity.BasicdataTrayEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataCodeClient; import com.logpm.basicdata.feign.IBasicdataTrayClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.entity.DistributionParcelListEntity; @@ -23,6 +25,8 @@ import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringEscapeUtils; +import org.springblade.common.constant.CodeNumConstant; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant; import org.springblade.common.exception.CustomerException; @@ -56,9 +60,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl loadCarsPageList(LoadCarsDTO loadCarsDTO) { @@ -91,7 +97,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("id_deleted",0) + queryWrapper.eq("is_deleted",0) .eq("load_id",loadId); List list = trunklineCarsLoadLineService.list(queryWrapper); trunklineCarsLoadVO.setCarsLoadLineList(list); @@ -673,9 +679,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadLineList = carsLoadDTO.getCarsLoadLineList(); for (TrunklineCarsLoadLineDTO carsLoadLineDTO:carsLoadLineList){ TrunklineCarsLoadLineEntity carsLoadLineEntity = new TrunklineCarsLoadLineEntity(); + Integer sort = carsLoadLineDTO.getSort(); BeanUtil.copy(carsLoadLineDTO,carsLoadLineEntity); carsLoadLineEntity.setLoadId(loadId); carsLoadLineEntity.setNodeStatus("0"); + if(sort == 1){ + carsLoadLineEntity.setNodeStatus("10"); + } carsLoadLineEntity.setSignStatus("0"); carsLoadLineEntity.setUnloadStatus("0"); carsLoadLineEntity.setLoadingStatus("0"); @@ -767,24 +789,24 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadLineList = trunklineCarsLoadLineService.findListByLoadId(loadId); for (TrunklineCarsLoadLineEntity carsLoadLineEntity:carsLoadLineList){ Long nodeId = carsLoadLineEntity.getNodeId(); Integer lineLoadingNum = trunklineCarsLoadScanService.findNumByLoadIdAndNodeId(loadId,nodeId);//节点实际装车数量 - Integer lineUnloadingNum = trunklineCarsUnloadScanService.findNumByLoadIdAndNodeId(loadId,nodeId);//节点实际卸车数量 - Integer lineLoadingAbnormalNum = trunklineCarsLoadScanService.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId);//节点实际装车异常数量 - Integer lineUnloadingAbnormalNum = trunklineCarsUnloadScanService.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId);//节点实际卸车异常数量 + Integer lineUnloadingNum = trunklineCarsLoadScanService.findUnloadNumByLoadIdAndNodeId(loadId,nodeId);//节点实际卸车数量 + Integer lineAbnormalNum = trunklineCarsLoadScanService.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId);//节点实际装车异常数量 +// Integer lineUnloadingAbnormalNum = trunklineCarsUnloadLogService.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId);//节点实际卸车异常数量 carsLoadLineEntity.setRealLoadingNumber(lineLoadingNum); carsLoadLineEntity.setUnloadNumber(lineUnloadingNum); - carsLoadLineEntity.setAbnormalNum(lineLoadingAbnormalNum+lineUnloadingAbnormalNum); + carsLoadLineEntity.setAbnormalNum(lineAbnormalNum); trunklineCarsLoadLineService.updateById(carsLoadLineEntity); //查询订单上 @@ -793,9 +815,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("order_code",orderCode) @@ -1456,30 +1519,40 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl planNum){ - carsLoadScanEntity.setIsAbnormal(1); + carsLoadScanEntity.setLoadingAbnormal(1); + isAbnormal = 1; + remark = "有数据,在本仓,在配载计划中,大于计划数量,异常装车"; }else{ - carsLoadScanEntity.setIsAbnormal(0); + carsLoadScanEntity.setLoadingAbnormal(0); + isAbnormal = 0; + remark = "正常装车"; } + carsLoadScanEntity.setFinalNodeId(carsOrderEntity.getFinalNodeId()); } - distributionParcelListClient.update(parcelListEntity); - distributionStockArticleClient.saveOrUpdate(stockArticleEntity); + distributionParcelListClient.updateOrderPackageCodeById(packageId,"60"); + distributionStockArticleClient.submitHandleNumByOrderId(1,articleId); + updownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId); } trunklineCarsLoadScanService.save(carsLoadScanEntity); - + loadScanId = carsLoadScanEntity.getId(); + trunklineCarsLoadingLogService.savaLoadingLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode,orderPackageCode,1, + 1,isData,isAbnormal,trayId,trayCode,trayName,fromWarehouseId,loadScanId,remark); updateNumByLoadId(loadId); return R.success("装车成功"); } @Override - public R loadingZero(Long loadId,Long warehouseId,String waybillNo,String trayCode,List productInfoList) { + public R loadingZero(Long loadId,Long warehouseId,String waybillNo,String orderCode,String trayCode, Integer enterNum,String remark) { TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); if(Objects.isNull(carsLoadEntity)){ @@ -1514,101 +1587,114 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("load_id",loadId) .eq("node_id",warehouseId) .eq("waybill_no",waybillNo) - .eq("order_code",waybillNo); + .eq("order_code",orderCode); TrunklineCarsOrderEntity carsOrderEntity = trunklineCarsOrderService.getOne(queryWrapper); if(Objects.isNull(carsOrderEntity)){ - log.warn("##################loadingZero: 运单不在计划当中 waybillNo={}",waybillNo); - return R.fail(405,"运单不在计划当中"); - } - - Integer planNum = carsOrderEntity.getPlanNum();//计划件数 - Integer totalNum = 0; - for (ProductInfoDTO productInfoDTO:productInfoList){ - totalNum = totalNum + productInfoDTO.getEnterNum(); - } - - if(totalNum > planNum){ - log.warn("##################loadingZero: 装车件数不能大于计划件数 waybillNo={} planNum={} totalNum={}",waybillNo,planNum,totalNum); - return R.fail(405,"装车件数不能大于计划件数"); - } - - //查询到对应的品类包件 - List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(waybillNo, warehouseId); - - for (ProductInfoDTO productInfoDTO:productInfoList){ - String productName = productInfoDTO.getProductName(); - Integer enterNum = productInfoDTO.getEnterNum(); - //先查看有没有已有的数据 - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("load_id",loadId) - .eq("warehouse_id",warehouseId) - .eq("waybill_no",waybillNo) - .eq("type",2) - .eq("scan_code",productName); - TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getOne(qw); - if(Objects.isNull(carsLoadScanEntity)){ - carsLoadScanEntity = new TrunklineCarsLoadScanEntity(); - carsLoadScanEntity.setWarehouseId(warehouseId); - carsLoadScanEntity.setWarehouseName(basicdataWarehouseEntity.getName()); - carsLoadScanEntity.setLoadId(loadId); - carsLoadScanEntity.setLoadCode(carsLoadEntity.getCarsNo()); - carsLoadScanEntity.setWaybillId(waybillEntity.getId()); - carsLoadScanEntity.setWaybillNo(waybillEntity.getWaybillNo()); - carsLoadScanEntity.setOrderCode(waybillNo); - carsLoadScanEntity.setScanCode(productInfoDTO.getProductName()); - carsLoadScanEntity.setScanStatus("1"); - carsLoadScanEntity.setNum(productInfoDTO.getEnterNum()); - carsLoadScanEntity.setIsAbnormal(isAbnormal); - carsLoadScanEntity.setType(2); - carsLoadScanEntity.setTrayId(trayId); - carsLoadScanEntity.setTrayName(trayName); - carsLoadScanEntity.setTrayCode(trayCode); - for (DistributionParcelListEntity parcelListEntity:parcelListEntityList){ - String firsts = parcelListEntity.getFirsts(); - if(firsts.equals(productInfoDTO.getProductName())){ - parcelListEntity.setQuantity(parcelListEntity.getQuantity()-productInfoDTO.getEnterNum()); - distributionParcelListClient.update(parcelListEntity); - } - stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity()-productInfoDTO.getEnterNum()); - distributionStockArticleClient.saveOrUpdate(stockArticleEntity); + isAbnormal = 1; + remark = "有数据,无计划,异常装车"; + }else{ + planNum = carsOrderEntity.getPlanNum();//计划件数 + } + + Integer useNum = trunklineCarsLoadScanService.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId, warehouseId, orderCode, waybillNo); + Map param = new HashMap<>(); + param.put("loadId",loadId); + param.put("warehouseId",warehouseId); + param.put("waybillNo",waybillNo); + param.put("type",2); + param.put("goodsName",goodsName); + param.put("trayCode",trayCode); + TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.findEntityByParam(param); + if(Objects.isNull(carsLoadScanEntity)){ + + if(enterNum+useNum >handQuantity){ + log.warn("##################loadingZero: 不能大于在库件数 handQuantity={} real={}",handQuantity,enterNum+useNum); + return R.fail(405,"不能大于在库件数"); + } + + if(!Objects.isNull(planNum)){ + if(enterNum+useNum > planNum){ + isAbnormal = 1; + remark = "有数据,有计划,大于计划件数,异常装车"; } - trunklineCarsLoadScanService.save(carsLoadScanEntity); - }else{ - Integer num = carsLoadScanEntity.getNum(); - Integer difficultNum = enterNum - num; - for (DistributionParcelListEntity parcelListEntity:parcelListEntityList){ - String firsts = parcelListEntity.getFirsts(); - if(firsts.equals(productInfoDTO.getProductName())){ - parcelListEntity.setQuantity(parcelListEntity.getQuantity()-difficultNum); - distributionParcelListClient.update(parcelListEntity); - } - stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity()-difficultNum); - distributionStockArticleClient.saveOrUpdate(stockArticleEntity); + } + + carsLoadScanEntity = new TrunklineCarsLoadScanEntity(); + carsLoadScanEntity.setWarehouseId(warehouseId); + carsLoadScanEntity.setWarehouseName(warehouseName); + carsLoadScanEntity.setLoadId(loadId); + carsLoadScanEntity.setLoadCode(loadCode); + carsLoadScanEntity.setWaybillId(waybillId); + carsLoadScanEntity.setWaybillNo(waybillNo); + carsLoadScanEntity.setOrderCode(orderCode); + carsLoadScanEntity.setScanCode(goodsName); + carsLoadScanEntity.setScanStatus("1"); + carsLoadScanEntity.setNum(enterNum); + carsLoadScanEntity.setLoadingAbnormal(isAbnormal); + carsLoadScanEntity.setType(2); + carsLoadScanEntity.setIsData(isData); + carsLoadScanEntity.setTrayId(trayId); + carsLoadScanEntity.setTrayName(trayName); + carsLoadScanEntity.setTrayCode(trayCode); + carsLoadScanEntity.setRemark(remark); + trunklineCarsLoadScanService.save(carsLoadScanEntity); + loadScanId = carsLoadScanEntity.getId(); + difficult = enterNum; + distributionStockArticleClient.submitHandleNumByOrderId(enterNum,articleId); + }else{ + + Integer num = carsLoadScanEntity.getNum(); + + if(useNum-num+enterNum > handQuantity){ + log.warn("##################loadingZero: 不能大于在库件数 handQuantity={} real={}",handQuantity,useNum-num+enterNum); + return R.fail(405,"不能大于在库件数"); + } + loadScanId = carsLoadScanEntity.getId(); + if(!Objects.isNull(planNum)){ + if(useNum-num+enterNum > planNum){ + isAbnormal = 1; + remark = "有数据,有计划,大于计划件数,异常装车"; } - carsLoadScanEntity.setNum(enterNum); - trunklineCarsLoadScanService.save(carsLoadScanEntity); } + + difficult = enterNum - num; + carsLoadScanEntity.setNum(enterNum); + trunklineCarsLoadScanService.updateById(carsLoadScanEntity); + distributionStockArticleClient.submitHandleNumByOrderId(difficult,articleId); } + trunklineCarsLoadingLogService.savaLoadingLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode,goodsName,difficult, + 2,isData,isAbnormal,trayId,trayCode,trayName,fromWarehouseId,loadScanId,remark); + updateNumByLoadId(loadId); return R.success("装车成功"); } @@ -1646,11 +1732,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl pageList = baseMapper.carsLoadPageList(page,loadCarsDTO); + List records = pageList.getRecords(); + for (TrunklineCarsLoadVO trunklineCarsLoadVO:records){ + String loadStatus = trunklineCarsLoadVO.getLoadStatus(); + String value = DictBizCache.getValue(DictBizConstant.CARS_LOAD_STATUS, loadStatus); + trunklineCarsLoadVO.setLoadStatus(value); + } + pageList.setRecords(records); return R.data(pageList); } @@ -1710,6 +1803,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderScanDetailList = trunklineCarsLoadScanService.findCarsLoadingOrderDetail(loadId,orderCode,warehouseId); + + return R.data(orderScanDetailList); + } + @Override public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) { log.info("##############loadingTrayInfo: 查询托盘的货物信息"); @@ -1726,6 +1827,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl plList = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId); + for (DistributionParcelListEntity parcelListEntity : plList) { + Integer quantity = parcelListEntity.getQuantity(); + String firsts = parcelListEntity.getFirsts(); + JSONObject detail = new JSONObject(); + detail.put("productName",firsts); + detail.put("stockNum",quantity); + plDetail.add(detail); + } + jsonObject.put("details",plDetail); zeroList.add(jsonObject); } if("3".equals(associationType)){ @@ -1772,22 +1885,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl productInfoList = loadingZeroDTO.getProductInfoList(); - for (ProductInfoDTO productInfoDTO : productInfoList) { - String productName = productInfoDTO.getProductName(); - Integer enterNum = productInfoDTO.getEnterNum(); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("load_id",loadId) - .eq("warehouse_id",warehouseId) - .eq("waybill_no",waybillNo) - .eq("scan_code",productName) - .eq("type",2); - TrunklineCarsLoadScanEntity one = trunklineCarsLoadScanService.getOne(queryWrapper); - if(!Objects.isNull(one)){ - productInfoDTO.setEnterNum(enterNum+one.getNum()); - } - } - loadingZero(loadId,warehouseId,waybillNo,trayCode,productInfoList); + Integer enterNum = loadingZeroDTO.getEnterNum(); + String orderCode = loadingZeroDTO.getOrderCode(); + loadingZero(loadId,warehouseId,waybillNo,orderCode,trayCode,enterNum,"整托正常装车"); } //下架托盘 @@ -1806,23 +1906,29 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl loadScanOrderList = trunklineCarsOrderService.findLoadScanPackageWithOrder(loadId,warehouseId); + + //查询已装车的零担 + List zeroList = trunklineCarsOrderService.findZeroList(loadId,warehouseId); - //查询已扫描装车的包件 + //查询异常列表 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("load_id",loadId) .eq("warehouse_id",warehouseId) - .eq("type",1); - List packageList = trunklineCarsLoadScanService.list(queryWrapper); - - //查询已装车的零担 - List zeroList = trunklineCarsOrderService.findZeroList(loadId,warehouseId); + .eq("loading_abnormal",1); + List exceptionList = trunklineCarsLoadScanService.list(queryWrapper); TrunklineCarsLoadVO trunklineCarsLoadVO = new TrunklineCarsLoadVO(); BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO); - trunklineCarsLoadVO.setCarsLoadScanPackageList(packageList); + String loadStatus = trunklineCarsLoadVO.getLoadStatus(); + trunklineCarsLoadVO.setLoadStatus(DictBizCache.getValue(DictBizConstant.CARS_LOAD_STATUS,loadStatus)); + + trunklineCarsLoadVO.setLoadScanOrderList(loadScanOrderList); trunklineCarsLoadVO.setZeroList(zeroList); + trunklineCarsLoadVO.setExceptionList(exceptionList); return R.data(trunklineCarsLoadVO); } @@ -1867,71 +1973,48 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("load_id",loadId) - .eq("node_id",warehouseId) - .eq("order_code",orderCode) - .eq("waybill_no",waybillNo); - TrunklineCarsOrderEntity carsOrderEntity = trunklineCarsOrderService.getOne(queryWrapper); - if(Objects.isNull(carsOrderEntity)){ - log.warn("##################removeCarsLoadScan: 节点订单信息不存在 loadId={} warehouseId={} orderCode={}",loadId,warehouseId,orderCode); - return R.fail(405,"节点订单信息不存在"); - } - if(isAbnormal == 1){ - carsLoadLineEntity.setAbnormalNum(carsLoadLineEntity.getAbnormalNum() - num); - carsLoadEntity.setAbnormalNum(carsLoadEntity.getAbnormalNum() - num); - } - carsLoadLineEntity.setRealLoadingNumber(carsLoadLineEntity.getRealLoadingNumber() - num); - carsLoadEntity.setRealLoadingNumber(carsLoadEntity.getRealLoadingNumber() - num); - carsOrderEntity.setRealNum(carsOrderEntity.getRealNum() - num); - updateById(carsLoadEntity); - trunklineCarsOrderService.updateById(carsOrderEntity); - trunklineCarsLoadLineService.updateById(carsLoadLineEntity); - - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(isData == 1){ + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); if(Objects.isNull(stockArticleEntity)){ - log.warn("##################removeCarsLoadScan: 订单信息不存在 warehouseId={} orderCode={}",warehouseId,orderCode); + log.warn("##################removeCarsLoadScan: 订单信息不存在 fromWarehouseId={} orderCode={}",fromWarehouseId,orderCode); return R.fail(405,"订单信息不存在"); } stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() + num); distributionStockArticleClient.saveOrUpdate(stockArticleEntity); + if(type == 1){ - DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, warehouseId); + DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, fromWarehouseId); + if(Objects.isNull(parcelListEntity)){ + log.warn("##################removeCarsLoadScan: 包件信息不存在 fromWarehouseId={} scanCode={}",fromWarehouseId,scanCode); + return R.fail(405,"包件信息不存在"); + } + Long wid = parcelListEntity.getWarehouseId(); String waybillNumber = parcelListEntity.getWaybillNumber(); WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber); - Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); - if(departureWarehouseId.equals(warehouseId)){ + Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); + if(destinationWarehouseId.equals(wid)){ parcelListEntity.setOrderPackageStatus("10"); }else{ parcelListEntity.setOrderPackageStatus("20"); } + distributionParcelListClient.update(parcelListEntity); + updownTypeClient.downPackageOrDelTray(scanCode,warehouseId); }else{ - List parcelListEntities = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId); - for (DistributionParcelListEntity parcelListEntity:parcelListEntities){ - String firsts = parcelListEntity.getFirsts(); - if(scanCode.equals(firsts)){ - parcelListEntity.setQuantity(parcelListEntity.getQuantity() + num); - distributionParcelListClient.update(parcelListEntity); - } - } + trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId); } } } @@ -1957,7 +2040,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl loadScanQueryWrapper = new QueryWrapper<>(); loadScanQueryWrapper.eq("load_id",loadId) - .eq("scan_code",orderPackageCode); + .eq("scan_code",orderPackageCode) + .eq("scan_status","1"); TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getOne(loadScanQueryWrapper); //判断是否有装车扫描记录 if(Objects.isNull(carsLoadScanEntity)){ @@ -1999,178 +2092,203 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl productInfoList, Long warehouseId,Integer unbindTray) { + public R unloadZero(Long loadId, String waybillNo,Integer enterNun, Long warehouseId,Integer unbindTray,String trayCode,String orderCode,String remark) { log.info("#############unloadZero: 卸车零担"); TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); @@ -2243,136 +2364,143 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("load_id",loadId) - .eq("waybill_no",waybillNo) - .eq("scan_code",productName) - .eq("type",2); - TrunklineCarsLoadScanEntity one = trunklineCarsLoadScanService.getOne(queryWrapper); - Integer loadNum = 0; - if(!Objects.isNull(one)){ - trayCode = one.getTrayCode(); - wid = one.getWarehouseId(); - loadNum = one.getNum(); + Long trayId = null; + String trayName = null; + if(!StringUtil.isBlank(trayCode)){ + BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode); + if(!Objects.isNull(trayEntity)){ + trayId = trayEntity.getId(); + trayName = trayEntity.getPalletName(); } + } + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("waybill_no",waybillNo) + .eq("load_id",loadId) + .eq("final_node_id",warehouseId) + .eq("order_code",orderCode); + TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getOne(queryWrapper); + if(Objects.isNull(carsLoadScanEntity)){ + log.warn("#############unloadZero: 零担信息不存在 waybillNo={} order_code={} loadId={} finalNodeId={}",waybillNo,orderCode,loadId,warehouseId); + return R.fail(405,"零担信息不存在"); + } - if(!enterNum.equals(loadNum)){ - log.warn("#############unloadZero: 卸车件数不正确 productName={} loadNum={} enterNum={}",productName,loadNum,enterNum); - return R.fail(405,"卸车件数不正确"); + Integer isAbnormal = 0; + Integer num = carsLoadScanEntity.getNum(); + Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId(); + Long waybillId = carsLoadScanEntity.getWaybillId(); + String scanCode = carsLoadScanEntity.getScanCode(); + Long loadScanId = carsLoadScanEntity.getId(); + if(enterNun != num){ + log.warn("#############unloadZero: 零担信息卸车数量不正确 enterNun={} num={}",enterNun,num); + return R.fail(405,"零担信息卸车数量不正确"); + } + + carsLoadScanEntity.setUnloadNum(enterNun); + carsLoadScanEntity.setUnloadNodeId(warehouseId); + carsLoadScanEntity.setUnloadNodeName(warehouseName); + carsLoadScanEntity.setUnloadAbnormal(0); + carsLoadScanEntity.setScanStatus("2"); + trunklineCarsLoadScanService.updateById(carsLoadScanEntity); + + trunklineCarsUnloadLogService.savaUnloadLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode, + scanCode,enterNun,2,1,isAbnormal,trayId,trayCode,trayName,fromWarehouseId,loadScanId,remark); + + if(unbindTray == 1){ + if(!StringUtil.isBlank(trayCode)){ + trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,fromWarehouseId); } + } - TrunklineCarsUnloadScanEntity carsUnloadScanEntity = new TrunklineCarsUnloadScanEntity(); - carsUnloadScanEntity.setWarehouseId(warehouseId); - carsUnloadScanEntity.setWarehouseName(basicdataWarehouseEntity.getName()); - carsUnloadScanEntity.setLoadId(loadId); - carsUnloadScanEntity.setLoadCode(carsLoadEntity.getCarsNo()); - carsUnloadScanEntity.setWaybillId(waybillEntity.getId()); - carsUnloadScanEntity.setWaybillNo(waybillNo); - carsUnloadScanEntity.setOrderCode(waybillNo); - carsUnloadScanEntity.setScanCode(productName); - carsUnloadScanEntity.setScanStatus("2"); - carsUnloadScanEntity.setNum(enterNum); - carsUnloadScanEntity.setTrayId(one.getTrayId()); - carsUnloadScanEntity.setTrayCode(trayCode); - carsUnloadScanEntity.setTrayName(one.getTrayName()); - - trunklineCarsUnloadScanService.save(carsUnloadScanEntity); - - totalNum = totalNum + enterNum; - - //创建对应的订单信息 - String orderCode = waybillNo; - DistributionStockArticleEntity newStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); - if(Objects.isNull(newStockArticleEntity)){ - Long loadWarehouseId = one.getWarehouseId();//装车仓库id - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, loadWarehouseId); - newStockArticleEntity = new DistributionStockArticleEntity(); - BeanUtil.copy(stockArticleEntity,newStockArticleEntity); - newStockArticleEntity.setId(null); - newStockArticleEntity.setHandQuantity(enterNum); - newStockArticleEntity.setIncomingNum(enterNum); - Long orderId = distributionStockArticleClient.addData(newStockArticleEntity); - if(orderId != 0){ - List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, loadWarehouseId); - for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { - String firsts = parcelListEntity.getFirsts(); - DistributionParcelListEntity newParcelListEntity = new DistributionParcelListEntity(); - BeanUtil.copy(parcelListEntity,newParcelListEntity); - newParcelListEntity.setId(null); - if(firsts.equals(productName)){ - newParcelListEntity.setQuantity(enterNum); - } - newParcelListEntity.setQuantity(0); - newParcelListEntity.setStockArticleId(orderId); - distributionParcelListClient.add(newParcelListEntity); - } - } - }else{ - Integer handQuantity = newStockArticleEntity.getHandQuantity(); - Integer incomingNum = newStockArticleEntity.getIncomingNum(); - newStockArticleEntity.setHandQuantity(handQuantity+enterNum); - newStockArticleEntity.setIncomingNum(incomingNum+enterNum); - distributionStockArticleClient.saveOrUpdate(newStockArticleEntity); - List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId); + DistributionStockArticleEntity newStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(Objects.isNull(newStockArticleEntity)){ + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); + newStockArticleEntity = new DistributionStockArticleEntity(); + BeanUtil.copy(stockArticleEntity,newStockArticleEntity); + newStockArticleEntity.setId(null); + newStockArticleEntity.setOrderReceiveStatus("20"); + newStockArticleEntity.setOrderStatus("10"); + newStockArticleEntity.setHandQuantity(enterNun); + newStockArticleEntity.setIncomingNum(enterNun); + Long orderId = distributionStockArticleClient.addData(newStockArticleEntity); + if(orderId != 0){ + List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, fromWarehouseId); for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) { - String firsts = parcelListEntity.getFirsts(); - Integer quantity = parcelListEntity.getQuantity(); - if(firsts.equals(productName)){ - parcelListEntity.setQuantity(quantity+enterNum); - distributionParcelListClient.update(parcelListEntity); - } + DistributionParcelListEntity newParcelListEntity = new DistributionParcelListEntity(); + BeanUtil.copy(parcelListEntity,newParcelListEntity); + newParcelListEntity.setId(null); + newParcelListEntity.setWarehouseId(warehouseId); + newParcelListEntity.setWarehouse(warehouseName); + newParcelListEntity.setStockArticleId(orderId); + distributionParcelListClient.add(newParcelListEntity); } } - } + }else{ + Integer handQuantity = newStockArticleEntity.getHandQuantity()+enterNun; + Integer incomingNum = newStockArticleEntity.getIncomingNum()+enterNun; + Integer totalNumber = newStockArticleEntity.getTotalNumber(); - if(!StringUtil.isBlank(trayCode)){ - if(unbindTray == 1){ - String orderCode=waybillNo; - trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,wid); + if(incomingNum == totalNumber){ + if(handQuantity == totalNumber){ + newStockArticleEntity.setOrderStatus("20"); + }else{ + newStockArticleEntity.setOrderStatus("30"); + } + newStockArticleEntity.setOrderReceiveStatus("30"); + }else{ + if(incomingNum == handQuantity){ + newStockArticleEntity.setOrderStatus("10"); + }else{ + newStockArticleEntity.setOrderStatus("30"); + } + newStockArticleEntity.setOrderReceiveStatus("20"); } + newStockArticleEntity.setHandQuantity(handQuantity); + newStockArticleEntity.setIncomingNum(incomingNum); + + distributionStockArticleClient.saveOrUpdate(newStockArticleEntity); } + + updateNumByLoadId(loadId); + return R.success("卸车成功"); } @Override - public R findLoadScanWaybillDetailList(Long loadId, String waybillNo, Long warehouseId) { + public R findLoadScanWaybillDetailList(Long loadId, String orderCode, Long warehouseId) { - DistributionStockArticleEntity zeroOrder = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(waybillNo, warehouseId); + DistributionStockArticleEntity zeroOrder = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); if(Objects.isNull(zeroOrder)){ - log.warn("#############findLoadScanWaybillDetailList: 零担运单信息不存在 waybillNo={} warehouseId={}",waybillNo,warehouseId); + log.warn("#############findLoadScanWaybillDetailList: 零担运单信息不存在 waybillNo={} warehouseId={}",orderCode,warehouseId); return R.fail(405,"零担运单信息不存在"); } - List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(waybillNo, warehouseId); + List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId); if(parcelListEntityList.isEmpty()){ - log.warn("#############findLoadScanWaybillDetailList: 零担运单品类包件信息不存在 waybillNo={} warehouseId={}",waybillNo,warehouseId); + log.warn("#############findLoadScanWaybillDetailList: 零担运单品类包件信息不存在 waybillNo={} warehouseId={}",orderCode,warehouseId); return R.fail(405,"零担运单品类包件信息不存在"); } QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("load_id",loadId) - .eq("node_id",warehouseId) - .eq("waybill_no",waybillNo); + .eq("warehouse_id",warehouseId) + .eq("order_code",orderCode); List zeroLoadList = trunklineCarsLoadScanService.list(queryWrapper); List ls = new ArrayList<>(); @@ -2406,26 +2534,37 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("load_id",loadId) - .eq("warehouse_id",warehouseId) - .eq("type",1); - List packageList = trunklineCarsUnloadScanService.list(queryWrapper); + List unloadScanOrderList = trunklineCarsLoadScanService.findPackageWithOrderList(loadId,warehouseId); + for (UnloadScanOrderVO unloadScanOrderVO : unloadScanOrderList) { + String waybillNo = unloadScanOrderVO.getWaybillNo(); + String orderCode = unloadScanOrderVO.getOrderCode(); + List unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode); + unloadScanOrderVO.setUnloadPackageList(unloadPackageList); + } //查询已装车的零担 List zeroList = trunklineCarsOrderService.findUnloadZeroList(loadId,warehouseId); for (UnloadZeroVO unloadZeroVO : zeroList) { String waybillNo = unloadZeroVO.getWaybillNo(); - List list = trunklineCarsLoadScanService.findListByLoadIdAndWaybillNo(loadId,waybillNo); - unloadZeroVO.setProductUnloadInfoList(list); + String orderCode = unloadZeroVO.getOrderCode(); + List unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode); + unloadZeroVO.setUnloadPackageList(unloadPackageList); } + //查询异常列表 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("load_id",loadId) + .eq("warehouse_id",warehouseId) + .eq("unload_abnormal",1); + List exceptionList = trunklineCarsLoadScanService.list(queryWrapper); + TrunklineCarsLoadVO trunklineCarsLoadVO = new TrunklineCarsLoadVO(); BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO); - trunklineCarsLoadVO.setCarsUnloadScanPackageList(packageList); + trunklineCarsLoadVO.setUnloadScanOrderList(unloadScanOrderList); trunklineCarsLoadVO.setUnloadZeroList(zeroList); + trunklineCarsLoadVO.setExceptionList(exceptionList); return R.data(trunklineCarsLoadVO); } @@ -2483,7 +2622,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl list = trunklineCarsLoadScanService.findUnloadTrayGoodsList(loadId,warehouseId,trayCode); if(list.isEmpty()){ - log.warn("###############findUnloadTrayGoodsList: 托盘上没有该节点的卸货数据 loadId={} trayCode={} warehouseId={]",loadId,trayCode,warehouseId); + log.warn("###############findUnloadTrayGoodsList: 托盘上没有该节点的卸货数据 loadId={} trayCode={} warehouseId={}",loadId,trayCode,warehouseId); return R.fail(405,"托盘上没有该节点的卸货数据"); } @@ -2505,19 +2644,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl productInfoList = trunklineCarsLoadScanService.findProductInfoList(loadId,trayCode,waybillNo); - unloadZero(loadId,waybillNo,productInfoList,warehouseId,0); - } - //处理托盘的入库和货物的入库 trayTypeClient.changeTrayWarehouseInfo(trayCode,warehouseId); @@ -2525,4 +2660,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl implements ITrunklineCarsLoadingLogService { + @Override + public void savaLoadingLog(Long warehouseId, String warehouseName, Long loadId, String loadCode, Long waybillId, String waybillNo, String orderCode, String scanCode, Integer num, Integer type, Integer isData, Integer isAbnormal, Long trayId, String trayCode, String trayName, Long fromWarehouseId, Long loadScanId, String remark) { + TrunklineCarsLoadingLogEntity entity = new TrunklineCarsLoadingLogEntity(); + entity.setWarehouseId(warehouseId); + entity.setWarehouseName(warehouseName); + entity.setLoadId(loadId); + entity.setLoadCode(loadCode); + entity.setWaybillId(waybillId); + entity.setWaybillNo(waybillNo); + entity.setOrderCode(orderCode); + entity.setScanCode(scanCode); + entity.setNum(num); + entity.setType(type); + entity.setIsData(isData); + entity.setIsAbnormal(isAbnormal); + entity.setTrayCode(trayCode); + entity.setTrayId(trayId); + entity.setTrayName(trayName); + entity.setFromWarehouseId(fromWarehouseId); + entity.setLoadScanId(loadScanId); + entity.setRemark(remark); + save(entity); + } +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java index 80f0bcbc2..a9d00b4ad 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java @@ -5,10 +5,7 @@ import com.logpm.trunkline.dto.LoadCarsDTO; import com.logpm.trunkline.entity.TrunklineCarsOrderEntity; import com.logpm.trunkline.mapper.TrunklineCarsOrderMapper; import com.logpm.trunkline.service.ITrunklineCarsOrderService; -import com.logpm.trunkline.vo.CarsLoadAllOrderVO; -import com.logpm.trunkline.vo.LoadZeroListVO; -import com.logpm.trunkline.vo.NodeNumDataVO; -import com.logpm.trunkline.vo.UnloadZeroVO; +import com.logpm.trunkline.vo.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; @@ -27,7 +24,7 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl findUnloadZeroList(Long loadId, Long warehouseId) { return baseMapper.findUnloadZeroList(loadId, warehouseId); } + + @Override + public List findLoadScanPackageWithOrder(Long loadId, Long warehouseId) { + return baseMapper.findLoadScanPackageWithOrder(loadId,warehouseId); + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadLogServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadLogServiceImpl.java new file mode 100644 index 000000000..18e0ca55f --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadLogServiceImpl.java @@ -0,0 +1,65 @@ +package com.logpm.trunkline.service.impl; + +import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity; +import com.logpm.trunkline.mapper.TrunklineCarsUnloadLogMapper; +import com.logpm.trunkline.service.ITrunklineCarsUnloadLogService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Slf4j +@AllArgsConstructor +@Service +public class TrunklineCarsUnloadLogServiceImpl extends BaseServiceImpl implements ITrunklineCarsUnloadLogService { + @Override + public Integer findNumByLoadId(Long loadId) { + return baseMapper.findNumByLoadId(loadId); + } + + @Override + public Integer findAbnormalNumByLoadId(Long loadId) { + return baseMapper.findAbnormalNumByLoadId(loadId); + } + + @Override + public Integer findNumByLoadIdAndNodeId(Long loadId, Long nodeId) { + return baseMapper.findNumByLoadIdAndNodeId(loadId,nodeId); + } + + @Override + public Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId) { + return baseMapper.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId); + } + + @Override + public Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo) { + return baseMapper.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo); + } + + + + @Override + public void savaUnloadLog(Long warehouseId, String warehouseName, Long loadId, String loadCode, Long waybillId, String waybillNo, String orderCode, String scanCode, Integer num, Integer type, Integer isData, Integer isAbnormal, Long trayId, String trayCode, String trayName, Long fromWarehouseId, Long loadScanId, String remark) { + TrunklineCarsUnloadLogEntity entity = new TrunklineCarsUnloadLogEntity(); + entity.setWarehouseId(warehouseId); + entity.setWarehouseName(warehouseName); + entity.setLoadId(loadId); + entity.setLoadCode(loadCode); + entity.setWaybillId(waybillId); + entity.setWaybillNo(waybillNo); + entity.setOrderCode(orderCode); + entity.setScanCode(scanCode); + entity.setNum(num); + entity.setType(type); + entity.setIsData(isData); + entity.setIsAbnormal(isAbnormal); + entity.setTrayCode(trayCode); + entity.setTrayId(trayId); + entity.setTrayName(trayName); + entity.setFromWarehouseId(fromWarehouseId); + entity.setLoadScanId(loadScanId); + entity.setRemark(remark); + save(entity); + } +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java deleted file mode 100644 index 5544f08cb..000000000 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.logpm.trunkline.service.impl; - -import com.logpm.trunkline.entity.TrunklineCarsUnloadScanEntity; -import com.logpm.trunkline.mapper.TrunklineCarsUnloadScanMapper; -import com.logpm.trunkline.service.ITrunklineCarsUnloadScanService; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springframework.stereotype.Service; - -@Slf4j -@AllArgsConstructor -@Service -public class TrunklineCarsUnloadScanServiceImpl extends BaseServiceImpl implements ITrunklineCarsUnloadScanService { - @Override - public Integer findNumByLoadId(Long loadId) { - return baseMapper.findNumByLoadId(loadId); - } - - @Override - public Integer findAbnormalNumByLoadId(Long loadId) { - return baseMapper.findAbnormalNumByLoadId(loadId); - } - - @Override - public Integer findNumByLoadIdAndNodeId(Long loadId, Long nodeId) { - return baseMapper.findNumByLoadIdAndNodeId(loadId,nodeId); - } - - @Override - public Integer findAbnormalNumByLoadIdAndNodeId(Long loadId, Long nodeId) { - return baseMapper.findAbnormalNumByLoadIdAndNodeId(loadId,nodeId); - } - - @Override - public Integer findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long loadId, Long nodeId, String orderCode, String waybillNo) { - return baseMapper.findNumByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(loadId,nodeId,orderCode,waybillNo); - } -} diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java index 8d5de5626..2f8a13a62 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java @@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; +import java.util.List; + @NonDS @ApiIgnore @RestController @@ -54,4 +56,9 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient { public void updateEntity(WarehouseWaybillEntity warehouseWaybill) { warehouseWaybillService.updateById(warehouseWaybill); } + + @Override + public List findList() { + return warehouseWaybillService.list(); + } } From c36eb2b5517d971c066e8110e6100cc7bf26f8d7 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sun, 10 Dec 2023 18:09:48 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=87=E8=B4=A7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/mapper/DistributionDeliveryListMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index eca214a7b..3202b41ee 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1335,7 +1335,7 @@ + select * from logpm_aftersale_survey_record where is_deleted = 0 + + + + + + diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesPersonResponsibleMapper.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesPersonResponsibleMapper.java new file mode 100644 index 000000000..8a089e20a --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesPersonResponsibleMapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.mapper; + +import com.logpm.aftersales.entity.AftersalesPersonResponsibleEntity; +import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO; +import com.logpm.aftersales.excel.AftersalesPersonResponsibleExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 异常工单预计责任人 Mapper 接口 + * + * @author cyz + * @since 2023-12-09 + */ +public interface AftersalesPersonResponsibleMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param aftersalesPersonResponsible + * @return + */ + List selectAftersalesPersonResponsiblePage(IPage page, AftersalesPersonResponsibleVO aftersalesPersonResponsible); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportAftersalesPersonResponsible(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesPersonResponsibleMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesPersonResponsibleMapper.xml new file mode 100644 index 000000000..4eb86dc7c --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesPersonResponsibleMapper.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 5f756734a..875ab1c93 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -51,7 +51,7 @@ diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersaleSurveyRecordService.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersaleSurveyRecordService.java new file mode 100644 index 000000000..a937a07a3 --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersaleSurveyRecordService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import com.logpm.aftersales.vo.AftersaleSurveyRecordVO; +import com.logpm.aftersales.excel.AftersaleSurveyRecordExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 工单调查记录表 服务类 + * + * @author cyz + * @since 2023-12-09 + */ +public interface IAftersaleSurveyRecordService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param aftersaleSurveyRecord + * @return + */ + IPage selectAftersaleSurveyRecordPage(IPage page, AftersaleSurveyRecordVO aftersaleSurveyRecord); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportAftersaleSurveyRecord(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesPersonResponsibleService.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesPersonResponsibleService.java new file mode 100644 index 000000000..a704521c5 --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesPersonResponsibleService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.aftersales.entity.AftersalesPersonResponsibleEntity; +import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO; +import com.logpm.aftersales.excel.AftersalesPersonResponsibleExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 异常工单预计责任人 服务类 + * + * @author cyz + * @since 2023-12-09 + */ +public interface IAftersalesPersonResponsibleService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param aftersalesPersonResponsible + * @return + */ + IPage selectAftersalesPersonResponsiblePage(IPage page, AftersalesPersonResponsibleVO aftersalesPersonResponsible); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportAftersalesPersonResponsible(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersaleSurveyRecordServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersaleSurveyRecordServiceImpl.java new file mode 100644 index 000000000..e4adb280c --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersaleSurveyRecordServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.service.impl; + +import com.logpm.aftersales.entity.AftersaleSurveyRecordEntity; +import com.logpm.aftersales.vo.AftersaleSurveyRecordVO; +import com.logpm.aftersales.excel.AftersaleSurveyRecordExcel; +import com.logpm.aftersales.mapper.AftersaleSurveyRecordMapper; +import com.logpm.aftersales.service.IAftersaleSurveyRecordService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 工单调查记录表 服务实现类 + * + * @author cyz + * @since 2023-12-09 + */ +@Service +public class AftersaleSurveyRecordServiceImpl extends BaseServiceImpl implements IAftersaleSurveyRecordService { + + @Override + public IPage selectAftersaleSurveyRecordPage(IPage page, AftersaleSurveyRecordVO aftersaleSurveyRecord) { + return page.setRecords(baseMapper.selectAftersaleSurveyRecordPage(page, aftersaleSurveyRecord)); + } + + + @Override + public List exportAftersaleSurveyRecord(Wrapper queryWrapper) { + List aftersaleSurveyRecordList = baseMapper.exportAftersaleSurveyRecord(queryWrapper); + //aftersaleSurveyRecordList.forEach(aftersaleSurveyRecord -> { + // aftersaleSurveyRecord.setTypeName(DictCache.getValue(DictEnum.YES_NO, AftersaleSurveyRecord.getType())); + //}); + return aftersaleSurveyRecordList; + } + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesPersonResponsibleServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesPersonResponsibleServiceImpl.java new file mode 100644 index 000000000..2af424b34 --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesPersonResponsibleServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.service.impl; + +import com.logpm.aftersales.entity.AftersalesPersonResponsibleEntity; +import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO; +import com.logpm.aftersales.excel.AftersalesPersonResponsibleExcel; +import com.logpm.aftersales.mapper.AftersalesPersonResponsibleMapper; +import com.logpm.aftersales.service.IAftersalesPersonResponsibleService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 异常工单预计责任人 服务实现类 + * + * @author cyz + * @since 2023-12-09 + */ +@Service +public class AftersalesPersonResponsibleServiceImpl extends BaseServiceImpl implements IAftersalesPersonResponsibleService { + + @Override + public IPage selectAftersalesPersonResponsiblePage(IPage page, AftersalesPersonResponsibleVO aftersalesPersonResponsible) { + return page.setRecords(baseMapper.selectAftersalesPersonResponsiblePage(page, aftersalesPersonResponsible)); + } + + + @Override + public List exportAftersalesPersonResponsible(Wrapper queryWrapper) { + List aftersalesPersonResponsibleList = baseMapper.exportAftersalesPersonResponsible(queryWrapper); + //aftersalesPersonResponsibleList.forEach(aftersalesPersonResponsible -> { + // aftersalesPersonResponsible.setTypeName(DictCache.getValue(DictEnum.YES_NO, AftersalesPersonResponsible.getType())); + //}); + return aftersalesPersonResponsibleList; + } + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index b0103dc73..8f3a9466b 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -22,6 +22,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.aftersales.dto.AftersaleSurveyRecordDTO; +import com.logpm.aftersales.dto.AftersalesPersonResponsibleDTO; import com.logpm.aftersales.dto.AftersalesProcessingResultsDTO; import com.logpm.aftersales.dto.AftersalesWorkOrderDTO; import com.logpm.aftersales.entity.*; @@ -33,6 +35,7 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.aftersales.WorkOrderStatusConstant; import org.springblade.common.constant.aftersales.WorkOrderTypesOfStatusConstant; @@ -81,6 +84,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl> deptNames = sysClient.getDeptNames(user.getDeptId()); + if(ObjectUtils.isNotNull(deptNames)){ + String collect = deptNames.getData().stream().collect(Collectors.joining(",")); + surveyRecordDTO.setAddDepartment(collect); + } + AftersaleSurveyRecordEntity aftersaleSurveyRecord = new AftersaleSurveyRecordEntity(); + BeanUtil.copyProperties(surveyRecordDTO,aftersaleSurveyRecord); + aftersaleSurveyRecord.setTypesOf("1"); + aftersaleSurveyRecord.setDifference("1"); + aftersaleSurveyRecordService.save(aftersaleSurveyRecord); + } + //添加责任人信息 + if(ObjectUtils.isNotNull(aftersalesWorkOrder.getPersonResponsibleDTO()) && !aftersalesWorkOrder.getPersonResponsibleDTO().isEmpty()){ + List personResponsibleList = getAftersalesPersonResponsibleEntities(aftersalesWorkOrder); + if(!personResponsibleList.isEmpty()){ + aftersalesPersonResponsibleService.saveBatch(personResponsibleList); + } + } + //添加完结受款方数据 + if(ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecipientEntities())){ + completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities()); + } + //添加完结赔款方数据 + if(ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecordEntities())){ + completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities()); + } + return true; + } + //添加责任人信息 + @NotNull + private static List getAftersalesPersonResponsibleEntities(AftersalesWorkOrderDTO aftersalesWorkOrder) { + List personResponsibleDTO = aftersalesWorkOrder.getPersonResponsibleDTO(); + List personResponsibleList = new ArrayList<>(); - return true; + personResponsibleDTO.forEach( i ->{ + AftersalesPersonResponsibleEntity personResponsibleEntity = new AftersalesPersonResponsibleEntity(); + BeanUtil.copyProperties(i , personResponsibleEntity); + personResponsibleEntity.setDifference("1"); + personResponsibleEntity.setTypesOf("1"); + personResponsibleList.add(personResponsibleEntity); + }); + return personResponsibleList; } /** @@ -335,23 +383,23 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl first = warehouseType.stream().filter(i -> { - if (i.getDictKey().equals(roleName)) { + if (i.getDictValue().equals(roleName)) { return true; } return false; }).findFirst(); if(first.isPresent()){ //存在 - DictBiz dictBiz = first.get(); - String dictValue = dictBiz.getDictValue(); + String dictValue = first.get().getDictKey(); + switch (dictValue){ case "1": //客服经理 查询全部待处理工单 - + aftersalesWorkOrder.put("customerIdentification", "1"); break; case "2": // 营业部客服 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(ObjectUtils.isNotNull(myCurrentWarehouse)){ - aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId()); + aftersalesWorkOrder.put("businessId", myCurrentWarehouse.getId()); }else{ throw new ServiceException("请选择仓库!"); } @@ -365,7 +413,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl { + + public static AftersaleSurveyRecordWrapper build() { + return new AftersaleSurveyRecordWrapper(); + } + + @Override + public AftersaleSurveyRecordVO entityVO(AftersaleSurveyRecordEntity aftersaleSurveyRecord) { + AftersaleSurveyRecordVO aftersaleSurveyRecordVO = Objects.requireNonNull(BeanUtil.copy(aftersaleSurveyRecord, AftersaleSurveyRecordVO.class)); + + //User createUser = UserCache.getUser(aftersaleSurveyRecord.getCreateUser()); + //User updateUser = UserCache.getUser(aftersaleSurveyRecord.getUpdateUser()); + //aftersaleSurveyRecordVO.setCreateUserName(createUser.getName()); + //aftersaleSurveyRecordVO.setUpdateUserName(updateUser.getName()); + + return aftersaleSurveyRecordVO; + } + + +} diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/wrapper/AftersalesPersonResponsibleWrapper.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/wrapper/AftersalesPersonResponsibleWrapper.java new file mode 100644 index 000000000..f790005bc --- /dev/null +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/wrapper/AftersalesPersonResponsibleWrapper.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.aftersales.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import com.logpm.aftersales.entity.AftersalesPersonResponsibleEntity; +import com.logpm.aftersales.vo.AftersalesPersonResponsibleVO; +import java.util.Objects; + +/** + * 异常工单预计责任人 包装类,返回视图层所需的字段 + * + * @author cyz + * @since 2023-12-09 + */ +public class AftersalesPersonResponsibleWrapper extends BaseEntityWrapper { + + public static AftersalesPersonResponsibleWrapper build() { + return new AftersalesPersonResponsibleWrapper(); + } + + @Override + public AftersalesPersonResponsibleVO entityVO(AftersalesPersonResponsibleEntity aftersalesPersonResponsible) { + AftersalesPersonResponsibleVO aftersalesPersonResponsibleVO = Objects.requireNonNull(BeanUtil.copy(aftersalesPersonResponsible, AftersalesPersonResponsibleVO.class)); + + //User createUser = UserCache.getUser(aftersalesPersonResponsible.getCreateUser()); + //User updateUser = UserCache.getUser(aftersalesPersonResponsible.getUpdateUser()); + //aftersalesPersonResponsibleVO.setCreateUserName(createUser.getName()); + //aftersalesPersonResponsibleVO.setUpdateUserName(updateUser.getName()); + + return aftersalesPersonResponsibleVO; + } + + +} From 3a39ca508fe4e28f1a30b1324055cb3b71934e5a Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 11 Dec 2023 09:50:50 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=AC=A7=E6=B4=BE=E8=A7=A3=E6=9E=90=E6=8A=A5=E9=94=99=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/oupai/service/impl/OuPaiFactoryServiceImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java index ebb19a618..ac92e1057 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java @@ -636,8 +636,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { analyzeData(resultArray); opOrderStatusLogEntity.setDataStatus(1); } catch (Exception e) { - e.printStackTrace(); - log.error(">>>> TAG {} error {}", FactoryConstant.OUPAI, e.getMessage()); + log.error(">>>> 欧派数据解析报错", e); opOrderStatusLogEntity.setDataStatus(2); } From 37b1aaebc3af80a8d05a75ad56965ebced309fff Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 11 Dec 2023 11:17:15 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E5=8C=85=E4=BB=B6=E8=BD=AC=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E5=93=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionStockListInfoEntity.java | 6 + .../DistributionStockListController.java | 16 ++ .../IDistributionStockListService.java | 8 + .../DistributionParcelListServiceImpl.java | 145 +++++++++++++++++- .../DistributionStockListServiceImpl.java | 60 ++++++++ .../impl/DistributionStockupServiceImpl.java | 64 +++++++- 6 files changed, 291 insertions(+), 8 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListInfoEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListInfoEntity.java index b1297bcd1..234e0fd4f 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListInfoEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListInfoEntity.java @@ -192,6 +192,12 @@ public class DistributionStockListInfoEntity extends TenantEntity { */ @ApiModelProperty(value = "包件id") private Long parcelListId; + + /** + * 包条码 + */ + @ApiModelProperty(value = "包条码") + private String packageCode; /** * 所属商场 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java index 019a40b72..80863dd0b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java @@ -158,6 +158,22 @@ public class DistributionStockListController extends BladeController { } + + @GetMapping("/showInventorySourcePackageCode") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "查看库存品包条码") + public R showInventorySourcePackageCode(@ApiIgnore @RequestParam String incomingBatch,@RequestParam Long packageIds){ + + OrderPackgeCodeDataVO orderPackgeCodeDataVo= null; + try { + orderPackgeCodeDataVo = distributionStockListService.showInventorySourcePackageCode(incomingBatch,packageIds); + } catch (Exception e) { + return R.fail(e.getMessage()); + } + return R.data(orderPackgeCodeDataVo); + + } + /** * 库存品管理 新增 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index 4abfe7dae..4b1d19ba8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -167,6 +167,14 @@ public interface IDistributionStockListService extends BaseService{ int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + List packageIds = new ArrayList<>(); v.stream().forEach( i -> { //查询有没有打托数据 @@ -467,7 +469,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl { DistributionStockArticleEntity stockArticleEntity1 = distributionStockArticleMapper.selectById(oo); @@ -508,9 +511,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl packageIds, Integer qu) { + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if (Func.isEmpty(myCurrentWarehouse)){ + //当前无选择仓库 + return null; + } + List distributionParcelListEntities = this.listByIds(packageIds); + List materialId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialId).distinct().collect(Collectors.toList()); + List materialCode = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialCode).distinct().collect(Collectors.toList()); + List materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList()); + List mallId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMallId).distinct().collect(Collectors.toList()); + List materialName= distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList()); + List brandId= distributionParcelListEntities.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList()); + if (materialId.size()!=1 ||materialCode.size()!=1 ||materialUnit.size()!=1 ||mallId.size()!=1 || materialName.size()!=1 || brandId.size()!=1 ){ + //该批次包件出现多种物料包件 + return null; + } + + int num = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum(); + if (num <= 0){ + //无有效的在库数量 + return null; + } + DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); + //直接添加 +// distributionStockListEntity.setIncomingBatch(distributionStockArticleEntity.get); //入库批次号 + distributionStockListEntity.setServiceNumber(Optional.ofNullable(distributionStockArticleEntity.getServiceNumber()).orElse(null)); //服务号 + distributionStockListEntity.setDescriptionGoods(materialName.get(0)); //物料名称 + distributionStockListEntity.setCargoNumber(materialCode.get(0)); //物料编号 + distributionStockListEntity.setWarehouseName(Optional.ofNullable(distributionStockArticleEntity.getWarehouse()).orElse(null)); //仓库 + distributionStockListEntity.setWarehouseId(Optional.ofNullable(distributionStockArticleEntity.getWarehouseId()).orElse(null)); //仓库ID + distributionStockListEntity.setMarketId(Optional.ofNullable(distributionStockArticleEntity.getMallId()).orElse(null)); //商场 + distributionStockListEntity.setCargoUnit(materialUnit.get(0)); //货物单位 + + distributionStockListEntity.setMallName(Optional.ofNullable(distributionStockArticleEntity.getMallName()).orElse(null)); //商场名称 + distributionStockListEntity.setQuantityStock(num); //库存数量(包件数量) + distributionStockListEntity.setIncomingBatch(Optional.ofNullable(distributionStockArticleEntity.getOrderCode()).orElse(null)); //入库批次 + distributionStockListEntity.setOutboundQuantity(0); //出库数量 + +// distributionStockListEntity.setCargoUnit(Optional.ofNullable(distributionParcelList.getMaterialUnit()).orElse(null));//单位 + distributionStockListEntity.setStoreId(Optional.ofNullable(distributionStockArticleEntity.getStoreId()).orElse(null));//门店ID + distributionStockListEntity.setMarketCode(Optional.ofNullable(distributionStockArticleEntity.getMallCode()).orElse(null));//商场编码 + distributionStockListEntity.setMarketName(Optional.ofNullable(distributionStockArticleEntity.getMallName()).orElse(null));//商场名称 + distributionStockListEntity.setStoreCode(Optional.ofNullable(distributionStockArticleEntity.getStoreCode()).orElse(null));//门店编码 + distributionStockListEntity.setStoreName(Optional.ofNullable(distributionStockArticleEntity.getStoreName()).orElse(null));//门店名称 + +// distributionStockListEntity.setCategory(Optional.ofNullable(distributionParcelList.getBrandId()+"").orElse(null));//品分类 + // 品牌 + distributionStockListEntity.setBrandId(brandId.get(0)); + distributionStockListEntity.setUnpackingQuantity(0); + distributionStockListEntity.setSourceType("1"); //类型 + BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(materialId.get(0)); + distributionStockListEntity.setSku(materialOwnId.getSku()); + distributionStockListEntity.setMaterialId(materialId.get(0));//货物ID +// distributionStockListEntity.setParcelListId(distributionParcelListEntities.getId());//包件id + distributionStockListEntity.setQuantityOccupied(0);//冻结数量 + distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量 + DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelListEntities.get(0).getMaterialId(), distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId()); + if(ObjectUtils.isNotNull(stockListEntity)){ + //有记录 + DistributionStockListEntity listEntity = new DistributionStockListEntity(); + listEntity.setId(stockListEntity.getId());//id + Integer quantity = ObjectUtils.isNull(distributionParcelListEntities.get(0).getQuantity()) ? 0: distributionParcelListEntities.get(0).getQuantity(); + Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock(); + listEntity.setQuantityStock(quantity + quantityStock); + distributionStockListService.updateById(listEntity); + }else{ + distributionStockListService.save(distributionStockListEntity); + } +// distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null)); //托盘 +// distributionStockListEntity.setStorageLocation(Optional.ofNullable(distributionParcelList.getGoodsAllocation()).orElse(null)); //库位信息 +// distributionStockListEntity.setFactory(Optional.ofNullable(distributionStockArticleEntity.getFactoryTrain()).orElse(null));//工厂车次 +// distributionStockListEntity.setDespatch(Optional.ofNullable(distributionStockArticleEntity.getTrainNumber()).orElse(null));//车次号 +// distributionStockListEntity.setStockArticleId(Optional.ofNullable(distributionStockArticleEntity.getId()).orElse(null)); //订单ID +// distributionStockListEntity.setOrderCode(Optional.ofNullable(distributionParcelListEntities.get(0).getOrderCode()).orElse(null)); //订单自编号 + for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { + //添加库存品记录 + DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity(); +// BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo); + + distributionStockListInfo.setServiceNumber(distributionStockListEntity.getServiceNumber()); //服务号 + distributionStockListInfo.setDescriptionGoods(distributionStockListEntity.getMallName()); //物料名称 + distributionStockListInfo.setCargoNumber(distributionStockListEntity.getMarketCode()); //物料编号 + distributionStockListInfo.setWarehouseName(distributionStockListEntity.getWarehouseName()); //仓库 + distributionStockListInfo.setWarehouseId(distributionStockListEntity.getWarehouseId()); //仓库ID + distributionStockListInfo.setMarketId(distributionStockListEntity.getMarketId()); //商场 + distributionStockListInfo.setCargoUnit(distributionStockListEntity.getCargoUnit()); //货物单位 + + distributionStockListInfo.setMallName(distributionStockListEntity.getMallName()); //商场名称 + distributionStockListInfo.setQuantityStock(distributionParcelListEntity.getQuantity()); //库存数量(包件数量) + distributionStockListInfo.setIncomingBatch(distributionStockListEntity.getIncomingBatch()); //入库批次 + distributionStockListInfo.setOutboundQuantity(0); //出库数量 + distributionStockListInfo.setOutboundQuantity(0); //入库时间 + +// distributionStockListEntity.setCargoUnit(Optional.ofNullable(distributionParcelList.getMaterialUnit()).orElse(null));//单位 + distributionStockListInfo.setStoreId(distributionStockListEntity.getStoreId());//门店ID + distributionStockListInfo.setMarketCode(distributionStockListEntity.getMarketCode());//商场编码 + distributionStockListInfo.setMarketName(distributionStockListEntity.getMarketName());//商场名称 + distributionStockListInfo.setStoreCode(distributionStockListEntity.getStoreCode());//门店编码 + distributionStockListInfo.setStoreName(distributionStockListEntity.getStoreName());//门店名称 + +// distributionStockListEntity.setCategory(Optional.ofNullable(distributionParcelList.getBrandId()+"").orElse(null));//品分类 + // 品牌 + distributionStockListInfo.setBrandId(distributionStockListEntity.getBrandId()); + distributionStockListInfo.setUnpackingQuantity(0); + distributionStockListInfo.setSourceType("1"); //类型 + + distributionStockListInfo.setSku(distributionStockListEntity.getSku()); + distributionStockListInfo.setMaterialId(distributionStockListEntity.getMaterialId());//货物ID +// distributionStockListEntity.setParcelListId(distributionParcelListEntities.getId());//包件id + distributionStockListInfo.setQuantityOccupied(0);//冻结数量 + distributionStockListInfo.setServiceType(distributionStockListEntity.getServiceType());//冻结数 + + //需要包件维度的详情 + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); + warehouseUpdownGoodsEntity.setAssociationType("3"); + warehouseUpdownGoodsEntity.setAssociationValue(distributionParcelListEntity.getOrderPackageCode()); + WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity); + if (Func.isNotEmpty(locationInformation)){ +// distributionStockListInfo.setTrayName(locationInformation.get); + distributionStockListInfo.setStorageLocation(locationInformation.getAllocationTitle()); + } + distributionStockListInfo.setFactory(distributionStockArticleEntity.getFactoryTrain()); + distributionStockListInfo.setDespatch(distributionStockArticleEntity.getTrainNumber()); + distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId()); + distributionStockListInfo.setOrderCode(distributionStockArticleEntity.getOrderCode()); + distributionStockListInfo.setParcelListId(distributionParcelListEntity.getId()); + distributionStockListInfo.setPackageCode(distributionParcelListEntity.getOrderPackageCode()); + distributionStockListInfoService.save(distributionStockListInfo); + } + return distributionStockArticleEntity; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index 44551978c..5784a50d6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -566,6 +566,66 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl data = new ArrayList<>(); + BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_11.getValue()); + if (ObjectUtil.isEmpty(template)) { + throw new ServiceException("模板内容未找到"); + } + if (Func.isEmpty(incomingBatch)){ + throw new ServiceException("参数缺少"); + } + if (Func.isEmpty(packageIds)){ + throw new ServiceException("参数缺少"); + + } + String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); + orderPackgeCodeDataVO.setTemplateHtml(html); + orderPackgeCodeDataVO.setTemplateId(template.getId()); + + //查询库存品 + DistributionStockListEntity stockListEntity = this.getOne(Wrappers.query().lambda() + .eq(DistributionStockListEntity::getIncomingBatch, incomingBatch) + ); + if (Func.isEmpty(stockListEntity)){ + log.info("##############查询批次号:{}",incomingBatch); + throw new ServiceException("查询库存品信息失败"); + } + + + List ids = Func.toLongList(",", packageIds.toString()); + List inventoryPackageList = distributionStockListInfoService.list(Wrappers.query().lambda() + .eq(DistributionStockListInfoEntity::getIncomingBatch, incomingBatch) + .in(DistributionStockListInfoEntity::getParcelListId, ids) + ); + + if (Func.isNotEmpty(inventoryPackageList)){ + for (DistributionStockListInfoEntity distributionStockListInfoEntity : inventoryPackageList) { + //构建模板信息 + Map map = JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class); + map.put("id"," "); + map.put("customerName"," "); + map.put("customerTelephone"," "); + map.put("customerAddress"," "); + map.put("shipperName"," "); + map.put("shipperAddress"," "); + map.put("orderCode",distributionStockListInfoEntity.getOrderCode()); + map.put("stockPackageCode",distributionStockListInfoEntity.getPackageCode()); + String filename = QRCodeUtil.createCodeToFile(distributionStockListInfoEntity.getPackageCode()); + map.put("img", QRCodeUtil.getEmpAutograph(filename)); + if (Func.isNotEmpty(distributionStockListInfoEntity.getOrderCode())){ + String fileTypeName = QRCodeUtil.createCodeToFile(distributionStockListInfoEntity.getOrderCode()); + map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName)); + } + data.add(map); + } + } + orderPackgeCodeDataVO.setDataList(data); + return orderPackgeCodeDataVO; + } } // @Override diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index ed1ec88e0..98604cff2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -2821,13 +2821,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl distributionStockListEntities = distributionStockListMapper.selectList(Wrappers.query().lambda() + .eq(DistributionStockListEntity::getCargoNumber, stockupDTO.getCargoNumber()) + .eq(DistributionStockListEntity::getWarehouseId, myCurrentWarehouse.getId()) + ); + + + int wushuju = 0; + int youshuju = 0; + for (DistributionStockListEntity distributionStockListEntity : distributionStockListEntities) { + if (distributionStockListEntity.getSourceType().equals("1")){ + List parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderCode, distributionStockListEntity.getIncomingBatch()) + .eq(DistributionParcelListEntity::getWarehouseId, distributionStockListEntity.getWarehouseId()) + .eq(DistributionParcelListEntity::getConditions, 2) + + ); + if (Func.isNotEmpty(parcelListEntities)){ + for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); + warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); + warehouseUpdownGoodsEntity.setAssociationType("3"); + warehouseUpdownGoodsEntity.setAssociationValue(parcelListEntity.getOrderPackageCode()); + List locationStockListInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); + if (Func.isNotEmpty(locationStockListInformation)){ + int sum = locationStockListInformation.stream().mapToInt(WarehouseUpdownGoodsEntity::getNum).sum(); + youshuju += sum; + } + } + } + }else if (distributionStockListEntity.getSourceType().equals("2")){ + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setAssociationValue(stockupDTO.getCargoNumber()); + warehouseUpdownGoodsEntity.setAssociationType("4"); + warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); + warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); + List locationStockListInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); + if (Func.isNotEmpty(locationStockListInformation)){ + int sum = locationStockListInformation.stream().mapToInt(WarehouseUpdownGoodsEntity::getNum).sum(); + wushuju += sum; + } + }else { + log.info("###################库存品source_type字段缺失:{}",distributionStockListEntity.getIncomingBatch()); + } + } + + + + // 查询预约单的上的信息 StockConfigInfoVO stockConfigInfoVO = new StockConfigInfoVO(); DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); //预约信息 stockConfigInfoVO.setCustomer(reservationEntity.getConsignee()); //客户0 From 3c8e49b9673f96a50581a89ccba615d58c2d3458 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 11 Dec 2023 11:27:19 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E6=AC=A7=E6=B4=BE=E8=A7=A3=E6=9E=90=E6=8A=A5=E9=94=99=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/factory/oupai/service/IFactoryOrderService.java | 2 +- .../factory/oupai/service/impl/FactoryOrderServiceImpl.java | 3 ++- .../factory/oupai/service/impl/OuPaiFactoryServiceImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryOrderService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryOrderService.java index 60876c839..465ed771e 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryOrderService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryOrderService.java @@ -39,7 +39,7 @@ public interface IFactoryOrderService extends BaseService { IPage selectFactoryOrderPage(IPage page, FactoryOrderVO factoryOrder); - FactoryOrderEntity selectEntityBySelfCode(String selfCode); + FactoryOrderEntity selectEntityBySelfCode(String selfCode,Long receivingId); /** * 根据包件查询订单 diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryOrderServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryOrderServiceImpl.java index a992aee7a..cfafd5d1b 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryOrderServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryOrderServiceImpl.java @@ -40,10 +40,11 @@ public class FactoryOrderServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.select("self_code","id"); queryWrapper.eq("self_code",selfCode); + queryWrapper.eq("receiving_id",receivingId); return baseMapper.selectOne(queryWrapper); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java index ac92e1057..2d7f7db07 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java @@ -738,7 +738,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { } String selfCode = orderEntity.getString("SelfCode");//订单自编码 //先查询是否存在订单自编码 - FactoryOrderEntity factoryOrderEntity = factoryOrderService.selectEntityBySelfCode(selfCode); + FactoryOrderEntity factoryOrderEntity = factoryOrderService.selectEntityBySelfCode(selfCode,receivingId); if (Objects.isNull(factoryOrderEntity)) { factoryOrderEntity = new FactoryOrderEntity(); @@ -844,7 +844,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService { boolean save = factoryOrderService.save(factoryOrderEntity); if (!save) { - log.warn("############handleData: 保存订单失败 selfCode={}", selfCode); + log.error("############handleData: 保存订单失败 selfCode={}", selfCode); throw new CustomerException(403, "保存订单失败"); } } From 2bdafe67c1b43bd4bf248fea0a4ecd08a56bdf24 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 11 Dec 2023 11:30:28 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionDeliveryListMapper.xml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 3202b41ee..4df52c6df 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1334,8 +1334,20 @@ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml index 00715c3a6..4f5b202a5 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadingLogMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml index eae6331d7..c63a931d8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml @@ -53,10 +53,9 @@ ltco.order_code orderCode, ltco.plan_num planNum, sum(ltcls.num) loadingNum, - sum(ltcus.num) unloadingNum + sum(ltcls.unload_num) unloadingNum from logpm_trunkline_cars_order ltco - left join logpm_trunkline_cars_load_scan ltcls on ltcls.waybill_no = ltco.waybill_no - left join logpm_trunkline_cars_unload_scan ltcus on ltcus.waybill_no = ltco.waybill_no + left join logpm_trunkline_cars_load_scan ltcls on ltcls.waybill_no = ltco.waybill_no and ltco.order_code = ltcls.order_code and ltco.load_id = ltcls.load_id where ltco.load_id = #{loadId} and ltco.node_id = #{nodeId} and ltco.type = 2 @@ -71,7 +70,7 @@ real_num loadingNum, unload_num unloadNum from logpm_trunkline_cars_order - where is_deleted = 0, + where is_deleted = 0 and load_id = #{loadId} and final_node_id = #{warehouseId} and `type` = 2 diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml index c0504682b..29752c060 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadLogMapper.xml @@ -39,8 +39,4 @@ and waybill_no = #{waybillNo} - - - 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 411382555..ef327d5be 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 @@ -1,6 +1,5 @@ package com.logpm.trunkline.service.impl; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -14,8 +13,12 @@ import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; import com.logpm.distribution.feign.IDistributionStockArticleClient; +import com.logpm.trunkline.bean.Resp; import com.logpm.trunkline.dto.*; -import com.logpm.trunkline.entity.*; +import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; +import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; +import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; +import com.logpm.trunkline.entity.TrunklineCarsOrderEntity; import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper; import com.logpm.trunkline.service.*; import com.logpm.trunkline.vo.*; @@ -1487,6 +1490,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl plList = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId); - for (DistributionParcelListEntity parcelListEntity : plList) { - Integer quantity = parcelListEntity.getQuantity(); - String firsts = parcelListEntity.getFirsts(); - JSONObject detail = new JSONObject(); - detail.put("productName",firsts); - detail.put("stockNum",quantity); - plDetail.add(detail); +// JSONArray plDetail = new JSONArray(); +// List plList = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId); +// for (DistributionParcelListEntity parcelListEntity : plList) { +// Integer quantity = parcelListEntity.getQuantity(); +// String firsts = parcelListEntity.getFirsts(); +// JSONObject detail = new JSONObject(); +// detail.put("productName",firsts); +// detail.put("stockNum",quantity); +// plDetail.add(detail); +// } +// jsonObject.put("details",plDetail); + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(!Objects.isNull(stockArticleEntity)){ + jsonObject.put("waybillNo",stockArticleEntity.getWaybillNumber()); + }else{ + jsonObject.put("waybillNo",""); } - jsonObject.put("details",plDetail); zeroList.add(jsonObject); } if("3".equals(associationType)){ @@ -1878,6 +1897,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl updownGoodsByStock = warehouseUpdownGoodsService.getUpdownGoodsByStock(marketId, materialCode, incomingBatch,warehouseId);