Browse Source

1.干线bug修复

dist.1.2.0^2
zhenghaoyu 5 months ago
parent
commit
44fa3b1139
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  2. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  3. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  4. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  5. 32
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  6. 70
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -211,4 +211,6 @@ public interface IDistributionStockArticleClient {
@GetMapping(API_PREFIX + "/findSignNumByWaybillNo")
Integer findSignNumByWaybillNo(@RequestParam String waybillNo, @RequestParam Long destinationWarehouseId);
@GetMapping(API_PREFIX + "/addSignNum")
void addSignNum(@RequestParam Long orderId, @RequestParam Integer unloadNum);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -414,4 +414,14 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
return distributionStockArticleService.findSignNumByWaybillNo(waybillNo,destinationWarehouseId);
}
@Override
public void addSignNum(Long orderId, Integer unloadNum) {
DistributionStockArticleEntity stockArticle = distributionStockArticleService.getById(orderId);
Integer signinQuantity = stockArticle.getSigninQuantity();
DistributionStockArticleEntity updateEntity = new DistributionStockArticleEntity();
updateEntity.setId(orderId);
updateEntity.setSigninQuantity(signinQuantity+unloadNum);
distributionStockArticleService.updateById(updateEntity);
}
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -404,6 +404,8 @@
ltcl.cars_no carsNo,
ltcl.carrier_name carrierName,
ltcl.carrier_time carrierTime,
ltcl.driver_name driverName,
ltcl.driver_mobile driverMobile,
ltcl.pay_method payMethod,
ltcl.count_transport_cost countTransportCost,
ltcl.replace_price replacePrice,

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

@ -451,7 +451,7 @@
lww.consignee_mobile consigneeMobile,
IFNULL(ltco.plan_num,0) AS planNum,
sum(case when ltcls.scan_status != 1 then ltcls.num else 0 end) unloadNum,
sum( ltcls.num ) AS smallTota
IFNULL(sum( ltcls.num ),0) AS smallTotal
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_order ltco on ltco.order_code = ltcls.order_code and ltco.waybill_no = ltcls.waybill_no and ltco.load_id = ltcls.load_id and ltco.node_id = ltcls.warehouse_id
left join logpm_distribution_stock_article ldsa on ldsa.order_code = ltcls.order_code and ldsa.warehouse_id = ltcls.from_warehouse_id

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

@ -2958,10 +2958,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanService.save(carsLoadScanEntity);
loadScanId = carsLoadScanEntity.getId();
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseName + " " + (StringUtil.isBlank(trayName) ? "扫码" : "托盘(" + trayName + ")") + " 装车, 车次号:"+loadCode+" ,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName;
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode(), content);
String loadType = carsLoadEntity.getLoadType();
if(!"4".equals(loadType)){
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
String content = "包件在 " + warehouseName + " " + (StringUtil.isBlank(trayName) ? "扫码" : "托盘(" + trayName + ")") + " 装车, 车次号:"+loadCode+" ,配载计划目的仓 " + carsLoadScanEntity.getFinalNodeName() + ",数据来源仓库 " + fromWarehouseName;
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.INITIAL_WAREHOUSE_LOADING.getCode(), content);
}
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, orderPackageCode, 1,
1, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
@ -4329,10 +4332,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long waybillId = carsLoadScanEntity.getWaybillId();
String scanCode = carsLoadScanEntity.getScanCode();
Long loadScanId = carsLoadScanEntity.getId();
if (!Objects.equals(enterNum, num)) {
log.warn("#############transferUnloadZero: 零担信息卸车数量不正确 enterNun={} num={}", enterNum, num);
return R.fail(405, "零担信息卸车数量不正确");
}
// if (!Objects.equals(enterNum, num)) {
// log.warn("#############transferUnloadZero: 零担信息卸车数量不正确 enterNun={} num={}", enterNum, num);
// return R.fail(405, "零担信息卸车数量不正确");
// }
carsLoadScanEntity.setUnloadNum(enterNum);
carsLoadScanEntity.setUnloadNodeId(warehouseId);
@ -5680,11 +5683,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//重新计算签收单的数量
updateSignOrderNumBySignOrderId(signOrderId);
Long waybillId = carsLoadScanEntity.getWaybillId();
if(!Objects.isNull(waybillId)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
waybillPackageService.updateWaybillStatus(waybillEntity);
}
// Long waybillId = carsLoadScanEntity.getWaybillId();
// if(!Objects.isNull(waybillId)){
// WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
// waybillPackageService.updateWaybillStatus(waybillEntity);
// }
// return Resp.scanSuccess("签收成功",enterNum+"件");
return R.success("签收成功");
@ -6523,11 +6526,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer unloadNum = carsLoadScanEntity.getUnloadNum();
String orderCode = carsLoadScanEntity.getOrderCode();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
DistributionStockArticleEntity stockArticle = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(unloadNum != num){
int diff = num - unloadNum;
DistributionStockArticleEntity stockArticle = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
distributionStockArticleClient.addHandQuantity(stockArticle.getId(), diff);
}
distributionStockArticleClient.addSignNum(stockArticle.getId(),unloadNum);
});
trunklineLoadSignOrderService.updateById(signOrderEntity);

