|
@@ -41,6 +41,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import tk.mybatis.mapper.weekend.Weekend;
|
|
|
import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
|
|
|
+import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.DayOfWeek;
|
|
|
import java.time.LocalDate;
|
|
@@ -455,7 +456,6 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
checkJob.setCheckUserId(sbInfo.getRepairUser());
|
|
|
standard.setCheckUserType(CheckUserTypeEnum.REPAIR_USER.getValue());
|
|
|
}
|
|
|
- updateStandardList.add(standard);
|
|
|
}else{
|
|
|
if(standard.getCheckUserType().equals(CheckUserTypeEnum.USE_USER.getValue())){
|
|
|
checkJob.setCheckUserId(sbInfo.getSaveUser());
|
|
@@ -477,6 +477,10 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
checkJob.setRequirement(standard.getRequirement());
|
|
|
checkJob.setRemark(standard.getRemark());
|
|
|
checkJob.setName(standard.getName());
|
|
|
+ if(standard.getLastDate() == null){
|
|
|
+ standard.setLastDate(currentDate.toLocalDate());
|
|
|
+ }
|
|
|
+ updateStandardList.add(standard);
|
|
|
jobList.add(checkJob);
|
|
|
}
|
|
|
}
|
|
@@ -943,6 +947,17 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
this.saveFile(dto);
|
|
|
|
|
|
// 非台时和公里,则需要生成下一次的任务
|
|
|
+ List<Integer> statusList = new ArrayList<Integer>();
|
|
|
+ statusList.add(CheckJobStatusEnum.NOT_EXECUTE.getValue());
|
|
|
+ statusList.add(CheckJobStatusEnum.EXECUTING.getValue());
|
|
|
+ statusList.add(CheckJobStatusEnum.OUT_OF_DATE.getValue());
|
|
|
+ Weekend<CheckJob> weekend = new Weekend<>(CheckJob.class);
|
|
|
+ WeekendCriteria<CheckJob, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
+ weekendCriteria.andEqualTo(CheckJob::getStandardId, checkJob.getStandardId()).andIn(CheckJob::getStatus, statusList);
|
|
|
+ int count = mapper.selectCountByExample(weekend);
|
|
|
+ if(count != 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
CheckStandard checkStandard = standardMapper.selectByPrimaryKey(checkJob.getStandardId());
|
|
|
CheckJob nextCheckJob = new CheckJob();
|
|
|
if(!CheckPlanPeriodTypeEnum.MILES.getValue().equals(checkStandard.getPeriodType()) && !CheckPlanPeriodTypeEnum.TAISHI.getValue().equals(checkStandard.getPeriodType()) ){
|
|
@@ -1030,7 +1045,19 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
// 提交完成图片信息
|
|
|
this.saveFile(dto);
|
|
|
|
|
|
- // 非台时和公里,则需要生成下一次的任务
|
|
|
+ // 非台时和公里,则需要生成下一次的任务:判断是否已经存在了,不存在才能生成
|
|
|
+ List<Integer> statusList = new ArrayList<Integer>();
|
|
|
+ statusList.add(CheckJobStatusEnum.NOT_EXECUTE.getValue());
|
|
|
+ statusList.add(CheckJobStatusEnum.EXECUTING.getValue());
|
|
|
+ statusList.add(CheckJobStatusEnum.OUT_OF_DATE.getValue());
|
|
|
+ Weekend<CheckJob> weekend = new Weekend<>(CheckJob.class);
|
|
|
+ WeekendCriteria<CheckJob, Object> weekendCriteria = weekend.weekendCriteria();
|
|
|
+ weekendCriteria.andEqualTo(CheckJob::getStandardId, checkJob.getStandardId()).andIn(CheckJob::getStatus, statusList);
|
|
|
+ int count = mapper.selectCountByExample(weekend);
|
|
|
+ if(count != 0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
CheckStandard checkStandard = standardMapper.selectByPrimaryKey(checkJob.getStandardId());
|
|
|
CheckJob nextCheckJob = new CheckJob();
|
|
|
if(!CheckPlanPeriodTypeEnum.MILES.getValue().equals(checkStandard.getPeriodType()) && !CheckPlanPeriodTypeEnum.TAISHI.getValue().equals(checkStandard.getPeriodType()) ){
|
|
@@ -1081,6 +1108,17 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) throws IOException {
|
|
|
+ FileInputStream inputStream = new FileInputStream("C:\\Users\\cyz\\Desktop\\需要被删除的id.txt");
|
|
|
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
|
|
|
+
|
|
|
+ String str = null;
|
|
|
+ while((str = bufferedReader.readLine()) != null)
|
|
|
+ {
|
|
|
+ System.out.println(str+"',");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询任务
|
|
|
* 未登录查询当日任务
|
|
@@ -1169,9 +1207,6 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
List<SysFile> repairFileList = model.getImgList();
|
|
|
List<SysFile> list = ListUtils.newArrayList();
|
|
|
if (CollectionUtil.isNotEmpty(repairFileList)) {
|
|
|
- Weekend<SysFile> weekend = new Weekend<>(SysFile.class);
|
|
|
- weekend.weekendCriteria().andEqualTo(SysFile::getTargetId, model.getId());
|
|
|
- sysFileMapper.deleteByExample(weekend);
|
|
|
repairFileList.forEach(item -> {
|
|
|
item.setType(SysFileTypeEnum.CHECK_JOB_FILES.getValue());
|
|
|
item.setId(IdGeneratorUtils.getObjectId());
|