|
@@ -1,6 +1,5 @@
|
|
|
package org.jeecg.modules.billet.billetHotsend.service.impl;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -17,6 +16,7 @@ import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
|
|
|
import org.jeecg.modules.billet.billetHotsend.service.IRulerDefaultConfigService;
|
|
|
import org.jeecg.modules.billet.billetHotsendConfig.entity.BilletHotsendTypeConfig;
|
|
|
import org.jeecg.modules.billet.billetHotsendConfig.service.IBilletHotsendTypeConfigService;
|
|
|
+import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
|
|
|
import org.jeecg.modules.billet.rollClubOne.entity.RollClubOne;
|
|
|
import org.jeecg.modules.billet.rollClubOne.entity.RollClubOneDetails;
|
|
|
import org.jeecg.modules.billet.rollClubOne.service.IRollClubOneDetailsService;
|
|
@@ -62,7 +62,8 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseMapper, BilletHotsend> implements IBilletHotsendBaseService {
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private IOperateLogService operateLogService;
|
|
|
@Autowired
|
|
|
private BilletHotsendBaseMapper billetHotsendBaseMapper;
|
|
|
@Autowired
|
|
@@ -305,40 +306,87 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
|
|
|
@Override
|
|
|
public void saveBilletHotsendDetails(BilletHotsendDetailsVo billetHotsendDetailsVo) {
|
|
|
+ // 根据billetHotsendTypeConfigId 查询基础垛位信息
|
|
|
+ BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
|
|
|
+ List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
|
|
|
BilletHotsend billetHotsend = new BilletHotsend();
|
|
|
- StorageBill storageBill = billetHotsendDetailsVo.getStorageBill();
|
|
|
// 新保存 钢坯热送基础信息
|
|
|
BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
|
|
|
billetHotsend.setCreateDate(new Date());
|
|
|
- List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
|
|
|
- billetHotsend.setAmountTotal(rollClubCommonList.size());
|
|
|
- if (billetHotsend.getIsUpd()){
|
|
|
+// billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
|
|
|
+ LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ BilletHotsend check = baseMapper.selectOne(queryWrapper);
|
|
|
+ if (oConvertUtils.isNotEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isEmpty(check)){
|
|
|
+ billetHotsend.setRollclubtwoNum(0);
|
|
|
+ billetHotsend.setRollcluboneNum(0);
|
|
|
+ billetHotsend.setRolloutshippNum(0);
|
|
|
+ billetHotsend.setRollheightNum(0);
|
|
|
+ billetHotsend.setRollclubthreeNum(0);
|
|
|
+ billetHotsend.setAmountTotal(0);
|
|
|
+ billetHotsend.setStackNum(0);
|
|
|
baseMapper.insert(billetHotsend);
|
|
|
+ billetHotsend.setId(billetHotsend.getId());
|
|
|
+ operateLogService.add(billetHotsend,null,BilletHotsend.class);
|
|
|
+ return;
|
|
|
}else {
|
|
|
+ if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollcluboneNum(check.getRollcluboneNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollclubtwoNum(check.getRollclubtwoNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollclubthreeNum(check.getRollclubthreeNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollheightNum(check.getRollheightNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRolloutshippNum(check.getRolloutshippNum() + rollClubCommonList.size());
|
|
|
+ }
|
|
|
LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
- updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo()).eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo());
|
|
|
+ updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());;
|
|
|
baseMapper.update(billetHotsend, updateWrapper);
|
|
|
- }
|
|
|
- if (oConvertUtils.isEmpty(billetHotsendDetailsVo.getBelongTable())){
|
|
|
- log.info("{}{}", ">>>>>>>>>钢坯热送基础信息-添加或发车失败,belongTable参数为空:", JSON.toJSON(billetHotsendDetailsVo));
|
|
|
- return;
|
|
|
+ billetHotsend.setId(check.getId());
|
|
|
+ operateLogService.add(billetHotsend,null,BilletHotsend.class);
|
|
|
}
|
|
|
List<String> billetNos = new ArrayList<>();
|
|
|
+ StorageBill storageBill = billetHotsendDetailsVo.getStorageBill();
|
|
|
// 保存 钢坯热送单炉支数传递单明细
|
|
|
if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
// 保存棒一信息
|
|
|
RollClubOne rollClubOne = new RollClubOne();
|
|
|
BeanUtils.copyProperties(billetHotsend, rollClubOne);
|
|
|
- rollClubOne.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
rollClubOne.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
// rollClubOne.setBlankOutput();// 出坯量
|
|
|
// rollClubOne.setDecideWeight();// 定重
|
|
|
- rollClubOneService.save(rollClubOne);
|
|
|
+ LambdaQueryWrapper<RollClubOne> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubOne::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollClubOne::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollClubOne::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollClubOne::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollClubOne rollClubOne1 = rollClubOneService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollClubOne1)){
|
|
|
+ rollClubOne.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollClubOneService.save(rollClubOne);
|
|
|
+ }else {
|
|
|
+ rollClubOne.setAmountTotal(rollClubOne1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollClubOne.setId(rollClubOne1.getId());
|
|
|
+ rollClubOneService.updateById(rollClubOne);
|
|
|
+ }
|
|
|
// 保存棒二明细信息
|
|
|
List<RollClubOneDetails> rollClubOneDetailsList = new ArrayList<>();
|
|
|
rollClubCommonList.forEach(x ->{
|
|
|
RollClubOneDetails rollClubOneDetails = new RollClubOneDetails();
|
|
|
BeanUtils.copyProperties(x, rollClubOneDetails);
|
|
|
+ rollClubOneDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
billetNos.add(x.getBilletNo());
|
|
|
rollClubOneDetailsList.add(rollClubOneDetails);
|
|
|
});
|
|
@@ -349,17 +397,32 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
// 保存棒一信息
|
|
|
RollClubTwo rollClubTwo = new RollClubTwo();
|
|
|
BeanUtils.copyProperties(billetHotsend, rollClubTwo);
|
|
|
- rollClubTwo.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
rollClubTwo.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
// rollClubTwo.setBlankOutput();// 出坯量
|
|
|
// rollClubTwo.setDecideWeight();// 定重
|
|
|
- rollClubTwoService.save(rollClubTwo);
|
|
|
+ LambdaQueryWrapper<RollClubTwo> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubTwo::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollClubTwo::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollClubTwo::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollClubTwo::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollClubTwo rollClubTwo1 = rollClubTwoService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollClubTwo1)){
|
|
|
+ rollClubTwo.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollClubTwoService.save(rollClubTwo);
|
|
|
+ }else {
|
|
|
+ rollClubTwo.setId(rollClubTwo1.getId());
|
|
|
+ rollClubTwo.setAmountTotal(rollClubTwo1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollClubTwoService.updateById(rollClubTwo);
|
|
|
+ }
|
|
|
// 保存棒二明细信息
|
|
|
List<RollClubTwoDetails> rollClubTwoDetailsList = new ArrayList<>();
|
|
|
rollClubCommonList.forEach(x ->{
|
|
|
RollClubTwoDetails rollClubTwoDetails = new RollClubTwoDetails();
|
|
|
BeanUtils.copyProperties(x, rollClubTwoDetails);
|
|
|
+ rollClubTwoDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollClubTwoDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
rollClubTwoDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollClubTwoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
billetNos.add(x.getBilletNo());
|
|
|
rollClubTwoDetailsList.add(rollClubTwoDetails);
|
|
|
});
|
|
@@ -370,17 +433,34 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
// 保存棒三信息
|
|
|
RollClubThree rollClubThree = new RollClubThree();
|
|
|
BeanUtils.copyProperties(billetHotsend, rollClubThree);
|
|
|
- rollClubThree.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+
|
|
|
rollClubThree.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
// rollClubThree.setBlankOutput();// 出坯量
|
|
|
// rollClubThree.setDecideWeight();// 定重
|
|
|
- rollClubThreeService.save(rollClubThree);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<RollClubThree> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubThree::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollClubThree::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollClubThree::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollClubThree::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollClubThree rollClubThree1 = rollClubThreeService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollClubThree1)){
|
|
|
+ rollClubThree.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollClubThreeService.save(rollClubThree);
|
|
|
+ }else {
|
|
|
+ rollClubThree.setId(rollClubThree1.getId());
|
|
|
+ rollClubThree.setAmountTotal(rollClubThree1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollClubThreeService.updateById(rollClubThree);
|
|
|
+ }
|
|
|
// 保存棒三明细信息
|
|
|
List<RollClubThreeDetails> rollClubThreeDetailsList = new ArrayList<>();
|
|
|
rollClubCommonList.forEach(x ->{
|
|
|
RollClubThreeDetails rollClubThreeDetails = new RollClubThreeDetails();
|
|
|
BeanUtils.copyProperties(x, rollClubThreeDetails);
|
|
|
+ rollClubThreeDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollClubThreeDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
rollClubThreeDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollClubThreeDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
billetNos.add(x.getBilletNo());
|
|
|
rollClubThreeDetailsList.add(rollClubThreeDetails);
|
|
|
});
|
|
@@ -393,16 +473,30 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
RollHeight rollHeight = new RollHeight();
|
|
|
BeanUtils.copyProperties(billetHotsend, rollHeight);
|
|
|
- rollHeight.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
rollHeight.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
// rollClubThree.setBlankOutput();// 出坯量
|
|
|
// rollClubThree.setDecideWeight();// 定重
|
|
|
- rollHeightService.save(rollHeight);
|
|
|
+ LambdaQueryWrapper<RollHeight> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollHeight::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollHeight::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollHeight::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollHeight::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollHeight rollHeight1 = rollHeightService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollHeight1)){
|
|
|
+ rollHeight.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollHeightService.save(rollHeight);
|
|
|
+ }else {
|
|
|
+ rollHeight.setAmountTotal(rollHeight1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollHeight.setId(rollHeight1.getId());
|
|
|
+ rollHeightService.updateById(rollHeight);
|
|
|
+ }
|
|
|
// 保存高线明细信息
|
|
|
List<RollHeightDetails> rollHeightDetailsList = new ArrayList<>();
|
|
|
rollClubCommonList.forEach(x ->{
|
|
|
RollHeightDetails rollHeightDetails = new RollHeightDetails();
|
|
|
BeanUtils.copyProperties(x, rollHeightDetails);
|
|
|
+ rollHeightDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
billetNos.add(x.getBilletNo());
|
|
|
rollHeightDetailsList.add(rollHeightDetails);
|
|
|
});
|
|
@@ -415,28 +509,44 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
RollOutShipp rollOutShipp = new RollOutShipp();
|
|
|
BeanUtils.copyProperties(billetHotsend, rollOutShipp);
|
|
|
- rollOutShipp.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+
|
|
|
rollOutShipp.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
// rollOutShipp.setBlankOutput();// 出坯量
|
|
|
// rollOutShipp.setDecideWeight();// 定重
|
|
|
- rollOutShippService.save(rollOutShipp);
|
|
|
+ LambdaQueryWrapper<RollOutShipp> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollOutShipp::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollOutShipp::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollOutShipp::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollOutShipp::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollOutShipp rollOutShipp1 = rollOutShippService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollOutShipp1)){
|
|
|
+ rollOutShipp.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollOutShippService.save(rollOutShipp);
|
|
|
+ }else {
|
|
|
+ rollOutShipp.setId(rollOutShipp1.getId());
|
|
|
+ rollOutShipp.setAmountTotal(rollOutShipp1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollOutShippService.updateById(rollOutShipp);
|
|
|
+ }
|
|
|
// 保存上若明细信息
|
|
|
List<RollOutShippDetails> rollOutShippDetailsList = new ArrayList<>();
|
|
|
rollClubCommonList.forEach(x ->{
|
|
|
RollOutShippDetails rollOutShippDetails = new RollOutShippDetails();
|
|
|
BeanUtils.copyProperties(x, rollOutShippDetails);
|
|
|
+ rollOutShippDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollOutShippDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
rollOutShippDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollOutShippDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
billetNos.add(x.getBilletNo());
|
|
|
rollOutShippDetailsList.add(rollOutShippDetails);
|
|
|
});
|
|
|
rollOutShippDetailsService.saveBatch(rollOutShippDetailsList);
|
|
|
}
|
|
|
//查询并批量更新钢坯基础信息 belongTable
|
|
|
- LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<BilletBasicInfo>()
|
|
|
+ LambdaQueryWrapper<BilletBasicInfo> queryWrapperls = new LambdaQueryWrapper<BilletBasicInfo>()
|
|
|
.eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
.eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
|
|
|
.in(BilletBasicInfo::getBilletNo, billetNos);
|
|
|
- List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapper);
|
|
|
+ List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperls);
|
|
|
billetBasicInfoList.forEach(x ->{
|
|
|
if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
x.setBelongTable("roll_club_one");
|
|
@@ -449,70 +559,10 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
}else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
x.setBelongTable("roll_out_shipp");
|
|
|
}
|
|
|
+ x.setBhtcId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
|
|
|
x.setUpdateTime(new Date());
|
|
|
});
|
|
|
billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
|
|
|
- // 更新装运单 车次总序号、本车车次
|
|
|
- if (!billetHotsend.getIsUpd() && oConvertUtils.isNotEmpty(storageBill)){
|
|
|
- storageBill.setCarAllNum(oConvertUtils.isEmpty(storageBill.getCarAllNum()) ? "1" : String.valueOf(Integer.valueOf(storageBill.getCarAllNum())+1));// 车次总序号
|
|
|
- storageBill.setCarNum(storageBill.getCarNum() + 1);// 本车车次
|
|
|
- storageBillService.updateById(storageBill);
|
|
|
- // 生成储运单
|
|
|
- StorageCarLog storageCarLog = new StorageCarLog();
|
|
|
- BeanUtils.copyProperties(storageBill, storageCarLog);
|
|
|
- List<String> sizeList = new ArrayList<>();
|
|
|
- List<String> heatNoList = new ArrayList<>();
|
|
|
- long count = 0l;
|
|
|
- //根据铸机号、钢坯转运单ID查询定尺信息
|
|
|
- if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
- LambdaQueryWrapper<RollClubTwoDetails> queryWrapperRC = new LambdaQueryWrapper();
|
|
|
- queryWrapperRC.eq(RollClubTwoDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId());
|
|
|
- List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapperRC);
|
|
|
- sizeList = rollClubTwoDetailsList.stream().map(RollClubTwoDetails::getSize).distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- heatNoList = rollClubTwoDetailsList.stream().map(RollClubTwoDetails::getHeatNo).distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)){
|
|
|
- count = rollClubTwoDetailsList.stream().count();
|
|
|
- }
|
|
|
- }
|
|
|
- if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
- LambdaQueryWrapper<RollClubThreeDetails> queryWrapperCT = new LambdaQueryWrapper();
|
|
|
- queryWrapperCT.eq(RollClubThreeDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId());
|
|
|
- List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapperCT);
|
|
|
- sizeList = rollClubThreeDetailsList.stream().map(RollClubThreeDetails::getSize).distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- heatNoList = rollClubThreeDetailsList.stream().map(RollClubThreeDetails::getHeatNo).distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)){
|
|
|
- count = rollClubThreeDetailsList.stream().count();
|
|
|
- }
|
|
|
- }
|
|
|
- if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
- LambdaQueryWrapper<RollOutShippDetails> queryWrapperROS = new LambdaQueryWrapper();
|
|
|
- queryWrapperROS.eq(RollOutShippDetails::getCcmNo, storageBill.getCcmNo()).eq(RollOutShippDetails::getStorageBillId, storageBill.getId());
|
|
|
- List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapperROS);
|
|
|
- sizeList = rollOutShippDetailsList.stream().map(RollOutShippDetails::getSize).distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- heatNoList = rollOutShippDetailsList.stream().map(RollOutShippDetails::getHeatNo).distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)){
|
|
|
- count = rollOutShippDetailsList.stream().count();
|
|
|
- }
|
|
|
- }
|
|
|
- // 根据billetHotsendTypeConfigId 查询基础垛位信息
|
|
|
- BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
|
|
|
- storageCarLog.setDestination(billetHotsendTypeConfig.getTypeName());// 目的地
|
|
|
- storageCarLog.setCarNm(storageCarLog.getCarNm());// 车号
|
|
|
-// storageCarLog.setFixedWeight();// 定重
|
|
|
- storageCarLog.setOutCarNum(storageCarLog.getOutCarNum()); // 出车号
|
|
|
- storageCarLog.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
|
|
|
- storageCarLog.setHeatNo(String.join(",", heatNoList));
|
|
|
- storageCarLog.setSize(String.join(",", sizeList));// 定尺
|
|
|
- storageCarLog.setAmount(String.valueOf(count));// 支数
|
|
|
- storageCarLog.setDataTime(new Date());
|
|
|
- storageCarLogService.save(storageCarLog);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -556,4 +606,335 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveBilletHotsendDetailsCar(BilletHotsendDetailsVo billetHotsendDetailsVo) {
|
|
|
+ // 根据billetHotsendTypeConfigId 查询基础垛位信息
|
|
|
+ BilletHotsendTypeConfig billetHotsendTypeConfig = billetHotsendTypeConfigService.getById(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
|
|
|
+ List<RollClubCommon> rollClubCommonList = billetHotsendDetailsVo.getRollClubCommonList();
|
|
|
+
|
|
|
+ BilletHotsend billetHotsend = new BilletHotsend();
|
|
|
+ // 新保存 钢坯热送基础信息
|
|
|
+ BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
|
|
|
+ billetHotsend.setCreateDate(new Date());
|
|
|
+ // billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
|
|
|
+ LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ BilletHotsend check = baseMapper.selectOne(queryWrapper);
|
|
|
+ if (oConvertUtils.isEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
+ if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollcluboneNum(rollClubCommonList.size());
|
|
|
+ }else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollclubtwoNum(rollClubCommonList.size());
|
|
|
+ }else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollclubthreeNum(rollClubCommonList.size());
|
|
|
+ }else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollheightNum(rollClubCommonList.size());
|
|
|
+ }else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRolloutshippNum(rollClubCommonList.size());
|
|
|
+ }
|
|
|
+ billetHotsend.setRollclubtwoNum(0);
|
|
|
+ billetHotsend.setRollcluboneNum(0);
|
|
|
+ billetHotsend.setRolloutshippNum(0);
|
|
|
+ billetHotsend.setRollheightNum(0);
|
|
|
+ billetHotsend.setRollclubthreeNum(0);
|
|
|
+ baseMapper.insert(billetHotsend);
|
|
|
+ billetHotsend.setId(check.getId());
|
|
|
+ operateLogService.add(billetHotsend,null,BilletHotsend.class);
|
|
|
+ }else {
|
|
|
+ if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollcluboneNum(check.getRollcluboneNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollclubtwoNum(check.getRollclubtwoNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollclubthreeNum(check.getRollclubthreeNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRollheightNum(check.getRollheightNum() + rollClubCommonList.size());
|
|
|
+ }else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable()) && "0".equals(billetHotsendTypeConfig.getBelongType().toString())){
|
|
|
+ billetHotsend.setRolloutshippNum(check.getRolloutshippNum() + rollClubCommonList.size());
|
|
|
+ }
|
|
|
+ LambdaUpdateWrapper<BilletHotsend> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
+ .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());;
|
|
|
+ baseMapper.update(billetHotsend, updateWrapper);
|
|
|
+ billetHotsend.setId(check.getId());
|
|
|
+ operateLogService.add(billetHotsend,null,BilletHotsend.class);
|
|
|
+ }
|
|
|
+ StorageBill storageBill = billetHotsendDetailsVo.getStorageBill();
|
|
|
+ List<String> billetNos = new ArrayList<>();
|
|
|
+ // 保存 钢坯热送单炉支数传递单明细
|
|
|
+ if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ // 保存棒一信息
|
|
|
+ RollClubOne rollClubOne = new RollClubOne();
|
|
|
+ BeanUtils.copyProperties(billetHotsend, rollClubOne);
|
|
|
+ rollClubOne.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
+// rollClubOne.setBlankOutput();// 出坯量
|
|
|
+// rollClubOne.setDecideWeight();// 定重
|
|
|
+ LambdaQueryWrapper<RollClubOne> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubOne::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollClubOne::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollClubOne::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollClubOne::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollClubOne rollClubOne1 = rollClubOneService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollClubOne1)){
|
|
|
+ rollClubOne.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollClubOneService.save(rollClubOne);
|
|
|
+ }else {
|
|
|
+ rollClubOne.setAmountTotal(rollClubOne1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollClubOne.setId(rollClubOne1.getId());
|
|
|
+ rollClubOneService.updateById(rollClubOne);
|
|
|
+ }
|
|
|
+ // 保存棒二明细信息
|
|
|
+ List<RollClubOneDetails> rollClubOneDetailsList = new ArrayList<>();
|
|
|
+ rollClubCommonList.forEach(x ->{
|
|
|
+ RollClubOneDetails rollClubOneDetails = new RollClubOneDetails();
|
|
|
+ BeanUtils.copyProperties(x, rollClubOneDetails);
|
|
|
+ rollClubOneDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollClubOneDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ billetNos.add(x.getBilletNo());
|
|
|
+ rollClubOneDetailsList.add(rollClubOneDetails);
|
|
|
+ });
|
|
|
+ rollClubOneDetailsService.saveBatch(rollClubOneDetailsList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ // 保存棒一信息
|
|
|
+ RollClubTwo rollClubTwo = new RollClubTwo();
|
|
|
+ BeanUtils.copyProperties(billetHotsend, rollClubTwo);
|
|
|
+ rollClubTwo.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
+// rollClubTwo.setBlankOutput();// 出坯量
|
|
|
+// rollClubTwo.setDecideWeight();// 定重
|
|
|
+ LambdaQueryWrapper<RollClubTwo> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubTwo::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollClubTwo::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollClubTwo::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollClubTwo::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollClubTwo rollClubTwo1 = rollClubTwoService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollClubTwo1)){
|
|
|
+ rollClubTwo.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollClubTwoService.save(rollClubTwo);
|
|
|
+ }else {
|
|
|
+ rollClubTwo.setId(rollClubTwo1.getId());
|
|
|
+ rollClubTwo.setAmountTotal(rollClubTwo1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollClubTwoService.updateById(rollClubTwo);
|
|
|
+ }
|
|
|
+ // 保存棒二明细信息
|
|
|
+ List<RollClubTwoDetails> rollClubTwoDetailsList = new ArrayList<>();
|
|
|
+ rollClubCommonList.forEach(x ->{
|
|
|
+ RollClubTwoDetails rollClubTwoDetails = new RollClubTwoDetails();
|
|
|
+ BeanUtils.copyProperties(x, rollClubTwoDetails);
|
|
|
+ rollClubTwoDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollClubTwoDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ rollClubTwoDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollClubTwoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetNos.add(x.getBilletNo());
|
|
|
+ rollClubTwoDetailsList.add(rollClubTwoDetails);
|
|
|
+ });
|
|
|
+ rollClubTwoDetailsService.saveBatch(rollClubTwoDetailsList);
|
|
|
+ }
|
|
|
+ if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ // 保存棒三信息
|
|
|
+ RollClubThree rollClubThree = new RollClubThree();
|
|
|
+ BeanUtils.copyProperties(billetHotsend, rollClubThree);
|
|
|
+
|
|
|
+ rollClubThree.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
+// rollClubThree.setBlankOutput();// 出坯量
|
|
|
+// rollClubThree.setDecideWeight();// 定重
|
|
|
+
|
|
|
+ LambdaQueryWrapper<RollClubThree> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollClubThree::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollClubThree::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollClubThree::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollClubThree::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollClubThree rollClubThree1 = rollClubThreeService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollClubThree1)){
|
|
|
+ rollClubThree.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollClubThreeService.save(rollClubThree);
|
|
|
+ }else {
|
|
|
+ rollClubThree.setId(rollClubThree1.getId());
|
|
|
+ rollClubThree.setAmountTotal(rollClubThree1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollClubThreeService.updateById(rollClubThree);
|
|
|
+ }
|
|
|
+ // 保存棒三明细信息
|
|
|
+ List<RollClubThreeDetails> rollClubThreeDetailsList = new ArrayList<>();
|
|
|
+ rollClubCommonList.forEach(x ->{
|
|
|
+ RollClubThreeDetails rollClubThreeDetails = new RollClubThreeDetails();
|
|
|
+ BeanUtils.copyProperties(x, rollClubThreeDetails);
|
|
|
+ rollClubThreeDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollClubThreeDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ rollClubThreeDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollClubThreeDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetNos.add(x.getBilletNo());
|
|
|
+ rollClubThreeDetailsList.add(rollClubThreeDetails);
|
|
|
+ });
|
|
|
+ rollClubThreeDetailsService.saveBatch(rollClubThreeDetailsList);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 保存高线信息
|
|
|
+ */
|
|
|
+ if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ RollHeight rollHeight = new RollHeight();
|
|
|
+ BeanUtils.copyProperties(billetHotsend, rollHeight);
|
|
|
+ rollHeight.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
+// rollClubThree.setBlankOutput();// 出坯量
|
|
|
+// rollClubThree.setDecideWeight();// 定重
|
|
|
+ LambdaQueryWrapper<RollHeight> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollHeight::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollHeight::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollHeight::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollHeight::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollHeight rollHeight1 = rollHeightService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollHeight1)){
|
|
|
+ rollHeight.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollHeightService.save(rollHeight);
|
|
|
+ }else {
|
|
|
+ rollHeight.setAmountTotal(rollHeight1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollHeight.setId(rollHeight1.getId());
|
|
|
+ rollHeightService.updateById(rollHeight);
|
|
|
+ }
|
|
|
+ // 保存高线明细信息
|
|
|
+ List<RollHeightDetails> rollHeightDetailsList = new ArrayList<>();
|
|
|
+ rollClubCommonList.forEach(x ->{
|
|
|
+ RollHeightDetails rollHeightDetails = new RollHeightDetails();
|
|
|
+ BeanUtils.copyProperties(x, rollHeightDetails);
|
|
|
+ rollHeightDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollHeightDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ billetNos.add(x.getBilletNo());
|
|
|
+ rollHeightDetailsList.add(rollHeightDetails);
|
|
|
+ });
|
|
|
+ rollHeightDetailsService.saveBatch(rollHeightDetailsList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存上若信息
|
|
|
+ */
|
|
|
+ if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ RollOutShipp rollOutShipp = new RollOutShipp();
|
|
|
+ BeanUtils.copyProperties(billetHotsend, rollOutShipp);
|
|
|
+ rollOutShipp.setSize(rollClubCommonList.stream().findFirst().orElse(null).getSize()); //定尺
|
|
|
+// rollOutShipp.setBlankOutput();// 出坯量
|
|
|
+// rollOutShipp.setDecideWeight();// 定重
|
|
|
+ LambdaQueryWrapper<RollOutShipp> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper1.eq(RollOutShipp::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(RollOutShipp::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(RollOutShipp::getShift, billetHotsend.getShift())
|
|
|
+ .eq(RollOutShipp::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ RollOutShipp rollOutShipp1 = rollOutShippService.getOne(queryWrapper1);
|
|
|
+ if (oConvertUtils.isEmpty(rollOutShipp1)){
|
|
|
+ rollOutShipp.setAmountTotal(rollClubCommonList.size());// 总支数
|
|
|
+ rollOutShippService.save(rollOutShipp);
|
|
|
+ }else {
|
|
|
+ rollOutShipp.setId(rollOutShipp1.getId());
|
|
|
+ rollOutShipp.setAmountTotal(rollOutShipp1.getAmountTotal() + rollClubCommonList.size());// 总支数
|
|
|
+ rollOutShippService.updateById(rollOutShipp);
|
|
|
+ }
|
|
|
+ // 保存上若明细信息
|
|
|
+ List<RollOutShippDetails> rollOutShippDetailsList = new ArrayList<>();
|
|
|
+ rollClubCommonList.forEach(x ->{
|
|
|
+ RollOutShippDetails rollOutShippDetails = new RollOutShippDetails();
|
|
|
+ BeanUtils.copyProperties(x, rollOutShippDetails);
|
|
|
+ rollOutShippDetails.setShift(billetHotsend.getShift());
|
|
|
+ rollOutShippDetails.setShiftGroup(billetHotsend.getShiftGroup());
|
|
|
+ rollOutShippDetails.setStorageBillId(storageBill.getId());
|
|
|
+ rollOutShippDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetNos.add(x.getBilletNo());
|
|
|
+ rollOutShippDetailsList.add(rollOutShippDetails);
|
|
|
+ });
|
|
|
+ rollOutShippDetailsService.saveBatch(rollOutShippDetailsList);
|
|
|
+ }
|
|
|
+ //查询并批量更新钢坯基础信息 belongTable
|
|
|
+ LambdaQueryWrapper<BilletBasicInfo> queryWrapperls = new LambdaQueryWrapper<BilletBasicInfo>()
|
|
|
+ .eq(BilletBasicInfo::getCcmNo, Integer.valueOf(billetHotsend.getCcmNo()))
|
|
|
+ .eq(BilletBasicInfo::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .in(BilletBasicInfo::getBilletNo, billetNos);
|
|
|
+ List<BilletBasicInfo> billetBasicInfoList = billetBasicInfoService.list(queryWrapperls);
|
|
|
+ billetBasicInfoList.forEach(x ->{
|
|
|
+ if ("roll_club_one".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ x.setBelongTable("roll_club_one");
|
|
|
+ }else if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ x.setBelongTable("roll_club_two");
|
|
|
+ }else if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ x.setBelongTable("roll_club_three");
|
|
|
+ }else if ("roll_height".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ x.setBelongTable("roll_height");
|
|
|
+ }else if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ x.setBelongTable("roll_out_shipp");
|
|
|
+ }
|
|
|
+ x.setBhtcId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId());
|
|
|
+ x.setUpdateTime(new Date());
|
|
|
+ });
|
|
|
+ billetBasicInfoService.saveOrUpdateBatch(billetBasicInfoList);
|
|
|
+
|
|
|
+ // 更新装运单 车次总序号、本车车次
|
|
|
+ LambdaQueryWrapper<StorageBill> queryWrapperSB = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapperSB.eq(StorageBill::getCcmNo, storageBill.getCcmNo())
|
|
|
+ .eq(StorageBill::getShift, storageBill.getShift())
|
|
|
+ .eq(StorageBill::getShiftGroup, storageBill.getShiftGroup())
|
|
|
+ .eq(StorageBill::getLicensePlate, storageBill.getLicensePlate());
|
|
|
+ List<StorageBill> storageBillList = storageBillService.list(queryWrapperSB);
|
|
|
+ storageBill.setCarNum(oConvertUtils.listIsEmpty(storageBillList) ? 0 : storageBillList.size() + 1);// 本车车次
|
|
|
+ storageBill.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
|
|
|
+ storageBill.setDestination(billetHotsendDetailsVo.getStorageBill().getDestination());// 目的地
|
|
|
+ storageBill.setAmountTotal(rollClubCommonList.size());
|
|
|
+ storageBill.setOutTime(new Date());
|
|
|
+ storageBillService.updateById(storageBill);
|
|
|
+ // 生成储运单
|
|
|
+ StorageCarLog storageCarLog = new StorageCarLog();
|
|
|
+ BeanUtils.copyProperties(storageBill, storageCarLog);
|
|
|
+ List<String> sizeList = new ArrayList<>();
|
|
|
+ List<String> heatNoList = new ArrayList<>();
|
|
|
+ long count = 0l;
|
|
|
+ //根据铸机号、钢坯转运单ID查询定尺信息
|
|
|
+ if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ LambdaQueryWrapper<RollClubTwoDetails> queryWrapperRC = new LambdaQueryWrapper();
|
|
|
+ queryWrapperRC.eq(RollClubTwoDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubTwoDetails::getStorageBillId, storageBill.getId());
|
|
|
+ List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapperRC);
|
|
|
+ sizeList = rollClubTwoDetailsList.stream().map(RollClubTwoDetails::getSize).distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ heatNoList = rollClubTwoDetailsList.stream().map(RollClubTwoDetails::getHeatNo).distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (oConvertUtils.listIsNotEmpty(rollClubTwoDetailsList)){
|
|
|
+ count = rollClubTwoDetailsList.stream().count();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ LambdaQueryWrapper<RollClubThreeDetails> queryWrapperCT = new LambdaQueryWrapper();
|
|
|
+ queryWrapperCT.eq(RollClubThreeDetails::getCcmNo, storageBill.getCcmNo()).eq(RollClubThreeDetails::getStorageBillId, storageBill.getId());
|
|
|
+ List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapperCT);
|
|
|
+ sizeList = rollClubThreeDetailsList.stream().map(RollClubThreeDetails::getSize).distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ heatNoList = rollClubThreeDetailsList.stream().map(RollClubThreeDetails::getHeatNo).distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (oConvertUtils.listIsNotEmpty(rollClubThreeDetailsList)){
|
|
|
+ count = rollClubThreeDetailsList.stream().count();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("roll_out_shipp".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
|
+ LambdaQueryWrapper<RollOutShippDetails> queryWrapperROS = new LambdaQueryWrapper();
|
|
|
+ queryWrapperROS.eq(RollOutShippDetails::getCcmNo, storageBill.getCcmNo()).eq(RollOutShippDetails::getStorageBillId, storageBill.getId());
|
|
|
+ List<RollOutShippDetails> rollOutShippDetailsList = rollOutShippDetailsService.list(queryWrapperROS);
|
|
|
+ sizeList = rollOutShippDetailsList.stream().map(RollOutShippDetails::getSize).distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ heatNoList = rollOutShippDetailsList.stream().map(RollOutShippDetails::getHeatNo).distinct()
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ if (oConvertUtils.listIsNotEmpty(rollOutShippDetailsList)){
|
|
|
+ count = rollOutShippDetailsList.stream().count();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ storageCarLog.setDestination(billetHotsendTypeConfig.getTypeName());// 目的地
|
|
|
+ storageCarLog.setCarNm(storageBill.getLicensePlate());// 车牌号
|
|
|
+// storageCarLog.setFixedWeight();// 定重
|
|
|
+ storageCarLog.setTypeConfigId(billetHotsendDetailsVo.getBilletHotsendTypeConfigId()); // 钢坯配置类型ID
|
|
|
+ storageCarLog.setHeatNo(String.join(",", heatNoList));
|
|
|
+ storageCarLog.setSize(String.join(",", sizeList));// 定尺
|
|
|
+ storageCarLog.setAmount(Integer.valueOf((int) count));// 支数
|
|
|
+ storageCarLog.setDataTime(new Date());
|
|
|
+ storageCarLogService.save(storageCarLog);
|
|
|
+
|
|
|
+ }
|
|
|
}
|