|
@@ -139,7 +139,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
.in(BilletBasicInfo::getBilletNo, billetNosList);
|
|
|
List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
|
|
|
- if (billetBasicInfoList.size() == 0) {
|
|
|
+ if (oConvertUtils.listIsEmpty(billetBasicInfoList)) {
|
|
|
result.put("fail", "钢坯基础信息为空,垛位装车保存失败");
|
|
|
return result;
|
|
|
}
|
|
@@ -202,16 +202,20 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
storageBill.setAmountTotal((oConvertUtils.isNotEmpty(storageBill.getAmountTotal()) ? storageBill.getAmountTotal() : 0) + stackingAndLoadingVehiclesList.size() * 4);
|
|
|
storageBill.setDestination(loadingParams.getDestination());
|
|
|
storageBill.setTypeConfigId(loadingParams.getDestinationId());
|
|
|
- String existingAssemblyNumber = storageBill.getAssemblyNumber();
|
|
|
String distinctAssemblyNumber = billetBasicInfoList.stream()
|
|
|
.map(BilletBasicInfo::getAssemblyNumber)
|
|
|
.filter(assemblyNumber -> assemblyNumber!= null)
|
|
|
.distinct()
|
|
|
.collect(Collectors.joining(","));
|
|
|
- String finalAssemblyNumber = Optional.ofNullable(existingAssemblyNumber)
|
|
|
- .map(s -> s + "," + distinctAssemblyNumber)
|
|
|
- .orElse(distinctAssemblyNumber);
|
|
|
- storageBill.setAssemblyNumber(finalAssemblyNumber);
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill)){
|
|
|
+ String existingAssemblyNumber = storageBill.getAssemblyNumber();
|
|
|
+ String finalAssemblyNumber = Optional.ofNullable(existingAssemblyNumber)
|
|
|
+ .map(s -> s + "," + distinctAssemblyNumber)
|
|
|
+ .orElse(distinctAssemblyNumber);
|
|
|
+ storageBill.setAssemblyNumber(finalAssemblyNumber);
|
|
|
+ }else {
|
|
|
+ storageBill.setAssemblyNumber(distinctAssemblyNumber);
|
|
|
+ }
|
|
|
storageBillService.updateById(storageBill);
|
|
|
result.put("success", "堆垛保存操作成功");
|
|
|
return result;
|
|
@@ -521,6 +525,10 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
.in(BilletBasicInfo::getBilletNo, billetNosList);
|
|
|
List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperBB);
|
|
|
+ if (oConvertUtils.listIsEmpty(billetBasicInfoList)){
|
|
|
+ result.put("fail", "钢坯基础信息不存在,堆垛发车保存失败!");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
List<RollClubCommon> rollClubCommonList= new ArrayList<>();
|
|
|
billetBasicInfoList.forEach(x ->{
|
|
|
RollClubCommon rollClubCommon = new RollClubCommon();
|
|
@@ -620,7 +628,14 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
// 生成钢坯装运单记录
|
|
|
StorageBill storageBillInfo = createStorageBill(loadingParams, rollClubCommonList, sizeLists);
|
|
|
storageBillInfo.setId(rollHeightStorageBillId);
|
|
|
+ String distinctAssemblyNumber = billetBasicInfoList.stream()
|
|
|
+ .map(BilletBasicInfo::getAssemblyNumber)
|
|
|
+ .filter(assemblyNumber -> assemblyNumber!= null)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+ storageBillInfo.setAssemblyNumber(distinctAssemblyNumber);
|
|
|
storageBillService.save(storageBillInfo);
|
|
|
+
|
|
|
// 生成钢坯储运单记录
|
|
|
StorageCarLog storageCarLog = createStorageCarLog(storageBillInfo, rollClubCommonList, heatNoList, sizeLists);
|
|
|
storageCarLogService.save(storageCarLog);
|
|
@@ -637,6 +652,23 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
storageBill.setDestination(loadingParams.getDestination());// 目的地
|
|
|
storageBill.setAmountTotal(storageBill.getAmountTotal() + stackingAndLoadingVehiclesList.size() * 4);
|
|
|
storageBill.setOutTime(new Date());
|
|
|
+
|
|
|
+ String distinctAssemblyNumber = billetBasicInfoList.stream()
|
|
|
+ .map(BilletBasicInfo::getAssemblyNumber)
|
|
|
+ .filter(assemblyNumber -> assemblyNumber!= null)
|
|
|
+ .distinct()
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
+
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill)){
|
|
|
+ String existingAssemblyNumber = storageBill.getAssemblyNumber();
|
|
|
+ String finalAssemblyNumber = Optional.ofNullable(existingAssemblyNumber)
|
|
|
+ .map(s -> s + "," + distinctAssemblyNumber)
|
|
|
+ .orElse(distinctAssemblyNumber);
|
|
|
+ storageBill.setAssemblyNumber(finalAssemblyNumber);
|
|
|
+ }else {
|
|
|
+ storageBill.setAssemblyNumber(distinctAssemblyNumber);
|
|
|
+ }
|
|
|
+
|
|
|
storageBillService.updateById(storageBill);
|
|
|
// 7 发车后,新增钢坯堆垛储运信息,生成储运单 storage_car_log
|
|
|
StorageCarLog storageCarLog = new StorageCarLog();
|
|
@@ -724,6 +756,7 @@ public class StackingAndLoadingVehiclesServiceImpl extends ServiceImpl<StackingA
|
|
|
.distinct() // 去重
|
|
|
.collect(Collectors.joining(",")); // 用逗号连接成一个字符串
|
|
|
stackingUpLog.setAssemblyNumber(distinctAssemblyNumber);
|
|
|
+ stackingUpLog.setCreateDate(new Date());
|
|
|
stackingUpLogList.add(stackingUpLog);
|
|
|
});
|
|
|
stackingUpLogService.saveBatch(stackingUpLogList);
|