|
@@ -2,6 +2,7 @@ package org.jeecg.modules.billet.billetHotsend.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -10,6 +11,7 @@ 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;
|
|
|
+import org.jeecg.modules.billet.billetHotsend.entity.BilletBasicInfoDetails;
|
|
|
import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsend;
|
|
|
import org.jeecg.modules.billet.billetHotsend.entity.BilletHotsendDetailsVo;
|
|
|
import org.jeecg.modules.billet.billetHotsend.entity.RollClubCommon;
|
|
@@ -19,6 +21,8 @@ import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendCha
|
|
|
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.billetLiftingBill.entity.BilletLiftingBill;
|
|
|
+import org.jeecg.modules.billet.billetLiftingBill.service.IBilletLiftingBillService;
|
|
|
import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
|
|
|
import org.jeecg.modules.billet.rollClubOne.entity.RollClubOne;
|
|
|
import org.jeecg.modules.billet.rollClubOne.entity.RollClubOneDetails;
|
|
@@ -40,6 +44,10 @@ 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.stackingAndLoadingVehicles.entity.StackingDownLog;
|
|
|
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.entity.StackingUpLog;
|
|
|
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingDownLogService;
|
|
|
+import org.jeecg.modules.billet.stackingAndLoadingVehicles.service.IStackingUpLogService;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.ShiftEnum;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.ShiftGroupEnum;
|
|
|
import org.jeecg.modules.billet.storageBill.entity.StorageBill;
|
|
@@ -102,6 +110,12 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
private IBilletHotsendChangeShiftService billetHotsendChangeShiftService;
|
|
|
@Autowired
|
|
|
public RedisTemplate redisTemplate;
|
|
|
+ @Autowired
|
|
|
+ private IStackingUpLogService stackingUpLogService;
|
|
|
+ @Autowired
|
|
|
+ private IStackingDownLogService stackingDownLogService;
|
|
|
+ @Autowired
|
|
|
+ private IBilletLiftingBillService billetLiftingBillService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -398,6 +412,229 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<BilletBasicInfoDetails> queryBilletInfoByBilletNo(String billetNo) {
|
|
|
+ List<BilletBasicInfoDetails> billetBasicInfoDetailsList = new ArrayList<>();
|
|
|
+ // 通过坯号查询钢坯基础信息
|
|
|
+ LambdaQueryWrapper<BilletBasicInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(BilletBasicInfo::getBilletNo, billetNo);
|
|
|
+ BilletBasicInfo billetBasicInfo = billetBasicInfoService.getOne(queryWrapper);
|
|
|
+ if (oConvertUtils.isEmpty(billetBasicInfo) || oConvertUtils.isEmpty(billetBasicInfo.getBhtcId())){
|
|
|
+ return billetBasicInfoDetailsList;
|
|
|
+ }
|
|
|
+ BilletBasicInfoDetails billetBasicInfoDetails = new BilletBasicInfoDetails();
|
|
|
+ billetBasicInfoDetails.setCcmNo(billetBasicInfo.getCcmNo().toString());
|
|
|
+ billetBasicInfoDetails.setBilletNo(billetNo);
|
|
|
+ billetBasicInfoDetails.setHeatNo(billetBasicInfo.getHeatNo());
|
|
|
+ billetBasicInfoDetails.setShift(ShiftEnum.fromCode(billetBasicInfo.getShift()).name());
|
|
|
+ billetBasicInfoDetails.setShiftGroup(ShiftGroupEnum.fromCode(billetBasicInfo.getShiftGroup()).name());
|
|
|
+ if ("roll_club_one".equals(billetBasicInfo.getBelongTable())){
|
|
|
+ billetBasicInfoDetails.setBelongType("直轧");
|
|
|
+ billetBasicInfoDetails.setLicensePlate("辊道");
|
|
|
+ billetBasicInfoDetails.setDestination("5号机棒一");
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+ }else if ("roll_club_two".equals(billetBasicInfo.getBelongTable())){
|
|
|
+ QueryWrapper<RollClubTwoDetails> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ RollClubTwoDetails rollClubTwoDetails = rollClubTwoDetailsService.getOne(queryWrapper1, false);
|
|
|
+ if (rollClubTwoDetails != null) {
|
|
|
+ StorageBill storageBill = storageBillService.getOne(new LambdaQueryWrapper<StorageBill>()
|
|
|
+ .eq(StorageBill::getId, rollClubTwoDetails.getStorageBillId()));
|
|
|
+ if (storageBill != null && oConvertUtils.isNotEmpty(rollClubTwoDetails.getStartNum())){
|
|
|
+ // 棒线、通过装运单ID查询装运信息
|
|
|
+ billetBasicInfoDetails.setBelongType("车运");
|
|
|
+ billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetBasicInfoDetails.setDestination(storageBill.getDestination());
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
|
|
|
+ billetBasicInfoDetails.setLoadCarTime(storageBill.getUpdateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
|
|
|
+ billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
|
|
|
+ }
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+ }else {
|
|
|
+ // 堆垛、通过装运单ID查询装运信息
|
|
|
+ billetBasicInfoDetails.setBelongType("堆垛");
|
|
|
+ billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetBasicInfoDetails.setDestination(storageBill.getDestination());
|
|
|
+ // 查询起跺信息
|
|
|
+ QueryWrapper<StackingUpLog> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ StackingUpLog stackingUpLog = stackingUpLogService.getOne(queryWrapper2, false);
|
|
|
+ if (stackingUpLog != null){
|
|
|
+ billetBasicInfoDetails.setStackingUpTime(stackingUpLog.getCreateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
|
|
|
+ billetBasicInfoDetails.setLoadCarTime(rollClubTwoDetails.getCreateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
|
|
|
+ billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
|
|
|
+ }
|
|
|
+ billetBasicInfoDetails.setStackingDownTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+
|
|
|
+ // 查询下跺信息
|
|
|
+ QueryWrapper<StackingDownLog> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ StackingDownLog stackingDownLog = stackingDownLogService.getOne(queryWrapper3, false);
|
|
|
+ if (stackingDownLog != null){
|
|
|
+ BilletBasicInfoDetails billetBasicInfoDetails1 = new BilletBasicInfoDetails();
|
|
|
+ BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails1);
|
|
|
+ billetBasicInfoDetails1.setStackingDownTime(stackingDownLog.getCreateTime());
|
|
|
+ billetBasicInfoDetails1.setStackingUpTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if ("roll_club_three".equals(billetBasicInfo.getBelongTable())){
|
|
|
+ QueryWrapper<RollClubThreeDetails> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ RollClubThreeDetails rollClubThreeDetails = rollClubThreeDetailsService.getOne(queryWrapper1, false);
|
|
|
+ if (rollClubThreeDetails != null) {
|
|
|
+ StorageBill storageBill = storageBillService.getOne(new LambdaQueryWrapper<StorageBill>()
|
|
|
+ .eq(StorageBill::getId, rollClubThreeDetails.getStorageBillId()));
|
|
|
+ if (storageBill != null && oConvertUtils.isNotEmpty(rollClubThreeDetails.getStartNum())){
|
|
|
+ // 棒线、通过装运单ID查询装运信息
|
|
|
+ billetBasicInfoDetails.setBelongType("车运");
|
|
|
+ billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetBasicInfoDetails.setDestination(storageBill.getDestination());
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
|
|
|
+ billetBasicInfoDetails.setLoadCarTime(storageBill.getUpdateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
|
|
|
+ billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
|
|
|
+ }
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+ }else {
|
|
|
+ // 堆垛、通过装运单ID查询装运信息
|
|
|
+ billetBasicInfoDetails.setBelongType("堆垛");
|
|
|
+ billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetBasicInfoDetails.setDestination(storageBill.getDestination());
|
|
|
+ // 查询起跺信息
|
|
|
+ QueryWrapper<StackingUpLog> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ StackingUpLog stackingUpLog = stackingUpLogService.getOne(queryWrapper2, false);
|
|
|
+ if (stackingUpLog != null){
|
|
|
+ billetBasicInfoDetails.setStackingUpTime(stackingUpLog.getCreateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
|
|
|
+ billetBasicInfoDetails.setLoadCarTime(rollClubThreeDetails.getCreateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
|
|
|
+ billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
|
|
|
+ }
|
|
|
+ billetBasicInfoDetails.setStackingDownTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+
|
|
|
+ // 查询下跺信息
|
|
|
+ QueryWrapper<StackingDownLog> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ StackingDownLog stackingDownLog = stackingDownLogService.getOne(queryWrapper3, false);
|
|
|
+ if (stackingDownLog != null){
|
|
|
+ BilletBasicInfoDetails billetBasicInfoDetails1 = new BilletBasicInfoDetails();
|
|
|
+ BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails1);
|
|
|
+ billetBasicInfoDetails1.setStackingDownTime(stackingDownLog.getCreateTime());
|
|
|
+ billetBasicInfoDetails1.setStackingUpTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if ("roll_out_shipp".equals(billetBasicInfo.getBelongTable())){
|
|
|
+ QueryWrapper<RollOutShippDetails> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ RollOutShippDetails rollOutShippDetails = rollOutShippDetailsService.getOne(queryWrapper1, false);
|
|
|
+ if (rollOutShippDetails != null) {
|
|
|
+ StorageBill storageBill = storageBillService.getOne(new LambdaQueryWrapper<StorageBill>()
|
|
|
+ .eq(StorageBill::getId, rollOutShippDetails.getStorageBillId()));
|
|
|
+ if (storageBill != null && oConvertUtils.isNotEmpty(rollOutShippDetails.getStartNum())){
|
|
|
+ // 棒线、通过装运单ID查询装运信息
|
|
|
+ billetBasicInfoDetails.setBelongType("车运");
|
|
|
+ billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetBasicInfoDetails.setDestination(storageBill.getDestination());
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
|
|
|
+ billetBasicInfoDetails.setLoadCarTime(storageBill.getUpdateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
|
|
|
+ billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
|
|
|
+ }
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+ }else {
|
|
|
+ // 堆垛、通过装运单ID查询装运信息
|
|
|
+ billetBasicInfoDetails.setBelongType("堆垛");
|
|
|
+ billetBasicInfoDetails.setLicensePlate(storageBill.getLicensePlate());
|
|
|
+ billetBasicInfoDetails.setDestination(storageBill.getDestination());
|
|
|
+ // 查询起跺信息
|
|
|
+ QueryWrapper<StackingUpLog> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ StackingUpLog stackingUpLog = stackingUpLogService.getOne(queryWrapper2, false);
|
|
|
+ if (stackingUpLog != null){
|
|
|
+ billetBasicInfoDetails.setStackingUpTime(stackingUpLog.getCreateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getUpdateTime())){
|
|
|
+ billetBasicInfoDetails.setLoadCarTime(rollOutShippDetails.getCreateTime());
|
|
|
+ }
|
|
|
+ if (oConvertUtils.isNotEmpty(storageBill.getOutTime())){
|
|
|
+ billetBasicInfoDetails.setOutCarTime(storageBill.getOutTime());
|
|
|
+ }
|
|
|
+ billetBasicInfoDetails.setStackingDownTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+
|
|
|
+ // 查询下跺信息
|
|
|
+ QueryWrapper<StackingDownLog> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("billet_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billet_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ StackingDownLog stackingDownLog = stackingDownLogService.getOne(queryWrapper3, false);
|
|
|
+ if (stackingDownLog != null){
|
|
|
+ BilletBasicInfoDetails billetBasicInfoDetails1 = new BilletBasicInfoDetails();
|
|
|
+ BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails1);
|
|
|
+ billetBasicInfoDetails1.setStackingDownTime(stackingDownLog.getCreateTime());
|
|
|
+ billetBasicInfoDetails.setStackingUpTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if ("roll_height".equals(billetBasicInfo.getBelongTable())){
|
|
|
+ billetBasicInfoDetails.setBelongType("高线");
|
|
|
+ billetBasicInfoDetails.setLicensePlate("辊道");
|
|
|
+ billetBasicInfoDetails.setDestination("6号机高线");
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails);
|
|
|
+ }
|
|
|
+ // 获取吊运单信息
|
|
|
+ QueryWrapper<BilletLiftingBill> queryWrapper5 = new QueryWrapper<>();
|
|
|
+ queryWrapper5.eq("billets_no", billetNo)
|
|
|
+ .or()
|
|
|
+ .apply("CONCAT(',', billets_no, ',') LIKE CONCAT('%,', {0}, ',%')", billetNo);
|
|
|
+ BilletLiftingBill billetLiftingBill = billetLiftingBillService.getOne(queryWrapper5, false);
|
|
|
+ if (billetLiftingBill != null){
|
|
|
+ BilletBasicInfoDetails billetBasicInfoDetails2 = new BilletBasicInfoDetails();
|
|
|
+ BeanUtils.copyProperties(billetBasicInfoDetails, billetBasicInfoDetails2);
|
|
|
+ billetBasicInfoDetails2.setLiftingTime(billetLiftingBill.getLiftingTime());
|
|
|
+ billetBasicInfoDetails2.setStackingDownTime(null);
|
|
|
+ billetBasicInfoDetails2.setStackingUpTime(null);
|
|
|
+ billetBasicInfoDetails2.setOutCarTime(null);
|
|
|
+ billetBasicInfoDetails2.setLoadCarTime(null);
|
|
|
+ billetBasicInfoDetailsList.add(billetBasicInfoDetails2);
|
|
|
+ }
|
|
|
+ return billetBasicInfoDetailsList;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 通过CcmNo查询结束根
|
|
|
* @param ccmNo
|
|
@@ -883,7 +1120,7 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
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() ;
|
|
|
+ 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;
|
|
|
}
|