From 7564ef74fc34e12f1bded6576438ed7e4028b9ab Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 27 Aug 2021 16:36:19 +0800 Subject: [PATCH 01/60] =?UTF-8?q?=E6=88=91=E6=94=B6=E5=88=B0=E7=9A=84sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/epmetmessage/InfoProfileDao.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml index 8c31bdcbb8..f93f3198d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml @@ -75,9 +75,9 @@ SELECT ir.INFO_ID, ip.content, - ii.CREATED_TIME, + ip.CREATED_TIME, ir.READ_FLAG, - ii.publish_staff_id, + ip.publish_staff_id, ip.first_att_id, ia.ATTACHMENT_NAME AS name, ia.ATTACHMENT_FORMAT AS format, @@ -91,18 +91,20 @@ end) as duration FROM info_receivers ir - INNER JOIN info ii ON ( ir.INFO_ID = ii.ID ) - INNER JOIN info_profile ip ON ( ii.ID = ip.INFO_ID AND ip.DEL_FLAG = '0' ) + + INNER JOIN info ii ON ( ir.INFO_ID = ii.ID ) + + INNER JOIN info_profile ip ON ( ir.INFO_ID = ip.INFO_ID AND ip.DEL_FLAG = '0' ) LEFT JOIN info_att ia on ( ip.first_att_id = ia.id AND ia.DEL_FLAG = '0' ) WHERE ir.DEL_FLAG = '0' - AND ii.DEL_FLAG = '0' AND ir.STAFF_ID = #{userId} + AND ii.DEL_FLAG = '0' and ii.content like concat('%',trim(#{content}),'%') ORDER BY - ii.CREATED_TIME DESC + ip.CREATED_TIME DESC - SELECT - agency.USER_ID - FROM - CUSTOMER_STAFF_AGENCY agency - WHERE - agency.DEL_FLAG = '0' - AND agency.AGENCY_ID = ( SELECT - PID + agency.user_id FROM - CUSTOMER_GRID + customer_staff_agency agency + INNER JOIN staff_org_relation sor ON agency.user_id = sor.staff_id AND sor.org_type = 'agency' WHERE - DEL_FLAG = '0' - AND ID = #{gridId}) - - AND agency.USER_ID NOT IN ( - SELECT - USER_ID - FROM - CUSTOMER_STAFF_GRID - WHERE - DEL_FLAG = '0' - AND - GRID_ID = #{gridId} ) + agency.del_flag = '0' + AND agency.agency_id = ( + SELECT + pid + FROM + customer_grid + WHERE + del_flag = '0' + AND id = #{gridId} + ) + AND agency.user_id NOT IN ( + SELECT + user_id + FROM + customer_staff_grid + WHERE + del_flag = '0' + AND + grid_id = #{gridId} + ) From b1e3614c5a0135be195135302ef77c018a8364f7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 31 Aug 2021 14:00:28 +0800 Subject: [PATCH 14/60] =?UTF-8?q?=E5=86=8D=E6=AC=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eenProjectCategoryOrgDailyServiceImpl.java | 63 +++++++++++-------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index eaabf75cc0..cd771a5a9f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; @@ -365,7 +366,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level); - log.info("分类标签:"+categoryProjectResultDTOS); + log.info("分类标签:{}"+JSON.toJSONString(categoryProjectResultDTOS)); List belongGridInfos = gridService.selectBelongGridInfo(customerId, level); if (!CollectionUtils.isEmpty(belongGridInfos)){ // 存在直属网格 @@ -405,29 +406,38 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl customerIds = relationInfo.stream().map(m -> m.getCustomerId()).collect(Collectors.toList()); + // 子客户单独存一份【三个街道的】 + List sonCustomerList = new ArrayList<>(); // 父客户存在的分类 List categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true); - log.info("父客户存在的分类"+categoryProjectExists); - // 这时的result集合要清空,因为被上边使用 【result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);】 - result.clear(); -/* List finalResult = result; - groupByCategoryCode.forEach((code, list) -> { - ScreenProjectCategoryOrgDailyEntity e = new ScreenProjectCategoryOrgDailyEntity(); - e.setCustomerId(customerId); - e.setCategoryOriginCustomerId(customerId); - e.setCategoryCode(code); - e.setOrgId(entity.getAgencyId()); - e.setProjectTotal(CollectionUtils.isEmpty(list) ? NumConstant.ZERO : list.stream().collect(Collectors.summingInt(CategoryProjectResultDTO::getProjectTotal))); - e.setPid(entity.getPid()); - e.setPids(StringUtils.isEmpty(entity.getPids()) ? NumConstant.ZERO_STR : entity.getPids()); - // 因为根据categoryCode分组,所以level都一样,取第一条的 - e.setLevel(list.get(NumConstant.ZERO).getLevel()); - finalResult.add(e); - });*/ + log.info("父客户存在的分类{}"+ JSON.toJSONString(categoryProjectExists)); + // 父客户不存在的分类 + List categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false); + log.info("父客户不存在的分类{}"+ JSON.toJSONString(categoryProjectNotExists)); + if (!CollectionUtils.isEmpty(categoryProjectExists)){ + sonCustomerList.addAll(categoryProjectExists); + } + if (!CollectionUtils.isEmpty(categoryProjectNotExists)){ + sonCustomerList.addAll(categoryProjectNotExists); + } + if (!CollectionUtils.isEmpty(sonCustomerList)){ + List finalSonResult = result; + sonCustomerList.forEach(s -> { + ScreenProjectCategoryOrgDailyEntity e = ConvertUtils.sourceToTarget(s, ScreenProjectCategoryOrgDailyEntity.class); + e.setOrgType(ScreenConstant.STREET); + e.setDateId(dateId); + e.setPid(entity.getPid()); + e.setCustomerId(customerId); + finalSonResult.add(e); + }); + result.addAll(finalSonResult); + } // 内部客户与外部客户 相同的分类累加 if (!CollectionUtils.isEmpty(categoryProjectExists)){ categoryProjectResultDTOS.forEach(f -> { @@ -449,22 +459,23 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl> groupByStatus = categoryProjectExists.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus)); if (!CollectionUtils.isEmpty(groupByStatus.get(false))){ List entities = ConvertUtils.sourceToTarget(groupByStatus.get(false), ScreenProjectCategoryOrgDailyEntity.class); + entities.forEach(e -> { + e.setOrgId(entity.getAgencyId()); + }); result.addAll(entities); } - log.info("父客户存在的分类,但是未使用的分类:"+groupByStatus.get(false)); - log.info("父客户存在的分类,但是未使用的分类,组合后:"+result); - // 父客户不存在的分类 - List categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false); if (!CollectionUtils.isEmpty(categoryProjectNotExists)){ List entities = ConvertUtils.sourceToTarget(categoryProjectNotExists, ScreenProjectCategoryOrgDailyEntity.class); + entities.forEach(e -> { + e.setOrgId(entity.getAgencyId()); + }); result.addAll(entities); } - log.info("父客户不存在的分类:"+categoryProjectNotExists); } } // 目前不考虑计算子客户组织直接创建的项目,只算内部客户 @@ -509,7 +520,7 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl Date: Tue, 31 Aug 2021 14:03:11 +0800 Subject: [PATCH 15/60] =?UTF-8?q?=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectCategoryOrgDailyDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml index 40b9b158af..e6293d01f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -47,7 +47,7 @@ From 70a8406ac3ef305ad6d50f20866a1b104533d084 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 31 Aug 2021 15:03:27 +0800 Subject: [PATCH 17/60] =?UTF-8?q?=E5=86=8D=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index 23f44b8184..902981793a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -436,7 +436,6 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl Date: Tue, 31 Aug 2021 17:38:23 +0800 Subject: [PATCH 18/60] =?UTF-8?q?=E7=BB=84=E7=BB=87/=E9=83=A8=E9=97=A8/?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0=E4=B8=8D=E8=83=BD=E8=B6=85?= =?UTF-8?q?=E8=BF=8720=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/AddAgencyFormDTO.java | 2 +- .../com/epmet/dto/form/AddDepartmentFormDTO.java | 12 +++++++----- .../java/com/epmet/dto/form/AddGridFormDTO.java | 15 +++++++++++---- .../com/epmet/dto/form/EditAgencyFormDTO.java | 2 +- .../com/epmet/dto/form/EditDepartmentFormDTO.java | 12 +++++++----- .../java/com/epmet/dto/form/EditGridFormDTO.java | 15 +++++++++++---- .../epmet/controller/DepartmentController.java | 4 ++-- .../java/com/epmet/controller/GridController.java | 2 ++ 8 files changed, 42 insertions(+), 22 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java index a177306a68..7a5e6b5537 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyFormDTO.java @@ -45,7 +45,7 @@ public class AddAgencyFormDTO implements Serializable { * 机构组织名称 */ @NotBlank(message = "组织名称不能为空") - @Length(max=50,message = "机构名称不能超过50个字") + @Length(max=20,message = "机构名称不能超过20个字") private String agencyName; /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java index 30f74015ca..5a582535c6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java @@ -16,6 +16,7 @@ package com.epmet.dto.form; * along with this program. If not, see . */ +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -31,20 +32,21 @@ import java.io.Serializable; public class AddDepartmentFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** * 所属组织机构ID(customer_agency.id) */ - @NotBlank(message = "组织机构Id不能为空") + @NotBlank(message = "组织机构Id不能为空",groups = AddDepartmentFormDTO.AddDept.class) private String agencyId; - /** * 部门名称 */ - @NotBlank(message = "部门名称不能为空") - @Length(max=120,message = "部门名称不能超过120个字") + @NotBlank(message = "部门名称不能为空",groups = AddDepartmentFormDTO.AddDept.class) + @Length(max=20,message = "部门名称不能超过20个字",groups = AddDepartmentFormDTO.AddDept.class) private String departmentName; + public interface AddDept extends CustomerClientShowGroup { + } + /** * 部门职责 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java index 95df5fca15..a9473e218e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,16 +15,20 @@ import java.io.Serializable; public class AddGridFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 新建网格名称 + */ + @NotBlank(message = "网格名称不能为空") + @Length(max=20,message = "网格名称不能超过20个字",groups = AddGridFormDTO.AddGrid.class) + private String gridName; /** * 机构id */ private String agencyId; - /** - * 新建网格名称 - */ - private String gridName; + public interface AddGrid extends CustomerClientShowGroup { + } /** * 管辖区域 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index 66984fc62e..f279164095 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -50,7 +50,7 @@ public class EditAgencyFormDTO implements Serializable { * 机关组织名称 */ @NotBlank(message = "机关组织名称不能为空") - @Length(max=50,message = "机构名称不能超过50个字",groups = DefaultUserShowGroup.class) + @Length(max=20,message = "机构名称不能超过20个字",groups = DefaultUserShowGroup.class) private String agencyName; /** diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java index d87c0081a0..5d59b289f0 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -33,20 +34,21 @@ import java.io.Serializable; public class EditDepartmentFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** * 部门Id */ - @NotBlank(message = "部门ID不能为空") + @NotBlank(message = "部门ID不能为空",groups = EditDepartmentFormDTO.EditDept.class) private String departmentId; - /** * 部门名称 */ - @NotBlank(message = "部门名称不能为空") - @Length(max=120,message = "部门名称不能超过120个字") + @NotBlank(message = "部门名称不能为空",groups = EditDepartmentFormDTO.EditDept.class) + @Length(max=20,message = "部门名称不能超过20个字",groups = EditDepartmentFormDTO.EditDept.class) private String departmentName; + public interface EditDept extends CustomerClientShowGroup { + } + /** * 部门职责 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java index b22e5048f9..0ad04c404d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,6 +15,12 @@ import java.io.Serializable; public class EditGridFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 网格名称 + */ + @NotBlank(message = "网格名称不能为空") + @Length(max=20,message = "网格名称不能超过20个字",groups = EditGridFormDTO.EditGrid.class) + private String gridName; /** * gridId 网格id @@ -23,10 +32,8 @@ public class EditGridFormDTO implements Serializable { */ private String agencyId; - /** - * 网格名称 - */ - private String gridName; + public interface EditGrid extends CustomerClientShowGroup { + } /** * 管理区域 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java index e0d76fc5b4..186cae52b6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/DepartmentController.java @@ -52,7 +52,7 @@ public class DepartmentController { @PostMapping("adddepartment") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_DEPARTMENT_CREATE) public Result addDepartment(@LoginUser TokenDto tokenDTO, @RequestBody AddDepartmentFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, AddDepartmentFormDTO.AddDept.class); return departmentService.addDepartment(formDTO); } @@ -65,7 +65,7 @@ public class DepartmentController { @PostMapping("editdepartment") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_DEPARTMENT_UPDATE) public Result editDepartment(@LoginUser TokenDto tokenDTO, @RequestBody EditDepartmentFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, EditDepartmentFormDTO.EditDept.class); return departmentService.editDepartment(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 4940768e7d..daf3c835cc 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -46,6 +46,7 @@ public class GridController { @PostMapping("addgrid") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_CREATE) public Result addGrid(@LoginUser TokenDto tokenDto, @RequestBody AddGridFormDTO addGridFormDTO){ + ValidatorUtils.validateEntity(addGridFormDTO, AddGridFormDTO.AddGrid.class); return customerGridService.addGrid(tokenDto,addGridFormDTO); } @@ -56,6 +57,7 @@ public class GridController { @PostMapping("editgrid") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_UPDATE) public Result editGrid(@LoginUser TokenDto tokenDto, @RequestBody EditGridFormDTO editGridFormDTO){ + ValidatorUtils.validateEntity(editGridFormDTO, EditGridFormDTO.EditGrid.class); return customerGridService.editGrid(tokenDto,editGridFormDTO); } From b5d66cebfd9e596c416375de261be6142c69ec2f Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 31 Aug 2021 21:34:53 +0800 Subject: [PATCH 19/60] =?UTF-8?q?1.=E6=8F=90=E5=8F=96openapi-sdk=202.?= =?UTF-8?q?=E8=B0=83=E6=95=B4third=20apiService=E7=9B=B8=E5=85=B3=E9=80=BB?= =?UTF-8?q?=E8=BE=91=203.=E5=AE=8C=E6=88=90=E6=8E=A8=E9=80=81component=20a?= =?UTF-8?q?ccess=20token=E5=88=B0=E7=A7=81=E6=9C=89=E5=8C=96=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 22 ++ .../src/main/resources/bootstrap.yml | 1 + .../epmet/constant/ThirdPlatformActions.java | 6 + .../result/ThirdPlatformActionsResultDTO.java | 19 ++ .../privateepmet/GetAccessTokenResultDTO.java | 18 ++ .../com/epmet/feign/ThirdOpenFeignClient.java | 22 ++ .../ThirdOpenFeignClientFallback.java | 12 + .../java/com/epmet/apiservice/ApiService.java | 246 +++++++++++++++--- .../epmet/apiservice/impl/DemoApiService.java | 18 +- .../impl/LuzhouGridPlatformApiService.java | 49 ++-- .../impl/PingyinPrivateEpmetApiService.java | 169 ++++++++++++ .../controller/PrivateEpmetController.java | 50 ++++ .../com/epmet/controller/TestConttroller.java | 30 +++ .../com/epmet/dao/ThirdplatformActionDao.java | 10 + .../dao/ThirdplatformCustomerRegisterDao.java | 10 + .../com/epmet/redis/ThirdPlatformCache.java | 19 ++ .../service/ComponentVerifyTicketService.java | 3 + .../epmet/service/PrivateEpmetService.java | 19 ++ .../epmet/service/ThirdPlatformService.java | 10 + .../ComponentVerifyTicketServiceImpl.java | 203 +++++++++------ .../service/impl/PrivateEpmetServiceImpl.java | 71 +++++ .../impl/ThirdPlatformServiceImpl.java | 6 + .../mapper/ThirdplatformActionDao.xml | 17 ++ .../ThirdplatformCustomerRegisterDao.xml | 14 + epmet-openapi/epmet-openapi-sdk/pom.xml | 15 ++ .../epmet/openapi/sdk/encrypt/Md5Util.java | 133 ++++++++++ .../openapi/sdk/sign/OpenApiSignUtils.java | 109 ++++++++ epmet-openapi/pom.xml | 1 + 28 files changed, 1160 insertions(+), 142 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ThirdPlatformActionsResultDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/privateepmet/GetAccessTokenResultDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PrivateEpmetController.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/TestConttroller.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/ThirdPlatformCache.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PrivateEpmetService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PrivateEpmetServiceImpl.java create mode 100644 epmet-openapi/epmet-openapi-sdk/pom.xml create mode 100644 epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java create mode 100644 epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/sign/OpenApiSignUtils.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 046802e321..0b965cf2da 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -440,6 +440,28 @@ public class RedisKeys { return rootPrefix.concat("thirdplatform:accesstoken:").concat(platformId); } + /** + * @Description 第三方平台信息key + * @param platformId + * @return java.lang.String + * @author wxz + * @date 2021.08.31 14:44:35 + */ + public static String getThirdPlatformInfoKey(String platformId) { + return rootPrefix.concat("thirdplatform:info:").concat(platformId); + } + + /** + * @Description 第三方平台操作urlkey + * @param platformId + * @return java.lang.String + * @author wxz + * @date 2021.08.31 15:15:15 + */ + public static String getThirdPlatformActionUrlKey(String platformId) { + return rootPrefix.concat("thirdplatform:actions:").concat(platformId); + } + /** * @return 设置组员已读、未读标识 * @param source :act notice diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 91552a59b1..4f65034c7d 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -495,6 +495,7 @@ epmet: - /data/stats/project/** - /data/stats/basereport/** - /data/stats/governance/** + - /third/private-epmet/push-component-access-token # 对外开放接口认证白名单 diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdPlatformActions.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdPlatformActions.java index dc17deca39..bd0875b2e2 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdPlatformActions.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/constant/ThirdPlatformActions.java @@ -19,4 +19,10 @@ public interface ThirdPlatformActions { */ String UPLOAD_FILE = "UPLOAD_FILE"; + /** 推送 微信component access token */ + String PUSH_COMPONENT_ACCESS_TOKEN = "PUSH_COMPONENT_ACCESS_TOKEN"; + + /** 推送 微信 authorizer access token */ + String PUSH_AUTHORIZER_ACCESS_TOKEN = "PUSH_AUTHORIZER_ACCESS_TOKEN"; + } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ThirdPlatformActionsResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ThirdPlatformActionsResultDTO.java new file mode 100644 index 0000000000..a1a81ee406 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ThirdPlatformActionsResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description 第三方平台及其支持的action result + * @author wxz + * @date 2021.08.30 17:06:42 +*/ +@Data +public class ThirdPlatformActionsResultDTO { + + private String platformId; + private String platformKey; + private String platformName; + private String actionKey; + private String apiUrl; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/privateepmet/GetAccessTokenResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/privateepmet/GetAccessTokenResultDTO.java new file mode 100644 index 0000000000..e2cc8ab4c3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/privateepmet/GetAccessTokenResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.privateepmet; + +import lombok.Data; + +/** + * @Description 获取accesstoken结果 + * @author wxz + * @date 2021.08.30 17:40:25 +*/ +@Data +public class GetAccessTokenResultDTO { + + // token + private String accessToken; + // 有效时长 + private Long expireTime; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java index 9cfd126d4c..d4efa88cc9 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java @@ -2,6 +2,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO; import com.epmet.dto.form.ThirdPlatformFormDTO; import com.epmet.dto.result.ThirdplatformResultDTO; @@ -35,4 +37,24 @@ public interface ThirdOpenFeignClient { */ @PostMapping("/third/thirdplatform/customer/list-available-platforms-by-action") Result> listAvailablePlatformsByCustomerAndAction(@RequestBody ThirdPlatformFormDTO input); + + /** + * @Description 私有化平台接收component-access推送 + * @param input + * @return com.epmet.commons.tools.utils.Result + * @author wxz + * @date 2021.08.30 16:40:17 + */ + @PostMapping("/third/private-epmet/push-component-access-token") + Result pushComponentAccessToken(@RequestBody ComponentAccessTokenFormDTO input); + + /** + * @Description 接收推送AuthorizerTokens + * @param input + * @return com.epmet.commons.tools.utils.Result + * @author wxz + * @date 2021.08.30 16:36:02 + */ + @PostMapping("/third/private-epmet/push-authorizer-tokens") + Result pushAuthorizerTokens(@RequestBody AuthorizerAccessTokenFormDTO input); } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java index 76098de169..b6929b9883 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java @@ -3,6 +3,8 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO; import com.epmet.dto.form.ThirdPlatformFormDTO; import com.epmet.dto.result.ThirdplatformResultDTO; @@ -22,4 +24,14 @@ public class ThirdOpenFeignClientFallback implements ThirdOpenFeignClient { public Result> listAvailablePlatformsByCustomerAndAction(ThirdPlatformFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "listAvailablePlatformsByCustomerAndAction", input); } + + @Override + public Result pushComponentAccessToken(ComponentAccessTokenFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "pushComponentAccessToken", input); + } + + @Override + public Result pushAuthorizerTokens(AuthorizerAccessTokenFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "pushAuthorizerTokens", input); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/ApiService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/ApiService.java index 36117287e1..a43689e321 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/ApiService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/ApiService.java @@ -1,7 +1,8 @@ package com.epmet.apiservice; +import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; -import com.epmet.apiservice.result.LZGridPlatformBaseResult; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.utils.HttpClientManager; @@ -10,19 +11,21 @@ import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.dao.ThirdplatformActionDao; import com.epmet.dao.ThirdplatformCustomerRegisterDao; import com.epmet.dao.ThirdplatformDao; -import com.epmet.dto.form.ProjectApplyAssistFormDTO; -import com.epmet.dto.form.TPFDemoFormDTO; -import com.epmet.dto.form.UploadFileFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.ProjectAssistResult; import com.epmet.dto.result.UploadFileResultDTO; import com.epmet.entity.ThirdplatformActionEntity; import com.epmet.entity.ThirdplatformCustomerRegisterEntity; import com.epmet.entity.ThirdplatformEntity; +import com.epmet.redis.ThirdPlatformCache; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import java.io.File; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -32,7 +35,7 @@ import java.util.concurrent.TimeUnit; * 此抽象类中定义方法的具体返回类型,所有子类都要统一使用,在具体实现中做转换。若是不需要返回,返回null即可。 */ @Slf4j -public abstract class ApiService { +public abstract class ApiService { /** * 重试次数 */ @@ -61,13 +64,13 @@ public abstract class ApiService { * @param headers * @return */ - public String sendGetRequest(String platformId, String action, Map params, Map headers) { + public R sendGetRequest(String platformId, String action, Map params, Map headers) { // 1.获取token String accessToken = getAccessToken(platformId); //2.获取url - ThirdplatformEntity thirdplatform = SpringContextUtils.getBean(ThirdplatformDao.class).selectById(platformId); - ThirdplatformActionEntity actionEntity = SpringContextUtils.getBean(ThirdplatformActionDao.class) - .getByPlatformIdAndActionKey(platformId, action); + ThirdPlatformCache thirdPlatformInfo = getThirdPlatformInfo(platformId); + String actionUrl = getThirdPlatformActionUrl(platformId, action); + if (headers == null) { headers = new HashMap<>(); @@ -76,8 +79,8 @@ public abstract class ApiService { // 填充access token到头当中 headers.put("X-Access-Token", accessToken); log.info("apiService sendGetRequest param:{},headers:{}",params,headers); - Result result = HttpClientManager.getInstance().sendGet(thirdplatform.getBaseUrl().concat(actionEntity.getApiUrl()), - thirdplatform.getBaseUrl().startsWith("https://"), + Result result = HttpClientManager.getInstance().sendGet(thirdPlatformInfo.getBaseUrl().concat(actionUrl), + thirdPlatformInfo.getBaseUrl().startsWith("https://"), params, headers); log.info("apiService sendGetRequest result:{}",JSON.toJSONString(result)); @@ -87,37 +90,51 @@ public abstract class ApiService { if (result.success()) { throw new RenException("请求第三方平台,获取AccessToken失败。"); } - LZGridPlatformBaseResult platformResult = JSON.parseObject(result.getData(), LZGridPlatformBaseResult.class); - judgeResultSuccess(platformResult); - return result.getData(); + return parsePlatformResponseResult(result.getData(), String.class); } + /** + * @Description + accesstoken header名称。如果不需要AccessToken,与getAccessToken()方法共同返回null即可 + * @return java.lang.String + * @author wxz + * @date 2021.08.30 14:06:26 + */ + public abstract String getAccessTokenHeaderName(); + /** * 发送post请求 * @param platformId * @param action * @param jsonString * @param headers - * @return + * @return 平台对应返回值的Result类 */ - public String sendPostRequest(String platformId, String action, String jsonString, Map headers) { + public R sendPostRequest(String platformId, String action, String jsonString, Map headers, Map urlParams) { // 1.获取token String accessToken = getAccessToken(platformId); //2.获取url - ThirdplatformEntity thirdplatform = SpringContextUtils.getBean(ThirdplatformDao.class).selectById(platformId); - ThirdplatformActionEntity actionEntity = SpringContextUtils.getBean(ThirdplatformActionDao.class) - .getByPlatformIdAndActionKey(platformId, action); + ThirdPlatformCache platformFromCache = getThirdPlatformInfo(platformId); + String actionUrl = getThirdPlatformActionUrl(platformId, action); if (headers == null) { headers = new HashMap<>(); } // 填充access token到头当中 - headers.put("X-Access-Token", accessToken); + if (StringUtils.isNotBlank(accessToken)) { + //headers.put("X-Access-Token", accessToken); + String accessTokenHeaderName = getAccessTokenHeaderName(); + if (StringUtils.isBlank(accessTokenHeaderName)) { + throw new RenException("没有指定AccessToken的Header名字"); + } + headers.put(accessTokenHeaderName, accessToken); + } log.info("apiService sendPostRequest param:{},headers:{}",jsonString,headers); - Result result = HttpClientManager.getInstance().sendPost(thirdplatform.getBaseUrl().concat(actionEntity.getApiUrl()), - thirdplatform.getBaseUrl().startsWith("https://"), + String urlParmsStr = this.convertQueryParams2String(urlParams); + Result result = HttpClientManager.getInstance().sendPost(platformFromCache.getBaseUrl().concat(actionUrl).concat(urlParmsStr), + platformFromCache.getBaseUrl().startsWith("https://"), jsonString, headers); log.info("apiService sendPostRequest result:{}",JSON.toJSONString(result)); @@ -128,12 +145,10 @@ public abstract class ApiService { throw new RenException("请求第三方平台,发送Post请求失败。错误信息:" + result.getMsg()); } - LZGridPlatformBaseResult platformResult = JSON.parseObject(result.getData(), LZGridPlatformBaseResult.class); - judgeResultSuccess(platformResult); - return result.getData(); + return parsePlatformResponseResult(result.getData(), String.class); } - public String sendPostRequestToUploadFile(String platformId, String action, File file, String fileName) { + public R sendPostRequestToUploadFile(String platformId, String action, File file, String fileName) { // 1.获取token String accessToken = getAccessToken(platformId); //2.获取url @@ -159,8 +174,6 @@ public abstract class ApiService { throw new RenException("请求第三方平台,发送Post请求失败。错误信息:" + result.getMsg()); } - LZGridPlatformBaseResult platformResult = JSON.parseObject(result.getData(), LZGridPlatformBaseResult.class); - // token过期重试逻辑,先不加 //if ("402".equals(platformResult.getCode())) { // // 如果token过期 @@ -168,8 +181,37 @@ public abstract class ApiService { // getAccessToken(platformId); // return sendPostRequest(platformId, action, jsonString, headers); //} - judgeResultSuccess(platformResult); - return result.getData(); + return parsePlatformResponseResult(result.getData(), String.class); + } + + /** + * @Description 将url参数拼接为字符串 + * @param queryParams + * @return java.lang.String + * @author wxz + * @date 2021.08.31 14:08:17 + */ + protected String convertQueryParams2String(Map queryParams) { + try { + if (queryParams == null || queryParams.size() == 0) { + return ""; + } + StringBuilder sb = new StringBuilder(""); + queryParams.entrySet().forEach(entry -> { + String key = entry.getKey(); + String value = entry.getValue(); + sb.append("&").append(key).append("=").append(value); + }); + String result = sb.toString(); + if (result.startsWith("&")) { + result = result.substring(1); + return "?".concat(result); + } + return ""; + } catch (Exception e) { + log.warn("gateway中将url参数转化为String失败,程序继续执行,错误信息:".concat(ExceptionUtils.getErrorStackTrace(e))); + return ""; + } } /** @@ -202,6 +244,36 @@ public abstract class ApiService { stringRedisTemplate.opsForValue().set(RedisKeys.getThirdPlatformAccessTokenKey(platformId), accessToken, expire, timeUnit); } + /** + * @Description 将第三方平台信息存入缓存 + * @param cache + * @return void + * @author wxz + * @date 2021.08.31 14:55:48 + */ + protected void addPlatformToCache(ThirdPlatformCache cache) { + RedisTemplate stringRedisTemplate = SpringContextUtils.getBean("redisTemplate", RedisTemplate.class); + Map stringObjectMap = BeanUtil.beanToMap(cache); + stringRedisTemplate.opsForHash().putAll(RedisKeys.getThirdPlatformInfoKey(cache.getPlatformId()), stringObjectMap); + } + + /** + * @Description 从缓存中取第三方平台信息 + * @param thirdPlatformKey + * @return com.epmet.redis.ThirdPlatformCache + * @author wxz + * @date 2021.08.31 14:55:28 + */ + protected ThirdPlatformCache getPlatformFromCache(String thirdPlatformKey) { + HashOperations hashOperations = SpringContextUtils.getBean("redisTemplate", RedisTemplate.class).opsForHash(); + Map entries = hashOperations.entries(RedisKeys.getThirdPlatformInfoKey(thirdPlatformKey)); + if (entries.size() == 0) { + return null; + } + ThirdPlatformCache thirdPlatformCache = BeanUtil.mapToBean(entries, ThirdPlatformCache.class, true); + return thirdPlatformCache; + } + /** * @Description 从缓存中取token * @return @@ -210,7 +282,87 @@ public abstract class ApiService { */ protected String getAccessTokenFromCache(String platformId) { RedisTemplate stringRedisTemplate = SpringContextUtils.getBean("redisTemplate", RedisTemplate.class); - return stringRedisTemplate.opsForValue().get(platformId); + return stringRedisTemplate.opsForValue().get(RedisKeys.getThirdPlatformAccessTokenKey(platformId)); + } + + /** + * @Description 从缓存查询第三方平台操作url + * @param platformId + * @param action + * @return java.lang.String + * @author wxz + * @date 2021.08.31 15:18:06 + */ + protected String getThirdPlatformActionUrlFromCache(String platformId, String action) { + HashOperations ops = SpringContextUtils.getBean("redisTemplate", RedisTemplate.class).opsForHash(); + String url = ops.get(RedisKeys.getThirdPlatformActionUrlKey(platformId), action); + return url; + } + + /** + * @Description 将第三方平台操作url添加至缓存 + * @param platformId + * @param map + * @return java.lang.String + * @author wxz + * @date 2021.08.31 15:20:45 + */ + protected void addThirdPlatformActionUrlsToCache(String platformId, Map map) { + String redisKey = RedisKeys.getThirdPlatformActionUrlKey(platformId); + + RedisTemplate redisTemplate = SpringContextUtils.getBean("redisTemplate", RedisTemplate.class); + HashOperations ops = redisTemplate.opsForHash(); + ops.putAll(redisKey, map); + } + + /** + * @Description 从缓存里面读取平台信息,如果缓存中没有,从db读取,放入缓存 + * @param platformId 平台id + * @return com.epmet.redis.ThirdPlatformCache + * @author wxz + * @date 2021.08.31 15:02:19 + */ + protected ThirdPlatformCache getThirdPlatformInfo(String platformId) { + ThirdPlatformCache platform = getPlatformFromCache(platformId); + if (platform == null) { + platform = new ThirdPlatformCache(); + ThirdplatformEntity platformEntity = SpringContextUtils.getBean(ThirdplatformDao.class).selectById(platformId); + platform.setPlatformId(platformEntity.getId()); + platform.setApiService(platformEntity.getApiService()); + platform.setBaseUrl(platformEntity.getBaseUrl()); + platform.setPlatformKey(platformEntity.getPlatformKey()); + platform.setPlatformName(platformEntity.getPlatformName()); + platform.setPlatformSecret(platformEntity.getPlatformSecret()); + addPlatformToCache(platform); + } + return platform; + } + + /** + * @Description 获取第三放平台操作url。优先读取缓存,没有则读取db + * @param platformId + * @param actionKey + * @return java.util.Map + * @author wxz + * @date 2021.08.31 15:21:39 + */ + protected String getThirdPlatformActionUrl(String platformId, String actionKey) { + String url = getThirdPlatformActionUrlFromCache(platformId, actionKey); + if (StringUtils.isBlank(url)) { + List actions = SpringContextUtils.getBean(ThirdplatformActionDao.class) + .listPlatformActions(platformId); + + Map map = new HashMap<>(actions.size()); + // 将action:url映射至map + for (ThirdplatformActionEntity a : actions) { + map.put(a.getActionKey(), a.getApiUrl()); + if (actionKey.equals(a.getActionKey())) { + url = a.getApiUrl(); + } + } + addThirdPlatformActionUrlsToCache(platformId, map); + } + return url; } /** @@ -246,16 +398,38 @@ public abstract class ApiService { } /** - * @Description 判断第三方平台返回结果成功失败。如果失败,则抛出异常 - * @return + * @Description 解析第三方平台返回结果 + * @param resultString + * @param clazz R的泛型对象T的clazz + * @return R 泛型,不同平台的Result DTO类型 * @author wxz - * @date 2021.03.22 10:32 - */ - public abstract void judgeResultSuccess(LZGridPlatformBaseResult result); + * @date 2021.08.31 13:36:11 + */ + public abstract R parsePlatformResponseResult(String resultString, Class clazz); public UploadFileResultDTO uploadFile(UploadFileFormDTO formDTO) { return null; } + /** + * @Description 推送ComponentAccessToken + * @param form + * @return void 保持空实现,让子类去实现 + * @author wxz + * @date 2021.08.30 17:15:01 + */ + public void pushComponentAccessToken(ComponentAccessTokenFormDTO form, String platformId, String platformKey) {} + + /** + * @description 推送小程序token + * + * @param form + * @param platformId + * @param platformKey + * @return + * @author wxz + * @date 2021.08.31 20:26:51 + */ + public void pushAuthorizerAccessToken(AuthorizerAccessTokenFormDTO form, String platformId, String platformKey) {}; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/DemoApiService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/DemoApiService.java index 63f718a0d5..ed06d5059a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/DemoApiService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/DemoApiService.java @@ -14,10 +14,15 @@ import org.springframework.stereotype.Component; * demo api service */ @Component(value = "demoApiService") -public class DemoApiService extends ApiService { +public class DemoApiService extends ApiService { Logger logger = LoggerFactory.getLogger(DemoApiService.class); + @Override + public String getAccessTokenHeaderName() { + return null; + } + @Override public String getAccessToken(String platformId) { return null; @@ -29,8 +34,15 @@ public class DemoApiService extends ApiService { return null; } + /** + * @Description 解析平台返回结果 + * @param resultString 平台返回结果string + * @return java.lang.String + * @author wxz + * @date 2021.08.30 22:43:24 + */ @Override - public void judgeResultSuccess(LZGridPlatformBaseResult result) { - + public String parsePlatformResponseResult(String resultString, Class clazz) { + return null; } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/LuzhouGridPlatformApiService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/LuzhouGridPlatformApiService.java index abbaad2255..dee2cd8137 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/LuzhouGridPlatformApiService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/LuzhouGridPlatformApiService.java @@ -31,7 +31,12 @@ import java.util.concurrent.TimeUnit; */ @Slf4j @Component("luzhouGridPlatformApiService") -public class LuzhouGridPlatformApiService extends ApiService { +public class LuzhouGridPlatformApiService extends ApiService { + + @Override + public String getAccessTokenHeaderName() { + return "X-Access-Token"; + } @Override public String getAccessToken(String platformId) { @@ -58,11 +63,8 @@ public class LuzhouGridPlatformApiService extends ApiService { throw new RenException("请求第三方平台,获取AccessToken失败。"); } - LZGridPlatformBaseResult platformResult = JSON.parseObject(result.getData(), LZGridPlatformBaseResult.class); - judgeResultSuccess(platformResult); - - token = platformResult.getResult(); - addAccessTokenToCache(platformId, token, (long)(3600*1.8*1000), TimeUnit.MILLISECONDS); + LZGridPlatformBaseResult lzGridPlatformBaseResult = parsePlatformResponseResult(result.getData(), String.class); + addAccessTokenToCache(platformId, lzGridPlatformBaseResult.getResult(), (long)(3600*1.8*1000), TimeUnit.MILLISECONDS); } return token; } @@ -83,30 +85,24 @@ public class LuzhouGridPlatformApiService extends ApiService { // 正式调用第三方平台 String argsStr = JSON.toJSONString(formDTO); - String result = sendPostRequest(platformId, ThirdPlatformActions.PROJECT_ASSIST, argsStr, null); + LZGridPlatformBaseResult result = sendPostRequest(platformId, ThirdPlatformActions.PROJECT_ASSIST, argsStr, null, null); // 开发阶段临时写死 //String result = "{\"eventId\":\"test-task-id\"}"; ProjectAssistResult projectAssistResult = new ProjectAssistResult(); - if (!StringUtils.isBlank(result)) { - // 此处要经过一系列业务处理,将第三方平台返回的数据进行解析,等处理最后转换成ProjectAssistResult类型,返回。ProjectAssistResult这个类型是 - // 所有apiService的projectAssist方法返回值的统一类型,是我们的epmet-cloud所需要的数据的实体, - // 所有apiService都要想办法转化成这个类型。 - LZGridPlatformBaseResult lzResult = JSON.parseObject(result, LZGridPlatformBaseResult.class); - - // 此处设置为第三方系统返回的唯一id - projectAssistResult.setTaskId(lzResult.getResult()); - } + // 此处设置为第三方系统返回的唯一id + projectAssistResult.setTaskId(result.getResult()); log.info("projectAssist 泸州网格化平台项目协助发送成功"); return projectAssistResult; } @Override - public void judgeResultSuccess(LZGridPlatformBaseResult result) { - //LZGridPlatformBaseResult; - if (!"200".equalsIgnoreCase(result.getCode())) { - throw new RenException("泸州网格化平台:返回失败结果,错误码:" + result.getCode()); + public LZGridPlatformBaseResult parsePlatformResponseResult(String resultString, Class clazz) { + LZGridPlatformBaseResult baseResult = JSON.parseObject(resultString, LZGridPlatformBaseResult.class); + if (!"200".equalsIgnoreCase(baseResult.getCode())) { + throw new RenException("泸州网格化平台:返回失败结果,错误码:" + baseResult.getCode()); } + return baseResult; } @Override @@ -118,16 +114,9 @@ public class LuzhouGridPlatformApiService extends ApiService { // 正式调用第三方平台 File file = new File(formDTO.getFile().getOriginalFilename()); FileUtils.copyInputStreamToFile(formDTO.getFile().getInputStream(), file); - String result = sendPostRequestToUploadFile(platformId, ThirdPlatformActions.UPLOAD_FILE, file, fileName); - if (!StringUtils.isBlank(result)) { - // 此处要经过一系列业务处理,将第三方平台返回的数据进行解析,等处理最后转换成ProjectAssistResult类型,返回。ProjectAssistResult这个类型是 - // 所有apiService的projectAssist方法返回值的统一类型,是我们的epmet-cloud所需要的数据的实体, - // 所有apiService都要想办法转化成这个类型。 - LZGridPlatformBaseResult lzResult = JSON.parseObject(result, LZGridPlatformBaseResult.class); - - // 此处设置为第三方系统返回的唯一id - resultDTO.setUrl((String) lzResult.getResult()); - } + LZGridPlatformBaseResult baseResult = sendPostRequestToUploadFile(platformId, ThirdPlatformActions.UPLOAD_FILE, file, fileName); + // 此处设置为第三方系统返回的唯一id + resultDTO.setUrl(baseResult.getResult()); System.out.println("泸州网格化平台项目文件上传成功"); } catch (Exception e) { throw new RenException("上传失败"); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java new file mode 100644 index 0000000000..da62386442 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/apiservice/impl/PingyinPrivateEpmetApiService.java @@ -0,0 +1,169 @@ +package com.epmet.apiservice.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import com.epmet.apiservice.ApiService; +import com.epmet.commons.tools.exception.EpmetErrorCode; +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.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ThirdPlatformActions; +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; +import com.epmet.dto.result.privateepmet.GetAccessTokenResultDTO; +import com.epmet.openapi.sdk.sign.OpenApiSignUtils; +import com.epmet.redis.ThirdPlatformCache; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +@Component("pingyinPrivateEpmetApiService") +@Slf4j +public class PingyinPrivateEpmetApiService extends ApiService implements ResultDataResolver { + + // 认证方式 + private String authType = "take_token"; + + @Override + public String getAccessTokenHeaderName() { + return "AccessToken"; + } + + @Override + public String getAccessToken(String platformId) { + String accessTokenFromCache = super.getAccessTokenFromCache(platformId); + if (StringUtils.isBlank(accessTokenFromCache)) { + ThirdPlatformCache thirdPlatformInfo = super.getThirdPlatformInfo(platformId); + String apiUrl = getThirdPlatformActionUrl(platformId, ThirdPlatformActions.GET_ACCESS_TOKEN); + String baseUrl = thirdPlatformInfo.getBaseUrl(); + String platformKey = thirdPlatformInfo.getPlatformKey(); + String platformSecret = thirdPlatformInfo.getPlatformSecret(); + String uuid = UUID.randomUUID().toString(); + long currentTimeMillis = System.currentTimeMillis(); + + try { + String sign = createSign(platformKey, platformSecret, uuid, currentTimeMillis, authType, null); + log.info("【调用平阴私有化平台获取AccessToken】参数列表:sign:{}, app_id:{}, auth_type:{}, nonce:{}, timestamp:{}", sign, platformKey, platformSecret, uuid, currentTimeMillis); + String urlParams = super.convertQueryParams2String(constructCommonUrlParamsMap(platformKey, authType, uuid, currentTimeMillis, sign)); + String requestUrl = baseUrl.concat(apiUrl).concat(urlParams); + Result stringResult = HttpClientManager.getInstance().sendPostByHttps(requestUrl, "{}"); + String remoteResultString = getResultDataOrThrowsException(stringResult, "【调用平阴私有化平台获取AccessToken】", EpmetErrorCode.SERVER_ERROR.getCode(), null); + Result remoteResult = parsePlatformResponseResult(remoteResultString, GetAccessTokenResultDTO.class); + log.info("【调用平阴私有化平台获取AccessToken】结果:{}", remoteResultString); + accessTokenFromCache = remoteResult.getData().getAccessToken(); + //(15 * 60 * 1000)为提前获取token。对方token有效期2小时,我们设置有效期为1小时45分钟,留15分钟容错时间,防止时间差 + long expire = remoteResult.getData().getExpireTime() - System.currentTimeMillis() - (15 * 60 * 1000); + super.addAccessTokenToCache(platformId, accessTokenFromCache, expire, TimeUnit.MILLISECONDS); + } catch (Exception e) { + throw new RenException(ExceptionUtils.getErrorStackTrace(e)); + } + } + return accessTokenFromCache; + } + + /** + * @Description 创建签名 + * @param platformKey + * @param platformSecret + * @param nonce + * @param timeMillis + * @param authType + * @return java.lang.String + * @author wxz + * @date 2021.08.31 15:37:58 + */ + private String createSign(String platformKey, String platformSecret, String nonce, Long timeMillis, String authType, Map requestBodyMap) { + HashMap contentMap = new HashMap<>(); + contentMap.put("app_id", platformKey); + contentMap.put("auth_type", authType); + contentMap.put("nonce", nonce); + contentMap.put("timestamp", String.valueOf(timeMillis)); + + if (requestBodyMap != null && requestBodyMap.size() > 0) { + contentMap.putAll(requestBodyMap); + } + + String sign; + try { + sign = OpenApiSignUtils.createSign(contentMap, platformSecret); + } catch (Exception e) { + String detail = ExceptionUtils.getErrorStackTrace(e); + log.error(detail); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "【平阴私有化平台apService】创建签名失败"); + } + return sign; + } + + /** + * @Description 构造url参数map + * @param platformKey + * @param authType + * @param nonce + * @param timeMillis + * @param sign + * @return java.util.Map + * @author wxz + * @date 2021.08.31 14:19:41 + */ + private Map constructCommonUrlParamsMap(String platformKey, String authType, String nonce, Long timeMillis, String sign) { + HashMap map = new HashMap<>(); + map.put("app_id", platformKey); + map.put("auth_type", authType); + map.put("nonce", nonce); + map.put("timestamp", String.valueOf(timeMillis)); + map.put("sign", sign); + return map; + } + + @Override + public Result parsePlatformResponseResult(String resultString, Class clazz) { + Result result; + try { + result = JSON.parseObject(resultString, new TypeReference>(clazz){}); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + log.error(errorStackTrace); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "【调用平阴私有化服务器,解析返回结果失败】"); + } + if (!result.success()) { + throw new RenException(String.format("【请求平阴私有化平台】失败,返回结果string:%s", resultString)); + } + return result; + } + + @Override + public void pushComponentAccessToken(ComponentAccessTokenFormDTO form, String platformId, String platformKey) { + ThirdPlatformCache thirdPlatformInfo = getThirdPlatformInfo(platformId); + String nonce = UUID.randomUUID().toString(); + long timeMillis = System.currentTimeMillis(); + + Map bodyMap = null; + try { + bodyMap = ConvertUtils.entityToMap(form); + } catch (Exception e) { + String detail = ExceptionUtils.getErrorStackTrace(e); + log.error(detail); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "【推送ComponentAccessToken】requestBody转化为map失败"); + } + + String sign = createSign(platformKey, thirdPlatformInfo.getPlatformSecret(), nonce, timeMillis, authType, bodyMap); + Map urlParams = constructCommonUrlParamsMap(platformKey, authType, nonce, timeMillis, sign); + + String jsonString = JSON.toJSONString(form); + Result result = super.sendPostRequest(platformId, ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN, jsonString, null, urlParams); + getResultDataOrThrowsException(result, "【平阴私有化平台】推送ComponentAccessToken", EpmetErrorCode.SERVER_ERROR.getCode(), null); + } + + @Override + public void pushAuthorizerAccessToken(AuthorizerAccessTokenFormDTO form, String platformId, String platformKey) { + + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PrivateEpmetController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PrivateEpmetController.java new file mode 100644 index 0000000000..1135562069 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PrivateEpmetController.java @@ -0,0 +1,50 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; +import com.epmet.service.PrivateEpmetService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description 私有化平台相关controller + * @author wxz + * @date 2021.08.30 15:18:51 +*/ +@RestController +@RequestMapping("/private-epmet") +public class PrivateEpmetController { + + @Autowired + private PrivateEpmetService privateEpmetService; + + /** + * @Description 接收推送component access + * @param input + * @return com.epmet.commons.tools.utils.Result + * @author wxz + * @date 2021.08.30 15:18:57 + */ + @PostMapping("push-component-access-token") + public Result pushComponentAccessToken(@RequestBody ComponentAccessTokenFormDTO input) { + privateEpmetService.pushComponentAccessToken(input); + return new Result(); + } + + /** + * @Description 接收推送AuthorizerTokens + * @param input + * @return com.epmet.commons.tools.utils.Result + * @author wxz + * @date 2021.08.30 16:36:02 + */ + @PostMapping("push-authorizer-tokens") + public Result pushAuthorizerTokens(@RequestBody AuthorizerAccessTokenFormDTO input) { + privateEpmetService.pushAuthorizerTokens(input); + return new Result(); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/TestConttroller.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/TestConttroller.java new file mode 100644 index 0000000000..f5d81f987d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/TestConttroller.java @@ -0,0 +1,30 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; +import com.epmet.service.ComponentVerifyTicketService; +import com.epmet.service.PrivateEpmetService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +@RestController +@RequestMapping("test") +public class TestConttroller { + + @Autowired + private ComponentVerifyTicketService componentVerifyTicketService; + + @PostMapping("push-component-access-token") + public Result testPushComponentAccessToken() { + ComponentAccessTokenFormDTO form = new ComponentAccessTokenFormDTO(); + form.setComponentAccessToken("token..."); + form.setExpiresInTime(new Date()); + componentVerifyTicketService.pushComponentAccessToken2PrivateEpmetPlatforms(form); + return new Result(); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformActionDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformActionDao.java index 50de9d3629..405ae52529 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformActionDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformActionDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.ThirdplatformActionEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * * @@ -38,4 +40,12 @@ public interface ThirdplatformActionDao extends BaseDao listPlatformActions(@Param("platformId") String platformId); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerRegisterDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerRegisterDao.java index 3dc3001baf..5f1fe6f038 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerRegisterDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerRegisterDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.PlatformUnregisterFormDTO; +import com.epmet.dto.result.ThirdPlatformActionsResultDTO; import com.epmet.entity.ThirdplatformCustomerRegisterEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -55,4 +56,13 @@ public interface ThirdplatformCustomerRegisterDao extends BaseDao + * @author wxz + * @date 2021.08.30 17:07:32 + */ + List listPlatformsByActionKey(@Param("actionKey") String actionKey); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/ThirdPlatformCache.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/ThirdPlatformCache.java new file mode 100644 index 0000000000..c8c3409bc2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/ThirdPlatformCache.java @@ -0,0 +1,19 @@ +package com.epmet.redis; + +import lombok.Data; + +/** + * @Description 第三方平台缓存对象 + * @author wxz + * @date 2021.08.31 14:41:49 +*/ +@Data +public class ThirdPlatformCache { + //String platformKey, String platformSecret, String platformName, String apiService, String baseUrl + private String platformId; + private String platformKey; + private String platformSecret; + private String platformName; + private String apiService; + private String baseUrl; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java index 28cfae2fde..8d3ce45cbf 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java @@ -2,6 +2,7 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.form.AuthCodeAndTimeFromDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; import org.springframework.web.bind.annotation.RequestBody; import javax.servlet.http.HttpServletRequest; @@ -48,4 +49,6 @@ public interface ComponentVerifyTicketService { */ void redirectUri(TokenDto tokenDto, @RequestBody AuthCodeAndTimeFromDTO fromDTO); + public void pushComponentAccessToken2PrivateEpmetPlatforms(ComponentAccessTokenFormDTO input); + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PrivateEpmetService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PrivateEpmetService.java new file mode 100644 index 0000000000..3ab6a0b870 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PrivateEpmetService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; + +public interface PrivateEpmetService { + void pushAuthorizerTokens(AuthorizerAccessTokenFormDTO input); + + /** + * @Description 推送component access token + * @param input + * @return void + * @author wxz + * @date 2021.08.30 16:17:48 + */ + void pushComponentAccessToken(ComponentAccessTokenFormDTO input); + + void pushVerifyTicket(String ticket); +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java index 570ce04d49..33224b3497 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java @@ -5,6 +5,7 @@ import com.epmet.dto.form.CustomerFormDTO; import com.epmet.dto.form.ThirdPlatformFormDTO; import com.epmet.dto.form.PlatformRegisterFormDTO; import com.epmet.dto.form.PlatformUnregisterFormDTO; +import com.epmet.dto.result.ThirdPlatformActionsResultDTO; import com.epmet.dto.result.ThirdplatformResultDTO; import java.util.List; @@ -100,4 +101,13 @@ public interface ThirdPlatformService { * @Date 10:15 2021-04-09 **/ void registerThirdPlatformCustomer(PlatformRegisterFormDTO formDTO); + + /** + * @Description 已知操作的key,查询哪些app可以做此操作 + * @param actionKey + * @return java.util.List + * @author wxz + * @date 2021.08.30 16:59:13 + */ + List listPlatformsByActionKey(String actionKey); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java index a23d9ac77f..2ac3e225b2 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java @@ -4,12 +4,15 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.nacos.client.config.utils.IOUtils; import com.dingtalk.api.request.OapiRobotSendRequest; +import com.epmet.apiservice.ApiService; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; 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.constant.ModuleConstant; +import com.epmet.constant.ThirdPlatformActions; import com.epmet.constant.ThirdRedisKeyConstant; import com.epmet.constant.ThirdRunTimeInfoConstant; import com.epmet.dao.*; @@ -21,7 +24,9 @@ import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.mpaes.WXBizMsgCrypt; import com.epmet.mpaes.WXXmlToMapUtil; import com.epmet.redis.RedisThird; +import com.epmet.service.ApiServiceSelector; import com.epmet.service.ComponentVerifyTicketService; +import com.epmet.service.ThirdPlatformService; import com.epmet.wxapi.constant.WxMaCodeConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -47,7 +52,7 @@ import static com.epmet.constant.ThirdRunTimeInfoConstant.*; */ @Slf4j @Service -public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketService { +public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketService, ApiServiceSelector { @Autowired private RedisThird redisThird; @@ -94,6 +99,9 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe @Autowired private PaCustomerDao paCustomerDao; + @Autowired + private ThirdPlatformService thirdPlatformService; + @Value("${third.platform.appId}") private String componentAppId; @Value("${third.platform.appSecret}") @@ -104,8 +112,8 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe private String token; /** - * @Description 获得授权事件的票据 * @param + * @Description 获得授权事件的票据 * @author zxc */ @Transactional(rollbackFor = Exception.class) @@ -123,23 +131,23 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe String nonce = request.getParameter(ModuleConstant.NONCE); String encryptType = request.getParameter(ModuleConstant.ENCRYPT_TYPE); String signature = request.getParameter(ModuleConstant.SIGNATURE); - log.info(String.format(ThirdRunTimeInfoConstant.VERIFY_TICKET,msgSignature,timeStamp,nonce,encryptType,signature)); + log.info(String.format(ThirdRunTimeInfoConstant.VERIFY_TICKET, msgSignature, timeStamp, nonce, encryptType, signature)); // 从请求中读取整个post数据 InputStream inputStream; String postData = null; inputStream = request.getInputStream(); - postData= IOUtils.toString(inputStream,ModuleConstant.UTF8); - WXBizMsgCrypt wxBizMsgCrypt = new WXBizMsgCrypt(token,aesKey,componentAppId); + postData = IOUtils.toString(inputStream, ModuleConstant.UTF8); + WXBizMsgCrypt wxBizMsgCrypt = new WXBizMsgCrypt(token, aesKey, componentAppId); String msg = wxBizMsgCrypt.decryptMsg(msgSignature, timeStamp, nonce, postData); - log.info(String.format(ThirdRunTimeInfoConstant.MSG,msg)); + log.info(String.format(ThirdRunTimeInfoConstant.MSG, msg)); // 将xml转为map Map result = WXXmlToMapUtil.xmlToMap(msg); String infotype = result.get(ModuleConstant.INFO_TYPE); - log.info(String.format(ThirdRunTimeInfoConstant.INFO_TYPE,infotype)); - switch (infotype){ + log.info(String.format(ThirdRunTimeInfoConstant.INFO_TYPE, infotype)); + switch (infotype) { case ModuleConstant.TICKET_UNDERLINE_KEY: //接收票据 【component_verify_ticket】 String ComponentVerifyTicket = result.get(ModuleConstant.TICKET_KEY); - log.info(String.format(COMPONENT_VERIFY_TICKET,ComponentVerifyTicket)); + log.info(String.format(COMPONENT_VERIFY_TICKET, ComponentVerifyTicket)); // 缓存 ticket redisThird.setComponentVerifyTicket(ComponentVerifyTicket); // 存数据库 @@ -149,7 +157,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe //先逻辑删 ticketDao.deleteOldComponentVerifyTicket(); ticketDao.insertComponentVerifyTicket(ticketFormDTO); - log.info(ModuleConstant.TICKET_UNDERLINE_KEY+":"+ComponentVerifyTicket); + log.info(ModuleConstant.TICKET_UNDERLINE_KEY + ":" + ComponentVerifyTicket); break; case ModuleConstant.AUTHORIZED: //授权成功 this.disposeAuthResult(result); @@ -173,7 +181,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } log.info(ThirdRunTimeInfoConstant.END_TICKET); Integer tokenCount = componentAccessTokenDao.selectAccessTokenCount(); - if (tokenCount == NumConstant.ZERO){ + if (tokenCount == NumConstant.ZERO) { String accessTokenCountFlag = ModuleConstant.ACCOUNT_TOKEN_FLAG_ONE; this.getComponentAccessToken(accessTokenCountFlag); } @@ -181,14 +189,14 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 授权结果插入 * @param result + * @Description 授权结果插入 * @author zxc */ @Transactional(rollbackFor = Exception.class) - public void disposeAuthResult(Map result){ + public void disposeAuthResult(Map result) { Map tempMap = result; - Map data = tempMap; + Map data = tempMap; AuthResultRecordFormDTO authResultRecord = ConvertUtils.mapToEntity(data, AuthResultRecordFormDTO.class); authResultRecord.setWechatCreateTime(this.sToDate(result.get(ModuleConstant.CREATE_TIME))); if (result.containsKey(ModuleConstant.AUTHORIZATION_CODE_EXPIRED_TIME)) { @@ -199,9 +207,9 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 定时获取 (令牌,component_access_token) 第三方与微信交互使用的component_access_token - * 每十分钟执行一次,判断是否有马上超时的(15分钟以内算马上超时) * @param accessTokenCountFlag 表里的 component_access_token的数量 + * @Description 定时获取 (令牌,component_access_token) 第三方与微信交互使用的component_access_token + * 每十分钟执行一次,判断是否有马上超时的(15分钟以内算马上超时) * @author zxc */ @Transactional(rollbackFor = Exception.class) @@ -218,7 +226,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); jsonObject.put(ModuleConstant.COMPONENT_APPSECRET, appSecret); jsonObject.put(ModuleConstant.TICKET_UNDERLINE_KEY, componentVerifyTicket); - log.info(String.format(ThirdRunTimeInfoConstant.COMPONENT_ACCESS_TOKEN,componentVerifyTicket)); + log.info(String.format(ThirdRunTimeInfoConstant.COMPONENT_ACCESS_TOKEN, componentVerifyTicket)); String post = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_COMPONENT_TOKEN_URL, JSON.toJSONString(jsonObject)).getData(); Map hashMap = JSON.parseObject(post, Map.class); if (!hashMap.containsKey(ModuleConstant.ERR_MSG)) { @@ -236,6 +244,13 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe componentAccessTokenDao.insertComponentAccessToken(formDTO); //存缓存 redisThird.setComponentAccessToken(componentAccessToken); + //推送到私有化平台们 + try { + pushComponentAccessToken2PrivateEpmetPlatforms(formDTO); + } catch (Exception e) { + String detail = ExceptionUtils.getErrorStackTrace(e); + log.error(detail); + } } else { throw new RenException(ThirdRunTimeInfoConstant.FAILURE_ACCESS_TOKEN); } @@ -245,8 +260,29 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 获取预授权码 + * @param input + * @return void + * @Description 推送component access token到私有化平台 + * @author wxz + * @date 2021.08.30 17:12:15 + */ + public void pushComponentAccessToken2PrivateEpmetPlatforms(ComponentAccessTokenFormDTO input) { + List platforms = thirdPlatformService.listPlatformsByActionKey(ThirdPlatformActions.PUSH_COMPONENT_ACCESS_TOKEN); + platforms.stream().forEach(p -> { + log.info("推送component-access-token到私有化平台:platformId:{}, platformKey:{}, platformName:{}, apiUrl:{}", p.getPlatformId(), p.getPlatformKey(), p.getPlatformName(), p.getApiUrl()); + ApiService apiService = selectApiService(p.getPlatformId()); + try { + apiService.pushComponentAccessToken(input, p.getPlatformId(), p.getPlatformKey()); + } catch (Exception e) { + String detail = ExceptionUtils.getErrorStackTrace(e); + log.error(detail); + } + }); + } + + /** * @param + * @Description 获取预授权码 * @author zxc */ @Transactional(rollbackFor = Exception.class) @@ -258,7 +294,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe JSONObject jsonObject = new JSONObject(); jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); String post = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_CREATE_PREAUTHCODE_URL + accessToken, JSON.toJSONString(jsonObject)).getData(); - log.info(String.format(POST_RESULT,post)); + log.info(String.format(POST_RESULT, post)); Map hashMap = JSON.parseObject(post, Map.class); if (!hashMap.containsKey(ModuleConstant.ERR_MSG)) { preAuthCode = hashMap.get(ModuleConstant.PRE_AUTH_CODE).toString(); @@ -283,11 +319,11 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 使用授权码获取授权信息 请求参数:【component_access_token、component_appid、authorization_code】 + * @Description 使用授权码获取授权信息 请求参数:【component_access_token、component_appid、authorization_code】 * @author zxc */ @Transactional(rollbackFor = Exception.class) - public AuthorizationInfoResultDTO authInfoByAuthCode(String authCode,String customerId,String clientType) { + public AuthorizationInfoResultDTO authInfoByAuthCode(String authCode, String customerId, String clientType) { log.info(START_GET_AUTH_INFO); AuthorizationInfoResultDTO authorizationInfoResultDTO = new AuthorizationInfoResultDTO(); // 获取令牌【component_access_token】 @@ -297,11 +333,11 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); jsonObject.put(ModuleConstant.AUTHORIZATION_CODE, authCode); String authInfo = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_QUERY_AUTH_URL + accessToken, JSON.toJSONString(jsonObject)).getData(); - HashMap hashMap = JSON.parseObject(authInfo, HashMap.class); + HashMap hashMap = JSON.parseObject(authInfo, HashMap.class); Map map = hashMap.get(ModuleConstant.AUTHORIZATION_INFO); authorizationInfoResultDTO = ConvertUtils.mapToEntity(map, AuthorizationInfoResultDTO.class); String authAppId = authorizationInfoResultDTO.getAuthorizer_appid(); - log.info("授权信息:"+map); + log.info("授权信息:" + map); String expiresIn = authorizationInfoResultDTO.getExpires_in().toString(); Date expiresInTime = this.countExpirationTime(expiresIn); //授权信息分为两张表,基础信息authorization_info,授权列表func_info @@ -314,14 +350,14 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe authInfoDTO.setCustomerId(customerId); authInfoDTO.setClientType(clientType); List func_info = authorizationInfoResultDTO.getFunc_info(); - log.info("权限列表信息:"+func_info); + log.info("权限列表信息:" + func_info); String funcInfo = JSON.toJSONString(func_info); authInfoDTO.setFuncInfo(funcInfo); //先逻辑删除,在插入 authorizationInfoDao.updateOldAuthorizationInfo(authAppId); authorizationInfoDao.insertAuthorizationInfo(authInfoDTO); // 授权信息放入缓存 - redisThird.setAuthInfo(authorizationInfoResultDTO,customerId,clientType); + redisThird.setAuthInfo(authorizationInfoResultDTO, customerId, clientType); //authorizer_refresh_token 放入缓存 redisThird.setAuthorizerRefreshToken(authInfoDTO); log.info(END_GET_AUTH_INFO); @@ -329,8 +365,8 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 获取/刷新接口调用令牌 * @param + * @Description 获取/刷新接口调用令牌 * @author zxc */ @Transactional(rollbackFor = Exception.class) @@ -338,7 +374,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe public void refreshToken() { //查询 即将过期的 authorizer_access_token List willOverDueResultDTOS = authorizationInfoDao.checkWillOverDue(); - if (willOverDueResultDTOS.size() != NumConstant.ZERO && null != willOverDueResultDTOS){ + if (willOverDueResultDTOS.size() != NumConstant.ZERO && null != willOverDueResultDTOS) { log.info("查询到即将过期的authorizer_access_token"); willOverDueResultDTOS.forEach(willOverDueDTO -> { String authAppId = willOverDueDTO.getAuthAppId(); @@ -346,10 +382,10 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe String clientType = willOverDueDTO.getClientType(); JSONObject jsonObject = new JSONObject(); //授权方AppId - jsonObject.put(ModuleConstant.AUTHORIZER_APPID,authAppId); + jsonObject.put(ModuleConstant.AUTHORIZER_APPID, authAppId); //第三方平台AppId - jsonObject.put(ModuleConstant.COMPONENT_APPID,componentAppId); - jsonObject.put(ModuleConstant.AUTHORIZER_REFRESH_TOKEN,willOverDueDTO.getAuthorizerRefreshToken()); + jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); + jsonObject.put(ModuleConstant.AUTHORIZER_REFRESH_TOKEN, willOverDueDTO.getAuthorizerRefreshToken()); String componentAccessToken = redisThird.getComponentAccessToken(); String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_AUTHORIZER_TOKEN_URL + componentAccessToken, JSON.toJSONString(jsonObject)).getData(); Map map = JSON.parseObject(data, HashMap.class); @@ -368,7 +404,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe formDTO.setAuthAppid(authAppId); formDTO.setClientType(clientType); AuthorizationInfoFormDTO authorizationInfo = new AuthorizationInfoFormDTO(); - BeanUtils.copyProperties(formDTO,authorizationInfo); + BeanUtils.copyProperties(formDTO, authorizationInfo); authorizationInfo.setAuthorizerAppid(authAppId); //先逻辑删除,在插入 authorizationInfoDao.deleteOldAuthorizerAccessToken(customerId, clientType); @@ -380,7 +416,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe resultDTO.setAuthorizer_refresh_token(authorizerRefreshToken); resultDTO.setAuthorizer_appid(authAppId); resultDTO.setExpires_in(7200); - redisThird.setAuthInfo(resultDTO,customerId,clientType); + redisThird.setAuthInfo(resultDTO, customerId, clientType); } }); log.info("更新authorizer_access_token成功"); @@ -389,13 +425,13 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 授权回调URL,回调时并获取授权信息 * @param + * @Description 授权回调URL, 回调时并获取授权信息 * @author zxc */ @Transactional(rollbackFor = Exception.class) @Override - public void redirectUri(TokenDto tokenDto, @RequestBody AuthCodeAndTimeFromDTO authCodeAndTime){ + public void redirectUri(TokenDto tokenDto, @RequestBody AuthCodeAndTimeFromDTO authCodeAndTime) { log.info("开始执行回调URL"); String authCode = authCodeAndTime.getAuthCode(); String clientType = authCodeAndTime.getClientType(); @@ -413,7 +449,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe formDTO.setClientType(clientType); formDTO.setCustomerId(customerId); log.info(ThirdRunTimeInfoConstant.BEGIN_DELETE_INSERT_AUTH_CODE); - authCodeDao.deleteCustomerAuthCode(customerId,clientType); + authCodeDao.deleteCustomerAuthCode(customerId, clientType); authCodeDao.insertRedirectAuthCode(formDTO); //authCode存缓存 redisThird.setAuthCode(formDTO); @@ -423,12 +459,12 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe List fixationAppIdResultDTOS = fixationAppIdDao.selectFixationInfos(); String finalCustomerId = customerId;// fixationAppIdResultDTOS.forEach(fixationAppId -> { - if (fixationAppId.getAppId().equals(authAppId)){ + if (fixationAppId.getAppId().equals(authAppId)) { // TODO 是城阳项目或者党群e事通 // crm表中的customerId【原customerId】 String masterCustomerId = fixationAppId.getMasterCustomerId(); formDTO.setCustomerId(masterCustomerId); - authCodeDao.deleteCustomerAuthCode(finalCustomerId,clientType); + authCodeDao.deleteCustomerAuthCode(finalCustomerId, clientType); authCodeDao.insertRedirectAuthCode(formDTO); //authCode存缓存 redisThird.setAuthCode(formDTO); @@ -447,37 +483,37 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe //替换 新customerId为旧customerId customerId = formDTO.getCustomerId(); // 2. 创建开放平台账号并绑定 或者 直接绑定开放平台 - this.createAndBindOpenAccount(customerId,authAppId,clientType); + this.createAndBindOpenAccount(customerId, authAppId, clientType); // 3. 更新 customer_mp 表授权状态和AuthAppId - this.updateCustomerMpAppId(customerId,authAppId,clientType); - authCodeDao.updateAppId(customerId,clientType,authAppId); + this.updateCustomerMpAppId(customerId, authAppId, clientType); + authCodeDao.updateAppId(customerId, clientType, authAppId); // 4. 保存授权方账户信息 - this.saveAuthAccountInfo(customerId,authAppId,clientType); + this.saveAuthAccountInfo(customerId, authAppId, clientType); // 5. 校验客户居民端、工作端小程序是否全部授权,全部授权完成的推送钉钉消息 sun this.checkAuthorization(customerId); log.info("回调结束"); } /** - * @Description 获取授权方的帐号基本信息并保存 * @param customerId * @param authAppId + * @Description 获取授权方的帐号基本信息并保存 * @author zxc */ @Transactional(rollbackFor = Exception.class) - public void saveAuthAccountInfo(String customerId, String authAppId,String clientType) { + public void saveAuthAccountInfo(String customerId, String authAppId, String clientType) { log.info("开始执行保存授权账户基本信息"); JSONObject jsonObject = new JSONObject(); - jsonObject.put(ModuleConstant.COMPONENT_APP_ID,componentAppId); - jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID,authAppId); + jsonObject.put(ModuleConstant.COMPONENT_APP_ID, componentAppId); + jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID, authAppId); String componentAccessToken = redisThird.getComponentAccessToken(); - String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_GET_AUTHORIZER_INFO + componentAccessToken , JSON.toJSONString(jsonObject)).getData(); - Map map = JSON.parseObject(data, Map.class); + String data = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_GET_AUTHORIZER_INFO + componentAccessToken, JSON.toJSONString(jsonObject)).getData(); + Map map = JSON.parseObject(data, Map.class); Map authorizerInfo = map.get(ModuleConstant.AUTHORIZER_INFO); - log.info("授权信息:"+authorizerInfo); + log.info("授权信息:" + authorizerInfo); // 存在 “miniprograminfo” 字段为小程序,不存在为公众号 boolean keyExist = authorizerInfo.containsKey(ModuleConstant.MINI_PROGRAM_INFO); - if (keyExist == true){ + if (keyExist == true) { log.info("授权方为小程序 并 开始插入信息"); MiniInfoFormDTO miniInfoFormDTO = ConvertUtils.mapToEntity(authorizerInfo, MiniInfoFormDTO.class); miniInfoFormDTO.setCustomerId(customerId); @@ -498,22 +534,22 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe businessInfoForm.setPrimaryId(primaryId); businessInfoList.add(businessInfoForm); }); - businessInfoDao.deleteBusinessInfo(customerId,clientType); + businessInfoDao.deleteBusinessInfo(customerId, clientType); businessInfoDao.insertBusinessInfo(businessInfoList); //todo 小程序配置的合法域名信息插入 Map miniProgramInfo = (Map) authorizerInfo.get(ModuleConstant.MINI_PROGRAM_INFO); List networkInfoList = new ArrayList<>(); Map networkInfo = (Map) miniProgramInfo.get(ModuleConstant.NETWORK); - networkInfo.forEach((key,value) -> { + networkInfo.forEach((key, value) -> { MiniNetworkInfoFormDTO miniNetworkInfoForm = new MiniNetworkInfoFormDTO(); - miniNetworkInfoForm .setCustomerId(customerId); + miniNetworkInfoForm.setCustomerId(customerId); miniNetworkInfoForm.setClientType(clientType); miniNetworkInfoForm.setNetworkType(key.toString()); miniNetworkInfoForm.setUrl(value.toString()); miniNetworkInfoForm.setPrimaryId(primaryId); networkInfoList.add(miniNetworkInfoForm); }); - miniNetworkInfoDao.deleteNetworkInfo(customerId,clientType); + miniNetworkInfoDao.deleteNetworkInfo(customerId, clientType); miniNetworkInfoDao.insertNetworkInfo(networkInfoList); //todo 小程序配置的类目信息插入 List categoryInfoList = new ArrayList<>(); @@ -533,7 +569,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe miniCategoryInfoDao.deleteCategoryInfo(customerId, clientType); miniCategoryInfoDao.insertCategoryInfo(categoryInfoList); } - }else { + } else { log.info("授权方为公众号 并 开始插入信息"); PaInfoFormDTO paInfoFormDTO = ConvertUtils.mapToEntity(authorizerInfo, PaInfoFormDTO.class); //公众号基本信息插入 @@ -551,7 +587,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe businessInfoForm.setPrimaryId(primaryId); businessInfoList.add(businessInfoForm); }); - businessInfoDao.deleteBusinessInfo(customerId,clientType); + businessInfoDao.deleteBusinessInfo(customerId, clientType); businessInfoDao.insertBusinessInfo(businessInfoList); } log.info("保存授权方基本信息结束"); @@ -559,12 +595,12 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 回填 customer_mp appId , 更改授权状态 * @param + * @Description 回填 customer_mp appId , 更改授权状态 * @author zxc */ @Transactional(rollbackFor = Exception.class) - public void updateCustomerMpAppId(String customerId,String authAppId,String clientType){ + public void updateCustomerMpAppId(String customerId, String authAppId, String clientType) { log.info("==========回填customer_mp开始=========="); Integer checkBindCount = customerMpDao.checkBind(authAppId, clientType); if (checkBindCount == NumConstant.ZERO) { @@ -578,14 +614,14 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe log.info("==========回填customer_mp结束=========="); } - public void createAndBindOpenAccount(String customerId,String authAppId,String clientType){ + public void createAndBindOpenAccount(String customerId, String authAppId, String clientType) { log.info(ThirdRunTimeInfoConstant.BEGIN_CREATE_OPEN); Map authorizerRefreshToken = redisThird.getAuthorizerRefreshToken(customerId + ThirdRedisKeyConstant.COLON + clientType); String authorizerAccessToken = authorizerRefreshToken.get("authorizerAccessToken").toString(); JSONObject bindInfoForm = new JSONObject(); - bindInfoForm.put(ModuleConstant.LOW_APP_ID,authAppId); + bindInfoForm.put(ModuleConstant.LOW_APP_ID, authAppId); String bindResult = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_OPEN_GET + authorizerAccessToken, JSON.toJSONString(bindInfoForm)).getData(); - Map bindInfo = JSON.parseObject(bindResult, Map.class); + Map bindInfo = JSON.parseObject(bindResult, Map.class); boolean bindStatus = bindInfo.containsKey(ModuleConstant.OPEN_APP_ID); if (bindStatus != true) { Integer authCount = customerMpDao.selectAuthCount(customerId); @@ -663,11 +699,11 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 转换过期时间 * @param expiresIn + * @Description 转换过期时间 * @author zxc */ - public Date countExpirationTime(String expiresIn){ + public Date countExpirationTime(String expiresIn) { expiresIn = expiresIn + "000"; Date date = new Date(); long l = date.getTime() + Long.valueOf(expiresIn); @@ -676,21 +712,21 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe } /** - * @Description 查询客户Id * @param tokenDto + * @Description 查询客户Id * @author zxc */ - public String getLoginUserCustomerId(TokenDto tokenDto){ + public String getLoginUserCustomerId(TokenDto tokenDto) { PaCustomerUserAgencyDTO result = paCustomerUserAgencyDao.selectCustomerIdByUserId(tokenDto.getUserId()); return result.getCustomerId(); } /** - * @Description 时间戳(秒级)转换 Date * @param t + * @Description 时间戳(秒级)转换 Date * @author zxc */ - public Date sToDate(String t){ + public Date sToDate(String t) { Long aLong = Long.valueOf(t + "000"); Date date = new Date(); date.setTime(aLong); @@ -699,24 +735,24 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe /** * @author sun - * @Description 校验客户两哥小程序是否完成授权 + * @Description 校验客户两哥小程序是否完成授权 */ - private void checkAuthorization(String customerId){ + private void checkAuthorization(String customerId) { List list = customerMpDao.selectByCustomerId(customerId); AtomicBoolean bl = new AtomicBoolean(false); - list.forEach(mp->{ - if(mp.getAuthorizationFlag()!=NumConstant.ONE){ + list.forEach(mp -> { + if (mp.getAuthorizationFlag() != NumConstant.ONE) { bl.set(true); } }); - if(!bl.get()){ + if (!bl.get()) { dDingNews(customerId); } } /** * @author sun - * @Description 发送钉钉消息,通知运营人员有新客户完成授权 + * @Description 发送钉钉消息,通知运营人员有新客户完成授权 */ private String dDingNews(String customerId) { //1.查询客户及管理员信息,用于发送消息使用 @@ -739,8 +775,29 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe "> 管理员称谓: " + result.getAppellation() + "\n\n" + "> 联系方式: " + result.getPhone() + "\n"); request.setMarkdown(markdown); - HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(request),url,secret); + HttpClientManager.getInstance().sendDingMsg(JSON.toJSONString(request), url, secret); return null; } + /** + * @Description 推送AuthorizerAccessToken到私有化平台们 + * @param form + * @return void + * @author wxz + * @date 2021.08.31 17:22:04 + */ + public void pushAuthorizerAccessToken2PrivateEpmets(AuthorizerAccessTokenFormDTO form) { + List platforms = thirdPlatformService.listPlatformsByActionKey(ThirdPlatformActions.PUSH_AUTHORIZER_ACCESS_TOKEN); + platforms.stream().forEach(p -> { + log.info("推送authorizer-access-token到私有化平台:platformId:{}, platformKey:{}, platformName:{}, apiUrl:{}", p.getPlatformId(), p.getPlatformKey(), p.getPlatformName(), p.getApiUrl()); + ApiService apiService = selectApiService(p.getPlatformId()); + try { + apiService.pushAuthorizerAccessToken(form, p.getPlatformId(), p.getPlatformKey()); + } catch (Exception e) { + String detail = ExceptionUtils.getErrorStackTrace(e); + log.error(detail); + } + }); + } + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PrivateEpmetServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PrivateEpmetServiceImpl.java new file mode 100644 index 0000000000..35cb59cad1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PrivateEpmetServiceImpl.java @@ -0,0 +1,71 @@ +package com.epmet.service.impl; + +import com.epmet.constant.ThirdRunTimeInfoConstant; +import com.epmet.dao.AuthorizationInfoDao; +import com.epmet.dao.ComponentAccessTokenDao; +import com.epmet.dao.ComponentVerifyTicketDao; +import com.epmet.dto.form.AuthorizationInfoFormDTO; +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; +import com.epmet.dto.result.AuthorizationInfoResultDTO; +import com.epmet.redis.RedisThird; +import com.epmet.service.PrivateEpmetService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@Slf4j +public class PrivateEpmetServiceImpl implements PrivateEpmetService { + + @Autowired + private ComponentVerifyTicketDao componentVerifyTicketDao; + + @Autowired + private AuthorizationInfoDao authorizationInfoDao; + + @Autowired + private ComponentAccessTokenDao componentAccessTokenDao; + + @Autowired + private RedisThird redisThird; + + @Transactional(rollbackFor = RuntimeException.class) + @Override + public void pushAuthorizerTokens(AuthorizerAccessTokenFormDTO input) { + System.out.println("收到AuthorizerAccessTokenFormDTO:" + input); + + //AuthorizationInfoFormDTO authorizationInfo = new AuthorizationInfoFormDTO(); + //BeanUtils.copyProperties(input,authorizationInfo); + //authorizationInfo.setAuthorizerAppid(input.getAuthAppid()); + ////先逻辑删除,在插入 + //authorizationInfoDao.deleteOldAuthorizerAccessToken(input.getCustomerId(), input.getClientType()); + //authorizationInfoDao.insertAuthorizerAccessToken(input); + ////缓存 refreshAuthorizerAccessToken + //redisThird.setAuthorizerRefreshToken(authorizationInfo); + //AuthorizationInfoResultDTO resultDTO = new AuthorizationInfoResultDTO(); + //resultDTO.setAuthorizer_access_token(input.getAuthorizerAccessToken()); + //resultDTO.setAuthorizer_refresh_token(input.getAuthorizerRefreshToken()); + //resultDTO.setAuthorizer_appid(input.getAuthAppid()); + //resultDTO.setExpires_in(7200); + //redisThird.setAuthInfo(resultDTO,input.getCustomerId(),input.getClientType()); + } + + @Override + @Transactional(rollbackFor = RuntimeException.class) + public void pushComponentAccessToken(ComponentAccessTokenFormDTO componentAccessToken) { + System.out.println("收到componentAccessToken:" + componentAccessToken); + //先逻辑删,在插入 + //componentAccessTokenDao.deleteOldComponentAccessToken(); + //componentAccessTokenDao.insertComponentAccessToken(componentAccessToken); + ////存缓存 + //redisThird.setComponentAccessToken(componentAccessToken.getComponentAccessToken()); + } + + @Override + public void pushVerifyTicket(String ticket) { + + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java index 3d6393e17e..a3e0930e7a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.dto.form.CustomerFormDTO; import com.epmet.dto.form.ThirdPlatformFormDTO; import com.epmet.dto.form.PlatformRegisterFormDTO; import com.epmet.dto.form.PlatformUnregisterFormDTO; +import com.epmet.dto.result.ThirdPlatformActionsResultDTO; import com.epmet.dto.result.ThirdplatformResultDTO; import com.epmet.entity.ThirdplatformCustomerActionEntity; import com.epmet.entity.ThirdplatformCustomerRegisterEntity; @@ -160,4 +161,9 @@ public class ThirdPlatformServiceImpl implements ThirdPlatformService { thirdplatformCustomerRegisterDao.batchInsertThirdplatformCustomerRegister(entityList); } } + + @Override + public List listPlatformsByActionKey(String actionKey) { + return thirdplatformCustomerRegisterDao.listPlatformsByActionKey(actionKey); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformActionDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformActionDao.xml index 39de22dca5..954b8a96e6 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformActionDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformActionDao.xml @@ -30,6 +30,23 @@ from thirdplatform_action ta where ta.PLATFORM_ID = #{platformId} and ACTION_KEY = #{action} + and ta.DEL_FLAG=0 + + + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml index 9ab368a8bc..66d039fc3c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml @@ -36,6 +36,20 @@ and DEL_FLAG = 0 + + + insert into thirdplatform_customer_register ( diff --git a/epmet-openapi/epmet-openapi-sdk/pom.xml b/epmet-openapi/epmet-openapi-sdk/pom.xml new file mode 100644 index 0000000000..c006c05b10 --- /dev/null +++ b/epmet-openapi/epmet-openapi-sdk/pom.xml @@ -0,0 +1,15 @@ + + + + epmet-openapi + com.epmet + 2.0.0 + + 4.0.0 + + epmet-openapi-sdk + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java b/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java new file mode 100644 index 0000000000..0838048629 --- /dev/null +++ b/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/encrypt/Md5Util.java @@ -0,0 +1,133 @@ +package com.epmet.openapi.sdk.encrypt; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +public class Md5Util { + /** + * 加密盐 值 + */ + public static final String SALT = "EPMET_UMD_SALT"; + + public static String md5(String string) throws Exception { + if (string == null || string.trim().length() == 0) { + return null; + } + return getMD5(string.getBytes("GBK")); + } + + private static final char hexDigits[] = { // 用来将字节转换成 16 进制表示的字符 + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + + private static String getMD5(byte[] source) throws Exception { + String s = null; + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(source); + byte tmp[] = md.digest(); // MD5 的计算结果是一个 128 位的长整数, + // 用字节表示就是 16 个字节 + char str[] = new char[16 * 2]; // 每个字节用 16 进制表示的话,使用两个字符, + // 所以表示成 16 进制需要 32 个字符 + int k = 0; // 表示转换结果中对应的字符位置 + for (int i = 0; i < 16; i++) { // 从第一个字节开始,对 MD5 的每一个字节 + // 转换成 16 进制字符的转换 + byte byte0 = tmp[i]; // 取第 i 个字节 + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; // 取字节中高 4 位的数字转换, + // >>> 为逻辑右移,将符号位一起右移 + str[k++] = hexDigits[byte0 & 0xf]; // 取字节中低 4 位的数字转换 + } + s = new String(str); // 换后的结果转换为字符串 + return s; + } + + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + "" + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) throws Exception { + String resultString = null; + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + return resultString; + } + + + public static void main(String[] args) { + for (int i = 0; i < 5; i++) { + String uuid = "03a1dcd8cb1811eabac1c03fd56f7847"; + System.out.println(get12Char(uuid)); + } + } + + /** + * 获取短字符 + * + * @param str + * @return 大写 + */ + public static String get12Char(String str) { + String arr[] = ShortText(str); + String rst = (arr[0] + arr[1]).toUpperCase(); + return rst.substring(0, 4) + rst.substring(4, 8) + rst.substring(8, 12); + } + + private static String[] ShortText(String string) { + String[] chars = new String[]{ // 要使用生成URL的字符 + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", + "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", + "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; + + String hex = ""; + + MessageDigest md = null; + try { + md = MessageDigest.getInstance("MD5"); + hex = byteArrayToHexString(md.digest(SALT.concat(string) + .getBytes("utf-8"))); + } catch (Exception e) { + e.printStackTrace(); + } + + int hexLen = hex.length(); + int subHexLen = hexLen / 8; + String[] ShortStr = new String[4]; + + for (int i = 0; i < subHexLen; i++) { + String outChars = ""; + int j = i + 1; + String subHex = hex.substring(i * 8, j * 8); + long idx = Long.valueOf("3FFFFFFF", 16) & Long.valueOf(subHex, 16); + + for (int k = 0; k < 6; k++) { + int index = (int) (Long.valueOf("0000003D", 16) & idx); + outChars += chars[index]; + idx = idx >> 5; + } + ShortStr[i] = outChars; + } + + return ShortStr; + } + +} diff --git a/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/sign/OpenApiSignUtils.java b/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/sign/OpenApiSignUtils.java new file mode 100644 index 0000000000..e44b17aa30 --- /dev/null +++ b/epmet-openapi/epmet-openapi-sdk/src/main/java/com/epmet/openapi/sdk/sign/OpenApiSignUtils.java @@ -0,0 +1,109 @@ +package com.epmet.openapi.sdk.sign; + +import com.epmet.openapi.sdk.encrypt.Md5Util; + +import java.util.*; + +/** + * OpenApi签名工具 + */ +public class OpenApiSignUtils { + + /** + * @Description 创建签名 + * @return + * @author wxz + * @date 2021.03.22 16:47 + */ + public static String createSign(Map contentMap, String signKey) throws Exception { + String str2beSigned = mapToSignStr(contentMap); + str2beSigned = str2beSigned.concat("&sign_key=").concat(signKey); + return Md5Util.md5(str2beSigned); + } + + /** + * @Description 验签 + * @return + * @author wxz + * @date 2021.03.22 16:51 + */ + public static boolean checkSign(Map contentMap, String signKey) throws Exception { + String newSign = createSign(contentMap, signKey); + return newSign.equals(contentMap.get("sign")); + } + + /** + * @Description map转化为签名明文 + * @return + * @author wxz + * @date 2021.03.22 16:47 + */ + public static String mapToSignStr(Map map) { + Set keySet = map.keySet(); + String[] keyArray = (String[])keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + + for(int i = 0; i < keyArray.length; ++i) { + String key = keyArray[i]; + String val = (String)map.get(key); + if (val != null && val.trim().length() > 0 && !"sign".equals(key)) { + if (!sb.toString().isEmpty()) { + sb.append("&"); + } + + sb.append(key).append("=").append((String)map.get(key)); + } + } + + return sb.toString(); + } + + public static void main(String[] args) throws Exception { + generateGetAccessTokenSign(); + System.out.println("=============="); + generateGetOrgDetailSign(); + } + + private static void generateGetAccessTokenSign() throws Exception { + long now = System.currentTimeMillis(); + System.out.println(now); + + String uuid = UUID.randomUUID().toString().replace("-", ""); + + HashMap content = new HashMap<>(); + content.put("app_id", "7d98b8af2d05752b4225709c4cfd4bd0"); + content.put("timestamp", String.valueOf(now)); + content.put("nonce", uuid); + content.put("auth_type", "take_token"); + + String secret = "3209ee9f41704482be1a1fb5873a25376f2899191ca846119d44168316bc3e44"; + + String sign = createSign(content, secret); + + System.out.println("时间戳:" + now); + System.out.println("随机数:" + uuid); + System.out.println("签名:" + sign); + } + + private static void generateGetOrgDetailSign() throws Exception { + long now = System.currentTimeMillis(); + String uuid = UUID.randomUUID().toString().replace("-", "");; + System.out.println("时间戳:" + now); + System.out.println("随机数:" + uuid); + + HashMap content = new HashMap<>(); + //content.put("orgId", "aaa"); + //content.put("test", null); + content.put("gridId", "12128e0f614f1c00a058ea9a107033b2"); + content.put("app_id", "7d98b8af2d05752b4225709c4cfd4bd0"); + content.put("timestamp", String.valueOf(now)); + content.put("nonce", uuid); + content.put("auth_type", "take_token"); + + String secret = "3209ee9f41704482be1a1fb5873a25376f2899191ca846119d44168316bc3e44"; + + String sign = createSign(content, secret); + System.out.println("签名:" + sign); + } +} diff --git a/epmet-openapi/pom.xml b/epmet-openapi/pom.xml index 9db62073f3..a3be582a53 100644 --- a/epmet-openapi/pom.xml +++ b/epmet-openapi/pom.xml @@ -13,6 +13,7 @@ epmet-openapi epmet-openapi-scan + epmet-openapi-sdk \ No newline at end of file From 2557b58325b51fbdbcc61a4c8e6bcfe53451d044 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 31 Aug 2021 22:21:44 +0800 Subject: [PATCH 20/60] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=9A=E6=BC=8F=E4=BA=86openapi-sdk=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/epmet-third/epmet-third-server/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index bd811cf03e..a945beb046 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -21,6 +21,11 @@ + + com.epmet + epmet-openapi-sdk + 2.0.0 + com.epmet epmet-third-client From 8df605b3cdf2cfb0e11233506db7d1d8b6f2e529 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 1 Sep 2021 09:56:55 +0800 Subject: [PATCH 21/60] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partymember/service/impl/PartyMemberConfirmServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 80cc4cc91e..1610de67c6 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -193,7 +193,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberInfoEntity.class); PartymemberInfoDTO info = partymemberInfoService.getPartyMemberInfoByUser(partyMemberInfoDTO.getCustomerId(), partyMemberInfoDTO.getUserId()); if (null != info) { - partyMemberInfoDTO.setId(info.getId()); + partyMemberInfoEntity.setId(info.getId()); } if (confirmAutoDTO == null || !confirmAutoDTO.getComparisonResults()) { log.info("submit confirmAutoDTO return null or false:{}",JSON.toJSONString(confirmAutoDTO)); From bdc0ab6e20a0e7915cdfade6d75dd716a3e6eeeb Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 3 Sep 2021 10:32:01 +0800 Subject: [PATCH 22/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=AE=9E=E5=86=B5=E6=97=A5=E6=9C=9Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 6a8896618d..868a97eda4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.service.datastats.impl; + import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -1487,26 +1488,25 @@ public class DataStatsServiceImpl implements DataStatsService { } String startDate = null; String actulStartDate = null; - String endDate = null; + String endDate = formDTO.getDateId(); Date dateIdDate = DateUtils.parse(formDTO.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD); boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); switch (formDTO.getType()){ case "yesterday": startDate = DateUtils.getBeforeNDay(formDTO.getDateId(),1); - endDate = formDTO.getDateId(); actulStartDate = formDTO.getDateId(); break; case "thisWeek": - actulStartDate = DateUtils.getWeekStart(formDTO.getDateId()); - startDate = DateUtils.getBeforeNDay(actulStartDate,1); - DateUtils.format(DateUtils.addDateDays(yesterday, -1),DateUtils.DATE_PATTERN_YYYYMMDD); + startDate = DateUtils.getWeekStart(formDTO.getDateId()); + //startDate = DateUtils.getBeforeNDay(actulStartDate,1); + //DateUtils.format(DateUtils.addDateDays(yesterday, -1),DateUtils.DATE_PATTERN_YYYYMMDD); if (!isYesterday){ endDate = DateUtils.getWeekEnd(formDTO.getDateId()); } break; case "thisMonth": - actulStartDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); - startDate = DateUtils.getBeforeNDay(actulStartDate,1); + startDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); + //startDate = DateUtils.getBeforeNDay(actulStartDate,1); if (!isYesterday) { endDate = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); } @@ -1516,6 +1516,7 @@ public class DataStatsServiceImpl implements DataStatsService { } formDTO.setStartDateId(startDate); formDTO.setEndDateId(endDate); + log.info("getSubWorkFact do select param:{}", JSON.toJSONString(formDTO)); List result = new ArrayList<>(); //如果是社区 则下级是网格 查询网格的数据 if (OrgLevelEnum.COMMUNITY.getCode().equals(formDTO.getAgencyLevel())){ From d657ee22cc0d894b02b78309e9ed799fa11127b3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Sep 2021 12:33:23 +0800 Subject: [PATCH 23/60] =?UTF-8?q?=E5=86=8D=E6=AC=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/datastats/impl/DataStatsServiceImpl.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 4667a7b99c..411be35b77 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1489,26 +1489,22 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setDateId(format.format(yesterday)); } String startDate = null; - String actulStartDate = null; String endDate = formDTO.getDateId(); Date dateIdDate = DateUtils.parse(formDTO.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD); boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); switch (formDTO.getType()){ case "yesterday": startDate = DateUtils.getBeforeNDay(formDTO.getDateId(),1); - actulStartDate = formDTO.getDateId(); + endDate = formDTO.getDateId(); break; case "thisWeek": startDate = DateUtils.getWeekStart(formDTO.getDateId()); - //startDate = DateUtils.getBeforeNDay(actulStartDate,1); - //DateUtils.format(DateUtils.addDateDays(yesterday, -1),DateUtils.DATE_PATTERN_YYYYMMDD); if (!isYesterday){ endDate = DateUtils.getWeekEnd(formDTO.getDateId()); } break; case "thisMonth": startDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); - //startDate = DateUtils.getBeforeNDay(actulStartDate,1); if (!isYesterday) { endDate = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); } @@ -1544,7 +1540,7 @@ public class DataStatsServiceImpl implements DataStatsService { Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); //巡查次数和时间 - List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(gridIdList,actulStartDate,formDTO.getEndDateId()); + List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(gridIdList,formDTO.getStartDateId(),formDTO.getEndDateId()); Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); subAgencyList.forEach(agency->{ @@ -1585,7 +1581,7 @@ public class DataStatsServiceImpl implements DataStatsService { Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); //巡查次数和时间 List agencyFullIds = subAgencyList.stream().map(o -> o.getPids().concat(StrConstant.COLON).concat(o.getAgencyId())).collect(Collectors.toList()); - List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,actulStartDate,formDTO.getEndDateId()); + List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,formDTO.getStartDateId(),formDTO.getEndDateId()); Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); subAgencyList.forEach(agency->{ From 65d8cbcd1911a5294c3185047baa5f75f401242f Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Sep 2021 12:57:43 +0800 Subject: [PATCH 24/60] =?UTF-8?q?=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/datastats/impl/DataStatsServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 411be35b77..443b33c2fa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1599,7 +1599,9 @@ public class DataStatsServiceImpl implements DataStatsService { }); } - List newResult = result.stream().sorted(Comparator.comparing(o -> o.getTopicToIssueTotal() + o.getIssueToProjectTotal() + o.getClosedProjectTotal() + o.getPatrolTotal())).collect(Collectors.toList()); + List newResult = result.stream().sorted(Comparator.comparing(o -> o.getTopicToIssueTotal() + o.getIssueToProjectTotal() + o.getClosedProjectTotal() + o.getPatrolTotal())) + .collect(Collectors.toList()); + Collections.reverse(newResult); return newResult; } From 59f134ef5455499dabe283e71fd438f0bb62255c Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Sep 2021 13:22:04 +0800 Subject: [PATCH 25/60] =?UTF-8?q?=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/datastats/impl/DataStatsServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 443b33c2fa..748ba3cf82 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1494,7 +1494,7 @@ public class DataStatsServiceImpl implements DataStatsService { boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); switch (formDTO.getType()){ case "yesterday": - startDate = DateUtils.getBeforeNDay(formDTO.getDateId(),1); + startDate = formDTO.getDateId(); endDate = formDTO.getDateId(); break; case "thisWeek": From b1c45ef5582c8ab927daebf73314e97e5a98ea8e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 1 Sep 2021 13:35:12 +0800 Subject: [PATCH 26/60] =?UTF-8?q?sql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/epmetuser/CustomerStaffDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 9b5da74efb..cc2f8dab8b 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 @@ -96,10 +96,10 @@ 'grid_manager' - , sr.created_time DESC + , sr.created_time DESC ) t GROUP BY t.staff_id - ORDER BY t.is_first ]]> 1 + ORDER BY t.is_first ]]> 1, t.staff_id desc LIMIT #{pageNo}, #{pageSize} From 7e1a228191be6d82720882bd5d035ff09e5f7dcc Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Sep 2021 13:38:39 +0800 Subject: [PATCH 27/60] =?UTF-8?q?=E5=B7=AE=E5=80=BC=20=E5=B7=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 748ba3cf82..eef006470e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1490,21 +1490,25 @@ public class DataStatsServiceImpl implements DataStatsService { } String startDate = null; String endDate = formDTO.getDateId(); + String breforeStartDate = null; Date dateIdDate = DateUtils.parse(formDTO.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD); boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); switch (formDTO.getType()){ case "yesterday": startDate = formDTO.getDateId(); + breforeStartDate = startDate = DateUtils.getBeforeNDay(startDate,1); endDate = formDTO.getDateId(); break; case "thisWeek": startDate = DateUtils.getWeekStart(formDTO.getDateId()); + breforeStartDate = startDate = DateUtils.getBeforeNDay(startDate,1); if (!isYesterday){ endDate = DateUtils.getWeekEnd(formDTO.getDateId()); } break; case "thisMonth": startDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); + breforeStartDate = startDate = DateUtils.getBeforeNDay(startDate,1); if (!isYesterday) { endDate = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); } @@ -1525,17 +1529,17 @@ public class DataStatsServiceImpl implements DataStatsService { } List gridIdList = subAgencyList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); //查询组织的话题转议题数据 - List toIssueStart = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, formDTO.getStartDateId()); + List toIssueStart = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, breforeStartDate); List toIssueEnd = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, formDTO.getEndDateId()); Map toIssueStartMap = toIssueStart.stream().collect(Collectors.toMap(SubGridFormDTO.Topic::getGridId, SubGridFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); Map toIssueEndMap = toIssueEnd.stream().collect(Collectors.toMap(SubGridFormDTO.Topic::getGridId, SubGridFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); //查询组织的议题转项目数据 - List toProjectStart = dataStatsDao.getSubGridIssue(gridIdList, formDTO.getStartDateId()); + List toProjectStart = dataStatsDao.getSubGridIssue(gridIdList, breforeStartDate); List toProjectEnd = dataStatsDao.getSubGridIssue(gridIdList, formDTO.getEndDateId()); Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubGridIssueResultDTO::getGridId, SubGridIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubGridIssueResultDTO::getGridId, SubGridIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); //查询组织已关闭的项目数据 - List closeProjectStart = dataStatsDao.getSubGridProject(gridIdList, formDTO.getStartDateId()); + List closeProjectStart = dataStatsDao.getSubGridProject(gridIdList, breforeStartDate); List closeProjectEnd = dataStatsDao.getSubGridProject(gridIdList, formDTO.getEndDateId()); Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); @@ -1565,23 +1569,23 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyList = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); //查询组织的话题转议题数据 - List toIssueStart = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, formDTO.getStartDateId()); + List toIssueStart = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, breforeStartDate); List toIssueEnd = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, formDTO.getEndDateId()); Map toIssueStartMap = toIssueStart.stream().collect(Collectors.toMap(SubAgencyFormDTO.Topic::getAgencyId, SubAgencyFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); Map toIssueEndMap = toIssueEnd.stream().collect(Collectors.toMap(SubAgencyFormDTO.Topic::getAgencyId, SubAgencyFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); //查询组织的议题转项目数据 - List toProjectStart = dataStatsDao.getSubAgencyIssue(agencyList, formDTO.getStartDateId()); + List toProjectStart = dataStatsDao.getSubAgencyIssue(agencyList, breforeStartDate); List toProjectEnd = dataStatsDao.getSubAgencyIssue(agencyList, formDTO.getEndDateId()); Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubAgencyIssueResultDTO::getAgencyId, SubAgencyIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubAgencyIssueResultDTO::getAgencyId, SubAgencyIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); //查询组织已关闭的项目数据 - List closeProjectStart = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getStartDateId()); + List closeProjectStart = dataStatsDao.getSubAgencyProject(agencyList, breforeStartDate); List closeProjectEnd = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getEndDateId()); Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); //巡查次数和时间 List agencyFullIds = subAgencyList.stream().map(o -> o.getPids().concat(StrConstant.COLON).concat(o.getAgencyId())).collect(Collectors.toList()); - List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,formDTO.getStartDateId(),formDTO.getEndDateId()); + List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,breforeStartDate,formDTO.getEndDateId()); Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); subAgencyList.forEach(agency->{ From a574ef5683d1cf0c1cd1746ae7b94a71365d1f0c Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 1 Sep 2021 13:40:25 +0800 Subject: [PATCH 28/60] =?UTF-8?q?=E5=B7=AE=E5=80=BC=20=E5=B7=AE=E5=80=BC?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/datastats/impl/DataStatsServiceImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index eef006470e..1002b8c34a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1490,25 +1490,21 @@ public class DataStatsServiceImpl implements DataStatsService { } String startDate = null; String endDate = formDTO.getDateId(); - String breforeStartDate = null; Date dateIdDate = DateUtils.parse(formDTO.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD); boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); switch (formDTO.getType()){ case "yesterday": startDate = formDTO.getDateId(); - breforeStartDate = startDate = DateUtils.getBeforeNDay(startDate,1); endDate = formDTO.getDateId(); break; case "thisWeek": startDate = DateUtils.getWeekStart(formDTO.getDateId()); - breforeStartDate = startDate = DateUtils.getBeforeNDay(startDate,1); if (!isYesterday){ endDate = DateUtils.getWeekEnd(formDTO.getDateId()); } break; case "thisMonth": startDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); - breforeStartDate = startDate = DateUtils.getBeforeNDay(startDate,1); if (!isYesterday) { endDate = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); } @@ -1517,6 +1513,7 @@ public class DataStatsServiceImpl implements DataStatsService { log.warn("==========="); } formDTO.setStartDateId(startDate); + String breforeStartDate = DateUtils.getBeforeNDay(formDTO.getStartDateId(),1); formDTO.setEndDateId(endDate); log.info("getSubWorkFact do select param:{}", JSON.toJSONString(formDTO)); List result = new ArrayList<>(); From 23936ab7437da2e0535cd926c4ec5d4b28c374d0 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 1 Sep 2021 14:35:38 +0800 Subject: [PATCH 29/60] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=86=85=E6=9C=89?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E9=A2=86=E5=AF=BC=E6=A0=87=E7=AD=BE=E7=9A=84?= =?UTF-8?q?=E4=BA=BA=E6=8E=92=E5=9C=A8=E5=89=8D=E9=9D=A2=EF=BC=8C=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=86=85=E6=9C=89=E7=BD=91=E6=A0=BC=E9=95=BF=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=9A=84=E4=BA=BA=E6=8E=92=E5=9C=A8=E5=89=8D=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E9=83=A8=E9=97=A8=E5=86=85=E6=9C=89=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E9=A2=86=E5=AF=BC=E6=A0=87=E7=AD=BE=E7=9A=84=E4=BA=BA=E6=8E=92?= =?UTF-8?q?=E5=9C=A8=E5=89=8D=E9=9D=A2=EF=BC=8C=E7=9B=B8=E5=90=8C=E8=81=8C?= =?UTF-8?q?=E4=BD=8D=E5=8F=8A=E5=85=B6=E4=BB=96=E8=81=8C=E4=BD=8D=E6=8C=89?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=BA=E5=BA=8F=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/epmetuser/CustomerStaffDao.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 cc2f8dab8b..07039eeed0 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 @@ -60,6 +60,7 @@ SELECT DISTINCT sr.staff_id, + cs.created_time, case when gsr.role_key = @@ -74,6 +75,7 @@ then 1 else 0 end is_first FROM staff_role sr + INNER JOIN customer_staff cs ON sr.staff_id = cs.user_id INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId} WHERE sr.del_flag = '0' @@ -96,10 +98,9 @@ 'grid_manager' - , sr.created_time DESC ) t GROUP BY t.staff_id - ORDER BY t.is_first ]]> 1, t.staff_id desc + ORDER BY t.is_first ]]> 1, t.created_time desc LIMIT #{pageNo}, #{pageSize} From 8d08abc80c2e6d5ff3f123ac4493a806e9d7ca64 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 1 Sep 2021 15:12:11 +0800 Subject: [PATCH 30/60] =?UTF-8?q?screenProjectOrgDaily=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenProjectOrgDailyServiceImpl.java | 26 ++---- .../extract/FactOriginProjectMainDailyDao.xml | 91 +++++++++---------- .../screen/ScreenProjectOrgDailyDao.xml | 2 +- 3 files changed, 48 insertions(+), 71 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index 3a37d17a40..9fbca67078 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -184,44 +184,30 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl projectOrgDaily = baseDao.selectOrgProjectByAgency(agencyInfos, dateId); if (CollectionUtils.isEmpty(projectOrgDaily)){ log.info(String.format(PingYinConstants.SELECT_GRID_INFO_BY_ORG_IS_NULL,customerId)); return; } log.info(projectOrgDaily.toString()); - List createProjects = disposeCreateProject(agencyInfos, dateId); + agencyInfos = disposeCreateProject(agencyInfos, dateId); agencyInfos.forEach(a -> { a.setDateId(dateId); projectOrgDaily.forEach(p -> { if (a.getAreaCode().equals(p.getAreaCode())){ - a.setResolvedRatio(getRatio(p.getResolvedNum(),p.getProjectTotal())); - a.setBadRatio(getRatio(p.getBadTotal(),p.getEvaluateTotal())); - a.setGoodRatio(getRatio(p.getGoodTotal(),p.getEvaluateTotal())); - a.setBadTotal(p.getBadTotal()); - a.setEvaluateTotal(p.getEvaluateTotal()); - a.setGoodTotal(p.getGoodTotal()); - a.setProjectTotal(p.getProjectTotal()); - a.setResolvedNum(p.getResolvedNum()); - } - }); - }); - agencyInfos.forEach(a -> { - createProjects.forEach(p -> { - if (a.getOrgId().equals(p.getOrgId())){ a.setBadTotal(p.getBadTotal() + a.getBadTotal()); a.setEvaluateTotal(p.getEvaluateTotal() + a.getEvaluateTotal()); a.setGoodTotal(p.getGoodTotal() + a.getGoodTotal()); a.setProjectTotal(p.getProjectTotal() + a.getProjectTotal()); a.setResolvedNum(p.getResolvedNum() + a.getResolvedNum()); - a.setResolvedRatio(getRatio(a.getResolvedNum(),a.getProjectTotal())); - a.setBadRatio(getRatio(a.getBadTotal(),a.getEvaluateTotal())); - a.setGoodRatio(getRatio(a.getGoodTotal(),a.getEvaluateTotal())); + a.setResolvedRatio(getRatio(p.getResolvedNum(),p.getProjectTotal())); + a.setBadRatio(getRatio(p.getBadTotal(),p.getEvaluateTotal())); + a.setGoodRatio(getRatio(p.getGoodTotal(),p.getEvaluateTotal())); } }); }); log.info(agencyInfos.toString()); - del(customerId, dateId); insert(agencyInfos,customerId,dateId); } @@ -239,6 +225,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl projectOrgDaily = baseDao.selectOrgProject(agencyInfos, dateId); if (CollectionUtils.isEmpty(projectOrgDaily)){ log.info(String.format(PingYinConstants.SELECT_GRID_INFO_BY_ORG_IS_NULL,customerId)); @@ -278,7 +265,6 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml index 0700977462..841526476b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml @@ -138,7 +138,7 @@ FROM screen_project_grid_daily g LEFT JOIN screen_customer_grid cg ON cg.GRID_ID = g.GRID_ID WHERE g.DEL_FLAG = 0 - AND cg.PARENT_AGENCY_ID = #{a.orgId} + AND cg.ALL_PARENT_IDS LIKE CONCAT('%',#{a.orgId},'%') AND g.DATE_ID #{dateId} From 7d2ccc1906362aaff3e3b47b16397591d3100300 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 2 Sep 2021 09:51:42 +0800 Subject: [PATCH 31/60] =?UTF-8?q?selectMonthPieChart=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 43d30e9193..7b641de992 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -6,9 +6,9 @@ SELECT fact.index_code AS "indexCode", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index 7c6be5ab92..8bb86a24b3 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -24,7 +24,7 @@ SELECT fact.index_code AS "indexCode", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", From 084be558edb1206ca8bc24ff5062529d90005aa0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 2 Sep 2021 13:12:10 +0800 Subject: [PATCH 33/60] =?UTF-8?q?month/indexscore=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 7b641de992..8d6109753d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -201,13 +201,13 @@ SELECT - ROUND(service_ablity,1) * SERVICE_ABLITY_WEIGHT AS serviceAbility, - ROUND(party_dev_ablity,1) * PARTY_DEV_WEIGHT AS partyDevAbility, - ROUND(govern_ablity,1) * GOVERN_ABLITY_WEIGHT AS governAbility, + ROUND((ROUND(service_ablity,1) * SERVICE_ABLITY_WEIGHT),1) AS serviceAbility, + ROUND((ROUND(party_dev_ablity,1) * PARTY_DEV_WEIGHT),1) AS partyDevAbility, + ROUND((ROUND(govern_ablity,1) * GOVERN_ABLITY_WEIGHT),1) AS governAbility, ROUND(service_ablity,1) serviceOriginScore, ROUND(party_dev_ablity,1) partyOriginScore, ROUND(govern_ablity,1) governOriginScore, @@ -38,9 +38,9 @@ SELECT sca.AGENCY_NAME AS NAME, - sy.govern_ablity * sy.GOVERN_ABLITY_WEIGHT AS governAbility, - sy.party_dev_ablity * sy.PARTY_DEV_WEIGHT AS partyDevAbility, - sy.service_ablity * sy.SERVICE_ABLITY_WEIGHT AS serviceAbility, + ROUND((ROUND(sy.govern_ablity,1) * sy.GOVERN_ABLITY_WEIGHT),1) AS governAbility, + ROUND((ROUND(sy.party_dev_ablity,1) * sy.PARTY_DEV_WEIGHT),1) AS partyDevAbility, + ROUND((ROUND(sy.service_ablity,1) * sy.SERVICE_ABLITY_WEIGHT),1) AS serviceAbility, sy.ORG_ID as orgId, sca.area_code as areaCode FROM screen_customer_agency sca @@ -382,9 +382,9 @@ SELECT - service_ablity AS serviceAbility, - party_dev_ablity AS partyDevAbility, - govern_ablity AS governAbility, + ROUND(service_ablity,1) AS serviceAbility, + ROUND(party_dev_ablity,1) AS partyDevAbility, + ROUND(govern_ablity,1) AS governAbility, year_id as yearId FROM screen_index_data_yearly From a2c2f99b2a91c006f26fc6510efb004db7e5b384 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 2 Sep 2021 16:50:29 +0800 Subject: [PATCH 35/60] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20=E8=AE=BE=E7=BD=AE=E5=88=86=E5=80=BC?= =?UTF-8?q?=E7=9A=84=E6=8C=89=E7=85=A7=E3=80=90=E6=80=BB=E5=88=86=3D?= =?UTF-8?q?=E5=90=84=E4=B8=AA=E8=83=BD=E5=8A=9B=E5=80=BC=E5=9B=9B=E8=88=8D?= =?UTF-8?q?=E4=BA=94=E5=85=A5=E4=BF=9D=E7=95=99=E4=B8=80=E4=BD=8D=20*=20?= =?UTF-8?q?=E6=9D=83=E9=87=8D=20=E7=9B=B8=E5=8A=A0=EF=BC=8C=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=80=BC=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E4=B8=80=E4=BD=8D=EF=BC=9B=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=E4=B8=89=E5=A4=A7=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=9A=84=E5=88=86=3D=E5=8E=9F=E5=A7=8B=E5=80=BC=E5=9B=9B?= =?UTF-8?q?=E8=88=8D=E4=BA=94=E5=85=A5=E4=BF=9D=E7=95=99=E4=B8=80=E4=BD=8D?= =?UTF-8?q?*=20=E6=9D=83=E9=87=8D=EF=BC=8C=E7=BB=93=E6=9E=9C=E5=80=BC?= =?UTF-8?q?=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5=E4=BF=9D=E7=95=99=E4=B8=80?= =?UTF-8?q?=E4=BD=8D=EF=BC=9B=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=E5=8D=95=E9=A1=B9=E5=8E=9F=E5=A7=8B=E5=80=BC=EF=BC=9A?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E4=B8=80=E4=BD=8D=E5=B0=8F=E6=95=B0=EF=BC=9B=E3=80=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/fact/FactIndexAgencyScoreDao.xml | 8 ++++---- .../mapper/fact/FactIndexAgencySubScoreDao.xml | 4 ++-- .../mapper/fact/FactIndexCommunityScoreDao.xml | 12 ++++++------ .../fact/FactIndexCommunitySubScoreDao.xml | 4 ++-- .../mapper/fact/FactIndexGridScoreDao.xml | 12 ++++++------ .../mapper/fact/FactIndexGridSubScoreDao.xml | 4 ++-- .../screen/ScreenIndexDataMonthlyDao.xml | 18 +++++++++--------- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 214385cc29..04fcae2efd 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -6,7 +6,7 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", - ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", + ROUND(ROUND(self.self_score,1)*fact.WEIGHT, 1) AS "agencyScore", + ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", fact.index_code AS "indexCode", self.SELF_WEIGHT AS "selfWeight", self.SUB_WEIGHT AS "subWeight" diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index aafd8dd25b..17354e06f7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -7,10 +7,10 @@ SELECT fact.index_code AS "key", IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", - fact.score AS score, + round(fact.score,1) AS score, dict.index_name AS "name", round(fact.WEIGHT,2) AS weight, - (fact.SCORE * fact.WEIGHT) AS weightedScore + round(round(fact.SCORE,1) * fact.WEIGHT,1) AS weightedScore FROM fact_index_agency_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index 8bb86a24b3..5f77c4950d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -6,7 +6,7 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", - ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", + ROUND(ROUND(self.self_score,1)*fact.WEIGHT, 1) AS "agencyScore", + ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", fact.index_code AS "indexCode", self.SELF_WEIGHT AS "selfWeight", self.SUB_WEIGHT AS "subWeight" diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index 37290ed60a..11a9f85a9b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -8,9 +8,9 @@ fact.index_code AS "key", IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", dict.index_name AS "name", - fact.score AS score, + round(fact.score,1) AS score, round(fact.WEIGHT,2) AS weight, - (fact.SCORE * fact.WEIGHT) AS weightedScore + round(round(fact.SCORE,1) * fact.WEIGHT,1) AS weightedScore FROM fact_index_community_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index 9be33bd524..c152cbd144 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -6,7 +6,7 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", - ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", + ROUND(ROUND(self.self_score,1)*fact.WEIGHT, 1) AS "agencyScore", + ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", fact.index_code AS "indexCode", self.SELF_WEIGHT AS "selfWeight", self.SUB_WEIGHT AS "subWeight" diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index 1fda25b3ac..f3127095e7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -8,9 +8,9 @@ fact.index_code AS "key", IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", dict.index_name AS "name", - fact.score AS score, + round(fact.score,1) AS score, round(fact.WEIGHT,2) AS weight, - (fact.SCORE * fact.WEIGHT) AS weightedScore + round(round(fact.SCORE,1) * fact.WEIGHT,1) AS weightedScore FROM fact_index_grid_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 03f4da3f4f..d6ad50cc2b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -88,9 +88,9 @@ resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> SELECT score.org_name AS `NAME`, - score.service_ablity * score.SERVICE_ABLITY_WEIGHT AS serviceAbility, - score.party_dev_ablity * score.PARTY_DEV_WEIGHT AS partyDevAbility, - score.govern_ablity * score.GOVERN_ABLITY_WEIGHT AS governAbility, + ROUND(ROUND(score.service_ablity,1) * score.SERVICE_ABLITY_WEIGHT, 1) AS serviceAbility, + ROUND(ROUND(score.party_dev_ablity,1) * score.PARTY_DEV_WEIGHT, 1) AS partyDevAbility, + ROUND(ROUND(score.govern_ablity,1) * score.GOVERN_ABLITY_WEIGHT, 1) AS governAbility, score.PARTY_DEV_WEIGHT AS partyWeight, score.GOVERN_ABLITY_WEIGHT AS governWeight, score.SERVICE_ABLITY_WEIGHT AS serviceWeight, @@ -156,13 +156,13 @@ org_id AS "orgId", org_name AS "orgName", - round((party_dev_ablity * party_dev_weight),1) AS "score" + round(round(party_dev_ablity,1) * party_dev_weight,1) AS "score" - round((govern_ablity * govern_ablity_weight),1) AS "score" + round(round(govern_ablity,1) * govern_ablity_weight,1) AS "score" - round((service_ablity * service_ablity_weight),1) AS "score" + round(round(service_ablity,1) * service_ablity_weight,1) AS "score" FROM screen_index_data_monthly @@ -406,9 +406,9 @@ resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO"> SELECT score.org_name AS `NAME`, - score.service_ablity * score.SERVICE_ABLITY_WEIGHT AS serviceAbility, - score.party_dev_ablity * score.PARTY_DEV_WEIGHT AS partyDevAbility, - score.govern_ablity * score.GOVERN_ABLITY_WEIGHT AS governAbility, + ROUND(ROUND(score.service_ablity,1)*score.SERVICE_ABLITY_WEIGHT, 1)AS serviceAbility, + ROUND(ROUND(score.party_dev_ablity,1) * score.PARTY_DEV_WEIGHT, 1) AS partyDevAbility, + ROUND(ROUND(score.govern_ablity,1) * score.GOVERN_ABLITY_WEIGHT, 1) AS governAbility, score.PARTY_DEV_WEIGHT AS partyWeight, score.GOVERN_ABLITY_WEIGHT AS governWeight, score.SERVICE_ABLITY_WEIGHT AS serviceWeight, From a61fd17deb0679dee3d4b3af7333b8988bd6e3f0 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 2 Sep 2021 17:10:12 +0800 Subject: [PATCH 36/60] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E7=9C=8B=E5=88=B0=E9=9D=9E=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9A=84=E4=BA=BA=E5=91=98=E3=80=81=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E7=BD=91=E6=A0=BC=E4=B8=8B=E6=B7=BB=E5=8A=A0=E7=9A=84?= =?UTF-8?q?=E4=BA=BA=E4=B8=8D=E5=85=81=E8=AE=B8=E5=86=8D=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E4=B8=8B=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/epmetuser/result/ListStaffResultDTO.java | 2 ++ .../service/govorg/impl/GovOrgServiceImpl.java | 14 ++++++++------ .../mapper/govorg/CustomerStaffAgencyDao.xml | 12 +++++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java index b465f8ec3e..ae926bd6ee 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java @@ -31,5 +31,7 @@ public class ListStaffResultDTO implements Serializable { private String orgName = ""; //职责名称列表 private List roles; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; } 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 5a56be39c6..b7b23299ab 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 @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.govorg.impl; import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -12,11 +11,6 @@ import com.epmet.dataaggre.dao.govorg.*; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.govorg.*; -import com.epmet.dataaggre.dto.govorg.form.*; -import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; -import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; -import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; -import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; @@ -38,6 +32,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.stream.Collectors; /** * @Author zxc @@ -401,6 +396,13 @@ public class GovOrgServiceImpl implements GovOrgService { //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 List staffList = epmetUserService.getStaffInfoList(formDTO); + //3.查询工作人员注册组织关系信息 + List staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(staffIdList)){ + List list = customerAgencyDao.selelctStaffOrg(staffIdList); + staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType()))); + } + //3.封装数据并返回 resultDTO.setStaffCount(staffIds.size()); resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index 65afdbabdd..55c4d7789c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -77,14 +77,16 @@ SELECT - user_id + csa.user_id FROM - customer_staff_agency + customer_staff_agency csa + INNER JOIN staff_org_relation sor ON csa.user_id = sor.staff_id WHERE - del_flag = '0' - AND agency_id = #{orgId} + csa.del_flag = '0' + AND sor.org_type = 'agency' + AND csa.agency_id = #{orgId} ORDER BY - created_time ASC + csa.created_time ASC From 3b4c455df9a07f84c018b86753e0dede9d0987f1 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 2 Sep 2021 17:12:10 +0800 Subject: [PATCH 37/60] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Ajob=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/config/ScheduleConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java index 199da6b24d..a20624fa18 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/config/ScheduleConfig.java @@ -46,6 +46,7 @@ public class ScheduleConfig { prop.put("org.quartz.jobStore.misfireThreshold", "12000"); prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); + prop.put("org.quartz.jobStore.acquireTriggersWithinLock", "true"); //PostgreSQL数据库,需要打开此注释 //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate"); From 906dd8120577aec9bd994ed27ccc2e29d5697d09 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 3 Sep 2021 09:48:25 +0800 Subject: [PATCH 38/60] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/SubAgencyIndexRankResultDTO.java | 3 +++ .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java index af9d6caf5e..ae70697765 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/SubAgencyIndexRankResultDTO.java @@ -27,16 +27,19 @@ public class SubAgencyIndexRankResultDTO implements Serializable { * 党建能力 */ private Double governAbility = 0.0; + private Double originGovernAbility = 0.0; /** * 治理能力 */ private Double partyDevAbility = 0.0; + private Double originPartyDevAbility = 0.0; /** * 服务能力 */ private Double serviceAbility = 0.0; + private Double originServiceAbility = 0.0; private String orgId; private String orgType; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index d6ad50cc2b..8b4eed6642 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -363,6 +363,9 @@ ROUND((ROUND(sy.govern_ablity,1) * sy.GOVERN_ABLITY_WEIGHT),1) AS governAbility, ROUND((ROUND(sy.party_dev_ablity,1) * sy.PARTY_DEV_WEIGHT),1) AS partyDevAbility, ROUND((ROUND(sy.service_ablity,1) * sy.SERVICE_ABLITY_WEIGHT),1) AS serviceAbility, + ROUND(sy.govern_ablity,1) AS originGovernAbility, + ROUND(sy.party_dev_ablity,1) AS originPartyDevAbility, + ROUND(sy.service_ablity,1) AS originServiceAbility, sy.ORG_ID as orgId, sca.area_code as areaCode FROM screen_customer_agency sca From 4e4ddadd940d11aa5083748754e81be7865a473c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 3 Sep 2021 16:12:12 +0800 Subject: [PATCH 39/60] =?UTF-8?q?=E4=BA=94=E7=A7=8D=E5=85=A5=E7=BB=84?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=9D=87=E9=9C=80=E8=A6=81=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E7=AB=99=E5=86=85=E4=BF=A1=E3=80=81=E5=BE=AE=E4=BF=A1=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/constant/UserMessageConstant.java | 1 + .../service/GroupInvitationService.java | 9 ++++++++- .../impl/GroupInvitationServiceImpl.java | 5 +++-- .../impl/GroupMemeberOperationServiceImpl.java | 18 +++++++++++------- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java index 86cb1a6ff2..831109fc67 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/UserMessageConstant.java @@ -29,6 +29,7 @@ public interface UserMessageConstant { */ String INVITED_JOIN_GROUP = "您的好友-【%s】通过邀请连接,加入了【%s】"; String SCANCODE_JOIN_GROUP = "您的好友-【%s】通过扫描二维码,加入了【%s】"; + String SHARABLELINK_JOIN_GROUP = "您的好友-【%s】通过分享链接,加入了【%s】"; /** * 组成员被禁言时会收到消息:您已被禁言,禁言时间2020.03.20 12:20-2020.03.27 12:20 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java index 4c8897c5f1..8577aa2bd9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/GroupInvitationService.java @@ -21,7 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.invitation.entity.GroupInvitationEntity; -import com.epmet.resi.group.dto.UserRoleDTO; +import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.GroupInvitationDTO; import com.epmet.resi.group.dto.invitation.form.AccetInvitationFormDTO; import com.epmet.resi.group.dto.invitation.form.CreateGroupInvitationFormDTO; @@ -143,4 +143,11 @@ public interface GroupInvitationService extends BaseService page(Map params) { @@ -434,7 +434,11 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl Date: Mon, 6 Sep 2021 10:34:44 +0800 Subject: [PATCH 40/60] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84error=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PartyBranchManageServiceImpl.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java index 0cf320e03f..e4e806573a 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java @@ -137,17 +137,14 @@ public class PartyBranchManageServiceImpl implements PartyBranchManageService { CustomerPartyBranchDTO customerPartyBranch = customerPartyBranchResult.getData(); PartyMemberBaseInfoAddFormDTO partyMemberBaseInfoAddFormDTO = this.getPartyMemberBaseInfoAddFormDTO(formDTO, customerPartyBranch); Result result = resiPartyMemberOpenFeignClient.addPartyMemberBaseInfo(partyMemberBaseInfoAddFormDTO); + if (!result.success() || StringUtils.isBlank(result.getData())) { + throw new RenException(result.getCode(), result.getMsg()); + } //3、党支部总人数+1 - if (result.success() && StringUtils.isNotBlank(result.getData())) { - //党支部总人数+1 - customerPartyBranch.setTotalPartyMember(customerPartyBranch.getTotalPartyMember() + 1); - Result updatePartyBranchResult = govOrgOpenFeignClient.updatePartyBranch(customerPartyBranch); - if (updatePartyBranchResult.success()) { - logger.info(String.format("党支部(%s)总人数+1", formDTO.getPartyBranchId())); - } - } else { - logger.error("添加党员异常"); - throw new RenException(result.getCode()); + customerPartyBranch.setTotalPartyMember(customerPartyBranch.getTotalPartyMember() + 1); + Result updatePartyBranchResult = govOrgOpenFeignClient.updatePartyBranch(customerPartyBranch); + if (updatePartyBranchResult.success()) { + logger.info(String.format("党支部(%s)总人数+1", formDTO.getPartyBranchId())); } return result.getData(); } From 55916816f72ee16f60f131951d49754a204b5f0d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 6 Sep 2021 13:28:57 +0800 Subject: [PATCH 41/60] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=94=9F=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/group/constant/ActConstant.java | 17 ++++ .../act/OrganizationalLifeLineChartDTO.java | 44 ++++++++++ .../act/form/OrganizationalLifeFormDTO.java | 22 +++++ .../result/OrganizationalLifeResultDTO.java | 47 +++++++++++ .../controller/GroupActInfoController.java | 13 +++ .../modules/act/dao/GroupActInfoDao.java | 39 ++++++++- .../act/service/GroupActInfoService.java | 10 +++ .../service/impl/GroupActInfoServiceImpl.java | 84 +++++++++++++++++++ .../resources/mapper/act/GroupActInfoDao.xml | 59 +++++++++++++ 9 files changed, 334 insertions(+), 1 deletion(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java new file mode 100644 index 0000000000..30f06ebaf6 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/ActConstant.java @@ -0,0 +1,17 @@ +package com.epmet.resi.group.constant; + +/** + * @Author zxc + * @DateTime 2021/9/3 4:39 下午 + * @DESC + */ +public interface ActConstant { + + /** + * 类型【组织活动次数:orgAct,应参加活动次数:joinAct,活动签到次数:signAct】 + */ + String ORG_ACT = "orgAct"; + String JOIN_ACT = "joinAct"; + String SIGN_ACT = "signAct"; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java new file mode 100644 index 0000000000..ad5dca0bba --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/OrganizationalLifeLineChartDTO.java @@ -0,0 +1,44 @@ +package com.epmet.resi.group.dto.act; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/3 3:35 下午 + * @DESC + */ +@Data +public class OrganizationalLifeLineChartDTO implements Serializable { + + private static final long serialVersionUID = -4224453421929580053L; + + /** + * 月份 + */ + private String month; + + /** + * 组织活动次数 + */ + private Integer organizationalActCount; + + /** + * 应参加活动次数 + */ + private Integer shouldJoinActCount; + + /** + * 活动签到次数 + */ + private Integer actSignCount; + + public OrganizationalLifeLineChartDTO() { + this.month = ""; + this.organizationalActCount = NumConstant.ZERO; + this.shouldJoinActCount = NumConstant.ZERO; + this.actSignCount = NumConstant.ZERO; + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java new file mode 100644 index 0000000000..3e515c2c75 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/OrganizationalLifeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.dto.act.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/3 2:52 下午 + * @DESC + */ +@Data +public class OrganizationalLifeFormDTO implements Serializable { + + private static final long serialVersionUID = -8611679719504666547L; + + private String yearId; + + private String userId; + + private String customerId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java new file mode 100644 index 0000000000..e68cbd02be --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/OrganizationalLifeResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.resi.group.dto.act.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/3 2:35 下午 + * @DESC + */ +@Data +public class OrganizationalLifeResultDTO implements Serializable { + + private static final long serialVersionUID = 6991638491754890967L; + + /** + * 组织活动次数 + */ + private Integer organizationalActCount; + + /** + * 应参加活动次数 + */ + private Integer shouldJoinActCount; + + /** + * 活动签到次数 + */ + private Integer actSignCount; + + /** + * 折线图 + */ + private List lineChart; + + public OrganizationalLifeResultDTO() { + this.organizationalActCount = NumConstant.ZERO; + this.shouldJoinActCount = NumConstant.ZERO; + this.actSignCount = NumConstant.ZERO; + this.lineChart = new ArrayList<>(); + } +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java index 4a1a973022..34fc73ec23 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/GroupActInfoController.java @@ -27,6 +27,7 @@ import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -153,4 +154,16 @@ public class GroupActInfoController { return new Result(); } + /** + * @Description 组织生活 + * @Param formDTO + * @author zxc + * @date 2021/9/3 2:57 下午 + */ + @PostMapping("organizationallife") + public Result organizationalLife(@LoginUser TokenDto tokenDto, @RequestBody OrganizationalLifeFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(groupActInfoService.organizationalLife(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java index 85f243e608..c4082b67c9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java @@ -19,7 +19,13 @@ package com.epmet.modules.act.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.act.entity.GroupActInfoEntity; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; +import com.epmet.resi.group.dto.act.form.OrganizationalLifeFormDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组织活动信息 @@ -29,5 +35,36 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GroupActInfoDao extends BaseDao { - + + /** + * @Description 根据人查询支部小组,小组审核状态为 approved 的,小组类型为 branch 的,GROUP_LEADER_FLAG 为 leader 的,人员状态为 approved 的 + * @Param userId + * @Param leaderFlag 是否是组长标志 + * @author zxc + * @date 2021/9/3 3:48 下午 + */ + List selectBranchGroupByUserId(@Param("userId")String userId,@Param("leaderFlag")Boolean leaderFlag); + + /** + * @Description 按照yearId查询组织生活,组织活动次数、应参加活动次数、活动签到次数 + * @Param formDTO + * @Param groupIds + * @Param leaderFlag 是否是组长标志 + * @author zxc + * @date 2021/9/3 4:12 下午 + */ + OrganizationalLifeResultDTO selectOrgLife(@Param("userId")String userId, @Param("groupIds")List groupIds, + @Param("leaderFlag")Boolean leaderFlag,@Param("yearId")String yearId); + + /** + * @Description 组织生活折线图 + * @Param leaderGroupIds + * @Param memberGroupIds + * @Param yearId + * @author zxc + * @date 2021/9/6 10:24 上午 + */ + List selectLineChart(@Param("groupIds") List groupId,@Param("leaderFlag")Boolean leaderFlag, + @Param("yearId")String yearId); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java index b815bb7358..9ed4a2b015 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/GroupActInfoService.java @@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.notice.result.NoticeReadListResultDTO; /** @@ -89,4 +90,13 @@ public interface GroupActInfoService extends BaseService { * @return */ void closeAct(CloseGroupActFormDTO formDTO); + + /** + * @Description 组织生活 + * @Param formDTO + * @author zxc + * @date 2021/9/3 2:57 下午 + */ + OrganizationalLifeResultDTO organizationalLife(OrganizationalLifeFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java index 48334bac4e..41e77cee6a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java @@ -58,9 +58,11 @@ import com.epmet.modules.invitation.service.InvitationRecordService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.GroupActInfoDTO; +import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; import com.epmet.resi.group.dto.act.result.ActDetailResultDTO; +import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; import com.epmet.resi.group.dto.group.GroupMessageDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.invitation.InvitationRecordDTO; @@ -75,6 +77,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.stream.Collectors; @@ -862,4 +865,85 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl leaderGroupIds = baseDao.selectBranchGroupByUserId(formDTO.getUserId(),true); + List chartResult = new ArrayList<>(); + if (!CollectionUtils.isEmpty(leaderGroupIds)){ + // 按照yearId查询组织生活【我创建的活动】,组织活动次数、应参加活动次数、活动签到次数 + OrganizationalLifeResultDTO dto = baseDao.selectOrgLife(formDTO.getUserId(), leaderGroupIds,true,formDTO.getYearId()); + result.setOrganizationalActCount(dto.getOrganizationalActCount()); + result.setActSignCount(dto.getActSignCount()); + // 当此人是组长,创建了几个活动就应参加几个活动 + result.setShouldJoinActCount(dto.getOrganizationalActCount()); + List chartDTOS = baseDao.selectLineChart(leaderGroupIds, true, formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartDTOS)){ + chartResult.addAll(chartDTOS); + } + } + // 查询此人不是组长,客户下所有支部小组 + List memberGroupIds = baseDao.selectBranchGroupByUserId(formDTO.getUserId(),false); + if (!CollectionUtils.isEmpty(memberGroupIds)){ + // 按照yearId查询组织生活【我所在支部组的活动】,组织活动次数、应参加活动次数、活动签到次数 + OrganizationalLifeResultDTO dto = baseDao.selectOrgLife(formDTO.getUserId(), memberGroupIds,false, formDTO.getYearId()); + result.setActSignCount(result.getActSignCount() + dto.getActSignCount()); + // 当此人不是组长,支部小组下有几个活动,应参加活动就是几 + result.setShouldJoinActCount(result.getShouldJoinActCount() + dto.getOrganizationalActCount()); + // 此人不是组长,我组织的活动这就不加了 + + List chartDTOS = baseDao.selectLineChart(memberGroupIds, false, formDTO.getYearId()); + if (!CollectionUtils.isEmpty(chartDTOS)){ + chartResult.addAll(chartDTOS); + } + } + // 折线图组装 + List lineChart = lineChart(); + if (!CollectionUtils.isEmpty(chartResult)){ + Map> groupByMonth = chartResult.stream().collect(Collectors.groupingBy(OrganizationalLifeLineChartDTO::getMonth)); + groupByMonth.forEach((month,list) -> { + lineChart.forEach(l -> { + if (month.equals(l.getMonth())){ + l.setOrganizationalActCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getOrganizationalActCount))); + l.setShouldJoinActCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getShouldJoinActCount))); + l.setActSignCount(list.stream().collect(Collectors.summingInt(OrganizationalLifeLineChartDTO::getActSignCount))); + } + }); + }); + } + result.setLineChart(lineChart); + return result; + } + + /** + * @Description 折线图构造 + * @author zxc + * @date 2021/9/6 10:55 上午 + */ + public List lineChart(){ + List lineChart = new ArrayList<>(); + for (int i = NumConstant.ONE; i <= NumConstant.TWELVE; i++) { + OrganizationalLifeLineChartDTO dto = new OrganizationalLifeLineChartDTO(); + if (i < NumConstant.TEN){ + dto.setMonth(NumConstant.ZERO + String.valueOf(i) + "月"); + }else { + dto.setMonth(String.valueOf(i) + "月"); + } + lineChart.add(dto); + } + return lineChart; + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml index 70b86b20e5..6ebd2be427 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml @@ -3,6 +3,65 @@ + + + + + + \ No newline at end of file From 29256d2d77c1dd4bb7955806c8ea520e38fa1c9a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 6 Sep 2021 14:09:00 +0800 Subject: [PATCH 42/60] =?UTF-8?q?=E7=BE=A4=E7=BB=84=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/dto/group/result/AllGroupListResultDTO.java | 4 ++++ .../group/dto/group/result/RecommendGroupResultDTO.java | 5 +++++ .../group/dto/group/result/RecommendedListResultDTO.java | 5 +++++ .../src/main/resources/mapper/group/ResiGroupDao.xml | 9 ++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java index d31e01cab8..3ddbd344d2 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/AllGroupListResultDTO.java @@ -47,4 +47,8 @@ public class AllGroupListResultDTO implements Serializable { */ private String groupType; + /** + * 群介绍 + */ + private String groupIntroduction = ""; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java index 72de523d2a..ff080a5864 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java @@ -48,4 +48,9 @@ public class RecommendGroupResultDTO implements Serializable { */ private String groupType; + /** + * 群介绍 + */ + private String groupIntroduction = ""; + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java index 47fbf7d9be..4e9834470a 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendedListResultDTO.java @@ -37,4 +37,9 @@ public class RecommendedListResultDTO implements Serializable { * 组长名 */ private String leaderName; + + /** + * 群介绍 + */ + private String groupIntroduction = ""; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 82d1531781..bf17a2004e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -157,7 +157,8 @@ rg.GROUP_NAME AS groupName, rg.GROUP_TYPE AS groupType, rgs.TOTAL_MEMBERS AS totalMember, - rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember + rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) @@ -452,7 +453,8 @@ rg.GROUP_HEAD_PHOTO AS groupHeadPhoto, rg.GROUP_NAME AS groupName, rgs.TOTAL_MEMBERS AS totalMember, - rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember + rgs.TOTAL_PARTY_MEMBERS AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) @@ -647,7 +649,8 @@ rg.group_name AS groupName, rg.group_type AS groupType, rgs.total_members AS totalMember, - rgs.total_party_members AS totalPartyMember + rgs.total_party_members AS totalPartyMember, + rg.GROUP_INTRODUCTION FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON (rg.id = rgs.resi_group_id) From da4abdd281b268f87edb0ed75b013d2138220090 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 6 Sep 2021 16:08:42 +0800 Subject: [PATCH 43/60] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E4=B8=8B=E5=85=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/ResiPartyMemberOpenFeignClient.java | 10 ++++++++++ .../ResiPartyMemberOpenFeignClientFallback.java | 5 +++++ .../controller/PartymemberInfoController.java | 11 +++++++++++ .../modules/partymember/dao/PartymemberInfoDao.java | 8 ++++++++ .../partymember/service/PartymemberInfoService.java | 8 ++++++++ .../service/impl/PartymemberInfoServiceImpl.java | 11 +++++++++++ .../mapper/partymember/PartymemberInfoDao.xml | 11 +++++++++++ 7 files changed, 64 insertions(+) diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 0eb5f2f018..0f320cf9be 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -95,4 +95,14 @@ public interface ResiPartyMemberOpenFeignClient { **/ @PostMapping(value = "/resi/partymember/partymemberinfo/getPartymemberInfoByGridId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> getPartymemberInfoByGridId(@RequestBody List gridIdList); + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + @PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid") + Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId); + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 9591f35234..953d5ca326 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -64,4 +64,9 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result> getPartymemberInfoByGridId(List gridIdList) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartymemberInfoByGridId", gridIdList); } + + @Override + public Result> getPartyMemberInfoByCustomerId(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberInfoByCustomerId", customerId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index 5d7d081e13..98b56b8475 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -157,4 +157,15 @@ public class PartymemberInfoController { List list = partymemberInfoService.listPartymemberInfoByGridId(gridIdList); return new Result>().ok(list); } + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + @PostMapping("getpartymemberinfobycustomerid") + public Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId){ + return new Result>().ok(partymemberInfoService.getPartyMemberInfoByCustomerId(customerId)); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java index f395beac8b..c363cd42a0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java @@ -95,4 +95,12 @@ public interface PartymemberInfoDao extends BaseDao { * @Date 2020/7/22 12:14 **/ List selectListPartymemberInfoByGridId(@Param("gridIdList") List gridIdList); + + /** + * @Description 根据客户ID查询党员 + * @Param customerId + * @author zxc + * @date 2021/9/6 3:54 下午 + */ + List selectListPartyMemberInfoByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index 4a25939dad..eed9482da3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -170,4 +170,12 @@ public interface PartymemberInfoService extends BaseService getPartyMemberInfoByCustomerId(String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 57e6a2922c..dfb4c42f71 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -248,4 +248,15 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl getPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectListPartyMemberInfoByCustomerId(customerId); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 876e1102f0..d6585f8dfb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -169,4 +169,15 @@ + + + From 05f3762f414f759d0f8ba707bb5b20d83b39bf57 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 6 Sep 2021 17:10:12 +0800 Subject: [PATCH 44/60] =?UTF-8?q?8=E3=80=81=E6=B4=BB=E5=8A=A8/=E9=80=9A?= =?UTF-8?q?=E7=9F=A5/=E8=AF=9D=E9=A2=98=E8=AF=84=E8=AE=BA=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E6=9C=89=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/act/ActCommentAttachmentDTO.java | 126 ++++++++++++++++++ .../group/dto/act/form/CommentFormDTO.java | 6 + .../dto/act/result/CommentResultDTO.java | 10 ++ .../comment/result/ResiCommentResultDTO.java | 8 ++ .../dto/group/result/CommentFileDTO.java | 26 ++++ .../notice/NoticeCommentAttachmentDTO.java | 126 ++++++++++++++++++ .../dto/notice/form/NoticeCommentFormDTO.java | 6 + .../result/NoticeCommentListResultDTO.java | 9 +- .../topic/ResiTopicCommentAttachmentDTO.java | 126 ++++++++++++++++++ .../topic/form/ResiPublishCommentFormDTO.java | 7 + .../ActCommentAttachmentController.java | 85 ++++++++++++ .../act/dao/ActCommentAttachmentDao.java | 43 ++++++ .../entity/ActCommentAttachmentEntity.java | 93 +++++++++++++ .../service/ActCommentAttachmentService.java | 103 ++++++++++++++ .../impl/ActCommentAttachmentServiceImpl.java | 110 +++++++++++++++ .../service/impl/ActCommentServiceImpl.java | 58 +++++++- .../NoticeCommentAttachmentController.java | 85 ++++++++++++ .../dao/NoticeCommentAttachmentDao.java | 43 ++++++ .../entity/NoticeCommentAttachmentEntity.java | 93 +++++++++++++ .../NoticeCommentAttachmentService.java | 103 ++++++++++++++ .../notice/service/NoticeCommentService.java | 7 + .../NoticeCommentAttachmentServiceImpl.java | 110 +++++++++++++++ .../impl/NoticeCommentServiceImpl.java | 103 +++++++++++++- .../service/impl/NoticeServiceImpl.java | 2 +- .../ResiTopicCommentAttachmentController.java | 85 ++++++++++++ .../dao/ResiTopicCommentAttachmentDao.java | 43 ++++++ .../ResiTopicCommentAttachmentEntity.java | 93 +++++++++++++ .../ResiTopicCommentAttachmentService.java | 102 ++++++++++++++ ...ResiTopicCommentAttachmentServiceImpl.java | 110 +++++++++++++++ .../impl/ResiTopicCommentServiceImpl.java | 68 ++++++++-- .../mapper/act/ActCommentAttachmentDao.xml | 25 ++++ .../notice/NoticeCommentAttachmentDao.xml | 25 ++++ .../topic/ResiTopicCommentAttachmentDao.xml | 25 ++++ 33 files changed, 2049 insertions(+), 15 deletions(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentAttachmentController.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java new file mode 100644 index 0000000000..5326d3783d --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/ActCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.act; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ActCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 活动Id[group_act_info.id] + */ + private String groupActId; + + /** + * 评论Id + */ + private String actCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java index 92fce732ae..8d3cbbcbe1 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/form/CommentFormDTO.java @@ -1,11 +1,13 @@ package com.epmet.resi.group.dto.act.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * 005、评论活动 @@ -27,6 +29,10 @@ public class CommentFormDTO implements Serializable { @NotBlank(message = "评论内容不能为空", groups = AddUserShowGroup.class) @Length(max = 500, message = "评论内容最多输入500字", groups = AddUserShowGroup.class) private String commentContent; + /** + * 图片附件集合 + */ + private List imageList; /** * 当前用户id diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java index efb8066f28..a6053ffc39 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/result/CommentResultDTO.java @@ -1,10 +1,13 @@ package com.epmet.resi.group.dto.act.result; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * 006、活动评论列表查询 @@ -27,4 +30,11 @@ public class CommentResultDTO implements Serializable { private Date commentTime; private String commentUserId; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java index c28985e054..57ae73c471 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java @@ -1,11 +1,14 @@ package com.epmet.resi.group.dto.comment.result; import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Description @@ -54,4 +57,9 @@ public class ResiCommentResultDTO implements Serializable { * 评论状态 * */ private String commentStatus; + + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java new file mode 100644 index 0000000000..f101a0a657 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java @@ -0,0 +1,26 @@ +package com.epmet.resi.group.dto.group.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 话题、通知、活动评论附件 + */ +@NoArgsConstructor +@Data +public class CommentFileDTO implements Serializable { + + private static final long serialVersionUID = -3930520724652521552L; + private String name; + private String url; + private String type; + private String format; + private Integer size; + private Integer duration; + @JsonIgnore + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java new file mode 100644 index 0000000000..6e7c7e336f --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/NoticeCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.notice; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class NoticeCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 通知Id + */ + private String noticeId; + + /** + * 评论Id + */ + private String noticeCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java index c543bf7222..1044128fcf 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import java.util.List; /** * @Author sun @@ -30,6 +31,11 @@ public class NoticeCommentFormDTO { */ private String userId; + /** + * 图片附件集合 + */ + private List imageList; + public interface Comment{} public interface UserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java index 726289e144..45a9c9f694 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/result/NoticeCommentListResultDTO.java @@ -1,11 +1,13 @@ package com.epmet.resi.group.dto.notice.result; -import com.alibaba.fastjson.annotation.JSONField; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.Date; +import java.util.List; /** * @Author sun @@ -42,4 +44,9 @@ public class NoticeCommentListResultDTO implements Serializable { * */ private String userId; + /** + * 图片附件集合 + */ + private List imageList = new ArrayList<>(); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java new file mode 100644 index 0000000000..acd1c4e381 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicCommentAttachmentDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class ResiTopicCommentAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java index 894364fe16..9e8b7338cd 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiPublishCommentFormDTO.java @@ -1,9 +1,11 @@ package com.epmet.resi.group.dto.topic.form; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @Description @@ -21,4 +23,9 @@ public class ResiPublishCommentFormDTO implements Serializable { @NotBlank(message = "评论内容不能为空") private String commentContent; + + /** + * 图片附件集合 + */ + private List imageList; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java new file mode 100644 index 0000000000..e84a321e4b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/controller/ActCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.act.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.act.service.ActCommentAttachmentService; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("actcommentattachment") +public class ActCommentAttachmentController { + + @Autowired + private ActCommentAttachmentService actCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = actCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActCommentAttachmentDTO data = actCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ActCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + actCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ActCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + actCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + actCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java new file mode 100644 index 0000000000..07f076a6f5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/ActCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.act.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +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 2021-09-06 + */ +@Mapper +public interface ActCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectActComFile(@Param("groupActId") String groupActId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java new file mode 100644 index 0000000000..1e290165ee --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/entity/ActCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.act.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_comment_attachment") +public class ActCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 活动Id[group_act_info.id] + */ + private String groupActId; + + /** + * 评论Id + */ + private String actCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java new file mode 100644 index 0000000000..c1faff4a04 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/ActCommentAttachmentService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.act.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; + +import java.util.List; +import java.util.Map; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface ActCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + ActCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(ActCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(ActCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询活动评论所有人员的附件信息 + **/ + List getActComFile(String groupActId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..916cf5bdda --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.act.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.act.dao.ActCommentAttachmentDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; +import com.epmet.modules.act.service.ActCommentAttachmentService; +import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 活动评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class ActCommentAttachmentServiceImpl extends BaseServiceImpl implements ActCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActCommentAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActCommentAttachmentDTO get(String id) { + ActCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActCommentAttachmentDTO dto) { + ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActCommentAttachmentDTO dto) { + ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getActComFile(String groupActId) { + return baseDao.selectActComFile(groupActId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java index c249c4ec28..98890462ca 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.modules.act.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -28,23 +29,31 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.act.dao.ActCommentDao; +import com.epmet.modules.act.entity.ActCommentAttachmentEntity; import com.epmet.modules.act.entity.ActCommentEntity; +import com.epmet.modules.act.service.ActCommentAttachmentService; import com.epmet.modules.act.service.ActCommentService; import com.epmet.modules.act.service.GroupActInfoService; import com.epmet.modules.constant.GroupActConstant; +import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.resi.group.dto.act.GroupActInfoDTO; import com.epmet.resi.group.dto.act.form.CommentFormDTO; import com.epmet.resi.group.dto.act.form.CommentQueryFormDTO; import com.epmet.resi.group.dto.act.result.CommentResultDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -65,6 +74,10 @@ public class ActCommentServiceImpl extends BaseServiceImpl imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + noticeCommentService.safetyCheck(new ArrayList<>(), imageList); + //3、插入记录 ActCommentEntity actCommentEntity = new ActCommentEntity(); actCommentEntity.setCustomerId(formDTO.getCustomerId()); @@ -103,6 +121,33 @@ public class ActCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + ActCommentAttachmentEntity attachment = new ActCommentAttachmentEntity(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setGroupActId(formDTO.getGroupActId()); + attachment.setActCommentId(actCommentEntity.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + actCommentAttachmentService.insertBatch(AttachmentEntityList); + } + } /** @@ -124,8 +169,11 @@ public class ActCommentServiceImpl extends BaseServiceImpl fileList = actCommentAttachmentService.getActComFile(formDTO.getGroupActId()); + if (!CollectionUtils.isEmpty(result.getData())) { - //3.遍历封装数据并返回 + //4.遍历封装数据并返回 list.forEach(l -> { result.getData().forEach(user -> { if (l.getCommentUserId().equals(user.getUserId())) { @@ -133,6 +181,14 @@ public class ActCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getCommentUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); }); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentAttachmentController.java new file mode 100644 index 0000000000..baaf689e54 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.notice.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("noticecommentattachment") +public class NoticeCommentAttachmentController { + + @Autowired + private NoticeCommentAttachmentService noticeCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = noticeCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + NoticeCommentAttachmentDTO data = noticeCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody NoticeCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + noticeCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody NoticeCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + noticeCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + noticeCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java new file mode 100644 index 0000000000..2ad57a60cd --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/dao/NoticeCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.notice.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +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 2021-09-06 + */ +@Mapper +public interface NoticeCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectNoticeComFile(@Param("noticeId") String noticeId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java new file mode 100644 index 0000000000..7ab97e6634 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/entity/NoticeCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.notice.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("notice_comment_attachment") +public class NoticeCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 通知Id + */ + private String noticeId; + + /** + * 评论Id + */ + private String noticeCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java new file mode 100644 index 0000000000..5baa7d553d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentAttachmentService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.notice.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface NoticeCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return NoticeCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + NoticeCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(NoticeCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(NoticeCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List getNoticeComFile(String noticeId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java index 0ac50c21e7..6684e61d80 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java @@ -48,4 +48,11 @@ public interface NoticeCommentService extends BaseService { * @Description 通知评论列表查询 **/ List noticeCommentList(NoticeCommentListFormDTO formDTO); + + /** + * @Author sun + * @Description 文字、图片安全校验 + **/ + void safetyCheck(List wordList, List imageList); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..10c3710894 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.notice.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.notice.dao.NoticeCommentAttachmentDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 通知评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class NoticeCommentAttachmentServiceImpl extends BaseServiceImpl implements NoticeCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, NoticeCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, NoticeCommentAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public NoticeCommentAttachmentDTO get(String id) { + NoticeCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, NoticeCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(NoticeCommentAttachmentDTO dto) { + NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(NoticeCommentAttachmentDTO dto) { + NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getNoticeComFile(String noticeId) { + return baseDao.selectNoticeComFile(noticeId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index 2ab3994891..a66e3869a5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -17,10 +17,13 @@ package com.epmet.modules.notice.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; @@ -30,18 +33,23 @@ import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.notice.dao.NoticeCommentDao; +import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; import com.epmet.modules.notice.entity.NoticeCommentEntity; import com.epmet.modules.notice.redis.NoticeCommentRedis; +import com.epmet.modules.notice.service.NoticeCommentAttachmentService; import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.modules.notice.service.NoticeService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.notice.NoticeDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentFormDTO; import com.epmet.resi.group.dto.notice.form.NoticeCommentListFormDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.notice.result.NoticeCommentListResultDTO; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -53,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -70,12 +79,16 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = formDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + safetyCheck(new ArrayList<>(), imageList); //2.判断当前用户是否被禁言、移除、非本组成员 NoticeDTO notice = noticeService.get(formDTO.getNoticeId()); @@ -139,6 +155,33 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (CollectionUtils.isNotEmpty(formDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + formDTO.getImageList().forEach(img -> { + NoticeCommentAttachmentEntity attachment = new NoticeCommentAttachmentEntity(); + attachment.setCustomerId(notice.getCustomerId()); + attachment.setNoticeId(formDTO.getNoticeId()); + attachment.setNoticeCommentId(entity.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + noticeCommentAttachmentService.insertBatch(AttachmentEntityList); + } + } /** @@ -165,7 +208,10 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl resultDTOList = result.getData(); - //3.封装数据并返回 + //3.查询通知评论所有人员的附件信息 + List fileList = noticeCommentAttachmentService.getNoticeComFile(formDTO.getNoticeId()); + + //4.封装数据并返回 resultList.forEach(l -> { StringBuffer name = new StringBuffer(); resultDTOList.forEach(user -> { @@ -175,9 +221,64 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); }); return resultList; } + /** + * @Author sun + * @Description 文字、图片安全校验 + **/ + public void safetyCheck(List wordList, List imageList) { + if (imageList.size() != NumConstant.ZERO) { + wordList.forEach(word -> { + //创建话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(word); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("safetyCheck textScan return failed,result:"+ JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.warn(EpmetErrorCode.TEXT_SCAN_FAILED.getMsg().concat(String.format(TopicConstant.CREATE_TOPIC, word))); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + }); + } + //创建话题图片审核 + if (imageList.size() != NumConstant.ZERO) { + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imageList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()) { + logger.error("safetyCheck imgScan return failed,result:"+ JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if (!imgScanResult.getData().isAllPass()) { + logger.warn(EpmetErrorCode.IMG_SCAN_FAILED.getMsg()); + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + + } + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index b21c69a4ae..49f240ca3c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java @@ -503,7 +503,7 @@ public class NoticeServiceImpl extends BaseServiceImpl * @Description 文字、图片安全校验 **/ private void safetyCheck(List wordList, List imageList) { - if (imageList.size() != NumConstant.ZERO) { + if (wordList.size() != NumConstant.ZERO) { wordList.forEach(word -> { //创建话题内容审核 TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java new file mode 100644 index 0000000000..9c5dd8f841 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicCommentAttachmentController.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("resitopiccommentattachment") +public class ResiTopicCommentAttachmentController { + + @Autowired + private ResiTopicCommentAttachmentService resiTopicCommentAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = resiTopicCommentAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ResiTopicCommentAttachmentDTO data = resiTopicCommentAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ResiTopicCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + resiTopicCommentAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ResiTopicCommentAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + resiTopicCommentAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + resiTopicCommentAttachmentService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java new file mode 100644 index 0000000000..ab917a7ba5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentAttachmentDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +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 2021-09-06 + */ +@Mapper +public interface ResiTopicCommentAttachmentDao extends BaseDao { + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + List selectTopicComFile(@Param("topicId") String topicId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java new file mode 100644 index 0000000000..d4400a14df --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicCommentAttachmentEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic_comment_attachment") +public class ResiTopicCommentAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题Id + */ + private String topicId; + + /** + * 评论Id + */ + private String topicCommentId; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java new file mode 100644 index 0000000000..d29f410d33 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentAttachmentService.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface ResiTopicCommentAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ResiTopicCommentAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + ResiTopicCommentAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(ResiTopicCommentAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(ResiTopicCommentAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 查询话题评论所有人员的附件信息 + **/ + List getTopicComFile(String topicId); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java new file mode 100644 index 0000000000..e44dd792da --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentAttachmentServiceImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.ResiTopicCommentAttachmentDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; +import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题评论附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class ResiTopicCommentAttachmentServiceImpl extends BaseServiceImpl implements ResiTopicCommentAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiTopicCommentAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiTopicCommentAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ResiTopicCommentAttachmentDTO get(String id) { + ResiTopicCommentAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ResiTopicCommentAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ResiTopicCommentAttachmentDTO dto) { + ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ResiTopicCommentAttachmentDTO dto) { + ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 查询通知评论所有人员的附件信息 + **/ + @Override + public List getTopicComFile(String topicId) { + return baseDao.selectTopicComFile(topicId); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index dd02ae9142..623338a5ec 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -41,22 +41,25 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.CommonDataFilterResultDTO; +import com.epmet.dto.result.UserInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.constant.WxmpSubscribeConstant; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.entity.ResiGroupEntity; -import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.group.redis.ResiGroupRedis; import com.epmet.modules.member.dao.ResiGroupMemberDao; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.notice.service.NoticeCommentService; import com.epmet.modules.topic.dao.ResiTopicCommentDao; import com.epmet.modules.topic.dao.ResiTopicDao; +import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; +import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; import com.epmet.modules.topic.service.ResiTopicCommentService; import com.epmet.modules.topic.service.ResiTopicService; import com.epmet.modules.utils.ModuleConstant; @@ -64,11 +67,12 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.constant.TopicConstant; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; -import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; +import com.epmet.resi.group.dto.group.result.CommentFileDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; +import com.epmet.resi.group.dto.notice.form.NoticeFileDTO; import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; @@ -76,6 +80,7 @@ import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.google.common.base.CharMatcher; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -85,6 +90,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -99,32 +105,28 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl imageList = resiCommentFormDTO.getImageList().stream().map(NoticeFileDTO::getUrl).collect(Collectors.toList()); + noticeCommentService.safetyCheck(new ArrayList<>(), imageList); + //1.判断当前用户是否被禁言 ResiTopicDTO topic = resiTopicService.get(resiCommentFormDTO.getTopicId()); if(null == topic){ @@ -314,6 +320,32 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl AttachmentEntityList = new ArrayList<>(); + //图片 + if (CollectionUtils.isNotEmpty(resiCommentFormDTO.getImageList())) { + AtomicInteger sort = new AtomicInteger(); + resiCommentFormDTO.getImageList().forEach(img -> { + ResiTopicCommentAttachmentEntity attachment = new ResiTopicCommentAttachmentEntity(); + attachment.setCustomerId(comment.getCustomerId()); + attachment.setTopicId(resiCommentFormDTO.getTopicId()); + attachment.setTopicCommentId(comment.getId()); + attachment.setFileName(img.getName()); + attachment.setAttachmentName(""); + attachment.setAttachmentSize(img.getSize()); + attachment.setAttachmentFormat(img.getFormat()); + attachment.setAttachmentType(img.getType()); + attachment.setAttachmentUrl(img.getUrl()); + attachment.setSort(sort.get()); + attachment.setDuration(img.getDuration()); + sort.getAndIncrement(); + AttachmentEntityList.add(attachment); + }); + } + if (AttachmentEntityList.size() > NumConstant.ZERO) { + resiTopicCommentAttachmentService.insertBatch(AttachmentEntityList); + } + //对所有关注这个话题的人发送微信订阅 resiTopicService.sendWxmpUpdateSubscribe(tokenDto,topic.getId(), WxmpSubscribeConstant.TYPE_COMMENT); return new Result(); @@ -372,6 +404,20 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl fileList = resiTopicCommentAttachmentService.getTopicComFile(commentFormDTO.getTopicId()); + //封装数据并返回 + comments.forEach(l -> { + //每一条评论的附件信息 + List imageList = new ArrayList<>(); + for (CommentFileDTO f : fileList) { + if (l.getUserId().equals(f.getUserId())) { + imageList.add(f); + } + } + l.setImageList(imageList); + }); + } return new Result>().ok(comments); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml new file mode 100644 index 0000000000..88a1997484 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml new file mode 100644 index 0000000000..027cf9b729 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml new file mode 100644 index 0000000000..ff7fcc59e9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file From f86ea8eae01165c09e861c61585a9f02d1ff6998 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 6 Sep 2021 17:17:02 +0800 Subject: [PATCH 45/60] =?UTF-8?q?=E5=8A=9E=E4=BA=8B=E6=8C=87=E5=8D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/GuideAttachmentDTO.java | 117 ++++++++++++++++++ .../java/com/epmet/dto/GuideCategoryDTO.java | 91 ++++++++++++++ .../epmet/dto/GuideCategoryDefaultDTO.java | 86 +++++++++++++ .../com/epmet/dto/GuideCollectionDTO.java | 91 ++++++++++++++ .../src/main/java/com/epmet/dto/GuideDTO.java | 101 +++++++++++++++ .../com/epmet/dto/GuideExternalLinkDTO.java | 91 ++++++++++++++ .../java/com/epmet/dto/GuideModuleDTO.java | 91 ++++++++++++++ .../com/epmet/dto/GuideModuleDictDTO.java | 96 ++++++++++++++ .../epmet/dto/GuideModuleDictDefaultDTO.java | 91 ++++++++++++++ .../controller/GuideCategoryController.java | 84 +++++++++++++ .../controller/GuideCollectionController.java | 84 +++++++++++++ .../com/epmet/controller/GuideController.java | 84 +++++++++++++ .../controller/GuideModuleController.java | 84 +++++++++++++ .../controller/GuideModuleDictController.java | 84 +++++++++++++ .../com/epmet/dao/GuideAttachmentDao.java | 33 +++++ .../java/com/epmet/dao/GuideCategoryDao.java | 33 +++++ .../epmet/dao/GuideCategoryDefaultDao.java | 33 +++++ .../com/epmet/dao/GuideCollectionDao.java | 33 +++++ .../src/main/java/com/epmet/dao/GuideDao.java | 33 +++++ .../com/epmet/dao/GuideExternalLinkDao.java | 33 +++++ .../java/com/epmet/dao/GuideModuleDao.java | 33 +++++ .../com/epmet/dao/GuideModuleDictDao.java | 33 +++++ .../epmet/dao/GuideModuleDictDefaultDao.java | 33 +++++ .../epmet/entity/GuideAttachmentEntity.java | 83 +++++++++++++ .../entity/GuideCategoryDefaultEntity.java | 56 +++++++++ .../com/epmet/entity/GuideCategoryEntity.java | 61 +++++++++ .../epmet/entity/GuideCollectionEntity.java | 61 +++++++++ .../java/com/epmet/entity/GuideEntity.java | 71 +++++++++++ .../epmet/entity/GuideExternalLinkEntity.java | 61 +++++++++ .../entity/GuideModuleDictDefaultEntity.java | 61 +++++++++ .../epmet/entity/GuideModuleDictEntity.java | 66 ++++++++++ .../com/epmet/entity/GuideModuleEntity.java | 61 +++++++++ .../epmet/service/GuideAttachmentService.java | 95 ++++++++++++++ .../service/GuideCategoryDefaultService.java | 95 ++++++++++++++ .../epmet/service/GuideCategoryService.java | 95 ++++++++++++++ .../epmet/service/GuideCollectionService.java | 95 ++++++++++++++ .../service/GuideExternalLinkService.java | 95 ++++++++++++++ .../GuideModuleDictDefaultService.java | 95 ++++++++++++++ .../epmet/service/GuideModuleDictService.java | 95 ++++++++++++++ .../com/epmet/service/GuideModuleService.java | 95 ++++++++++++++ .../java/com/epmet/service/GuideService.java | 95 ++++++++++++++ .../impl/GuideAttachmentServiceImpl.java | 100 +++++++++++++++ .../impl/GuideCategoryDefaultServiceImpl.java | 100 +++++++++++++++ .../impl/GuideCategoryServiceImpl.java | 100 +++++++++++++++ .../impl/GuideCollectionServiceImpl.java | 100 +++++++++++++++ .../impl/GuideExternalLinkServiceImpl.java | 100 +++++++++++++++ .../GuideModuleDictDefaultServiceImpl.java | 100 +++++++++++++++ .../impl/GuideModuleDictServiceImpl.java | 100 +++++++++++++++ .../service/impl/GuideModuleServiceImpl.java | 100 +++++++++++++++ .../epmet/service/impl/GuideServiceImpl.java | 100 +++++++++++++++ .../resources/mapper/GuideAttachmentDao.xml | 26 ++++ .../resources/mapper/GuideCategoryDao.xml | 21 ++++ .../mapper/GuideCategoryDefaultDao.xml | 20 +++ .../resources/mapper/GuideCollectionDao.xml | 21 ++++ .../src/main/resources/mapper/GuideDao.xml | 23 ++++ .../resources/mapper/GuideExternalLinkDao.xml | 21 ++++ .../main/resources/mapper/GuideModuleDao.xml | 21 ++++ .../resources/mapper/GuideModuleDictDao.xml | 22 ++++ .../mapper/GuideModuleDictDefaultDao.xml | 21 ++++ 59 files changed, 4104 insertions(+) create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDefaultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDefaultDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryDefaultEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryDefaultService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideAttachmentServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryDefaultServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDefaultDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java new file mode 100644 index 0000000000..212e9bc369 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideAttachmentDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南ID + */ + private String guideId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件大小 单位byte + */ + private Integer attachmentSize; + + /** + * 文件格式 word、excel、pdf + */ + private String attachmentFormat; + + /** + * 类型 + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java new file mode 100644 index 0000000000..ccd59bc862 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 分类名 + */ + private String categoryName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDefaultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDefaultDTO.java new file mode 100644 index 0000000000..3d7080d2ff --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCategoryDefaultDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南默认分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideCategoryDefaultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 分类名 + */ + private String categoryName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java new file mode 100644 index 0000000000..6b9dbfaeee --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideCollectionDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideCollectionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户所属客户端 居民端resi 工作端gov + */ + private String app; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java new file mode 100644 index 0000000000..9d5377c34d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 发布单位ID + */ + private String agencyId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 标题 + */ + private String title; + + /** + * 分类ID + */ + private String categoryId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java new file mode 100644 index 0000000000..3cbc69462e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideExternalLinkDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideExternalLinkDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java new file mode 100644 index 0000000000..40e4fed74e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 模块ID + */ + private String moduleId; + + /** + * + */ + private String moduleContent; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java new file mode 100644 index 0000000000..938e7b211a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java new file mode 100644 index 0000000000..6c59d906f9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideModuleDictDefaultDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +public class GuideModuleDictDefaultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java new file mode 100644 index 0000000000..03bd231c0b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCategoryController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.service.GuideCategoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidecategory") +public class GuideCategoryController { + + @Autowired + private GuideCategoryService guideCategoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideCategoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideCategoryDTO data = guideCategoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideCategoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideCategoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideCategoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideCategoryService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java new file mode 100644 index 0000000000..08f94a4126 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideCollectionController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.service.GuideCollectionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidecollection") +public class GuideCollectionController { + + @Autowired + private GuideCollectionService guideCollectionService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideCollectionService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideCollectionDTO data = guideCollectionService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideCollectionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideCollectionService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideCollectionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideCollectionService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideCollectionService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java new file mode 100644 index 0000000000..d484148233 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideDTO; +import com.epmet.service.GuideService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guide") +public class GuideController { + + @Autowired + private GuideService guideService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideDTO data = guideService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java new file mode 100644 index 0000000000..c1823c7684 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.service.GuideModuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidemodule") +public class GuideModuleController { + + @Autowired + private GuideModuleService guideModuleService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideModuleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideModuleDTO data = guideModuleService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideModuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideModuleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideModuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideModuleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideModuleService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java new file mode 100644 index 0000000000..a8a59b6b8b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideModuleDictController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.service.GuideModuleDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@RestController +@RequestMapping("guidemoduledict") +public class GuideModuleDictController { + + @Autowired + private GuideModuleDictService guideModuleDictService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = guideModuleDictService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GuideModuleDictDTO data = guideModuleDictService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GuideModuleDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + guideModuleDictService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GuideModuleDictDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + guideModuleDictService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + guideModuleDictService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java new file mode 100644 index 0000000000..01e5baddd7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideAttachmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java new file mode 100644 index 0000000000..a6b9a24cc8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDefaultDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDefaultDao.java new file mode 100644 index 0000000000..3c3b31a12b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCategoryDefaultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideCategoryDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南默认分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCategoryDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java new file mode 100644 index 0000000000..905dfb9f3e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideCollectionDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideCollectionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideCollectionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java new file mode 100644 index 0000000000..cc5039c8d4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java new file mode 100644 index 0000000000..f766b71680 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideExternalLinkDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideExternalLinkEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideExternalLinkDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java new file mode 100644 index 0000000000..d77324965b --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideModuleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java new file mode 100644 index 0000000000..8af7910511 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideModuleDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDictDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java new file mode 100644 index 0000000000..071c7ed2c1 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideModuleDictDefaultDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GuideModuleDictDefaultEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Mapper +public interface GuideModuleDictDefaultDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java new file mode 100644 index 0000000000..192f52b306 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideAttachmentEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_attachment") +public class GuideAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 办事指南ID + */ + private String guideId; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件大小 单位byte + */ + private Integer attachmentSize; + + /** + * 文件格式 word、excel、pdf + */ + private String attachmentFormat; + + /** + * 类型 + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryDefaultEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryDefaultEntity.java new file mode 100644 index 0000000000..bb6056e549 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryDefaultEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_category_default") +public class GuideCategoryDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 分类名 + */ + private String categoryName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java new file mode 100644 index 0000000000..8231f9d5ef --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCategoryEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_category") +public class GuideCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 分类名 + */ + private String categoryName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java new file mode 100644 index 0000000000..f522884f79 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideCollectionEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_collection") +public class GuideCollectionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户所属客户端 居民端resi 工作端gov + */ + private String app; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java new file mode 100644 index 0000000000..f135e3f676 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide") +public class GuideEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 发布单位ID + */ + private String agencyId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String pid; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 标题 + */ + private String title; + + /** + * 分类ID + */ + private String categoryId; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java new file mode 100644 index 0000000000..4113a168c5 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideExternalLinkEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_external_link") +public class GuideExternalLinkEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 链接说明 + */ + private String description; + + /** + * 外部链接 + */ + private String externalLink; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java new file mode 100644 index 0000000000..f01788acdc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictDefaultEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module_dict_default") +public class GuideModuleDictDefaultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java new file mode 100644 index 0000000000..2816effef0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleDictEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module_dict") +public class GuideModuleDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 模块key + */ + private String moduleValue; + + /** + * 模块名 + */ + private String moduleName; + + /** + * 排序 + */ + private Integer sort; + + /** + * 状态 禁用disable 启用enable + */ + private String status; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java new file mode 100644 index 0000000000..35d602602e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideModuleEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2021-09-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("guide_module") +public class GuideModuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指南ID + */ + private String guideId; + + /** + * 模块ID + */ + private String moduleId; + + /** + * + */ + private String moduleContent; + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java new file mode 100644 index 0000000000..0c56c55e62 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideAttachmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.entity.GuideAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideAttachmentDTO + * @author generator + * @date 2021-09-06 + */ + GuideAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryDefaultService.java new file mode 100644 index 0000000000..f7b73ceae8 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryDefaultService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideCategoryDefaultDTO; +import com.epmet.entity.GuideCategoryDefaultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南默认分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCategoryDefaultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideCategoryDefaultDTO + * @author generator + * @date 2021-09-06 + */ + GuideCategoryDefaultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideCategoryDefaultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideCategoryDefaultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java new file mode 100644 index 0000000000..84f995d0fd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCategoryService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.entity.GuideCategoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCategoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideCategoryDTO + * @author generator + * @date 2021-09-06 + */ + GuideCategoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideCategoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideCategoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java new file mode 100644 index 0000000000..6e8266c556 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideCollectionService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.entity.GuideCollectionEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideCollectionService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideCollectionDTO + * @author generator + * @date 2021-09-06 + */ + GuideCollectionDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideCollectionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideCollectionDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java new file mode 100644 index 0000000000..fcb7cc5b65 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideExternalLinkService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideExternalLinkDTO; +import com.epmet.entity.GuideExternalLinkEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideExternalLinkService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideExternalLinkDTO + * @author generator + * @date 2021-09-06 + */ + GuideExternalLinkDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideExternalLinkDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideExternalLinkDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java new file mode 100644 index 0000000000..1af3f23de9 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictDefaultService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.entity.GuideModuleDictDefaultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleDictDefaultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDictDefaultDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDictDefaultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDictDefaultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDictDefaultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java new file mode 100644 index 0000000000..50ea1e80e0 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleDictService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.entity.GuideModuleDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDictDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java new file mode 100644 index 0000000000..e03d399b5c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideModuleService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.entity.GuideModuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideModuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideModuleDTO + * @author generator + * @date 2021-09-06 + */ + GuideModuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideModuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideModuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java new file mode 100644 index 0000000000..415a968d01 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GuideDTO; +import com.epmet.entity.GuideEntity; + +import java.util.List; +import java.util.Map; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +public interface GuideService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GuideDTO + * @author generator + * @date 2021-09-06 + */ + GuideDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void save(GuideDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-06 + */ + void update(GuideDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideAttachmentServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideAttachmentServiceImpl.java new file mode 100644 index 0000000000..2f66e4b70e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideAttachmentServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideAttachmentDao; +import com.epmet.dto.GuideAttachmentDTO; +import com.epmet.entity.GuideAttachmentEntity; +import com.epmet.service.GuideAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 办事指南附件 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideAttachmentServiceImpl extends BaseServiceImpl implements GuideAttachmentService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideAttachmentDTO get(String id) { + GuideAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideAttachmentDTO dto) { + GuideAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, GuideAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideAttachmentDTO dto) { + GuideAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, GuideAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryDefaultServiceImpl.java new file mode 100644 index 0000000000..4fba3fa9ec --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryDefaultServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideCategoryDefaultDao; +import com.epmet.dto.GuideCategoryDefaultDTO; +import com.epmet.entity.GuideCategoryDefaultEntity; +import com.epmet.service.GuideCategoryDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南默认分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCategoryDefaultServiceImpl extends BaseServiceImpl implements GuideCategoryDefaultService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideCategoryDefaultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideCategoryDefaultDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideCategoryDefaultDTO get(String id) { + GuideCategoryDefaultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideCategoryDefaultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideCategoryDefaultDTO dto) { + GuideCategoryDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryDefaultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideCategoryDefaultDTO dto) { + GuideCategoryDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryDefaultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java new file mode 100644 index 0000000000..502f18571a --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCategoryServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideCategoryDao; +import com.epmet.dto.GuideCategoryDTO; +import com.epmet.entity.GuideCategoryEntity; +import com.epmet.service.GuideCategoryService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南分类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCategoryServiceImpl extends BaseServiceImpl implements GuideCategoryService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideCategoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideCategoryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideCategoryDTO get(String id) { + GuideCategoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideCategoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideCategoryDTO dto) { + GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideCategoryDTO dto) { + GuideCategoryEntity entity = ConvertUtils.sourceToTarget(dto, GuideCategoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java new file mode 100644 index 0000000000..a73d8228ee --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideCollectionServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideCollectionDao; +import com.epmet.dto.GuideCollectionDTO; +import com.epmet.entity.GuideCollectionEntity; +import com.epmet.service.GuideCollectionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南收藏表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideCollectionServiceImpl extends BaseServiceImpl implements GuideCollectionService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideCollectionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideCollectionDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideCollectionDTO get(String id) { + GuideCollectionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideCollectionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideCollectionDTO dto) { + GuideCollectionEntity entity = ConvertUtils.sourceToTarget(dto, GuideCollectionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideCollectionDTO dto) { + GuideCollectionEntity entity = ConvertUtils.sourceToTarget(dto, GuideCollectionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java new file mode 100644 index 0000000000..a9f080965e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideExternalLinkServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideExternalLinkDao; +import com.epmet.dto.GuideExternalLinkDTO; +import com.epmet.entity.GuideExternalLinkEntity; +import com.epmet.service.GuideExternalLinkService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南外链表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideExternalLinkServiceImpl extends BaseServiceImpl implements GuideExternalLinkService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideExternalLinkDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideExternalLinkDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideExternalLinkDTO get(String id) { + GuideExternalLinkEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideExternalLinkDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideExternalLinkDTO dto) { + GuideExternalLinkEntity entity = ConvertUtils.sourceToTarget(dto, GuideExternalLinkEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideExternalLinkDTO dto) { + GuideExternalLinkEntity entity = ConvertUtils.sourceToTarget(dto, GuideExternalLinkEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java new file mode 100644 index 0000000000..6be5e56dc4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictDefaultServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDictDefaultDao; +import com.epmet.dto.GuideModuleDictDefaultDTO; +import com.epmet.entity.GuideModuleDictDefaultEntity; +import com.epmet.service.GuideModuleDictDefaultService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块默认字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleDictDefaultServiceImpl extends BaseServiceImpl implements GuideModuleDictDefaultService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDictDefaultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDictDefaultDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideModuleDictDefaultDTO get(String id) { + GuideModuleDictDefaultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDictDefaultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDictDefaultDTO dto) { + GuideModuleDictDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictDefaultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDictDefaultDTO dto) { + GuideModuleDictDefaultEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictDefaultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java new file mode 100644 index 0000000000..c758eebdad --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleDictServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDictDao; +import com.epmet.dto.GuideModuleDictDTO; +import com.epmet.entity.GuideModuleDictEntity; +import com.epmet.service.GuideModuleDictService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleDictServiceImpl extends BaseServiceImpl implements GuideModuleDictService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDictDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideModuleDictDTO get(String id) { + GuideModuleDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDictDTO dto) { + GuideModuleDictEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDictDTO dto) { + GuideModuleDictEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java new file mode 100644 index 0000000000..ce07f2e233 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideModuleServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideModuleDao; +import com.epmet.dto.GuideModuleDTO; +import com.epmet.entity.GuideModuleEntity; +import com.epmet.service.GuideModuleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 指南模块关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideModuleServiceImpl extends BaseServiceImpl implements GuideModuleService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideModuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideModuleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideModuleDTO get(String id) { + GuideModuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideModuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideModuleDTO dto) { + GuideModuleEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideModuleDTO dto) { + GuideModuleEntity entity = ConvertUtils.sourceToTarget(dto, GuideModuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java new file mode 100644 index 0000000000..5ac7a56e3e --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GuideDao; +import com.epmet.dto.GuideDTO; +import com.epmet.entity.GuideEntity; +import com.epmet.service.GuideService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 办事指南表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-09-06 + */ +@Service +public class GuideServiceImpl extends BaseServiceImpl implements GuideService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GuideDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GuideDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GuideDTO get(String id) { + GuideEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GuideDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GuideDTO dto) { + GuideEntity entity = ConvertUtils.sourceToTarget(dto, GuideEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GuideDTO dto) { + GuideEntity entity = ConvertUtils.sourceToTarget(dto, GuideEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml new file mode 100644 index 0000000000..7c34e2d2f2 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml new file mode 100644 index 0000000000..dad8bb6c4c --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDefaultDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDefaultDao.xml new file mode 100644 index 0000000000..af77665580 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCategoryDefaultDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml new file mode 100644 index 0000000000..69f598adf7 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideCollectionDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml new file mode 100644 index 0000000000..071bf38535 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml new file mode 100644 index 0000000000..e570f994b4 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideExternalLinkDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml new file mode 100644 index 0000000000..a75b2d018f --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml new file mode 100644 index 0000000000..be18e67c5d --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml new file mode 100644 index 0000000000..89cc9ac2e3 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDictDefaultDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From cbde6493a7a985d432cfe84efc4dc22e6d96e10c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 7 Sep 2021 09:21:22 +0800 Subject: [PATCH 46/60] =?UTF-8?q?=E5=85=A8=E9=83=A8=E5=85=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AllPartyFormDTO.java | 46 +++++++++++++++++++ .../epmet/dto/result/AllPartyResultDTO.java | 41 +++++++++++++++++ .../epmet/controller/ResiPointController.java | 12 +++++ .../UserPointStatisticalDailyService.java | 10 ++++ .../UserPointStatisticalDailyServiceImpl.java | 33 +++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java create mode 100644 epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java new file mode 100644 index 0000000000..ebfea4f918 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AllPartyFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:13 下午 + * @DESC + */ +@Data +public class AllPartyFormDTO implements Serializable { + + private static final long serialVersionUID = -600409785611581009L; + + + /** + * 页码 + **/ + private Integer pageNo = NumConstant.ONE; + + /** + * 每页数据条数 + **/ + private Integer pageSize = NumConstant.TEN; + + /** + * 本月 monthly 总排行 all; + * */ + private String type; + + /** + * 认证成功的党员 的用户ID + * */ + private List userIds; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java new file mode 100644 index 0000000000..25413e04a5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/AllPartyResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/6 3:12 下午 + * @DESC + */ +@Data +public class AllPartyResultDTO implements Serializable { + + private static final long serialVersionUID = -5889648842876122793L; + + /** + * 排序 + **/ + private Integer ranking; + + /** + * 积分 + **/ + private Integer point; + + /** + * 头像 + **/ + private String userHeadPhoto; + + /** + * 名称 + **/ + private String realName; + + /** + * 用户id + **/ + private String userId; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index b52a602ede..9f5ee8acf8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -159,6 +159,18 @@ public class ResiPointController { return new Result>().ok(resultDTOS); } + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + @PostMapping("allparty") + public Result> allParty(@RequestBody AllPartyFormDTO formDTO,@LoginUser TokenDto tokenDto){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(userPointStatisticalDailyService.allParty(formDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result> * @param tokenDto diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java index 6630a87891..1a82b5ca14 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -20,8 +20,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.AllPartyResultDTO; import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; @@ -125,4 +127,12 @@ public interface UserPointStatisticalDailyService extends BaseService listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO); + + /** + * @Description 全部党员积分排行 + * @Param formDTO + * @author zxc + * @date 2021/9/6 3:30 下午 + */ + List allParty(AllPartyFormDTO formDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 10ed45500f..23d0381cee 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -23,11 +23,13 @@ import com.epmet.common.enu.AroundPartyConstant; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.UserPointStatisticalDailyDao; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.AllPartyFormDTO; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.*; @@ -45,6 +47,7 @@ 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 org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -292,6 +295,36 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl allParty(AllPartyFormDTO formDTO) { + Result> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId()); + if (!partyMemberInfosResult.success()){ + throw new RenException("查询客户下的党员失败......"); + } + if (CollectionUtils.isEmpty(partyMemberInfosResult.getData())){ + return new ArrayList<>(); + } + List partyMemberInfos = partyMemberInfosResult.getData(); + List userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList()); + ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class); + selDto.setUserIds(userIds); + List resultDTOS = new ArrayList<>(); + if (AroundPartyConstant.ALL.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(selDto); + }else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ + resultDTOS = baseDao.selectListGridPartyRankByMonth(selDto); + } + resultDTOS = getPartyBaseInfo(resultDTOS); + List result = ConvertUtils.sourceToTarget(resultDTOS, AllPartyResultDTO.class); + return result; + } + /** * 获取认证通过的党员的 用户id * From ccfbbbe015db88bf35f510d025b6d6fb80ab4a5d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 7 Sep 2021 09:22:30 +0800 Subject: [PATCH 47/60] =?UTF-8?q?=E5=85=A8=E9=83=A8=E5=85=9A=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/UserPointStatisticalDailyServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 23d0381cee..aa9942312d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -303,6 +303,7 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl allParty(AllPartyFormDTO formDTO) { + formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); Result> partyMemberInfosResult = resiPartyMemberOpenFeignClient.getPartyMemberInfoByCustomerId(formDTO.getCustomerId()); if (!partyMemberInfosResult.success()){ throw new RenException("查询客户下的党员失败......"); From 50985c9532e0be039b92e2e9bc65560e922390a1 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 7 Sep 2021 10:36:28 +0800 Subject: [PATCH 48/60] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/resi/group/dto/group/result/CommentFileDTO.java | 2 ++ .../epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java | 2 +- .../epmet/modules/act/service/impl/ActCommentServiceImpl.java | 3 ++- .../modules/notice/service/impl/NoticeCommentServiceImpl.java | 2 +- .../topic/service/impl/ResiTopicCommentServiceImpl.java | 2 +- .../resources/mapper/notice/NoticeCommentAttachmentDao.xml | 1 + .../resources/mapper/topic/ResiTopicCommentAttachmentDao.xml | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java index f101a0a657..dfec88238a 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/CommentFileDTO.java @@ -22,5 +22,7 @@ public class CommentFileDTO implements Serializable { private Integer size; private Integer duration; @JsonIgnore + private String commentId; + @JsonIgnore private String userId; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java index 1044128fcf..f6d7488bb4 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java @@ -23,7 +23,7 @@ public class NoticeCommentFormDTO { * 评论内容300 */ @NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.UserShow.class}) - @Length(max = 20, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class}) + @Length(max = 300, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class}) private String commentContent; /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java index 98890462ca..a117db2b23 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/ActCommentServiceImpl.java @@ -169,6 +169,7 @@ public class ActCommentServiceImpl extends BaseServiceImpl fileList = actCommentAttachmentService.getActComFile(formDTO.getGroupActId()); @@ -184,7 +185,7 @@ public class ActCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); for (CommentFileDTO f : fileList) { - if (l.getCommentUserId().equals(f.getUserId())) { + if (l.getCommentId().equals(f.getCommentId()) && l.getCommentUserId().equals(f.getUserId())) { imageList.add(f); } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index a66e3869a5..0ab3dbbc09 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -224,7 +224,7 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); for (CommentFileDTO f : fileList) { - if (l.getUserId().equals(f.getUserId())) { + if (l.getNoticeCommentId().equals(f.getCommentId()) && l.getUserId().equals(f.getUserId())) { imageList.add(f); } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index 623338a5ec..ce928fed18 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -411,7 +411,7 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); for (CommentFileDTO f : fileList) { - if (l.getUserId().equals(f.getUserId())) { + if (l.getCommentId().equals(f.getCommentId()) && l.getUserId().equals(f.getUserId())) { imageList.add(f); } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml index 027cf9b729..d20f434692 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/notice/NoticeCommentAttachmentDao.xml @@ -12,6 +12,7 @@ attachment_url url, sort sort, duration duration, + notice_comment_id commentId, created_by userId FROM notice_comment_attachment diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml index ff7fcc59e9..f4616d1913 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentAttachmentDao.xml @@ -12,6 +12,7 @@ attachment_url url, sort sort, duration duration, + topic_comment_id commentId, created_by userId FROM resi_topic_comment_attachment From 7ab738da405a2435e963f5ca3962b7b3a33ff465 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 7 Sep 2021 10:39:16 +0800 Subject: [PATCH 49/60] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/act/ActCommentAttachmentDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml index 88a1997484..b74e6adc02 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActCommentAttachmentDao.xml @@ -12,6 +12,7 @@ attachment_url url, sort sort, duration duration, + act_comment_id commentId, created_by userId FROM act_comment_attachment From bc1c0b292e75abd43c4762b2e9cf072b0309978f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 7 Sep 2021 13:37:50 +0800 Subject: [PATCH 50/60] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/UserPointStatisticalDailyDao.java | 3 ++ .../UserPointStatisticalDailyServiceImpl.java | 10 ++--- .../mapper/UserPointStatisticalDailyDao.xml | 41 +++++++++++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java index 63a3e68c1c..2ae8bb24f5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; +import com.epmet.dto.result.AllPartyResultDTO; import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; import com.epmet.dto.result.ResiPointRankResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; @@ -73,6 +74,7 @@ public interface UserPointStatisticalDailyDao extends BaseDao selectListGridPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyNewRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); /** * 身边党员-积分排行 :按网格统计,对本月党员增加的积分 进行排序 @@ -82,4 +84,5 @@ public interface UserPointStatisticalDailyDao extends BaseDao selectListGridPartyRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); + List selectListGridPartyNewRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index aa9942312d..c75edbae56 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -315,14 +315,14 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl userIds = partyMemberInfos.stream().map(m -> m.getUserId()).collect(Collectors.toList()); ResiAroundPartyPointRankFormDTO selDto = ConvertUtils.sourceToTarget(formDTO, ResiAroundPartyPointRankFormDTO.class); selDto.setUserIds(userIds); - List resultDTOS = new ArrayList<>(); + List resultDTOS = new ArrayList<>(); if (AroundPartyConstant.ALL.equals(formDTO.getType())){ - resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(selDto); + resultDTOS = baseDao.selectListGridPartyNewRankByUsablePoint(selDto); }else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ - resultDTOS = baseDao.selectListGridPartyRankByMonth(selDto); + resultDTOS = baseDao.selectListGridPartyNewRankByMonth(selDto); } - resultDTOS = getPartyBaseInfo(resultDTOS); - List result = ConvertUtils.sourceToTarget(resultDTOS, AllPartyResultDTO.class); + List partyBaseInfo = getPartyBaseInfo(ConvertUtils.sourceToTarget(resultDTOS, ResiAroundPartyPointRankResultDTO.class)); + List result = ConvertUtils.sourceToTarget(partyBaseInfo, AllPartyResultDTO.class); return result; } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index d49ca80396..7d7677ffd1 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -184,4 +184,45 @@ ORDER BY P.point DESC LIMIT #{pageNo}, #{pageSize} + + + + From b5fcc12655cbb5fc5ee33712c4fcc2d2bdb12390 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 7 Sep 2021 13:50:52 +0800 Subject: [PATCH 51/60] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserPointStatisticalDailyDao.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml index 7d7677ffd1..49179803c7 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -186,6 +186,7 @@ + SELECT + g.ID AS "guideId", + g.TITLE AS "title", + gc.CATEGORY_NAME AS categoryName, + g.CREATED_BY AS createdId, + g.UPDATED_TIME AS updatedTime, + FROM + guide g + INNER JOIN guide_category gc ON g.CATEGORY_ID = gc.ID + WHERE g.DEL_FLAG = 0 + + AND g.PIDS LIKE CONCAT( '%', #{agencyId}, '%' ) + + + AND g.TITLE LIKE CONCAT( '%', #{guideTitle}, '%' ) + + + AND g.CATEGORY_ID = #{categoryId} + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml index a75b2d018f..3d329b642d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideModuleDao.xml @@ -16,6 +16,19 @@ + \ No newline at end of file From 9a66324acfe2f83c9125d217434eae04b1e29f74 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 8 Sep 2021 12:42:05 +0800 Subject: [PATCH 56/60] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=911.?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=B0=8F=E7=BB=84=E6=80=BB=E6=8E=92=E5=90=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 12 +++ .../redis/common/bean/GridInfoCache.java | 12 +++ .../com/epmet/dto/form/GroupPointFormDTO.java | 3 + .../result/GroupPointRankingResultDTO.java | 4 + .../controller/GroupPointController.java | 22 +++++- .../service/BizPointTotalDetailService.java | 7 +- .../impl/BizPointTotalDetailServiceImpl.java | 75 ++++++++++++++++--- .../group/dto/group/form/GroupFormDTO.java | 25 +------ .../group/result/GroupDetailResultDTO.java | 1 + .../resi/group/enums/SearchScopeTypeEnum.java | 22 ++++++ .../group/controller/ResiGroupController.java | 3 +- .../service/impl/ResiGroupServiceImpl.java | 6 +- 12 files changed, 152 insertions(+), 40 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index bcbded2bd6..0196f02f44 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -522,4 +522,16 @@ public class RedisKeys { public static String getCustomerStaffInfoKey(String customerId, String staffId) { return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId); } + + /** + * @description 网格信息 + * + * @param gridId + * @return + * @author wxz + * @date 2021.09.08 11:03:48 + */ + public static String getGridInfoKey(String gridId) { + return rootPrefix.concat("gov:grid:").concat(gridId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java new file mode 100644 index 0000000000..2900180581 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java @@ -0,0 +1,12 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +@Data +public class GridInfoCache { + private String gridId; + private String gridNamePath; + private String customerId; + private String pid; + private String pids; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java index 8e6ded72e1..d1124fe9b8 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/GroupPointFormDTO.java @@ -19,10 +19,13 @@ public class GroupPointFormDTO implements Serializable { public interface GroupPoint extends CustomerClientShowGroup {} public interface GridRank extends CustomerClientShowGroup {} public interface GridScopeRank extends CustomerClientShowGroup {} + public interface CustomerScopeRank extends CustomerClientShowGroup {} @NotBlank(message = "小组Id不能为空", groups = {GroupPoint.class, GridRank.class}) private String groupId; @NotBlank(message = "网格Id不能为空", groups = {GridRank.class, GridScopeRank.class}) private String gridId; + @NotBlank(message = "客户Id不能为空", groups = {CustomerScopeRank.class}) + private String customerId; /** 页码 */ private Integer pageNo = 1; diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java index e45a709d6e..b99d4313ac 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/GroupPointRankingResultDTO.java @@ -42,5 +42,9 @@ public class GroupPointRankingResultDTO implements Serializable { /** 类型 branch 支部小组;o */ private String groupType; + /** 所属网格id */ + private String gridId; + /** 所属网格名称 */ + private String gridNamePath; } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java index 55dbc70813..1ff898d97d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/GroupPointController.java @@ -11,6 +11,7 @@ import com.epmet.dto.result.GroupPointRankingResultDTO; import com.epmet.dto.result.GroupPointRuleResultDTO; import com.epmet.dto.result.PointRankingResultDTO; import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.service.BizPointTotalDetailService; import com.epmet.service.BizPointUserTotalDetailService; import com.epmet.service.PointRuleService; @@ -132,7 +133,26 @@ public class GroupPointController { Integer pageNo = formDTO.getPageNo(); Integer pageSize = formDTO.getPageSize(); - PageData page = bizPointTotalDetailService.listGroupPointRandingInGridScope(gridId, pageNo, pageSize); + PageData page = bizPointTotalDetailService.listGroupPointRandingInGridScope(SearchScopeTypeEnum.GRID, gridId,pageNo, pageSize); + return new Result>().ok(page); + } + + /** + * @description 【小组排名】- 客户范围内 + * + * @param formDTO + * @return + * @author wxz + * @date 2021.09.08 09:18:37 + */ + @PostMapping("grouppointranking/customerscope") + public Result> listGroupPointRandingInCustomerScope(@RequestBody GroupPointFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GroupPointFormDTO.CustomerScopeRank.class); + String customerId = formDTO.getCustomerId(); + Integer pageNo = formDTO.getPageNo(); + Integer pageSize = formDTO.getPageSize(); + + PageData page = bizPointTotalDetailService.listGroupPointRandingInGridScope(SearchScopeTypeEnum.CUSTOMER, customerId, pageNo, pageSize); return new Result>().ok(page); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java index 1d2a0af41e..0b64de14bc 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/BizPointTotalDetailService.java @@ -24,7 +24,7 @@ import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; import com.epmet.dto.result.GroupPointRankingResultDTO; import com.epmet.entity.BizPointTotalDetailEntity; -import com.github.pagehelper.PageInfo; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import java.util.List; import java.util.Map; @@ -140,12 +140,13 @@ public interface BizPointTotalDetailService extends BaseService listGroupPointRandingInGridScope(String gridId, Integer pageNo, Integer pageSize); + PageData listGroupPointRandingInGridScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java index 8d8648fc57..29723b68a2 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -27,12 +28,17 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; 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.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.BizPointTotalDetailDao; import com.epmet.dto.BizPointTotalDetailDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.GroupPointFormDTO; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.resi.group.dto.group.form.GroupFormDTO; import com.epmet.resi.group.dto.group.form.GroupPointDetailFormDTO; import com.epmet.resi.group.dto.group.result.GroupDetailResultDTO; @@ -40,6 +46,7 @@ import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; import com.epmet.dto.result.GroupPointRankingResultDTO; import com.epmet.entity.BizPointTotalDetailEntity; import com.epmet.resi.group.dto.group.ResiGroupDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.BizPointTotalDetailService; import com.epmet.service.BizPointUserTotalDetailService; @@ -50,6 +57,8 @@ import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -73,6 +82,10 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl redisTemplate; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; @Override public PageData page(Map params) { @@ -248,14 +261,17 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl listGroupPointRandingInGridScope(String gridId, Integer pageNo, Integer pageSize) { + public PageData listGroupPointRandingInGridScope(SearchScopeTypeEnum searchScopeType, String searchScopeId, Integer pageNo, Integer pageSize) { // 1.查询有积分的小组得分排名 PageInfo entityPageInfo = PageHelper.startPage(pageNo, pageSize).doSelectPageInfo(() -> { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(BizPointTotalDetailEntity::getGridId, gridId); + if (SearchScopeTypeEnum.CUSTOMER == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getCustomerId, searchScopeId); + } else if (SearchScopeTypeEnum.GRID == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getGridId, searchScopeId); + } query.eq(BizPointTotalDetailEntity::getBizType, "group"); - //query.eq(BizPointTotalDetailEntity::getDelFlag, 0); #用mybatis plus不需要手动指定,框架会自动指定 query.orderByDesc(BizPointTotalDetailEntity::getTotalPoint); baseDao.selectList(query); }); @@ -273,7 +289,11 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl groupIds.size()) { // 查出网格下已有积分的小组id LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(BizPointTotalDetailEntity::getGridId, gridId); + if (SearchScopeTypeEnum.CUSTOMER == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getCustomerId, searchScopeId); + } else if (SearchScopeTypeEnum.GRID == searchScopeType) { + query.eq(BizPointTotalDetailEntity::getGridId, searchScopeId); + } query.eq(BizPointTotalDetailEntity::getBizType, "group"); query.select(BizPointTotalDetailEntity::getObjectId); List existingGroupIds = baseDao.selectObjs(query).stream().map(obj -> obj.toString()).collect(Collectors.toList()); @@ -282,14 +302,17 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl gap; - gap = fillGroupPageGap(existingGroupIds, gridId, startRow, pageSize - groupList.size()); + gap = fillGroupPageGap(existingGroupIds, searchScopeType, searchScopeId, startRow, pageSize - groupList.size()); rankingInfoDTOs.addAll(gap); } // 4.排名填充 Integer ranking = page.getStartRow() + 1; for (GroupPointRankingResultDTO g : rankingInfoDTOs) { + GridInfoCache gridInfo = getGridInfo(g.getGridId()); g.setRanking(String.valueOf(ranking)); + g.setGridId(g.getGridId()); + g.setGridNamePath(gridInfo.getGridNamePath()); ranking ++; } PageData pageData = new PageData<>(rankingInfoDTOs, entityPageInfo.getTotal()); @@ -305,18 +328,18 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl fillGroupPageGap(List existingGroupIds,String searchScopeObjectId, Integer startRow, Integer rowCount) { + private List fillGroupPageGap(List existingGroupIds, SearchScopeTypeEnum searchScopeType, String searchScopeObjectId, Integer startRow, Integer rowCount) { GroupFormDTO form = new GroupFormDTO(); form.setExcludeGroupIds(existingGroupIds); form.setOrder(GroupFormDTO.OrderTypeEnum.DESC); form.setSort(GroupFormDTO.SortTypeEnum.CREATE_TIME); form.setStartRow(startRow); form.setRowCount(rowCount); - form.setSearchScopeType(GroupFormDTO.SearchScopeTypeEnum.GRID); + form.setSearchScopeType(searchScopeType); form.setSearchScopeObjectId(searchScopeObjectId); Result> result = resiGroupOpenFeignClient.listGroupDetailsExcludeGroupIds(form); - List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】网格内排名:查询积分为0的小组列表失败"); + List groups = getResultDataOrThrowsException(result, ServiceConstant.RESI_GROUP_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询积分为0的小组列表失败"); if (CollectionUtils.isEmpty(groups)) { return new ArrayList<>(); } @@ -327,12 +350,13 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl ope = redisTemplate.opsForHash(); + Map entries = ope.entries(RedisKeys.getGridInfoKey(gridId)); + if (entries.size() != 0) { + return BeanUtil.mapToBean(entries, GridInfoCache.class, true); + } + + CustomerGridFormDTO form = new CustomerGridFormDTO(); + form.setGridId(gridId); + Result result = govOrgOpenFeignClient.getCustomerGridByGridId(form); + if (result == null || !result.success() || result.getData() == null) { + return null; + } + + GridInfoCache cache = new GridInfoCache(); + cache.setCustomerId(result.getData().getCustomerId()); + cache.setGridId(result.getData().getId()); + cache.setGridNamePath(result.getData().getGridName()); + cache.setPid(result.getData().getPid()); + cache.setPids(result.getData().getPids()); + ope.putAll(RedisKeys.getGridInfoKey(gridId), BeanUtil.beanToMap(cache)); + return cache; + } } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java index 23e00b4485..96295879f1 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupFormDTO.java @@ -1,14 +1,10 @@ package com.epmet.resi.group.dto.group.form; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import lombok.Data; -import sun.security.provider.PolicySpiFile; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.List; -import java.util.PrimitiveIterator; /** * @author zhaoqifeng @@ -89,24 +85,5 @@ public class GroupFormDTO implements Serializable { } } - /** - * @Description 搜索范围类型枚举 - * @author wxz - * @date 2021.09.07 20:14:21 - */ - public enum SearchScopeTypeEnum { - - CUSTOMER("customer"), - GRID("grid"); - private String scopeType; - - SearchScopeTypeEnum(String scopeType) { - this.scopeType = scopeType; - } - - public String getScopeType() { - return scopeType; - } - } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java index 82793a5ffd..93247725a4 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupDetailResultDTO.java @@ -9,6 +9,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class GroupDetailResultDTO { + private String gridId; private String groupHeadPhoto; private String groupId; private String groupName; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java new file mode 100644 index 0000000000..474a2662a1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/enums/SearchScopeTypeEnum.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.enums; + +/** + * @Description 搜索范围类型枚举 + * @author wxz + * @date 2021.09.07 20:14:21 + */ +public enum SearchScopeTypeEnum { + + CUSTOMER("customer"), + GRID("grid"); + + private String scopeType; + + SearchScopeTypeEnum(String scopeType) { + this.scopeType = scopeType; + } + + public String getScopeType() { + return scopeType; + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index 57d8870685..5acbf76bb2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -33,6 +33,7 @@ import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO; import com.epmet.resi.group.dto.member.result.AchievementResultDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -630,7 +631,7 @@ public class ResiGroupController { List excludeGroupIds = form.getExcludeGroupIds(); GroupFormDTO.SortTypeEnum sort = form.getSort(); GroupFormDTO.OrderTypeEnum order = form.getOrder(); - GroupFormDTO.SearchScopeTypeEnum searchScopeType = form.getSearchScopeType(); + SearchScopeTypeEnum searchScopeType = form.getSearchScopeType(); String searchScopeObjectId = form.getSearchScopeObjectId(); List groups = resiGroupService.listGroupDetailsExcludeGroupIds(excludeGroupIds, startRow, rowCount, searchScopeType.getScopeType(), searchScopeObjectId, sort.getSortField(), order.getOrderType()); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 8abf0eba12..68586a600a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -81,6 +81,7 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; import com.epmet.resi.group.dto.member.result.AchievementResultDTO; import com.epmet.resi.group.dto.member.result.GroupAchievementDTO; +import com.epmet.resi.group.enums.SearchScopeTypeEnum; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -1809,9 +1810,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl Date: Wed, 8 Sep 2021 13:31:35 +0800 Subject: [PATCH 57/60] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8A=A0=E8=BF=94?= =?UTF-8?q?=E5=8F=82=E3=80=81=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/govorg/form/OrgStaffListFormDTO.java | 2 ++ .../service/govorg/impl/GovOrgServiceImpl.java | 14 ++++++++++---- .../mapper/epmetuser/CustomerStaffDao.xml | 11 ++++++++--- .../dto/group/result/GroupSummarizeResultDTO.java | 8 ++++++++ .../main/resources/mapper/group/ResiGroupDao.xml | 11 +++++++---- 5 files changed, 35 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java index 7d0ed2f595..391fe968c9 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java @@ -45,6 +45,8 @@ public class OrgStaffListFormDTO implements Serializable { private List staffIds; //token中用户Id private String staffId; + //人员是否禁用【未禁用enable,已禁用disabled】 + private String enableFlag = "enable"; public interface OrgStaff extends CustomerClientShowGroup {} } 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 b7b23299ab..8142f4a728 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 @@ -3,8 +3,10 @@ package com.epmet.dataaggre.service.govorg.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.*; @@ -28,10 +30,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; /** @@ -393,6 +392,13 @@ public class GovOrgServiceImpl implements GovOrgService { staffIds.removeIf(s->s.equals(formDTO.getStaffId())); } + //是否具有超级管理员或管理员角色 + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + Map roleMap = staffInfoCache.getRoleMap(); + if (roleMap.containsKey("root_manager") || roleMap.containsKey("manager")) { + formDTO.setEnableFlag("disabled"); + } + //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 List staffList = epmetUserService.getStaffInfoList(formDTO); 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 07039eeed0..a4ebcae961 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 @@ -61,7 +61,7 @@ SELECT DISTINCT sr.staff_id, cs.created_time, - case when gsr.role_key = + case when cs.enable_flag = 'enable' AND gsr.role_key = 'agency_leader' @@ -73,9 +73,14 @@ 'grid_manager' - then 1 else 0 end is_first + then 0 + when cs.enable_flag = 'enable' AND gsr.role_key != 'agency_leader' + then 1 else 2 end is_first FROM staff_role sr INNER JOIN customer_staff cs ON sr.staff_id = cs.user_id + + AND cs.enable_flag = 'enable' + INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId} WHERE sr.del_flag = '0' @@ -100,7 +105,7 @@ ) t GROUP BY t.staff_id - ORDER BY t.is_first ]]> 1, t.created_time desc + ORDER BY t.is_first ]]> 0, t.is_first asc, t.created_time desc LIMIT #{pageNo}, #{pageSize} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java index dbf681b90d..28755fffe8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupSummarizeResultDTO.java @@ -69,6 +69,14 @@ public class GroupSummarizeResultDTO implements Serializable { * 进组审核open开启;close关闭 */ private String auditSwitch; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + /** + * 小组类型名称 + */ + private String groupTypeName; private String level; public GroupSummarizeResultDTO(){ diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 82d1531781..a5893e1677 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -246,14 +246,17 @@ AND gmo.OPERATE_STATUS = 'under_auditting' ) AS totalApplyingMember, rgs.TOTAL_TOPICS, - rg.AUDIT_SWITCH + rg.AUDIT_SWITCH, + rg.group_type groupType, + gs.`name` groupTypeName FROM resi_group rg LEFT JOIN resi_group_statistical rgs ON ( rg.id = rgs.RESI_GROUP_ID ) LEFT JOIN resi_group_member rgm - ON ( rg.id = rgm.RESI_GROUP_ID - AND rgm.DEL_FLAG='0' - AND rgm.CUSTOMER_USER_ID =#{userId}) + ON ( rg.id = rgm.RESI_GROUP_ID + AND rgm.DEL_FLAG='0' + AND rgm.CUSTOMER_USER_ID =#{userId}) + LEFT JOIN resi_group_setup gs ON rg.GROUP_TYPE = gs.GROUP_TYPE AND gs.CUSTOMER_ID = 'default' WHERE rg.DEL_FLAG = '0' AND rgs.DEL_FLAG = '0' From d919a1c09ac9d6ec35c552e6a12333828ee0e1ae Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 8 Sep 2021 13:39:32 +0800 Subject: [PATCH 58/60] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/ResiGroupDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index bf17a2004e..4e7e7b418c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -77,8 +77,8 @@ AND rg.CUSTOMER_ID = #{customerId} AND rg.GRID_ID =#{gridId} AND rgm.CUSTOMER_USER_ID = #{userId} - AND rgm.STATUS IN ( 'approved', 'silent' ) - AND rg.STATE in('approved','hidden','closed') + AND rgm.STATUS IN ( 'approved', 'silent' ,'under_auditting') + AND rg.STATE in('approved','hidden','closed','under_auditting') AND rg.GROUP_TYPE = #{groupType} From de42e5226aef2d257607b7f076e6c0b750e63ff4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 8 Sep 2021 13:43:28 +0800 Subject: [PATCH 59/60] paixushijian --- .../src/main/resources/mapper/group/ResiGroupDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 4e7e7b418c..3d416b3a91 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -82,7 +82,7 @@ AND rg.GROUP_TYPE = #{groupType} - order by rg.LATEST_TOPIC_PUBLISH_DATE desc + order by rg.CREATED_TIME desc LIMIT #{pageNo}, #{pageSize} From 4777b56d32502c544a2639bb9381f42103c571e6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 8 Sep 2021 17:40:31 +0800 Subject: [PATCH 60/60] wxController --- .../com/epmet/controller/WxController.java | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/WxController.java diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/WxController.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/WxController.java new file mode 100644 index 0000000000..71fc73ef60 --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/controller/WxController.java @@ -0,0 +1,125 @@ + +package com.epmet.controller; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + + +/** + * desc:微信配置测试 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-08 + */ +@RestController +@RequestMapping("wechat") +public class WxController { + private static Logger log = LoggerFactory.getLogger(WxController.class); + + + @RequestMapping("check") + public void doGet(HttpServletRequest request, HttpServletResponse response) { + log.debug("weixin get..."); + // 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。 + String signature = request.getParameter("signature"); + // 时间戳 + String timestamp = request.getParameter("timestamp"); + // 随机数 + String nonce = request.getParameter("nonce"); + // 随机字符串 + String echostr = request.getParameter("echostr"); + + // 通过检验signature对请求进行校验,若校验成功则原样返回echostr,表示接入成功,否则接入失败 + PrintWriter out = null; + try { + out = response.getWriter(); + if (WxController.checkSignature(signature, timestamp, nonce)) { + log.debug("weixin get success...."); + out.print(echostr); + } + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (out != null) + out.close(); + } + } + + /** + * 与接口配置信息中的Token要一致 + */ + private static String token = "o2opri3hschiwit"; + + /** + * 验证签名 + * + * @param signature + * @param timestamp + * @param nonce + * @return + */ + public static boolean checkSignature(String signature, String timestamp, String nonce) { + String[] arr = new String[]{token, timestamp, nonce}; + // 将token、timestamp、nonce三个参数进行字典序排序 + Arrays.sort(arr); + StringBuilder content = new StringBuilder(); + for (int i = 0; i < arr.length; i++) { + content.append(arr[i]); + } + MessageDigest md = null; + String tmpStr = null; + + try { + md = MessageDigest.getInstance("SHA-1"); + // 将三个参数字符串拼接成一个字符串进行sha1加密 + byte[] digest = md.digest(content.toString().getBytes()); + tmpStr = byteToStr(digest); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + + content = null; + // 将sha1加密后的字符串可与signature对比,标识该请求来源于微信 + return tmpStr != null ? tmpStr.equals(signature.toUpperCase()) : false; + } + + /** + * 将字节数组转换为十六进制字符串 + * + * @param byteArray + * @return + */ + private static String byteToStr(byte[] byteArray) { + String strDigest = ""; + for (int i = 0; i < byteArray.length; i++) { + strDigest += byteToHexStr(byteArray[i]); + } + return strDigest; + } + + /** + * 将字节转换为十六进制字符串 + * + * @param mByte + * @return + */ + private static String byteToHexStr(byte mByte) { + char[] Digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + char[] tempArr = new char[2]; + tempArr[0] = Digit[(mByte >>> 4) & 0X0F]; + tempArr[1] = Digit[mByte & 0X0F]; + + String s = new String(tempArr); + return s; + } +}