From ccd28a0c35e8fff74da6ef63042fb8a896d78f7f Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 29 六月 2022 09:45:52 +0800
Subject: [PATCH] 单位服务统计

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java |  317 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 300 insertions(+), 17 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
index 94df2de..5507439 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java
@@ -1,5 +1,6 @@
 package com.panzhihua.service_community.service.impl;
 
+import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -8,29 +9,32 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.panzhihua.common.model.dtos.community.acid.ComActAcidRecordDTO;
-import com.panzhihua.common.model.dtos.property.CommonPage;
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.vos.community.acid.*;
+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.ComActAcidDangerMemberDao;
+import com.panzhihua.service_community.dao.*;
 import com.panzhihua.service_community.entity.ComActAcidDangerMember;
 import com.panzhihua.service_community.entity.ComActAcidRecord;
-import com.panzhihua.service_community.dao.ComActAcidRecordDao;
+import com.panzhihua.service_community.entity.ComActAcidUpdateRecord;
 import com.panzhihua.service_community.service.ComActAcidRecordService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.annotation.Resource;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
 import static com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNotEmpty;
 import static com.baomidou.mybatisplus.core.toolkit.ObjectUtils.isNull;
+import static org.apache.commons.lang3.StringUtils.isBlank;
 
 /**
  * (ComActAcidRecord)表服务实现类
@@ -48,6 +52,14 @@
     private RabbitTemplate rabbitTemplate;
     @Resource
     private ComActAcidDangerMemberDao comActAcidDangerMemberDao;
+    @Resource
+    private UserService userService;
+    @Resource
+    private ComActDAO comActDAO;
+    @Resource
+    private ComActAcidUpdateRecordDao comActAcidUpdateRecordDao;
+    @Resource
+    private ComAreaTownCommunityDao comAreaTownCommunityDao;
 
     @Override
     public R pageList(ComActAcidRecordDTO comActAcidRecordDTO) {
@@ -56,7 +68,32 @@
 
     @Override
     public R export(ComActAcidRecordDTO comActAcidRecordDTO) {
-        List<ComActAcidRecordExcelVO> comActAcidRecordExcelVOS=this.baseMapper.export(comActAcidRecordDTO);
+        List<ComActAcidRecordExcelReturn> comActAcidRecordExcelVOS=this.baseMapper.export(comActAcidRecordDTO);
+        comActAcidRecordExcelVOS.forEach(comActAcidRecordExcelVO -> {
+            if(StringUtils.isNotEmpty(comActAcidRecordExcelVO.getTouristCity())&&comActAcidRecordExcelVO.getTouristCity().contains("[")){
+                JSONArray jsonArray = JSON.parseArray(comActAcidRecordExcelVO.getTouristCity());
+                if(jsonArray.isEmpty()){
+                    comActAcidRecordExcelVO.setTouristCity("");
+                }
+                else {
+                    StringBuilder touristCity= new StringBuilder();
+                    for(int i=0;i<jsonArray.size();i++){
+                        JSONObject jsonObject=jsonArray.getJSONObject(i);
+                        String name=jsonObject.getString("name");
+                        if(StringUtils.isNotEmpty(name)){
+                            touristCity.append(name).append(";");
+                        }
+                    }
+                    comActAcidRecordExcelVO.setTouristCity(touristCity.toString());
+                }
+            }
+        });
+        return R.ok(comActAcidRecordExcelVOS);
+    }
+
+    @Override
+    public R exportNew(ComActAcidRecordDTO comActAcidRecordDTO) {
+        List<ComActAcidRecordExcelReturn> comActAcidRecordExcelVOS=this.baseMapper.exportNew(comActAcidRecordDTO);
         comActAcidRecordExcelVOS.forEach(comActAcidRecordExcelVO -> {
             if(StringUtils.isNotEmpty(comActAcidRecordExcelVO.getTouristCity())&&comActAcidRecordExcelVO.getTouristCity().contains("[")){
                 JSONArray jsonArray = JSON.parseArray(comActAcidRecordExcelVO.getTouristCity());
@@ -82,15 +119,18 @@
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R insertRecord(ComActAcidRecordVO comActAcidRecordVO) {
-        Integer count= this.baseMapper.selectCount(new QueryWrapper<ComActAcidRecord>().lambda().eq(ComActAcidRecord::getIdCard,comActAcidRecordVO.getIdCard()).ge(ComActAcidRecord::getCreateTime, DateUtils.getCurrentDate(DateUtils.yyyyMMdd_format)));
+        Integer count= this.baseMapper.selectCount(new QueryWrapper<ComActAcidRecord>().lambda().eq(ComActAcidRecord::getIsDel,0).eq(ComActAcidRecord::getIdCard,comActAcidRecordVO.getIdCard()).ge(ComActAcidRecord::getCreateTime, DateUtils.getCurrentDate(DateUtils.yyyyMMdd_format)));
         if(count>0){
             return R.fail("请勿重复提交");
         }
         if(StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())){
             rabbitTemplate.convertAndSend("huacheng.acid.exchange", "huacheng.acid.key", comActAcidRecordVO, message -> {
-                message.getMessageProperties().setHeader("x-delay", 24*60*60*1000);
+                message.getMessageProperties().setHeader("x-delay", 2*60*60*1000);
                 return message;
             });
+        }
+        else {
+            rabbitTemplate.convertAndSend("huacheng.acid.direct.exchange", "huacheng.acid.direct.key", comActAcidRecordVO);
         }
         ComActAcidRecord comActAcidRecord=new ComActAcidRecord();
         BeanUtils.copyProperties(comActAcidRecordVO,comActAcidRecord);
@@ -105,12 +145,13 @@
             if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是")
                     || dangerArea.equals("是") || outsideCity.equals("是") || acidTest.equals("阳性")) {
                 //风险人员
-                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1);
+                String riskType = retrieveRiskType(colorMark, travelCard, dangerArea, outsideCity, acidTest);
+                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1, riskType);
                 return R.ok();
             }
             if (StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())) {
                 //未填住址人员
-                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2);
+                saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2, null);
             }
             return R.ok();
         }
@@ -118,23 +159,50 @@
         return R.fail("操作失败,请重新尝试");
     }
 
-    private void saveAcidDangerMember(ComActAcidRecordVO comActAcidRecordVO, Long recordId, Integer type) {
+    private String retrieveRiskType(String colorMark, String travelCard, String dangerArea, String outsideCity, String acidTest) {
+        StringBuilder riskType = new StringBuilder();
+        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码")) {
+            riskType.append(",");
+            riskType.append(ComActAcidDangerMember.RiskType.COLOR);
+        }
+        if (travelCard.equals("是")) {
+            riskType.append(",");
+            riskType.append(ComActAcidDangerMember.RiskType.STAR);
+        }
+        if (dangerArea.equals("是")) {
+            riskType.append(",");
+            riskType.append(ComActAcidDangerMember.RiskType.HIGH);
+        }
+        if (outsideCity.equals("是")) {
+            riskType.append(",");
+            riskType.append(ComActAcidDangerMember.RiskType.OUT);
+        }
+        if (acidTest.equals("阳性")) {
+            riskType.append(",");
+            riskType.append(ComActAcidDangerMember.RiskType.TEST);
+        }
+        return riskType.substring(1);
+    }
+
+    private void saveAcidDangerMember(ComActAcidRecordVO comActAcidRecordVO, Long recordId, Integer type, String riskType) {
         String localCity = comActAcidRecordVO.getLocalCity();
         String relationName = "panzhihua";
         if (isNotEmpty(localCity)) {
             relationName = localCity;
         } else {
             String realAddress = comActAcidRecordVO.getRealAddress();
-            if (realAddress.contains("攀枝花")) {
-                if (realAddress.contains("区")) {
-                    relationName = realAddress.substring(realAddress.indexOf("市") + 1, realAddress.indexOf("区") + 1);
-                } else {
-                    relationName = realAddress.substring(realAddress.indexOf("市") + 1, realAddress.indexOf("县") + 1);
+            if(isNotEmpty(realAddress)){
+                if (realAddress.contains("攀枝花")) {
+                    if (realAddress.contains("区")) {
+                        relationName = realAddress.substring(realAddress.indexOf("市") + 1, realAddress.indexOf("区") + 1);
+                    } else {
+                        relationName = realAddress.substring(realAddress.indexOf("市") + 1, realAddress.indexOf("县") + 1);
+                    }
                 }
             }
         }
         ComActAcidDangerMember dangerMember = comActAcidDangerMemberDao.selectOne(new LambdaQueryWrapper<ComActAcidDangerMember>()
-                .eq(ComActAcidDangerMember::getIdCard, comActAcidRecordVO.getIdCard()).eq(ComActAcidDangerMember::getRelationName, relationName));
+                .eq(ComActAcidDangerMember::getIdCard, comActAcidRecordVO.getIdCard()).eq(ComActAcidDangerMember::getRecordId, recordId).orderByDesc(ComActAcidDangerMember::getCreateTime).last("limit 1"));
         if (isNull(dangerMember)) {
             dangerMember = new ComActAcidDangerMember();
             dangerMember.setName(comActAcidRecordVO.getName());
@@ -146,6 +214,7 @@
             dangerMember.setType(type);
             dangerMember.setRelationName(relationName);
             dangerMember.setCreateTime(new Date());
+            dangerMember.setRiskType(riskType);
             comActAcidDangerMemberDao.insert(dangerMember);
         } else {
             dangerMember.setName(comActAcidRecordVO.getName());
@@ -153,10 +222,10 @@
             dangerMember.setRecordId(recordId);
             dangerMember.setIdCard(comActAcidRecordVO.getIdCard());
             dangerMember.setSource(1);
-            dangerMember.setStatus(6);
             dangerMember.setType(type);
             dangerMember.setRelationName(relationName);
             dangerMember.setUpdateTime(new Date());
+            dangerMember.setRiskType(riskType);
             comActAcidDangerMemberDao.updateById(dangerMember);
         }
         ComActAcidDangerMemberVO dangerMemberVO = new ComActAcidDangerMemberVO();
@@ -177,9 +246,77 @@
     }
 
     @Override
+    public R charts(String date, String localCity) {
+        if(StringUtils.isNotEmpty(localCity)){
+            ComActAcidCharts comActAcidCharts=new ComActAcidCharts();
+            List<ComActAcidChartsVO> acidList=new ArrayList<>();
+            List<ComActAcidChartsVO> dangerList=new ArrayList<>();
+            List<ComActAcidChartsVO> checkCount=new ArrayList<>();
+            String[] area={"东区","西区","仁和区","米易县","盐边县"};
+            if("panzhihua".equals(localCity)){
+                for(String areaValue:area){
+                    ComActAcidChartsVO acid=new ComActAcidChartsVO();
+                    acid.setName(areaValue);
+                    ComActAcidChartsVO acidCount =this.baseMapper.selectAcidCount(date,areaValue);
+                    if(acidCount!=null){
+                        acid.setNumOne(acidCount.getNumOne());
+                    }
+                    acidList.add(acid);
+                    ComActAcidChartsVO danger=new ComActAcidChartsVO();
+                    danger.setName(areaValue);
+                    ComActAcidChartsVO dangerCount =this.baseMapper.selectDangerCount(date,areaValue);
+                    if(dangerCount!=null){
+                        danger.setNumOne(dangerCount.getNumOne());
+                        danger.setNumTwo(dangerCount.getNumTwo());
+                    }else{
+                        danger.setNumOne(0);
+                        danger.setNumTwo(0);
+                    }
+                    dangerList.add(danger);
+                    checkCount =this.baseMapper.selectCheck(date,localCity);
+                    if(checkCount!=null){
+                        checkCount.forEach(comActAcidChartsVO -> {
+                            if(comActAcidChartsVO.getNumTwo()!=null){
+                                comActAcidChartsVO.setPercent(new BigDecimal(comActAcidChartsVO.getNumOne())
+                                        .divide(new BigDecimal(comActAcidChartsVO.getNumTwo()), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0));
+                            }
+                        });
+                    }
+
+                }
+            }
+            if(ArrayUtil.contains(area,localCity)){
+                List<String> streets=comAreaTownCommunityDao.selectDistinctTown(localCity);
+                streets.forEach(street ->{
+                    ComActAcidChartsVO acid=new ComActAcidChartsVO();
+                    acid.setName(street);
+                    ComActAcidChartsVO acidCount =this.baseMapper.selectAcidCount(date,street);
+                    if(acidCount!=null){
+                        acid.setNumOne(acidCount.getNumOne());
+                    }
+                    acidList.add(acid);
+                    ComActAcidChartsVO danger=new ComActAcidChartsVO();
+                    danger.setName(street);
+                    ComActAcidChartsVO dangerCount =this.baseMapper.selectDangerCount(date,street);
+                    if(dangerCount!=null){
+                        danger.setNumOne(dangerCount.getNumOne());
+                        danger.setNumTwo(dangerCount.getNumTwo());
+                    }
+                    dangerList.add(danger);
+                });
+            }
+            comActAcidCharts.setAcidList(acidList);
+            comActAcidCharts.setDangerList(dangerList);
+            comActAcidCharts.setCheckList(checkCount);
+            return R.ok(comActAcidCharts);
+        }
+        return R.fail();
+    }
+
+    @Override
     public R statics(String date) {
         List<ComAcidStaticVO> comAcidStaticVOS=new ArrayList<>();
-        String[] area={"东区","西区","仁和区","米易县","盐边县","钒钛新城"};
+        String[] area={"攀枝花市","东区","西区","仁和区","米易县","盐边县","钒钛新城"};
         String[] country={"上海市","吉林省","广东省","江苏省","浙江省","山东省","湖北省","山西省","黑龙江省","广西壮族自治区","河北省","辽宁省","河南省","福建省","安徽省","南昌市","西宁市","西安市","文山州","兰州市","邵阳市"};
         for(String areaName:area){
             ComAcidStaticVO comAcidStaticVO=this.baseMapper.areaStatics(areaName,date);
@@ -197,4 +334,150 @@
         }
         return R.ok(comAcidStaticVOS);
     }
+
+    @Override
+    public R updateLocalCity(ComActAcidRecordVO comActAcidRecordVO) {
+        ComActAcidUpdateRecord comActAcidUpdateRecord=new ComActAcidUpdateRecord();
+        comActAcidUpdateRecord.setRecordId(comActAcidRecordVO.getId());
+        comActAcidUpdateRecord.setUserId(comActAcidRecordVO.getUserId());
+        comActAcidUpdateRecord.setCreateTime(new Date());
+        comActAcidUpdateRecordDao.insert(comActAcidUpdateRecord);
+        ComActAcidRecord comActAcidRecord = new ComActAcidRecord();
+        BeanUtils.copyProperties(comActAcidRecordVO, comActAcidRecord);
+        String idCard = comActAcidRecordVO.getIdCard();
+        ComActAcidRecord comActAcidRecord1 = this.baseMapper.selectById(comActAcidRecordVO.getId());
+        comActAcidRecord.setUserId(comActAcidRecord1.getUserId());
+        if (isBlank(idCard)) {
+            //只修改地址
+            if (isNull(comActAcidRecord1)) {
+                return R.fail("填报纪录不存在");
+            }
+            String localCity = comActAcidRecordVO.getLocalCity();
+            String localAddress = comActAcidRecordVO.getLocalAddress();
+            Integer checkStatus=comActAcidRecordVO.getCheckStatus();
+            String remark=comActAcidRecordVO.getRemark();
+            BeanUtils.copyProperties(comActAcidRecord1, comActAcidRecordVO);
+            if(StringUtils.isNotEmpty(localCity)){
+                comActAcidRecordVO.setLocalCity(localCity);
+            }
+            if(StringUtils.isNotEmpty(localAddress)){
+                comActAcidRecordVO.setLocalAddress(localAddress);
+            }
+            BeanUtils.copyProperties(comActAcidRecord1,comActAcidRecord);
+            if(checkStatus>0){
+                comActAcidRecord.setCheckStatus(checkStatus);
+            }
+            if(StringUtils.isNotEmpty(remark)){
+                comActAcidRecord.setRemark(remark);
+            }
+        }
+        ComActAcidDangerMember comActAcidDangerMember =
+            comActAcidDangerMemberDao.selectOne(new QueryWrapper<ComActAcidDangerMember>().lambda()
+                .eq(ComActAcidDangerMember::getRecordId, comActAcidRecordVO.getId()).orderByDesc(ComActAcidDangerMember::getCreateTime).last("limit 1"));
+        String colorMark = comActAcidRecordVO.getColorMark();
+        String travelCard = comActAcidRecordVO.getTravelCard();
+        String dangerArea = comActAcidRecordVO.getDangerArea();
+        String outsideCity = comActAcidRecordVO.getOutsideCity();
+        String acidTest = comActAcidRecordVO.getAcidTest();
+        if(StringUtils.isEmpty(acidTest)){
+            acidTest="阴性";
+        }
+        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是") || dangerArea.equals("是")
+            || outsideCity.equals("是") || acidTest.equals("阳性")) {
+            // 风险人员
+            String riskType = retrieveRiskType(colorMark, travelCard, dangerArea, outsideCity, acidTest);
+            saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1, riskType);
+        } else if (StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())) {
+            // 未填住址人员
+            saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2, null);
+        } else if (comActAcidDangerMember != null && comActAcidDangerMember.getType() == 2) {
+            this.comActAcidDangerMemberDao.deleteById(comActAcidDangerMember.getId());
+        }
+
+        return R.ok(this.baseMapper.updateById(comActAcidRecord));
+    }
+
+    @Override
+    public R updateApplets(ComActAcidRecordVO comActAcidRecordVO) {
+        ComActAcidUpdateRecord comActAcidUpdateRecord=new ComActAcidUpdateRecord();
+        comActAcidUpdateRecord.setRecordId(comActAcidRecordVO.getId());
+        comActAcidUpdateRecord.setUserId(comActAcidRecordVO.getUserId());
+        comActAcidUpdateRecord.setCreateTime(new Date());
+        comActAcidUpdateRecordDao.insert(comActAcidUpdateRecord);
+        ComActAcidRecord comActAcidRecord = new ComActAcidRecord();
+        BeanUtils.copyProperties(comActAcidRecordVO, comActAcidRecord);
+        String idCard = comActAcidRecordVO.getIdCard();
+        ComActAcidRecord comActAcidRecord1 = this.baseMapper.selectById(comActAcidRecordVO.getId());
+        comActAcidRecord.setUserId(comActAcidRecord1.getUserId());
+        if (isBlank(idCard)) {
+            //只修改核对状态
+            if (isNull(comActAcidRecord1)) {
+                return R.fail("填报纪录不存在");
+            }
+            Integer checkStatus=comActAcidRecordVO.getCheckStatus();
+            String remark=comActAcidRecordVO.getRemark();
+            BeanUtils.copyProperties(comActAcidRecord1, comActAcidRecordVO);
+            BeanUtils.copyProperties(comActAcidRecord1,comActAcidRecord);
+            if(checkStatus>0){
+                comActAcidRecord.setCheckStatus(checkStatus);
+            }
+            if(StringUtils.isNotEmpty(remark)){
+                comActAcidRecord.setRemark(remark);
+            }
+        }
+        ComActAcidDangerMember comActAcidDangerMember =
+                comActAcidDangerMemberDao.selectOne(new QueryWrapper<ComActAcidDangerMember>().lambda()
+                        .eq(ComActAcidDangerMember::getRecordId, comActAcidRecordVO.getId()).orderByDesc(ComActAcidDangerMember::getCreateTime).last("limit 1"));
+        String colorMark = comActAcidRecordVO.getColorMark();
+        String travelCard = comActAcidRecordVO.getTravelCard();
+        String dangerArea = comActAcidRecordVO.getDangerArea();
+        String outsideCity = comActAcidRecordVO.getOutsideCity();
+        String acidTest = comActAcidRecordVO.getAcidTest();
+        if (StringUtils.inStringIgnoreCase(colorMark, "红码", "黄码") || travelCard.equals("是") || dangerArea.equals("是")
+                || outsideCity.equals("是") || acidTest.equals("阳性")) {
+            // 风险人员
+            String riskType = retrieveRiskType(colorMark, travelCard, dangerArea, outsideCity, acidTest);
+            saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1, riskType);
+        } else if (StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())) {
+            // 未填住址人员
+            saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 2, null);
+        } else if (comActAcidDangerMember != null && comActAcidDangerMember.getType() == 2) {
+            this.comActAcidDangerMemberDao.deleteById(comActAcidDangerMember.getId());
+        }
+        return R.ok(this.baseMapper.updateById(comActAcidRecord));
+    }
+
+    @Override
+    public R delete(Long id) {
+        ComActAcidRecord comActAcidRecord=new ComActAcidRecord();
+        comActAcidRecord.setId(id);
+        comActAcidRecord.setIsDel(1);
+        this.baseMapper.updateById(comActAcidRecord);
+        List<ComActAcidDangerMember> comActAcidDangerMembers=this.comActAcidDangerMemberDao.selectList(new QueryWrapper<ComActAcidDangerMember>().lambda().eq(ComActAcidDangerMember::getRecordId,id));
+        comActAcidDangerMembers.forEach(comActAcidDangerMember -> {
+            comActAcidDangerMember.setIsDel(1);
+            this.comActAcidDangerMemberDao.updateById(comActAcidDangerMember);
+        });
+        return R.ok();
+    }
+
+    @Override
+    public R detailByApp(Long id,String localCity) {
+        ComActAcidRecord comActAcidRecord=this.baseMapper.selectById(id);
+        ComActAcidRecordVO comActAcidRecordVO=this.baseMapper.selectLastNext(id,localCity);
+        BeanUtils.copyProperties(comActAcidRecord,comActAcidRecordVO);
+        return R.ok(comActAcidRecordVO);
+    }
+
+    @Override
+    public R detailByCommunity(Long id) {
+        ComActAcidRecordVO comActAcidRecordVO=new ComActAcidRecordVO();
+        ComActAcidRecord comActAcidRecord= this.baseMapper.selectById(id);
+        BeanUtils.copyProperties(comActAcidRecord,comActAcidRecordVO);
+        List<ComActAcidUpdateRecordVO> comActAcidUpdateRecordList=this.comActAcidUpdateRecordDao.selectList(id);
+        if(!comActAcidUpdateRecordList.isEmpty()){
+            comActAcidRecordVO.setComActAcidUpdateRecordVOList(comActAcidUpdateRecordList);
+        }
+        return R.ok(comActAcidRecordVO);
+    }
 }

--
Gitblit v1.7.1