From 5ebd3acdab45b6d48794ea9fe49e24c15eab4cdb Mon Sep 17 00:00:00 2001 From: HAHA Date: Wed, 18 May 2022 13:55:43 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D-?= =?UTF-8?q?=E7=AE=80=E8=A6=81=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartyUnitListbriefFormDTO.java | 55 +++++++++++++++++++ .../result/PartyUnitListbrieResultDTO.java | 41 ++++++++++++++ .../controller/IcPartyUnitController.java | 17 ++++++ .../java/com/epmet/dao/IcPartyUnitDao.java | 12 ++++ .../com/epmet/service/IcPartyUnitService.java | 8 +++ .../service/impl/IcPartyUnitServiceImpl.java | 10 ++++ .../main/resources/mapper/IcPartyUnitDao.xml | 36 ++++++++++++ 7 files changed, 179 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java new file mode 100644 index 0000000000..b84d504bd3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitListbriefFormDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyUnitListbriefFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -2776705671944626707L; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空") + private String agencyId; + + /** + * 单位名称 + */ + private String unitName; + + /** + * 服务事项 + */ + private String serviceMatter; + + /** + * 分类 + */ + private String type; + + /** + * 联系人 + */ + private String contact; + + /** + * 联系人电话 + */ + private String contactMobile; + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java new file mode 100644 index 0000000000..56a7524ae7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyUnitListbrieResultDTO implements Serializable { + + private static final long serialVersionUID = -300315089751537091L; + + /** + * id + */ + private String id; + + /** + * 所属网格 + */ + private String gridName; + + /** + * 分类 + */ + private String type; + + /** + * 服务事项 + */ + private String serviceMatter; + + /** + * 单位名称 + */ + private String unitName; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 2d9ae33d75..6734697c40 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -36,9 +36,11 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcPartyUnitExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -53,6 +55,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; @@ -233,6 +236,20 @@ public class IcPartyUnitController { return new Result>().ok(icPartyUnitService.distribution(formDTO)); } + /** + * 联建单位-简要信息列表 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/18 13:54 + */ + @PostMapping("/listbrief") + public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form){ + ValidatorUtils.validateEntity(form); + PageData data = icPartyUnitService.getListbrief(form); + return new Result().ok(data); + } /** * 计算区域化党建单位的群众满意度 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index faddda7644..a926f07069 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import org.apache.ibatis.annotations.Mapper; @@ -66,4 +68,14 @@ public interface IcPartyUnitDao extends BaseDao { List getDistribution(@Param("agencyId")String agencyId); int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); + + /** + * 联建单位-简要信息列表 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/18 13:54 + */ + List getListbrief(PartyUnitListbriefFormDTO form); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index d8e5285297..4da4e2d6d6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -25,8 +25,10 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; import org.springframework.web.multipart.MultipartFile; @@ -158,4 +160,10 @@ public interface IcPartyUnitService extends BaseService { void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); List queryListById(List partyUnitIds); + + /** + * 联建单位-简要信息列表 + * @param form + */ + PageData getListbrief(PartyUnitListbriefFormDTO form); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 3924261510..fb7609a043 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -51,8 +51,10 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; +import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceStatDTO; @@ -594,6 +596,14 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl dto = baseDao.getListbrief(form); + PageInfo info = new PageInfo<>(dto); + return new PageData<>(dto,info.getTotal()); + } + private String getServiceMatter(Map map, String matter) { List matters = Arrays.asList(matter.split(StrConstant.COLON)); List list = matters.stream().map(map::get).collect(Collectors.toList()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index d7f02b7109..07ea2115c4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -73,6 +73,42 @@ ORDER BY ID + update ic_party_unit From df98fac9f5700b27c16deb89f55caef07f728d0e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 18 May 2022 14:01:40 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E8=BF=94=E5=9B=9Elevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/CustomerStaffServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 01283f45c4..0d768140d9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -745,8 +745,11 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl()); - resultDTO.setAreaCode(null != agency && StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR); + if (agency != null){ + resultDTO.setAreaCodePath(!CollectionUtils.isEmpty(agency.getAreaCodePath()) ? agency.getAreaCodePath() : new ArrayList<>()); + resultDTO.setAreaCode(StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR); + resultDTO.setLevel(agency.getLevel()); + } } //获取工作人员所属客户名 CustomerDTO dto = new CustomerDTO(); From 08b9b1c2f320265a0f5f2c76444e5cce539de707 Mon Sep 17 00:00:00 2001 From: HAHA Date: Wed, 18 May 2022 14:13:57 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D-?= =?UTF-8?q?=E7=AE=80=E8=A6=81=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcPartyUnitController.java | 4 ++-- .../src/main/java/com/epmet/dao/IcPartyUnitDao.java | 2 +- .../src/main/java/com/epmet/service/IcPartyUnitService.java | 2 +- .../java/com/epmet/service/impl/IcPartyUnitServiceImpl.java | 4 ++-- .../src/main/resources/mapper/IcPartyUnitDao.xml | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 6734697c40..b7ac5fe912 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -245,9 +245,9 @@ public class IcPartyUnitController { * @date 2022/5/18 13:54 */ @PostMapping("/listbrief") - public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form){ + public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form,@LoginUser TokenDto tokenDto){ ValidatorUtils.validateEntity(form); - PageData data = icPartyUnitService.getListbrief(form); + PageData data = icPartyUnitService.getListbrief(form,tokenDto); return new Result().ok(data); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index a926f07069..d96e45e96b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -77,5 +77,5 @@ public interface IcPartyUnitDao extends BaseDao { * @author LZN * @date 2022/5/18 13:54 */ - List getListbrief(PartyUnitListbriefFormDTO form); + List getListbrief(PartyUnitListbriefFormDTO form,String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index 4da4e2d6d6..4469073a2c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -165,5 +165,5 @@ public interface IcPartyUnitService extends BaseService { * 联建单位-简要信息列表 * @param form */ - PageData getListbrief(PartyUnitListbriefFormDTO form); + PageData getListbrief(PartyUnitListbriefFormDTO form,TokenDto tokenDto); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index fb7609a043..45ce4bc831 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -597,9 +597,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl dto = baseDao.getListbrief(form); + List dto = baseDao.getListbrief(form,tokenDto.getCustomerId()); PageInfo info = new PageInfo<>(dto); return new PageData<>(dto,info.getTotal()); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index 07ea2115c4..0295be0c07 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -87,6 +87,7 @@ a.DEL_FLAG = '0' AND a.AGENCY_ID = #{agencyId} + AND a.CUSTOMER_ID = #{customerId} AND b.GRID_ID = #{gridId} From 9e4174e69e00afdd9c6c7526c713f5252b9855c0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 18 May 2022 15:13:07 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=9A=84=E5=85=9A?= =?UTF-8?q?=E5=91=98=E4=BF=A1=E6=81=AF=E5=90=8C=E6=AD=A5=E5=88=B0=E5=85=9A?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/IcHouseFormDTO.java | 38 ++++++ .../tools/feign/CommonGovOrgFeignClient.java | 11 ++ .../CommonGovOrgFeignClientFallback.java | 15 +++ .../redis/common/CustomerIcHouseRedis.java | 34 +++++ .../redis/common/bean/HouseInfoCache.java | 92 ++++++++++++++ .../com/epmet/controller/HouseController.java | 9 ++ .../dto/partymember/IcPartyMemberDTO.java | 7 + .../feign/ResiPartyMemberOpenFeignClient.java | 10 ++ ...esiPartyMemberOpenFeignClientFallback.java | 14 ++ .../controller/IcPartyMemberController.java | 7 +- .../service/IcPartyMemberService.java | 10 ++ .../impl/IcPartyMemberServiceImpl.java | 36 ++++++ .../service/impl/IcResiUserServiceImpl.java | 120 +++++++++++++++++- 13 files changed, 398 insertions(+), 5 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java new file mode 100644 index 0000000000..5caca05c88 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IcHouseFormDTO.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.commons.tools.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * epmet-user端调用gov-org端的入参 + * @author sun + */ +@Data +public class IcHouseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + private String customerId; + private String houseId; + + +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java index bb6bfe423b..da09442ea8 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonGovOrgFeignClient.java @@ -2,8 +2,10 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.CustomerGridFormDTO; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.feign.fallback.CommonGovOrgFeignClientFallBackFactory; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -26,4 +28,13 @@ public interface CommonGovOrgFeignClient { @PostMapping("/gov/org/grid/getbaseinfo") Result getGridInfo(@RequestBody CustomerGridFormDTO customerGridFormDTO); + /** + * @Description 查询房屋信息 + * @Param houseInfo + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/18 14:29 + */ + @PostMapping("/gov/org/house/getHouseInfoCache") + Result getHouseInfoCache(@RequestBody IcHouseFormDTO houseInfo); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java index c54567c350..7f5097fd20 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonGovOrgFeignClientFallback.java @@ -2,8 +2,10 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.form.CustomerGridFormDTO; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.feign.CommonGovOrgFeignClient; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import org.springframework.stereotype.Component; @@ -22,5 +24,18 @@ public class CommonGovOrgFeignClientFallback implements CommonGovOrgFeignClient return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo", customerGridFormDTO); } + /** + * @param houseInfo + * @Description 查询房屋信息 + * @Param houseInfo + * @Return {@link Result< HouseInfoCache >} + * @Author zhaoqifeng + * @Date 2022/5/18 14:29 + */ + @Override + public Result getHouseInfoCache(IcHouseFormDTO houseInfo) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getHouseInfoCache", houseInfo); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java index 6f2e4959e0..81cd3dd878 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerIcHouseRedis.java @@ -1,11 +1,14 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; +import com.epmet.commons.tools.feign.CommonGovOrgFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; @@ -28,6 +31,8 @@ public class CustomerIcHouseRedis { private RedisUtils redisUtils; @Autowired private CommonAggFeignClient commonAggFeignClient; + @Autowired + private CommonGovOrgFeignClient govOrgFeignClient; private static CustomerIcHouseRedis customerIcHouseRedis; @PostConstruct @@ -62,6 +67,35 @@ public class CustomerIcHouseRedis { return buildInfoResult.getData(); } + /** + * @Description 获取房屋信息 + * @Param customerId + * @Param houseId + * @Return {@link HouseInfoCache} + * @Author zhaoqifeng + * @Date 2022/5/18 14:37 + */ + public static HouseInfoCache getHouseInfo(String customerId, String houseId){ + String key = RedisKeys.getHouseInfoCacheKey(houseId,customerId); + Map house = customerIcHouseRedis.redisUtils.hGetAll(key); + if (!MapUtils.isEmpty(house)) { + return ConvertUtils.mapToEntity(house, HouseInfoCache.class); + } + IcHouseFormDTO formDTO = new IcHouseFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setHouseId(houseId); + Result houseInfoResult = customerIcHouseRedis.govOrgFeignClient.getHouseInfoCache(formDTO); + if (!houseInfoResult.success()){ + throw new RenException("查询房屋信息失败..."); + } + if (null == houseInfoResult.getData()){ + return null; + } + Map map = BeanUtil.beanToMap(houseInfoResult.getData(), false, true); + customerIcHouseRedis.redisUtils.hMSet(key, map); + return houseInfoResult.getData(); + } + public static void delBuildingInfo(String buildingId){ String key = RedisKeys.getBuildingInfoKey(buildingId); customerIcHouseRedis.redisUtils.delete(key); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java new file mode 100644 index 0000000000..4c6551b881 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java @@ -0,0 +1,92 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 房屋信息缓存 + * @author Administrator + */ +@Data +public class HouseInfoCache implements Serializable { + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 小区详细地址 + */ + private String neighborAddress; + /** + * 小区id + */ + private String neighborHoodId; + /** + * 小区名称 + */ + private String neighborHoodName; + + + /** + * 所属楼栋id + */ + private String buildingId; + /** + * 楼栋名称 + */ + private String buildingName; + + + /** + * 所属单元id + */ + private String buildingUnitId; + /** + * 单元名 + */ + private String unitName; + + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,1楼房,2平房,3别墅 + */ + private String houseType; + + private String houseName; + + /** + * 楼的经度 + */ + private String buildingLongitude; + /** + * 楼的纬度 + */ + private String buildingLatitude; + + /** + * 小区名+楼栋名+单元名+房屋名 + */ + private String allName; + + private String customerId; + + /** + * 小区所在的组织id + */ + private String agencyId; + /** + * eg:市北区-阜新路街道-南宁社区 + */ + private String agencyPathName; + /** + * 组织的area_code + */ + private String areaCode; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 60c9bff074..5fb5deae73 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -30,11 +30,14 @@ import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.form.IcHouseFormDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; +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.utils.poi.excel.handler.ExcelFillCellMergeStrategy; @@ -288,6 +291,12 @@ public class HouseController implements ResultDataResolver { return new Result().ok(houseService.getHouseInfoDTO(tokenDto.getCustomerId(), houseId)); } + @PostMapping("getHouseInfoCache") + public Result getHouseInfoCache(@RequestBody IcHouseFormDTO houseInfo) { + HouseInfoDTO house = houseService.getHouseInfoDTO(houseInfo.getCustomerId(), houseInfo.getHouseId()); + return new Result().ok(ConvertUtils.sourceToTarget(house, HouseInfoCache.class)); + } + /** * @Author sun * @Description 【人房】房屋总数饼图 diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java index 86a5d68c2d..72173dcad1 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java @@ -1,7 +1,10 @@ package com.epmet.resi.partymember.dto.partymember; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; @@ -20,6 +23,7 @@ public class IcPartyMemberDTO implements Serializable { /** * 唯一标识 */ + @NotBlank(message = "当前网格id不能为空",groups ={UpdateGroup.class}) private String id; /** @@ -50,16 +54,19 @@ public class IcPartyMemberDTO implements Serializable { /** * 姓名 */ + @NotBlank(message = "当前网格id不能为空",groups ={AddGroup.class, UpdateGroup.class}) private String name; /** * 手机号 */ + @NotBlank(message = "当前网格id不能为空",groups ={AddGroup.class, UpdateGroup.class}) private String mobile; /** * 身份证号 */ + @NotBlank(message = "当前网格id不能为空",groups ={AddGroup.class, UpdateGroup.class}) private String idCard; /** diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 63c2674043..d88cd797b3 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.resi.partymember.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; @@ -114,4 +115,13 @@ public interface ResiPartyMemberOpenFeignClient { @PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset") Result partyMemberAuditReset(@RequestParam("gridId")String gridId); + /** + * @Description 同步党员信息 + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/18 10:41 + */ + @PostMapping("/resi/partymember/icPartyMember/icPartyMemberSync") + Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto); } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 2cb889e348..3a10c64914 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.resi.partymember.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; @@ -74,4 +75,17 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result partyMemberAuditReset(String gridId) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "partyMemberAuditReset", gridId); } + + /** + * @param dto + * @Description 同步党员信息 + * @Param dto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/18 10:41 + */ + @Override + public Result icPartyMemberSync(IcPartyMemberDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "icPartyMemberSync", dto); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java index 1da2c277bd..d3ad0f31e8 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java @@ -76,6 +76,9 @@ public class IcPartyMemberController { ExcelUtils.exportExcelToTarget(response, null, list, IcPartyMemberExcel.class); } - - + @PostMapping("icPartyMemberSync") + public Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto) { + icPartyMemberService.icPartyMemberSync(dto); + return new Result(); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java index 54b63e743e..d3d8cfc352 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java @@ -75,4 +75,14 @@ public interface IcPartyMemberService extends BaseService { * @date 2022-05-17 */ void delete(String[] ids); + + /** + * 党员信息同步 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/5/18 10:16 + */ + void icPartyMemberSync(IcPartyMemberDTO dto); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java index c4de661862..5f854e277e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java @@ -151,4 +151,40 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyMemberEntity::getCustomerId, dto.getCustomerId()); + wrapper.eq(IcPartyMemberEntity::getIdCard, dto.getIdCard()); + IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper); + + //查询党组织信息 + if (StringUtils.isNotBlank(dto.getSszb())) { + //获取党组织信息 + IcPartyOrgEntity org = icPartyOrgService.selectById(dto.getSszb()); + dto.setAgencyId(org.getAgencyId()); + dto.setAgencyPids(org.getAgencyPids()); + dto.setOrgPids(org.getOrgPids()); + } + IcPartyMemberEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberEntity.class); + + //判断党员是否已存在,有则更新,没有则添加 + if (null != partyMember) { + entity.setId(partyMember.getId()); + baseDao.updateById(entity); + } else { + baseDao.insert(entity); + } + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 7285d59211..9f89b5ad1f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -36,10 +36,12 @@ import com.epmet.commons.tools.feign.ResultDataResolver; 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.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; @@ -59,6 +61,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.entity.*; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.feign.*; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.*; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -137,6 +140,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); @@ -199,6 +204,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(); + com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); for (IcResiUserFormDTO d : formDTO) { if ("ic_resi_user".equals(d.getTableName())) { map = d.getList().get(0); @@ -233,7 +239,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getAgencyById(agencyId); @@ -244,6 +250,27 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : d.getList()) { + partyMemberDTO.setRdsj(hash.get("RDSJ")); + partyMemberDTO.setSszb(hash.get("SSZB")); + partyMemberDTO.setIsLd(hash.get("IS_LD")); + partyMemberDTO.setLdzh(hash.get("LDZH")); + partyMemberDTO.setPartyZw(hash.get("PARTY_ZW")); + partyMemberDTO.setIsTx(hash.get("IS_TX")); + partyMemberDTO.setIsDyzxh(hash.get("IS_DYZXH")); + } + } + if ("ic_volunteer".equals(d.getTableName())) { + for (LinkedHashMap hash : d.getList()) { + partyMemberDTO.setVolunteerCategory(hash.get("VOLUNTEER_CATEGORY")); + } + } + //2022.05.18 end zhaoqf }); - + Result syncResult = resiPartyMemberOpenFeignClient.icPartyMemberSync(partyMemberDTO); + if (!syncResult.success()) { + log.error("同步党员信息失败"); + } //3.变更记录表和变更记录明细表新增数据 saveUserChangeRecord(tokenDto,map,resiUserId,name); @@ -349,6 +397,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map = new LinkedHashMap<>(); + com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO partyMemberDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); for (IcResiUserFormDTO d : formDTO) { if ("ic_resi_user".equals(d.getTableName())) { map = d.getList().get(0); @@ -383,6 +432,50 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : d.getList()) { + partyMemberDTO.setRdsj(hash.get("RDSJ")); + partyMemberDTO.setSszb(hash.get("SSZB")); + partyMemberDTO.setIsLd(hash.get("IS_LD")); + partyMemberDTO.setLdzh(hash.get("LDZH")); + partyMemberDTO.setPartyZw(hash.get("PARTY_ZW")); + partyMemberDTO.setIsTx(hash.get("IS_TX")); + partyMemberDTO.setIsDyzxh(hash.get("IS_DYZXH")); + } + } + if ("ic_volunteer".equals(d.getTableName())) { + for (LinkedHashMap hash : d.getList()) { + partyMemberDTO.setVolunteerCategory(hash.get("VOLUNTEER_CATEGORY")); + } + } + //2022.05.18 end zhaoqf }); - + Result syncResult = resiPartyMemberOpenFeignClient.icPartyMemberSync(partyMemberDTO); + if (!syncResult.success()) { + log.error("同步党员信息失败"); + } return resiUserId; } From cfed984894aa0c6d0b69b9dc71d0232dc2bcca80 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 18 May 2022 15:59:29 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/PartyPostEnum.java | 61 +++++++++++++++++++ .../feign/OperCustomizeOpenFeignClient.java | 9 +++ .../OperCustomizeOpenFeignClientFallback.java | 12 ++++ .../IcFormItemOptionsController.java | 15 +++++ .../dto/partymember/IcPartyMemberDTO.java | 3 +- .../resi-partymember-server/pom.xml | 12 ++++ .../impl/IcPartyMemberServiceImpl.java | 41 ++++++++++++- 7 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java new file mode 100644 index 0000000000..80c9d81155 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/PartyPostEnum.java @@ -0,0 +1,61 @@ +package com.epmet.commons.tools.enums; + +import java.util.Objects; + +/** + * @author Administrator + */ +public enum PartyPostEnum { + //党员职务 + PTDY("0", "普通党员"), + ZBSJ("1", "支部书记"), + ZBWY("2", "支部委员"), + DWWY("3", "党委委员"), + + UN_KNOWN("8", "未知"); + + private String code; + private String name; + + + PartyPostEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + PartyPostEnum[] partyPostEnums = values(); + for (PartyPostEnum partyPostEnum : partyPostEnums) { + if (Objects.equals(partyPostEnum.getCode(), code)) { + return partyPostEnum.getName(); + } + } + return PartyPostEnum.UN_KNOWN.getName(); + } + + public static String getCode(String name) { + PartyPostEnum[] partyPostEnums = values(); + for (PartyPostEnum partyPostEnum : partyPostEnums) { + if (partyPostEnum.getName().equals(name)) { + return partyPostEnum.getCode(); + } + } + return null; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index ce708be3b2..e93d9badaa 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -170,4 +171,12 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icExportTemplate/getExcelHeaderAndSqlColumnForExport") Result getExcelHeaderAndSqlColumnForExport(@RequestBody IcExportTemplateQueryFormDTO param); + /** + * 使用item相关条件查询关联的options + * @param input + * @return + */ + @PostMapping("/oper/customize/icformitemoptions/getItemConditions") + Result> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input); + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 555dac052c..e59af2b818 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -12,6 +12,7 @@ import com.epmet.dto.result.*; import com.epmet.feign.OperCustomizeOpenFeignClient; import java.util.List; +import java.util.Map; import java.util.Set; /** @@ -130,4 +131,15 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getExcelHeaderAndSqlColumnForExport", param); } + /** + * 使用item相关条件查询关联的options + * + * @param input + * @return + */ + @Override + public Result> getOptionsMap(IcFormOptionsQueryFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOptionsMap", input); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java index 9f6f68e3a5..9a8f76e302 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java @@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** @@ -120,5 +121,19 @@ public class IcFormItemOptionsController { return new Result>().ok(r); } + @PostMapping("getItemConditions") + public Result> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input) { + ValidatorUtils.validateEntity(input, IcFormOptionsQueryFormDTO.QueryByLabelAndCustomerIdForForm.class); + String customerId = input.getCustomerId(); + String formCode = input.getFormCode(); + String columnName = input.getColumnName(); + Integer columnNum = input.getColumnNum(); + List list = icFormItemOptionsService.getOptionsByItemConditions(customerId, formCode, columnName, columnNum); + Map map = list.stream() + .collect(Collectors.toMap(IcFormItemOptionsDTO::getOptionValue, IcFormItemOptionsDTO::getOptionLabel, (o1, o2) -> o1)); + return new Result>().ok(map); + } + + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java index 72173dcad1..9832a35e5e 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberDTO.java @@ -7,6 +7,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -123,7 +124,7 @@ public class IcPartyMemberDTO implements Serializable { * 志愿者类型,逗号隔开 */ private String volunteerCategory; - private String volunteerCategoryName; + private List volunteerCategoryName; /** * 备注 */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 0aa5915d98..a1f564cf47 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -104,6 +104,18 @@ 2.0.0 compile + + com.epmet + epmet-admin-client + 2.0.0 + compile + + + com.epmet + oper-customize-client + 2.0.0 + compile + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java index 5f854e277e..43fd68686e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java @@ -5,12 +5,19 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.IcFormCodeEnum; +import com.epmet.commons.tools.enums.PartyPostEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.IcFormOptionsQueryFormDTO; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partymember.dao.IcPartyMemberDao; @@ -25,6 +32,7 @@ import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 数字平台党员信息表 @@ -39,6 +47,10 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl page(Map params) { @@ -68,11 +80,38 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl> education = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + if (!education.success()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取文化程度信息失败", "获取文化程度信息失败"); + } + dto.setCultureName(education.getData().get(dto.getCulture())); + } //志愿者类别 - return ConvertUtils.sourceToTarget(entity, IcPartyMemberDTO.class); + if (StringUtils.isNotBlank(dto.getVolunteerCategory())) { + IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); + optionsForm.setCustomerId(dto.getCustomerId()); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); + optionsForm.setColumnName("VOLUNTEER_CATEGORY"); + Result> volunteerMap = operCustomizeOpenFeignClient.getOptionsMap(optionsForm); + List category = Arrays.asList(dto.getVolunteerCategory().split(StrConstant.COMMA)); + dto.setVolunteerCategoryName(category.stream().map(volunteerMap.getData()::get).collect(Collectors.toList())); + } + return dto; } @Override From e69d596c1cb1111de003dbf242b5a4eea75e7862 Mon Sep 17 00:00:00 2001 From: HAHA Date: Wed, 18 May 2022 16:44:18 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D-?= =?UTF-8?q?=E6=8C=89=E5=88=86=E7=B1=BB=E7=BB=9F=E8=AE=A1=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=8F=8A=E5=8D=A0=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartyTypepercentFormDTO.java | 22 +++++ .../dto/result/PartyTypepercentResultDTO.java | 33 +++++++ .../controller/IcPartyUnitController.java | 48 +++++++---- .../java/com/epmet/dao/IcPartyUnitDao.java | 19 ++++- .../com/epmet/service/IcPartyUnitService.java | 17 +++- .../service/impl/IcPartyUnitServiceImpl.java | 85 +++++++++++-------- .../main/resources/mapper/IcPartyUnitDao.xml | 13 +++ 7 files changed, 179 insertions(+), 58 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java new file mode 100644 index 0000000000..f5bdb317af --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyTypepercentFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyTypepercentFormDTO { + + private static final long serialVersionUID = -3833404131164761022L; + + /** + * 组织id + */ + @NotBlank(message = "组织id不能为空") + private String agencyId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java new file mode 100644 index 0000000000..34bc09d38b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PartyTypepercentResultDTO { + + private static final long serialVersionUID = -5256798094892121661L; + + /** + * 联建单位类型 + */ + private String label; + + /** + * 数量 + */ + private String value; + + /** + * 联建单位编码 + */ + private String code; + + /** + * 联建单位数量占比(%) + */ + private String percent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index b7ac5fe912..0cf4da7683 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -33,12 +33,10 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.PartyUnitFormDTO; -import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -88,14 +86,14 @@ public class IcPartyUnitController { @PostMapping("list") - public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO){ + public Result> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); PageData page = icPartyUnitService.search(formDTO); return new Result>().ok(page); } @PostMapping("detail") - public Result get(@RequestBody IcPartyUnitDTO formDTO){ + public Result get(@RequestBody IcPartyUnitDTO formDTO) { AssertUtils.isBlank(formDTO.getId(), "id"); IcPartyUnitDTO data = icPartyUnitService.get(formDTO.getId()); return new Result().ok(data); @@ -103,7 +101,7 @@ public class IcPartyUnitController { @PostMapping("save") @NoRepeatSubmit - public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto){ + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto) { //效验数据 dto.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -112,7 +110,7 @@ public class IcPartyUnitController { } @PostMapping("delete") - public Result delete(@RequestBody IcPartyUnitDTO dto){ + public Result delete(@RequestBody IcPartyUnitDTO dto) { //效验数据 AssertUtils.isBlank(dto.getId(), "id"); icPartyUnitService.delete(dto.getId()); @@ -152,21 +150,22 @@ public class IcPartyUnitController { * @return */ @PostMapping("servicelist") - public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); } @PostMapping("option") - public Result> option(@RequestBody IcPartyUnitDTO dto){ + public Result> option(@RequestBody IcPartyUnitDTO dto) { AssertUtils.isBlank(dto.getAgencyId(), "agencyId"); return new Result>().ok(icPartyUnitService.option(dto)); } /** * 数据导入 + * * @Param tokenDto * @Param response * @Param file @@ -218,7 +217,7 @@ public class IcPartyUnitController { * @Date 2021/12/8 14:52 */ @PostMapping("typestatistics") - public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO){ + public Result> typeStatistics(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.typeStatistics(formDTO)); } @@ -231,7 +230,7 @@ public class IcPartyUnitController { * @Date 2021/12/9 10:11 */ @PostMapping("distribution") - public Result> distribution(@RequestBody PartyActivityFormDTO formDTO){ + public Result> distribution(@RequestBody PartyActivityFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.distribution(formDTO)); } @@ -245,12 +244,27 @@ public class IcPartyUnitController { * @date 2022/5/18 13:54 */ @PostMapping("/listbrief") - public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form,@LoginUser TokenDto tokenDto){ + public Result getListbrief(@RequestBody PartyUnitListbriefFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); - PageData data = icPartyUnitService.getListbrief(form,tokenDto); + PageData data = icPartyUnitService.getListbrief(form, tokenDto); return new Result().ok(data); } + /** + * 联建单位-按分类统计数量及占比 + * + * @param form + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/18 16:42 + */ + @PostMapping("/statistics/typepercent") + public Result> getTypepercent(@RequestBody PartyTypepercentFormDTO form) { + ValidatorUtils.validateEntity(form); + List dto = icPartyUnitService.getTypepercent(form); + return new Result>().ok(dto); + } + /** * 计算区域化党建单位的群众满意度 * @@ -258,8 +272,8 @@ public class IcPartyUnitController { * @return */ @PostMapping("cal-partyunit-satisfation") - public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO,ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); + public Result calPartyUnitSatisfation(@RequestBody ServerSatisfactionCalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ServerSatisfactionCalFormDTO.AddUserInternalGroup.class); icPartyUnitService.calPartyUnitSatisfation(formDTO); return new Result(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index d96e45e96b..e9f4559434 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -19,7 +19,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.form.PartyTypepercentFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -41,22 +43,24 @@ public interface IcPartyUnitDao extends BaseDao { /** * 需求指派,选择区域化党建单位,调用此接口 + * * @param agencyIds * @param unitName * @return */ List selectListByAgencyId(@Param("agencyIds") List agencyIds, @Param("unitName") String unitName, - @Param("customerId")String customerId); + @Param("customerId") String customerId); /** * 单位分类统计 + * * @Param agencyId * @Return {@link java.util.List} * @Author zhaoqifeng * @Date 2021/12/8 15:25 */ - List getTypeStatistics(@Param("agencyId")String agencyId); + List getTypeStatistics(@Param("agencyId") String agencyId); /** * @Description 联建单位分布 @@ -65,7 +69,7 @@ public interface IcPartyUnitDao extends BaseDao { * @Author zhaoqifeng * @Date 2021/12/9 14:24 */ - List getDistribution(@Param("agencyId")String agencyId); + List getDistribution(@Param("agencyId") String agencyId); int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); @@ -77,5 +81,12 @@ public interface IcPartyUnitDao extends BaseDao { * @author LZN * @date 2022/5/18 13:54 */ - List getListbrief(PartyUnitListbriefFormDTO form,String customerId); + List getListbrief(PartyUnitListbriefFormDTO form, String customerId); + + /** + * 联建单位-按分类统计数量及占比 + * + * @param agencyId + */ + List getTypepercent(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index 4469073a2c..5a5cb36416 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -24,9 +24,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.form.PartyTypepercentFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -83,7 +85,7 @@ public interface IcPartyUnitService extends BaseService { * @author generator * @date 2021-11-19 */ - void save(TokenDto tokenDto, IcPartyUnitDTO dto); + void save(TokenDto tokenDto, IcPartyUnitDTO dto); /** @@ -126,6 +128,7 @@ public interface IcPartyUnitService extends BaseService { /** * 导入数据 + * * @Param tokenDto * @Param response * @Param file @@ -146,6 +149,7 @@ public interface IcPartyUnitService extends BaseService { /** * 联建单位分布 + * * @Param formDTO * @Return {@link List< PartyUnitDistributionResultDTO>} * @Author zhaoqifeng @@ -155,6 +159,7 @@ public interface IcPartyUnitService extends BaseService { /** * 计算区域化党建单位的群众满意度 + * * @param formDTO */ void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO); @@ -163,7 +168,15 @@ public interface IcPartyUnitService extends BaseService { /** * 联建单位-简要信息列表 + * + * @param form + */ + PageData getListbrief(PartyUnitListbriefFormDTO form, TokenDto tokenDto); + + /** + * 联建单位-按分类统计数量及占比 + * * @param form */ - PageData getListbrief(PartyUnitListbriefFormDTO form,TokenDto tokenDto); + List getTypepercent(PartyTypepercentFormDTO form); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 45ce4bc831..429652da58 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -39,7 +39,9 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils; @@ -48,11 +50,9 @@ import com.epmet.constant.UserDemandConstant; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPartyUnitDao; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.ImportTaskCommonFormDTO; -import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.PartyUnitFormDTO; -import com.epmet.dto.form.PartyUnitListbriefFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; +import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.PartyUnitListbrieResultDTO; import com.epmet.dto.result.UploadImgResultDTO; @@ -128,10 +128,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); PageInfo pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 - List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { @@ -142,12 +142,12 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } - if(StringUtils.isBlank(item.getSatisfaction())){ + if (StringUtils.isBlank(item.getSatisfaction())) { item.setSatisfaction(StrConstant.HYPHEN); - }else{ - item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + } else { + item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2, BigDecimal.ROUND_HALF_UP).toString()); } - item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); + item.setScore(null == pointMap.get(item.getId()) ? NumConstant.ZERO : pointMap.get(item.getId())); }); return new PageData<>(dtoList, pageInfo.getTotal()); } @@ -164,10 +164,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 - List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取单位积分 Map pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); dtoList.forEach(item -> { @@ -178,13 +178,13 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } - item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId())); + item.setScore(null == pointMap.get(item.getId()) ? NumConstant.ZERO : pointMap.get(item.getId())); }); return dtoList; } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -200,14 +200,14 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); - dto.setScore(null == pointMap.get(id)?NumConstant.ZERO:pointMap.get(id)); + dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id)); } return dto; } @Override @Transactional(rollbackFor = Exception.class) - public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { + public void save(TokenDto tokenDto, IcPartyUnitDTO dto) { IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class); CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); entity.setAgencyId(staff.getAgencyId()); @@ -219,7 +219,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); - if(StringUtils.isBlank(entity.getId())) { + if (StringUtils.isBlank(entity.getId())) { if (CollectionUtils.isNotEmpty(list)) { throw new EpmetException(EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getCode(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg(), EpmetErrorCode.PARTY_UNIT_NAME_EXITED.getMsg()); } @@ -258,19 +258,19 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl} * @Author zhaoqifeng * @Date 2021/11/22 14:35 @@ -347,8 +347,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //1.数据校验 Iterator iterator = result.iterator(); while (iterator.hasNext()) { @@ -519,6 +519,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl distribution(PartyActivityFormDTO formDTO) { - Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); List list = baseDao.getDistribution(formDTO.getAgencyId()); if (CollectionUtils.isEmpty(list)) { return Collections.emptyList(); @@ -573,35 +574,49 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(),formDTO.getServiceType()); + List list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); for (ServiceStatDTO serviceStatDTO : list) { if (0 != serviceStatDTO.getDemandCount()) { BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); - baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result); + baseDao.updateSatisfaction(serviceStatDTO.getServerId(), result); } } } @Override public List queryListById(List partyUnitIds) { - if(CollectionUtils.isNotEmpty(partyUnitIds)){ + if (CollectionUtils.isNotEmpty(partyUnitIds)) { return baseDao.selectBatchIds(partyUnitIds); } return Collections.EMPTY_LIST; } @Override - public PageData getListbrief(PartyUnitListbriefFormDTO form,TokenDto tokenDto) { - PageHelper.startPage(form.getPageNo(),form.getPageSize()); - List dto = baseDao.getListbrief(form,tokenDto.getCustomerId()); - PageInfo info = new PageInfo<>(dto); - return new PageData<>(dto,info.getTotal()); + public PageData getListbrief(PartyUnitListbriefFormDTO form, TokenDto tokenDto) { + PageHelper.startPage(form.getPageNo(), form.getPageSize()); + List dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); + PageInfo info = new PageInfo<>(dto); + return new PageData<>(dto, info.getTotal()); + } + + @Override + public List getTypepercent(PartyTypepercentFormDTO form) { + List dto = baseDao.getTypepercent(form.getAgencyId()); + int total = 0; + for (PartyTypepercentResultDTO item : dto) { + total = Integer.parseInt(item.getValue()) + total; + } + for (PartyTypepercentResultDTO item : dto) { + item.setPercent((Integer.parseInt(item.getValue()) * 100) / total + "%"); + } + return dto; } private String getServiceMatter(Map map, String matter) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index 0295be0c07..2938ee960e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -110,6 +110,19 @@ order by a.CREATED_TIME + update ic_party_unit From e7fcda6ff8d0816448f8aa200d4276741ace8606 Mon Sep 17 00:00:00 2001 From: HAHA Date: Wed, 18 May 2022 16:50:55 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D-?= =?UTF-8?q?=E7=AE=80=E8=A6=81=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96gridName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/PartyUnitListbrieResultDTO.java | 5 +++++ .../com/epmet/service/impl/IcPartyUnitServiceImpl.java | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java index 56a7524ae7..e4eef93ec1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyUnitListbrieResultDTO.java @@ -23,6 +23,11 @@ public class PartyUnitListbrieResultDTO implements Serializable { */ private String gridName; + /** + * 所属网格id + */ + private String gridId; + /** * 分类 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 429652da58..81afd27ab7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -602,6 +602,15 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); + // 获取gridName + for (PartyUnitListbrieResultDTO item:dto) { + if (StringUtils.isNotEmpty(item.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridName()); + } + } + } PageInfo info = new PageInfo<>(dto); return new PageData<>(dto, info.getTotal()); } From b9a995fcbcfdc65948edf9e9be1181043d12142f Mon Sep 17 00:00:00 2001 From: HAHA Date: Wed, 18 May 2022 18:20:46 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E9=87=8F=E5=8C=96=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/PartyMemberPointEchoFormDTO.java | 34 ++++++++++++ .../result/PartyMemberPointEchoResultDTO.java | 55 +++++++++++++++++++ .../IcPartyMemberPointController.java | 19 ++++++- .../dao/IcPartyMemberPointDao.java | 5 ++ .../service/IcPartyMemberPointService.java | 11 ++++ .../impl/IcPartyMemberPointServiceImpl.java | 29 +++++++++- .../partymember/IcPartyMemberPointDao.xml | 20 +++++++ 7 files changed, 170 insertions(+), 3 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java new file mode 100644 index 0000000000..ba52678e75 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointEchoFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class PartyMemberPointEchoFormDTO implements Serializable { + + private static final long serialVersionUID = 6999955563137801002L; + + /** + * 年份 + */ + @NotBlank(message = "年份不能为空") + private String year; + + /** + * 季度 + */ + @NotBlank(message = "季度不能为空") + private String quarter; + + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空") + private String partyMemberId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java new file mode 100644 index 0000000000..080da2ef8d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class PartyMemberPointEchoResultDTO implements Serializable { + + private static final long serialVersionUID = 195601506560614702L; + + /** + * 基础积分分值 + */ + private Integer basePoint; + + /** + * 基础积分选项 英文逗号隔开 + */ + private String baseOptions; + + /** + * 民主评议积分分值 + */ + private Integer reviewPoint; + + /** + * 民主评议积分选项 + */ + private String reviewOptions; + + /** + * 激励积分分值 + */ + private Integer inspirePoint; + + /** + * 激励积分选项 + */ + private String inspireOptions; + + /** + * 警示扣分分值 + */ + private Integer warnPoint; + + /** + * 警示扣分选项 + */ + private String warnOptions; +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java index 81dcbd7c78..256a56642d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java @@ -15,7 +15,9 @@ import com.epmet.modules.partymember.excel.IcPartyMemberPointExcel; import com.epmet.modules.partymember.service.IcPartyMemberPointService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -92,8 +94,23 @@ public class IcPartyMemberPointController { */ @PostMapping("getList") public Result> getList(@RequestBody PartyMemberPointListFormDTO form, @LoginUser TokenDto tokenDto) { - List dto = icPartyMemberPointService.getList(form,tokenDto); + List dto = icPartyMemberPointService.getList(form, tokenDto); return new Result>().ok(dto); } + /** + * 量化积分统计回显 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/18 18:18 + */ + @PostMapping("echoPartyMemberPoint") + public Result getEchoPartyMemberPoint(@RequestBody PartyMemberPointEchoFormDTO form) { + ValidatorUtils.validateEntity(form); + List dto = icPartyMemberPointService.getEchoPartyMemberPoint(form); + return new Result().ok(dto); + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java index 64e41932b9..0d128f3ed7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -28,4 +29,8 @@ public interface IcPartyMemberPointDao extends BaseDao List getListCount(@Param("year") String year, @Param("customerId") String customerId); + + List getEchoPartyMemberPoint(@Param("partyMemberId") String partyMemberId, + @Param("quarter") String quarter, + @Param("year") String year); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java index 81eb14b2fc..2c11d65d4f 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java @@ -6,7 +6,9 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; @@ -91,4 +93,13 @@ public interface IcPartyMemberPointService extends BaseService getList(PartyMemberPointListFormDTO form, TokenDto tokenDto); + /** + * 量化积分统计回显 + * + * @param form + * @return java.util.List + * @author LZN + * @date 2022/5/18 18:18 + */ + List getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java index ff7d172d2d..875ed05bf7 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java @@ -15,7 +15,9 @@ import com.epmet.modules.partymember.redis.IcPartyMemberPointRedis; import com.epmet.modules.partymember.service.IcPartyMemberPointService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; import jdk.nashorn.internal.parser.Token; import org.apache.commons.lang3.StringUtils; @@ -91,11 +93,20 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl + * @author LZN + * @date 2022/5/18 18:20 + */ @Override public List getList(PartyMemberPointListFormDTO form, TokenDto tokenDto) { List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), - form.getOrgId(), form.getYear(),tokenDto.getCustomerId()); - List count = baseDao.getListCount(form.getYear(),tokenDto.getCustomerId()); + form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); + List count = baseDao.getListCount(form.getYear(), tokenDto.getCustomerId()); // 处理统计的平均值 for (int i = 0; i < dto.size(); i++) { // 基础积分分值平均值 @@ -128,5 +139,19 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl + * @author LZN + * @date 2022/5/18 18:20 + */ + @Override + public List getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form) { + List dto = baseDao.getEchoPartyMemberPoint(form.getPartyMemberId(), form.getQuarter(), form.getYear()); + return dto; + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml index 7392a9426f..f02e41db4e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml @@ -75,6 +75,26 @@ a.total_score ASC, a.CREATED_TIME + \ No newline at end of file From 5a0f0eabd7b580319fe7112f0c45f28bbb3121f0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 18 May 2022 19:06:02 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcPartyMemberFromDTO.java | 84 +++++++++++++++++ .../result/IcPartyMemberResultDTO.java | 82 +++++++++++++++++ .../controller/IcPartyMemberController.java | 12 ++- .../partymember/dao/IcPartyMemberDao.java | 14 ++- .../service/IcPartyMemberService.java | 9 +- .../impl/IcPartyMemberServiceImpl.java | 72 ++++++++++++--- .../mapper/partymember/IcPartyMemberDao.xml | 89 +++++++++++++++++++ .../service/impl/IcResiUserServiceImpl.java | 1 + 8 files changed, 345 insertions(+), 18 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java new file mode 100644 index 0000000000..42da9bdf94 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java @@ -0,0 +1,84 @@ +package com.epmet.resi.partymember.dto.partymember.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/18 16:03 + */ +@NoArgsConstructor +@Data +public class IcPartyMemberFromDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = -5751720367897462952L; + private String customerId; + /** + * 所属党组织 + */ + private String partyOrgId; + /** + * 姓名 + */ + private String name; + /** + * 手机 + */ + private String mobile; + /** + * 身份证号 + */ + private String idCard; + /** + * 地址 + */ + private String address; + /** + * 流动党员 + */ + private String isLd; + /** + * 流动党员证号 + */ + private String ldzh; + /** + * 职务 + */ + private String partyZw; + /** + * 是否党员中心户 + */ + private String isDyzxh; + /** + * 是否免学习 + */ + private String isMxx; + /** + * 文化程度 + */ + private String culture; + /** + * 是否缴费 + */ + private String isPay; + /** + * 入党时间开始 + */ + private String rdsjStartDate; + /** + * 入党时间结束 + */ + private String rdsjEndDate; + /** + * 最后一次缴费时间开始 + */ + private String payStatrDate; + /** + * 最后一次缴费时间结束 + */ + private String payEndDate; + private String year; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java new file mode 100644 index 0000000000..bf4408f5a6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyMemberResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/18 16:33 + */ +@NoArgsConstructor +@Data +public class IcPartyMemberResultDTO implements Serializable { + + private static final long serialVersionUID = -4964061462850271428L; + /** + * 主键 + */ + private String id; + /** + * 姓名 + */ + private String name; + /** + * 身份证号 + */ + private String idCard; + /** + * 手机号 + */ + private String mobile; + /** + * 入党时间 + */ + private String rdsj; + /** + * 所属党组织 + */ + private String sszb; + /** + * 流动党员 + */ + private String isLd; + /** + * 流动党员证号 + */ + private String ldzh; + /** + * 职务 + */ + private String partyZw; + /** + * 地址 + */ + private String address; + /** + * 是否缴费 + */ + private String isPay; + /** + * 最近一次缴纳党费时间 + */ + private String payDate; + /** + * 文化程度 + */ + private String culture; + /** + * 量化积分 + */ + private String point; + /** + * 志愿者类别 + */ + private String volunteerCategory; + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java index d3ad0f31e8..cb246fcf2b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java @@ -1,7 +1,9 @@ package com.epmet.modules.partymember.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -9,9 +11,11 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; -import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.modules.partymember.excel.IcPartyMemberExcel; import com.epmet.modules.partymember.service.IcPartyMemberService; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -34,9 +38,9 @@ public class IcPartyMemberController { private IcPartyMemberService icPartyMemberService; @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = icPartyMemberService.page(params); - return new Result>().ok(page); + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO){ + PageData page = icPartyMemberService.page(tokenDto, formDTO); + return new Result>().ok(page); } @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java index 7860b8a4d9..dd8dede3af 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberDao.java @@ -2,8 +2,12 @@ package com.epmet.modules.partymember.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 数字平台党员信息表 * @@ -12,5 +16,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcPartyMemberDao extends BaseDao { - + /** + * 党员列表 + * + * @Param formDTO + * @Return {@link List< IcPartyMemberResultDTO>} + * @Author zhaoqifeng + * @Date 2022/5/18 17:01 + */ + List selectList(IcPartyMemberFromDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java index d3d8cfc352..8e9f3d7e4e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java @@ -2,8 +2,11 @@ package com.epmet.modules.partymember.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.modules.partymember.entity.IcPartyMemberEntity; +import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; import java.util.List; import java.util.Map; @@ -19,12 +22,12 @@ public interface IcPartyMemberService extends BaseService { /** * 默认分页 * - * @param params + * @param formDTO * @return PageData * @author generator * @date 2022-05-17 */ - PageData page(Map params); + PageData page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO); /** * 默认查询 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java index 43fd68686e..88a3e86fa5 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java @@ -2,36 +2,44 @@ package com.epmet.modules.partymember.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.enums.PartyPostEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.IcFormOptionsQueryFormDTO; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partymember.dao.IcPartyMemberDao; import com.epmet.modules.partymember.entity.IcPartyMemberEntity; import com.epmet.modules.partymember.service.IcPartyMemberService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; +import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO; +import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -46,6 +54,8 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, IcPartyMemberDTO.class); + public PageData page(TokenDto tokenDto, IcPartyMemberFromDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + if (StringUtils.isBlank(formDTO.getPartyOrgId())) { + //获取工作人员所属组织同级的党组织 + LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, formDTO.getCustomerId()); + orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); + IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper); + if (null == org) { + return new PageData<>(Collections.emptyList(), 0); + } + formDTO.setPartyOrgId(org.getId()); + } + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setYear(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY)); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectList(formDTO); + + PageInfo pageInfo = new PageInfo<>(list); + //获取文化程度字典 + Result> education = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + if (!education.success()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取文化程度信息失败", "获取文化程度信息失败"); + } + if (CollectionUtils.isNotEmpty(list)) { + //获取志愿者类别 + IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); + optionsForm.setCustomerId(tokenDto.getCustomerId()); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); + optionsForm.setColumnName("VOLUNTEER_CATEGORY"); + Result> volunteerMap = operCustomizeOpenFeignClient.getOptionsMap(optionsForm); + //构造数据 + list.forEach(item -> { + item.setIsLd(NumConstant.ONE_STR.equals(item.getIsLd()) ? "是" : "否"); + item.setIsLd(NumConstant.ONE_STR.equals(item.getIsPay()) ? "是" : "否"); + item.setPartyZw(PartyPostEnum.getName(item.getPartyZw())); + item.setCulture(education.getData().get(item.getCulture())); + item.setPoint(("0.00").equals(item.getPoint()) ? StrConstant.HYPHEN : item.getPoint()); + List category = Arrays.asList(item.getVolunteerCategory().split(StrConstant.COMMA)); + List categoryNames = category.stream().map(volunteerMap.getData()::get).collect(Collectors.toList()); + item.setVolunteerCategory(String.join(String.valueOf((char) 10), categoryNames)); + }); + } + return new PageData<>(list, pageInfo.getTotal()); } @Override @@ -200,6 +251,7 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml index 80b5742174..d9c392f174 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml @@ -36,6 +36,95 @@ + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 9f89b5ad1f..a20d6a304a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -2038,6 +2038,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl Date: Thu, 19 May 2022 08:59:24 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E9=87=8F=E5=8C=96=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/partymember/result/PartyMemberPointEchoResultDTO.java | 2 ++ .../partymember/controller/IcPartyMemberPointController.java | 4 ++-- .../epmet/modules/partymember/dao/IcPartyMemberPointDao.java | 3 ++- .../partymember/service/IcPartyMemberPointService.java | 2 +- .../service/impl/IcPartyMemberPointServiceImpl.java | 4 ++-- .../resources/mapper/partymember/IcPartyMemberPointDao.xml | 2 ++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java index 080da2ef8d..42b93cd711 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyMemberPointEchoResultDTO.java @@ -52,4 +52,6 @@ public class PartyMemberPointEchoResultDTO implements Serializable { * 警示扣分选项 */ private String warnOptions; + + private String id; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java index 256a56642d..fd2277d091 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java @@ -107,9 +107,9 @@ public class IcPartyMemberPointController { * @date 2022/5/18 18:18 */ @PostMapping("echoPartyMemberPoint") - public Result getEchoPartyMemberPoint(@RequestBody PartyMemberPointEchoFormDTO form) { + public Result getEchoPartyMemberPoint(@RequestBody PartyMemberPointEchoFormDTO form,@LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); - List dto = icPartyMemberPointService.getEchoPartyMemberPoint(form); + List dto = icPartyMemberPointService.getEchoPartyMemberPoint(form,tokenDto.getCustomerId()); return new Result().ok(dto); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java index 0d128f3ed7..11f7c53e8d 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java @@ -32,5 +32,6 @@ public interface IcPartyMemberPointDao extends BaseDao List getEchoPartyMemberPoint(@Param("partyMemberId") String partyMemberId, @Param("quarter") String quarter, - @Param("year") String year); + @Param("year") String year, + @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java index 2c11d65d4f..c73ccedbf1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberPointService.java @@ -101,5 +101,5 @@ public interface IcPartyMemberPointService extends BaseService getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form); + List getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form,String customerId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java index 875ed05bf7..bda0cb98a9 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java @@ -148,8 +148,8 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form) { - List dto = baseDao.getEchoPartyMemberPoint(form.getPartyMemberId(), form.getQuarter(), form.getYear()); + public List getEchoPartyMemberPoint(PartyMemberPointEchoFormDTO form,String customerId) { + List dto = baseDao.getEchoPartyMemberPoint(form.getPartyMemberId(), form.getQuarter(), form.getYear(),customerId); return dto; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml index f02e41db4e..d4eecf5891 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml @@ -78,6 +78,7 @@ From 0d9891af4e5abb9976c59f88bcae9d00f471fd5e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 19 May 2022 09:54:55 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=81=9A=E5=90=88=E8=A1=A8=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/IcVolunteerPolyCategoryDTO.java | 80 +++++++++++++++ .../com/epmet/dto/IcVolunteerPolyDTO.java | 99 +++++++++++++++++++ .../controller/IcVolunteerPolyController.java | 71 +++++++++++++ .../epmet/dao/IcVolunteerPolyCategoryDao.java | 16 +++ .../com/epmet/dao/IcVolunteerPolyDao.java | 16 +++ .../entity/IcVolunteerPolyCategoryEntity.java | 46 +++++++++ .../epmet/entity/IcVolunteerPolyEntity.java | 69 +++++++++++++ .../IcVolunteerPolyCategoryService.java | 78 +++++++++++++++ .../epmet/service/IcVolunteerPolyService.java | 78 +++++++++++++++ .../IcVolunteerPolyCategoryServiceImpl.java | 83 ++++++++++++++++ .../impl/IcVolunteerPolyServiceImpl.java | 84 ++++++++++++++++ .../mapper/IcVolunteerPolyCategoryDao.xml | 22 +++++ .../resources/mapper/IcVolunteerPolyDao.xml | 26 +++++ 13 files changed, 768 insertions(+) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java new file mode 100644 index 0000000000..4b4737d46e --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyCategoryDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +public class IcVolunteerPolyCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java new file mode 100644 index 0000000000..3a237f0856 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcVolunteerPolyDTO.java @@ -0,0 +1,99 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +public class IcVolunteerPolyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 居住成员1姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java new file mode 100644 index 0000000000..193c4ba6f0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java @@ -0,0 +1,71 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.service.IcVolunteerPolyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@RestController +@RequestMapping("icVolunteerPoly") +public class IcVolunteerPolyController { + + @Autowired + private IcVolunteerPolyService icVolunteerPolyService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icVolunteerPolyService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcVolunteerPolyDTO data = icVolunteerPolyService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcVolunteerPolyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icVolunteerPolyService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcVolunteerPolyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icVolunteerPolyService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icVolunteerPolyService.delete(ids); + return new Result(); + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java new file mode 100644 index 0000000000..d585715290 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyCategoryDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Mapper +public interface IcVolunteerPolyCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java new file mode 100644 index 0000000000..f963d33513 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcVolunteerPolyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Mapper +public interface IcVolunteerPolyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java new file mode 100644 index 0000000000..fa15bdc41e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyCategoryEntity.java @@ -0,0 +1,46 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_volunteer_poly_category") +public class IcVolunteerPolyCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 类别【字典表】 + */ + private String volunteerCategory; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java new file mode 100644 index 0000000000..7db2e18595 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcVolunteerPolyEntity.java @@ -0,0 +1,69 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_volunteer_poly") +public class IcVolunteerPolyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 居住成员1姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java new file mode 100644 index 0000000000..0dd4cfa523 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyCategoryService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcVolunteerPolyCategoryDTO; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +public interface IcVolunteerPolyCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcVolunteerPolyCategoryDTO + * @author generator + * @date 2022-05-19 + */ + IcVolunteerPolyCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void save(IcVolunteerPolyCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void update(IcVolunteerPolyCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java new file mode 100644 index 0000000000..180bae7924 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.entity.IcVolunteerPolyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +public interface IcVolunteerPolyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcVolunteerPolyDTO + * @author generator + * @date 2022-05-19 + */ + IcVolunteerPolyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void save(IcVolunteerPolyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-19 + */ + void update(IcVolunteerPolyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java new file mode 100644 index 0000000000..ff4aaa59d0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyCategoryServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcVolunteerPolyCategoryDao; +import com.epmet.dto.IcVolunteerPolyCategoryDTO; +import com.epmet.entity.IcVolunteerPolyCategoryEntity; +import com.epmet.service.IcVolunteerPolyCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合,志愿者类别表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Service +public class IcVolunteerPolyCategoryServiceImpl extends BaseServiceImpl implements IcVolunteerPolyCategoryService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcVolunteerPolyCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcVolunteerPolyCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcVolunteerPolyCategoryDTO get(String id) { + IcVolunteerPolyCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcVolunteerPolyCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcVolunteerPolyCategoryDTO dto) { + IcVolunteerPolyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcVolunteerPolyCategoryDTO dto) { + IcVolunteerPolyCategoryEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java new file mode 100644 index 0000000000..a3e4d4d806 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcVolunteerPolyDao; +import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.entity.IcVolunteerPolyEntity; +import com.epmet.service.IcVolunteerPolyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息聚合 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-19 + */ +@Service +public class IcVolunteerPolyServiceImpl extends BaseServiceImpl implements IcVolunteerPolyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcVolunteerPolyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcVolunteerPolyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcVolunteerPolyDTO get(String id) { + IcVolunteerPolyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcVolunteerPolyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcVolunteerPolyDTO dto) { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcVolunteerPolyDTO dto) { + IcVolunteerPolyEntity entity = ConvertUtils.sourceToTarget(dto, IcVolunteerPolyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml new file mode 100644 index 0000000000..0029247482 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyCategoryDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml new file mode 100644 index 0000000000..130d275705 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 08d7abc754d37c34dce015c3735a65cde0082a90 Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 19 May 2022 10:14:14 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D-?= =?UTF-8?q?=E6=8C=89=E5=88=86=E7=B1=BB=E7=BB=9F=E8=AE=A1=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E5=8F=8A=E5=8D=A0=E6=AF=94=E4=BF=AE=E6=94=B9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/PartyTypepercentResultDTO.java | 2 +- .../service/impl/IcPartyUnitServiceImpl.java | 31 +++++++++++++------ .../main/resources/mapper/IcPartyUnitDao.xml | 5 ++- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java index 34bc09d38b..5a5112a4a8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyTypepercentResultDTO.java @@ -19,7 +19,7 @@ public class PartyTypepercentResultDTO { /** * 数量 */ - private String value; + private Integer value; /** * 联建单位编码 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 81afd27ab7..cf4f96c510 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -603,7 +603,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); // 获取gridName - for (PartyUnitListbrieResultDTO item:dto) { + for (PartyUnitListbrieResultDTO item : dto) { if (StringUtils.isNotEmpty(item.getGridId())) { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); if (null != gridInfo) { @@ -617,15 +617,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl getTypepercent(PartyTypepercentFormDTO form) { - List dto = baseDao.getTypepercent(form.getAgencyId()); - int total = 0; - for (PartyTypepercentResultDTO item : dto) { - total = Integer.parseInt(item.getValue()) + total; - } - for (PartyTypepercentResultDTO item : dto) { - item.setPercent((Integer.parseInt(item.getValue()) * 100) / total + "%"); + + DictListFormDTO dictFromDTO = new DictListFormDTO(); + dictFromDTO.setDictType(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFromDTO); + if (!dictResult.success()) { + throw new EpmetException(dictResult.getCode()); } - return dto; + + List result = baseDao.getTypepercent(form.getAgencyId()); + Map map = result.stream().collect(Collectors.toMap(PartyTypepercentResultDTO::getCode, PartyTypepercentResultDTO::getValue)); + + int sum = result.stream().mapToInt(PartyTypepercentResultDTO::getValue).sum(); + + return dictResult.getData().stream().map(item -> { + PartyTypepercentResultDTO dto = new PartyTypepercentResultDTO(); + dto.setLabel(item.getLabel()); + dto.setCode(item.getValue()); + dto.setValue(null == map.get(item.getValue()) ? NumConstant.ZERO : map.get(item.getValue())); + dto.setPercent((Integer.parseInt(item.getValue()) * 100) / sum + "%"); + return dto; + }).collect(Collectors.toList()); + } private String getServiceMatter(Map map, String matter) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index 2938ee960e..30925f1867 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -112,9 +112,8 @@ + SELECT id, + pid, + pids, + ORGANIZATION_NAME as name, + level + FROM `customer_agency` + where + DEL_FLAG='0' + and (id=#{agencyId} + or PIDS LIKE concat('%',#{agencyId}, '%' )) + + and level IN + + #{item} + + + order by CREATED_TIME desc + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java index b4703e9d21..b5d26e1ee6 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java @@ -2,6 +2,7 @@ package com.epmet.resi.partymember.dto.partyOrg; import lombok.Data; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -30,6 +31,7 @@ public class IcPartyOrgDTO implements Serializable { /** * 党组织的上级ID,没有上级时为0 */ + @NotNull(message = "上级组织不能为空") private String orgPid; /** @@ -40,6 +42,7 @@ public class IcPartyOrgDTO implements Serializable { /** * 行政组织 机关ID */ + private String agencyId; /** @@ -50,11 +53,13 @@ public class IcPartyOrgDTO implements Serializable { /** * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 */ + @NotNull(message = "组织类型不能为空") private String partyOrgType; /** * 组织名称 */ + @NotNull(message = "组织名称不能为空") private String partyOrgName; /** @@ -65,11 +70,13 @@ public class IcPartyOrgDTO implements Serializable { /** * 经度 */ + @NotNull(message = "经度不能为空") private String longitude; /** * 纬度 */ + @NotNull(message = "纬度不能为空") private String latitude; /** @@ -112,4 +119,9 @@ public class IcPartyOrgDTO implements Serializable { */ private Date updatedTime; + /** + * 用户id + */ + private String staffId; + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java new file mode 100644 index 0000000000..35d7372bc9 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java @@ -0,0 +1,91 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * 党组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-17 + */ +@Data +public class IcPartyOrgTreeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 党组织的上级ID,没有上级时为0(前端展示用) + */ + private String pid; + + + /** + * 党组织的上级ID,没有上级时为0 + */ + private String orgPid; + + /** + * 党组织的所有上级ID,没有上级时为0 + */ + private String orgPids; + + /** + * 行政组织 机关ID + */ + private String agencyId; + + /** + * 行政组织 机关ID + */ + private String agencyPids; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + */ + private String partyOrgType; + + /** + * 组织名称 + */ + private String partyOrgName; + + /** + * 组织编码 + */ + private String partyOrgCode; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 党组织介绍 + */ + private String introduction; + + + private List children = new ArrayList<>(); + + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java index 5b6c3937c8..8d06c68748 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,16 +47,15 @@ public class IcPartyOrgController { } @NoRepeatSubmit - @PostMapping("save") + @PostMapping public Result save(@RequestBody IcPartyOrgDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - icPartyOrgService.save(dto); - return new Result(); + return icPartyOrgService.save(dto); } @NoRepeatSubmit - @PostMapping("update") + @PutMapping public Result update(@RequestBody IcPartyOrgDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -78,5 +78,19 @@ public class IcPartyOrgController { } + /** + * @describe: 获取党组织下拉树 + * @author wangtong + * @date 2022/5/17 17:13 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @GetMapping("getTreelist") + public Result> getTreelist(IcPartyOrgDTO formDTO){ +// ValidatorUtils.validateEntity(formDTO,IcPartyOrgDTO.AddUserInternalGroup.class, PageFormDTO.AddUserInternalGroup.class); + return icPartyOrgService.getTreelist(formDTO); + } + + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java index 71e36d6036..b38cac1d34 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java @@ -2,8 +2,12 @@ package com.epmet.modules.partyOrg.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 党组织表 * @@ -13,4 +17,12 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface IcPartyOrgDao extends BaseDao { + /** + * @describe: 获取组织列表 + * @author wangtong + * @date 2022/5/17 19:00 + * @params [] + * @return java.util.List + */ + List getTreelist(IcPartyOrgDTO formDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java index 5de6135f20..92b979a6a2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java @@ -2,8 +2,10 @@ package com.epmet.modules.partyOrg.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import java.util.List; import java.util.Map; @@ -54,7 +56,7 @@ public interface IcPartyOrgService extends BaseService { * @author generator * @date 2022-05-17 */ - void save(IcPartyOrgDTO dto); + Result save(IcPartyOrgDTO dto); /** * 默认更新 @@ -75,4 +77,13 @@ public interface IcPartyOrgService extends BaseService { * @date 2022-05-17 */ void delete(String[] ids); + + /** + * @describe: 获取党组织下拉树 + * @author wangtong + * @date 2022/5/17 17:20 + * @params [formDTO] + * @return com.epmet.commons.tools.page.PageData + */ + Result> getTreelist(IcPartyOrgDTO formDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java index dcae7448f5..22f604bf09 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java @@ -4,20 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.enums.PartyOrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 党组织表 @@ -62,15 +65,34 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl> getTreelist(IcPartyOrgDTO formDTO) { + List list = baseDao.getTreelist(formDTO); + return new Result>().ok(build(list)); + } + + /** + * 构建树节点 + */ + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(IcPartyOrgTreeDTO treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(IcPartyOrgTreeDTO node : nodeMap.values()) { + IcPartyOrgTreeDTO parent = nodeMap.get(node.getOrgPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml index cb955631e0..d3ecd6c0b4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -24,6 +24,30 @@ + From d712b8f3498a4b5c450783a24eb6142561da434f Mon Sep 17 00:00:00 2001 From: HAHA Date: Thu, 19 May 2022 14:18:40 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E3=80=90=E7=BD=91=E6=A0=BC=E5=85=9A?= =?UTF-8?q?=E5=BB=BA=E5=B9=B3=E9=9D=A2=E5=9B=BE=E3=80=91=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/VolunteerPolyMapDataFormDTO.java | 23 +++++++ .../result/VolunteerPolyMapDataResultDTO.java | 65 +++++++++++++++++++ .../controller/IcVolunteerPolyController.java | 20 ++++++ .../com/epmet/dao/IcVolunteerPolyDao.java | 12 +++- .../epmet/service/IcVolunteerPolyService.java | 12 ++++ .../impl/IcVolunteerPolyServiceImpl.java | 37 +++++++++++ .../resources/mapper/IcVolunteerPolyDao.xml | 21 ++++++ 7 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java new file mode 100644 index 0000000000..f6c841e5c7 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerPolyMapDataFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VolunteerPolyMapDataFormDTO implements Serializable { + + private static final long serialVersionUID = 341371496246696462L; + + /** + * 志愿者分类code + */ + @NotBlank(message = "分类不能为空") + private String code; + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java new file mode 100644 index 0000000000..13716b0071 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerPolyMapDataResultDTO.java @@ -0,0 +1,65 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class VolunteerPolyMapDataResultDTO implements Serializable { + + private static final long serialVersionUID = -6310126790215323874L; + + /** + * 主键 + */ + private String id; + + /** + * 名字 + */ + private String name; + + /** + * 所属网格 + */ + private String gridName; + + /** + * 网格id + */ + private String gridId; + + /** + * 所属房屋 + */ + private String houseName; + + /** + * 房屋id + */ + private String homeId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 人户状况 + */ + private String rhzk; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java index 193c4ba6f0..63e48d10ca 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -9,10 +11,13 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; import com.epmet.service.IcVolunteerPolyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; @@ -67,5 +72,20 @@ public class IcVolunteerPolyController { return new Result(); } + /** + * 【网格党建平面图】地图 + * + * @param form + * @return com.epmet.commons.tools.utils.Result> + * @author LZN + * @date 2022/5/19 13:54 + */ + @PostMapping("/mapData") + public Result> getMapData(@RequestBody VolunteerPolyMapDataFormDTO form, @LoginUser TokenDto tokenDto){ + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); + List dto = icVolunteerPolyService.getMapData(form); + return new Result>().ok(dto); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java index f963d33513..b523ecd64d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java @@ -1,8 +1,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; import com.epmet.entity.IcVolunteerPolyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 志愿者信息聚合 @@ -12,5 +16,11 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcVolunteerPolyDao extends BaseDao { - + + /** + * 【网格党建平面图】地图 + * @param code + */ + List getMapData(@Param("code") String code, + @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java index 180bae7924..44b4fdd82f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java @@ -3,6 +3,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; import com.epmet.entity.IcVolunteerPolyEntity; import java.util.List; @@ -75,4 +77,14 @@ public interface IcVolunteerPolyService extends BaseService + * @author LZN + * @date 2022/5/19 13:55 + */ + List getMapData(VolunteerPolyMapDataFormDTO form); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java index a3e4d4d806..8965534e86 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -4,10 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.IcVolunteerPolyDao; import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; +import com.epmet.dto.result.PartyUnitListbrieResultDTO; +import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; import com.epmet.entity.IcVolunteerPolyEntity; import com.epmet.service.IcVolunteerPolyService; import org.apache.commons.lang3.StringUtils; @@ -81,4 +88,34 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl + * @author LZN + * @date 2022/5/19 13:55 + */ + @Override + public List getMapData(VolunteerPolyMapDataFormDTO form) { + List dto = baseDao.getMapData(form.getCode(),form.getCustomerId()); + // 获取gridName + for (VolunteerPolyMapDataResultDTO item : dto) { + if (StringUtils.isNotEmpty(item.getGridId())) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridName()); + } + } + // 获取houseName + if(StringUtils.isNotEmpty(item.getHomeId())) { + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(form.getCustomerId(), item.getHomeId()); + if(null != houseInfo) { + item.setHouseName(houseInfo.getHouseName()); + } + } + } + return dto; + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml index 130d275705..4b7d22d93d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -21,6 +21,27 @@ + \ No newline at end of file