|
@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.entity.BilletBasicInfo;
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
|
|
import org.jeecg.modules.actualControl.billetActual.billetActual.service.IBilletBasicInfoService;
|
|
@@ -13,6 +15,8 @@ import org.jeecg.modules.billet.billetHotsendChangeShift.entity.BilletHotsendCha
|
|
import org.jeecg.modules.billet.billetHotsendChangeShift.mapper.BilletHotsendChangeShiftMapper;
|
|
import org.jeecg.modules.billet.billetHotsendChangeShift.mapper.BilletHotsendChangeShiftMapper;
|
|
import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
|
|
import org.jeecg.modules.billet.billetHotsendChangeShift.service.IBilletHotsendChangeShiftService;
|
|
import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
|
|
import org.jeecg.modules.billet.operateLog.service.IOperateLogService;
|
|
|
|
+import org.jeecg.modules.billet.shiftConfiguration.entity.ShiftConfiguration;
|
|
|
|
+import org.jeecg.modules.billet.shiftConfiguration.service.IShiftConfigurationService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -40,6 +44,8 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
|
|
@Autowired
|
|
@Autowired
|
|
private IOperateLogService operateLogService;
|
|
private IOperateLogService operateLogService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IShiftConfigurationService shiftConfigurationService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -153,7 +159,7 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
- public JSONObject autoChangeShiftHandle(BilletHotsendChangeShift billetHotsendChangeShiftVo) {
|
|
|
|
|
|
+ public JSONObject autoChangeShiftHandle(BilletHotsendChangeShift billetHotsendChangeShiftVo, String currentSixShiftGroup, String currentSixShift) {
|
|
JSONObject result = new JSONObject();
|
|
JSONObject result = new JSONObject();
|
|
// 缓存交班索引ID
|
|
// 缓存交班索引ID
|
|
String nextshiftIdKey = String.format("class:nextshift:Id:%s", "6");
|
|
String nextshiftIdKey = String.format("class:nextshift:Id:%s", "6");
|
|
@@ -246,6 +252,33 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
|
|
billetHotsendChangeShift1.setCounts(0);
|
|
billetHotsendChangeShift1.setCounts(0);
|
|
billetHotsendChangeShift1.setBlankOutputs(0d);
|
|
billetHotsendChangeShift1.setBlankOutputs(0d);
|
|
baseMapper.insert(billetHotsendChangeShift1);
|
|
baseMapper.insert(billetHotsendChangeShift1);
|
|
|
|
+ /**
|
|
|
|
+ * 6号机根据 铸机号、当班班组、当班班别 查询储运配置信息,倒序取最新的一条,把查询到的牌号、定尺、目的地、新/旧站台
|
|
|
|
+ * 带到下一个班组中,生成一个新的储运配置信息,并保存到数据库中。
|
|
|
|
+ */
|
|
|
|
+ LambdaQueryWrapper<ShiftConfiguration> queryWrapper = new LambdaQueryWrapper<ShiftConfiguration>();
|
|
|
|
+ queryWrapper.eq(ShiftConfiguration::getCcmNo, "6")
|
|
|
|
+ .eq(ShiftConfiguration::getShiftGroup, currentSixShiftGroup)
|
|
|
|
+ .eq(ShiftConfiguration::getShift, currentSixShift)
|
|
|
|
+ .orderByDesc(ShiftConfiguration::getCreateTime)
|
|
|
|
+ .last("limit 1");
|
|
|
|
+ ShiftConfiguration shiftConfiguration = shiftConfigurationService.getOne(queryWrapper);
|
|
|
|
+ if (shiftConfiguration != null){
|
|
|
|
+ // 生出储运配置信息
|
|
|
|
+ ShiftConfiguration newShiftConfiguration = new ShiftConfiguration();
|
|
|
|
+ newShiftConfiguration.setId(String.valueOf(IdWorker.getId()));
|
|
|
|
+ newShiftConfiguration.setCcmNo(ccmNo);
|
|
|
|
+ newShiftConfiguration.setShiftGroup(billetHotsendChangeShiftVo.getShiftGroup());
|
|
|
|
+ newShiftConfiguration.setShift(billetHotsendChangeShiftVo.getShift());
|
|
|
|
+ newShiftConfiguration.setSteelGrade(shiftConfiguration.getSteelGrade());
|
|
|
|
+ newShiftConfiguration.setSpec(shiftConfiguration.getSpec());
|
|
|
|
+ newShiftConfiguration.setDestination(shiftConfiguration.getDestination());
|
|
|
|
+ newShiftConfiguration.setNewOldPlatform(shiftConfiguration.getNewOldPlatform());
|
|
|
|
+ newShiftConfiguration.setCreateTime(new Date());
|
|
|
|
+ newShiftConfiguration.setDate(DateUtils.getDateWithOnlyYearMonthDay(new Date()));
|
|
|
|
+ shiftConfigurationService.save(newShiftConfiguration);
|
|
|
|
+ log.info("{}{}", "6号机生成储运配置:", JSON.toJSON(newShiftConfiguration));
|
|
|
|
+ }
|
|
result.put("success", "自动化交班操作成功!");
|
|
result.put("success", "自动化交班操作成功!");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("自动化交班操作出现异常", e);
|
|
log.error("自动化交班操作出现异常", e);
|
|
@@ -263,7 +296,6 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 计算余数并提取相应元素
|
|
* 计算余数并提取相应元素
|
|
* @param billetBasicInfoList
|
|
* @param billetBasicInfoList
|