湖北水库:施工:根据设备查询审批ID、审批待办列表分页
13 files modified
1 files added
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | |
| | | * @author shenyijian |
| | | * @since 2024-06-15 11:45:35 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("SG_PROJECT_PERSON_CONFIG") |
| | | public class SgProjectPersonConfigDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | @TableName("SG_PROJECT_PERSON_CONFIG") |
| | | @Data |
| | | public class SgProjectPersonConfigDO { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| New file |
| | |
| | | package cn.gistack.sm.sg.DO; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SgProjectRolePersonV0 { |
| | | private Long projectId; |
| | | private String projectName; |
| | | private Long roleId; |
| | | private String roleName; |
| | | private Long userId; |
| | | private String userName; |
| | | } |
| | |
| | | private String gxName; |
| | | private String deviceName; |
| | | private Long dId; |
| | | private Long reportId; |
| | | private String gxStepName; |
| | | private Integer reportStatus; |
| | | private String gxStepNum; |
| | |
| | | import cn.gistack.sm.sg.DTO.ApprovalDTO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgProgressReportVO; |
| | | import cn.gistack.sm.sg.VO.SgProjectInfoVO; |
| | | import cn.gistack.sm.sg.service.SgProgressReportService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | } |
| | | |
| | | /** |
| | | * APP审核列表 |
| | | * 待办列表(APP) |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R queryList(ProjectSearchDTO searchDTO) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 待办列表统计 |
| | | * 待办列表分页 |
| | | */ |
| | | @GetMapping(value = "/project_progress_page") |
| | | public R progressPage(ProjectSearchDTO searchDTO,Query query) { |
| | | IPage<SgProgressReportVO> page = sgProgressReportService.progressPage(Condition.getPage(query),searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 待办列表统计(APP) |
| | | */ |
| | | @GetMapping(value = "/approval_count") |
| | | public R countList(ProjectSearchDTO searchDTO) { |
| | |
| | | |
| | | |
| | | /** |
| | | * 审批状态统计 |
| | | * 审批情况检验(APP) |
| | | */ |
| | | @GetMapping(value = "/check_step") |
| | | public R checkStep(@RequestParam Long deviceId , @RequestParam Long stepId) { |
| | | boolean flag = sgProgressReportService.checkStep(deviceId,stepId); |
| | | return R.data(flag); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询当前设备审批记录 |
| | | */ |
| | | @GetMapping(value = "/get_device_report") |
| | | public R getDeviceReport(@RequestParam Long deviceId , @RequestParam(required = false) Long stepId) { |
| | | String reportId = sgProgressReportService.getDeviceReport(deviceId,stepId); |
| | | return R.data(reportId); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.service.SgProjectPersonConfigService; |
| | | import org.checkerframework.checker.units.qual.A; |
| | |
| | | /** |
| | | * 新增项目人员配置 |
| | | */ |
| | | @GetMapping(value = "/add") |
| | | @PostMapping(value = "/add") |
| | | public R add( @RequestBody List<SgProjectPersonConfigDO> list) { |
| | | projectPersonConfigService.add(list); |
| | | return R.success("新增成功"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * 列表 |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | public R delete( ProjectSearchDTO searchDTO) { |
| | | projectPersonConfigService.getList(searchDTO); |
| | | return R.success("删除成功"); |
| | | public R list( ProjectSearchDTO searchDTO) { |
| | | List<SgProjectRolePersonV0> list = projectPersonConfigService.getList(searchDTO); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |
| | |
| | | SgProgressReportVO queryById(@Param("id") String id); |
| | | |
| | | List<SgProgressReportVO> queryList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | List<SgProgressReportVO> queryList(IPage<SgProgressReportVO> page,@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | Long countList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | |
| | | step.gx_step_num, |
| | | re.STATUS as reportStatus, |
| | | d.STATUS as deviceStatus, |
| | | pro.STATUS as projectStatus |
| | | pro.STATUS as projectStatus, |
| | | re.id as reportId |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | SgProjectPersonConfigDO selectByUserId(@Param("userId") Long reportUser); |
| | | |
| | | List<String> getRoleList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectRolePersonV0> getList(@Param("dto") ProjectSearchDTO searchDTO); |
| | | } |
| | |
| | | and pro.id = #{dto.projectId} |
| | | </if> |
| | | </select> |
| | | <select id="getList" resultType="cn.gistack.sm.sg.DO.SgProjectRolePersonV0"> |
| | | SELECT |
| | | DISTINCT |
| | | sgc.role_id as roleId, |
| | | pro.id as projectId, |
| | | pro.project_name, |
| | | ro.role_name |
| | | -- d.id as device_id, |
| | | -- d.device_name |
| | | , sppc.user_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.blade_user bu on sppc.user_id = bu.id |
| | | where 1=1 and pro.id = #{dto.projectId} |
| | | </select> |
| | | </mapper> |
| | |
| | | Map<String, Long> statusCount(ProjectSearchDTO searchDTO); |
| | | |
| | | boolean checkStep(Long deviceId, Long stepId); |
| | | |
| | | IPage<SgProgressReportVO> progressPage(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO); |
| | | |
| | | String getDeviceReport(Long deviceId, Long stepId); |
| | | } |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | |
| | | List<String> getRoleList(ProjectSearchDTO searchDTO); |
| | | |
| | | void add(List<SgProjectPersonConfigDO> list); |
| | | void add(List<SgProjectPersonConfigDO> list); |
| | | |
| | | void getList(ProjectSearchDTO searchDTO); |
| | | |
| | | List<SgProjectRolePersonV0> getList(ProjectSearchDTO searchDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SgProgressReportVO> progressPage(IPage<SgProgressReportVO> page, ProjectSearchDTO searchDTO) { |
| | | Long userId = AuthUtil.getUserId(); |
| | | searchDTO.setUserId(userId); |
| | | List<SgProgressReportVO> list = sgProgressReportMapper.queryList(page, searchDTO); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | | public String getDeviceReport(Long gxDeviceId, Long gxStepId) { |
| | | QueryWrapper<SgProgressReportDO> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("gx_device_id",gxDeviceId); |
| | | if (gxStepId!=null){ |
| | | wrapper.eq("gx_step_id",gxStepId); |
| | | } |
| | | List<SgProgressReportDO> sgProgressReportDOS = sgProgressReportMapper.selectList(wrapper); |
| | | if (CollectionUtils.isNotEmpty(sgProgressReportDOS)){ |
| | | sgProgressReportDOS.sort((u1, u2) -> u2.getCreateTime().compareTo(u1.getCreateTime())); |
| | | return sgProgressReportDOS.get(0).getId().toString(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | sgDeviceDO.setId(dId); |
| | | sgDeviceDO.setDeviceName(deList.get(0).getDeviceName()); |
| | | sgDeviceDO.setStatus( deList.get(0).getDeviceStatus()); |
| | | sgDeviceDO.setStepDOList(deList.stream().map(s->SgGxStepDO.builder().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()).approvalStatus(s.getReportStatus()).build()).collect(Collectors.toList())); |
| | | deviceDOS.add(sgDeviceDO); |
| | | } |
| | | typeVO.setDeviceDOS(deviceDOS); |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgProjectPersonConfigDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectRolePersonV0; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.mapper.SgProjectPersonConfigMapper; |
| | | import cn.gistack.sm.sg.service.SgProjectPersonConfigService; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void getList(ProjectSearchDTO searchDTO) { |
| | | |
| | | public List<SgProjectRolePersonV0> getList(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectRolePersonV0> list = projectPersonConfigMapper.getList(searchDTO); |
| | | return list; |
| | | } |
| | | } |