Browse Source

1.干线bug修复

master
zhenghaoyu 5 months ago
parent
commit
407d300516
  1. 18
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java
  2. 23
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  3. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  4. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  5. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  6. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  7. 234
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  8. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

18
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java

@ -15,13 +15,17 @@ public class CarsLoadOrderInfoVO implements Serializable {
private Integer loadingNum = 0; private Integer loadingNum = 0;
private Integer unloadNum = 0; private Integer unloadNum = 0;
private Integer signNum = 0; private Integer signNum = 0;
private BigDecimal unloadIncome = BigDecimal.ZERO; private BigDecimal unloadIncome = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private BigDecimal costZhang = BigDecimal.ZERO; private BigDecimal costZhang = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private BigDecimal costPiece = BigDecimal.ZERO; private BigDecimal costPiece = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private BigDecimal income = BigDecimal.ZERO; private BigDecimal income = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private BigDecimal weight = BigDecimal.ZERO; private BigDecimal weight = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private BigDecimal volume = BigDecimal.ZERO; private BigDecimal volume = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private BigDecimal orderFreight = BigDecimal.ZERO; private BigDecimal orderFreight = BigDecimal.ZERO.setScale(2, BigDecimal.ROUND_HALF_UP);
private String orderGoodsName;
private String orderGoodsNum;
private String orderGoodsVolume;
private String orderGoodsWeight;
private String checkUserName;//审核人员 private String checkUserName;//审核人员

23
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -3,8 +3,6 @@ package com.logpm.patch.jobhandle;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
@ -1264,17 +1262,38 @@ public class SyncOrderInfoToPlatform {
distributionParcelListClient.updateList(updateParceList); distributionParcelListClient.updateList(updateParceList);
} }
}
@XxlJob("jisuanLoadNum")
public ReturnT<String> jisuanLoadNum(String param) {
log.info("############jisuanLoadNum: 计算车次数量 开始");
if(StringUtil.isBlank(param)){
log.warn("###########jisuanLoadNum: 车次号为空");
throw new CustomerException(405,"车次号为空");
}
String[] split = param.split(",");
for (int i = 0; i < split.length; i++) {
String carNo = split[i];
log.info("###################jisuanLoadNum: 当前处理的车次号为 carNo={}",carNo);
TrunklineCarsLoadEntity entityByCarsNo = carsLoadClient.findEntityByCarsNo(carNo);
Long loadId = entityByCarsNo.getId();
carsLoadClient.updateCardLoadNum(loadId);
}
log.info("############jisuanLoadNum: 计算车次数量 完成");
return ReturnT.SUCCESS;
} }
} }

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java

@ -50,4 +50,5 @@ public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntit
IPage<TrunklineAdvanceVO> advancePageListByBussiness(IPage<Object> page, @Param("param") AdvanceDTO advanceDTO); IPage<TrunklineAdvanceVO> advancePageListByBussiness(IPage<Object> page, @Param("param") AdvanceDTO advanceDTO);
Integer findTotalNumByWaybillNoAndOrderCode(@Param("waybillNo") String waybillNo, @Param("orderCode") String orderCode);
} }

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -261,4 +261,11 @@
where waybill_no = #{waybillNo} where waybill_no = #{waybillNo}
</update> </update>
<select id="findTotalNumByWaybillNoAndOrderCode" resultType="int">
select IFNULL(sum(total_num),0)
from logpm_trunkline_advance
where waybill_no = #{waybillNo}
and order_code = #{orderCode}
</select>
</mapper> </mapper>

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

@ -51,4 +51,6 @@ public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEn
IPage<TrunklineAdvanceVO> advancePageListByBussiness(IPage<Object> page, AdvanceDTO advanceDTO); IPage<TrunklineAdvanceVO> advancePageListByBussiness(IPage<Object> page, AdvanceDTO advanceDTO);
void clearWaybillInfoByWaybillNo(String waybillNo); void clearWaybillInfoByWaybillNo(String waybillNo);
Integer findTotalNumByWaybillNoAndOrderCode(String waybillNo, String orderCode);
} }

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -1974,4 +1974,9 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
public void clearWaybillInfoByWaybillNo(String waybillNo) { public void clearWaybillInfoByWaybillNo(String waybillNo) {
baseMapper.clearWaybillInfoByWaybillNo(waybillNo); baseMapper.clearWaybillInfoByWaybillNo(waybillNo);
} }
@Override
public Integer findTotalNumByWaybillNoAndOrderCode(String waybillNo, String orderCode) {
return baseMapper.findTotalNumByWaybillNoAndOrderCode(waybillNo,orderCode);
}
} }

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

