From 32c620d74a20c6db0017679f8bb22bd3671b9595 Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期一, 21 二月 2022 14:33:07 +0800
Subject: [PATCH] 开发环境代码提交
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java | 267 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 178 insertions(+), 89 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java
index e0a8e39..7be2c3b 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java
@@ -1,5 +1,17 @@
package com.panzhihua.service_community.service.impl;
+import java.text.SimpleDateFormat;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import com.panzhihua.common.model.dtos.community.ComSwDangerReportEditDTO;
+import com.panzhihua.service_community.dao.ComActDAO;
+import com.panzhihua.service_community.model.dos.ComSwSafetyWorkRecordDO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,13 +20,11 @@
import com.panzhihua.common.model.dtos.community.ComSwDangerReportHandleDTO;
import com.panzhihua.common.model.dtos.community.ComSwDangerReportRectifyDTO;
import com.panzhihua.common.model.dtos.community.ComSwPatrolRecordPageDTO;
-import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
-import com.panzhihua.common.model.vos.community.ComMngCarExcelVO;
import com.panzhihua.common.model.vos.community.ComSwDangerReportExcelVO;
import com.panzhihua.common.model.vos.community.ComSwDangerReportVO;
-import com.panzhihua.common.model.vos.community.ComSwSafetyWorkRecordVO;
import com.panzhihua.common.service.user.UserService;
+import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComSwDangerReportDAO;
import com.panzhihua.service_community.dao.ComSwPatrolRecordDAO;
@@ -22,18 +32,9 @@
import com.panzhihua.service_community.model.dos.ComSwDangerReportDO;
import com.panzhihua.service_community.model.dos.ComSwPatrolRecordDO;
import com.panzhihua.service_community.model.dos.ComSwPatrolRecordReportDO;
-import com.panzhihua.service_community.model.dos.ComSwSafetyWorkRecordDO;
import com.panzhihua.service_community.service.ComSwDangerReportService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-import javax.annotation.Resource;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import lombok.extern.slf4j.Slf4j;
/**
* @auther txb
@@ -42,7 +43,8 @@
*/
@Slf4j
@Service
-public class ComSwDangerReportServiceImpl extends ServiceImpl<ComSwDangerReportDAO, ComSwDangerReportDO> implements ComSwDangerReportService {
+public class ComSwDangerReportServiceImpl extends ServiceImpl<ComSwDangerReportDAO, ComSwDangerReportDO>
+ implements ComSwDangerReportService {
@Resource
private ComSwDangerReportDAO comSwDangerReportDAO;
@@ -55,6 +57,9 @@
@Resource
private UserService userService;
+
+ @Resource
+ private ComActDAO comActDAO;
@Override
public R pageDangerReport(ComSwPatrolRecordPageDTO comSwPatrolRecordPageDTO) {
@@ -73,20 +78,21 @@
IPage<ComSwDangerReportVO> iPage = comSwDangerReportDAO.pageDangerReport(page, comSwPatrolRecordPageDTO);
if (!iPage.getRecords().isEmpty()) {
iPage.getRecords().forEach(comSwDangerReportVO -> {
- if (StringUtils.isNotEmpty(comSwDangerReportVO.getStatus()) && "2".equals(comSwDangerReportVO.getStatus())) {
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getStatus())
+ && "2".equals(comSwDangerReportVO.getStatus())) {
comSwDangerReportVO.setIsAssign(ComSwDangerReportVO.isOk.yes);
- }else {
+ } else {
comSwDangerReportVO.setIsAssign(ComSwDangerReportVO.isOk.no);
}
StringBuilder patrolNameString = new StringBuilder();
StringBuilder patrolPhoneString = new StringBuilder();
- //巡查人员id查询巡查人员的名字和电话
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolPerson())){
+ // 巡查人员id查询巡查人员的名字和电话
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolPerson())) {
String[] patrolIds = comSwDangerReportVO.getPatrolPerson().split(",");
- for (int i = 0; i < patrolIds.length ; i++) {
- Map<String,String> leader = comSwPatrolRecordDAO.getPbServiceTeamById(patrolIds[i]);
- if(leader != null){
- if(i != 0){
+ for (int i = 0; i < patrolIds.length; i++) {
+ Map<String, String> leader = comSwPatrolRecordDAO.getPbServiceTeamById(patrolIds[i]);
+ if (leader != null) {
+ if (i != 0) {
patrolNameString.append(",");
patrolPhoneString.append(",");
}
@@ -97,15 +103,15 @@
comSwDangerReportVO.setPPersonName(patrolNameString.toString());
comSwDangerReportVO.setPPersonPhone(patrolPhoneString.toString());
}
- //整改人员id查询整改人员的名字和电话
+ // 整改人员id查询整改人员的名字和电话
StringBuilder dangerNameString = new StringBuilder();
StringBuilder dangerPhoneString = new StringBuilder();
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())){
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())) {
String[] dangerIds = comSwDangerReportVO.getRectifyPerson().split(",");
- for (int i = 0; i < dangerIds.length ; i++) {
- Map<String,String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
- if(person != null){
- if(i != 0){
+ for (int i = 0; i < dangerIds.length; i++) {
+ Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
+ if (person != null) {
+ if (i != 0) {
dangerNameString.append(",");
dangerPhoneString.append(",");
}
@@ -122,69 +128,124 @@
}
@Override
+ public R editDangerReport(ComSwDangerReportEditDTO comSwDangerReportEditDTO) {
+ ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(comSwDangerReportEditDTO.getId());
+ if (null == comSwDangerReportDO) {
+ return R.fail("该隐患报告不存在");
+ }
+ BeanUtils.copyProperties(comSwDangerReportEditDTO, comSwDangerReportDO);
+ comSwDangerReportDO.setDangerType(comSwDangerReportEditDTO.getPatrolType());
+ ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>()
+ .lambda().eq(ComSwPatrolRecordReportDO::getReportId, comSwDangerReportEditDTO.getId()));
+ ComSwPatrolRecordDO comSwPatrolRecordDO = new ComSwPatrolRecordDO();
+ if (null != comSwPatrolRecordReportDO) {
+ comSwPatrolRecordDO = comSwPatrolRecordDAO.selectOne(new QueryWrapper<ComSwPatrolRecordDO>()
+ .lambda().eq(ComSwPatrolRecordDO::getId, comSwPatrolRecordReportDO.getPatrolRecordId()));
+ Long id = comSwPatrolRecordDO.getId();
+ BeanUtils.copyProperties(comSwDangerReportEditDTO, comSwPatrolRecordDO);
+ comSwPatrolRecordDO.setId(id);
+ try {
+ comSwPatrolRecordDO.setPatrolTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwDangerReportEditDTO.getPatrolTime()));
+ comSwPatrolRecordDO.setSuccessionTime(new SimpleDateFormat("yyyy-MM-dd").parse(comSwDangerReportEditDTO.getSuccessionTime()));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ // 根据传递的巡查人员id查询巡查人员的名字和电话
+ StringBuilder nameString = new StringBuilder();
+ StringBuilder phoneString = new StringBuilder();
+ if (StringUtils.isNotEmpty(comSwDangerReportEditDTO.getPatrolPerson())) {
+ String[] personIds = comSwDangerReportEditDTO.getPatrolPerson().split(",");
+ for (int i = 0; i < personIds.length; i++) {
+ Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]);
+ if (person != null) {
+ if (i != 0) {
+ nameString.append(",");
+ phoneString.append(",");
+ }
+ nameString.append(person.get("name"));
+ phoneString.append(person.get("phone"));
+ }
+ }
+ comSwPatrolRecordDO.setPersonName(nameString.toString());
+ comSwPatrolRecordDO.setPersonPhone(phoneString.toString());
+ }
+ }
+ comSwPatrolRecordDAO.updateById(comSwPatrolRecordDO);
+ comSwDangerReportDAO.updateById(comSwDangerReportDO);
+ return R.ok();
+ }
+
+ @Override
public R detailDangerReport(Long dangerReportId) {
ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(dangerReportId);
if (null == comSwDangerReportDO) {
return R.fail("该隐患报告不存在");
}
ComSwDangerReportVO comSwDangerReportVO = new ComSwDangerReportVO();
- ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>().lambda().eq(ComSwPatrolRecordReportDO::getReportId, dangerReportId));
+ ComSwPatrolRecordReportDO comSwPatrolRecordReportDO =
+ comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>().lambda()
+ .eq(ComSwPatrolRecordReportDO::getReportId, dangerReportId));
if (null != comSwPatrolRecordReportDO) {
- ComSwPatrolRecordDO comSwPatrolRecordDO = comSwPatrolRecordDAO.selectById(comSwPatrolRecordReportDO.getPatrolRecordId());
+ ComSwPatrolRecordDO comSwPatrolRecordDO =
+ comSwPatrolRecordDAO.selectById(comSwPatrolRecordReportDO.getPatrolRecordId());
BeanUtils.copyProperties(comSwPatrolRecordDO, comSwDangerReportVO);
+ comSwDangerReportVO.setPatrolTime(new SimpleDateFormat("yyyy-MM-dd").format(comSwPatrolRecordDO.getPatrolTime()));
}
BeanUtils.copyProperties(comSwDangerReportDO, comSwDangerReportVO);
- //组装巡查类型
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolType())){
+ // 组装巡查类型
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolType())) {
StringBuilder sb = new StringBuilder();
- String patrolTypes[] = comSwDangerReportVO.getPatrolType().split(",");
+ String[] patrolTypes = comSwDangerReportVO.getPatrolType().split(",");
for (int i = 0; i < patrolTypes.length; i++) {
- if(i != 0){
+ if (i != 0) {
sb.append(",");
}
- if(patrolTypes[i].equals("1")){
+ if (patrolTypes[i].equals("1")) {
sb.append("防火巡查");
- }else if(patrolTypes[i].equals("2")){
+ } else if (patrolTypes[i].equals("2")) {
sb.append("防汛巡查");
- }else if(patrolTypes[i].equals("3")){
+ } else if (patrolTypes[i].equals("3")) {
sb.append("防疫巡查");
}
}
comSwDangerReportVO.setPatrolType(sb.toString());
}
- //查询整改人员信息
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())){
+ // 查询整改人员信息
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())) {
StringBuilder sb = new StringBuilder();
- String personIds[] = comSwDangerReportVO.getRectifyPerson().split(",");
+ String[] personIds = comSwDangerReportVO.getRectifyPerson().split(",");
for (int i = 0; i < personIds.length; i++) {
- if(i != 0){
+ if (i != 0) {
sb.append(",");
}
- Map<String,String> personMap = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]);
- if(personMap != null){
+ Map<String, String> personMap = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]);
+ if (personMap != null) {
sb.append(personMap.get("name"));
}
}
comSwDangerReportVO.setPersonName(sb.toString());
}
- //查询填报人名称
- if(comSwDangerReportVO.getCreateBy() != null){
+ // 查询填报人名称
+ if (comSwDangerReportVO.getCreateBy() != null) {
comSwDangerReportVO.setCreateName(comSwPatrolRecordDAO.getCreateName(comSwDangerReportVO.getCreateBy()));
}
- //查询指派人名称
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getAssignPerson())){
+ // 所属社区名称
+ comSwDangerReportVO.setCommunityName(comActDAO.selectById(comSwDangerReportVO.getCommunityId()).getName());
+
+ // 查询指派人名称
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getAssignPerson())) {
StringBuilder sb = new StringBuilder();
- String personIds[] = comSwDangerReportVO.getAssignPerson().split(",");
+ String[] personIds = comSwDangerReportVO.getAssignPerson().split(",");
for (int i = 0; i < personIds.length; i++) {
- if(i != 0){
+ if (i != 0) {
sb.append(",");
}
- Map<String,String> personMap = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]);
- if(personMap != null){
+ Map<String, String> personMap = comSwPatrolRecordDAO.getPbServiceTeamById(personIds[i]);
+ if (personMap != null) {
sb.append(personMap.get("name"));
}
}
@@ -193,13 +254,13 @@
StringBuilder patrolNameString = new StringBuilder();
StringBuilder patrolPhoneString = new StringBuilder();
- //巡查人员id查询巡查人员的名字和电话
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolPerson())){
+ // 巡查人员id查询巡查人员的名字和电话
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolPerson())) {
String[] patrolIds = comSwDangerReportVO.getPatrolPerson().split(",");
- for (int i = 0; i < patrolIds.length ; i++) {
- Map<String,String> leader = comSwPatrolRecordDAO.getPbServiceTeamById(patrolIds[i]);
- if(leader != null){
- if(i != 0){
+ for (int i = 0; i < patrolIds.length; i++) {
+ Map<String, String> leader = comSwPatrolRecordDAO.getPbServiceTeamById(patrolIds[i]);
+ if (leader != null) {
+ if (i != 0) {
patrolNameString.append(",");
patrolPhoneString.append(",");
}
@@ -210,15 +271,15 @@
comSwDangerReportVO.setPPersonName(patrolNameString.toString());
comSwDangerReportVO.setPPersonPhone(patrolPhoneString.toString());
}
- //整改人员id查询整改人员的名字和电话
+ // 整改人员id查询整改人员的名字和电话
StringBuilder dangerNameString = new StringBuilder();
StringBuilder dangerPhoneString = new StringBuilder();
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())){
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())) {
String[] dangerIds = comSwDangerReportVO.getRectifyPerson().split(",");
- for (int i = 0; i < dangerIds.length ; i++) {
- Map<String,String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
- if(person != null){
- if(i != 0){
+ for (int i = 0; i < dangerIds.length; i++) {
+ Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
+ if (person != null) {
+ if (i != 0) {
dangerNameString.append(",");
dangerPhoneString.append(",");
}
@@ -236,13 +297,16 @@
@Override
public R detailDangerReportByPrId(Long patrolRecordId) {
ComSwPatrolRecordDO comSwPatrolRecordDO = comSwPatrolRecordDAO.selectById(patrolRecordId);
- if(comSwPatrolRecordDO == null){
+ if (comSwPatrolRecordDO == null) {
return R.fail("该隐患报告不存在");
}
ComSwDangerReportVO comSwDangerReportVO = new ComSwDangerReportVO();
- ComSwPatrolRecordReportDO comSwPatrolRecordReportDO = comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>().lambda().eq(ComSwPatrolRecordReportDO::getPatrolRecordId, patrolRecordId));
+ ComSwPatrolRecordReportDO comSwPatrolRecordReportDO =
+ comSwPatrolRecordReportDAO.selectOne(new QueryWrapper<ComSwPatrolRecordReportDO>().lambda()
+ .eq(ComSwPatrolRecordReportDO::getPatrolRecordId, patrolRecordId));
if (null != comSwPatrolRecordReportDO) {
- ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(comSwPatrolRecordReportDO.getReportId());
+ ComSwDangerReportDO comSwDangerReportDO =
+ comSwDangerReportDAO.selectById(comSwPatrolRecordReportDO.getReportId());
if (null == comSwDangerReportDO) {
return R.fail("该隐患报告不存在");
}
@@ -251,13 +315,13 @@
BeanUtils.copyProperties(comSwPatrolRecordDO, comSwDangerReportVO);
StringBuilder patrolNameString = new StringBuilder();
StringBuilder patrolPhoneString = new StringBuilder();
- //巡查人员id查询巡查人员的名字和电话
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolPerson())){
+ // 巡查人员id查询巡查人员的名字和电话
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getPatrolPerson())) {
String[] patrolIds = comSwDangerReportVO.getPatrolPerson().split(",");
- for (int i = 0; i < patrolIds.length ; i++) {
- Map<String,String> leader = comSwPatrolRecordDAO.getPbServiceTeamById(patrolIds[i]);
- if(leader != null){
- if(i != 0){
+ for (int i = 0; i < patrolIds.length; i++) {
+ Map<String, String> leader = comSwPatrolRecordDAO.getPbServiceTeamById(patrolIds[i]);
+ if (leader != null) {
+ if (i != 0) {
patrolNameString.append(",");
patrolPhoneString.append(",");
}
@@ -268,15 +332,15 @@
comSwDangerReportVO.setPPersonName(patrolNameString.toString());
comSwDangerReportVO.setPPersonPhone(patrolPhoneString.toString());
}
- //整改人员id查询整改人员的名字和电话
+ // 整改人员id查询整改人员的名字和电话
StringBuilder dangerNameString = new StringBuilder();
StringBuilder dangerPhoneString = new StringBuilder();
- if(StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())){
+ if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyPerson())) {
String[] dangerIds = comSwDangerReportVO.getRectifyPerson().split(",");
- for (int i = 0; i < dangerIds.length ; i++) {
- Map<String,String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
- if(person != null){
- if(i != 0){
+ for (int i = 0; i < dangerIds.length; i++) {
+ Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
+ if (person != null) {
+ if (i != 0) {
dangerNameString.append(",");
dangerPhoneString.append(",");
}
@@ -292,12 +356,18 @@
@Override
public R handleDangerReport(ComSwDangerReportHandleDTO comSwDangerReportHandleDTO) {
- ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(comSwDangerReportHandleDTO.getDangerReportId());
+ ComSwDangerReportDO comSwDangerReportDO =
+ comSwDangerReportDAO.selectById(comSwDangerReportHandleDTO.getDangerReportId());
if (null == comSwDangerReportDO) {
return R.fail("该隐患报告不存在");
}
BeanUtils.copyProperties(comSwDangerReportHandleDTO, comSwDangerReportDO);
comSwDangerReportDO.setStatus(String.valueOf(SafeWordStatusEnum.YCL.getCode()));
+ ComSwDangerReportDO comSwDangerReportDO1 =
+ comSwDangerReportDAO.selectById(comSwDangerReportHandleDTO.getDangerReportId());
+ if (!comSwDangerReportDO1.getStatus().equals(String.valueOf(SafeWordStatusEnum.DCL.getCode()))) {
+ return R.fail("该隐患报告已处理,请勿重复操作");
+ }
int update = comSwDangerReportDAO.updateById(comSwDangerReportDO);
if (update > 0) {
return R.ok();
@@ -307,12 +377,19 @@
@Override
public R rectifyDangerReport(ComSwDangerReportRectifyDTO comSwDangerReportRectifyDTO) {
- ComSwDangerReportDO comSwDangerReportDO = comSwDangerReportDAO.selectById(comSwDangerReportRectifyDTO.getDangerReportId());
+ ComSwDangerReportDO comSwDangerReportDO =
+ comSwDangerReportDAO.selectById(comSwDangerReportRectifyDTO.getDangerReportId());
if (null == comSwDangerReportDO) {
return R.fail("该隐患报告不存在");
}
BeanUtils.copyProperties(comSwDangerReportRectifyDTO, comSwDangerReportDO);
comSwDangerReportDO.setStatus(String.valueOf(SafeWordStatusEnum.YZG.getCode()));
+ comSwDangerReportDO.setRectifyTime(DateUtils.getCurrentDateStr());
+ ComSwDangerReportDO comSwDangerReportDO1 =
+ comSwDangerReportDAO.selectById(comSwDangerReportRectifyDTO.getDangerReportId());
+ if (comSwDangerReportDO1.getStatus().equals(String.valueOf(SafeWordStatusEnum.YZG.getCode()))) {
+ return R.fail("该隐患报告已整改,请勿重复操作");
+ }
int update = comSwDangerReportDAO.updateById(comSwDangerReportDO);
if (update > 0) {
return R.ok();
@@ -323,15 +400,27 @@
@Override
public R exportDangerReport(List<Long> dangerReportIds) {
List<ComSwDangerReportExcelVO> list = comSwDangerReportDAO.exportDangerReport(dangerReportIds);
-// list.forEach(comSwDangerReportExcelVO -> {
-// List<String> patrolUserIds = Arrays.asList(comSwDangerReportExcelVO.getPatrolPerson().split(","));
-// List<String> patrolPhones = new ArrayList<>();
-// for (String userId : patrolUserIds) {
-// LoginUserInfoVO loginUserInfoVO = userService.getUserInfoByUserId(userId).getData();
-// patrolPhones.add(loginUserInfoVO.getPhone());
-// }
-// comSwDangerReportExcelVO.setPatrolPersonPhone(StringUtils.join(patrolPhones,","));
-// });
+ list.forEach(comSwDangerReportExcelVO -> {
+ // 整改人员id查询整改人员的名字和电话
+ StringBuilder dangerNameString = new StringBuilder();
+ StringBuilder dangerPhoneString = new StringBuilder();
+ if (StringUtils.isNotEmpty(comSwDangerReportExcelVO.getDpersonName())) {
+ String[] dangerIds = comSwDangerReportExcelVO.getDpersonName().split(",");
+ for (int i = 0; i < dangerIds.length; i++) {
+ Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]);
+ if (person != null) {
+ if (i != 0) {
+ dangerNameString.append(",");
+ dangerPhoneString.append(",");
+ }
+ dangerNameString.append(person.get("name"));
+ dangerPhoneString.append(person.get("phone"));
+ }
+ }
+ comSwDangerReportExcelVO.setDpersonName(dangerNameString.toString());
+ comSwDangerReportExcelVO.setDpersonPhone(dangerPhoneString.toString());
+ }
+ });
return R.ok(list);
}
}
--
Gitblit v1.7.1