| | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @auther txb |
| | |
| | | BeanUtils.copyProperties(comSwPatrolRecordDO, comSwDangerReportVO); |
| | | } |
| | | BeanUtils.copyProperties(comSwDangerReportDO, comSwDangerReportVO); |
| | | |
| | | //组装巡查类型 |
| | | if(StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolType())){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | String patrolTypes[] = comSwDangerReportVO.getPatrolType().split(","); |
| | | for (int i = 0; i < patrolTypes.length; i++) { |
| | | if(i != 0){ |
| | | sb.append(","); |
| | | } |
| | | if(patrolTypes[i].equals("1")){ |
| | | sb.append("防火巡查"); |
| | | }else if(patrolTypes[i].equals("2")){ |
| | | sb.append("防汛巡查"); |
| | | }else if(patrolTypes[i].equals("3")){ |
| | | sb.append("防疫巡查"); |
| | | } |
| | | } |
| | | comSwDangerReportVO.setPatrolType(sb.toString()); |
| | | } |
| | | |
| | | //查询人员信息 |
| | | if(StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | String personIds[] = comSwDangerReportVO.getRectifyPerson().split(","); |
| | | for (int i = 0; i < personIds.length; i++) { |
| | | if(i != 0){ |
| | | sb.append(","); |
| | | } |
| | | Map<String,String> personMap = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]); |
| | | if(personMap != null){ |
| | | sb.append(personMap.get("name")); |
| | | } |
| | | } |
| | | comSwDangerReportVO.setPersonName(sb.toString()); |
| | | } |
| | | |
| | | //查询填报人名称 |
| | | if(comSwDangerReportVO.getCreateBy() != null){ |
| | | comSwDangerReportVO.setCreateName(comSwPatrolRecordDAO.getCreateName(comSwDangerReportVO.getCreateBy())); |
| | | } |
| | | |
| | | //查询指派人名称 |
| | | if(StringUtils.isNotEmpty(comSwDangerReportVO.getAssignPerson())){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | String personIds[] = comSwDangerReportVO.getAssignPerson().split(","); |
| | | for (int i = 0; i < personIds.length; i++) { |
| | | if(i != 0){ |
| | | sb.append(","); |
| | | } |
| | | Map<String,String> personMap = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]); |
| | | if(personMap != null){ |
| | | sb.append(personMap.get("name")); |
| | | } |
| | | } |
| | | comSwDangerReportVO.setAssignPersonName(sb.toString()); |
| | | } |
| | | |
| | | //查询巡查人员 |
| | | Map<String,String> map = comSwPatrolRecordDAO.getPatrolPersonName(comSwDangerReportVO.getId()); |
| | | if(map != null){ |
| | | comSwDangerReportVO.setPatrolName(map.get("person_name")); |
| | | } |
| | | |
| | | return R.ok(comSwDangerReportVO); |
| | | } |
| | | |
| | | @Override |
| | | public R detailDangerReportByPrId(Long patrolRecordId) { |
| | | ComSwPatrolRecordDO comSwPatrolRecordDO = comSwPatrolRecordDAO.selectById(patrolRecordId); |
| | | if(comSwPatrolRecordDO == null){ |
| | | return R.fail("该隐患报告不存在"); |
| | | } |
| | | ComSwDangerReportVO comSwDangerReportVO = new ComSwDangerReportVO(); |
| | | ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>().lambda().eq(ComSwPatrolRecordReportDO::getPatrolRecordId, patrolRecordId)); |
| | | if (null != comSwPatrolRecordReportDO) { |