70
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillTrackServiceImpl.java

@ -3,7 +3,6 @@ package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.OpenOrderDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.entity.TrunklineWaybillTrackEntity;
import com.logpm.trunkline.mapper.TrunklineWaybillTrackMapper;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
@ -22,7 +21,6 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@ -116,39 +114,41 @@ public class TrunklineWaybillTrackServiceImpl extends BaseServiceImpl<TrunklineW
//存入签收日志
String operationRemark = warehouseName+" "+typeStr+num+"件,车次号:"+trainNumber+",司机:"+driverName+",车牌号:"+carNumber+",签收人"+ signUser+",签收单:"+signOrderCode+",签收时间"+ CommonUtil.dateToStringGeneral(signTime);
openOrderAsyncService.saveLog(waybillId,waybillNo,"100",warehouseName+" "+typeStr,operationRemark,nickName,userId,warehouseId,warehouseName);
if(type != 2){
//需要更新运单的状态
TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo, waybillNo);
if(!Objects.isNull(waybillOrderEntity)){
int waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
Integer totalCount = warehouseWaybillEntity.getTotalCount();
Integer handleNumber = waybillOrderEntity.getHandleNumber();
int i = handleNumber + num;
if(waybillStatusInt < 90){
if(num == totalCount){
warehouseWaybillEntity.setWaybillStatus("100");
waybillOrderEntity.setHandleNumber(num);
}else{
warehouseWaybillEntity.setWaybillStatus("90");
waybillOrderEntity.setHandleNumber(num);
}
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
waybillOrderService.updateById(waybillOrderEntity);
}else if(waybillStatusInt == 90){
if(i == totalCount){
warehouseWaybillEntity.setWaybillStatus("100");
waybillOrderEntity.setHandleNumber(i);
}else{
waybillOrderEntity.setHandleNumber(i);
}
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
waybillOrderService.updateById(waybillOrderEntity);
}
}
}else{
trunklineWaybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
}
trunklineWaybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
// if(type != 2){
//
// //需要更新运单的状态
// TrunklineWaybillOrderEntity waybillOrderEntity = waybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo, waybillNo);
// if(!Objects.isNull(waybillOrderEntity)){
// int waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
// Integer totalCount = warehouseWaybillEntity.getTotalCount();
// Integer handleNumber = waybillOrderEntity.getHandleNumber();
// int i = handleNumber + num;
// if(waybillStatusInt < 90){
// if(num == totalCount){
// warehouseWaybillEntity.setWaybillStatus("100");
// waybillOrderEntity.setHandleNumber(num);
// }else{
// warehouseWaybillEntity.setWaybillStatus("90");
// waybillOrderEntity.setHandleNumber(num);
// }
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// waybillOrderService.updateById(waybillOrderEntity);
// }else if(waybillStatusInt == 90){
// if(i == totalCount){
// warehouseWaybillEntity.setWaybillStatus("100");
// waybillOrderEntity.setHandleNumber(i);
// }else{
// waybillOrderEntity.setHandleNumber(i);
// }
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// waybillOrderService.updateById(waybillOrderEntity);
// }
// }
// }else{
// trunklineWaybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
// }
}
private void addPackageWaybillTrackLog(WaybillLogDTO waybillLogDTO,Long waybillId) {

Loading…
Cancel
Save