|
@@ -386,7 +386,9 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
}
|
|
|
applicationForm.setRepairUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
applicationForm.setStatus(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
- applicationForm.setRepairStartTime(LocalDateTime.now());
|
|
|
+ if(applicationForm.getRepairStartTime() == null){
|
|
|
+ applicationForm.setRepairStartTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
applicationForm.setUpdateTime(LocalDateTime.now());
|
|
|
super.modModelByPrimaryKey(applicationForm);
|
|
|
|
|
@@ -502,7 +504,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
|
|
|
/**
|
|
|
* 完成为待验收状态,此时需要再次编辑维修内容,最终提交审核
|
|
|
- *
|
|
|
+ * 完成同时将设备状态为使用中
|
|
|
* @param dto
|
|
|
*/
|
|
|
@Override
|
|
@@ -514,7 +516,11 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
RepairForm repairForm = new RepairForm();
|
|
|
repairForm.setId(dto.getId());
|
|
|
applicationForm.setStatus(RepairApplicationFormStatusEnum.WAIT_SUBMIT.getValue());
|
|
|
- applicationForm.setRepairEndTime(LocalDateTime.now());
|
|
|
+
|
|
|
+ // 驳回重新完成的,不用更新这个时间,驳回应该状态是完成待审核,不需要重新维修
|
|
|
+ if(applicationForm.getRepairEndTime() == null){
|
|
|
+ applicationForm.setRepairEndTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
applicationForm.setRepairMinutes(DateUtils.dateDiff(applicationForm.getRepairEndTime(), applicationForm.getRepairStartTime()));
|
|
|
|
|
|
applicationForm.setRepairContent(dto.getRepairContent());
|
|
@@ -544,6 +550,12 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
sysFileMapper.insertListforComplex(list);
|
|
|
}
|
|
|
super.modModelByPrimaryKey(applicationForm);
|
|
|
+
|
|
|
+ // 更新设备状态为使用中
|
|
|
+ SbInfo sbInfo = sbInfoService.getModelById(applicationForm.getSbId());
|
|
|
+ sbInfo.setStatus(SbInfoStatusEnum.IN_USE.getValue());
|
|
|
+ sbInfoService.modModelByPrimaryKey(sbInfo);
|
|
|
+
|
|
|
/*String userId = applicationForm.getUserId();
|
|
|
applicationForm.setCheckUserId(userId);*/
|
|
|
/*// 维修人自己发起报修自己验收
|
|
@@ -596,6 +608,11 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
applicationForm.getId(), ListUtils.newArrayList(applicationForm.getRepairUserId()), ListUtils.newArrayList(noticeUser.getEmail())));*/
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 验收是主管验收,驳回到待审核状态
|
|
|
+ *
|
|
|
+ * @param dto
|
|
|
+ */
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public void returnRepair(RepairApplicationFormDTO dto) {
|