Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
pref_mail@163.com 1 week ago
parent
commit
83b60ff8f5
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  2. 5
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceRuleEntity.java
  3. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  4. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java
  5. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java
  7. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  8. 183
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  9. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  11. 2
      blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java
  12. 5
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java
  13. 40
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java
  14. 34
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java
  15. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/QualityDispatchNumberMapper.xml
  16. 55
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  17. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeDetailVO.java
  18. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java
  19. 1
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java
  20. 13
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java
  21. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java
  22. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/PackageCodeDTO.java
  23. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  24. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  25. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  26. 23
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  27. 331
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  28. 236
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -17,6 +17,7 @@ public enum WorkNodeEnums implements Serializable {
INITIAL_DATA_ENTRY(101010, "数据入库"), INITIAL_DATA_ENTRY(101010, "数据入库"),
INITIAL_WAREHOUSE_ENTRY(101020, "始发仓入库"), INITIAL_WAREHOUSE_ENTRY(101020, "始发仓入库"),
UNLOAD_WAREHOUSE_ENTRY(101021, "卸车并入库"), UNLOAD_WAREHOUSE_ENTRY(101021, "卸车并入库"),
ERROR_WAREHOUSE_ENTRY(101022, "异常入库"),
OPEN_ORDER(102010, "开单"), OPEN_ORDER(102010, "开单"),
CHANGE_ORDER(102020, "改单"), CHANGE_ORDER(102020, "改单"),
@ -46,6 +47,7 @@ public enum WorkNodeEnums implements Serializable {
SIGN_DIRECT_SHIPPER(105030,"直发商家签收"), SIGN_DIRECT_SHIPPER(105030,"直发商家签收"),
END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"), END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"),
NO_STOCK_CAR(105050, "本车次少货"), NO_STOCK_CAR(105050, "本车次少货"),
NO_DATA(105051, "无效包条码"),
COST_SHARE(105060, "车次成本分摊"), COST_SHARE(105060, "车次成本分摊"),
SORTING_TRAYS(201010, "分拣打托"), SORTING_TRAYS(201010, "分拣打托"),

5
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceRuleEntity.java

@ -105,6 +105,11 @@ public class ExpenseDispatchPriceRuleEntity extends TenantEntity {
*/ */
@ApiModelProperty(value = "是否点位补贴计费") @ApiModelProperty(value = "是否点位补贴计费")
private Integer ynSiteSubsidy; private Integer ynSiteSubsidy;
/**
* 是否点位合并区域
*/
@ApiModelProperty(value = "是否点位合并区域")
private Integer ynMergePointArea;
/** /**
* 是否保底费 * 是否保底费
*/ */

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -148,7 +148,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode); warehousePackageTrackLogEntity.setOrderPackageCode(orderPackageCode);
warehousePackageTrackLogEntity.setWarehouseId(abnormalRecordDTO.getWarehouseId()); warehousePackageTrackLogEntity.setWarehouseId(abnormalRecordDTO.getWarehouseId());
warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName()); warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode()); warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.NO_DATA.getCode());
warehousePackageTrackLogEntity.setContent("异常处理已确认为无效包条码"); warehousePackageTrackLogEntity.setContent("异常处理已确认为无效包条码");
warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName()); warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName());
List<JSONObject> ls = new ArrayList<>(); List<JSONObject> ls = new ArrayList<>();

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java

@ -248,6 +248,9 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
} }
}catch (CustomerException e){
log.error("保存失败!", e);
throw new CustomerException(405, e.getMessage());
}catch (Exception e){ }catch (Exception e){
log.error("保存失败!", e); log.error("保存失败!", e);
throw new CustomerException(405, "保存失败!"); throw new CustomerException(405, "保存失败!");
@ -284,7 +287,7 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
*/ */
private String buildEqualString(BasicdataFactoryCategoryEntity allBasicdataFactoryCategoryEntity) { private String buildEqualString(BasicdataFactoryCategoryEntity allBasicdataFactoryCategoryEntity) {
StringBuilder stringBuffer = new StringBuilder(); StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(allBasicdataFactoryCategoryEntity.getBrand()).append(allBasicdataFactoryCategoryEntity.getCategory()); stringBuffer.append(allBasicdataFactoryCategoryEntity.getBrand());
// 增加结算类型 收入或者成本 // 增加结算类型 收入或者成本
stringBuffer.append(allBasicdataFactoryCategoryEntity.getType()); stringBuffer.append(allBasicdataFactoryCategoryEntity.getType());
@ -322,7 +325,7 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
*/ */
private String buildEqualString2(BasicdataFactoryCategoryExcel datum) { private String buildEqualString2(BasicdataFactoryCategoryExcel datum) {
StringBuilder stringBuffer = new StringBuilder(); StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(datum.getBrand()).append(datum.getCategory()); stringBuffer.append(datum.getBrand());
// 增加结算类型 收入或者成本 // 增加结算类型 收入或者成本
stringBuffer.append(datum.getType()); stringBuffer.append(datum.getType());
if (ObjectUtil.isNotEmpty(datum.getFirsts())) { if (ObjectUtil.isNotEmpty(datum.getFirsts())) {

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java

@ -160,6 +160,9 @@ public class DeliverFinishReportListener implements ReportService {
entity.setWaybillNumber(qualityDeliverEntity.getWaybillNumber()); entity.setWaybillNumber(qualityDeliverEntity.getWaybillNumber());
entity.setConditions(qualityDeliverEntity.getConditions()); entity.setConditions(qualityDeliverEntity.getConditions());
entity.setSignNum(qualityDeliverEntity.getSignNum()); entity.setSignNum(qualityDeliverEntity.getSignNum());
entity.setArriveProvince(qualityDeliverEntity.getArriveProvince());
entity.setArriveCity(qualityDeliverEntity.getArriveCity());
entity.setArriveDistrict(qualityDeliverEntity.getArriveDistrict());
// 查询品类 // 查询品类
BasicdataFactoryCategoryEntity param = new BasicdataFactoryCategoryEntity(); BasicdataFactoryCategoryEntity param = new BasicdataFactoryCategoryEntity();
param.setBrand(qualityDeliverEntity.getBrandName()); param.setBrand(qualityDeliverEntity.getBrandName());
@ -763,7 +766,26 @@ public class DeliverFinishReportListener implements ReportService {
Set<Long> longs = valueMap.keySet(); Set<Long> longs = valueMap.keySet();
Integer dkp = 0; Integer dkp = 0;
if (CollUtil.isNotEmpty(allRouteMap)) { if (CollUtil.isNotEmpty(allRouteMap)) {
dkp = allRouteMap.keySet().size(); // 是否合并区域计费
Integer ynMergePointArea = rule.getYnMergePointArea();
if(NumberUtil.equals(ynMergePointArea, BooleanZeroOneEnums.YES.getCode())){
// 是 同一区域的视为一个点
Collection<QualityDeliverEntity> values = valueMap.values();
// 按省市区分组后的数量 arriveProvince arriveCity arriveDistrict
if(CollUtil.isNotEmpty(values)){
Set<String> collect1 = values.stream()
.filter(v -> StrUtil.isNotEmpty(v.getArriveProvince() + v.getArriveCity() + v.getArriveDistrict()))
.map(v -> {
return v.getArriveProvince() + v.getArriveCity() + v.getArriveDistrict();
}).collect(Collectors.toSet());
if(CollUtil.isNotEmpty(collect1)){
dkp = collect1.size();
}
}
}else{
// 否 所有点位
dkp = allRouteMap.keySet().size();
}
} }
if (!NumberUtil.equals(dkp, 0)) { if (!NumberUtil.equals(dkp, 0)) {
dkp = dkp - 1; dkp = dkp - 1;

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java

@ -335,8 +335,8 @@ public class QualityDeliverAddListener implements ReportService {
TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNumber, orderCode); TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNumber, orderCode);
if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) { if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) {
qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber()); qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber());
redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 60L);
} }
redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 60L);
} }
} }
} }

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -3984,6 +3984,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanService.save(distributionLoadscanEntity); distributionLoadscanService.save(distributionLoadscanEntity);
pushList.add(distributionLoadscanEntity); pushList.add(distributionLoadscanEntity);
loadingId = distributionLoadscanEntity.getId(); loadingId = distributionLoadscanEntity.getId();
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "扫描异常签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
pushList.add(distributionLoadscanEntity); pushList.add(distributionLoadscanEntity);
} else { } else {
loadingId = distributionLoadscanEntity.getId(); loadingId = distributionLoadscanEntity.getId();
@ -6090,13 +6092,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("num", 1); jsonObject.put("num", 1);
jsonObject.put("remark", "批量签收下架"); jsonObject.put("remark", "批量签收下架");
jsonObjects.add(jsonObject); jsonObjects.add(jsonObject);
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd()); trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
//distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName()); //distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse); sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse);
} else { } else {
loadscanEntities.setMsg("司机一键签收数据补录"); loadscanEntities.setMsg("司机一键签收数据补录");
if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//已经进行过装车 这里不需要进行订制品订单在库数量扣减 //已经进行过装车 这里不需要进行订制品订单在库数量扣减
@ -6110,11 +6110,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity()); loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setSigningTime(signingTime); loadscanEntities.setSigningTime(signingTime);
DistributionLoadscanEntity update = getDistributionLoadscanEntity(loadscanEntities); DistributionLoadscanEntity update = getDistributionLoadscanEntity(loadscanEntities);
content = "包件在" + myCurrentWarehouse.getName() + "由" + update.getSigningUser() + "司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
distributionLoadscanService.updateById(update); distributionLoadscanService.updateById(update);
distributionLoadscanEntityLists.add(loadscanEntities); distributionLoadscanEntityLists.add(loadscanEntities);
packageLockIds.add(loadscanEntities.getPackageId()); packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd()); trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
// 节点作业推送 // 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse); sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse);
@ -6131,21 +6130,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(packageIds)) { if (Func.isNotEmpty(packageIds)) {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId()); distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
} }
// if (Func.isNotEmpty(packageCodes)) {
//批量下架
// String collected = packageCodes.stream().distinct().collect(Collectors.joining(","));
// log.info(method + "司机批量签收进行包件下架:{}", collected);
// Map<String, Object> map = new HashMap<>();
// map.put("orderPackageCode", collected);
// map.put("warehouseId", myCurrentWarehouse.getId());
// warehouseUpdownTypeClient.downDeliveryPackage(map);
// trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
// }
} }
//维护客户信息状态 //维护客户信息状态
// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
// reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue());
// distributionReservationMapper.updateById(reservationEntity);
//更新配送装车时间 //更新配送装车时间
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());

183
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java

@ -24,11 +24,11 @@ import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.SplitPackageOrderVO; import com.logpm.distribution.vo.SplitPackageOrderVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.order.OrderSplitAllTaskStateConstant; import org.springblade.common.constant.order.OrderSplitAllTaskStateConstant;
import org.springblade.common.constant.order.OrderSplitStateConstant; import org.springblade.common.constant.order.OrderSplitStateConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageSplitStateConstant; import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.exception.CustomerException; import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -106,6 +107,27 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
if (distributionStockArticle == null) { if (distributionStockArticle == null) {
return R.fail("原订单信息错误"); return R.fail("原订单信息错误");
} }
if (!Objects.equals(distributionStockArticle.getOrderStatus(), OrderStatusConstant.ruku.getValue())
|| Objects.equals(distributionStockArticle.getReservationStatus(), OrderReservationStatusConstant.yiyueyue.getValue())) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"不允许拆单");
}
long packageAllowCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
);
long packageAllCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getStockArticleId, stockArticleId)
);
if (packageAllowCount == 0 || packageAllCount == 1) {
return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单");
}
taskLock(stockArticleId, () -> { taskLock(stockArticleId, () -> {
String allTaskNo = getAllTaskNo(); String allTaskNo = getAllTaskNo();
@ -210,6 +232,28 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.fail("拆单任务已完成,无法添加"); return R.fail("拆单任务已完成,无法添加");
} }
// 预约、签收状态的不允许拆单
long count = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getOrderPackageCode, packageCodes)
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue())
.eq(DistributionParcelListEntity::getIsTransfer, 0)
);
if (count != packageCodes.size()) {
return R.fail("提交包件包含预约、签收状态的包件");
}
long currentOrderCount = distributionParcelListService.count(
Wrappers.<DistributionParcelListEntity>lambdaQuery()
.in(DistributionParcelListEntity::getOrderPackageCode, packageCodes)
.eq(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId())
);
if (currentOrderCount < packageCodes.size()){
return R.fail("提交包件包含不属于当前拆单订单的包件");
}
try { try {
List<DistributionSplitOrderDetailEntity> existsList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery() List<DistributionSplitOrderDetailEntity> existsList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes) .in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes)
@ -617,48 +661,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
try { try {
List<DistributionSplitOrderDetailEntity> packageList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId)
.eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue())
);
DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId());
originalOrder.setTotalNumber(originalOrder.getTotalNumber() - packageList.size());
originalOrder.setHandQuantity(Math.max(originalOrder.getHandQuantity() - packageList.size(), 0));
originalOrder.setIncomingNum(Math.max(originalOrder.getIncomingNum() - packageList.size(), 0));
distributionStockArticleService.updateById(originalOrder);
DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId());
if (newOrder == null) {
newOrder = SerializationUtils.clone(originalOrder);
newOrder.setId(null);
newOrder.setOrderCode(task.getNewOrderCode());
}
newOrder.setTotalNumber(packageList.size());
newOrder.setHandQuantity(packageList.size());
newOrder.setIncomingNum(packageList.size());
if (newOrder.getId() != null) {
distributionStockArticleService.updateById(newOrder);
}else{
distributionStockArticleService.save(newOrder);
}
task.setNewStockArticleId(newOrder.getId());
task.setState(OrderSplitStateConstant.finish.getValue()); task.setState(OrderSplitStateConstant.finish.getValue());
task.setFinishTime(DateUtil.now()); task.setFinishTime(DateUtil.now());
task.setFinishUsername(AuthUtil.getUser().getUserName()); task.setFinishUsername(AuthUtil.getUser().getUserName());
task.setFinishUser(AuthUtil.getUser().getUserId()); task.setFinishUser(AuthUtil.getUser().getUserId());
updateById(task); updateById(task);
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>lambdaUpdate()
.in(DistributionParcelListEntity::getOrderPackageCode, packageList.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList()))
.eq(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId())
.set(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId())
.set(DistributionParcelListEntity::getOrderCode, task.getNewOrderCode())
);
distributionSplitOrderLogService.record(task, "完成拆单任务", AuthUtil.getUser().getUserName());
} catch (Exception e) { } catch (Exception e) {
if (e instanceof CustomerException) { if (e instanceof CustomerException) {
throw new CustomerException(e.getMessage()); throw new CustomerException(e.getMessage());
@ -670,50 +678,67 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
return R.success("success"); return R.success("success");
} }
private void packageTransfer(DistributionSplitOrderTaskEntity task) {
List<DistributionSplitOrderDetailEntity> packageList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId())
.eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue())
);
DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId());
originalOrder.setTotalNumber(originalOrder.getTotalNumber() - packageList.size());
originalOrder.setHandQuantity(Math.max(originalOrder.getHandQuantity() - packageList.size(), 0));
originalOrder.setIncomingNum(Math.max(originalOrder.getIncomingNum() - packageList.size(), 0));
distributionStockArticleService.updateById(originalOrder);
DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId());
if (newOrder == null) {
newOrder = SerializationUtils.clone(originalOrder);
newOrder.setId(null);
newOrder.setOrderCode(task.getNewOrderCode());
}
newOrder.setTotalNumber(packageList.size());
newOrder.setHandQuantity(packageList.size());
newOrder.setIncomingNum(packageList.size());
if (newOrder.getId() != null) {
distributionStockArticleService.updateById(newOrder);
}else{
distributionStockArticleService.save(newOrder);
}
task.setNewStockArticleId(newOrder.getId());
updateById(task);
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>lambdaUpdate()
.in(DistributionParcelListEntity::getOrderPackageCode, packageList.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList()))
.eq(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId())
.set(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId())
.set(DistributionParcelListEntity::getOrderCode, task.getNewOrderCode())
);
distributionSplitOrderLogService.record(task, "完成拆单任务", AuthUtil.getUser().getUserName());
}
/**
* 取消完成
* @param taskId
* @return
*/
@Override @Override
public R<String> cancelTask(Long taskId) { public R<String> cancelTask(Long taskId) {
DistributionSplitOrderTaskEntity task = getById(taskId); DistributionSplitOrderTaskEntity task = getById(taskId);
if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) { if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) {
return R.fail("任务未已完成或已取消,无法操作"); return R.fail("任务未已完成,无法操作");
} }
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId()); DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId());
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) { if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) {
return R.fail("拆单总任务已完成或已取消,无法操作"); return R.fail("拆单总任务已完成,无法操作");
} }
try { try {
List<DistributionSplitOrderDetailEntity> packageList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId)
.eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue())
);
DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId());
originalOrder.setTotalNumber(originalOrder.getTotalNumber() + packageList.size());
originalOrder.setHandQuantity(originalOrder.getHandQuantity() + packageList.size());
distributionStockArticleService.updateById(originalOrder);
DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId());
if (newOrder != null) {
newOrder.setTotalNumber(0);
newOrder.setHandQuantity(0);
distributionStockArticleService.updateById(newOrder);
}
task.setNumber(0);
task.setState(OrderSplitStateConstant.cancel.getValue()); task.setState(OrderSplitStateConstant.cancel.getValue());
updateById(task); updateById(task);
if (!packageList.isEmpty()) {
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>lambdaUpdate()
.in(DistributionParcelListEntity::getOrderPackageCode, packageList.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList()))
.eq(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId())
.set(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId())
.set(DistributionParcelListEntity::getOrderCode, task.getOrderCode())
);
}
distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName()); distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName());
} catch (Exception e) { } catch (Exception e) {
@ -731,16 +756,24 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
public R<String> cancelAllTask(Long allTaskId) { public R<String> cancelAllTask(Long allTaskId) {
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId); DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId);
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.finish.getValue())) { if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.finish.getValue())) {
return R.fail("拆单总任务未完成或已取消,无法操作"); return R.fail("拆单总任务已完成,无法操作");
} }
allTask.setState(OrderSplitAllTaskStateConstant.InProgress.getValue()); if (!list(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue())
).isEmpty()) {
return R.fail("拆单总任务中存在已完成拆单任务,无法操作");
}
allTask.setState(OrderSplitAllTaskStateConstant.cancel.getValue());
distributionSplitOrderAllTaskService.updateById(allTask); distributionSplitOrderAllTaskService.updateById(allTask);
return R.success("success"); return R.success("success");
} }
@Override @Override
@Transactional
public R<String> finishAllTask(Long allTaskId) { public R<String> finishAllTask(Long allTaskId) {
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId); DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId);
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) { if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) {
@ -756,8 +789,16 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
} }
allTask.setState(OrderSplitAllTaskStateConstant.finish.getValue()); allTask.setState(OrderSplitAllTaskStateConstant.finish.getValue());
allTask.setFinishTime(DateUtil.now());
allTask.setFinishUsername(AuthUtil.getUser().getUserName());
allTask.setFinishUser(AuthUtil.getUser().getUserId());
distributionSplitOrderAllTaskService.updateById(allTask); distributionSplitOrderAllTaskService.updateById(allTask);
list(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue())
).forEach(this::packageTransfer);
return R.success("success"); return R.success("success");
} }

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -5841,9 +5841,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//订制品 //订制品
if (!packageEntityList.isEmpty() && packageEntityList.size() > 0) { if (!packageEntityList.isEmpty() && packageEntityList.size() > 0) {
packageFlag = packageEntityList.stream().allMatch(a->OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus())); packageFlag = packageEntityList.stream().allMatch(a->OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus()));
}else { } else {
packageFlag = true; packageFlag = true;
} }
}else {
packageFlag = true;
} }
//库存品 //库存品
if (!inventoryList.isEmpty() && inventoryList.size() > 0) { if (!inventoryList.isEmpty() && inventoryList.size() > 0) {
@ -5862,7 +5864,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
zeroFlag = true; zeroFlag = true;
} }
} }
}else { } else {
zeroFlag = true; zeroFlag = true;
} }
DistributionStockupEntity distributionStockupEntity = new DistributionStockupEntity(); DistributionStockupEntity distributionStockupEntity = new DistributionStockupEntity();
@ -6334,7 +6336,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (!stockListId.equals(disStockListDetailEntity.getStockListId())){ if (!stockListId.equals(disStockListDetailEntity.getStockListId())){
//对已有计划进行减少 //对已有计划进行减少
DistributionDeliveryDetailsEntity deliveryDetails = distributionDeliveryDetailsEntities.stream().filter(f -> !Objects.equals(f.getQuantity(), f.getRealityQuantity())).collect(Collectors.toList()).get(0); DistributionDeliveryDetailsEntity deliveryDetails = distributionDeliveryDetailsEntities.stream().filter(f -> !Objects.equals(f.getQuantity(), f.getRealityQuantity())).collect(Collectors.toList()).get(0);
deliveryDetails.setQuantity(deliveryDetails.getQuantity() - 1); int updateNum = deliveryDetails.getQuantity() - 1;
if (Objects.equals(updateNum,deliveryDetails.getRealityQuantity())) {
deliveryDetails.setStockStatus("3");
}
deliveryDetails.setQuantity(updateNum);
distributionDeliveryDetailsService.updateById(deliveryDetails); distributionDeliveryDetailsService.updateById(deliveryDetails);
distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, 1); distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, 1);
distributionStockListMapper.updateInventoryQuantityOccupied(distributionStockListEntity.getId(), 1); distributionStockListMapper.updateInventoryQuantityOccupied(distributionStockListEntity.getId(), 1);
@ -6353,6 +6359,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
disStockListDetailEntity.setStockPackageCode(one.getCode()); disStockListDetailEntity.setStockPackageCode(one.getCode());
disStockListDetailEntity.setStockType(InventoryStockTypeStatusConstant.shengcheng.getValue()); disStockListDetailEntity.setStockType(InventoryStockTypeStatusConstant.shengcheng.getValue());
disStockListDetailEntity.setStockListId(distributionStockListEntity.getId()); disStockListDetailEntity.setStockListId(distributionStockListEntity.getId());
disStockListDetailService.updateById(disStockListDetailEntity);
distributionStockListService.updateById(distributionStockListEntity); distributionStockListService.updateById(distributionStockListEntity);
distributionStockListMapper.updateInventoryQuantityOccupied(disStockListDetailEntity.getStockListId(), disStockListDetailEntity.getNum()); distributionStockListMapper.updateInventoryQuantityOccupied(disStockListDetailEntity.getStockListId(), disStockListDetailEntity.getNum());
distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, num); distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, num);
@ -6360,7 +6367,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
distrilbutionBillLadingService.maintenanceStockListStockup(reservationId, stockListId, myCurrentWarehouse.getId()); distrilbutionBillLadingService.maintenanceStockListStockup(reservationId, stockListId, myCurrentWarehouse.getId());
//对原计划进行减少 //对原计划进行减少
DistributionDeliveryDetailsEntity deliveryDetails = distributionDeliveryDetailsEntities.stream().filter(r -> !Objects.equals(r.getQuantity(), r.getRealityQuantity())).collect(Collectors.toList()).get(0); DistributionDeliveryDetailsEntity deliveryDetails = distributionDeliveryDetailsEntities.stream().filter(r -> !Objects.equals(r.getQuantity(), r.getRealityQuantity())).collect(Collectors.toList()).get(0);
deliveryDetails.setQuantity(deliveryDetails.getQuantity() - 1); int updateNum = deliveryDetails.getQuantity() - 1;
if (Objects.equals(updateNum,deliveryDetails.getRealityQuantity())) {
deliveryDetails.setStockStatus("3");
}
deliveryDetails.setQuantity(updateNum);
distributionDeliveryDetailsService.updateById(deliveryDetails); distributionDeliveryDetailsService.updateById(deliveryDetails);
} }
} }

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -3355,7 +3355,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
List<DisStockListDetailEntity> listed = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() List<DisStockListDetailEntity> listed = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, i.getId()) .eq(DisStockListDetailEntity::getReservationId, i.getId())
.eq(DisStockListDetailEntity::getSku, i.getSku()) .eq(DisStockListDetailEntity::getSku, i.getSku())
.eq(DisStockListDetailEntity::getStockListId, i.getStockListId())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
); );
if (Func.isNotEmpty(listed)) { if (Func.isNotEmpty(listed)) {

2
blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java

@ -260,7 +260,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
// 如果有数量没有包条码,则生成系统包条 // 如果有数量没有包条码,则生成系统包条
if (CollUtil.isEmpty(boxCodes)) { if (CollUtil.isEmpty(boxCodes)) {
for (int i = 0; i < Convert.toInt(orderInfoVO.getGoodsNumber()); i++) { for (int i = 0; i < Convert.toInt(orderInfoVO.getGoodsNumber()); i++) {
boxCodes.add(orderInfoVO.getCustomItemNo() + "-" + (i + 1)); boxCodes.add(orderInfoVO.getCustomOrderNo() + orderInfoVO.getCustomItemNo() + "-" + (i + 1));
} }
} }
int size = boxCodes.size(); int size = boxCodes.size();

5
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java

@ -79,6 +79,11 @@ public class FactoryNodePushEntity extends BaseEntity {
*/ */
@ApiModelProperty(value = "订单号") @ApiModelProperty(value = "订单号")
private String orderCode; private String orderCode;
/**
* 包条码
*/
@ApiModelProperty(value = "包条码")
private String packageCode;
/** /**
* 运单号 * 运单号
*/ */

40
blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java

@ -173,22 +173,30 @@ public class NodeDataPushListener {
// value 按包件分组 包含则数量+1 // value 按包件分组 包含则数量+1
// 分拨中心回传所有包件,其他节点回传当前操作的包件 // 分拨中心回传所有包件,其他节点回传当前操作的包件
if (isArrival) { if (isArrival) {
List<DeliveryNoteEntity> collect2 = factoryList.stream() // List<DeliveryNoteEntity> collect2 = factoryList.stream()
.filter(data -> data.getCrmSo().equals(orderCode)) // .filter(data -> data.getCrmSo().equals(orderCode))
.filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo)) // .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo))
.collect(Collectors.toList()); // .collect(Collectors.toList());
snMap = collect2.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty()))); List<DeliveryNoteEntity> checkList = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>lambdaQuery()
FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder() .select(DeliveryNoteEntity::getSn, DeliveryNoteEntity::getQty)
.orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue()) .eq(DeliveryNoteEntity::getShipmentSplitNo, shipmentSplitNo)
.waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName()) .eq(DeliveryNoteEntity::getCrmSo, orderCode)
.receiveOrSend(needSendNode.getReceiveOrSend()) );
.shipmentSpitCode(shipmentSplitNo).shipmentCode(collect.get(sendData.getPackageCode() + sendData.getOrderCode()).get(0).getShipmentNo()) snMap = checkList.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty())));
.receivable(0).receipts(0) for (DeliveryNoteEntity deliveryNoteEntity : checkList) {
.type(needSendNode.getValue()) FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder()
.typeCode(needSendNode.getCode()) .orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue())
.build(); .waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName())
pushEntities.add(entity1); .receiveOrSend(needSendNode.getReceiveOrSend())
factoryNodeAllPushEntity.setPackageCode(collect2.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(","))); .shipmentSpitCode(shipmentSplitNo).shipmentCode(collect.get(sendData.getPackageCode() + sendData.getOrderCode()).get(0).getShipmentNo())
.receivable(0).receipts(0)
.type(needSendNode.getValue())
.typeCode(needSendNode.getCode())
.packageCode(deliveryNoteEntity.getSn())
.build();
pushEntities.add(entity1);
}
factoryNodeAllPushEntity.setPackageCode(checkList.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(",")));
} else { } else {
for (PushData data : value) { for (PushData data : value) {
if (snMap.containsKey(data.getPackageCode())) { if (snMap.containsKey(data.getPackageCode())) {

34
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java

@ -52,23 +52,6 @@ public class ReportTimeController extends BladeController {
@ApiOperation(value = "开单时效明细报表", notes = "开单时效明细报表") @ApiOperation(value = "开单时效明细报表", notes = "开单时效明细报表")
public R openTimeDetailPage(@RequestBody ReportTimeDTO reportTimeDTO) { public R openTimeDetailPage(@RequestBody ReportTimeDTO reportTimeDTO) {
String method = "###########openTimeDetailPage: "; String method = "###########openTimeDetailPage: ";
String brand = reportTimeDTO.getBrand();
String businessLine = reportTimeDTO.getBusinessLine();
Long warehouseId = reportTimeDTO.getWarehouseId();
if(StringUtil.isBlank(brand)){
log.warn(method+"品牌不能为空 {}",brand);
return R.fail(405,"品牌不能为空");
}
if(StringUtil.isBlank(businessLine)){
log.warn(method+"事业线不能为空 {}",businessLine);
return R.fail(405,"事业线不能为空");
}
if(Objects.isNull(warehouseId)){
log.warn(method+"仓库id不能为空 {}",warehouseId);
return R.fail(405,"仓库id不能为空");
}
try{ try{
return reportTimeService.openTimeDetailPage(reportTimeDTO); return reportTimeService.openTimeDetailPage(reportTimeDTO);
}catch (Exception e){ }catch (Exception e){
@ -82,23 +65,6 @@ public class ReportTimeController extends BladeController {
@ApiOperation(value = "开单时效明细报表导出", notes = "开单时效明细报表导出") @ApiOperation(value = "开单时效明细报表导出", notes = "开单时效明细报表导出")
public void openTimeDetailExport(@RequestBody ReportTimeDTO reportTimeDTO, HttpServletResponse response) { public void openTimeDetailExport(@RequestBody ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
String method = "###########openTimeDetailExport: "; String method = "###########openTimeDetailExport: ";
String brand = reportTimeDTO.getBrand();
String businessLine = reportTimeDTO.getBusinessLine();
Long warehouseId = reportTimeDTO.getWarehouseId();
if(StringUtil.isBlank(brand)){
log.warn(method+"品牌不能为空 {}",brand);
throw new CustomerException(405,"品牌不能为空");
}
if(StringUtil.isBlank(businessLine)){
log.warn(method+"事业线不能为空 {}",businessLine);
throw new CustomerException(405,"事业线不能为空");
}
if(Objects.isNull(warehouseId)){
log.warn(method+"仓库id不能为空 {}",warehouseId);
throw new CustomerException(405,"仓库id不能为空");
}
reportTimeService.openTimeDetailExport(reportTimeDTO,response); reportTimeService.openTimeDetailExport(reportTimeDTO,response);
} }

2
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/QualityDispatchNumberMapper.xml

@ -143,7 +143,7 @@
t.driver_name, t.driver_name,
t.vehicle_name, t.vehicle_name,
t.delivery_create_user_name, t.delivery_create_user_name,
case when t.sign_status = 1 then '已签收' else '未签收' end signStatus, t.sign_status signStatus,
t.sign_time, t.sign_time,
t.sign_user_name, t.sign_user_name,
t.reviewStatus, t.reviewStatus,

55
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml

@ -245,9 +245,10 @@
from logpm_trunkline_advance_detail lta from logpm_trunkline_advance_detail lta
left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where lta.create_time &gt; '2024-10-22 00:00:00' where lta.create_time &gt; '2024-10-22 00:00:00'
and lww.document_making_time &gt; '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id and lww.departure_warehouse_id != lww.destination_warehouse_id
and waw.business_line is not null and waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> <if test="param.businessLineList != null and param.businessLineList.size() > 0">
@ -305,9 +306,10 @@
from logpm_trunkline_advance_detail lta from logpm_trunkline_advance_detail lta
left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where lta.create_time &gt; '2024-10-22 00:00:00' where lta.create_time &gt; '2024-10-22 00:00:00'
and lww.document_making_time &gt; '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id and lww.departure_warehouse_id != lww.destination_warehouse_id
and waw.business_line is not null and waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> <if test="param.businessLineList != null and param.businessLineList.size() > 0">
@ -579,7 +581,7 @@
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/sum( if(ltcls.id is not null or ldpl.order_package_status != '20',1,0))/3600,1) avgTime round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/sum( if(ltcls.id is not null or ldpl.order_package_status != '20',1,0))/3600,1) avgTime
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ldpl.is_transfer = 1 where ldpl.is_transfer = 1
and ldpl.create_time &gt; '2024-10-22 00:00:00' and ldpl.create_time &gt; '2024-10-22 00:00:00'
@ -648,7 +650,7 @@
round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/sum( if(ltcls.id is not null or ldpl.order_package_status != '20',1,0))/3600,1) avgTime round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/sum( if(ltcls.id is not null or ldpl.order_package_status != '20',1,0))/3600,1) avgTime
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ldpl.is_transfer = 1 where ldpl.is_transfer = 1
and ldpl.create_time &gt; '2024-10-22 00:00:00' and ldpl.create_time &gt; '2024-10-22 00:00:00'
@ -711,9 +713,11 @@
ldsa.brand brand, ldsa.brand brand,
sum(ldsa.incoming_num) incomingNum, sum(ldsa.incoming_num) incomingNum,
IFNULL(sum(ltcls.num),0) outNum, IFNULL(sum(ltcls.num),0) outNum,
sum( ldsa.incoming_num ) - IFNULL(sum(ltcls.num),0) noOutNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0)) outOnTimeNum, sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0)) outOnTimeNum,
IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0))/sum(ldsa.incoming_num)*100,2),'0.00') outOnTimeRate, IFNULL(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0))/sum(ldsa.incoming_num)*100,2),'0.00') outOnTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, ldsa.create_time, ltcll.start_date)*ltcls.num)/sum(ltcls.num)/3600,1) avgTime round(sum(TIMESTAMPDIFF(SECOND, ldsa.create_time, ltcll.start_date)*ltcls.num)/sum(ltcls.num)/3600,1) avgTime,
#{param.hoursTime} hoursTime
from logpm_distribution_stock_article ldsa from logpm_distribution_stock_article ldsa
left join logpm_warehouse_warehouse waw on waw.id = ldsa.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ldsa.warehouse_id
left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.order_code left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.order_code
@ -775,9 +779,11 @@
ldsa.brand brand, ldsa.brand brand,
sum(ldsa.incoming_num) incomingNum, sum(ldsa.incoming_num) incomingNum,
IFNULL(sum(ltcls.num),0) outNum, IFNULL(sum(ltcls.num),0) outNum,
sum( ldsa.incoming_num ) - IFNULL(sum(ltcls.num),0) noOutNum,
sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0)) outOnTimeNum, sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0)) outOnTimeNum,
IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0))/sum(ldsa.incoming_num)*100,2),'%'),'0.00%') outOnTimeRate, IFNULL(concat(round(sum(if(ltcll.start_date &lt;= DATE_ADD( ldsa.create_time, INTERVAL #{param.hoursTime} HOUR ),ltcls.num,0))/sum(ldsa.incoming_num)*100,2),'%'),'0.00%') outOnTimeRate,
round(sum(TIMESTAMPDIFF(SECOND, ldsa.create_time, ltcll.start_date)*ltcls.num)/sum(ltcls.num)/3600,1) avgTime round(sum(TIMESTAMPDIFF(SECOND, ldsa.create_time, ltcll.start_date)*ltcls.num)/sum(ltcls.num)/3600,1) avgTime,
#{param.hoursTime} hoursTime
from logpm_distribution_stock_article ldsa from logpm_distribution_stock_article ldsa
left join logpm_warehouse_warehouse waw on waw.id = ldsa.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ldsa.warehouse_id
left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.order_code left join logpm_warehouse_waybill lww on lww.waybill_no = ldsa.order_code
@ -1401,6 +1407,7 @@
left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.is_deleted = 0 left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.is_deleted = 0
where ltad.waybill_id is not null where ltad.waybill_id is not null
and ltad.create_time > '2024-10-22 00:00:00' and ltad.create_time > '2024-10-22 00:00:00'
and lww.document_making_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id and lww.departure_warehouse_id != lww.destination_warehouse_id
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> <if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in and waw.business_line in
@ -1618,6 +1625,7 @@
lta.store_name storeName, lta.store_name storeName,
lta.warehouse_id warehouseId, lta.warehouse_id warehouseId,
lta.warehouse_name warehouseName, lta.warehouse_name warehouseName,
min(ltad.incoming_time) incomingTime,
GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName, GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName,
lta.site_name siteName, lta.site_name siteName,
lta.brand brand, lta.brand brand,
@ -1656,9 +1664,15 @@
left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no
left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id
where lta.create_time > '2024-10-22 00:00:00' where lta.create_time > '2024-10-22 00:00:00'
and waw.business_line = #{param.businessLine} <if test="param.businessLine != null and param.businessLine !='' ">
and lta.brand = #{param.brand} and waw.business_line = #{param.businessLine}
and lta.warehouse_id = #{param.warehouseId} </if>
<if test="param.brand != null and param.brand !='' ">
and lta.brand = #{param.brand}
</if>
<if test="param.warehouseId != null ">
and lta.warehouse_id = #{param.warehouseId}
</if>
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> <if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")"> <foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
@ -1788,6 +1802,7 @@
lta.store_name storeName, lta.store_name storeName,
lta.warehouse_id warehouseId, lta.warehouse_id warehouseId,
lta.warehouse_name warehouseName, lta.warehouse_name warehouseName,
min(ltad.incoming_time) incomingTime,
GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName, GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName,
lta.site_name siteName, lta.site_name siteName,
lta.brand brand, lta.brand brand,
@ -1832,9 +1847,15 @@
left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no
left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id
where lta.create_time > '2024-10-22 00:00:00' where lta.create_time > '2024-10-22 00:00:00'
and waw.business_line = #{param.businessLine} <if test="param.businessLine != null and param.businessLine !='' ">
and lta.brand = #{param.brand} and waw.business_line = #{param.businessLine}
and lta.warehouse_id = #{param.warehouseId} </if>
<if test="param.brand != null and param.brand !='' ">
and lta.brand = #{param.brand}
</if>
<if test="param.warehouseId != null ">
and lta.warehouse_id = #{param.warehouseId}
</if>
<if test="param.businessLineList != null and param.businessLineList.size() > 0"> <if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")"> <foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
@ -2744,9 +2765,10 @@
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ltad.create_time > '2024-10-22 00:00:00' where ltad.create_time > '2024-10-22 00:00:00'
and lww.document_making_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id and lww.departure_warehouse_id != lww.destination_warehouse_id
and waw.business_line is not null and waw.business_line is not null
and waw.business_line = #{param.businessLine} and waw.business_line = #{param.businessLine}
@ -2845,9 +2867,10 @@
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id
left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ltad.create_time > '2024-10-22 00:00:00' where ltad.create_time > '2024-10-22 00:00:00'
and lww.document_making_time > '2024-10-22 00:00:00'
and lww.departure_warehouse_id != lww.destination_warehouse_id and lww.departure_warehouse_id != lww.destination_warehouse_id
and waw.business_line is not null and waw.business_line is not null
and waw.business_line = #{param.businessLine} and waw.business_line = #{param.businessLine}
@ -2945,7 +2968,7 @@
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id
left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ldpl.is_transfer = 1 where ldpl.is_transfer = 1
and ldpl.create_time > '2024-10-22 00:00:00' and ldpl.create_time > '2024-10-22 00:00:00'
@ -3046,7 +3069,7 @@
from logpm_distribution_parcel_list ldpl from logpm_distribution_parcel_list ldpl
left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id
left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id
where ldpl.is_transfer = 1 where ldpl.is_transfer = 1
and ldpl.create_time > '2024-10-22 00:00:00' and ldpl.create_time > '2024-10-22 00:00:00'

4
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeDetailVO.java

@ -30,6 +30,10 @@ public class ReportOpenTimeDetailVO implements Serializable {
private Long warehouseId; private Long warehouseId;
@ExcelProperty(value = "导入仓库") @ExcelProperty(value = "导入仓库")
private String warehouseName; private String warehouseName;
@ExcelProperty(value = "入库时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date incomingTime;
@ExcelProperty(value = "入库仓库") @ExcelProperty(value = "入库仓库")
private String incomingWarehouseName; private String incomingWarehouseName;

3
blade-service/logpm-report/src/main/java/com/logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java

@ -1,5 +1,6 @@
package com.logpm.report.vo.qulity.dispatch; package com.logpm.report.vo.qulity.dispatch;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.ContentRowHeight;
@ -94,7 +95,7 @@ public class QualityDispatchTaskVO implements Serializable {
private Integer signStockNum; private Integer signStockNum;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
@ExcelProperty("状态") @ExcelIgnore
private String signStatus; private String signStatus;
@ApiModelProperty(value = "签收时间") @ApiModelProperty(value = "签收时间")

1
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java

@ -150,6 +150,7 @@ public class ExpenseDispatchPriceServiceController extends BladeController {
List<ExpenseDispatchPriceServiceEntity> list = expenseDispatchPriceServiceService.list(); List<ExpenseDispatchPriceServiceEntity> list = expenseDispatchPriceServiceService.list();
if (CollUtil.isNotEmpty(list)) { if (CollUtil.isNotEmpty(list)) {
Set<Long> collect = list.stream() Set<Long> collect = list.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getDriverId()))
.filter(item -> !item.getDriverId().equals(byId.getDriverId())) .filter(item -> !item.getDriverId().equals(byId.getDriverId()))
.map(ExpenseDispatchPriceServiceEntity::getDriverId).collect(Collectors.toSet()); .map(ExpenseDispatchPriceServiceEntity::getDriverId).collect(Collectors.toSet());
if (collect.contains(expenseDispatchPriceService.getDriverId())) { if (collect.contains(expenseDispatchPriceService.getDriverId())) {

13
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java

@ -16,13 +16,17 @@
*/ */
package com.logpm.statistics.controller; package com.logpm.statistics.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.statistics.entity.ExpenseDispatchPriceServiceEntity;
import com.logpm.statistics.entity.ExpenseDispatchPriceTemplateEntity; import com.logpm.statistics.entity.ExpenseDispatchPriceTemplateEntity;
import com.logpm.statistics.excel.ExpenseDispatchPriceTemplateExcel; import com.logpm.statistics.excel.ExpenseDispatchPriceTemplateExcel;
import com.logpm.statistics.query.ExpenseDispatchPriceTemplateQuery; import com.logpm.statistics.query.ExpenseDispatchPriceTemplateQuery;
import com.logpm.statistics.service.IExpenseDispatchPriceServiceService;
import com.logpm.statistics.service.IExpenseDispatchPriceTemplateService; import com.logpm.statistics.service.IExpenseDispatchPriceTemplateService;
import com.logpm.statistics.vo.ExpenseDispatchPriceTemplateVO; import com.logpm.statistics.vo.ExpenseDispatchPriceTemplateVO;
import com.logpm.statistics.wrapper.ExpenseDispatchPriceTemplateWrapper; import com.logpm.statistics.wrapper.ExpenseDispatchPriceTemplateWrapper;
@ -65,6 +69,7 @@ import java.util.Map;
public class ExpenseDispatchPriceTemplateController extends BladeController { public class ExpenseDispatchPriceTemplateController extends BladeController {
private final IExpenseDispatchPriceTemplateService expenseDispatchPriceTemplateService; private final IExpenseDispatchPriceTemplateService expenseDispatchPriceTemplateService;
private final IExpenseDispatchPriceServiceService expenseDispatchPriceServiceService;
/** /**
* 成本配送价格模版 详情 * 成本配送价格模版 详情
@ -136,7 +141,13 @@ public class ExpenseDispatchPriceTemplateController extends BladeController {
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids") @ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(expenseDispatchPriceTemplateService.deleteLogic(Func.toLongList(ids))); List<ExpenseDispatchPriceServiceEntity> list = expenseDispatchPriceServiceService.list(Wrappers.<ExpenseDispatchPriceServiceEntity>lambdaQuery()
.in(ExpenseDispatchPriceServiceEntity::getTemplateId, Func.toLong(ids)));
if(CollUtil.isNotEmpty(list)){
return R.fail("选择的模版存在绑定的服务商,不能删除");
}
boolean b = expenseDispatchPriceTemplateService.deleteLogic(Func.toLongList(ids));
return R.status(b);
} }

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java

@ -8,6 +8,7 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO; import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDetailDTO; import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO; import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.dto.PackageCodeDTO;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService; import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -17,10 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException; import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
@Slf4j @Slf4j
@ -62,14 +61,14 @@ public class AdvanceDetailController {
} }
@GetMapping("/showAdvancePackgeCode") @PostMapping("/showAdvancePackgeCode")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "返回模板和模板内容") @ApiOperation(value = "返回模板和模板内容")
public R showAdvancePackgeCode(@ApiIgnore @RequestParam Map<String,Object> params){ public R showAdvancePackgeCode(@RequestBody PackageCodeDTO packageCodeDTO){
OrderPackgeCodeDataVO orderPackgeCodeDataVo= null; OrderPackgeCodeDataVO orderPackgeCodeDataVo= null;
try { try {
orderPackgeCodeDataVo = advanceDetailService.showAdvancePackgeCode(params); orderPackgeCodeDataVo = advanceDetailService.showAdvancePackgeCode(packageCodeDTO);
} catch (Exception e) { } catch (Exception e) {
return R.fail(e.getMessage()); return R.fail(e.getMessage());
} }

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/PackageCodeDTO.java

@ -0,0 +1,13 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class PackageCodeDTO implements Serializable {
private List<String> orderPackageCodes;
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -6,6 +6,7 @@ import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDTO; import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.AdvanceDetailDTO; import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO; import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.dto.PackageCodeDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.*; import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.entity.WarehouseWaybillEntity;
@ -41,7 +42,7 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
Integer getNumByAdvanceId(Long advanceId); Integer getNumByAdvanceId(Long advanceId);
OrderPackgeCodeDataVO showAdvancePackgeCode(Map<String, Object> params) throws Exception; OrderPackgeCodeDataVO showAdvancePackgeCode(PackageCodeDTO packageCodeDTO) throws Exception;
List<TrunklineAdvanceDetailEntity> findListByAdvanceId(Long advanceId); List<TrunklineAdvanceDetailEntity> findListByAdvanceId(Long advanceId);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -339,6 +339,8 @@ public class InComingServiceImpl implements IInComingService {
if(incomingType.equals(IncomingTypeEnum.PACKAGE_INCOMING.getCode())){ if(incomingType.equals(IncomingTypeEnum.PACKAGE_INCOMING.getCode())){
c = WorkNodeEnums.UNLOAD_WAREHOUSE_ENTRY.getCode(); c = WorkNodeEnums.UNLOAD_WAREHOUSE_ENTRY.getCode();
}else if(incomingType.equals(IncomingTypeEnum.SYNC_INCOMING.getCode())){
c = WorkNodeEnums.ERROR_WAREHOUSE_ENTRY.getCode();
} }
//存入日志 //存入日志

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1027,6 +1027,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}); });
if (CollUtil.isNotEmpty(updateStockArticleList)) { if (CollUtil.isNotEmpty(updateStockArticleList)) {
log.info("###############openWaybill: 更新订单列表, {}", updateStockArticleList);
distributionStockArticleClient.updateByBatchId(updateStockArticleList); distributionStockArticleClient.updateByBatchId(updateStockArticleList);
} }
} }

23
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.entity.BasicPrintTemplateEntity;
@ -17,6 +16,7 @@ import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDTO; import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.AdvanceDetailDTO; import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO; import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.dto.PackageCodeDTO;
import com.logpm.trunkline.entity.ReportPackageBasicEntity; import com.logpm.trunkline.entity.ReportPackageBasicEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
@ -35,6 +35,7 @@ import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.enums.BizOperationEnums; import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums; import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg; import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg; import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData; import org.springblade.common.model.PackageData;
@ -157,7 +158,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
} }
@Override @Override
public OrderPackgeCodeDataVO showAdvancePackgeCode(Map<String, Object> params) throws Exception { public OrderPackgeCodeDataVO showAdvancePackgeCode(PackageCodeDTO packageCodeDTO) throws Exception {
log.info("----------------------------------------111111111"); log.info("----------------------------------------111111111");
OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO(); OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();
List<Map> data = new ArrayList<>(); List<Map> data = new ArrayList<>();
@ -170,15 +171,10 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl()); String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
orderPackgeCodeDataVO.setTemplateHtml(html); orderPackgeCodeDataVO.setTemplateHtml(html);
orderPackgeCodeDataVO.setTemplateId(template.getId()); orderPackgeCodeDataVO.setTemplateId(template.getId());
String orderPackageCodes = (String) params.get("orderPackageCodes"); List<String> orderPackageCodes = packageCodeDTO.getOrderPackageCodes();
String[] idArray = orderPackageCodes.split(",");
if (ObjectUtils.isNull(idArray)) {
throw new ServiceException("参数错误");
}
log.info("----------------------------------------333333333"); log.info("----------------------------------------333333333");
for (String orderPackageCode : idArray) { orderPackageCodes.forEach(orderPackageCode -> {
DistributionStockArticleQRCodeVO vo = new DistributionStockArticleQRCodeVO(); DistributionStockArticleQRCodeVO vo = new DistributionStockArticleQRCodeVO();
log.info("----------------------------------------444444444444444444"); log.info("----------------------------------------444444444444444444");
TrunklineAdvanceDetailEntity advanceDetailEntity = baseMapper.findEntityByOrderPackageCodelimit1(orderPackageCode); TrunklineAdvanceDetailEntity advanceDetailEntity = baseMapper.findEntityByOrderPackageCodelimit1(orderPackageCode);
@ -241,9 +237,14 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
String fileTypeName = QRCodeUtil.createCodeToFile(vo.getOrderCode()); String fileTypeName = QRCodeUtil.createCodeToFile(vo.getOrderCode());
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName)); map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
data.add(map); data.add(map);
String tempData = TemplateUtil.popTemplate(template.getTemplateName(), map, orderPackgeCodeDataVO.getTemplateHtml()); String tempData = null;
try {
tempData = TemplateUtil.popTemplate(template.getTemplateName(), map, orderPackgeCodeDataVO.getTemplateHtml());
} catch (Exception e) {
throw new CustomerException(405, "模板生成失败");
}
values.add(tempData); values.add(tempData);
} });
log.info("----------------------------------------88888888888888"); log.info("----------------------------------------88888888888888");
orderPackgeCodeDataVO.setDataList(data); orderPackgeCodeDataVO.setDataList(data);

331
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -1207,10 +1207,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();//当前节点id Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();//当前节点id
String carsNo = carsLoadEntity.getCarsNo(); String carsNo = carsLoadEntity.getCarsNo();
if (!warehouseId.equals(nowWarehouseId)) { // if (!warehouseId.equals(nowWarehouseId)) {
log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId); // log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId);
throw new CustomerException(400, "配载未到达当前仓"); // throw new CustomerException(400, "配载未到达当前仓");
} // }
String loadStatus = carsLoadEntity.getLoadStatus(); String loadStatus = carsLoadEntity.getLoadStatus();
@ -1220,10 +1220,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (unloadType == 1) { if (unloadType == 1) {
node = WorkNodeEnums.TRANSFER_WAREHOUSE_UNLOADING; node = WorkNodeEnums.TRANSFER_WAREHOUSE_UNLOADING;
//网点卸车确认 //网点卸车确认
if ("40".equals(loadStatus)) { // if ("40".equals(loadStatus)) {
log.warn("#############unloadByLoadId: 当前节点为终点 loadId={} loadStatus={}", loadId, loadStatus); // log.warn("#############unloadByLoadId: 当前节点为终点 loadId={} loadStatus={}", loadId, loadStatus);
throw new CustomerException(400, "当前节点为终点"); // throw new CustomerException(400, "当前节点为终点");
} // }
updateUnloadStatus.setId(currentCarsLoadLineEntity.getId()); updateUnloadStatus.setId(currentCarsLoadLineEntity.getId());
updateUnloadStatus.setUnloadStatus("1"); updateUnloadStatus.setUnloadStatus("1");
currentCarsLoadLineEntity.setUnloadStatus("1"); currentCarsLoadLineEntity.setUnloadStatus("1");
@ -1516,6 +1516,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String content = "包件在 " + warehouseEntity.getName() + "卸车确认"; String content = "包件在 " + warehouseEntity.getName() + "卸车确认";
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), node.getCode(), content); packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), node.getCode(), content);
//同步一次系统无编码数据
syncNoSystemData(loadId, warehouseId, warehouseEntity.getName());
} catch (Exception e) { } catch (Exception e) {
log.warn("###############unloadPackage: 存入异常列表记录失败"); log.warn("###############unloadPackage: 存入异常列表记录失败");
} }
@ -9934,6 +9937,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String packageStatus = advanceDetailEntity.getPackageStatus(); String packageStatus = advanceDetailEntity.getPackageStatus();
String orderCode = advanceDetailEntity.getOrderCode(); String orderCode = advanceDetailEntity.getOrderCode();
String waybillNo = advanceDetailEntity.getWaybillNo(); String waybillNo = advanceDetailEntity.getWaybillNo();
Long advanceId = advanceDetailEntity.getAdvanceId();
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
if ("0".equals(packageStatus)) { if ("0".equals(packageStatus)) {
InComingDTO inComingDTO = new InComingDTO(); InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(scanCode); inComingDTO.setOrderPackageCode(scanCode);
@ -9949,6 +9956,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode); carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setIsData(1); carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setIsSupple(1); carsLoadScanEntity.setIsSupple(1);
if(!Objects.isNull(advanceEntity)){
carsLoadScanEntity.setCustomerName(advanceEntity.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
carsLoadScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress());
}
carsLoadScanEntity.setFirsts(advanceDetailEntity.getFirstPackName());
carsLoadScanEntity.setSenconds(advanceDetailEntity.getSecondPackName());
carsLoadScanEntity.setThirds(advanceDetailEntity.getThirdPackName());
carsLoadScanEntity.setMaterialName(advanceDetailEntity.getMaterialName());
carsLoadScanEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
trunklineCarsLoadScanService.updateById(carsLoadScanEntity); trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
return R.success("同步成功"); return R.success("同步成功");
} }
@ -9991,6 +10008,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode); carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setIsData(1); carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setIsSupple(1); carsLoadScanEntity.setIsSupple(1);
if(!Objects.isNull(advanceEntity)){
carsLoadScanEntity.setCustomerName(advanceEntity.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
carsLoadScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress());
}
carsLoadScanEntity.setFirsts(advanceDetailEntity.getFirstPackName());
carsLoadScanEntity.setSenconds(advanceDetailEntity.getSecondPackName());
carsLoadScanEntity.setThirds(advanceDetailEntity.getThirdPackName());
carsLoadScanEntity.setMaterialName(advanceDetailEntity.getMaterialName());
carsLoadScanEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
trunklineCarsLoadScanService.updateById(carsLoadScanEntity); trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
return R.success("同步成功"); return R.success("同步成功");
@ -10022,6 +10049,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode); carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setIsData(1); carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setIsSupple(1); carsLoadScanEntity.setIsSupple(1);
if(!Objects.isNull(advanceEntity)){
carsLoadScanEntity.setCustomerName(advanceEntity.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
carsLoadScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress());
}
carsLoadScanEntity.setFirsts(advanceDetailEntity.getFirstPackName());
carsLoadScanEntity.setSenconds(advanceDetailEntity.getSecondPackName());
carsLoadScanEntity.setThirds(advanceDetailEntity.getThirdPackName());
carsLoadScanEntity.setMaterialName(advanceDetailEntity.getMaterialName());
carsLoadScanEntity.setMaterialCode(advanceDetailEntity.getMaterialCode());
trunklineCarsLoadScanService.updateById(carsLoadScanEntity); trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
return R.success("同步成功"); return R.success("同步成功");
@ -11139,6 +11176,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<DistributionStockArticleEntity> updateStockArticleList = new ArrayList<>(); List<DistributionStockArticleEntity> updateStockArticleList = new ArrayList<>();
groupedByLoadId.keySet().forEach(loadId -> { groupedByLoadId.keySet().forEach(loadId -> {
TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if (Objects.isNull(loadLineEntity)) {
log.warn("##################removeCarsLoadScan: 配载计划不存在 loadId={}", loadId);
throw new CustomerException(405,"配载计划不存在");
}
String nodeStatus = loadLineEntity.getNodeStatus();
if("20".equals(nodeStatus)){
log.warn("##################removeCarsLoadScan: 当前节点已发车 loadId={} warehouseId={}", loadId,warehouseId);
throw new CustomerException(405,"当前节点已发车");
}
if("0".equals(nodeStatus)){
log.warn("##################removeCarsLoadScan: 当前节点未到达 loadId={} warehouseId={}", loadId,warehouseId);
throw new CustomerException(405,"当前节点未到达");
}
List<TrunklineCarsLoadScanEntity> loadScanEntityList = groupedByLoadId.get(loadId); List<TrunklineCarsLoadScanEntity> loadScanEntityList = groupedByLoadId.get(loadId);
if(CollUtil.isNotEmpty(loadScanEntityList)){ if(CollUtil.isNotEmpty(loadScanEntityList)){
//把loadScanEntityList通过fromNodeId进行分组 //把loadScanEntityList通过fromNodeId进行分组
@ -13274,130 +13327,159 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} }
int i= 0;
List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = trunklineCarsLoadScanService.findUnloadNoDataList(loadId,warehouseId); List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = trunklineCarsLoadScanService.findUnloadNoDataList(loadId,warehouseId);
//把carsLoadScanEntities中所有元素的scanCode放入一个Set集合 if(CollUtil.isNotEmpty(carsLoadScanEntities)){
Set<String> scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet()); //把carsLoadScanEntities中所有元素的scanCode放入一个Set集合
Set<String> scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet());
log.info("###############syncNoSystemData: 当前同步的数据 {}",scanCodeSet); log.info("###############syncNoSystemData: 当前同步的数据 {}",scanCodeSet);
List<String> scanCodeList = new ArrayList<>(scanCodeSet); List<String> scanCodeList = new ArrayList<>(scanCodeSet);
List<TrunklineAdvanceDetailEntity> allAdvanceDetailList = new ArrayList<>(); List<TrunklineAdvanceDetailEntity> allAdvanceDetailList = new ArrayList<>();
int packageBatchSize = 500; int packageBatchSize = 500;
List<List<String>> orderPackageCodeGroups = new ArrayList<>(); List<List<String>> orderPackageCodeGroups = new ArrayList<>();
for (int i = 0; i < scanCodeList.size(); i += packageBatchSize) { for (int m = 0; m < scanCodeList.size(); m += packageBatchSize) {
int endIndex = Math.min(i + packageBatchSize, scanCodeList.size()); int endIndex = Math.min(m + packageBatchSize, scanCodeList.size());
orderPackageCodeGroups.add(scanCodeList.subList(i, endIndex)); orderPackageCodeGroups.add(scanCodeList.subList(m, endIndex));
} }
orderPackageCodeGroups.forEach(orderPackageCodeGroup -> { orderPackageCodeGroups.forEach(orderPackageCodeGroup -> {
List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup); List<TrunklineAdvanceDetailEntity> advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup);
allAdvanceDetailList.addAll(advanceDetailEntityList); allAdvanceDetailList.addAll(advanceDetailEntityList);
}); });
//把allAdvanceDetailList转化成orderPackageCode为key的Map //把allAdvanceDetailList中所有advanceId放入一个Set集合
Map<String, TrunklineAdvanceDetailEntity> advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity())); Set<Long> advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet());
List<TrunklineAdvanceEntity> advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet));
//把advanceEntities转化成id为key的Map
Map<Long, TrunklineAdvanceEntity> advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity()));
List<TrunklineCarsLoadScanEntity> updateScanList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> incomingAdvanceDetailList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> udateAdvanceDetailList = new ArrayList<>();
Set<String> orderPackageCodeSet = new HashSet<>();
carsLoadScanEntities.forEach(carsLoadScanEntity -> {
String orderPackageCode = carsLoadScanEntity.getScanCode();
Date unloadTime = carsLoadScanEntity.getUnloadTime();
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode);
if(!Objects.isNull(trunklineAdvanceDetailEntity)){
orderPackageCodeSet.add(orderPackageCode);
TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity();
updateScanEntity.setId(carsLoadScanEntity.getId());
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if(packageStatus.equals("0")){
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId());
incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity);
}else{
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
trunklineAdvanceDetailEntity.setReserve5(CommonUtil.dateToStringGeneral(unloadTime));
udateAdvanceDetailList.add(trunklineAdvanceDetailEntity);
//把allAdvanceDetailList转化成orderPackageCode为key的Map
Map<String, TrunklineAdvanceDetailEntity> advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity()));
List<TrunklineCarsLoadScanEntity> updateScanList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> incomingAdvanceDetailList = new ArrayList<>();
List<TrunklineAdvanceDetailEntity> udateAdvanceDetailList = new ArrayList<>();
List<String> orderPackageCodeList = new ArrayList<>();
Set<String> orderPackageCodeSet = new HashSet<>();
carsLoadScanEntities.forEach(carsLoadScanEntity -> {
String orderPackageCode = carsLoadScanEntity.getScanCode();
Date unloadTime = carsLoadScanEntity.getUnloadTime();
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode);
if(!Objects.isNull(trunklineAdvanceDetailEntity)){
Long advanceId = trunklineAdvanceDetailEntity.getAdvanceId();
orderPackageCodeSet.add(orderPackageCode);
TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity();
updateScanEntity.setId(carsLoadScanEntity.getId());
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if(packageStatus.equals("0")){
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId());
incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity);
}else{
updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
trunklineAdvanceDetailEntity.setReserve5(CommonUtil.dateToStringGeneral(unloadTime));
udateAdvanceDetailList.add(trunklineAdvanceDetailEntity);
}
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
TrunklineAdvanceEntity advanceEntity = advanceMap.get(advanceId);
if(!Objects.isNull(advanceEntity)){
updateScanEntity.setCustomerName(advanceEntity.getCustomerName());
updateScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone());
updateScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress());
}
updateScanEntity.setFirsts(trunklineAdvanceDetailEntity.getFirstPackName());
updateScanEntity.setSenconds(trunklineAdvanceDetailEntity.getSecondPackName());
updateScanEntity.setThirds(trunklineAdvanceDetailEntity.getThirdPackName());
updateScanEntity.setMaterialCode(trunklineAdvanceDetailEntity.getMaterialCode());
updateScanEntity.setMaterialName(trunklineAdvanceDetailEntity.getMaterialName());
updateScanEntity.setIsData(1);
updateScanList.add(updateScanEntity);
} }
updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode()); });
updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
updateScanEntity.setIsData(1);
updateScanList.add(updateScanEntity);
}
});
if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){ if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) { for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) {
InComingDTO inComingDTO = new InComingDTO(); InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode()); inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode());
inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode()); inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode());
inComingDTO.setWarehouseId(warehouseId); inComingDTO.setWarehouseId(warehouseId);
R r = inComingService.incomingPackage(inComingDTO); R r = inComingService.incomingPackage(inComingDTO);
if(r.getCode() != 200){ if(r.getCode() != 200){
throw new CustomerException(405,"入库失败"); throw new CustomerException(405,"入库失败");
}
} }
} }
}
if(CollUtil.isNotEmpty(udateAdvanceDetailList)){ if(CollUtil.isNotEmpty(udateAdvanceDetailList)){
advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId); advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId);
List<TrunklineAdvanceDetailEntity> updateNowWarehouseList = new ArrayList<>(); List<TrunklineAdvanceDetailEntity> updateNowWarehouseList = new ArrayList<>();
List<DistributionParcelListEntity> updateParceList = new ArrayList<>(); List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode(); String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode();
String reserve5 = trunklineAdvanceDetailEntity.getReserve5(); String reserve5 = trunklineAdvanceDetailEntity.getReserve5();
Date unloadTime = CommonUtil.StringToDate(reserve5); Date unloadTime = CommonUtil.StringToDate(reserve5);
//查询是否有在系统无编码后进行卸车的数据 orderPackageCodeList.add(orderPackageCode);
int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime);
if(unloadNum > 0){ //查询是否有在系统无编码后进行卸车的数据
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime);
if(!Objects.isNull(parcelListEntity)){ if(unloadNum > 0){
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
updateEntity.setId(parcelListEntity.getId()); if(!Objects.isNull(parcelListEntity)){
updateEntity.setOrderPackageStatus("60");
updateEntity.setOrderCode(parcelListEntity.getOrderCode());
updateEntity.setWarehouseId(parcelListEntity.getWarehouseId());
updateParceList.add(updateEntity);
}
}else{
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatusAndNoWarehouseId(orderPackageCode,"20",warehouseId);
if(CollUtil.isNotEmpty(list)) {
list.forEach(distributionParcelListEntity -> {
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
updateEntity.setId(distributionParcelListEntity.getId()); updateEntity.setId(parcelListEntity.getId());
updateEntity.setOrderPackageStatus("60"); updateEntity.setOrderPackageStatus("60");
updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode()); updateEntity.setOrderCode(parcelListEntity.getOrderCode());
updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId()); updateEntity.setWarehouseId(parcelListEntity.getWarehouseId());
updateParceList.add(updateEntity); updateParceList.add(updateEntity);
}); }
}else{
List<DistributionParcelListEntity> list = distributionParcelListClient.findListByOrderPackageCodeAndStatusAndNoWarehouseId(orderPackageCode,"20",warehouseId);
if(CollUtil.isNotEmpty(list)) {
list.forEach(distributionParcelListEntity -> {
DistributionParcelListEntity updateEntity = new DistributionParcelListEntity();
updateEntity.setId(distributionParcelListEntity.getId());
updateEntity.setOrderPackageStatus("60");
updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode());
updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId());
updateParceList.add(updateEntity);
});
}
TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity();
updateEntity.setId(trunklineAdvanceDetailEntity.getId());
updateEntity.setNowWarehouseId(warehouseId);
updateEntity.setNowWarehouseName(warehouseName);
updateNowWarehouseList.add(updateEntity);
} }
TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity(); });
updateEntity.setId(trunklineAdvanceDetailEntity.getId());
updateEntity.setNowWarehouseId(warehouseId);
updateEntity.setNowWarehouseName(warehouseName);
updateNowWarehouseList.add(updateEntity);
}
});
if(CollUtil.isNotEmpty(updateParceList)){ if(CollUtil.isNotEmpty(updateParceList)){
distributionParcelListClient.updateList(updateParceList); distributionParcelListClient.updateList(updateParceList);
} }
if(CollUtil.isNotEmpty(updateNowWarehouseList)){ if(CollUtil.isNotEmpty(updateNowWarehouseList)){
trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList); trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList);
} }
if(CollUtil.isNotEmpty(updateScanList)){
trunklineCarsLoadScanService.updateBatchById(updateScanList);
}
@ -13423,29 +13505,38 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { // udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
//
}); // });
} }
// trunklineCarsLoadScanService.updateBatchById(updateScanList); // trunklineCarsLoadScanService.updateBatchById(updateScanList);
int i= 0; //完结所有包件异常列表
if(CollUtil.isNotEmpty(orderPackageCodeSet)){
i = orderPackageCodeSet.size();
DealWithAbnormalVO dealWithAbnormalVO = new DealWithAbnormalVO();
dealWithAbnormalVO.setOrderPackageCodes(new ArrayList<>(orderPackageCodeSet));
dealWithAbnormalVO.setCarsNo(carsLoadEntity.getCarsNo());
dealWithAbnormalVO.setWarehouseName(warehouseName);
dealWithAbnormalVO.setNickName(AuthUtil.getNickName());
dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+carsLoadEntity.getCarsNo()+" "+AuthUtil.getNickName()+")");
abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO);
List<String> orderPackageCodes = new ArrayList<>(orderPackageCodeSet);
//完结所有包件异常列表 orderPackageCodes.removeAll(orderPackageCodeList);
if(CollUtil.isNotEmpty(orderPackageCodeSet)){
i = orderPackageCodeSet.size(); String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(IncomingTypeEnum.SYNC_INCOMING.getCode());
DealWithAbnormalVO dealWithAbnormalVO = new DealWithAbnormalVO(); packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content);
dealWithAbnormalVO.setOrderPackageCodes(new ArrayList<>(orderPackageCodeSet));
dealWithAbnormalVO.setCarsNo(carsLoadEntity.getCarsNo()); }
dealWithAbnormalVO.setWarehouseName(warehouseName);
dealWithAbnormalVO.setNickName(AuthUtil.getNickName());
dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+carsLoadEntity.getCarsNo()+" "+AuthUtil.getNickName()+")");
abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO);
} }
bladeRedis.del(key); bladeRedis.del(key);
return R.success("同步成功"+i+"条"); return R.success("同步成功"+i+"条");
} }

236
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -16,6 +16,7 @@
*/ */
package com.logpm.warehouse.service.impl; package com.logpm.warehouse.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -305,6 +306,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if (ObjectUtils.isNotNull(stockArticleEntity)) { if (ObjectUtils.isNotNull(stockArticleEntity)) {
detailEntity.setMarketName(stockArticleEntity.getMallName()); detailEntity.setMarketName(stockArticleEntity.getMallName());
} }
}else{
detailEntity.setMarketName(i.getMallName());
} }
detailEntity.setIncomingBatch(i.getOrderCode()); detailEntity.setIncomingBatch(i.getOrderCode());
return detailEntity; return detailEntity;
@ -843,116 +846,117 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 45); log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 45);
Long taskID; try{
if (ObjectUtils.isNotNull(i.getId())) { Long taskID;
taskID = i.getId(); if (ObjectUtils.isNotNull(i.getId())) {
} else { taskID = i.getId();
taskID = getTaskID();
}
if (i.getIsNew().equals(1)) {
//新增数据
Integer questTarget = i.getQuestTarget();
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(i, questDetail);
questDetail.setTenantId(user.getTenantId());
questDetail.setCreateDept(getDeptByMaxDept(user.getDeptId()));
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setIsChange(1);
if (questTarget.equals(2)) {
questDetail.setHasData(0);
} else { } else {
String orderPackageCode = i.getOrderPackageCode(); taskID = getTaskID();
if (StringUtil.isBlank(orderPackageCode)) { }
if (i.getIsNew().equals(1)) {
//新增数据
Integer questTarget = i.getQuestTarget();
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(i, questDetail);
questDetail.setTenantId(user.getTenantId());
questDetail.setCreateDept(getDeptByMaxDept(user.getDeptId()));
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setIsChange(1);
if (questTarget.equals(2)) {
questDetail.setHasData(0); questDetail.setHasData(0);
} else { } else {
questDetail.setHasData(1); String orderPackageCode = i.getOrderPackageCode();
if (StringUtil.isBlank(orderPackageCode)) {
questDetail.setHasData(0);
} else {
questDetail.setHasData(1);
}
} }
questDetail.setCreateUser(user.getUserId());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setInventoryTime(new Date());
questDetail.setInventoryUser(user.getUserId());
questDetail.setId(taskID);
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestStatus(1);
List<QuestDetailEntity> entityList = new ArrayList<>();
entityList.add(questDetail);
baseMapper.insertQuestDetail(questNum, entityList);
} }
questDetail.setCreateUser(user.getUserId()); Integer stockNum = i.getStockNum();
questDetail.setUpdateUser(user.getUserId()); Integer lossNum = i.getLossNum();
questDetail.setUpdateTime(new Date()); Integer deliveNum = i.getDeliveNum();
questDetail.setInventoryTime(new Date()); Integer wornNum = i.getWornNum();
questDetail.setInventoryUser(user.getUserId()); Integer noReceivedNum = i.getNoReceivedNum();
Integer noRepairNum = i.getNoRepairNum();
questDetail.setId(taskID); if (stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0) {
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestStatus(1); //查询盘点包件信息
List<QuestDetailEntity> entityList = new ArrayList<>(); if (ObjectUtils.isNotNull(i.getOrderPackageCode())) {
entityList.add(questDetail); QuestDetailEntity questDetail = new QuestDetailEntity();
baseMapper.insertQuestDetail(questNum, entityList); questDetail.setOrderPackageCode(i.getOrderPackageCode());
} QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
Integer stockNum = i.getStockNum(); if (ObjectUtils.isNotNull(questDetail1)) {
Integer lossNum = i.getLossNum(); i.setId(questDetail1.getId());
Integer deliveNum = i.getDeliveNum(); taskID = questDetail1.getId();
Integer wornNum = i.getWornNum(); }
Integer noReceivedNum = i.getNoReceivedNum();
Integer noRepairNum = i.getNoRepairNum();
if (stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0) {
//查询盘点包件信息
if (ObjectUtils.isNotNull(i.getOrderPackageCode())) {
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setOrderPackageCode(i.getOrderPackageCode());
QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
if (ObjectUtils.isNotNull(questDetail1)) {
i.setId(questDetail1.getId());
taskID = questDetail1.getId();
} }
}
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(stockNum, "10", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(wornNum, "20", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(lossNum, "30", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(noRepairNum, "40", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(deliveNum, "50", taskID, warehouseId, questNum));
childList.add(addQuestDetailChild(noReceivedNum, "60", taskID, warehouseId, questNum));
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if (b) {
//添加 //添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList); List<QuestDetailChildEntity> childList = new ArrayList<>();
//修改盘点数据 childList.add(addQuestDetailChild(stockNum, "10", taskID, warehouseId, questNum));
List<QuestDetailEntity> list = new ArrayList<>(); childList.add(addQuestDetailChild(wornNum, "20", taskID, warehouseId, questNum));
QuestDetailEntity questDetail = new QuestDetailEntity(); childList.add(addQuestDetailChild(lossNum, "30", taskID, warehouseId, questNum));
questDetail.setId(i.getId()); childList.add(addQuestDetailChild(noRepairNum, "40", taskID, warehouseId, questNum));
questDetail.setQuestStatus(1); //已盘 childList.add(addQuestDetailChild(deliveNum, "50", taskID, warehouseId, questNum));
questDetail.setUpdateUser(user.getUserId()); childList.add(addQuestDetailChild(noReceivedNum, "60", taskID, warehouseId, questNum));
QuestDetailEntity detailEntity = baseMapper.findEntityById(questNum, taskID); boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if (!Objects.isNull(detailEntity)) { if (b) {
Integer isNew = detailEntity.getIsNew(); //添加
Integer questTarget = detailEntity.getQuestTarget(); baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList);
Integer stockNum1 = detailEntity.getStockNum(); //修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
if (isNew.equals(1)) { QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setIsChange(1); questDetail.setId(i.getId());
} else { questDetail.setQuestStatus(1); //已盘
if (!stockNum1.equals(stockNum)) { questDetail.setUpdateUser(user.getUserId());
QuestDetailEntity detailEntity = baseMapper.findEntityById(questNum, taskID);
if (!Objects.isNull(detailEntity)) {
Integer isNew = detailEntity.getIsNew();
Integer questTarget = detailEntity.getQuestTarget();
Integer stockNum1 = detailEntity.getStockNum();
if (isNew.equals(1)) {
questDetail.setIsChange(1); questDetail.setIsChange(1);
} else {
if (!stockNum1.equals(stockNum)) {
questDetail.setIsChange(1);
}
} }
} }
} questDetail.setUpdateTime(new Date());
questDetail.setUpdateTime(new Date()); if (ObjectUtils.isNotNull(i.getTrayId())) {
if (ObjectUtils.isNotNull(i.getTrayId())) { questDetail.setTrayId(i.getTrayId());
questDetail.setTrayId(i.getTrayId()); questDetail.setTrayCode(i.getTrayCode());
questDetail.setTrayCode(i.getTrayCode()); }
} list.add(questDetail);
list.add(questDetail); baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list); } else {
} else { //修改
//修改
// List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList()); // List<QuestDetailChildEntity> collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum + "_child", childList); baseMapper.updetaQuestDetailChildList(questNum + "_child", childList);
}
} }
}
//是否修改库位 //是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity(); QuestDetailEntity questDetail = new QuestDetailEntity();
if (ObjectUtils.isNotNull(i.getGroundingAllocationId()) || ObjectUtils.isNotNull(i.getNewTrayId())) { if (ObjectUtils.isNotNull(i.getGroundingAllocationId()) || ObjectUtils.isNotNull(i.getNewTrayId())) {
//查询当前待更新货位是否包含已更新货位数据 //查询当前待更新货位是否包含已更新货位数据
QuestDetailEntity questDetail1 = new QuestDetailEntity(); QuestDetailEntity questDetail1 = new QuestDetailEntity();
questDetail1.setGroundingAllocationId(i.getGroundingAllocationId()); questDetail1.setGroundingAllocationId(i.getGroundingAllocationId());
// List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1); // List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1);
// if (!questDetailEntities.isEmpty()) { // if (!questDetailEntities.isEmpty()) {
// boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId())); // boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId()));
@ -960,23 +964,27 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// return Resp.scanFail("更新的货位,已有数据,无法上架更新!", "更新的货位,已有数据,无法上架更新!"); // return Resp.scanFail("更新的货位,已有数据,无法上架更新!", "更新的货位,已有数据,无法上架更新!");
// } // }
// } // }
questDetail.setId(i.getId()); questDetail.setId(i.getId());
questDetail.setIsChangeAt(1); questDetail.setIsChangeAt(1);
questDetail.setNewTrayId(i.getNewTrayId()); questDetail.setNewTrayId(i.getNewTrayId());
questDetail.setNewTrayCode(i.getNewTrayCode()); questDetail.setNewTrayCode(i.getNewTrayCode());
// 通过托盘ID 查询托盘名称 // 通过托盘ID 查询托盘名称
if (ObjectUtils.isNotNull(i.getNewTrayCode())) { if (ObjectUtils.isNotNull(i.getNewTrayCode())) {
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(i.getNewTrayCode()); BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(i.getNewTrayCode());
questDetail.setNewTrayName(trayEntity.getPalletName()); questDetail.setNewTrayName(trayEntity.getPalletName());
}
questDetail.setGroundingAllocationId(i.getGroundingAllocationId());
questDetail.setGroundingPositionCode(i.getGroundingPositionCode());
questDetail.setInventoryTime(new Date());
questDetail.setInventoryUser(user.getUserId());
detailEntityList.add(questDetail);
} }
questDetail.setGroundingAllocationId(i.getGroundingAllocationId()); }catch (Exception e){
questDetail.setGroundingPositionCode(i.getGroundingPositionCode()); log.error("######系统异常",e);
questDetail.setInventoryTime(new Date()); throw new CustomerException(405,e.getMessage());
questDetail.setInventoryUser(user.getUserId());
detailEntityList.add(questDetail);
} }
} }
@ -2940,7 +2948,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setMarketNames(marketNames); questDetail.setMarketNames(marketNames);
List<QuestDetailEntity> questDetailEntityList = baseMapper.selectQuestDetailList(taskSearchDTO.getQuestNum(), questDetail); List<QuestDetailEntity> questDetailEntityList = baseMapper.selectQuestDetailList(taskSearchDTO.getQuestNum(), questDetail);
if (questDetailEntityList.isEmpty() || ObjectUtils.isNull(questDetailEntityList) || ObjectUtils.isNull(questDetailEntityList.get(0).getQuestId())) { if (CollUtil.isEmpty(questDetailEntityList)) {
// 需要判读这个盘点任务 是否存在绑定的商场 // 需要判读这个盘点任务 是否存在绑定的商场
R<Object> extracted = extracted(questId, questDetail); R<Object> extracted = extracted(questId, questDetail);
@ -2950,8 +2958,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// 需要去业务系统上进行查询信息 // 需要去业务系统上进行查询信息
List<DistributionParcelListEntity> byPacketBarCode = distributionParcelListClient.findByPacketBarCode(questDetail.getOrderPackageCode()); List<DistributionParcelListEntity> byPacketBarCode = distributionParcelListClient.findByPacketBarCode(questDetail.getOrderPackageCode());
// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(questDetail.getOrderPackageCode(), warehouseId);
if (ObjectUtils.isEmpty(byPacketBarCode)) { if (CollUtil.isEmpty(byPacketBarCode)) {
return R.fail(5000, "包件信息不存在!!"); return R.fail(5000, "包件信息不存在!!");
} else { } else {
for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) { for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) {

Loading…
Cancel
Save