Browse Source

1.发车逻辑优化

visual
zhenghaoyu 4 months ago
parent
commit
28d73d6842
  1. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java
  2. 24
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadEntity.java

@ -1,5 +1,7 @@
package com.logpm.trunkline.entity; package com.logpm.trunkline.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -138,9 +140,11 @@ public class TrunklineCarsLoadEntity extends TenantEntity {
@ApiModelProperty(name = "最新到车仓库id",notes = "") @ApiModelProperty(name = "最新到车仓库id",notes = "")
private Long nowWarehouseId ; private Long nowWarehouseId ;
/** 发车时间 */ /** 发车时间 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "发车时间",notes = "") @ApiModelProperty(name = "发车时间",notes = "")
private Date startTime ; private Date startTime ;
/** 到车时间 */ /** 到车时间 */
@TableField(updateStrategy = FieldStrategy.ALWAYS)
@ApiModelProperty(name = "到车时间",notes = "") @ApiModelProperty(name = "到车时间",notes = "")
private Date arriveTime ; private Date arriveTime ;
/** 取消时间 */ /** 取消时间 */

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

@ -1581,8 +1581,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("###########updateNumByLoadId: 配载计划数据不存在 loadId={}", loadId); log.warn("###########updateNumByLoadId: 配载计划数据不存在 loadId={}", loadId);
throw new CustomerException(400, "配载计划数据不存在"); throw new CustomerException(400, "配载计划数据不存在");
} }
TrunklineCarsLoadEntity updateCarsLoadEntity = new TrunklineCarsLoadEntity(); // TrunklineCarsLoadEntity updateCarsLoadEntity = new TrunklineCarsLoadEntity();
updateCarsLoadEntity.setId(loadId); // updateCarsLoadEntity.setId(loadId);
//计划件数 //计划件数
Integer loadPlanNum = 0; Integer loadPlanNum = 0;
@ -1603,11 +1603,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer realUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1")).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum(); Integer realUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1")).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
Integer stockCarNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && scan.getScanStatus().equals("1")).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum(); Integer stockCarNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && scan.getScanStatus().equals("1")).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum();
updateCarsLoadEntity.setPlanLoadingNumber(loadPlanNum); carsLoadEntity.setPlanLoadingNumber(loadPlanNum);
updateCarsLoadEntity.setRealLoadingNumber(realLoadingNum); carsLoadEntity.setRealLoadingNumber(realLoadingNum);
updateCarsLoadEntity.setUnloadNumber(realUnloadingNum); carsLoadEntity.setUnloadNumber(realUnloadingNum);
updateCarsLoadEntity.setStockNumber(stockCarNum); carsLoadEntity.setStockNumber(stockCarNum);
updateById(updateCarsLoadEntity); updateById(carsLoadEntity);
//节点数据 //节点数据
List<TrunklineCarsLoadLineEntity> carsLoadLineList = trunklineCarsLoadLineService.findListByLoadId(loadId); List<TrunklineCarsLoadLineEntity> carsLoadLineList = trunklineCarsLoadLineService.findListByLoadId(loadId);
@ -1622,12 +1622,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} }
Integer lineRealLoadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getWarehouseId()) && NumberUtil.equals(nodeId,scan.getWarehouseId())).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum(); Integer lineRealLoadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getWarehouseId()) && NumberUtil.equals(nodeId,scan.getWarehouseId())).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum();
Integer lineRealUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1") && !Objects.isNull(scan.getUnloadNodeId()) && NumberUtil.equals(nodeId,scan.getUnloadNodeId())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum(); Integer lineRealUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1") && !Objects.isNull(scan.getUnloadNodeId()) && NumberUtil.equals(nodeId,scan.getUnloadNodeId())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
TrunklineCarsLoadLineEntity updateEntity = new TrunklineCarsLoadLineEntity(); carsLoadLineEntity.setPlanLoadingNumber(planNum);
updateEntity.setId(loadLingId); carsLoadLineEntity.setRealLoadingNumber(lineRealLoadingNum);
updateEntity.setPlanLoadingNumber(planNum); carsLoadLineEntity.setUnloadNumber(lineRealUnloadingNum);
updateEntity.setRealLoadingNumber(lineRealLoadingNum); updateLoadLineList.add(carsLoadLineEntity);
updateEntity.setUnloadNumber(lineRealUnloadingNum);
updateLoadLineList.add(updateEntity);
}); });
if(CollUtil.isNotEmpty(updateLoadLineList)){ if(CollUtil.isNotEmpty(updateLoadLineList)){

Loading…
Cancel
Save