@ -1658,7 +1658,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String orderCode = carsOrderEntity.getOrderCode(); String orderCode = carsOrderEntity.getOrderCode();
String waybillNo = carsOrderEntity.getWaybillNo(); String waybillNo = carsOrderEntity.getWaybillNo();
Integer carsOrderRealLoadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getWarehouseId()) && NumberUtil.equals(nodeId,scan.getWarehouseId()) && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum(); Integer carsOrderRealLoadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getWarehouseId()) && NumberUtil.equals(nodeId,scan.getWarehouseId()) && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getNum).sum();
Integer carsOrderRealUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1") && !Objects.isNull(scan.getUnloadNodeId()) && NumberUtil.equals(nodeId,scan.getUnloadNodeId()) && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum(); Integer carsOrderRealUnloadingNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && !scan.getScanStatus().equals("1") && !Objects.isNull(scan.getUnloadNodeId()) && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
Integer carsOrderRealSignNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && scan.getScanStatus().equals("3") && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum(); Integer carsOrderRealSignNum = scanList.stream().filter(scan -> !Objects.isNull(scan.getScanStatus()) && scan.getScanStatus().equals("3") && StringUtil.equals(orderCode,scan.getOrderCode()) && StringUtil.equals(waybillNo,scan.getWaybillNo())).mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
carsOrderEntity.setRealNum(carsOrderRealLoadingNum); carsOrderEntity.setRealNum(carsOrderRealLoadingNum);
carsOrderEntity.setUnloadNum(carsOrderRealUnloadingNum); carsOrderEntity.setUnloadNum(carsOrderRealUnloadingNum);
@ -3598,21 +3598,23 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (Objects.isNull(otherParcelListEntity)) { if (Objects.isNull(otherParcelListEntity)) {
TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = trunklineAdvanceDetailService.findEntityByOrderPackageCode(orderPackageCode); TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = trunklineAdvanceDetailService.findEntityByOrderPackageCode(orderPackageCode);
if (Objects.isNull(trunklineAdvanceDetailEntity)) { if (Objects.isNull(trunklineAdvanceDetailEntity)) {
carsLoadScanEntity.setOrderCode("--");
carsLoadScanEntity.setIsData(0);
carsLoadScanEntity.setReserve1("1");
//把其他仓reserve1为1的更新为2
trunklineCarsLoadScanService.updateReserve1ByOrderPackageCode(orderPackageCode,"2");
isData = 0; return Resp.scanFail(405,"系统无编码","系统无编码,不能装车");
remark = "无系统数据,异常装车"; // carsLoadScanEntity.setOrderCode("--");
audio = "系统无编码"; // carsLoadScanEntity.setIsData(0);
// carsLoadScanEntity.setReserve1("1");
// //把其他仓reserve1为1的更新为2
// trunklineCarsLoadScanService.updateReserve1ByOrderPackageCode(orderPackageCode,"2");
// isData = 0;
// remark = "无系统数据,异常装车";
// audio = "系统无编码";
} else { } else {
carsLoadScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode()); // carsLoadScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
carsLoadScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo()); // carsLoadScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
carsLoadScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId()); // carsLoadScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
carsLoadScanEntity.setIsData(1); // carsLoadScanEntity.setIsData(1);
carsLoadScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId()); // carsLoadScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId());
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus(); String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if ("0".equals(packageStatus)) { if ("0".equals(packageStatus)) {
//未入库 //未入库
@ -3627,14 +3629,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("##################loadingScan: 暂存单未开单 orderPackageCode={}", orderPackageCode); log.warn("##################loadingScan: 暂存单未开单 orderPackageCode={}", orderPackageCode);
remark = "有系统数据,暂存单未开单"; remark = "有系统数据,暂存单未开单";
audio = "包件未开单"; audio = "包件未开单";
return Resp.scanFail(405,"包件未开单","包件未开单,不能装车");
} else { } else {
log.warn("##################loadingScan: 包件暂未入到本仓 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId); log.warn("##################loadingScan: 包件暂未入到本仓 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
remark = "有系统数据,包件暂未入到本仓"; remark = "有系统数据,包件暂未入到本仓";
audio = "包件未入库"; audio = "包件未入库";
return Resp.scanFail(405,"包件未入库","包件不在当前仓,不能装车");
} }
} }
} }
} else { } else {
return Resp.scanFail(405,"包件不在当前仓","包件不在当前仓,不能装车");
//先把其他仓在库的包件出库并下架 //先把其他仓在库的包件出库并下架
// try{ // try{
// List<DistributionParcelListEntity> parcelListEntities = distributionParcelListClient.findAllStockListByOrderPackageCode(orderPackageCode); // List<DistributionParcelListEntity> parcelListEntities = distributionParcelListClient.findAllStockListByOrderPackageCode(orderPackageCode);
@ -3648,53 +3654,53 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// log.warn("################loadingScan: 下架及解托包件失败"); // log.warn("################loadingScan: 下架及解托包件失败");
// } // }
carsLoadScanEntity.setIsData(1); // carsLoadScanEntity.setIsData(1);
isData = 1; // isData = 1;
Long otherPackageId = otherParcelListEntity.getId(); // Long otherPackageId = otherParcelListEntity.getId();
String waybillNumber = otherParcelListEntity.getWaybillNumber(); // String waybillNumber = otherParcelListEntity.getWaybillNumber();
fromWarehouseId = otherParcelListEntity.getWarehouseId(); // fromWarehouseId = otherParcelListEntity.getWarehouseId();
orderCode = otherParcelListEntity.getOrderCode(); // orderCode = otherParcelListEntity.getOrderCode();
brandName = otherParcelListEntity.getBrandName(); // brandName = otherParcelListEntity.getBrandName();
BasicdataWarehouseEntity fromWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(fromWarehouseId); // BasicdataWarehouseEntity fromWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(fromWarehouseId);
if (!Objects.isNull(fromWarehouseEntity)) { // if (!Objects.isNull(fromWarehouseEntity)) {
fromWarehouseName = fromWarehouseEntity.getName(); // fromWarehouseName = fromWarehouseEntity.getName();
} // }
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber); // WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
if (!Objects.isNull(waybillEntity)) { // if (!Objects.isNull(waybillEntity)) {
waybillId = waybillEntity.getId(); // waybillId = waybillEntity.getId();
waybillNo = waybillEntity.getWaybillNo(); // waybillNo = waybillEntity.getWaybillNo();
destinationWarehouse = waybillEntity.getDestinationWarehouseName(); // destinationWarehouse = waybillEntity.getDestinationWarehouseName();
} // }
carsLoadScanEntity.setWaybillId(waybillId); // carsLoadScanEntity.setWaybillId(waybillId);
carsLoadScanEntity.setWaybillNo(waybillNo); // carsLoadScanEntity.setWaybillNo(waybillNo);
carsLoadScanEntity.setOrderCode(orderCode); // carsLoadScanEntity.setOrderCode(orderCode);
carsLoadScanEntity.setFromWarehouseId(fromWarehouseId); // carsLoadScanEntity.setFromWarehouseId(fromWarehouseId);
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); // DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if (Objects.isNull(stockArticleEntity)) { // if (Objects.isNull(stockArticleEntity)) {
log.warn("##################loadingScan: 订单信息不存在 orderCode={} warehouseId={}", orderCode, warehouseId); // log.warn("##################loadingScan: 订单信息不存在 orderCode={} warehouseId={}", orderCode, warehouseId);
return R.fail(405, "订单信息不存在"); // return R.fail(405, "订单信息不存在");
} // }
Long articleId = stockArticleEntity.getId(); // Long articleId = stockArticleEntity.getId();
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - 1); // stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - 1);
//
distributionParcelListClient.updateOrderPackageCodeById(otherPackageId, "60"); // distributionParcelListClient.updateOrderPackageCodeById(otherPackageId, "60");
distributionStockArticleClient.submitHandleNumByOrderId(1, articleId); // distributionStockArticleClient.submitHandleNumByOrderId(1, articleId);
//
carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName()); // carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone()); // carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone());
carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress()); // carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress());
//
carsLoadScanEntity.setFirsts(otherParcelListEntity.getFirsts()); // carsLoadScanEntity.setFirsts(otherParcelListEntity.getFirsts());
carsLoadScanEntity.setSenconds(otherParcelListEntity.getSecond()); // carsLoadScanEntity.setSenconds(otherParcelListEntity.getSecond());
carsLoadScanEntity.setThirds(otherParcelListEntity.getThirdProduct()); // carsLoadScanEntity.setThirds(otherParcelListEntity.getThirdProduct());
carsLoadScanEntity.setMaterialCode(otherParcelListEntity.getMaterialCode()); // carsLoadScanEntity.setMaterialCode(otherParcelListEntity.getMaterialCode());
carsLoadScanEntity.setMaterialName(otherParcelListEntity.getMaterialName()); // carsLoadScanEntity.setMaterialName(otherParcelListEntity.getMaterialName());
//
remark = "有数据,不在当前仓,异常装车"; // remark = "有数据,不在当前仓,异常装车";
audio = "包件未入库"; // audio = "包件未入库";
if(StringUtils.isNotBlank(orderPackageCode)){ // if(StringUtils.isNotBlank(orderPackageCode)){
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线装车下架解托"); // updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线装车下架解托");
} // }
} }
@ -3729,7 +3735,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId); DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(stockArticleEntity)) { if (Objects.isNull(stockArticleEntity)) {
log.warn("##################loadingScan: 订单信息不存在 orderCode={} warehouseId={}", orderCode, warehouseId); log.warn("##################loadingScan: 订单信息不存在 orderCode={} warehouseId={}", orderCode, warehouseId);
return R.fail(405, "订单暂未开单"); return R.fail(405, "订单信息不存在");
} }
Long articleId = stockArticleEntity.getId(); Long articleId = stockArticleEntity.getId();
@ -3740,16 +3746,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.eq("waybill_no", parcelListEntity.getWaybillNumber()); .eq("waybill_no", parcelListEntity.getWaybillNumber());
TrunklineCarsOrderEntity carsOrderEntity = trunklineCarsOrderService.getOne(queryWrapper); TrunklineCarsOrderEntity carsOrderEntity = trunklineCarsOrderService.getOne(queryWrapper);
if (Objects.isNull(carsOrderEntity)) { if (Objects.isNull(carsOrderEntity)) {
return Resp.scanFail(405,"无计划包件","无计划包件,不能装车");
//该计划中不存在对应的数据,所以是异常包件 //该计划中不存在对应的数据,所以是异常包件
carsLoadScanEntity.setLoadingAbnormal(1); // carsLoadScanEntity.setLoadingAbnormal(1);
isAbnormal = 1; // isAbnormal = 1;
remark = "有数据,在本仓,不在配载计划中,异常装车"; // remark = "有数据,在本仓,不在配载计划中,异常装车";
audio = "无计划装车"; // audio = "无计划装车";
String loadType = carsLoadEntity.getLoadType(); // String loadType = carsLoadEntity.getLoadType();
if("4".equals(loadType)){ // if("4".equals(loadType)){
carsLoadScanEntity.setFinalNodeId(warehouseId); // carsLoadScanEntity.setFinalNodeId(warehouseId);
carsLoadScanEntity.setFinalNodeName(warehouseName); // carsLoadScanEntity.setFinalNodeName(warehouseName);
} // }
} else { } else {
//有计划 //有计划
Integer planNum = carsOrderEntity.getPlanNum(); Integer planNum = carsOrderEntity.getPlanNum();
@ -3759,6 +3766,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
isAbnormal = 1; isAbnormal = 1;
remark = "有数据,在本仓,在配载计划中,大于计划数量,异常装车"; remark = "有数据,在本仓,在配载计划中,大于计划数量,异常装车";
audio = "大于计划数量装车"; audio = "大于计划数量装车";
return Resp.scanFail(405,"大于计划数量","大于计划数量,不能装车");
} else { } else {
carsLoadScanEntity.setLoadingAbnormal(0); carsLoadScanEntity.setLoadingAbnormal(0);
isAbnormal = 0; isAbnormal = 0;
@ -4684,21 +4692,35 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if(!Objects.isNull(trunklineWaybillOrder)){ if(!Objects.isNull(trunklineWaybillOrder)){
carsLoadOrderInfoVO.setOrderNum(trunklineWaybillOrder.getTotalNumber()); carsLoadOrderInfoVO.setOrderNum(trunklineWaybillOrder.getTotalNumber());
}else{ }else{
carsLoadOrderInfoVO.setOrderNum(0); Integer totalNumber = advanceService.findTotalNumByWaybillNoAndOrderCode(waybillNo,orderCode);
if(Objects.isNull(totalNumber)){
carsLoadOrderInfoVO.setOrderNum(0);
}else{
carsLoadOrderInfoVO.setOrderNum(totalNumber);
}
} }
carsLoadOrderInfoVO.setLoadingNum(loadingNum); carsLoadOrderInfoVO.setLoadingNum(loadingNum);
carsLoadOrderInfoVO.setUnloadNum(unloadNum); carsLoadOrderInfoVO.setUnloadNum(unloadNum);
carsLoadOrderInfoVO.setSignNum(signNum); carsLoadOrderInfoVO.setSignNum(signNum);
carsLoadOrderInfoVO.setOrderFreight(freightPrice.multiply(new BigDecimal(loadingNum)).setScale(2, RoundingMode.HALF_UP));
carsLoadOrderInfoVOMap.put(orderCode, carsLoadOrderInfoVO); }else{
carsLoadOrderInfoVO.setLoadingNum(loadingNum);
carsLoadOrderInfoVO.setUnloadNum(unloadNum);
carsLoadOrderInfoVO.setSignNum(signNum);
} }
carsLoadOrderInfoVOMap.put(orderCode, carsLoadOrderInfoVO);
//把trunklineCarsLoadScanListByOrderCode通过type分组 //把trunklineCarsLoadScanListByOrderCode通过type分组
Map<Integer, List<TrunklineCarsLoadScanVO>> trunklineCarsLoadScanMapByType = trunklineCarsLoadScanListByOrderCode.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanVO::getType)); Map<Integer, List<TrunklineCarsLoadScanVO>> trunklineCarsLoadScanMapByType = trunklineCarsLoadScanListByOrderCode.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanVO::getType));
AtomicReference<BigDecimal> totalIncomingParice = new AtomicReference<>(BigDecimal.ZERO); AtomicReference<BigDecimal> totalIncomingParice = new AtomicReference<>(BigDecimal.ZERO);
AtomicReference<BigDecimal> totalVolume = new AtomicReference<>(BigDecimal.ZERO); AtomicReference<BigDecimal> totalVolume = new AtomicReference<>(BigDecimal.ZERO);
AtomicReference<BigDecimal> totalWeight = new AtomicReference<>(BigDecimal.ZERO); AtomicReference<BigDecimal> totalWeight = new AtomicReference<>(BigDecimal.ZERO);
Map<String,Integer> goodsByNum = new HashMap<>();
Map<String,BigDecimal> goodsByVolume = new HashMap<>();
Map<String,BigDecimal> goodsByWeight = new HashMap<>();
trunklineCarsLoadScanMapByType.keySet().forEach(type -> { trunklineCarsLoadScanMapByType.keySet().forEach(type -> {
List<TrunklineCarsLoadScanVO> trunklineCarsLoadScanVOS = trunklineCarsLoadScanMapByType.get(type); List<TrunklineCarsLoadScanVO> trunklineCarsLoadScanVOS = trunklineCarsLoadScanMapByType.get(type);
@ -4726,6 +4748,25 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
totalIncomingParice.set(totalIncomingParice.get().add(new BigDecimal(price).multiply(new BigDecimal(unloadNum1)))); totalIncomingParice.set(totalIncomingParice.get().add(new BigDecimal(price).multiply(new BigDecimal(unloadNum1))));
totalVolume.set(totalVolume.get().add(new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1)))); totalVolume.set(totalVolume.get().add(new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1))));
totalWeight.set(totalWeight.get().add(new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1)))); totalWeight.set(totalWeight.get().add(new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1))));
Integer n = goodsByNum.get(gn);
if(Objects.isNull(n)){
goodsByNum.put(gn,num);
}else{
goodsByNum.put(gn,n+num);
}
BigDecimal v = goodsByVolume.get(gn);
if(Objects.isNull(v)){
goodsByVolume.put(gn,new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1)));
}else{
goodsByVolume.put(gn,v.add(new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1))));
}
BigDecimal w = goodsByWeight.get(gn);
if(Objects.isNull(w)){
goodsByWeight.put(gn,new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1)));
}else{
goodsByWeight.put(gn,w.add(new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1))));
}
}); });
@ -4753,14 +4794,49 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
totalIncomingParice.set(totalIncomingParice.get().add(new BigDecimal(price).multiply(new BigDecimal(unloadNum1)))); totalIncomingParice.set(totalIncomingParice.get().add(new BigDecimal(price).multiply(new BigDecimal(unloadNum1))));
totalVolume.set(totalVolume.get().add(new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1)))); totalVolume.set(totalVolume.get().add(new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1))));
totalWeight.set(totalWeight.get().add(new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1)))); totalWeight.set(totalWeight.get().add(new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1))));
Integer n = goodsByNum.get(scanCode);
if(Objects.isNull(n)){
goodsByNum.put(scanCode,num);
}else{
goodsByNum.put(scanCode,n+num);
}
BigDecimal v = goodsByVolume.get(scanCode);
if(Objects.isNull(v)){
goodsByVolume.put(scanCode,new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1)));
}else{
goodsByVolume.put(scanCode,v.add(new BigDecimal(oneVolume).multiply(new BigDecimal(unloadNum1))));
}
BigDecimal w = goodsByWeight.get(scanCode);
if(Objects.isNull(w)){
goodsByWeight.put(scanCode,new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1)));
}else{
goodsByWeight.put(scanCode,w.add(new BigDecimal(oneWeight).multiply(new BigDecimal(unloadNum1))));
}
}); });
} }
}); });
List<String> orderGoodsNameList = new ArrayList<>();
List<String> orderGoodsNumList = new ArrayList<>();
List<String> orderGoodsVolumeList = new ArrayList<>();
List<String> orderGoodsWeightList = new ArrayList<>();
goodsByNum.keySet().forEach(g -> {
orderGoodsNameList.add(g);
orderGoodsNumList.add(goodsByNum.get(g)+"");
orderGoodsVolumeList.add(goodsByVolume.get(g).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
orderGoodsWeightList.add(goodsByWeight.get(g).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
});
carsLoadOrderInfoVO.setUnloadIncome(totalIncomingParice.get()); carsLoadOrderInfoVO.setUnloadIncome(totalIncomingParice.get());
carsLoadOrderInfoVO.setWeight(totalWeight.get()); carsLoadOrderInfoVO.setWeight(totalWeight.get());
carsLoadOrderInfoVO.setVolume(totalVolume.get()); carsLoadOrderInfoVO.setVolume(totalVolume.get());
carsLoadOrderInfoVO.setOrderGoodsNum(String.join(",", orderGoodsNumList));
carsLoadOrderInfoVO.setOrderGoodsName(String.join(",", orderGoodsNameList));
carsLoadOrderInfoVO.setOrderGoodsVolume(String.join(",", orderGoodsVolumeList));
carsLoadOrderInfoVO.setOrderGoodsWeight(String.join(",", orderGoodsWeightList));
resulOrderList.add(carsLoadOrderInfoVO); resulOrderList.add(carsLoadOrderInfoVO);
}); });
} }
@ -8982,6 +9058,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(map); return R.data(map);
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public R loadingTray(LoadCarsDTO loadCarsDTO) { public R loadingTray(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId(); Long loadId = loadCarsDTO.getLoadId();
@ -9019,7 +9096,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer zeroNum = 0; Integer zeroNum = 0;
for (LoadingPackageDTO loadingPackageDTO : packageList) { for (LoadingPackageDTO loadingPackageDTO : packageList) {
String orderPackageCode = loadingPackageDTO.getOrderPackageCode(); String orderPackageCode = loadingPackageDTO.getOrderPackageCode();
loadingScan(loadId, warehouseId, orderPackageCode, trayCode, "托盘正常装车"); R r = loadingScan(loadId, warehouseId, orderPackageCode, trayCode, "托盘正常装车");
if(r.getCode() != 200){
throw new CustomerException(r.getCode(),r.getMsg());
}
pacakagNum = pacakagNum + 1; pacakagNum = pacakagNum + 1;
} }
@ -12030,5 +12110,3 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} }

