|
@@ -224,7 +224,29 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
public AbstractPageResultBean<PreparationVO> selectPageList(PreparationDTO record, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
- record.setTempUserId(userInfo.getUserId());
|
|
|
+ // 获取用户角色
|
|
|
+ StringBuilder roleCodes = new StringBuilder();
|
|
|
+ userInfo.getRoleCodes().forEach(item-> {
|
|
|
+ roleCodes.append(item).append(",");
|
|
|
+ });
|
|
|
+ String roles = roleCodes.toString();
|
|
|
+ if(userInfo.getSuperAdmin() != 1){
|
|
|
+ record.setDelUserId(userInfo.getUserId());
|
|
|
+ if(roles.contains(SysRoleCodeEnum.DEPT_LEADER.name())){
|
|
|
+ // 部门负责人(执行和申请)
|
|
|
+ record.setTempUserId(userInfo.getUserId());
|
|
|
+ }else if(roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name())){
|
|
|
+ // 申请部门主管
|
|
|
+ record.setApplyVerifyUserId(userInfo.getUserId());
|
|
|
+ }else if(roles.contains(SysRoleCodeEnum.PREPARATION_USER.name())){
|
|
|
+ // 执行人
|
|
|
+ record.setRepairUserId(userInfo.getUserId());
|
|
|
+ }else {
|
|
|
+ // 申请人
|
|
|
+ record.setUserId(userInfo.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //record.setTempUserId(userInfo.getUserId());
|
|
|
if (record.getSearchType() != null && record.getStatus() == null) {
|
|
|
List<Integer> statusList = new ArrayList<>();
|
|
|
if (record.getSearchType() == 1) { // 待派工单
|
|
@@ -241,7 +263,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
} else if (record.getSearchType() == 3) { // 我的工单
|
|
|
}
|
|
|
// 超级管理员可以看到各个状态下的所有数据 相关领导,可以在这里进行设置
|
|
|
- if (userInfo.getSuperAdmin() == 1 || record.getSearchType() == -1) {
|
|
|
+ if (userInfo.getSuperAdmin() == 1) {
|
|
|
record.setTempUserId(null);
|
|
|
}
|
|
|
}
|
|
@@ -799,6 +821,20 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void deleteById(String id) {
|
|
|
+ Preparation preparation = mapper.selectByPrimaryKey(id);
|
|
|
+ String delUserId = preparation.getDelUserId();
|
|
|
+ Preparation updPre = new Preparation();
|
|
|
+ updPre.setId(id);
|
|
|
+ if(StringUtils.isEmpty(delUserId)){
|
|
|
+ updPre.setDelUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ }else{
|
|
|
+ updPre.setDelUserId(preparation.getDelUserId() + "," + SecurityUtils.getUserInfo().getUserId());
|
|
|
+ }
|
|
|
+ mapper.updateByPrimaryKeySelective(updPre);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public AbstractPageResultBean<Preparation> selectPageInfo(PreparationDTO record, int pageNum, int pageSize) {
|
|
|
PageHelper.startPage(pageNum, pageSize);
|