|
@@ -7,14 +7,14 @@ 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.exception.JeecgBootException;
|
|
|
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;
|
|
|
+import org.jeecg.modules.actualControl.heatsActuals.entity.HeatsActuals;
|
|
|
+import org.jeecg.modules.actualControl.heatsActuals.service.IHeatsActualsService;
|
|
|
+import org.jeecg.modules.billet.billetHotsend.entity.*;
|
|
|
import org.jeecg.modules.billet.billetHotsend.mapper.BilletHotsendBaseMapper;
|
|
|
import org.jeecg.modules.billet.billetHotsend.service.IBilletHotsendBaseService;
|
|
|
import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendChangeShift;
|
|
@@ -62,6 +62,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicLong;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -75,6 +77,9 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseMapper, BilletHotsend> implements IBilletHotsendBaseService {
|
|
|
+
|
|
|
+ private static final DateTimeFormatter DATETIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
@Autowired
|
|
|
private IOperateLogService operateLogService;
|
|
|
@Autowired
|
|
@@ -117,6 +122,8 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
private IStackingDownLogService stackingDownLogService;
|
|
|
@Autowired
|
|
|
private IBilletLiftingBillService billetLiftingBillService;
|
|
|
+ @Autowired
|
|
|
+ private IHeatsActualsService heatsActualsService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
@@ -703,6 +710,39 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
return billetHotsendTypeConfigService.getById(typeConfigId);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public FurnaceChangeData buildFurnaceChangeData(FurnaceChangeData data) {
|
|
|
+ String heatNo = data.getHeatNo(); // 炉号
|
|
|
+ if (oConvertUtils.isEmpty(heatNo)) {
|
|
|
+ throw new JeecgBootException("换炉查询失败:炉号不能为空!");
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<HeatsActuals> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(HeatsActuals::getHeatsCode, heatNo);
|
|
|
+ HeatsActuals one = heatsActualsService.getOne(queryWrapper, false);
|
|
|
+
|
|
|
+ FurnaceChangeData finalData = new FurnaceChangeData();
|
|
|
+
|
|
|
+ finalData.setHeatNo(heatNo);
|
|
|
+
|
|
|
+ if (one != null) {
|
|
|
+ finalData.setNetWeight(one.getMoltenSteelWeight() != null ? one.getMoltenSteelWeight().toString() : null);
|
|
|
+ finalData.setLadleNo(one.getLadleCode());
|
|
|
+ finalData.setGrade(one.getGrade());
|
|
|
+ finalData.setStartPourTime(formatDate(one.getStartPourTime()));
|
|
|
+ finalData.setSpec(one.getSpec());
|
|
|
+ finalData.setCcmNo(one.getCasterCode());
|
|
|
+ } else {
|
|
|
+ finalData.setNetWeight(data.getNetWeight());
|
|
|
+ finalData.setLadleNo(data.getLadleNo());
|
|
|
+ finalData.setGrade(data.getGrade());
|
|
|
+ finalData.setStartPourTime(data.getStartPourTime());
|
|
|
+ finalData.setSpec(data.getSpec());
|
|
|
+ finalData.setCcmNo(data.getCcmNo());
|
|
|
+ }
|
|
|
+
|
|
|
+ return finalData;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 通过CcmNo查询结束根
|
|
|
* @param ccmNo
|
|
@@ -753,6 +793,14 @@ public class BilletHotsendBaseServiceImpl extends ServiceImpl<BilletHotsendBaseM
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private String formatDate(Date date) {
|
|
|
+ return date != null ? date.toInstant()
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
+ .toLocalDateTime()
|
|
|
+ .format(DATETIME_FORMATTER) : null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 根据铸机号、班次、班别查询当天交班记录,并根据提供的日志列表更新相应的热送总支数
|
|
|
*
|