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 1/3] =?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 2/3] =?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 3/3] =?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