|
@@ -112,24 +112,26 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
|
|
|
// 获取报修人
|
|
|
- if (record.getSearchType() == 1) {
|
|
|
- if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setUserId(userInfo.getUserId());
|
|
|
+ if(record.getSearchType() != null){
|
|
|
+ if (record.getSearchType() == 1) {
|
|
|
+ if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ record.setUserId(userInfo.getUserId());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // 获取维修人
|
|
|
- if (record.getSearchType() == 2) {
|
|
|
- if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setRepairUserId(userInfo.getUserId());
|
|
|
+ // 获取维修人
|
|
|
+ if (record.getSearchType() == 2) {
|
|
|
+ if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ record.setRepairUserId(userInfo.getUserId());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // 获取验收人
|
|
|
- if (record.getSearchType() == 3) {
|
|
|
- if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
- UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setCheckUserId(userInfo.getUserId());
|
|
|
+ // 获取验收人
|
|
|
+ if (record.getSearchType() == 3) {
|
|
|
+ if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ record.setCheckUserId(userInfo.getUserId());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return new MyVOPage<>(mapper.selectPageList(record));
|
|
@@ -341,6 +343,55 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.RECEIVE.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_RECEIVE.getValue(),
|
|
|
applicationForm.getId(), MessageTemplateUtil.getReceive(applicationForm.getNo()),
|
|
|
applicationForm.getId(), ListUtils.newArrayList(applicationForm.getUserId())));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发起审核给领导人,必须完成后的报修单才可以提交审核
|
|
|
+ *
|
|
|
+ * @param id :
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void examine(String id) {
|
|
|
+ RepairApplicationForm applicationForm = mapper.selectById(id);
|
|
|
+ if (!RepairApplicationFormStatusEnum.NOT_ACCEPTANCE.getValue().equals(applicationForm.getStatus())) {
|
|
|
+ throw new BusinessException("未完成的不允许提交审核");
|
|
|
+ }
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.EXAMINING.getValue());
|
|
|
+ applicationForm.setUpdateTime(LocalDateTime.now());
|
|
|
+ super.modModelByPrimaryKey(applicationForm);
|
|
|
+ SysUserDTO query = new SysUserDTO();
|
|
|
+ query.setRoleCode(SysRoleCodeEnum.REPAIR_EXAMINE.name());
|
|
|
+ List<SysUserVO> users = userMapper.selectDeptRoleUser(query);
|
|
|
+ SysUserVO userVO = null;
|
|
|
+ if (CollectionUtil.isNotEmpty(users)) {
|
|
|
+ userVO = users.get(0);
|
|
|
+ }else{
|
|
|
+ throw new BusinessException("审核角色为绑定用户,请设置用户");
|
|
|
+ }
|
|
|
+ SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.RECEIVE.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_EXAMINE.getValue(),
|
|
|
+ applicationForm.getId(), MessageTemplateUtil.getReceiveExamine(applicationForm.getNo()),
|
|
|
+ applicationForm.getId(), ListUtils.newArrayList(userVO.getUserId()), ListUtils.newArrayList(userVO.getEmail())));}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 进行维修单审核
|
|
|
+ *
|
|
|
+ * @param id :
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void examined(String id, Integer result, RepairApplicationFormDTO dto) {
|
|
|
+ RepairApplicationForm applicationForm = mapper.selectById(id);
|
|
|
+ if (!RepairApplicationFormStatusEnum.EXAMINING.getValue().equals(applicationForm.getStatus())) {
|
|
|
+ throw new BusinessException("该状态不允许审核,请检查维修单状态");
|
|
|
+ }
|
|
|
+ if(result == 1){
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.EXAMINED.getValue());
|
|
|
+ }else{// 打回,重新完善维修单, 再次提交审核
|
|
|
+ applicationForm.setStatus(RepairApplicationFormStatusEnum.FINISHED.getValue());
|
|
|
+ }
|
|
|
+ applicationForm.setUpdateTime(LocalDateTime.now());
|
|
|
+ applicationForm.setExamineContent(dto.getExamineContent());
|
|
|
+ super.modModelByPrimaryKey(applicationForm);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -428,19 +479,6 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
sysFileMapper.insertListforComplex(list);
|
|
|
}
|
|
|
|
|
|
-// // 获取部门的项目部
|
|
|
-// SysDeptVO natureDept = UserUtil.getUserNatureDept(DeptNatureEnum.XIANG_MU_BU, userInfo);
|
|
|
-// // 获取项目部设备主管
|
|
|
-// List<SysUserVO> users = UserUtil.selectUserByIdentityTypeLikeDeptCode(natureDept.getDeptCode(),
|
|
|
-// SysUserIdentityType.WXZG.getValue());
|
|
|
-// SysUserVO checkUser = null;
|
|
|
-// if (CollectionUtil.isNotEmpty(users)) {
|
|
|
-// checkUser = users.get(0);
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (checkUser == null) {
|
|
|
-// throw new BusinessException("找不到该项目部的维修主管,项目部名称:" + natureDept.getName());
|
|
|
-// }
|
|
|
String userId = applicationForm.getUserId();
|
|
|
applicationForm.setCheckUserId(userId);
|
|
|
// 维修人自己发起报修自己验收
|
|
@@ -459,10 +497,10 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
|
|
|
} else {
|
|
|
super.modModelByPrimaryKey(applicationForm);
|
|
|
// 发送通知给主管,主管是验收人,他收到通知,进行调拨给使用人员
|
|
|
- SysUser checkUser = userMapper.selectByPrimaryKey(applicationForm.getCheckUserId());
|
|
|
+ /* SysUser checkUser = userMapper.selectByPrimaryKey(applicationForm.getCheckUserId());
|
|
|
SpringContextHolder.publishEvent(new WorkplaceBacklogEvent(WorkplaceBacklogTypeEnum.REPAIR.getValue(), WorkplaceBacklogDetailTypeEnum.REPAIR_FINISH.getValue(),
|
|
|
applicationForm.getId(), MessageTemplateUtil.getRepairCheck(applicationForm.getNo()),
|
|
|
- applicationForm.getId(), ListUtils.newArrayList(applicationForm.getCheckUserId()), ListUtils.newArrayList(checkUser.getEmail())));
|
|
|
+ applicationForm.getId(), ListUtils.newArrayList(applicationForm.getCheckUserId()), ListUtils.newArrayList(checkUser.getEmail())));*/
|
|
|
}
|
|
|
}
|
|
|
|