|
@@ -314,6 +314,11 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成设备的保养任务
|
|
|
+ *
|
|
|
+ * @param checkType 检查类型:
|
|
|
+ */
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void genTaskBySbId(int checkType) {
|
|
@@ -335,6 +340,10 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
Weekend<CheckJob> weekend = new Weekend<>(CheckJob.class);
|
|
|
weekend.weekendCriteria().andNotEqualTo(CheckJob::getStatus, CheckJobStatusEnum.FINISHED.getValue());
|
|
|
List<CheckJob> checkJobs = mapper.selectByExample(weekend);
|
|
|
+
|
|
|
+ // 针对没有设置指定人方式的,要更新
|
|
|
+
|
|
|
+ List<CheckStandard> updateStandardList = new ArrayList<CheckStandard>();
|
|
|
for(CheckStandard standard: standardList){
|
|
|
if(!CheckPlanPeriodTypeEnum.MILES.getValue().equals(standard.getPeriodType()) && !CheckPlanPeriodTypeEnum.TAISHI.getValue().equals(standard.getPeriodType()) ){
|
|
|
boolean find = false;
|
|
@@ -350,9 +359,12 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
if(standard.getCheckUserType() == null){
|
|
|
if(standard.getPeriodType()< CheckPlanPeriodTypeEnum.WEEK.getValue()){
|
|
|
checkJob.setCheckUserId(sbInfo.getSaveUser());
|
|
|
+ standard.setCheckUserType(CheckUserTypeEnum.USE_USER.getValue());
|
|
|
}else{
|
|
|
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());
|
|
@@ -381,6 +393,10 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
|
if (!CollectionUtils.isEmpty(jobList)) {
|
|
|
mapper.insertListforComplex(jobList);
|
|
|
}
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(updateStandardList)) {
|
|
|
+ standardMapper.updataBatch(updateStandardList);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|