|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
|
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
|
|
@@ -18,6 +19,8 @@ import org.jeecg.modules.billet.billetHotsend.entity.RulerDefaultConfig;
|
|
|
import org.jeecg.modules.billet.billetHotsend.mapper.BilletHotsendBaseMapper;
|
|
|
import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
|
|
|
import org.jeecg.modules.billet.billetHotsend.service.IRulerDefaultConfigService;
|
|
|
+import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
|
|
|
+import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
|
|
|
import org.jeecg.modules.billet.billetHotsendConfig.entity.BilletHotsendTypeConfig;
|
|
|
import org.jeecg.modules.billet.billetHotsendConfig.service.IBilletHotsendTypeConfigService;
|
|
|
import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
|
|
@@ -105,6 +108,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
private IBilletHotsendTypeConfigService billetHotsendTypeConfigService;
|
|
|
@Autowired
|
|
|
private IHeatsActualsService heatsActualsService;
|
|
|
+ @Autowired
|
|
|
+ private IBilletHotsendChangeShiftService billetHotsendChangeShiftService;
|
|
|
@Override
|
|
|
public void updateDesc(BilletHotsend billetHotsend) {
|
|
|
RulerDefaultConfig last = rulerDefaultConfigService.getLast(billetHotsend.getCcmNo());
|
|
@@ -320,29 +325,29 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
BilletHotsend billetHotsend = new BilletHotsend();
|
|
|
// 新保存 钢坯热送基础信息
|
|
|
BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
|
|
|
-// billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
|
|
|
- LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper<>();
|
|
|
- queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
|
|
|
- HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
|
|
|
- LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+
|
|
|
+ String cacheShint = billetHotsendDetailsVo.getBilletHotsend().getShift();
|
|
|
+ String cacheShintGroup = billetHotsendDetailsVo.getBilletHotsend().getShiftGroup();
|
|
|
+
|
|
|
+ HeatsActuals heatsActuals = heatsActualsService.getOne(new LambdaQueryWrapper<HeatsActuals>()
|
|
|
+ .eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo())
|
|
|
+ .eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo()));
|
|
|
if (heatsActuals != null){
|
|
|
- queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
- .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, heatsActuals.getShift())
|
|
|
- .eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
|
|
|
- billetHotsend.setShift(heatsActuals.getShift());
|
|
|
- billetHotsend.setShiftGroup(heatsActuals.getShiftGroup());
|
|
|
- }else {
|
|
|
- queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
- .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
- .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ cacheShint = heatsActuals.getShift();
|
|
|
+ cacheShintGroup = heatsActuals.getShiftGroup();
|
|
|
}
|
|
|
+ LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(BilletHotsend::getShift, cacheShint)
|
|
|
+ .eq(BilletHotsend::getShiftGroup, cacheShintGroup);
|
|
|
BilletHotsend check = baseMapper.selectOne(queryWrapper);
|
|
|
if (oConvertUtils.isNotEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
result.put("fail", "该炉次信息已存在!");
|
|
|
return result;
|
|
|
}
|
|
|
+ billetHotsend.setShiftGroup(cacheShintGroup);
|
|
|
+ billetHotsend.setShift(cacheShint);
|
|
|
if (oConvertUtils.isEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
billetHotsend.setRollclubtwoNum(0);
|
|
|
billetHotsend.setRollcluboneNum(0);
|
|
@@ -443,6 +448,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollClubOneDetailsList.add(rollClubOneDetails);
|
|
|
});
|
|
|
rollClubOneDetailsService.saveBatch(rollClubOneDetailsList);
|
|
|
+ // 更新交班表中的热送总支数
|
|
|
+ updateShiftInfoByType(billetHotsend.getCcmNo(), billetHotsend.getShift(), billetHotsend.getShiftGroup(), rollClubOneDetailsList.size(), "roll_club_one", "hotSend");
|
|
|
}
|
|
|
|
|
|
if ("roll_club_two".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
@@ -486,6 +493,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollClubTwoDetailsList.add(rollClubTwoDetails);
|
|
|
});
|
|
|
rollClubTwoDetailsService.saveBatch(rollClubTwoDetailsList);
|
|
|
+ // 更新交班表中的热送总支数
|
|
|
+ updateShiftInfoByType(billetHotsend.getCcmNo(), billetHotsend.getShift(), billetHotsend.getShiftGroup(), rollClubTwoDetailsList.size(), "roll_club_two", "hotCharge");
|
|
|
}
|
|
|
|
|
|
if ("roll_club_three".equals(billetHotsendDetailsVo.getBelongTable())){
|
|
@@ -531,6 +540,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollClubThreeDetailsList.add(rollClubThreeDetails);
|
|
|
});
|
|
|
rollClubThreeDetailsService.saveBatch(rollClubThreeDetailsList);
|
|
|
+ updateShiftInfoByType(billetHotsend.getCcmNo(), billetHotsend.getShift(), billetHotsend.getShiftGroup(), rollClubThreeDetailsList.size(), "roll_club_three", "hotCharge");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -574,6 +584,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollHeightDetailsList.add(rollHeightDetails);
|
|
|
});
|
|
|
rollHeightDetailsService.saveBatch(rollHeightDetailsList);
|
|
|
+ // 更新交班表中的热送总支数
|
|
|
+ updateShiftInfoByType(billetHotsend.getCcmNo(), billetHotsend.getShift(), billetHotsend.getShiftGroup(), rollHeightDetailsList.size(), "roll_height", "hotSend");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -620,6 +632,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
rollOutShippDetailsList.add(rollOutShippDetails);
|
|
|
});
|
|
|
rollOutShippDetailsService.saveBatch(rollOutShippDetailsList);
|
|
|
+ updateShiftInfoByType(billetHotsend.getCcmNo(), billetHotsend.getShift(), billetHotsend.getShiftGroup(), rollOutShippDetailsList.size(), "roll_out_shipp", "hotCharge");
|
|
|
}
|
|
|
//查询并批量更新钢坯基础信息 belongTable
|
|
|
LambdaQueryWrapper<BilletBasicInfo> queryWrapperls = new LambdaQueryWrapper<BilletBasicInfo>()
|
|
@@ -662,48 +675,6 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public Integer queryEndNumByCcmNo(String ccmNo, String heatNo, String belongTable) {
|
|
|
- if ("roll_club_one".equals(belongTable)){
|
|
|
- LambdaQueryWrapper<RollClubOneDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(RollClubOneDetails::getCcmNo, ccmNo).eq(RollClubOneDetails::getHeatNo, heatNo);
|
|
|
- List<RollClubOneDetails> rollClubOneDetailsList = rollClubOneDetailsService.list(queryWrapper);
|
|
|
- if (oConvertUtils.listIsEmpty(rollClubOneDetailsList)){
|
|
|
- return 0;
|
|
|
- }
|
|
|
- RollClubOneDetails rollClubOneDetails = rollClubOneDetailsList.stream().max(Comparator.comparing(RollClubOneDetails::getEndNum)).orElse(null);
|
|
|
- return rollClubOneDetails.getEndNum();
|
|
|
- }else if ("roll_club_two".equals(belongTable)){
|
|
|
- LambdaQueryWrapper<RollClubTwoDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(RollClubTwoDetails::getCcmNo, ccmNo).eq(RollClubTwoDetails::getHeatNo, heatNo);
|
|
|
- List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapper);
|
|
|
- if (oConvertUtils.listIsEmpty(rollClubTwoDetailsList)){
|
|
|
- return 0;
|
|
|
- }
|
|
|
- RollClubTwoDetails rollClubTwoDetails = rollClubTwoDetailsList.stream().max(Comparator.comparing(RollClubTwoDetails::getEndNum)).orElse(null);
|
|
|
- return rollClubTwoDetails.getEndNum();
|
|
|
- }else if ("roll_club_three".equals(belongTable)){
|
|
|
- LambdaQueryWrapper<RollClubThreeDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(RollClubThreeDetails::getCcmNo, ccmNo).eq(RollClubThreeDetails::getHeatNo, heatNo);
|
|
|
- List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapper);
|
|
|
- if (oConvertUtils.listIsEmpty(rollClubThreeDetailsList)){
|
|
|
- return 0;
|
|
|
- }
|
|
|
- RollClubThreeDetails rollClubThreeDetails = rollClubThreeDetailsList.stream().max(Comparator.comparing(RollClubThreeDetails::getEndNum)).orElse(null);
|
|
|
- return rollClubThreeDetails.getEndNum();
|
|
|
- }else if ("roll_height".equals(belongTable)){
|
|
|
- LambdaQueryWrapper<RollHeightDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(RollHeightDetails::getCcmNo, ccmNo).eq(RollHeightDetails::getHeatNo, heatNo);
|
|
|
- List<RollHeightDetails> rollHeightDetailsList = rollHeightDetailsService.list(queryWrapper);
|
|
|
- if (oConvertUtils.listIsEmpty(rollHeightDetailsList)){
|
|
|
- return 0;
|
|
|
- }
|
|
|
- RollHeightDetails rollHeightDetails = rollHeightDetailsList.stream().max(Comparator.comparing(RollHeightDetails::getEndNum)).orElse(null);
|
|
|
- return rollHeightDetails.getEndNum();
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public void saveBilletHotsendDetailsCar(BilletHotsendDetailsVo billetHotsendDetailsVo) {
|
|
@@ -716,27 +687,28 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
BeanUtils.copyProperties(billetHotsendDetailsVo.getBilletHotsend(), billetHotsend);
|
|
|
billetHotsend.setCreateDate(new Date());
|
|
|
// billetHotsend.setAmountTotal(rollClubCommonList.size()); //总支数
|
|
|
- LambdaQueryWrapper<HeatsActuals> queryWrapperHA = new LambdaQueryWrapper();
|
|
|
- queryWrapperHA.eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo()).eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo());
|
|
|
- HeatsActuals heatsActuals = heatsActualsService.getOne(queryWrapperHA);
|
|
|
- LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+
|
|
|
+ String cacheShint = billetHotsendDetailsVo.getBilletHotsend().getShift();
|
|
|
+ String cacheShintGroup = billetHotsendDetailsVo.getBilletHotsend().getShiftGroup();
|
|
|
+
|
|
|
+ HeatsActuals heatsActuals = heatsActualsService.getOne(new LambdaQueryWrapper<HeatsActuals>()
|
|
|
+ .eq(HeatsActuals::getCasterCode, billetHotsend.getCcmNo())
|
|
|
+ .eq(HeatsActuals::getHeatsCode, billetHotsend.getHeatNo()));
|
|
|
if (heatsActuals != null){
|
|
|
- queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
- .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, heatsActuals.getShift())
|
|
|
- .eq(BilletHotsend::getShiftGroup, heatsActuals.getShiftGroup());
|
|
|
- billetHotsend.setShift(heatsActuals.getShift());
|
|
|
- billetHotsend.setShiftGroup(heatsActuals.getShiftGroup());
|
|
|
- }else {
|
|
|
- queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
- .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
- .eq(BilletHotsend::getShift, billetHotsend.getShift())
|
|
|
- .eq(BilletHotsend::getShiftGroup, billetHotsend.getShiftGroup());
|
|
|
+ cacheShint = heatsActuals.getShift();
|
|
|
+ cacheShintGroup = heatsActuals.getShiftGroup();
|
|
|
}
|
|
|
+ LambdaQueryWrapper<BilletHotsend> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletHotsend::getCcmNo, billetHotsend.getCcmNo())
|
|
|
+ .eq(BilletHotsend::getHeatNo, billetHotsend.getHeatNo())
|
|
|
+ .eq(BilletHotsend::getShift, cacheShint)
|
|
|
+ .eq(BilletHotsend::getShiftGroup, cacheShintGroup);
|
|
|
BilletHotsend check = baseMapper.selectOne(queryWrapper);
|
|
|
if (oConvertUtils.isNotEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
return;
|
|
|
}
|
|
|
+ billetHotsend.setShiftGroup(cacheShintGroup);
|
|
|
+ billetHotsend.setShift(cacheShint);
|
|
|
if (oConvertUtils.isEmpty(check) && oConvertUtils.listIsEmpty(rollClubCommonList)){
|
|
|
billetHotsend.setRollclubtwoNum(0);
|
|
|
billetHotsend.setRollcluboneNum(0);
|
|
@@ -1099,6 +1071,77 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
storageCarLog.setAmount(Integer.valueOf((int) count));// 支数
|
|
|
storageCarLog.setDataTime(new Date());
|
|
|
storageCarLogService.save(storageCarLog);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Integer queryEndNumByCcmNo(String ccmNo, String heatNo, String belongTable) {
|
|
|
+ if ("roll_club_one".equals(belongTable)){
|
|
|
+ LambdaQueryWrapper<RollClubOneDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(RollClubOneDetails::getCcmNo, ccmNo).eq(RollClubOneDetails::getHeatNo, heatNo).isNotNull(RollClubOneDetails::getEndNum);
|
|
|
+ List<RollClubOneDetails> rollClubOneDetailsList = rollClubOneDetailsService.list(queryWrapper);
|
|
|
+ if (oConvertUtils.listIsEmpty(rollClubOneDetailsList)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ RollClubOneDetails rollClubOneDetails = rollClubOneDetailsList.stream().max(Comparator.comparing(RollClubOneDetails::getEndNum)).orElse(null);
|
|
|
+ return rollClubOneDetails.getEndNum();
|
|
|
+ }else if ("roll_club_two".equals(belongTable)){
|
|
|
+ LambdaQueryWrapper<RollClubTwoDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(RollClubTwoDetails::getCcmNo, ccmNo).eq(RollClubTwoDetails::getHeatNo, heatNo).isNotNull(RollClubTwoDetails::getEndNum);
|
|
|
+ List<RollClubTwoDetails> rollClubTwoDetailsList = rollClubTwoDetailsService.list(queryWrapper);
|
|
|
+ if (oConvertUtils.listIsEmpty(rollClubTwoDetailsList)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ RollClubTwoDetails rollClubTwoDetails = rollClubTwoDetailsList.stream().max(Comparator.comparing(RollClubTwoDetails::getEndNum)).orElse(null);
|
|
|
+ return rollClubTwoDetails.getEndNum();
|
|
|
+ }else if ("roll_club_three".equals(belongTable)){
|
|
|
+ LambdaQueryWrapper<RollClubThreeDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(RollClubThreeDetails::getCcmNo, ccmNo).eq(RollClubThreeDetails::getHeatNo, heatNo).isNotNull(RollClubThreeDetails::getEndNum);
|
|
|
+ List<RollClubThreeDetails> rollClubThreeDetailsList = rollClubThreeDetailsService.list(queryWrapper);
|
|
|
+ if (oConvertUtils.listIsEmpty(rollClubThreeDetailsList)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ RollClubThreeDetails rollClubThreeDetails = rollClubThreeDetailsList.stream().max(Comparator.comparing(RollClubThreeDetails::getEndNum)).orElse(null);
|
|
|
+ return rollClubThreeDetails.getEndNum();
|
|
|
+ }else if ("roll_height".equals(belongTable)){
|
|
|
+ LambdaQueryWrapper<RollHeightDetails> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(RollHeightDetails::getCcmNo, ccmNo).eq(RollHeightDetails::getHeatNo, heatNo).isNotNull(RollHeightDetails::getEndNum);
|
|
|
+ List<RollHeightDetails> rollHeightDetailsList = rollHeightDetailsService.list(queryWrapper);
|
|
|
+ if (oConvertUtils.listIsEmpty(rollHeightDetailsList)){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ RollHeightDetails rollHeightDetails = rollHeightDetailsList.stream().max(Comparator.comparing(RollHeightDetails::getEndNum)).orElse(null);
|
|
|
+ return rollHeightDetails.getEndNum();
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据铸机号、班次、班别查询当天交班记录,并根据提供的日志列表更新相应的热送总支数
|
|
|
+ *
|
|
|
+ * @param ccmNo 铸机号
|
|
|
+ * @param cacheShint 班次信息
|
|
|
+ * @param cacheShintGroup 班别信息
|
|
|
+ * @param sum 热送总支数
|
|
|
+ */
|
|
|
+ public void updateShiftInfoByType(String ccmNo, String cacheShint, String cacheShintGroup, Integer sum, String type, String updateType) {
|
|
|
+ LambdaQueryWrapper<BilletHotsendChangeShift> queryWrapperCS = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapperCS.eq(BilletHotsendChangeShift::getCcmNo, ccmNo)
|
|
|
+ .eq(BilletHotsendChangeShift::getShift, cacheShint)
|
|
|
+ .eq(BilletHotsendChangeShift::getShiftGroup, cacheShintGroup)
|
|
|
+ .between(BilletHotsendChangeShift::getCreateTime, DateUtils.getStartOfDay(), DateUtils.getEndOfDay());
|
|
|
+ BilletHotsendChangeShift billetHotsendChangeShift = billetHotsendChangeShiftService.getOne(queryWrapperCS);
|
|
|
+ if (oConvertUtils.isNotEmpty(billetHotsendChangeShift)) {
|
|
|
+ String operationName = type.equals("hotSend")? "热送" : "热装";
|
|
|
+ log.info("{}{}", ">>>>>棒线统计当前班次" + operationName + "总支数:", sum + "班组:" + cacheShintGroup + "班次:" + cacheShint);
|
|
|
+ billetHotsendChangeShift.setUpdateTime(new Date());
|
|
|
+ if ("hotSend".equals(updateType)){
|
|
|
+ billetHotsendChangeShift.setHotsendAmount(sum);
|
|
|
+ }else{
|
|
|
+ billetHotsendChangeShift.setHotfeignAmount(sum);
|
|
|
+ }
|
|
|
+ billetHotsendChangeShiftService.updateById(billetHotsendChangeShift);
|
|
|
+ }
|
|
|
}
|
|
|
}
|