From 7a623cf1e0e57d6464fc0cac54397d01a47f2858 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 19 Apr 2021 12:37:29 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerGridController.java | 1 + .../com/epmet/controller/GridController.java | 14 +++++- .../java/com/epmet/dao/CustomerGridDao.java | 46 ++++++++++++------- .../epmet/service/CustomerGridService.java | 19 ++++---- .../service/impl/CustomerGridServiceImpl.java | 5 ++ .../main/resources/mapper/CustomerGridDao.xml | 13 ++++++ 6 files changed, 72 insertions(+), 26 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 5068d6187f..eec27314ba 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -104,6 +104,7 @@ public class CustomerGridController { public Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO) { return customerGridService.getCustomerGridByGridId(customerGridFormDTO); } + /** * @Description 陌生人导览模块调用 根据陌生揽客传入的地区码进行分页查询显示 * @Param ListCustomerGridFormDTO diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 6d82530dfe..a51b505b35 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -5,8 +5,9 @@ import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.*; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.CustomerGridService; import com.epmet.service.CustomerStaffAgencyService; @@ -165,4 +166,15 @@ public class GridController { public Result> selectOrgInfo(@RequestBody OrgInfoFormDTO orgInfoFormDTO){ return new Result>().ok(customerGridService.selectOrgInfo(orgInfoFormDTO)); } + /** + * 供epmet-user服务调用 查询客户网格表数据 + * @author sun + * @param customerGridFormDTO + * @return + * @throws Exception + */ + @PostMapping("getbaseinfo") + public Result getBaseInfo(@RequestBody CustomerGridFormDTO customerGridFormDTO) { + return customerGridService.getBaseInfo(customerGridFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index a6c519d1ce..125c7731ed 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -18,7 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.UserIdAndPidDTO; import com.epmet.dto.UserIdDTO; @@ -60,11 +60,11 @@ public interface CustomerGridDao extends BaseDao { List selectRestGridWithoutGivenAreaCode(Map paramsMap); /** - * @Description 通过gridId查询网格信息,网格名称格式: 上级组织名称-网格名称 * @param customerGridFormDTO + * @Description 通过gridId查询网格信息,网格名称格式: 上级组织名称-网格名称 * @author wangc * @date 2020.04.30 13:57 - **/ + **/ CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); /** @@ -156,8 +156,8 @@ public interface CustomerGridDao extends BaseDao { List selectGridByIds(@Param("gridIdList") List gridIdList); /** - * @Description 获取所属网格 * @param formDTO + * @Description 获取所属网格 * @author zxc * @date 2020/5/11 18:50 */ @@ -178,12 +178,12 @@ public interface CustomerGridDao extends BaseDao { List selectGridListByIds(@Param("gridIdList") List gridIdList); /** - * @Description 通过网格Id获取网格所需要的数据权限信息 * @param gridId + * @Description 通过网格Id获取网格所需要的数据权限信息 * @author wangc * @date 2020.05.13 11:01 **/ - CommonDataFilterResultDTO getGridDataFilterMsg(@Param("gridId")String gridId); + CommonDataFilterResultDTO getGridDataFilterMsg(@Param("gridId") String gridId); /** * @param agencyId @@ -218,41 +218,55 @@ public interface CustomerGridDao extends BaseDao { List selectThirdRestGridWithoutGivenAreaCode(Map map); /** - * @Description 查询当前客户已有网格数量 * @param customerId + * @Description 查询当前客户已有网格数量 * @author zxc * @date 2020/8/12 5:10 下午 */ - Integer selectGridCount(@Param("customerId")String customerId); + Integer selectGridCount(@Param("customerId") String customerId); /** * 删除工作人员与网格关联 - * @author zhaoqifeng - * @date 2020/8/28 15:32 + * * @param staffId * @return void + * @author zhaoqifeng + * @date 2020/8/28 15:32 */ void deleteGridStaff(@Param("staffId") String staffId); /** * 查询工作人员所在网格 - * @author zhaoqifeng - * @date 2020/8/28 15:41 + * * @param staffId * @return java.util.List + * @author zhaoqifeng + * @date 2020/8/28 15:41 */ List selectGridByStaff(@Param("staffId") String staffId); - List selectOrgInfoByAgency(@Param("orgIds")List orgIds); - List selectOrgInfoByGrid(@Param("orgIds")List orgIds); - List selectOrgInfoByDept(@Param("orgIds")List orgIds); + List selectOrgInfoByAgency(@Param("orgIds") List orgIds); + + List selectOrgInfoByGrid(@Param("orgIds") List orgIds); + + List selectOrgInfoByDept(@Param("orgIds") List orgIds); /** * @param gridId - * @return com.epmet.commons.tools.utils.Result> + * @return com.epmet.commons.tools.utils.Result> * @Author zy * @Description 根据 网格id,查询同属于一个社区下的所有网格id * @Date 2020/12/28 23:16 **/ List selectListGridIdsInCommunity(@Param("gridId") String gridId); + + /** + * desc: 根据网格Id获取网格基础信息 单表查询 + * + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/4/19 11:56 上午 + */ + Result getGridBaseInfoById(@Param("gridId") String gridId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index adb1d3c1e0..4799c38890 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -23,17 +23,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.AddGridResultDTO; -import com.epmet.dto.form.CommonAgencyIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.form.SelectGridNameByGridIdFormDTO; -import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -286,4 +277,14 @@ public interface CustomerGridService extends BaseService { * @Date 2020/12/28 23:16 **/ List listGridIdsInCommunity(String gridId); + + /** + * desc: 获取网格基础数据单表查询 + * + * @param customerGridFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/4/19 11:53 上午 + */ + Result getBaseInfo(CustomerGridFormDTO customerGridFormDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 8302b1252f..3d30cd063a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -696,4 +696,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl listGridIdsInCommunity(String gridId) { return baseDao.selectListGridIdsInCommunity(gridId); } + + @Override + public Result getBaseInfo(CustomerGridFormDTO customerGridFormDTO) { + return baseDao.getGridBaseInfoById(customerGridFormDTO.getGridId()); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index ec5c6143ac..6adafc3cff 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -600,4 +600,17 @@ ) AND DEL_FLAG = 0 + From 1ca746001391ee8317296ace6b5a85f4d6680a57 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 19 Apr 2021 13:12:41 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/CustomerGridDao.xml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 6adafc3cff..938a0c3ffe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -602,12 +602,9 @@ - SELECT * - + SELECT + CUSTOMER_ID, + GRID_ID, + USER_ID, + FIRST_REGISTER, + REGISTER, + PARTICIPATION FROM register_relation WHERE @@ -78,4 +83,4 @@ - \ No newline at end of file + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml index 260fe0db93..8c664e678e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -44,8 +44,8 @@ FROM user_base_info ubi WHERE - ubi.DEL_FLAG = '0' - AND ubi.USER_ID = #{userId} + ubi.USER_ID = #{userId} + AND ubi.DEL_FLAG = '0' From 57dab627ccffbf41dae57f66f60d1936c72fff36 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 19 Apr 2021 13:52:01 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=BC=80=E4=B8=AA=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RegisterRelationServiceImpl.java | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index 99120a52ef..17d1c3a2ff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -43,6 +43,7 @@ import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.GridVisitedService; import com.epmet.service.RegisterRelationService; import com.epmet.util.ModuleConstant; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,6 +52,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.*; /** * 注册关系表 用于统计客户网格的注册居民数 @@ -60,11 +62,11 @@ import java.util.*; */ @Service public class RegisterRelationServiceImpl extends BaseServiceImpl implements RegisterRelationService { -// private static ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() -// .setNameFormat("registerRelationService-pool-%d").build(); -// private static final ExecutorService threadPool = new ThreadPoolExecutor(2, 3, -// 0L, TimeUnit.MILLISECONDS, -// new ArrayBlockingQueue(1), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + private static ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("registerRelationService-pool-%d").build(); + private static final ExecutorService threadPool = new ThreadPoolExecutor(1, 1, + 0L, TimeUnit.MILLISECONDS, + new ArrayBlockingQueue(1), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); private static final Logger log = LoggerFactory.getLogger(RegisterRelationServiceImpl.class); @@ -177,14 +179,11 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl futureUserRole = threadPool.submit(() -> { -// -// return true; -// }); - setUserRoleList(enterGridFormDTO, resultObj); - setGridName(resultObj, gridId); - //setUserRoleList(enterGridFormDTO, resultObj); - //setGridName(resultObj, gridId); + Future futureUserRole = threadPool.submit(() -> { + setUserRoleList(enterGridFormDTO, resultObj); + setGridName(resultObj, gridId); + return true; + }); //4.去网格表中查询网格对应的名称 //Future futureGridName = threadPool.submit(() -> setGridName(resultObj, gridId)); @@ -258,7 +257,6 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl userWechatEntityList=userWechatDao.selectByUserId(enterGridFormDTO.getUserId()); UserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selectListByUserIdList(enterGridFormDTO.getUserId()); if(null != userBaseInfo){ resultObj.setNickname(StringUtils.isNotBlank(userBaseInfo.getNickname())?userBaseInfo.getNickname(): StrConstant.EPMETY_STR); @@ -276,11 +274,11 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl Date: Mon, 19 Apr 2021 14:06:55 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RegisterRelationServiceImpl.java | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index 17d1c3a2ff..8c6c448689 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -43,7 +43,6 @@ import com.epmet.feign.GovOrgFeignClient; import com.epmet.service.GridVisitedService; import com.epmet.service.RegisterRelationService; import com.epmet.util.ModuleConstant; -import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +51,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; -import java.util.concurrent.*; /** * 注册关系表 用于统计客户网格的注册居民数 @@ -62,12 +60,6 @@ import java.util.concurrent.*; */ @Service public class RegisterRelationServiceImpl extends BaseServiceImpl implements RegisterRelationService { - private static ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() - .setNameFormat("registerRelationService-pool-%d").build(); - private static final ExecutorService threadPool = new ThreadPoolExecutor(1, 1, - 0L, TimeUnit.MILLISECONDS, - new ArrayBlockingQueue(1), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); - private static final Logger log = LoggerFactory.getLogger(RegisterRelationServiceImpl.class); @@ -178,16 +170,6 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl futureUserRole = threadPool.submit(() -> { - setUserRoleList(enterGridFormDTO, resultObj); - setGridName(resultObj, gridId); - return true; - }); - - //4.去网格表中查询网格对应的名称 - //Future futureGridName = threadPool.submit(() -> setGridName(resultObj, gridId)); - //1.查找用户注册关系表,如果没有表示当前用户为陌生人(拉取用户微信表信息),如果有表示当前用户已经进行居民认证 if(null == registerRecords || registerRecords.size() <= 0){ //当前用户尚未注册过居民信息 @@ -270,15 +252,13 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl Date: Mon, 19 Apr 2021 14:50:23 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BC=98=E5=8C=96footBar=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerFootBarController.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java index 924dbc5b4b..7e8f5c4325 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java @@ -17,34 +17,35 @@ package com.epmet.controller; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import com.epmet.excel.CustomerFootBarExcel; import com.epmet.service.CustomerFootBarService; -import com.epmet.service.impl.CustomerFunctionDetailServiceImpl; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** @@ -127,12 +128,13 @@ public class CustomerFootBarController { // 查询db List footbars = customerFootBarService.listCustomerFootBars(customerId, appType); List barDTOS = new LinkedList<>(); - footbars.forEach(barEntity -> { - CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey()); - CustomerFootBarDTO barDTO = new CustomerFootBarDTO(); - BeanUtils.copyProperties(barEntity, barDTO); - barDTO.setDefaultBarName(defaultFootBarEntity.getBarName()); + List defaultFootBarList = customerFootBarService.listCustomerFootBars("default", appType); + Map defaultBarNameMaps = defaultFootBarList.stream().collect(Collectors.toMap(CustomerFootBarEntity::getBarKey, CustomerFootBarEntity::getBarName)); + footbars.forEach(barEntity -> { + String defaultName = defaultBarNameMaps.getOrDefault(barEntity.getBarKey(), StrConstant.EPMETY_STR); + CustomerFootBarDTO barDTO = ConvertUtils.sourceToTarget(barEntity, CustomerFootBarDTO.class); + barDTO.setDefaultBarName(defaultName); barDTOS.add(barDTO); }); @@ -253,4 +255,4 @@ public class CustomerFootBarController { return new Result(); } -} \ No newline at end of file +}