提交修改

This commit is contained in:
quyixiao 2020-11-10 15:38:32 +08:00
parent d0c9169033
commit bac11e73e9
11 changed files with 47 additions and 7 deletions

View File

@ -54,6 +54,7 @@ public class ShiroConfig {
filterMap.put("/file/**", "anon"); filterMap.put("/file/**", "anon");
filterMap.put("/user/lzstaffrole/role/**", "anon"); filterMap.put("/user/lzstaffrole/role/**", "anon");
filterMap.put("/user/lzresultrecord/**", "anon"); filterMap.put("/user/lzresultrecord/**", "anon");
filterMap.put("/user/lzstaffrole/listByGroupId/**", "anon");
filterMap.put("/test/**", "anon"); filterMap.put("/test/**", "anon");
filterMap.put("/druid/**", "anon"); filterMap.put("/druid/**", "anon");
filterMap.put("/app/**", "anon"); filterMap.put("/app/**", "anon");

View File

@ -8,6 +8,7 @@ import com.lz.common.utils.R;
import com.lz.modules.app.entity.DepartmentsEntity; import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.enums.RoleEnums;
import com.lz.modules.app.model.RoleModel; import com.lz.modules.app.model.RoleModel;
import com.lz.modules.app.resp.StaffRoleModel; import com.lz.modules.app.resp.StaffRoleModel;
import com.lz.modules.app.service.DepartmentsService; import com.lz.modules.app.service.DepartmentsService;
@ -16,9 +17,11 @@ import com.lz.modules.app.service.StaffService;
import com.lz.modules.flow.entity.RecordRole; import com.lz.modules.flow.entity.RecordRole;
import com.lz.modules.flow.entity.StaffRole; import com.lz.modules.flow.entity.StaffRole;
import com.lz.modules.flow.entity.StaffRoleDepartment; import com.lz.modules.flow.entity.StaffRoleDepartment;
import com.lz.modules.flow.entity.StaffRoleEvaluationGroup;
import com.lz.modules.flow.req.StaffRoleRequest; import com.lz.modules.flow.req.StaffRoleRequest;
import com.lz.modules.flow.service.RecordRoleService; import com.lz.modules.flow.service.RecordRoleService;
import com.lz.modules.flow.service.StaffRoleDepartmentService; import com.lz.modules.flow.service.StaffRoleDepartmentService;
import com.lz.modules.flow.service.StaffRoleEvaluationGroupService;
import com.lz.modules.flow.service.StaffRoleService; import com.lz.modules.flow.service.StaffRoleService;
import com.lz.modules.sys.entity.SysMenuEntity; import com.lz.modules.sys.entity.SysMenuEntity;
import com.lz.modules.sys.entity.SysRoleEntity; import com.lz.modules.sys.entity.SysRoleEntity;
@ -63,6 +66,8 @@ public class StaffRoleController {
@Autowired @Autowired
private DepartmentsStaffRelateService departmentsStaffRelateService; private DepartmentsStaffRelateService departmentsStaffRelateService;
@Autowired
private StaffRoleEvaluationGroupService staffRoleEvaluationGroupService;
/** /**
* 列表 * 列表
@ -80,7 +85,7 @@ public class StaffRoleController {
// http://localhost:8080/lz_management/user/lzstaffrole/listByGroupId?groupId=3 // http://localhost:8080/lz_management/user/lzstaffrole/listByGroupId?groupId=3
@ApiImplicitParam(name = "groupId",value = "组id",defaultValue = "1",required = true, dataType = "Long",paramType = "query") @ApiImplicitParam(name = "groupId",value = "组id",defaultValue = "1",required = true, dataType = "Long",paramType = "query")
public R listByGroupId( Long groupId ) { public R listByGroupId( Long groupId ) {
List<StaffRole> staffRoleList = staffRoleService.selectByGroupId(groupId); List<StaffRole> staffRoleList = staffRoleService.selectAllStaffRoleByDepartmentLevel(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName(),RoleEnums.CHILD_PM.getName()}));
List<StaffRoleModel> staffRoles = new ArrayList<>(); List<StaffRoleModel> staffRoles = new ArrayList<>();
for(StaffRole staffRole:staffRoleList){ for(StaffRole staffRole:staffRoleList){
StaffRoleModel staffRoleModel = new StaffRoleModel(); StaffRoleModel staffRoleModel = new StaffRoleModel();
@ -93,6 +98,14 @@ public class StaffRoleController {
staffRoleModel.setStaffName(staffRoleModel.getStaffName() + " "+departmentsEntity.getDepartmentName()); staffRoleModel.setStaffName(staffRoleModel.getStaffName() + " "+departmentsEntity.getDepartmentName());
} }
} }
StaffRoleEvaluationGroup staffRoleEvaluationGroup = staffRoleEvaluationGroupService.selectEvaluationGroupIdsByRoleIdGroupId(staffRole.getId(),groupId);
staffRoleModel.setIsSelect(0);
if(staffRoleEvaluationGroup !=null){
staffRoleModel.setIsSelect(1);
}
if(staffRole.getDepartmentLevel().equals(RoleEnums.MASTER_PM.getName())){
staffRoleModel.setIsSelect(1);
}
staffRoles.add(staffRoleModel); staffRoles.add(staffRoleModel);
} }
return R.ok().put("data", staffRoles); return R.ok().put("data", staffRoles);
@ -185,7 +198,6 @@ public class StaffRoleController {
} }
} }
} }
if (req.getId() == null || req.getId() <= 0) { if (req.getId() == null || req.getId() <= 0) {
staffRoleService.insertStaffRole(staffRole); staffRoleService.insertStaffRole(staffRole);
} else { } else {

View File

@ -21,10 +21,6 @@ public class StaffRoleModel {
@ApiModelProperty(value = "组id", name = "evaluationGroupId") @ApiModelProperty(value = "组id", name = "evaluationGroupId")
private Long evaluationGroupId; private Long evaluationGroupId;
//是否是必选 //是否是必选
@ApiModelProperty(value = "是否是必选,0不是必选1必选", name = "isSelect") @ApiModelProperty(value = "是否是必选,0不是必选1必选", name = "isSelect")
private Integer isSelect; private Integer isSelect;

View File

@ -39,4 +39,6 @@ public interface StaffRoleEvaluationGroupMapper extends BaseMapper<StaffRoleEval
void deleteStaffRoleEvaluationGroupByRoleId(@Param("roleId") Long roleId); void deleteStaffRoleEvaluationGroupByRoleId(@Param("roleId") Long roleId);
StaffRoleEvaluationGroup selectEvaluationGroupIdsByRoleIdGroupId(@Param("roleId") Long roleId, @Param("groupId") Long groupId);
} }

View File

@ -58,4 +58,6 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
List<StaffRole> selectAllByStaffId(@Param("staffId") Long staffId); List<StaffRole> selectAllByStaffId(@Param("staffId") Long staffId);
List<StaffMenu> selectAllMenus(@Param("userId") Long userId); List<StaffMenu> selectAllMenus(@Param("userId") Long userId);
List<StaffRole> selectAllStaffRoleByDepartmentLevel(@Param("departmentLevels") List<String> departmentLevels);
} }

View File

@ -38,4 +38,6 @@ public interface StaffRoleEvaluationGroupService extends IService<StaffRoleEvalu
List<EvaluationGroupInfo> selectStaffRoleEvaluationGroupBy(Long id); List<EvaluationGroupInfo> selectStaffRoleEvaluationGroupBy(Long id);
void deleteStaffRoleEvaluationGroupByRoleId(Long roleId); void deleteStaffRoleEvaluationGroupByRoleId(Long roleId);
StaffRoleEvaluationGroup selectEvaluationGroupIdsByRoleIdGroupId(Long roleId, Long groupId);
} }

View File

@ -65,4 +65,6 @@ public interface StaffRoleService extends IService<StaffRole> {
List<StaffRole> selectAllByStaffId(Long userId); List<StaffRole> selectAllByStaffId(Long userId);
Map<String, Integer> getRoleByUserId(Long userId); Map<String, Integer> getRoleByUserId(Long userId);
List<StaffRole> selectAllStaffRoleByDepartmentLevel(List<String> asList);
} }

View File

@ -71,7 +71,13 @@ public class StaffRoleEvaluationGroupServiceImpl extends ServiceImpl<StaffRoleEv
staffRoleEvaluationGroupMapper.deleteStaffRoleEvaluationGroupByRoleId(roleId); staffRoleEvaluationGroupMapper.deleteStaffRoleEvaluationGroupByRoleId(roleId);
} }
@Override @Override
public StaffRoleEvaluationGroup selectEvaluationGroupIdsByRoleIdGroupId(Long roleId, Long groupId) {
return staffRoleEvaluationGroupMapper.selectEvaluationGroupIdsByRoleIdGroupId(roleId,groupId);
}
@Override
public List<Long> selectEvaluationGroupIdsByRoleId(Long roleId) { public List<Long> selectEvaluationGroupIdsByRoleId(Long roleId) {
return staffRoleEvaluationGroupMapper.selectEvaluationGroupIdsByRoleId(roleId); return staffRoleEvaluationGroupMapper.selectEvaluationGroupIdsByRoleId(roleId);
} }

View File

@ -503,6 +503,12 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
return map; return map;
} }
@Override
public List<StaffRole> selectAllStaffRoleByDepartmentLevel(List<String> asList) {
return staffRoleMapper.selectAllStaffRoleByDepartmentLevel(asList);
}
public void insertPM(StaffRole staffRole, Long parentId, StaffEntity staffEntity) { public void insertPM(StaffRole staffRole, Long parentId, StaffEntity staffEntity) {
staffRole.setEvaluationGroupId(EvaluationGroupEnums.ALL.getType());//全部考评组 staffRole.setEvaluationGroupId(EvaluationGroupEnums.ALL.getType());//全部考评组
staffRole.setDepartmentId(DepartmentPMEnums.ALL.getType());//所有部门 staffRole.setDepartmentId(DepartmentPMEnums.ALL.getType());//所有部门

View File

@ -97,5 +97,10 @@
select evaluation_group_id from lz_staff_role_evaluation_group where is_delete = 0 and role_id = #{roleId} and is_select = 1 select evaluation_group_id from lz_staff_role_evaluation_group where is_delete = 0 and role_id = #{roleId} and is_select = 1
</select> </select>
<select id="selectEvaluationGroupIdsByRoleIdGroupId"
resultType="com.lz.modules.flow.entity.StaffRoleEvaluationGroup">
select * from lz_staff_role_evaluation_group where is_delete = 0 and role_id = #{roleId} and evaluation_group_id = #{groupId}
</select>
</mapper> </mapper>

View File

@ -169,6 +169,12 @@
select menu_id from lz_staff_role_menu where role_id in ( select menu_id from lz_staff_role_menu where role_id in (
select id from lz_staff_role where staff_id = #{userId} and is_delete=0) and is_delete = 0 ) and is_delete = 0 select id from lz_staff_role where staff_id = #{userId} and is_delete=0) and is_delete = 0 ) and is_delete = 0
</select> </select>
<select id="selectAllStaffRoleByDepartmentLevel" resultType="com.lz.modules.flow.entity.StaffRole">
select * from lz_staff_role where is_delete = 0 and department_level in
<foreach collection="departmentLevels" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper> </mapper>