|
|
|
@ -38,49 +38,14 @@ import com.logpm.distribution.dto.DistributionStockListDTO;
|
|
|
|
|
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; |
|
|
|
|
import com.logpm.distribution.dto.OrderStatusDTO; |
|
|
|
|
import com.logpm.distribution.dto.app.BillLadingAppDTO; |
|
|
|
|
import com.logpm.distribution.entity.DisStockListDetailEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionBillLadingScanEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionDeliveryChargeEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelNumberEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionPrintEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockArticleEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockupEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockupInfoEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockupScanEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistrilbutionBillStockEntity; |
|
|
|
|
import com.logpm.distribution.entity.*; |
|
|
|
|
import com.logpm.distribution.excel.DistributionBillInventoryExcel; |
|
|
|
|
import com.logpm.distribution.excel.DistributionBillOrderExcel; |
|
|
|
|
import com.logpm.distribution.excel.DistributionBillOrderPackExcel; |
|
|
|
|
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel; |
|
|
|
|
import com.logpm.distribution.mapper.DistributionStockListMapper; |
|
|
|
|
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper; |
|
|
|
|
import com.logpm.distribution.service.IDisStockListDetailService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionAsyncService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionBillLadingScanService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionDeliveryChargeService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionDeliveryDetailsService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionNodeWorkService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionParcelListService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionParcelNumberService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionPrintService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionReservationService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionReservationZeroPackageService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockArticleService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockListService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockupInfoService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockupScanService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockupService; |
|
|
|
|
import com.logpm.distribution.service.IDistrilbutionBillLadingService; |
|
|
|
|
import com.logpm.distribution.service.IDistrilbutionBillPackageService; |
|
|
|
|
import com.logpm.distribution.service.IDistrilbutionBillStockService; |
|
|
|
|
import com.logpm.distribution.service.*; |
|
|
|
|
import com.logpm.distribution.vo.DistributionDeliveryDetailsVO; |
|
|
|
|
import com.logpm.distribution.vo.DistributionParcelNumberVO; |
|
|
|
|
import com.logpm.distribution.vo.DistributionStockArticleVO; |
|
|
|
@ -115,11 +80,8 @@ import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
import org.apache.logging.log4j.util.Strings; |
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.constant.*; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant; |
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.constant.RedisKeyConstant; |
|
|
|
|
import org.springblade.common.constant.WorkNodeEnums; |
|
|
|
|
import org.springblade.common.constant.billLading.BillLadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.order.OrderReservationStatusConstant; |
|
|
|
@ -255,6 +217,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ITrunklineWaybillTrackClient trunklineWaybillTrackClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionPlanLogService distributionPlanLogService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -418,7 +382,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
//修改
|
|
|
|
|
if (!distrilbutionBillLading.getBillPackageEntityList().isEmpty() || !distrilbutionBillLading.getUnBillPackageEntityList().isEmpty()) { |
|
|
|
|
//修改新增包件
|
|
|
|
|
//todo
|
|
|
|
|
List<JSONObject> jsonObjects = updateBillPackeg(distrilbutionBillLading, myCurrentWarehouse, billLadingEntity.getPickupBatch()); |
|
|
|
|
if (!jsonObjects.isEmpty()) { |
|
|
|
|
logs.addAll(jsonObjects); |
|
|
|
@ -682,7 +645,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
List<DistributionParcelListDTO> zeroPackageList = distrilbutionBillLading.getParcelLisList(); |
|
|
|
|
zeroPackageMap = zeroPackageList.stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId)); |
|
|
|
|
} |
|
|
|
|
this.saveDistrilbutionBillLading(distrilbutionBillLading); |
|
|
|
|
this.saveDistrilbutionBillLading(distrilbutionBillLading,myCurrentWarehouse); |
|
|
|
|
// List<DistrilbutionBillPackageEntity> packageEntityList = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotBlank(distrilbutionBillLading.getStockArticleId())) { |
|
|
|
|
String[] split = distrilbutionBillLading.getStockArticleId().split(","); |
|
|
|
@ -916,10 +879,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
}); |
|
|
|
|
distributionDeliveryDetailsService.saveBatch(detailsEntities); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer integer = baseMapper.selectBillLadingPlanNum(distrilbutionBillLading.getId()); |
|
|
|
|
handleCreatedReservationPlanLog(distrilbutionBillLading,AuthUtil.getUser(),myCurrentWarehouse,integer); |
|
|
|
|
} |
|
|
|
|
//添加库存品信息
|
|
|
|
|
|
|
|
|
|
//添加费用
|
|
|
|
|
if (!distrilbutionBillLading.getFei().isEmpty()) { |
|
|
|
|
//删除和自提相关的所有费用
|
|
|
|
@ -948,6 +911,26 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleCreatedReservationPlanLog(DistrilbutionBillLadingEntity billLadingEntity, BladeUser user, BasicdataWarehouseEntity warehouse,Integer planNum) { |
|
|
|
|
String planContent = user.getNickName() + "在" + warehouse.getName() |
|
|
|
|
+ "创建自提计划;自提计划编号:" + billLadingEntity.getPickupBatch() |
|
|
|
|
+ ";收货单位:" + billLadingEntity.getConsigneeUnit() |
|
|
|
|
+ ",提货人:" + billLadingEntity.getConsignee() |
|
|
|
|
+ ",提货车牌:" + billLadingEntity.getPickUpPlate() |
|
|
|
|
+ ",提货证件:" + billLadingEntity.getDeliveryDocument()!=null?billLadingEntity.getDeliveryDocument():"未填写" |
|
|
|
|
+ ",计划件数:" + planNum; |
|
|
|
|
DistributionPlanLogEntity distributionPlanLogEntity = new DistributionPlanLogEntity(); |
|
|
|
|
distributionPlanLogEntity.setContent(planContent); |
|
|
|
|
distributionPlanLogEntity.setRefId(billLadingEntity.getId()); |
|
|
|
|
distributionPlanLogEntity.setRefCode(billLadingEntity.getPickupBatch()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseId(warehouse.getId()); |
|
|
|
|
distributionPlanLogEntity.setWarehouseName(warehouse.getName()); |
|
|
|
|
distributionPlanLogEntity.setOperator(user.getNickName()); |
|
|
|
|
distributionPlanLogEntity.setType(1); |
|
|
|
|
distributionPlanLogService.save(distributionPlanLogEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private NodeFanoutMsg<DeliveryOfPickupPlanVO> buildNodeFanoutMsgForBill(DistrilbutionBillLadingDTO distrilbutionBillLading, List<DistrilbutionBillPackageEntity> packageEntityList, List<DistributionDeliveryDetailsEntity> detailsEntities, List<DistributionReservationZeroPackageEntity> zeroPackageEntityList, List<DistributionDeliveryChargeEntity> listEntity) { |
|
|
|
|
|
|
|
|
|
if (distrilbutionBillLading.getId() == null) { |
|
|
|
@ -4272,7 +4255,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public void saveDistrilbutionBillLading(DistrilbutionBillLadingDTO distrilbutionBillLading) { |
|
|
|
|
public void saveDistrilbutionBillLading(DistrilbutionBillLadingDTO distrilbutionBillLading,BasicdataWarehouseEntity warehouse) { |
|
|
|
|
//判断是不是零担
|
|
|
|
|
List<DistributionParcelListDTO> list = new ArrayList<>(); |
|
|
|
|
boolean isZeroType = false; |
|
|
|
@ -4283,60 +4266,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
isZeroType = true; |
|
|
|
|
} |
|
|
|
|
this.save(distrilbutionBillLading); |
|
|
|
|
// if (isZeroType) {
|
|
|
|
|
// if (list.isEmpty()) {
|
|
|
|
|
// throw new ServiceException("类型数据未填写!!!");
|
|
|
|
|
// }
|
|
|
|
|
// List<DistributionReservationZeroPackageEntity> zeroPackageEntityList = new ArrayList<>();
|
|
|
|
|
// List<DistributionParcelNumberEntity> parcelNumberEntityList = new ArrayList<>();
|
|
|
|
|
// AtomicInteger nu = new AtomicInteger();
|
|
|
|
|
// //是 添加物料信息
|
|
|
|
|
// list.forEach(i -> {
|
|
|
|
|
// if (i.getQuantity() != 0) {
|
|
|
|
|
// DistributionReservationZeroPackageEntity zeroPackageEntity = new DistributionReservationZeroPackageEntity();
|
|
|
|
|
// zeroPackageEntity.setQuantity(i.getQuantity());
|
|
|
|
|
// zeroPackageEntity.setReservationId(distrilbutionBillLading.getId());
|
|
|
|
|
// zeroPackageEntity.setType("3");
|
|
|
|
|
// zeroPackageEntity.setCategoryName(i.getFirsts());
|
|
|
|
|
// zeroPackageEntity.setZeroPackageStatus("1");
|
|
|
|
|
// zeroPackageEntity.setStockArticleId(i.getStockArticleId());
|
|
|
|
|
// zeroPackageEntity.setRealityQuantity(0);
|
|
|
|
|
// //修改包件配送数量
|
|
|
|
|
// //查询
|
|
|
|
|
// DistributionStockArticleEntity byId = distributionStockArticleService.getById(i.getStockArticleId());
|
|
|
|
|
// DistributionParcelNumberEntity one = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda().eq(DistributionParcelNumberEntity::getParcelListId, i.getId()));
|
|
|
|
|
//
|
|
|
|
|
// int i1 = one.getDeliveryQuantity() + i.getQuantity();
|
|
|
|
|
// //全部数据不能大于预约数
|
|
|
|
|
// if (ObjectUtils.isNotNull(one) && i1 <= one.getHandQuantity()) {
|
|
|
|
|
// nu.addAndGet(i.getQuantity());
|
|
|
|
|
// DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
|
|
|
|
|
// parcelNumberEntity.setId(one.getId());
|
|
|
|
|
// parcelNumberEntity.setDeliveryQuantity(one.getDeliveryQuantity() + i.getQuantity());
|
|
|
|
|
// parcelNumberEntity.setHandQuantity(byId.getHandQuantity());
|
|
|
|
|
// parcelNumberEntityList.add(parcelNumberEntity);
|
|
|
|
|
// zeroPackageEntity.setParcelListId(one.getParcelListId());
|
|
|
|
|
// zeroPackageEntityList.add(zeroPackageEntity);
|
|
|
|
|
// } else {
|
|
|
|
|
// throw new ServiceException("配送数量大于在库数量!!");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// if (!parcelNumberEntityList.isEmpty()) {
|
|
|
|
|
// parcelNumberEntityList.forEach(p -> {
|
|
|
|
|
// if (nu.get() <= p.getHandQuantity()) {
|
|
|
|
|
// p.setHandQuantity(null);
|
|
|
|
|
// distributionParcelNumberService.updateById(p);
|
|
|
|
|
// } else {
|
|
|
|
|
// throw new ServiceException("预约数量大于在库数量!!");
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// } else {
|
|
|
|
|
// throw new ServiceException("数据异常,请联系管理员!!");
|
|
|
|
|
// }
|
|
|
|
|
// distributionZeroPackageService.saveBatch(zeroPackageEntityList);
|
|
|
|
|
// }
|
|
|
|
|
//新增自提日志
|
|
|
|
|
// 创建备货任务
|
|
|
|
|
DistributionStockupEntity distributionStockupEntity = buildDistributionStockupEntityBydistrilbutionBillLading(distrilbutionBillLading); |
|
|
|
|
|
|
|
|
|