|
@@ -228,16 +228,20 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
roleCodes.append(item).append(",");
|
|
|
});
|
|
|
String roles = roleCodes.toString();
|
|
|
+ int roleFlag = 1; // 1 申请人 2 执行人 3 部门主管 4 部门负责人
|
|
|
if(userInfo.getSuperAdmin() != 1){
|
|
|
record.setDelUserId(userInfo.getUserId());
|
|
|
if(roles.contains(SysRoleCodeEnum.DEPT_LEADER.name())){
|
|
|
// 部门负责人(执行和申请)
|
|
|
+ roleFlag = 4;
|
|
|
record.setTempUserId(userInfo.getUserId());
|
|
|
}else if(roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name())){
|
|
|
// 申请部门主管
|
|
|
+ roleFlag = 3;
|
|
|
record.setApplyVerifyUserId(userInfo.getUserId());
|
|
|
}else if(roles.contains(SysRoleCodeEnum.PREPARATION_USER.name())){
|
|
|
// 执行人
|
|
|
+ roleFlag = 2;
|
|
|
record.setRepairUserId(userInfo.getUserId());
|
|
|
}else {
|
|
|
// 申请人
|
|
@@ -252,11 +256,21 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
record.setTempUserId(null);
|
|
|
record.setStatusList(statusList);
|
|
|
} else if (record.getSearchType() == 2) { // 待审核工单
|
|
|
- statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
- statusList.add(PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue());
|
|
|
- statusList.add(PreparationStatusEnum.APPLY_LEADER_VERIFY_SUCCESS.getValue());
|
|
|
- statusList.add(PreparationStatusEnum.FIRST_PROCESSING_VERIFYING.getValue());
|
|
|
- statusList.add(PreparationStatusEnum.SECOND_PROCESSING_VERIFYING.getValue());
|
|
|
+ switch (roleFlag){
|
|
|
+ case 1:
|
|
|
+ statusList.add(PreparationStatusEnum.FIRST_PROCESSING_VERIFYING.getValue());
|
|
|
+ statusList.add(PreparationStatusEnum.SECOND_PROCESSING_VERIFYING.getValue());
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ statusList.add(PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue());
|
|
|
+ statusList.add(PreparationStatusEnum.APPLY_LEADER_VERIFY_SUCCESS.getValue());
|
|
|
+ break;
|
|
|
+ }
|
|
|
record.setStatusList(statusList);
|
|
|
} else if (record.getSearchType() == 3) { // 我的工单
|
|
|
}
|
|
@@ -300,6 +314,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
model.setNo(IdGeneratorUtils.getPreparationNo(++count));
|
|
|
model.setStatus(PreparationStatusEnum.NOT_ALLOCATED.getValue()); // 待主管审核
|
|
|
model.setNodeNum(PreparationNodeEnum.APPLY.getValue());
|
|
|
+ model.setDelUserId("[]");
|
|
|
Preparation preparation = this.saveModelByDTO(model);
|
|
|
// 给申请部门主管发送信息,通知审核
|
|
|
SysUser sendUser = sysUserMapper.selectByPrimaryKey(model.getApplyVerifyUserId());
|
|
@@ -885,10 +900,11 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
String delUserId = preparation.getDelUserId();
|
|
|
Preparation updPre = new Preparation();
|
|
|
updPre.setId(id);
|
|
|
- if(StringUtils.isEmpty(delUserId)){
|
|
|
- updPre.setDelUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ if(StringUtils.isEmpty(delUserId) || "[]".equals(delUserId)){
|
|
|
+ updPre.setDelUserId("[" + SecurityUtils.getUserInfo().getUserId() + "]");
|
|
|
}else{
|
|
|
- updPre.setDelUserId(preparation.getDelUserId() + "," + SecurityUtils.getUserInfo().getUserId());
|
|
|
+ String preStr = delUserId.substring(0,delUserId.length()-1);
|
|
|
+ updPre.setDelUserId(preStr + "," + SecurityUtils.getUserInfo().getUserId() + "]");
|
|
|
}
|
|
|
mapper.updateByPrimaryKeySelective(updPre);
|
|
|
}
|