From ec037c17c163d88393140883856a20a62a2a0e09 Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期三, 01 九月 2021 14:53:14 +0800
Subject: [PATCH] 新增高龄老人认证基础类
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActBuildingServiceImpl.java | 51 +++++++++++++++++++++++++++++++--------------------
1 files changed, 31 insertions(+), 20 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActBuildingServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActBuildingServiceImpl.java
index aefbe50..039d939 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActBuildingServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActBuildingServiceImpl.java
@@ -1,5 +1,14 @@
package com.panzhihua.service_community.service.impl;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.annotation.Resource;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -18,20 +27,14 @@
import com.panzhihua.service_community.model.dos.GridBuildRelationDO;
import com.panzhihua.service_community.service.ComActBuildingService;
import com.panzhihua.service_community.service.GridBuildRelationService;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
/**
* @author xyh
* @date 2021/6/10 13:46
*/
@Service
-public class ComActBuildingServiceImpl extends ServiceImpl<ComMngBuildingDAO, ComMngBuildingDO> implements ComActBuildingService {
+public class ComActBuildingServiceImpl extends ServiceImpl<ComMngBuildingDAO, ComMngBuildingDO>
+ implements ComActBuildingService {
@Resource
private ComActVillageDAO comActVillageDAO;
@@ -48,35 +51,42 @@
ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO();
importErrorVO.setErrorMsg("重复楼栋");
StringBuilder sb = new StringBuilder();
- for(ComMngBuildingExcelVO vo:newVoList){
- ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getAlley()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId));
- if(comMngVillageDO == null){
+ for (ComMngBuildingExcelVO vo : newVoList) {
+ ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>()
+ .eq("alley", vo.getAlley()).eq("house_num", vo.getDoorNo()).eq("community_id", communityId));
+ if (comMngVillageDO == null) {
continue;
}
- List<ComMngBuildingDO> buildingDOList = this.baseMapper.selectList(new QueryWrapper<ComMngBuildingDO>().eq("street_id",comMngVillageDO.getStreetId()).eq("act_id",communityId).eq("village_id",comMngVillageDO.getVillageId()).eq("name",vo.getName()));
- if(buildingDOList.size() > 0){
- sb.append("街路巷:").append(vo.getAlley()).append(",门牌号:").append(vo.getDoorNo()).append(",楼栋号:").append(vo.getName()).append(";");
+ vo.setName(vo.getName().replace("栋", ""));
+ List<ComMngBuildingDO> buildingDOList = this.baseMapper.selectList(new QueryWrapper<ComMngBuildingDO>()
+ .eq("street_id", comMngVillageDO.getStreetId()).eq("act_id", communityId)
+ .eq("village_id", comMngVillageDO.getVillageId()).eq("name", vo.getName()));
+ if (buildingDOList.size() > 0) {
+ sb.append("街路巷:").append(vo.getAlley()).append(",门牌号:").append(vo.getDoorNo()).append(",楼栋号:")
+ .append(vo.getName()).append(";");
continue;
}
ComMngBuildingDO comMngBuildingDO = new ComMngBuildingDO();
- BeanUtils.copyProperties(vo,comMngBuildingDO);
+ BeanUtils.copyProperties(vo, comMngBuildingDO);
comMngBuildingDO.setActId(comMngVillageDO.getCommunityId());
comMngBuildingDO.setStreetId(comMngVillageDO.getStreetId());
comMngBuildingDO.setVillageId(comMngVillageDO.getVillageId());
ComActDO actDO = comActDAO.selectById(comMngVillageDO.getCommunityId());
StringBuilder path = new StringBuilder();
- path.append(vo.getAlley()).append(">").append(actDO.getName()).append(comMngVillageDO.getName()).append(">").append(vo.getName());
+ path.append(vo.getAlley()).append(">").append(actDO.getName()).append(comMngVillageDO.getName()).append(">")
+ .append(vo.getName());
comMngBuildingDO.setPath(path.toString());
comMngBuildingDO.setGridId(vo.getGridId());
list.add(comMngBuildingDO);
- GridBuildRelationDO gridBuildRelation = getGridBuildRelationDO(communityId, comMngVillageDO.getStreetId(), vo, comMngBuildingDO);
+ GridBuildRelationDO gridBuildRelation =
+ getGridBuildRelationDO(communityId, comMngVillageDO.getStreetId(), vo, comMngBuildingDO);
keyList.add(gridBuildRelation);
}
- if(list.size()>0){
+ if (list.size() > 0) {
this.saveBatch(list);
}
- if(sb.length() > 0 && !StringUtils.isEmpty(sb.toString())){
+ if (sb.length() > 0 && !StringUtils.isEmpty(sb.toString())) {
errorList.add(importErrorVO);
return R.fail(JSON.toJSONString(errorList));
}
@@ -85,7 +95,8 @@
return R.ok();
}
- public GridBuildRelationDO getGridBuildRelationDO(Long communityId, Long streetId, ComMngBuildingExcelVO vo, ComMngBuildingDO comMngBuildingDO) {
+ public GridBuildRelationDO getGridBuildRelationDO(Long communityId, Long streetId, ComMngBuildingExcelVO vo,
+ ComMngBuildingDO comMngBuildingDO) {
GridBuildRelationDO gridBuildRelation = new GridBuildRelationDO();
gridBuildRelation.setId(Snowflake.getId());
gridBuildRelation.setBuildId(comMngBuildingDO.getId());
--
Gitblit v1.7.1