|
|
|
@ -774,7 +774,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
try{ |
|
|
|
|
carsLoadAsyncService.saveLog(carsLoadEntity,currentCarsLoadLineEntity, CarsLoadLogTypeConstant.END_UNLOAD_CARS_LOAD.getValue(),AuthUtil.getNickName(),AuthUtil.getUserId()); |
|
|
|
|
openOrderAsyncService.saveUnloadStartCarLog(currentCarsLoadLineEntity,AuthUtil.getNickName(),AuthUtil.getUserId()); |
|
|
|
|
carsLoadAsyncService.saveCostShareRecord(loadId,carsLoadEntity); |
|
|
|
|
carsLoadAsyncService.saveCostShareRecord(loadId,carsLoadEntity,AuthUtil.getUserId(),AuthUtil.getTenantId(),AuthUtil.getDeptId()); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.warn("#############unloadByLoadId: 存入日志失败"); |
|
|
|
|
} |
|
|
|
@ -3016,9 +3016,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R batchUnload(BatchUnloadDTO batchUnloadDTO) { |
|
|
|
|
|
|
|
|
|
Long loadId = batchUnloadDTO.getLoadId(); |
|
|
|
|
Long warehouseId = batchUnloadDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
|
if(Objects.isNull(carsLoadEntity)){ |
|
|
|
|
log.warn("############batchUnload: 配载计划信息不存在 loadId={}",loadId); |
|
|
|
|
return R.fail(405,"配载计划信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long nowWarehouseId = carsLoadEntity.getNowWarehouseId(); |
|
|
|
|
if(!warehouseId.equals(nowWarehouseId)){ |
|
|
|
|
log.warn("############batchUnload: 当前节点还未到车 loadId={} warehouseId={}",loadId,warehouseId); |
|
|
|
|
return R.fail(405,"当前节点还未到车"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<UnloadPackageDTO> unloadPackageList = batchUnloadDTO.getUnloadPackageList(); |
|
|
|
|
List<UnloadZeroDTO> unloadZeroList = batchUnloadDTO.getUnloadZeroList(); |
|
|
|
|
|
|
|
|
@ -3920,7 +3933,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.fail(405,"暂未有权限进行操作"); |
|
|
|
|
} |
|
|
|
|
String loadStatus = carsLoadEntity.getLoadStatus(); |
|
|
|
|
if(!"0".equals(loadStatus) && !"20".equals(loadStatus)){ |
|
|
|
|
if(!"0".equals(loadStatus) && !"20".equals(loadStatus) && !"40".equals(loadStatus)){ |
|
|
|
|
log.warn("##################removeCarsLoadScan: 当前配载计划不属于到车状态 loadStatus={} warehouseId={}",loadStatus,warehouseId); |
|
|
|
|
return R.fail(405,"当前配载计划不属于到车状态"); |
|
|
|
|
} |
|
|
|
@ -3940,27 +3953,27 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
//删除
|
|
|
|
|
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) { |
|
|
|
|
updateNumByLoadId(loadId); |
|
|
|
|
Integer isAbnormal = carsLoadScanEntity.getLoadingAbnormal(); |
|
|
|
|
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)){ |
|
|
|
@ -3981,6 +3994,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
}else{ |
|
|
|
|
trayTypeClient.deleteZeroOrderByTrayCode(orderCode,trayCode,warehouseId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|