|
@@ -885,22 +885,9 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
if (!sbInfo.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
if (!sbInfo.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue())) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ setCheckUserId(standard, sbInfo, checkJob);
|
|
if (standard.getCheckUserType() == null) {
|
|
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());
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (standard.getCheckUserType().equals(CheckUserTypeEnum.USE_USER.getValue())) {
|
|
|
|
- checkJob.setCheckUserId(sbInfo.getSaveUser());
|
|
|
|
- } else if (standard.getCheckUserType().equals(CheckUserTypeEnum.REPAIR_USER.getValue())) {
|
|
|
|
- checkJob.setCheckUserId(sbInfo.getRepairUser());
|
|
|
|
- } else if (standard.getCheckUserType().equals(CheckUserTypeEnum.ZHIDING.getValue())) {
|
|
|
|
- checkJob.setCheckUserId(sbInfo.getRepairUser());
|
|
|
|
- }
|
|
|
|
|
|
+ standard.setCheckUserType(CheckUserTypeEnum.REPAIR_USER.getValue());
|
|
}
|
|
}
|
|
checkJob.setStandardHours(standard.getStandardHours());
|
|
checkJob.setStandardHours(standard.getStandardHours());
|
|
checkJob.setStatus(CheckJobStatusEnum.NOT_EXECUTE.getValue());
|
|
checkJob.setStatus(CheckJobStatusEnum.NOT_EXECUTE.getValue());
|
|
@@ -932,6 +919,19 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void setCheckUserId(CheckStandard standard, SbInfo sbInfo, CheckJob checkJob){
|
|
|
|
+ if (standard.getCheckUserType() == null) {
|
|
|
|
+ checkJob.setCheckUserId(sbInfo.getRepairUser());
|
|
|
|
+ } else {
|
|
|
|
+ if (standard.getCheckUserType().equals(CheckUserTypeEnum.USE_USER.getValue())) {
|
|
|
|
+ checkJob.setCheckUserId(sbInfo.getSaveUser());
|
|
|
|
+ } else if (standard.getCheckUserType().equals(CheckUserTypeEnum.REPAIR_USER.getValue())) {
|
|
|
|
+ checkJob.setCheckUserId(sbInfo.getRepairUser());
|
|
|
|
+ } else if (standard.getCheckUserType().equals(CheckUserTypeEnum.ZHIDING.getValue())) {
|
|
|
|
+ checkJob.setCheckUserId(sbInfo.getRepairUser());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 判断某个计划,某个设备,某个标准,是否要生成任务
|
|
* 判断某个计划,某个设备,某个标准,是否要生成任务
|
|
*
|
|
*
|
|
@@ -1361,6 +1361,8 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
public void finishJob(CheckJobDTO dto) {
|
|
public void finishJob(CheckJobDTO dto) {
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
CheckJob checkJob = mapper.selectByPrimaryKey(dto.getId());
|
|
CheckJob checkJob = mapper.selectByPrimaryKey(dto.getId());
|
|
|
|
+ SbInfo sbInfo = sbInfoMapper.selectByPrimaryKey(dto.getSbId());
|
|
|
|
+
|
|
/*if(!CheckJobStatusEnum.EXECUTING.getValue().equals(checkJob.getStatus()) && !CheckJobStatusEnum.OUT_OF_DATE.getValue().equals(checkJob.getStatus())){
|
|
/*if(!CheckJobStatusEnum.EXECUTING.getValue().equals(checkJob.getStatus()) && !CheckJobStatusEnum.OUT_OF_DATE.getValue().equals(checkJob.getStatus())){
|
|
return;
|
|
return;
|
|
}*/
|
|
}*/
|
|
@@ -1420,7 +1422,9 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
nextCheckJob.setCreatedTime(LocalDateTime.now());
|
|
nextCheckJob.setCreatedTime(LocalDateTime.now());
|
|
nextCheckJob.setSbId(checkStandard.getSbId());
|
|
nextCheckJob.setSbId(checkStandard.getSbId());
|
|
nextCheckJob.setReceiveOvertime(false);
|
|
nextCheckJob.setReceiveOvertime(false);
|
|
- nextCheckJob.setCheckUserId(checkJob.getCheckUserId());
|
|
|
|
|
|
+
|
|
|
|
+ setCheckUserId(checkStandard, sbInfo, nextCheckJob);
|
|
|
|
+ // nextCheckJob.setCheckUserId(checkJob.getCheckUserId());
|
|
nextCheckJob.setPartId(checkStandard.getPart());
|
|
nextCheckJob.setPartId(checkStandard.getPart());
|
|
nextCheckJob.setStandardId(checkStandard.getId());
|
|
nextCheckJob.setStandardId(checkStandard.getId());
|
|
nextCheckJob.setType(checkStandard.getType());
|
|
nextCheckJob.setType(checkStandard.getType());
|
|
@@ -1474,6 +1478,7 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
public void finishJobIgnore(CheckJobDTO dto) {
|
|
public void finishJobIgnore(CheckJobDTO dto) {
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
CheckJob checkJob = mapper.selectByPrimaryKey(dto.getId());
|
|
CheckJob checkJob = mapper.selectByPrimaryKey(dto.getId());
|
|
|
|
+ SbInfo sbInfo = sbInfoMapper.selectByPrimaryKey(checkJob.getSbId());
|
|
checkJob.setStatus(CheckJobStatusEnum.FINISHED.getValue());
|
|
checkJob.setStatus(CheckJobStatusEnum.FINISHED.getValue());
|
|
checkJob.setActualEndTime(now);
|
|
checkJob.setActualEndTime(now);
|
|
if(checkJob.getActualStartTime() == null){
|
|
if(checkJob.getActualStartTime() == null){
|
|
@@ -1517,7 +1522,7 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
|
|
calcNextJobTime(nextCheckJob, checkJob.getActualEndTime(), checkStandard);
|
|
calcNextJobTime(nextCheckJob, checkJob.getActualEndTime(), checkStandard);
|
|
nextCheckJob.setCreatedTime(LocalDateTime.now());
|
|
nextCheckJob.setCreatedTime(LocalDateTime.now());
|
|
nextCheckJob.setSbId(checkStandard.getSbId());
|
|
nextCheckJob.setSbId(checkStandard.getSbId());
|
|
- nextCheckJob.setCheckUserId(checkJob.getCheckUserId());
|
|
|
|
|
|
+ setCheckUserId(checkStandard, sbInfo, nextCheckJob);
|
|
nextCheckJob.setPartId(checkStandard.getPart());
|
|
nextCheckJob.setPartId(checkStandard.getPart());
|
|
nextCheckJob.setStandardId(checkStandard.getId());
|
|
nextCheckJob.setStandardId(checkStandard.getId());
|
|
nextCheckJob.setType(checkStandard.getType());
|
|
nextCheckJob.setType(checkStandard.getType());
|