From 4f442eff01e5b4e803f84e1a4454432b3ec8aebe Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 4 May 2023 15:26:37 +0800 Subject: [PATCH 01/26] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98addstaffv2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=96=87=E5=8C=96?= =?UTF-8?q?=E7=A8=8B=E5=BA=A6=E7=9A=84=E5=AD=97=E6=AE=B5=E3=80=81idCard?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=86=85?= =?UTF-8?q?=E9=83=A8=E9=80=BB=E8=BE=91=E4=B8=AD=EF=BC=8C=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E8=A7=A3=E6=9E=90idCard=E5=BE=97=E5=88=B0=E5=87=BA=E7=94=9F?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=AD=98=E5=82=A8?= =?UTF-8?q?=202.=E4=BF=AE=E6=94=B9=EF=BC=9A=E7=BC=96=E8=BE=91=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E4=BA=BA=E5=91=98editstaff=E6=8E=A5=E5=8F=A3=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=87=E5=8C=96=E7=A8=8B=E5=BA=A6=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=81idCard=E7=9A=84=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=86=85=E9=83=A8=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E9=80=9A=E8=BF=87=E8=A7=A3=E6=9E=90idCard?= =?UTF-8?q?=E5=BE=97=E5=88=B0=E5=87=BA=E7=94=9F=E6=97=A5=E6=9C=9F=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AddStaffV2FromDTO.java | 7 +++++++ .../epmet/dto/form/StaffSubmitFromDTO.java | 13 +++++++++++++ .../com/epmet/entity/CustomerStaffEntity.java | 10 ++++++++++ .../impl/CustomerStaffServiceImpl.java | 19 +++++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java index 7bc3b93076..413e9af58a 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java @@ -78,4 +78,11 @@ public class AddStaffV2FromDTO implements Serializable { * 烟台用:当前登录用户 */ private String currentUserId; + + /** + * 文化程度。0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专 + */ + private String culture; + + private String idCard; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java index f39bde7aab..ded840ad19 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffSubmitFromDTO.java @@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -74,4 +75,16 @@ public class StaffSubmitFromDTO implements Serializable { * 社会自组织: community_org */ private String deptType; + + private String idCard; + + /** + * 文化程度。0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专 + */ + private String culture; + + // /** + // * 出生日期 + // */ + // private Date birthday; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java index aa19464f9e..99ba05e16c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java @@ -111,4 +111,14 @@ public class CustomerStaffEntity extends BaseEpmetEntity { * 身份证号 */ private String idCard; + + /** + * 出生日期 + */ + private Date birthday; + + /** + * 文化程度。0小学及文盲,1初中,2高中,3大专,4本科,5硕士,6博士,7中专 + */ + private String culture; } 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 1ff4560c99..fcc7fdba67 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 @@ -37,6 +37,8 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.IdCardRegexUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerStaffConstant; import com.epmet.constant.RoleKeyConstants; @@ -73,6 +75,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.time.LocalDate; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; @@ -370,6 +373,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Thu, 4 May 2023 17:51:36 +0800 Subject: [PATCH 02/26] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E4=BA=BA=E5=91=98=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=8E=A5=E5=8F=A3editstaffinit,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0idcard=EF=BC=8Cculture,cultureDisplay?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/epmetuser/CustomerStaffDTO.java | 4 +++ .../dto/govorg/form/StaffDetailV2FormDTO.java | 13 ++++++++++ .../data-aggregator-server/pom.xml | 5 ++++ .../controller/GovOrgController.java | 2 +- .../epmetuser/impl/EpmetUserServiceImpl.java | 18 ++++++++++++- .../epmet/dto/result/StaffInitResultDTO.java | 8 ++++++ .../java/com/epmet/dto/CustomerStaffDTO.java | 2 ++ .../impl/CustomerStaffServiceImpl.java | 25 +++++++++++++++---- 8 files changed, 70 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java index dec7a89cc7..29c416a0a7 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java @@ -134,4 +134,8 @@ public class CustomerStaffDTO implements Serializable { */ private String password; + private String idCard; + private String culture; + private Date birthday; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java index ea1763af18..8a29563dd2 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.dto.govorg.form; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; @@ -48,4 +49,16 @@ public class StaffDetailV2FormDTO implements Serializable { private List szsqRoles; private String customerId; + private String idCard; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date birthday; + /** + * 文化程度 + */ + private String culture; + /** + * 文化程度,中文 + */ + private String cultureDisplay; + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 33b3dcea12..0841274180 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -138,6 +138,11 @@ 2.0.0 compile + + com.epmet + epmet-admin-client + 2.0.0 + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java index 67fd1c711d..263a862971 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -217,7 +217,7 @@ public class GovOrgController { return new Result().ok(govOrgService.getCurrentOrgStafflist(formDTO)); } - /** + /**w * @Param formDTO * @Description 【通讯录】人员详情v2 * @author sun diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 75f863dd58..4d9219f48b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -5,12 +5,14 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.OrgTypeEnum; 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.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; @@ -53,6 +55,7 @@ import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govproject.GovProjectService; import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.SysDictDataDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.GetStaffExistRoleFormDTO; @@ -60,6 +63,7 @@ import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.DetailByTypeResultDTO; import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; +import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovAccessFeignClient; import com.github.pagehelper.PageHelper; @@ -86,7 +90,7 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EPMET_USER) @Slf4j -public class EpmetUserServiceImpl implements EpmetUserService { +public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolver { @Autowired private UserBaseInfoDao userBaseInfoDao; @@ -124,6 +128,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; /** * @Description 根据UserIds查询 @@ -752,6 +758,16 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setName(dto.getRealName()); result.setGender(dto.getGender().toString()); result.setRoles(list); + + List dict = getResultDataOrReturnNull(adminOpenFeignClient.dictDataList("education"), ServiceConstant.EPMET_ADMIN_SERVER); + if (CollectionUtils.isNotEmpty(dict)) { + for (SysDictDataDTO d : dict) { + if (d.getDictValue().equals(dto.getCulture())) { + result.setCultureDisplay(d.getDictLabel()); + break; + } + } + } // 获取数字社区里的新角色 GetStaffExistRoleFormDTO getStaffExistRoleFormDTO = new GetStaffExistRoleFormDTO(); getStaffExistRoleFormDTO.setStaffId(staffId); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 87b641b564..fb53b15ab3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -55,4 +57,10 @@ public class StaffInitResultDTO implements Serializable { * xxx-xxx */ private String agencyName; + + private String culture; + + private String cultureDisplay; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date birthday; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java index cd042877ab..f92d694e3c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java @@ -149,5 +149,7 @@ public class CustomerStaffDTO implements Serializable { * 身份证号 */ private String idCard; + private String culture; + private Date birthday; } \ No newline at end of file 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 fcc7fdba67..9b55a2e861 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 @@ -29,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; 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.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; @@ -54,10 +55,7 @@ import com.epmet.entity.CustomerStaffEntity; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; -import com.epmet.feign.AuthFeignClient; -import com.epmet.feign.GovAccessFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.feign.*; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; @@ -88,7 +86,7 @@ import java.util.stream.Collectors; */ @Slf4j @Service -public class CustomerStaffServiceImpl extends BaseServiceImpl implements CustomerStaffService { +public class CustomerStaffServiceImpl extends BaseServiceImpl implements CustomerStaffService, ResultDataResolver { private final Logger logger = LogManager.getLogger(getClass()); @Autowired private GovStaffRoleService govStaffRoleService; @@ -113,6 +111,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -342,6 +343,20 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl staffRoleResultDTOS = ConvertUtils.sourceToTarget(staffExistRole.getData(), StaffRoleResultDTO.class); resultDTO.setNewRoleList(staffRoleResultDTOS); } + + resultDTO.setIdCard(customerStaffDTO.getIdCard()); + resultDTO.setBirthday(customerStaffDTO.getBirthday()); + resultDTO.setCulture(customerStaffDTO.getCulture()); + + List dict = getResultDataOrReturnNull(adminOpenFeignClient.dictDataList("education"), ServiceConstant.EPMET_ADMIN_SERVER); + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(dict)) { + for (SysDictDataDTO d : dict) { + if (d.getDictValue().equals(customerStaffDTO.getCulture())) { + resultDTO.setCultureDisplay(d.getDictLabel()); + break; + } + } + } return new Result().ok(resultDTO); } From 7659d2fc441c55d2dbdb00490f56566639a5b147 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 5 May 2023 09:14:03 +0800 Subject: [PATCH 03/26] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=96=87=E7=AB=A0=E6=A0=8F=E7=9B=AE=E3=80=82=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E5=88=A0=E9=99=A4=E4=B8=80=E7=BA=A7=E6=A0=8F=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CategoryDictServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java index 66ec701d54..f0f2cb5d58 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/CategoryDictServiceImpl.java @@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 文章栏目表 @@ -138,7 +139,18 @@ public class CategoryDictServiceImpl extends BaseServiceImpl idList = Arrays.asList(ids); + + List idList2Del = idList.stream().map(id -> { + CategoryDictEntity dict = baseDao.selectById(id); + if (dict == null || StringUtils.isBlank(dict.getPid().trim()) || "0".equals(dict.getPid())) { + // 一级分类的情况下,不执行删除。一级分类的id已经被固定到了菜单中,要删除了,就对应不起来了 + return false; + } + return true; + }).collect(Collectors.toList()); + + baseDao.deleteBatchIds(idList2Del); } @Override From cc41cb420abb36348bb3fee445dab3ef83c26101 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 9 May 2023 15:56:48 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=91=E5=81=9A=E4=BA=86=E4=B8=80=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LingShanAgentServiceProcessStatusEnum.java | 59 ++++++ .../WorkCloseAgentServiceFormDTO.java | 18 ++ .../AgentServiceResiSubmitFormDTO.java | 35 ++++ .../ResiMyCreatedAgentServiceResultDTO.java | 41 +++++ .../WorkServiceAgentResultDTO.java | 25 +++ .../LingShanAgentServiceController.java | 131 +++++++++++++ .../dao/LingshanAgentServiceCategoryDao.java | 16 ++ .../dao/LingshanAgentServiceRecordDao.java | 16 ++ .../LingshanAgentServiceCategoryEntity.java | 39 ++++ .../LingshanAgentServiceRecordEntity.java | 131 +++++++++++++ .../service/LingShanAgentServiceService.java | 20 ++ .../impl/LingShanAgentServiceServiceImpl.java | 173 ++++++++++++++++++ .../LingshanAgentServiceCategoryDao.xml | 20 ++ .../mapper/LingshanAgentServiceRecordDao.xml | 39 ++++ .../com/epmet/constant/RoleKeyConstants.java | 5 + 15 files changed, 768 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/LingShanAgentServiceProcessStatusEnum.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/agentservice/WorkCloseAgentServiceFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/AgentServiceResiSubmitFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/WorkServiceAgentResultDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceCategoryDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceRecordDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/LingShanAgentServiceProcessStatusEnum.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/LingShanAgentServiceProcessStatusEnum.java new file mode 100644 index 0000000000..a96310b991 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/LingShanAgentServiceProcessStatusEnum.java @@ -0,0 +1,59 @@ +package com.epmet; + +/** + * @Description 红色待办-待办状态枚举 + * @Author wangxianzhang + * @Time 2023/5/9 9:59 AM + */ +public enum LingShanAgentServiceProcessStatusEnum { + // 办理状态。0待受理,1已受理,2已驳回,3已办结,-1已撤回 + + WAIT_ACCEPT(0, "待受理"), + ACCEPTED(1, "已受理"), + REJECTED(2, "已驳回"), + CLOSED(3, "已办结"), + WITHDRAW(-1, "已撤回"); + + private int statusCode; + + private String statusName; + + LingShanAgentServiceProcessStatusEnum(int status, String name) { + this.statusCode = status; + this.statusName = name; + } + + public static LingShanAgentServiceProcessStatusEnum getByStatus(int statusCode) { + for (LingShanAgentServiceProcessStatusEnum e : LingShanAgentServiceProcessStatusEnum.values()) { + if (e.statusCode == statusCode) { + return e; + } + } + return null; + } + + public static LingShanAgentServiceProcessStatusEnum getByName(String statusName) { + for (LingShanAgentServiceProcessStatusEnum e : LingShanAgentServiceProcessStatusEnum.values()) { + if (e.statusName.equals(statusName)) { + return e; + } + } + return null; + } + + public int getStatusCode() { + return statusCode; + } + + public void setStatusCode(int statusCode) { + this.statusCode = statusCode; + } + + public String getStatusName() { + return statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/agentservice/WorkCloseAgentServiceFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/agentservice/WorkCloseAgentServiceFormDTO.java new file mode 100644 index 0000000000..5a949299f6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/agentservice/WorkCloseAgentServiceFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form.agentservice; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.List; + +/** + * 工作端:代理服务办结 + */ +@Data +public class WorkCloseAgentServiceFormDTO { + @NotBlank(message = "待办服务ID必填") + private String id; + + private String processDesc; + private List processAttachments; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/AgentServiceResiSubmitFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/AgentServiceResiSubmitFormDTO.java new file mode 100644 index 0000000000..f4f914c07d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/AgentServiceResiSubmitFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.form.lingshan; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +@Data +public class AgentServiceResiSubmitFormDTO { + + public interface Create extends CustomerClientShowGroup {} + + @NotBlank(message = "网格ID不能为空", groups = { Create.class }) + private String gridId; + @NotBlank(message = "服务类别不能为空", groups = { Create.class }) + private String serviceCategory; + @NotBlank(message = "详细说明不能为空", groups = { Create.class }) + private String content; + @NotBlank(message = "预约服务地点不能为空", groups = { Create.class }) + private String exceptServeAddress; + @NotBlank(message = "联系人不能为空", groups = { Create.class }) + private String contactName; + @NotBlank(message = "联系电话不能为空", groups = { Create.class }) + private String contactMobile; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @NotNull(message = "预约服务时间不能为空", groups = { Create.class }) + private Date exceptServeTime; + private List attachmentsList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java new file mode 100644 index 0000000000..1922dea3bd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result.agentservice; + +import lombok.Data; + +import java.util.Date; + +@Data +public class ResiMyCreatedAgentServiceResultDTO { + + private String serviceCategory; + private String serviceCategoryName; + private String content; + private Date createdTime; + // 待受理 + private Date exceptServeTime; + private String exceptServeAddress; + + /** + * 处理时间 + */ + private Date processTime; + + /** + * 处理说明 + */ + private String processDesc; + + /** + * 办结时间 + */ + private Date closeTime; + + /** + * 办结说明 + */ + private String closeDesc; + + private Integer processStatus; + + private String processStatusName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/WorkServiceAgentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/WorkServiceAgentResultDTO.java new file mode 100644 index 0000000000..83c8f040e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/WorkServiceAgentResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result.agentservice; + +import lombok.Data; + +import java.util.Date; + +/** + * @Description 工作单-服务代办列表 + * @Author wangxianzhang + * @Time 2023/5/9 10:52 AM + */ +@Data +public class WorkServiceAgentResultDTO { + + private Integer serviceCategory; + private String serviceCategoryName; + + private Date createdTime; + private String content; + + // 待受理 + private Date exceptServeTime; + private String exceptServeAddress; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java new file mode 100644 index 0000000000..f27ffc4181 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -0,0 +1,131 @@ +package com.epmet.controller; + +import com.epmet.LingShanAgentServiceProcessStatusEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.agentservice.WorkCloseAgentServiceFormDTO; +import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; +import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; +import com.epmet.service.LingShanAgentServiceService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @Description 灵山-服务代办 + * @Author wangxianzhang + * @Time 2023/5/6 2:49 PM + */ +@RestController +@RequestMapping("lingshan/serviceAgent") +public class LingShanAgentServiceController { + + @Autowired + private LingShanAgentServiceService lingShanServiceAgentService; + + /** + * @description: 居民端-提交代办服务 + * @param form: + * @return + * @author: WangXianZhang + * @date: 2023/5/6 3:02 PM + */ + @PostMapping("resi/submit") + public Result resiSubmit(@RequestBody AgentServiceResiSubmitFormDTO form) { + ValidatorUtils.validateEntity(form, AgentServiceResiSubmitFormDTO.Create.class); + lingShanServiceAgentService.resiSubmit(form); + return new Result(); + } + + /** + * @description: 我创建的 + * @return + * @author: WangXianZhang + * @date: 2023/5/9 10:06 AM + */ + @GetMapping("resi/mycreated") + public Result> myCreated(@RequestParam(value = "processStatus", required = false) Integer processStatus, + @RequestParam("gridId") String gridId, + @RequestParam("pageNo") Integer pageNo, + @RequestParam("pageSize") Integer pageSize) { + + PageData pd = lingShanServiceAgentService.myCreatedList(processStatus, gridId, pageNo, pageSize); + return new Result().ok(pd); + } + + /** + * @description: 工作端-服务列表 + * 这个接口返回的跟居民端一样,所以暂时就调用居民端一样的接口了。 + * @param processStatus: + * @param gridId: + * @return + * @author: WangXianZhang + * @date: 2023/5/9 10:59 AM + */ + @GetMapping("work/serviceList") + public Result> workServiceList(@RequestParam(value = "processStatus", required = false) Integer processStatus, + @RequestParam("gridId") String gridId, + @RequestParam("pageNo") Integer pageNo, + @RequestParam("pageSize") Integer pageSize) { + PageData pd = lingShanServiceAgentService.myCreatedList(processStatus, gridId, pageNo, pageSize); + return new Result().ok(pd); + } + + /** + * @description: 工作端提交处理。没几个参数,不值当用dto了 + * @return + * @author: WangXianZhang + * @date: 2023/5/9 11:10 AM + */ + @PostMapping("work/process") + public Result workProcess(@RequestBody Map input) { + + String id = (String) input.get("id"); + Integer processType = (Integer) input.get("processType"); + String processDesc = (String) input.get("processDesc"); + + if (StringUtils.isAnyBlank(id) || processType == null) { + throw new ValidateException("参数错误"); + } + + LingShanAgentServiceProcessStatusEnum processTypeEnum = LingShanAgentServiceProcessStatusEnum.getByStatus(processType); + + // 如果是驳回,那么描述必填 + if (processTypeEnum == LingShanAgentServiceProcessStatusEnum.REJECTED + && StringUtils.isBlank(processDesc)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "驳回操作时,驳回原因为必填项"); + } + + lingShanServiceAgentService.workProcess(id, processType, processDesc); + return new Result(); + } + + /** + * @description: 工作端:办结 + * @param input: + * @return + * @author: WangXianZhang + * @date: 2023/5/9 2:57 PM + */ + @PostMapping("work/close") + public Result workClose(@RequestBody WorkCloseAgentServiceFormDTO input) { + ValidatorUtils.validateEntity(input); + + String id = input.getId(); + String processDesc = input.getProcessDesc(); + List processAttachments = input.getProcessAttachments(); + + lingShanServiceAgentService.workClose(id, processDesc, processAttachments); + return new Result(); + } + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceCategoryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceCategoryDao.java new file mode 100644 index 0000000000..7d23603738 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceCategoryDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanAgentServiceCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 待办服务类别 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Mapper +public interface LingshanAgentServiceCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceRecordDao.java new file mode 100644 index 0000000000..f75e7e08df --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanAgentServiceRecordDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.LingshanAgentServiceRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 待办服务记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-06 + */ +@Mapper +public interface LingshanAgentServiceRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java new file mode 100644 index 0000000000..60ba1474d3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java @@ -0,0 +1,39 @@ +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 2023-05-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_agent_service_category") +public class LingshanAgentServiceCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + private String customerId; + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 描述 + */ + private String description; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java new file mode 100644 index 0000000000..a4d3a8c67e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java @@ -0,0 +1,131 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +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 2023-05-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_agent_service_record") +public class LingshanAgentServiceRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 申请人ID(居民端用户ID) + */ + private String applicantId; + + /** + * 申请人姓名 + */ + private String applicantName; + + /** + * 代办员ID。默认使用空字符串。 + */ + private String agentId; + + /** + * 代办员姓名 + */ + private String agentName; + + /** + * 提交者所在网格ID + */ + private String gridId; + + /** + * 组织id路径,含本级,含网格id + */ + private String orgIdPath; + + private String attachments; + + /** + * 服务类型id + */ + private String serviceCategory; + + /** + * 预约服务时间 + */ + private Date exceptServeTime; + + /** + * 预约服务地点 + */ + private String exceptServeAddress; + + /** + * 受理时间。状态变为受理的时间 + */ + private Date processTime; + private String processDesc; + + private String processAttachments; + + /** + * 联系人姓名 + */ + private String contactName; + + /** + * 联系电话 + */ + private String contactMobile; + + /** + * 办理状态。0待受理,1已受理,2已驳回,3已办结,-1已撤回 + */ + private Integer processStatus; + + /** + * 办结时间 + */ + private Date closeTime; + + /** + * 办结说明 + */ + private String closeDesc; + + /** + * 内容,详细说明 + */ + private String content; + + /** + * 满意度评价。-1不满意,0基本满意,1非常满意 + */ + private Integer satisfication; + + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java new file mode 100644 index 0000000000..1f9e7093a5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; +import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; + +import java.util.List; + +public interface LingShanAgentServiceService { + void resiSubmit(AgentServiceResiSubmitFormDTO form); + + PageData myCreatedList(Integer processStatus, String gridId, Integer pageNo, Integer pageSize); + + PageData workServiceList(Integer processStatus, String gridId); + + void workProcess(String id, Integer processType, String processDesc); + + void workClose(String id, String processDesc, List processAttachments); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java new file mode 100644 index 0000000000..b75d84f059 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -0,0 +1,173 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.LingShanAgentServiceProcessStatusEnum; +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.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.dao.LingshanAgentServiceCategoryDao; +import com.epmet.dao.LingshanAgentServiceRecordDao; +import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; +import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; +import com.epmet.entity.LingshanAgentServiceCategoryEntity; +import com.epmet.entity.LingshanAgentServiceRecordEntity; +import com.epmet.service.LingShanAgentServiceService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@Service +@Slf4j +public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceService { + + @Autowired + private LingshanAgentServiceCategoryDao agentServiceCategoryDao; + + @Autowired + private LingshanAgentServiceRecordDao agentServiceRecordDao; + + + @Override + public void resiSubmit(AgentServiceResiSubmitFormDTO form) { + // 判断类别是否存在 + if (agentServiceCategoryDao.selectById(form.getServiceCategory()) == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务类别ID:" + form.getServiceCategory()); + } + + ResiUserInfoCache resiInfo = CustomerResiUserRedis.getUserBaseInfo(EpmetRequestHolder.getLoginUserId()); + + LingshanAgentServiceRecordEntity e2Insert = ConvertUtils.sourceToTarget(form, LingshanAgentServiceRecordEntity.class); + e2Insert.setAttachments(JSON.toJSONString(form.getAttachmentsList())); + e2Insert.setApplicantId(EpmetRequestHolder.getLoginUserId()); + e2Insert.setApplicantName(resiInfo.getRealName()); + e2Insert.setProcessStatus(LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()); //初始为待受理状态 + + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(form.getGridId()); + e2Insert.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids())); + + agentServiceRecordDao.insert(e2Insert); + } + + @Override + public PageData myCreatedList(Integer processStatus, String gridId, Integer pageNo, Integer pageSize) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(processStatus != null, LingshanAgentServiceRecordEntity::getProcessStatus, processStatus); + q.eq(LingshanAgentServiceRecordEntity::getGridId, gridId); + + PageHelper.startPage(pageNo, pageSize); + List l = agentServiceRecordDao.selectList(q); + + List rl = l.stream().map(e -> { + ResiMyCreatedAgentServiceResultDTO d = ConvertUtils.sourceToTarget(e, ResiMyCreatedAgentServiceResultDTO.class); + + d.setProcessStatusName(LingShanAgentServiceProcessStatusEnum.getByStatus(e.getProcessStatus()).getStatusName()); + + LingshanAgentServiceCategoryEntity sc = agentServiceCategoryDao.selectById(e.getServiceCategory()); + if (sc != null) { + d.setServiceCategoryName(sc.getCategoryName()); + } else { + log.error("【红色待办】居民-我创建的列表:未找到服务类别数据:{}", e.getServiceCategory()); + } + + return d; + }).collect(Collectors.toList()); + + return new PageData<>(rl, new PageInfo<>(l).getTotal()); + } + + @Override + public PageData workServiceList(Integer processStatus, String gridId) { + + + return null; + } + + @Override + public void workProcess(String id, Integer processType, String processDesc) { + LingshanAgentServiceRecordEntity service; + if ((service = agentServiceRecordDao.selectById(id)) == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); + } + + // 执行状态变更校验 + statusChangeValid(service.getProcessStatus(), processType); + + Date now = new Date(); + + LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); + e2Update.setId(id); + // 处理,处理受理状态和描述,以及处理时间 + e2Update.setProcessStatus(processType); + e2Update.setProcessDesc(processDesc); + e2Update.setProcessTime(now); + + agentServiceRecordDao.updateById(e2Update); + } + + @Override + public void workClose(String id, String processDesc, List processAttachments) { + LingshanAgentServiceRecordEntity service; + if ((service = agentServiceRecordDao.selectById(id)) == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); + } + + // 执行状态变更校验 + LingShanAgentServiceProcessStatusEnum closeStatusEnum = LingShanAgentServiceProcessStatusEnum.CLOSED; + statusChangeValid(service.getProcessStatus(), closeStatusEnum.getStatusCode()); + + Date now = new Date(); + + LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); + e2Update.setId(id); + // 办结,设置处理状态,办结描述,办结时间 + e2Update.setProcessStatus(closeStatusEnum.getStatusCode()); + e2Update.setCloseDesc(processDesc); + e2Update.setCloseTime(now); + + agentServiceRecordDao.updateById(e2Update); + } + + /** + * @description: 状态变更校验 + * @param oldStatus: 旧状态 + * @param newStatus: 新状态 + * @return + * @author: WangXianZhang + * @date: 2023/5/9 1:57 PM + */ + private void statusChangeValid(Integer oldStatus, Integer newStatus) { + if (newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode() + && oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()) { + // 只有待处理状态,才能撤回 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许撤回", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); + } + + if ((newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode() + || newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode()) + && oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()) { + // 如果要接受,或者拒绝,那么当前状态必须为待处理 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许操作", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); + } + + if (newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.CLOSED.getStatusCode() + && oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode()) { + // 如果要关闭,那么当前状态必须为已受理 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许操作", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml new file mode 100644 index 0000000000..8790cc1735 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml new file mode 100644 index 0000000000..3eea2c861e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java index 3a8361be2c..e565f9da43 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/RoleKeyConstants.java @@ -49,4 +49,9 @@ public class RoleKeyConstants { */ public static final String ROLE_KEY_GRID_MEMBER = "grid_member"; + /** + * 代办员 + */ + public static final String ROLE_KEY_AGENT = "agent"; + } From 5ca67fa90adb2150f15fc8dc5b03020d38e34a0f Mon Sep 17 00:00:00 2001 From: luyan Date: Wed, 10 May 2023 10:07:15 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=B8=B8=E9=87=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/net/TCCCClientUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java index 822d6cfe22..7fcff43282 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/net/TCCCClientUtils.java @@ -21,12 +21,15 @@ public class TCCCClientUtils { private static String SECRETKEY = "ymRuDJI8mCRUUPFvQqCPQME0c2MbfaM2"; + private static String ENDPOINT ="ccc.ap-shanghai.tencentcloudapi.com"; + public static String getToken() { try { Credential cred = new Credential(SECRETID, SECRETKEY); // 实例化一个http选项,可选的,没有特殊需求可以跳过 + HttpProfile httpProfile = new HttpProfile(); - httpProfile.setEndpoint("ccc.ap-shanghai.tencentcloudapi.com"); + httpProfile.setEndpoint(ENDPOINT); // 实例化一个client选项,可选的,没有特殊需求可以跳过 ClientProfile clientProfile = new ClientProfile(); clientProfile.setHttpProfile(httpProfile); @@ -46,4 +49,8 @@ public class TCCCClientUtils { return e.toString(); } } + + public static void main(String[] args) { + getToken(); + } } From b5513931ff7b9ae388862eaa9a79af2c4328a5a5 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 10 May 2023 14:42:33 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=91=E5=81=9A=E5=AE=8C=E4=BA=86=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/LingshanServiceAgentAgentList.java | 25 ++++ .../LingShanAgentServiceStaffAndGrid.java | 10 ++ .../beans/StaffInfoInGridOfRole.java | 14 ++ .../LingShanServiceAgentController.java | 46 ++++++ .../dao/epmetuser/CustomerStaffDao.java | 21 ++- .../dao/govorg/CustomerStaffGridDao.java | 5 + .../service/LingShanServiceAgentService.java | 8 ++ .../service/epmetuser/EpmetUserService.java | 4 + .../epmetuser/impl/EpmetUserServiceImpl.java | 25 +++- .../service/govorg/GovOrgService.java | 5 + .../govorg/impl/GovOrgServiceImpl.java | 14 ++ .../impl/LingShanServiceAgentServiceImpl.java | 128 +++++++++++++++++ .../mapper/epmetuser/CustomerStaffDao.xml | 31 ++++ .../mapper/govorg/CustomerStaffGridDao.xml | 10 ++ .../LingShanAgentServiceController.java | 30 ++++ .../service/LingShanAgentServiceService.java | 4 + .../impl/LingShanAgentServiceServiceImpl.java | 133 ++++++++++++++---- 17 files changed, 480 insertions(+), 33 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/LingShanAgentServiceStaffAndGrid.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/StaffInfoInGridOfRole.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java new file mode 100644 index 0000000000..49fa8d30d9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java @@ -0,0 +1,25 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.Data; + +/** + * @Description 灵山代办,代办员列表 + * @Author wangxianzhang + * @Time 2023/5/9 4:26 PM + */ +@Data +public class LingshanServiceAgentAgentList { + + private String gridId; + private String orgNamePath; + private String agentId; + private String agentName; + private Integer gender; + private String genderDisplay; + private Integer age; + private String cultureDisplay; + private Integer culture; + private String mobile; + private String idCard; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/LingShanAgentServiceStaffAndGrid.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/LingShanAgentServiceStaffAndGrid.java new file mode 100644 index 0000000000..a3d2ed5bc8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/LingShanAgentServiceStaffAndGrid.java @@ -0,0 +1,10 @@ +package com.epmet.dataaggre.beans; + +import lombok.Data; + +@Data +public class LingShanAgentServiceStaffAndGrid { + private String staffId; + + private String gridId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/StaffInfoInGridOfRole.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/StaffInfoInGridOfRole.java new file mode 100644 index 0000000000..352fb79a0a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/StaffInfoInGridOfRole.java @@ -0,0 +1,14 @@ +package com.epmet.dataaggre.beans; + +import lombok.Data; + +@Data +public class StaffInfoInGridOfRole { + private String staffId; + private String staffName; + private Integer gender; + private Integer age; + private Integer culture; + private String mobile; + private String idCard; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java new file mode 100644 index 0000000000..1fa76f9bfd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java @@ -0,0 +1,46 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; +import com.epmet.dataaggre.service.LingShanServiceAgentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("lingshan/serviceAgent") +public class LingShanServiceAgentController { + + @Autowired + private LingShanServiceAgentService lingShanServiceAgentService; + + /** + * @description: 工作端pc,代办员列表 + * @param pageNo: + * @param pageSize: + * @param orgId: + * @param orgType: + * @param agentName: + * @param mobile: + * @param idCard: + * @return + * @author: WangXianZhang + * @date: 2023/5/9 4:30 PM + */ + @GetMapping("workpc/agentList") + public Result> workPcAgentList(@RequestParam("pageNo") Integer pageNo, + @RequestParam("pageSize") Integer pageSize, + @RequestParam("orgId") String orgId, + @RequestParam("orgType") String orgType, + @RequestParam("agentName") String agentName, + @RequestParam("mobile") Integer mobile, + @RequestParam("idCard") Integer idCard) { + + PageData pd = lingShanServiceAgentService.workPcAgentList(orgId, orgType, agentName, mobile, idCard, pageNo, pageSize); + return new Result>().ok(pd); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java index 6062e45dcb..cd6059ed50 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.epmetuser; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.beans.StaffInfoInGridOfRole; import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO; @@ -28,6 +29,7 @@ import org.apache.ibatis.annotations.Param; import java.util.LinkedList; import java.util.List; +import java.util.Set; /** * 政府工作人员表 @@ -78,8 +80,25 @@ public interface CustomerStaffDao extends BaseDao { /** * 根据staffId查询姓名、手机号 * 禁用的不展示 - * @param staffIds + * @param staffIdss * @return */ List staffSelectList(@Param("staffIds") List staffIds); + + /** + * @Description:查询工作人员列表 + * @param staffIds: 工作人员id列表 + * @param roleId: 角色id + * @param mobile: 手机号 + * @param realname: realname + * @param idCard: 身份证 + * @Return void + * @Author: wangxianzhang + * @Date: 2023/5/10 9:37 AM + */ + List selectStaffListByStaffIdsAndRole(@Param("staffIds") Set staffIds, + @Param("roleId") String roleId, + @Param("mobile") Integer mobile, + @Param("realname") String realname, + @Param("idCard") Integer idCard); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java index b481617cb2..8073c55807 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java @@ -18,14 +18,17 @@ package com.epmet.dataaggre.dao.govorg; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid; import com.epmet.dataaggre.dto.govorg.OrgDTO; import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO; import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity; +import com.epmet.dataaggre.service.impl.LingShanServiceAgentServiceImpl; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 网格人员关系表 @@ -58,4 +61,6 @@ public interface CustomerStaffGridDao extends BaseDao { List selectGridList(@Param("agencyId") String agencyId, @Param("userId") String userId); List getGridStaffByAgency(@Param("agencyId") String agencyId); + + List getStaffAndItsBelongsGridByAgencyIdPath(@Param("agencyIdPath") String agencyIdPath); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java new file mode 100644 index 0000000000..779d4c26b7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java @@ -0,0 +1,8 @@ +package com.epmet.dataaggre.service; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; + +public interface LingShanServiceAgentService { + PageData workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, Integer pageNo, Integer pageSize); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 6ff3e02f90..53fb0f2880 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -2,6 +2,7 @@ package com.epmet.dataaggre.service.epmetuser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.beans.StaffInfoInGridOfRole; import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; import com.epmet.dataaggre.dto.epmetuser.form.*; @@ -26,6 +27,7 @@ import com.epmet.dto.result.DetailByTypeResultDTO; import java.util.List; import java.util.Map; +import java.util.Set; /** * @Author zxc @@ -263,4 +265,6 @@ public interface EpmetUserService { */ DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto); + PageData staffListInGridsOfRole(String roleKey, Set staffIds, String agentName, Integer mobile, Integer idCard, + Integer pageNo, Integer pageSize); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 4d9219f48b..adc9b83e4b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -20,13 +20,11 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; 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.IpUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.BadgeConstant; import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.OrgInfoConstant; +import com.epmet.dataaggre.beans.StaffInfoInGridOfRole; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.*; import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; @@ -1149,4 +1147,23 @@ public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolve epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); return result; } + + @Override + public PageData staffListInGridsOfRole(String roleKey, Set staffIds, String agentName, Integer mobile, + Integer idCard, Integer pageNo, Integer pageSize) { + + LambdaQueryWrapper rq = new LambdaQueryWrapper<>(); + rq.eq(GovStaffRoleEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + rq.eq(GovStaffRoleEntity::getRoleKey, roleKey); + GovStaffRoleEntity role = govStaffRoleDao.selectOne(rq); + if (role == null) { + return null; + } + + PageHelper.startPage(pageNo, pageSize); + List ss = customerStaffDao.selectStaffListByStaffIdsAndRole(staffIds, role.getId(), mobile, agentName, idCard); + + return new PageData<>(ss, new PageInfo<>(ss).getTotal()); + + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 7464db5e2b..1828e4c713 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.service.govorg; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffSelectResDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO; @@ -18,6 +19,7 @@ import com.epmet.dto.IcNeighborHoodDTO; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.Set; /** * @Author zxc @@ -301,4 +303,7 @@ public interface GovOrgService { */ Map getEmployeeRegisterMobileAndIdCard(String registerId); + List getStaffAndItsBelongsGridByAgencyIdPath(String agencyIdPath); + + Set getStaffIdsInGrid(String gridId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index ab72e0992d..36755471d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.OrgConstant; import com.epmet.dataaggre.dao.govorg.*; @@ -49,6 +50,7 @@ import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; +import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity; import com.epmet.dataaggre.excel.GridLivelyDetailExcel; import com.epmet.dataaggre.excel.GridLivelyExcel; import com.epmet.dataaggre.service.commonservice.AreaCodeService; @@ -1540,4 +1542,16 @@ public class GovOrgServiceImpl implements GovOrgService { return customerAgencyDao.getEmployeeRegisterMobileAndIdCard(registerId); } + @Override + public List getStaffAndItsBelongsGridByAgencyIdPath(String agencyIdPath) { + return customerStaffGridDao.getStaffAndItsBelongsGridByAgencyIdPath(agencyIdPath); + } + + @Override + public Set getStaffIdsInGrid(String gridId) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(CustomerStaffGridEntity::getGridId, gridId); + List es = customerStaffGridDao.selectList(q); + return es.stream().map(CustomerStaffGridEntity::getUserId).collect(Collectors.toSet()); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java new file mode 100644 index 0000000000..82cd3515d9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java @@ -0,0 +1,128 @@ +package com.epmet.dataaggre.service.impl; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.enums.GenderEnum; +import com.epmet.commons.tools.feign.ResultDataResolver; +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.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.constant.OrgInfoConstant; +import com.epmet.constant.RoleKeyConstants; +import com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid; +import com.epmet.dataaggre.beans.StaffInfoInGridOfRole; +import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; +import com.epmet.dataaggre.service.LingShanServiceAgentService; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import com.epmet.dto.SysDictDataDTO; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.sql.Array; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentService, ResultDataResolver { + + @Autowired + private EpmetUserService epmetUserService; + + @Autowired + private GovOrgService govOrgService; + + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + @Override + public PageData workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, + Integer pageNo, Integer pageSize) { + + // 1个人可能属于多个wangge + Map> staffIdAndGridIds = new HashMap<>(); + Set staffIds = new HashSet<>(); + + // 得到staffIds和staffIdAndGridIds + if (OrgInfoConstant.AGENCY.equals(orgType)) { + // agency + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + List sags = govOrgService.getStaffAndItsBelongsGridByAgencyIdPath(PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids())); + for (LingShanAgentServiceStaffAndGrid sag : sags) { + staffIds.add(sag.getStaffId()); + + List gridIds = staffIdAndGridIds.get(sag.getStaffId()); + if (CollectionUtils.isEmpty(gridIds)) { + gridIds = new ArrayList<>(); + staffIdAndGridIds.put(sag.getStaffId(), gridIds); + } + + gridIds.add(sag.getGridId()); + } + } else if (OrgInfoConstant.GRID.equals(orgType)) { + // 网格 + staffIds = govOrgService.getStaffIdsInGrid(orgId); + for (String staffId : staffIds) { + staffIdAndGridIds.put(staffId, Arrays.asList(orgId)); + } + } + + // 开始查询staff列表 + PageData pd = epmetUserService.staffListInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds, agentName, mobile, idCard, pageNo, pageSize); + + if (pd == null) { + return new PageData(new ArrayList(), 0); + } + + // 性别字典 + List edus = getResultDataOrReturnNull(adminOpenFeignClient.dictDataList(DictTypeEnum.EDUCATION.getCode()), ServiceConstant.EPMET_ADMIN_SERVER); + Map eduMap = edus.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel)); + + // 转换为dto + List rl = pd.getList().stream().map(e -> { + LingshanServiceAgentAgentList d = new LingshanServiceAgentAgentList(); + d.setAgentName(e.getStaffName()); + d.setAgentId(e.getStaffId()); + d.setGender(e.getGender()); + d.setGenderDisplay(GenderEnum.getName(e.getGender().toString())); + d.setAge(e.getAge()); + d.setCulture(e.getCulture()); + if (e.getCulture() != null) { + d.setCultureDisplay(eduMap.get(e.getCulture().toString())); + } + d.setMobile(e.getMobile()); + d.setIdCard(e.getIdCard()); + + // 组织名称 + d.setOrgNamePath(getOrgNamePath(staffIdAndGridIds.get(e.getStaffId()))); + return d; + }).collect(Collectors.toList()); + + return new PageData<>(rl, pd.getTotal()); + } + + /** + * 通过gridid列表,拼接处组织名称path,例如:开发者社区-Java第一网格,开发者社区-Python第一网格 + */ + private String getOrgNamePath(List gridIds) { + List orgNames = gridIds.stream().map(gridId -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId); + if (gridInfo == null) { + return null; + } + + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(gridInfo.getPid()); + String agencyName = agencyInfo.getOrganizationName(); + return agencyName.concat("-").concat(gridInfo.getGridName()); + }).filter(Objects::nonNull).collect(Collectors.toList()); + + return String.join(",", orgNames); + } + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml index 8bc486c5e0..78ec048218 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -163,4 +163,35 @@ cs.user_id = #{staffId} + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml index 0120ff67a5..af5b07332c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml @@ -68,4 +68,14 @@ AND b.PID = #{agencyId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java index f27ffc4181..91338c87f1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -61,6 +61,36 @@ public class LingShanAgentServiceController { return new Result().ok(pd); } + /** + * @Description: 撤回 + * @param form: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/10 11:20 AM + */ + @PostMapping("resi/withdraw") + public Result resiWithDraw(@RequestBody Map form) { + String id = form.get("id"); + if (StringUtils.isBlank(id)) { + throw new ValidateException("缺少ID参数"); + } + + lingShanServiceAgentService.resiWithDraw(id); + return new Result(); + } + + @PostMapping("resi/evaluate") + public Result resiEvaluate(@RequestBody Map form) { + String id = (String) form.get("id"); + Integer satisfication = (Integer) form.get("satisfication"); + if (StringUtils.isAnyBlank(id) || satisfication == null) { + throw new ValidateException("缺少ID参数"); + } + + lingShanServiceAgentService.resiEvaluate(id, satisfication); + return new Result(); + } + /** * @description: 工作端-服务列表 * 这个接口返回的跟居民端一样,所以暂时就调用居民端一样的接口了。 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java index 1f9e7093a5..14e83ec1a9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -17,4 +17,8 @@ public interface LingShanAgentServiceService { void workProcess(String id, Integer processType, String processDesc); void workClose(String id, String processDesc, List processAttachments); + + void resiWithDraw(String id); + + void resiEvaluate(String id, Integer satisfication); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index b75d84f059..405e93721e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -3,8 +3,10 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.LingShanAgentServiceProcessStatusEnum; +import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; @@ -24,6 +26,7 @@ import com.epmet.service.LingShanAgentServiceService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,6 +44,11 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ @Autowired private LingshanAgentServiceRecordDao agentServiceRecordDao; + @Autowired + private DistributedLock distributedLock; + + public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:"; + @Override public void resiSubmit(AgentServiceResiSubmitFormDTO form) { @@ -104,19 +112,30 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); } - // 执行状态变更校验 - statusChangeValid(service.getProcessStatus(), processType); - - Date now = new Date(); - - LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); - e2Update.setId(id); - // 处理,处理受理状态和描述,以及处理时间 - e2Update.setProcessStatus(processType); - e2Update.setProcessDesc(processDesc); - e2Update.setProcessTime(now); - - agentServiceRecordDao.updateById(e2Update); + RLock lock = distributedLock.getLock(AGENT_SERVICE_LOCK_PREFIX + id); + try { + // 执行状态变更校验 + statusChangeCheck(service.getProcessStatus(), processType); + + Date now = new Date(); + + LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); + e2Update.setId(id); + // 处理,处理受理状态和描述,以及处理时间 + e2Update.setProcessStatus(processType); + e2Update.setProcessDesc(processDesc); + e2Update.setProcessTime(now); + + agentServiceRecordDao.updateById(e2Update); + } catch (Exception e) { + log.error("【待办服务】办结:分布式锁错误:" + ExceptionUtils.getErrorStackTrace(e)); + throw e; + } finally { + // 释放锁 + if (lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } } @Override @@ -126,20 +145,32 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); } - // 执行状态变更校验 - LingShanAgentServiceProcessStatusEnum closeStatusEnum = LingShanAgentServiceProcessStatusEnum.CLOSED; - statusChangeValid(service.getProcessStatus(), closeStatusEnum.getStatusCode()); - - Date now = new Date(); - - LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); - e2Update.setId(id); - // 办结,设置处理状态,办结描述,办结时间 - e2Update.setProcessStatus(closeStatusEnum.getStatusCode()); - e2Update.setCloseDesc(processDesc); - e2Update.setCloseTime(now); - - agentServiceRecordDao.updateById(e2Update); + RLock lock = distributedLock.getLock(AGENT_SERVICE_LOCK_PREFIX + id); + + try { + // 执行状态变更校验 + LingShanAgentServiceProcessStatusEnum closeStatusEnum = LingShanAgentServiceProcessStatusEnum.CLOSED; + statusChangeCheck(service.getProcessStatus(), closeStatusEnum.getStatusCode()); + + Date now = new Date(); + + LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); + e2Update.setId(id); + // 办结,设置处理状态,办结描述,办结时间 + e2Update.setProcessStatus(closeStatusEnum.getStatusCode()); + e2Update.setCloseDesc(processDesc); + e2Update.setCloseTime(now); + + agentServiceRecordDao.updateById(e2Update); + } catch (Exception e) { + log.error("【待办服务】办结:分布式锁错误:" + ExceptionUtils.getErrorStackTrace(e)); + throw e; + } finally { + // 释放锁 + if (lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } } /** @@ -150,7 +181,7 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ * @author: WangXianZhang * @date: 2023/5/9 1:57 PM */ - private void statusChangeValid(Integer oldStatus, Integer newStatus) { + private void statusChangeCheck(Integer oldStatus, Integer newStatus) { if (newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode() && oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()) { // 只有待处理状态,才能撤回 @@ -170,4 +201,50 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许操作", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); } } + + @Override + public void resiWithDraw(String id) { + LingshanAgentServiceRecordEntity service; + if ((service = agentServiceRecordDao.selectById(id)) == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); + } + + RLock lock = distributedLock.getLock(AGENT_SERVICE_LOCK_PREFIX + id); + + try { + // 状态检查 + statusChangeCheck(service.getProcessStatus(), LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode()); + + LingshanAgentServiceRecordEntity e2update = new LingshanAgentServiceRecordEntity(); + e2update.setId(id); + e2update.setProcessStatus(LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode()); + agentServiceRecordDao.updateById(e2update); + } catch (Exception e) { + log.error("【待办服务】撤回:分布式锁错误:" + ExceptionUtils.getErrorStackTrace(e)); + throw e; + } finally { + // 释放锁 + if (lock.isHeldByCurrentThread()) { + lock.unlock(); + } + } + } + + @Override + public void resiEvaluate(String id, Integer satisfication) { + LingshanAgentServiceRecordEntity service; + if ((service = agentServiceRecordDao.selectById(id)) == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); + } + + if (! service.getProcessStatus().equals(LingShanAgentServiceProcessStatusEnum.CLOSED.getStatusCode())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, + "【代办服务】只有办结的服务才能进行评价,当前状态为:" + LingShanAgentServiceProcessStatusEnum.getByStatus(service.getProcessStatus()).getStatusName()); + } + + LingshanAgentServiceRecordEntity e2update = new LingshanAgentServiceRecordEntity(); + e2update.setId(id); + e2update.setSatisfication(satisfication); + agentServiceRecordDao.updateById(e2update); + } } From 2cf36636a91526e69e505bf9a110c9c0e6102389 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 10 May 2023 16:46:15 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=91=E6=8F=90=E4=BA=A4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgentServiceList4WorkPcResultDTO.java | 30 ++++++ .../ResiMyCreatedAgentServiceResultDTO.java | 4 +- .../LingShanAgentServiceController.java | 47 +++++++++ .../service/LingShanAgentServiceService.java | 5 + .../impl/LingShanAgentServiceServiceImpl.java | 89 ++++++++++++++++++ .../mapper/LingshanAgentServiceRecordDao.xml | 5 +- ...=> special_crowd_jiedurenyuan_import.xlsx} | Bin 7 files changed, 177 insertions(+), 3 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java rename epmet-user/epmet-user-server/src/main/resources/excel/lingshan/{special_crowd_xidurenyuan_import.xlsx => special_crowd_jiedurenyuan_import.xlsx} (100%) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java new file mode 100644 index 0000000000..1ec156b2d9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result.agentservice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @Description PC工作端-服务列表 + * @Author wangxianzhang + * @Time 2023/5/10 2:58 PM + */ +@Data +public class AgentServiceList4WorkPcResultDTO { + private String id; + private String orgNamePath; + private String serviceCategory; + private String serviceCategoryName; + private String applicantName; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date createdTime; + + private String agentName; + private Integer processStatus; + private String processStatusDisplay; + @JsonFormat(pattern = "yyyy-MM-dd") + private Date processTime; + + private Integer satisfaction; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java index 1922dea3bd..db90db2c38 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java @@ -1,17 +1,19 @@ package com.epmet.dto.result.agentservice; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @Data public class ResiMyCreatedAgentServiceResultDTO { - + private String id; private String serviceCategory; private String serviceCategoryName; private String content; private Date createdTime; // 待受理 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date exceptServeTime; private String exceptServeAddress; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java index 91338c87f1..219cfae250 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -5,10 +5,12 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.agentservice.WorkCloseAgentServiceFormDTO; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; import com.epmet.service.LingShanAgentServiceService; @@ -16,6 +18,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.List; import java.util.Map; @@ -79,6 +82,13 @@ public class LingShanAgentServiceController { return new Result(); } + /** + * @Description: 居民端-评价 + * @param form: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/10 2:53 PM + */ @PostMapping("resi/evaluate") public Result resiEvaluate(@RequestBody Map form) { String id = (String) form.get("id"); @@ -157,5 +167,42 @@ public class LingShanAgentServiceController { return new Result(); } + /** + * @Description: pc工作端:服务列表 + * @param orgId: + * @param orgType: + * @param serviceCategory: + * @param content: + * @param agentName: + * @param processTimeStartStr: + * @param processTimeEndStr: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/10 3:00 PM + */ + @GetMapping("workpc/serviceList") + public Result> workPcServiceList(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType, + @RequestParam(value = "serviceCategory", required = false) String serviceCategory, + @RequestParam(value = "content", required = false) String content, + @RequestParam(value = "agentName", required = false) String agentName, + @RequestParam(value = "processTimeStart", required = false) String processTimeStartStr, + @RequestParam(value = "processTimeEnd", required = false) String processTimeEndStr, + @RequestParam(value = "pageNo") Integer pageNo, + @RequestParam(value = "pageSize") Integer pageSize) { + + Date processTimeStart = null, processTimeEnd = null; + + if (StringUtils.isNotBlank(processTimeStartStr)) { + processTimeStart = DateUtils.parse(processTimeStartStr, DateUtils.DATE_TIME_PATTERN); + } + if (StringUtils.isNotBlank(processTimeEndStr)) { + processTimeEnd = DateUtils.parse(processTimeEndStr, DateUtils.DATE_TIME_PATTERN); + } + + PageData pd = lingShanServiceAgentService.workPcServiceList(orgId, orgType, serviceCategory, content, agentName, + processTimeStart, processTimeEnd, pageNo, pageSize); + return new Result>().ok(pd); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java index 14e83ec1a9..0a7cda1e30 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -2,9 +2,11 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; +import java.util.Date; import java.util.List; public interface LingShanAgentServiceService { @@ -21,4 +23,7 @@ public interface LingShanAgentServiceService { void resiWithDraw(String id); void resiEvaluate(String id, Integer satisfication); + + PageData workPcServiceList(String orgId, String orgType, String serviceCategory, String content, + String agentName, Date processTimeStart, Date processTimeEnd, Integer pageNo, Integer pageSize); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index 405e93721e..18b40ac60a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.LingShanAgentServiceProcessStatusEnum; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -10,22 +11,27 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; +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.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.LingshanAgentServiceCategoryDao; import com.epmet.dao.LingshanAgentServiceRecordDao; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; import com.epmet.entity.LingshanAgentServiceCategoryEntity; import com.epmet.entity.LingshanAgentServiceRecordEntity; +import com.epmet.remote.EpmetUserRemoteService; import com.epmet.service.LingShanAgentServiceService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +53,9 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ @Autowired private DistributedLock distributedLock; + @Autowired + private EpmetUserRemoteService epmetUserRemoteService; + public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:"; @@ -247,4 +256,84 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ e2update.setSatisfication(satisfication); agentServiceRecordDao.updateById(e2update); } + + @Override + public PageData workPcServiceList(String orgId, String orgType, String serviceCategory, String content, + String agentName, Date processTimeStart, Date processTimeEnd, Integer pageNo, Integer pageSize) { + + String orgIdPath; + if (StringUtils.isBlank(orgId)) { + // 没传组织id,则默认使用当前人员所属的组织 + orgIdPath = epmetUserRemoteService.getLoginUserDetails().getOrgIdPath(); + } else { + if (StringUtils.isBlank(orgType)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, + "【代办服务】缺少组织类型参数"); + } + if (OrgInfoConstant.AGENCY.equals(orgType)) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); + } else if (OrgInfoConstant.GRID.equals(orgType)) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids()); + } else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, + "【代办服务】未知的组织类型"); + } + } + + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + // q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath); + // q.eq(StringUtils.isNotBlank(serviceCategory), LingshanAgentServiceRecordEntity::getServiceCategory, serviceCategory); + // q.like(StringUtils.isNotBlank(content), LingshanAgentServiceRecordEntity::getContent, content); + // q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); + // q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); + // q.ge(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeStart); + // q.le(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeEnd); + + // PageHelper.startPage(pageNo, pageSize); + List l = agentServiceRecordDao.selectList(q); + Page pd = agentServiceRecordDao.selectPage(new Page<>(pageNo, pageSize), q); + + List ds = pd.getRecords().stream().map(serviceEntity -> { + String categoryName = null; + LingshanAgentServiceCategoryEntity categoryEntity = agentServiceCategoryDao.selectById(serviceEntity.getServiceCategory()); + if (categoryEntity != null) { + categoryName = categoryEntity.getCategoryName(); + } + + AgentServiceList4WorkPcResultDTO d = new AgentServiceList4WorkPcResultDTO(); + d.setId(serviceEntity.getId()); + d.setOrgNamePath(getOrgNamePath(serviceEntity.getGridId())); + d.setServiceCategory(serviceEntity.getServiceCategory()); + d.setServiceCategoryName(categoryName); + d.setApplicantName(serviceEntity.getApplicantName()); + d.setCreatedTime(serviceEntity.getCreatedTime()); + d.setAgentName(serviceEntity.getAgentName()); + d.setProcessStatus(serviceEntity.getProcessStatus()); + d.setProcessStatusDisplay(LingShanAgentServiceProcessStatusEnum.getByStatus(serviceEntity.getProcessStatus()).getStatusName()); + if (!(LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode() == serviceEntity.getProcessStatus().intValue())) { + // 驳回的话,不显示处理时间;受理、办结状态显示;待受理还没有处理时间 + d.setProcessTime(serviceEntity.getProcessTime()); + } + d.setSatisfaction(serviceEntity.getSatisfication()); + return d; + }).collect(Collectors.toList()); + + return new PageData<>(ds, pd.getTotal()); + } + + /** + * 通过gridid列表,拼接处组织名称path,例如:开发者社区-Java第一网格,开发者社区-Python第一网格 + */ + private String getOrgNamePath(String gridId) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId); + if (gridInfo == null) { + return null; + } + + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(gridInfo.getPid()); + String agencyName = agencyInfo.getOrganizationName(); + return agencyName.concat("-").concat(gridInfo.getGridName()); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml index 3eea2c861e..1486105b71 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceRecordDao.xml @@ -13,16 +13,17 @@ - + + + - diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_xidurenyuan_import.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_jiedurenyuan_import.xlsx similarity index 100% rename from epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_xidurenyuan_import.xlsx rename to epmet-user/epmet-user-server/src/main/resources/excel/lingshan/special_crowd_jiedurenyuan_import.xlsx From 165c4c338ffbef16a28e73fb71fe8d94a2569e68 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 10 May 2023 16:52:07 +0800 Subject: [PATCH 08/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=91=E6=8F=90=E4=BA=A4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LingShanAgentServiceServiceImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index 18b40ac60a..9a3beacd9e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.LingShanAgentServiceProcessStatusEnum; import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; +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.ResiUserInfoCache; @@ -21,6 +23,7 @@ import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.LingshanAgentServiceCategoryDao; import com.epmet.dao.LingshanAgentServiceRecordDao; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; @@ -134,6 +137,15 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ e2Update.setProcessStatus(processType); e2Update.setProcessDesc(processDesc); e2Update.setProcessTime(now); + if (LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode() == processType.intValue()) { + // 如果是受理,则记录受理人 + LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); + e2Update.setAgentId(loginUserDetails.getUserId()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), loginUserDetails.getUserId()); + if (staffInfo != null) { + e2Update.setAgentName(staffInfo.getRealName()); + } + } agentServiceRecordDao.updateById(e2Update); } catch (Exception e) { From d15abf5626eb6461d54bfd83a7e12cf8d8cb6494 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 10 May 2023 17:50:31 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=91=E6=8F=90=E4=BA=A4=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgentServiceList4WorkPcResultDTO.java | 2 ++ .../ResiMyCreatedAgentServiceResultDTO.java | 2 ++ .../LingShanAgentServiceController.java | 22 ++++++++++-- .../service/LingShanAgentServiceService.java | 2 ++ .../impl/LingShanAgentServiceServiceImpl.java | 34 +++++++++++-------- 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java index 1ec156b2d9..00c4d6f08d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java @@ -27,4 +27,6 @@ public class AgentServiceList4WorkPcResultDTO { private Date processTime; private Integer satisfaction; + + private String content; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java index db90db2c38..b4db654125 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java @@ -40,4 +40,6 @@ public class ResiMyCreatedAgentServiceResultDTO { private Integer processStatus; private String processStatusName; + + private Integer satisfaction; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java index 219cfae250..682d69c6d1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -167,6 +167,24 @@ public class LingShanAgentServiceController { return new Result(); } + /** + * @Description: 删除 + * @param input: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/10 5:29 PM + */ + @PostMapping("workpc/delete") + public Result workPcDelete(@RequestBody Map input) { + String id = (String) input.get("id"); + if (StringUtils.isBlank(id)) { + throw new ValidateException("ID为必填项"); + } + + lingShanServiceAgentService.workPcDelete(id); + return new Result(); + } + /** * @Description: pc工作端:服务列表 * @param orgId: @@ -194,10 +212,10 @@ public class LingShanAgentServiceController { Date processTimeStart = null, processTimeEnd = null; if (StringUtils.isNotBlank(processTimeStartStr)) { - processTimeStart = DateUtils.parse(processTimeStartStr, DateUtils.DATE_TIME_PATTERN); + processTimeStart = DateUtils.parse(processTimeStartStr, DateUtils.DATE_PATTERN); } if (StringUtils.isNotBlank(processTimeEndStr)) { - processTimeEnd = DateUtils.parse(processTimeEndStr, DateUtils.DATE_TIME_PATTERN); + processTimeEnd = DateUtils.parse(processTimeEndStr, DateUtils.DATE_PATTERN); } PageData pd = lingShanServiceAgentService.workPcServiceList(orgId, orgType, serviceCategory, content, agentName, diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java index 0a7cda1e30..22990448cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -26,4 +26,6 @@ public interface LingShanAgentServiceService { PageData workPcServiceList(String orgId, String orgType, String serviceCategory, String content, String agentName, Date processTimeStart, Date processTimeEnd, Integer pageNo, Integer pageSize); + + void workPcDelete(String id); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index 9a3beacd9e..734acf0e95 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -129,22 +129,20 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ // 执行状态变更校验 statusChangeCheck(service.getProcessStatus(), processType); - Date now = new Date(); - LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); e2Update.setId(id); // 处理,处理受理状态和描述,以及处理时间 e2Update.setProcessStatus(processType); e2Update.setProcessDesc(processDesc); - e2Update.setProcessTime(now); if (LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode() == processType.intValue()) { - // 如果是受理,则记录受理人 + // 如果是受理,则记录受理人和受理时间 LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); e2Update.setAgentId(loginUserDetails.getUserId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), loginUserDetails.getUserId()); if (staffInfo != null) { e2Update.setAgentName(staffInfo.getRealName()); } + e2Update.setProcessTime(new Date()); } agentServiceRecordDao.updateById(e2Update); @@ -295,16 +293,13 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ } LambdaQueryWrapper q = new LambdaQueryWrapper<>(); - // q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath); - // q.eq(StringUtils.isNotBlank(serviceCategory), LingshanAgentServiceRecordEntity::getServiceCategory, serviceCategory); - // q.like(StringUtils.isNotBlank(content), LingshanAgentServiceRecordEntity::getContent, content); - // q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); - // q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); - // q.ge(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeStart); - // q.le(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeEnd); - - // PageHelper.startPage(pageNo, pageSize); - List l = agentServiceRecordDao.selectList(q); + q.likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath); + q.eq(StringUtils.isNotBlank(serviceCategory), LingshanAgentServiceRecordEntity::getServiceCategory, serviceCategory); + q.like(StringUtils.isNotBlank(content), LingshanAgentServiceRecordEntity::getContent, content); + q.like(StringUtils.isNotBlank(agentName), LingshanAgentServiceRecordEntity::getAgentName, agentName); + q.ge(processTimeStart != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeStart); + q.le(processTimeEnd != null , LingshanAgentServiceRecordEntity::getProcessTime, processTimeEnd); + Page pd = agentServiceRecordDao.selectPage(new Page<>(pageNo, pageSize), q); List ds = pd.getRecords().stream().map(serviceEntity -> { @@ -316,6 +311,7 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ AgentServiceList4WorkPcResultDTO d = new AgentServiceList4WorkPcResultDTO(); d.setId(serviceEntity.getId()); + d.setContent(serviceEntity.getContent()); d.setOrgNamePath(getOrgNamePath(serviceEntity.getGridId())); d.setServiceCategory(serviceEntity.getServiceCategory()); d.setServiceCategoryName(categoryName); @@ -335,6 +331,16 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ return new PageData<>(ds, pd.getTotal()); } + @Override + public void workPcDelete(String id) { + LingshanAgentServiceRecordEntity service; + if ((service = agentServiceRecordDao.selectById(id)) == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); + } + + agentServiceRecordDao.deleteById(id); + } + /** * 通过gridid列表,拼接处组织名称path,例如:开发者社区-Java第一网格,开发者社区-Python第一网格 */ From e528c52e40e2029543309d7f87a39847f90b087a Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 11 May 2023 14:16:16 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=91=E5=90=84=E7=A7=8D=E5=88=97=E8=A1=A8=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=84=E4=BB=B6=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agentservice/AgentServiceList4WorkPcResultDTO.java | 3 +++ .../agentservice/ResiMyCreatedAgentServiceResultDTO.java | 3 +++ .../epmet/service/impl/LingShanAgentServiceServiceImpl.java | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java index 00c4d6f08d..28691df4b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceList4WorkPcResultDTO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; +import java.util.List; /** * @Description PC工作端-服务列表 @@ -29,4 +30,6 @@ public class AgentServiceList4WorkPcResultDTO { private Integer satisfaction; private String content; + + private List attachments; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java index b4db654125..8ff13ad941 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ResiMyCreatedAgentServiceResultDTO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; +import java.util.List; @Data public class ResiMyCreatedAgentServiceResultDTO { @@ -42,4 +43,6 @@ public class ResiMyCreatedAgentServiceResultDTO { private String processStatusName; private Integer satisfaction; + + private List attachments; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index 734acf0e95..c31835cc02 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -104,6 +104,9 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ log.error("【红色待办】居民-我创建的列表:未找到服务类别数据:{}", e.getServiceCategory()); } + // 反序列化附件列表 + d.setAttachments(JSON.parseArray(e.getAttachments(), String.class)); + return d; }).collect(Collectors.toList()); @@ -325,6 +328,9 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ d.setProcessTime(serviceEntity.getProcessTime()); } d.setSatisfaction(serviceEntity.getSatisfication()); + + // 反序列化附件列表 + d.setAttachments(JSON.parseArray(serviceEntity.getAttachments(), String.class)); return d; }).collect(Collectors.toList()); From 1bddac93de874d1d1a7d4c99fc9652901eb1970a Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 11 May 2023 15:02:52 +0800 Subject: [PATCH 11/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=911.=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=88=86=E7=B1=BB=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...LingShanAgentServiceCategoryResultDTO.java | 23 +++++++++++++++++++ .../LingShanAgentServiceController.java | 14 +++++++++++ .../service/LingShanAgentServiceService.java | 3 +++ .../impl/LingShanAgentServiceServiceImpl.java | 6 +++++ 4 files changed, 46 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java new file mode 100644 index 0000000000..c3a6bfc0c7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.agentservice; + +import lombok.Data; + +@Data +public class LingShanAgentServiceCategoryResultDTO { + + /** + * 租户号 + */ + private String id; + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 描述 + */ + private String description; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java index 682d69c6d1..bff96e088f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.agentservice.WorkCloseAgentServiceFormDTO; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; +import com.epmet.dto.result.agentservice.LingShanAgentServiceCategoryResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; import com.epmet.service.LingShanAgentServiceService; @@ -34,6 +35,19 @@ public class LingShanAgentServiceController { @Autowired private LingShanAgentServiceService lingShanServiceAgentService; + /** + * @Description: 服务分类 + * @param : + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/11 2:57 PM + */ + @GetMapping("serviceCategoryList") + public Result> listServiceCategories() { + List l = lingShanServiceAgentService.listServiceCategories(); + return new Result>().ok(l); + } + /** * @description: 居民端-提交代办服务 * @param form: diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java index 22990448cf..f5c2d7ba47 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -3,6 +3,7 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; +import com.epmet.dto.result.agentservice.LingShanAgentServiceCategoryResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; @@ -28,4 +29,6 @@ public interface LingShanAgentServiceService { String agentName, Date processTimeStart, Date processTimeEnd, Integer pageNo, Integer pageSize); void workPcDelete(String id); + + List listServiceCategories(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index c31835cc02..2a0c261b8b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.dao.LingshanAgentServiceRecordDao; import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.agentservice.AgentServiceList4WorkPcResultDTO; +import com.epmet.dto.result.agentservice.LingShanAgentServiceCategoryResultDTO; import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; import com.epmet.entity.LingshanAgentServiceCategoryEntity; @@ -61,6 +62,11 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ public static final String AGENT_SERVICE_LOCK_PREFIX = "lingshan:agentservice:statuschange:"; + @Override + public List listServiceCategories() { + List es = agentServiceCategoryDao.selectList(new LambdaQueryWrapper<>()); + return ConvertUtils.sourceToTarget(es, LingShanAgentServiceCategoryResultDTO.class); + } @Override public void resiSubmit(AgentServiceResiSubmitFormDTO form) { From ebd9d12f9a1fd3d5ce7602cd3af367c73170f671 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 11 May 2023 16:04:23 +0800 Subject: [PATCH 12/26] =?UTF-8?q?=E3=80=90=E7=BA=A2=E8=89=B2=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E3=80=911.=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=88=86=E7=B1=BB=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BE=E6=A0=87=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agentservice/LingShanAgentServiceCategoryResultDTO.java | 5 +++++ .../com/epmet/entity/LingshanAgentServiceCategoryEntity.java | 5 +++++ .../resources/mapper/LingshanAgentServiceCategoryDao.xml | 1 + 3 files changed, 11 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java index c3a6bfc0c7..196ed44075 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanAgentServiceCategoryResultDTO.java @@ -20,4 +20,9 @@ public class LingShanAgentServiceCategoryResultDTO { */ private String description; + /** + * 图标 + */ + private String iconUrl; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java index 60ba1474d3..703a2f8a99 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceCategoryEntity.java @@ -36,4 +36,9 @@ public class LingshanAgentServiceCategoryEntity extends BaseEpmetEntity { */ private String description; + /** + * 图标 + */ + private String iconUrl; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml index 8790cc1735..371ee095c9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanAgentServiceCategoryDao.xml @@ -8,6 +8,7 @@ + From d7fe8bedc25d907aebaf22b196a594152111f149 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 12 May 2023 16:17:24 +0800 Subject: [PATCH 13/26] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1-=E5=85=9A?= =?UTF-8?q?=E5=BB=BA=E5=BC=95=E9=A2=86=E3=80=911.=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=EF=BC=9A=E5=A4=A7=E5=B1=8F=E4=B8=AD=E9=97=B4=EF=BC=8C=E5=90=84?= =?UTF-8?q?=E5=85=9A=E7=9B=B8=E5=85=B3=E5=AF=B9=E8=B1=A1=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1=E3=80=822=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=EF=BC=9A=E5=85=9A=E7=BB=84=E7=BB=87=E9=80=90=E7=BA=A7?= =?UTF-8?q?=E7=82=B9=E5=85=A5=EF=BC=8C=E6=A0=B9=E6=8D=AE=E8=A1=8C=E6=94=BF?= =?UTF-8?q?=E7=BB=84=E7=BB=87id=E6=9F=A5=E8=AF=A2=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E5=85=9A=E7=9B=B8=E5=85=B3=E5=AF=B9=E8=B1=A1=E7=9A=84=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=EF=BC=8C=E5=9D=90=E6=A0=87=EF=BC=8C=E5=85=9A=E5=91=98?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/LingShanPartyUnitRstDTO.java | 17 ++ .../feign/EpmetHeartOpenFeignClient.java | 25 ++- .../EpmetHeartOpenFeignClientFallback.java | 11 + .../controller/IcPartyUnitController.java | 29 +++ .../com/epmet/service/IcPartyUnitService.java | 9 +- .../service/impl/IcPartyUnitServiceImpl.java | 29 ++- .../LingShanPartyServiceCenterQtyRstDTO.java | 23 +++ ...LingShanScreenPartyObjectByTypeRstDTO.java | 12 ++ .../epmet/feign/GovOrgOpenFeignClient.java | 25 +++ .../GovOrgOpenFeignClientFallback.java | 9 + .../IcPartyServiceCenterController.java | 38 +++- .../entity/IcPartyServiceCenterEntity.java | 4 + .../service/IcPartyServiceCenterService.java | 8 +- .../impl/IcPartyServiceCenterServiceImpl.java | 54 +++++ .../LingShanPartyMemQtyStatsInOrgRstDTO.java | 10 + .../LingShanPartyOrgAndOtherObjQtyRstDTO.java | 25 +++ ...LingShanScreenPartyObjectByTypeRstDTO.java | 19 ++ .../enums/LingShanPartyObjEnums.java | 30 +++ .../resi-partymember-server/pom.xml | 7 + .../modules/partyOrg/dao/IcPartyOrgDao.java | 16 +- .../partyOrg/entity/IcPartyOrgEntity.java | 5 + .../service/LingShanPartyOrgService.java | 13 ++ .../impl/LingShanPartyOrgServiceImpl.java | 189 ++++++++++++++++++ .../controller/LingShanScreenController.java | 35 ++++ .../mapper/partyOrg/IcPartyOrgDao.xml | 26 +++ 25 files changed, 644 insertions(+), 24 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/LingShanPartyUnitRstDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanPartyServiceCenterQtyRstDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanScreenPartyObjectByTypeRstDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyMemQtyStatsInOrgRstDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyOrgAndOtherObjQtyRstDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/enums/LingShanPartyObjEnums.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/LingShanPartyOrgService.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/LingShanPartyUnitRstDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/LingShanPartyUnitRstDTO.java new file mode 100644 index 0000000000..01115d45c7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/LingShanPartyUnitRstDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description 灵山,联建单位 + * @Author wangxianzhang + * @Time 2023/5/12 2:38 PM + */ +@Data +public class LingShanPartyUnitRstDTO { + + private String orgName; + private String longitude; + private String latitude; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index f0906621f7..c7fb36f7cc 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -17,15 +17,13 @@ import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.result.CheckStaffInfoResultDTO; +import com.epmet.dto.result.LingShanPartyUnitRstDTO; import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -182,4 +180,23 @@ public interface EpmetHeartOpenFeignClient { @PostMapping("/heart/userdemand/deleteByOriginId/{originId}/{origin}") Result deleteUserDemandByOriginId(@PathVariable("originId") String originId, @PathVariable("origin")String origin); + /** + * @Description: 组织下的联建单位数量 + * @param agencyId: 组织id + * @Return void + * @Author: wangxianzhang + * @Date: 2023/5/12 10:22 AM + */ + @RequestMapping("/heart/icpartyunit/qtyInAgency") + Result qtyInAgency(@RequestParam(value = "agencyId", required = false) String agencyId); + + /** + * @Description: 灵山大屏:联建单位列表 + * @param orgId: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/12 2:36 PM + */ + @GetMapping("/heart/icpartyunit/lingshan/partyUnitList") + Result> lingshanPartyUnitList(@RequestParam(value = "orgId", required = false) String orgId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 247495bdf5..f6909d4004 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -18,6 +18,7 @@ import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.result.CheckStaffInfoResultDTO; +import com.epmet.dto.result.LingShanPartyUnitRstDTO; import com.epmet.dto.result.PartyUnitListResultDTO; import com.epmet.dto.result.demand.IcResiDemandDictDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; @@ -175,4 +176,14 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result deleteUserDemandByOriginId(String originId, String origin) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "deleteUserDemandByOriginId", originId,origin); } + + @Override + public Result qtyInAgency(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "qtyInAgency", agencyId); + } + + @Override + public Result> lingshanPartyUnitList(String orgId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "lingshanPartyUnitList", orgId); + } } 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 d94fcf94ce..3a637a925f 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 @@ -367,4 +367,33 @@ public class IcPartyUnitController implements ResultDataResolver { } } } + + /** + * @Description: 组织下的联建单位数量 + * @param agencyId: 组织id + * @Return void + * @Author: wangxianzhang + * @Date: 2023/5/12 10:22 AM + */ + @RequestMapping("qtyInAgency") + public Result qtyInAgency(@RequestParam(value = "agencyId", required = false) String agencyId) { + Integer q = icPartyUnitService.qtyInAgency(agencyId); + return new Result().ok(q); + } + + /** + * @Description: 灵山大屏:联建单位列表 + * @param orgId: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/12 2:36 PM + */ + @GetMapping("lingshan/partyUnitList") + public Result> lingshanScreenPartyUnitList(@RequestParam(value = "orgId", required = false) String orgId) { + + List l = icPartyUnitService.lingshanScreenPartyUnitList(orgId); + return new Result>().ok(l); + } + + } 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 36d886e439..00ca07690e 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 @@ -8,10 +8,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.result.CheckStaffInfoResultDTO; -import com.epmet.dto.result.PartyTypepercentResultDTO; -import com.epmet.dto.result.PartyUnitDistributionResultDTO; -import com.epmet.dto.result.PartyUnitListResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyUnitEntity; @@ -181,4 +178,8 @@ public interface IcPartyUnitService extends BaseService { * @param filePath */ void execAsyncExcelImport(Path filePath, String importTaskId,String customerId,String userId); + + Integer qtyInAgency(String agencyId); + + List lingshanScreenPartyUnitList(String orgId); } 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 d0d8c5d541..6674005ab3 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 @@ -41,10 +41,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.FileUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.commons.tools.utils.*; import com.epmet.constant.UserDemandConstant; import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcPartyUnitDao; @@ -725,4 +722,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl q = new LambdaQueryWrapper<>(); + q.and(q1 -> q1.eq(IcPartyUnitEntity::getAgencyId, agencyId).or(q2 -> q2.eq(IcPartyUnitEntity::getPids, orgIdPath))); + + return baseDao.selectCount(q); + } + + @Override + public List lingshanScreenPartyUnitList(String orgId) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(IcPartyUnitEntity::getAgencyId, orgId); + return baseDao.selectList(q).stream().map(e -> { + LingShanPartyUnitRstDTO d = new LingShanPartyUnitRstDTO(); + d.setLatitude(e.getLatitude()); + d.setLongitude(e.getLongitude()); + d.setOrgName(e.getUnitName()); + return d; + }).collect(Collectors.toList()); + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanPartyServiceCenterQtyRstDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanPartyServiceCenterQtyRstDTO.java new file mode 100644 index 0000000000..48389aa008 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanPartyServiceCenterQtyRstDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class LingShanPartyServiceCenterQtyRstDTO { + + /** + * 名称 + */ + // private String orgId; + + /** + * 组织类型 + */ + private String orgType; + + /** + * 数量 + */ + private Integer qty; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanScreenPartyObjectByTypeRstDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanScreenPartyObjectByTypeRstDTO.java new file mode 100644 index 0000000000..cea14d18ac --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LingShanScreenPartyObjectByTypeRstDTO.java @@ -0,0 +1,12 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class LingShanScreenPartyObjectByTypeRstDTO { + + private String orgName; + private String longitude; + private String latitude; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 9818f7f832..6712f7247e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -757,4 +757,29 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/enterprise/sendEnterprisePatrolRemindMessage") Result sendEnterprisePatrolRemindMessage(); + + /** + * @Description: 灵山:根据行政组织id,查询组织下的党群服务中心/站的列表 + * @param orgId: 组织id + * @param orgType: agency,grid + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/12 9:23 AM + */ + @GetMapping("/gov/org/icpartyservicecenter/lingshan/partyServiceCenterQtyStats") + Result> partyServiceCenterQtyStats(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType); + + /** + * @Description: 灵山党群服务中心、站列表查询 + * @param objType: + * @param orgId: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/12 2:14 PM + */ + @GetMapping("/gov/org/icpartyservicecenter/lingshan/partyServiceCenterList") + Result> lingshanPartyServiceCenterList( + @RequestParam(value = "objType", required = false) String objType, + @RequestParam(value = "orgId", required = false) String orgId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index befef36cf5..040c046b85 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -474,4 +474,13 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto); } + @Override + public Result> partyServiceCenterQtyStats(String orgId, String orgType) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "partyServiceCenterQtyStats", orgId, orgType); + } + + @Override + public Result> lingshanPartyServiceCenterList(String objType, String orgId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "lingshanPartyServiceCenterList", objType, orgId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java index 545726ea84..7fa9ff4173 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java @@ -30,10 +30,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcPartyServiceCenterDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.AllMattersResultDTO; -import com.epmet.dto.result.AppointmentRecordResultDTO; -import com.epmet.dto.result.AppointmentTimeResultDTO; -import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.dto.result.*; import com.epmet.excel.IcPartyServiceCenterExcel; import com.epmet.service.IcPartyServiceCenterService; import org.springframework.beans.factory.annotation.Autowired; @@ -249,4 +246,37 @@ public class IcPartyServiceCenterController { return new Result().ok(icPartyServiceCenterService.partyServiceCenterDetail(formDTO)); } + /** + * @Description: 根据行政组织id,查询 + * @param orgId: 组织id + * @param orgType: agency,grid + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/12 9:23 AM + */ + @GetMapping("/lingshan/partyServiceCenterQtyStats") + public Result> partyServiceCenterQtyStats(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType) { + List l = icPartyServiceCenterService.partyServiceCenterQtyStats(orgId, orgType); + return new Result>().ok(l); + } + + /** + * @Description: 灵山党群服务中心、站列表查询 + * @param objType: + * @param orgId: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/12 2:14 PM + */ + @GetMapping("/lingshan/partyServiceCenterList") + public Result> partyServiceCenterList( + @RequestParam(value = "objType", required = false) String objType, + @RequestParam(value = "orgId", required = false) String orgId) { + + List l = icPartyServiceCenterService.lingshanPartyServiceCenterList(objType, orgId); + return new Result>().ok(l); + } + + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java index 9b40b223b3..8ed38d0183 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterEntity.java @@ -105,4 +105,8 @@ public class IcPartyServiceCenterEntity extends BaseEpmetEntity { */ private String address; + /** + * 某种组织类型的数量 + */ + private transient int qtyOfType; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java index c8ef99388e..96f8e57f14 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyServiceCenterDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.AllMattersResultDTO; -import com.epmet.dto.result.AppointmentRecordResultDTO; -import com.epmet.dto.result.AppointmentTimeResultDTO; -import com.epmet.dto.result.PartyServiceCenterListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcPartyServiceCenterEntity; import java.util.List; @@ -192,4 +189,7 @@ public interface IcPartyServiceCenterService extends BaseService partyServiceCenterQtyStats(String orgId, String orgType); + + List lingshanPartyServiceCenterList(String objType, String orgId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index d07ece36b9..d7ecec82cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -36,6 +36,7 @@ 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.DateUtils; +import com.epmet.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.PartyServiceCenterConstant; import com.epmet.dao.IcMatterAppointmentRecordDao; @@ -83,6 +84,8 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl page(Map params) { @@ -748,4 +751,55 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl partyServiceCenterQtyStats(String orgId, String orgType) { + String orgIdPath; + + if (PartyServiceCenterConstant.ORG_TYPE_AGENCY.equals(orgType)) { + // 是行政组织 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); + } else { + // 是网格 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids()); + } + + LambdaQueryWrapper q = new QueryWrapper().select(" org_type, count(*) qtyOfType") + .lambda() + .and(c1 -> c1.eq(IcPartyServiceCenterEntity::getOrgId, orgId).or(c2 -> c2.eq(IcPartyServiceCenterEntity::getPids, orgIdPath))) + .groupBy(IcPartyServiceCenterEntity::getOrgType); + + List l = icPartyServiceCenterDao.selectList(q); + + return l.stream().map(e -> { + LingShanPartyServiceCenterQtyRstDTO r = new LingShanPartyServiceCenterQtyRstDTO(); + r.setQty(e.getQtyOfType()); + r.setOrgType(e.getOrgType()); + return r; + }).collect(Collectors.toList()); + } + + @Override + public List lingshanPartyServiceCenterList(String objType, String orgId) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>();; + if (objType.equals("party_service_center")) { + // 党群服务中心 + q.eq(IcPartyServiceCenterEntity::getOrgId, orgId); + q.eq(IcPartyServiceCenterEntity::getOrgType, "agency"); + } else { + // 党群服务站 + q.eq(IcPartyServiceCenterEntity::getOrgId, orgId); + q.eq(IcPartyServiceCenterEntity::getOrgType, "grid"); + } + + List es = icPartyServiceCenterDao.selectList(q); + return es.stream().map(e -> { + LingShanPartyUnitRstDTO d = new LingShanPartyUnitRstDTO(); + d.setLatitude(e.getLatitude()); + d.setLongitude(e.getLongitude()); + d.setOrgName(e.getCenterName()); + return d; + }).collect(Collectors.toList()); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyMemQtyStatsInOrgRstDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyMemQtyStatsInOrgRstDTO.java new file mode 100644 index 0000000000..0195c943a7 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyMemQtyStatsInOrgRstDTO.java @@ -0,0 +1,10 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +/** + * @Description 地图中的党员数量分布 + * @Author wangxianzhang + * @Time 2023/5/12 3:25 PM + */ +public class LingShanPartyMemQtyStatsInOrgRstDTO { + private String name; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyOrgAndOtherObjQtyRstDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyOrgAndOtherObjQtyRstDTO.java new file mode 100644 index 0000000000..fa85aa2824 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanPartyOrgAndOtherObjQtyRstDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LingShanPartyOrgAndOtherObjQtyRstDTO { + /** + * 党建相关对象类型code + */ + private String partyObjectTypeCode; + /** + * 名称 + */ + private String name; + + /** + * 数量 + */ + private Integer value; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java new file mode 100644 index 0000000000..d0f0208e1e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/LingShanScreenPartyObjectByTypeRstDTO.java @@ -0,0 +1,19 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +/** + * @Description 灵山街道:按照党类型查询党相关对象 + * @Author wangxianzhang + * @Time 2023/5/12 1:16 PM + */ +@Data +public class LingShanScreenPartyObjectByTypeRstDTO { + + private String name; + private String longitude; + private String latitude; + + private Integer partymemberQty; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/enums/LingShanPartyObjEnums.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/enums/LingShanPartyObjEnums.java new file mode 100644 index 0000000000..39fe4716c0 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/enums/LingShanPartyObjEnums.java @@ -0,0 +1,30 @@ +package com.epmet.resi.partymember.enums; + +/** + * @Description 灵山党建相关对象枚举 + * @Author wangxianzhang + * @Time 2023/5/12 1:26 PM + */ +public enum LingShanPartyObjEnums { + DW("dw", "党委"), + BRANCH("branch", "支部"), + PARTY_SERVICE_CENTER("party_service_center", "党群服务中心"), + PARTY_SERVICE_STATION("party_service_station", "党群服务站"), + PARTY_UNIT("party_unit", "联建单位"); + + private String code; + private String name; + + LingShanPartyObjEnums(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 194ec74de1..0314e973e5 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -12,6 +12,13 @@ jar + + com.epmet + epmet-heart-client + + 2.0.0 + + com.epmet resi-partymember-client 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 91b8f5500d..2eba20f381 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 @@ -5,10 +5,7 @@ import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; import com.epmet.resi.partymember.dto.partyOrg.form.EditPrincipalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; -import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; -import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; -import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; -import com.epmet.resi.partymember.dto.partyOrg.result.PartyOrgListResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.*; import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO; import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgTreeResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -148,4 +145,15 @@ public interface IcPartyOrgDao extends BaseDao { List getPartyOrgsOfBranch(@Param("customerId") String customerId, @Param("agencyId") String agencyId, @Param("orgIdpath") String orgIdpath); + + List lingshanListDw(@Param("orgIdPath") String orgIdPath); + + /** + * @Description: 灵山:直属支部 + * @param orgId: + * @Return java.util.List + * @Author: wangxianzhang + * @Date: 2023/5/12 4:05 PM + */ + List lingshanListZsBranchs(@Param("orgId") String orgId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java index bc8be3d038..a989eeea18 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java @@ -93,4 +93,9 @@ public class IcPartyOrgEntity extends BaseEpmetEntity { */ private String introduction; + /** + * 子级数量 + */ + private transient Integer childrenQty; + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/LingShanPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/LingShanPartyOrgService.java new file mode 100644 index 0000000000..a6e8528736 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/LingShanPartyOrgService.java @@ -0,0 +1,13 @@ +package com.epmet.modules.partyOrg.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO; + +import java.util.List; + +public interface LingShanPartyOrgService { + List partyOrgAndOtherObjectQtyStats(String agencyId); + + List partyObjsByType(String objType, String orgId, String orgType); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java new file mode 100644 index 0000000000..d869e728cf --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/LingShanPartyOrgServiceImpl.java @@ -0,0 +1,189 @@ +package com.epmet.modules.partyOrg.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.enums.PartyOrgTypeEnum; +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.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.PidUtils; +import com.epmet.constant.OrgInfoConstant; +import com.epmet.dto.result.LingShanPartyServiceCenterQtyRstDTO; +import com.epmet.dto.result.LingShanPartyUnitRstDTO; +import com.epmet.feign.EpmetHeartOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; +import com.epmet.modules.partyOrg.service.LingShanPartyOrgService; +import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO; +import com.epmet.resi.partymember.enums.LingShanPartyObjEnums; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +@Service +public class LingShanPartyOrgServiceImpl implements LingShanPartyOrgService, ResultDataResolver { + + @Autowired + private IcPartyOrgDao partyOrgDao; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetHeartOpenFeignClient heartOpenFeignClient; + + @Override + public List partyOrgAndOtherObjectQtyStats(String agencyId) { + + ArrayList tl = new ArrayList<>(); + + // 1.党组织 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); + String orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); + + String level = agencyInfo.getLevel(); + + LambdaQueryWrapper q; + if (OrgLevelEnum.COMMUNITY.getCode().equals(level)) { + // 社区级别,那直接用agencyId查,因为它下面就只有党支部一级了 + q = new QueryWrapper().select(" party_org_type, count(*) childrenQty").lambda() + // 本组织下级的所有子级 + .eq(IcPartyOrgEntity::getAgencyId, agencyId) + .eq(IcPartyOrgEntity::getPartyOrgType, PartyOrgTypeEnum.BRANCH.getCode()) // 是社区,就只能查询支部了。这里要控制,因为支部的行政组织也是对应到社区,所以这里必须限制一下 + .groupBy(IcPartyOrgEntity::getPartyOrgType); + } else { + // 街道及以上级别,用pids,因为要从社区开始查,本级及下级 + q = new QueryWrapper().select(" party_org_type, count(*) childrenQty").lambda() + // 本组织下级的所有子级,不含本级 + .like(IcPartyOrgEntity::getAgencyPids, orgIdPath) + .groupBy(IcPartyOrgEntity::getPartyOrgType); + } + + List es = partyOrgDao.selectList(q); + List l1 = es.stream().map(e -> { + LingShanPartyOrgAndOtherObjQtyRstDTO d = new LingShanPartyOrgAndOtherObjQtyRstDTO(); + d.setPartyObjectTypeCode(e.getPartyOrgType().equals("5") ? LingShanPartyObjEnums.BRANCH.getCode() : LingShanPartyObjEnums.DW.getCode()); + d.setName(PartyOrgTypeEnum.getEnumByCode(e.getPartyOrgType()).getName()); + d.setValue(e.getChildrenQty()); + return d; + }).collect(Collectors.toList()); + + tl.addAll(l1); + + // 2.党群服务中心/站 + List serviceCenters = getResultDataOrReturnNull(govOrgOpenFeignClient.partyServiceCenterQtyStats(agencyId, OrgInfoConstant.AGENCY), ServiceConstant.GOV_ORG_SERVER); + if (serviceCenters == null) { + logger.error("【灵山大屏-党组织数量统计】查询党群服务中心失败,返回空"); + } else { + List temp = serviceCenters.stream().map(e -> { + LingShanPartyOrgAndOtherObjQtyRstDTO d = new LingShanPartyOrgAndOtherObjQtyRstDTO(); + d.setPartyObjectTypeCode(e.getOrgType().equals(OrgInfoConstant.AGENCY) ? LingShanPartyObjEnums.PARTY_SERVICE_CENTER.getCode() : LingShanPartyObjEnums.PARTY_SERVICE_STATION.getCode()); + d.setName(e.getOrgType().equals(OrgInfoConstant.AGENCY) ? "党群服务中心" : "党群服务站"); + d.setValue(e.getQty()); + return d; + }).collect(Collectors.toList()); + temp.addAll(temp); + } + + // 3.联建单位 + Integer partyUnitQty = getResultDataOrReturnNull(heartOpenFeignClient.qtyInAgency(agencyId), ServiceConstant.EPMET_HEART_SERVER); + tl.add(new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_UNIT.getCode(), "联建单位", partyUnitQty)); + + // 4.检查缺项(党委, 支部, 党群服务中心, 党群服务站, 联建单位几项都要有,没有数据则显示0。党代表工作室目前还没开发,开发了也要有) + Map map = tl.stream().collect(Collectors.toMap(LingShanPartyOrgAndOtherObjQtyRstDTO::getName, Function.identity())); + + LinkedList rl = new LinkedList(); + LingShanPartyOrgAndOtherObjQtyRstDTO dw = map.get("党委"); + rl.add(dw != null ? dw : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.DW.getCode(), "党委", 0)); + + LingShanPartyOrgAndOtherObjQtyRstDTO zb = map.get("支部"); + rl.add(zb != null ? zb : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.BRANCH.getCode(), "支部", 0)); + + LingShanPartyOrgAndOtherObjQtyRstDTO dqfwzx = map.get("党群服务中心"); + rl.add(dqfwzx != null ? dqfwzx : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_SERVICE_CENTER.getCode(), "党群服务中心", 0)); + + LingShanPartyOrgAndOtherObjQtyRstDTO dqfwz = map.get("党群服务站"); + rl.add(dqfwz != null ? dqfwz : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_SERVICE_STATION.getCode(), "党群服务站", 0)); + + LingShanPartyOrgAndOtherObjQtyRstDTO ljdz = map.get("联建单位"); + rl.add(ljdz != null ? ljdz : new LingShanPartyOrgAndOtherObjQtyRstDTO(LingShanPartyObjEnums.PARTY_UNIT.getCode(), "联建单位", 0)); + + return rl; + } + + @Override + public List partyObjsByType(String objType, String orgId, String orgType) { + if (LingShanPartyObjEnums.DW.getCode().equals(objType)) { + // 党委 + return listDw(orgId, orgType); + } else if (LingShanPartyObjEnums.BRANCH.getCode().equals(objType)) { + // 支部 + return listBranch(orgId, orgType); + } else if (LingShanPartyObjEnums.PARTY_SERVICE_CENTER.getCode().equals(objType) + || LingShanPartyObjEnums.PARTY_SERVICE_STATION.getCode().equals(objType)) { + // 党群服务中心 + List rsts = + getResultDataOrReturnNull(govOrgOpenFeignClient.lingshanPartyServiceCenterList(objType, orgId), ServiceConstant.GOV_ORG_SERVER); + return ConvertUtils.sourceToTarget(rsts, LingShanScreenPartyObjectByTypeRstDTO.class); + } else if (LingShanPartyObjEnums.PARTY_UNIT.getCode().equals(objType)) { + // 联建单位 + List rsts = getResultDataOrReturnNull(heartOpenFeignClient.lingshanPartyUnitList(orgId), ServiceConstant.EPMET_HEART_SERVER); + if (rsts == null) { + logger.error("【灵山大屏-党建相关对象列表查询】出错,"); + } + return ConvertUtils.sourceToTarget(rsts, LingShanScreenPartyObjectByTypeRstDTO.class); + } else { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未知的数据类型"); + } + } + + /** + * @Description: 查询党委列表 + * @param orgId: + * @param orgType: + * @Return java.util.List + * @Author: wangxianzhang + * @Date: 2023/5/12 1:42 PM + */ + List listDw(String orgId, String orgType) { + if (OrgInfoConstant.AGENCY.equals(orgType)) { + // 是行政组织,就要查询组织的下一级。查询下一级只能用AGENCY_PIDS + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + return partyOrgDao.lingshanListDw(PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids())); + } else { + // 是网格,哪里来的党委? + return new ArrayList<>(); + } + } + + /** + * @Description: 查询支部。支部是直属的 + * @param orgId: + * @param orgType: + * @Return java.util.List + * @Author: wangxianzhang + * @Date: 2023/5/12 1:52 PM + */ + List listBranch(String orgId, String orgType) { + if (OrgInfoConstant.AGENCY.equals(orgType)) { + // 是行政组织 + // AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + return partyOrgDao.lingshanListZsBranchs(orgId); + } else { + // 是网格 + // 这里应该是有问题。因为查询支部,只能用社区id查,不能用网格id查,party_org里面没有网格相关字段去关联 + return new ArrayList<>(); + } + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java index 71e0e3ae75..4d4d4ef6c5 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/LingShanScreenController.java @@ -5,7 +5,10 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.modules.partyOrg.service.LingShanPartyOrgService; import com.epmet.modules.partymember.service.LingShanScreenService; +import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO; import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActQtyStatsResultDTO; import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyActTypeAndQtyResultDTO; import com.epmet.resi.partymember.dto.partymember.result.LingShanScreenPartyOrgCategoryResultDTO; @@ -28,6 +31,9 @@ public class LingShanScreenController { @Autowired private LingShanScreenService lingShanScreenService; + @Autowired + private LingShanPartyOrgService lingShanPartyOrgService; + /** * @description: 党建引领,党组织和数量 * @param agencyId: 当前组织id @@ -117,4 +123,33 @@ public class LingShanScreenController { return new Result().ok(lingShanScreenService.getPartymemberQtyOfOrg(agencyId)); } + /** + * @Description: 灵山:党组织以及其他党相关对象(党群服务中心、站等)的数量统计,供选择 + * @param : + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/11 3:45 PM + */ + @GetMapping("partyOrgAndOtherObjectQtyStats") + public Result> partyOrgAndOtherObjectQtyStats(@RequestParam(value = "agencyId", required = true) String agencyId) { + List l = lingShanPartyOrgService.partyOrgAndOtherObjectQtyStats(agencyId); + return new Result>().ok(l); + } + + /** + * @Description: 灵山街道:按照党类型查询党相关对象 + * @param : + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/12 1:18 PM + */ + @GetMapping("partyObjsByType") + public Result> partyObjsByType(@RequestParam(value = "objType", required = false) String objType, + @RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType) { + + List l = lingShanPartyOrgService.partyObjsByType(objType, orgId, orgType); + return new Result>().ok(l); + } + } 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 0f096e641d..d2592642d3 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 @@ -293,4 +293,30 @@ group by org.ID, org.PARTY_ORG_NAME + + + + + + From ca0a27d36c5cda629bf904db80b20fbf5efd5126 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 12 May 2023 17:29:34 +0800 Subject: [PATCH 14/26] =?UTF-8?q?=E3=80=90=E7=81=B5=E5=B1=B1-=E4=BB=A3?= =?UTF-8?q?=E5=8A=9E=E6=9C=8D=E5=8A=A1=E3=80=91=E8=B0=83=E6=95=B4pc?= =?UTF-8?q?=E7=AB=AF=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E5=BF=85=E5=A1=AB?= =?UTF-8?q?=E9=A1=B9=E3=80=82=E6=92=A4=E5=9B=9E=EF=BC=8C=E9=A9=B3=E5=9B=9E?= =?UTF-8?q?=E7=AD=89=EF=BC=8C=E9=83=BD=E7=BB=99processTime=E8=B5=8B?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LingShanServiceAgentController.java | 10 +++++----- .../impl/LingShanServiceAgentServiceImpl.java | 13 +++++++++++++ .../impl/LingShanAgentServiceServiceImpl.java | 8 +++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java index 1fa76f9bfd..0a84670f82 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java @@ -33,11 +33,11 @@ public class LingShanServiceAgentController { @GetMapping("workpc/agentList") public Result> workPcAgentList(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, - @RequestParam("orgId") String orgId, - @RequestParam("orgType") String orgType, - @RequestParam("agentName") String agentName, - @RequestParam("mobile") Integer mobile, - @RequestParam("idCard") Integer idCard) { + @RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType, + @RequestParam(value = "agentName",required = false) String agentName, + @RequestParam(value = "mobile", required = false) Integer mobile, + @RequestParam(value = "idCard", required = false) Integer idCard) { PageData pd = lingShanServiceAgentService.workPcAgentList(orgId, orgType, agentName, mobile, idCard, pageNo, pageSize); return new Result>().ok(pd); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java index 82cd3515d9..803baf5578 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java @@ -19,8 +19,11 @@ import com.epmet.dataaggre.service.LingShanServiceAgentService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dto.SysDictDataDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.remote.EpmetUserRemoteService; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -40,6 +43,9 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ @Autowired private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private EpmetUserRemoteService epmetUserRemoteService; + @Override public PageData workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, Integer pageNo, Integer pageSize) { @@ -48,6 +54,13 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ Map> staffIdAndGridIds = new HashMap<>(); Set staffIds = new HashSet<>(); + if (StringUtils.isAnyBlank(orgId, orgType)) { + // 如果前端没选择,那就取当前工作人员所属组织 + LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); + orgId = loginUserDetails.getAgencyId(); + orgType = OrgInfoConstant.AGENCY; + } + // 得到staffIds和staffIdAndGridIds if (OrgInfoConstant.AGENCY.equals(orgType)) { // agency diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index 2a0c261b8b..79a63f9332 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -151,8 +151,8 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ if (staffInfo != null) { e2Update.setAgentName(staffInfo.getRealName()); } - e2Update.setProcessTime(new Date()); } + e2Update.setProcessTime(new Date()); agentServiceRecordDao.updateById(e2Update); } catch (Exception e) { @@ -246,6 +246,7 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ LingshanAgentServiceRecordEntity e2update = new LingshanAgentServiceRecordEntity(); e2update.setId(id); e2update.setProcessStatus(LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode()); + e2update.setProcessTime(new Date()); agentServiceRecordDao.updateById(e2update); } catch (Exception e) { log.error("【待办服务】撤回:分布式锁错误:" + ExceptionUtils.getErrorStackTrace(e)); @@ -329,8 +330,9 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ d.setAgentName(serviceEntity.getAgentName()); d.setProcessStatus(serviceEntity.getProcessStatus()); d.setProcessStatusDisplay(LingShanAgentServiceProcessStatusEnum.getByStatus(serviceEntity.getProcessStatus()).getStatusName()); - if (!(LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode() == serviceEntity.getProcessStatus().intValue())) { - // 驳回的话,不显示处理时间;受理、办结状态显示;待受理还没有处理时间 + if (LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode() == serviceEntity.getProcessStatus().intValue() + || LingShanAgentServiceProcessStatusEnum.CLOSED.getStatusCode() == serviceEntity.getProcessStatus().intValue()) { + // 只有已受理和驳回才显示这个时间。 d.setProcessTime(serviceEntity.getProcessTime()); } d.setSatisfaction(serviceEntity.getSatisfication()); From 351a3bc6a1878569b385ab9efed5003b04f8ff13 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 15 May 2023 14:25:53 +0800 Subject: [PATCH 15/26] =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=85=B3=E6=A0=87=E5=BF=97=EF=BC=8C?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E7=9A=84=E6=97=B6=E5=80=99=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9Etrue=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/ScanContentUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index bf0bfb5ba5..36f1d8ba12 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -29,7 +29,7 @@ import java.util.stream.Collectors; public class ScanContentUtils { // 内容审核是否可用。烟台是政务网,无法使用互联网,所以该功能不可用 - public static final Boolean USABLE = true; + public static final Boolean USABLE = false; /** * 模拟sync成功的结果(可以用来模拟,也可以适用于无法使用互联网的环境) From 09d2005fb8533f935cc4dad32f3136cb7a50bed3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 15 May 2023 14:40:17 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=BB=9F=E8=AE=A1-=E9=A5=BC=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/OrgCommonFormDTO.java | 36 +++++++++++ .../DangerousChemicalsTypeStatResultDTO.java | 17 +++++ .../IcDangerousChemicalsController.java | 13 +++- .../service/IcDangerousChemicalsService.java | 9 +++ .../impl/IcDangerousChemicalsServiceImpl.java | 64 +++++++++++++++++-- 5 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/OrgCommonFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/OrgCommonFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/OrgCommonFormDTO.java new file mode 100644 index 0000000000..d4be5e3011 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/OrgCommonFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.commons.tools.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2023/5/15 13:44 + */ +@Data +public class OrgCommonFormDTO implements Serializable { + private static final long serialVersionUID = 2261315322260807610L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 组织id或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class) + private String orgId; + /** + * agency + * grid + */ + @NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) + private String orgType; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatResultDTO.java new file mode 100644 index 0000000000..3c814adf9b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result.lingshan; + +import lombok.Data; + +/** + * @Description 灵山大屏-安全生产-生产企业类型统计 + * @Author yzm + * @Date 2023/5/15 13:48 + */ +@Data +public class DangerousChemicalsTypeStatResultDTO { + private String name; + private Integer value; + private String typeCode; + +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java index 5561fdcbaf..0d4bab7d0b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java @@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.OrgCommonFormDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -25,6 +26,7 @@ import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.excel.IcDangerousChemicalsExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcDangerousChemicalsService; @@ -288,5 +290,14 @@ public class IcDangerousChemicalsController { return new Result(); } - + /** + * 灵山大屏-安全生产-生产企业类型统计 + * + * @param formDto + * @return + */ + @PostMapping("type-stat") + public Result> typeStat(@RequestBody OrgCommonFormDTO formDto) { + return new Result>().ok(icDangerousChemicalsService.typeStat(formDto.getOrgId(), formDto.getOrgType())); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java index be86798fd5..d3963172c3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java @@ -7,6 +7,7 @@ import com.epmet.dto.IcDangerousChemicalsDTO; import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.entity.IcDangerousChemicalsEntity; import java.nio.file.Path; @@ -82,4 +83,12 @@ public interface IcDangerousChemicalsService extends BaseService entityList); IcDangerousChemicalsEntity get(String orgId, String name); + + /** + * 灵山大屏-安全生产-生产企业类型统计 + * @param orgId + * @param orgType + * @return + */ + List typeStat(String orgId, String orgType); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java index 4bb95cf9a0..8f0567c01c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.entity.IcDangerousChemicalsEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -59,10 +60,7 @@ import java.io.IOException; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; /** @@ -115,7 +113,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode()); Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); //企业类别字典数据 - List dictList = coverageService.dictMap(formDTO.getCustomerId(), "dangerous_chemicals"); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel)); for (IcDangerousChemicalsListResultDTO v : list) { if (StringUtils.isNotBlank(v.getCategory())) { @@ -225,7 +223,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_DANGER_TYPE.getCode()); Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); //企业类别字典数据 - List dictList = coverageService.dictMap(formDTO.getCustomerId(), "city_management"); + List dictList = coverageService.dictMap(formDTO.getCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); Map dictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel)); if (StringUtils.isNotBlank(resultDTO.getCategory())) { resultDTO.setCategoryName(dictMap.get(resultDTO.getCategory())); @@ -355,4 +353,58 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl typeStat(String orgId, String orgType) { + // 企业类别字典数据 + List dictList = coverageService.dictMap(EpmetRequestHolder.getLoginUserCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); + if (CollectionUtils.isEmpty(dictList)) { + return new ArrayList<>(); + } + String orgIdPath = queryOrgIdPath(orgId, orgType); + if (StringUtils.isBlank(orgIdPath)) { + return new ArrayList<>(); + } + List resultList = new ArrayList<>(); + for (IcCoverageCategoryDictListResultDTO dto : dictList) { + DangerousChemicalsTypeStatResultDTO resultDTO = new DangerousChemicalsTypeStatResultDTO(); + resultDTO.setName(dto.getLabel()); + LambdaQueryWrapper countWrapper = new LambdaQueryWrapper<>(); + countWrapper.eq(IcDangerousChemicalsEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()) + .likeRight(IcDangerousChemicalsEntity::getOrgIdPath, orgIdPath) + .eq(IcDangerousChemicalsEntity::getCategory, dto.getValue()); + resultDTO.setValue(baseDao.selectCount(countWrapper)); + resultDTO.setTypeCode(dto.getValue()); + resultList.add(resultDTO); + } + return resultList; + } + + private String queryOrgIdPath(String orgId, String orgType) { + String orgIdPath = ""; + // 如果没传,默认查询当前工作人员所属组织 + if (StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); + orgId = staffInfoCacheResult.getAgencyId(); + orgType = OrgTypeEnum.AGENCY.getCode(); + } + if (OrgTypeEnum.AGENCY.getCode().equals(orgType)) { + CustomerAgencyDTO customerAgencyDTO = SpringContextUtils.getBean(CustomerAgencyService.class).get(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(customerAgencyDTO.getId(), customerAgencyDTO.getPids()); + } else if (OrgTypeEnum.GRID.getCode().equals(orgType)) { + CustomerGridDTO customerGridDTO = SpringContextUtils.getBean(CustomerGridService.class).get(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(customerGridDTO.getId(), customerGridDTO.getPids()); + } + return orgIdPath; + } + + } \ No newline at end of file From 51113bdb38a5658f1c5c5c86399fe13626057c81 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 15 May 2023 15:32:04 +0800 Subject: [PATCH 17/26] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=BB=9F=E8=AE=A1-=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E5=88=97=E8=A1=A8=EF=BC=88=E8=AF=A6=E6=83=85?= =?UTF-8?q?=EF=BC=89=E9=80=9A=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DangerousChemicalsDistributionFormDTO.java | 15 +++++ .../DangerousChemicalsTypeStatDetailDTO.java | 56 +++++++++++++++++++ .../IcDangerousChemicalsController.java | 24 +++++++- .../epmet/dao/IcDangerousChemicalsDao.java | 11 ++++ .../service/IcDangerousChemicalsService.java | 14 ++++- .../impl/IcDangerousChemicalsServiceImpl.java | 44 +++++++++++++-- .../mapper/IcDangerousChemicalsDao.xml | 28 +++++++++- 7 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/lingshan/DangerousChemicalsDistributionFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatDetailDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/lingshan/DangerousChemicalsDistributionFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/lingshan/DangerousChemicalsDistributionFormDTO.java new file mode 100644 index 0000000000..c106a76f18 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/lingshan/DangerousChemicalsDistributionFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.form.lingshan; + +import com.epmet.commons.tools.dto.form.OrgCommonFormDTO; +import lombok.Data; + +/** + * @Description 灵山大屏-安全生产-生产企业类型统计,点击饼图,中间地图显示列表 + * @Author yzm + * @Date 2023/5/15 14:59 + */ +@Data +public class DangerousChemicalsDistributionFormDTO extends OrgCommonFormDTO { + private String typeCode; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatDetailDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatDetailDTO.java new file mode 100644 index 0000000000..10dcef96be --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/lingshan/DangerousChemicalsTypeStatDetailDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result.lingshan; + +/** + * @Description 灵山大屏-安全生产-生产企业类型统计 点击饼图,列表及详情返参DTO + * @Author yzm + * @Date 2023/5/15 15:00 + */ + +import lombok.Data; + +@Data +public class DangerousChemicalsTypeStatDetailDTO { + /** + * 企业id + */ + private String id; + /** + * 企业名称 + */ + private String name; + /** + * 企业介绍 + */ + private String content; + private String longitude; + private String latitude; + private String addr; + /** + * 联系人 + */ + private String annt; + /** + * 联系电话 + */ + private String phone; + // @JsonIgnore + private String category; + + /** + * 类别名称 + */ + private String type; + /** + * 是否重点企业 + */ + private Boolean zd; + /** + * 包企领导 + */ + private String leader; + /** + * 包企干部 + */ + private String cadre; +} + diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java index 0d4bab7d0b..3ec91f1896 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcDangerousChemicalsController.java @@ -24,8 +24,10 @@ import com.epmet.dto.IcDangerousChemicalsDTO; import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; +import com.epmet.dto.form.lingshan.DangerousChemicalsDistributionFormDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO; import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.excel.IcDangerousChemicalsExcel; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -297,7 +299,25 @@ public class IcDangerousChemicalsController { * @return */ @PostMapping("type-stat") - public Result> typeStat(@RequestBody OrgCommonFormDTO formDto) { - return new Result>().ok(icDangerousChemicalsService.typeStat(formDto.getOrgId(), formDto.getOrgType())); + public Result> typeStat(@LoginUser TokenDto tokenDto, @RequestBody OrgCommonFormDTO formDto) { + return new Result>().ok(icDangerousChemicalsService.typeStat(tokenDto.getCustomerId(), + tokenDto.getUserId(), + formDto.getOrgId(), + formDto.getOrgType())); + } + + /** + * 灵山大屏-安全生产-生产企业类型统计,点击饼图,查询列表及详情 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("distribution") + public Result> distribution(@LoginUser TokenDto tokenDto, @RequestBody DangerousChemicalsDistributionFormDTO formDTO) { + return new Result>().ok(icDangerousChemicalsService.distribution(tokenDto.getCustomerId(), + tokenDto.getUserId(), + formDTO.getOrgId(), + formDTO.getOrgType(), + formDTO.getTypeCode())); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java index 1cc152c5f5..194eba8f2f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcDangerousChemicalsDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO; import com.epmet.entity.IcDangerousChemicalsEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -24,4 +25,14 @@ public interface IcDangerousChemicalsDao extends BaseDao entityList); + /** + * 灵山大屏-安全生产-生产企业类型统计,点击饼图,查询列表及详情 + * @param customerId + * @param orgIdPath + * @param typeCode + * @return + */ + List selectDistributionList(@Param("customerId") String customerId, + @Param("orgIdPath") String orgIdPath, + @Param("typeCode") String typeCode); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java index d3963172c3..81e4da7937 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcDangerousChemicalsService.java @@ -7,6 +7,7 @@ import com.epmet.dto.IcDangerousChemicalsDTO; import com.epmet.dto.form.IcDangerousChemicalsAddEditFormDTO; import com.epmet.dto.form.IcDangerousChemicalsListFormDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO; import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.entity.IcDangerousChemicalsEntity; @@ -90,5 +91,16 @@ public interface IcDangerousChemicalsService extends BaseService typeStat(String orgId, String orgType); + List typeStat(String customerId,String staffId,String orgId, String orgType); + + /** + * 灵山大屏-安全生产-生产企业类型统计,点击饼图,查询列表及详情 + * @param customerId + * @param userId + * @param orgId + * @param orgType + * @param typeCode + * @return + */ + List distribution(String customerId, String staffId, String orgId, String orgType, String typeCode); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java index 8f0567c01c..d482ea2bf0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcDangerousChemicalsServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.result.IcCoverageCategoryDictListResultDTO; import com.epmet.dto.result.IcDangerousChemicalsListResultDTO; import com.epmet.dto.result.UploadImgResultDTO; +import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatDetailDTO; import com.epmet.dto.result.lingshan.DangerousChemicalsTypeStatResultDTO; import com.epmet.entity.IcDangerousChemicalsEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -363,13 +364,13 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl typeStat(String orgId, String orgType) { + public List typeStat(String customerId,String staffId,String orgId, String orgType) { // 企业类别字典数据 - List dictList = coverageService.dictMap(EpmetRequestHolder.getLoginUserCustomerId(), CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); + List dictList = coverageService.dictMap(customerId, CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); if (CollectionUtils.isEmpty(dictList)) { return new ArrayList<>(); } - String orgIdPath = queryOrgIdPath(orgId, orgType); + String orgIdPath = queryOrgIdPath(customerId,staffId,orgId, orgType); if (StringUtils.isBlank(orgIdPath)) { return new ArrayList<>(); } @@ -378,7 +379,7 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl countWrapper = new LambdaQueryWrapper<>(); - countWrapper.eq(IcDangerousChemicalsEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()) + countWrapper.eq(IcDangerousChemicalsEntity::getCustomerId, customerId) .likeRight(IcDangerousChemicalsEntity::getOrgIdPath, orgIdPath) .eq(IcDangerousChemicalsEntity::getCategory, dto.getValue()); resultDTO.setValue(baseDao.selectCount(countWrapper)); @@ -388,11 +389,11 @@ public class IcDangerousChemicalsServiceImpl extends BaseServiceImpl distribution(String customerId, String staffId, String orgId, String orgType, String typeCode) { + // 企业类别字典数据 + List dictList = coverageService.dictMap(customerId, CoveragePlaceTypeEnum.DANGEROUS_CHEMICALS.getCode()); + if (CollectionUtils.isEmpty(dictList)) { + return new ArrayList<>(); + } + Map categoryDictMap = dictList.stream().collect(Collectors.toMap(IcCoverageCategoryDictListResultDTO::getValue, IcCoverageCategoryDictListResultDTO::getLabel)); + String orgIdPath = queryOrgIdPath(customerId, staffId, orgId, orgType); + if (StringUtils.isBlank(orgIdPath)) { + return new ArrayList<>(); + } + List list = baseDao.selectDistributionList(customerId, orgIdPath, typeCode); + list.forEach(l -> { + // 赋值企业分类名称 + if (MapUtils.isNotEmpty(categoryDictMap) && categoryDictMap.containsKey(l.getCategory())) { + l.setType(categoryDictMap.get(l.getCategory())); + } + }); + return list; + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml index 936cda737e..5258d85b78 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcDangerousChemicalsDao.xml @@ -143,5 +143,31 @@ AND del_flag = '0' - + + \ No newline at end of file From 3b5eca8f47d42a70a17f36a88a26e851c04c125c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 15 May 2023 18:33:46 +0800 Subject: [PATCH 18/26] =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E5=A4=A7=E5=8E=85?= =?UTF-8?q?=EF=BC=8C=E5=BE=85=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/DictTypeEnum.java | 1 + .../LingshanOfficeHallServiceRecordDTO.java | 199 ++++++++++++++++++ ...hanOfficeHallServiceRecordPageFormDTO.java | 48 +++++ ...shanOfficeHallServiceRecordController.java | 175 +++++++++++++++ .../LingshanOfficeHallServiceRecordDao.java | 28 +++ ...LingshanOfficeHallServiceRecordEntity.java | 118 +++++++++++ ...hanOfficeHallServiceRecordExportExcel.java | 92 ++++++++ ...ingshanOfficeHallServiceRecordService.java | 70 ++++++ ...hanOfficeHallServiceRecordServiceImpl.java | 169 +++++++++++++++ .../LingshanOfficeHallServiceRecordDao.xml | 42 ++++ 10 files changed, 942 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanOfficeHallServiceRecordEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LingshanOfficeHallServiceRecordExportExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index a07838684d..99338ee9c6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -34,6 +34,7 @@ public enum DictTypeEnum { TRAFFIC_TYPE("traffic_type", "交通方式", 36), SOJOURN_HISTORY("sojourn_history", "7天内旅居史情况", 37), TRIP_DATA_TYPE("trip_data_type", "行程记录类型", 39), + LINGSHAN_OFFICE_HALL_SERVICE_RECORD("lingshan_office_hall_service_record","灵山-办事大厅业务类型",40), ; private final String code; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java new file mode 100644 index 0000000000..f95bd871ec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java @@ -0,0 +1,199 @@ +package com.epmet.dto; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + + +/** + * 灵山_办事大厅服务记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-15 + */ +@Data +public class LingshanOfficeHallServiceRecordDTO implements Serializable { + private static final long serialVersionUID = 2157075710544884607L; + + public interface AddInternalGroup { + } + + public interface AddShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateInternalGroup { + } + + public interface UpdateShowGroup extends CustomerClientShowGroup { + } + + + /** + * 主键 + */ + @NotBlank(message = "id不能为空",groups = {UpdateInternalGroup.class}) + private String id; + + /** + * 租户号 + */ + private String customerId; + + /** + * 工作人员录入:gov_pc;居民端小程序:resi_mp + */ + private String sourceType; + + /** + * 事项类型 + */ + @NotBlank(message = "事项类型不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String categoryCode; + + /** + * 类别名称 + * 举例:营业执照服务、食品许可证服务、医疗保险业务、养老保险业务 + */ + private String categoryName; + + /** + * 事项说明 + */ + @NotBlank(message = "事项说明不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @Length(max = 500, message = "事项说明最多输入500字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String content; + + /** + * 申请人所属组织id或者网格id + */ + @NotBlank(message = "申请人所属组织不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String applicantOrgId; + + /** + * agency或者grid + */ + @NotBlank(message = "orgType不能为空",groups = {AddInternalGroup.class,UpdateInternalGroup.class}) + private String applicantOrgType; + + /** + * ORG_ID全路径 + */ + private String applicantOrgIdPath; + + /** + * 申请人所属组织名称 + */ + private String applicantOrgName; + + /** + * 申请人姓名 + */ + // @NotBlank(message = "申请人姓名不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + // @Length(max = 30, message = "申请人姓名最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String applicantName; + + /** + * 申请人联系电话 + */ + // @NotBlank(message = "申请人电话不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + // @Length(max = 30, message = "申请人电话最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String applicantMobile; + + /** + * 申请人身份证号 + */ + // @NotBlank(message = "申请人身份证号不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + // @Length(max = 30, message = "申请人身份证号最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String applicantIdCard; + + /** + * 申请日期 + */ + @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + private Date applicantTime; + + /** + * 办理人姓名 + */ + @NotBlank(message = "办理人姓名不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @Length(max = 30, message = "办理人姓名最多输入30字", groups = {AddShowGroup.class, UpdateShowGroup.class}) + private String transactorName; + + /** + * 未办结:0;已办结:1 + */ + @NotBlank(message = "办理状态不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + private String status; + + private String statusName; + /** + * 办结日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + private Date closeTime; + + /** + * 满意度评价。-1不满意,0基本满意,1非常满意 + */ + private Integer satisfication; + + private String satisficationName; + + /** + * 本条数据所属组织id/所属网格id + */ + private String orgId; + + /** + * agency或者grid + */ + private String orgType; + + /** + * 本条数据所属组织的org_id_path + */ + private String orgIdPath; + /** + * 乐观锁 + */ + @JsonIgnore + private Integer revision; + + /** + * 删除标记 + */ + @JsonIgnore + private String delFlag; + + /** + * 创建人 + */ + @JsonIgnore + private String createdBy; + + /** + * 创建时间 + */ + @JsonIgnore + private Date createdTime; + + /** + * 更新人 + */ + @JsonIgnore + private String updatedBy; + + /** + * 更新时间 + */ + @JsonIgnore + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java new file mode 100644 index 0000000000..9f6102afff --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form.lingshan; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2023/5/15 16:31 + */ +@Data +public class LingshanOfficeHallServiceRecordPageFormDTO extends PageFormDTO { + private String orgId; + private String orgType; + /** + * 事项类型 + */ + private String categoryCode; + /** + * 事项说明 + */ + private String content; + /** + * 满意度评价。-1不满意,0基本满意,1非常满意 + */ + private Integer satisfication; + /** + * 办结日期 + */ + // @DateTimeFormat(pattern = "yyyy-MM-dd") + // @JsonFormat(pattern = "yyyy-MM-dd") + private String startDate; + + // @DateTimeFormat(pattern = "yyyy-MM-dd") + // @JsonFormat(pattern = "yyyy-MM-dd") + private String endDate; + + /** + * 未办结:0;已办结:1 + */ + private String status; + + //tokenDto. + private String customerId; + //tokenDto. + private String staffId; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java new file mode 100644 index 0000000000..8ce453b22d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java @@ -0,0 +1,175 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; +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.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; +import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO; +import com.epmet.service.LingshanOfficeHallServiceRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.poi.ss.usermodel.IndexedColors; +import org.apache.poi.ss.usermodel.VerticalAlignment; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Date; +import java.util.List; + + +/** + * 灵山_办事大厅服务记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-15 + */ +@Slf4j +@RestController +@RequestMapping("lingshanOfficeHallServiceRecord") +public class LingshanOfficeHallServiceRecordController { + + @Autowired + private LingshanOfficeHallServiceRecordService lingshanOfficeHallServiceRecordService; + + /** + * 分页列表 + * + * @param formDTO + * @return + */ + @PostMapping("page") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + PageData page = lingshanOfficeHallServiceRecordService.page(formDTO); + return new Result>().ok(page); + } + + /** + * 办事大厅-查看详情 + * + * @param id + * @return + */ + @RequestMapping(value = "detail/{id}", method = {RequestMethod.POST}) + public Result get(@PathVariable("id") String id) { + LingshanOfficeHallServiceRecordDTO data = lingshanOfficeHallServiceRecordService.get(id); + return new Result().ok(data); + } + + /** + * 工作端添加 + * + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("save") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordDTO dto) { + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setSourceType("gov_pc"); + ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.AddShowGroup.class, LingshanOfficeHallServiceRecordDTO.AddInternalGroup.class); + lingshanOfficeHallServiceRecordService.save(dto); + return new Result(); + } + + /** + * 工作端修改 + * + * @param dto + * @return + */ + @NoRepeatSubmit + @PostMapping("update") + public Result update(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordDTO dto) { + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setSourceType("gov_pc"); + ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.UpdateShowGroup.class, LingshanOfficeHallServiceRecordDTO.UpdateInternalGroup.class); + lingshanOfficeHallServiceRecordService.update(dto); + return new Result(); + } + + /** + * 批量删除 + * 单挑删除 + * + * @param ids + * @return + */ + @PostMapping("delete") + public Result delete(@RequestBody List ids) { + if (CollectionUtils.isNotEmpty(ids)) { + lingshanOfficeHallServiceRecordService.delete(ids); + } + return new Result(); + } + + @PostMapping("export") + public void exportEnterprise(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "办事大厅" + DateUtils.format(new Date()) + ".xlsx"; + // 头的策略 + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + // 背景设置为红色 + headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); + FreezeAndFilter writeHandler = new FreezeAndFilter(); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), LingshanOfficeHallServiceRecordDTO.class) + .registerWriteHandler(horizontalCellStyleStrategy) + .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) + .registerWriteHandler(writeHandler).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + List list = null; + do { + data = lingshanOfficeHallServiceRecordService.page(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordDTO.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("办事大厅列表导出异常export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java new file mode 100644 index 0000000000..51cc8bc63b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java @@ -0,0 +1,28 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; +import com.epmet.entity.LingshanOfficeHallServiceRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 灵山_办事大厅服务记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-15 + */ +@Mapper +public interface LingshanOfficeHallServiceRecordDao extends BaseDao { + + List pageList(@Param("customerId") String customerId, + @Param("orgIdPath") String orgIdPath, + @Param("categoryCode") String categoryCode, + @Param("content") String content, + @Param("satisfication") Integer satisfication, + @Param("startDate") String startDate, + @Param("endDate") String endDate, + @Param("status") String status); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanOfficeHallServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanOfficeHallServiceRecordEntity.java new file mode 100644 index 0000000000..3f649fd6e7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanOfficeHallServiceRecordEntity.java @@ -0,0 +1,118 @@ +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 2023-05-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("lingshan_office_hall_service_record") +public class LingshanOfficeHallServiceRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 租户号 + */ + private String customerId; + + /** + * 工作人员录入:gov_pc;居民端小程序:resi_mp + */ + private String sourceType; + + /** + * 事项类型 + */ + private String categoryCode; + + /** + * 事项说明 + */ + private String content; + + /** + * 申请人所属组织id或者网格id + */ + private String applicantOrgId; + + /** + * agency或者grid + */ + private String applicantOrgType; + + /** + * ORG_ID全路径 + */ + private String applicantOrgIdPath; + + /** + * 申请人所属组织名称 + */ + private String applicantOrgName; + + /** + * 申请人姓名 + */ + private String applicantName; + + /** + * 申请人联系电话 + */ + private String applicantMobile; + + /** + * 申请人身份证号 + */ + private String applicantIdCard; + + /** + * 申请日期 + */ + private Date applicantTime; + + /** + * 办理人姓名 + */ + private String transactorName; + + /** + * 未办结:0;已办结:1 + */ + private String status; + + /** + * 办结日期 + */ + private Date closeTime; + + /** + * 满意度评价。-1不满意,0基本满意,1非常满意 + */ + private Integer satisfication; + + /** + * 本条数据所属组织id/所属网格id + */ + private String orgId; + /** + * agency或者grid + */ + private String orgType; + + /** + * 本条数据所属组织的org_id_path + */ + private String orgIdPath; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LingshanOfficeHallServiceRecordExportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LingshanOfficeHallServiceRecordExportExcel.java new file mode 100644 index 0000000000..2e97bced41 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LingshanOfficeHallServiceRecordExportExcel.java @@ -0,0 +1,92 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @Description + * @Author yzm + * @Date 2023/5/15 18:24 + */ +@Data +public class LingshanOfficeHallServiceRecordExportExcel { + + /** + * 申请人所属组织名称 + */ + @ExcelProperty(value = "所属组织") + @ColumnWidth(30) + private String applicantOrgName; + + /** + * 类别名称 + * 举例:营业执照服务、食品许可证服务、医疗保险业务、养老保险业务 + */ + @ExcelProperty(value = "事项类型") + @ColumnWidth(25) + private String categoryName; + + /** + * 事项说明 + */ + @ExcelProperty(value = "事项说明") + @ColumnWidth(40) + private String content; + + /** + * 申请人姓名 + */ + @ExcelProperty(value = "申请人") + @ColumnWidth(30) + private String applicantName; + + /** + * 申请人联系电话 + */ + @ExcelProperty(value = "申请人联系电话") + @ColumnWidth(30) + private String applicantMobile; + + /** + * 申请人身份证号 + */ + @ExcelProperty(value = "申请人身份证号") + @ColumnWidth(30) + private String applicantIdCard; + + @ExcelProperty(value = "申请日期") + @ColumnWidth(30) + @JsonFormat(pattern = "yyyy-MM-dd") + private Date applicantTime; + + /** + * 办理人姓名 + */ + @ExcelProperty(value = "办理人") + @ColumnWidth(30) + private String transactorName; + + @ExcelProperty(value = "办理状态") + @ColumnWidth(30) + private String statusName; + /** + * 办结日期 + */ + @ExcelProperty(value = "办结日期") + @ColumnWidth(30) + @JsonFormat(pattern = "yyyy-MM-dd") + private Date closeTime; + + /** + * 满意度评价。-1不满意,0基本满意,1非常满意 + */ + @ExcelProperty(value = "满意度") + @ColumnWidth(25) + private String satisficationName; + +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java new file mode 100644 index 0000000000..d2f2f96834 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java @@ -0,0 +1,70 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; +import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO; +import com.epmet.entity.LingshanOfficeHallServiceRecordEntity; + +import java.util.List; + +/** + * 灵山_办事大厅服务记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-15 + */ +public interface LingshanOfficeHallServiceRecordService extends BaseService { + + /** + * 办事大厅-分页列表 + * + * @param formDTO + * @return PageData + * @author generator + * @date 2023-05-15 + */ + PageData page(LingshanOfficeHallServiceRecordPageFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return LingshanOfficeHallServiceRecordDTO + * @author generator + * @date 2023-05-15 + */ + LingshanOfficeHallServiceRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2023-05-15 + */ + void save(LingshanOfficeHallServiceRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2023-05-15 + */ + void update(LingshanOfficeHallServiceRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2023-05-15 + */ + void delete(List ids); + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java new file mode 100644 index 0000000000..a5f3f275e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java @@ -0,0 +1,169 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +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.OrgTypeEnum; +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.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.EpmetRequestHolder; +import com.epmet.commons.tools.utils.PidUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.LingshanOfficeHallServiceRecordDao; +import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; +import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO; +import com.epmet.entity.LingshanOfficeHallServiceRecordEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.LingshanOfficeHallServiceRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +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.List; +import java.util.Map; + +/** + * 灵山_办事大厅服务记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2023-05-15 + */ +@Service +public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl implements LingshanOfficeHallServiceRecordService { + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + + /** + * 办事大厅-分页列表 + * + * @param formDTO + * @return + */ + @Override + public PageData page(LingshanOfficeHallServiceRecordPageFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOrgId()) && StringUtils.isBlank(formDTO.getOrgType())) { + formDTO.setOrgId(CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()).getAgencyId()); + formDTO.setOrgType(OrgTypeEnum.AGENCY.getCode()); + } + String orgIdPath = queryOrgIdPath(formDTO.getCustomerId(), formDTO.getStaffId(), formDTO.getOrgId(), formDTO.getOrgType()); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, formDTO.getCategoryCode(), formDTO.getContent(), formDTO.getSatisfication(), formDTO.getStartDate(), formDTO.getEndDate(), formDTO.getStatus()); + if (CollectionUtils.isNotEmpty(resultList)) { + Result> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode()); + resultList.forEach(dto -> { + dto.setCategoryName(MapUtils.isNotEmpty(categoryRes.getData()) ? categoryRes.getData().get(dto.getCategoryCode()) : StrConstant.EPMETY_STR); + }); + } + PageInfo pageInfo = new PageInfo<>(resultList); + return new PageData<>(resultList, pageInfo.getTotal()); + } + + /** + * 办事大厅-查看详情 + * + * @param id + * @return + */ + @Override + public LingshanOfficeHallServiceRecordDTO get(String id) { + LingshanOfficeHallServiceRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, LingshanOfficeHallServiceRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(LingshanOfficeHallServiceRecordDTO dto) { + LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class); + entity.setStatus(NumConstant.ZERO_STR); + if (StringUtils.isNotBlank(dto.getApplicantOrgId())) { + if (OrgTypeEnum.GRID.getCode().equals(dto.getApplicantOrgType())) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getApplicantOrgId()); + entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfoCache.getId(), gridInfoCache.getPids())); + entity.setApplicantOrgName(gridInfoCache.getGridNamePath()); + + // 本条数据属于网格 + entity.setOrgId(gridInfoCache.getId()); + entity.setOrgType(dto.getOrgType()); + entity.setOrgIdPath(entity.getApplicantOrgIdPath()); + } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); + entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyInfoCache.getId(), agencyInfoCache.getPids())); + entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); + // 本条数据属于组织 + entity.setOrgId(agencyInfoCache.getId()); + entity.setOrgType(dto.getOrgType()); + entity.setOrgIdPath(entity.getApplicantOrgIdPath()); + } + } else { + // 如果申请人所属组织没填写, 本条数据属于当前工作人员所属组织 + entity.setOrgId(CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), EpmetRequestHolder.getLoginUserId()).getAgencyId()); + entity.setOrgType(OrgTypeEnum.AGENCY.getCode()); + entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType())); + } + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(LingshanOfficeHallServiceRecordDTO dto) { + LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class); + if (StringUtils.isNotBlank(dto.getApplicantOrgId())) { + if (OrgTypeEnum.GRID.getCode().equals(dto.getApplicantOrgType())) { + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(dto.getApplicantOrgId()); + entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfoCache.getId(), gridInfoCache.getPids())); + entity.setApplicantOrgName(gridInfoCache.getGridNamePath()); + // 本条数据属于网格 + entity.setOrgId(gridInfoCache.getId()); + entity.setOrgType(dto.getOrgType()); + entity.setOrgIdPath(entity.getApplicantOrgIdPath()); + } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); + entity.setApplicantOrgIdPath(PidUtils.convertPid2OrgIdPath(agencyInfoCache.getId(), agencyInfoCache.getPids())); + entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); + // 本条数据属于组织 + entity.setOrgId(agencyInfoCache.getId()); + entity.setOrgType(dto.getOrgType()); + entity.setOrgIdPath(entity.getApplicantOrgIdPath()); + } + } else { + // 如果申请人所属组织没填写, 本条数据属于当前工作人员所属组织 + entity.setOrgId(CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), EpmetRequestHolder.getLoginUserId()).getAgencyId()); + entity.setOrgType(OrgTypeEnum.AGENCY.getCode()); + entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType())); + } + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(List ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(ids); + } + + private String queryOrgIdPath(String customerId, String staffId, String orgId, String orgType) { + String orgIdPath = ""; + // 如果没传,默认查询当前工作人员所属组织 + if (StringUtils.isBlank(orgId) && StringUtils.isBlank(orgType)) { + CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, staffId); + orgId = staffInfoCacheResult.getAgencyId(); + orgType = OrgTypeEnum.AGENCY.getCode(); + } + orgIdPath = CustomerOrgRedis.getOrgIdPath(orgId, orgType); + return orgIdPath; + } + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml new file mode 100644 index 0000000000..2b09eaf521 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml @@ -0,0 +1,42 @@ + + + + + + + \ No newline at end of file From 929189c56f841b37443fbb67adf88fc36b88a4bb Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 15 May 2023 20:33:54 +0800 Subject: [PATCH 19/26] =?UTF-8?q?=E7=81=B5=E5=B1=B1=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E4=B8=AD=E5=A4=AE=E4=B8=80=E6=B3=A2=E4=BB=A3=E7=A0=81=E3=80=82?= =?UTF-8?q?=E8=BF=98=E5=A4=A7=E5=B1=8F=E4=B8=8A=E4=BB=A3=E5=8A=9E=E5=91=98?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E5=8A=9E=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B2=A1=E5=86=99=EF=BC=8C=E6=98=8E=E5=A4=A9=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/LingShanScreenAgentRstDTO.java | 21 +++ .../result/LingshanServiceAgentAgentList.java | 4 + .../feign/DataAggregatorOpenFeignClient.java | 49 +++++ ...DataAggregatorOpenFeignClientFallback.java | 16 ++ .../LingShanServiceAgentController.java | 32 ++++ .../dao/epmetuser/CustomerStaffDao.java | 10 + .../service/LingShanServiceAgentService.java | 6 + .../service/epmetuser/EpmetUserService.java | 2 + .../epmetuser/impl/EpmetUserServiceImpl.java | 20 +- .../service/govorg/GovOrgService.java | 3 + .../govorg/impl/GovOrgServiceImpl.java | 18 ++ .../impl/LingShanServiceAgentServiceImpl.java | 137 ++++++++++++-- .../mapper/epmetuser/CustomerStaffDao.xml | 19 ++ .../mapper/govorg/CustomerStaffGridDao.xml | 1 + .../LingShanScreenAgentRstDTO.java | 21 +++ .../LingShanScreenServiceRstDTO.java | 20 ++ .../ScreenCatalogueQtyStatsRstDTO.java | 22 +++ .../LingShanAgentServiceController.java | 56 +++++- .../dao/LingshanAgentServiceRecordDao.java | 15 +- .../service/LingShanAgentServiceService.java | 11 +- .../impl/LingShanAgentServiceServiceImpl.java | 178 +++++++++++++++++- .../mapper/LingshanAgentServiceRecordDao.xml | 22 +++ 22 files changed, 648 insertions(+), 35 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingShanScreenAgentRstDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenAgentRstDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenCatalogueQtyStatsRstDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingShanScreenAgentRstDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingShanScreenAgentRstDTO.java new file mode 100644 index 0000000000..a4eefe5aa1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingShanScreenAgentRstDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description 灵山代办员信息 + * @Author wangxianzhang + * @Time 2023/5/15 2:57 PM + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LingShanScreenAgentRstDTO { + + private String agentName; + private String longitude; + private String latitude; + private String mobile; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java index 49fa8d30d9..49776b5240 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/LingshanServiceAgentAgentList.java @@ -22,4 +22,8 @@ public class LingshanServiceAgentAgentList { private String mobile; private String idCard; + private String longitude; + + private String latitude; + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java index 8d2624af35..db47eb69ca 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/DataAggregatorOpenFeignClient.java @@ -5,13 +5,16 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; import com.epmet.dataaggre.feign.impl.DataAggregatorOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -40,4 +43,50 @@ public interface DataAggregatorOpenFeignClient { */ @PostMapping(value = "data/aggregator/org/gridlively") Result> grdiLively(@RequestBody GridLivelyFormDTO form); + + /** + * @description: 工作端pc,代办员列表 + * @param pageNo: + * @param pageSize: + * @param orgId: + * @param orgType: + * @param agentName: + * @param mobile: + * @param idCard: + * @return + * @author: WangXianZhang + * @date: 2023/5/9 4:30 PM + */ + @GetMapping("data/aggregator/lingshan/serviceAgent/workpc/agentList") + Result> workPcAgentList(@RequestParam("pageNo") Integer pageNo, + @RequestParam("pageSize") Integer pageSize, + @RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType, + @RequestParam(value = "agentName",required = false) String agentName, + @RequestParam(value = "mobile", required = false) Integer mobile, + @RequestParam(value = "idCard", required = false) Integer idCard); + + /** + * @Description: 大屏-代办员数量 + * @param orgId: + * @param orgType: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/15 10:29 AM + */ + @GetMapping("data/aggregator/lingshan/serviceAgent/screen/agentQty") + Result lingshanScreenAgentQty(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType); + + /** + * @Description: 大屏:代办员列表 + * @param orgId: + * @param orgType: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/15 4:57 PM + */ + @GetMapping("data/aggregator/lingshan/serviceAgent/screen/agentList") + Result> screenAgentList(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType); } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java index c180033e19..b74bbee020 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/feign/impl/DataAggregatorOpenFeignClientFallback.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dataaggre.dto.epmetuser.form.ResisByPolicyRulesFormDTO; +import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO; import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; @@ -32,4 +33,19 @@ public class DataAggregatorOpenFeignClientFallback implements DataAggregatorOpen public Result> grdiLively(GridLivelyFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "grdiLively",form); } + + @Override + public Result lingshanScreenAgentQty(String orgId, String orgType) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "lingshanScreenAgentQty",orgId, orgType); + } + + @Override + public Result> workPcAgentList(Integer pageNo, Integer pageSize, String orgId, String orgType, String agentName, Integer mobile, Integer idCard) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "workPcAgentList",pageNo, pageSize, orgId, orgType, agentName, mobile, idCard); + } + + @Override + public Result> screenAgentList(String orgId, String orgType) { + return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "screenAgentList", orgId, orgType); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java index 0a84670f82..1614fd5453 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/LingShanServiceAgentController.java @@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RestController @RequestMapping("lingshan/serviceAgent") public class LingShanServiceAgentController { @@ -43,4 +45,34 @@ public class LingShanServiceAgentController { return new Result>().ok(pd); } + /** + * @Description: 大屏-代办员数量 + * @param orgId: + * @param orgType: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/15 10:29 AM + */ + @GetMapping("screen/agentQty") + public Result lingshanScreenAgentQty(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType) { + + return new Result().ok(lingShanServiceAgentService.lingshanScreenAgentQty(orgId, orgType)); + } + + /** + * @Description: 大屏:代办员列表 + * @param orgId: + * @param orgType: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/15 4:57 PM + */ + @GetMapping("screen/agentList") + public Result> screenAgentList(@RequestParam(value = "orgId", required = false) String orgId, + @RequestParam(value = "orgType", required = false) String orgType) { + + List rl = lingShanServiceAgentService.screenAgentList(orgId, orgType); + return new Result>().ok(rl); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java index cd6059ed50..617c216415 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java @@ -101,4 +101,14 @@ public interface CustomerStaffDao extends BaseDao { @Param("mobile") Integer mobile, @Param("realname") String realname, @Param("idCard") Integer idCard); + + /** + * @Description: 查询网格下具有某角色的工作人员数量 + * @param staffIds: + * @param roleId: + * @Return java.lang.Integer + * @Author: wangxianzhang + * @Date: 2023/5/15 11:21 AM + */ + Integer countStaffQtyByStaffIdsAndRole(@Param("staffIds") Set staffIds, @Param("roleId") String roleId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java index 779d4c26b7..6cb2f1c5ec 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/LingShanServiceAgentService.java @@ -3,6 +3,12 @@ package com.epmet.dataaggre.service; import com.epmet.commons.tools.page.PageData; import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; +import java.util.List; + public interface LingShanServiceAgentService { PageData workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, Integer pageNo, Integer pageSize); + + Integer lingshanScreenAgentQty(String orgId, String orgType); + + List screenAgentList(String orgId, String orgType); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 53fb0f2880..ec87a71781 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -267,4 +267,6 @@ public interface EpmetUserService { PageData staffListInGridsOfRole(String roleKey, Set staffIds, String agentName, Integer mobile, Integer idCard, Integer pageNo, Integer pageSize); + + Integer staffQtyInGridsOfRole(String roleKeyAgent, Set staffIds); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index e6bfd22670..9e04d840db 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -1155,8 +1155,13 @@ public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolve public PageData staffListInGridsOfRole(String roleKey, Set staffIds, String agentName, Integer mobile, Integer idCard, Integer pageNo, Integer pageSize) { + String customerId; + if (StringUtils.isBlank(customerId = EpmetRequestHolder.getLoginUserCustomerId())) { + throw new EpmetException(EpmetErrorCode.ERR10005.getCode()); + } + LambdaQueryWrapper rq = new LambdaQueryWrapper<>(); - rq.eq(GovStaffRoleEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + rq.eq(GovStaffRoleEntity::getCustomerId, customerId); rq.eq(GovStaffRoleEntity::getRoleKey, roleKey); GovStaffRoleEntity role = govStaffRoleDao.selectOne(rq); if (role == null) { @@ -1169,4 +1174,17 @@ public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolve return new PageData<>(ss, new PageInfo<>(ss).getTotal()); } + + @Override + public Integer staffQtyInGridsOfRole(String roleKey, Set staffIds) { + LambdaQueryWrapper rq = new LambdaQueryWrapper<>(); + rq.eq(GovStaffRoleEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + rq.eq(GovStaffRoleEntity::getRoleKey, roleKey); + GovStaffRoleEntity role = govStaffRoleDao.selectOne(rq); + if (role == null) { + return 0; + } + + return customerStaffDao.countStaffQtyByStaffIdsAndRole(staffIds, role.getId()); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 1828e4c713..d8ffe1e59b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -14,6 +14,7 @@ import com.epmet.dataaggre.dto.govorg.form.*; import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; import com.epmet.dto.IcNeighborHoodDTO; import javax.servlet.http.HttpServletResponse; @@ -306,4 +307,6 @@ public interface GovOrgService { List getStaffAndItsBelongsGridByAgencyIdPath(String agencyIdPath); Set getStaffIdsInGrid(String gridId); + + List listBelongGridsByStaffId(String staffId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 36755471d7..68a8b8dac3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -1554,4 +1554,22 @@ public class GovOrgServiceImpl implements GovOrgService { List es = customerStaffGridDao.selectList(q); return es.stream().map(CustomerStaffGridEntity::getUserId).collect(Collectors.toSet()); } + + /** + * @Description: 一个人多个网格:根据工作人员id查询所属网格id + * @param staffId: + * @Return java.util.List + * @Author: wangxianzhang + * @Date: 2023/5/15 4:39 PM + */ + @Override + public List listBelongGridsByStaffId(String staffId) { + LambdaQueryWrapper q = new LambdaQueryWrapper<>(); + q.eq(CustomerStaffGridEntity::getUserId, staffId); + List staffAndGrids = customerStaffGridDao.selectList(q); + + LambdaQueryWrapper q2 = new LambdaQueryWrapper<>(); + q2.in(CustomerGridEntity::getId, staffAndGrids.stream().map(CustomerStaffGridEntity::getGridId).collect(Collectors.toList())); + return customerGridDao.selectList(q2); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java index 803baf5578..cf39b5b964 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/LingShanServiceAgentServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.enums.GenderEnum; @@ -14,7 +15,11 @@ import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dataaggre.beans.LingShanAgentServiceStaffAndGrid; import com.epmet.dataaggre.beans.StaffInfoInGridOfRole; +import com.epmet.dataaggre.dao.govorg.CustomerGridDao; +import com.epmet.dataaggre.dao.govorg.CustomerStaffGridDao; import com.epmet.dataaggre.dto.epmetuser.result.LingshanServiceAgentAgentList; +import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; +import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity; import com.epmet.dataaggre.service.LingShanServiceAgentService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.govorg.GovOrgService; @@ -24,12 +29,13 @@ import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.remote.EpmetUserRemoteService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.sql.Array; import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; @Service public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentService, ResultDataResolver { @@ -46,22 +52,17 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ @Autowired private EpmetUserRemoteService epmetUserRemoteService; - @Override - public PageData workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, - Integer pageNo, Integer pageSize) { - - // 1个人可能属于多个wangge - Map> staffIdAndGridIds = new HashMap<>(); - Set staffIds = new HashSet<>(); - - if (StringUtils.isAnyBlank(orgId, orgType)) { - // 如果前端没选择,那就取当前工作人员所属组织 - LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); - orgId = loginUserDetails.getAgencyId(); - orgType = OrgInfoConstant.AGENCY; - } - - // 得到staffIds和staffIdAndGridIds + /** + * @Description: 填充 + * @param orgId: + * @param orgType: + * @param staffIdAndGridIds: + * @param staffIds: + * @Return void + * @Author: wangxianzhang + * @Date: 2023/5/15 10:33 AM + */ + private void fillDatas4AgentQuery(String orgId, String orgType, Map> staffIdAndGridIds, Set staffIds) { if (OrgInfoConstant.AGENCY.equals(orgType)) { // agency AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); @@ -84,6 +85,27 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ staffIdAndGridIds.put(staffId, Arrays.asList(orgId)); } } + } + + @Override + public PageData workPcAgentList(String orgId, String orgType, String agentName, Integer mobile, Integer idCard, + Integer pageNo, Integer pageSize) { + + // 1个人可能属于多个网格,这里用来给页面显示多个网格,逗号分割 + Map> staffIdAndGridIds = new HashMap<>(); + + // 用来进一步查询工作人员 + Set staffIds = new HashSet<>(); + + if (StringUtils.isAnyBlank(orgId, orgType)) { + // 如果前端没选择,那就取当前工作人员所属组织 + LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); + orgId = loginUserDetails.getAgencyId(); + orgType = OrgInfoConstant.AGENCY; + } + + // 得到staffIds和staffIdAndGridIds + fillDatas4AgentQuery(orgId, orgType, staffIdAndGridIds, staffIds); // 开始查询staff列表 PageData pd = epmetUserService.staffListInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds, agentName, mobile, idCard, pageNo, pageSize); @@ -137,5 +159,86 @@ public class LingShanServiceAgentServiceImpl implements LingShanServiceAgentServ return String.join(",", orgNames); } + @Override + public Integer lingshanScreenAgentQty(String orgId, String orgType) { + + // 1个人可能属于多个wangge + Map> staffIdAndGridIds = new HashMap<>(); + Set staffIds = new HashSet<>(); + if (StringUtils.isAnyBlank(orgId, orgType)) { + // 如果前端没选择,那就取当前工作人员所属组织 + LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); + orgId = loginUserDetails.getAgencyId(); + orgType = OrgInfoConstant.AGENCY; + } + + // 得到staffIds和staffIdAndGridIds + fillDatas4AgentQuery(orgId, orgType, staffIdAndGridIds, staffIds); + + // 开始查询staff列表 + return epmetUserService.staffQtyInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds); + } + + @Override + public List screenAgentList(String orgId, String orgType) { + // 1个人可能属于多个wangge + Map> staffIdAndGridIds = new HashMap<>(); + Set staffIds = new HashSet<>(); + + if (StringUtils.isAnyBlank(orgId, orgType)) { + // 如果前端没选择,那就取当前工作人员所属组织 + LoginUserDetailsResultDTO loginUserDetails = epmetUserRemoteService.getLoginUserDetails(); + orgId = loginUserDetails.getAgencyId(); + orgType = OrgInfoConstant.AGENCY; + } + + fillDatas4AgentQuery(orgId, orgType, staffIdAndGridIds, staffIds); + + // 开始查询staff列表 + PageData staffPage = epmetUserService.staffListInGridsOfRole(RoleKeyConstants.ROLE_KEY_AGENT, staffIds, + null, null, null, 1, Integer.MAX_VALUE); + + if (staffPage == null) { + return new ArrayList(); + } + + // 性别&教育字典 + List edus = getResultDataOrReturnNull(adminOpenFeignClient.dictDataList(DictTypeEnum.EDUCATION.getCode()), ServiceConstant.EPMET_ADMIN_SERVER); + Map eduMap = edus.stream().collect(Collectors.toMap(SysDictDataDTO::getDictValue, SysDictDataDTO::getDictLabel)); + + // 转换为dto + List rl = staffPage.getList().stream().map(e -> { + LingshanServiceAgentAgentList d = new LingshanServiceAgentAgentList(); + d.setAgentName(e.getStaffName()); + d.setAgentId(e.getStaffId()); + d.setGender(e.getGender()); + d.setGenderDisplay(GenderEnum.getName(e.getGender().toString())); + d.setAge(e.getAge()); + d.setCulture(e.getCulture()); + if (e.getCulture() != null) { + d.setCultureDisplay(eduMap.get(e.getCulture().toString())); + } + d.setMobile(e.getMobile()); + d.setIdCard(e.getIdCard()); + // 组织名称 + return d; + }).collect(Collectors.toList()); + + // 展开工作人员与网格的对应关系,开始赋值坐标,坐标使用所属网格的坐标,但是一个工作人员可能属于多个网格,有几个网格就复制出来几条工作人员信息,内容重复即可。 + List finalAgentList = rl.stream().flatMap(agent -> { + List gridIdsOfAgent = staffIdAndGridIds.get(agent.getAgentId()); + return gridIdsOfAgent.stream().map(gridId -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId); + LingshanServiceAgentAgentList newOne = ConvertUtils.sourceToTarget(agent, LingshanServiceAgentAgentList.class); + newOne.setLatitude(gridInfo.getLatitude()); + newOne.setLongitude(gridInfo.getLongitude()); + newOne.setGridId(gridId); + newOne.setOrgNamePath(gridInfo.getGridNamePath()); + return newOne; + }); + }).collect(Collectors.toList()); + + return finalAgentList; + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml index 78ec048218..69a89c0cfc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -164,6 +164,7 @@ + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml index af5b07332c..099345e615 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml @@ -69,6 +69,7 @@ + + select r.AGENT_ID + , r.GRID_ID + , count(r.PROCESS_STATUS = 1 or null) as unClosedServiceQty + , count(r.PROCESS_STATUS = 3 or null) as closedServiceQty + from lingshan_agent_service_record r + + + r.AGENT_ID in + + #{agentId} + + + and r.DEL_FLAG = 0 + and r.AGENT_ID is not null + and r.AGENT_ID != '' + + group by r.AGENT_ID, r.GRID_ID + + \ No newline at end of file From 937112c4bdee04bb79199b72b3dd48fd3159e432 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 15 May 2023 20:39:42 +0800 Subject: [PATCH 20/26] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=92=8C=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BB=8F?= =?UTF-8?q?=E7=BA=AC=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java | 3 +++ .../src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java | 3 +++ .../src/main/java/com/epmet/entity/IcHouseEntity.java | 3 +++ .../src/main/java/com/epmet/service/impl/HouseServiceImpl.java | 2 ++ 4 files changed, 11 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index cdbf65c799..93735939e8 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -170,4 +170,7 @@ public class IcHouseDTO implements Serializable { * 加密后的房主身份证 */ private String showOwnerIdCard; + + private String longitude; + private String latitude; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java index aa4e6a999b..46057d6fae 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcHouseAddFormDTO.java @@ -113,4 +113,7 @@ public class IcHouseAddFormDTO implements Serializable { */ private String coding; + private String longitude; + private String latitude; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java index 96e993c865..fe282a9265 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcHouseEntity.java @@ -136,4 +136,7 @@ public class IcHouseEntity extends BaseEpmetEntity { * 房屋可编辑编码 */ private String coding; + + private String longitude; + private String latitude; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 92fb0d2116..d47c6e0132 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -238,6 +238,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { } IcHouseDTO icHouseDTO = ConvertUtils.sourceToTarget(formDTO, IcHouseDTO.class); icHouseDTO.setId(formDTO.getHouseId()); + icHouseDTO.setLatitude(formDTO.getLatitude()); + icHouseDTO.setLongitude(formDTO.getLongitude()); icHouseDTO.setCustomerId(customerId); icHouseDTO.setRentFlag(formDTO.getRentFlag()); icHouseDTO.setHouseTypeName(HouseTypeEnums.getTypeValue(formDTO.getHouseType())); From 9cf45385b6d95368bee2c949c09e195e675aa995 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:26:51 +0800 Subject: [PATCH 21/26] =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E5=A4=A7=E5=8E=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=AB=AFend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LingshanOfficeHallServiceRecordDTO.java | 8 +++- ...shanOfficeHallServiceRecordController.java | 11 ++--- ...ingshanOfficeHallServiceRecordService.java | 2 +- ...hanOfficeHallServiceRecordServiceImpl.java | 45 ++++++++++++++++--- 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java index f95bd871ec..208ea845e0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import org.hibernate.validator.constraints.Length; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -116,7 +117,9 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { /** * 申请日期 */ - @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @NotNull(message = "申请日期1111不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) private Date applicantTime; /** @@ -136,7 +139,8 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { /** * 办结日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date closeTime; /** diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java index 8ce453b22d..feda2f66a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingshanOfficeHallServiceRecordController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.LingshanOfficeHallServiceRecordDTO; import com.epmet.dto.form.lingshan.LingshanOfficeHallServiceRecordPageFormDTO; +import com.epmet.excel.LingshanOfficeHallServiceRecordExportExcel; import com.epmet.service.LingshanOfficeHallServiceRecordService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -89,8 +90,7 @@ public class LingshanOfficeHallServiceRecordController { dto.setCustomerId(tokenDto.getCustomerId()); dto.setSourceType("gov_pc"); ValidatorUtils.validateEntity(dto, LingshanOfficeHallServiceRecordDTO.AddShowGroup.class, LingshanOfficeHallServiceRecordDTO.AddInternalGroup.class); - lingshanOfficeHallServiceRecordService.save(dto); - return new Result(); + return new Result().ok(lingshanOfficeHallServiceRecordService.save(dto)); } /** @@ -127,6 +127,7 @@ public class LingshanOfficeHallServiceRecordController { @PostMapping("export") public void exportEnterprise(@LoginUser TokenDto tokenDto, @RequestBody LingshanOfficeHallServiceRecordPageFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); ExcelWriter excelWriter = null; formDTO.setPageNo(NumConstant.ONE); formDTO.setPageSize(NumConstant.TEN_THOUSAND); @@ -140,16 +141,16 @@ public class LingshanOfficeHallServiceRecordController { contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); FreezeAndFilter writeHandler = new FreezeAndFilter(); - excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), LingshanOfficeHallServiceRecordDTO.class) + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), LingshanOfficeHallServiceRecordExportExcel.class) .registerWriteHandler(horizontalCellStyleStrategy) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(writeHandler).build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); PageData data = null; - List list = null; + List list = null; do { data = lingshanOfficeHallServiceRecordService.page(formDTO); - list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordDTO.class); + list = ConvertUtils.sourceToTarget(data.getList(), LingshanOfficeHallServiceRecordExportExcel.class); formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); excelWriter.write(list, writeSheet); } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java index d2f2f96834..2deff3860d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingshanOfficeHallServiceRecordService.java @@ -44,7 +44,7 @@ public interface LingshanOfficeHallServiceRecordService extends BaseService> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode()); + resultDto.setCategoryName(MapUtils.isNotEmpty(categoryRes.getData()) ? categoryRes.getData().get(resultDto.getCategoryCode()) : StrConstant.EPMETY_STR); + //未办结:0;已办结:1 + if(NumConstant.ZERO_STR.equals(resultDto.getStatus())){ + resultDto.setStatusName("未办结"); + }else if(NumConstant.ONE_STR.equals(resultDto.getStatus())){ + resultDto.setStatusName("已办结"); + } + if(null!=resultDto.getSatisfication()){ + // 满意度评价。-1不满意,0基本满意,1非常满意 + switch(resultDto.getSatisfication()) + { + case -1: + resultDto.setSatisficationName("不满意"); + break; + case 0: + resultDto.setSatisficationName("基本满意"); + break; + case 1: + resultDto.setSatisficationName("非常满意"); + break; + default: + resultDto.setSatisficationName(StrConstant.EPMETY_STR); + break; + } + } + return resultDto; } @Override @Transactional(rollbackFor = Exception.class) - public void save(LingshanOfficeHallServiceRecordDTO dto) { + public String save(LingshanOfficeHallServiceRecordDTO dto) { LingshanOfficeHallServiceRecordEntity entity = ConvertUtils.sourceToTarget(dto, LingshanOfficeHallServiceRecordEntity.class); entity.setStatus(NumConstant.ZERO_STR); if (StringUtils.isNotBlank(dto.getApplicantOrgId())) { @@ -95,7 +127,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< // 本条数据属于网格 entity.setOrgId(gridInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); @@ -103,7 +135,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); // 本条数据属于组织 entity.setOrgId(agencyInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } } else { @@ -113,6 +145,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setOrgIdPath(CustomerOrgRedis.getOrgIdPath(entity.getOrgId(), entity.getOrgType())); } insert(entity); + return entity.getId(); } @Override @@ -126,7 +159,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setApplicantOrgName(gridInfoCache.getGridNamePath()); // 本条数据属于网格 entity.setOrgId(gridInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } else if (OrgTypeEnum.AGENCY.getCode().equals(dto.getApplicantOrgType())) { AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(dto.getApplicantOrgId()); @@ -134,7 +167,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< entity.setApplicantOrgName(agencyInfoCache.getOrganizationName()); // 本条数据属于组织 entity.setOrgId(agencyInfoCache.getId()); - entity.setOrgType(dto.getOrgType()); + entity.setOrgType(dto.getApplicantOrgType()); entity.setOrgIdPath(entity.getApplicantOrgIdPath()); } } else { From a4bae4cc59b3480ca662363a48e2cbb19581f65d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:29:46 +0800 Subject: [PATCH 22/26] =?UTF-8?q?=E5=8E=BB=E6=8E=89111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java index 208ea845e0..8e43d3739b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java @@ -119,7 +119,7 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") - @NotNull(message = "申请日期1111不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) private Date applicantTime; /** From ef533b8c3708a36e16ea8a638074ff1fa9ae8ac4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:39:38 +0800 Subject: [PATCH 23/26] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E3=80=81=E7=BB=93=E6=9D=9F=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E3=80=81=E5=8A=9E=E7=BB=93=E5=BC=80=E5=A7=8B=E3=80=81=E5=8A=9E?= =?UTF-8?q?=E7=BB=93=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ingshanOfficeHallServiceRecordPageFormDTO.java | 15 +++++++++++++-- .../dao/LingshanOfficeHallServiceRecordDao.java | 6 ++++-- ...ingshanOfficeHallServiceRecordServiceImpl.java | 7 ++++++- .../mapper/LingshanOfficeHallServiceRecordDao.xml | 14 ++++++++++---- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java index 9f6102afff..2edc3a6b2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/lingshan/LingshanOfficeHallServiceRecordPageFormDTO.java @@ -24,16 +24,27 @@ public class LingshanOfficeHallServiceRecordPageFormDTO extends PageFormDTO { * 满意度评价。-1不满意,0基本满意,1非常满意 */ private Integer satisfication; + + /** + * 申请开始日期 + */ + private String applicantStartDate; + + /** + * 申请结束日期 + */ + private String applicantEndDate; + /** * 办结日期 */ // @DateTimeFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd") - private String startDate; + private String closeStartDate; // @DateTimeFormat(pattern = "yyyy-MM-dd") // @JsonFormat(pattern = "yyyy-MM-dd") - private String endDate; + private String closeEndDate; /** * 未办结:0;已办结:1 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java index 51cc8bc63b..d19c69460d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LingshanOfficeHallServiceRecordDao.java @@ -22,7 +22,9 @@ public interface LingshanOfficeHallServiceRecordDao extends BaseDao resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, formDTO.getCategoryCode(), formDTO.getContent(), formDTO.getSatisfication(), formDTO.getStartDate(), formDTO.getEndDate(), formDTO.getStatus()); + List resultList = baseDao.pageList(formDTO.getCustomerId(), orgIdPath, + formDTO.getCategoryCode(), formDTO.getContent(), + formDTO.getSatisfication(), + formDTO.getApplicantStartDate(), formDTO.getApplicantEndDate(), + formDTO.getCloseStartDate(), formDTO.getCloseEndDate(), + formDTO.getStatus()); if (CollectionUtils.isNotEmpty(resultList)) { Result> categoryRes = adminOpenFeignClient.dictMap(DictTypeEnum.LINGSHAN_OFFICE_HALL_SERVICE_RECORD.getCode()); resultList.forEach(dto -> { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml index 2b09eaf521..47beac5b32 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LingshanOfficeHallServiceRecordDao.xml @@ -31,11 +31,17 @@ and r.STATUS = #{status} - - AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{startDate} + + AND DATE_FORMAT(r.APPLICANT_TIME,'%Y-%m-%d') >= #{applicantStartDate} - - AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') #{endDate} + + AND DATE_FORMAT(r.APPLICANT_TIME,'%Y-%m-%d') #{applicantEndDate} + + + AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') >= #{closeStartDate} + + + AND DATE_FORMAT(r.CLOSE_TIME,'%Y-%m-%d') #{closeEndDate} ORDER BY R.CREATED_TIME DESC From ffcaa6495cd1179db02e78ffce89106a6f788c1c Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 16 May 2023 14:49:11 +0800 Subject: [PATCH 24/26] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=B1=BB=E5=9E=8B=E6=95=B0=E9=87=8F=E5=88=86=E6=9E=90?= =?UTF-8?q?+=E4=BB=A3=E5=8A=9E=E6=9C=8D=E5=8A=A1=E8=B6=8B=E5=8A=BF?= =?UTF-8?q?=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgentServiceTrendAnalysisRstDTO.java | 57 ++++++++++++ .../LingShanScreenServiceRstDTO.java | 9 ++ ...eenAgentServiceCategoryAnalysisRstDTO.java | 20 +++++ .../LingShanAgentServiceController.java | 36 +++++++- .../LingshanAgentServiceRecordEntity.java | 2 + .../service/LingShanAgentServiceService.java | 4 + .../impl/LingShanAgentServiceServiceImpl.java | 90 +++++++++++++++++++ 7 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceTrendAnalysisRstDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenAgentServiceCategoryAnalysisRstDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceTrendAnalysisRstDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceTrendAnalysisRstDTO.java new file mode 100644 index 0000000000..effdcdb01f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/AgentServiceTrendAnalysisRstDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.result.agentservice; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @Description + * { + * "time":"1月", + * "data":[ + * { + * "name": "受理数", + * "value": 140 + * }, + * { + * "name": "办结率", + * "value": 95.3 + * } + * ] + * }, + * @Author wangxianzhang + * @Time 2023/5/16 1:38 PM + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AgentServiceTrendAnalysisRstDTO { + // 1月 + private String time; + + // + private List data; + + public static class DataObj { + private String name; + private Integer value; + + public DataObj() { + } + + public DataObj(String name, Integer value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public Integer getValue() { + return value; + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java index 77d3b3b4e1..4669c0a2ce 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/LingShanScreenServiceRstDTO.java @@ -17,4 +17,13 @@ public class LingShanScreenServiceRstDTO { private Date createdTime; private String agentName; private String agentMobile; + + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenAgentServiceCategoryAnalysisRstDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenAgentServiceCategoryAnalysisRstDTO.java new file mode 100644 index 0000000000..2d08f0285e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/agentservice/ScreenAgentServiceCategoryAnalysisRstDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.agentservice; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Description 灵山大屏:服务类别统计分析 + * @Author wangxianzhang + * @Time 2023/5/16 12:48 PM + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ScreenAgentServiceCategoryAnalysisRstDTO { + + private String name; + private Integer value; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java index f46630f11f..e6cbb2311e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/LingShanAgentServiceController.java @@ -270,8 +270,8 @@ public class LingShanAgentServiceController { /** * @Description: 大屏中央:服务列表 * @param orgType: - * @param orgId: - * @param dataType: agnet service_unclosed service_closed + * @param orgId: + * @param dataType: agnet service_unclosed service_closed * @Return com.epmet.commons.tools.utils.Result * @Author: wangxianzhang * @Date: 2023/5/15 7:56 PM @@ -285,4 +285,36 @@ public class LingShanAgentServiceController { return new Result>().ok(rl); } + /** + * @Description: 服务类型数量分析 + * @param orgType: + * @param orgId: + * @Return com.epmet.commons.tools.utils.Result + * @Author: wangxianzhang + * @Date: 2023/5/16 12:47 PM + */ + @GetMapping("screen/serviceCategoryAnalysis") + public Result> serviceCategoryAnalysis(@RequestParam("orgType") String orgType, + @RequestParam("orgId") String orgId) { + + List rl = lingShanServiceAgentService.serviceCategoryAnalysis(orgType, orgId); + return new Result>().ok(rl); + } + + /** + * @Description: 代办服务趋势分析 + * @param orgType: + * @param orgId: + * @Return com.epmet.commons.tools.utils.Result> + * @Author: wangxianzhang + * @Date: 2023/5/16 1:39 PM + */ + @GetMapping("screen/serviceTrendAnalysis") + public Result> serviceTrendAnalysis(@RequestParam("orgType") String orgType, + @RequestParam("orgId") String orgId) { + + List rl = lingShanServiceAgentService.serviceTrendAnalysis(orgType, orgId); + return new Result>().ok(rl); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java index a4d3a8c67e..a7c0798f70 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LingshanAgentServiceRecordEntity.java @@ -128,4 +128,6 @@ public class LingshanAgentServiceRecordEntity extends BaseEpmetEntity { */ private String latitude; + private transient int qty = 0; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java index 04872b4797..adbcb0bbcd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LingShanAgentServiceService.java @@ -34,4 +34,8 @@ public interface LingShanAgentServiceService { List screenAgentList(String orgType, String orgId); List screenServiceList(String orgType, String orgId, String dataType); + + List serviceCategoryAnalysis(String orgType, String orgId); + + List serviceTrendAnalysis(String orgType, String orgId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java index ae354b0ba6..7f96edbca9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingShanAgentServiceServiceImpl.java @@ -1,7 +1,9 @@ package com.epmet.service.impl; +import cn.hutool.http.useragent.UserAgentInfo; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.LingShanAgentServiceProcessStatusEnum; import com.epmet.commons.tools.constant.ServiceConstant; @@ -19,6 +21,7 @@ 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.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.PidUtils; import com.epmet.constant.OrgInfoConstant; @@ -527,7 +530,94 @@ public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceServ d.setApplicantName(rec.getApplicantName()); d.setApplicantMobile(rec.getContactMobile()); d.setAgentName(rec.getAgentName()); + d.setLongitude(rec.getLongitude()); + d.setLatitude(rec.getLatitude()); return d; }).collect(Collectors.toList()); } + + @Override + public List serviceCategoryAnalysis(String orgType, String orgId) { + + String orgIdPath; + if (OrgInfoConstant.AGENCY.equals(orgType)) { + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(agencyInfo.getId(), agencyInfo.getPids()); + } else { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(orgId); + orgIdPath = PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids()); + } + + LambdaQueryWrapper q = new QueryWrapper().select(" service_category, count(*) qty ") + .lambda() + .likeRight(LingshanAgentServiceRecordEntity::getOrgIdPath, orgIdPath) + .groupBy(LingshanAgentServiceRecordEntity::getServiceCategory); + + Map categoryAndData = + agentServiceRecordDao.selectList(q).stream().collect(Collectors.toMap(LingshanAgentServiceRecordEntity::getServiceCategory, Function.identity())); + + LambdaQueryWrapper cq = new LambdaQueryWrapper<>(); + cq.eq(LingshanAgentServiceCategoryEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId()); + + List cateogries = agentServiceCategoryDao.selectList(cq); + + return cateogries.stream().map(c -> { + LingshanAgentServiceRecordEntity data = categoryAndData.get(c.getId()); + return new ScreenAgentServiceCategoryAnalysisRstDTO(c.getCategoryName(), data.getQty()); + }).collect(Collectors.toList()); + } + + @Override + public List serviceTrendAnalysis(String orgType, String orgId) { + + // 计算得到时间列表 + Map dateCatelogue = generateTimeCatelogue(); + + // 为了能使用索引,只能循环查询每个时间段的了,否则就要加一列日期,就这样吧 + return dateCatelogue.entrySet().stream().map(entry -> { + String monthName = entry.getKey(); + Date timeStart = entry.getValue()[0]; + Date timeEnd = entry.getValue()[1]; + + // 1.受理数 + // 受理数,使用processTime计算,processTime可用于表示受理时间和驳回时间。要查询受理数,要查询状态为已受理和已结案两种状态,使用processTime+processStatus结合查询 + LambdaQueryWrapper rq = new LambdaQueryWrapper<>(); + rq.ge(LingshanAgentServiceRecordEntity::getProcessTime, timeStart); + rq.le(LingshanAgentServiceRecordEntity::getProcessTime, timeEnd); + rq.in(LingshanAgentServiceRecordEntity::getProcessStatus, + LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode(), LingShanAgentServiceProcessStatusEnum.CLOSED.getStatusCode()); + Integer acceptCount = agentServiceRecordDao.selectCount(rq); + + // 2.办结率 todo + + // 3.组合数据 + ArrayList dataList = new ArrayList<>(); + dataList.add(new AgentServiceTrendAnalysisRstDTO.DataObj("受理数", acceptCount)); + dataList.add(new AgentServiceTrendAnalysisRstDTO.DataObj("办结率", 0)); + AgentServiceTrendAnalysisRstDTO rd = new AgentServiceTrendAnalysisRstDTO(monthName, dataList); + return rd; + }).collect(Collectors.toList()); + } + + /** + * @Description: 计算时间目录 + * @param : + * @Return java.util.Map + * @Author: wangxianzhang + * @Date: 2023/5/16 1:53 PM + */ + public Map generateTimeCatelogue() { + Date startDate = DateUtils.addDateMonths(new Date(), -11); + HashMap rm = new LinkedHashMap<>(); + + for (int c = 1; c <= 12; c++) { + Date monthStart = DateUtils.getMonthStart(startDate); + Date monthEnd = DateUtils.getMonthEnd(startDate); + rm.put(DateUtils.format(startDate, "MM") + "月", new Date[]{monthStart, monthEnd}); + + startDate = DateUtils.addDateMonths(startDate, 1); + } + + return rm; + } } \ No newline at end of file From 1de6db04393e659325149c2789c7671c593eaf84 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 14:53:28 +0800 Subject: [PATCH 25/26] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E3=80=81=E7=BB=93=E6=9D=9F=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E3=80=81=E5=8A=9E=E7=BB=93=E5=BC=80=E5=A7=8B=E3=80=81=E5=8A=9E?= =?UTF-8?q?=E7=BB=93=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LingshanOfficeHallServiceRecordServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java index 565d54dae3..af2b6fa237 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LingshanOfficeHallServiceRecordServiceImpl.java @@ -74,7 +74,7 @@ public class LingshanOfficeHallServiceRecordServiceImpl extends BaseServiceImpl< }); } PageInfo pageInfo = new PageInfo<>(resultList); - return new PageData<>(resultList, pageInfo.getTotal()); + return new PageData<>(resultList, pageInfo.getTotal(),formDTO.getPageSize()); } /** From a6585ea3cd31166869d22fa3917073f3c6a1b379 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 16 May 2023 15:08:32 +0800 Subject: [PATCH 26/26] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=8D=E5=A1=AB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java index 8e43d3739b..aa455a6e0a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LingshanOfficeHallServiceRecordDTO.java @@ -8,7 +8,6 @@ import org.hibernate.validator.constraints.Length; import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -119,7 +118,7 @@ public class LingshanOfficeHallServiceRecordDTO implements Serializable { */ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @DateTimeFormat(pattern = "yyyy-MM-dd") - @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) + // @NotNull(message = "申请日期不能为空",groups = {AddShowGroup.class,UpdateShowGroup.class}) private Date applicantTime; /**