|
@@ -87,28 +87,39 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
|
|
|
log.info(DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + " 5号机C端自动化当前班次信息名:" + currentCacheId + "," + currentShiftName+ ","+ currentShiftGroupName);
|
|
|
|
|
|
String[] data = {
|
|
|
- "1 丙 夜", "2 甲 白", "3 乙 中", "4 丙 夜", "5 甲 白", "6 乙 中", "7 丙 夜", "8 甲 白", "9 乙 中", "10 丙 夜",
|
|
|
- "11 甲 白", "12 乙 中", "13 丁 夜", "14 丙 白", "15 甲 中", "16 丁 夜", "17 丙 白", "18 甲 中", "19 丁 夜", "20 丙 白",
|
|
|
- "21 甲 中", "22 丁 夜", "23 丙 白", "24 甲 中", "25 乙 夜", "26 丁 白", "27 丙 中", "28 乙 夜", "29 丁 白", "30 丙 中",
|
|
|
- "31 乙 夜", "32 丁 白", "33 丙 中", "34 乙 夜", "35 丁 白", "36 丙 中", "37 甲 夜", "38 乙 白", "39 丁 中", "40 甲 夜",
|
|
|
- "41 乙 白", "42 丁 中", "43 甲 夜", "44 乙 白", "45 丁 中", "46 甲 夜", "47 乙 白", "48 丁 中"
|
|
|
+ "1 丙", "2 甲", "3 乙", "4 丙", "5 甲", "6 乙", "7 丙", "8 甲", "9 乙", "10 丙",
|
|
|
+ "11 甲", "12 乙", "13 丁", "14 丙", "15 甲", "16 丁", "17 丙", "18 甲", "19 丁", "20 丙",
|
|
|
+ "21 甲", "22 丁", "23 丙", "24 甲", "25 乙", "26 丁", "27 丙", "28 乙", "29 丁", "30 丙",
|
|
|
+ "31 乙", "32 丁", "33 丙", "34 乙", "35 丁", "36 丙", "37 甲", "38 乙", "39 丁", "40 甲",
|
|
|
+ "41 乙", "42 丁", "43 甲", "44 乙", "45 丁", "46 甲", "47 乙", "48 丁"
|
|
|
};
|
|
|
|
|
|
- ShiftInfo nextShiftInfo = ScheduleUtils.findNextShift(data, Integer.valueOf(currentCacheId), currentShiftGroupName, currentShiftName);
|
|
|
- if (nextShiftInfo == null){
|
|
|
+ ShiftInfo nextShiftGroupInfo = ScheduleUtils.findNextShift(data, Integer.valueOf(currentCacheId), currentShiftGroupName);
|
|
|
+ if (nextShiftGroupInfo == null){
|
|
|
log.info("{}{}", "5号机获取到下个班组信息为空!", DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + "C端自动化交班失败!");
|
|
|
return;
|
|
|
}
|
|
|
+ // 班别名(白中夜)
|
|
|
+ String nextShiftName = "";
|
|
|
+ // 验证23:00 到01:00 之间
|
|
|
+ if (ScheduleUtils.isBetweenTime(new Date(), "07:30", "08:30")) {
|
|
|
+ nextShiftName = "白";
|
|
|
+ } else if (ScheduleUtils.isBetweenTime(new Date(), "15:30", "16:30")) {
|
|
|
+ nextShiftName = "中";
|
|
|
+ } else if (ScheduleUtils.isBetweenTime(new Date(), "23:30", "01:00")) {
|
|
|
+ nextShiftName = "夜";
|
|
|
+ }else {
|
|
|
+ log.info("{}{}", "未在交班范围内,", DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + "5号机C端自动化交班失败!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 班组名(甲乙丙丁)
|
|
|
+ String nextShiftGroupName = nextShiftGroupInfo.getShift();
|
|
|
+ // 班组值
|
|
|
+ String finalNextShiftGroupVal = ShiftGroupEnum.getCodeByName(nextShiftGroupName);
|
|
|
+ // 班别值
|
|
|
+ String finalNextShiftVal = ShiftEnum.getCodeByName(nextShiftName + "班");
|
|
|
|
|
|
- String nextShiftGroupName = nextShiftInfo.getShiftgroup();
|
|
|
-
|
|
|
- String nextShiftName = nextShiftInfo.getShift();
|
|
|
-
|
|
|
- int nextUniqueShiftId = nextShiftInfo.getId();
|
|
|
-
|
|
|
- String finalNextShiftGroupVal = ShiftGroupEnum.getCodeByName(nextShiftName);
|
|
|
-
|
|
|
- String finalNextShiftVal = ShiftEnum.getCodeByName(nextShiftGroupName + "班");;
|
|
|
+ int nextUniqueShiftId = nextShiftGroupInfo.getId();
|
|
|
|
|
|
redisTemplate.opsForValue().set(nextshiftIdKey, nextUniqueShiftId);
|
|
|
|
|
@@ -175,28 +186,40 @@ public class BilletHotsendChangeShiftServiceImpl extends ServiceImpl<BilletHotse
|
|
|
log.info(DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + " 6号机C端自动化当前班次信息名:" + currentCacheId + "," + currentShiftName+ ","+ currentShiftGroupName);
|
|
|
|
|
|
String[] data = {
|
|
|
- "1 丙 夜", "2 甲 白", "3 乙 中", "4 丙 夜", "5 甲 白", "6 乙 中", "7 丙 夜", "8 甲 白", "9 乙 中", "10 丙 夜",
|
|
|
- "11 甲 白", "12 乙 中", "13 丁 夜", "14 丙 白", "15 甲 中", "16 丁 夜", "17 丙 白", "18 甲 中", "19 丁 夜", "20 丙 白",
|
|
|
- "21 甲 中", "22 丁 夜", "23 丙 白", "24 甲 中", "25 乙 夜", "26 丁 白", "27 丙 中", "28 乙 夜", "29 丁 白", "30 丙 中",
|
|
|
- "31 乙 夜", "32 丁 白", "33 丙 中", "34 乙 夜", "35 丁 白", "36 丙 中", "37 甲 夜", "38 乙 白", "39 丁 中", "40 甲 夜",
|
|
|
- "41 乙 白", "42 丁 中", "43 甲 夜", "44 乙 白", "45 丁 中", "46 甲 夜", "47 乙 白", "48 丁 中"
|
|
|
+ "1 丙", "2 甲", "3 乙", "4 丙", "5 甲", "6 乙", "7 丙", "8 甲", "9 乙", "10 丙",
|
|
|
+ "11 甲", "12 乙", "13 丁", "14 丙", "15 甲", "16 丁", "17 丙", "18 甲", "19 丁", "20 丙",
|
|
|
+ "21 甲", "22 丁", "23 丙", "24 甲", "25 乙", "26 丁", "27 丙", "28 乙", "29 丁", "30 丙",
|
|
|
+ "31 乙", "32 丁", "33 丙", "34 乙", "35 丁", "36 丙", "37 甲", "38 乙", "39 丁", "40 甲",
|
|
|
+ "41 乙", "42 丁", "43 甲", "44 乙", "45 丁", "46 甲", "47 乙", "48 丁"
|
|
|
};
|
|
|
|
|
|
- ShiftInfo nextShiftInfo = ScheduleUtils.findNextShift(data, Integer.valueOf(currentCacheId), currentShiftGroupName, currentShiftName);
|
|
|
- if (nextShiftInfo == null){
|
|
|
+ ShiftInfo nextShiftGroupInfo = ScheduleUtils.findNextShift(data, Integer.valueOf(currentCacheId), currentShiftGroupName);
|
|
|
+ if (nextShiftGroupInfo == null){
|
|
|
log.info("{}{}", "6号机获取到下个班组信息为空!", DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + "6号机C端自动化交班失败!");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- String nextShiftGroupName = nextShiftInfo.getShiftgroup();
|
|
|
-
|
|
|
- String nextShiftName = nextShiftInfo.getShift();
|
|
|
-
|
|
|
- int nextUniqueShiftId = nextShiftInfo.getId();
|
|
|
-
|
|
|
- String finalNextShiftGroupVal = ShiftGroupEnum.getCodeByName(nextShiftName);
|
|
|
-
|
|
|
- String finalNextShiftVal = ShiftEnum.getCodeByName(nextShiftGroupName + "班");;
|
|
|
+ // 班别名
|
|
|
+ String nextShiftName = "";
|
|
|
+ // 验证23:00 到01:00 之间
|
|
|
+ if (ScheduleUtils.isBetweenTime(new Date(), "07:30", "08:30")) {
|
|
|
+ nextShiftName = "白";
|
|
|
+ } else if (ScheduleUtils.isBetweenTime(new Date(), "15:30", "16:30")) {
|
|
|
+ nextShiftName = "中";
|
|
|
+ } else if (ScheduleUtils.isBetweenTime(new Date(), "23:30", "01:00")) {
|
|
|
+ nextShiftName = "夜";
|
|
|
+ }else {
|
|
|
+ log.info("{}{}", "未在交班范围内,", DateUtils.date2Str(new Date(), DateUtils.datetimeFormat.get()) + "6号机C端自动化交班失败!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 班组名
|
|
|
+ String nextShiftGroupName = nextShiftGroupInfo.getShift();
|
|
|
+ // 班组值
|
|
|
+ String finalNextShiftGroupVal = ShiftGroupEnum.getCodeByName(nextShiftGroupName);
|
|
|
+ // 班别值
|
|
|
+ String finalNextShiftVal = ShiftEnum.getCodeByName(nextShiftName + "班");
|
|
|
+
|
|
|
+ int nextUniqueShiftId = nextShiftGroupInfo.getId();
|
|
|
|
|
|
redisTemplate.opsForValue().set(nextshiftIdKey, nextUniqueShiftId);
|
|
|
|