24
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -226,6 +226,7 @@
from logpm_warehouse_waybill lww from logpm_warehouse_waybill lww
left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id
left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0 left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0
left join logpm_trunkline_waybill_track ltwt on ltwt.waybill_id = lww.id
where lww.is_deleted = 0 where lww.is_deleted = 0
and lww.abolish_status = 0 and lww.abolish_status = 0
<if test="param.waybillNoList != null"> <if test="param.waybillNoList != null">
@ -234,18 +235,6 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and (
lww.departure_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
or lww.destination_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
<if test="param.waybillNo != null and param.waybillNo != ''"> <if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},lww.waybill_no) > 0 and Locate(#{param.waybillNo},lww.waybill_no) > 0
</if> </if>
@ -373,6 +362,17 @@
</foreach> </foreach>
</if> </if>
group by lww.id group by lww.id
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
HAVING
<foreach collection="param.warehouseIds" item="item" index="index" open="(" close=")">
<if test="index == 0">
GROUP_CONCAT(DISTINCT ltwt.warehouse_id) like CONCAT('%',#{item},'%')
</if>
<if test="index != 0">
or GROUP_CONCAT(DISTINCT ltwt.warehouse_id) like CONCAT('%',#{item},'%')
</if>
</foreach>
</if>
order by lww.create_time desc order by lww.create_time desc
</select> </select>

Loading…
Cancel
Save