diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql new file mode 100644 index 0000000000..70705df799 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql @@ -0,0 +1,11 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000014', 'ic_service_type', '服务类别', '', '20', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000000', '1000000000000000014', '社区养老', '00', '0', '', '0', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000001', '1000000000000000014', '社会保障', '01', '0', '', '1', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000002', '1000000000000000014', '社区救助', '02', '0', '', '2', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000003', '1000000000000000014', '健康医疗', '03', '0', '', '3', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000004', '1000000000000000014', '社区安全', '04', '0', '', '4', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000005', '1000000000000000014', '社区卫生', '05', '0', '', '5', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000006', '1000000000000000014', '社区环境', '06', '0', '', '6', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000007', '1000000000000000014', '社区治安', '07', '0', '', '7', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000008', '1000000000000000014', '社区文化', '08', '0', '', '8', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); diff --git a/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml b/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml index ab8ee06fa8..94112d1c19 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/logback-spring.xml @@ -133,12 +133,36 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -152,6 +176,10 @@ + + + + diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index ab5eccfc39..dd48a5577f 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -288,7 +288,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); logger.error("登录:查询部门列表异常:{}", errorStackTrace); } - return null; + return new HashSet<>(); } /** diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index 3c0b35ff4d..749eef2360 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -147,12 +147,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { updatedTime = metaObject.getValue(FieldConstant.UPDATED_TIME_HUMP); } if (updatedTime == null) { - if(metaObject.hasGetter(FieldConstant.CREATED_TIME_HUMP)) { - updatedTime = metaObject.getValue(FieldConstant.CREATED_TIME_HUMP); - } - if(updatedTime == null) { - updatedTime = new Date(); - } + updatedTime = new Date(); } return updatedTime; } @@ -165,13 +160,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { } if (value == null) { - if(metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) { - value = metaObject.getValue(FieldConstant.CREATED_BY_HUMP); - } - - if(null == value) { - value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG); - } + value = Optional.ofNullable(loginUserUtil.getLoginUserId()).orElse(Constant.APP_USER_FLAG); } return value; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index a813af8152..6c8f4271ce 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -25,6 +25,7 @@ public enum DictTypeEnum { ITEM_TYPE_QUERY("item_type_query","居民信息组件查询方式",14), SELF_ORG_CATEGORY("self_org_category","社区自组织分类",15), IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), + IC_SERVICE_TYPE("ic_service_type","服务类别",20), ; private final String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java new file mode 100644 index 0000000000..9009bdb141 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HomeMemberOperationEnum.java @@ -0,0 +1,42 @@ +package com.epmet.commons.tools.enums; + +/** + * 组织级别枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum HomeMemberOperationEnum { + + + ADD("add", "新增"), + UPDATE("update", "修改"), + DELETE("delele", "删除"); + + + private String code; + private String name; + + + HomeMemberOperationEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java new file mode 100644 index 0000000000..09f17a92a3 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/HouseQrcodeEnum.java @@ -0,0 +1,41 @@ +package com.epmet.commons.tools.enums; + +/** +* @describe: 一户一档二维码信息 +* @author wangtong +* @date 2022/6/1 13:34 +* @params +* @return +*/ +public enum HouseQrcodeEnum { + + SUFFIX(".png", "二维码格式的后缀"), + PREFIX_KEY("house_qrcode_pre", "二维码格式的前缀key"); +// PREFIX("https://epmet-dev.elinkservice.cn/cqrcode-ty/", "二维码地址的前缀"); + + + private String code; + private String name; + + + HouseQrcodeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 13b7d37057..d03143dd81 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -194,7 +194,13 @@ public enum RequirePermissionEnum { /** * 基层治理-群众直报 功能入口 */ - RESI_EVENT_MANAGE("resi_event_manage","基层治理:群众直报","基层治理-群众直报"); + RESI_EVENT_MANAGE("resi_event_manage","基层治理:群众直报","基层治理-群众直报"), + + /** + * 事件管理-工作端小程序列表、详情接口权限 + */ + IC_EVENT_LIST("ic_event_list","基层治理:事件管理:列表","基层治理-事件管理-列表"), + IC_EVENT_DETAIL("ic_event_detail","基层治理:事件管理:详情","基层治理-事件管理-详情"); private String key; private String name; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ed274b2c28..425417c7d5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -256,7 +256,9 @@ public enum EpmetErrorCode { RESI_IC_NAT(8925,"已存在记录,请联系社区工作人员修改"), IC_MOVE_IN(8926,"居民信息中房屋信息与当前选择房屋不一致,是否更新?"), NOT_REGEIST_RESI(8927,"未注册居民"), + UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"), + MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"), //通用错误码 start //通用的 错误消息自己定义返回 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java new file mode 100644 index 0000000000..0f8f937a8a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.feign.fallback.CommonUserFeignClientFallBackFactory; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.utils.Result; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * @Author zqf + * @DateTime 2022/3/17 1:42 下午 + * @DESC + */ +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = CommonUserFeignClientFallBackFactory.class) +public interface CommonUserFeignClient { + @PostMapping("/epmetuser/userbaseinfo/getUserInfo/{userId}") + Result getUserInfo(@PathVariable("userId") String userId); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallBackFactory.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallBackFactory.java new file mode 100644 index 0000000000..269ee6d985 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallBackFactory.java @@ -0,0 +1,24 @@ +package com.epmet.commons.tools.feign.fallback; + +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.CommonUserFeignClient; +import feign.hystrix.FallbackFactory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * @Author zqf + * @DateTime 2022/3/17 1:46 下午 + * @DESC + */ +@Slf4j +@Component +public class CommonUserFeignClientFallBackFactory implements FallbackFactory { + private CommonUserFeignClientFallback fallback = new CommonUserFeignClientFallback(); + @Override + public CommonUserFeignClient create(Throwable cause) { + log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); + return fallback; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java new file mode 100644 index 0000000000..8cd5660484 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java @@ -0,0 +1,23 @@ +package com.epmet.commons.tools.feign.fallback; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.feign.CommonUserFeignClient; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import org.springframework.stereotype.Component; + +/** + * 调用政府端权限 + * @Author zqf + * @Description + * @Date 2020/4/24 11:17 + **/ +@Component +public class CommonUserFeignClientFallback implements CommonUserFeignClient { + + @Override + public Result getUserInfo(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserInfo", userId); + } +} 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 05e5c200a4..89e8a70ab3 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 @@ -101,7 +101,7 @@ public class RedisKeys { * epmet:sys:security:user:token字符串 */ public static String getCpUserKey(String app, String client, String userId) { - return rootPrefix.concat("sys:security:user:").concat(app).concat(":").concat(client).concat(":").concat(userId); + return rootPrefix.concat("sys:security:user:").concat(app).concat(StrConstant.COLON).concat(client).concat(StrConstant.COLON).concat(userId); } /** @@ -200,7 +200,7 @@ public class RedisKeys { * @return */ public static String getRoleOpeScopesKey(String roleId, String opeKey) { - return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(":").concat(opeKey); + return rootPrefix.concat("gov:access:role:opescopes:").concat(roleId).concat(StrConstant.COLON).concat(opeKey); } /** @@ -338,7 +338,7 @@ public class RedisKeys { * @return */ public static String getCustomerStatsCalFlag(String customerId) { - return getCustomerStatsCalKeyPrefix().concat(":").concat(customerId); + return getCustomerStatsCalKeyPrefix().concat(StrConstant.COLON).concat(customerId); } /** @@ -364,7 +364,7 @@ public class RedisKeys { * @return */ public static String getCustomerFootbarKey(String customerId, String appType) { - return rootPrefix.concat("footbar").concat(":").concat(customerId).concat(":").concat(appType); + return rootPrefix.concat("footbar").concat(StrConstant.COLON).concat(customerId).concat(StrConstant.COLON).concat(appType); } @@ -397,7 +397,7 @@ public class RedisKeys { * @date 2020.11.05 13:34 */ public static String getResiUserBadgeKey(String customerId, String userId) { - return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(StringUtils.isBlank(userId) ? "*" : userId); + return rootPrefix.concat("badge:user:").concat(customerId).concat(StrConstant.COLON).concat(StringUtils.isBlank(userId) ? "*" : userId); } /** @@ -483,7 +483,7 @@ public class RedisKeys { **/ public static String getGroupMsgReadKey(String source, String groupId, String sourceId) { String currentMonth= DateUtils.getBeforeNMonth(NumConstant.ZERO); - return "groupread:".concat(currentMonth).concat(":").concat(source).concat(":").concat(groupId).concat(":").concat(sourceId); + return "groupread:".concat(currentMonth).concat(StrConstant.COLON).concat(source).concat(StrConstant.COLON).concat(groupId).concat(StrConstant.COLON).concat(sourceId); } /** @@ -497,7 +497,7 @@ public class RedisKeys { **/ public static String getGroupMsgShouldReadUser(String source, String groupId, String sourceId) { String currentMonth= DateUtils.getBeforeNMonth(NumConstant.ZERO); - return "groupread:user:".concat(currentMonth).concat(":").concat(source).concat(":").concat(groupId).concat(":").concat(sourceId); + return "groupread:user:".concat(currentMonth).concat(StrConstant.COLON).concat(source).concat(StrConstant.COLON).concat(groupId).concat(StrConstant.COLON).concat(sourceId); } /** @@ -560,7 +560,7 @@ public class RedisKeys { * @date 2021.09.23 17:38:37 */ public static String getQuestionnaireAccessKey(String userId, String qKey) { - return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(":").concat(qKey); + return rootPrefix.concat("questionnaire:accesskey:").concat(userId).concat(StrConstant.COLON).concat(qKey); } /** @@ -594,7 +594,7 @@ public class RedisKeys { * @date 2021.10.25 17:49:43 */ public static String loginTicket(String app, String ticket) { - return rootPrefix.concat("sys:security:ticket:").concat(app).concat(":").concat(ticket); + return rootPrefix.concat("sys:security:ticket:").concat(app).concat(StrConstant.COLON).concat(ticket); } /** @@ -649,7 +649,7 @@ public class RedisKeys { } public static String getHouseInfoCacheKey(String houseId,String customerId){ - return rootPrefix.concat("house:").concat(customerId).concat(":").concat(houseId); + return rootPrefix.concat("house:").concat(customerId).concat(StrConstant.COLON).concat(houseId); } /** @@ -671,7 +671,7 @@ public class RedisKeys { * @return */ public static String icResiImportTypeKey(String importTag, String type) { - return icResiImportBaseKey(importTag).concat(":").concat(type); + return icResiImportBaseKey(importTag).concat(StrConstant.COLON).concat(type); } /** @@ -682,7 +682,7 @@ public class RedisKeys { * @return */ public static String icResiImportResiCategoryKey(String importTag, String type, String resiId) { - return icResiImportTypeKey(importTag, type).concat(":").concat(resiId); + return icResiImportTypeKey(importTag, type).concat(StrConstant.COLON).concat(resiId); } /** @@ -693,7 +693,7 @@ public class RedisKeys { * @date 2022/2/14 9:38 上午 */ public static String getTemporaryHouseInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryHouse:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryHouse:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -704,7 +704,7 @@ public class RedisKeys { * @date 2022/2/14 9:38 上午 */ public static String getTemporaryGridInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryGrid:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryGrid:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -715,7 +715,7 @@ public class RedisKeys { * @date 2022/2/14 9:39 上午 */ public static String getTemporaryNeighborHoodInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryNeighborHood:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryNeighborHood:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -726,7 +726,7 @@ public class RedisKeys { * @date 2022/2/14 9:39 上午 */ public static String getTemporaryBuildingInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryBuilding:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryBuilding:").concat(customerId).concat(StrConstant.COLON).concat(userId); } /** @@ -737,15 +737,15 @@ public class RedisKeys { * @date 2022/2/14 1:54 下午 */ public static String getTemporaryBuildingUnitInfoCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryBuildingUnit:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryBuildingUnit:").concat(customerId).concat(StrConstant.COLON).concat(userId); } public static String getTemporaryImportResultCacheKey(String customerId,String userId){ - return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(":").concat(userId); + return rootPrefix.concat("temporary:").concat("temporaryResult:").concat(customerId).concat(StrConstant.COLON).concat(userId); } - public static String getCustomerMenuList(String customerId, Integer type) { - return getCustomerMenuListPrefix().concat(customerId).concat(":type:")+type; + public static String getCustomerMenuList(String customerId, Integer type, String tableName) { + return getCustomerMenuListPrefix().concat("type:").concat(type.toString()).concat(":tableName:").concat(tableName).concat(StrConstant.COLON).concat(customerId); } /** @@ -753,7 +753,7 @@ public class RedisKeys { * @return */ public static String getCustomerMenuListPrefix() { - return rootPrefix.concat("oper:access:nav:customerId:"); + return rootPrefix.concat("gov:access:nav:"); } /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java new file mode 100644 index 0000000000..5b34fcdee7 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java @@ -0,0 +1,90 @@ +package com.epmet.commons.tools.redis.common; + +import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.feign.CommonUserFeignClient; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.Nullable; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.util.Map; + +/** + * 居民缓存通用类 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-22 + */ +@Slf4j +@Component +public class CustomerResiUserRedis { + @Resource + private RedisUtils redisUtils; + @Resource + private CommonUserFeignClient commonUserFeignClient; + + private static CustomerResiUserRedis customerResiUserRedis; + private static final String ROLE_MAP_KEY = "roleMap"; + + @PostConstruct + public void init() { + customerResiUserRedis = this; + customerResiUserRedis.redisUtils = this.redisUtils; + customerResiUserRedis.commonUserFeignClient = this.commonUserFeignClient; + } + + /** + * desc: 获取居民缓存 + * + * @param userId + * @return com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache + * @author LiuJanJun + * @date 2021/8/19 10:29 下午 + * @remark 此方法仅用于 获取某个工作人员的信息,不用于获取客户下所有工作人员信息 + */ + public static ResiUserInfoCache getUserBaseInfo(String userId) { + if (StringUtils.isBlank(userId)){ + log.warn("getUserBaseInfo param is blank,userId:{}",userId); + return null; + } + String key = RedisKeys.getResiUserKey(userId); + Map map = customerResiUserRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(map)) { + return ConvertUtils.mapToEntity(map, ResiUserInfoCache.class); + } + + ResiUserInfoCache resultData = reloadStaffCache(userId, key); + if (resultData == null) { + return null; + } + + return resultData; + } + + @Nullable + private static ResiUserInfoCache reloadStaffCache(String userId, String key) { + Result result = customerResiUserRedis.commonUserFeignClient.getUserInfo(userId); + if (result == null || !result.success()) { + throw new RenException("获取居民信息失败"); + } + ResiUserInfoCache resultData = result.getData(); + if (null == resultData) { + log.warn("居民信息为空,userId:{}", userId); + return null; + } + + Map map = BeanUtil.beanToMap(resultData, false, true); + customerResiUserRedis.redisUtils.hMSet(key, map); + return resultData; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java index 4c6551b881..075a954290 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java @@ -89,4 +89,21 @@ public class HouseInfoCache implements Serializable { * 组织的area_code */ private String areaCode; + + /** + * 网格id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 房屋编码 + */ + private String houseCode; + /** + * 二维码地址 + */ + private String houseQrcodeUrl; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/ResiUserInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/ResiUserInfoCache.java new file mode 100644 index 0000000000..6cba629aca --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/ResiUserInfoCache.java @@ -0,0 +1,99 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 房屋信息缓存 + * @author Administrator + */ +@Data +public class ResiUserInfoCache implements Serializable { + private String id; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 网格Id + * */ + private String registeredGridId; + + /** + * xx机关-yy网格 + * */ + private String registeredGridName; + + /** + * 显示昵称 xx网格-y先生/女士 + * */ + private String showName; + + /** + * xxx街道-尹女士 + */ + private String userShowName; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java index 1d201149f4..b6d1f518a1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ @@ -11,10 +11,14 @@ package com.epmet.commons.tools.security.config; import com.epmet.commons.tools.security.resolver.LoginUserHandlerMethodArgumentResolver; import com.epmet.commons.tools.security.resolver.UserDetailHandlerMethodArgumentResolver; import com.epmet.commons.tools.utils.DateUtils; +import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -27,9 +31,10 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import java.io.IOException; +import java.lang.reflect.Field; import java.text.SimpleDateFormat; -import java.util.List; -import java.util.TimeZone; +import java.util.*; /** * MVC配置 @@ -43,6 +48,7 @@ public class WebMvcConfig implements WebMvcConfigurer { private UserDetailHandlerMethodArgumentResolver userDetailHandlerMethodArgumentResolver; @Autowired private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver; + @Override public void addArgumentResolvers(List argumentResolvers) { argumentResolvers.add(loginUserHandlerMethodArgumentResolver); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java index ee92fbeb26..199fe6dcdb 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java @@ -7,6 +7,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import cn.afterturn.easypoi.excel.imports.ExcelImportService; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.web.multipart.MultipartFile; @@ -228,6 +229,27 @@ public class ExcelPoiUtils { throw new IOException(e.getMessage()); } } + + public static ExcelImportResult importExcel1(InputStream inputStream, Integer titleRows, Integer headerRows, Class pojoClass) throws IOException { + if (inputStream == null) { + return null; + } + ImportParams params = new ImportParams(); + params.setTitleRows(titleRows); + params.setHeadRows(headerRows); + params.setSaveUrl("/tmp/excel/"); + params.setNeedSave(true); + try { + // return ExcelImportUtil.importExcel(inputStream, pojoClass, params); + return (new ExcelImportService()).importExcelByIs(inputStream, pojoClass, params, false); + } catch (NoSuchElementException e) { + throw new IOException("excel文件不能为空"); + } catch (Exception e) { + throw new IOException(e.getMessage()); + } + } + + /** * excel 导入,有错误信息 * diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java new file mode 100644 index 0000000000..bb667af0c9 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HouseQRcodeUtils.java @@ -0,0 +1,171 @@ +package com.epmet.commons.tools.utils; + + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.EncodeHintType; +import com.google.zxing.MultiFormatWriter; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageConfig; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.common.CharacterSetECI; +import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; +import lombok.extern.slf4j.Slf4j; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +/** + * Date: 2022/06/7 10:01 + * Description:房屋一户一码生成工具类 + */ +@Slf4j +public class HouseQRcodeUtils { + /** + * 二维码颜色 默认是黑色 + */ + private static final Color QRCOLOR = Color.black; + /** + * 背景颜色 + */ + private static final Color BGWHITE = Color.white; + public static final int WIDTH = 800; + public static final int HEIGHT = 800; + public static final int MARGIN = 10; + public static final int FONTSIZE = 40; + + + + /** + * 房屋一户一码生成-指定像素 + * + * @param contents 说明 + * @return BufferedImage + * @throws Exception + */ + public static BufferedImage drawHouseQRImage(String pressText, String contents) throws Exception { + BufferedImage qRImage = null; + if (contents == null || "".equals(contents)) { + throw new Exception("content说明不能为空"); + } + // 二维码参数设置 + HashMap hints = new HashMap<>(); + hints.put(EncodeHintType.CHARACTER_SET, CharacterSetECI.UTF8); // 编码设置 + hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); // 安全等级,最高h + hints.put(EncodeHintType.MARGIN, MARGIN); // 设置margin=0-10 + + // 二维码图片的生成 + BarcodeFormat format = BarcodeFormat.QR_CODE; + // 创建矩阵容器 + BitMatrix matrix = null; + try { + matrix = new MultiFormatWriter().encode(contents, format, WIDTH, HEIGHT, hints); + } catch (WriterException e) { + log.error("method exception", e); + } + + // 设置矩阵转为图片的参数 + MatrixToImageConfig toImageConfig = new MatrixToImageConfig(QRCOLOR.getRGB(), BGWHITE.getRGB()); + + // 矩阵转换图像 + qRImage = MatrixToImageWriter.toBufferedImage(matrix, toImageConfig); + return pressHouseText(pressText, qRImage); + } + + /** + * @param pressText 二维码下方插入文字 + * @param image 需要添加文字的图片 + * @为图片添加文字 + */ + private static BufferedImage pressHouseText(String pressText, BufferedImage image) throws Exception { + + BufferedImage outImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); + //计算文字开始的位置 + //x开始的位置:(图片宽度-字体大小*字的个数)/2 + int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2; + //y开始的位置:图片高度-(图片高度-图片宽度)/2 +// int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE; + int startY = 740; + + int imageW = outImage.getWidth(); + int imageH = outImage.getHeight(); + Graphics2D g = outImage.createGraphics(); + g.drawImage(image, 0, 0, imageW, imageH, null); + g.setColor(QRCOLOR); + g.setFont(new Font("Noto Sans SC Light", Font.BOLD, FONTSIZE)); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g.setBackground(Color.white); +// 获取文字数量 按照字节展示 + int size = pressText.getBytes("GBK").length; +// 获取一行最多能容纳多少文字 按照文字字节展示 + int maxSize = (WIDTH / FONTSIZE - 2) * 2; + if (size > maxSize) { + int v = size % maxSize; + for (int a = 0; a < (size / maxSize); a++) { + String s = outStringByByte(pressText, maxSize); + g.drawString(s, (WIDTH - (FONTSIZE * (WIDTH / FONTSIZE - 2))) / 2, startY); + pressText = pressText.substring(s.length(), pressText.length()); + startY = startY + 35; + } + if (v != 0) { + g.drawString(pressText, (WIDTH - (FONTSIZE * v)) / 2, startY); + } + } else { + g.drawString(pressText, (WIDTH - ((pressText.getBytes("GBK").length) / 2) * FONTSIZE) / 2, startY); + } + + g.dispose(); + return outImage; + } + + + + /** + * 保存二维码图片到本地 + * + * @param contents + * @throws Exception + */ + public static void createImg(String pressText, String contents, String filename, String filePath) throws Exception { + BufferedImage qRImageWithLogo = drawHouseQRImage(pressText, contents); + // 写入返回 + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ImageIO.write(qRImageWithLogo, "jpg", baos); + //图片类型 + String imageType = "jpg"; + //生成二维码存放文件 + File file = new File(filePath + filename + ".jpg"); + if (!file.exists()) { + file.mkdirs(); + } + ImageIO.write(qRImageWithLogo, imageType, file); + baos.close(); + } + + + private static String outStringByByte(String str, int len) throws IOException { + byte[] btf = str.getBytes("GBK"); + int count = 0; + + for (int j = len - 1; j >= 0; j--) { + if (btf[j] < 0) { + count++; + } else { + break; + } + } + + if (count % 2 == 0) { + return new String(btf, 0, len, "GBK"); + } else { + return new String(btf, 0, len - 1, "GBK"); + } + } + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IDCardUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IDCardUtil.java new file mode 100644 index 0000000000..3ec57c53f5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IDCardUtil.java @@ -0,0 +1,132 @@ +package com.epmet.commons.tools.utils; + +import com.epmet.commons.tools.enums.GenderEnum; +import org.apache.commons.lang3.StringUtils; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/13 17:53 + */ +public class IDCardUtil { + /** + * 15位身份证号 + */ + private static final Integer FIFTEEN_ID_CARD=15; + /** + * 18位身份证号 + */ + private static final Integer EIGHTEEN_ID_CARD=18; + private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + + /** + * 根据身份证号获取性别 + * @param idCard + * @return + */ + public static String getSex(String idCard){ + String sex =""; + if (StringUtils.isNotBlank(idCard)){ + //15位身份证号 + if (idCard.length() == FIFTEEN_ID_CARD){ + if (Integer.parseInt(idCard.substring(14, 15)) % 2 == 0) { + sex = GenderEnum.WOMAN.getCode(); + } else { + sex = GenderEnum.MAN.getCode(); + } + //18位身份证号 + }else if(idCard.length() == EIGHTEEN_ID_CARD){ + // 判断性别 + if (Integer.parseInt(idCard.substring(16).substring(0, 1)) % 2 == 0) { + sex = GenderEnum.WOMAN.getCode(); + } else { + sex = GenderEnum.MAN.getCode(); + } + } + } + return sex; + } + + /** + * 根据身份证号获取年龄 + * @param idCard + * @return + */ + public static Integer getAge(String idCard){ + int age = 0; + Date date = new Date(); + if (StringUtils.isNotBlank(idCard)){ + //15位身份证号 + if (idCard.length() == FIFTEEN_ID_CARD){ + // 身份证上的年份(15位身份证为1980年前的) + String uyear = "19" + idCard.substring(6, 8); + // 身份证上的月份 + String uyue = idCard.substring(8, 10); + // 当前年份 + String fyear = format.format(date).substring(0, 4); + // 当前月份 + String fyue = format.format(date).substring(5, 7); + if (Integer.parseInt(uyue) <= Integer.parseInt(fyue)) { + age = Integer.parseInt(fyear) - Integer.parseInt(uyear) + 1; + // 当前用户还没过生 + } else { + age = Integer.parseInt(fyear) - Integer.parseInt(uyear); + } + //18位身份证号 + }else if(idCard.length() == EIGHTEEN_ID_CARD){ + // 身份证上的年份 + String year = idCard.substring(6).substring(0, 4); + // 身份证上的月份 + String yue = idCard.substring(10).substring(0, 2); + // 当前年份 + String fyear = format.format(date).substring(0, 4); + // 当前月份 + String fyue = format.format(date).substring(5, 7); + // 当前月份大于用户出身的月份表示已过生日 + if (Integer.parseInt(yue) <= Integer.parseInt(fyue)) { + age = Integer.parseInt(fyear) - Integer.parseInt(year) + 1; + // 当前用户还没过生日 + } else { + age = Integer.parseInt(fyear) - Integer.parseInt(year); + } + } + } + return age; + } + + /** + * 获取出生日期 yyyy年MM月dd日 + * @param idCard + * @return + */ + public static String getBirthday(String idCard){ + String birthday=""; + String year=""; + String month=""; + String day=""; + if (StringUtils.isNotBlank(idCard)){ + //15位身份证号 + if (idCard.length() == FIFTEEN_ID_CARD){ + // 身份证上的年份(15位身份证为1980年前的) + year = "19" + idCard.substring(6, 8); + //身份证上的月份 + month = idCard.substring(8, 10); + //身份证上的日期 + day= idCard.substring(10, 12); + //18位身份证号 + }else if(idCard.length() == EIGHTEEN_ID_CARD){ + // 身份证上的年份 + year = idCard.substring(6).substring(0, 4); + // 身份证上的月份 + month = idCard.substring(10).substring(0, 2); + //身份证上的日期 + day=idCard.substring(12).substring(0,2); + } + birthday=year+"-"+month+"-"+day; + } + return birthday; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java new file mode 100644 index 0000000000..8f28cef145 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTree.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.utils; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class NodeTree implements Serializable { + private static final long serialVersionUID = 8020505121785861117L; + /** + * 主键 + */ + private String id; + /** + * 上级ID + */ + private String pid; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPid() { + return pid; + } + + public void setPid(String pid) { + this.pid = pid; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java new file mode 100644 index 0000000000..1c3df168ee --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/NodeTreeUtils.java @@ -0,0 +1,31 @@ +package com.epmet.commons.tools.utils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public class NodeTreeUtils { + + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(T treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(T node : nodeMap.values()) { + T parent = nodeMap.get(node.getPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index add7341a75..d4bdb13bb2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -203,6 +203,7 @@ INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.DEPT_ID = u.ORG_ID AND org.DEL_FLAG = '0' + WHERE diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java new file mode 100644 index 0000000000..862f85649f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyUserHouseDailyDTO.java @@ -0,0 +1,148 @@ +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactAgencyUserHouseDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+AGENCY_ID+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java new file mode 100644 index 0000000000..1da0d57339 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridUserHouseDailyDTO.java @@ -0,0 +1,139 @@ +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactGridUserHouseDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+grid_id+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 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/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java new file mode 100644 index 0000000000..9a2a6d7328 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactNeighborhoodUserHouseDailyDTO.java @@ -0,0 +1,149 @@ +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class FactNeighborhoodUserHouseDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+grid_id+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区ID + */ + private String neighbourhoodsId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java new file mode 100644 index 0000000000..ed7492dbee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/FactUserHouseFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.stats.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactUserHouseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * level + */ + private String level; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java new file mode 100644 index 0000000000..37c080deee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/FactUserHouseResultDTO.java @@ -0,0 +1,169 @@ +package com.epmet.dto.stats.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactUserHouseResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键,customer_id+AGENCY_ID+date_id只有一条记录 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织id + */ + private String agencyName; + + /** + * 小区ID + */ + private String neighbourhoodsId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + + /** + * 删除标识 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/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 595977d64c..67f56957dc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -13,6 +13,7 @@ import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; @@ -368,4 +369,13 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/screenextract/data_check") Result dataCheck(@RequestBody ExtractOriginFormDTO formDTO); + + @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatGrid") + Result userHouseStatGrid(@RequestBody FactUserHouseFormDTO formDTO); + + @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatAgency") + Result userHouseStatAgency(@RequestBody FactUserHouseFormDTO formDTO); + + @PostMapping("/data/stats/factAgencyUserHouseDaily/userHouseStatNeighborhood") + Result userHouseStatNeighborhood(@RequestBody FactUserHouseFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 43e2a3445c..b5bb0013c4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -14,6 +14,7 @@ import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; import com.epmet.dto.user.form.StaffBaseInfoFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.GridUserInfoDTO; @@ -351,4 +352,19 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result dataCheck(ExtractOriginFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "dataCheck", formDTO); } + + @Override + public Result userHouseStatGrid(FactUserHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatGrid", formDTO); + } + + @Override + public Result userHouseStatAgency(FactUserHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatAgency", formDTO); + } + + @Override + public Result userHouseStatNeighborhood(FactUserHouseFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "userHouseStatNeighborhood", formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java new file mode 100644 index 0000000000..3ff1e7df16 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactUserHouseController.java @@ -0,0 +1,103 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.excel.FactUserHouseExcel; +import com.epmet.service.stats.FactUserHouseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("factAgencyUserHouseDaily") +public class FactUserHouseController { + + @Autowired + private FactUserHouseService factUserHouseService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = factUserHouseService.page(params); + return new Result>().ok(page); + } + + /** + * 合计 + * + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @RequestMapping("total") + public Result total(@RequestParam Map params) { + FactUserHouseResultDTO dto = factUserHouseService.total(params); + return new Result().ok(dto); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = factUserHouseService.list(params); + if (list.isEmpty()) { + FactUserHouseResultDTO dto = new FactUserHouseResultDTO(); + list.add(dto); + } + ExcelUtils.exportExcelToTarget(response, null, list, FactUserHouseExcel.class); + } + + /** + * 统计网格纬度 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @PostMapping("userHouseStatGrid") + public Result userHouseStatGrid(@RequestBody FactUserHouseFormDTO formDTO) { + factUserHouseService.statGrid(formDTO); + return new Result(); + } + + /** + * 统计小区纬度 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author wgf + * @date 2022/5/31 9:48 + */ + @PostMapping("userHouseStatNeighborhood") + public Result userHouseStatNeighborhood(@RequestBody FactUserHouseFormDTO formDTO) { + factUserHouseService.statNeighborhood(formDTO); + return new Result(); + } + + /** + * 统计组织纬度 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/31 9:48 + */ + @PostMapping("userHouseStatAgency") + public Result userHouseStatAgency(@RequestBody FactUserHouseFormDTO formDTO) { + factUserHouseService.statAgency(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java new file mode 100644 index 0000000000..5e3d1e5477 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/IcHouseDao.java @@ -0,0 +1,28 @@ +package com.epmet.dao.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.org.IcHouseEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Mapper +public interface IcHouseDao extends BaseDao { + + List houseStat(FactUserHouseFormDTO formDTO); + + List houseStatNew(FactUserHouseFormDTO formDTO); + + List neighborhoodStatStat(FactUserHouseFormDTO formDTO); + + List neighborhoodStatStatNew(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java new file mode 100644 index 0000000000..3bbdef4df6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyUserHouseDailyDao.java @@ -0,0 +1,26 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface FactAgencyUserHouseDailyDao extends BaseDao { + + List listPage(Map params); + + List getTotal(Map params); + + void deleteByDateId(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java new file mode 100644 index 0000000000..515333fc6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridUserHouseDailyDao.java @@ -0,0 +1,28 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface FactGridUserHouseDailyDao extends BaseDao { + + List listPage(Map params); + + List getTotal(Map params); + + List statAgency(FactUserHouseFormDTO formDTO); + + void deleteByDateId(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java new file mode 100644 index 0000000000..e83fb2dcc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactNeighborhoodUserHouseDailyDao.java @@ -0,0 +1,27 @@ +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Mapper +public interface FactNeighborhoodUserHouseDailyDao extends BaseDao { + + void deleteByDateId(FactUserHouseFormDTO formDTO); + + List listPage(Map params); + + List getTotal(Map params); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java new file mode 100644 index 0000000000..e879641504 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/IcResiUserDao.java @@ -0,0 +1,42 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.user.IcResiUserEntity; +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-10-26 + */ +@Mapper +public interface IcResiUserDao extends BaseDao { + + List userStat(FactUserHouseFormDTO formDTO); + + List userStatNew(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 4120ed76c5..ce6447a5e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -238,6 +238,8 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { this.eventUnResolvedCount=NumConstant.ZERO; this.workEventResolvedCount=NumConstant.ZERO; this.workEventUnResolvedCount=NumConstant.ZERO; + this.icEventResolvedCount = NumConstant.ZERO; + this.icEventUnResolvedCount = NumConstant.ZERO; this.inGroupTopicResolvedCount=NumConstant.ZERO; this.inGroupTopicUnResolvedCount=NumConstant.ZERO; this.fromIssueResolvedInGridCount=NumConstant.ZERO; @@ -248,5 +250,6 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { this.communityClosedCount=NumConstant.ZERO; this.streetClosedCount=NumConstant.ZERO; this.districtDeptClosedCount=NumConstant.ZERO; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.java new file mode 100644 index 0000000000..889f5b3d86 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/IcHouseEntity.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.entity.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 房屋信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_house") +public class IcHouseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小区id + */ + private String neighborHoodId; + + /** + * 片区id,neighbor_hood_part.id,可为空。 + */ + private String partId; + + /** + * 所属楼栋id + */ + private String buildingId; + + /** + * 所属单元id + */ + private String buildingUnitId; + + /** + * 房屋名字后台插入时生成 + */ + private String houseName; + + /** + * 门牌号 + */ + private String doorName; + + /** + * 房屋类型,这里存储字典value就可以 + */ + private String houseType; + + /** + * 存储字典value + */ + private String purpose; + + /** + * 1出租;0未出租 + */ + private Integer rentFlag; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证号 + */ + private String ownerIdCard; + + /** + * 排序 + */ + private BigDecimal sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java new file mode 100644 index 0000000000..2426a984d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyUserHouseDailyEntity.java @@ -0,0 +1,118 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_user_house_daily") +public class FactAgencyUserHouseDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java new file mode 100644 index 0000000000..58075e335e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridUserHouseDailyEntity.java @@ -0,0 +1,109 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_user_house_daily") +public class FactGridUserHouseDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java new file mode 100644 index 0000000000..2c48798b2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactNeighborhoodUserHouseDailyEntity.java @@ -0,0 +1,119 @@ +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_neighborhood_user_house_daily") +public class FactNeighborhoodUserHouseDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 小区ID + */ + private String neighbourhoodsId; + + /** + * 小区名称 + */ + private String neighborHoodName; + + /** + * 房屋总数 + */ + private Integer houseCount; + + /** + * 小区总数 + */ + private Integer neighbourhoodsCount; + + /** + * 自住房屋总数 + */ + private Integer houseSelfCount; + + /** + * 出租房屋总数 + */ + private Integer houseLeaseCount; + + /** + * 闲置房屋总数 + */ + private Integer houseIdleCount; + + /** + * 居民总数 + */ + private Integer userCount; + + /** + * 常住居民总数 + */ + private Integer userResiCount; + + /** + * 流动居民总数 + */ + private Integer userFloatCount; + + /** + * 当日新增房屋数 + */ + private Integer houseIncr; + + /** + * 当日修改房屋数 + */ + private Integer houseModify; + + /** + * 当日新增居民数 + */ + private Integer userIncr; + + /** + * 当日修改居民数 + */ + private Integer userModify; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java new file mode 100644 index 0000000000..4a2260b045 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/user/IcResiUserEntity.java @@ -0,0 +1,513 @@ +/** + * 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.user; + +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-10-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_user") +public class IcResiUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 是否本地户籍 + */ + private String isBdhj; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系人电话 + */ + private String contactsMobile; + + /** + * 九小场所url + */ + private String ninePlace; + + /** + * 是否党员 + */ + private String isParty; + + /** + * 是否低保户 + */ + private String isDbh; + + /** + * 是否保障房 + */ + private String isEnsureHouse; + + /** + * 是否失业 + */ + private String isUnemployed; + + /** + * 是否育龄妇女 + */ + private String isYlfn; + + /** + * 是否退役军人 + */ + private String isVeterans; + + /** + * 是否统战人员 + */ + private String isUnitedFront; + + /** + * 是否信访人员 + */ + private String isXfry; + + /** + * 是否志愿者 + */ + private String isVolunteer; + + /** + * 是否老年人 + */ + private String isOldPeople; + + /** + * 是否空巢 + */ + private String isKc; + + /** + * 是否失独 + */ + private String isSd; + + /** + * 是否失能 + */ + private String isSn; + + /** + * 是否失智 + */ + private String isSz; + + /** + * 是否残疾 + */ + private String isCj; + + /** + * 是否大病 + */ + private String isDb; + + /** + * 是否慢病 + */ + private String isMb; + + /** + * 是否特殊人群 + */ + private String isSpecial; + + /** + * 是否租户【是:1 否:0】 + */ + private String isTenant; + + /** + * 是否流动人口【是:1 否:0】 + */ + private String isFloating; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 文化程度备注 + */ + private String cultureRemakes; + + /** + * 特长【字典表】 + */ + private String specialSkill; + + /** + * 兴趣爱好 + */ + private String hobby; + + /** + * 兴趣爱好备注 + */ + private String hobbyRemakes; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 宗教信仰备注 + */ + private String faithRemakes; + + /** + * 残疾类别【字典表】 + */ + private String cjlb; + + /** + * 残疾登记(状况)【字典表】 + */ + private String cjzk; + + /** + * 残疾证号 + */ + private String cjzh; + + /** + * 残疾说明 + */ + private String cjsm; + + /** + * 有无监护人【yes no】 + */ + private String ynJdr; + + /** + * 有无技能特长【yes no】 + */ + private String ynJntc; + + /** + * 有无劳动能力 + */ + private String ynLdnl; + + /** + * 有无非义务教育阶段助学【yes no】 + */ + private String ynFywjyjdzx; + + /** + * 所患大病 + */ + private String shdb; + + /** + * 患大病时间 + */ + private String dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private String mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private String jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private String ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 籍贯 + */ + private String jg; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 人户情况 + */ + private String rhzk; + + /** + * 居住信息备注 + */ + private String jzxxRemakes; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 与户主关系【字典表】 + */ + private String yhzgx; + + /** + * 居住情况【字典表】 + */ + private String jzqk; + + /** + * 婚姻状况【字典表】 + */ + private String hyzk; + + /** + * 配偶情况【字典表】 + */ + private String poqk; + + /** + * 有无赡养人 + */ + private String ynSyr; + + /** + * 与赡养人关系【字典表】 + */ + private String ysyrgx; + + /** + * 赡养人电话 + */ + private String syrMobile; + + /** + * 家庭信息备注 + */ + private String jtxxRemakes; + + /** + * 用户状态【0:正常;1:迁出;2:注销】 + */ + private String status; + + /** + * 用户详细状态:01:新增、02:导入、03:迁入、04:新生、11:迁出、21死亡 + */ + private String subStatus; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + + /** + * 预留字段6 + */ + private String field6; + + /** + * 预留字段7 + */ + private String field7; + + /** + * 预留字段8 + */ + private String field8; + + /** + * 预留字段9 + */ + private String field9; + + /** + * 预留字段10 + */ + private String field10; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java new file mode 100644 index 0000000000..47e4445591 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/excel/FactUserHouseExcel.java @@ -0,0 +1,56 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class FactUserHouseExcel { + + @Excel(name = "组织结构") + private String agencyName; + + @Excel(name = "小区数") + private Integer neighbourhoodsCount; + + @Excel(name = "房屋数") + private Integer houseCount; + + @Excel(name = "自住房屋数") + private Integer houseSelfCount; + + @Excel(name = "出租房屋数") + private Integer houseLeaseCount; + + @Excel(name = "闲置房屋数") + private Integer houseIdleCount; + + @Excel(name = "居民总数") + private Integer userCount; + + @Excel(name = "常住人口数") + private Integer userResiCount; + + @Excel(name = "流动人口数") + private Integer userFloatCount; + + @Excel(name = "新增房屋数") + private Integer houseIncr; + + @Excel(name = "新增人口数") + private Integer userIncr; + + @Excel(name = "修改房屋数") + private Integer houseModify; + + @Excel(name = "修改人口数") + private Integer userModify; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/HouseService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/HouseService.java new file mode 100644 index 0000000000..5eafd8cc88 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/HouseService.java @@ -0,0 +1,73 @@ +/** + * 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.org; + +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; + +import java.util.List; + +/** + * 小区表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-25 + */ +public interface HouseService { + + /** + * 房屋统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List houseStat(FactUserHouseFormDTO formDTO); + + /** + * 房屋统计(小区) + * + * @param formDTO + * @return java.util.List + * @author wgf + * @date 2022/5/30 13:33 + */ + List houseStatNew(FactUserHouseFormDTO formDTO); + + /** + * 小区统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List neighborhoodStat(FactUserHouseFormDTO formDTO); + + /** + * 小区统计(小区) + * + * @param formDTO + * @return java.util.List + * @author wgf + * @date 2022/5/30 13:33 + */ + List neighborhoodStatNew(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java new file mode 100644 index 0000000000..f6e74ac689 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/HouseServiceImpl.java @@ -0,0 +1,42 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.IcHouseDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.org.IcHouseEntity; +import com.epmet.service.org.HouseService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@DataSource(DataSourceConstant.GOV_ORG) +@Service +public class HouseServiceImpl extends BaseServiceImpl implements HouseService, ResultDataResolver { + + @Override + public List houseStat(FactUserHouseFormDTO formDTO) { + return baseDao.houseStat(formDTO); + } + + @Override + public List houseStatNew(FactUserHouseFormDTO formDTO) { + return baseDao.houseStatNew(formDTO); + } + + @Override + public List neighborhoodStat(FactUserHouseFormDTO formDTO) { + return baseDao.neighborhoodStatStat(formDTO); + } + + @Override + public List neighborhoodStatNew(FactUserHouseFormDTO formDTO) { + return baseDao.neighborhoodStatStatNew(formDTO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java new file mode 100644 index 0000000000..9a31152d55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyUserHouseDailyService.java @@ -0,0 +1,111 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface FactAgencyUserHouseDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 分页合计 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + FactUserHouseResultDTO getTotal(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 查询导出数据 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List listExport(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyUserHouseDailyDTO + * @author generator + * @date 2022-05-27 + */ + FactAgencyUserHouseDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(FactAgencyUserHouseDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(FactAgencyUserHouseDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * 物理删除历史数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:32 + */ + void deleteByDateId(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java new file mode 100644 index 0000000000..36dd9046a5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridUserHouseDailyService.java @@ -0,0 +1,120 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface FactGridUserHouseDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 页面合计 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + FactUserHouseResultDTO getTotal(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 查询导出数据 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List listExport(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGridUserHouseDailyDTO + * @author generator + * @date 2022-05-27 + */ + FactGridUserHouseDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(FactGridUserHouseDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(FactGridUserHouseDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * 物理删除历史数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:32 + */ + void deleteByDateId(FactUserHouseFormDTO formDTO); + + /** + * 根据网格统计组织数据 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:32 + */ + List statAgency(FactUserHouseFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java new file mode 100644 index 0000000000..4c8905bae4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactNeighborhoodUserHouseDailyService.java @@ -0,0 +1,113 @@ +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +public interface FactNeighborhoodUserHouseDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactNeighborhoodUserHouseDailyDTO + * @author generator + * @date 2022-06-01 + */ + FactNeighborhoodUserHouseDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void save(FactNeighborhoodUserHouseDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void update(FactNeighborhoodUserHouseDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-01 + */ + void delete(String[] ids); + + + /** + * 物理删除历史数据 + * + * @param formDTO + * @return void + * @author wgf + * @date 2022/5/30 13:32 + */ + void deleteByDateId(FactUserHouseFormDTO formDTO); + + /** + * 查询导出数据 + * + * @param params + * @return java.util.List + * @author wgf + * @date 2022-05-27 + */ + List listExport(Map params); + + /** + * 页面合计 + * + * @param params + * @return PageData + * @author wgf + * @date 2022-05-27 + */ + FactUserHouseResultDTO getTotal(Map params); + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java new file mode 100644 index 0000000000..9221627c48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactUserHouseService.java @@ -0,0 +1,78 @@ +package com.epmet.service.stats; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface FactUserHouseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 页面合计 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + FactUserHouseResultDTO total(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 人房网格数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:31 + */ + void statGrid(FactUserHouseFormDTO formDTO); + + /** + * 人房小区数据 + * + * @param formDTO + * @return void + * @author wgf + * @date 2022/5/30 13:31 + */ + void statNeighborhood(FactUserHouseFormDTO formDTO); + + /** + * 人房组织数据 + * + * @param formDTO + * @return void + * @author zhy + * @date 2022/5/30 13:31 + */ + void statAgency(FactUserHouseFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java index 9ff2671fbb..044f6e63d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -81,9 +81,11 @@ public class DimGridServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String customerId = (String)params.get("customerId"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(customerId), "CUSTOMER_ID", customerId); return wrapper; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java new file mode 100644 index 0000000000..8fbf82b671 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyUserHouseDailyServiceImpl.java @@ -0,0 +1,121 @@ +package com.epmet.service.stats.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.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactAgencyUserHouseDailyDao; +import com.epmet.dto.stats.FactAgencyUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; +import com.epmet.service.stats.FactAgencyUserHouseDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class FactAgencyUserHouseDailyServiceImpl extends BaseServiceImpl implements FactAgencyUserHouseDailyService { + + @Autowired + private LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + IPage page = getPage(params); + List list = baseDao.listPage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public FactUserHouseResultDTO getTotal(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + List list = baseDao.getTotal(params); + + // 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算 + if (list.size() == NumConstant.ZERO) { + return null; + } else if (list.size() == NumConstant.ONE) { + return list.get(0); + } else { + FactUserHouseResultDTO first = list.get(0); + FactUserHouseResultDTO last = list.get(list.size() - 1); + FactUserHouseResultDTO dto = last; + dto.setHouseIncr(last.getHouseIncr() - first.getHouseIncr()); + dto.setHouseModify(last.getHouseModify() - first.getHouseModify()); + dto.setUserIncr(last.getUserIncr() - first.getUserIncr()); + dto.setUserModify(last.getUserModify() - first.getUserModify()); + return dto; + } + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyUserHouseDailyDTO.class); + } + + @Override + public List listExport(Map params) { + return baseDao.listPage(params); + } + + 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 FactAgencyUserHouseDailyDTO get(String id) { + FactAgencyUserHouseDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyUserHouseDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyUserHouseDailyDTO dto) { + FactAgencyUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyUserHouseDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyUserHouseDailyDTO dto) { + FactAgencyUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyUserHouseDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteByDateId(FactUserHouseFormDTO formDTO) { + baseDao.deleteByDateId(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java new file mode 100644 index 0000000000..7aef227b16 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridUserHouseDailyServiceImpl.java @@ -0,0 +1,138 @@ +package com.epmet.service.stats.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.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactGridUserHouseDailyDao; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import com.epmet.service.stats.FactGridUserHouseDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class FactGridUserHouseDailyServiceImpl extends BaseServiceImpl implements FactGridUserHouseDailyService { + + @Autowired + private LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + IPage page = getPage(params); + List list = baseDao.listPage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public FactUserHouseResultDTO getTotal(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + List list = baseDao.getTotal(params); + + // 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算 + if (list.size() == NumConstant.ZERO) { + return null; + } else if (list.size() == NumConstant.ONE) { + return list.get(0); + } else { + Integer houseIncr = 0; + Integer houseModify = 0; + Integer userIncr = 0; + Integer userModify = 0; + for(FactUserHouseResultDTO factUserHouseResultDTO : list){ + houseIncr = houseIncr + factUserHouseResultDTO.getHouseIncr(); + houseModify = houseModify + factUserHouseResultDTO.getHouseModify(); + userIncr = userIncr + factUserHouseResultDTO.getUserIncr(); + userModify = userModify + factUserHouseResultDTO.getUserModify(); + } + FactUserHouseResultDTO dto = list.get(list.size() - 1); + dto.setHouseIncr(houseIncr); + dto.setHouseModify(houseModify); + dto.setUserIncr(userIncr); + dto.setUserModify(userModify); + return dto; + } + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGridUserHouseDailyDTO.class); + } + + @Override + public List listExport(Map params) { + return baseDao.listPage(params); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String dateId = (String) params.get("dateId"); + String customerId = (String) params.get("customerId"); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + wrapper.eq(StringUtils.isNotBlank(dateId), "DATE_ID", dateId); + wrapper.eq(StringUtils.isNotBlank(customerId), "CUSTOMER_ID", customerId); + + return wrapper; + } + + @Override + public FactGridUserHouseDailyDTO get(String id) { + FactGridUserHouseDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGridUserHouseDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGridUserHouseDailyDTO dto) { + FactGridUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGridUserHouseDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGridUserHouseDailyDTO dto) { + FactGridUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGridUserHouseDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteByDateId(FactUserHouseFormDTO formDTO) { + baseDao.deleteByDateId(formDTO); + } + + @Override + public List statAgency(FactUserHouseFormDTO formDTO) { + return baseDao.statAgency(formDTO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java new file mode 100644 index 0000000000..8772511aa0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactNeighborhoodUserHouseDailyServiceImpl.java @@ -0,0 +1,129 @@ +package com.epmet.service.stats.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.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.stats.FactNeighborhoodUserHouseDailyDao; +import com.epmet.dto.stats.FactNeighborhoodUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; +import com.epmet.service.stats.FactNeighborhoodUserHouseDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 网格的人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Service +public class FactNeighborhoodUserHouseDailyServiceImpl extends BaseServiceImpl implements FactNeighborhoodUserHouseDailyService { + + @Autowired + private LoginUserUtil loginUserUtil; + + @Override + public PageData page(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + IPage page = getPage(params); + List list = baseDao.listPage(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactNeighborhoodUserHouseDailyDTO.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 FactNeighborhoodUserHouseDailyDTO get(String id) { + FactNeighborhoodUserHouseDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactNeighborhoodUserHouseDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactNeighborhoodUserHouseDailyDTO dto) { + FactNeighborhoodUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactNeighborhoodUserHouseDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactNeighborhoodUserHouseDailyDTO dto) { + FactNeighborhoodUserHouseDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactNeighborhoodUserHouseDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void deleteByDateId(FactUserHouseFormDTO formDTO) { + baseDao.deleteByDateId(formDTO); + } + + @Override + public List listExport(Map params) { + return baseDao.listPage(params); + } + + @Override + public FactUserHouseResultDTO getTotal(Map params) { + params.put("customerId", loginUserUtil.getLoginUserCustomerId()); + List list = baseDao.getTotal(params); + + // 只有当日数据直接展示,否则需要统计时间段内两天差值进行Incr和Modify数据计算 + if (list.size() == NumConstant.ZERO) { + return null; + } else if (list.size() == NumConstant.ONE) { + return list.get(0); + } else { + Integer houseIncr = 0; + Integer houseModify = 0; + Integer userIncr = 0; + Integer userModify = 0; + for(FactUserHouseResultDTO factUserHouseResultDTO : list){ + houseIncr = houseIncr + factUserHouseResultDTO.getHouseIncr(); + houseModify = houseModify + factUserHouseResultDTO.getHouseModify(); + userIncr = userIncr + factUserHouseResultDTO.getUserIncr(); + userModify = userModify + factUserHouseResultDTO.getUserModify(); + } + FactUserHouseResultDTO dto = list.get(list.size() - 1); + dto.setHouseIncr(houseIncr); + dto.setHouseModify(houseModify); + dto.setUserIncr(userIncr); + dto.setUserModify(userModify); + return dto; + } + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java new file mode 100644 index 0000000000..db20e4ccc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactUserHouseServiceImpl.java @@ -0,0 +1,307 @@ +package com.epmet.service.stats.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.stats.FactGridUserHouseDailyDTO; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.stats.FactAgencyUserHouseDailyEntity; +import com.epmet.entity.stats.FactGridUserHouseDailyEntity; +import com.epmet.entity.stats.FactNeighborhoodUserHouseDailyEntity; +import com.epmet.service.org.HouseService; +import com.epmet.service.stats.*; +import com.epmet.service.user.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * 人房信息统计数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +@Slf4j +public class FactUserHouseServiceImpl implements FactUserHouseService { + + @Autowired + private FactAgencyUserHouseDailyService factAgencyUserHouseDailyService; + + @Autowired + private FactGridUserHouseDailyService factGridUserHouseDailyService; + + @Autowired + private FactNeighborhoodUserHouseDailyService factNeighborhoodUserHouseDailyService; + + @Autowired + private HouseService houseService; + + @Autowired + private IcResiUserService icResiUserService; + + @Autowired + private DimGridService dimGridService; + + @Override + public PageData page(Map params) { + PageData page = null; + if (params.containsKey("startTime") && params.containsKey("endTime")) { + if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) { + params.put("dateId", StringUtils.EMPTY); + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + if (params.containsKey("level")) { + if("neighborhood".equals(params.get("level").toString()) || OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())){ + page = factNeighborhoodUserHouseDailyService.page(params); + + }else if (OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) { + page = factGridUserHouseDailyService.page(params); + } else { + page = factAgencyUserHouseDailyService.page(params); + } + } + return page; + } + + @Override + public FactUserHouseResultDTO total(Map params) { + FactUserHouseResultDTO dto = null; + // 不查询时间段默认查询当天 + if (params.containsKey("startTime") && params.containsKey("endTime")) { + if (StringUtils.isNotBlank(params.get("startTime").toString()) && StringUtils.isNotBlank(params.get("endTime").toString())) { + params.put("dateId", StringUtils.EMPTY); + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + } else { + params.put("dateId", DateUtils.getBeforeNDay(NumConstant.ONE)); + } + // 网格纬度查询网格统计表,其余纬度查询组织统计表 + if (params.containsKey("level")) { + if("neighborhood".equals(params.get("level").toString())){ + dto = factNeighborhoodUserHouseDailyService.getTotal(params); + }else if (OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())) { + dto = factGridUserHouseDailyService.getTotal(params); + } else { + dto = factAgencyUserHouseDailyService.getTotal(params); + } + } + return dto; + } + + @Override + public List list(Map params) { + List list = new ArrayList<>(); + if (params.containsKey("level")) { + if("neighborhood".equals(params.get("level").toString()) || OrgLevelEnum.GRID.getCode().equals(params.get("level").toString())){ + list = factNeighborhoodUserHouseDailyService.listExport(params); + }else if (OrgLevelEnum.COMMUNITY.getCode().equals(params.get("level").toString())) { + list = factGridUserHouseDailyService.listExport(params); + } else { + list = factAgencyUserHouseDailyService.listExport(params); + } + } + FactUserHouseResultDTO dto = total(params); + if (dto != null) { + dto.setAgencyName("合计"); + } + list.add(dto); + return list; + } + + @Override + public void statGrid(FactUserHouseFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + String dateId = formDTO.getDateId(); + String customerId = formDTO.getCustomerId(); + + // 先删除历史 + factGridUserHouseDailyService.deleteByDateId(formDTO); + + // 保证小区是全部网格后,其余数据进行循环匹配 + List neiList = houseService.neighborhoodStat(formDTO); + List houseList = houseService.houseStat(formDTO); + List userList = icResiUserService.userStat(formDTO); + + List addList = new ArrayList<>(); + + neiList.forEach(item -> { + String gridId = item.getGridId(); + FactUserHouseResultDTO dto = new FactUserHouseResultDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setDateId(dateId); + dto.setGridId(gridId); + dto.setPid(item.getPid()); + dto.setPids(item.getPids()); + dto.setNeighbourhoodsCount(item.getNeighbourhoodsCount()); + + Optional houseOptional = houseList.stream().filter(house -> gridId.equals(house.getGridId()) && customerId.equals(house.getCustomerId())).findFirst(); + if (houseOptional.isPresent()) { + dto.setHouseCount(houseOptional.get().getHouseCount()); + dto.setHouseSelfCount(houseOptional.get().getHouseSelfCount()); + dto.setHouseLeaseCount(houseOptional.get().getHouseLeaseCount()); + dto.setHouseIdleCount(houseOptional.get().getHouseIdleCount()); + dto.setHouseIncr(houseOptional.get().getHouseIncr()); + dto.setHouseModify(houseOptional.get().getHouseModify()); + } else { + dto.setHouseCount(NumConstant.ZERO); + dto.setHouseSelfCount(NumConstant.ZERO); + dto.setHouseLeaseCount(NumConstant.ZERO); + dto.setHouseIdleCount(NumConstant.ZERO); + dto.setHouseIncr(NumConstant.ZERO); + dto.setHouseModify(NumConstant.ZERO); + } + + Optional userOptional = userList.stream().filter(user -> gridId.equals(user.getGridId()) && customerId.equals(user.getCustomerId())).findFirst(); + if (userOptional.isPresent()) { + dto.setUserCount(userOptional.get().getUserCount()); + dto.setUserResiCount(userOptional.get().getUserResiCount()); + dto.setUserFloatCount(userOptional.get().getUserFloatCount()); + dto.setUserIncr(userOptional.get().getUserIncr()); + dto.setUserModify(userOptional.get().getUserModify()); + } else { + dto.setUserCount(NumConstant.ZERO); + dto.setUserResiCount(NumConstant.ZERO); + dto.setUserFloatCount(NumConstant.ZERO); + dto.setUserIncr(NumConstant.ZERO); + dto.setUserModify(NumConstant.ZERO); + } + addList.add(dto); + }); + + List entityList = ConvertUtils.sourceToTarget(addList, FactGridUserHouseDailyEntity.class); + factGridUserHouseDailyService.insertBatch(entityList); + } + + + /** + * 小区 + * @author wgf + * @param formDTO + */ + @Override + public void statNeighborhood(FactUserHouseFormDTO formDTO) { + log.info("$$$进入业务逻辑"); + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + String dateId = formDTO.getDateId(); + String customerId = formDTO.getCustomerId(); + + // 先删除历史 + factNeighborhoodUserHouseDailyService.deleteByDateId(formDTO); + log.info("$$$删除历史完成"); + // 保证小区是全部网格后,其余数据进行循环匹配 + List neiList = houseService.neighborhoodStatNew(formDTO); + List houseList = houseService.houseStatNew(formDTO); + List userList = icResiUserService.userStatNew(formDTO); + + List addList = new ArrayList<>(); + + neiList.forEach(item -> { + String gridId = item.getGridId() == null ? "" : item.getGridId(); + String neighborHoodsId = item.getNeighbourhoodsId(); + FactUserHouseResultDTO dto = new FactUserHouseResultDTO(); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setDateId(dateId); + dto.setGridId(gridId); + dto.setPid(item.getPid() == null ? "" : item.getPid()); + dto.setPids(item.getPids() == null ? "" : item.getPids()); + dto.setNeighbourhoodsCount(item.getNeighbourhoodsCount()); + dto.setNeighbourhoodsId(item.getNeighbourhoodsId()); + dto.setNeighborHoodName(item.getNeighborHoodName()); + + Optional houseOptional = houseList.stream().filter(house -> neighborHoodsId.equals(house.getNeighbourhoodsId()) && customerId.equals(house.getCustomerId())).findFirst(); + if (houseOptional.isPresent()) { + dto.setHouseCount(houseOptional.get().getHouseCount()); + dto.setHouseSelfCount(houseOptional.get().getHouseSelfCount()); + dto.setHouseLeaseCount(houseOptional.get().getHouseLeaseCount()); + dto.setHouseIdleCount(houseOptional.get().getHouseIdleCount()); + } else { + dto.setHouseCount(NumConstant.ZERO); + dto.setHouseSelfCount(NumConstant.ZERO); + dto.setHouseLeaseCount(NumConstant.ZERO); + dto.setHouseIdleCount(NumConstant.ZERO); + } + + Optional userOptional = userList.stream().filter(user -> neighborHoodsId.equals(user.getNeighbourhoodsId()) && customerId.equals(user.getCustomerId())).findFirst(); + if (userOptional.isPresent()) { + dto.setUserCount(userOptional.get().getUserCount()); + dto.setUserResiCount(userOptional.get().getUserResiCount()); + dto.setUserFloatCount(userOptional.get().getUserFloatCount()); + } else { + dto.setUserCount(NumConstant.ZERO); + dto.setUserResiCount(NumConstant.ZERO); + dto.setUserFloatCount(NumConstant.ZERO); + } + addList.add(dto); + }); + log.info("$$$addList:::::" + addList); + List entityList = ConvertUtils.sourceToTarget(addList, FactNeighborhoodUserHouseDailyEntity.class); + factNeighborhoodUserHouseDailyService.insertBatch(entityList); + } + + @Override + public void statAgency(FactUserHouseFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); + } + + Map params = new HashMap<>(); + params.put("dateId", formDTO.getDateId()); + params.put("customerId", formDTO.getCustomerId()); + List list = factGridUserHouseDailyService.list(params); + if (list.isEmpty()) { + return; + } + + // 先删除历史 + factAgencyUserHouseDailyService.deleteByDateId(formDTO); + + // 使用机构表左关联,对不同纬度的机构进行分组统计 + formDTO.setLevel("community"); + List commList = factGridUserHouseDailyService.statAgency(formDTO); + if (!commList.isEmpty()) { + commList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(commList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("street"); + List streetList = factGridUserHouseDailyService.statAgency(formDTO); + if (!streetList.isEmpty()) { + streetList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(streetList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("district"); + List districtList = factGridUserHouseDailyService.statAgency(formDTO); + if (!districtList.isEmpty()) { + districtList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(districtList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("city"); + List cityList = factGridUserHouseDailyService.statAgency(formDTO); + if (!cityList.isEmpty()) { + cityList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(cityList, FactAgencyUserHouseDailyEntity.class)); + } + formDTO.setLevel("province"); + List provinceList = factGridUserHouseDailyService.statAgency(formDTO); + if (!provinceList.isEmpty()) { + provinceList.forEach(item -> item.setDateId(formDTO.getDateId())); + factAgencyUserHouseDailyService.insertBatch(ConvertUtils.sourceToTarget(provinceList, FactAgencyUserHouseDailyEntity.class)); + } + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java new file mode 100644 index 0000000000..a3c689b8a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/IcResiUserService.java @@ -0,0 +1,55 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.user.IcResiUserEntity; + +import java.util.List; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +public interface IcResiUserService extends BaseService { + + /** + * 居民统计 + * + * @param formDTO + * @return java.util.List + * @author zhy + * @date 2022/5/30 13:33 + */ + List userStat(FactUserHouseFormDTO formDTO); + + /** + * 居民统计(小区) + * + * @param formDTO + * @return java.util.List + * @author wgf + * @date 2022/5/30 13:33 + */ + List userStatNew(FactUserHouseFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java new file mode 100644 index 0000000000..e1f1e9ef1e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/IcResiUserServiceImpl.java @@ -0,0 +1,55 @@ +/** + * 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.user.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.user.IcResiUserDao; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.dto.stats.result.FactUserHouseResultDTO; +import com.epmet.entity.user.IcResiUserEntity; +import com.epmet.service.user.IcResiUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-26 + */ +@Slf4j +@DataSource(DataSourceConstant.EPMET_USER) +@Service +public class IcResiUserServiceImpl extends BaseServiceImpl implements IcResiUserService, ResultDataResolver { + + @Override + public List userStat(FactUserHouseFormDTO formDTO) { + return baseDao.userStat(formDTO); + } + + @Override + public List userStatNew(FactUserHouseFormDTO formDTO) { + return baseDao.userStatNew(formDTO); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql new file mode 100644 index 0000000000..a5ce1a6c8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.32__fact_grid_user_house_daily.sql @@ -0,0 +1,85 @@ +/* + Navicat Premium Data Transfer + + Source Server : epmet_cloud_dev_statistical + Source Server Type : MySQL + Source Server Version : 50726 + Source Host : 192.168.1.140:3306 + Source Schema : epmet_data_statistical + + Target Server Type : MySQL + Target Server Version : 50726 + File Encoding : 65001 + + Date: 31/05/2022 13:29:46 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for fact_grid_user_house_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_grid_user_house_daily`; +CREATE TABLE `fact_grid_user_house_daily` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格id', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织id', + `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所有上级id', + `NEIGHBOURHOODS_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '小区总数', + `HOUSE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '房屋总数', + `HOUSE_SELF_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '自住房屋总数', + `HOUSE_LEASE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '出租房屋总数', + `HOUSE_IDLE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '闲置房屋总数', + `USER_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '居民总数', + `USER_RESI_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '常住居民总数', + `USER_FLOAT_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '流动居民总数', + `HOUSE_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增房屋数', + `HOUSE_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改房屋数', + `USER_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增居民数', + `USER_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改居民数', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格的人房信息统计数,按天统计' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for fact_agency_user_house_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_agency_user_house_daily`; +CREATE TABLE `fact_agency_user_house_daily` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id', + `LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id', + `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id', + `NEIGHBOURHOODS_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '小区总数', + `HOUSE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '房屋总数', + `HOUSE_SELF_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '自住房屋总数', + `HOUSE_LEASE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '出租房屋总数', + `HOUSE_IDLE_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '闲置房屋总数', + `USER_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '居民总数', + `USER_RESI_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '常住居民总数', + `USER_FLOAT_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '流动居民总数', + `HOUSE_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增房屋数', + `HOUSE_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改房屋数', + `USER_INCR` int(11) NOT NULL DEFAULT 0 COMMENT '当日新增居民数', + `USER_MODIFY` int(11) NOT NULL DEFAULT 0 COMMENT '当日修改居民数', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '人房信息统计数,按天统计' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index 90d3242709..1a92303138 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -138,11 +138,35 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -166,6 +190,10 @@ + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml new file mode 100644 index 0000000000..1510478bc4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/IcHouseDao.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index a1e6a233d0..2ee065b4b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -4,7 +4,7 @@ + SELECT + d.AGENCY_NAME AS AGENCY_NAME, + max( NEIGHBOURHOODS_COUNT ) AS NEIGHBOURHOODS_COUNT, + max( HOUSE_COUNT ) AS HOUSE_COUNT, + max( HOUSE_SELF_COUNT ) AS HOUSE_SELF_COUNT, + max( HOUSE_LEASE_COUNT ) AS HOUSE_LEASE_COUNT, + max( HOUSE_IDLE_COUNT ) AS HOUSE_IDLE_COUNT, + max( USER_COUNT ) AS USER_COUNT, + max( USER_RESI_COUNT ) AS USER_RESI_COUNT, + max( USER_FLOAT_COUNT ) AS USER_FLOAT_COUNT, + max( HOUSE_INCR ) AS HOUSE_INCR, + max( HOUSE_MODIFY ) AS HOUSE_MODIFY, + max( USER_INCR ) AS USER_INCR, + max( USER_MODIFY ) AS USER_MODIFY + FROM + fact_agency_user_house_daily a + LEFT JOIN dim_agency d ON d.id = a.AGENCY_ID + WHERE + d.DEL_FLAG = '0' + + AND a.CUSTOMER_ID = #{customerId} + AND d.CUSTOMER_ID = #{customerId} + + + AND a.DATE_ID = #{dateId} + + + AND a.LEVEL = 'community' + AND a.PID = #{agencyId} + + + AND a.LEVEL = 'street' + AND a.PID = #{agencyId} + + + AND a.LEVEL = 'district' + AND a.PID = #{agencyId} + + + AND a.LEVEL = 'city' + AND a.PID = #{agencyId} + + + AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) >= DATE_FORMAT( #{startTime}, '%Y-%m-%d' ) + + + AND DATE_FORMAT( a.DATE_ID, '%Y-%m-%d' ) <= DATE_FORMAT( #{endTime}, '%Y-%m-%d' ) + + GROUP BY + a.AGENCY_ID + + + + + + DELETE + FROM + fact_agency_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml new file mode 100644 index 0000000000..b46b9467eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridUserHouseDailyDao.xml @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_grid_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml new file mode 100644 index 0000000000..4ff079453d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactNeighborhoodUserHouseDailyDao.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE + FROM + fact_neighborhood_user_house_daily + WHERE + DATE_ID = #{dateId} + AND CUSTOMER_ID = #{customerId} + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml new file mode 100644 index 0000000000..94ed1819ee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/IcResiUserDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java new file mode 100644 index 0000000000..42d8fcf19b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 服务类别【字典表 ic_service_type】多个值逗号分隔 + */ + private String serviceType; + + /** + * 服务组织名称 + */ + private String orgName; + + /** + * 组织描述 + */ + private String orgDescribe; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 + */ + 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/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java new file mode 100644 index 0000000000..6919112fde --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceProjectAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icServiceId; + + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + private String name; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + private String format; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + private String type; + + /** + * 附件地址 + */ + private String attachmentUrl; + private String url; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + 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/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java new file mode 100644 index 0000000000..3d3a6c733f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java @@ -0,0 +1,104 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级[包括自己] + */ + private String agencyIdPath; + + /** + * 服务类别值 + */ + private String serviceCategoryKey; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 启用状态,0启用,1禁用 + */ + private Integer enabled; + + /** + * + */ + 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/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java new file mode 100644 index 0000000000..140e8269c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * 【服务项目记录】修改 + */ +@Data +public class IcServiceEditFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "", groups = AddUserInternalGroup.class) + private String serviceRecordId; + private String principalName; + private String principalContact; + /** + * 服务时间 + */ + @NotNull(message = "起始服务时间不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + @NotNull(message = "截止服务时间不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeEnd; + + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java new file mode 100644 index 0000000000..3b95afef3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 服务组织新增/修改 + * @Author sun + */ +@Data +public class IcServiceOrgAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface Del extends CustomerClientShowGroup { + } + + /** + * 服务组织Id + */ + @NotBlank(message = "服务组织Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icServiceOrgId; + /** + * 服务类型,多个值逗号分隔,字典值,字典key:ic_service_type + */ + @NotBlank(message = "服务类型不能为空", groups = {AddGroup.class}) + private String serviceType; + /** + * 服务组织名称 + */ + @NotBlank(message = "服务组织名称不能为空", groups = {AddGroup.class}) + private String orgName; + /** + * 组织描述 + */ + private String orgDescribe; + /** + * 负责人姓名 + */ + @NotBlank(message = "负责人姓名不能为空", groups = {AddGroup.class}) + private String principalName; + /** + * 联系方式 + */ + @NotBlank(message = "联系方式不能为空", groups = {AddGroup.class}) + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + /** + * 服务地址 + */ + private String address; + /** + * 备注信息 + */ + private String remark; + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java new file mode 100644 index 0000000000..b0cceaeb79 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【组织】服务组织列表--接口入参 + * @Author sun + */ +@Data +public class IcServiceOrgListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 服务类型,字典值 + */ + private String serviceType; + /** + * 服务组织名称 + */ + private String orgName; + /** + * 服务地址 + */ + private String address; + /** + * 备注信息 + */ + private String remark; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icServiceOrgId; + private String customerId; + private String staffId; + private String agencyId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java new file mode 100644 index 0000000000..231ab79b95 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +public class ServiceProjectFeedbackFormDTO { + + /** + * 反馈接口分组 + */ + public interface FeedbackGroup {} + + /** + * 发起服务接口分组 + */ + public interface InitiateGroup {} + + @NotBlank(message = "服务记录id不能为空", groups = { FeedbackGroup.class }) + private String serviceRecordId; + private String serviceProjectId; + private String serviceGoal; + private String serviceEffect; + private Integer servicePeopleNumber; + /** + * 服务状态。in_service服务中;completed:已完成 + */ + @NotBlank(message = "服务状态不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String serviceStatus; + /** + * 满意度。不满意:bad、基本满意:good、非常满意:perfect + * 按理说,服务完成的时候才可以选,不完成应该不能选,可是谁知道呢,原型也没写 + */ + private String satisfaction; + private String longitude; + private String latitude; + private String address; + + @Valid + private List attachmentList; + + @Data + public static class Attachment { + + @NotBlank(message = "附件名称不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentName; + @NotBlank(message = "附件格式不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentFormat; + @NotBlank(message = "附件类型不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentType; + @NotBlank(message = "附件url不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentUrl; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java new file mode 100644 index 0000000000..524628e95c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/27 15:53 + * @DESC + */ +@Data +public class ServiceProjectFormDTO implements Serializable { + + private static final long serialVersionUID = -4573264697450644498L; + + public interface ServiceProjectAddForm{} + public interface ServiceProjectUpdateForm{} + + @NotBlank(message = "服务类别不能为空",groups = {ServiceProjectAddForm.class}) + private String serviceCategoryKey; + + @NotBlank(message = "服务名称不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class}) + private String serviceName; + + @NotBlank(message = "服务内容不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class}) + private String serviceContent; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + private String customerId; + + private String userId; + + @NotBlank(message = "serviceProjectId不能为空",groups = {ServiceProjectUpdateForm.class}) + private String serviceProjectId; + + /** + * 附件集合 + */ + private List attachmentList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java new file mode 100644 index 0000000000..ff265a8a44 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/27 16:42 + * @DESC + */ +@Data +public class ServiceProjectListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -6508966695564469253L; + + public interface ServiceProjectDetail{} + + private String serviceCategoryKey; + private String serviceName; + private String serviceContent; + private String policyGround; + private String customerId; + private String userId; + private String agencyId; + + @NotBlank(message = "serviceProjectId不能为空",groups = ServiceProjectDetail.class) + private String serviceProjectId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java new file mode 100644 index 0000000000..59d86bfac5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.form; + +import com.epmet.dto.result.IcServiceScopeDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +@Data +public class ServiceProjectRecordFormDTO { + + /** + * 发起服务 + */ + public interface Initiate {} + + @NotBlank(message = "服务类别key不能为空", groups = { Initiate.class }) + private String serviceCategoryKey; + + @NotBlank(message = "服务项目Id不能为空", groups = { Initiate.class }) + private String serviceProjectId; + + private String serviceProjectName; + + @NotBlank(message = "服务组织Id不能为空", groups = { Initiate.class }) + private String serviceOrgId; + + private String serviceOrgName; + + @NotEmpty(message = "发布范围不能为空", groups = { Initiate.class }) + private List serviceScope; + + @NotNull(message = "服务起始时间不能为空", groups = { Initiate.class }) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceTimeStart; + + @NotNull(message = "服务结束时间不能为空", groups = { Initiate.class }) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceTimeEnd; + private String serviceStatus; + private String satisfaction; + + private String principalName; + + private String principalContact; + + /** + * 备注 + */ + private String remark; + + @Valid + private ServiceProjectFeedbackFormDTO feedback; + + private Integer pageNo = 1; + private Integer pageSize = 20; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java new file mode 100644 index 0000000000..394b5b6b40 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 服务记录反馈 + */ +@Data +public class IcServiceFeedbackResDTO implements Serializable { + + /** + * 反馈记录id + */ + private String feedBackId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + // private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + private List attachmentList; + + @Data + public static class Attachment { + private String attachmentName; + private String attachmentFormat; + private String attachmentType; + private String attachmentUrl; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java new file mode 100644 index 0000000000..30164b69c4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 【组织】服务组织列表--接口返参 + * @Author sun + */ +@Data +public class IcServiceOrgListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务组织Id + */ + private String icServiceOrgId; + /** + * 组织Id + */ + private String agencyId; + /** + * 服务类别 + */ + private List serviceTypeList; + /** + * 服务类别,多个值逗号分隔 + */ + private String serviceType; + /** + * 服务类别,多个值顿号分隔 + */ + private String serviceTypeName; + /** + * 服务组织名称 + */ + private String orgName; + /** + * 组织描述 + */ + private String orgDescribe; + /** + * 负责人名称 + */ + private String principalName; + /** + * 负责人电话 + */ + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + /** + * 备注 + */ + private String remark; + + @Data + public static class ServiceType { + /** + * 服务类别值 + */ + private String value; + /** + * 服务类别名 + */ + private String name; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java new file mode 100644 index 0000000000..30f5ef457b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【组织】服务组织列表_下拉框使用--接口返参 + * @Author sun + */ +@Data +public class IcServiceOrgSelectListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务组织Id + */ + private String icServiceOrgId; + /** + * 服务组织名称 + */ + private String orgName; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java new file mode 100644 index 0000000000..d1ef78ab5f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java @@ -0,0 +1,90 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@Data +public class IcServiceRecDetailRes implements Serializable { + + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 备注 + */ + private String remark; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务类别ID + */ + private String serviceCategoryName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名称 + */ + private String serviceOrgName; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务项目名称 + */ + private String serviceProjectName; + + /** + * 服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成 + */ + private String serviceStatus; + + /** + * 发布范围 + */ + private List serviceScope; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + + /** + * 反馈详情 + */ + private IcServiceFeedbackResDTO feedBack; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java new file mode 100644 index 0000000000..1a2be3dca0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + + +import lombok.Data; + +@Data +public class IcServiceScopeDTO { + private String objectId; + private String objectName; + private String objectType; + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java new file mode 100644 index 0000000000..eadf11a78a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/27 16:42 + * @DESC + */ +@Data +public class ServiceProjectListResultDTO implements Serializable { + + private static final long serialVersionUID = -6508966695564469113L; + + /** + * 服务类别 + */ + private String serviceCategory; + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 政策级别 + */ + private String policyLevel; + private String policyLevelName; + + private List attachmentList; + + public ServiceProjectListResultDTO() { + this.serviceCategory = ""; + this.serviceProjectId = ""; + this.serviceName = ""; + this.serviceContent = ""; + this.policyGround = ""; + this.policyLevel = ""; + this.policyLevelName = ""; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java new file mode 100644 index 0000000000..940a8ae9f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ServiceProjectRecordResultDTO { + private String serviceRecordId; + private String serviceCategoryKey; + private String serviceCategoryName; + private String serviceProjectId; + private String serviceProjectName; + private String serviceOrgId; + private String serviceOrgName; + private String serviceTimeStart; + private String serviceTimeEnd; + private String serviceStatus; + private String servicePeopleNumber; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index bc2955d8b7..af7bb32c5d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -132,6 +132,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + ${project.basedir}/src/main/java diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java new file mode 100644 index 0000000000..2232830346 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java @@ -0,0 +1,91 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.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.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.service.IcServiceOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceOrg") +public class IcServiceOrgController { + + @Autowired + private IcServiceOrgService icServiceOrgService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icServiceOrgService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceOrgDTO data = icServiceOrgService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icServiceOrgService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO dto){ + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icServiceOrgService.update(dto); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcServiceOrgAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceOrgService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcServiceOrgListFormDTO formDTO) { + return new Result().ok(icServiceOrgService.detail(formDTO)); + } + + @RequestMapping("selectlist") + public Result> selectList(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icServiceOrgService.selectList(formDTO)); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java new file mode 100644 index 0000000000..07e07b0d92 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java @@ -0,0 +1,72 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.service.IcServiceProjectAttachmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceProjectAttachment") +public class IcServiceProjectAttachmentController { + + @Autowired + private IcServiceProjectAttachmentService icServiceProjectAttachmentService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceProjectAttachmentService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceProjectAttachmentDTO data = icServiceProjectAttachmentService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceProjectAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceProjectAttachmentService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceProjectAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceProjectAttachmentService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceProjectAttachmentService.delete(ids); + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java new file mode 100644 index 0000000000..abcf757f89 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java @@ -0,0 +1,244 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.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.IcServiceProjectDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; +import com.epmet.service.IcServiceProjectService; +import com.epmet.service.IcServiceRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceProject") +public class IcServiceProjectController { + + @Autowired + private IcServiceProjectService icServiceProjectService; + @Autowired + private IcServiceRecordService icServiceRecordService; + + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceProjectService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceProjectDTO data = icServiceProjectService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceProjectDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceProjectService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceProjectDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceProjectService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceProjectService.delete(ids); + return new Result(); + } + + /** + * Desc: 服务项目新增 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + @PostMapping("serviceProjectAdd") + public Result serviceProjectAdd(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectFormDTO.ServiceProjectAddForm.class); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icServiceProjectService.serviceProjectAdd(formDTO); + return new Result(); + } + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + @PostMapping("serviceProjectList") + public Result serviceProjectList(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icServiceProjectService.serviceProjectList(formDTO)); + } + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @PostMapping("serviceProjectDetail") + public Result serviceProjectDetail(@RequestBody ServiceProjectListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectListFormDTO.ServiceProjectDetail.class); + return new Result().ok(icServiceProjectService.serviceProjectDetail(formDTO)); + } + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + @PostMapping("serviceProjectEdit") + public Result serviceProjectEdit(@RequestBody ServiceProjectFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectFormDTO.ServiceProjectUpdateForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icServiceProjectService.serviceProjectEdit(formDTO); + return new Result(); + } + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + @PostMapping("serviceProjectEnabled") + public Result serviceProjectEnabled(@RequestBody List ids){ + icServiceProjectService.serviceProjectEnabled(ids); + return new Result(); + } + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * + * @param serviceId + * @return 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + @PostMapping("service/cancel/{service-id}") + public Result cancelService(@PathVariable("service-id") String serviceId) { + icServiceRecordService.cancelService(serviceId, "yzm"); + return new Result(); + } + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7821 + * @param serviceId + * @return 【服务项目记录】详情 + */ + @PostMapping("service/detail/{service-id}") + public Result queryServiceDetail(@PathVariable("service-id") String serviceId) { + return new Result().ok(icServiceRecordService.queryServiceDetail(serviceId)); + } + + /** + * 【服务项目记录】修改 + * + * @param formDTO + * @return + */ + @PostMapping("service/update") + public Result updateServiceRecord(@RequestBody IcServiceEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcServiceEditFormDTO.AddUserShowGroup.class, IcServiceEditFormDTO.AddUserInternalGroup.class); + icServiceRecordService.updateServiceRecord(formDTO); + return new Result(); + } + + /** + * 服务列表 + * @param input + * @return + */ + @PostMapping("/service/recordList") + public Result listServiceRecords(@RequestBody ServiceProjectRecordFormDTO input) { + + PageData page = icServiceRecordService.listServiceRecords( + input.getServiceCategoryKey(), input.getServiceProjectName(), input.getServiceOrgName(), input.getServiceTimeStart(), + input.getServiceTimeEnd(), input.getServiceStatus(), input.getSatisfaction(), input.getPageNo(), input.getPageSize()); + + return new Result().ok(page); + } + + /** + * 发起服务 + * @param input + * @return + */ + @PostMapping("/service/initiate") + public Result initiateService(@RequestBody ServiceProjectRecordFormDTO input) { + + ValidatorUtils.validateEntity(input, ServiceProjectRecordFormDTO.Initiate.class, ServiceProjectFeedbackFormDTO.InitiateGroup.class); + icServiceRecordService.initiateService(input); + + return new Result(); + } + + /** + * 反馈 + * @param input + * @return + */ + @PostMapping("/service/feedback") + public Result serviceFeedback(@RequestBody ServiceProjectFeedbackFormDTO input) { + ValidatorUtils.validateEntity(input, ServiceProjectFeedbackFormDTO.FeedbackGroup.class); + String serviceRecordId = input.getServiceRecordId(); + + // 做状态检查,未反馈的,服务状态为服务中的才可以反馈 + IcServiceRecordEntity serviceRecord = icServiceRecordService.selectById(serviceRecordId); + if (serviceRecord == null) { + String msg = "未找到服务记录"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + + if ("completed".equals(serviceRecord.getServiceStatus())) { + String msg = "服务已完成,不能再次反馈"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + + icServiceRecordService.serviceFeedback(serviceRecord.getServiceCategoryKey(), + serviceRecord.getServiceOrgId(), + serviceRecord.getServiceProjectId(), + serviceRecord.getId(), + input); + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 9c53742254..3405c0c019 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -44,9 +44,9 @@ import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -83,6 +83,7 @@ public class IcUserDemandRecController implements ResultDataResolver { @Autowired private EpmetUserOpenFeignClient userOpenFeignClient; + /** * 根据服务方类型查询 下拉框 * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; @@ -219,28 +220,33 @@ public class IcUserDemandRecController implements ResultDataResolver { && null != finishResultDTO.getAwardPoint() && finishResultDTO.getAwardPoint() > NumConstant.ZERO && UserDemandConstant.RESOLVED.equals(finishResultDTO.getFinishResult())) { - // 志愿者发放积分 - List actPointEventMsgList = new ArrayList<>(); - BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); - actPointEventMsg.setCustomerId(formDTO.getCustomerId()); - actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); - actPointEventMsg.setSourceId(formDTO.getDemandRecId()); - actPointEventMsg.setUserId(finishResultDTO.getServerId()); - actPointEventMsg.setActionFlag(MqConstant.PLUS); - actPointEventMsg.setIsCommon(false); - actPointEventMsg.setRemark(finishResultDTO.getRemark()); - actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); - actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); - actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName()); - actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode()); - actPointEventMsg.setPoint(finishResultDTO.getAwardPoint()); - actPointEventMsgList.add(actPointEventMsg); - SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); - sendMsgForm.setContent(actPointEventMsgList); - sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); - Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); - if (!mqResult.success()) { - log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId())); + Result> userIdRes = userOpenFeignClient.getUserId(finishResultDTO.getServerId()); + if (userIdRes.success() && CollectionUtils.isNotEmpty(userIdRes.getData())) { + userIdRes.getData().forEach(userId -> { + // 志愿者发放积分 + List actPointEventMsgList = new ArrayList<>(); + BasePointEventMsg actPointEventMsg = new BasePointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setSourceType(MqConstant.SOURCE_TYPE_DEMAND); + actPointEventMsg.setSourceId(formDTO.getDemandRecId()); + actPointEventMsg.setUserId(userId); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(finishResultDTO.getRemark()); + actPointEventMsg.setEventTag(EventEnum.FINISH_USER_DEMAND.getEventTag()); + actPointEventMsg.setEventClass(EventEnum.FINISH_USER_DEMAND.getEventClass()); + actPointEventMsg.setEventName(finishResultDTO.getFirstCategoryName()); + actPointEventMsg.setObjectId(finishResultDTO.getCategoryCode()); + actPointEventMsg.setPoint(finishResultDTO.getAwardPoint()); + actPointEventMsgList.add(actPointEventMsg); + SystemMsgFormDTO sendMsgForm = new SystemMsgFormDTO(); + sendMsgForm.setContent(actPointEventMsgList); + sendMsgForm.setMessageType(SystemMessageType.FINISH_USER_DEMAND); + Result mqResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(sendMsgForm); + if (!mqResult.success()) { + log.error(String.format("demandRecId:%s,给志愿者发放积分失败", formDTO.getDemandRecId())); + } + }); } } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index 5899abc96f..3ba576777b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -73,4 +73,6 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao queryCategoryList(CategorySelfOrgFormDTO formDTO); List queryCoordinateList(CategorySelfOrgFormDTO formDTO); + + List selectByIds(@Param("communityOrgIds") List communityOrgIds); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index fd36187bd8..0c02e737b7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -19,7 +19,6 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; -import com.epmet.dto.form.PartyTypepercentFormDTO; import com.epmet.dto.form.PartyUnitListbriefFormDTO; import com.epmet.dto.result.PartyTypepercentResultDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; @@ -32,7 +31,6 @@ import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.util.List; -import java.util.Map; /** * 联建单位 @@ -97,7 +95,7 @@ public interface IcPartyUnitDao extends BaseDao { * @author zxc * @date 2022/5/18 13:48 */ - List getAssistanceUnitList(@Param("agencyId")String agencyId); + List getAssistanceUnitList(@Param("agencyId")String agencyId,@Param("pid")String pid); /** * 联建单位-简要信息列表 @@ -116,4 +114,6 @@ public interface IcPartyUnitDao extends BaseDao { */ List getTypepercent(@Param("agencyId") String agencyId, @Param("customerId") String customerId); + + List selectByIds(@Param("partyUnitIds") List partyUnitIds); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java new file mode 100755 index 0000000000..301a261fb1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java @@ -0,0 +1,33 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcServiceFeedbackResDTO; +import com.epmet.entity.IcServiceFeedbackEntity; +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 2022-05-30 + */ +@Mapper +public interface IcServiceFeedbackDao extends BaseDao { + + /** + * 根据服务记录id,查询反馈记录 + * @param serviceRecordId + * @return + */ + IcServiceFeedbackResDTO selectByRecId(@Param("serviceRecordId") String serviceRecordId); + + /** + * 根据服务反馈id,查询附件列表 + * @param feedBackId + * @return + */ + List getAttachmentList(String feedBackId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java new file mode 100644 index 0000000000..5407d8f10b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java @@ -0,0 +1,34 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface IcServiceOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 服务组织-列表查询 + **/ + List selectServiceOrgList(IcServiceOrgListFormDTO formDTO); + + /** + * @Author sun + * @Description 服务组织列表_下拉框 + **/ + List selectServiceOrgSelectList(IcServiceOrgListFormDTO formDTO); + + void del(IcServiceOrgEntity entity); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java new file mode 100644 index 0000000000..17eddc6215 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java @@ -0,0 +1,27 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +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 2022-05-27 + */ +@Mapper +public interface IcServiceProjectAttachmentDao extends BaseDao { + + /** + * Desc: 根据服务项目ID删除附件 + * @param id + * @author zxc + * @date 2022/5/30 09:50 + */ + void delAttachmentByServiceProjectId(@Param("id")String id); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java new file mode 100644 index 0000000000..528e9a06a5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java @@ -0,0 +1,37 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectEntity; +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 2022-05-27 + */ +@Mapper +public interface IcServiceProjectDao extends BaseDao { + + /** + * Desc: 查询服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 17:13 + */ + List getServiceProjectList(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + void serviceProjectEnabled(@Param("ids") List ids); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java new file mode 100644 index 0000000000..5a51a14a76 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java @@ -0,0 +1,29 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Mapper +public interface IcServiceRecordDao extends BaseDao { + + List listServiceRecords( + @Param("serviceCategoryKey") String serviceCategoryKey, + @Param("serviceProjectName") String serviceProjectName, + @Param("serviceOrgName") String serviceOrgName, + @Param("serviceTimeStart") Date serviceTimeStart, + @Param("serviceTimeEnd") Date serviceTimeEnd, + @Param("serviceStatus") String serviceStatus, + @Param("satisfaction") String satisfaction); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java new file mode 100644 index 0000000000..c2fc96cfd9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcServiceScopeDTO; +import com.epmet.entity.IcServiceScopeEntity; +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 2022-05-30 + */ +@Mapper +public interface IcServiceScopeDao extends BaseDao { + + int update(@Param("serviceId") String serviceId, @Param("userId") String userId); + + List selectList(String serviceRecordId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 01ab0ad96d..f3ac1eb80b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -140,4 +140,11 @@ public interface IcUserDemandRecDao extends BaseDao { List getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType); List queryServiceList(ServiceListFormDTO formDTO); + + /** + * 根据服务方id查询已派单的服务记录数 + * @param serverId + * @return + */ + Integer selectCountByServerId(String serverId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java new file mode 100755 index 0000000000..df89735b5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java @@ -0,0 +1,83 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_feedback") +public class IcServiceFeedbackEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + //private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * + */ + private String serviceRecordId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java new file mode 100644 index 0000000000..9b9da6dd7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java @@ -0,0 +1,81 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_org") +public class IcServiceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 服务类别【字典表 ic_service_type】多个值逗号分隔 + */ + private String serviceType; + + /** + * 服务组织名称 + */ + private String orgName; + + /** + * 组织描述 + */ + private String orgDescribe; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java new file mode 100644 index 0000000000..966b5a6d94 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java @@ -0,0 +1,88 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_project_attachment") +public class IcServiceProjectAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 事件Id + */ + private String icServiceId; + + /** + * 隶属于。feedback:反馈;service:服务本身 + */ + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(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; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java new file mode 100644 index 0000000000..b8a09e67cf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java @@ -0,0 +1,74 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_project") +public class IcServiceProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级[包括自己] + */ + private String agencyIdPath; + + /** + * 服务类别值 + */ + private String serviceCategoryKey; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 启用状态,0启用,1禁用 + */ + private Integer enabled; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java new file mode 100644 index 0000000000..4156c60604 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java @@ -0,0 +1,89 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_record") +public class IcServiceRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务项目名称 + */ + private String serviceProjectName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名称 + */ + private String serviceOrgName; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java new file mode 100644 index 0000000000..1826e26df1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java @@ -0,0 +1,75 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_scope") +public class IcServiceScopeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务记录的ID + */ + private String serviceRecordId; + + /** + * agency单位;grid网格;neighborhood小区 + */ + private String objectType; + + /** + * 选中的组织的ID + */ + private String objectId; + + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; + + /** + * + */ + private String objectName; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java new file mode 100644 index 0000000000..79c052a9f8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java @@ -0,0 +1,75 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceOrgExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "所属组织机构Id") + private String agencyId; + + @Excel(name = "agencyId的所有上级,包含自己") + private String agencyIdPath; + + @Excel(name = "服务类别【字典表 ic_service_type】多个值逗号分隔") + private String serviceType; + + @Excel(name = "服务组织名称") + private String orgName; + + @Excel(name = "组织描述") + private String orgDescribe; + + @Excel(name = "负责人姓名") + private String principalName; + + @Excel(name = "负责人电话") + private String principalMobile; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java new file mode 100644 index 0000000000..3115e08d8a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java @@ -0,0 +1,68 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; + +import java.util.List; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceOrgService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + PageData list(IcServiceOrgListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcServiceOrgDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceOrgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceOrgAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceOrgAddEditFormDTO dto); + + void delete(IcServiceOrgAddEditFormDTO formDTO); + + IcServiceOrgListResultDTO detail(IcServiceOrgListFormDTO formDTO); + + List selectList(IcServiceOrgListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java new file mode 100644 index 0000000000..afc94ec748 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceProjectAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceProjectAttachmentDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceProjectAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceProjectAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceProjectAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java new file mode 100644 index 0000000000..aa02487cab --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java @@ -0,0 +1,122 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.ServiceProjectFormDTO; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectEntity; + +import java.util.List; +import java.util.Map; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceProjectService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceProjectDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceProjectDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceProjectDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceProjectDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * Desc: 服务项目新增 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + void serviceProjectAdd(ServiceProjectFormDTO formDTO); + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + PageData serviceProjectList(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + ServiceProjectListResultDTO serviceProjectDetail(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + void serviceProjectEdit(ServiceProjectFormDTO formDTO); + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + void serviceProjectEnabled(List ids); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java new file mode 100644 index 0000000000..1fe7cb518a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java @@ -0,0 +1,56 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.IcServiceEditFormDTO; +import com.epmet.dto.form.ServiceProjectFeedbackFormDTO; +import com.epmet.dto.form.ServiceProjectRecordFormDTO; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +public interface IcServiceRecordService extends BaseService { + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * @param serviceId + * 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + void cancelService(String serviceId,String userId); + + /** + * 【服务项目记录】详情 + * @param serviceId + * @return + */ + IcServiceRecDetailRes queryServiceDetail(String serviceId); + + /** + * 【服务项目记录】修改 + * @param formDTO + */ + void updateServiceRecord(IcServiceEditFormDTO formDTO); + + PageData listServiceRecords(String serviceCategoryKey, String serviceProjectName, String serviceOrgName, + Date serviceTimeStart, Date serviceTimeEnd, String serviceStatus, + String satisfaction, Integer pageNo, Integer pageSize); + + /** + * 发起服务 + * @param input + */ + void initiateService(ServiceProjectRecordFormDTO input); + + /** + * 服务反馈 + */ + void serviceFeedback(String serviceCategoryKey, String serviceOrgId, String serviceProjectId, String serviceRecordId, ServiceProjectFeedbackFormDTO feedbackDto); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java new file mode 100644 index 0000000000..00603de5c3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcServiceScopeEntity; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +public interface IcServiceScopeService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index eb5f2f89fc..1824e1feb3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -260,4 +260,6 @@ public interface IcUserDemandRecService extends BaseService l = new LambdaQueryWrapper<>(); l.eq(IcCommunitySelfOrganizationEntity::getOrganizationName,formDTO.getOrganizationName()) .eq(IcCommunitySelfOrganizationEntity::getCustomerId,customerId) @@ -182,7 +182,6 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl { + /** + * 2022-06-14 需求变动 去掉号码校验 + */ + /*formDTO.getOrganizationPersonnel().forEach(p -> { boolean m = PhoneValidatorUtils.isMobile(p.getPersonPhone()); boolean t = PhoneValidatorUtils.isTel(p.getPersonPhone()); if (!m && !t){ throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode()); } - }); + });*/ List persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); Map> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); List phones = new ArrayList<>(); @@ -242,11 +246,11 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl l = new LambdaQueryWrapper<>(); l.eq(IcCommunitySelfOrganizationEntity::getOrganizationName,formDTO.getOrganizationName()) .eq(IcCommunitySelfOrganizationEntity::getCustomerId,tokenDto.getCustomerId()) @@ -262,13 +266,16 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl { + /** + * 2022-06-14 需求变动 去掉号码校验 + */ + /*formDTO.getOrganizationPersonnel().forEach(p -> { boolean mobile = PhoneValidatorUtils.isMobile(p.getPersonPhone()); boolean tel = PhoneValidatorUtils.isTel(p.getPersonPhone()); if (!mobile && !tel){ throw new EpmetException(EpmetErrorCode.CHECK_PHONE_ERROR.getCode()); } - }); + });*/ List persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); Map> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); List phones = new ArrayList<>(); @@ -362,6 +369,10 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); + } baseDao.deleteById(formDTO.getOrgId()); personnelService.deleteByOrgId(formDTO.getOrgId()); } @@ -499,16 +510,18 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl fileList = new ArrayList<>(); CommunitySelfOrgImportExcel excel = null; //1.读取Excel数据 - ExcelImportResult testExcelImportResult = ExcelPoiUtils.importExcelMore(inputStream,0,2,ImportCommunitySelfOrganization.class); + ExcelImportResult testExcelImportResult = ExcelPoiUtils.importExcel1(inputStream,0,2,ImportCommunitySelfOrganization.class); //2.存在错误行数据时存入错误数据集合中 - for (ImportCommunitySelfOrganization entity : testExcelImportResult.getFailList()) { - //打印失败的行 和失败的信息 - log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); - excel = new CommunitySelfOrgImportExcel(); - //excel.setAgencyName(entity.getOrganizationName()); - excel.setSocietyName(entity.getOrganizationName()); - excel.setErrorInfo(entity.getErrorMsg()); - fileList.add(excel); + if(CollectionUtils.isNotEmpty(testExcelImportResult.getFailList())){ + for (ImportCommunitySelfOrganization entity : testExcelImportResult.getFailList()) { + //打印失败的行 和失败的信息 + log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); + excel = new CommunitySelfOrgImportExcel(); + //excel.setAgencyName(entity.getOrganizationName()); + excel.setSocietyName(entity.getOrganizationName()); + excel.setErrorInfo(entity.getErrorMsg()); + fileList.add(excel); + } } //正确行数据集合 List list = testExcelImportResult.getList(); @@ -529,19 +542,22 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl { if (obj.getOrganizationName().equals(org.getOrganizationName())) { - log.warn(String.format("当前客户下的社会自组织名称已存在,社会自组织名称->%s,行号->%s", obj.getOrganizationName(), obj.getRowNum())); - errMsg.append("客户下社会自组织名称已存在;"); + log.warn(String.format("当前客户下的社区自组织名称已存在,社会自组织名称->%s,行号->%s", obj.getOrganizationName(), obj.getRowNum())); + errMsg.append("客户下社区自组织名称已存在;"); bl.set(true); } }); //手机号不合规 - boolean m = PhoneValidatorUtils.isMobile(obj.getPrincipalPhone()); + /** + * 2022-06-14 需求变动 去掉号码校验 + */ + /*boolean m = PhoneValidatorUtils.isMobile(obj.getPrincipalPhone()); boolean t = PhoneValidatorUtils.isTel(obj.getPrincipalPhone()); if (!m && !t){ errMsg.append("手机号码不合法;"); bl.set(true); log.warn("手机号码不合法,自组织名称{}", obj.getOrganizationName()); - } + }*/ if(bl.get()){ excel = new CommunitySelfOrgImportExcel(); //excel.setAgencyName(obj.getOrganizationName()); @@ -560,19 +576,23 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl persons = new ArrayList<>(); AtomicReference bl = new AtomicReference<>(false); StringBuffer msg = new StringBuffer(""); if (CollectionUtils.isNotEmpty(l.getPersons())){ - l.getPersons().forEach(p -> { + /*l.getPersons().forEach(p -> { boolean m = PhoneValidatorUtils.isMobile(p.getPersonPhone()); boolean t = PhoneValidatorUtils.isTel(p.getPersonPhone()); if (!m && !t){ @@ -582,7 +602,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl> groupByPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone)); List phones = new ArrayList<>(); @@ -703,7 +723,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl queryListById(List communityOrgIds) { if(CollectionUtils.isNotEmpty(communityOrgIds)){ - return baseDao.selectBatchIds(communityOrgIds); + return baseDao.selectByIds(communityOrgIds); } return Collections.EMPTY_LIST; } @@ -769,9 +789,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl queryCoordinateList(CategorySelfOrgFormDTO formDTO) { CustomerStaffInfoCacheResult staffInfo=getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId()); formDTO.setAgencyId(staffInfo.getAgencyId()); - PageInfo pageInfo= PageHelper.startPage(formDTO.getPageNo(), - formDTO.getPageSize(),formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.queryCoordinateList(formDTO)); - List list=pageInfo.getList(); + List list=baseDao.queryCoordinateList(formDTO); for (CommunitySelfOrganizationListDTO dto : list) { dto.setColor(SelfOrgCategoryEnum.getEnum(dto.getCategoryCode()).getColor()); if (StringUtils.isNotBlank(dto.getCategoryCode())) { @@ -779,7 +797,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); + return new PageData<>(list, NumConstant.ONE_NEG); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index ce0b172893..c645ffbc55 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -179,8 +179,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(entity.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); List services = icActivityServiceRelationService.getServiceList(id); List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); dto.setServiceMatterList(services); @@ -213,7 +213,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取联建单位 IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); unitDTO.setAgencyId(staffInfoCache.getAgencyId()); @@ -341,43 +341,43 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl%s", obj.getRowNum())); iterator.remove(); - } else if(StringUtils.isBlank(obj.getTarget())) { + } else if (StringUtils.isBlank(obj.getTarget())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动目标为空"); fileList.add(failed); log.warn(String.format("活动目标为空,行号->%s", obj.getRowNum())); - } else if(StringUtils.isBlank(obj.getContent())) { + } else if (StringUtils.isBlank(obj.getContent())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动内容为空"); fileList.add(failed); log.warn(String.format("活动内容为空,行号->%s", obj.getRowNum())); - } else if(StringUtils.isBlank(obj.getActivityTime())) { + } else if (StringUtils.isBlank(obj.getActivityTime())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动时间为空"); fileList.add(failed); log.warn(String.format("活动时间为空,行号->%s", obj.getRowNum())); - } else if(StringUtils.isBlank(obj.getAddress())) { + } else if (StringUtils.isBlank(obj.getAddress())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动地址为空"); fileList.add(failed); log.warn(String.format("活动地址为空,行号->%s", obj.getRowNum())); - } else if(StringUtils.isBlank(obj.getLatitude())) { + } else if (StringUtils.isBlank(obj.getLatitude())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动地址纬度为空"); fileList.add(failed); log.warn(String.format("活动地址纬度为空,行号->%s", obj.getRowNum())); - } else if(StringUtils.isBlank(obj.getLongitude())) { + } else if (StringUtils.isBlank(obj.getLongitude())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动地址经度为空"); fileList.add(failed); log.warn(String.format("活动地址经度为空,行号->%s", obj.getRowNum())); - } else if(StringUtils.isBlank(obj.getResult())) { + } else if (StringUtils.isBlank(obj.getResult())) { IcPartyActivityImportFailedExcel failed = ConvertUtils.sourceToTarget(obj, IcPartyActivityImportFailedExcel.class); failed.setErrorInfo("活动结果为空"); fileList.add(failed); @@ -540,7 +540,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl getActivityList(TokenDto tokenDto, PartyActivityFormDTO formDTO) { - if (null == formDTO.getStartTime() && null == formDTO.getEndTime()) { + // unitId 不为空(按单位查询)时,不需要限制活动创建时间 + if (null == formDTO.getStartTime() && null == formDTO.getEndTime() && StringUtils.isBlank(formDTO.getUnitId())) { setDate(formDTO); } PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); @@ -554,8 +555,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取服务事项字典 - List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //数据组装 dtoList.forEach(dto -> { //联建单位ID与单位名匹配 @@ -617,6 +618,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); + } // 逻辑删除(@TableLogic 注解) baseDao.deleteById(id); } @@ -598,7 +594,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl queryListById(List partyUnitIds) { if (CollectionUtils.isNotEmpty(partyUnitIds)) { - return baseDao.selectBatchIds(partyUnitIds); + return baseDao.selectByIds(partyUnitIds); } return Collections.EMPTY_LIST; } @@ -633,7 +629,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl implements IcServiceOrgService { + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + + + @Override + public PageData list(IcServiceOrgListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectServiceOrgList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装服务类别数据 + if (!CollectionUtils.isEmpty(list)) { + //服务类别字典表数据 + Result> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List stList = null; + IcServiceOrgListResultDTO.ServiceType st = null; + StringBuffer buffer = null; + for (IcServiceOrgListResultDTO dto : list) { + stList = new ArrayList<>(); + buffer = new StringBuffer(""); + for (String str : dto.getServiceType().split(",")) { + st = new IcServiceOrgListResultDTO.ServiceType(); + st.setValue(str); + st.setName(null != statusMap.get(str) ? statusMap.get(str) : ""); + stList.add(st); + buffer.append(buffer.length() > NumConstant.ZERO ? "、" : "").append(st.getName()); + } + dto.setServiceTypeList(stList); + dto.setServiceTypeName(buffer.toString()); + } + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + 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 IcServiceOrgDTO get(String id) { + IcServiceOrgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceOrgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceOrgAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.新增服务组织数据 + IcServiceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceOrgEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceOrgAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcServiceOrgEntity::getId, formDTO.getIcServiceOrgId()); + tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcServiceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceOrgEntity.class); + entity.setId(formDTO.getIcServiceOrgId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcServiceOrgAddEditFormDTO formDTO) { + IcServiceOrgEntity entity = new IcServiceOrgEntity(); + entity.setId(formDTO.getIcServiceOrgId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcServiceOrgListResultDTO detail(IcServiceOrgListFormDTO formDTO) { + IcServiceOrgListResultDTO resultDTO = new IcServiceOrgListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectServiceOrgList(formDTO); + + //封装服务类别数据 + if (!CollectionUtils.isEmpty(list)) { + resultDTO = list.get(NumConstant.ZERO); + //服务类别字典表数据 + Result> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List stList = new ArrayList<>(); + IcServiceOrgListResultDTO.ServiceType st = null; + StringBuffer buffer = new StringBuffer(""); + for (String str : resultDTO.getServiceType().split(",")) { + st = new IcServiceOrgListResultDTO.ServiceType(); + st.setValue(str); + st.setName(null != statusMap.get(str) ? statusMap.get(str) : ""); + stList.add(st); + buffer.append(buffer.length() > NumConstant.ZERO ? "、" : "").append(st.getName()); + } + resultDTO.setServiceTypeList(stList); + resultDTO.setServiceTypeName(buffer.toString()); + } + + return resultDTO; + } + + @Override + public List selectList(IcServiceOrgListFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getStaffId())); + } + //2.按条件查询当前组织及下级服务组织数据 + List resultList = baseDao.selectServiceOrgSelectList(formDTO); + + return resultList; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java new file mode 100644 index 0000000000..13610ad374 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcServiceProjectAttachmentDao; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import com.epmet.service.IcServiceProjectAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceProjectAttachmentServiceImpl extends BaseServiceImpl implements IcServiceProjectAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceProjectAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceProjectAttachmentDTO.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 IcServiceProjectAttachmentDTO get(String id) { + IcServiceProjectAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceProjectAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceProjectAttachmentDTO dto) { + IcServiceProjectAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceProjectAttachmentDTO dto) { + IcServiceProjectAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectAttachmentEntity.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/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java new file mode 100644 index 0000000000..ecc399cfb3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java @@ -0,0 +1,259 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +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.IcServiceProjectAttachmentDao; +import com.epmet.dao.IcServiceProjectDao; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.ServiceProjectFormDTO; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import com.epmet.entity.IcServiceProjectEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcServiceProjectAttachmentService; +import com.epmet.service.IcServiceProjectService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceProjectServiceImpl extends BaseServiceImpl implements IcServiceProjectService { + + @Autowired + private IcServiceProjectAttachmentService attachmentService; + @Autowired + private IcServiceProjectAttachmentDao attachmentDao; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceProjectDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceProjectDTO.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 IcServiceProjectDTO get(String id) { + IcServiceProjectEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceProjectDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceProjectDTO dto) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceProjectDTO dto) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * Desc: 服务项目新增 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectAdd(ServiceProjectFormDTO formDTO) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceProjectEntity.class); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员"+formDTO.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到此组织信息"+staffInfo.getStaffId()); + } + entity.setEnabled(NumConstant.ZERO); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setPid(agencyInfo.getPid()); + entity.setAgencyIdPath((StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR)) ? staffInfo.getAgencyId() : agencyInfo.getPids().concat(":").concat(staffInfo.getAgencyId())); + baseDao.insert(entity); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){ + disposeAttachment(formDTO.getAttachmentList(), formDTO.getCustomerId(), entity.getId()); + } + } + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + @Override + public PageData> serviceProjectList(ServiceProjectListFormDTO formDTO) { + PageData result = new PageData(new ArrayList(),NumConstant.ZERO); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员"+formDTO.getUserId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getServiceProjectList(formDTO)); + if (CollectionUtils.isNotEmpty(pageInfo.getList())){ + DictListFormDTO dictListFormDTO = new DictListFormDTO(); + dictListFormDTO.setDictType("ic_service_type"); + Result> listResult = adminOpenFeignClient.dictList(dictListFormDTO); + if (!listResult.success()){ + throw new EpmetException("获取字典表数据失败,类型为:ic_service_type"); + } + if (CollectionUtils.isNotEmpty(listResult.getData())){ + pageInfo.getList().forEach(p -> listResult.getData().stream().filter(l -> l.getValue().equals(p.getServiceCategoryKey())).forEach(l -> p.setServiceCategory(l.getLabel()))); + } + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + result.setList(pageInfo.getList()); + } + return result; + } + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @Override + public ServiceProjectListResultDTO serviceProjectDetail(ServiceProjectListFormDTO formDTO) { + List serviceProjectList = baseDao.getServiceProjectList(formDTO); + if (CollectionUtils.isNotEmpty(serviceProjectList)){ + DictListFormDTO dictListFormDTO = new DictListFormDTO(); + dictListFormDTO.setDictType("ic_service_type"); + Result> listResult = adminOpenFeignClient.dictList(dictListFormDTO); + if (!listResult.success()){ + throw new EpmetException("获取字典表数据失败,类型为:ic_service_type"); + } + if (CollectionUtils.isNotEmpty(listResult.getData())){ + serviceProjectList.forEach(p -> listResult.getData().stream().filter(l -> l.getValue().equals(p.getServiceCategoryKey())).forEach(l -> p.setServiceCategory(l.getLabel()))); + } + return serviceProjectList.get(NumConstant.ZERO); + } + return new ServiceProjectListResultDTO(); + } + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectEdit(ServiceProjectFormDTO formDTO) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + qw.eq(IcServiceProjectEntity::getId,formDTO.getServiceProjectId()); + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceProjectEntity.class); + baseDao.update(entity,qw); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){ + // 先删后增 + attachmentDao.delAttachmentByServiceProjectId(formDTO.getServiceProjectId()); + disposeAttachment(formDTO.getAttachmentList(), formDTO.getCustomerId(), formDTO.getServiceProjectId()); + }else { + attachmentDao.delAttachmentByServiceProjectId(formDTO.getServiceProjectId()); + } + } + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectEnabled(List ids) { + if (CollectionUtils.isNotEmpty(ids)){ + baseDao.serviceProjectEnabled(ids); + } + } + + /** + * Desc: 附件处理 + * @param attachmentList + * @param customerId + * @param serviceId + * @author zxc + * @date 2022/5/30 10:17 + */ + public void disposeAttachment(List attachmentList,String customerId,String serviceId){ + attachmentList.forEach(a -> { + a.setAttachmentName(a.getName()); + a.setAttachmentFormat(a.getFormat()); + a.setAttachmentType(a.getType()); + a.setAttachmentUrl(a.getUrl()); + }); + List entities = ConvertUtils.sourceToTarget(attachmentList, IcServiceProjectAttachmentEntity.class); + Integer sort = NumConstant.ZERO; + for (IcServiceProjectAttachmentEntity e : entities) { + e.setCustomerId(customerId); + e.setStatus("auto_passed"); + e.setSort(sort); + e.setIcServiceId(serviceId); + e.setAttachTo("service"); + sort++; + } + attachmentService.insertBatch(entities); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java new file mode 100644 index 0000000000..214b762cfc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java @@ -0,0 +1,324 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.form.IcServiceEditFormDTO; +import com.epmet.dto.form.ServiceProjectFeedbackFormDTO; +import com.epmet.dto.form.ServiceProjectRecordFormDTO; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.IcServiceScopeDTO; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcServiceRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Service +public class IcServiceRecordServiceImpl extends BaseServiceImpl implements IcServiceRecordService, ResultDataResolver { + @Autowired + private IcServiceScopeDao icServiceScopeDao; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private IcServiceProjectDao serviceProjectDao; + @Autowired + private IcServiceOrgDao serviceOrgDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcServiceFeedbackDao serviceFeedbackDao; + @Autowired + private IcServiceProjectAttachmentDao serviceProjectAttachmentDao; + @Autowired + private IcServiceRecordDao serviceRecordDao; + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * + * @param serviceId 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelService(String serviceId,String userId) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(serviceId); + if (null == icServiceRecordEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("服务记录不存在,serviceId:%s",serviceId),"服务记录不存在"); + } + if (!"in_service".equals(icServiceRecordEntity.getServiceStatus())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("服务状态:%s", icServiceRecordEntity.getServiceStatus()), "只有服务中的项目可以取消"); + } + baseDao.deleteById(serviceId); + icServiceScopeDao.update(serviceId,userId); + } + + /** + * 【服务项目记录】详情 + * + * @param serviceId + * @return + */ + @Override + public IcServiceRecDetailRes queryServiceDetail(String serviceId) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(serviceId); + IcServiceRecDetailRes res = ConvertUtils.sourceToTarget(icServiceRecordEntity, IcServiceRecDetailRes.class); + if (null != res) { + res.setServiceScope(icServiceScopeDao.selectList(serviceId)); + //服务分类名称 + Result> icServiceTypeMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + if (!icServiceTypeMapRes.success() || MapUtils.isEmpty(icServiceTypeMapRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务分类字典查询异常"); + } + res.setServiceCategoryName(icServiceTypeMapRes.getData().get(res.getServiceCategoryKey())); + res.setFeedBack(serviceFeedbackDao.selectByRecId(icServiceRecordEntity.getId())); + } + return res; + } + + /** + * 【服务项目记录】修改 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void updateServiceRecord(IcServiceEditFormDTO formDTO) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(formDTO.getServiceRecordId()); + if (null == icServiceRecordEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("服务记录不存在,serviceRecordId:%s",formDTO.getServiceRecordId()),"服务记录不存在"); + } + icServiceRecordEntity.setServiceTimeStart(formDTO.getServiceTimeStart()); + icServiceRecordEntity.setServiceTimeEnd(formDTO.getServiceTimeEnd()); + if(StringUtils.isNotBlank(formDTO.getPrincipalContact())){ + icServiceRecordEntity.setPrincipalContact(formDTO.getPrincipalContact()); + } + if(StringUtils.isNotBlank(formDTO.getPrincipalName())){ + icServiceRecordEntity.setPrincipalName(formDTO.getPrincipalName()); + } + if(StringUtils.isNotBlank(formDTO.getRemark())){ + icServiceRecordEntity.setRemark(formDTO.getRemark()); + } + baseDao.updateById(icServiceRecordEntity); + } + + + @Override + public PageData listServiceRecords(String serviceCategoryKey, String serviceProjectName, + String serviceOrgName, Date serviceTimeStart, + Date serviceTimeEnd, String serviceStatus, + String satisfaction, Integer pageNo, + Integer pageSize) { + + String msg = "【服务列表】查询服务类别失败"; + Map categories = getResultDataOrThrowsException(adminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + + if (categories == null || categories.size() == 0) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + } + + PageHelper.startPage(pageNo, pageSize); + List records = baseDao.listServiceRecords(serviceCategoryKey, serviceProjectName, serviceOrgName, serviceTimeStart, serviceTimeEnd, serviceStatus, satisfaction); + PageInfo pi = new PageInfo<>(records); + + // 补充信息 + records.forEach(r->{ + String categoryKey = r.getServiceCategoryKey(); + r.setServiceCategoryName(categories.get(categoryKey)); + }); + + return new PageData<>(records, pi.getTotal()); + } + + @Transactional(rollbackFor = Throwable.class) + public void initiateService(ServiceProjectRecordFormDTO input) { + + // 同一个项目暂时不做服务次数限制 + //LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + //query.eq(IcServiceRecordEntity::getServiceProjectId, input.getServiceProjectId()); + // + //if (serviceRecordDao.selectCount(query) > 0) { + // String msg = "该项目已经发起服务,不能重复发起"; + // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + //} + + IcServiceProjectEntity serviceProject = serviceProjectDao.selectById(input.getServiceProjectId()); + IcServiceOrgEntity serviceOrg = serviceOrgDao.selectById(input.getServiceOrgId()); + + ServiceProjectFeedbackFormDTO feedbackDto = input.getFeedback(); + + // 1.服务记录 + IcServiceRecordEntity serviceRecord = new IcServiceRecordEntity(); + serviceRecord.setServiceCategoryKey(input.getServiceCategoryKey()); + serviceRecord.setServiceProjectId(input.getServiceProjectId()); + serviceRecord.setServiceProjectName(serviceProject.getServiceName()); + serviceRecord.setServiceOrgId(input.getServiceOrgId()); + serviceRecord.setServiceOrgName(serviceOrg.getOrgName()); + serviceRecord.setPrincipalName(input.getPrincipalName()); + serviceRecord.setPrincipalContact(input.getPrincipalContact()); + serviceRecord.setServiceTimeStart(input.getServiceTimeStart()); + serviceRecord.setServiceTimeEnd(input.getServiceTimeEnd()); + if (feedbackDto == null) { + // 没写反馈,给一个服务中 + serviceRecord.setServiceStatus("in_service"); + } else { + // 写了反馈,按照反馈的来 + serviceRecord.setServiceStatus(feedbackDto.getServiceStatus()); + serviceRecord.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + } + serviceRecord.setRemark(input.getRemark()); + + baseDao.insert(serviceRecord); + + // 2.服务范围列表 + List serviceScope = input.getServiceScope(); + + serviceScope.stream().forEach(s -> { + String[] scopeObjectIdPathAndName = getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); + IcServiceScopeEntity scope = new IcServiceScopeEntity(); + scope.setServiceCategoryKey(input.getServiceCategoryKey()); + scope.setServiceProjectId(input.getServiceProjectId()); + scope.setServiceOrgId(input.getServiceOrgId()); + scope.setServiceRecordId(serviceRecord.getId()); + scope.setObjectType(s.getObjectType()); + scope.setObjectId(s.getObjectId()); + scope.setObjectIdPath(scopeObjectIdPathAndName[0]); + scope.setObjectName(scopeObjectIdPathAndName[1]); + icServiceScopeDao.insert(scope); + //scope.setRemark(); 为什么会有这个字段?? + }); + + // 3.反馈 + if (feedbackDto == null) { + return; + } + + serviceFeedback(input.getServiceCategoryKey(), input.getServiceOrgId(), input.getServiceProjectId(), serviceRecord.getId(), feedbackDto); + } + + /** + * 查询服务范围的对象的Id path + * @param scopeObjectType + * @param scopeObjectId + * @return + */ + private String[] getScopeObjectIdPath(String scopeObjectType, String scopeObjectId) { + if ("neighborhood".equals(scopeObjectType)) { + + String msg = String.format("【服务项目】-发起服务-根据范围id查询小区信息失败。scopeObjectType:%s, scopeObjectId:%s", + scopeObjectType, scopeObjectId); + + IcNeighborHoodDTO neighborHoodDTO = getResultDataOrThrowsException(govOrgOpenFeignClient.getIcNeighbordhoodById(scopeObjectId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + msg, msg); + + GridInfoCache gridOfNeighborhood = CustomerOrgRedis.getGridInfo(neighborHoodDTO.getGridId()); + + String agencyPids = neighborHoodDTO.getAgencyPids(); + String agencyId = neighborHoodDTO.getAgencyId(); + String gridId = gridOfNeighborhood.getId(); + + return new String[]{ agencyPids.concat(":") + .concat(agencyId).concat(":") + .concat(gridId).concat(":") + .concat(neighborHoodDTO.getId()), + neighborHoodDTO.getNeighborHoodName() }; + } else if ("agency".equals(scopeObjectType)) { + // 组织的pids是到父级组织 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(scopeObjectId); + if ("0".equals(agencyInfo.getPid())) { + return new String[]{ agencyInfo.getId(), agencyInfo.getOrganizationName() }; + } + return new String[]{ agencyInfo.getPids().concat(":").concat(agencyInfo.getPid()), agencyInfo.getOrganizationName() }; + } else if ("grid".equals(scopeObjectType)) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(scopeObjectId); + // 网格的pids是到社区的 + return new String[]{ gridInfo.getPids().concat(":").concat(gridInfo.getId()), gridInfo.getGridName() }; + } else { + String msg = String.format("【服务项目】-发起服务-范围type未知:scopeObjectType:%s,scopeObjectId:%s", scopeObjectType, scopeObjectId); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + } + + @Transactional(rollbackFor = Throwable.class) + @Override + public void serviceFeedback(String serviceCategoryKey, String serviceOrgId, String serviceProjectId, String serviceRecordId, ServiceProjectFeedbackFormDTO feedbackDto) { + + // 如果还在服务中,那么需要改为已结束 + IcServiceRecordEntity serviceRecord = serviceRecordDao.selectById(serviceRecordId); + if ("in_service".equals(serviceRecord.getServiceStatus())) { + serviceRecord.setServiceStatus("completed"); + serviceRecord.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + serviceRecordDao.updateById(serviceRecord); + } + + // 反馈信息 + IcServiceFeedbackEntity feedbackEntity = new IcServiceFeedbackEntity(); + feedbackEntity.setServiceCategoryKey(serviceCategoryKey); + feedbackEntity.setServiceProjectId(serviceProjectId); + feedbackEntity.setServiceOrgId(serviceOrgId); + feedbackEntity.setServiceGoal(feedbackDto.getServiceGoal()); + feedbackEntity.setServiceEffect(feedbackDto.getServiceEffect()); + //feedbackEntity.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + feedbackEntity.setSatisfaction(feedbackDto.getSatisfaction()); + feedbackEntity.setLongitude(feedbackDto.getLongitude()); + feedbackEntity.setLatitude(feedbackDto.getLatitude()); + feedbackEntity.setAddress(feedbackDto.getAddress()); + feedbackEntity.setServiceRecordId(serviceRecordId); + serviceFeedbackDao.insert(feedbackEntity); + + // 反馈附件列表 + List attachmentList = feedbackDto.getAttachmentList(); + if (CollectionUtils.isNotEmpty(attachmentList)) { + for (int i = 0; i < attachmentList.size(); i++) { + ServiceProjectFeedbackFormDTO.Attachment a = attachmentList.get(i); + + IcServiceProjectAttachmentEntity at = new IcServiceProjectAttachmentEntity(); + at.setAttachmentFormat(a.getAttachmentFormat()); + at.setAttachmentName(a.getAttachmentName()); + at.setAttachmentType(a.getAttachmentType()); + at.setAttachmentUrl(a.getAttachmentUrl()); + // feedback:反馈,service:服务本身 + at.setAttachTo("feedback"); + at.setDuration(0); + at.setIcServiceId(feedbackEntity.getId()); + // 根本不需要审核,逗你玩 + at.setReason(null); + at.setStatus("auto_passed"); + at.setSort(i); + serviceProjectAttachmentDao.insert(at); + } + } + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java new file mode 100644 index 0000000000..8324f297d3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcServiceScopeDao; +import com.epmet.entity.IcServiceScopeEntity; +import com.epmet.service.IcServiceScopeService; +import org.springframework.stereotype.Service; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Service +public class IcServiceScopeServiceImpl extends BaseServiceImpl implements IcServiceScopeService { + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index b552251007..2d04bec434 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -1810,6 +1810,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl query=new LambdaQueryWrapper<>(); - query.eq(VolunteerInfoEntity::getCustomerId,customerId); - query.likeRight(VolunteerInfoEntity::getPids,pids); - query.select(VolunteerInfoEntity::getUserId); - query.orderByAsc(VolunteerInfoEntity::getCreatedTime); - Set userIds = baseDao.selectObjs(query).stream().map(o->o.toString()).collect(Collectors.toSet()); List resultList = new ArrayList<>(); - if (CollectionUtils.isEmpty(userIds)) { - return resultList; - } - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIds)); - if (userInfoRes.success() && CollectionUtils.isNotEmpty(userInfoRes.getData())) { - Map userMap = userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity())); - for (String userId : userIds) { - if (userMap.containsKey(userId)) { - if (StringUtils.isNoneBlank(userRealName)) { - if (userMap.get(userId).getRealName().contains(userRealName)) { - OptionDTO optionDTO = new OptionDTO(); - optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); - optionDTO.setValue(userId); - resultList.add(optionDTO); - } - } else { - OptionDTO optionDTO = new OptionDTO(); - optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); - optionDTO.setValue(userId); - resultList.add(optionDTO); - } - } - } + IcResiUserDTO icUser = new IcResiUserDTO(); + icUser.setCustomerId(customerId); + icUser.setAgencyId(staffInfo.getAgencyId()); + Result> volunteerRes = epmetUserOpenFeignClient.getVolunteerList(icUser); + if (volunteerRes.success() && CollectionUtils.isNotEmpty(volunteerRes.getData())) { + resultList = ConvertUtils.sourceToTarget(volunteerRes.getData(), OptionDTO.class); + resultList = resultList.stream().sorted((o1, o2) -> + Collator.getInstance(Locale.SIMPLIFIED_CHINESE).compare(o1.getLabel(),o2.getLabel())) + .collect(Collectors.toList()); } return resultList; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index ee3924bdb5..7c4f924e20 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -162,9 +162,9 @@ public class WorkActServiceImpl implements WorkActService { //校验参数 //校验 活动报名截止时间应该大于当前时间 - if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ - throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); - } + // if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ + // throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); + // } this.checkPublishFormDTO(actInfoEntity); PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); //内容审核(活动标题、招募要求、活动内容图文) @@ -202,10 +202,10 @@ public class WorkActServiceImpl implements WorkActService { ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); //校验参数 - //校验 活动报名截止时间应该大于当前时间 - if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ - throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); - } + // //校验 活动报名截止时间应该大于当前时间 + // if (actInfoEntity.getSignUpEndTime().before(DateUtils.minStrToSecondDate(DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)))){ + // throw new RenException(EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getCode(),EpmetErrorCode.ACT_SIGN_UP_END_TIME_EARLIER_NOW_EERROR.getMsg()); + // } this.checkPublishFormDTO(actInfoEntity); PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); //内容审核(活动标题、招募要求、活动内容图文) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql new file mode 100644 index 0000000000..8882e7c143 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql @@ -0,0 +1,137 @@ + +CREATE TABLE `ic_service_project` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PID` varchar(64) NOT NULL COMMENT '组织ID的上级', + `AGENCY_ID_PATH` varchar(255) NOT NULL COMMENT '组织ID的所有上级[包括自己]', + `SERVICE_CATEGORY_KEY` varchar(10) NOT NULL COMMENT '服务类别值', + `SERVICE_NAME` varchar(2000) NOT NULL COMMENT '服务名称', + `SERVICE_CONTENT` varchar(2000) NOT NULL COMMENT '服务内容', + `POLICY_LEVEL` varchar(1) DEFAULT '' COMMENT '政策级别,0市级;1区级;2街道级', + `POLICY_GROUND` varchar(2000) DEFAULT NULL COMMENT '政策依据', + `ENABLED` int(1) NOT NULL COMMENT '启用状态,0启用,1禁用', + `DEL_FLAG` int(1) NOT NULL, + `REVISION` int(1) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务项目管理表'; + + +CREATE TABLE `ic_service_project_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_SERVICE_ID` varchar(64) NOT NULL COMMENT '服务记录id,服务项目id', + `ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '隶属于。feedback:反馈;service:服务本身', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + +CREATE TABLE `ic_service_org` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '所属组织机构Id', + `AGENCY_ID_PATH` varchar(256) NOT NULL COMMENT 'agencyId的所有上级,包含自己', + `SERVICE_TYPE` varchar(64) NOT NULL COMMENT '服务类别【字典表 ic_service_type】多个值逗号分隔', + `ORG_NAME` varchar(64) NOT NULL COMMENT '服务组织名称', + `ORG_DESCRIBE` varchar(512) DEFAULT NULL COMMENT '组织描述', + `PRINCIPAL_NAME` varchar(64) NOT NULL COMMENT '负责人姓名', + `PRINCIPAL_MOBILE` varchar(11) NOT NULL COMMENT '负责人电话', + `LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', + `ADDRESS` varchar(256) DEFAULT NULL COMMENT '地址', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_pid` (`AGENCY_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='服务组织表'; + + +CREATE TABLE `ic_service_record` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_PROJECT_NAME` varchar(255) NOT NULL COMMENT '服务项目名称', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_ORG_NAME` varchar(255) NOT NULL COMMENT '服务组织名称', + `PRINCIPAL_NAME` varchar(32) DEFAULT NULL COMMENT '经办人姓名', + `PRINCIPAL_CONTACT` varchar(64) DEFAULT NULL COMMENT '联系方式', + `SERVICE_TIME_START` datetime NOT NULL COMMENT '服务时间', + `SERVICE_TIME_END` datetime NOT NULL COMMENT '服务截止时间', + `SERVICE_STATUS` varchar(32) NOT NULL COMMENT 'in_service服务中;completed:已完成', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务项目记录表'; + +CREATE TABLE `ic_service_feedback` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_GOAL` varchar(255) DEFAULT NULL COMMENT '服务目标', + `SERVICE_EFFECT` varchar(255) DEFAULT NULL COMMENT '服务效果', + `SERVICE_PEOPLE_NUMBER` int(10) DEFAULT NULL COMMENT '服务人数', + `SATISFACTION` varchar(30) DEFAULT NULL COMMENT '满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect', + `LONGITUDE` varchar(255) DEFAULT NULL COMMENT '地址经度', + `LATITUDE` varchar(255) DEFAULT NULL COMMENT '地址纬度', + `address` varchar(64) DEFAULT NULL COMMENT '地址', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_RECORD_ID` varchar(64) NOT NULL, + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务项目反馈信息'; + + +CREATE TABLE `ic_service_scope` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_RECORD_ID` varchar(64) NOT NULL COMMENT '服务记录的ID', + `OBJECT_TYPE` varchar(32) NOT NULL COMMENT 'agency单位;grid网格;neighborhood小区', + `OBJECT_ID` varchar(64) NOT NULL COMMENT '选中的组织的ID', + `OBJECT_ID_PATH` varchar(255) NOT NULL COMMENT '发布范围的组织ID PATH', + `OBJECT_NAME` varchar(32) DEFAULT NULL, + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务范围表' \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql new file mode 100644 index 0000000000..32cb514da9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql @@ -0,0 +1,6 @@ +ALTER TABLE `ic_service_org` +MODIFY COLUMN `ORG_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务组织名称' AFTER `SERVICE_TYPE`, +MODIFY COLUMN `ORG_DESCRIBE` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织描述' AFTER `ORG_NAME`, +MODIFY COLUMN `PRINCIPAL_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人姓名' AFTER `ORG_DESCRIBE`, +MODIFY COLUMN `PRINCIPAL_MOBILE` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人电话' AFTER `PRINCIPAL_NAME`; + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql new file mode 100644 index 0000000000..703651cf09 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql @@ -0,0 +1,2 @@ +alter table ic_service_record + add SERVICE_PEOPLE_NUMBER int(10) comment '服务人数' after SERVICE_STATUS; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml index 4293f65f43..d7b90133a4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -178,4 +178,13 @@ ORDER BY so.ORG_ID ASC,so.ORGANIZATION_CREATED_TIME DESC + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml index 1117174bcc..0c5c86d30d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -163,7 +163,10 @@ AND ACTIVITY_TIME <= #{endTime} - AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} + + AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime} + + ORDER BY ACTIVITY_TIME DESC diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index f57d1c7826..c1800190cb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -164,7 +164,7 @@ CREATED_TIME FROM ic_party_unit WHERE DEL_FLAG = '0' - AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%') + AND AGENCY_ID IN (#{pid},#{agencyId}) UNION ALL SELECT ID AS assistanceUnitId, @@ -183,4 +183,14 @@ where del_flag='0' and id=#{partyUnitId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml new file mode 100755 index 0000000000..2f58637231 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml new file mode 100644 index 0000000000..18c6dbe981 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + UPDATE ic_service_org + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml new file mode 100644 index 0000000000..e33c5a3958 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml @@ -0,0 +1,11 @@ + + + + + + + + DELETE FROM ic_service_project_attachment + WHERE IC_SERVICE_ID = #{id} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml new file mode 100644 index 0000000000..17f4de965a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml @@ -0,0 +1,72 @@ + + + + + + + + UPDATE ic_service_project + SET ENABLED = 1, + UPDATED_TIME = NOW() + WHERE ID IN ( + #{id} + ) + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml new file mode 100644 index 0000000000..ad5df068ef --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml new file mode 100644 index 0000000000..026d8c6ac4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + update ic_service_scope set del_flag='1',UPDATED_TIME=now(),UPDATED_BY=#{userId} + where SERVICE_RECORD_ID=#{serviceId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 4d215c16d9..158dcb1b7d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -658,10 +658,24 @@ INNER JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID ) WHERE r.CUSTOMER_ID = #{customerId} + AND r.DEL_FLAG = '0' AND r.STATUS = 'finished' s.SERVER_ID = #{serverId} order by r.REPORT_TIME desc + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx index 0f67e0f0e1..6f5622382d 100644 Binary files a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx and b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/self_org_import_template.xlsx differ diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java new file mode 100644 index 0000000000..7a1537bdd1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsUserHouseService.java @@ -0,0 +1,37 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; + +public interface StatsUserHouseService { + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseGridStatistical(FactUserHouseFormDTO formDTO); + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseAgencyStatistical(FactUserHouseFormDTO formDTO); + + /** + * 人房信息统计 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhy + * @date 2022/5/30 10:25 + */ + Result execUserHouseNeighborhoodStatistical(FactUserHouseFormDTO formDTO); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java new file mode 100644 index 0000000000..653c0ae7e8 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsUserHouseServiceImpl.java @@ -0,0 +1,35 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.StatsUserHouseService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service +public class StatsUserHouseServiceImpl implements StatsUserHouseService { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result execUserHouseGridStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatGrid(formDTO); + } + + @Override + public Result execUserHouseAgencyStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatAgency(formDTO); + } + + @Override + public Result execUserHouseNeighborhoodStatistical(FactUserHouseFormDTO formDTO) { + return dataStatisticalOpenFeignClient.userHouseStatNeighborhood(formDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java new file mode 100644 index 0000000000..9925ed4391 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsUserHouseTask.java @@ -0,0 +1,55 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.FactUserHouseFormDTO; +import com.epmet.service.StatsUserHouseService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 人房 + * + * @author zhy + * @date 2022/5/30 10:23 + */ +@Component("statsUserHouseTask") +public class StatsUserHouseTask implements ITask { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsUserHouseService statsUserHouseService; + + @Override + public void run(String params) { + logger.info("StatsUserHouseTask定时任务正在执行,参数为:{}", params); + FactUserHouseFormDTO formDTO = new FactUserHouseFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, FactUserHouseFormDTO.class); + } + Result result = statsUserHouseService.execUserHouseGridStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-grid定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-grid定时任务执行失败:" + result.getMsg()); + } + + result = statsUserHouseService.execUserHouseAgencyStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-agency定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-agency定时任务执行失败:" + result.getMsg()); + } + + result = statsUserHouseService.execUserHouseNeighborhoodStatistical(formDTO); + if (result.success()) { + logger.info("StatsUserHouseTask-neighborhood定时任务执行成功"); + } else { + logger.error("StatsUserHouseTask-neighborhood定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index 81edf12a9a..5a4b39f502 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -544,7 +544,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { throw new WxSubscribeException("clientType有误", "", openId); } } catch (Exception e) { - log.error("method exception", e); + log.warn("method exception,msg:{}", e.getMessage()); throw new WxSubscribeException("获取openId失败:" + e.getMessage(), "", ""); } return openId; diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/CategorydetailResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/CategorydetailResultDTO.java new file mode 100644 index 0000000000..61bfbc41c6 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/CategorydetailResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 10:44 + **/ +@Data +public class CategorydetailResultDTO implements Serializable { + + /** + *类别ID + */ + private String id; + + /** + *类别名 + */ + private String categoryName; + + /** + *上级类别ID + */ + private String pid; + + /** + *上级类别名 + */ + private String parentCategoryName; + + /** + *创建时间 + */ + private String createdTime; + + /** + *修改时间 + */ + private String updatedTime; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveCalcDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveCalcDTO.java new file mode 100644 index 0000000000..5a86dff31b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveCalcDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 附加积分计算 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +public class PointAdditiveCalcDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 积分类别;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分主体ID;居民端用户ID或房屋ID + */ + private String subjectId; + + /** + * 已用积分;累计已花费 + */ + private Integer spend; + + /** + * 总分;累计积分 + */ + private Integer total; + + /** + * 删除标识;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/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRecordDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRecordDTO.java new file mode 100644 index 0000000000..68c899bed8 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRecordDTO.java @@ -0,0 +1,95 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 附加积分记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +public class PointAdditiveRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标题;积分变动标题或业务场景标题 + */ + private String title; + + /** + * 说明;积分变动的说明 + */ + private String statement; + + /** + * 分值 + */ + private Integer pointValue; + + /** + * 积分类别;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分主体ID;居民端用户ID或房屋ID + */ + private String subjectId; + + /** + * 业务主键 + */ + private String businessId; + + /** + * 业务编码;积分申请point_apply;积分奖励point_reward;积分扣罚point_fine;积分花费point_cost;驳回积分申请point_reject + */ + private String businessCode; + + /** + * 删除标识;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/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRuleDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRuleDTO.java new file mode 100644 index 0000000000..750bdaf71b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRuleDTO.java @@ -0,0 +1,102 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +public class PointAdditiveRuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 记录类型;分类:category;规则:rule + */ + private String type; + + /** + * 允许申请标记;允许0(type = category时,强制赋值为0),禁止1。 + */ + private String applyFlag; + + private String applyFlagName; + + /** + * 积分类别编码;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分类别名称;type=category时必填 + */ + private String categoryName; + + /** + * 积分规则名称;type=rule时必填 + */ + private String ruleName; + + /** + * 上级节点ID;上级分类ID,顶级分类的PID为0 + */ + private String pid; + + /** + * 上级节点ID路径;所有上级节点以英文冒号(:)拼接;不必拼接0 + */ + private String pids; + + /** + * 分值;正数加分,负数减分;type=rule时必填 + */ + private Integer pointValue; + + /** + * 删除标识;0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAnnexDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAnnexDTO.java new file mode 100644 index 0000000000..db0bcc7e16 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAnnexDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 积分相关附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +public class PointAnnexDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务ID;业务主键,包括积分申请、奖扣等业务 + */ + private String businessId; + + /** + * 业务编码;积分申请point_apply,积分奖励point_reward,积分扣罚point_fine,积分花费point_cost + */ + private String businessCode; + + /** + * 附件访问地址 + */ + private String url; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识;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/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointApplyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointApplyDTO.java new file mode 100644 index 0000000000..1cd7fc89e5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointApplyDTO.java @@ -0,0 +1,181 @@ +package com.epmet.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 积分申请 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +public class PointApplyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 类别ID + */ + private String categoryId; + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 类别编码;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分规则ID + */ + private String ruleId; + + /** + * 积分规则名称 + */ + private String ruleName; + + /** + * 申请标题;30字内 + */ + private String title; + + /** + * 申请内容说明;1000字内 + */ + private String statement; + + /** + * 申请状态;0已提交;1已驳回;2已通过 + */ + private String status; + + /** + * 申请人所属网格名称 + */ + private String gridName; + + /** + * 申请人所属网格ID + */ + private String gridId; + + /** + * 申请人所属组织ID + */ + private String agencyId; + + /** + * 上级组织ID路径 + */ + private String agencyPids; + + /** + * 用户ID;申请人ID(居民端用户ID) + */ + private String userId; + + /** + * 居民ID;申请人居民ID(IC_RESI_USER表主键) + */ + private String icResiUser; + + /** + * 房屋ID;房屋或家庭ID + */ + private String houseId; + + /** + * 房屋名称;完整拼接的名称 + */ + private String houseAllName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 昵称 + */ + private String nickname; + private String showName; + /** + * 性别;未知0;男1;女2 + */ + private String gender; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 审核备注 + */ + private String remark; + + private List annexList; + private Integer pointValue; + + /** + * 删除标识;0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRewardDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRewardDTO.java new file mode 100644 index 0000000000..3602e3a5cb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRewardDTO.java @@ -0,0 +1,104 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +public class PointRewardDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID路径 + */ + private String agencyPids; + + /** + * 房屋ID + */ + private String houseId; + + /** + * 房屋名称;完整拼接的名称 + */ + private String houseAllName; + + /** + * 工作人员ID + */ + private String staffId; + + /** + * 工作人员姓名 + */ + private String staffName; + + /** + * 操作类型;积分奖励point_reward;积分扣罚point_fine + */ + private String businessCode; + + /** + * 备注说明;200字内 + */ + private String statement; + + /** + * 奖扣总分值 + */ + private Integer pointValue; + + /** + * 删除标识;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/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRewardRuleDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRewardRuleDTO.java new file mode 100644 index 0000000000..d3cac0024d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointRewardRuleDTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +public class PointRewardRuleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 奖扣ID + */ + private String rewardId; + + /** + * 规则ID + */ + private String ruleId; + + /** + * 删除标识;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/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AddcategoryFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AddcategoryFormDTO.java new file mode 100644 index 0000000000..41aecae242 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AddcategoryFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 11:12 + **/ +@Data +public class AddcategoryFormDTO implements Serializable { + + /** + *类别名称 + */ + @NotNull(message = "类别名称不可为空") + private String categoryName; + + /** + *上级类别ID + */ + @NotNull(message = "上级类别不可为空") + private String pid; + + private String customerId; + + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AddruleFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AddruleFormDTO.java new file mode 100644 index 0000000000..53dd15ca35 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/AddruleFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 11:12 + **/ +@Data +public class AddruleFormDTO implements Serializable { + + /** + *积分规则名称 + */ + @NotNull(message = "积分规则名称不可为空") + private String ruleName; + + /** + *上级类别ID + */ + @NotNull(message = "上级类别不可为空") + private String pid; + + /** + *分值,整数,可以为负数(表示减分) + */ + @NotNull(message = "分值不可为空") + private Integer pointValue; + + /** + *允许申请0,不允许申请1 + */ + @NotNull(message = "申请标记不可为空") + private String applyFlag; + + private String customerId; + + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java index 6ccb0b2a51..d76f874e4c 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java @@ -29,4 +29,6 @@ public class CommonPageUserFormDTO implements Serializable { @NotBlank(message = "获取不到客户Id" , groups = PageUserGroup.class) private String customerId; + + private String categoryCode; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/List4applyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/List4applyFormDTO.java new file mode 100644 index 0000000000..b9fd87d5b2 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/List4applyFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 16:23 + **/ +@Data +public class List4applyFormDTO implements Serializable { + + /** + *允许申请0,不允许申请1 + */ + private String applyFlag; + + /** + *类别 + */ + @NotNull(message = "类别不可为空") + private String categoryCode; + + /** + * 记录类型;分类:category;规则:rule + */ + private String type; + + /** + *积分奖励point_reward;积分扣罚point_fine + */ + @NotNull(message = "奖罚编码不可为空") + private String businessCode; + + + + private String customerId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/List4treeFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/List4treeFormDTO.java new file mode 100644 index 0000000000..2f3e912649 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/List4treeFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 10:10 + **/ +@Data +public class List4treeFormDTO implements Serializable { + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 规则名称 + */ + private String ruleName; + + private String customerId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyFormDTO.java new file mode 100644 index 0000000000..2d46dca728 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/14 14:08 + */ +@NoArgsConstructor +@Data +public class PointApplyFormDTO implements Serializable { + private static final long serialVersionUID = 4850146857511834988L; + private String customerId; + private String userId; + @NotBlank(message = "申请类别不能为空", groups = {AddGroup.class}) + private String ruleId; + @NotBlank(message = "标题不能为空", groups = {AddGroup.class}) + private String title; + @NotBlank(message = "申请内容不能为空", groups = {AddGroup.class}) + private String statement; + @NotBlank(message = "分类不能为空", groups = {AddGroup.class}) + private String categoryCode; + private List annexList; + private String gridId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyPageFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyPageFormDTO.java new file mode 100644 index 0000000000..ca35444589 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyPageFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/15 14:57 + */ +@Data +public class PointApplyPageFormDTO extends PageFormDTO implements Serializable { + private static final long serialVersionUID = -2274024797424706386L; + /** + * 姓名 + */ + private String name; + /** + * 身份证 + */ + private String idCard; + /** + * 手机号 + */ + private String mobile; + /** + * 申请状态;0已提交;1已驳回;2已通过 + */ + private String status; + /** + * 开始时间 + */ + private String startTime; + /** + * 结束时间 + */ + private String endTime; + + private String categoryCode; + + private String agencyId; + private String customerId; + private String userId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointAuditFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointAuditFormDTO.java new file mode 100644 index 0000000000..6acae8a5af --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointAuditFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/15 15:18 + */ +@Data +public class PointAuditFormDTO implements Serializable { + private static final long serialVersionUID = -2470114698294263404L; + private String id; + private String status; + private String remark; + private List ids; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointModifyFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointModifyFormDTO.java new file mode 100644 index 0000000000..71cff835cd --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointModifyFormDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-17 17:48 + **/ +@Data +public class PointModifyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @NotNull(message = "id不可为空") + private String id; + + private String customerId; + + + /** + * 记录类型;分类:category;规则:rule + */ + @NotNull(message = "类型不可为空") + private String type; + + /** + * 允许申请标记;允许0(type = category时,强制赋值为0),禁止1。 + */ + private String applyFlag; + + + /** + * 积分类别名称;type=category时必填 + */ + private String categoryName; + + /** + * 积分规则名称;type=rule时必填 + */ + private String ruleName; + + /** + * 上级节点ID;上级分类ID,顶级分类的PID为0 + */ + @NotNull(message = "pid不可为空") + private String pid; + + + /** + * 分值;正数加分,负数减分;type=rule时必填 + */ + private Integer pointValue; + + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/RecordRewardFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/RecordRewardFormDTO.java new file mode 100644 index 0000000000..f01fe59676 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/RecordRewardFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 17:21 + **/ +@Data +public class RecordRewardFormDTO extends PageFormDTO implements Serializable { + + /** + * 客户ID + */ + private String customerId; + + /** + *积分申请房屋ID + */ + private String houseId; + + /** + *业务编码:积分奖励point_reward;积分扣罚point_fine + */ + @NotNull(message = "业务编码不可为空") + private String businessCode; + + + + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/SubmitRewardFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/SubmitRewardFormDTO.java new file mode 100644 index 0000000000..27b112f0f7 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/SubmitRewardFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-15 17:21 + **/ +@Data +public class SubmitRewardFormDTO implements Serializable { + + /** + * 客户ID + */ + private String customerId; + + /** + * 工作人员ID + */ + private String staffId; + + /** + *积分申请房屋ID + */ + private String houseId; + + /** + *业务编码:积分奖励point_reward;积分扣罚point_fine + */ + private String businessCode; + /** + *规则ID集合 + */ + private List ruleIdList; + + /** + *附件url集合 + */ + private List annexList; + /** + *备注说明 + */ + private String statement; + + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java new file mode 100644 index 0000000000..0d74a3fdf2 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-17 10:50 + **/ +@Data +public class List4ApplyResultDTO implements Serializable { + + private String id; + + private String name; + +// private String pid; + + private Integer pointValue; + +// private List children = new ArrayList<>(); +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyTotalPointResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyTotalPointResultDTO.java new file mode 100644 index 0000000000..050416dd08 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyTotalPointResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/14 15:39 + */ +@Data +public class MyTotalPointResultDTO implements Serializable { + private static final long serialVersionUID = 15299506166024546L; + /** + * 总积分 + */ + private Integer total; + /** + * 已花费积分 + */ + private Integer spend; + /** + * 可用积分 + */ + private Integer usable; + + public MyTotalPointResultDTO() { + this.total = 0; + this.spend = 0; + this.usable = 0; + } +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdditiveRecordDailyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdditiveRecordDailyDTO.java new file mode 100644 index 0000000000..1f51bc9928 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdditiveRecordDailyDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/15 9:47 + */ +@Data +public class PointAdditiveRecordDailyDTO implements Serializable { + private static final long serialVersionUID = -239326201168528901L; + /** + * 日期yyyy-MM-dd + */ + private String date; + /** + * 时间hh:mm + */ + private String time; + /** + * 标题 + */ + private String title; + /** + * 积分说明 + */ + private String remark; + /** + * 积分值 + */ + private String point; + /** + * 业务主键 + */ + private String businessId; + /** + * 业务类型 积分申请point_apply;积分奖励point_reward;积分扣罚point_fine;积分花费point_cost;驳回积分申请point_reject + */ + private String businessCode; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdditiveRecordResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdditiveRecordResultDTO.java new file mode 100644 index 0000000000..096b585417 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointAdditiveRecordResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/15 9:46 + */ +@Data +public class PointAdditiveRecordResultDTO implements Serializable { + private static final long serialVersionUID = -1498111500078847600L; + /** + * 日期yyyy-MM-dd + */ + private String date; + private List dailyList; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/CommonConstant.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/CommonConstant.java new file mode 100644 index 0000000000..b57d39a273 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/CommonConstant.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.common; + +import com.epmet.commons.tools.constant.Constant; + +/** + * 身边党员-积分排行 入参常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface CommonConstant extends Constant { + /** + * 德育积分 + */ + String MORAL_EDUCATION = "moral_education"; + /** + * 党建积分 + */ + String PARTY_BUILDING = "party_building"; + /** + * 活跃积分 + */ + String ACTIVE = "active"; + /** + * 活跃积分 + */ + String TOTAL = "total"; + /** + * 积分申请 + */ + String POINT_APPLY = "point_apply"; + /** + * 积分奖励 + */ + String POINT_REWARD = "point_reward"; + /** + * 积分扣罚 + */ + String POINT_FINE = "point_fine"; + /** + * 积分花费 + */ + String POINT_COST = "point_cost"; + /** + * 驳回积分申请 + */ + String POINT_REJECT = "point_reject"; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/ApplyStatusEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/ApplyStatusEnum.java new file mode 100644 index 0000000000..855dcaf599 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/ApplyStatusEnum.java @@ -0,0 +1,49 @@ +package com.epmet.common.enu; + +import java.util.Objects; + +/** + * @author Administrator + */ + +public enum ApplyStatusEnum { + //审核状态 + AUDITING("0", "未审核"), + REJECT("1", "已驳回"), + PASSED("2", "已通过"); + + private String code; + private String name; + + + ApplyStatusEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static String getName(String code) { + ApplyStatusEnum[] applyStatusEnums = values(); + for (ApplyStatusEnum applyStatusEnum : applyStatusEnums) { + if (Objects.equals(applyStatusEnum.getCode(), code)) { + return applyStatusEnum.getName(); + } + } + return null; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointAddRuleEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointAddRuleEnum.java new file mode 100644 index 0000000000..8763af0681 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointAddRuleEnum.java @@ -0,0 +1,44 @@ +package com.epmet.common.enu; + +/** +* @describe: 积分规则枚举类 +* @author wangtong +* @date 2022/6/15 13:54 +*/ +public enum PointAddRuleEnum { + CATEGORY_TYPE("category", "分类"), + RULE_TYPE("rule", "规则"), + APPLY_ALLOW("0", "允许"), + APPLY_BAN("1", "禁止"), + MORAL_EDUCATION("moral_education", "德育积分"), + POINT_FINE("point_fine", "积分扣罚"), + POINT_REWARD("point_reward", "积分奖励"), + ; + + private String code; + private String desc; + + + PointAddRuleEnum(String code, String name) { + this.code = code; + this.desc = name; + } + + public static PointAddRuleEnum getEnum(String code) { + PointAddRuleEnum[] values = PointAddRuleEnum.values(); + for (PointAddRuleEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointAdditiveRuleController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointAdditiveRuleController.java new file mode 100644 index 0000000000..3f780d3ff9 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointAdditiveRuleController.java @@ -0,0 +1,188 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.CategorydetailResultDTO; +import com.epmet.dto.PointAdditiveRuleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.List4ApplyResultDTO; +import com.epmet.excel.PointAdditiveRuleExcel; +import com.epmet.service.PointAdditiveRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@RestController +@RequestMapping("additiverule") +public class PointAdditiveRuleController { + + @Autowired + private PointAdditiveRuleService pointAdditiveRuleService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = pointAdditiveRuleService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + PointAdditiveRuleDTO data = pointAdditiveRuleService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody PointAdditiveRuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + pointAdditiveRuleService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody PointAdditiveRuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + pointAdditiveRuleService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pointAdditiveRuleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = pointAdditiveRuleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PointAdditiveRuleExcel.class); + } + + /** + * @describe: 查询积分类别规则列表 + * @author wangtong + * @date 2022/6/15 10:11 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("list4tree") + public Result> list4tree(@LoginUser TokenDto tokenDto, @RequestBody List4treeFormDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + return pointAdditiveRuleService.list4tree(dto); + } + + /** + * @describe: 查询下级类别简要信息 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("subcategory/listbrief/{categoryId}") + public Result> listbrief(@PathVariable("categoryId") String categoryId){ + return pointAdditiveRuleService.listbrief(categoryId); + } + + /** + * @describe: 查询积分类别详情 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("categorydetail/{categoryId}") + public Result categorydetail(@PathVariable("categoryId") String categoryId){ + return pointAdditiveRuleService.categorydetail(categoryId); + } + + /** + * @describe: 添加积分类别 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("addcategory") + public Result addcategory(@LoginUser TokenDto tokenDto,@RequestBody AddcategoryFormDTO dto){ + ValidatorUtils.validateEntity(dto); + dto.setCustomerId(tokenDto.getCustomerId()); + return pointAdditiveRuleService.addcategory(dto); + } + + /** + * @describe: 添加积分规则 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("addrule") + public Result addrule(@LoginUser TokenDto tokenDto,@RequestBody AddruleFormDTO dto){ + ValidatorUtils.validateEntity(dto); + dto.setCustomerId(tokenDto.getCustomerId()); + return pointAdditiveRuleService.addrule(dto); + } + + /** + * @describe: [附加积分]获取允许申请的积分类别 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("list4apply") + public Result> list4apply(@LoginUser TokenDto tokenDto, @RequestBody List4applyFormDTO dto){ + ValidatorUtils.validateEntity(dto); + dto.setCustomerId(tokenDto.getCustomerId()); + return pointAdditiveRuleService.list4apply(dto); + } + + /** + * @describe: 查询积分规则详情 + * @author wangtong + * @date 2022/6/17 17:36 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("ruledetail/{ruleId}") + public Result ruledetail(@PathVariable("ruleId") String ruleId){ + return pointAdditiveRuleService.ruledetail(ruleId); + } + + /** + * @describe: 修改积分分类/规则 + * @author wangtong + * @date 2022/6/17 17:51 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("modify") + public Result modify(@LoginUser TokenDto tokenDto,@RequestBody PointModifyFormDTO dto){ + dto.setCustomerId(tokenDto.getCustomerId()); + return pointAdditiveRuleService.modify(dto); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointApplyController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointApplyController.java new file mode 100644 index 0000000000..19423970b3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointApplyController.java @@ -0,0 +1,94 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.PointApplyDTO; +import com.epmet.dto.form.PointApplyFormDTO; +import com.epmet.dto.form.PointApplyPageFormDTO; +import com.epmet.dto.form.PointAuditFormDTO; +import com.epmet.service.PointApplyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * 积分申请 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@RestController +@RequestMapping("apply") +public class PointApplyController { + + @Autowired + private PointApplyService pointApplyService; + + @RequestMapping("listall") + public Result> page(@LoginUser TokenDto tokenDto, @RequestBody PointApplyPageFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + PageData page = pointApplyService.page(formDTO); + return new Result>().ok(page); + } + + @RequestMapping(value = "detail/{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + PointApplyDTO data = pointApplyService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody PointApplyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + pointApplyService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody PointApplyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + pointApplyService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pointApplyService.delete(ids); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("submit") + public Result submit(@LoginUser TokenDto tokenDto, @RequestBody PointApplyFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + pointApplyService.submit(formDTO); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("examine/submit") + public Result audit(@LoginUser TokenDto tokenDto, @RequestBody PointAuditFormDTO formDTO){ + //效验数据 + pointApplyService.audit(tokenDto, formDTO); + return new Result(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRewardController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRewardController.java new file mode 100644 index 0000000000..4ee6c98f37 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRewardController.java @@ -0,0 +1,113 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.PointRewardDTO; +import com.epmet.dto.form.RecordRewardFormDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.excel.PointRewardExcel; +import com.epmet.service.PointRewardService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@RestController +@RequestMapping("reward") +public class PointRewardController { + + @Autowired + private PointRewardService pointRewardService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = pointRewardService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + PointRewardDTO data = pointRewardService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody PointRewardDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + pointRewardService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody PointRewardDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + pointRewardService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pointRewardService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = pointRewardService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PointRewardExcel.class); + } + + /** + * @describe: 提交积分奖扣 + * @author wangtong + * @date 2022/6/15 17:30 + * @params [tokenDto, dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("submit") + public Result submit(@LoginUser TokenDto tokenDto, @RequestBody SubmitRewardFormDTO dto){ + ValidatorUtils.validateEntity(dto); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setStaffId(tokenDto.getUserId()); + return pointRewardService.submit(dto); + } + + /** + * @describe: 查询积分奖扣记录 + * @author wangtong + * @date 2022/6/16 14:21 + * @params [tokenDto, dto] + * @return com.epmet.commons.tools.utils.Result>> + */ + @PostMapping("record") + public Result> record(@LoginUser TokenDto tokenDto, @RequestBody RecordRewardFormDTO dto){ + ValidatorUtils.validateEntity(dto); + dto.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(pointRewardService.record(dto)); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRewardRuleController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRewardRuleController.java new file mode 100644 index 0000000000..9ee5a025e8 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRewardRuleController.java @@ -0,0 +1,82 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.PointRewardRuleDTO; +import com.epmet.excel.PointRewardRuleExcel; +import com.epmet.service.PointRewardRuleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@RestController +@RequestMapping("pointRewardRule") +public class PointRewardRuleController { + + @Autowired + private PointRewardRuleService pointRewardRuleService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = pointRewardRuleService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + PointRewardRuleDTO data = pointRewardRuleService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody PointRewardRuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + pointRewardRuleService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody PointRewardRuleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + pointRewardRuleService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + pointRewardRuleService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = pointRewardRuleService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PointRewardRuleExcel.class); + } + + + +} 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 0b19244e0a..885910a843 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 @@ -8,10 +8,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.service.PointVerificationLogService; -import com.epmet.service.UserPointActionLogService; -import com.epmet.service.UserPointStatisticalDailyService; -import com.epmet.service.UserPointTotalService; +import com.epmet.service.*; import com.epmet.utils.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -20,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.util.List; /** @@ -39,6 +37,8 @@ public class ResiPointController { private PointVerificationLogService pointVerificationLogService; @Autowired private UserPointActionLogService pointActionLogService; + @Resource + private PointAdditiveRecordService pointAdditiveRecordService; /** * @Description 获取指定居民的积分信息 @@ -232,5 +232,27 @@ public class ResiPointController { return new Result().ok(userPointStatisticalDailyService.gridPointRank(tokenDto, formDTO)); } + @PostMapping("total") + public Result totalPoint(@LoginUser TokenDto tokenDto, @RequestBody CommonPageUserFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(userPointTotalService.totalPoint(formDTO)); + } + /** + * 德育积分/党建积分的积分记录 + * + * @Param dto + * @Param pageUserParam + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/15 9:55 + */ + @PostMapping("additiverecordlist") + public Result> additiveRecords(@LoginUser TokenDto dto, @RequestBody CommonPageUserFormDTO pageUserParam){ + pageUserParam.setCustomerId(dto.getCustomerId()); + pageUserParam.setUserId(dto.getUserId()); + ValidatorUtils.validateEntity(pageUserParam, CommonPageUserFormDTO.PageUserGroup.class); + return new Result>().ok(pointAdditiveRecordService.getRecords(pageUserParam)); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveCalcDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveCalcDao.java new file mode 100644 index 0000000000..ca55b3d103 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveCalcDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointAdditiveCalcEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 附加积分计算 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Mapper +public interface PointAdditiveCalcDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRecordDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRecordDao.java new file mode 100644 index 0000000000..e1a5638f48 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRecordDao.java @@ -0,0 +1,30 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.PointAdditiveRecordDailyDTO; +import com.epmet.entity.PointAdditiveRecordEntity; +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 2022-06-14 + */ +@Mapper +public interface PointAdditiveRecordDao extends BaseDao { + /** + * 积分记录 + * + * @Param customerId + * @Param categoryCode + * @Param subjectId + * @Return {@link List< PointAdditiveRecordDailyDTO >} + * @Author zhaoqifeng + * @Date 2022/6/15 10:12 + */ + List selectRecordList(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode, @Param("subjectId") String subjectId); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRuleDao.java new file mode 100644 index 0000000000..8b39e7d65b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveRuleDao.java @@ -0,0 +1,90 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CategorydetailResultDTO; +import com.epmet.dto.PointAdditiveRuleDTO; +import com.epmet.dto.form.List4applyFormDTO; +import com.epmet.dto.form.List4treeFormDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.dto.result.List4ApplyResultDTO; +import com.epmet.entity.PointAdditiveRuleEntity; +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 2022-06-15 + */ +@Mapper +public interface PointAdditiveRuleDao extends BaseDao { + + /** + * @describe: 查询下级类别简要信息 + * @author wangtong + * @date 2022/6/15 10:30 + * @params [categoryId] + * @return java.util.List + */ + List selectListbrief(@Param("categoryId") String categoryId); + + /** + * @describe: 查询积分类别详情 + * @author wangtong + * @date 2022/6/15 10:52 + * @params [categoryId] + * @return com.epmet.dto.CategorydetailResultDTO + */ + CategorydetailResultDTO selectCategorydetail(@Param("categoryId") String categoryId); + + /** + * @describe: [附加积分]获取允许申请的积分类别 + * @author wangtong + * @date 2022/6/15 16:29 + * @params [dto] + * @return java.util.List + */ + List selectList4apply(List4applyFormDTO dto); + + /** + * @describe: 查询积分类别规则列表 + * @author wangtong + * @date 2022/6/15 16:43 + * @params [dto] + * @return java.util.List + */ + List selectList4tree(List4treeFormDTO dto); + + /** + * @describe: 根据规则查询积分总值 + * @author wangtong + * @date 2022/6/16 10:43 + * @params [dto] + * @return java.lang.Integer + */ + Integer selectPointTotalByIds(SubmitRewardFormDTO dto); + + /** + * @describe: 通过名称查询 + * @author wangtong + * @date 2022/6/17 9:37 + * @params [customerId, categoryName] + * @return com.epmet.entity.PointAdditiveRuleEntity + */ + PointAdditiveRuleEntity selectEntityByName(@Param("id") String id, + @Param("customerId") String customerId, + @Param("categoryName") String categoryName, + @Param("ruleName") String ruleName); + + /** + * @describe: 查询积分规则详情 + * @author wangtong + * @date 2022/6/17 17:40 + * @params [categoryId] + * @return com.epmet.dto.PointAdditiveRuleDTO + */ + PointAdditiveRuleDTO selectRuledetail(@Param("ruleId") String ruleId); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAnnexDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAnnexDao.java new file mode 100644 index 0000000000..6d1163adc3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAnnexDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointAnnexEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分相关附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Mapper +public interface PointAnnexDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointApplyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointApplyDao.java new file mode 100644 index 0000000000..809226c58d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointApplyDao.java @@ -0,0 +1,40 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PointApplyDTO; +import com.epmet.dto.form.PointApplyPageFormDTO; +import com.epmet.entity.PointApplyEntity; +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 2022-06-14 + */ +@Mapper +public interface PointApplyDao extends BaseDao { + + /** + * 获取积分申请详情 + * + * @Param id + * @Return {@link PointApplyDTO} + * @Author zhaoqifeng + * @Date 2022/6/15 14:31 + */ + PointApplyDTO getDetail(@Param("id") String id); + + /** + * 申请列表 + * @Param formDTO + * @Return {@link List< PointApplyDTO>} + * @Author zhaoqifeng + * @Date 2022/6/15 15:01 + */ + List getList(PointApplyPageFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRewardDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRewardDao.java new file mode 100644 index 0000000000..6ff72ba2a4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRewardDao.java @@ -0,0 +1,28 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PointRewardDTO; +import com.epmet.dto.form.RecordRewardFormDTO; +import com.epmet.entity.PointRewardEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Mapper +public interface PointRewardDao extends BaseDao { + + /** + * @describe: 查询积分奖扣记录 + * @author wangtong + * @date 2022/6/16 14:29 + * @params [dto] + * @return java.util.List + */ + List selectRewardRecord(RecordRewardFormDTO dto); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRewardRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRewardRuleDao.java new file mode 100644 index 0000000000..99f2d046bf --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRewardRuleDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointRewardRuleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Mapper +public interface PointRewardRuleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveCalcEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveCalcEntity.java new file mode 100644 index 0000000000..53c4939cf8 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveCalcEntity.java @@ -0,0 +1,46 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 附加积分计算 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_additive_calc") +public class PointAdditiveCalcEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 积分类别;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分主体ID;居民端用户ID或房屋ID + */ + private String subjectId; + + /** + * 已用积分;累计已花费 + */ + private Integer spend; + + /** + * 总分;累计积分 + */ + private Integer total; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRecordEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRecordEntity.java new file mode 100644 index 0000000000..cc30d1fb85 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRecordEntity.java @@ -0,0 +1,61 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 附加积分记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_additive_record") +public class PointAdditiveRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 标题;积分变动标题或业务场景标题 + */ + private String title; + + /** + * 说明;积分变动的说明 + */ + private String statement; + + /** + * 分值 + */ + private Integer pointValue; + + /** + * 积分类别;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分主体ID;居民端用户ID或房屋ID + */ + private String subjectId; + + /** + * 业务主键 + */ + private String businessId; + + /** + * 业务编码;积分申请point_apply;积分奖励point_reward;积分扣罚point_fine;积分花费point_cost;驳回积分申请point_reject + */ + private String businessCode; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRuleEntity.java new file mode 100644 index 0000000000..fbd1ebbdf5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRuleEntity.java @@ -0,0 +1,69 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_additive_rule") +public class PointAdditiveRuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 记录类型;分类:category;规则:rule + */ + private String type; + + /** + * 允许申请标记;允许0(type = category时,强制赋值为0),禁止1。 + */ + private String applyFlag; + + /** + * 积分类别编码;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分类别名称;type=category时必填 + */ + private String categoryName; + + /** + * 积分规则名称;type=rule时必填 + */ + private String ruleName; + + /** + * 上级节点ID;上级分类ID,顶级分类的PID为0 + */ + private String pid; + + /** + * 上级节点ID路径;所有上级节点以英文冒号(:)拼接;不必拼接0 + */ + private String pids; + + /** + * 分值;正数加分,负数减分;type=rule时必填 + */ + private Integer pointValue; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAnnexEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAnnexEntity.java new file mode 100644 index 0000000000..b5b19d6ccb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAnnexEntity.java @@ -0,0 +1,45 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 积分相关附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_annex") +public class PointAnnexEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务ID;业务主键,包括积分申请、奖扣等业务 + */ + private String businessId; + + /** + * 业务编码;积分申请point_apply,积分奖励point_reward,积分扣罚point_fine,积分花费point_cost + */ + private String businessCode; + + /** + * 附件访问地址 + */ + private String url; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointApplyEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointApplyEntity.java new file mode 100644 index 0000000000..29c2272fec --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointApplyEntity.java @@ -0,0 +1,144 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 积分申请 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_apply") +public class PointApplyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 类别ID + */ + private String categoryId; + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 类别编码;德育积分moral_education;党建积分party_building + */ + private String categoryCode; + + /** + * 积分规则ID + */ + private String ruleId; + + /** + * 积分规则名称 + */ + private String ruleName; + + /** + * 申请标题;30字内 + */ + private String title; + + /** + * 申请内容说明;1000字内 + */ + private String statement; + + /** + * 申请状态;0已提交;1已驳回;2已通过 + */ + private String status; + + /** + * 申请人所属网格名称 + */ + private String gridName; + + /** + * 申请人所属网格ID + */ + private String gridId; + + /** + * 申请人所属组织ID + */ + private String agencyId; + + /** + * 上级组织ID路径 + */ + private String agencyPids; + + /** + * 用户ID;申请人ID(居民端用户ID) + */ + private String userId; + + /** + * 居民ID;申请人居民ID(IC_RESI_USER表主键) + */ + private String icResiUser; + + /** + * 房屋ID;房屋或家庭ID + */ + private String houseId; + + /** + * 房屋名称;完整拼接的名称 + */ + private String houseAllName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别;未知0;男1;女2 + */ + private String gender; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 审核备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRewardEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRewardEntity.java new file mode 100644 index 0000000000..b1b1c8dbcf --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRewardEntity.java @@ -0,0 +1,74 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_reward") +public class PointRewardEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID路径 + */ + private String agencyPids; + + /** + * 房屋ID + */ + private String houseId; + + /** + * 房屋名称;完整拼接的名称 + */ + private String houseAllName; + + /** + * 工作人员ID + */ + private String staffId; + + /** + * 工作人员姓名 + */ + private String staffName; + + /** + * 操作类型;积分奖励point_reward;积分扣罚point_fine + */ + private String businessCode; + + /** + * 备注说明;200字内 + */ + private String statement; + + /** + * 奖扣总分值 + */ + private Integer pointValue; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRewardRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRewardRuleEntity.java new file mode 100644 index 0000000000..d32582f876 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRewardRuleEntity.java @@ -0,0 +1,39 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_reward_rule") +public class PointRewardRuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 奖扣ID + */ + private String rewardId; + + /** + * 规则ID + */ + private String ruleId; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointAdditiveRuleExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointAdditiveRuleExcel.java new file mode 100644 index 0000000000..b87cae4a7e --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointAdditiveRuleExcel.java @@ -0,0 +1,66 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +public class PointAdditiveRuleExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "记录类型;分类:category;规则:rule") + private String type; + + @Excel(name = "允许申请标记;允许0(type = category时,强制赋值为0),禁止1。") + private String applyFlag; + + @Excel(name = "积分类别编码;德育积分moral_education;党建积分party_building") + private String categoryCode; + + @Excel(name = "积分类别名称;type=category时必填") + private String categoryName; + + @Excel(name = "积分规则名称;type=rule时必填") + private String ruleName; + + @Excel(name = "上级节点ID;上级分类ID,顶级分类的PID为0") + private String pid; + + @Excel(name = "上级节点ID路径;所有上级节点以英文冒号(:)拼接;不必拼接0") + private String pids; + + @Excel(name = "分值;正数加分,负数减分;type=rule时必填") + private Integer pointValue; + + @Excel(name = "删除标识;0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRewardExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRewardExcel.java new file mode 100644 index 0000000000..e4b3857ddc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRewardExcel.java @@ -0,0 +1,69 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +public class PointRewardExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "组织ID") + private String agencyId; + + @Excel(name = "组织ID路径") + private String agencyPids; + + @Excel(name = "房屋ID") + private String houseId; + + @Excel(name = "房屋名称;完整拼接的名称") + private String houseAllName; + + @Excel(name = "工作人员ID") + private String staffId; + + @Excel(name = "工作人员姓名") + private String staffName; + + @Excel(name = "操作类型;积分奖励point_reward;积分扣罚point_fine") + private String businessCode; + + @Excel(name = "备注说明;200字内") + private String statement; + + @Excel(name = "奖扣总分值") + private Integer pointValue; + + @Excel(name = "删除标识;0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRewardRuleExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRewardRuleExcel.java new file mode 100644 index 0000000000..cf300c2f43 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRewardRuleExcel.java @@ -0,0 +1,48 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Data +public class PointRewardRuleExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "奖扣ID") + private String rewardId; + + @Excel(name = "规则ID") + private String ruleId; + + @Excel(name = "删除标识;0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointAdditiveRuleRedis.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointAdditiveRuleRedis.java new file mode 100644 index 0000000000..b8345af3c2 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointAdditiveRuleRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Component +public class PointAdditiveRuleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRewardRedis.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRewardRedis.java new file mode 100644 index 0000000000..dbf8ec87da --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRewardRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Component +public class PointRewardRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRewardRuleRedis.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRewardRuleRedis.java new file mode 100644 index 0000000000..1742b32ad0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRewardRuleRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Component +public class PointRewardRuleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveCalcService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveCalcService.java new file mode 100644 index 0000000000..50d477b844 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveCalcService.java @@ -0,0 +1,89 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.PointAdditiveCalcDTO; +import com.epmet.entity.PointAdditiveCalcEntity; +import com.epmet.entity.PointRewardEntity; + +import java.util.List; +import java.util.Map; + +/** + * 附加积分计算 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +public interface PointAdditiveCalcService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointAdditiveCalcDTO + * @author generator + * @date 2022-06-14 + */ + PointAdditiveCalcDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void save(PointAdditiveCalcDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void update(PointAdditiveCalcDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-14 + */ + void delete(String[] ids); + + /** + * @describe: 根据房屋ID和积分类别 插入/修改德育积分 + * @author wangtong + * @date 2022/6/21 14:51 + * @params [insertEntity] + * @return com.epmet.commons.tools.utils.Result + */ + Result insertMoralEducation(PointRewardEntity insertEntity); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRecordService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRecordService.java new file mode 100644 index 0000000000..c4536982dd --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRecordService.java @@ -0,0 +1,101 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.PointAdditiveRecordDTO; +import com.epmet.dto.form.CommonPageUserFormDTO; +import com.epmet.dto.result.PointAdditiveRecordResultDTO; +import com.epmet.entity.PointAdditiveRecordEntity; +import com.epmet.entity.PointRewardEntity; + +import java.util.List; +import java.util.Map; + +/** + * 附加积分记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +public interface PointAdditiveRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointAdditiveRecordDTO + * @author generator + * @date 2022-06-14 + */ + PointAdditiveRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void save(PointAdditiveRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void update(PointAdditiveRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-14 + */ + void delete(String[] ids); + + /** + * 获取积分记录 + * + * @Param formDTO + * @Return {@link List< PointAdditiveRecordResultDTO >} + * @Author zhaoqifeng + * @Date 2022/6/15 9:55 + */ + List getRecords(CommonPageUserFormDTO formDTO); + + /** + * @describe: 插入德育积分记录 + * @author wangtong + * @date 2022/6/21 14:29 + * @params [insertEntity] + * @return com.epmet.commons.tools.utils.Result + */ + Result insertMoralEducation(PointRewardEntity insertEntity); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRuleService.java new file mode 100644 index 0000000000..4f9995158e --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveRuleService.java @@ -0,0 +1,154 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CategorydetailResultDTO; +import com.epmet.dto.PointAdditiveRuleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.List4ApplyResultDTO; +import com.epmet.entity.PointAdditiveRuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +public interface PointAdditiveRuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointAdditiveRuleDTO + * @author generator + * @date 2022-06-15 + */ + PointAdditiveRuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-15 + */ + void save(PointAdditiveRuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-15 + */ + void update(PointAdditiveRuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-15 + */ + void delete(String[] ids); + + /** + * @describe: 查询下级类别简要信息 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + Result> listbrief(String categoryId); + + /** + * @describe: 查询积分类别详情 + * @author wangtong + * @date 2022/6/15 10:49 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result + */ + Result categorydetail(String categoryId); + + /** + * @describe: 添加积分类别 + * @author wangtong + * @date 2022/6/15 11:14 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result addcategory(AddcategoryFormDTO dto); + + /** + * @describe: 添加积分规则 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + Result addrule(AddruleFormDTO dto); + + /** + * @describe: [附加积分]获取允许申请的积分类别 + * @author wangtong + * @date 2022/6/15 10:23 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result> + */ + Result> list4apply(List4applyFormDTO dto); + + /** + * @describe: 查询积分类别规则列表 + * @author wangtong + * @date 2022/6/15 10:11 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result> list4tree(List4treeFormDTO dto); + + /** + * @describe: 查询积分规则详情 + * @author wangtong + * @date 2022/6/17 17:36 + * @params [categoryId] + * @return com.epmet.commons.tools.utils.Result + */ + Result ruledetail(String ruleId); + + /** + * @describe: 修改积分分类/规则 + * @author wangtong + * @date 2022/6/17 17:51 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result modify(PointModifyFormDTO dto); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAnnexService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAnnexService.java new file mode 100644 index 0000000000..c9aea552f1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAnnexService.java @@ -0,0 +1,88 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointAnnexDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.entity.PointAnnexEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分相关附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +public interface PointAnnexService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointAnnexDTO + * @author generator + * @date 2022-06-14 + */ + PointAnnexDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void save(PointAnnexDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void update(PointAnnexDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-14 + */ + void delete(String[] ids); + + /** + * @describe: 提交积分奖扣 + * @author wangtong + * @date 2022/6/16 9:27 + * @params [id, dto] + * @return void + */ + void insertBatchPoint(String rewardId, SubmitRewardFormDTO dto); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointApplyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointApplyService.java new file mode 100644 index 0000000000..74160b5099 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointApplyService.java @@ -0,0 +1,102 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.PointApplyDTO; +import com.epmet.dto.form.PointApplyFormDTO; +import com.epmet.dto.form.PointApplyPageFormDTO; +import com.epmet.dto.form.PointAuditFormDTO; +import com.epmet.entity.PointApplyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分申请 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +public interface PointApplyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-14 + */ + PageData page(PointApplyPageFormDTO formDTO); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointApplyDTO + * @author generator + * @date 2022-06-14 + */ + PointApplyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void save(PointApplyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-14 + */ + void update(PointApplyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-14 + */ + void delete(String[] ids); + + /** + * 申请德育积分/党建积分 + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/14 14:14 + */ + void submit(PointApplyFormDTO formDTO); + + /** + * 审核 + * + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/15 15:20 + */ + void audit(TokenDto tokenDto, PointAuditFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRewardRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRewardRuleService.java new file mode 100644 index 0000000000..4dac4bfd97 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRewardRuleService.java @@ -0,0 +1,88 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointRewardRuleDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.entity.PointRewardRuleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +public interface PointRewardRuleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointRewardRuleDTO + * @author generator + * @date 2022-06-15 + */ + PointRewardRuleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-15 + */ + void save(PointRewardRuleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-15 + */ + void update(PointRewardRuleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-15 + */ + void delete(String[] ids); + + /** + * @describe: 插入积分奖扣明细 + * @author wangtong + * @date 2022/6/16 9:37 + * @params [id, dto] + * @return void + */ + void insertBatchPointRule(String rewardId, SubmitRewardFormDTO dto); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRewardService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRewardService.java new file mode 100644 index 0000000000..c83226937f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRewardService.java @@ -0,0 +1,99 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.PointRewardDTO; +import com.epmet.dto.form.RecordRewardFormDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.entity.PointRewardEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +public interface PointRewardService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointRewardDTO + * @author generator + * @date 2022-06-15 + */ + PointRewardDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-15 + */ + void save(PointRewardDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-15 + */ + void update(PointRewardDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-15 + */ + void delete(String[] ids); + + /** + * @describe: 提交积分奖扣 + * @author wangtong + * @date 2022/6/15 17:30 + * @params [tokenDto, dto] + * @return com.epmet.commons.tools.utils.Result + */ + Result submit(SubmitRewardFormDTO dto); + + /** + * @describe: 查询积分奖扣记录 + * @author wangtong + * @date 2022/6/16 14:21 + * @params [tokenDto, dto] + * @return com.epmet.commons.tools.utils.Result>> + */ + PageData record(RecordRewardFormDTO dto); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java index 8c9977dce8..43302c3948 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java @@ -18,8 +18,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.MyTotalPointResultDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointTotalEntity; @@ -69,4 +71,14 @@ public interface UserPointTotalService extends BaseService * @date 2020.07.22 15:58 **/ ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam); + + /** + * 积分总分 + * + * @Param formDTO + * @Return {@link MyTotalPointResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/14 15:46 + */ + MyTotalPointResultDTO totalPoint(CommonPageUserFormDTO formDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveCalcServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveCalcServiceImpl.java new file mode 100644 index 0000000000..368c1b5ad7 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveCalcServiceImpl.java @@ -0,0 +1,112 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.common.enu.PointAddRuleEnum; +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.commons.tools.utils.Result; +import com.epmet.dao.PointAdditiveCalcDao; +import com.epmet.dto.PointAdditiveCalcDTO; +import com.epmet.entity.PointAdditiveCalcEntity; +import com.epmet.entity.PointRewardEntity; +import com.epmet.service.PointAdditiveCalcService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 附加积分计算 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Service +public class PointAdditiveCalcServiceImpl extends BaseServiceImpl implements PointAdditiveCalcService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointAdditiveCalcDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointAdditiveCalcDTO.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 PointAdditiveCalcDTO get(String id) { + PointAdditiveCalcEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointAdditiveCalcDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointAdditiveCalcDTO dto) { + PointAdditiveCalcEntity entity = ConvertUtils.sourceToTarget(dto, PointAdditiveCalcEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointAdditiveCalcDTO dto) { + PointAdditiveCalcEntity entity = ConvertUtils.sourceToTarget(dto, PointAdditiveCalcEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result insertMoralEducation(PointRewardEntity rewardEntity) { + PointAdditiveCalcEntity queryData = new PointAdditiveCalcEntity(); + queryData.setSubjectId(rewardEntity.getHouseId()); + queryData.setCategoryCode(PointAddRuleEnum.MORAL_EDUCATION.getCode()); + QueryWrapper wrapper = new QueryWrapper<>(queryData); + PointAdditiveCalcEntity isExist = baseDao.selectOne(wrapper); + //有则更新,无则插入 + if(null == isExist){ + PointAdditiveCalcEntity entity = new PointAdditiveCalcEntity(); + entity.setCustomerId(rewardEntity.getCustomerId()); + entity.setSubjectId(rewardEntity.getHouseId()); + entity.setCategoryCode(PointAddRuleEnum.MORAL_EDUCATION.getCode()); + entity.setSpend(0); + entity.setTotal(rewardEntity.getPointValue()); + insert(entity); + }else{ + if(null == isExist.getTotal()){ + isExist.setTotal(rewardEntity.getPointValue()); + }else{ + isExist.setTotal(isExist.getTotal()+rewardEntity.getPointValue()); + } + updateById(isExist); + } + return new Result(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRecordServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRecordServiceImpl.java new file mode 100644 index 0000000000..1b0bec197c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRecordServiceImpl.java @@ -0,0 +1,169 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.common.CommonConstant; +import com.epmet.common.enu.PointAddRuleEnum; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.PointAdditiveRecordDao; +import com.epmet.dto.PointAdditiveRecordDTO; +import com.epmet.dto.form.CommonPageUserFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.PointAdditiveRecordDailyDTO; +import com.epmet.dto.result.PointAdditiveRecordResultDTO; +import com.epmet.entity.PointAdditiveRecordEntity; +import com.epmet.entity.PointRewardEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.PointAdditiveRecordService; +import com.github.pagehelper.PageHelper; +import com.google.common.collect.Maps; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 附加积分记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Service +public class PointAdditiveRecordServiceImpl extends BaseServiceImpl implements PointAdditiveRecordService { + + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointAdditiveRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointAdditiveRecordDTO.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 PointAdditiveRecordDTO get(String id) { + PointAdditiveRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointAdditiveRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointAdditiveRecordDTO dto) { + PointAdditiveRecordEntity entity = ConvertUtils.sourceToTarget(dto, PointAdditiveRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointAdditiveRecordDTO dto) { + PointAdditiveRecordEntity entity = ConvertUtils.sourceToTarget(dto, PointAdditiveRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取积分记录 + * + * @param formDTO 入参 + * @Return {@link List< PointAdditiveRecordResultDTO >} + * @Author zhaoqifeng + * @Date 2022/6/15 9:55 + */ + @Override + public List getRecords(CommonPageUserFormDTO formDTO) { + List list = new ArrayList<>(); + String subjectId; + //如果申请类型为德育积分,需要获取用户所在房屋 + if (CommonConstant.MORAL_EDUCATION.equals(formDTO.getCategoryCode())) { + Result result = epmetUserOpenFeignClient.getHomeInfo(); + if (!result.success() || null == result.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民所在家庭信息失败", "获取居民所在家庭信息失败"); + } + if (StringUtils.isBlank(result.getData().getHouseId())) { + return list; + } + subjectId = result.getData().getHouseId(); + } else { + subjectId = formDTO.getUserId(); + } + + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List recordList = baseDao.selectRecordList(formDTO.getCustomerId(), formDTO.getCategoryCode(), subjectId); + + if(CollectionUtils.isNotEmpty(recordList)){ + Map> map = + recordList.stream().collect(Collectors.groupingBy(PointAdditiveRecordDailyDTO::getDate)); + + Map> sortedMap = Maps.newLinkedHashMap(); + map.entrySet().stream().sorted(Map.Entry.>comparingByKey().reversed()) + .forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue())); + sortedMap.forEach((key, value) -> { + PointAdditiveRecordResultDTO o = new PointAdditiveRecordResultDTO(); + o.setDate(key); + o.setDailyList(value); + list.add(o); + }); + + } + return list; + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Result insertMoralEducation(PointRewardEntity rewardEntity) { + PointAdditiveRecordEntity entity = new PointAdditiveRecordEntity(); + entity.setCustomerId(rewardEntity.getCustomerId()); + if(PointAddRuleEnum.POINT_REWARD.getCode().equals(rewardEntity.getBusinessCode())){ + entity.setTitle("德育积分奖励"); + }else if(PointAddRuleEnum.POINT_FINE.getCode().equals(rewardEntity.getBusinessCode())){ + entity.setTitle("德育积分扣罚"); + } + entity.setStatement(rewardEntity.getStatement()); + entity.setPointValue(rewardEntity.getPointValue()); + entity.setCategoryCode(PointAddRuleEnum.MORAL_EDUCATION.getCode()); + entity.setSubjectId(rewardEntity.getHouseId()); + entity.setBusinessId(rewardEntity.getId()); + entity.setBusinessCode(rewardEntity.getBusinessCode()); + insert(entity); + return new Result(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java new file mode 100644 index 0000000000..7146f105f1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java @@ -0,0 +1,270 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.common.enu.PointAddRuleEnum; +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.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.PointAdditiveRuleDao; +import com.epmet.dao.PointApplyDao; +import com.epmet.dto.CategorydetailResultDTO; +import com.epmet.dto.PointAdditiveRuleDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.List4ApplyResultDTO; +import com.epmet.entity.PointAdditiveRuleEntity; +import com.epmet.entity.PointApplyEntity; +import com.epmet.redis.PointAdditiveRuleRedis; +import com.epmet.service.PointAdditiveRuleService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 附加积分规则 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Service +public class PointAdditiveRuleServiceImpl extends BaseServiceImpl implements PointAdditiveRuleService { + + @Autowired + private PointAdditiveRuleRedis pointAdditiveRuleRedis; + + @Autowired + private PointApplyDao pointApplyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointAdditiveRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointAdditiveRuleDTO.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 PointAdditiveRuleDTO get(String id) { + PointAdditiveRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointAdditiveRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointAdditiveRuleDTO dto) { + PointAdditiveRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointAdditiveRuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointAdditiveRuleDTO dto) { + PointAdditiveRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointAdditiveRuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + for(String id : ids){ + PointAdditiveRuleEntity entity = baseDao.selectById(id); + if(null == entity){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息。","未查到相关信息。"); + } + if(PointAddRuleEnum.CATEGORY_TYPE.getCode().equals(entity.getType())){ + //分类判断是否有下级 + PointAdditiveRuleEntity queryData = new PointAdditiveRuleEntity(); + queryData.setPid(entity.getId()); + QueryWrapper wrapper = new QueryWrapper<>(queryData); + List applyList = baseDao.selectList(wrapper); + if(CollectionUtils.isNotEmpty(applyList)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请先删除下级的积分规则。","请先删除下级的积分规则。"); + } + }else{ + //判断其规则下面是否有待审核的积分申请,如果有则不允许修改/删除 + PointApplyEntity queryData = new PointApplyEntity(); + queryData.setRuleId(entity.getId()); + queryData.setStatus("0"); + QueryWrapper wrapper = new QueryWrapper<>(queryData); + List applyList = pointApplyDao.selectList(wrapper); + if(CollectionUtils.isNotEmpty(applyList)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该规则下有积分申请尚未完成,请处理完成后再执行该操作。","该规则下有积分申请尚未完成,请处理完成后再执行该操作。"); + } + } + } + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> listbrief(String categoryId) { + List result = baseDao.selectListbrief(categoryId); + return new Result>().ok(result); + } + + @Override + public Result categorydetail(String categoryId) { + CategorydetailResultDTO result = baseDao.selectCategorydetail(categoryId); + return new Result().ok(result); + } + + @Override + public Result addcategory(AddcategoryFormDTO dto) { + PointAdditiveRuleEntity isExist = baseDao.selectEntityByName(null,dto.getCustomerId(),dto.getCategoryName(),null); + if(isExist != null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该名称已存在","该名称已存在"); + } + PointAdditiveRuleEntity entity = new PointAdditiveRuleEntity(); + entity.setCustomerId(dto.getCustomerId()); + entity.setType(PointAddRuleEnum.CATEGORY_TYPE.getCode()); + entity.setApplyFlag(PointAddRuleEnum.APPLY_ALLOW.getCode()); + entity.setCategoryName(dto.getCategoryName()); + entity.setPid(dto.getPid()); + if(!NumConstant.ZERO_STR.equals(dto.getPid())){ + PointAdditiveRuleEntity parentEntity = baseDao.selectById(dto.getPid()); + if(null == parentEntity){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到父节点信息","未查到父节点信息"); + } + if(StringUtils.isBlank(parentEntity.getPids())){ + entity.setPids(parentEntity.getId()); + }else{ + entity.setPids(parentEntity.getPids()+":"+parentEntity.getId()); + } + entity.setCategoryCode(parentEntity.getCategoryCode()); + } + insert(entity); + return new Result().ok("新增成功!"); + } + + @Override + public Result addrule(AddruleFormDTO dto) { + PointAdditiveRuleEntity isExist = baseDao.selectEntityByName(null,dto.getCustomerId(),null,dto.getRuleName()); + if(isExist != null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该名称已存在","该名称已存在"); + } + PointAdditiveRuleEntity entity = new PointAdditiveRuleEntity(); + entity.setCustomerId(dto.getCustomerId()); + entity.setType(PointAddRuleEnum.RULE_TYPE.getCode()); + entity.setRuleName(dto.getRuleName()); + entity.setApplyFlag(dto.getApplyFlag()); + entity.setPointValue(dto.getPointValue()); + entity.setPid(dto.getPid()); + if(!NumConstant.ZERO_STR.equals(dto.getPid())){ + PointAdditiveRuleEntity parentEntity = baseDao.selectById(dto.getPid()); + if(null == parentEntity){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到父节点信息","未查到父节点信息"); + } + if(StringUtils.isBlank(parentEntity.getPids())){ + entity.setPids(parentEntity.getId()); + }else{ + entity.setPids(parentEntity.getPids()+":"+parentEntity.getId()); + } + entity.setCategoryCode(parentEntity.getCategoryCode()); + } + insert(entity); + return new Result().ok("新增成功!"); + } + + @Override + public Result> list4apply(List4applyFormDTO dto) { + List list = baseDao.selectList4apply(dto); + return new Result>().ok(list); + } + + + @Override + public Result> list4tree(List4treeFormDTO dto) { + List result = baseDao.selectList4tree(dto); + return new Result>().ok(result); + } + + @Override + public Result ruledetail(String ruleId) { + PointAdditiveRuleDTO result = baseDao.selectRuledetail(ruleId); + return new Result().ok(result); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Result modify(PointModifyFormDTO dto) { + PointAdditiveRuleEntity entity = baseDao.selectById(dto.getId()); + if(entity == null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息","未查到相关信息"); + } + if(PointAddRuleEnum.CATEGORY_TYPE.getCode().equals(dto.getType())){ + //类别 + PointAdditiveRuleEntity isExist = baseDao.selectEntityByName(dto.getId(),dto.getCustomerId(),dto.getCategoryName(),null); + if(isExist != null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该名称已存在","该名称已存在"); + } + entity.setCategoryName(dto.getCategoryName()); + if(StringUtils.isNotBlank(dto.getApplyFlag())){ + entity.setApplyFlag(dto.getApplyFlag()); + } + }else if(PointAddRuleEnum.RULE_TYPE.getCode().equals(dto.getType())){ + //规则 + //判断名称重复 + PointAdditiveRuleEntity isExist = baseDao.selectEntityByName(dto.getId(),dto.getCustomerId(),null,dto.getRuleName()); + if(isExist != null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该名称已存在","该名称已存在"); + } + //判断其规则下面是否有待审核的积分申请,如果有则不允许修改/删除 + PointApplyEntity queryData = new PointApplyEntity(); + queryData.setRuleId(entity.getId()); + queryData.setStatus("0"); + QueryWrapper wrapper = new QueryWrapper<>(queryData); + List applyList = pointApplyDao.selectList(wrapper); + if(CollectionUtils.isNotEmpty(applyList)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "该规则下有积分申请尚未完成,请处理完成后再执行该操作。","该规则下有积分申请尚未完成,请处理完成后再执行该操作。"); + } + + entity.setRuleName(dto.getRuleName()); + entity.setPointValue(dto.getPointValue()); + entity.setApplyFlag(dto.getApplyFlag()); + }else{ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "type类型有误","type类型有误"); + } + + if(!NumConstant.ZERO_STR.equals(dto.getPid())){ + PointAdditiveRuleEntity parentEntity = baseDao.selectById(dto.getPid()); + if(null == parentEntity){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到父节点信息","未查到父节点信息"); + } + entity.setPid(dto.getPid()); + if(StringUtils.isBlank(parentEntity.getPids())){ + entity.setPids(parentEntity.getId()); + }else{ + entity.setPids(parentEntity.getPids()+":"+parentEntity.getId()); + } + } + updateById(entity); + return new Result().ok("修改成功!"); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAnnexServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAnnexServiceImpl.java new file mode 100644 index 0000000000..d7f0ff9ea7 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAnnexServiceImpl.java @@ -0,0 +1,100 @@ +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.PointAnnexDao; +import com.epmet.dto.PointAnnexDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.entity.PointAnnexEntity; +import com.epmet.service.PointAnnexService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 积分相关附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Service +public class PointAnnexServiceImpl extends BaseServiceImpl implements PointAnnexService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointAnnexDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointAnnexDTO.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 PointAnnexDTO get(String id) { + PointAnnexEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointAnnexDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointAnnexDTO dto) { + PointAnnexEntity entity = ConvertUtils.sourceToTarget(dto, PointAnnexEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointAnnexDTO dto) { + PointAnnexEntity entity = ConvertUtils.sourceToTarget(dto, PointAnnexEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void insertBatchPoint(String rewardId, SubmitRewardFormDTO dto) { + Integer sort = 1; + for(String pointUrl : dto.getAnnexList()){ + PointAnnexEntity entity = new PointAnnexEntity(); + entity.setCustomerId(dto.getCustomerId()); + entity.setBusinessId(rewardId); + entity.setBusinessCode(dto.getBusinessCode()); + entity.setUrl(pointUrl); + entity.setSort(sort); + sort++; + insert(entity); + } + + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java new file mode 100644 index 0000000000..a3576edb27 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java @@ -0,0 +1,304 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.common.CommonConstant; +import com.epmet.common.enu.ApplyStatusEnum; +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.GenderEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.PointAdditiveCalcDao; +import com.epmet.dao.PointAdditiveRecordDao; +import com.epmet.dao.PointAnnexDao; +import com.epmet.dao.PointApplyDao; +import com.epmet.dto.PointApplyDTO; +import com.epmet.dto.form.PointApplyFormDTO; +import com.epmet.dto.form.PointApplyPageFormDTO; +import com.epmet.dto.form.PointAuditFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.entity.PointAdditiveCalcEntity; +import com.epmet.entity.PointAdditiveRecordEntity; +import com.epmet.entity.PointAnnexEntity; +import com.epmet.entity.PointApplyEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.PointApplyService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 积分申请 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-14 + */ +@Service +public class PointApplyServiceImpl extends BaseServiceImpl implements PointApplyService { + + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Resource + private PointAnnexDao pointAnnexDao; + @Resource + private PointAdditiveRecordDao pointAdditiveRecordDao; + @Resource + private PointAdditiveCalcDao pointAdditiveCalcDao; + + @Override + public PageData page(PointApplyPageFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取工作人员信息失败", "获取工作人员信息失败"); + } + if (StringUtils.isBlank(formDTO.getAgencyId())) { + formDTO.setAgencyId(staffInfo.getAgencyId()); + } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + //获取居民信息 + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(item.getUserId()); + if (null != userInfo) { + item.setHeadImgUrl(userInfo.getHeadImgUrl()); + item.setGender(GenderEnum.getName(userInfo.getGender())); + item.setShowName(userInfo.getShowName()); + } + //获取网格信息 + //从缓存获取网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); + if (null != gridInfo) { + item.setGridName(gridInfo.getGridName()); + } + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointApplyDTO.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 PointApplyDTO get(String id) { + PointApplyDTO dto = baseDao.getDetail(id); + if (null == dto) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "内容不存在", "内容不存在"); + } + //获取居民信息 + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(dto.getUserId()); + if (null == userInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息失败", "获取居民信息失败"); + } + dto.setHeadImgUrl(userInfo.getHeadImgUrl()); + dto.setShowName(userInfo.getShowName()); + //从缓存获取网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId()); + if (null == gridInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取网格缓存失败", "获取网格缓存失败"); + } + dto.setGridName(gridInfo.getGridName()); + return dto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointApplyDTO dto) { + PointApplyEntity entity = ConvertUtils.sourceToTarget(dto, PointApplyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointApplyDTO dto) { + PointApplyEntity entity = ConvertUtils.sourceToTarget(dto, PointApplyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 申请德育积分/党建积分 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/14 14:14 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void submit(PointApplyFormDTO formDTO) { + PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class); + //从缓存获取网格信息 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == gridInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取网格缓存失败", "获取网格缓存失败"); + } + //如果申请类型为德育积分,需要获取用户所在房屋 + if (CommonConstant.MORAL_EDUCATION.equals(formDTO.getCategoryCode())) { + Result result = epmetUserOpenFeignClient.getHomeInfo(); + if (!result.success() || null == result.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民所在家庭信息失败", "获取居民所在家庭信息失败"); + } + if (StringUtils.isBlank(result.getData().getHouseId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法申请", "没有绑定家庭,无法申请德育积分"); + } + entity.setHouseId(result.getData().getHouseId()); + } + //获取居民信息 + ResiUserInfoCache userInfo = CustomerResiUserRedis.getUserBaseInfo(formDTO.getUserId()); + if (null == userInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息失败", "获取居民信息失败"); + } + + entity.setAgencyId(gridInfo.getPid()); + entity.setAgencyPids(gridInfo.getPids()); + entity.setStatus(ApplyStatusEnum.AUDITING.getCode()); + entity.setName(userInfo.getRealName()); + entity.setMobile(userInfo.getMobile()); + entity.setIdCard(userInfo.getIdNum()); + baseDao.insert(entity); + + //保存附件 + if (CollectionUtils.isNotEmpty(formDTO.getAnnexList())) { + AtomicInteger i = new AtomicInteger(NumConstant.ONE); + formDTO.getAnnexList().forEach(url -> { + PointAnnexEntity annex = new PointAnnexEntity(); + annex.setCustomerId(formDTO.getCustomerId()); + annex.setBusinessId(entity.getId()); + annex.setBusinessCode(CommonConstant.POINT_APPLY); + annex.setUrl(url); + annex.setSort(i.getAndIncrement()); + pointAnnexDao.insert(annex); + }); + } + + } + + /** + * 审核 + * + * @param tokenDto + * @param formDTO + * @Param tokenDto + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/15 15:20 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void audit(TokenDto tokenDto, PointAuditFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getId()) && CollectionUtils.isEmpty(formDTO.getIds())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "请选择待审核的申请", "请选择待审核的申请"); + } + List ids = new ArrayList<>(); + if (CollectionUtils.isEmpty(formDTO.getIds())) { + ids.add(formDTO.getId()); + } else { + ids = formDTO.getIds(); + } + ids.forEach(id -> { + //获取积分申请信息 + PointApplyDTO dto = get(id); + if (NumConstant.ZERO_STR.equals(dto.getStatus())) { + //更新审核状态 + PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class); + entity.setId(id); + baseDao.updateById(entity); + + String subjectId; + + if (CommonConstant.MORAL_EDUCATION.equals(dto.getCategoryCode())) { + subjectId = dto.getHouseId(); + } else { + subjectId = dto.getUserId(); + } + //生成积分记录 + PointAdditiveRecordEntity record = new PointAdditiveRecordEntity(); + record.setCustomerId(tokenDto.getCustomerId()); + record.setTitle(dto.getTitle()); + record.setStatement(dto.getStatement()); + if (NumConstant.TWO_STR.equals(formDTO.getStatus())) { + record.setPointValue(dto.getPointValue()); + record.setBusinessCode(CommonConstant.POINT_APPLY); + } else { + record.setPointValue(NumConstant.ZERO); + record.setBusinessCode(CommonConstant.POINT_REJECT); + } + record.setCategoryCode(dto.getCategoryCode()); + record.setSubjectId(subjectId); + record.setBusinessId(dto.getId()); + + pointAdditiveRecordDao.insert(record); + if (NumConstant.TWO_STR.equals(formDTO.getStatus())) { + //重新计算总分 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PointAdditiveCalcEntity::getCustomerId, tokenDto.getCustomerId()); + wrapper.eq(PointAdditiveCalcEntity::getSubjectId, subjectId); + wrapper.eq(PointAdditiveCalcEntity::getCategoryCode, dto.getCategoryCode()); + PointAdditiveCalcEntity calc = pointAdditiveCalcDao.selectOne(wrapper); + if (null != calc) { + calc.setUpdatedBy(null); + calc.setUpdatedTime(null); + calc.setTotal(calc.getTotal() + dto.getPointValue()); + pointAdditiveCalcDao.updateById(calc); + } else { + calc = new PointAdditiveCalcEntity(); + calc.setCustomerId(tokenDto.getCustomerId()); + calc.setCategoryCode(dto.getCategoryCode()); + calc.setSubjectId(subjectId); + calc.setSpend(NumConstant.ZERO); + calc.setTotal(dto.getPointValue()); + pointAdditiveCalcDao.insert(calc); + } + } + } + }); + + + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRewardRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRewardRuleServiceImpl.java new file mode 100644 index 0000000000..10d54b582c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRewardRuleServiceImpl.java @@ -0,0 +1,100 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PointRewardRuleDao; +import com.epmet.dto.PointRewardRuleDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.entity.PointRewardRuleEntity; +import com.epmet.redis.PointRewardRuleRedis; +import com.epmet.service.PointRewardRuleService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 积分奖扣明细 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Service +public class PointRewardRuleServiceImpl extends BaseServiceImpl implements PointRewardRuleService { + + @Autowired + private PointRewardRuleRedis pointRewardRuleRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointRewardRuleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointRewardRuleDTO.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 PointRewardRuleDTO get(String id) { + PointRewardRuleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointRewardRuleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointRewardRuleDTO dto) { + PointRewardRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointRewardRuleEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointRewardRuleDTO dto) { + PointRewardRuleEntity entity = ConvertUtils.sourceToTarget(dto, PointRewardRuleEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public void insertBatchPointRule(String rewardId, SubmitRewardFormDTO dto) { + dto.getRuleIdList().forEach(ruleId->{ + PointRewardRuleEntity entity = new PointRewardRuleEntity(); + entity.setCustomerId(dto.getCustomerId()); + entity.setRewardId(rewardId); + entity.setRuleId(ruleId); + insert(entity); + }); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRewardServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRewardServiceImpl.java new file mode 100644 index 0000000000..bd8c2b9307 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRewardServiceImpl.java @@ -0,0 +1,155 @@ +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.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.PointAdditiveRuleDao; +import com.epmet.dao.PointRewardDao; +import com.epmet.dto.PointRewardDTO; +import com.epmet.dto.form.RecordRewardFormDTO; +import com.epmet.dto.form.SubmitRewardFormDTO; +import com.epmet.entity.PointRewardEntity; +import com.epmet.redis.PointRewardRedis; +import com.epmet.service.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 积分奖扣 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-15 + */ +@Service +public class PointRewardServiceImpl extends BaseServiceImpl implements PointRewardService { + + @Autowired + private PointRewardRedis pointRewardRedis; + + @Autowired + private PointAnnexService pointAnnexService; + + @Autowired + private PointRewardRuleService pointRewardRuleService; + + @Autowired + private PointAdditiveRuleDao pointAdditiveRuleDao; + + @Autowired + private PointAdditiveRecordService pointAdditiveRecordService; + + @Autowired + private PointAdditiveCalcService pointAdditiveCalcService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointRewardDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointRewardDTO.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 PointRewardDTO get(String id) { + PointRewardEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointRewardDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointRewardDTO dto) { + PointRewardEntity entity = ConvertUtils.sourceToTarget(dto, PointRewardEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointRewardDTO dto) { + PointRewardEntity entity = ConvertUtils.sourceToTarget(dto, PointRewardEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public Result submit(SubmitRewardFormDTO dto) { + HouseInfoCache houseCache = CustomerIcHouseRedis.getHouseInfo(dto.getCustomerId(),dto.getHouseId()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(),dto.getStaffId()); + PointRewardEntity insertEntity = new PointRewardEntity(); + insertEntity.setCustomerId(dto.getCustomerId()); + insertEntity.setAgencyId(staffInfo.getAgencyId()); + insertEntity.setAgencyPids(staffInfo.getAgencyPIds()); + insertEntity.setHouseId(dto.getHouseId()); + insertEntity.setHouseAllName(houseCache.getAllName()); + insertEntity.setStaffId(staffInfo.getStaffId()); + insertEntity.setStaffName(staffInfo.getRealName()); + insertEntity.setBusinessCode(dto.getBusinessCode()); + insertEntity.setStatement(dto.getStatement()); + //根据积分规则去获取分值 + Integer pointSum = pointAdditiveRuleDao.selectPointTotalByIds(dto); + if(null == pointSum){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "积分不可为空","积分不可为空"); + } + insertEntity.setPointValue(pointSum); + insert(insertEntity); + //插入积分奖扣明细 + pointRewardRuleService.insertBatchPointRule(insertEntity.getId(),dto); + //插入积分附件 + pointAnnexService.insertBatchPoint(insertEntity.getId(),dto); + //插入附加积分记录 + pointAdditiveRecordService.insertMoralEducation(insertEntity); + //插入附加积分计算 + pointAdditiveCalcService.insertMoralEducation(insertEntity); + return new Result().ok("提交成功!"); + } + + @Override + public PageData record(RecordRewardFormDTO dto) { + PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); + List list = baseDao.selectRewardRecord(dto); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java index 66f83715c8..e9ff35e4bc 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java @@ -17,15 +17,22 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.common.CommonConstant; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.PointAdditiveCalcDao; import com.epmet.dao.UserPointTotalDao; +import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.*; +import com.epmet.entity.PointAdditiveCalcEntity; import com.epmet.entity.UserPointTotalEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.UserPointTotalService; @@ -33,9 +40,9 @@ import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -50,8 +57,10 @@ import java.util.stream.Collectors; @Slf4j public class UserPointTotalServiceImpl extends BaseServiceImpl implements UserPointTotalService { - @Autowired - EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Resource + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Resource + private PointAdditiveCalcDao pointAdditiveCalcDao; /** * @Description 获取指定居民的积分信息 @@ -62,12 +71,18 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl result = epmetUserOpenFeignClient.getHomeInfo(); + if (!result.success() || null == result.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民绑定家庭信息失败", "获取居民绑定家庭信息失败"); + } + if (StringUtils.isNotBlank(result.getData().getHouseId())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PointAdditiveCalcEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(PointAdditiveCalcEntity::getSubjectId, result.getData().getHouseId()); + wrapper.eq(PointAdditiveCalcEntity::getCategoryCode, CommonConstant.MORAL_EDUCATION); + PointAdditiveCalcEntity entity = pointAdditiveCalcDao.selectOne(wrapper); + if (null != entity) { + resultDTO.setTotal(entity.getTotal()); + resultDTO.setSpend(entity.getSpend()); + resultDTO.setUsable(entity.getTotal() - entity.getSpend()); + } + } + return resultDTO; + } + + /** + * 党建积分 + * @Param formDTO + * @Return {@link MyTotalPointResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/17 9:58 + */ + private MyTotalPointResultDTO getPartyTotal(CommonPageUserFormDTO formDTO) { + MyTotalPointResultDTO resultDTO = new MyTotalPointResultDTO(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PointAdditiveCalcEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(PointAdditiveCalcEntity::getSubjectId, formDTO.getUserId()); + wrapper.eq(PointAdditiveCalcEntity::getCategoryCode, CommonConstant.PARTY_BUILDING); + PointAdditiveCalcEntity entity = pointAdditiveCalcDao.selectOne(wrapper); + if (null != entity) { + resultDTO.setTotal(entity.getTotal()); + resultDTO.setSpend(entity.getSpend()); + resultDTO.setUsable(entity.getTotal() - entity.getSpend()); + } + return resultDTO; + } + + /** + * 活跃积分 + * + * @Param formDTO + * @Return {@link MyTotalPointResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/17 9:58 + */ + private MyTotalPointResultDTO getActiveTotal(CommonPageUserFormDTO formDTO) { + MyTotalPointResultDTO resultDTO = new MyTotalPointResultDTO(); + ResiPointDetailResultDTO activeTotal = baseDao.selectPointByCustomerUserId(formDTO.getUserId(), formDTO.getCustomerId()); + if (null != activeTotal) { + resultDTO.setTotal(activeTotal.getAccumulatedPoint()); + resultDTO.setUsable(activeTotal.getUsablePoint()); + resultDTO.setSpend(activeTotal.getAccumulatedPoint() - activeTotal.getUsablePoint()); + } + return resultDTO; + } + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.11__pointAdditive.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.11__pointAdditive.sql new file mode 100644 index 0000000000..9e69ec4907 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.11__pointAdditive.sql @@ -0,0 +1,147 @@ +DROP TABLE IF EXISTS point_additive_rule; +CREATE TABLE point_additive_rule( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + TYPE VARCHAR(32) NOT NULL COMMENT '记录类型;分类:category;规则:rule' , + APPLY_FLAG VARCHAR(1) COMMENT '允许申请标记;允许0(type = category时,强制赋值为0),禁止1。' , + CATEGORY_CODE VARCHAR(32) COMMENT '积分类别编码;德育积分moral_education;党建积分party_building' , + CATEGORY_NAME VARCHAR(128) COMMENT '积分类别名称;type=category时必填' , + RULE_NAME VARCHAR(512) COMMENT '积分规则名称;type=rule时必填' , + PID VARCHAR(64) COMMENT '上级节点ID;上级分类ID,顶级分类的PID为0' , + PIDS VARCHAR(512) COMMENT '上级节点ID路径;所有上级节点以英文冒号(:)拼接;不必拼接0' , + POINT_VALUE INT(10) COMMENT '分值;正数加分,负数减分;type=rule时必填' , + DEL_FLAG VARCHAR(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除' , + REVISION INT(10) COMMENT '乐观锁' , + CREATED_BY VARCHAR(64) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(64) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '附加积分规则'; + +DROP TABLE IF EXISTS point_additive_record; +CREATE TABLE point_additive_record( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + TITLE VARCHAR(512) COMMENT '标题;积分变动标题或业务场景标题' , + STATEMENT VARCHAR(3072) COMMENT '说明;积分变动的说明' , + POINT_VALUE INT(10) COMMENT '分值' , + CATEGORY_CODE VARCHAR(32) COMMENT '积分类别;德育积分moral_education;党建积分party_building' , + SUBJECT_ID VARCHAR(64) COMMENT '积分主体ID;居民端用户ID或房屋ID' , + BUSINESS_ID VARCHAR(64) COMMENT '业务主键' , + BUSINESS_CODE VARCHAR(32) COMMENT '业务编码;积分申请point_apply;积分奖励point_reward;积分扣罚point_fine;积分花费point_cost;驳回积分申请point_reject' , + DEL_FLAG VARCHAR(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除' , + REVISION INT(10) COMMENT '乐观锁' , + CREATED_BY VARCHAR(64) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(64) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '附加积分记录'; + +DROP TABLE IF EXISTS point_additive_calc; +CREATE TABLE point_additive_calc( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + CATEGORY_CODE VARCHAR(32) COMMENT '积分类别;德育积分moral_education;党建积分party_building' , + SUBJECT_ID VARCHAR(64) COMMENT '积分主体ID;居民端用户ID或房屋ID' , + SPEND INT(10) DEFAULT 0 COMMENT '已用积分;累计已花费' , + TOTAL INT(10) DEFAULT 0 COMMENT '总分;累计积分' , + DEL_FLAG VARCHAR(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除' , + REVISION INT(10) COMMENT '乐观锁' , + CREATED_BY VARCHAR(64) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(64) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '附加积分计算'; + +DROP TABLE IF EXISTS point_apply; +CREATE TABLE `point_apply` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '申请人所属组织ID', + `AGENCY_PIDS` varchar(512) DEFAULT NULL COMMENT '上级组织ID路径', + `GRID_ID` varchar(64) NOT NULL COMMENT '申请人所属网格ID', + `GRID_NAME` varchar(32) DEFAULT NULL COMMENT '申请人所属网格名称', + `CATEGORY_ID` varchar(64) DEFAULT NULL COMMENT '类别ID', + `CATEGORY_NAME` varchar(90) DEFAULT NULL COMMENT '类别名称', + `CATEGORY_CODE` varchar(32) DEFAULT NULL COMMENT '类别编码;德育积分moral_education;党建积分party_building', + `RULE_ID` varchar(64) NOT NULL COMMENT '积分规则ID', + `RULE_NAME` varchar(512) DEFAULT NULL COMMENT '积分规则名称', + `TITLE` varchar(128) DEFAULT NULL COMMENT '申请标题;30字内', + `STATEMENT` varchar(3072) DEFAULT NULL COMMENT '申请内容说明;1000字内', + `STATUS` varchar(1) NOT NULL DEFAULT '0' COMMENT '申请状态;0已提交;1已驳回;2已通过', + `USER_ID` varchar(64) DEFAULT NULL COMMENT '用户ID;申请人ID(居民端用户ID)', + `IC_RESI_USER` varchar(64) DEFAULT NULL COMMENT '居民ID;申请人居民ID(IC_RESI_USER表主键)', + `HOUSE_ID` varchar(64) DEFAULT NULL COMMENT '房屋ID;房屋或家庭ID', + `HOUSE_ALL_NAME` varchar(512) DEFAULT NULL COMMENT '房屋名称;完整拼接的名称', + `HEAD_IMG_URL` varchar(512) DEFAULT NULL COMMENT '头像', + `NICKNAME` varchar(90) DEFAULT NULL COMMENT '昵称', + `GENDER` varchar(1) DEFAULT NULL COMMENT '性别;未知0;男1;女2', + `NAME` varchar(90) DEFAULT NULL COMMENT '姓名', + `ID_CARD` varchar(32) DEFAULT NULL COMMENT '身份证号', + `MOBILE` varchar(32) DEFAULT NULL COMMENT '手机号', + `REMARK` varchar(512) DEFAULT NULL COMMENT '审核备注', + `DEL_FLAG` varchar(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除', + `REVISION` int(10) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分申请'; + +DROP TABLE IF EXISTS point_reward; +CREATE TABLE point_reward( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + AGENCY_ID VARCHAR(32) NOT NULL COMMENT '组织ID' , + AGENCY_PIDS VARCHAR(512) COMMENT '组织ID路径' , + HOUSE_ID VARCHAR(64) COMMENT '房屋ID' , + HOUSE_ALL_NAME VARCHAR(512) COMMENT '房屋名称;完整拼接的名称' , + STAFF_ID VARCHAR(64) COMMENT '工作人员ID' , + STAFF_NAME VARCHAR(90) COMMENT '工作人员姓名' , + BUSINESS_CODE VARCHAR(32) COMMENT '操作类型;积分奖励point_reward;积分扣罚point_fine' , + STATEMENT VARCHAR(3072) COMMENT '备注说明;200字内' , + POINT_VALUE INT(10) COMMENT '奖扣总分值' , + DEL_FLAG VARCHAR(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除' , + REVISION INT(10) COMMENT '乐观锁' , + CREATED_BY VARCHAR(64) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(64) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '积分奖扣'; + +DROP TABLE IF EXISTS point_reward_rule; +CREATE TABLE point_reward_rule( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户ID' , + REWARD_ID VARCHAR(64) COMMENT '奖扣ID' , + RULE_ID VARCHAR(64) COMMENT '规则ID' , + DEL_FLAG VARCHAR(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除' , + REVISION INT(10) COMMENT '乐观锁' , + CREATED_BY VARCHAR(64) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(64) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '积分奖扣明细'; + +DROP TABLE IF EXISTS point_annex; +CREATE TABLE `point_annex` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `BUSINESS_ID` varchar(64) DEFAULT NULL COMMENT '业务ID;业务主键,包括积分申请、奖扣等业务', + `BUSINESS_CODE` varchar(32) DEFAULT NULL COMMENT '业务编码;积分申请point_apply,积分奖励point_reward,积分扣罚point_fine,积分花费point_cost', + `URL` varchar(512) DEFAULT NULL COMMENT '附件访问地址', + `SORT` int(10) DEFAULT NULL COMMENT '排序', + `DEL_FLAG` varchar(1) DEFAULT '0' COMMENT '删除标识;0.未删除 1.已删除', + `REVISION` int(10) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分相关附件表'; diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml index c6a2ee5d59..63a188f67c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml @@ -137,12 +137,36 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -156,6 +180,10 @@ + + + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveCalcDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveCalcDao.xml new file mode 100644 index 0000000000..dc41cb4988 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveCalcDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRecordDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRecordDao.xml new file mode 100644 index 0000000000..1451688cc2 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRecordDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml new file mode 100644 index 0000000000..84a26d63e7 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdditiveRuleDao.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAnnexDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAnnexDao.xml new file mode 100644 index 0000000000..b53f102654 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAnnexDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml new file mode 100644 index 0000000000..4eff87f9b8 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardDao.xml new file mode 100644 index 0000000000..98f794dcea --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardRuleDao.xml new file mode 100644 index 0000000000..e0fb760bd7 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardRuleDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index c5845d11c8..899a40c76b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -3,6 +3,8 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -309,6 +311,14 @@ public class CodeServiceImpl implements CodeService { if (null == authInfo) { throw new RenException("未授权"); } + //校验小程序是否设置了用户隐私 如果没有设置则执行设置后 再发布 + WxResult privacySetting = wxMaCodeService.getPrivacySetting(authInfo.getAuthorizerAccessToken()); + if (!privacySetting.success()){ + WxResult stringWxResult = wxMaCodeService.setPrivacySetting(authInfo.getAuthorizerAccessToken()); + if (!stringWxResult.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),stringWxResult.getErrorMsg(),"用户隐私权限设置失败"); + } + } //获取上传代码信息 CodeCustomerDTO uploadCode = codeCustomerService.getUploadCodeByCustomer(formDTO.getCodeId(), codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType()); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java index 7d1263e3b3..735a3b4569 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -200,4 +200,16 @@ public interface WxMaCodeConstant { * 获取代码草稿列表 */ String DELETE_TEMPLATE_URL = "https://api.weixin.qq.com/wxa/deletetemplate"; + + /** + * 获取用户隐私地址 + * @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html + */ + String GET_PRIVACY_SETTING_URL = "https://api.weixin.qq.com/cgi-bin/component/getprivacysetting"; + + /** + * 设置用户隐私地址 + * @see https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html + */ + String SET_PRIVACY_SETTING_URL = "https://api.weixin.qq.com/cgi-bin/component/setprivacysetting"; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java index 452ad866e1..e116eca160 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java @@ -72,6 +72,22 @@ public interface WxMaCodeService { */ WxResult submitAudit(String accessToken, WxMaCodeSubmitAuditRequest auditRequest); + /** + * 获取用户隐私接口权限. + * + * @param accessToken 小程序对应的accessToken + * @return 审核编号 + */ + WxResult getPrivacySetting(String accessToken); + + /** + * 设置用户隐私接口权限. + * + * @param accessToken 小程序对应的accessToken + * @return 审核编号 + */ + WxResult setPrivacySetting(String accessToken); + /** * 加急审核申请 * @author zhaoqifeng @@ -197,7 +213,7 @@ public interface WxMaCodeService { /** * 版本退回 * @author zhaoqifeng - * @date 2020/8/10 15:41 + * @date 2020/8/10 15:41 * @param accessToken * @return com.epmet.wxapi.result.WxResult */ @@ -215,7 +231,7 @@ public interface WxMaCodeService { /** * 将草稿添加到代码模板库 * @author zhaoqifeng - * @date 2020/10/28 10:23 + * @date 2020/10/28 10:23 * @param accessToken * @param request * @return com.epmet.wxapi.result.WxResult diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java index ecf30738c8..52d258308a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java @@ -1,5 +1,7 @@ package com.epmet.wxapi.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.HttpClientManager; @@ -36,6 +38,7 @@ import java.util.Map; public class WxMaCodeServiceImpl implements WxMaCodeService { private static final String ERR_CODE = "errcode"; private static final String ERR_MSG = "errmsg"; + private static final String SETTING_LIST = "setting_list"; @Autowired private WxMaDomainDTO wxMaDomainDTO; @@ -150,6 +153,50 @@ public class WxMaCodeServiceImpl implements WxMaCodeService { return result; } + @Override + public WxResult getPrivacySetting(String accessToken) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.GET_PRIVACY_SETTING_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, "{\"privacy_ver\":2}"); + log.info("getPrivacySetting result:{}", JSON.toJSONString(submitResult)); + if (!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + + + JSONArray jsonArray = jsonObject.getJSONArray(SETTING_LIST); + if (jsonArray != null || jsonArray.size() == 9){ + result.setErrorCode(9999); + result.setErrorMsg("用户隐私权限未设置或设置不完整"); + return result; + } + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + + @Override + public WxResult setPrivacySetting(String accessToken) { + //todo 目前设置9个隐私权限 + String param = "{\"owner_setting\":{\"contact_email\":\"eshitong@elink-cn.com\",\"contact_phone\":\"\",\"contact_qq\":\"\",\"contact_weixin\":\"\",\"ext_file_media_id\":\"\",\"notice_method\":\"通知\",\"store_expire_timestamp\":\"\"},\"setting_list\":[{\"privacy_key\":\"UserInfo\",\"privacy_text\":\"用户个人中心显示用户头像及昵称等\"},{\"privacy_key\":\"Location\",\"privacy_text\":\"发表话题等功能时获取位置信息\"},{\"privacy_key\":\"Record\",\"privacy_text\":\"录音发话题等\"},{\"privacy_key\":\"Album\",\"privacy_text\":\"上传照片发话题等\"},{\"privacy_key\":\"AlbumWriteOnly\",\"privacy_text\":\"下载党建声音图片或项目附近等\"},{\"privacy_key\":\"Camera\",\"privacy_text\":\"通过相机拍照发话题反应问题等\"},{\"privacy_key\":\"PhoneNumber\",\"privacy_text\":\"通过手机号为用户开通账号,更新用户基础信息\"},{\"privacy_key\":\"MessageFile\",\"privacy_text\":\"发表话题等可以选择文件上传\"},{\"privacy_key\":\"ChooseLocation\",\"privacy_text\":\"用户巡查上报\"}],\"privacy_ver\":2}"; + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.SET_PRIVACY_SETTING_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, param); + log.info("setPrivacySetting param:{}, result:{}", param, JSON.toJSONString(submitResult)); + if (!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + @Override public WxResult speedUpAudit(String accessToken, WxMaSpeedUpAuditReq request) { WxResult result = new WxResult(); diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java index fb130e9c65..91ef00b75a 100644 --- a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java @@ -22,7 +22,6 @@ import com.epmet.dto.result.MenuResourceDTO; import lombok.Data; import java.io.Serializable; -import java.util.Date; import java.util.List; @@ -77,36 +76,6 @@ public class GovMenuDTO extends TreeStringNode implements Serializab */ private Integer sort; - /** - * 删除标识:0.未删除 1.已删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; - /** * 菜单资源 */ @@ -121,4 +90,9 @@ public class GovMenuDTO extends TreeStringNode implements Serializab * 是否显示,1:显示 0不显示 */ private Integer showFlag; -} \ No newline at end of file + + /** + * 用于区分哪个端的菜单 eg:管理平台(gov_menu)、数据分析平台(data_menu) + */ + private String tableName; +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java index d3a67c889f..20636cfc3a 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java @@ -11,7 +11,6 @@ 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.GovMenuDTO; -import com.epmet.dto.result.MenuResourceDTO; import com.epmet.service.GovMenuService; import com.epmet.service.GovResourceService; import org.springframework.beans.factory.annotation.Autowired; @@ -45,11 +44,8 @@ public class GovMenuController { } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - GovMenuDTO data = govMenuService.get(id); - - //菜单资源列表 - List resourceList = govResourceService.getMenuResourceList(id); + public Result get(@PathVariable("id") String id,String tableName){ + GovMenuDTO data = govMenuService.get(id,tableName); return new Result().ok(data); } @@ -101,8 +97,8 @@ public class GovMenuController { * @return Result> */ @GetMapping("list") - public Result> list(Integer type){ - List list = govMenuService.getMenuList(type); + public Result> list(Integer type,String tableName){ + List list = govMenuService.getMenuList(type,tableName); return new Result>().ok(list); } @@ -113,8 +109,8 @@ public class GovMenuController { * @return List */ @GetMapping("nav") - public Result> nav(@LoginUser TokenDto tokenDto){ - List list = govMenuService.getUserMenuNavList(tokenDto); + public Result> nav(@LoginUser TokenDto tokenDto, String tableName){ + List list = govMenuService.getUserMenuNavList(tokenDto,tableName); return new Result>().ok(list); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java index ba05556dc1..d1902baca6 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *

* https://www.renren.io - * + *

* 版权所有,侵权必究! */ @@ -24,21 +24,22 @@ import java.util.List; @Mapper public interface GovMenuDao extends BaseDao { - GovMenuEntity getById(@Param("id") String id, @Param("language") String language); + GovMenuEntity getById(@Param("id") String id, @Param("language") String language, @Param("tableName") String tableName); /** * 查询所有菜单列表 * - * @param type 菜单类型 - * @param language 语言 + * @param type 菜单类型 + * @param language 语言 + * @param tableName */ - List getMenuList(@Param("type") Integer type, @Param("language") String language); + List getMenuList(@Param("type") Integer type, @Param("language") String language, @Param("tableName") String tableName); /** * 查询用户菜单列表 * - * @param userId 用户ID - * @param type 菜单类型 + * @param userId 用户ID + * @param type 菜单类型 * @param language 语言 */ List getUserMenuList(@Param("userId") String userId, @Param("type") Integer type, @Param("language") String language); @@ -46,7 +47,8 @@ public interface GovMenuDao extends BaseDao { /** * 根据父菜单,查询子菜单 - * @param pid 父菜单ID + * + * @param pid 父菜单ID */ List getListPid(String pid); @@ -54,8 +56,9 @@ public interface GovMenuDao extends BaseDao { * 查询客户菜单列表 * * @param customerId 客户id - * @param type 菜单类型 - * @param language 语言 + * @param type 菜单类型 + * @param language 语言 + * @param tableName */ - List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language); + List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language, @Param("tableName") String tableName); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java index 911e42f59a..64dcb0fb1c 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -45,11 +45,12 @@ public class GovCustomerMenuRedis { * desc:保存客户菜单缓存 * @param customerId * @param type + * @param tableName * @see com.epmet.enums.MenuTypeEnum */ - public void setCustomerMenuList(String customerId, Integer type, List govMenuDTOS) { + public void setCustomerMenuList(String customerId, Integer type, List govMenuDTOS, String tableName) { if (checkParam(customerId, type) && !CollectionUtils.isEmpty(govMenuDTOS) && StringUtils.isNotBlank(govMenuDTOS.get(NumConstant.ZERO).getName())) { - String key = RedisKeys.getCustomerMenuList(customerId, type); + String key = RedisKeys.getCustomerMenuList(customerId, type, tableName); redisUtils.set(key, govMenuDTOS, RedisUtils.DEFAULT_EXPIRE); } } @@ -57,11 +58,12 @@ public class GovCustomerMenuRedis { * desc:获取客户菜单缓存 * @param customerId * @param type + * @param tableName * @see com.epmet.enums.MenuTypeEnum */ - public List getCustomerMenuList(String customerId, Integer type) { + public List getCustomerMenuList(String customerId, Integer type, String tableName) { if (checkParam(customerId, type)) { - String key = RedisKeys.getCustomerMenuList(customerId, type); + String key = RedisKeys.getCustomerMenuList(customerId, type, tableName); return (List) redisUtils.get(key); } return null; diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java index b5c0cf12a3..0e87946dc5 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java @@ -59,11 +59,12 @@ public interface GovMenuService extends BaseService { * 单条查询 * * @param id + * @param tableName * @return GovMenuDTO * @author generator * @date 2020-03-18 */ - GovMenuDTO get(String id); + GovMenuDTO get(String id, String tableName); /** * 默认保存 @@ -117,15 +118,17 @@ public interface GovMenuService extends BaseService { * 菜单列表 * * @param type 菜单类型 + * @param tableName */ - List getMenuList(Integer type); + List getMenuList(Integer type, String tableName); /** * 用户菜单导航 * @param tokenDto 用户信息 + * @param tableName * @return java.util.List */ - List getUserMenuNavList(TokenDto tokenDto); + List getUserMenuNavList(TokenDto tokenDto, String tableName); /** * 获取用户权限标识 @@ -141,4 +144,4 @@ public interface GovMenuService extends BaseService { List getListPid(String pid); void clearOperUserAccess(String app, String client, String userId); -} \ No newline at end of file +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index 63bde3c678..2dbb4abe05 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -94,8 +94,9 @@ public class GovMenuServiceImpl extends BaseServiceImpl getMenuList(Integer type) { - List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + public List getMenuList(Integer type, String tableName) { + tableName = getTableName(tableName); + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage(), tableName); List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); @@ -189,7 +208,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { + public List getUserMenuNavList(TokenDto tokenDto, String tableName) { // List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); // if(menuList == null){ // menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); @@ -198,7 +217,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl * @Author zhangyong * @Date 15:51 2021-03-16 **/ - private List getCustomerMenuList(String customerId, Integer type) { - List govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type); + private List getCustomerMenuList(String customerId, Integer type, String tableName) { + List govMenuDTOS = govCustomerMenuRedis.getCustomerMenuList(customerId,type,tableName); if (!CollectionUtils.isEmpty(govMenuDTOS)){ return govMenuDTOS; } - List menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage()); + List menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage(),tableName); List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); govMenuDTOS = TreeUtils.buildTree(dtoList); - govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS); + govCustomerMenuRedis.setCustomerMenuList(customerId,type,govMenuDTOS,tableName); return govMenuDTOS; } @@ -235,7 +256,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl menuList; // if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ - menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); + //目前不支持角色 菜单 + menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage(), null); // }else{ // menuList = baseDao.getUserMenuList(tokenDto.getUserId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); // } @@ -267,7 +289,7 @@ public class GovMenuServiceImpl extends BaseServiceImpl select t1.*, - (select lang.field_value from gov_language lang where lang.table_name='gov_menu' and lang.field_name='name' + (select lang.field_value from gov_language lang where lang.table_name=#{tableName} and lang.field_name='name' and lang.table_id=t1.pid and lang.language=#{language}) as parentName, - (select lang.field_value from gov_language lang where lang.table_name='gov_menu' and lang.field_name='name' + (select lang.field_value from gov_language lang where lang.table_name=#{tableName} and lang.field_name='name' and lang.table_id=t1.id and lang.language=#{language}) as name from gov_menu t1 where t1.id = #{id} and t1.del_flag = 0 - select ID AS agencyId, ORGANIZATION_NAME AS agencyName, @@ -625,8 +632,13 @@ customer_agency where DEL_FLAG = 0 - AND PID ='0' AND CUSTOMER_ID = #{customerId} + + AND id = #{staffAgencyId} + + + AND PID ='0' + + UPDATE customer_agency @@ -802,4 +869,15 @@ order by CREATED_TIME desc + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 0f08fce996..e428bc42c6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -846,6 +846,17 @@ ) + + + UPDATE customer_grid SET total_user = total_user+#{incrCount} where id = #{gridId} and del_flag = '0' diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml index 7e0d3bde18..92c486f24a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml @@ -48,10 +48,18 @@ SET TOTAL_UNIT_NUM = #{totalUnitNum}, TOTAL_FLOOR_NUM = #{totalFloorNum}, TOTAL_HOUSE_NUM = #{totalHouseNum}, - BUILDING_LEADER_NAME = #{buildingLeaderName}, - BUILDING_LEADER_MOBILE = #{buildingLeaderMobile}, - SORT = #{sort}, - TYPE = #{type}, + + BUILDING_LEADER_NAME = #{buildingLeaderName}, + + + BUILDING_LEADER_MOBILE = #{buildingLeaderMobile}, + + + SORT = #{sort}, + + + TYPE = #{type}, + UPDATED_TIME = NOW() WHERE ID = #{buildingId} diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml index 0ee38da368..09f334b42d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingUnitDao.xml @@ -3,19 +3,20 @@ - - - - - - - - - - - - - + + + UPDATE ic_building_unit + SET DEL_FLAG = '1', + UPDATED_TIME = NOW() + WHERE ID IN ( + #{id} + ) + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml new file mode 100644 index 0000000000..385a13b216 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseCodeInfoDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + update ic_house_code_info + set HOUSE_MAX_NUM=#{houseMaxNum} + where CUSTOMER_ID = #{customerId} + and BUILDING_ID = #{buildingId} + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 5fe411e6ee..c55f985fc5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -96,10 +96,12 @@ (case when a.RENT_FLAG = '0' then '自住' when a.RENT_FLAG = '1' then '出租' when a.RENT_FLAG = '2' then '闲置' + when a.RENT_FLAG = '3' then '未出售' else '' end) as rentFlag, a.OWNER_NAME as ownerName, a.OWNER_PHONE as ownerPhone, a.OWNER_ID_CARD as ownerIdCard, + a.HOUSE_CODE, a.ID as houseId, c.ID as neighborHoodId, @@ -112,7 +114,9 @@ ag.ORGANIZATION_NAME agencyName, c.GRID_ID as gridId, gr.GRID_NAME, - IFNULL(a.sort,0) as sort + IFNULL(a.sort,0) as sort, + IFNULL(a.REMARK,'') AS remark, + a.CUSTOMER_ID from ic_house a LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' @@ -121,6 +125,7 @@ LEFT JOIN customer_agency ag on ag.ID = c.AGENCY_ID and d.DEL_FLAG = '0' 1 = 1 + and a.del_flag = '0' and case c.AGENCY_PIDS when '' then CONCAT(c.AGENCY_ID) like CONCAT(#{pids}, '%') else CONCAT(c.AGENCY_PIDS, ':', c.AGENCY_ID) like CONCAT(#{pids}, '%') end @@ -170,7 +175,16 @@ AND a.REMARK like CONCAT('%',#{remark},'%') - and a.del_flag = '0' + + AND ((DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') >= #{updateStartDate} AND DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') #{updateEndDate}) + OR (DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d') >= #{updateStartDate} AND DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d') #{updateEndDate})) + + + AND (DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') #{updateEndDate}) OR ((DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d')) #{updateEndDate}) + + + AND (DATE_FORMAT(a.CREATED_TIME,'%Y%m%d') =]]> #{updateStartDate}) OR ((DATE_FORMAT(a.UPDATED_TIME,'%Y%m%d')) =]]> #{updateStartDate}) + #排序规则:根据小区、楼栋、单元、门牌号(分别按照数字和中文)分别升序排序 ORDER BY @@ -255,11 +269,16 @@ IFNULL(ib.LATITUDE,'') as buildingLatitude, ih.CUSTOMER_ID AS customerId, concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.DOOR_NAME,'')) AS allName, - n.AGENCY_ID as agencyId + n.AGENCY_ID as agencyId, + n.GRID_ID, + gr.GRID_NAME, + ih.HOUSE_CODE, + ih.HOUSE_QRCODE_URL FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0') left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0') left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.ID AND u.DEL_FLAG = '0') + left join customer_grid gr ON (gr.id=n.GRID_ID and gr.ABANDON_FLAG=0 and gr.DEL_FLAG=0) WHERE ih.DEL_FLAG = '0' AND ih.ID = #{houseId} @@ -336,9 +355,12 @@ AND neighbor_hood_id IN ( - select id from ic_neighbor_hood - where del_flag = '0' - and (agency_id = #{orgId} OR agency_pids LIKE CONCAT('%', #{orgId}, '%')) + select a.id from ic_neighbor_hood a + + inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0' + inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0' + where a.del_flag = '0' + and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%')) ) @@ -373,5 +395,131 @@ INNER JOIN ic_neighbor_hood nh ON (nh.ID = h.NEIGHBOR_HOOD_ID AND nh.DEL_FLAG = '0') WHERE h.ID = #{houseId} + + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml index 0f1cf1b84b..8d6e24b5f7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml @@ -301,4 +301,15 @@ del_flag = '0' AND grid_id = #{gridId} + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java index fb86222967..b357632bf8 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -121,6 +122,11 @@ public class IcEventDTO implements Serializable { */ private Integer redDot; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + /** * 最近一次操作时间(回复、立项、转需求、办结更新此列) */ @@ -182,7 +188,7 @@ approved:人工审核通过) private String createdBy; /** - * 展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示 + * 创建时间 */ private Date createdTime; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java index ad88c1ce36..7d8187c110 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -17,11 +17,13 @@ public class IcEventListFormDTO implements Serializable { public interface Detail extends CustomerClientShowGroup { } + public interface GovRedDot extends CustomerClientShowGroup { + } /** * 事件ID */ - @NotBlank(message = "事件ID不能为空", groups = Detail.class) + @NotBlank(message = "事件ID不能为空", groups = {Detail.class, GovRedDot.class}) private String icEventId; /** * 所属组织 diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java index 032a0c5b65..f313f6b406 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MyReportIcEvFormDTO.java @@ -29,6 +29,8 @@ public class MyReportIcEvFormDTO extends PageFormDTO implements Serializable { } public interface RemoveRedGroup { } - @NotBlank(message = "事件id不能为空", groups = {ReplyListGroup.class,RemoveRedGroup.class}) + public interface DetailGroup { + } + @NotBlank(message = "事件id不能为空", groups = {ReplyListGroup.class,RemoveRedGroup.class,DetailGroup.class}) private String icEventId; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java index 19bb9b55df..408d0c1ea6 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -44,7 +44,7 @@ public class IcEventListResultDTO implements Serializable { /** * 音频[url集合] */ - private List voiceList; + private List voiceList; /** * 上报渠道 */ @@ -136,6 +136,10 @@ public class IcEventListResultDTO implements Serializable { * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; */ private Integer redDot; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; /** * 最近一次操作时间(回复、立项、转需求、办结更新此列) */ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java index 724a39a79b..bf1a15c05d 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventMonthlyCountResultDTO.java @@ -1,9 +1,7 @@ package com.epmet.dto.result; -import jdk.nashorn.internal.ir.debug.PrintVisitor; import lombok.Data; -import java.util.Date; @Data public class IcEventMonthlyCountResultDTO { diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java index 24e4fc16f4..12416e4276 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -5,14 +5,14 @@ import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; @@ -65,6 +65,17 @@ public class IcEventController { formDTO.setStaffId(tokenDto.getUserId()); return new Result>().ok(icEventService.list(formDTO)); } + /** + * @Author sun + * @Description 工作端小程序-事件管理-列表 + **/ + @RequestMapping("gov-list") + @RequirePermission(requirePermission = RequirePermissionEnum.IC_EVENT_LIST) + public Result> govList(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icEventService.list(formDTO)); + } @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) public Result get(@PathVariable("id") String id){ @@ -72,6 +83,7 @@ public class IcEventController { return new Result().ok(data); } + @NoRepeatSubmit @PostMapping("add") public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class); @@ -191,6 +203,7 @@ public class IcEventController { * @Author sun * @Description 事件管理-回复 **/ + @NoRepeatSubmit @PostMapping("reply") public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class); @@ -204,6 +217,7 @@ public class IcEventController { * @Author sun * @Description 事件管理-立项 **/ + @NoRepeatSubmit @PostMapping("icEventToProject") public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -267,6 +281,18 @@ public class IcEventController { ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class); return new Result().ok(icEventService.detail(formDTO)); } + /** + * @Author sun + * @Description 工作端小程序-事件管理-详情 + **/ + @PostMapping("gov-detail") + @RequirePermission(requirePermission = RequirePermissionEnum.IC_EVENT_DETAIL) + public Result govDetail(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class); + return new Result().ok(icEventService.detail(formDTO)); + } /** * 事件分类分析- 饼图2,直属下级 事件数量 @@ -322,6 +348,7 @@ public class IcEventController { * @author zxc * @date 2022/5/19 13:38 */ + @NoRepeatSubmit @PostMapping("add-event-resi") public Result addEventFromResi(@LoginUser TokenDto tokenDto,@RequestBody AddEventFromResiFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO, AddEventFromResiFormDTO.AddEventFromResiForm.class); @@ -346,6 +373,20 @@ public class IcEventController { return new Result>().ok(icEventService.myReport(formDTO).getList()); } + /** + * 居民端我上报的事件, 消息列表跳转详情 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("myreport-detail") + public Result myReportDetail(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.DetailGroup.class); + return new Result().ok(icEventService.myReportDetail(formDTO)); + } + /** * 居民端小程序我上报的事件详情页面-回复列表 * http://yapi.elinkservice.cn/project/102/interface/api/7783 @@ -382,6 +423,7 @@ public class IcEventController { * @param formDTO * @return */ + @NoRepeatSubmit @PostMapping("resi-reply") public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -395,6 +437,7 @@ public class IcEventController { * @Author sun * @Description 数字平台-事件导出 **/ + @NoRepeatSubmit @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -437,4 +480,15 @@ public class IcEventController { } } + /** + * @Author sun + * @Description 工作端事件红点消除 + **/ + @PostMapping("govRedDot") + public Result govRedDot(@RequestBody IcEventListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.GovRedDot.class); + icEventService.govRedDot(formDTO.getIcEventId()); + return new Result(); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java index db3fc54536..a8e83bcf7c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -121,6 +121,11 @@ public class IcEventEntity extends BaseEpmetEntity { */ private Integer redDot; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + /** * 最近一次操作时间(回复、立项、转需求、办结更新此列) */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java index acffa5765c..2a3545fc9c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -208,4 +208,16 @@ public interface IcEventService extends BaseService { * @param formDTO */ void resiReply(ResiReplyIcEventFormDTO formDTO); + + /** + * 居民端我上报的事件, 消息列表跳转详情 + * @param formDTO + * @return + */ + MyReportIcEvResDTO myReportDetail(MyReportIcEvFormDTO formDTO); + + /** + * @Description 工作端事件红点消除 + **/ + void govRedDot(String icEventId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index a05d3d731d..ed76a24e82 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -135,12 +135,12 @@ public class IcEventServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); - List voiceList = new ArrayList<>(); + List voiceList = new ArrayList<>(); for(IcEventListResultDTO.Attachment file: dto.getAttachmentList()){ if ("image".equals(file.getType())) { imageList.add(file.getUrl()); } else if ("voice".equals(file.getType())) { - voiceList.add(file.getUrl()); + voiceList.add(file); } } dto.setImageList(imageList); @@ -993,7 +993,7 @@ public class IcEventServiceImpl extends BaseServiceImpl imageList = new ArrayList<>(); - List voiceList = new ArrayList<>(); + List voiceList = new ArrayList<>(); resultDTO.getAttachmentList().forEach(file -> { if ("image".equals(file.getType())) { imageList.add(file.getUrl()); } else if ("voice".equals(file.getType())) { - voiceList.add(file.getUrl()); + voiceList.add(file); } }); resultDTO.setImageList(imageList); @@ -1212,6 +1212,27 @@ public class IcEventServiceImpl extends BaseServiceImpl msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(formDTO.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.RESI); + messageFormDTO.setGridId(entity.getGridId()); + messageFormDTO.setUserId(entity.getCreatedBy()); + messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE); + messageFormDTO.setMessageContent(String.format("您上报的事件已完成,请查看。")); + messageFormDTO.setReadFlag(Constant.UNREAD); + messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT); + messageFormDTO.setTargetId(entity.getId()); + msgList.add(messageFormDTO); + Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList); + if (!sendMessageRes.success()) { + log.warn(String.format("事件回复,给居民端用户发送站内信异常,事件Id->%s", entity.getId())); + } + } + } /** @@ -1267,9 +1288,12 @@ public class IcEventServiceImpl extends BaseServiceImpl attachmentEntityList = new ArrayList<>(); @@ -1426,7 +1450,10 @@ public class IcEventServiceImpl extends BaseServiceImpl> agencyStaffsResult = govOrgOpenFeignClient.getAgencyStaffs(formDTO); + if (!agencyStaffsResult.success()){ + throw new EpmetException("查询组织下工作人员失败..."); + } + if (!CollectionUtils.isEmpty(agencyStaffsResult.getData())){ + List msgList = new ArrayList<>(); + agencyStaffsResult.getData().forEach(u -> { + UserMessageFormDTO msg = new UserMessageFormDTO(); + msg.setUserId(u); + msg.setCustomerId(customerId); + msg.setTargetId(icEventId); + msg.setGridId("*"); + msg.setApp(AppClientConstant.APP_GOV); + msg.setMessageType(UserMessageTypeConstant.IC_EVENT); + msg.setReadFlag(ReadFlagConstant.UN_READ); + msg.setTitle("您有一条事件消息"); + msg.setMessageContent(showName+"对事件进行了新的回复,请查看。"); + msgList.add(msg); + }); + messageOpenFeignClient.saveUserMessageList(msgList); + } + } + + /** + * 居民端我上报的事件, 消息列表跳转详情 + * + * @param formDTO + * @return + */ + @Override + public MyReportIcEvResDTO myReportDetail(MyReportIcEvFormDTO formDTO) { + // 1.分页查询 + List list=baseDao.selectMyReport(formDTO); + if (!CollectionUtils.isEmpty(list)) { + //封装数据 + for (MyReportIcEvResDTO dto : list) { + //每个事件对应的图片数据 + if (!CollectionUtils.isEmpty(dto.getAttachmentList())) { + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + for (IcEventAttachmentDTO file : dto.getAttachmentList()) { + if ("image".equals(file.getAttachmentType())) { + imageList.add(file.getAttachmentUrl()); + } else if ("voice".equals(file.getAttachmentType())) { + voiceList.add(file); + } + } + dto.setImageList(imageList); + dto.setVoiceList(voiceList); + } + + //分类信息 + if(StringUtils.isNotBlank(dto.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(dto.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(dto.getCategoryId())) { + if(StringUtils.isNotBlank(ca.getParentCategoryName())){ + //大类-子类 + dto.setCategoryName(ca.getParentCategoryName().concat(StrConstant.HYPHEN).concat(ca.getCategoryName())); + }else{ + dto.setCategoryName(ca.getCategoryName()); + } + } + } + } + + } + } + return list.get(NumConstant.ZERO); } private IcEventEntity checkReply(String icEventId) { @@ -1466,5 +1572,12 @@ public class IcEventServiceImpl extends BaseServiceImpl + @@ -169,6 +170,7 @@ ie.operation_id, ie.read_flag, ie.red_dot, + ie.gov_red_dot, ie.latest_operated_time, ie.resolve_status, ie.close_remark, diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml index f985020aa1..9b1c2efa20 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/logback-spring.xml @@ -145,12 +145,36 @@ --> + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + + + + @@ -164,6 +188,10 @@ + + + + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java index 4d0a000b8a..386fffd4d5 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ConditionResultDTO.java @@ -96,5 +96,10 @@ public class ConditionResultDTO implements Serializable { * 这个表 是否支持添加 即是否是多对一 eg:居民需求是多个对一个 */ private boolean supportAdd; + + /** + * 是否为多选 1可以多选,0单选 + */ + private Integer multiSelect; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java index 3c2004e714..8d16dfdb23 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/ResiCategoryStatsConfigController.java @@ -75,7 +75,6 @@ public class ResiCategoryStatsConfigController { @PostMapping("list") public Result> list(@LoginUser TokenDto tokenDTO,@RequestBody ResiCategoryStatsConfigListFormDTO formDTO){ String customerId = tokenDTO.getCustomerId(); -// String customerId = "123123"; return new Result>().ok(resiCategoryStatsConfigService.list(customerId,formDTO)); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java index 22f83887ba..a6940e9499 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java @@ -76,7 +76,12 @@ public class IcFormQueryBuilderEntity extends BaseEpmetEntity { * 手机号:mobile; 身份证:id_card;只能输入数字:num */ private String validType; - + + /** + * 是否为多选 1可以多选,0单选 + */ + private Integer multiSelect; + /** * 排序 */ diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java index 6002398fbd..0523b83600 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormServiceImpl.java @@ -175,6 +175,7 @@ public class IcFormServiceImpl extends BaseServiceImpl if (CollectionUtils.isEmpty(itemList)) { return "默认配置错误"; } + String defaultBaseInfoGroupId = "default_0"; //设置ic_form_item itemList.forEach(item -> { item.setId(newPrefixed + item.getId()); @@ -183,7 +184,10 @@ public class IcFormServiceImpl extends BaseServiceImpl item.setAreaCode(areaCode); item.setParentItemId(newPrefixed + item.getParentItemId()); //分组Id 为0 说明不村子分组 则直接不设置 仍然为0 - if (!NumConstant.ZERO_STR.equals(item.getItemGroupId())){ + //基础信息分组id:default_0;默认是客户id_0 + if (defaultBaseInfoGroupId.equals(item.getItemGroupId())) { + item.setItemGroupId(customerId.concat("_0")); + } else { item.setItemGroupId(newPrefixed + item.getItemGroupId()); } String optionSourceValue = item.getOptionSourceValue(); @@ -227,7 +231,12 @@ public class IcFormServiceImpl extends BaseServiceImpl wrapperGroup.eq(IcFormItemGroupEntity::getFormCode, formCode); List groupList = icFormItemGroupDao.selectList(wrapperGroup); groupList.forEach(item -> { - item.setId(newPrefixed + item.getId()); + if (defaultBaseInfoGroupId.equals(item.getId())) { + //基础信息分组id默认客户id_0 + item.setId(customerId.concat("_0")); + } else { + item.setId(newPrefixed + item.getId()); + } item.setCustomerId(customerId); item.setFormId(newFormId); item.setCreatedBy("init_user"); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java index e95f209aba..a21534cdce 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/ResiCategoryStatsConfigServiceImpl.java @@ -81,6 +81,9 @@ public class ResiCategoryStatsConfigServiceImpl implements ResiCategoryStatsConf //2.获取ic_resi_category_stats_config 和 ic_resi_category_warn_config 表中的数据 List statsConfigEntityList = icResiCategoryStatsConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryStatsConfigEntity::getCustomerId,customerId)); + if (!CollectionUtils.isEmpty(statsConfigEntityList)){ + return icResiCategoryStatsConfigDao.listInfo(customerId,formDTO.getIsWarn(),formDTO.getLevel()); + } List warnConfigEntityList = icResiCategoryWarnConfigDao.selectList(new QueryWrapper().lambda().eq(IcResiCategoryWarnConfigEntity::getCustomerId,customerId)); //3.新增不存在的,删除不在tableColumnMap的 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.29__radio_default.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.29__radio_default.sql new file mode 100644 index 0000000000..f23b014497 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.29__radio_default.sql @@ -0,0 +1,6 @@ +UPDATE ic_form_item +SET DEFAULT_VALUE = '0',UPDATED_TIME=NOW() +WHERE + ITEM_TYPE = 'radio' + AND DEL_FLAG = '0' + AND ( DEFAULT_VALUE IS NULL OR DEFAULT_VALUE = '' ); diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.30__item_query.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.30__item_query.sql new file mode 100644 index 0000000000..cdf0174eab --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.30__item_query.sql @@ -0,0 +1,2 @@ +alter TABLE ic_form_query_builder add COLUMN `MULTI_SELECT` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1可以多选,0单选,默认0' after VALID_TYPE; + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml index d809abcfd7..594456d25f 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/logback-spring.xml @@ -108,6 +108,25 @@ DENY + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + @@ -144,6 +163,10 @@ + + + + @@ -157,6 +180,10 @@ + + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index b58666f21c..20974d2afa 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -85,7 +85,8 @@ IFNULL(i.PLACEHOLDER,'') as PLACEHOLDER, IFNULL(i.COLUMN_NAME,'')as COLUMN_NAME, b.QUERY_TYPE, - b.FUN_TYPE + b.FUN_TYPE, + b.MULTI_SELECT as multiSelect FROM ic_form_query_builder b inner join ic_form_item i on(i.id=b.FORM_ITEM_ID and i.DEL_FLAG='0') LEFT JOIN ic_form_item_group g ON ( i.ITEM_GROUP_ID = g.id ) diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml index a496703051..3eb3b4432f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml @@ -138,6 +138,26 @@ + + + + ${log.path}/rocketmqclient.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%X{Transaction-Serial}] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/rocketmqclient-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + @@ -147,6 +167,10 @@ + + + + @@ -164,6 +188,10 @@ + + + + diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java index a508fffe31..5c4788f7b7 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java @@ -28,11 +28,14 @@ public class PersonalCenterServiceImpl implements PersonalCenterService { @Override public InitInfoResultDTO initInfo(TokenDto tokenDto) { + InitInfoResultDTO resultDTO = new InitInfoResultDTO(); Result baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); - if (!baseInfoResult.success() || null == baseInfoResult.getData()) { + if (!baseInfoResult.success()) { throw new RenException(baseInfoResult.getCode(), baseInfoResult.getMsg()); } - InitInfoResultDTO resultDTO = new InitInfoResultDTO(); + if (null == baseInfoResult.getData()) { + return resultDTO; + } resultDTO.setHeadImgUrl(baseInfoResult.getData().getHeadImgUrl()); resultDTO.setSurname(baseInfoResult.getData().getSurname()); resultDTO.setName(baseInfoResult.getData().getName()); diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java new file mode 100644 index 0000000000..fa1534fc65 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.resi.partymember.dto.partyOrg.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @program: epmet-cloud + * @description: + * @author: wangtong + * @create: 2022-06-10 16:02 + **/ +@Data +public class GetParentOrgFormDTO implements Serializable { + /** + * 党组织类型 + */ + @NotNull(message = "党组织类型不可为空") + private String partyOrgType; + + /** + * 行政组织 机关ID + */ + @NotNull(message = "行政组织id不可为空") + private String agencyId; + + /** + * 客户Id (customer.id) + */ + private String customerId; + +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java index 1663f19881..2fb53983a9 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyMemberPointDTO.java @@ -16,10 +16,6 @@ public class IcPartyMemberPointDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 唯一标识 - */ - private String id; /** * 客户Id (customer.id) @@ -84,7 +80,7 @@ public class IcPartyMemberPointDTO implements Serializable { /** * 总分 */ - private Integer totalScore; + private Integer totalScore = 0; /** * 删除标识:0.未删除 1.已删除 @@ -116,4 +112,4 @@ public class IcPartyMemberPointDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java index 42da9bdf94..5ded6b154c 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/IcPartyMemberFromDTO.java @@ -81,4 +81,5 @@ public class IcPartyMemberFromDTO extends PageFormDTO implements Serializable { */ private String payEndDate; private String year; + private String month; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java index 5055126aec..4ca728461e 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/PartyMemberPointListFormDTO.java @@ -10,10 +10,14 @@ import java.io.Serializable; @Data @AllArgsConstructor @NoArgsConstructor -public class PartyMemberPointListFormDTO extends PageFormDTO implements Serializable { +public class PartyMemberPointListFormDTO implements Serializable { private static final long serialVersionUID = 5659445492756209830L; + private Integer page; + + private Integer limit; + /** * 所属党组织id */ 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 d88cd797b3..0098acd036 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 @@ -1,7 +1,11 @@ package com.epmet.resi.partymember.feign; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; @@ -48,18 +52,18 @@ public interface ResiPartyMemberOpenFeignClient { Result addPartyMemberBaseInfo(@RequestBody PartyMemberBaseInfoAddFormDTO formDTO); /** - * @return com.epmet.commons.tools.utils.Result> * @param partyBranchId + * @return com.epmet.commons.tools.utils.Result> * @author yinzuomei - * @description 根据党支部id,查询党员列表 + * @description 根据党支部id, 查询党员列表 * @Date 2020/6/18 10:12 **/ @GetMapping(value = "/resi/partymember/partymemberbaseinfo/listPartyMemberBaseInfo/{partyBranchId}") Result> listPartyMemberBaseInfo(@PathVariable("partyBranchId") String partyBranchId); /** - * @return com.epmet.commons.tools.utils.Result * @param partyMemberId 党员库id主键 + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 根据党员id查询党员信息 * @Date 2020/6/18 15:30 @@ -68,8 +72,8 @@ public interface ResiPartyMemberOpenFeignClient { Result queryPartyMemberBaseInfoById(@PathVariable("partyMemberId") String partyMemberId); /** - * @return com.epmet.commons.tools.utils.Result * @param formDTO + * @return com.epmet.commons.tools.utils.Result * @author yinzuomei * @description 删除党员 * @Date 2020/6/18 17:57 @@ -78,8 +82,8 @@ public interface ResiPartyMemberOpenFeignClient { Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO); /** - * @return com.epmet.commons.tools.utils.Result> * @param userIdList + * @return com.epmet.commons.tools.utils.Result> * @author yinzuomei * @description 根据用户id查询认证通过的党员信息 * @Date 2020/7/22 12:14 @@ -88,8 +92,8 @@ public interface ResiPartyMemberOpenFeignClient { Result> queryPartymemberInfoByUserId(@RequestBody List userIdList); /** - * @return com.epmet.commons.tools.utils.Result> * @param gridIdList + * @return com.epmet.commons.tools.utils.Result> * @author zy * @description 根据网格id查询认证通过的党员信息 * @Date 2020/7/22 12:14 @@ -98,22 +102,23 @@ public interface ResiPartyMemberOpenFeignClient { Result> getPartymemberInfoByGridId(@RequestBody List gridIdList); /** - * @Description 根据客户ID查询党员 + * @Description 根据客户ID查询党员 * @Param customerId * @author zxc * @date 2021/9/6 3:54 下午 */ @PostMapping(value = "/resi/partymember/partymemberinfo/getpartymemberinfobycustomerid") - Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId")String customerId); + Result> getPartyMemberInfoByCustomerId(@RequestParam("customerId") String customerId); /** * Desc: 查询网格下是否存在党员审核 true:存在,false:不存在 + * * @param gridId * @author zxc * @date 2022/3/15 4:19 下午 */ @PostMapping("/resi/partymember/partymemberconfirmmanual/audit-reset") - Result partyMemberAuditReset(@RequestParam("gridId")String gridId); + Result partyMemberAuditReset(@RequestParam("gridId") String gridId); /** * @Description 同步党员信息 @@ -124,4 +129,10 @@ public interface ResiPartyMemberOpenFeignClient { */ @PostMapping("/resi/partymember/icPartyMember/icPartyMemberSync") Result icPartyMemberSync(@RequestBody IcPartyMemberDTO dto); + + @PostMapping("/resi/partymember/icPartyMember/getPartyMemberByIdCard") + Result getPartyMemberByIdCard(@RequestBody IcPartyMemberDTO dto); + + @PostMapping("/resi/partymember/icPartyOrg/branchlist") + public Result> branchlist(); } 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 3a10c64914..57ce87c1e4 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 @@ -1,8 +1,11 @@ package com.epmet.resi.partymember.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionResultDTO; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; @@ -88,4 +91,14 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result icPartyMemberSync(IcPartyMemberDTO dto) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "icPartyMemberSync", dto); } + + @Override + public Result getPartyMemberByIdCard(IcPartyMemberDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyMemberByIdCard", dto); + } + + @Override + public Result> branchlist() { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "branchlist", null); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java index c0b0af1144..499c2a1d70 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java @@ -14,6 +14,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; @@ -96,6 +97,19 @@ public class IcPartyOrgController { return icPartyOrgService.getTreelist(formDTO); } + /** + * @describe: 列表搜索党组织树(不包含当前级组织) + * @author wangtong + * @date 2022/6/10 14:20 + * @params [tokenDto, formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @GetMapping("getSearchTreelist") + public Result> getSearchTreelist(@LoginUser TokenDto tokenDto,PartyOrgTreeListDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + return icPartyOrgService.getSearchTreelist(formDTO); + } + /** * @describe: 当前登录用户所属行政组织,及下级的党组织(只限支部) * @author wangtong @@ -108,6 +122,19 @@ public class IcPartyOrgController { return icPartyOrgService.branchlist(tokenDto); } - + /** + * @describe: 上级党组织列表 + * @author wangtong + * @date 2022/6/10 15:59 + * @params [tokenDto, formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + @GetMapping("getParentOrgList") + public Result> getParentOrgList(@LoginUser TokenDto tokenDto, GetParentOrgFormDTO formDTO){ + //效验数据 + ValidatorUtils.validateEntity(formDTO); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return icPartyOrgService.getParentOrgList(formDTO); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java index 3413e87649..93fa4d8a64 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java @@ -3,7 +3,6 @@ package com.epmet.modules.partyOrg.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; -import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.apache.ibatis.annotations.Mapper; @@ -21,7 +20,7 @@ import java.util.List; public interface IcPartyOrgDao extends BaseDao { /** - * @describe: 获取组织列表 + * @describe: 获取当前及下级组织列表 * @author wangtong * @date 2022/5/17 19:00 * @params [] @@ -75,4 +74,34 @@ public interface IcPartyOrgDao extends BaseDao { * @return java.util.List */ List selectAllBranchByAgencyId(@Param("agencyId") String agencyId, @Param("customerId") String customerId); + + /** + * @describe: 获取下级组织列表 + * @author wangtong + * @date 2022/6/10 14:21 + * @params [formDTO] + * @return java.util.List + */ + List getSearchTreelist(PartyOrgTreeListDTO formDTO); + + /** + * @describe: 获取上级党组织 + * @author wangtong + * @date 2022/6/10 16:48 + * @params [agencyPid, customerId, code] + * @return java.util.List + */ + List selectParentOrgByAgencyPid(@Param("agencyId") String agencyId, + @Param("agencyPid") String agencyPid, + @Param("customerId") String customerId, + @Param("partyOrgType") String partyOrgType); + + /** + * @describe: 查询该客户下的一级组织 + * @author wangtong + * @date 2022/6/10 17:29 + * @params [customerId] + * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity + */ + IcPartyOrgEntity selectByCustomerIdAndFirstOrg(@Param("customerId") String customerId); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java index 5405a5b531..6397916cc6 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; @@ -98,4 +99,22 @@ public interface IcPartyOrgService extends BaseService { * @return com.epmet.commons.tools.utils.Result */ Result> branchlist(TokenDto tokenDto); + + /** + * @describe: 列表搜索党组织树(不包含当前级组织) + * @author wangtong + * @date 2022/6/10 14:20 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + Result> getSearchTreelist(PartyOrgTreeListDTO formDTO); + + /** + * @describe: 上级党组织列表 + * @author wangtong + * @date 2022/6/10 16:01 + * @params [formDTO] + * @return com.epmet.commons.tools.utils.Result> + */ + Result> getParentOrgList(GetParentOrgFormDTO formDTO); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java index b0925ffd7d..70cb443864 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.PartyOrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; @@ -14,15 +15,19 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.enums.OrgLevelEnums; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.modules.partymember.dao.IcPartyMemberDao; import com.epmet.modules.partymember.entity.IcPartyMemberEntity; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +52,9 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl page(Map params) { @@ -64,8 +72,8 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -83,47 +91,47 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl orgList = baseDao.selectAllByOrgId(id); - if(!CollectionUtils.isEmpty(orgList)){ + if (!CollectionUtils.isEmpty(orgList)) { throw new EpmetException("请先删除下级党组织!"); } //判断该组织下是否有党员 List memberList = icPartyMemberDao.selectAllByOrgId(id); - if(!CollectionUtils.isEmpty(memberList)){ + if (!CollectionUtils.isEmpty(memberList)) { throw new EpmetException("该组织下有党员信息暂时不可删除!"); } baseDao.deleteById(id); @@ -214,17 +222,54 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl> branchlist(TokenDto tokenDto) { - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); List resultList = new ArrayList<>(); BranchlistTreeDTO result = new BranchlistTreeDTO(); result.setValue(staffInfo.getAgencyId()); // result.setOrgPids(staffInfo.getAgencyPIds()); result.setLabel(staffInfo.getAgencyName()); - result.setChildren(baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(),tokenDto.getCustomerId())); + //该行政组织下的所有类型为支部的党组织 + List orgList = baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(), tokenDto.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + return new Result>().ok(resultList); + } + result.setChildren(orgList); resultList.add(result); return new Result>().ok(resultList); } + @Override + public Result> getSearchTreelist(PartyOrgTreeListDTO formDTO) { + List list = baseDao.getSearchTreelist(formDTO); + return new Result>().ok(build(list)); + } + + @Override + public Result> getParentOrgList(GetParentOrgFormDTO formDTO) { + Result agencyDTOResult = govOrgOpenFeignClient.getAgencyById(formDTO.getAgencyId()); + if (!agencyDTOResult.success() || null == agencyDTOResult || null == agencyDTOResult.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询行政组织信息错误", "查询行政组织信息错误"); + } + String agencyPid = agencyDTOResult.getData().getPid(); + List list = new ArrayList<>(); + //如果本工作人员的级别是该客户下的最高级别,并且没有一级组织时,添加一级组织选项 + IcPartyOrgEntity entity = baseDao.selectByCustomerIdAndFirstOrg(formDTO.getCustomerId()); + if("0".equals(agencyPid) && null == entity){ + IcPartyOrgTreeDTO firstOrg = new IcPartyOrgTreeDTO(); + firstOrg.setId("0"); + firstOrg.setPartyOrgName("一级组织"); + list.add(firstOrg); + } + //如果类型为支部,则查询该行政组织下的所有党委(列表) + if(PartyOrgTypeEnum.BRANCH.getCode().equals(formDTO.getPartyOrgType())){ + list.addAll(baseDao.selectParentOrgByAgencyPid(formDTO.getAgencyId(),null,formDTO.getCustomerId(),PartyOrgTypeEnum.PARTY.getCode())); + }else{ + //查询该行政组织对应上级所关联的党组织(单个实体类) + list.addAll(baseDao.selectParentOrgByAgencyPid(null,agencyPid,formDTO.getCustomerId(),null)); + } + return new Result>().ok(list); + } + /** * 构建树节点 */ @@ -233,13 +278,13 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl nodeMap = new LinkedHashMap<>(treeNodes.size()); - for(IcPartyOrgTreeDTO treeNode : treeNodes){ + for (IcPartyOrgTreeDTO treeNode : treeNodes) { nodeMap.put(treeNode.getId(), treeNode); } - for(IcPartyOrgTreeDTO node : nodeMap.values()) { + for (IcPartyOrgTreeDTO node : nodeMap.values()) { IcPartyOrgTreeDTO parent = nodeMap.get(node.getPid()); - if(parent != null && !(node.getId().equals(parent.getId()))){ + if (parent != null && !(node.getId().equals(parent.getId()))) { parent.getChildren().add(node); continue; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java index 3390d45acc..a1fdca4c49 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java @@ -112,6 +112,12 @@ public class IcPartyMemberController implements ResultDataResolver { return new Result(); } + @PostMapping("getPartyMemberByIdCard") + public Result getPartyMemberByIdCard(@RequestBody IcPartyMemberDTO dto){ + IcPartyMemberDTO result = icPartyMemberService.getPartyMemberByIdCard(dto); + return new Result().ok(result); + } + @NoRepeatSubmit @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFromDTO formDTO, HttpServletResponse response) throws Exception { diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java index 4c095ac243..68b1b5248b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPayRecordDetailController.java @@ -52,6 +52,7 @@ public class IcPartyMemberPayRecordDetailController { @RequestMapping("page") public Result> page(@LoginUser TokenDto tokenDto, @RequestParam Map params){ params.put("customerId",tokenDto.getCustomerId()); + params.put("userId",tokenDto.getUserId()); // PageData page = icPartyMemberPayRecordDetailService.page(params); PageData page = icPartyMemberPayRecordDetailService.getPhrasePage(params); return new Result>().ok(page); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java index 07af853ce1..7d111cfa92 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberPointController.java @@ -12,7 +12,6 @@ import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; @@ -21,23 +20,13 @@ 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.IcFollowUpRecordDTO; -import com.epmet.dto.result.IcMoveInListResultDTO; -import com.epmet.dto.result.IcVaccineListResultDTO; -import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; -import com.epmet.modules.partymember.excel.IcPartyMemberExcel; import com.epmet.modules.partymember.excel.IcPartyMemberPointExcel; import com.epmet.modules.partymember.service.IcPartyMemberPointService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; -import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; -import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; -import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; -import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; -import jdk.nashorn.internal.parser.Token; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -45,7 +34,6 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; -import java.util.Date; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; @@ -117,8 +105,8 @@ public class IcPartyMemberPointController { @PostMapping("export") public void export(@RequestBody PartyMemberPointListFormDTO formDto, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { - formDto.setIsPage(false); - formDto.setPageSize(NumConstant.TEN_THOUSAND); + + formDto.setLimit(NumConstant.TEN_THOUSAND); ExcelWriter excelWriter = null; AtomicInteger i = new AtomicInteger(1); @@ -135,8 +123,8 @@ public class IcPartyMemberPointController { item.setIndex(i.getAndIncrement()); }); excelWriter.write(list, writeSheet); - formDto.setPageNo(formDto.getPageNo() + NumConstant.ONE); - } while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == formDto.getPageSize()); + formDto.setPage(formDto.getPage() + NumConstant.ONE); + } while (CollectionUtils.isNotEmpty(page.getList()) && page.getList().size() == formDto.getLimit()); } catch (EpmetException e) { response.reset(); response.setCharacterEncoding("UTF-8"); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java index f7a36ea435..ed745c2b90 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyMemberPointDao.java @@ -42,4 +42,11 @@ public interface IcPartyMemberPointDao extends BaseDao @Param("customerId") String customerId); void updateMember(@Param("partyMemberId") String partyMemberId, @Param("totalScore") Integer totalScore); -} \ No newline at end of file + + int getPoint(@Param("year") String year, + @Param("quarter") String quarter, + @Param("customerId") String customerId, + @Param("partyMemberId") String partyMemberId); + + void updateByPartyMemberId(@Param("entity") IcPartyMemberPointEntity entity); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java index 0d84d90723..20373c3ca5 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java @@ -85,6 +85,16 @@ public interface IcPartyMemberService extends BaseService { */ void delete(String[] ids); + /** + * 根据身份证获取党员信息 + * + * @Param dto + * @Return {@link IcPartyMemberDTO} + * @Author zhaoqifeng + * @Date 2022/6/9 10:07 + */ + IcPartyMemberDTO getPartyMemberByIdCard(IcPartyMemberDTO dto); + /** * 党员信息同步 * diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java index fb1d15b57e..ba21b74d5c 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPayRecordDetailServiceImpl.java @@ -4,30 +4,29 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.constant.FieldConstant; +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.EpmetException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.common.CustomerOrgRedis; -import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.modules.partyOrg.dao.IcPartyOrgDao; +import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.modules.partymember.dao.IcPartyMemberPayRecordDetailDao; import com.epmet.modules.partymember.entity.IcPartyMemberPayRecordDetailEntity; -import com.epmet.modules.partymember.entity.IcPartymemberStyleCategoryDictEntity; -import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; import com.epmet.modules.partymember.redis.IcPartyMemberPayRecordDetailRedis; import com.epmet.modules.partymember.service.IcPartyMemberPayRecordDetailService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPayRecordDetailDTO; -import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; -import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberPayRecordDetailFormDTO; -import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; 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 javax.annotation.Resource; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -42,6 +41,8 @@ public class IcPartyMemberPayRecordDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -59,6 +60,25 @@ public class IcPartyMemberPayRecordDetailServiceImpl extends BaseServiceImpl getPhrasePage(Map params) { + String customerId = (String) params.get("customerId"); + String userId = (String) params.get("userId"); + String orgId = (String) params.get("orgId"); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取工作人员信息失败", "获取工作人员信息失败"); + } + if (StringUtils.isBlank(orgId)) { + //获取工作人员所属组织同级的党组织 + LambdaQueryWrapper orgWrapper = new LambdaQueryWrapper<>(); + orgWrapper.eq(IcPartyOrgEntity::getCustomerId, customerId); + orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId()); + orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR); + IcPartyOrgEntity org = icPartyOrgDao.selectOne(orgWrapper); + if (null == org) { + return new PageData<>(Collections.emptyList(), 0); + } + params.put("orgId",org.getId()); + } IPage page = getPage(params); List list = baseDao.selectListInfo(params); return new PageData<>(list, page.getTotal()); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java index b5e7471213..e52fe10436 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberPointServiceImpl.java @@ -14,26 +14,19 @@ import com.epmet.modules.partymember.entity.IcPartyMemberPointEntity; import com.epmet.modules.partymember.redis.IcPartyMemberPointRedis; import com.epmet.modules.partymember.service.IcPartyMemberPointService; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberPointDTO; -import com.epmet.resi.partymember.dto.partymember.PartyMemberPointListCountDTO; -import com.epmet.resi.partymember.dto.partymember.form.PartyMemberExportFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointEchoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberPointListFormDTO; -import com.epmet.resi.partymember.dto.partymember.result.IcPartyMemberResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointEchoResultDTO; -import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointExportResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberPointListResultDTO; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import jdk.nashorn.internal.parser.Token; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.sql.Time; import java.time.Year; import java.util.Arrays; -import java.util.Calendar; import java.util.List; import java.util.Map; @@ -83,14 +76,27 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl 0) { - dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + if (dto.getWarnPoint() != null) { + if (dto.getWarnPoint() > 0) { + dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + } else { + dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + } } else { - dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + dto.setWarnPoint(NumConstant.ZERO); } IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); - if(dto.getYear().equals(Year.now().toString())){ + if (dto.getYear().equals(Year.now().toString())) { baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); } insert(entity); @@ -99,17 +105,35 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl 0) { - dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + if (baseDao.getPoint(dto.getYear(), dto.getQuarter(), dto.getCustomerId(), dto.getPartyMemberId()) != NumConstant.ZERO) { + if (dto.getBasePoint() == null) { + dto.setBasePoint(NumConstant.ZERO); + } + if (dto.getReviewPoint() == null) { + dto.setReviewPoint(NumConstant.ZERO); + } + if (dto.getInspirePoint() == null) { + dto.setInspirePoint(NumConstant.ZERO); + } + dto.setTotalScore(dto.getBasePoint() + dto.getInspirePoint() + dto.getReviewPoint()); + if (dto.getWarnPoint() != null) { + if (dto.getWarnPoint() > 0) { + dto.setTotalScore(dto.getTotalScore() - dto.getWarnPoint()); + } else { + dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + } + } else { + dto.setWarnPoint(NumConstant.ZERO); + } + IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); + if (dto.getYear().equals(Year.now().toString())) { + baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); + } + baseDao.updateByPartyMemberId(entity); } else { - dto.setTotalScore(dto.getTotalScore() + dto.getWarnPoint()); + save(dto); } - IcPartyMemberPointEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyMemberPointEntity.class); - if(dto.getYear().equals(Year.now().toString())){ - baseDao.updateMember(dto.getPartyMemberId(), dto.getTotalScore()); - } - updateById(entity); + } @Override @@ -130,7 +154,7 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl getList(PartyMemberPointListFormDTO form, TokenDto tokenDto) { - PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); + PageHelper.startPage(form.getPage(), form.getLimit()); List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); PageInfo pageInfo = new PageInfo<>(dto); @@ -161,7 +185,7 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl getExport(PartyMemberPointListFormDTO form, TokenDto tokenDto) { - PageHelper.startPage(form.getPageNo(), form.getPageSize(), form.getIsPage()); + PageHelper.startPage(form.getPage(), form.getLimit()); List dto = baseDao.getList(form.getIdCard(), form.getMobile(), form.getName(), form.getOrgId(), form.getYear(), tokenDto.getCustomerId()); PageInfo pageInfo = new PageInfo<>(dto); @@ -169,4 +193,4 @@ public class IcPartyMemberPointServiceImpl extends BaseServiceImpl list = baseDao.selectList(formDTO); @@ -331,6 +333,24 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcPartyMemberEntity::getCustomerId, dto.getCustomerId()); + wrapper.eq(IcPartyMemberEntity::getIdCard, dto.getIdCard()); + IcPartyMemberEntity partyMember = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(partyMember, IcPartyMemberDTO.class); + } + /** * 党员信息同步 * @@ -361,6 +381,21 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl= 70) { + entity.setIsMxx(NumConstant.ONE_STR); + } else { + entity.setIsMxx(NumConstant.ZERO_STR); + } + if (StringUtils.isBlank(entity.getIsLd())) { + entity.setIsLd(NumConstant.ZERO_STR); + } + if (StringUtils.isBlank(entity.getIsDyzxh())) { + entity.setIsDyzxh(NumConstant.ZERO_STR); + } + if (StringUtils.isBlank(entity.getIsTx())) { + entity.setIsTx(NumConstant.ZERO_STR); + } //判断党员是否已存在,有则更新,没有则添加 if (null != partyMember) { diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml index 34f4cc1a79..1af1738da2 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -96,6 +96,55 @@ AND (AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )) + + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml index d71cdbd883..21ea480cca 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberDao.xml @@ -51,7 +51,7 @@ a.LDZH, a.PARTY_ZW, a.ADDRESS, - IF( b.PAY_DATE IS NULL, 0, 1 ) AS isPay, + IF( e.MONEY IS NULL, 0, 1 ) AS isPay, b.PAY_DATE, a.CULTURE, a.TOTAL_SCORE AS point, @@ -73,6 +73,8 @@ AND b.CUSTOMER_ID = #{customerId} INNER JOIN ic_party_org d ON a.SSZB = d.ID AND d.DEL_FLAG = 0 + LEFT JOIN ic_party_member_pay_record_detail e ON a.ID = e.PARTY_MEMBER_ID + AND e.DEL_FLAG = 0 AND e.`YEAR` = #{year} AND e.`MONTH` = #{month} WHERE a.DEL_FLAG = 0 AND a.CUSTOMER_ID = #{customerId} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml index aaf0abe2c1..f4898cea8a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPayRecordDetailDao.xml @@ -33,6 +33,7 @@ left join ic_party_org org on org.ID = pm.SSZB and org.DEL_FLAG = 0 where prd.DEL_FLAG = 0 and prd.CUSTOMER_ID = #{customerId} + AND (pm.SSZB = #{orgId} OR pm.ORG_PIDS LIKE concat('%', #{orgId}, '%')) and pm.NAME like concat('%',#{name},'%') @@ -42,9 +43,6 @@ and pm.ID_CARD like concat('%',#{idCard},'%') - - and FIND_IN_SET(#{orgId},pm.ORG_PIDS) - and prd.YEAR = #{year} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml index 3876ddf432..c2b6857a10 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyMemberPointDao.xml @@ -8,6 +8,23 @@ WHERE id = #{partyMemberId} + + UPDATE ic_party_member_point + SET BASE_POINT = #{entity.basePoint}, + BASE_OPTIONS = #{entity.baseOptions}, + REVIEW_POINT = #{entity.reviewPoint}, + REVIEW_OPTIONS = #{entity.reviewOptions}, + INSPIRE_POINT = #{entity.inspirePoint}, + INSPIRE_OPTIONS = #{entity.inspireOptions}, + WARN_POINT = #{entity.warnPoint}, + WARN_OPTIONS = #{entity.warnOptions} + WHERE + DEL_FLAG = '0' + AND PARTY_MEMBER_ID = #{entity.partyMemberId} + AND YEAR = #{entity.year} + AND QUARTER = #{entity.quarter} + AND CUSTOMER_ID = #{entity.customerId} + + - \ No newline at end of file + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java new file mode 100644 index 0000000000..39ee709284 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiUserConfirmDTO.java @@ -0,0 +1,190 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 户籍所在地地区码 + */ + private String hjszdCode; + + /** + * 户籍所在地层级编码 + */ + private String hjszdPathCode; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 现居住地地区码 + */ + private String xjzdCode; + + /** + * 现居住地层级编码 + */ + private String xjzdPathCode; + + /** + * 详细地址 + */ + private String xxdz; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 名族名称 + */ + private String mzName; + + /** + * 与户主关系 + */ + private String yhzgx; + + /** + * 与户主关系名称 + */ + private String yhzgxName; + + /** + * 审核状态0未审核,1审核通过,2审核不通过 + */ + private String confirmResult; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + + /** + * 操作类型:新增add 修改 update 删除 delete + */ + private String submitType; + + /** + * 删除原因 + */ + private String deleteReason; + + /** + * 操作说明 + */ + private String operationDescribe; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java index d8b5c10495..9ebc12d681 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java @@ -142,5 +142,7 @@ public class UserResiInfoDTO implements Serializable { */ private String mobileCode; + private String nickname; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java index decce16f25..99957503cf 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java @@ -24,6 +24,10 @@ public class CollectListFormDTO extends PageFormDTO { */ private String startDate; private String endDate; + /** + * 户籍所在地 + */ + private String domicilePlace; private String userId; private String customerId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 12aff48466..7e7cb6e846 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -49,11 +49,26 @@ public class IcResiCollectMemFormDTO implements Serializable { */ private String domicilePlace; + /** + * 户籍所在地行政地区编码 + */ + private String domicilePlaceCode; + + /** + * 户籍所在地行政地区编码全路径,包含自己,英文逗号隔开例如:37,3702,370203 + */ + private String domicilePlaceCodePath; + /** * 学校或公司 */ private String workPlace; + /** + * 备注 + */ + private String remark; + /** * 社区居民信息登记-查询返参用 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java new file mode 100644 index 0000000000..10e36979f5 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmGetDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 查询家庭成员信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmGetDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java new file mode 100644 index 0000000000..ea119fbd80 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiUserConfirmSubmitDTO.java @@ -0,0 +1,214 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmSubmitDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + private String staffId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 姓 + */ + private String surname; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 户籍所在地地区码 + */ + private String hjszdCode; + + /** + * 户籍所在地层级编码 + */ + private String hjszdPathCode; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 现居住地地区码 + */ + private String xjzdCode; + + /** + * 现居住地层级编码 + */ + private String xjzdPathCode; + + /** + * 详细地址 + */ + private String xxdz; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 名族名称 + */ + private String mzName; + + /** + * 与户主关系 + */ + private String yhzgx; + + /** + * 与户主关系名称 + */ + private String yhzgxName; + + /** + * 审核状态0未审核,1审核通过,2审核不通过 + */ + private String confirmResult; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + + /** + * 操作类型:新增add 修改 update 删除 delete + */ + private String submitType; + + /** + * 删除原因 + */ + private String deleteReason; + + /** + * 操作说明 + */ + private String operationDescribe; + + private String houseCode; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MoveOutMemberFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MoveOutMemberFormDTO.java new file mode 100644 index 0000000000..18bc3cc7c8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MoveOutMemberFormDTO.java @@ -0,0 +1,136 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class MoveOutMemberFormDTO implements Serializable { + + private static final long serialVersionUID = 7059338517023959372L; + + /** + * 客户id + */ + private String customerId; + + /** + * 居民信息ID + */ + private String icResiUserId; + + /** + * 居民所在网格ID + */ + private String gridId; + + /** + * 迁出到网格名 迁出类型为in时必填 + */ + private String gridName; + + /** + * 迁出到小区名 迁出类型为in时必填 + */ + private String villageName; + + /** + * 迁出到楼栋名 迁出类型为in时必填 + */ + private String buildName; + + /** + * 迁出到单元名 迁出类型为in时必填 + */ + private String unitName; + + /** + * 迁出到房屋名 迁出类型为in时必填 + */ + private String homeName; + + /** + * 外迁详细地址 迁出类型为out时必填 + */ + private String xxdz; + + /** + * 迁出类型 迁出客户外out 迁出客户内in + */ + private String submitType; + + /** + * 迁出原因 + */ + private String deleteReason; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 房屋ID + */ + private String houseId; + + /** + * 名字 + */ + private String allName; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 民族 + */ + private String mz; + + /** + * 与户主关系 + */ + private String yhzgx; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java new file mode 100644 index 0000000000..5869490ead --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RegisterAndBindFormDTO.java @@ -0,0 +1,70 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/1 9:39 + */ +@NoArgsConstructor +@Data +public class RegisterAndBindFormDTO implements Serializable { + + private static final long serialVersionUID = 7068763631425911170L; + private String customerId; + private String userId; + /** + * 姓 + */ + private String surname; + /** + * 名 + */ + private String name; + /** + * 昵称 + */ + private String nickname; + /** + * 头像 + */ + private String headImgUrl; + /** + * 身份证 + */ + private String idCard; + /** + * 手机号 + */ + private String mobile; + /** + * 网格 + */ + private String gridId; + /** + * 小区 + */ + private String villageId; + /** + * 楼栋 + */ + private String buildId; + /** + * 单元 + */ + private String unitId; + /** + * 房屋 + */ + private String homeId; + /** + * 路牌号 + */ + private String address; + + private String visitId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java index 9778cb6a17..75bc3b1c69 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ResiCollectFormDTO.java @@ -86,9 +86,9 @@ public class ResiCollectFormDTO implements Serializable { private String address; /** - * 1自有0租住 + * 房屋状态与ic_house表的RENT_FLAG一致取值1:出租 0:自住 2:闲置 3:未售出 */ - @NotBlank(message = "房子属于自有还是租住?", groups = {InternalShowGroup.class}) + @NotBlank(message = "房子状态不能为空", groups = {InternalShowGroup.class}) private String houseType; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java index 14675f3046..ff71263f95 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java @@ -29,5 +29,9 @@ public class UserChartFormDTO implements Serializable { //token这信息 private String customerId; private String userId; + //无效组织Id集合 + private List agencyIdList; + //无效网格Id集合 + private List gridIdList; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java index b98e4489bd..04a34bb814 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java @@ -31,8 +31,9 @@ public class CollectListExcelResultDTO implements Serializable { /** * 房屋类型,1:自有, 0:租住 + * 房屋状态1:出租 0:自住 2:闲置 3:未售出 */ - @Excel(name = "房屋类型",replace = { "自有_1", "租住_0"}, width = 30, needMerge = true) + @Excel(name = "房屋状态",replace = { "出租_1", "自住_0","闲置_2","未售出_3"}, width = 30, needMerge = true) private String houseType; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java index 34efe5d146..85208ba924 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java @@ -56,4 +56,10 @@ public class CollectListMemberExcelResultDTO implements Serializable { */ @Excel(name = "单位或学校", width = 60) private String workPlace; + + /** + * 备注 + */ + @Excel(name = "备注", width = 60) + private String remark; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java index f4bd2a1886..0fcaa480d4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -38,6 +39,8 @@ public class CollectListResultDTO implements Serializable { */ private Integer totalResi; + private String domicilePlace; + private List list; @@ -73,10 +76,24 @@ public class CollectListResultDTO implements Serializable { */ private String domicilePlace; + /** + * 户籍所在地行政地区编码 + */ + private String domicilePlaceCode; + + /** + * 户籍所在地行政地区编码全路径,包含自己,英文逗号隔开例如:37,3702,370203 + */ + private String domicilePlaceCodePath; + /** * 学校或公司 */ private String workPlace; + /** + * 备注 + */ + private String remark; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java index bbdba74e4b..0cd96df6cf 100755 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleTemplateDTO.java @@ -67,7 +67,7 @@ public class GovStaffRoleTemplateDTO implements Serializable { /** * 排序 */ - private String sort; + private Integer sort; /** * diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java new file mode 100644 index 0000000000..e890aa3092 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/6/1 16:49 + */ +@NoArgsConstructor +@Data +public class HomeInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -6109420020924607393L; + private String icResiUserId; + private String houseId; + private String houseName; + private String houseCode; + private String qrCodeUrl; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java new file mode 100644 index 0000000000..97cc70ea11 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcUserRoleResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 9:44 + */ +@Data +public class IcUserRoleResultDTO implements Serializable { + private static final long serialVersionUID = 6755574567711827403L; + /** + * 是否是志愿者0否,1是 + */ + private String isVolunteer; + /** + * 是否是党员0否,1是 + */ + private String isPartyMember; + + private Map>> detail; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java index 01741a9275..d14ec7a0bf 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java @@ -100,7 +100,7 @@ public class UserBaseInfoResultDTO implements Serializable { /** * 微信基本信息 */ - private UserWechatResultDTO userWechatResultDTO; + // private UserWechatResultDTO userWechatResultDTO; /** * xxx街道-尹女士 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index e5952a2726..90b0359881 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; @@ -806,4 +807,13 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/icVolunteerPoly/volunteerDataExtraction/{customerId}") Result volunteerDataExtraction(@PathVariable("customerId") String customerId); + + @PostMapping("/epmetuser/myHome/homeInfo") + Result getHomeInfo(); + + @PostMapping("/epmetuser/icresiuser/getVolunteerList") + Result> getVolunteerList(@RequestBody IcResiUserDTO formDTO); + + @PostMapping("/epmetuser/icresiuser/getUserId/{icUserId}") + Result> getUserId(@PathVariable("icUserId") String icUserId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 404ba7d0c3..55083de3a2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -1,6 +1,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; @@ -595,4 +596,19 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "volunteerDataExtraction", customerId); } + @Override + public Result getHomeInfo() { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeInfo"); + } + + @Override + public Result> getVolunteerList(IcResiUserDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getVolunteerList", formDTO); + } + + @Override + public Result> getUserId(String icUserId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserId", icUserId); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java new file mode 100644 index 0000000000..fc1e27a907 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserConfirmController.java @@ -0,0 +1,95 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcResiUserConfirmDTO; +import com.epmet.excel.IcResiUserConfirmExcel; +import com.epmet.service.IcResiUserConfirmService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@RestController +@RequestMapping("icResiUserConfirm") +public class IcResiUserConfirmController { + + @Autowired + private IcResiUserConfirmService icResiUserConfirmService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icResiUserConfirmService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcResiUserConfirmDTO data = icResiUserConfirmService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcResiUserConfirmDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icResiUserConfirmService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcResiUserConfirmDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icResiUserConfirmService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icResiUserConfirmService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = icResiUserConfirmService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, IcResiUserConfirmExcel.class); + } + + + /** + * 审核 + * + * @Param tokenDto + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/1 17:26 + */ + @PostMapping("confirm") + public Result confirm(@RequestBody IcResiUserConfirmDTO dto) { + icResiUserConfirmService.confirm(dto); + return new Result(); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index c1f669535e..b166ceca92 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -53,6 +53,7 @@ import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.PartyMemberAgeExportExcel; import com.epmet.excel.PartyMemberEducationExportExcel; @@ -226,14 +227,15 @@ public class IcResiUserController implements ResultDataResolver { /** * desc:发送 志愿者变动消息 + * * @param customerId * @param resiUserId */ private void sendVolunteerMsg(String customerId, String resiUserId) { //发送志愿者人员消息变动 boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendRocketMqMsg(SystemMessageType.VOLUNTEER_CHANGED, new MqBaseFormDTO(customerId, resiUserId)); - if (!flag){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"发送志愿者变动消息失败","发送志愿者变动消息失败"); + if (!flag) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "发送志愿者变动消息失败", "发送志愿者变动消息失败"); } } @@ -261,13 +263,13 @@ public class IcResiUserController implements ResultDataResolver { */ @NoRepeatSubmit @PostMapping("changeIcResiUserBelongTo") - Result changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO){ + Result changeIcResiUserBelongTo(@LoginUser TokenDto tokenDto, @RequestBody IcUserBelongToChangedFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(formDTO); - List changedUserIds = icResiUserService.changeIcResiUserBelongTo(tokenDto,formDTO); + List changedUserIds = icResiUserService.changeIcResiUserBelongTo(tokenDto, formDTO); //推送MQ事件 - if (CollectionUtils.isNotEmpty(changedUserIds)){ - changedUserIds.forEach(resiUserId->editResiMq(tokenDto.getCustomerId(), resiUserId)); + if (CollectionUtils.isNotEmpty(changedUserIds)) { + changedUserIds.forEach(resiUserId -> editResiMq(tokenDto.getCustomerId(), resiUserId)); } return new Result().ok(true); @@ -497,7 +499,7 @@ public class IcResiUserController implements ResultDataResolver { * @return void * @author LiuJanJun * @date 2021/11/19 4:24 下午 - * @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx, + * @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx, * 如果某个客户需要更新模版 则替换掉上面的模版文件;然后 更新缓存里的值或者删除也行 再导出就会下载新的模版了 */ @NoRepeatSubmit @@ -506,22 +508,23 @@ public class IcResiUserController implements ResultDataResolver { try { //获取导出配置 String aDefault = tokenDto.getCustomerId().concat(StrConstant.UNDER_LINE).concat("default"); - if (pageFormDTO.getTemplateId().equals(aDefault)){ + if (pageFormDTO.getTemplateId().equals(aDefault)) { log.info("通过原来的模板下载,tokenDto:{}", JSON.toJSONString(tokenDto)); - this.exportExcelByEasyExcel(tokenDto,pageFormDTO.getSearchForm(),response); - }else{ - icResiUserExportService.exportIcResiUser(tokenDto,pageFormDTO,response); + this.exportExcelByEasyExcel(tokenDto, pageFormDTO.getSearchForm(), response); + } else { + icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, response); } } catch (EpmetException e) { response.reset(); response.setCharacterEncoding("UTF-8"); response.setHeader("content-type", "application/json; charset=UTF-8"); PrintWriter printWriter = response.getWriter(); - Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg()); printWriter.write(JSON.toJSONString(result)); printWriter.close(); } } + /** * desc:根据客户id 先从oss下载模版,如果有没有则使用系统默认模板 如果不存在则返回null * @@ -725,7 +728,7 @@ public class IcResiUserController implements ResultDataResolver { * 新增需求,需求人列表:展示当前工作人员所属组织+页面已选择所属网格 下的居民列 */ @PostMapping("demandusers") - public Result> queryDemandUsers(@LoginUser TokenDto tokenDto,@RequestBody DemandUserFormDTO formDTO) { + public Result> queryDemandUsers(@LoginUser TokenDto tokenDto, @RequestBody DemandUserFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class); @@ -992,8 +995,8 @@ public class IcResiUserController implements ResultDataResolver { * @date 2022/1/17 4:25 下午 */ @PostMapping("personwarn/rightlist") - @MaskResponse(fieldNames = "mobile", fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE }) - public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + @MaskResponse(fieldNames = "mobile", fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) + public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class); return new Result().ok(icResiUserService.personWarnRightList(formDTO, tokenDto)); } @@ -1048,6 +1051,7 @@ public class IcResiUserController implements ResultDataResolver { /** * 根据房屋id,查询居民信息表中-家庭信息-本人 的居民。如果有多个,返回最近一个 + * * @param homeId * @param loginUser * @return @@ -1074,6 +1078,7 @@ public class IcResiUserController implements ResultDataResolver { /** * desc:条件获取房屋内的居民 按房屋分组 + * * @param formDTO * @return */ @@ -1084,6 +1089,7 @@ public class IcResiUserController implements ResultDataResolver { /** * 使用身份证号查询家属信息 + * * @param idCard * @return */ @@ -1095,6 +1101,7 @@ public class IcResiUserController implements ResultDataResolver { /** * 身份证号查询居民信息 + * * @param idCard * @return */ @@ -1157,10 +1164,51 @@ public class IcResiUserController implements ResultDataResolver { * @date 2022/6/22 16:29 */ @PostMapping("/bindHome") - public Result bindHome(@RequestBody BindHomeFormDTO form,@LoginUser TokenDto tokenDto){ + public Result bindHome(@RequestBody BindHomeFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); form.setCustomerId(tokenDto.getCustomerId()); icResiUserService.bindHome(form); return new Result(); } + + /** + * 根据身份证获取居民角色(目前只有是否是志愿者) + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/5/31 9:47 + */ + @PostMapping("getUserRoleByIdCard") + public Result getUserRoleByIdCard(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(icResiUserService.getUserRoleByIdCard(formDTO)); + } + + /** + * 获取组织下的志愿者 + * + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/16 15:22 + */ + @PostMapping("getVolunteerList") + public Result> getVolunteerList(@RequestBody IcResiUserDTO formDTO) { + return new Result>().ok(icResiUserService.getVolunteerList(formDTO.getCustomerId(), formDTO.getAgencyId())); + } + + /** + * 获取居民信息对应的居民用户ID + * + * @Param icUserId + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2022/6/16 15:40 + */ + @PostMapping("getUserId/{icUserId}") + public Result> getUserId(@PathVariable("icUserId") String icUserId) { + return new Result>().ok(icResiUserService.getUserId(icUserId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java new file mode 100644 index 0000000000..0e595cc96f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/MyHomeController.java @@ -0,0 +1,198 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.enums.HomeMemberOperationEnum; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +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.dto.IcResiUserConfirmDTO; +import com.epmet.dto.form.IcResiUserConfirmGetDTO; +import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; +import com.epmet.dto.form.MoveOutMemberFormDTO; +import com.epmet.dto.form.RegisterAndBindFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.HomeUserBriefResultDTO; +import com.epmet.service.IcResiUserConfirmService; +import com.epmet.service.IcResiUserService; +import com.epmet.service.MyHomeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 16:20 + */ +@Slf4j +@RestController +@RequestMapping("myHome") +public class MyHomeController { + + @Autowired + private MyHomeService myHomeService; + + @Autowired + private IcResiUserConfirmService icResiUserConfirmService; + + @Autowired + private IcResiUserService icResiUserService; + + + @MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE}) + @PostMapping("memberList/{houseCode}") + public Result> selectListHomeMember(@PathVariable("houseCode") String houseCode, @LoginUser TokenDto tokenDto) { + return new Result().ok(myHomeService.selectListHomeMember(houseCode, tokenDto.getCustomerId())); + } + + +// /** +// * @describe: 新增家庭成员 +// * @author wangtong +// * @date 2022/6/1 15:50 +// * @params [dto] +// * @return com.epmet.commons.tools.utils.Result +// */ +// @PostMapping("addMember") +// public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto){ +// //效验数据 +// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); +// dto.setSubmitType(HomeMemberOperationEnum.ADD.getCode()); +// return icResiUserConfirmService.addMember(dto); +// } +// +// /** +// * @describe: 修改家庭成员 +// * @author wangtong +// * @date 2022/6/1 15:27 +// * @params [dto] +// * @return com.epmet.commons.tools.utils.Result +// */ +// @PostMapping("editMember") +// public Result save(@RequestBody IcResiUserConfirmSubmitDTO dto){ +// //效验数据 +// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); +// dto.setSubmitType(HomeMemberOperationEnum.UPDATE.getCode()); +// return icResiUserConfirmService.editMember(dto); +// } +// + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 删除家庭成员 + * @author wangtong + * @date 2022/6/1 16:10 + * @params [dto] + */ + @PostMapping("delMember") + public Result delMember(@RequestBody IcResiUserConfirmSubmitDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setSubmitType(HomeMemberOperationEnum.DELETE.getCode()); + return icResiUserConfirmService.delMember(dto); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:50 + * @params [dto] + */ + @PostMapping("addMember") + public Result addMember(@RequestBody IcResiUserConfirmSubmitDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icResiUserService.addMember(dto); + } + + /** + * @describe: 工作端-新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:50 + * @params [dto] + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("addWorkMember") + public Result addWorkMember(@LoginUser TokenDto tokenDto,@RequestBody IcResiUserConfirmSubmitDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setStaffId(tokenDto.getUserId()); + return icResiUserService.addWorkMember(dto); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 修改家庭成员 + * @author wangtong + * @date 2022/6/1 15:27 + * @params [dto] + */ + @PostMapping("editMember") + public Result editMember(@RequestBody IcResiUserConfirmSubmitDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icResiUserService.editMember(dto); + } + + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 查询家庭成员信息 + * @author wangtong + * @date 2022/6/1 16:14 + * @params [dto] + */ + @PostMapping("getMemberDetail") + public Result getMemberDetail(@RequestBody IcResiUserConfirmGetDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return icResiUserConfirmService.getMemberDetail(dto); + } + + /** + * 注册绑定家庭信息 + * + * @Param tokenDto + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2022/6/1 10:26 + */ + @PostMapping("registerAndBind") + public Result registerAndBind(@LoginUser TokenDto tokenDto, @RequestBody RegisterAndBindFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + myHomeService.registerAndBind(formDTO); + return new Result(); + } + + @PostMapping("homeInfo") + public Result getHomeInfo(@LoginUser TokenDto tokenDto) { + HomeInfoResultDTO result = myHomeService.getHomeInfo(tokenDto); + return new Result().ok(result); + } + + /** + * 【我的家庭】迁出家庭成员 + * + * @param form + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/6/10 11:06 + */ + @PostMapping("/moveOutMember") + public Result moveOutMember(@RequestBody MoveOutMemberFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + icResiUserConfirmService.moveOutMember(form); + return new Result(); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index adc98f7a08..a60efed8cc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -19,6 +19,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -215,5 +216,10 @@ public class UserBaseInfoController { public Result resiRelationInfo(@RequestParam("userId")String userId){ return new Result().ok(userBaseInfoService.resiRelationInfo(userId)); } + + @PostMapping("getUserInfo/{userId}") + public Result getUserInfo(@PathVariable("userId") String userId){ + return new Result().ok(userBaseInfoService.getUserInfo(userId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index f877b1e50b..725a456b46 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -127,7 +127,9 @@ public interface CustomerStaffDao extends BaseDao { * @Author sun * @Description 根据staffId集合查询工作人员基础信息 **/ - List selectStaffByIds(@Param("staffIdList") List staffIdList); + List selectStaffByIds(@Param("staffIdList") List staffIdList, + @Param("enableFlag") String enableFlag); + /** * @param staffId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java index 547ef63ca8..db8eb3db7c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiCollectDao.java @@ -34,6 +34,8 @@ public interface IcResiCollectDao extends BaseDao { */ List getCollectList(CollectListFormDTO formDTO); + List selectMemberList(@Param("id") String id, @Param("domicilePlace") String domicilePlace); + /** * 我上次提交的主表记录 * @param customerId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java new file mode 100644 index 0000000000..03704abd4b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserConfirmDao.java @@ -0,0 +1,51 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcResiUserConfirmEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Mapper +public interface IcResiUserConfirmDao extends BaseDao { + + /** + * @return com.epmet.entity.IcResiUserConfirmEntity + * @describe: 根据icResiUserId查询 + * @author wangtong + * @date 2022/6/1 16:01 + * @params [icResiUserId] + */ + IcResiUserConfirmEntity selectByIcResiUserId(@Param("icResiUserId") String icResiUserId); + + /** + * 【我的家庭】迁出家庭成员 根据身份证号查询是否已提交 + * + * @param idCard + * @param customerId + * @param submitType + * @return int + * @author LZN + * @date 2022/6/10 11:04 + */ + int selectByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId, + @Param("submitType") String submitType); + + /** + * 【我的家庭】迁出家庭成员 先删后添 + * + * @param idCard + * @param customerId + * @param submitType + * @return void + * @author LZN + * @date 2022/6/10 11:04 + */ + void deleteByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId, + @Param("submitType") String submitType); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index fcb114c437..1fca7a2582 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -19,9 +19,11 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.dto.IcResiUserConfirmDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.EpidemicPreventionFormDTO; +import com.epmet.dto.form.MoveOutMemberFormDTO; import com.epmet.dto.form.RentTenantDataFormDTO; import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.result.*; @@ -50,6 +52,12 @@ public interface IcResiUserDao extends BaseDao { **/ void add(@Param("tableName") String tableName, @Param("map") Map map); + /** + * @Author sun + * @Description 居民信息修改先删除字表可能存在的数据 + **/ + void del(@Param("tableName") String tableName, @Param("resiUserId") String resiUserId); + /** * @Author sun * @Description 更新或新增居民信息各表数据 @@ -302,7 +310,7 @@ public interface IcResiUserDao extends BaseDao { IcResiUserEntity selectResiNoDelFlag(@Param("icResiUserId") String icResiUserId); - List userChart(@Param("orgId") String orgId, @Param("orgType") String orgType); + List userChart(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("agencyIdList") List agencyIdList, @Param("gridIdList") List gridIdList); /** * desc:根据维度获取居民信息表的数据[正常状态的居民] @@ -364,4 +372,33 @@ public interface IcResiUserDao extends BaseDao { String seletIdByIdCard(@Param("customerId") String customerId, @Param("idCard") String idCard); + /** + * @return com.epmet.dto.IcResiUserConfirmDTO + * @describe: 查询家庭成员信息 + * @author wangtong + * @date 2022/6/1 16:16 + * @params [icResiUserId] + */ + IcResiUserConfirmDTO selectMemberDetail(@Param("icResiUserId") String icResiUserId); + + /** + * 【我的家庭】迁出家庭成员 查询缺失字段 + * + * @param icResiUserId + * @param customerId + * @return com.epmet.dto.form.MoveOutMemberFormDTO + * @author LZN + * @date 2022/6/10 11:03 + */ + MoveOutMemberFormDTO moveOutMember(@Param("icResiUserId") String icResiUserId, + @Param("customerId") String customerId); + + /** + * @return com.epmet.entity.IcResiUserEntity + * @describe: 通过身份证号查询实体类 + * @author wangtong + * @date 2022/6/13 17:32 + * @params [idCard, customerId] + */ + IcResiUserEntity selectResiUserEntityByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java index 8b6a20d87b..3b4b8ac3e0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiCollectEntity.java @@ -69,7 +69,7 @@ public class IcResiCollectEntity extends BaseEpmetEntity { private String address; /** - * 1自由0租住 + * 房屋状态与ic_house表的RENT_FLAG一致取值1:出租 0:自住 2:闲置 3:未售出 */ private String houseType; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java index b93190e5c5..583663a1a1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiMemberEntity.java @@ -58,8 +58,23 @@ public class IcResiMemberEntity extends BaseEpmetEntity { */ private String domicilePlace; + /** + * 户籍所在地行政地区编码 + */ + private String domicilePlaceCode; + + /** + * 户籍所在地行政地区编码全路径,包含自己,英文逗号隔开例如:37,3702,370203 + */ + private String domicilePlaceCodePath; + /** * 学校或公司 */ private String workPlace; + + /** + * 备注 + */ + private String remark; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java new file mode 100644 index 0000000000..5c06a854e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserConfirmEntity.java @@ -0,0 +1,157 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_resi_user_confirm") +public class IcResiUserConfirmEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 组织的pids + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 户籍所在地地区码 + */ + private String hjszdCode; + + /** + * 户籍所在地层级编码 + */ + private String hjszdPathCode; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 现居住地地区码 + */ + private String xjzdCode; + + /** + * 现居住地层级编码 + */ + private String xjzdPathCode; + + /** + * 详细地址 + */ + private String xxdz; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 名族名称 + */ + private String mzName; + + /** + * 与户主关系 + */ + private String yhzgx; + + /** + * 与户主关系名称 + */ + private String yhzgxName; + + /** + * 审核状态0未审核,1审核通过,2审核不通过 + */ + private String confirmResult; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * ic_resi_user表id + */ + private String icResiUserId; + + /** + * 操作类型:新增add 修改 update 删除 delete + */ + private String submitType; + + /** + * 删除原因 + */ + private String deleteReason; + + /** + * 操作说明 + */ + private String operationDescribe; + +} + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java new file mode 100644 index 0000000000..be302d0a35 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiUserConfirmExcel.java @@ -0,0 +1,105 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Data +public class IcResiUserConfirmExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id customer.id") + private String customerId; + + @Excel(name = "组织Id") + private String agencyId; + + @Excel(name = "组织的pids") + private String pids; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "姓") + private String surname; + + @Excel(name = "名") + private String name; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "性别") + private String gender; + + @Excel(name = "身份证号") + private String idCard; + + @Excel(name = "出生日期") + private String birthday; + + @Excel(name = "户籍所在地地区码") + private String hjszdCode; + + @Excel(name = "户籍所在地") + private String hjszd; + + @Excel(name = "现居住地地区码") + private String xjzdCode; + + @Excel(name = "现居住地") + private String xjzd; + + @Excel(name = "民族【字典表】") + private String mz; + + @Excel(name = "与户主关系") + private String yhzgx; + + @Excel(name = "审核状态0未审核,1审核通过,2审核不通过") + private String confirmResult; + + @Excel(name = "审核不通过的原因") + private String reason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "ic_resi_user表id") + private String icUserId; + + @Excel(name = "操作类型:新增add 修改 update 删除 delete") + private String submitType; + + @Excel(name = "删除原因") + private String deleteReason; + + @Excel(name = "操作说明") + private String operationDescribe; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java new file mode 100644 index 0000000000..7d94a32386 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/IcResiUserConfirmRedis.java @@ -0,0 +1,30 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Component +public class IcResiUserConfirmRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java new file mode 100644 index 0000000000..202964eca1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserConfirmService.java @@ -0,0 +1,138 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcResiUserConfirmDTO; +import com.epmet.dto.form.IcResiUserConfirmGetDTO; +import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; +import com.epmet.dto.form.MoveOutMemberFormDTO; +import com.epmet.entity.IcResiUserConfirmEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +public interface IcResiUserConfirmService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-06-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-06-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcResiUserConfirmDTO + * @author generator + * @date 2022-06-01 + */ + IcResiUserConfirmDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void save(IcResiUserConfirmDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-06-01 + */ + void update(IcResiUserConfirmDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-06-01 + */ + void delete(String[] ids); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:30 + * @params [dto] + */ + Result editMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/1 15:50 + * @params [dto] + */ + Result addMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 删除家庭成员 + * @author wangtong + * @date 2022/6/1 16:11 + * @params [dto] + */ + Result delMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 查询家庭成员信息 + * @author wangtong + * @date 2022/6/1 16:15 + * @params [dto] + */ + Result getMemberDetail(IcResiUserConfirmGetDTO dto); + + /** + * 审核 + * + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 17:27 + */ + void confirm(IcResiUserConfirmDTO dto); + + /** + * 【我的家庭】迁出家庭成员 + * + * @param form + * @return void + * @author LZN + * @date 2022/6/10 11:06 + */ + void moveOutMember(MoveOutMemberFormDTO form); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 9c22fa648b..92b38e3f9a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -21,9 +21,11 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcResiUserEntity; import com.epmet.excel.support.ExportResiUserItemDTO; import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO; @@ -89,17 +91,17 @@ public interface IcResiUserService extends BaseService { String staffOrgPath); /** - * @Description 查询个人数据 * @param formDTO + * @Description 查询个人数据 * @author zxc * @date 2021/11/3 9:21 上午 */ PersonDataResultDTO personData(PersonDataFormDTO formDTO); /** - * @Description 根据名字搜索 * @param formDTO * @Description 根据名字搜索 + * @Description 根据名字搜索 * @author zxc * @date 2021/11/3 1:42 下午 */ @@ -278,7 +280,7 @@ public interface IcResiUserService extends BaseService { */ List listHomeUserBrief(String houseId, String customerId); - List> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List showSqlColumns, List conditions, String agencyId, String finalStaffOrgPath); + List> dynamicQuery(String loginUserCustomerId, String formCode, String icResiUser, List showSqlColumns, List conditions, String agencyId, String finalStaffOrgPath); /** * 租客房东黑名单查询个人数据 @@ -331,8 +333,10 @@ public interface IcResiUserService extends BaseService { * @return */ SyncResiResDTO checkUser(String customerId, String idCard, String agencyId); + /** * desc:条件获取居民基础信息 + * * @param formDTO * @return */ @@ -384,4 +388,62 @@ public interface IcResiUserService extends BaseService { * @date 2022/6/22 16:30 */ void bindHome(BindHomeFormDTO form); + + /** + * 根据身份证获取居民角色(目前只有是否是志愿者) + * + * @Param formDTO + * @Return {@link IcUserRoleResultDTO} + * @Author zhaoqifeng + * @Date 2022/5/31 9:50 + */ + IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 新增家庭成员 + * @author wangtong + * @date 2022/6/6 10:36 + * @params [dto] + */ + Result addMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 修改家庭成员 + * @author wangtong + * @date 2022/6/6 10:36 + * @params [dto] + */ + Result editMember(IcResiUserConfirmSubmitDTO dto); + + /** + * @return com.epmet.commons.tools.utils.Result + * @describe: 工作端-新增家庭成员 + * @author wangtong + * @date 2022/6/10 13:32 + * @params [dto] + */ + Result addWorkMember(IcResiUserConfirmSubmitDTO dto); + + /** + * 获取组织下志愿者列表 + * + * @Param customerId 客户 + * @Param agencyId 组织 + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/6/16 14:58 + */ + List getVolunteerList(String customerId, String agencyId); + + /** + * 获取居民信息对应的居民用户ID + * + * @Param icResiUserId + * @Return {@link String} + * @Author zhaoqifeng + * @Date 2022/6/16 15:30 + */ + List getUserId(String icResiUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java new file mode 100644 index 0000000000..0d1667b03d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/MyHomeService.java @@ -0,0 +1,46 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.RegisterAndBindFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.HomeUserBriefResultDTO; + +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 16:21 + */ +public interface MyHomeService { + /** + * 注册绑定房屋信息 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 16:33 + */ + void registerAndBind(RegisterAndBindFormDTO formDTO); + + /** + * 获取用户绑定的房屋信息 + * + * @Param tokenDto + * @Return {@link HomeInfoResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/1 16:52 + */ + HomeInfoResultDTO getHomeInfo(TokenDto tokenDto); + + /** + * 查询家庭成员 + * + * @param houseCode 房屋编码 + * @param customerId + * @return java.util.List + * @author work@yujt.net.cn + * @date 2022/6/1/0001 16:12 + */ + List selectListHomeMember(String houseCode, String customerId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index 01bac74fc2..f66453c243 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; @@ -203,4 +204,13 @@ public interface UserBaseInfoService extends BaseService { * @date 2021/12/30 3:12 下午 */ RegisterRelationDTO resiRelationInfo(String userId); + + /** + * 获取用户缓存信息 + * @Param userId + * @Return {@link UserBaseInfoResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/15 16:09 + */ + ResiUserInfoCache getUserInfo(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 0d768140d9..024d3aed37 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -22,10 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.constant.*; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -36,7 +33,6 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerStaffConstant; import com.epmet.constant.RoleKeyConstants; @@ -53,7 +49,6 @@ import com.epmet.entity.GovStaffRoleEntity; import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; import com.epmet.feign.AuthFeignClient; -import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.CustomerStaffService; @@ -82,550 +77,545 @@ import java.util.stream.Collectors; @Slf4j @Service public class CustomerStaffServiceImpl extends BaseServiceImpl implements CustomerStaffService { - private final Logger logger = LogManager.getLogger(getClass()); - @Autowired - private GovStaffRoleService govStaffRoleService; - @Autowired - private UserService userService; - @Autowired - private StaffRoleService staffRoleService; - @Autowired - private StaffRoleDao staffRoleDao; - @Autowired - private CpUserDetailRedis cpUserDetailRedis; - @Autowired - private AuthFeignClient authFeignClient; - @Autowired - private GovOrgOpenFeignClient govOrgOpenFeignClient; - @Autowired - private CustomerStaffDao customerStaffDao; - @Autowired - private GovStaffRoleDao govStaffRoleDao; + private final Logger logger = LogManager.getLogger(getClass()); @Autowired - private OperCrmOpenFeignClient operCrmOpenFeignClient; + private GovStaffRoleService govStaffRoleService; @Autowired - private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerStaffDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerStaffDTO.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 CustomerStaffDTO get(String id) { - CustomerStaffEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerStaffDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerStaffDTO dto) { - CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerStaffDTO dto) { - CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - @Override - public Result> getCustsomerStaffByPhone(String mobile) { - //判断用户是否存在 - List customerStaffDTOList = baseDao.selectListCustomerStaffDTO(mobile); - if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { - logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); - } - return new Result>().ok(customerStaffDTOList); - } + private UserService userService; + @Autowired + private StaffRoleService staffRoleService; + @Autowired + private StaffRoleDao staffRoleDao; + @Autowired + private AuthFeignClient authFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private GovStaffRoleDao govStaffRoleDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerStaffDTO.class); + } - @Override - public Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { - CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); - if (null == customerStaffDTO) { - logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); - } - //判断用户是否已被禁用 - if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { - logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); - return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); - } - return new Result().ok(customerStaffDTO); - } - - @Override - public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { - CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO); - return new Result().ok(customerStaffDTO); - } - - @Override - public Result> selectStaffGridListByUserId(List customerStaffGridDTOS) { - if (CollectionUtils.isEmpty(customerStaffGridDTOS)){ - return new Result>().ok(new ArrayList<>()); - } - List gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); - List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); - for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { - if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)){ - for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { - if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())){ - staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); - } - } - } - } - return new Result>().ok(staffGridListDTOS); - } - - @Override - public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { - List list = baseDao.selectCustomerStaffList(fromDTO); - if (null == list) { - list = new ArrayList<>(); - } - return new Result>().ok(list); - } - - @Override - public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { - List list = baseDao.selectStaffList(fromDTO); - if (null == list) { - list = new ArrayList<>(); - } - if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { - Map> map = govStaffRoleService.getStaffRoles(fromDTO.getStaffList(), fromDTO.getAgencyId()); - list.forEach(item -> { - item.setRoles(map.get(item.getStaffId())); - }); - } - return new Result>().ok(list); - } + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); - @Override - public Result> addStaffInit(StaffInfoFromDTO fromDTO) { - GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); - govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); - List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + return ConvertUtils.sourceToTarget(entityList, CustomerStaffDTO.class); + } - if (null == roleList || roleList.size() == 0) { - return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); - } - List staffRoleList = roleList.stream() - .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) - .map(p -> { - RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO(); - staffRoleResultDTO.setRoleId(p.getId()); - staffRoleResultDTO.setRoleName(p.getRoleName()); - staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); - staffRoleResultDTO.setDescription(p.getDescription()); - return staffRoleResultDTO; - }).collect(Collectors.toList()); - return new Result>().ok(staffRoleList); - } - - @Override - public Result editStaffInit(StaffInfoFromDTO fromDTO) { - StaffInitResultDTO resultDTO = new StaffInitResultDTO(); - //获取工作人员信息 - CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); - if (null == customerStaffDTO) { - log.warn("工作人员不存在"); - } - resultDTO.setStaffId(customerStaffDTO.getUserId()); - resultDTO.setName(customerStaffDTO.getRealName()); - resultDTO.setGender(customerStaffDTO.getGender()); - resultDTO.setMobile(customerStaffDTO.getMobile()); - resultDTO.setWorkType(customerStaffDTO.getWorkType()); - //获取角色列表 - GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); - govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); - List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); - //获取工作人员角色 - List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); - List staffRoleList = roleList - .stream() - .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) - .map(p -> { - StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); - staffRoleResultDTO.setRoleId(p.getId()); - staffRoleResultDTO.setRoleName(p.getRoleName()); - staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); - staffRoleResultDTO.setDescription(p.getDescription()); - staffRoleResultDTO.setSelected(false); - return staffRoleResultDTO; - }).collect(Collectors.toList()); - - staffRoleList.forEach(role -> staffRoles.forEach(staffRole -> { - if (role.getRoleId().equals(staffRole.getId())) { - role.setSelected(true); - } - })); - resultDTO.setRoleList(staffRoleList); - - return new Result().ok(resultDTO); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result addStaff(StaffSubmitFromDTO fromDTO) { - CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); - customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); - customerStaffFormDTO.setMobile(fromDTO.getMobile()); - CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); - if (null != customerStaffDTO) { - return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); - } - //USER表插入数据 - UserEntity userEntity = new UserEntity(); - userEntity.setFromApp(fromDTO.getApp()); - userEntity.setFromClient(fromDTO.getClient()); - userEntity.setCustomerId(fromDTO.getCustomerId()); - userService.insert(userEntity); - //Customer_Staff表插入数据 - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setCustomerId(fromDTO.getCustomerId()); - staffEntity.setUserId(userEntity.getId()); - staffEntity.setRealName(fromDTO.getName()); - staffEntity.setMobile(fromDTO.getMobile()); - staffEntity.setActiveFlag(CustomerStaffConstant.INACTIVE); - staffEntity.setGender(fromDTO.getGender()); - staffEntity.setWorkType(fromDTO.getWorkType()); - staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); - baseDao.insert(staffEntity); - - //工作人员角色关联表 - fromDTO.getRoles().forEach(role -> { - StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); - staffRoleEntity.setStaffId(userEntity.getId()); - staffRoleEntity.setRoleId(role); - staffRoleEntity.setOrgId(fromDTO.getAgencyId()); - staffRoleEntity.setCustomerId(fromDTO.getCustomerId()); - staffRoleService.insert(staffRoleEntity); - }); - - // 角色放缓存 - CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); - List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setStaffId(userEntity.getId()); - dto.setAgencyId(fromDTO.getAgencyId()); - Map m = new HashMap(16); - roleKeyValue.forEach(r -> { - m.put(r.getRoleKey(),r.getRoleName()); - }); - dto.setRoles(m); - CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); - - return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public Result editStaff(StaffSubmitFromDTO fromDTO) { - CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); - customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); - customerStaffFormDTO.setMobile(fromDTO.getMobile()); - CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); - if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())){ - return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); - } + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); - CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); - //Customer_Staff表插入数据 - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setId(customerStaffEntity.getId()); - staffEntity.setRealName(fromDTO.getName()); - staffEntity.setMobile(fromDTO.getMobile()); - staffEntity.setGender(fromDTO.getGender()); - staffEntity.setWorkType(fromDTO.getWorkType()); - baseDao.updateById(staffEntity); - - //清空权限关联 - StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); - staffRoleDTO.setStaffId(fromDTO.getStaffId()); - staffRoleDTO.setOrgId(fromDTO.getAgencyId()); - staffRoleService.clearStaffRoles(staffRoleDTO); - //重新添加角色关联 - fromDTO.getRoles().forEach(role -> { - StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); - staffRoleEntity.setStaffId(fromDTO.getStaffId()); - staffRoleEntity.setRoleId(role); - staffRoleEntity.setOrgId(fromDTO.getAgencyId()); - staffRoleService.insert(staffRoleEntity); - }); - - // 重新查询用户的角色列表(可以取到前端没有传过来的角色,例如根管理员) - List staffRoleEntytiesByStaffIdAndOrgId = staffRoleService.getStaffRoleEntytiesByStaffIdAndOrgId(fromDTO.getAgencyId(), fromDTO.getStaffId()); - List roleIds = new ArrayList<>(); - if (!CollectionUtils.isEmpty(staffRoleEntytiesByStaffIdAndOrgId)) { - roleIds = staffRoleEntytiesByStaffIdAndOrgId.stream().map(sr -> sr.getRoleId()).collect(Collectors.toList()); - } + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - // redis缓存角色修改 - UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO(); - updateRolesForm.setOrgId(fromDTO.getAgencyId()); - updateRolesForm.setStaffId(fromDTO.getStaffId()); - updateRolesForm.setRoleIds(roleIds); - try { - Result result = authFeignClient.updateCachedRoles(updateRolesForm); - if (!result.success()) { - logger.error("修改用户信息:修改用户已缓存的角色列表失败:{}", result.getInternalMsg()); - } - logger.info("修改用户信息:修改用户已缓存的角色列表成功"); - } catch (Exception e) { - log.error("method exception", e); - logger.error("修改用户信息:修改用户已缓存的角色列表异常:{}", ExceptionUtils.getErrorStackTrace(e)); - } + return wrapper; + } - // 角色放缓存 - CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); - List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setStaffId(fromDTO.getStaffId()); - dto.setAgencyId(fromDTO.getAgencyId()); - Map m = new HashMap(16); - roleKeyValue.forEach(r -> { - m.put(r.getRoleKey(),r.getRoleName()); - }); - dto.setRoles(m); - CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); - - return new Result(); - } - - @Override - public Result getStaffDetail(StaffInfoFromDTO fromDTO) { - StaffDetailResultDTO resultDTO = new StaffDetailResultDTO(); - //获取工作人员信息 - CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); - resultDTO.setStaffId(customerStaffDTO.getUserId()); - resultDTO.setName(customerStaffDTO.getRealName()); - resultDTO.setMobile(customerStaffDTO.getMobile()); - resultDTO.setHeadPhoto(customerStaffDTO.getHeadPhoto()); - resultDTO.setGender(customerStaffDTO.getGender()); - resultDTO.setActiveFlag(customerStaffDTO.getActiveFlag()); - resultDTO.setActiveTime(customerStaffDTO.getActiveTime()); - resultDTO.setEnableFlag(customerStaffDTO.getEnableFlag()); - - //获取工作人员角色 - List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); - List roles = staffRoles.stream().map(GovStaffRoleEntity::getRoleName).collect(Collectors.toList()); - resultDTO.setRoles(roles); - return new Result().ok(resultDTO); - } - - @Override - public Result disabledStaff(StaffInfoFromDTO fromDTO) { - CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setId(customerStaffEntity.getId()); - staffEntity.setEnableFlag(CustomerStaffConstant.DISABLED); - baseDao.updateById(staffEntity); - //2021.8.24 sun 人员禁用时删除工作人员的缓存信息 - CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId()); - return new Result(); - } - - /** - * 根据userId查询网格下未被禁用的人员数量 - * - * @param userIdDTO - * @return - */ - @Override - public Result selectGridStaffCountByUserId(List userIdDTO) { - Result gridStaffCountDTOResult = new Result(); - GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); - gridStaffCountDTOResult.setData(gridStaffCountDTO); - return gridStaffCountDTOResult; - } - - @Override - public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { - //1:根据userId集合查询人员基本信息 - List staffList = baseDao.selectDepartmentStaffList(formDTO); - //2:根据组织Id查询部门下是领导角色的用户 - List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getAgencyId(), DataScope.getDefault()); - staffRoleDTOS.forEach(roleDto -> { - staffList.stream().filter(staffDto -> - roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> - result.setRoleName(roleDto.getRoleName())); - }); - return new Result>().ok(staffList); - } - - /** - * @return Result> - * @Description 通过userId列表查询未被禁用的用户信息 - * @Param CommonUserIdListFormDTO :: getUserIdList - * @Author wangc - * @Date 2020.04.24 15:44 - **/ - @Override - public Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList) { - if (userIdList.getUserIdList().size() <= NumConstant.ZERO) { - return new Result>().ok(new ArrayList<>()); - } + @Override + public CustomerStaffDTO get(String id) { + CustomerStaffEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerStaffDTO.class); + } - return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(), userIdList.getCustomerId())); - } - - /** - * @param staffIdList - * @return - * @Author sun - * @Description 根据staffId集合查询工作人员基础信息 - **/ - @Override - public CustomerStaffListResultDTO getCustomerStaffList(List staffIdList) { - //1:批量查询人员基本信息 - List staffList = baseDao.selectStaffByIds(staffIdList); - //2:批量查询人员拥有的所有角色信息 - List roleList = staffRoleDao.selectStaffRoleList(staffIdList); - CustomerStaffListResultDTO list = new CustomerStaffListResultDTO(); - list.setStaffList(staffList); - list.setRoleList(roleList); - return list; - } - - /** - * @param staffId - * @return - * @Author sun - * @Description 根据staffId查询工作人员基本信息 - **/ - @Override - public CustomerStaffDTO getCustomerStaff(String staffId) { - return baseDao.selectByStaffId(staffId); - } - - /** - * @param staffResetPwFormDTO - * @return void - * @author yinzuomei - * @description 工作端,修改工作人员密码 - * @Date 2020/7/1 10:41 - **/ - @Override - public void resetStaffPassword(StaffResetPwFormDTO staffResetPwFormDTO) { - CustomerStaffDTO customerStaffDTO=this.getCustomerStaff(staffResetPwFormDTO.getStaffId()); - if(null==customerStaffDTO){ - return; - } - //密码加密 - String password = PasswordUtils.encode(staffResetPwFormDTO.getNewPassword()); - logger.info(String.format("密码%s加密后为%s",staffResetPwFormDTO.getNewPassword(),password)); - customerStaffDTO.setPassword(password); - this.update(customerStaffDTO); - } - - /** - * @Description 得到工组人员的头像、名称、所属机关名称 - * @param userId - * @return - * @author wangc - * @date 2020.07.27 14:45 - **/ - @Override - public StaffEtAgencyResultDTO getStaffMsg(IssueInitiatorFormDTO userId) { - StaffEtAgencyResultDTO result = new StaffEtAgencyResultDTO(); - CustomerStaffDTO staff = baseDao.selectByStaffId(userId.getUserId()); - if(null != staff){ - Result agencyResult = govOrgOpenFeignClient.getAgencyByStaff(userId.getUserId()); - if(agencyResult.success() && null != agencyResult.getData()){ - result = ConvertUtils.sourceToTarget(agencyResult.getData(),StaffEtAgencyResultDTO.class); - result.setAgencyId(agencyResult.getData().getId()); - result.setNickname(new StringBuilder(agencyResult.getData().getOrganizationName()).append(ModuleConstant.DASH).append(staff.getRealName()).toString()); - } - } - return result; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 - **/ - @Override - public List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO) { - //根据客户Id和手机号查询工作人员信息 - List customerStaffDTOList = baseDao.selectStaff(formDTO); - if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { - logger.warn(String.format("根据客户Id和手机号查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", - formDTO.getCustomerId(), formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), - EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); - throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); - } - return customerStaffDTOList; - } - - /** - * @Description 查询工作人员的信息 - * @param formDTO - * @author zxc - * @date 2020/8/13 1:45 下午 - */ - @Override - public List getStaffInfoList(UserIdsFormDTO formDTO) { - List userIds = formDTO.getUserIds(); - // 1. 根据userId查询人员基本信息 - List staffInfoList = new ArrayList<>(); - userIds.forEach(staffId->{ - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); - if (staffInfo ==null){ - log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db",formDTO.getCustomerId(), staffId); - return; - } - StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); - resultDTO.setStaffId(staffId); - resultDTO.setStaffName(staffInfo.getRealName()); - resultDTO.setHeadPhoto(staffInfo.getHeadPhoto()); - resultDTO.setGender(staffInfo.getGender()); - - List roleInfoList = new ArrayList<>(); - staffInfo.getRoleMap().forEach((key,value) ->{ - RoleResultDTO dto = new RoleResultDTO(); - dto.setRoleKey(key); - dto.setRoleName(value); - roleInfoList.add(dto); - }); - resultDTO.setRoleList(roleInfoList); - staffInfoList.add(resultDTO); - }); + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerStaffDTO dto) { + CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerStaffDTO dto) { + CustomerStaffEntity entity = ConvertUtils.sourceToTarget(dto, CustomerStaffEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> getCustsomerStaffByPhone(String mobile) { + //判断用户是否存在 + List customerStaffDTOList = baseDao.selectListCustomerStaffDTO(mobile); + if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) { + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", mobile, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + return new Result>().ok(customerStaffDTOList); + } + + + @Override + public Result getCustomerStaffInfo(CustomerStaffFormDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(formDTO); + if (null == customerStaffDTO) { + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],code[%s],msg[%s]", formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + //判断用户是否已被禁用 + if (null != customerStaffDTO && UserConstant.DISABLED.equals(customerStaffDTO.getEnableFlag())) { + logger.warn(String.format("根据手机号查询用户异常,手机号:[%s],客户id:[%s],code[%s],msg[%s]", formDTO.getMobile(), formDTO.getCustomerId(), EpmetErrorCode.GOV_STAFF_DISABLED.getCode(), EpmetErrorCode.GOV_STAFF_DISABLED.getMsg())); + return new Result().error(EpmetErrorCode.GOV_STAFF_DISABLED.getCode()); + } + return new Result().ok(customerStaffDTO); + } + + @Override + public Result getCustomerStaffInfoByUserId(CustomerStaffDTO formDTO) { + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfoByUserId(formDTO); + return new Result().ok(customerStaffDTO); + } + + @Override + public Result> selectStaffGridListByUserId(List customerStaffGridDTOS) { + if (CollectionUtils.isEmpty(customerStaffGridDTOS)) { + return new Result>().ok(new ArrayList<>()); + } + List gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); + List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); + for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { + if (govStaffRoleResultDTO.getRoleKey().equals(UserRoleConstant.GRID_MANAGER)) { + for (StaffGridListDTO staffGridListDTO : staffGridListDTOS) { + if (staffGridListDTO.getStaffId().equals(govStaffRoleResultDTO.getStaffId())) { + staffGridListDTO.setRoleName(govStaffRoleResultDTO.getRoleName()); + } + } + } + } + return new Result>().ok(staffGridListDTOS); + } + + @Override + public Result> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { + List list = baseDao.selectCustomerStaffList(fromDTO); + if (null == list) { + list = new ArrayList<>(); + } + return new Result>().ok(list); + } + + @Override + public Result> getStaffList(StaffsInAgencyFromDTO fromDTO) { + List list = baseDao.selectStaffList(fromDTO); + if (null == list) { + list = new ArrayList<>(); + } + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) { + Map> map = govStaffRoleService.getStaffRoles(fromDTO.getStaffList(), fromDTO.getAgencyId()); + list.forEach(item -> { + item.setRoles(map.get(item.getStaffId())); + }); + } + return new Result>().ok(list); + } + + @Override + public Result> addStaffInit(StaffInfoFromDTO fromDTO) { + GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); + govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); + List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + + if (null == roleList || roleList.size() == 0) { + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + List staffRoleList = roleList.stream() + .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) + .map(p -> { + RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO(); + staffRoleResultDTO.setRoleId(p.getId()); + staffRoleResultDTO.setRoleName(p.getRoleName()); + staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); + staffRoleResultDTO.setDescription(p.getDescription()); + return staffRoleResultDTO; + }).collect(Collectors.toList()); + return new Result>().ok(staffRoleList); + } + + @Override + public Result editStaffInit(StaffInfoFromDTO fromDTO) { + StaffInitResultDTO resultDTO = new StaffInitResultDTO(); + //获取工作人员信息 + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); + if (null == customerStaffDTO) { + log.warn("工作人员不存在"); + } + resultDTO.setStaffId(customerStaffDTO.getUserId()); + resultDTO.setName(customerStaffDTO.getRealName()); + resultDTO.setGender(customerStaffDTO.getGender()); + resultDTO.setMobile(customerStaffDTO.getMobile()); + resultDTO.setWorkType(customerStaffDTO.getWorkType()); + //获取角色列表 + GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); + govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); + List roleList = govStaffRoleService.getGovStaffRoleList(govStaffRoleDTO); + //获取工作人员角色 + List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); + List staffRoleList = roleList + .stream() + .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey())) + .map(p -> { + StaffRoleResultDTO staffRoleResultDTO = new StaffRoleResultDTO(); + staffRoleResultDTO.setRoleId(p.getId()); + staffRoleResultDTO.setRoleName(p.getRoleName()); + staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); + staffRoleResultDTO.setDescription(p.getDescription()); + staffRoleResultDTO.setSelected(false); + return staffRoleResultDTO; + }).collect(Collectors.toList()); + + staffRoleList.forEach(role -> staffRoles.forEach(staffRole -> { + if (role.getRoleId().equals(staffRole.getId())) { + role.setSelected(true); + } + })); + resultDTO.setRoleList(staffRoleList); + + return new Result().ok(resultDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result addStaff(StaffSubmitFromDTO fromDTO) { + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffFormDTO.setMobile(fromDTO.getMobile()); + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); + if (null != customerStaffDTO) { + return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + } + //USER表插入数据 + UserEntity userEntity = new UserEntity(); + userEntity.setFromApp(fromDTO.getApp()); + userEntity.setFromClient(fromDTO.getClient()); + userEntity.setCustomerId(fromDTO.getCustomerId()); + userService.insert(userEntity); + //Customer_Staff表插入数据 + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setCustomerId(fromDTO.getCustomerId()); + staffEntity.setUserId(userEntity.getId()); + staffEntity.setRealName(fromDTO.getName()); + staffEntity.setMobile(fromDTO.getMobile()); + staffEntity.setActiveFlag(CustomerStaffConstant.INACTIVE); + staffEntity.setGender(fromDTO.getGender()); + staffEntity.setWorkType(fromDTO.getWorkType()); + staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); + staffEntity.setPassword(PasswordUtils.encode("12345678")); + baseDao.insert(staffEntity); + + //工作人员角色关联表 + fromDTO.getRoles().forEach(role -> { + StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); + staffRoleEntity.setStaffId(userEntity.getId()); + staffRoleEntity.setRoleId(role); + staffRoleEntity.setOrgId(fromDTO.getAgencyId()); + staffRoleEntity.setCustomerId(fromDTO.getCustomerId()); + staffRoleService.insert(staffRoleEntity); + }); + + // 角色放缓存 + CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); + List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(userEntity.getId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(), r.getRoleName()); + }); + dto.setRoles(m); + CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); + + return new Result().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result editStaff(StaffSubmitFromDTO fromDTO) { + CustomerStaffFormDTO customerStaffFormDTO = new CustomerStaffFormDTO(); + customerStaffFormDTO.setCustomerId(fromDTO.getCustomerId()); + customerStaffFormDTO.setMobile(fromDTO.getMobile()); + CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); + if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { + return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + } + + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + //Customer_Staff表插入数据 + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setRealName(fromDTO.getName()); + staffEntity.setMobile(fromDTO.getMobile()); + staffEntity.setGender(fromDTO.getGender()); + staffEntity.setWorkType(fromDTO.getWorkType()); + baseDao.updateById(staffEntity); + + //清空权限关联 + StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); + staffRoleDTO.setStaffId(fromDTO.getStaffId()); + staffRoleDTO.setOrgId(fromDTO.getAgencyId()); + staffRoleService.clearStaffRoles(staffRoleDTO); + //重新添加角色关联 + fromDTO.getRoles().forEach(role -> { + StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); + staffRoleEntity.setStaffId(fromDTO.getStaffId()); + staffRoleEntity.setRoleId(role); + staffRoleEntity.setOrgId(fromDTO.getAgencyId()); + staffRoleService.insert(staffRoleEntity); + }); + + // 重新查询用户的角色列表(可以取到前端没有传过来的角色,例如根管理员) + List staffRoleEntytiesByStaffIdAndOrgId = staffRoleService.getStaffRoleEntytiesByStaffIdAndOrgId(fromDTO.getAgencyId(), fromDTO.getStaffId()); + List roleIds = new ArrayList<>(); + if (!CollectionUtils.isEmpty(staffRoleEntytiesByStaffIdAndOrgId)) { + roleIds = staffRoleEntytiesByStaffIdAndOrgId.stream().map(sr -> sr.getRoleId()).collect(Collectors.toList()); + } + + // redis缓存角色修改 + UpdateCachedRolesFormDTO updateRolesForm = new UpdateCachedRolesFormDTO(); + updateRolesForm.setOrgId(fromDTO.getAgencyId()); + updateRolesForm.setStaffId(fromDTO.getStaffId()); + updateRolesForm.setRoleIds(roleIds); + try { + Result result = authFeignClient.updateCachedRoles(updateRolesForm); + if (!result.success()) { + logger.error("修改用户信息:修改用户已缓存的角色列表失败:{}", result.getInternalMsg()); + } + logger.info("修改用户信息:修改用户已缓存的角色列表成功"); + } catch (Exception e) { + log.error("method exception", e); + logger.error("修改用户信息:修改用户已缓存的角色列表异常:{}", ExceptionUtils.getErrorStackTrace(e)); + } + + // 角色放缓存 + CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO(); + List roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles()); + dto.setCustomerId(fromDTO.getCustomerId()); + dto.setStaffId(fromDTO.getStaffId()); + dto.setAgencyId(fromDTO.getAgencyId()); + Map m = new HashMap(16); + roleKeyValue.forEach(r -> { + m.put(r.getRoleKey(), r.getRoleName()); + }); + dto.setRoles(m); + CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); + + return new Result(); + } + + @Override + public Result getStaffDetail(StaffInfoFromDTO fromDTO) { + StaffDetailResultDTO resultDTO = new StaffDetailResultDTO(); + //获取工作人员信息 + CustomerStaffDTO customerStaffDTO = baseDao.selectStaffInfo(fromDTO); + resultDTO.setStaffId(customerStaffDTO.getUserId()); + resultDTO.setName(customerStaffDTO.getRealName()); + resultDTO.setMobile(customerStaffDTO.getMobile()); + resultDTO.setHeadPhoto(customerStaffDTO.getHeadPhoto()); + resultDTO.setGender(customerStaffDTO.getGender()); + resultDTO.setActiveFlag(customerStaffDTO.getActiveFlag()); + resultDTO.setActiveTime(customerStaffDTO.getActiveTime()); + resultDTO.setEnableFlag(customerStaffDTO.getEnableFlag()); + + //获取工作人员角色 + List staffRoles = govStaffRoleService.listRolesByStaffId(fromDTO.getStaffId(), fromDTO.getAgencyId()); + List roles = staffRoles.stream().map(GovStaffRoleEntity::getRoleName).collect(Collectors.toList()); + resultDTO.setRoles(roles); + return new Result().ok(resultDTO); + } + + @Override + public Result disabledStaff(StaffInfoFromDTO fromDTO) { + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setEnableFlag(CustomerStaffConstant.DISABLED); + baseDao.updateById(staffEntity); + //2021.8.24 sun 人员禁用时删除工作人员的缓存信息 + CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId()); + return new Result(); + } + + /** + * 根据userId查询网格下未被禁用的人员数量 + * + * @param userIdDTO + * @return + */ + @Override + public Result selectGridStaffCountByUserId(List userIdDTO) { + Result gridStaffCountDTOResult = new Result(); + GridStaffCountDTO gridStaffCountDTO = baseDao.selectGridStaffCountByUserId(userIdDTO); + gridStaffCountDTOResult.setData(gridStaffCountDTO); + return gridStaffCountDTOResult; + } + + @Override + public Result> getDepartmentStaffList(DepartmentInStaffFormDTO formDTO) { + //1:根据userId集合查询人员基本信息 + List staffList = baseDao.selectDepartmentStaffList(formDTO); + //2:根据组织Id查询部门下是领导角色的用户 + List staffRoleDTOS = staffRoleService.listStaffsInRole(UserRoleConstant.DEPT_LEADER, formDTO.getAgencyId(), DataScope.getDefault()); + staffRoleDTOS.forEach(roleDto -> { + staffList.stream().filter(staffDto -> + roleDto.getStaffId().equals(staffDto.getStaffId())).findAny().ifPresent(result -> + result.setRoleName(roleDto.getRoleName())); + }); + return new Result>().ok(staffList); + } + + /** + * @return Result> + * @Description 通过userId列表查询未被禁用的用户信息 + * @Param CommonUserIdListFormDTO :: getUserIdList + * @Author wangc + * @Date 2020.04.24 15:44 + **/ + @Override + public Result> getEnableStaffMsgList(CommonUserIdListFormDTO userIdList) { + if (userIdList.getUserIdList().size() <= NumConstant.ZERO) { + return new Result>().ok(new ArrayList<>()); + } + + return new Result>().ok(baseDao.selectEnableStaffMsg(userIdList.getUserIdList(), userIdList.getCustomerId())); + } + + /** + * @param staffIdList + * @return + * @Author sun + * @Description 根据staffId集合查询工作人员基础信息 + **/ + @Override + public CustomerStaffListResultDTO getCustomerStaffList(List staffIdList) { + //1:批量查询人员基本信息 + List staffList = baseDao.selectStaffByIds(staffIdList, null); + //2:批量查询人员拥有的所有角色信息 + List roleList = staffRoleDao.selectStaffRoleList(staffIdList); + CustomerStaffListResultDTO list = new CustomerStaffListResultDTO(); + list.setStaffList(staffList); + list.setRoleList(roleList); + return list; + } + + /** + * @param staffId + * @return + * @Author sun + * @Description 根据staffId查询工作人员基本信息 + **/ + @Override + public CustomerStaffDTO getCustomerStaff(String staffId) { + return baseDao.selectByStaffId(staffId); + } + + /** + * @param staffResetPwFormDTO + * @return void + * @author yinzuomei + * @description 工作端,修改工作人员密码 + * @Date 2020/7/1 10:41 + **/ + @Override + public void resetStaffPassword(StaffResetPwFormDTO staffResetPwFormDTO) { + CustomerStaffDTO customerStaffDTO = this.getCustomerStaff(staffResetPwFormDTO.getStaffId()); + if (null == customerStaffDTO) { + return; + } + //密码加密 + String password = PasswordUtils.encode(staffResetPwFormDTO.getNewPassword()); + logger.info(String.format("密码%s加密后为%s", staffResetPwFormDTO.getNewPassword(), password)); + customerStaffDTO.setPassword(password); + this.update(customerStaffDTO); + } + + /** + * @param userId + * @return + * @Description 得到工组人员的头像、名称、所属机关名称 + * @author wangc + * @date 2020.07.27 14:45 + **/ + @Override + public StaffEtAgencyResultDTO getStaffMsg(IssueInitiatorFormDTO userId) { + StaffEtAgencyResultDTO result = new StaffEtAgencyResultDTO(); + CustomerStaffDTO staff = baseDao.selectByStaffId(userId.getUserId()); + if (null != staff) { + Result agencyResult = govOrgOpenFeignClient.getAgencyByStaff(userId.getUserId()); + if (agencyResult.success() && null != agencyResult.getData()) { + result = ConvertUtils.sourceToTarget(agencyResult.getData(), StaffEtAgencyResultDTO.class); + result.setAgencyId(agencyResult.getData().getId()); + result.setNickname(new StringBuilder(agencyResult.getData().getOrganizationName()).append(ModuleConstant.DASH).append(staff.getRealName()).toString()); + } + } + return result; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 + **/ + @Override + public List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO) { + //根据客户Id和手机号查询工作人员信息 + List customerStaffDTOList = baseDao.selectStaff(formDTO); + if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) { + logger.warn(String.format("根据客户Id和手机号查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]", + formDTO.getCustomerId(), formDTO.getMobile(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), + EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg())); + throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode()); + } + return customerStaffDTOList; + } + + /** + * @param formDTO + * @Description 查询工作人员的信息 + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + @Override + public List getStaffInfoList(UserIdsFormDTO formDTO) { + List userIds = formDTO.getUserIds(); + // 1. 根据userId查询人员基本信息 + List staffInfoList = new ArrayList<>(); + userIds.forEach(staffId -> { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); + if (staffInfo == null) { + log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db", formDTO.getCustomerId(), staffId); + return; + } + StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); + resultDTO.setStaffId(staffId); + resultDTO.setStaffName(staffInfo.getRealName()); + resultDTO.setHeadPhoto(staffInfo.getHeadPhoto()); + resultDTO.setGender(staffInfo.getGender()); + + List roleInfoList = new ArrayList<>(); + staffInfo.getRoleMap().forEach((key, value) -> { + RoleResultDTO dto = new RoleResultDTO(); + dto.setRoleKey(key); + dto.setRoleName(value); + roleInfoList.add(dto); + }); + resultDTO.setRoleList(roleInfoList); + staffInfoList.add(resultDTO); + }); /*List staffInfoList = customerStaffDao.getStaffInfoList(userIds); if (staffInfoList.size() == NumConstant.ZERO){ @@ -644,14 +634,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl govOrgResult = - govOrgOpenFeignClient.staffInfoExt(result); - if(govOrgResult.success() && null != govOrgResult.getData()){ + govOrgOpenFeignClient.staffInfoExt(result); + if (govOrgResult.success() && null != govOrgResult.getData()) { return govOrgResult.getData(); } } - log.warn("com.epmet.service.impl.CustomerStaffServiceImpl.extStaffInfo,根据传入的用户Id未找到对应的工作人员,传参:{}",JSON.toJSONString(staffParam)); + log.warn("com.epmet.service.impl.CustomerStaffServiceImpl.extStaffInfo,根据传入的用户Id未找到对应的工作人员,传参:{}", JSON.toJSONString(staffParam)); return null; } - @Override - public void updateRootManage(UpdateRootManageFormDTO formDTO) { - CustomerStaffDTO dto = baseDao.selectRootManage(formDTO.getOrgId(), formDTO.getRoleKey()); - if (null == dto) { - throw new RenException("查询客户管理员失败"); - } - dto.setRealName(formDTO.getRootManageName()); - dto.setMobile(formDTO.getRootManagePhone()); - update(dto); - } + @Override + public void updateRootManage(UpdateRootManageFormDTO formDTO) { + CustomerStaffDTO dto = baseDao.selectRootManage(formDTO.getOrgId(), formDTO.getRoleKey()); + if (null == dto) { + throw new RenException("查询客户管理员失败"); + } + dto.setRealName(formDTO.getRootManageName()); + dto.setMobile(formDTO.getRootManagePhone()); + update(dto); + } - @Override - public Result> selectCustomerList(CustomerListFormDTO formDTO) { + @Override + public Result> selectCustomerList(CustomerListFormDTO formDTO) { List listResultDTO = new ArrayList<>(); CustomerDTO customerDTO = new CustomerDTO(); - // 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id + // 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id List customerStaffList = baseDao.selectListCustomerStaffDTO(formDTO.getPhone()); //sun 2020.11.12 需求变更-之前pc工作端只能是工作端小程序的超级管理员能登陆 现调整为工作端小程序的工作人员均可登陆(使用账号密码登陆) start @@ -714,153 +703,157 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); - if (!customerInfo.success()) { - logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); - } else { - if (null != customerInfo.getData()){ - CustomerListResultDTO resultDTO = new CustomerListResultDTO(); - resultDTO.setCustomerId(customerInfo.getData().getId()); - resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); - listResultDTO.add(resultDTO); - } - } - } - //2020.11.12 sun end - return new Result>().ok(listResultDTO); - } - - @Override - public Result selectStaffBasicInfo(String userId, String customerId) { - StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); - if (null != resultDTO) { - resultDTO.setRoleList(baseDao.selectStaffRoles(userId, resultDTO.getCustomerId())); - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); - if (null != staffInfo) { - resultDTO.setAgencyId(staffInfo.getAgencyId()); - resultDTO.setAgencyName(staffInfo.getAgencyName()); - resultDTO.setLevel(staffInfo.getLevel()); - resultDTO.setLongitude(staffInfo.getLongitude()); - resultDTO.setLatitude(staffInfo.getLatitude()); - AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); - if (agency != null){ - resultDTO.setAreaCodePath(!CollectionUtils.isEmpty(agency.getAreaCodePath()) ? agency.getAreaCodePath() : new ArrayList<>()); - resultDTO.setAreaCode(StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR); - resultDTO.setLevel(agency.getLevel()); - } - } - //获取工作人员所属客户名 - CustomerDTO dto = new CustomerDTO(); - dto.setId(customerId); - Result customerResult = operCrmOpenFeignClient.getCustomerInfo(dto); - if (!customerResult.success()) { - throw new RenException(customerResult.getCode(), customerResult.getMsg()); - } - if (null != customerResult.getData()) { - resultDTO.setCustomerName(customerResult.getData().getCustomerName()); - } - } - return new Result().ok(resultDTO); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 - **/ - @Override - public GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { - //1.根据客户Id和手机号查询用户信息 - return baseDao.selectByCustomerIdAndPhone(formDTO); - } - - /** - * 根据staffId查询用户基本信息 - * @author sun - * @return - */ - @Override - public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { - return baseDao.getStaffBasicInfo(fromDTO); - } - - @Override - public List list(String customerId, String realName, String mobile, List userIds) { - return baseDao.listDTOS(customerId, realName, mobile, userIds); - } - - /** - * 【通讯录】工作人员解禁 - * @author sun - */ - @Override - public void enableStaff(EnableStaffFormDTO fromDTO) { - CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); - if (null == customerStaffEntity) { - logger.error(String.format("工作人员解禁,未查询到被解禁人信息,被解禁人Id->%s", fromDTO.getStaffId())); - throw new RenException("未查询到被解禁人信息,请核对后操作"); - } - CustomerStaffEntity staffEntity = new CustomerStaffEntity(); - staffEntity.setId(customerStaffEntity.getId()); - staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); - baseDao.updateById(staffEntity); - } - - /** - * @Author sun - * @Description 根据工作人员姓名批量查询基础信息数据 - **/ - @Override - public List getByRealNames(GetByRealNamesFormDTO formDTO) { - return baseDao.getByRealNames(formDTO); - } - - /** - * @Author sun - * @Description 【事件】网格员服务电话 - **/ - @Override - public List gridMobileList(String gridId, String userId) { - List resultList = new ArrayList<>(); - //1.查询网格下工作人员列表 - CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); - dto.setGridId(gridId); - dto.setUserId(userId); - Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto); - if (!gridStaffs.success()) { - throw new RenException("获取网格下工作人员列表失败!"); - } - if (gridStaffs.getData().size() < NumConstant.ONE) { - return resultList; - } + for (CustomerStaffDTO staffDTO : customerStaffList) { + customerDTO.setId(staffDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + logger.warn(String.format("获取客户信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + } else { + if (null != customerInfo.getData()) { + CustomerListResultDTO resultDTO = new CustomerListResultDTO(); + resultDTO.setCustomerId(customerInfo.getData().getId()); + resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); + listResultDTO.add(resultDTO); + } + } + } + //2020.11.12 sun end + return new Result>().ok(listResultDTO); + } - //2.查询工作人员中拥有网格长网格员角色的人员列表 - List staffRoleList = staffRoleDao.staffRoleList(gridStaffs.getData()); - - //3.查询工作人员基础信息 - List staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList()); - staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); - List list = baseDao.selectStaffByIds(staffIdList); - - //4.封装数据并返回 - resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class); - List roleList = null; - for (GridMobileListResultDTO re : resultList) { - roleList = new ArrayList<>(); - for (GridMobileListResultDTO.Role r : staffRoleList) { - if (re.getStaffId().equals(r.getStaffId())) { - GridMobileListResultDTO.Role role = ConvertUtils.sourceToTarget(r, GridMobileListResultDTO.Role.class); - roleList.add(role); - } - } - re.setGridId(gridId); - re.setRoleList(roleList); - } - return resultList; - } + @Override + public Result selectStaffBasicInfo(String userId, String customerId) { + StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + if (null != resultDTO) { + resultDTO.setRoleList(baseDao.selectStaffRoles(userId, resultDTO.getCustomerId())); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null != staffInfo) { + resultDTO.setAgencyId(staffInfo.getAgencyId()); + resultDTO.setAgencyName(staffInfo.getAgencyName()); + resultDTO.setLevel(staffInfo.getLevel()); + resultDTO.setLongitude(staffInfo.getLongitude()); + resultDTO.setLatitude(staffInfo.getLatitude()); + AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (agency != null) { + resultDTO.setAreaCodePath(!CollectionUtils.isEmpty(agency.getAreaCodePath()) ? agency.getAreaCodePath() : new ArrayList<>()); + resultDTO.setAreaCode(StringUtils.isNotBlank(agency.getAreaCode()) ? agency.getAreaCode() : StrConstant.EPMETY_STR); + resultDTO.setLevel(agency.getLevel()); + } + } + //获取工作人员所属客户名 + CustomerDTO dto = new CustomerDTO(); + dto.setId(customerId); + Result customerResult = operCrmOpenFeignClient.getCustomerInfo(dto); + if (!customerResult.success()) { + throw new RenException(customerResult.getCode(), customerResult.getMsg()); + } + if (null != customerResult.getData()) { + resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + } + } + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @Override + public GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { + //1.根据客户Id和手机号查询用户信息 + return baseDao.selectByCustomerIdAndPhone(formDTO); + } + + /** + * 根据staffId查询用户基本信息 + * + * @return + * @author sun + */ + @Override + + public BasicInfoResultDTO getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { + return baseDao.getStaffBasicInfo(fromDTO); + } + + @Override + public List list(String customerId, String realName, String mobile, List userIds) { + return baseDao.listDTOS(customerId, realName, mobile, userIds); + } + + /** + * 【通讯录】工作人员解禁 + * + * @author sun + */ + @Override + public void enableStaff(EnableStaffFormDTO fromDTO) { + CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); + if (null == customerStaffEntity) { + logger.error(String.format("工作人员解禁,未查询到被解禁人信息,被解禁人Id->%s", fromDTO.getStaffId())); + throw new RenException("未查询到被解禁人信息,请核对后操作"); + } + CustomerStaffEntity staffEntity = new CustomerStaffEntity(); + staffEntity.setId(customerStaffEntity.getId()); + staffEntity.setEnableFlag(CustomerStaffConstant.ENABLE); + baseDao.updateById(staffEntity); + } + + /** + * @Author sun + * @Description 根据工作人员姓名批量查询基础信息数据 + **/ + @Override + public List getByRealNames(GetByRealNamesFormDTO formDTO) { + return baseDao.getByRealNames(formDTO); + } + + /** + * @Author sun + * @Description 【事件】网格员服务电话 + **/ + @Override + public List gridMobileList(String gridId, String userId) { + List resultList = new ArrayList<>(); + //1.查询网格下工作人员列表 + CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); + dto.setGridId(gridId); + dto.setUserId(userId); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto); + if (!gridStaffs.success()) { + throw new RenException("获取网格下工作人员列表失败!"); + } + if (gridStaffs.getData().size() < NumConstant.ONE) { + return resultList; + } + + //2.查询工作人员中拥有网格长网格员角色的人员列表 + List staffRoleList = staffRoleDao.staffRoleList(gridStaffs.getData()); + + //3.查询工作人员基础信息 + List staffIdList = staffRoleList.stream().map(GridMobileListResultDTO.Role::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + List list = baseDao.selectStaffByIds(staffIdList, Constant.ENABLE); + + //4.封装数据并返回 + resultList = ConvertUtils.sourceToTarget(list, GridMobileListResultDTO.class); + List roleList = null; + for (GridMobileListResultDTO re : resultList) { + roleList = new ArrayList<>(); + for (GridMobileListResultDTO.Role r : staffRoleList) { + if (re.getStaffId().equals(r.getStaffId())) { + GridMobileListResultDTO.Role role = ConvertUtils.sourceToTarget(r, GridMobileListResultDTO.Role.class); + roleList.add(role); + } + } + re.setGridId(gridId); + re.setRoleList(roleList); + } + + return resultList; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java new file mode 100644 index 0000000000..33888e282f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserConfirmServiceImpl.java @@ -0,0 +1,202 @@ +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.constant.NumConstant; +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.IcResiUserConfirmDao; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dto.IcResiUserConfirmDTO; +import com.epmet.dto.form.IcResiUserConfirmGetDTO; +import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; +import com.epmet.dto.form.MoveOutMemberFormDTO; +import com.epmet.entity.IcResiUserConfirmEntity; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.redis.IcResiUserConfirmRedis; +import com.epmet.service.IcResiUserConfirmService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民信息审核表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-06-01 + */ +@Service +public class IcResiUserConfirmServiceImpl extends BaseServiceImpl implements IcResiUserConfirmService { + + @Autowired + private IcResiUserConfirmRedis icResiUserConfirmRedis; + + @Autowired + private IcResiUserDao icResiUserDao; + + @Autowired + private IcResiUserConfirmDao icResiUserConfirmDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcResiUserConfirmDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcResiUserConfirmDTO.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 IcResiUserConfirmDTO get(String id) { + IcResiUserConfirmEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcResiUserConfirmDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcResiUserConfirmDTO dto) { + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcResiUserConfirmDTO dto) { + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result editMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId()); + if (null != oldEntity) { + dto.setId(oldEntity.getId()); + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + updateById(entity); + } else { + addMember(dto); + } + return new Result().ok("修改成功"); + } + + @Override + public Result addMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId()); + dto.setCustomerId(user.getCustomerId()); + dto.setAgencyId(user.getAgencyId()); + dto.setPids(user.getPids()); + dto.setGridId(user.getGridId()); + + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + entity.setIcResiUserId(null); + insert(entity); + + return new Result().ok("新增成功"); + } + + @Override + public Result delMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserConfirmEntity oldEntity = baseDao.selectByIcResiUserId(dto.getIcResiUserId()); + if (null != oldEntity) { + dto.setId(oldEntity.getId()); + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class); + updateById(entity); + } else { + addMember(dto); + } + return new Result().ok("删除成功"); + } + + @Override + public Result getMemberDetail(IcResiUserConfirmGetDTO dto) { + IcResiUserConfirmDTO result = icResiUserDao.selectMemberDetail(dto.getIcResiUserId()); + if (null != result && StringUtils.isBlank(result.getGender())) { + result.setGender(""); + } + return new Result().ok(result); + } + + /** + * 审核 + * + * @param dto + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 17:27 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void confirm(IcResiUserConfirmDTO dto) { + baseDao.updateById(ConvertUtils.sourceToTarget(dto, IcResiUserConfirmEntity.class)); + if (NumConstant.ONE_STR.equals(dto.getConfirmResult())) { + //审核通过,修改居民信息 + IcResiUserConfirmEntity confirmEntity = baseDao.selectById(dto.getId()); + if ("edit".equals(confirmEntity.getSubmitType())) { + IcResiUserEntity entity = ConvertUtils.sourceToTarget(confirmEntity, IcResiUserEntity.class); + entity.setName(confirmEntity.getSurname() + confirmEntity.getName()); + entity.setId(confirmEntity.getIcResiUserId()); + icResiUserDao.updateById(entity); + } else if ("delete".equals(confirmEntity.getSubmitType())) { + IcResiUserEntity entity = new IcResiUserEntity(); + entity.setId(confirmEntity.getIcResiUserId()); + entity.setStatus(confirmEntity.getDeleteReason()); + icResiUserDao.updateById(entity); + } + } else { + //TODO 发送消息 + } + } + + /** + * 【我的家庭】迁出家庭成员 + * + * @param form + * @return void + * @author LZN + * @date 2022/6/10 11:03 + */ + @Override + public void moveOutMember(MoveOutMemberFormDTO form) { + form = icResiUserDao.moveOutMember(form.getIcResiUserId(), form.getCustomerId()); + form.setSurname(form.getAllName().substring(0, 1)); + form.setName(form.getAllName().substring(1)); + if (icResiUserConfirmDao.selectByIdCard(form.getIdCard(), form.getCustomerId(), form.getSubmitType()) > 0) { + icResiUserConfirmDao.deleteByIdCard(form.getIdCard(), form.getCustomerId(), form.getSubmitType()); + } + IcResiUserConfirmEntity entity = ConvertUtils.sourceToTarget(form, IcResiUserConfirmEntity.class); + icResiUserConfirmDao.insert(entity); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 079c51dcf7..6901fd27b1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -23,7 +23,10 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.EpmetRequestHolder; import com.epmet.commons.tools.utils.FileUtils; @@ -47,6 +50,7 @@ import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.handler.IcResiImportDynamicExcelListener; import com.epmet.excel.handler.IcResiVirtualSheetImportListener; import com.epmet.feign.*; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.IcResiUserImportService; import com.epmet.service.UserService; import com.google.common.cache.Cache; @@ -68,6 +72,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.nio.file.Path; +import java.time.DateTimeException; import java.time.LocalDate; import java.time.Period; import java.util.*; @@ -87,7 +92,7 @@ import java.util.stream.Collectors; public class IcResiUserImportServiceImpl implements IcResiUserImportService, ResultDataResolver { public static final List controlGroup1 = Arrays.asList("input", "textarea", "datepicker", "daterange"); - public static final List controlGroup2 = Arrays.asList("select", "radio"); + public static final List controlGroup2 = Arrays.asList("select", "radio", "cascader"); /** * 15位身份证号的正则表达式 @@ -165,6 +170,8 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; @Autowired private OssFeignClient ossFeignClient; + @Autowired + private ResiPartyMemberOpenFeignClient partyMemberOpenFeignClient; /** * 子表中不需要的列。因为主表中需要身份证号,网格等信息,但子表中不需要这些列必填,只要有身份证号即可,因此字表判断的时候需要排除这些列 @@ -504,8 +511,15 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res columnAndValues.put("IS_FLOATING", existingResiMap.get("IS_FLOATING")); } - columnAndValues.put("AGENCY_ID", currUserAgencyId); - columnAndValues.put("PIDS", currUserAgencyPids); + String gridId = columnAndValues.get("GRID_ID"); + AgencyInfoCache agencyInfo = getAgencyInfo(gridId); + if (agencyInfo != null) { + columnAndValues.put("AGENCY_ID", agencyInfo.getId()); + columnAndValues.put("PIDS", agencyInfo.getPids()); + } else { + String msg = String.format("【居民信息导入】根据网格查询组织失败,网格ID:%s", gridId); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } columnAndValues.put("CUSTOMER_ID", EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID.toLowerCase())); columnAndValues.put("UPDATED_BY", currentUserId); @@ -562,6 +576,11 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } } + private AgencyInfoCache getAgencyInfo(String gridId) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(gridId); + return CustomerOrgRedis.getAgencyInfo(gridInfo.getPid()); + } + /** * 执行指定的检查以及数据的补充 * @param columnAndValues @@ -629,7 +648,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } // 出生日期 & 年龄 - LocalDate birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); + LocalDate birthday = null; + try { + birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day)); + } catch (DateTimeException e) { + throw new EpmetException("身份证号中日期信息错误"); + } int age = Period.between(birthday, LocalDate.now()).getYears(); // 性别 & 生日 & 老年人 @@ -798,7 +822,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res private LinkedHashMap removeNeedlessColumns(LinkedHashMap originColumnAndValues) { List needlessColumns = Arrays.asList("GRID_ID", "VILLAGE_ID", "BUILD_ID", "UNIT_ID", "HOME_ID", "IS_BDHJ", "NAME", "MOBILE", "GENDER", "ID_CARD", - "BIRTHDAY", "CONTACTS", "CONTACTS_MOBILE"); + "BIRTHDAY", "CONTACTS", "CONTACTS_MOBILE", "REMARKS"); LinkedHashMap newMap = new LinkedHashMap(); @@ -892,7 +916,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res Map itemOptions = columnWrapper.getOptions(); String colValue = itemOptions.get(cellContent); columnWrapper.setColValue(colValue); - } else { + } else if (StringUtils.isNotBlank(cellContent)) { String fullUri = columnWrapper.getOptionSourceValue(); String[] uriParts = splitOptionSourceUrl(fullUri); String pureUri = uriParts[0]; @@ -1326,6 +1350,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res case "/sys/dict/data/relationship": options = getResultDataOrThrowsException(adminOpenFeignClient.getRelationshipOption(), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); break; + case "/resi/partymember/icPartyOrg/branchlist": + options = this.listBranchOptions(); + break; default: log.warn("listRemoteOptions url is not supported"); @@ -1368,6 +1395,20 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } + /** + * 支部列表选项 + * @return + */ + private List listBranchOptions() { + String msg = "查询支部列表失败"; + List branchList = getResultDataOrThrowsException(partyMemberOpenFeignClient.branchlist(), + ServiceConstant.RESI_PARTYMEMBER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + //结果平铺展开 + Map resultMap = new HashMap<>(); + branchList.forEach(option-> option.getCurrenNodeAllChild(option,resultMap)); + return branchList; + } + @Override public Map listRemoteCascadeOptions(String pureUri, String cascadeItemId, Map columnWrappers, String currentStaffAgencyId, String query) { ColumnWrapper cascadeItemColumnWrapper = null; @@ -1383,9 +1424,12 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res options = getResultDataOrThrowsException(epmetHeartOpenFeignClient.getDemandOptions(), ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null); break; + case "/resi/partymember/icPartyOrg/branchlist": + options = this.listBranchOptions(); + break; } if (options == null) { - return null; + return new HashMap<>(); } //结果平铺展开 Map resultMap = new HashMap<>(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 5d55bdaf9c..3a01487589 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -50,6 +50,7 @@ import com.epmet.constant.UserConstant; import com.epmet.dao.IcPartyMemberDao; import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcVolunteerDao; +import com.epmet.dao.UserBaseInfoDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; @@ -64,6 +65,7 @@ import com.epmet.opendata.dto.result.ResidentByIdCardResultDTO; import com.epmet.opendata.feign.GuardarDatosFeignClient; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; import com.epmet.service.*; +import com.epmet.dto.result.demand.OptionDTO; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -148,7 +150,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params) { String id = (String) params.get(FieldConstant.ID_HUMP); @@ -274,6 +279,18 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : formMap.get("ic_party_member")) { + if (!hash.containsKey("SSZB")) { + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } + } else { + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + partyMemberDTO.setCustomerId(tokenDto.getCustomerId()); partyMemberDTO.setAgencyId(agencyId); partyMemberDTO.setAgencyPids(result.getData().getPids()); @@ -296,6 +313,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, map.get("ID_CARD")); + wrapper.ne(IcResiUserEntity::getId, map.get("ID")); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "修改居民信息失败,身份证号已存在!"; throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); } @@ -474,6 +493,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl hash : formMap.get("ic_party_member")) { + if (!hash.containsKey("ID") && !hash.containsKey("SSZB")) { + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } + } else { + String errorMsg = "党员信息所属支部不能为空"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + } if ((map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(map.get("IS_PARTY"))) || (!map.containsKey("IS_PARTY") && NumConstant.ONE_STR.equals(icResiUser.getIsParty()))) { partyMemberDTO.setCustomerId(tokenDto.getCustomerId()); @@ -549,6 +581,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl tableMap = new HashMap<>(); formDTO.forEach(d -> { if (!"ic_resi_user".equals(d.getTableName())) { for (LinkedHashMap hash : d.getList()) { @@ -558,6 +592,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl()); Result> demandNameRes = heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO); if (!demandNameRes.success() || CollectionUtils.isEmpty(demandNameRes.getData())) { throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取需求分类字典表数据异常", EpmetErrorCode.SERVER_ERROR.getMsg()); @@ -1842,19 +1882,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId()); + if (!result.success()) { + throw new EpmetException(String.format("获取当前组织及下级已删除组织、网格列表失败,组织Id->%s", formDTO.getUserId())); + } + formDTO.setAgencyIdList(result.getData().getAgencyIdList()); + formDTO.setGridIdList(result.getData().getGridIdList()); + } + //2.根据入参值查询对应的房屋统计数据 - List list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType()); + List list = baseDao.userChart(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getAgencyIdList(), formDTO.getGridIdList()); //3.汇总数据 AtomicInteger userTotal = new AtomicInteger(); + AtomicInteger czUserTotal = new AtomicInteger(); + AtomicInteger ldUserTotal = new AtomicInteger(); list.forEach(l -> { userTotal.addAndGet(l.getNum()); if ("0".equals(l.getIsFloating())) { - resultDTO.setCzUserTotal(l.getNum()); + czUserTotal.addAndGet(l.getNum()); } else { - resultDTO.setLdUserTotal(l.getNum()); + ldUserTotal.addAndGet(l.getNum()); } }); resultDTO.setUserTotal(userTotal.get()); + resultDTO.setCzUserTotal(czUserTotal.get()); + resultDTO.setLdUserTotal(ldUserTotal.get()); resultDTO.setCzUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getCzUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getCzUserTotal() / (float) resultDTO.getUserTotal()) * 100))); resultDTO.setLdUserRatio(Double.valueOf((resultDTO.getUserTotal() == 0 || resultDTO.getLdUserTotal() > resultDTO.getUserTotal()) ? "0" : numberFormat.format(((float) resultDTO.getLdUserTotal() / (float) resultDTO.getUserTotal()) * 100))); resultDTO.setOrgId(formDTO.getOrgId()); @@ -1884,6 +1939,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl lqw = new LambdaQueryWrapper<>(); lqw.eq(IcResiUserEntity::getCustomerId, customerId) .eq(IcResiUserEntity::getHomeId, houseId) + .eq(IcResiUserEntity::getStatus,"0") .select( IcResiUserEntity::getId, IcResiUserEntity::getHomeId, @@ -2269,6 +2325,281 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + + dto.setCustomerId(user.getCustomerId()); + dto.setAgencyId(user.getAgencyId()); + dto.setPids(user.getPids()); + dto.setGridId(user.getGridId()); + dto.setVillageId(user.getVillageId()); + dto.setBuildId(user.getBuildId()); + dto.setUnitId(user.getUnitId()); + dto.setHomeId(user.getHomeId()); + + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + insert(entity); + + return new Result().ok("新增成功"); + } + + @Override + public Result editMember(IcResiUserConfirmSubmitDTO dto) { + IcResiUserEntity user = icResiUserDao.selectById(dto.getIcResiUserId()); + + LambdaQueryWrapper userWrapper = new LambdaQueryWrapper<>(); + userWrapper.ne(IcResiUserEntity::getId, dto.getIcResiUserId()); + userWrapper.eq(IcResiUserEntity::getIdCard, dto.getIdCard()); + userWrapper.eq(IcResiUserEntity::getCustomerId, user.getCustomerId()); + List userList = baseDao.selectList(userWrapper); + if (CollectionUtils.isNotEmpty(userList)) { + String errorMsg = "修改居民信息失败,身份证号已存在!"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); + } + //这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户 + if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + entity.setId(dto.getIcResiUserId()); + updateById(entity); + return new Result().ok("修改成功"); + } + + @Override + public Result addWorkMember(IcResiUserConfirmSubmitDTO dto) { + if(StringUtils.isBlank(dto.getHouseCode())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "房屋编码不可为空", "房屋编码不可为空"); + } + CommonHouseFormDTO formDto = new CommonHouseFormDTO(); + formDto.setHouseCode(dto.getHouseCode()); + Result houseResult = govOrgOpenFeignClient.getHomeInfoByHouseCode(formDto); + if (!houseResult.success() || null == houseResult || null == houseResult.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询房屋信息失败", "查询房屋信息失败"); + } + HouseInfoResultDTO houseInfo = houseResult.getData(); + + //这个房屋下已经设置了户主后,再次选择户主时提示提示“房屋下已存在户主” PS.户主指与户主关系是本人的用户 + if (RelationshipEnum.SELF.getCode().equals(dto.getYhzgx())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getHomeId, houseInfo.getHouseId()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { + String errorMsg = "房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + } + } + + dto.setCustomerId(houseInfo.getCustomerId()); + dto.setAgencyId(houseInfo.getAgencyId()); + dto.setPids(houseInfo.getAgencyPids()); + dto.setGridId(houseInfo.getGridId()); + dto.setVillageId(houseInfo.getNeighborHoodId()); + dto.setBuildId(houseInfo.getBuildingId()); + dto.setUnitId(houseInfo.getBuildingUnitId()); + dto.setHomeId(houseInfo.getHouseId()); + + IcResiUserDTO userDTO = baseDao.getResiUserByIdCard(dto.getIdCard(), houseInfo.getCustomerId()); + if (null != userDTO && null != userDTO.getIdCard()) { + //覆盖原有的家庭成员信息,并且添加成员变更记录 + return updateOldMemberInfo(houseInfo.getCustomerId(),dto); + } + + IcResiUserEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserEntity.class); + insert(entity); + + return new Result().ok("新增成功"); + } + + private Result updateOldMemberInfo(String customerId, IcResiUserConfirmSubmitDTO dto) { + IcResiUserEntity userEntity = baseDao.selectResiUserEntityByIdCard(dto.getIdCard(), customerId); + //在添加调动记录的时候调整 + userEntity.setCustomerId(dto.getCustomerId()); + userEntity.setAgencyId(dto.getAgencyId()); + userEntity.setPids(dto.getPids()); + userEntity.setGridId(dto.getGridId()); + userEntity.setVillageId(dto.getVillageId()); + userEntity.setBuildId(dto.getBuildId()); + userEntity.setUnitId(dto.getUnitId()); + userEntity.setHomeId(dto.getHomeId()); + + userEntity.setName(dto.getName()); + userEntity.setIdCard(dto.getIdCard()); + userEntity.setMobile(dto.getMobile()); + userEntity.setBirthday(dto.getBirthday()); + userEntity.setGender(dto.getGender()); + userEntity.setMz(dto.getMz()); + userEntity.setYhzgx(dto.getYhzgx()); + userEntity.setHjszd(dto.getHjszd()); + userEntity.setXjzd(dto.getXjzd()); + userEntity.setUpdatedTime(new java.util.Date()); + //添加人员调动记录 + IcResiUserTransferFormDTO formDTO = new IcResiUserTransferFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setStaffId(dto.getStaffId()); + formDTO.setIcUserId(userEntity.getId()); + formDTO.setType("in");//客户内 + formDTO.setNewAgencyId(dto.getAgencyId()); + formDTO.setNewGridId(dto.getGridId()); + formDTO.setNewNeighborHoodId(dto.getVillageId()); + formDTO.setNewBuildingId(dto.getBuildId()); + formDTO.setNewBuildingUnitId(dto.getUnitId()); + formDTO.setNewHouseId(dto.getHomeId()); + formDTO.setTransferTime(new java.util.Date()); + formDTO.setRemark("更换房屋"); + formDTO.setReason("更换房屋"); + formDTO.setOrigin(IcResiUserConstant.CHANGE); + icUserTransferRecordService.add(formDTO); + //更新家庭成员信息 + baseDao.updateById(userEntity); + return new Result().ok("新增成功"); + } + + /** + * 获取组织下志愿者列表 + * + * @param customerId + * @param agencyId + * @Param customerId + * @Param agencyId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/6/16 14:58 + */ + @Override + public List getVolunteerList(String customerId, String agencyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, customerId); + wrapper.and(wq -> wq.eq(IcResiUserEntity::getAgencyId, agencyId).or().like(IcResiUserEntity::getPids, agencyId)); + wrapper.eq(IcResiUserEntity::getIsVolunteer, NumConstant.ONE_STR); + wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list.stream().map(item -> { + OptionDataResultDTO dto = new OptionDataResultDTO(); + dto.setValue(item.getId()); + if (StringUtils.isNotBlank(item.getMobile())) { + dto.setLabel(item.getName().concat("(").concat(item.getMobile().concat(")"))); + } else { + dto.setLabel(item.getName()); + } + return dto; + }).collect(Collectors.toList()); + } + + /** + * 获取居民信息对应的居民用户ID + * + * @param icResiUserId + * @Param icResiUserId + * @Return {@link String} + * @Author zhaoqifeng + * @Date 2022/6/16 15:30 + */ + @Override + public List getUserId(String icResiUserId) { + IcResiUserEntity entity = baseDao.selectById(icResiUserId); + if (null == entity) { + return null; + } + //根据身份证获取小程序端居民信息 + LambdaQueryWrapper baseInfoWrapper = new LambdaQueryWrapper<>(); + baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, entity.getCustomerId()); + baseInfoWrapper.eq(UserBaseInfoEntity::getIdNum, entity.getIdCard()); + List baseInfoList = userBaseInfoDao.selectList(baseInfoWrapper); + if (CollectionUtils.isEmpty(baseInfoList)) { + return null; + } + return baseInfoList.stream().map(UserBaseInfoEntity::getUserId).collect(Collectors.toList()); + } + + /** + * 根据身份证获取居民角色(目前只有是否是志愿者) + * + * @param formDTO + * @Param formDTO + * @Return {@link IcUserRoleResultDTO} + * @Author zhaoqifeng + * @Date 2022/5/31 9:50 + */ + @Override + public IcUserRoleResultDTO getUserRoleByIdCard(IcResiUserDTO formDTO) { + IcUserRoleResultDTO result = new IcUserRoleResultDTO(); + Map>> detail = new HashMap<>(); + result.setIsVolunteer(NumConstant.ZERO_STR); + result.setIsPartyMember(NumConstant.ZERO_STR); + //根据身份证获取小程序端居民信息 + LambdaQueryWrapper baseInfoWrapper = new LambdaQueryWrapper<>(); + baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, formDTO.getCustomerId()); + baseInfoWrapper.eq(UserBaseInfoEntity::getIdNum, formDTO.getIdCard()); + List baseInfoList = userBaseInfoDao.selectList(baseInfoWrapper); + if (CollectionUtils.isNotEmpty(baseInfoList)) { + for (UserBaseInfoEntity baseInfo : baseInfoList) { + //获取志愿者信息 + Result volunteerResult = epmetHeartOpenFeignClient.queryUserVolunteerInfo(baseInfo.getUserId()); + if (!volunteerResult.success()) { + log.error("志愿者变更-获取小程序志愿者失败"); + continue; + } + if (null != volunteerResult.getData()) { + result.setIsVolunteer(NumConstant.ONE_STR); + break; + } + } + } + //获取党员信息 + com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO memberFormDTO = new com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO(); + memberFormDTO.setCustomerId(formDTO.getCustomerId()); + memberFormDTO.setIdCard(formDTO.getIdCard()); + Result memberInfoResult = resiPartyMemberOpenFeignClient.getPartyMemberByIdCard(memberFormDTO); + if (memberInfoResult.success() && null != memberInfoResult.getData()) { + List> list = new ArrayList<>(); + Map memberMap = new HashMap<>(); + result.setIsPartyMember(NumConstant.ONE_STR); + com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO dto = memberInfoResult.getData(); + memberMap.put("RDSJ", dto.getRdsj()); + memberMap.put("SSZB", dto.getSszb()); + memberMap.put("IS_LD", dto.getIsLd()); + memberMap.put("LDZH", dto.getLdzh()); + memberMap.put("PARTY_ZW", dto.getPartyZw()); + memberMap.put("IS_DYZXH", dto.getIsDyzxh()); + list.add(memberMap); + detail.put("ic_party_member", list); + } + result.setDetail(detail); + return result; + } + /** * 绑定房屋 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index bc88226da3..f72d695c5e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -45,7 +46,6 @@ import com.epmet.service.IcUserChangeRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -175,7 +175,6 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl"+customerId); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -198,15 +197,15 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl> icUserList = new ArrayList<>(); do { //一千条一循环查询客户下居民数据 - PageHelper.startPage(pageNo, NumConstant.ONE_THOUSAND); + PageHelper.startPage(pageNo, NumConstant.ONE_THOUSAND,false); icUserList = icResiUserDao.getIcUserList(customerId, columns); - pageNo++; + //不需要分页了 因为sql中已经去掉了一些存在变更记录的数据了 + //pageNo++; //3.遍历封装数据 for (Map map : icUserList){ //存放一个人的类别为是的变更明细数据 - List subList = new ArrayList<>(); - String changeId = UUID.randomUUID().toString().replaceAll("-", ""); + String changeId = IdWorker.getIdStr(); for (IcResiCategoryStatsConfigDTO dto : categoryListResult.getData()){ if(map.containsKey(dto.getColumnName())&&"1".equals(map.get(dto.getColumnName()))){ detailed = new IcUserChangeDetailedEntity(); @@ -228,12 +227,10 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl NumConstant.ZERO) { - detailedList.addAll(subList); - } + if (!hash.containsKey(map.get("CREATED_BY"))) { CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, map.get("CREATED_BY")); //被删除或被移除的工作人员,名字为空 @@ -256,21 +253,35 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl= NumConstant.FIVE_HUNDRED){ + delAndInsertChangeRecord(customerId, changeList, detailedList); + } } } while (icUserList.size() == NumConstant.ONE_THOUSAND); //4.批量新增数据,先删后增【只删除新增节点的历史数据】 //4-1.删除待处理的人员数据【这类人是指在变更记录表中不存在新增节点数据的人】 + //最后再处理一批 + delAndInsertChangeRecord(customerId, changeList, detailedList); + } + + @Transactional(rollbackFor = Exception.class) + public void delAndInsertChangeRecord(String customerId, List changeList, List detailedList) { + if (CollectionUtils.isEmpty(changeList)) { + log.info("customerId:{}初始变更记录数据 已完成!", customerId); + return; + } List icUserIdList = changeList.stream().map(IcUserChangeRecordEntity::getIcUserId).collect(Collectors.toList()); - List> partition = ListUtils.partition(icUserIdList, NumConstant.FIVE_HUNDRED); - partition.forEach(part -> { - baseDao.delByCustomerId(customerId, "add", part); - icUserChangeDetailedService.delByCustomerId(customerId, "add", part); - }); + baseDao.delByCustomerId(customerId, "add", icUserIdList); + icUserChangeDetailedService.delByCustomerId(customerId, "add", icUserIdList); log.info("初始变更记录数据,总条数->" + changeList.size()); icUserChangeRecordService.insertBatch(changeList); log.info("初始变更记录明细数据,总条数->" + detailedList.size()); icUserChangeDetailedService.insertBatch(detailedList); + changeList.clear(); + detailedList.clear(); + icUserIdList.clear(); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java index c2de05f566..f2477ae314 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -355,13 +355,15 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl baseInfoWrapper = new LambdaQueryWrapper<>(); baseInfoWrapper.eq(UserBaseInfoEntity::getCustomerId, customerId); baseInfoWrapper.eq(UserBaseInfoEntity::getIdNum, icUser.getIdCard()); - UserBaseInfoEntity baseInfo = userBaseInfoDao.selectOne(baseInfoWrapper); - if (null != baseInfo) { - ResiVolunteerAuthenticateFormDTO formDTO = new ResiVolunteerAuthenticateFormDTO(); - formDTO.setCustomerId(customerId); - formDTO.setUserId(baseInfo.getUserId()); - formDTO.setGridId(icUser.getGridId()); - epmetHeartOpenFeignClient.addVolunteer(formDTO); + List baseInfoList = userBaseInfoDao.selectList(baseInfoWrapper); + if (CollectionUtils.isNotEmpty(baseInfoList)) { + baseInfoList.forEach(baseInfo -> { + ResiVolunteerAuthenticateFormDTO formDTO = new ResiVolunteerAuthenticateFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setUserId(baseInfo.getUserId()); + formDTO.setGridId(icUser.getGridId()); + epmetHeartOpenFeignClient.addVolunteer(formDTO); + }); } } else { if (!isDyzxh) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java new file mode 100644 index 0000000000..9ae1bba783 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java @@ -0,0 +1,192 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; +import com.epmet.dto.IcHouseDTO; +import com.epmet.dto.UserResiInfoDTO; +import com.epmet.dto.form.EnterGridFormDTO; +import com.epmet.dto.form.GetRoleKeyListFormDTO; +import com.epmet.dto.form.RegisterAndBindFormDTO; +import com.epmet.dto.result.HomeInfoResultDTO; +import com.epmet.dto.result.HomeUserBriefResultDTO; +import com.epmet.dto.result.ResiUserBaseInfoResultDTO; +import com.epmet.entity.IcResiUserEntity; +import com.epmet.entity.UserBaseInfoEntity; +import com.epmet.entity.UserResiInfoEntity; +import com.epmet.entity.UserResiRegisterVisitEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.compress.utils.Lists; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/5/31 16:22 + */ +@Service +@Slf4j +public class MyHomeServiceImpl implements MyHomeService { + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiUserService icResiUserService; + @Resource + private UserRoleDao userRoleDao; + @Resource + private UserResiInfoService userResiInfoService; + @Resource + private UserResiInfoDao userResiInfoDao; + @Resource + private UserBaseInfoService userBaseInfoService; + @Resource + private UserBaseInfoDao userBaseInfoDao; + @Resource + private IcResiUserDao icResiUserDao; + @Resource + private RegisterRelationService registerRelationService; + @Resource + private UserResiRegisterVisitDao userResiRegisterVisitDao; + + @Override + public List selectListHomeMember(String houseCode, String customerId) { + + Result byHouseCode = govOrgOpenFeignClient.getByHouseCode(houseCode); + + if (byHouseCode.success() && null != byHouseCode.getData()) { + return icResiUserService.listHomeUserBrief(byHouseCode.getData().getId(), customerId); + } + + return Lists.newArrayList(); + } + + /** + * 注册绑定房屋信息 + * + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2022/6/1 16:33 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void registerAndBind(RegisterAndBindFormDTO formDTO) { + + LambdaQueryWrapper userWrapper = new LambdaQueryWrapper<>(); + userWrapper.eq(IcResiUserEntity::getCustomerId, formDTO.getCustomerId()); + userWrapper.eq(IcResiUserEntity::getIdCard, formDTO.getIdCard()); + IcResiUserEntity icUser = icResiUserDao.selectOne(userWrapper); + if (null == icUser || !icUser.getHomeId().equals(formDTO.getHomeId())) { + throw new EpmetException(EpmetErrorCode.MISMATCH.getCode(), + "人员与房屋信息不匹配,请与工作人员联系。", + "人员与房屋信息不匹配,请与工作人员联系。"); + } + + //进入网格(entergrid)流程 + EnterGridFormDTO userInfoParams = new EnterGridFormDTO(); + userInfoParams.setUserId(formDTO.getUserId()); + userInfoParams.setCustomerId(formDTO.getCustomerId()); + userInfoParams.setGridId(formDTO.getGridId()); + registerRelationService.getUserInfoAndRoles(userInfoParams); + + //1.判断是否是居民,如果不是则注册居民,如果是则更新居民信息 + GetRoleKeyListFormDTO getRoleKeyListFormDTO = new GetRoleKeyListFormDTO(); + getRoleKeyListFormDTO.setUserId(formDTO.getUserId()); + getRoleKeyListFormDTO.setGridId(formDTO.getGridId()); + List roleList = userRoleDao.selectUserRoleKeyList(getRoleKeyListFormDTO); + + if (CollectionUtils.isNotEmpty(roleList) && roleList.contains("registered_resi")) { + //更新user_resi_info和user_base_info的信息 + UserResiInfoEntity userResiInfo = new UserResiInfoEntity(); + userResiInfo.setUserId(formDTO.getUserId()); + userResiInfo.setSurname(formDTO.getSurname()); + userResiInfo.setName(formDTO.getName()); + userResiInfo.setIdNum(formDTO.getIdCard()); + userResiInfo.setRegMobile(formDTO.getMobile()); + userResiInfo.setResiVisitId(formDTO.getVisitId()); + userResiInfo.setStreet(formDTO.getAddress()); + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(UserResiInfoEntity::getCustomerId, formDTO.getCustomerId()); + wrapper.eq(UserResiInfoEntity::getUserId, formDTO.getUserId()); + userResiInfoDao.update(userResiInfo, wrapper); + + UserBaseInfoEntity userBaseInfoEntity = ConvertUtils.sourceToTarget(userResiInfo, UserBaseInfoEntity.class); + userBaseInfoEntity.setNickname(formDTO.getNickname()); + userBaseInfoService.insertOrUpdate(userBaseInfoEntity); + } else { + //visit表添加数据 + UserResiRegisterVisitEntity visit = new UserResiRegisterVisitEntity(); + visit.setCustomerId(formDTO.getCustomerId()); + visit.setGridId(formDTO.getGridId()); + visit.setUserId(formDTO.getUserId()); + visit.setVisitFrom("register_and_bind"); + visit.setLastOperateVisit("success"); + visit.setVisitTime(new Date()); + userResiRegisterVisitDao.insert(visit); + //注册居民 + UserResiInfoDTO userResiInfoDTO = ConvertUtils.sourceToTarget(formDTO, UserResiInfoDTO.class); + userResiInfoDTO.setUserId(formDTO.getUserId()); + userResiInfoDTO.setIdNum(formDTO.getIdCard()); + userResiInfoDTO.setRegMobile(formDTO.getMobile()); + userResiInfoDTO.setResiVisitId(visit.getId()); + userResiInfoDTO.setStreet(formDTO.getAddress()); + userResiInfoDTO.setCustomerId(formDTO.getCustomerId()); + userResiInfoDTO.setApp("resi"); + userResiInfoService.saveResiInfo(userResiInfoDTO); + } + } + + /** + * 获取用户绑定的房屋信息 + * + * @param tokenDto + * @Param tokenDto + * @Return {@link HomeInfoResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/1 16:52 + */ + @Override + public HomeInfoResultDTO getHomeInfo(TokenDto tokenDto) { + HomeInfoResultDTO resultDto = new HomeInfoResultDTO(); + ResiUserBaseInfoResultDTO baseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(tokenDto.getUserId()); + if (null == baseInfo) { + return resultDto; + } + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, baseInfo.getIdNum()); + IcResiUserEntity icUser = icResiUserDao.selectOne(wrapper); + + if (null == icUser) { + return resultDto; + } + resultDto.setIcResiUserId(icUser.getId()); + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId()); + if (null == houseInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); + } + resultDto.setHouseId(houseInfo.getHomeId()); + resultDto.setHouseName(houseInfo.getAllName()); + resultDto.setHouseCode(houseInfo.getHouseCode()); + resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl()); + return resultDto; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index a808b172e7..f36dffda3f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -81,6 +81,9 @@ public class UserBadgeServiceImpl implements UserBadgeService { this.reloadCustomerBadge(userBadgeListFormDTO.getCustomerId()); userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); } + if (null == userBadge){ + return new ArrayList<>(); + } List redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); List userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO); if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ @@ -116,6 +119,9 @@ public class UserBadgeServiceImpl implements UserBadgeService { public List selectOperList(UserOperListFormDTO userOperListFormDTO) { List userAuthBadgeList = userBadgeDao.selectAuthRecord(userOperListFormDTO.getUserId()); Object userBadge = userBadgeRedis.getCustomerBadge(userOperListFormDTO.getCustomerId()); + if (null == userBadge){ + return new ArrayList<>(); + } List userOperListResultDTOS = JSON.parseArray(userBadge.toString(), UserOperListResultDTO.class); // 没有任何记录 if (CollectionUtils.isEmpty(userAuthBadgeList)){ @@ -402,11 +408,10 @@ public class UserBadgeServiceImpl implements UserBadgeService { public void reloadCustomerBadge(String customerId){ userBadgeRedis.delCustomerBadge(customerId); List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(customerId); - if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ - throw new RenException("客户徽章缓存初始化未查到数据"); + if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){ + userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } userBadgeRedis.batchClearUserBadgeCache(customerId); - userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 898a7735d2..5970d78788 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; @@ -504,4 +505,18 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl + and ENABLE_FLAG = #{enableFlag} + user_id = #{userId} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index ebfe3767fd..d2ca4339c1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -16,16 +16,19 @@ - + + - select m.`NAME` AS memberName, m.ID_NUM AS memberIdNum, @@ -52,10 +58,16 @@ m.HE_SUAN_COUNT AS heSuanCount, m.YMJZ AS ymjz, m.DOMICILE_PLACE as domicilePlace, - m.WORK_PLACE as workPlace + m.DOMICILE_PLACE_CODE as domicilePlaceCode, + m.DOMICILE_PLACE_CODE_PATH as domicilePlaceCodePath, + m.WORK_PLACE as workPlace, + m.REMARK as remark from ic_resi_member m where m.DEL_FLAG = 0 and m.IC_RESI_COLLECT_ID = #{id} + + AND m.DOMICILE_PLACE LIKE CONCAT('%',#{domicilePlace},'%') + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml index b9bc9300dd..13db077a3c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiMemberDao.xml @@ -14,7 +14,10 @@ m.HE_SUAN_COUNT, m.YMJZ, m.DOMICILE_PLACE, - m.WORK_PLACE + m.WORK_PLACE, + m.DOMICILE_PLACE_CODE, + m.DOMICILE_PLACE_CODE_PATH, + m.REMARK FROM ic_resi_member m WHERE diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml new file mode 100644 index 0000000000..30c3baca88 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserConfirmDao.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from ic_resi_user_confirm + where + id_card = #{idCard} + AND customer_id = #{customerId} + AND CONFIRM_RESULT = '0' + AND SUBMIT_TYPE = #{submitType} + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 1b81b08320..06dfa4887c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -55,6 +55,14 @@ ) + + DELETE + FROM + ${tableName} + WHERE + ic_resi_user = #{resiUserId} + + UPDATE ${tableName} SET @@ -120,6 +128,16 @@ ${subCondition.tableName}.${subCondition.columnName} like concat('%',#{colValue},'%') + + + + + + and ${subCondition.tableName}.${colValue} ='1' + + + + @@ -958,9 +976,20 @@ ic_resi_user WHERE del_flag = '0' + AND status = '0' AND (agency_id = #{orgId} OR pids LIKE CONCAT('%', #{orgId}, '%')) + + + #{agencyId} + + + + + #{gridId} + + AND grid_id = #{orgId} @@ -1077,6 +1106,7 @@ AND a.ID = #{userId} + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml index e8bec0b3b8..6c5066bbe0 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml @@ -61,7 +61,7 @@