|
@@ -44,6 +44,8 @@ import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShipp;
|
|
|
import org.jeecg.modules.billet.rollOutShipp.entity.RollOutShippDetails;
|
|
|
import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippDetailsService;
|
|
|
import org.jeecg.modules.billet.rollOutShipp.service.IRollOutShippService;
|
|
|
+import org.jeecg.modules.billet.storageBill.entity.ShiftEnum;
|
|
|
+import org.jeecg.modules.billet.storageBill.entity.ShiftGroupEnum;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.StorageBill;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.StorageBillModel;
|
|
|
import org.jeecg.modules.billet.storageBill.service.IStorageBillModelService;
|
|
@@ -347,7 +349,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
.eq(BilletHotsend::getShiftGroup, cacheShintGroup);
|
|
|
BilletHotsend check = baseMapper.selectOne(queryWrapper);
|
|
|
if (oConvertUtils.isNotEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
- result.put("fail", "该炉次信息已存在!");
|
|
|
+ result.put("fail", "钢坯热送信息已存在,未选择钢坯信息,保存失败!");
|
|
|
return result;
|
|
|
}
|
|
|
billetHotsend.setShiftGroup(cacheShintGroup);
|
|
@@ -412,6 +414,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
}
|
|
|
List<String> billetNos = new ArrayList<>();
|
|
|
StorageBill storageBill = billetHotsendDetailsVo.getStorageBill();
|
|
|
+
|
|
|
+ String rollClubOneOrHeightStorageBillId = String.valueOf(IdWorker.getId());
|
|
|
// 保存 钢坯热送单炉支数传递单明细
|
|
|
if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
// 保存棒一信息
|
|
@@ -445,6 +449,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollClubOneDetails.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollClubOneDetails.setShift(billetHotsend.getShift());
|
|
|
rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ rollClubOneDetails.setStorageBillId(rollClubOneOrHeightStorageBillId);
|
|
|
+ rollClubOneDetails.setLicensePlate("辊道");
|
|
|
rollClubOneDetails.setSize(String.valueOf(x.getLength()));
|
|
|
rollClubOneDetails.setSteel(x.getGrade());
|
|
|
rollClubOneDetails.setCreateTime(new Date());
|
|
@@ -582,6 +588,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollHeightDetails.setId(String.valueOf(IdWorker.getId()));
|
|
|
rollHeightDetails.setShift(billetHotsend.getShift());
|
|
|
rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ rollHeightDetails.setStorageBillId(rollClubOneOrHeightStorageBillId);
|
|
|
+ rollHeightDetails.setLicensePlate("辊道");
|
|
|
rollHeightDetails.setSize(String.valueOf(x.getLength()));
|
|
|
rollHeightDetails.setSteel(x.getGrade());
|
|
|
rollHeightDetails.setCreateTime(new Date());
|
|
@@ -663,7 +671,19 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
});
|
|
|
billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
|
|
|
if (oConvertUtils.isEmpty(billetHotsendDetailsVo.getStorageBill()) || billetHotsendDetailsVo.getStorageBill() == null){
|
|
|
- result.put("success", "新增高线成功!");
|
|
|
+ if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) || "roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ List<String> heatNoList = rollClubCommonList.stream().map(RollClubCommon::getHeatNo).distinct().collect(Collectors.toList());
|
|
|
+ List<Integer> sizeList = rollClubCommonList.stream().map(RollClubCommon::getLength).distinct().collect(Collectors.toList());
|
|
|
+ List<String> sizeLists = sizeList.stream().map(String::valueOf).collect(Collectors.toList());
|
|
|
+ // 生成钢坯装运单记录
|
|
|
+ StorageBill storageBillInfo = createStorageBill(billetHotsendDetailsVo, rollClubCommonList, sizeLists);
|
|
|
+ storageBillInfo.setId(rollClubOneOrHeightStorageBillId);
|
|
|
+ storageBillService.save(storageBillInfo);
|
|
|
+ // 生成钢坯储运单记录
|
|
|
+ StorageCarLog storageCarLog = createStorageCarLog(billetHotsendDetailsVo, storageBillInfo, rollClubCommonList, heatNoList, sizeLists);
|
|
|
+ storageCarLogService.save(storageCarLog);
|
|
|
+ result.put("success", "6".equals(billetHotsendDetailsVo.getBilletHotsend().getCcmNo())? "保存高线成功!" : "保存棒一成功!");
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
// 更新装运单 车次总序号、本车车次
|
|
@@ -678,10 +698,53 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
|
|
|
storageBill.setDestination(billetHotsendDetailsVo.getBelongTypeName());// 目的地
|
|
|
storageBillService.updateById(storageBill);
|
|
|
- result.put("success", "新增钢坯热送成功!");
|
|
|
+ result.put("success", "棒线保存成功!");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ private StorageBill createStorageBill(BilletHotsendDetailsVo billetHotsendDetailsVo, List<RollClubCommon> rollClubCommonList, List<String> sizeList) {
|
|
|
+ StorageBill storageBillInfo = new StorageBill();
|
|
|
+ storageBillInfo.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
|
|
|
+ storageBillInfo.setDestination(billetHotsendDetailsVo.getBelongTypeName());
|
|
|
+ storageBillInfo.setShiftGroup(billetHotsendDetailsVo.getBilletHotsend().getShiftGroup());
|
|
|
+ storageBillInfo.setSteel(billetHotsendDetailsVo.getBilletHotsend().getSteel());
|
|
|
+ storageBillInfo.setSpec(billetHotsendDetailsVo.getBilletHotsend().getSpec());
|
|
|
+ storageBillInfo.setShift(billetHotsendDetailsVo.getBilletHotsend().getShift());
|
|
|
+ storageBillInfo.setAmountTotal(rollClubCommonList.size());
|
|
|
+ LambdaQueryWrapper<StorageBill> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(StorageBill::getCcmNo, billetHotsendDetailsVo.getBilletHotsend().getCcmNo())
|
|
|
+ .eq(StorageBill::getLicensePlate, "辊道")
|
|
|
+ .eq(StorageBill::getShiftGroup, billetHotsendDetailsVo.getBilletHotsend().getShiftGroup())
|
|
|
+ .eq(StorageBill::getShift, billetHotsendDetailsVo.getBilletHotsend().getShift())
|
|
|
+ .between(StorageBill::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
+ List<StorageBill> storageBillList = storageBillService.list(queryWrapper1);
|
|
|
+ LambdaQueryWrapper<StorageBill> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper2.eq(StorageBill::getCcmNo, billetHotsendDetailsVo.getBilletHotsend().getCcmNo())
|
|
|
+ .between(StorageBill::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
+ List<StorageBill> storageBillList2 = storageBillService.list(queryWrapper2);
|
|
|
+ storageBillInfo.setCarNum(oConvertUtils.listIsNotEmpty(storageBillList) ? storageBillList.size() + 1 : 1);
|
|
|
+ storageBillInfo.setCarAllNum(oConvertUtils.listIsNotEmpty(storageBillList2) ? storageBillList.size() + 1 : 1);
|
|
|
+ storageBillInfo.setLicensePlate("辊道");
|
|
|
+ storageBillInfo.setCcmNo(billetHotsendDetailsVo.getBilletHotsend().getCcmNo());
|
|
|
+ storageBillInfo.setSize(String.join(",", sizeList));
|
|
|
+ storageBillInfo.setDateTime(new Date());
|
|
|
+ storageBillInfo.setCreateTime(new Date());
|
|
|
+ String uniqueCode = DateUtils.date2Str(new Date(), DateUtils.yyyymmddhhmmss.get()) + "-" + billetHotsendDetailsVo.getBilletHotsend().getCcmNo() + "#" + ShiftEnum.fromCode(billetHotsendDetailsVo.getBilletHotsend().getShift()).name() + "-" + ShiftGroupEnum.fromCode(billetHotsendDetailsVo.getBilletHotsend().getShiftGroup()).name() ;
|
|
|
+ storageBillInfo.setUniqueCode(uniqueCode);
|
|
|
+ return storageBillInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ private StorageCarLog createStorageCarLog(BilletHotsendDetailsVo billetHotsendDetailsVo, StorageBill storageBill, List<RollClubCommon> rollClubCommonList, List<String> heatNoList, List<String> sizeList) {
|
|
|
+ StorageCarLog storageCarLog = new StorageCarLog();
|
|
|
+ BeanUtils.copyProperties(storageBill, storageCarLog);
|
|
|
+ storageCarLog.setCarNm("辊道");
|
|
|
+ storageCarLog.setHeatNo(String.join(",", heatNoList));
|
|
|
+ storageCarLog.setSize(String.join(",", sizeList));
|
|
|
+ storageCarLog.setAmount(rollClubCommonList.size());
|
|
|
+ storageCarLog.setDataTime(new Date());
|
|
|
+ return storageCarLog;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void saveBilletHotsendDetailsCar(BilletHotsendDetailsVo billetHotsendDetailsVo) {
|