| | |
| | | |
| | | @Override |
| | | public R pagePatrolRecord(ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) { |
| | | //是否是查询自己的巡查记录 |
| | | if(StringUtils.isNotEmpty(comSwPatrolRecordPageDTO.getPatrolPerson())){ |
| | | Map<String,Object> map = comSwPatrolRecordDAO.getPbServiceTeamCardNo(comSwPatrolRecordPageDTO.getPatrolPerson()); |
| | | if(map != null){ |
| | | comSwPatrolRecordPageDTO.setPatrolPerson(map.get("id").toString()); |
| | | } |
| | | } |
| | | IPage<ComSwPatrolRecordVO> iPage = comSwPatrolRecordDAO.pagePatrolRecord(new Page(comSwPatrolRecordPageDTO.getPageNum(),comSwPatrolRecordPageDTO.getPageSize()), comSwPatrolRecordPageDTO); |
| | | if(!iPage.getRecords().isEmpty()){ |
| | | iPage.getRecords().forEach(patrol -> { |
| | |
| | | .lambda().eq(ComSwPatrolRecordReportDO::getPatrolRecordId,patrol.getId())); |
| | | if(recordReportDO != null){ |
| | | patrol.setServiceId(recordReportDO.getReportId()); |
| | | if (null != comSwDangerReportDAO.selectById(recordReportDO.getReportId())) { |
| | | patrol.setDangerOrRecord(1); |
| | | }else{ |
| | | patrol.setDangerOrRecord(2); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | |
| | | Long patrolRecordReport = Snowflake.getId(); |
| | | comSwPatrolRecordReportDO.setId(patrolRecordReport); |
| | | comSwPatrolRecordReportDO.setPatrolRecordId(patrolRecordId); |
| | | if(StringUtils.isNotEmpty(comSwPatrolRecordAddDTO.getDangerDescription())){ |
| | | comSwPatrolRecordAddDTO.setDagerDescription(comSwPatrolRecordAddDTO.getDangerDescription()); |
| | | } |
| | | if(StringUtils.isNotEmpty(comSwPatrolRecordAddDTO.getDagerName())){ |
| | | comSwPatrolRecordAddDTO.setDangerName(comSwPatrolRecordAddDTO.getDagerName()); |
| | | } |
| | | if (comSwPatrolRecordAddDTO.getIsHiddenDanger().intValue() == ComSwPatrolRecordAddDTO.isOk.yes) { |
| | | //如果存在安全隐患,自动生成安全隐患报告 |
| | | ComSwDangerReportDO comSwDangerReportDO = new ComSwDangerReportDO(); |