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 Long carsLoadScanId;
private String carsLoadScanIds;
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) {
String method = "############removeCarsLoadScan: ";
log.info(method + "请求参数{}", loadCarsDTO);
Long carsLoadScanId = loadCarsDTO.getCarsLoadScanId();
String carsLoadScanIds = loadCarsDTO.getCarsLoadScanIds();
try{
//当前登录人选择的仓库
@ -261,12 +261,12 @@ public class CarsLoadApiController {
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(carsLoadScanId)){
log.warn(method+"配载装车扫描id为空 carsLoadScanId={}",carsLoadScanId);
if(StringUtil.isBlank(carsLoadScanIds)){
log.warn(method+"配载装车扫描id为空 carsLoadScanIds={}",carsLoadScanIds);
return R.fail(405,"配载装车扫描id为空");
}
return carsLoadService.removeCarsLoadScan(carsLoadScanId,myCurrentWarehouse.getId());
return carsLoadService.removeCarsLoadScan(carsLoadScanIds,myCurrentWarehouse.getId());
}catch (CustomerException e){
log.error(e.message,e);
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 removeCarsLoadScan(Long carsLoadScanId, Long warehouseId);
R removeCarsLoadScan(String carsLoadScanIds, Long warehouseId);
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
public R removeCarsLoadScan(Long carsLoadScanId, Long warehouseId) {
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(carsLoadScanId);
if(Objects.isNull(carsLoadScanEntity)){
log.warn("##################removeCarsLoadScan: 配载装车扫描不存在 carsLoadScanId={}",carsLoadScanId);
return R.fail(405,"配载装车扫描不存在");
}
Long loadId = carsLoadScanEntity.getLoadId();
public R removeCarsLoadScan(String carsLoadScanIds, Long warehouseId) {
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("##################removeCarsLoadScan: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
String[] split = carsLoadScanIds.split(",");
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();
for (String str : split) {
long carsLoadScanId = Long.parseLong(str);
if(!nowWarehouseId.equals(warehouseId)){
log.warn("##################removeCarsLoadScan: 暂未有权限进行操作 nowWarehouseId={} warehouseId={}",nowWarehouseId,warehouseId);
return R.fail(405,"暂未有权限进行操作");
}
String loadStatus = carsLoadEntity.getLoadStatus();
if(!"0".equals(loadStatus) && !"20".equals(loadStatus)){
log.warn("##################removeCarsLoadScan: 当前配载计划不属于到车状态 loadStatus={} warehouseId={}",loadStatus,warehouseId);
return R.fail(405,"当前配载计划不属于到车状态");
}
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.getById(carsLoadScanId);
if(Objects.isNull(carsLoadScanEntity)){
log.warn("##################removeCarsLoadScan: 配载装车扫描不存在 carsLoadScanId={}",carsLoadScanId);
return R.fail(405,"配载装车扫描不存在");
}
Long loadId = carsLoadScanEntity.getLoadId();
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if(Objects.isNull(carsLoadLineEntity)){
log.warn("##################removeCarsLoadScan: 当前节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId);
return R.fail(405,"当前节点信息不存在");
}
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("##################removeCarsLoadScan: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
String nodeStatus = carsLoadLineEntity.getNodeStatus();
if(!"10".equals(nodeStatus)){
log.warn("##################removeCarsLoadScan: 当前节点不是到车状态 nodeStatus={} warehouseId={}",nodeStatus,warehouseId);
return R.fail(405,"当前节点不是到车状态");
}
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();
//删除
boolean b = trunklineCarsLoadScanService.deleteEntityByCarsLoadScanId(carsLoadScanId);
if(b){
updateNumByLoadId(loadId);
Integer isAbnormal = carsLoadScanEntity.getLoadingAbnormal();
Integer isData = carsLoadScanEntity.getIsData();
Integer num = carsLoadScanEntity.getNum();
Long trayId = carsLoadScanEntity.getTrayId();
String trayCode = carsLoadScanEntity.getTrayCode();
String orderCode = carsLoadScanEntity.getOrderCode();
String waybillNo = carsLoadScanEntity.getWaybillNo();
String scanCode = carsLoadScanEntity.getScanCode();
Integer type = carsLoadScanEntity.getType();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
if(!nowWarehouseId.equals(warehouseId)){
log.warn("##################removeCarsLoadScan: 暂未有权限进行操作 nowWarehouseId={} warehouseId={}",nowWarehouseId,warehouseId);
return R.fail(405,"暂未有权限进行操作");
}
String loadStatus = carsLoadEntity.getLoadStatus();
if(!"0".equals(loadStatus) && !"20".equals(loadStatus)){
log.warn("##################removeCarsLoadScan: 当前配载计划不属于到车状态 loadStatus={} warehouseId={}",loadStatus,warehouseId);
return R.fail(405,"当前配载计划不属于到车状态");
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(Objects.isNull(stockArticleEntity)){
log.warn("##################removeCarsLoadScan: 订单信息不存在 fromWarehouseId={} orderCode={}",fromWarehouseId,orderCode);
return R.fail(405,"订单信息不存在");
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
if(Objects.isNull(carsLoadLineEntity)){
log.warn("##################removeCarsLoadScan: 当前节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId);
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");
String nodeStatus = carsLoadLineEntity.getNodeStatus();
if(!"10".equals(nodeStatus)){
log.warn("##################removeCarsLoadScan: 当前节点不是到车状态 nodeStatus={} warehouseId={}",nodeStatus,warehouseId);
return R.fail(405,"当前节点不是到车状态");
}
//删除
boolean b = trunklineCarsLoadScanService.deleteEntityByCarsLoadScanId(carsLoadScanId);
if(b){
updateNumByLoadId(loadId);
Integer isAbnormal = carsLoadScanEntity.getLoadingAbnormal();
Integer isData = carsLoadScanEntity.getIsData();
Integer num = carsLoadScanEntity.getNum();
Long trayId = carsLoadScanEntity.getTrayId();
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{
parcelListEntity.setOrderPackageStatus("20");
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId);
}
distributionParcelListClient.update(parcelListEntity);
updownTypeClient.downPackageOrDelTray(scanCode,warehouseId);
}else{
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId);
}
}
}
// updateNumByLoadId(loadId);
return R.success("删除成功");

Loading…
Cancel
Save