Browse Source

1.bug修复

visual
zhenghaoyu 4 months ago
parent
commit
e1c367805c
  1. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java
  2. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  3. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  4. 84
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  5. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

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

@ -9,6 +9,7 @@ import java.math.BigDecimal;
public class CarsLoadOrderInfoVO implements Serializable {
private String orderCode;
private String waybillNo;
private Integer orderNum;
private Integer planNum;
private Integer loadingNum;

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -845,8 +845,9 @@
IFNULL(sum(ltcls.num),0) loadingNum,
IFNULL(sum(ltcls.unload_num),0) unloadNum
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_order ltco on ltco.waybill_id = ltcls.waybill_id and ltco.order_code = ltcls.order_code
left join logpm_trunkline_cars_order ltco on ltco.waybill_no = ltcls.waybill_no and ltco.order_code = ltcls.order_code
where ltcls.load_id = #{loadId}
and ltco.id is null
GROUP BY IFNULL(ltcls.waybill_no,'--'),
ltcls.order_code
order by IFNULL(ltcls.waybill_no,'--') desc, ltcls.order_code desc

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml

@ -173,10 +173,11 @@
<select id="findCarsLoadOrderInfoListPlan" resultType="com.logpm.trunkline.vo.CarsLoadOrderInfoVO">
select ltco.order_code orderCode,
ltco.waybill_no waybillNo,
ltco.plan_num planNum,
ltco.real_num loadingNum,
IFNULL(sum(ltcls.num),0) loadingNum,
lww.check_user_name checkUserName,
IFNULL(ltco.unload_num,0) unloadNum,
IFNULL(sum(ltcls.unload_num),0) unloadNum,
IFNULL(lww.total_freight/lww.total_count*ltwo.total_number,0) orderFreight,
IFNULL(lww.total_freight/lww.total_count*ltco.unload_num,0) unloadIncome,
IFNULL(lww.total_freight/lww.total_count*ltco.plan_num,0) orderLineCost,

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

@ -1637,19 +1637,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<TrunklineCarsOrderEntity> carsOrderList = trunklineCarsOrderService.findListByLoadId(loadId);
List<TrunklineCarsOrderEntity> updateOrderList = new ArrayList<>();
carsOrderList.forEach(carsOrderEntity -> {
Long carsOrderId = carsOrderEntity.getId();
Long nodeId = carsOrderEntity.getNodeId();
String orderCode = carsOrderEntity.getOrderCode();
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 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 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();
TrunklineCarsOrderEntity updateCarsOrderEntity = new TrunklineCarsOrderEntity();
updateCarsOrderEntity.setId(carsOrderId);
updateCarsOrderEntity.setRealNum(carsOrderRealLoadingNum);
updateCarsOrderEntity.setUnloadNum(carsOrderRealUnloadingNum);
updateCarsOrderEntity.setSignNum(carsOrderRealSignNum);
updateOrderList.add(updateCarsOrderEntity);
carsOrderEntity.setRealNum(carsOrderRealLoadingNum);
carsOrderEntity.setUnloadNum(carsOrderRealUnloadingNum);
carsOrderEntity.setSignNum(carsOrderRealSignNum);
updateOrderList.add(carsOrderEntity);
});
if(CollUtil.isNotEmpty(updateOrderList)){
@ -4529,69 +4526,41 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadVO.setCarsLoadLineList(loadLineList);
List<CarsLoadWaybillInfoVO> carsLoadWaybillInfoList = trunklineCarsOrderService.findWaybillOrderByloadId(loadId);
// 得到集合中的运单号集合
// List<String> waybillNoList = carsLoadWaybillInfoList.stream().map(CarsLoadWaybillInfoVO::getWaybillNo).collect(Collectors.toList());
// 查询运单号的总量、体积
// List<WaybillOrderTotalWeightAndVolumeVO> waybillOrderTotalList = warehouseWaybillDetailClient.findWaybillOrderTotalWeightAndVolumeByWaybillNoList(waybillNoList);
for (CarsLoadWaybillInfoVO carsLoadWaybillInfoVO : carsLoadWaybillInfoList) {
// 获取运单对应的总体积和总重量
// WaybillOrderTotalWeightAndVolumeVO waybillOrderTotalWeightAndVolumeVO = getWaybillOrderTotalWeighAndVolume(carsLoadWaybillInfoVO, waybillOrderTotalList);
String waybillNo = carsLoadWaybillInfoVO.getWaybillNo();
// 查询 明细上的总量和体积
List<WarehouseWayBillDetail> wayBillDetails = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
String openPrice = null;
String productNames = null;
BigDecimal oneWeight = BigDecimal.ZERO;
BigDecimal oneVolume = BigDecimal.ZERO;
if(!StringUtil.isBlank(waybillNo)){
List<WarehouseWayBillDetail> wayBillDetails = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
for (WarehouseWayBillDetail wayBillDetail : wayBillDetails) {
String productName = wayBillDetail.getProductName();
Integer num = wayBillDetail.getNum();
BigDecimal volume = wayBillDetail.getVolume();
BigDecimal weight = wayBillDetail.getWeight();
BigDecimal price = wayBillDetail.getPrice();
if (StringUtil.isBlank(openPrice)) {
openPrice = price.toPlainString();
} else {
openPrice = openPrice + "," + price.toPlainString();
}
if (StringUtil.isBlank(productNames)) {
productNames = productName + "(" + num + ")";
} else {
productNames = productNames + "," + productName + "(" + num + ")";
}
for (WarehouseWayBillDetail wayBillDetail : wayBillDetails) {
String productName = wayBillDetail.getProductName();
Integer num = wayBillDetail.getNum();
BigDecimal price = wayBillDetail.getPrice();
if (StringUtil.isBlank(openPrice)) {
openPrice = price.toPlainString();
} else {
openPrice = openPrice + "," + price.toPlainString();
}
if (StringUtil.isBlank(productNames)) {
productNames = productName + "(" + num + ")";
} else {
productNames = productNames + "," + productName + "(" + num + ")";
}
List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP));
carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP));
});
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan);
}
carsLoadWaybillInfoVO.setOpenPrice(openPrice);
carsLoadWaybillInfoVO.setGoodsName(productNames);
// List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo);
if(!StringUtil.isBlank(waybillNo)){
}
List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP));
carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP));
});
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan);
// carsLoadWaybillInfoVO.setCarsLoadOrderInfoListPlan(carsLoadOrderInfoListPlan);
TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId, waybillNo);
@ -4600,6 +4569,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadWaybillInfoVO.setCostNum(costShareRecordEntity.getNum());
}
//查询异常的数据
List<CarsLoadScanAbnormalVO> carsLoadScanAbnormalList = trunklineCarsLoadScanService.findAbnormalData(loadId);
if(!carsLoadScanAbnormalList.isEmpty()){

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

@ -184,7 +184,8 @@
lww.cancle_check_time cancleCheckTime,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
lww.document_making_time openTime,
lww.document_making_time documentMakingTime,
lww.create_time createTime,
GROUP_CONCAT(lwwd.product_name) goodsName,
lww.total_count totalCount,
sum(lwwd.weight) totalWeight,
@ -955,7 +956,8 @@
lww.cancle_check_time cancleCheckTime,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
lww.document_making_time openTime,
lww.document_making_time documentMakingTime,
lww.create_time createTime,
GROUP_CONCAT(lwwd.product_name) goodsName,
lww.total_count totalCount,
sum(lwwd.weight) totalWeight,

Loading…
Cancel
Save