From be37484c131c7460c557c4f6042feeed73e83a0b Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Tue, 27 Aug 2024 20:09:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=BD=92=E5=B1=9E=E9=83=A8=E9=97=A8=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/supervise/service/impl/IndicatorsServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java index d69b1d098..a8562510e 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java @@ -184,7 +184,7 @@ public class IndicatorsServiceImpl extends BaseServiceImpl list = baseMapper.selectExportList(indicatorsDTO); for (ExportIndicatorsVO exportIndicatorsVO : list) { - Long deptId = exportIndicatorsVO.getCreateDept(); + Long deptId = exportIndicatorsVO.getExamineDeptId(); String deptName = deptClient.findNameById(deptId); exportIndicatorsVO.setCreateDeptName(deptName); Long createUser = exportIndicatorsVO.getCreateUser(); From a7009a57d79d86ddd868d34b1b040ab0af1e6ab9 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Tue, 27 Aug 2024 21:39:08 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=BD=92=E5=B1=9E=E9=83=A8=E9=97=A8=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=982?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/logpm/supervise/mapper/IndicatorsMapper.xml | 2 +- .../supervise/service/impl/IndicatorsServiceImpl.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml index e956ea312..5a86b1d84 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/mapper/IndicatorsMapper.xml @@ -113,7 +113,7 @@ sc.name classifyName, sc.description classifyDesc, si.remark indicatorsRemark, - sc.examine_dept_id examineDeptId, + sc.create_dept examineDeptId, sc.examine_dept_name examineDeptName, psc.name parentClassifyName, psc.description parentClassifyDesc, diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java index a8562510e..843a2b373 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java @@ -17,6 +17,7 @@ import org.springblade.common.utils.CommonUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.entity.User; import org.springblade.system.feign.IDeptClient; import org.springblade.system.feign.IUserClient; @@ -173,13 +174,17 @@ public class IndicatorsServiceImpl extends BaseServiceImpl list = baseMapper.selectExportList(indicatorsDTO); From 779c2d89b169d4a4d2bb82205f639d41f381f1d6 Mon Sep 17 00:00:00 2001 From: chenlong Date: Wed, 28 Aug 2024 11:06:37 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=A2=A6=E5=A4=A9=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=8E=A8=E9=80=81BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mt/service/impl/MtOrderLogFailRetryServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtOrderLogFailRetryServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtOrderLogFailRetryServiceImpl.java index 67a513c99..33c22fb61 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtOrderLogFailRetryServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtOrderLogFailRetryServiceImpl.java @@ -9,6 +9,7 @@ import com.logpm.factory.mt.service.MtOrderLogFailRetryService; import com.logpm.factory.props.MtFactoryProperties; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.annotations.LogpmAsync; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -54,7 +55,7 @@ public class MtOrderLogFailRetryServiceImpl implements MtOrderLogFailRetryServic protected final Integer SIGN_TYPE = 6; - @Async + @LogpmAsync("asyncExecutor") @Override public void retry(List waitData){ waitData.forEach(this::executeRetry); From 9ff80fc0155980e1a37f787f01527cc24e1bc284 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 28 Aug 2024 16:07:12 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B8=82=E9=85=8D?= =?UTF-8?q?=E9=A2=84=E7=BA=A6=E3=80=81=E9=85=8D=E9=80=81=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/DistributionPlanLogEntity.java | 106 +++++++++++++ .../mapper/DistributionPlanLogMapper.java | 46 ++++++ .../mapper/DistributionPlanLogMapper.xml | 30 ++++ .../service/IDistributionPlanLogService.java | 31 ++++ .../DistributionDeliveryListServiceImpl.java | 113 +++++++++++++- .../impl/DistributionPlanLogServiceImpl.java | 38 +++++ .../DistributionReservationServiceImpl.java | 139 +++++++++++++----- 7 files changed, 462 insertions(+), 41 deletions(-) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPlanLogEntity.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.xml create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPlanLogService.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPlanLogServiceImpl.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPlanLogEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPlanLogEntity.java new file mode 100644 index 000000000..ee52de4ed --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionPlanLogEntity.java @@ -0,0 +1,106 @@ +/* + * 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.distribution.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * PAD备货扫描记录 实体类 + * + * @author cyz + * @since 2023-06-26 + */ +@Data +@TableName("logpm_distribution_plan_log") +@ApiModel(value = "DistributionPlanLogEntity对象", description = "计划日志") +@EqualsAndHashCode(callSuper = true) +public class DistributionPlanLogEntity extends TenantEntity { + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + /** + * 关联ID + */ + @ApiModelProperty(value = "关联ID") + private Long refId; + + /** + * 关联任务Code + */ + @ApiModelProperty(value = "关联任务Code") + private String refCode; + + /** + * 仓库ID + */ + @ApiModelProperty(value = "仓库ID") + private Long warehouseId; + + /** + * 仓库名称 + */ + @ApiModelProperty(value = "仓库名称") + private String warehouseName; + + /** + * 描述 + */ + @ApiModelProperty(value = "描述") + private String content; + + /** + * 操作人 + */ + @ApiModelProperty(value = "操作人") + private String operator; + /** + * 货位 + */ + @ApiModelProperty(value = "类型 1-预约计划,2-自提计划,3-配送计划,4-备货计划") + private Integer type; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.java new file mode 100644 index 000000000..d718cc55c --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.java @@ -0,0 +1,46 @@ +/* + * 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.distribution.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.DistributionLoadingNumDTO; +import com.logpm.distribution.dto.DistributionParcelNumberDTO; +import com.logpm.distribution.dto.DistributionReservationDTO; +import com.logpm.distribution.entity.*; +import com.logpm.distribution.vo.*; +import com.logpm.oldproject.dto.SignPushDataContactDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 预约列表 Mapper 接口 + * + * @author TJJ + * @since 2023-06-12 + */ +@Mapper +public interface DistributionPlanLogMapper extends BaseMapper { + + + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.xml new file mode 100644 index 000000000..a4e5116c7 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPlanLogMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPlanLogService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPlanLogService.java new file mode 100644 index 000000000..d5cdcabec --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionPlanLogService.java @@ -0,0 +1,31 @@ +/* + * 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.distribution.service; + +import com.logpm.distribution.entity.DistributionPlanLogEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * 配送计划日志服务类 + * + * @author cyz + * @since 2023-07-25 + */ +public interface IDistributionPlanLogService extends BaseService { + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 3590b9ad2..530fe9499 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -264,6 +264,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl oldList, List newList, BasicdataWarehouseEntity myCurrentWarehouse) { + List addNewList = newList.stream().filter(f -> !oldList.stream().map(DistributionReservationEntity::getId).collect(Collectors.toList()).contains(f.getId())).collect(Collectors.toList()); + List reservationLogList= new ArrayList<>(); + if (!addNewList.isEmpty()) { + //存在新增 + for (DistributionReservationEntity reservationEntity : addNewList) { + String reservationContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"进行预约计划新增转配送;预约计划:"+reservationEntity.getReservationCode() + +"车次号:"+deliveryListEntity.getTrainNumber(); + DistributionPlanLogEntity reservationPlanLogEntity = new DistributionPlanLogEntity(); + reservationPlanLogEntity.setContent(reservationContent); + reservationPlanLogEntity.setRefId(reservationEntity.getId()); + reservationPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); + reservationPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + reservationPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + reservationPlanLogEntity.setOperator(user.getNickName()); + reservationPlanLogEntity.setType(1); + reservationLogList.add(reservationPlanLogEntity); + } + } + List deletedList = oldList.stream().filter(f -> !newList.stream().map(DistributionReservationEntity::getId).collect(Collectors.toList()).contains(f.getId())).collect(Collectors.toList()); + if (!deletedList.isEmpty()) { + //存在取消 + for (DistributionReservationEntity reservationEntity : addNewList) { + String reservationContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"进行预约计划取消转配送;预约计划:"+reservationEntity.getReservationCode() + +"车次号:"+deliveryListEntity.getTrainNumber(); + DistributionPlanLogEntity reservationPlanLogEntity = new DistributionPlanLogEntity(); + reservationPlanLogEntity.setContent(reservationContent); + reservationPlanLogEntity.setRefId(reservationEntity.getId()); + reservationPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); + reservationPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + reservationPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + reservationPlanLogEntity.setOperator(user.getNickName()); + reservationPlanLogEntity.setType(1); + reservationLogList.add(reservationPlanLogEntity); + } + } + if (!reservationLogList.isEmpty()){ + distributionPlanLogService.saveBatch(reservationLogList); + String distributionContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"修改市配配送计划;车次号:"+deliveryListEntity.getTrainNumber() + +"预约编号:["+oldList.stream().map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(","))+"]变更为-->["+newList.stream().map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(","))+"]"; + DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); + distributionPlanLogEntity.setContent(distributionContent); + distributionPlanLogEntity.setRefId(deliveryListEntity.getId()); + distributionPlanLogEntity.setRefCode(deliveryListEntity.getTrainNumber()); + distributionPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + distributionPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + distributionPlanLogEntity.setOperator(user.getNickName()); + distributionPlanLogEntity.setType(3); + distributionPlanLogService.save(distributionPlanLogEntity); + } + } + @Override public IPage getPackageListByDeliverylistId(IPage page, Map distributionDeliveryInfoDTO) throws ParseException { if (Func.isEmpty(distributionDeliveryInfoDTO.get("deliveryId"))) { @@ -4307,7 +4367,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl().lambda().eq(DistributionDeliveryTripartiteEntity::getId, loadingId).set(DistributionDeliveryTripartiteEntity::getDepartureTime, format)); + b = distributionDeliveryTripartiteService.update(new UpdateWrapper().lambda() + .eq(DistributionDeliveryTripartiteEntity::getId, loadingId) + .set(DistributionDeliveryTripartiteEntity::getDepartureTime, format)); } //修改主表状态 @@ -4324,7 +4386,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl cancelMarketDeliveryListTask(Map distributionDeliveryListDTO) { - //1、查询配送计划下的预约、订单、包件信息 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if (Objects.isNull(myCurrentWarehouse)){ + return R.fail(403,"未授权!!!"); + } + String deliveryListId = (String) distributionDeliveryListDTO.get("deliveryListId"); DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryListId); List distributionSignforEntities = distributionSignforServicer.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId())); BladeUser user = AuthUtil.getUser(); + List reservationList = new ArrayList<>(); distributionSignforEntities.forEach(s -> { - //2、将预约计划进行确认状态的回滚 -// DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(s.getReservationId()); DistributionReservationEntity reservationEntity = distributionReservationMapper.selectOne(Wrappers.query().lambda() .eq(DistributionReservationEntity::getId, s.getReservationId()) .ne(DistributionReservationEntity::getReservationStatus, ReservationStatusConstant.yiquexiao.getValue()) ); + reservationList.add(reservationEntity); reservationEntity.setReservationStatus(ReservationStatusConstant.yiqueren.getValue()); reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue()); distributionReservationMapper.updateById(reservationEntity); @@ -4426,9 +4490,46 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationList, BasicdataWarehouseEntity myCurrentWarehouse) { + List reservationLogList = new ArrayList<>(); + //进行预约计划日志 + for (DistributionReservationEntity reservationEntity : reservationList) { + String reservationContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"进行预约计划取消转配送;预约计划:"+reservationEntity.getReservationCode() + +"车次号:"+deliveryListEntity.getTrainNumber(); + DistributionPlanLogEntity reservationPlanLogEntity = new DistributionPlanLogEntity(); + reservationPlanLogEntity.setContent(reservationContent); + reservationPlanLogEntity.setRefId(reservationEntity.getId()); + reservationPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); + reservationPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + reservationPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + reservationPlanLogEntity.setOperator(user.getNickName()); + reservationPlanLogEntity.setType(1); + reservationLogList.add(reservationPlanLogEntity); + } + if (!reservationLogList.isEmpty()) { + distributionPlanLogService.saveBatch(reservationLogList); + } + String distributionContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"取消市配配送计划;车次号:"+deliveryListEntity.getTrainNumber() + +"预约编号:["+reservationList.stream().map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(","))+"]"; + DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); + distributionPlanLogEntity.setContent(distributionContent); + distributionPlanLogEntity.setRefId(deliveryListEntity.getId()); + distributionPlanLogEntity.setRefCode(deliveryListEntity.getTrainNumber()); + distributionPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + distributionPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + distributionPlanLogEntity.setOperator(user.getNickName()); + distributionPlanLogEntity.setType(3); + distributionPlanLogService.save(distributionPlanLogEntity); + + } + @Override public List selectDistributionDeliveryinventory(IPage page, Map distributionInventoryDTO) { if (Func.isEmpty(distributionInventoryDTO.get("deliveryId"))) { diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPlanLogServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPlanLogServiceImpl.java new file mode 100644 index 000000000..59040f08b --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionPlanLogServiceImpl.java @@ -0,0 +1,38 @@ +/* + * 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.distribution.service.impl; + +import com.logpm.distribution.entity.DistributionPlanLogEntity; +import com.logpm.distribution.mapper.DistributionPlanLogMapper; +import com.logpm.distribution.service.IDistributionPlanLogService; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * 通知提货记录 服务实现类 + * + * @author cyz + * @since 2023-06-14 + */ +@Service +@AllArgsConstructor +public class DistributionPlanLogServiceImpl extends BaseServiceImpl implements IDistributionPlanLogService { + + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index aaa01d2cf..26fd90fdd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -38,23 +38,7 @@ import com.logpm.distribution.dto.DistributionReservationPackageDTO; import com.logpm.distribution.dto.DistributionStockArticleDTO; import com.logpm.distribution.dto.DistributionStockListDTO; import com.logpm.distribution.dto.DistributionStockupDTO; -import com.logpm.distribution.entity.DisStockListDetailEntity; -import com.logpm.distribution.entity.DistributionDeliveryListEntity; -import com.logpm.distribution.entity.DistributionDeliverySelfEntity; -import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity; -import com.logpm.distribution.entity.DistributionLoadscanEntity; -import com.logpm.distribution.entity.DistributionParcelListEntity; -import com.logpm.distribution.entity.DistributionParcelNumberEntity; -import com.logpm.distribution.entity.DistributionReservationEntity; -import com.logpm.distribution.entity.DistributionReservationPackageEntity; -import com.logpm.distribution.entity.DistributionReservationStockarticleEntity; -import com.logpm.distribution.entity.DistributionReservationStocklistEntity; -import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity; -import com.logpm.distribution.entity.DistributionSignforEntity; -import com.logpm.distribution.entity.DistributionStockArticleEntity; -import com.logpm.distribution.entity.DistributionStockListEntity; -import com.logpm.distribution.entity.DistributionStockupEntity; -import com.logpm.distribution.entity.DistributionStockupInfoEntity; +import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionReservationExcel; import com.logpm.distribution.mapper.DisStockListDetailMapper; import com.logpm.distribution.mapper.DistributionLoadscanMapper; @@ -69,24 +53,7 @@ import com.logpm.distribution.mapper.DistributionStockListMapper; import com.logpm.distribution.mapper.DistributionStockMapper; import com.logpm.distribution.mapper.DistributionStockupInfoMapper; import com.logpm.distribution.mapper.DistributionStockupMapper; -import com.logpm.distribution.service.IDisStockListDetailService; -import com.logpm.distribution.service.IDistributionAsyncService; -import com.logpm.distribution.service.IDistributionDeliveryListService; -import com.logpm.distribution.service.IDistributionDeliverySelfService; -import com.logpm.distribution.service.IDistributionDeliveryTripartiteService; -import com.logpm.distribution.service.IDistributionLoadscaninvnService; -import com.logpm.distribution.service.IDistributionParcelListService; -import com.logpm.distribution.service.IDistributionParcelNumberService; -import com.logpm.distribution.service.IDistributionReservationPackageService; -import com.logpm.distribution.service.IDistributionReservationService; -import com.logpm.distribution.service.IDistributionReservationStockarticleService; -import com.logpm.distribution.service.IDistributionReservationStocklistService; -import com.logpm.distribution.service.IDistributionReservationZeroPackageService; -import com.logpm.distribution.service.IDistributionSignforService; -import com.logpm.distribution.service.IDistributionStockArticleService; -import com.logpm.distribution.service.IDistributionStockListService; -import com.logpm.distribution.service.IDistributionStockupInfoService; -import com.logpm.distribution.service.IDistributionStockupService; +import com.logpm.distribution.service.*; import com.logpm.distribution.vo.DistributionParcelListVO; import com.logpm.distribution.vo.DistributionParcelNumberVO; import com.logpm.distribution.vo.DistributionReservationOrderPackageVO; @@ -301,6 +268,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl ReservationStatusConstant.daipeisong.getValue().equals(r.getReservationStatus())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); return R.fail(collect + "已进行配送 请移除"); } + //判断是否存在有取消的预约计划 + boolean cancelMatch = reservationEntityList.stream().anyMatch(r -> ReservationStatusConstant.yiquexiao.getValue().equals(r.getReservationStatus())); + if (cancelMatch) { + String collect = reservationEntityList.stream().filter(r -> ReservationStatusConstant.yiquexiao.getValue().equals(r.getReservationStatus())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); + return R.fail(collect + "已进行配送 请移除"); + } boolean flag = reservationEntityList.stream().anyMatch(s -> s.getStockupStatus().equals(ReservationStockupStatusConstant.weibeihuo.getValue())); DistributionStockupEntity stockupEntity = null; if (flag) { @@ -1479,9 +1456,45 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl reservationEntityList) { + List reservationLogList = new ArrayList<>(); + //进行预约计划日志 + for (DistributionReservationEntity reservationEntity : reservationEntityList) { + String reservationContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"进行预约计划转配送;预约计划:"+reservationEntity.getReservationCode() + +"车次号:"+distributionDeliveryListEntity.getTrainNumber(); + DistributionPlanLogEntity reservationPlanLogEntity = new DistributionPlanLogEntity(); + reservationPlanLogEntity.setContent(reservationContent); + reservationPlanLogEntity.setRefId(reservationEntity.getId()); + reservationPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); + reservationPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + reservationPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + reservationPlanLogEntity.setOperator(user.getNickName()); + reservationPlanLogEntity.setType(1); + reservationLogList.add(reservationPlanLogEntity); + } + if (!reservationLogList.isEmpty()) { + distributionPlanLogService.saveBatch(reservationLogList); + } + String distributionContent =user.getNickName()+"在"+myCurrentWarehouse.getName() + +"创建市配配送计划;车次号:"+distributionDeliveryListEntity.getTrainNumber() + +"预约编号:["+reservationEntityList.stream().map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(","))+"],总件数:"+distributionDeliveryListEntity.getDeliveryNumber(); + DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); + distributionPlanLogEntity.setContent(distributionContent); + distributionPlanLogEntity.setRefId(distributionDeliveryListEntity.getId()); + distributionPlanLogEntity.setRefCode(distributionDeliveryListEntity.getTrainNumber()); + distributionPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + distributionPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + distributionPlanLogEntity.setOperator(user.getNickName()); + distributionPlanLogEntity.setType(3); + distributionPlanLogService.save(distributionPlanLogEntity); + } + /** * 处理广播数据 * @param distributionDeliveryListEntity @@ -1579,6 +1592,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl distributionReservationStockarticleEntities = distributionReservationStockarticleService.getBaseMapper().selectList(Wrappers.query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, id).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())); Map> oldStockArticle = distributionReservationStockarticleEntities.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId)); @@ -2129,9 +2143,41 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl"+reservationEntity.getReceivingUnit()) + +",收货人:"+(reservationEntity.getConsignee().equals(oldReservation.getConsignee())?reservationEntity.getConsignee():"由"+oldReservation.getConsignee()+"变更为-->"+reservationEntity.getConsignee()) + +",联系电话:"+(reservationEntity.getDeliveryPhone().equals(oldReservation.getDeliveryPhone())?reservationEntity.getDeliveryPhone():"由"+oldReservation.getDeliveryPhone()+"变更为-->"+reservationEntity.getDeliveryPhone()) + +",收货地址:"+(reservationEntity.getDeliveryAddress().equals(oldReservation.getDeliveryAddress())?reservationEntity.getDeliveryAddress():"由"+oldReservation.getDeliveryAddress()+"变更为-->"+reservationEntity.getDeliveryAddress()) + +",计划件数:"+(newPlanNum.equals(oldPlanNum)?newPlanNum:"由"+oldPlanNum+"变更为-->"+newPlanNum); + DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); + distributionPlanLogEntity.setContent(planContent); + distributionPlanLogEntity.setRefId(reservationEntity.getId()); + distributionPlanLogEntity.setRefCode(reservationEntity.getReservationCode()); + distributionPlanLogEntity.setWarehouseId(myCurrentWarehouse.getId()); + distributionPlanLogEntity.setWarehouseName(myCurrentWarehouse.getName()); + distributionPlanLogEntity.setOperator(user.getNickName()); + distributionPlanLogEntity.setType(1); + distributionPlanLogService.save(distributionPlanLogEntity); + + + } + @Override @Transactional public R deliveryBusinessTask(DistributionDeliveryAllocationDTO allocationDTO) { @@ -3390,9 +3436,32 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl Date: Thu, 29 Aug 2024 09:38:31 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E4=B8=89=E6=96=B9=E4=B8=AD=E8=BD=AC?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/vo/TrunklineCarsLoadScanVO.java | 1 + .../TripartiteTransferController.java | 61 ++++- .../mapper/TrunklineCarsLoadScanMapper.java | 4 + .../mapper/TrunklineCarsLoadScanMapper.xml | 20 +- .../service/IOpenOrderAsyncService.java | 2 + .../ITrunklineCarsLoadScanService.java | 4 + .../service/ITrunklineCarsLoadService.java | 2 + .../impl/OpenOrderAsyncServiceImpl.java | 75 ++++++ .../TrunklineCarsLoadScanServiceImpl.java | 10 + .../impl/TrunklineCarsLoadServiceImpl.java | 231 ++++++++++++++---- .../TrunklineWaybillTrackServiceImpl.java | 18 +- 11 files changed, 371 insertions(+), 57 deletions(-) diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadScanVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadScanVO.java index a9bee5e6d..70ef81332 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadScanVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadScanVO.java @@ -7,6 +7,7 @@ import lombok.Data; public class TrunklineCarsLoadScanVO extends TrunklineCarsLoadScanEntity { private Long signOrderId; + private Long carsLoadScanId; private String destinationWarehouseName; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java index e3a5d7ea8..af225e61c 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java @@ -175,6 +175,38 @@ public class TripartiteTransferController { } + @ResponseBody + @PostMapping("/startCarsBefore") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "三方中转发车前验证", notes = "传入loadCarsDTO") + public R startCarsBefore(@RequestBody LoadCarsDTO loadCarsDTO) { + String method = "############startCars: "; + log.info(method+"请求参数{}",loadCarsDTO); + Long loadId = loadCarsDTO.getLoadId(); + try{ + + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(400,"多仓权限无法操作,请选择仓库"); + } + if(Objects.isNull(loadId)){ + log.warn(method+"三方中转id为空 loadId={}",loadId); + return R.fail(400,"三方中转id为空"); + } + + + return carsLoadService.startCarsBefore(loadId,myCurrentWarehouse.getId()); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + @ResponseBody @PostMapping("/startCars") @ApiOperationSupport(order = 1) @@ -392,6 +424,7 @@ public class TripartiteTransferController { String carNumber = carsLoadDTO.getCarNumber(); String remark = carsLoadDTO.getRemark(); String loadType = carsLoadDTO.getLoadType(); + String deliveryType = carsLoadDTO.getDeliveryType(); try{ @@ -406,18 +439,26 @@ public class TripartiteTransferController { log.warn(method+"配载id为空 loadId={}",loadId); return R.fail(400,"配载id为空"); } - if(Objects.isNull(driverId)){ - log.warn(method+"司机id为空 driverId={}",driverId); - return R.fail(400,"司机id为空"); - } - if(StringUtil.isBlank(driverName)){ - log.warn(method+"司机名称为空 driverName={}",driverName); - return R.fail(400,"司机名称为空"); + if(StringUtil.isBlank(deliveryType)){ + log.warn(method+"送货方式为空 deliveryType={}",deliveryType); + return R.fail(400,"送货方式为空"); } - if(StringUtil.isBlank(driverMobile)){ - log.warn(method+"司机电话为空 driverMobile={}",driverMobile); - return R.fail(400,"司机电话为空"); + + if(deliveryType.equals("2")){ + if(Objects.isNull(driverId)){ + log.warn(method+"司机id为空 driverId={}",driverId); + return R.fail(400,"司机id为空"); + } + + if(StringUtil.isBlank(driverName)){ + log.warn(method+"司机名称为空 driverName={}",driverName); + return R.fail(400,"司机名称为空"); + } + if(StringUtil.isBlank(driverMobile)){ + log.warn(method+"司机电话为空 driverMobile={}",driverMobile); + return R.fail(400,"司机电话为空"); + } } if(StringUtil.isBlank(chargeType)){ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java index 98db9c039..7557ffb12 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java @@ -171,4 +171,8 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper findAbnormalZeroScanList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); List findZeroStartNum(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); + + List findAllIdListByLoadIdAndNoScanStatus(@Param("loadId") Long loadId, @Param("scanStatus") String scanStatus); + + List findTransferLoadScanWaybillList(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index a8bf03373..9b8e2f006 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -80,7 +80,8 @@ + + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java index d75fcf07d..a7646fa31 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderAsyncService.java @@ -10,10 +10,12 @@ public interface IOpenOrderAsyncService { void saveLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName,Long userId,Long warehouseId,String warehouseName); void saveStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity,String nickName,Long userId); + void saveTripartiteStartCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity,String nickName,Long userId); void saveCancelStartCarLog(TrunklineCarsLoadLineEntity currentCarsLoadLineEntity, String nickName,Long userId); void saveArriveCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId); + void saveTripartiteArriveCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId); void saveCancelArriveCarLog(TrunklineCarsLoadLineEntity currentCarsLoadLineEntity, String nickName,Long userId); 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 51913e4ef..84a0a0cdd 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 @@ -166,4 +166,8 @@ public interface ITrunklineCarsLoadScanService extends BaseService findAbnormalZeroScanList(Long loadId, Long warehouseId); List findZeroStartNum(Long loadId, Long warehouseId); + + List findAllIdListByLoadIdAndNoScanStatus(Long loadId, String scanStatus); + + List findTransferLoadScanWaybillList(Long loadId, Long nodeId); } 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 183fcd320..0c29aa26a 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 @@ -223,4 +223,6 @@ public interface ITrunklineCarsLoadService extends BaseService list = trunklineCarsLoadScanService.findTransferLoadScanWaybillList(loadId,nodeId); + + for (LoadScanWaybillVO loadScanWaybillVO : list) { + String waybillNo = loadScanWaybillVO.getWaybillNo(); + Integer num = loadScanWaybillVO.getNum(); + WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); + if(Objects.isNull(waybillEntity)){ + log.warn("##############saveStartCarLog: 运单信息不存在 waybillNo={}",waybillNo); + continue; + } + Long waybillId = waybillEntity.getId(); + + String operationRemark = "运单装车"+num+"件 三方中转批次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+",司机手机:"+driverMobile; + saveLog(waybillId,waybillNo,"30",nodeName+" 三方中转装车",operationRemark,nickName,userId,nodeId,nodeName); + + operationRemark = "三方中转从"+nodeName+"发车,实际发车时间"+ CommonUtil.dateToStringGeneral(new Date()); + saveLog(waybillId,waybillNo,"40",nodeName+"已发车",operationRemark,nickName,userId,nodeId,nodeName); + } + + } + + private void saveTrackLog(Long waybillId, String waybillNo, String trackType, String refer, String operationRemark, String nickName,Long userId,Long warehouseId,String warehouseName) { TrunklineWaybillTrackEntity waybillTrackEntity = new TrunklineWaybillTrackEntity(); waybillTrackEntity.setWarehouseId(warehouseId); @@ -249,6 +294,36 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { } } + @LogpmAsync("asyncExecutor") + @Override + public void saveTripartiteArriveCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId) { + Long loadId = carsLoadLineEntity.getLoadId(); + TrunklineCarsLoadEntity carsLoadEntity = trunklineCarsLoadService.getById(loadId); + if(Objects.isNull(carsLoadEntity)){ + log.warn("##############saveCancelStartCarLog: 配载信息不存在 loadId={}",loadId); + return; + } + + Long nodeId = carsLoadLineEntity.getNodeId(); + String nodeName = carsLoadLineEntity.getNodeName(); + + + List list = trunklineCarsLoadScanService.findArriveLoadScanWaybillList(loadId,nodeId); + + for (LoadScanWaybillVO loadScanWaybillVO : list) { + String waybillNo = loadScanWaybillVO.getWaybillNo(); + WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo); + if(Objects.isNull(waybillEntity)){ + log.warn("##############saveCancelStartCarLog: 运单信息不存在 waybillNo={}",waybillNo); + continue; + } + Long waybillId = waybillEntity.getId(); + + String operationRemark = "三方中转到达"+nodeName+",到达时间"+ CommonUtil.dateToStringGeneral(new Date()); + saveLog(waybillId,waybillNo,"60",nodeName+" 三方中转到达",operationRemark,nickName,userId,nodeId,nodeName); + } + } + @LogpmAsync("asyncExecutor") @Override public void saveCancelArriveCarLog(TrunklineCarsLoadLineEntity carsLoadLineEntity, String nickName,Long userId) { 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 211f387a6..2e7e8f3c4 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 @@ -404,4 +404,14 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl findAllIdListByLoadIdAndNoScanStatus(Long loadId, String scanStatus) { + return baseMapper.findAllIdListByLoadIdAndNoScanStatus(loadId,scanStatus); + } + + @Override + public List findTransferLoadScanWaybillList(Long loadId, Long nodeId) { + return baseMapper.findTransferLoadScanWaybillList(loadId,nodeId); + } + } 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 2134603a2..d4816a506 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 @@ -1719,6 +1719,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("load_id",loadId); + + List carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); + Integer loadingNum = carsLoadScanEntityList.stream().mapToInt(t -> Objects.nonNull(t.getNum()) ? t.getNum() : 0).sum(); + Integer unloadNum = carsLoadScanEntityList.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); + + Map map = new HashMap<>(); + map.put("loadingNum",loadingNum); + map.put("unloadNum",unloadNum); + + return R.data(map); + } + @Transactional(rollbackFor = Exception.class) @Override @@ -2355,10 +2371,65 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId); + openOrderAsyncService.saveTripartiteStartCarLog(carsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId()); - String content = "包件在 " + warehouseEntity.getName() + "三方中转发车"; - packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.TRIPARTITE_TRANSFER_DEPART.getCode(), content); + List orderPackageCodes = new ArrayList<>(); + List noUnloadOrderPackageCodes = new ArrayList<>(); + + //处理三方中转未卸车数据 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("load_id",loadId); + List carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); + //把carsLoadScanEntityList中所有元素通过type进行分组 + //通过type分组区分零担和包件 + Map> carsLoadScanEntityMap = carsLoadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType)); + carsLoadScanEntityMap.keySet().forEach(type -> { + List trunklineCarsLoadScanEntities = carsLoadScanEntityMap.get(type); + if(type == 1){ + //包件 + trunklineCarsLoadScanEntities.forEach(trunklineCarsLoadScanEntity -> { + String scanCode = trunklineCarsLoadScanEntity.getScanCode(); + Integer num = trunklineCarsLoadScanEntity.getNum(); + Integer unloadNum = trunklineCarsLoadScanEntity.getUnloadNum(); + Integer isData = trunklineCarsLoadScanEntity.getIsData(); + if(unloadNum == num){ + orderPackageCodes.add(scanCode); + }else{ + //未卸车包件 + if(isData == 1){ + noUnloadOrderPackageCodes.add(scanCode); + } + } + }); + }else if(type == 2){ + //零担 + //把trunklineCarsLoadScanEntities通过orderCode进行分组 + //通过orderCode分组 + Map> orderCodeMap = trunklineCarsLoadScanEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getOrderCode)); + orderCodeMap.keySet().forEach(orderCode -> { + List trunklineCarsLoadScanEntities1 = orderCodeMap.get(orderCode); + Integer loadingNum = trunklineCarsLoadScanEntities1.stream().mapToInt(t -> Objects.nonNull(t.getNum()) ? t.getNum() : 0).sum(); + Integer unloadNum = trunklineCarsLoadScanEntities1.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); + int i = loadingNum - unloadNum; + + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId); + if(!Objects.isNull(stockArticleEntity)){ + distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(), i); + } + }); + } + }); + + + if(CollUtil.isNotEmpty(orderPackageCodes)){ + String content = "包件在 " + warehouseEntity.getName() + "三方中转发车"; + packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.TRIPARTITE_TRANSFER_DEPART.getCode(), content); + } + + if(CollUtil.isNotEmpty(noUnloadOrderPackageCodes)){ + String content = "包件在 " + warehouseEntity.getName() + "三方中转取消装车"; + packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), noUnloadOrderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_LOADING.getCode(), content); + } } catch (Exception e) { log.warn("#############startCarByLoadId: 存入日志失败"); @@ -2493,6 +2564,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId); + openOrderAsyncService.saveTripartiteArriveCarLog(carsLoadLineEntity,AuthUtil.getNickName(),AuthUtil.getUserId()); + String content = "包件在 " + warehouseEntity.getName() + "三方中转到达"; packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.ARRICE_TRIPARTITE_TRANSFER_DEPART.getCode(), content); @@ -2535,27 +2608,30 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndNoScanStatus(loadId,"3"); - try { - trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue()); + return signLoadScanByIds(scanLoadIds,warehouseId); - List orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId); - - String content = "包件在" + warehouseEntity.getName() + "被三方中转整车签收"; - packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(), content); - // 推送签收数据给工厂 - sendFactorySignTriparite(warehouseId, orderPackageCodes, warehouseEntity); - } catch (Exception e) { - log.warn("###########存入日志失败"); - } - - - return R.success("签收成功"); +// carsLoadEntity.setSignTime(new Date()); +// carsLoadEntity.setLoadStatus("90"); +// updateById(carsLoadEntity); +// +// trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date(),AuthUtil.getNickName()); +// +// try { +// trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue()); +// +// List orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId); +// +// String content = "包件在" + warehouseEntity.getName() + "被三方中转整车签收"; +// packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(), content); +// // 推送签收数据给工厂 +// sendFactorySignTriparite(warehouseId, orderPackageCodes, warehouseEntity); +// } catch (Exception e) { +// log.warn("###########存入日志失败"); +// } +// return R.success("签收成功"); } @Override @@ -3647,6 +3723,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(); try { +// if(!Objects.isNull(waybillId)){ +// WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); +// waybillPackageService.updateWaybillStatus(waybillEntity); +// WaybillLogDTO waybillLogDTO = new WaybillLogDTO(); +// waybillLogDTO.setWarehouseId(warehouseId); +// waybillLogDTO.setWarehouseName(warehouseName); +// waybillLogDTO.setWaybillNo(waybillEntity.getWaybillNo()); +// waybillLogDTO.setTrainNumber(carsLoadEntity.getCarsNo()); +// waybillLogDTO.setCarNumber(carsLoadEntity.getCarNumber()); +// waybillLogDTO.setSignUser(AuthUtil.getNickName()); +// waybillLogDTO.setSignTime(date); +// waybillLogDTO.setDriverName(carsLoadEntity.getDriverName()); +// waybillLogDTO.setNum(unloadNum); +// waybillLogDTO.setSignOrderCode(carsLoadEntity.getCarsNo()); +// waybillLogDTO.setType(1); +// waybillLogDTO.setUserId(AuthUtil.getUserId()); +// waybillLogDTO.setNickName(AuthUtil.getNickName()); +// waybillTrackService.addSignWaybillLog(waybillLogDTO); +// } + orderPackageCodes.add(orderPackageCode); String content = "包件在 " + warehouseEntity.getName() + "直发商家签收"; packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode(), content); @@ -5474,8 +5598,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl> map = trunklineCarsLoadScanEntities.stream().filter(t -> Objects.nonNull(t.getWaybillNo())).collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getWaybillNo)); map.keySet().forEach(waybillNo -> { List list = map.get(waybillNo); - //把list中所有元素的unloadNum求和,没有值就取0 - Integer unloadNum = list.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); - - WaybillLogDTO waybillLogDTO = new WaybillLogDTO(); - waybillLogDTO.setWarehouseId(warehouseId); - waybillLogDTO.setWarehouseName(warehouseName); - waybillLogDTO.setWaybillNo(waybillNo); - waybillLogDTO.setTrainNumber(carsLoadEntity.getCarsNo()); - waybillLogDTO.setCarNumber(carsLoadEntity.getCarNumber()); - waybillLogDTO.setSignUser(AuthUtil.getNickName()); - waybillLogDTO.setSignTime(date); - waybillLogDTO.setDriverName(carsLoadEntity.getDriverName()); - waybillLogDTO.setNum(unloadNum); - waybillLogDTO.setSignOrderCode(carsLoadEntity.getCarsNo()); - waybillLogDTO.setType(1); - waybillLogDTO.setUserId(AuthUtil.getUserId()); - waybillLogDTO.setNickName(AuthUtil.getNickName()); - waybillTrackService.addSignWaybillLog(waybillLogDTO); - }); + Integer signNum = 0; + if("1".equals(deliveryType)){ + signNum = list.stream().mapToInt(t -> Objects.nonNull(t.getNum()) ? t.getNum() : 0).sum(); + }else if("2".equals(deliveryType)){ + signNum = list.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); + } + if(signNum > 0){ + WaybillLogDTO waybillLogDTO = new WaybillLogDTO(); + waybillLogDTO.setWarehouseId(warehouseId); + waybillLogDTO.setWarehouseName(warehouseName); + waybillLogDTO.setWaybillNo(waybillNo); + waybillLogDTO.setTrainNumber(carsLoadEntity.getCarsNo()); + waybillLogDTO.setCarNumber(carsLoadEntity.getCarNumber()); + waybillLogDTO.setSignUser(AuthUtil.getNickName()); + waybillLogDTO.setSignTime(date); + waybillLogDTO.setDriverName(carsLoadEntity.getDriverName()); + waybillLogDTO.setNum(signNum); + waybillLogDTO.setSignOrderCode(carsLoadEntity.getCarsNo()); + waybillLogDTO.setType(1); + waybillLogDTO.setUserId(AuthUtil.getUserId()); + waybillLogDTO.setNickName(AuthUtil.getNickName()); + waybillTrackService.addSignWaybillLog(waybillLogDTO); + } + + }); } catch (Exception e) { log.warn("###########存入日志失败"); @@ -6395,7 +6538,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl waybillLogDTOList = new ArrayList<>(); QueryWrapper queryWrapper1 = new QueryWrapper<>(); - queryWrapper1.eq("load_id",warehouseId) + queryWrapper1.eq("load_id",loadId) .eq("sign_order_id",signOrderId) .eq("scan_status","3"); List signCarsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper1); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java index a7144c1a5..0aeb85233 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java @@ -100,6 +100,9 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl