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. 22
      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. 141
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java
  9. 15
      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. 20
      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. 43
      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. 123
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  28. 14
      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_WAREHOUSE_ENTRY(101020, "始发仓入库"),
UNLOAD_WAREHOUSE_ENTRY(101021, "卸车并入库"),
ERROR_WAREHOUSE_ENTRY(101022, "异常入库"),
OPEN_ORDER(102010, "开单"),
CHANGE_ORDER(102020, "改单"),
@ -46,6 +47,7 @@ public enum WorkNodeEnums implements Serializable {
SIGN_DIRECT_SHIPPER(105030,"直发商家签收"),
END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"),
NO_STOCK_CAR(105050, "本车次少货"),
NO_DATA(105051, "无效包条码"),
COST_SHARE(105060, "车次成本分摊"),
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 = "是否点位补贴计费")
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.setWarehouseId(abnormalRecordDTO.getWarehouseId());
warehousePackageTrackLogEntity.setWarehouseName(abnormalRecordDTO.getWarehouseName());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode());
warehousePackageTrackLogEntity.setWorkNode(WorkNodeEnums.NO_DATA.getCode());
warehousePackageTrackLogEntity.setContent("异常处理已确认为无效包条码");
warehousePackageTrackLogEntity.setOperator(AuthUtil.getNickName());
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){
log.error("保存失败!", e);
throw new CustomerException(405, "保存失败!");
@ -284,7 +287,7 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
*/
private String buildEqualString(BasicdataFactoryCategoryEntity allBasicdataFactoryCategoryEntity) {
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(allBasicdataFactoryCategoryEntity.getBrand()).append(allBasicdataFactoryCategoryEntity.getCategory());
stringBuffer.append(allBasicdataFactoryCategoryEntity.getBrand());
// 增加结算类型 收入或者成本
stringBuffer.append(allBasicdataFactoryCategoryEntity.getType());
@ -322,7 +325,7 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
*/
private String buildEqualString2(BasicdataFactoryCategoryExcel datum) {
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(datum.getBrand()).append(datum.getCategory());
stringBuffer.append(datum.getBrand());
// 增加结算类型 收入或者成本
stringBuffer.append(datum.getType());
if (ObjectUtil.isNotEmpty(datum.getFirsts())) {

22
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.setConditions(qualityDeliverEntity.getConditions());
entity.setSignNum(qualityDeliverEntity.getSignNum());
entity.setArriveProvince(qualityDeliverEntity.getArriveProvince());
entity.setArriveCity(qualityDeliverEntity.getArriveCity());
entity.setArriveDistrict(qualityDeliverEntity.getArriveDistrict());
// 查询品类
BasicdataFactoryCategoryEntity param = new BasicdataFactoryCategoryEntity();
param.setBrand(qualityDeliverEntity.getBrandName());
@ -763,8 +766,27 @@ public class DeliverFinishReportListener implements ReportService {
Set<Long> longs = valueMap.keySet();
Integer dkp = 0;
if (CollUtil.isNotEmpty(allRouteMap)) {
// 是否合并区域计费
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)) {
dkp = dkp - 1;
}

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

@ -335,11 +335,11 @@ public class QualityDeliverAddListener implements ReportService {
TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNumber, orderCode);
if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) {
qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber());
}
redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 60L);
}
}
}
}
private void buildOrderInfo(QualityDeliverEntity qualityDeliverEntity, Long warehouseId, String orderCode) {
DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticleEntity(warehouseId, orderCode);

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);
pushList.add(distributionLoadscanEntity);
loadingId = distributionLoadscanEntity.getId();
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "扫描异常签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
pushList.add(distributionLoadscanEntity);
} else {
loadingId = distributionLoadscanEntity.getId();
@ -6090,13 +6092,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObject.put("num", 1);
jsonObject.put("remark", "批量签收下架");
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());
//distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse);
} else {
loadscanEntities.setMsg("司机一键签收数据补录");
if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//已经进行过装车 这里不需要进行订制品订单在库数量扣减
@ -6110,11 +6110,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntities.setReceivedQuantity(parcelListEntity.getQuantity());
loadscanEntities.setSigningTime(signingTime);
DistributionLoadscanEntity update = getDistributionLoadscanEntity(loadscanEntities);
content = "包件在" + myCurrentWarehouse.getName() + "由" + update.getSigningUser() + "司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
distributionLoadscanService.updateById(update);
distributionLoadscanEntityLists.add(loadscanEntities);
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());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse);
@ -6131,21 +6130,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(packageIds)) {
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.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());

141
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 lombok.AllArgsConstructor;
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.OrderSplitStateConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageSplitStateConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@ -106,6 +107,27 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
if (distributionStockArticle == null) {
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, () -> {
String allTaskNo = getAllTaskNo();
@ -210,6 +232,28 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
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 {
List<DistributionSplitOrderDetailEntity> existsList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes)
@ -617,8 +661,26 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
try {
task.setState(OrderSplitStateConstant.finish.getValue());
task.setFinishTime(DateUtil.now());
task.setFinishUsername(AuthUtil.getUser().getUserName());
task.setFinishUser(AuthUtil.getUser().getUserId());
updateById(task);
} catch (Exception e) {
if (e instanceof CustomerException) {
throw new CustomerException(e.getMessage());
}
log.error("完成拆单任务系统错误", e);
throw new CustomerException("系统错误");
}
return R.success("success");
}
private void packageTransfer(DistributionSplitOrderTaskEntity task) {
List<DistributionSplitOrderDetailEntity> packageList = distributionSplitOrderDetailService.list(Wrappers.<DistributionSplitOrderDetailEntity>lambdaQuery()
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId)
.eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId())
.eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue())
);
@ -644,10 +706,6 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
task.setNewStockArticleId(newOrder.getId());
task.setState(OrderSplitStateConstant.finish.getValue());
task.setFinishTime(DateUtil.now());
task.setFinishUsername(AuthUtil.getUser().getUserName());
task.setFinishUser(AuthUtil.getUser().getUserId());
updateById(task);
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>lambdaUpdate()
@ -658,62 +716,29 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
);
distributionSplitOrderLogService.record(task, "完成拆单任务", AuthUtil.getUser().getUserName());
} catch (Exception e) {
if (e instanceof CustomerException) {
throw new CustomerException(e.getMessage());
}
log.error("完成拆单任务系统错误", e);
throw new CustomerException("系统错误");
}
return R.success("success");
}
/**
* 取消完成
* @param taskId
* @return
*/
@Override
public R<String> cancelTask(Long taskId) {
DistributionSplitOrderTaskEntity task = getById(taskId);
if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) {
return R.fail("任务未已完成或已取消,无法操作");
return R.fail("任务未已完成,无法操作");
}
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId());
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) {
return R.fail("拆单总任务已完成或已取消,无法操作");
return R.fail("拆单总任务已完成,无法操作");
}
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());
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());
} catch (Exception e) {
@ -731,16 +756,24 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
public R<String> cancelAllTask(Long allTaskId) {
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId);
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);
return R.success("success");
}
@Override
@Transactional
public R<String> finishAllTask(Long allTaskId) {
DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId);
if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) {
@ -756,8 +789,16 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
}
allTask.setState(OrderSplitAllTaskStateConstant.finish.getValue());
allTask.setFinishTime(DateUtil.now());
allTask.setFinishUsername(AuthUtil.getUser().getUserName());
allTask.setFinishUser(AuthUtil.getUser().getUserId());
distributionSplitOrderAllTaskService.updateById(allTask);
list(Wrappers.<DistributionSplitOrderTaskEntity>lambdaQuery()
.eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId)
.eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue())
).forEach(this::packageTransfer);
return R.success("success");
}

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

@ -5844,6 +5844,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else {
packageFlag = true;
}
}else {
packageFlag = true;
}
//库存品
if (!inventoryList.isEmpty() && inventoryList.size() > 0) {
@ -6334,7 +6336,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (!stockListId.equals(disStockListDetailEntity.getStockListId())){
//对已有计划进行减少
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);
distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, 1);
distributionStockListMapper.updateInventoryQuantityOccupied(distributionStockListEntity.getId(), 1);
@ -6353,6 +6359,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
disStockListDetailEntity.setStockPackageCode(one.getCode());
disStockListDetailEntity.setStockType(InventoryStockTypeStatusConstant.shengcheng.getValue());
disStockListDetailEntity.setStockListId(distributionStockListEntity.getId());
disStockListDetailService.updateById(disStockListDetailEntity);
distributionStockListService.updateById(distributionStockListEntity);
distributionStockListMapper.updateInventoryQuantityOccupied(disStockListDetailEntity.getStockListId(), disStockListDetailEntity.getNum());
distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, num);
@ -6360,7 +6367,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
distrilbutionBillLadingService.maintenanceStockListStockup(reservationId, stockListId, myCurrentWarehouse.getId());
//对原计划进行减少
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);
}
}

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()
.eq(DisStockListDetailEntity::getReservationId, i.getId())
.eq(DisStockListDetailEntity::getSku, i.getSku())
.eq(DisStockListDetailEntity::getStockListId, i.getStockListId())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
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)) {
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();

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 = "订单号")
private String orderCode;
/**
* 包条码
*/
@ApiModelProperty(value = "包条码")
private String packageCode;
/**
* 运单号
*/

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

@ -173,11 +173,17 @@ public class NodeDataPushListener {
// value 按包件分组 包含则数量+1
// 分拨中心回传所有包件,其他节点回传当前操作的包件
if (isArrival) {
List<DeliveryNoteEntity> collect2 = factoryList.stream()
.filter(data -> data.getCrmSo().equals(orderCode))
.filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo))
.collect(Collectors.toList());
snMap = collect2.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty())));
// List<DeliveryNoteEntity> collect2 = factoryList.stream()
// .filter(data -> data.getCrmSo().equals(orderCode))
// .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo))
// .collect(Collectors.toList());
List<DeliveryNoteEntity> checkList = deliveryNoteService.list(Wrappers.<DeliveryNoteEntity>lambdaQuery()
.select(DeliveryNoteEntity::getSn, DeliveryNoteEntity::getQty)
.eq(DeliveryNoteEntity::getShipmentSplitNo, shipmentSplitNo)
.eq(DeliveryNoteEntity::getCrmSo, orderCode)
);
snMap = checkList.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty())));
for (DeliveryNoteEntity deliveryNoteEntity : checkList) {
FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder()
.orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue())
.waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName())
@ -186,9 +192,11 @@ public class NodeDataPushListener {
.receivable(0).receipts(0)
.type(needSendNode.getValue())
.typeCode(needSendNode.getCode())
.packageCode(deliveryNoteEntity.getSn())
.build();
pushEntities.add(entity1);
factoryNodeAllPushEntity.setPackageCode(collect2.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(",")));
}
factoryNodeAllPushEntity.setPackageCode(checkList.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(",")));
} else {
for (PushData data : value) {
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 = "开单时效明细报表")
public R openTimeDetailPage(@RequestBody ReportTimeDTO reportTimeDTO) {
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{
return reportTimeService.openTimeDetailPage(reportTimeDTO);
}catch (Exception e){
@ -82,23 +65,6 @@ public class ReportTimeController extends BladeController {
@ApiOperation(value = "开单时效明细报表导出", notes = "开单时效明细报表导出")
public void openTimeDetailExport(@RequestBody ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
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);
}

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

@ -143,7 +143,7 @@
t.driver_name,
t.vehicle_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_user_name,
t.reviewStatus,

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

@ -245,9 +245,10 @@
from logpm_trunkline_advance_detail lta
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_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
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 waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
@ -305,9 +306,10 @@
from logpm_trunkline_advance_detail lta
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_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
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 waw.business_line is not null
<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
from logpm_distribution_parcel_list ldpl
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
where ldpl.is_transfer = 1
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
from logpm_distribution_parcel_list ldpl
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
where ldpl.is_transfer = 1
and ldpl.create_time &gt; '2024-10-22 00:00:00'
@ -711,9 +713,11 @@
ldsa.brand brand,
sum(ldsa.incoming_num) incomingNum,
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,
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
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
@ -775,9 +779,11 @@
ldsa.brand brand,
sum(ldsa.incoming_num) incomingNum,
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,
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
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
@ -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
where ltad.waybill_id is not null
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
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
@ -1618,6 +1625,7 @@
lta.store_name storeName,
lta.warehouse_id warehouseId,
lta.warehouse_name warehouseName,
min(ltad.incoming_time) incomingTime,
GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName,
lta.site_name siteName,
lta.brand brand,
@ -1656,9 +1664,15 @@
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
where lta.create_time > '2024-10-22 00:00:00'
<if test="param.businessLine != null and param.businessLine !='' ">
and waw.business_line = #{param.businessLine}
</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">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
@ -1788,6 +1802,7 @@
lta.store_name storeName,
lta.warehouse_id warehouseId,
lta.warehouse_name warehouseName,
min(ltad.incoming_time) incomingTime,
GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName,
lta.site_name siteName,
lta.brand brand,
@ -1832,9 +1847,15 @@
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
where lta.create_time > '2024-10-22 00:00:00'
<if test="param.businessLine != null and param.businessLine !='' ">
and waw.business_line = #{param.businessLine}
</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">
and waw.business_line in
<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_warehouse_waybill lww on lww.id = ltad.waybill_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
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 waw.business_line is not null
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_warehouse_waybill lww on lww.id = ltad.waybill_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
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 waw.business_line is not null
and waw.business_line = #{param.businessLine}
@ -2945,7 +2968,7 @@
from logpm_distribution_parcel_list ldpl
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_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
where ldpl.is_transfer = 1
and ldpl.create_time > '2024-10-22 00:00:00'
@ -3046,7 +3069,7 @@
from logpm_distribution_parcel_list ldpl
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_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
where ldpl.is_transfer = 1
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;
@ExcelProperty(value = "导入仓库")
private String warehouseName;
@ExcelProperty(value = "入库时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date incomingTime;
@ExcelProperty(value = "入库仓库")
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;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
@ -94,7 +95,7 @@ public class QualityDispatchTaskVO implements Serializable {
private Integer signStockNum;
@ApiModelProperty(value = "状态")
@ExcelProperty("状态")
@ExcelIgnore
private String signStatus;
@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();
if (CollUtil.isNotEmpty(list)) {
Set<Long> collect = list.stream()
.filter(item -> ObjectUtil.isNotEmpty(item.getDriverId()))
.filter(item -> !item.getDriverId().equals(byId.getDriverId()))
.map(ExpenseDispatchPriceServiceEntity::getDriverId).collect(Collectors.toSet());
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;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.statistics.entity.ExpenseDispatchPriceServiceEntity;
import com.logpm.statistics.entity.ExpenseDispatchPriceTemplateEntity;
import com.logpm.statistics.excel.ExpenseDispatchPriceTemplateExcel;
import com.logpm.statistics.query.ExpenseDispatchPriceTemplateQuery;
import com.logpm.statistics.service.IExpenseDispatchPriceServiceService;
import com.logpm.statistics.service.IExpenseDispatchPriceTemplateService;
import com.logpm.statistics.vo.ExpenseDispatchPriceTemplateVO;
import com.logpm.statistics.wrapper.ExpenseDispatchPriceTemplateWrapper;
@ -65,6 +69,7 @@ import java.util.Map;
public class ExpenseDispatchPriceTemplateController extends BladeController {
private final IExpenseDispatchPriceTemplateService expenseDispatchPriceTemplateService;
private final IExpenseDispatchPriceServiceService expenseDispatchPriceServiceService;
/**
* 成本配送价格模版 详情
@ -136,7 +141,13 @@ public class ExpenseDispatchPriceTemplateController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入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.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.dto.PackageCodeDTO;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import io.swagger.annotations.Api;
@ -17,10 +18,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Slf4j
@ -62,14 +61,14 @@ public class AdvanceDetailController {
}
@GetMapping("/showAdvancePackgeCode")
@PostMapping("/showAdvancePackgeCode")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "返回模板和模板内容")
public R showAdvancePackgeCode(@ApiIgnore @RequestParam Map<String,Object> params){
public R showAdvancePackgeCode(@RequestBody PackageCodeDTO packageCodeDTO){
OrderPackgeCodeDataVO orderPackgeCodeDataVo= null;
try {
orderPackgeCodeDataVo = advanceDetailService.showAdvancePackgeCode(params);
orderPackgeCodeDataVo = advanceDetailService.showAdvancePackgeCode(packageCodeDTO);
} catch (Exception e) {
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.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.dto.PackageCodeDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
@ -41,7 +42,7 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
Integer getNumByAdvanceId(Long advanceId);
OrderPackgeCodeDataVO showAdvancePackgeCode(Map<String, Object> params) throws Exception;
OrderPackgeCodeDataVO showAdvancePackgeCode(PackageCodeDTO packageCodeDTO) throws Exception;
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())){
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)) {
log.info("###############openWaybill: 更新订单列表, {}", 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.extension.plugins.pagination.Page;
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.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.dto.PackageCodeDTO;
import com.logpm.trunkline.entity.ReportPackageBasicEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
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.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
@ -157,7 +158,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
}
@Override
public OrderPackgeCodeDataVO showAdvancePackgeCode(Map<String, Object> params) throws Exception {
public OrderPackgeCodeDataVO showAdvancePackgeCode(PackageCodeDTO packageCodeDTO) throws Exception {
log.info("----------------------------------------111111111");
OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();
List<Map> data = new ArrayList<>();
@ -170,15 +171,10 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
orderPackgeCodeDataVO.setTemplateHtml(html);
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");
for (String orderPackageCode : idArray) {
orderPackageCodes.forEach(orderPackageCode -> {
DistributionStockArticleQRCodeVO vo = new DistributionStockArticleQRCodeVO();
log.info("----------------------------------------444444444444444444");
TrunklineAdvanceDetailEntity advanceDetailEntity = baseMapper.findEntityByOrderPackageCodelimit1(orderPackageCode);
@ -241,9 +237,14 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
String fileTypeName = QRCodeUtil.createCodeToFile(vo.getOrderCode());
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
data.add(map);
String tempData = TemplateUtil.popTemplate(template.getTemplateName(), map, orderPackgeCodeDataVO.getTemplateHtml());
values.add(tempData);
String tempData = null;
try {
tempData = TemplateUtil.popTemplate(template.getTemplateName(), map, orderPackgeCodeDataVO.getTemplateHtml());
} catch (Exception e) {
throw new CustomerException(405, "模板生成失败");
}
values.add(tempData);
});
log.info("----------------------------------------88888888888888");
orderPackgeCodeDataVO.setDataList(data);

123
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
String carsNo = carsLoadEntity.getCarsNo();
if (!warehouseId.equals(nowWarehouseId)) {
log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId);
throw new CustomerException(400, "配载未到达当前仓");
}
// if (!warehouseId.equals(nowWarehouseId)) {
// log.warn("#############cancelArriveCarByLoadId: 配载未到达当前仓 loadId={} nowWarehouseId={}", loadId, nowWarehouseId);
// throw new CustomerException(400, "配载未到达当前仓");
// }
String loadStatus = carsLoadEntity.getLoadStatus();
@ -1220,10 +1220,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (unloadType == 1) {
node = WorkNodeEnums.TRANSFER_WAREHOUSE_UNLOADING;
//网点卸车确认
if ("40".equals(loadStatus)) {
log.warn("#############unloadByLoadId: 当前节点为终点 loadId={} loadStatus={}", loadId, loadStatus);
throw new CustomerException(400, "当前节点为终点");
}
// if ("40".equals(loadStatus)) {
// log.warn("#############unloadByLoadId: 当前节点为终点 loadId={} loadStatus={}", loadId, loadStatus);
// throw new CustomerException(400, "当前节点为终点");
// }
updateUnloadStatus.setId(currentCarsLoadLineEntity.getId());
updateUnloadStatus.setUnloadStatus("1");
currentCarsLoadLineEntity.setUnloadStatus("1");
@ -1516,6 +1516,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String content = "包件在 " + warehouseEntity.getName() + "卸车确认";
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) {
log.warn("###############unloadPackage: 存入异常列表记录失败");
}
@ -9934,6 +9937,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String packageStatus = advanceDetailEntity.getPackageStatus();
String orderCode = advanceDetailEntity.getOrderCode();
String waybillNo = advanceDetailEntity.getWaybillNo();
Long advanceId = advanceDetailEntity.getAdvanceId();
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
if ("0".equals(packageStatus)) {
InComingDTO inComingDTO = new InComingDTO();
inComingDTO.setOrderPackageCode(scanCode);
@ -9949,6 +9956,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setIsData(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);
return R.success("同步成功");
}
@ -9991,6 +10008,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setIsData(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);
return R.success("同步成功");
@ -10022,6 +10049,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setIsData(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);
return R.success("同步成功");
@ -11139,6 +11176,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<DistributionStockArticleEntity> updateStockArticleList = new ArrayList<>();
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);
if(CollUtil.isNotEmpty(loadScanEntityList)){
//把loadScanEntityList通过fromNodeId进行分组
@ -13274,7 +13327,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
int i= 0;
List<TrunklineCarsLoadScanEntity> carsLoadScanEntities = trunklineCarsLoadScanService.findUnloadNoDataList(loadId,warehouseId);
if(CollUtil.isNotEmpty(carsLoadScanEntities)){
//把carsLoadScanEntities中所有元素的scanCode放入一个Set集合
Set<String> scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet());
@ -13287,9 +13343,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
int packageBatchSize = 500;
List<List<String>> orderPackageCodeGroups = new ArrayList<>();
for (int i = 0; i < scanCodeList.size(); i += packageBatchSize) {
int endIndex = Math.min(i + packageBatchSize, scanCodeList.size());
orderPackageCodeGroups.add(scanCodeList.subList(i, endIndex));
for (int m = 0; m < scanCodeList.size(); m += packageBatchSize) {
int endIndex = Math.min(m + packageBatchSize, scanCodeList.size());
orderPackageCodeGroups.add(scanCodeList.subList(m, endIndex));
}
orderPackageCodeGroups.forEach(orderPackageCodeGroup -> {
@ -13297,12 +13353,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
allAdvanceDetailList.addAll(advanceDetailEntityList);
});
//把allAdvanceDetailList中所有advanceId放入一个Set集合
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()));
//把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 -> {
@ -13310,6 +13374,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
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());
@ -13327,6 +13393,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
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);
}
@ -13358,6 +13435,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String reserve5 = trunklineAdvanceDetailEntity.getReserve5();
Date unloadTime = CommonUtil.StringToDate(reserve5);
orderPackageCodeList.add(orderPackageCode);
//查询是否有在系统无编码后进行卸车的数据
int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime);
if(unloadNum > 0){
@ -13398,6 +13477,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList);
}
if(CollUtil.isNotEmpty(updateScanList)){
trunklineCarsLoadScanService.updateBatchById(updateScanList);
}
@ -13423,17 +13505,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
});
// udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> {
//
// });
}
// trunklineCarsLoadScanService.updateBatchById(updateScanList);
int i= 0;
//完结所有包件异常列表
if(CollUtil.isNotEmpty(orderPackageCodeSet)){
i = orderPackageCodeSet.size();
@ -13444,7 +13524,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
dealWithAbnormalVO.setNickName(AuthUtil.getNickName());
dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+carsLoadEntity.getCarsNo()+" "+AuthUtil.getNickName()+")");
abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO);
List<String> orderPackageCodes = new ArrayList<>(orderPackageCodeSet);
orderPackageCodes.removeAll(orderPackageCodeList);
String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(IncomingTypeEnum.SYNC_INCOMING.getCode());
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content);
}
}
bladeRedis.del(key);
return R.success("同步成功"+i+"条");

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

@ -16,6 +16,7 @@
*/
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.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -305,6 +306,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if (ObjectUtils.isNotNull(stockArticleEntity)) {
detailEntity.setMarketName(stockArticleEntity.getMallName());
}
}else{
detailEntity.setMarketName(i.getMallName());
}
detailEntity.setIncomingBatch(i.getOrderCode());
return detailEntity;
@ -843,6 +846,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 45);
try{
Long taskID;
if (ObjectUtils.isNotNull(i.getId())) {
taskID = i.getId();
@ -977,6 +981,10 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntityList.add(questDetail);
}
}catch (Exception e){
log.error("######系统异常",e);
throw new CustomerException(405,e.getMessage());
}
}
@ -2940,7 +2948,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setMarketNames(marketNames);
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);
@ -2950,8 +2958,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// 需要去业务系统上进行查询信息
List<DistributionParcelListEntity> byPacketBarCode = distributionParcelListClient.findByPacketBarCode(questDetail.getOrderPackageCode());
if (ObjectUtils.isEmpty(byPacketBarCode)) {
// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(questDetail.getOrderPackageCode(), warehouseId);
if (CollUtil.isEmpty(byPacketBarCode)) {
return R.fail(5000, "包件信息不存在!!");
} else {
for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) {

Loading…
Cancel
Save