90 changed files with 4164 additions and 412 deletions
@ -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<ResiUserInfoCache> getUserInfo(@PathVariable("userId") String userId); |
|||
} |
@ -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<CommonUserFeignClient> { |
|||
private CommonUserFeignClientFallback fallback = new CommonUserFeignClientFallback(); |
|||
@Override |
|||
public CommonUserFeignClient create(Throwable cause) { |
|||
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause))); |
|||
return fallback; |
|||
} |
|||
|
|||
} |
@ -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<ResiUserInfoCache> getUserInfo(String userId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserInfo", userId); |
|||
} |
|||
} |
@ -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<String, Object> 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<ResiUserInfoCache> 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<String, Object> map = BeanUtil.beanToMap(resultData, false, true); |
|||
customerResiUserRedis.redisUtils.hMSet(key, map); |
|||
return resultData; |
|||
} |
|||
|
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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; |
|||
} |
@ -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<String> ids; |
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -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<String> ruleIdList; |
|||
|
|||
/** |
|||
*附件url集合 |
|||
*/ |
|||
private List<String> annexList; |
|||
/** |
|||
*备注说明 |
|||
*/ |
|||
private String statement; |
|||
|
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @program: epmet-cloud |
|||
* @description: |
|||
* @author: wangtong |
|||
* @create: 2022-06-17 10:50 |
|||
**/ |
|||
@Data |
|||
public class List4ApplyResultDTO implements Serializable { |
|||
|
|||
private String id; |
|||
|
|||
private String name; |
|||
|
|||
// private String pid;
|
|||
|
|||
private Integer pointValue; |
|||
|
|||
// private List<List4ApplyResultDTO> children = new ArrayList<>();
|
|||
} |
@ -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; |
|||
} |
@ -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<PointAdditiveRecordDailyDTO> dailyList; |
|||
} |
@ -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; |
|||
} |
|||
} |
@ -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<PageData<PointAdditiveRuleDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PointAdditiveRuleDTO> page = pointAdditiveRuleService.page(params); |
|||
return new Result<PageData<PointAdditiveRuleDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<PointAdditiveRuleDTO> get(@PathVariable("id") String id){ |
|||
PointAdditiveRuleDTO data = pointAdditiveRuleService.get(id); |
|||
return new Result<PointAdditiveRuleDTO>().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<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PointAdditiveRuleDTO> 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<List<PointAdditiveRuleDTO>> 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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
@PostMapping("subcategory/listbrief/{categoryId}") |
|||
public Result<List<PointAdditiveRuleDTO>> 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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
@PostMapping("categorydetail/{categoryId}") |
|||
public Result<CategorydetailResultDTO> 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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
@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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
@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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
@PostMapping("list4apply") |
|||
public Result<List<List4ApplyResultDTO>> 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<com.epmet.dto.PointAdditiveRuleDTO> |
|||
*/ |
|||
@PostMapping("ruledetail/{ruleId}") |
|||
public Result<PointAdditiveRuleDTO> 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); |
|||
} |
|||
} |
@ -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<PageData<PointRewardDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PointRewardDTO> page = pointRewardService.page(params); |
|||
return new Result<PageData<PointRewardDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<PointRewardDTO> get(@PathVariable("id") String id){ |
|||
PointRewardDTO data = pointRewardService.get(id); |
|||
return new Result<PointRewardDTO>().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<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PointRewardDTO> 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<com.epmet.commons.tools.page.PageData<java.util.Map<java.lang.String,java.lang.Object>>> |
|||
*/ |
|||
@PostMapping("record") |
|||
public Result<PageData<PointRewardDTO>> record(@LoginUser TokenDto tokenDto, @RequestBody RecordRewardFormDTO dto){ |
|||
ValidatorUtils.validateEntity(dto); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<PageData<PointRewardDTO>>().ok(pointRewardService.record(dto)); |
|||
} |
|||
|
|||
} |
@ -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<PageData<PointRewardRuleDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<PointRewardRuleDTO> page = pointRewardRuleService.page(params); |
|||
return new Result<PageData<PointRewardRuleDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<PointRewardRuleDTO> get(@PathVariable("id") String id){ |
|||
PointRewardRuleDTO data = pointRewardRuleService.get(id); |
|||
return new Result<PointRewardRuleDTO>().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<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<PointRewardRuleDTO> list = pointRewardRuleService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, PointRewardRuleExcel.class); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -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<PointAdditiveRecordEntity> { |
|||
/** |
|||
* 积分记录 |
|||
* |
|||
* @Param customerId |
|||
* @Param categoryCode |
|||
* @Param subjectId |
|||
* @Return {@link List< PointAdditiveRecordDailyDTO >} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/6/15 10:12 |
|||
*/ |
|||
List<PointAdditiveRecordDailyDTO> selectRecordList(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode, @Param("subjectId") String subjectId); |
|||
} |
@ -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<PointAdditiveRuleEntity> { |
|||
|
|||
/** |
|||
* @describe: 查询下级类别简要信息 |
|||
* @author wangtong |
|||
* @date 2022/6/15 10:30 |
|||
* @params [categoryId] |
|||
* @return java.util.List<com.epmet.dto.PointAdditiveRuleDTO> |
|||
*/ |
|||
List<PointAdditiveRuleDTO> 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<com.epmet.dto.PointAdditiveRuleDTO> |
|||
*/ |
|||
List<List4ApplyResultDTO> selectList4apply(List4applyFormDTO dto); |
|||
|
|||
/** |
|||
* @describe: 查询积分类别规则列表 |
|||
* @author wangtong |
|||
* @date 2022/6/15 16:43 |
|||
* @params [dto] |
|||
* @return java.util.List<com.epmet.dto.PointAdditiveRuleDTO> |
|||
*/ |
|||
List<PointAdditiveRuleDTO> 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); |
|||
} |
@ -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<PointAditiveRecordEntity> { |
|||
|
|||
} |
@ -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<PointRewardEntity> { |
|||
|
|||
/** |
|||
* @describe: 查询积分奖扣记录 |
|||
* @author wangtong |
|||
* @date 2022/6/16 14:29 |
|||
* @params [dto] |
|||
* @return java.util.List<com.epmet.dto.PointRewardDTO> |
|||
*/ |
|||
List<PointRewardDTO> selectRewardRecord(RecordRewardFormDTO dto); |
|||
} |
@ -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<PointRewardRuleEntity> { |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
|
|||
|
|||
} |
@ -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; |
|||
} |
|||
|
|||
} |
@ -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; |
|||
} |
|||
|
|||
} |
@ -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; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,101 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.PointAdditiveRecordDTO; |
|||
import com.epmet.dto.form.CommonPageUserFormDTO; |
|||
import com.epmet.dto.result.PointAdditiveRecordResultDTO; |
|||
import com.epmet.entity.PointAdditiveRecordEntity; |
|||
import com.epmet.entity.PointRewardEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 附加积分记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-14 |
|||
*/ |
|||
public interface PointAdditiveRecordService extends BaseService<PointAdditiveRecordEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PointAdditiveRecordDTO> |
|||
* @author generator |
|||
* @date 2022-06-14 |
|||
*/ |
|||
PageData<PointAdditiveRecordDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PointAdditiveRecordDTO> |
|||
* @author generator |
|||
* @date 2022-06-14 |
|||
*/ |
|||
List<PointAdditiveRecordDTO> list(Map<String, Object> 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<PointAdditiveRecordResultDTO> 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); |
|||
} |
@ -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<PointAdditiveRuleEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PointAdditiveRuleDTO> |
|||
* @author generator |
|||
* @date 2022-06-15 |
|||
*/ |
|||
PageData<PointAdditiveRuleDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PointAdditiveRuleDTO> |
|||
* @author generator |
|||
* @date 2022-06-15 |
|||
*/ |
|||
List<PointAdditiveRuleDTO> list(Map<String, Object> 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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
Result<List<PointAdditiveRuleDTO>> listbrief(String categoryId); |
|||
|
|||
/** |
|||
* @describe: 查询积分类别详情 |
|||
* @author wangtong |
|||
* @date 2022/6/15 10:49 |
|||
* @params [categoryId] |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.CategorydetailResultDTO> |
|||
*/ |
|||
Result<CategorydetailResultDTO> 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<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
Result addrule(AddruleFormDTO dto); |
|||
|
|||
/** |
|||
* @describe: [附加积分]获取允许申请的积分类别 |
|||
* @author wangtong |
|||
* @date 2022/6/15 10:23 |
|||
* @params [categoryId] |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.PointAdditiveRuleDTO>> |
|||
*/ |
|||
Result<List<List4ApplyResultDTO>> list4apply(List4applyFormDTO dto); |
|||
|
|||
/** |
|||
* @describe: 查询积分类别规则列表 |
|||
* @author wangtong |
|||
* @date 2022/6/15 10:11 |
|||
* @params [dto] |
|||
* @return com.epmet.commons.tools.utils.Result |
|||
*/ |
|||
Result<List<PointAdditiveRuleDTO>> list4tree(List4treeFormDTO dto); |
|||
|
|||
/** |
|||
* @describe: 查询积分规则详情 |
|||
* @author wangtong |
|||
* @date 2022/6/17 17:36 |
|||
* @params [categoryId] |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.PointAdditiveRuleDTO> |
|||
*/ |
|||
Result<PointAdditiveRuleDTO> 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); |
|||
} |
@ -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<PointAditiveRecordEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PointAditiveRecordDTO> |
|||
* @author generator |
|||
* @date 2022-06-14 |
|||
*/ |
|||
PageData<PointAditiveRecordDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PointAditiveRecordDTO> |
|||
* @author generator |
|||
* @date 2022-06-14 |
|||
*/ |
|||
List<PointAditiveRecordDTO> list(Map<String, Object> 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); |
|||
} |
@ -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<PointRewardRuleEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PointRewardRuleDTO> |
|||
* @author generator |
|||
* @date 2022-06-15 |
|||
*/ |
|||
PageData<PointRewardRuleDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PointRewardRuleDTO> |
|||
* @author generator |
|||
* @date 2022-06-15 |
|||
*/ |
|||
List<PointRewardRuleDTO> list(Map<String, Object> 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); |
|||
} |
@ -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<PointRewardEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<PointRewardDTO> |
|||
* @author generator |
|||
* @date 2022-06-15 |
|||
*/ |
|||
PageData<PointRewardDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<PointRewardDTO> |
|||
* @author generator |
|||
* @date 2022-06-15 |
|||
*/ |
|||
List<PointRewardDTO> list(Map<String, Object> 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<com.epmet.commons.tools.page.PageData<java.util.Map<java.lang.String,java.lang.Object>>> |
|||
*/ |
|||
PageData<PointRewardDTO> record(RecordRewardFormDTO dto); |
|||
} |
@ -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<PointAdditiveCalcDao, PointAdditiveCalcEntity> implements PointAdditiveCalcService { |
|||
|
|||
@Override |
|||
public PageData<PointAdditiveCalcDTO> page(Map<String, Object> params) { |
|||
IPage<PointAdditiveCalcEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointAdditiveCalcDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointAdditiveCalcDTO> list(Map<String, Object> params) { |
|||
List<PointAdditiveCalcEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointAdditiveCalcDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointAdditiveCalcEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointAdditiveCalcEntity> 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<PointAdditiveCalcEntity> 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(); |
|||
} |
|||
|
|||
} |
@ -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<PointAdditiveRecordDao, PointAdditiveRecordEntity> implements PointAdditiveRecordService { |
|||
|
|||
@Resource |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
@Override |
|||
public PageData<PointAdditiveRecordDTO> page(Map<String, Object> params) { |
|||
IPage<PointAdditiveRecordEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointAdditiveRecordDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointAdditiveRecordDTO> list(Map<String, Object> params) { |
|||
List<PointAdditiveRecordEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointAdditiveRecordDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointAdditiveRecordEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointAdditiveRecordEntity> 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<PointAdditiveRecordResultDTO> getRecords(CommonPageUserFormDTO formDTO) { |
|||
List<PointAdditiveRecordResultDTO> list = new ArrayList<>(); |
|||
String subjectId; |
|||
//如果申请类型为德育积分,需要获取用户所在房屋
|
|||
if (CommonConstant.MORAL_EDUCATION.equals(formDTO.getCategoryCode())) { |
|||
Result<HomeInfoResultDTO> 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<PointAdditiveRecordDailyDTO> recordList = baseDao.selectRecordList(formDTO.getCustomerId(), formDTO.getCategoryCode(), subjectId); |
|||
|
|||
if(CollectionUtils.isNotEmpty(recordList)){ |
|||
Map<String,List<PointAdditiveRecordDailyDTO>> map = |
|||
recordList.stream().collect(Collectors.groupingBy(PointAdditiveRecordDailyDTO::getDate)); |
|||
|
|||
Map<String, List<PointAdditiveRecordDailyDTO>> sortedMap = Maps.newLinkedHashMap(); |
|||
map.entrySet().stream().sorted(Map.Entry.<String, List<PointAdditiveRecordDailyDTO>>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(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,270 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.common.enu.PointAddRuleEnum; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dao.PointAdditiveRuleDao; |
|||
import com.epmet.dao.PointApplyDao; |
|||
import com.epmet.dto.CategorydetailResultDTO; |
|||
import com.epmet.dto.PointAdditiveRuleDTO; |
|||
import com.epmet.dto.form.*; |
|||
import com.epmet.dto.result.List4ApplyResultDTO; |
|||
import com.epmet.entity.PointAdditiveRuleEntity; |
|||
import com.epmet.entity.PointApplyEntity; |
|||
import com.epmet.redis.PointAdditiveRuleRedis; |
|||
import com.epmet.service.PointAdditiveRuleService; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.*; |
|||
|
|||
/** |
|||
* 附加积分规则 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-06-15 |
|||
*/ |
|||
@Service |
|||
public class PointAdditiveRuleServiceImpl extends BaseServiceImpl<PointAdditiveRuleDao, PointAdditiveRuleEntity> implements PointAdditiveRuleService { |
|||
|
|||
@Autowired |
|||
private PointAdditiveRuleRedis pointAdditiveRuleRedis; |
|||
|
|||
@Autowired |
|||
private PointApplyDao pointApplyDao; |
|||
|
|||
@Override |
|||
public PageData<PointAdditiveRuleDTO> page(Map<String, Object> params) { |
|||
IPage<PointAdditiveRuleEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointAdditiveRuleDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointAdditiveRuleDTO> list(Map<String, Object> params) { |
|||
List<PointAdditiveRuleEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointAdditiveRuleDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointAdditiveRuleEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointAdditiveRuleEntity> 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<PointAdditiveRuleEntity> wrapper = new QueryWrapper<>(queryData); |
|||
List<PointAdditiveRuleEntity> 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<PointApplyEntity> wrapper = new QueryWrapper<>(queryData); |
|||
List<PointApplyEntity> 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<List<PointAdditiveRuleDTO>> listbrief(String categoryId) { |
|||
List<PointAdditiveRuleDTO> result = baseDao.selectListbrief(categoryId); |
|||
return new Result<List<PointAdditiveRuleDTO>>().ok(result); |
|||
} |
|||
|
|||
@Override |
|||
public Result<CategorydetailResultDTO> categorydetail(String categoryId) { |
|||
CategorydetailResultDTO result = baseDao.selectCategorydetail(categoryId); |
|||
return new Result<CategorydetailResultDTO>().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<List<List4ApplyResultDTO>> list4apply(List4applyFormDTO dto) { |
|||
List<List4ApplyResultDTO> list = baseDao.selectList4apply(dto); |
|||
return new Result<List<List4ApplyResultDTO>>().ok(list); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public Result<List<PointAdditiveRuleDTO>> list4tree(List4treeFormDTO dto) { |
|||
List<PointAdditiveRuleDTO> result = baseDao.selectList4tree(dto); |
|||
return new Result<List<PointAdditiveRuleDTO>>().ok(result); |
|||
} |
|||
|
|||
@Override |
|||
public Result<PointAdditiveRuleDTO> ruledetail(String ruleId) { |
|||
PointAdditiveRuleDTO result = baseDao.selectRuledetail(ruleId); |
|||
return new Result<PointAdditiveRuleDTO>().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<PointApplyEntity> wrapper = new QueryWrapper<>(queryData); |
|||
List<PointApplyEntity> 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("修改成功!"); |
|||
} |
|||
|
|||
} |
@ -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<PointAditiveCalcDao, PointAditiveCalcEntity> implements PointAditiveCalcService { |
|||
|
|||
@Override |
|||
public PageData<PointAditiveCalcDTO> page(Map<String, Object> params) { |
|||
IPage<PointAditiveCalcEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointAditiveCalcDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointAditiveCalcDTO> list(Map<String, Object> params) { |
|||
List<PointAditiveCalcEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointAditiveCalcDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointAditiveCalcEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointAditiveCalcEntity> 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)); |
|||
} |
|||
|
|||
} |
@ -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<PointAditiveRecordDao, PointAditiveRecordEntity> implements PointAditiveRecordService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<PointAditiveRecordDTO> page(Map<String, Object> params) { |
|||
IPage<PointAditiveRecordEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointAditiveRecordDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointAditiveRecordDTO> list(Map<String, Object> params) { |
|||
List<PointAditiveRecordEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointAditiveRecordDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointAditiveRecordEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointAditiveRecordEntity> 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)); |
|||
} |
|||
|
|||
} |
@ -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<PointRewardRuleDao, PointRewardRuleEntity> implements PointRewardRuleService { |
|||
|
|||
@Autowired |
|||
private PointRewardRuleRedis pointRewardRuleRedis; |
|||
|
|||
@Override |
|||
public PageData<PointRewardRuleDTO> page(Map<String, Object> params) { |
|||
IPage<PointRewardRuleEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointRewardRuleDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointRewardRuleDTO> list(Map<String, Object> params) { |
|||
List<PointRewardRuleEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointRewardRuleDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointRewardRuleEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointRewardRuleEntity> 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); |
|||
}); |
|||
} |
|||
|
|||
} |
@ -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<PointRewardDao, PointRewardEntity> 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<PointRewardDTO> page(Map<String, Object> params) { |
|||
IPage<PointRewardEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, PointRewardDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<PointRewardDTO> list(Map<String, Object> params) { |
|||
List<PointRewardEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, PointRewardDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<PointRewardEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<PointRewardEntity> 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<PointRewardDTO> record(RecordRewardFormDTO dto) { |
|||
PageHelper.startPage(dto.getPageNo(), dto.getPageSize()); |
|||
List<PointRewardDTO> list = baseDao.selectRewardRecord(dto); |
|||
PageInfo<PointRewardDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
} |
@ -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='积分相关附件表'; |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PointAdditiveCalcDao"> |
|||
|
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PointAdditiveRecordDao"> |
|||
|
|||
<select id="selectRecordList" resultType="com.epmet.dto.result.PointAdditiveRecordDailyDTO"> |
|||
SELECT |
|||
TITLE, |
|||
STATEMENT AS remark, |
|||
IF(POINT_VALUE > 0,concat( '+', POINT_VALUE ),POINT_VALUE) AS point, |
|||
BUSINESS_ID, |
|||
BUSINESS_CODE, |
|||
DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) AS date, |
|||
DATE_FORMAT( CREATED_TIME, '%H:%i' ) AS time |
|||
FROM |
|||
point_additive_record |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND SUBJECT_ID = #{subjectId} |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND CATEGORY_CODE = #{categoryCode} |
|||
ORDER BY |
|||
CREATED_TIME DESC |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,127 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PointAdditiveRuleDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.PointAdditiveRuleEntity" id="pointAdditiveRuleMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="type" column="TYPE"/> |
|||
<result property="applyFlag" column="APPLY_FLAG"/> |
|||
<result property="categoryCode" column="CATEGORY_CODE"/> |
|||
<result property="categoryName" column="CATEGORY_NAME"/> |
|||
<result property="ruleName" column="RULE_NAME"/> |
|||
<result property="pid" column="PID"/> |
|||
<result property="pids" column="PIDS"/> |
|||
<result property="pointValue" column="POINT_VALUE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
<select id="selectListbrief" resultType="com.epmet.dto.PointAdditiveRuleDTO"> |
|||
select id, |
|||
CATEGORY_NAME |
|||
from point_additive_rule |
|||
where type = 'category' |
|||
and DEL_FLAG='0' |
|||
and pid = #{categoryId} |
|||
order by UPDATED_TIME desc |
|||
</select> |
|||
<select id="selectCategorydetail" resultType="com.epmet.dto.CategorydetailResultDTO"> |
|||
select c.id, |
|||
c.CATEGORY_NAME as categoryName, |
|||
p.id as pid, |
|||
p.CATEGORY_NAME as parentCategoryName, |
|||
c.CREATED_TIME, |
|||
c.UPDATED_TIME |
|||
from point_additive_rule c |
|||
left join point_additive_rule p on c.PID = p.id and p.DEL_FLAG='0' |
|||
where c.type='category' |
|||
and c.DEL_FLAG='0' |
|||
and c.id = #{categoryId} |
|||
</select> |
|||
<select id="selectList4apply" resultType="com.epmet.dto.result.List4ApplyResultDTO"> |
|||
select id, |
|||
RULE_NAME as name, |
|||
POINT_VALUE |
|||
from point_additive_rule |
|||
where DEL_FLAG='0' |
|||
and CATEGORY_CODE=#{categoryCode} |
|||
<if test="applyFlag != null and applyFlag != ''"> |
|||
and APPLY_FLAG= #{applyFlag} |
|||
</if> |
|||
<if test="businessCode != null and businessCode != '' and businessCode == 'point_fine'.toString()"> |
|||
and POINT_VALUE < 0 |
|||
</if> |
|||
<if test="businessCode != null and businessCode != '' and businessCode == 'point_reward'.toString()"> |
|||
and POINT_VALUE > 0 |
|||
</if> |
|||
and type='rule' |
|||
and CUSTOMER_ID=#{customerId} |
|||
order by UPDATED_TIME desc |
|||
</select> |
|||
<select id="selectList4tree" resultType="com.epmet.dto.PointAdditiveRuleDTO"> |
|||
select id, |
|||
pid, |
|||
type, |
|||
CATEGORY_NAME, |
|||
RULE_NAME, |
|||
APPLY_FLAG, |
|||
POINT_VALUE |
|||
from point_additive_rule |
|||
where DEL_FLAG='0' |
|||
<if test="categoryName != null and categoryName != ''"> |
|||
and CATEGORY_NAME= #{categoryName} |
|||
</if> |
|||
<if test="ruleName != null and ruleName != ''"> |
|||
and RULE_NAME= #{ruleName} |
|||
</if> |
|||
and CUSTOMER_ID=#{customerId} |
|||
order by UPDATED_TIME desc |
|||
</select> |
|||
<select id="selectPointTotalByIds" resultType="java.lang.Integer"> |
|||
SELECT sum(POINT_VALUE) |
|||
FROM `point_additive_rule` |
|||
where DEL_FLAG='0' |
|||
and CUSTOMER_ID=#{customerId} |
|||
<if test="ruleIdList != null and ruleIdList.size() > 0"> |
|||
AND id in |
|||
<foreach collection="ruleIdList" item="ruleId" open="(" close=")" separator=","> |
|||
#{ruleId} |
|||
</foreach> |
|||
</if> |
|||
</select> |
|||
<select id="selectEntityByName" resultType="com.epmet.entity.PointAdditiveRuleEntity"> |
|||
select * |
|||
FROM `point_additive_rule` |
|||
where DEL_FLAG='0' |
|||
and CUSTOMER_ID=#{customerId} |
|||
<if test="id != null and id != ''"> |
|||
and id != #{id} |
|||
</if> |
|||
<if test="categoryName != null and categoryName != ''"> |
|||
and CATEGORY_NAME= #{categoryName} |
|||
</if> |
|||
<if test="ruleName != null and ruleName != ''"> |
|||
and RULE_NAME= #{ruleName} |
|||
</if> |
|||
</select> |
|||
<select id="selectRuledetail" resultType="com.epmet.dto.PointAdditiveRuleDTO"> |
|||
SELECT id, |
|||
pid, |
|||
RULE_NAME, |
|||
POINT_VALUE, |
|||
APPLY_FLAG, |
|||
if(APPLY_FLAG='0','允许','禁止') as applyFlagName, |
|||
CREATED_TIME, |
|||
UPDATED_TIME |
|||
FROM point_additive_rule |
|||
WHERE DEL_FLAG='0' |
|||
AND ID=#{ruleId} |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -1,25 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PointAditiveRecordDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.PointAditiveRecordEntity" id="pointAditiveRecordMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="title" column="TITLE"/> |
|||
<result property="statement" column="STATEMENT"/> |
|||
<result property="pointValue" column="POINT_VALUE"/> |
|||
<result property="categoryCode" column="CATEGORY_CODE"/> |
|||
<result property="subjectId" column="SUBJECT_ID"/> |
|||
<result property="businessId" column="BUSINESS_ID"/> |
|||
<result property="businessCode" column="BUSINESS_CODE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,43 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PointRewardDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.PointRewardEntity" id="pointRewardMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="agencyPids" column="AGENCY_PIDS"/> |
|||
<result property="houseId" column="HOUSE_ID"/> |
|||
<result property="houseAllName" column="HOUSE_ALL_NAME"/> |
|||
<result property="staffId" column="STAFF_ID"/> |
|||
<result property="staffName" column="STAFF_NAME"/> |
|||
<result property="businessCode" column="BUSINESS_CODE"/> |
|||
<result property="statement" column="STATEMENT"/> |
|||
<result property="pointValue" column="POINT_VALUE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
<select id="selectRewardRecord" resultType="com.epmet.dto.PointRewardDTO"> |
|||
select id, |
|||
HOUSE_ID, |
|||
HOUSE_ALL_NAME, |
|||
STATEMENT, |
|||
POINT_VALUE, |
|||
CREATED_TIME |
|||
from point_reward |
|||
where DEL_FLAG='0' |
|||
and BUSINESS_CODE=#{businessCode} |
|||
and CUSTOMER_ID=#{customerId} |
|||
<if test="houseId != null and houseId != ''"> |
|||
and HOUSE_ID= #{houseId} |
|||
</if> |
|||
order by CREATED_TIME desc |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -1,15 +1,13 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PointAditiveCalcDao"> |
|||
<mapper namespace="com.epmet.dao.PointRewardRuleDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.PointAditiveCalcEntity" id="pointAditiveCalcMap"> |
|||
<resultMap type="com.epmet.entity.PointRewardRuleEntity" id="pointRewardRuleMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="categoryCode" column="CATEGORY_CODE"/> |
|||
<result property="subjectId" column="SUBJECT_ID"/> |
|||
<result property="spend" column="SPEND"/> |
|||
<result property="total" column="TOTAL"/> |
|||
<result property="rewardId" column="REWARD_ID"/> |
|||
<result property="ruleId" column="RULE_ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
Loading…
Reference in new issue