|
|
@@ -88,7 +88,7 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = StringUtils.isBlank(effectiveTime) ? SuperDateUtils.getYYYYMMDD() : effectiveTime;
|
|
|
List<String> adjacentDatesYearDay = SuperDateUtils.getAdjacentDatesYearDay(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ "9999-12-31",
|
|
|
frequency,
|
|
|
Integer.parseInt(timePoint),
|
|
|
10);
|
|
|
@@ -100,7 +100,7 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = StringUtils.isBlank(effectiveTime) ? SuperDateUtils.getYYYYMMDD() : effectiveTime;
|
|
|
List<String> adjacentDatesMonthDay = SuperDateUtils.getAdjacentDatesMonthDay(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ "9999-12-31",
|
|
|
frequency,
|
|
|
Integer.parseInt(timePoint),
|
|
|
10);
|
|
|
@@ -112,7 +112,7 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = StringUtils.isBlank(effectiveTime) ? SuperDateUtils.getYYYYMMDD() : effectiveTime;
|
|
|
List<String> adjacentDatesByWeekday = SuperDateUtils.getAdjacentDatesByWeekday(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ "9999-12-31",
|
|
|
frequency,
|
|
|
timePoint,
|
|
|
10);
|
|
|
@@ -124,7 +124,7 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = StringUtils.isBlank(effectiveTime) ? SuperDateUtils.getYYYYMMDD() : effectiveTime;
|
|
|
List<String> adjacentDatesByDay = SuperDateUtils.getAdjacentDatesByDay(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ "9999-12-31",
|
|
|
frequency,
|
|
|
10);
|
|
|
strings.addAll(adjacentDatesByDay);
|
|
|
@@ -146,16 +146,28 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
// sop数据
|
|
|
SopRespVO sopDetailById = sopService.getSopDetailById(bean.getSopId());
|
|
|
ArrayList<SopPreviewDataVO> sopRespVOS = new ArrayList<>();
|
|
|
+ Integer count = 10;
|
|
|
+ String endDateStr = "9999-12-31";
|
|
|
+ if (StringUtils.isNotBlank(bean.getEndType()) && (bean.getEndType().equals("0") || bean.getEndType().equals("1"))) {
|
|
|
+ // 如果是时间截至和永不截至
|
|
|
+ count = 10;
|
|
|
+ endDateStr = bean.getEndValue();
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(bean.getEndType()) && bean.getEndType().equals("2")) {
|
|
|
+ // 如果是时间截至和永不截至
|
|
|
+ count = Integer.valueOf(bean.getEndValue());
|
|
|
+ endDateStr = "9999-12-31";
|
|
|
+ }
|
|
|
// 年
|
|
|
if (bean.getFrequencyUnit().equals(0)) {
|
|
|
// 处理年的数据
|
|
|
String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
List<String> adjacentDatesYearDay = SuperDateUtils.getAdjacentDatesYearDay(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ endDateStr,
|
|
|
bean.getFrequency(),
|
|
|
Integer.parseInt(bean.getTimePoint()),
|
|
|
- 10);
|
|
|
+ count);
|
|
|
for (String s : adjacentDatesYearDay) {
|
|
|
SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
sopPreviewDataVO.setPlanDay(s);
|
|
|
@@ -174,10 +186,10 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
List<String> adjacentDatesMonthDay = SuperDateUtils.getAdjacentDatesMonthDay(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ endDateStr,
|
|
|
bean.getFrequency(),
|
|
|
Integer.parseInt(bean.getTimePoint()),
|
|
|
- 10);
|
|
|
+ count);
|
|
|
for (String s : adjacentDatesMonthDay) {
|
|
|
SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
sopPreviewDataVO.setPlanDay(s);
|
|
|
@@ -196,10 +208,10 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
List<String> adjacentDatesByWeekday = SuperDateUtils.getAdjacentDatesByWeekday(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ endDateStr,
|
|
|
bean.getFrequency(),
|
|
|
bean.getTimePoint(),
|
|
|
- 10);
|
|
|
+ count);
|
|
|
for (String s : adjacentDatesByWeekday) {
|
|
|
SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
sopPreviewDataVO.setPlanDay(s);
|
|
|
@@ -218,9 +230,9 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
List<String> adjacentDatesByDay = SuperDateUtils.getAdjacentDatesByDay(
|
|
|
yyyymmdd,
|
|
|
- null,
|
|
|
+ endDateStr,
|
|
|
bean.getFrequency(),
|
|
|
- 10);
|
|
|
+ count);
|
|
|
for (String s : adjacentDatesByDay) {
|
|
|
SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
sopPreviewDataVO.setPlanDay(s);
|
|
|
@@ -248,98 +260,7 @@ public class SopExecutionPlanServiceImpl extends ServiceImpl<SopExecutionPlanMap
|
|
|
if (sopExecutionPlanDO == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- SopExecutionPlanRespVO bean = BeanUtils.toBean(sopExecutionPlanDO, SopExecutionPlanRespVO.class);
|
|
|
- // sop数据
|
|
|
- SopRespVO sopDetailById = sopService.getSopDetailById(bean.getSopId());
|
|
|
- ArrayList<SopPreviewDataVO> sopRespVOS = new ArrayList<>();
|
|
|
- // 年
|
|
|
- if (bean.getFrequencyUnit().equals(0)) {
|
|
|
- // 处理年的数据
|
|
|
- String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
- List<String> adjacentDatesYearDay = SuperDateUtils.getAdjacentDatesYearDay(
|
|
|
- yyyymmdd,
|
|
|
- sopExecutionPlanDO.getEndValue(),
|
|
|
- bean.getFrequency(),
|
|
|
- Integer.parseInt(bean.getTimePoint()),
|
|
|
- 10);
|
|
|
- for (String s : adjacentDatesYearDay) {
|
|
|
- SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
- sopPreviewDataVO.setPlanDay(s);
|
|
|
- sopPreviewDataVO.setStartTime(bean.getStartTime());
|
|
|
- sopPreviewDataVO.setDuration(bean.getDuration());
|
|
|
- sopPreviewDataVO.setWorkstationName(sopDetailById.getWorkstationName());
|
|
|
- sopPreviewDataVO.setMachineryName(sopDetailById.getMachineryName());
|
|
|
- sopPreviewDataVO.setSopTypeName(sopDetailById.getSopTypeName());
|
|
|
- sopRespVOS.add(sopPreviewDataVO);
|
|
|
- }
|
|
|
- bean.setPreviewDataList(sopRespVOS);
|
|
|
- }
|
|
|
- // 月
|
|
|
- if (bean.getFrequencyUnit().equals(1)) {
|
|
|
- // 处理月的数据
|
|
|
- String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
- List<String> adjacentDatesMonthDay = SuperDateUtils.getAdjacentDatesMonthDay(
|
|
|
- yyyymmdd,
|
|
|
- sopExecutionPlanDO.getEndValue(),
|
|
|
- bean.getFrequency(),
|
|
|
- Integer.parseInt(bean.getTimePoint()),
|
|
|
- 10);
|
|
|
- for (String s : adjacentDatesMonthDay) {
|
|
|
- SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
- sopPreviewDataVO.setPlanDay(s);
|
|
|
- sopPreviewDataVO.setStartTime(bean.getStartTime());
|
|
|
- sopPreviewDataVO.setDuration(bean.getDuration());
|
|
|
- sopPreviewDataVO.setWorkstationName(sopDetailById.getWorkstationName());
|
|
|
- sopPreviewDataVO.setMachineryName(sopDetailById.getMachineryName());
|
|
|
- sopPreviewDataVO.setSopTypeName(sopDetailById.getSopTypeName());
|
|
|
- sopRespVOS.add(sopPreviewDataVO);
|
|
|
- }
|
|
|
- bean.setPreviewDataList(sopRespVOS);
|
|
|
- }
|
|
|
- // 周
|
|
|
- if (bean.getFrequencyUnit().equals(2)) {
|
|
|
- // 处理周的数据
|
|
|
- String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
- List<String> adjacentDatesByWeekday = SuperDateUtils.getAdjacentDatesByWeekday(
|
|
|
- yyyymmdd,
|
|
|
- bean.getEndValue(),
|
|
|
- bean.getFrequency(),
|
|
|
- bean.getTimePoint(),
|
|
|
- 10);
|
|
|
- for (String s : adjacentDatesByWeekday) {
|
|
|
- SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
- sopPreviewDataVO.setPlanDay(s);
|
|
|
- sopPreviewDataVO.setStartTime(bean.getStartTime());
|
|
|
- sopPreviewDataVO.setDuration(bean.getDuration());
|
|
|
- sopPreviewDataVO.setWorkstationName(sopDetailById.getWorkstationName());
|
|
|
- sopPreviewDataVO.setMachineryName(sopDetailById.getMachineryName());
|
|
|
- sopPreviewDataVO.setSopTypeName(sopDetailById.getSopTypeName());
|
|
|
- sopRespVOS.add(sopPreviewDataVO);
|
|
|
- }
|
|
|
- bean.setPreviewDataList(sopRespVOS);
|
|
|
- }
|
|
|
- // 天
|
|
|
- if (bean.getFrequencyUnit().equals(3)) {
|
|
|
- // 处理天的数据
|
|
|
- String yyyymmdd = SuperDateUtils.getYYYYMMDD();
|
|
|
- List<String> adjacentDatesByDay = SuperDateUtils.getAdjacentDatesByDay(
|
|
|
- yyyymmdd,
|
|
|
- sopExecutionPlanDO.getEndValue(),
|
|
|
- bean.getFrequency(),
|
|
|
- 10);
|
|
|
- for (String s : adjacentDatesByDay) {
|
|
|
- SopPreviewDataVO sopPreviewDataVO = new SopPreviewDataVO();
|
|
|
- sopPreviewDataVO.setPlanDay(s);
|
|
|
- sopPreviewDataVO.setStartTime(bean.getStartTime());
|
|
|
- sopPreviewDataVO.setDuration(bean.getDuration());
|
|
|
- sopPreviewDataVO.setWorkstationName(sopDetailById.getWorkstationName());
|
|
|
- sopPreviewDataVO.setMachineryName(sopDetailById.getMachineryName());
|
|
|
- sopPreviewDataVO.setSopTypeName(sopDetailById.getSopTypeName());
|
|
|
- sopRespVOS.add(sopPreviewDataVO);
|
|
|
- }
|
|
|
- bean.setPreviewDataList(sopRespVOS);
|
|
|
- }
|
|
|
- return bean;
|
|
|
+ return getSopExecutionPlan(sopExecutionPlanDO.getId());
|
|
|
}
|
|
|
|
|
|
@Override
|