Browse Source

1.干线-bug修复

chenglong
zhenghaoyu 1 year ago
parent
commit
7c4c37e551
  1. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  2. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java
  3. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  4. 151
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -61,6 +61,7 @@ public class LoadCarsDTO implements Serializable {
private List<LoadingZeroDTO> zeroList = new ArrayList<>(); private List<LoadingZeroDTO> zeroList = new ArrayList<>();
private Long carsLoadScanId; private Long carsLoadScanId;
private String carsLoadScanIds;
private String arriveDateStr; private String arriveDateStr;

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java

@ -250,7 +250,7 @@ public class CarsLoadApiController {
public R removeCarsLoadScan(@RequestBody LoadCarsDTO loadCarsDTO) { public R removeCarsLoadScan(@RequestBody LoadCarsDTO loadCarsDTO) {
String method = "############removeCarsLoadScan: "; String method = "############removeCarsLoadScan: ";
log.info(method + "请求参数{}", loadCarsDTO); log.info(method + "请求参数{}", loadCarsDTO);
Long carsLoadScanId = loadCarsDTO.getCarsLoadScanId(); String carsLoadScanIds = loadCarsDTO.getCarsLoadScanIds();
try{ try{
//当前登录人选择的仓库 //当前登录人选择的仓库
@ -261,12 +261,12 @@ public class CarsLoadApiController {
} }
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId()); loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(carsLoadScanId)){ if(StringUtil.isBlank(carsLoadScanIds)){
log.warn(method+"配载装车扫描id为空 carsLoadScanId={}",carsLoadScanId); log.warn(method+"配载装车扫描id为空 carsLoadScanIds={}",carsLoadScanIds);
return R.fail(405,"配载装车扫描id为空"); return R.fail(405,"配载装车扫描id为空");
} }
return carsLoadService.removeCarsLoadScan(carsLoadScanId,myCurrentWarehouse.getId()); return carsLoadService.removeCarsLoadScan(carsLoadScanIds,myCurrentWarehouse.getId());
}catch (CustomerException e){ }catch (CustomerException e){
log.error(e.message,e); log.error(e.message,e);
return R.fail(e.code,e.message); return R.fail(e.code,e.message);

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

@ -86,7 +86,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findCarsLoadingDetail(Long loadId, Long warehouseId); R findCarsLoadingDetail(Long loadId, Long warehouseId);
R removeCarsLoadScan(Long carsLoadScanId, Long warehouseId); R removeCarsLoadScan(String carsLoadScanIds, Long warehouseId);
R arriveUnloadPageList(LoadCarsDTO loadCarsDTO); R arriveUnloadPageList(LoadCarsDTO loadCarsDTO);

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

@ -3494,90 +3494,99 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} }
@Override @Override
public R removeCarsLoadScan(Long carsLoadScanId, Long warehouseId) { public R removeCarsLoadScan(String carsLoadScanIds, Long warehouseId) {
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(carsLoadScanId);
if(Objects.isNull(carsLoadScanEntity)){
log.warn("##################removeCarsLoadScan: 配载装车扫描不存在 carsLoadScanId={}",carsLoadScanId);
return R.fail(405,"配载装车扫描不存在");
}
Long loadId = carsLoadScanEntity.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); String[] split = carsLoadScanIds.split(",");
if(Objects.isNull(carsLoadEntity)){
log.warn("##################removeCarsLoadScan: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId(); for (String str : split) {
long carsLoadScanId = Long.parseLong(str);
if(!nowWarehouseId.equals(warehouseId)){ TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(carsLoadScanId);
log.warn("##################removeCarsLoadScan: 暂未有权限进行操作 nowWarehouseId={} warehouseId={}",nowWarehouseId,warehouseId); if(Objects.isNull(carsLoadScanEntity)){
return R.fail(405,"暂未有权限进行操作"); log.warn("##################removeCarsLoadScan: 配载装车扫描不存在 carsLoadScanId={}",carsLoadScanId);
} return R.fail(405,"配载装车扫描不存在");
String loadStatus = carsLoadEntity.getLoadStatus(); }
if(!"0".equals(loadStatus) && !"20".equals(loadStatus)){ Long loadId = carsLoadScanEntity.getLoadId();
log.warn("##################removeCarsLoadScan: 当前配载计划不属于到车状态 loadStatus={} warehouseId={}",loadStatus,warehouseId);
return R.fail(405,"当前配载计划不属于到车状态");
}
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadLineEntity)){ if(Objects.isNull(carsLoadEntity)){
log.warn("##################removeCarsLoadScan: 当前节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId); log.warn("##################removeCarsLoadScan: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"当前节点信息不存在"); return R.fail(405,"配载计划不存在");
} }
String nodeStatus = carsLoadLineEntity.getNodeStatus(); Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();
if(!"10".equals(nodeStatus)){
log.warn("##################removeCarsLoadScan: 当前节点不是到车状态 nodeStatus={} warehouseId={}",nodeStatus,warehouseId);
return R.fail(405,"当前节点不是到车状态");
}
//删除 if(!nowWarehouseId.equals(warehouseId)){
boolean b = trunklineCarsLoadScanService.deleteEntityByCarsLoadScanId(carsLoadScanId); log.warn("##################removeCarsLoadScan: 暂未有权限进行操作 nowWarehouseId={} warehouseId={}",nowWarehouseId,warehouseId);
if(b){ return R.fail(405,"暂未有权限进行操作");
updateNumByLoadId(loadId); }
Integer isAbnormal = carsLoadScanEntity.getLoadingAbnormal(); String loadStatus = carsLoadEntity.getLoadStatus();
Integer isData = carsLoadScanEntity.getIsData(); if(!"0".equals(loadStatus) && !"20".equals(loadStatus)){
Integer num = carsLoadScanEntity.getNum(); log.warn("##################removeCarsLoadScan: 当前配载计划不属于到车状态 loadStatus={} warehouseId={}",loadStatus,warehouseId);
Long trayId = carsLoadScanEntity.getTrayId(); return R.fail(405,"当前配载计划不属于到车状态");
String trayCode = carsLoadScanEntity.getTrayCode(); }
String orderCode = carsLoadScanEntity.getOrderCode();
String waybillNo = carsLoadScanEntity.getWaybillNo();
String scanCode = carsLoadScanEntity.getScanCode();
Integer type = carsLoadScanEntity.getType();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId); TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if(Objects.isNull(stockArticleEntity)){ if(Objects.isNull(carsLoadLineEntity)){
log.warn("##################removeCarsLoadScan: 订单信息不存在 fromWarehouseId={} orderCode={}",fromWarehouseId,orderCode); log.warn("##################removeCarsLoadScan: 当前节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId);
return R.fail(405,"订单信息不存在"); return R.fail(405,"当前节点信息不存在");
} }
Long articleId = stockArticleEntity.getId();
distributionStockArticleClient.submitHandleNumByOrderId(-num,articleId); String nodeStatus = carsLoadLineEntity.getNodeStatus();
if(!"10".equals(nodeStatus)){
if(isData == 1){ log.warn("##################removeCarsLoadScan: 当前节点不是到车状态 nodeStatus={} warehouseId={}",nodeStatus,warehouseId);
if(type == 1){ return R.fail(405,"当前节点不是到车状态");
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, fromWarehouseId); }
if(Objects.isNull(parcelListEntity)){
log.warn("##################removeCarsLoadScan: 包件信息不存在 fromWarehouseId={} scanCode={}",fromWarehouseId,scanCode); //删除
return R.fail(405,"包件信息不存在"); boolean b = trunklineCarsLoadScanService.deleteEntityByCarsLoadScanId(carsLoadScanId);
} if(b){
Long wid = parcelListEntity.getWarehouseId(); updateNumByLoadId(loadId);
String waybillNumber = parcelListEntity.getWaybillNumber(); Integer isAbnormal = carsLoadScanEntity.getLoadingAbnormal();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber); Integer isData = carsLoadScanEntity.getIsData();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); Integer num = carsLoadScanEntity.getNum();
if(destinationWarehouseId.equals(wid)){ Long trayId = carsLoadScanEntity.getTrayId();
parcelListEntity.setOrderPackageStatus("10"); String trayCode = carsLoadScanEntity.getTrayCode();
String orderCode = carsLoadScanEntity.getOrderCode();
String waybillNo = carsLoadScanEntity.getWaybillNo();
String scanCode = carsLoadScanEntity.getScanCode();
Integer type = carsLoadScanEntity.getType();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(Objects.isNull(stockArticleEntity)){
log.warn("##################removeCarsLoadScan: 订单信息不存在 fromWarehouseId={} orderCode={}",fromWarehouseId,orderCode);
return R.fail(405,"订单信息不存在");
}
Long articleId = stockArticleEntity.getId();
distributionStockArticleClient.submitHandleNumByOrderId(-num,articleId);
if(isData == 1){
if(type == 1){
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(scanCode, fromWarehouseId);
if(Objects.isNull(parcelListEntity)){
log.warn("##################removeCarsLoadScan: 包件信息不存在 fromWarehouseId={} scanCode={}",fromWarehouseId,scanCode);
return R.fail(405,"包件信息不存在");
}
Long wid = parcelListEntity.getWarehouseId();
String waybillNumber = parcelListEntity.getWaybillNumber();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
if(destinationWarehouseId.equals(wid)){
parcelListEntity.setOrderPackageStatus("10");
}else{
parcelListEntity.setOrderPackageStatus("20");
}
distributionParcelListClient.update(parcelListEntity);
updownTypeClient.downPackageOrDelTray(scanCode,warehouseId);
}else{ }else{
parcelListEntity.setOrderPackageStatus("20"); trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId);
} }
distributionParcelListClient.update(parcelListEntity);
updownTypeClient.downPackageOrDelTray(scanCode,warehouseId);
}else{
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId);
} }
} }
} }
// updateNumByLoadId(loadId); // updateNumByLoadId(loadId);
return R.success("删除成功"); return R.success("删除成功");

Loading…
Cancel
Save