湖北水库:施工:项目查询过滤无效修复、根据角色查询用户
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Integer approvalStatus; |
| | | |
| | | @TableField(exist = false) |
| | | private Long deviceId; |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class SgProjectRolePersonV0 { |
| | | private Long id; |
| | | private Long projectId; |
| | | private String projectName; |
| | | private Long roleId; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据角色查用户 |
| | | */ |
| | | @GetMapping(value = "/get_user_by_role") |
| | | public R getUserByRole( @RequestParam String roleId) { |
| | | List<Map<String,Object>> list = projectPersonConfigService.getUserByRole(roleId); |
| | | return R.data(list); |
| | | } |
| | | } |
| | |
| | | <if test="dto.deviceName != null and dto.deviceName != ''"> |
| | | and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%') |
| | | </if> |
| | | <if test="dto.reportPerson != null"> |
| | | and report.reportPerson = #{dto.reportPerson} |
| | | </if> |
| | | </select> |
| | | <select id="getUserByIds" resultType="java.util.Map"> |
| | | select id ,real_name from ywxt.blade_user where 1 = 1 |
| | |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.DO.SgProjectInfoDO"> |
| | | select * from YWXT.SG_PROJECT_INFO info where 1=1 |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and info.project_name = #{dto.projectName} |
| | | and info.project_name like concat( concat ('%',#{dto.projectName}),'%') |
| | | </if> |
| | | <if test="dto.skName != null and dto.skName != ''"> |
| | | and info.sk_name = #{dto.skName} |
| | | and info.sk_name like concat(concat('%',#{dto.skName}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="queryStepByProject" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | List<String> getRoleList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectRolePersonV0> getList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<Map<String, Object>> getUserByRole(@Param("roleId") String roleId); |
| | | } |
| | |
| | | -- d.id as device_id, |
| | | -- d.device_name |
| | | , sppc.user_id |
| | | , sppc.id |
| | | , bu.real_name as userName |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | | Left JOIN ywxt.sg_gx_config sgc ON d.device_type = sgc.gx_device_type |
| | | left join ywxt.blade_role ro on ro.id = sgc.role_id |
| | | left join ywxt.sg_project_person_config sppc on sppc.rold_id = sgc.role_id |
| | | left join ywxt.sg_project_person_config sppc on sgc.role_id = sppc.rold_id and sppc.program_id = pro.id |
| | | left join ywxt.blade_user bu on sppc.user_id = bu.id |
| | | where 1=1 and pro.id = #{dto.projectId} |
| | | </select> |
| | | <select id="getUserByRole" resultType="java.util.Map"> |
| | | select id,real_name as realName from ywxt.blade_user where role_id = #{roleId} |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | |
| | | List<SgProjectRolePersonV0> getList(ProjectSearchDTO searchDTO); |
| | | |
| | | List<Map<String, Object>> getUserByRole(String roleId); |
| | | } |
| | |
| | | sgDeviceDO.setId(dId); |
| | | sgDeviceDO.setDeviceName(deList.get(0).getDeviceName()); |
| | | sgDeviceDO.setStatus( deList.get(0).getDeviceStatus()); |
| | | sgDeviceDO.setStepDOList(deList.stream().map(s->SgGxStepDO.builder().id(s.getReportId()).gxStepNum(s.getGxStepNum()).gxStepName(s.getGxStepName()).approvalStatus(s.getReportStatus()).build()).collect(Collectors.toList())); |
| | | sgDeviceDO.setStepDOList(deList.stream().map(s->SgGxStepDO.builder().id(s.getReportId()).gxStepNum(s.getGxStepNum()).gxStepName(s.getGxStepName()).deviceId(s.getDId()).approvalStatus(s.getReportStatus()).build()).collect(Collectors.toList())); |
| | | deviceDOS.add(sgDeviceDO); |
| | | } |
| | | typeVO.setDeviceDOS(deviceDOS); |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Override |
| | | public void add(List<SgProjectPersonConfigDO> list) { |
| | | for (SgProjectPersonConfigDO sgProjectPersonConfigDO : list) { |
| | | projectPersonConfigMapper.insert(sgProjectPersonConfigDO); |
| | | if (Objects.isNull(sgProjectPersonConfigDO.getId())){ |
| | | projectPersonConfigMapper.insert(sgProjectPersonConfigDO); |
| | | }else { |
| | | projectPersonConfigMapper.updateById(sgProjectPersonConfigDO); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | List<SgProjectRolePersonV0> list = projectPersonConfigMapper.getList(searchDTO); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserByRole(String roleId) { |
| | | return projectPersonConfigMapper.getUserByRole(roleId); |
| | | } |
| | | } |