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/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/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-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/PointAditiveCalcDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveCalcDTO.java similarity index 94% rename from epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveCalcDTO.java rename to epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveCalcDTO.java index dd61db0db7..5a86dff31b 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveCalcDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveCalcDTO.java @@ -12,7 +12,7 @@ import lombok.Data; * @since v1.0.0 2022-06-14 */ @Data -public class PointAditiveCalcDTO implements Serializable { +public class PointAdditiveCalcDTO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveRecordDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRecordDTO.java similarity index 95% rename from epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveRecordDTO.java rename to epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRecordDTO.java index b72fe77a08..68c899bed8 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveRecordDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAdditiveRecordDTO.java @@ -13,7 +13,7 @@ import java.util.Date; * @since v1.0.0 2022-06-14 */ @Data -public class PointAditiveRecordDTO implements Serializable { +public class PointAdditiveRecordDTO implements Serializable { private static final long serialVersionUID = 1L; 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/PointApplyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointApplyDTO.java index 459447f84c..1cd7fc89e5 100644 --- 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 @@ -1,8 +1,11 @@ package com.epmet.dto; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; +import java.util.List; /** @@ -115,7 +118,7 @@ public class PointApplyDTO implements Serializable { * 昵称 */ private String nickname; - + private String showName; /** * 性别;未知0;男1;女2 */ @@ -141,6 +144,9 @@ public class PointApplyDTO implements Serializable { */ private String remark; + private List annexList; + private Integer pointValue; + /** * 删除标识;0.未删除 1.已删除 */ @@ -159,6 +165,7 @@ public class PointApplyDTO implements Serializable { /** * 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date createdTime; /** 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/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..49fdc3844b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/List4ApplyResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @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 index 81d70ffd3c..050416dd08 100644 --- 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 @@ -12,10 +12,6 @@ import java.io.Serializable; @Data public class MyTotalPointResultDTO implements Serializable { private static final long serialVersionUID = 15299506166024546L; - /** - * 德育积分moral_education;党建积分party_building;活跃积分active - */ - private String categoryCode; /** * 总积分 */ 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 index 9f8a8786d9..b57d39a273 100644 --- 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 @@ -29,6 +29,10 @@ public interface CommonConstant extends Constant { * 活跃积分 */ String ACTIVE = "active"; + /** + * 活跃积分 + */ + String TOTAL = "total"; /** * 积分申请 */ @@ -45,4 +49,8 @@ public interface CommonConstant extends Constant { * 积分花费 */ 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 index 5db66d452b..855dcaf599 100644 --- 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 @@ -9,7 +9,7 @@ import java.util.Objects; public enum ApplyStatusEnum { //审核状态 AUDITING("0", "未审核"), - REJECT("1", "未通过"), + REJECT("1", "已驳回"), PASSED("2", "已通过"); private String code; 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 index 4f7ba03a07..19423970b3 100644 --- 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 @@ -12,12 +12,12 @@ 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.*; -import java.util.Map; - /** * 积分申请 @@ -32,13 +32,15 @@ public class PointApplyController { @Autowired private PointApplyService pointApplyService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = pointApplyService.page(params); + @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 = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + @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); @@ -81,4 +83,12 @@ public class PointApplyController { 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 05b37956d2..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 获取指定居民的积分信息 @@ -233,9 +233,26 @@ public class ResiPointController { } @PostMapping("total") - public Result> totalPoint(@LoginUser TokenDto tokenDto) { - return new Result>().ok(userPointTotalService.totalPoint(tokenDto)); + 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/PointAditiveCalcDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveCalcDao.java similarity index 63% rename from epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveCalcDao.java rename to epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveCalcDao.java index b5410693e5..ca55b3d103 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveCalcDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAdditiveCalcDao.java @@ -1,7 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.PointAditiveCalcEntity; +import com.epmet.entity.PointAdditiveCalcEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2022-06-14 */ @Mapper -public interface PointAditiveCalcDao extends BaseDao { +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/PointAditiveRecordDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveRecordDao.java deleted file mode 100644 index cf95a4367c..0000000000 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveRecordDao.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.dao; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.PointAditiveRecordEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 附加积分记录 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-06-14 - */ -@Mapper -public interface PointAditiveRecordDao 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 index 29fd3d8c90..809226c58d 100644 --- 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 @@ -1,8 +1,13 @@ 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; /** * 积分申请 @@ -12,5 +17,24 @@ import org.apache.ibatis.annotations.Mapper; */ @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/PointAditiveCalcEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveCalcEntity.java similarity index 89% rename from epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveCalcEntity.java rename to epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveCalcEntity.java index 552b9e5dea..53c4939cf8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveCalcEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveCalcEntity.java @@ -13,8 +13,8 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("point_aditive_calc") -public class PointAditiveCalcEntity extends BaseEpmetEntity { +@TableName("point_additive_calc") +public class PointAdditiveCalcEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveRecordEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRecordEntity.java similarity index 92% rename from epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveRecordEntity.java rename to epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRecordEntity.java index 1a3ad83056..cc30d1fb85 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveRecordEntity.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAdditiveRecordEntity.java @@ -13,8 +13,8 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("point_aditive_record") -public class PointAditiveRecordEntity extends BaseEpmetEntity { +@TableName("point_additive_record") +public class PointAdditiveRecordEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; 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/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/PointAditiveCalcService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveCalcService.java similarity index 52% rename from epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveCalcService.java rename to epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveCalcService.java index 6b87e5cefc..50d477b844 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveCalcService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdditiveCalcService.java @@ -2,8 +2,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.PointAditiveCalcDTO; -import com.epmet.entity.PointAditiveCalcEntity; +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; @@ -14,37 +16,37 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2022-06-14 */ -public interface PointAditiveCalcService extends BaseService { +public interface PointAdditiveCalcService extends BaseService { /** * 默认分页 * * @param params - * @return PageData + * @return PageData * @author generator * @date 2022-06-14 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 * * @param params - * @return java.util.List + * @return java.util.List * @author generator * @date 2022-06-14 */ - List list(Map params); + List list(Map params); /** * 单条查询 * * @param id - * @return PointAditiveCalcDTO + * @return PointAdditiveCalcDTO * @author generator * @date 2022-06-14 */ - PointAditiveCalcDTO get(String id); + PointAdditiveCalcDTO get(String id); /** * 默认保存 @@ -54,7 +56,7 @@ public interface PointAditiveCalcService 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/PointAditiveRecordService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveRecordService.java deleted file mode 100644 index 857d5b797d..0000000000 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveRecordService.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.epmet.service; - -import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.page.PageData; -import com.epmet.dto.PointAditiveRecordDTO; -import com.epmet.entity.PointAditiveRecordEntity; - -import java.util.List; -import java.util.Map; - -/** - * 附加积分记录 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2022-06-14 - */ -public interface PointAditiveRecordService 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 PointAditiveRecordDTO - * @author generator - * @date 2022-06-14 - */ - PointAditiveRecordDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2022-06-14 - */ - void save(PointAditiveRecordDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2022-06-14 - */ - void update(PointAditiveRecordDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2022-06-14 - */ - void delete(String[] ids); -} \ No newline at end of file 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 index f2c7cdb49e..c9aea552f1 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -75,4 +76,13 @@ public interface PointAnnexService extends BaseService { * @date 2022-06-14 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * @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 index 7988b94f26..74160b5099 100644 --- 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 @@ -2,8 +2,11 @@ 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; @@ -25,7 +28,7 @@ public interface PointApplyService extends BaseService { * @author generator * @date 2022-06-14 */ - PageData page(Map params); + PageData page(PointApplyPageFormDTO formDTO); /** * 默认查询 @@ -85,4 +88,15 @@ public interface PointApplyService extends BaseService { * @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 07bc0b77e1..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,7 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.MyTotalPointResultDTO; @@ -75,10 +75,10 @@ public interface UserPointTotalService extends BaseService /** * 积分总分 * - * @Param tokenDto + * @Param formDTO * @Return {@link MyTotalPointResultDTO} * @Author zhaoqifeng * @Date 2022/6/14 15:46 */ - List totalPoint(TokenDto tokenDto); + 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..371c861773 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdditiveRuleServiceImpl.java @@ -0,0 +1,296 @@ +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); + List result = build(list); + result.removeIf(category ->CollectionUtils.isEmpty(category.getChildren())); + return new Result>().ok(result); + } + + /** + * 构建树节点 + */ + public static List build(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(List4ApplyResultDTO treeNode : treeNodes){ + nodeMap.put(treeNode.getId(), treeNode); + } + + for(List4ApplyResultDTO node : nodeMap.values()) { + List4ApplyResultDTO parent = nodeMap.get(node.getPid()); + if(parent != null && !(node.getId().equals(parent.getId()))){ + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + + @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/PointAditiveCalcServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveCalcServiceImpl.java deleted file mode 100644 index 2b8bc7ed16..0000000000 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveCalcServiceImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -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.PointAditiveCalcDao; -import com.epmet.dto.PointAditiveCalcDTO; -import com.epmet.entity.PointAditiveCalcEntity; -import com.epmet.service.PointAditiveCalcService; -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 PointAditiveCalcServiceImpl extends BaseServiceImpl implements PointAditiveCalcService { - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PointAditiveCalcDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, PointAditiveCalcDTO.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 PointAditiveCalcDTO get(String id) { - PointAditiveCalcEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, PointAditiveCalcDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(PointAditiveCalcDTO dto) { - PointAditiveCalcEntity entity = ConvertUtils.sourceToTarget(dto, PointAditiveCalcEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(PointAditiveCalcDTO dto) { - PointAditiveCalcEntity entity = ConvertUtils.sourceToTarget(dto, PointAditiveCalcEntity.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-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveRecordServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveRecordServiceImpl.java deleted file mode 100644 index 6ca0fb5f22..0000000000 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveRecordServiceImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -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.PointAditiveRecordDao; -import com.epmet.dto.PointAditiveRecordDTO; -import com.epmet.entity.PointAditiveRecordEntity; -import com.epmet.service.PointAditiveRecordService; -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-14 - */ -@Service -public class PointAditiveRecordServiceImpl extends BaseServiceImpl implements PointAditiveRecordService { - - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PointAditiveRecordDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, PointAditiveRecordDTO.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 PointAditiveRecordDTO get(String id) { - PointAditiveRecordEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, PointAditiveRecordDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(PointAditiveRecordDTO dto) { - PointAditiveRecordEntity entity = ConvertUtils.sourceToTarget(dto, PointAditiveRecordEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(PointAditiveRecordDTO dto) { - PointAditiveRecordEntity entity = ConvertUtils.sourceToTarget(dto, PointAditiveRecordEntity.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-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 index fdfd83e9fd..d7f0ff9ea7 100644 --- 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 @@ -3,15 +3,15 @@ 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.commons.tools.constant.FieldConstant; 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.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -80,4 +80,21 @@ public class PointAnnexServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PointApplyDTO.class); + 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 @@ -75,8 +117,24 @@ public class PointApplyServiceImpl extends BaseServiceImpl 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 4dbda58db2..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 @@ -24,15 +24,15 @@ 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.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dao.PointAditiveCalcDao; +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.PointAditiveCalcEntity; +import com.epmet.entity.PointAdditiveCalcEntity; import com.epmet.entity.UserPointTotalEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.UserPointTotalService; @@ -60,7 +60,7 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl totalPoint(TokenDto tokenDto) { - List list = new ArrayList(); - //活跃度积分 - MyTotalPointResultDTO active = new MyTotalPointResultDTO(); - active.setCategoryCode(CommonConstant.ACTIVE); - ResiPointDetailResultDTO activeTotal = baseDao.selectPointByCustomerUserId(tokenDto.getUserId(), tokenDto.getCustomerId()); - if (null != activeTotal) { - active.setTotal(activeTotal.getAccumulatedPoint()); - active.setUsable(activeTotal.getUsablePoint()); - active.setSpend(activeTotal.getAccumulatedPoint() - activeTotal.getUsablePoint()); + public MyTotalPointResultDTO totalPoint(CommonPageUserFormDTO formDTO) { + MyTotalPointResultDTO resultDTO = new MyTotalPointResultDTO(); + switch (formDTO.getCategoryCode()) { + case CommonConstant.MORAL_EDUCATION: + //德育积分 + resultDTO = getEducationTotal(formDTO); + break; + case CommonConstant.PARTY_BUILDING: + //党建积分 + resultDTO = getPartyTotal(formDTO); + break; + case CommonConstant.ACTIVE: + //活跃度积分 + resultDTO = getActiveTotal(formDTO); + break; + case CommonConstant.TOTAL: + MyTotalPointResultDTO education = getEducationTotal(formDTO); + MyTotalPointResultDTO party = getPartyTotal(formDTO); + MyTotalPointResultDTO active = getActiveTotal(formDTO); + resultDTO.setTotal(education.getTotal() + party.getTotal() + active.getTotal()); + resultDTO.setSpend(education.getSpend() + party.getSpend() + active.getSpend()); + resultDTO.setUsable(education.getUsable() + party.getUsable() + active.getUsable()); + break; + default: + break; } - list.add(active); + + return resultDTO; + } + + /** + * 德育积分 + * @Param formDTO + * @Return {@link MyTotalPointResultDTO} + * @Author zhaoqifeng + * @Date 2022/6/17 9:58 + */ + private MyTotalPointResultDTO getEducationTotal(CommonPageUserFormDTO formDTO) { + MyTotalPointResultDTO resultDTO = new MyTotalPointResultDTO(); //德育积分 - MyTotalPointResultDTO education = new MyTotalPointResultDTO(); - education.setCategoryCode(CommonConstant.MORAL_EDUCATION); //获取居民绑定的家庭 Result 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(PointAditiveCalcEntity::getCustomerId, tokenDto.getCustomerId()); - wrapper.eq(PointAditiveCalcEntity::getSubjectId, result.getData().getHouseId()); - wrapper.eq(PointAditiveCalcEntity::getCategoryCode, CommonConstant.MORAL_EDUCATION); - PointAditiveCalcEntity entity = pointAditiveCalcDao.selectOne(wrapper); + 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) { - education.setTotal(entity.getTotal()); - education.setSpend(entity.getSpend()); - education.setUsable(entity.getTotal() - entity.getSpend()); + resultDTO.setTotal(entity.getTotal()); + resultDTO.setSpend(entity.getSpend()); + resultDTO.setUsable(entity.getTotal() - entity.getSpend()); } } - list.add(education); + return resultDTO; + } - //党建积分 - MyTotalPointResultDTO party = new MyTotalPointResultDTO(); - party.setCategoryCode(CommonConstant.PARTY_BUILDING); - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(PointAditiveCalcEntity::getCustomerId, tokenDto.getCustomerId()); - wrapper.eq(PointAditiveCalcEntity::getSubjectId, tokenDto.getUserId()); - wrapper.eq(PointAditiveCalcEntity::getCategoryCode, CommonConstant.PARTY_BUILDING); - PointAditiveCalcEntity entity = pointAditiveCalcDao.selectOne(wrapper); + /** + * 党建积分 + * @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) { - party.setTotal(entity.getTotal()); - party.setSpend(entity.getSpend()); - party.setUsable(entity.getTotal() - entity.getSpend()); + resultDTO.setTotal(entity.getTotal()); + resultDTO.setSpend(entity.getSpend()); + resultDTO.setUsable(entity.getTotal() - entity.getSpend()); } - list.add(party); + return resultDTO; + } - return list; + /** + * 活跃积分 + * + * @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/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..058d6db765 --- /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/PointAditiveRecordDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveRecordDao.xml deleted file mode 100644 index 4839dd26fa..0000000000 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveRecordDao.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ 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 index 6daa8936d8..500b87339d 100644 --- 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 @@ -37,5 +37,94 @@ + + + + + + + + + + + + + + + + + + + + + + + \ 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/PointAditiveCalcDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardRuleDao.xml similarity index 62% rename from epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveCalcDao.xml rename to epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardRuleDao.xml index c015362019..e0fb760bd7 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveCalcDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRewardRuleDao.xml @@ -1,15 +1,13 @@ - + - + - - - - + + 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/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/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