Browse Source

申请积分,总分查询接口

master
zhaoqifeng 3 years ago
parent
commit
d25b1c96cf
  1. 99
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/ResiUserInfoCache.java
  2. 79
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveCalcDTO.java
  3. 95
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveRecordDTO.java
  4. 80
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAnnexDTO.java
  5. 174
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointApplyDTO.java
  6. 32
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyFormDTO.java
  7. 37
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyTotalPointResultDTO.java
  8. 48
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/CommonConstant.java
  9. 49
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/ApplyStatusEnum.java
  10. 84
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointApplyController.java
  11. 5
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java
  12. 16
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveCalcDao.java
  13. 16
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveRecordDao.java
  14. 16
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAnnexDao.java
  15. 16
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointApplyDao.java
  16. 46
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveCalcEntity.java
  17. 61
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveRecordEntity.java
  18. 45
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAnnexEntity.java
  19. 144
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointApplyEntity.java
  20. 78
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveCalcService.java
  21. 78
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveRecordService.java
  22. 78
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAnnexService.java
  23. 88
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointApplyService.java
  24. 12
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java
  25. 82
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveCalcServiceImpl.java
  26. 84
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveRecordServiceImpl.java
  27. 83
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAnnexServiceImpl.java
  28. 153
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java
  29. 77
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java
  30. 22
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveCalcDao.xml
  31. 25
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveRecordDao.xml
  32. 21
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAnnexDao.xml
  33. 41
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml
  34. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java
  35. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  36. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  37. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java

99
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/ResiUserInfoCache.java

@ -0,0 +1,99 @@
package com.epmet.commons.tools.redis.common.bean;
import lombok.Data;
import java.io.Serializable;
/**
* 房屋信息缓存
* @author Administrator
*/
@Data
public class ResiUserInfoCache implements Serializable {
private String id;
/**
* 客户Id
* */
private String customerId;
/**
* 用户id
*/
private String userId;
/**
* 手机号(注册手机号)
*/
private String mobile;
/**
* 姓氏
*/
private String surname;
/**
*
*/
private String name;
/**
* 姓名
*/
private String realName;
/**
* 身份证号
*/
private String idNum;
/**
* 性别1男2女0未知
*/
private String gender;
/**
* 街道
*/
private String street;
/**
* 小区名称
*/
private String district;
/**
* 楼栋单元
*/
private String buildingAddress;
/**
* 昵称(目前来源于微信昵称后续系统可支持用户有昵称)
*/
private String nickname;
/**
* 头像目前来源于微信后续系统顾客支持上传头像
*/
private String headImgUrl;
/**
* 网格Id
* */
private String registeredGridId;
/**
* xx机关-yy网格
* */
private String registeredGridName;
/**
* 显示昵称 xx网格-y先生/女士
* */
private String showName;
/**
* xxx街道-尹女士
*/
private String userShowName;
}

79
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveCalcDTO.java

@ -0,0 +1,79 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 附加积分计算
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
public class PointAditiveCalcDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 积分类别;德育积分moral_education党建积分party_building
*/
private String categoryCode;
/**
* 积分主体ID;居民端用户ID或房屋ID
*/
private String subjectId;
/**
* 已用积分;累计已花费
*/
private Integer spend;
/**
* 总分;累计积分
*/
private Integer total;
/**
* 删除标识;0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

95
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAditiveRecordDTO.java

@ -0,0 +1,95 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 附加积分记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
public class PointAditiveRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 标题;积分变动标题或业务场景标题
*/
private String title;
/**
* 说明;积分变动的说明
*/
private String statement;
/**
* 分值
*/
private Integer pointValue;
/**
* 积分类别;德育积分moral_education党建积分party_building
*/
private String categoryCode;
/**
* 积分主体ID;居民端用户ID或房屋ID
*/
private String subjectId;
/**
* 业务主键
*/
private String businessId;
/**
* 业务编码;积分申请point_apply积分奖励point_reward积分扣罚point_fine积分花费point_cost驳回积分申请point_reject
*/
private String businessCode;
/**
* 删除标识;0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

80
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointAnnexDTO.java

@ -0,0 +1,80 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 积分相关附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
public class PointAnnexDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 业务ID;业务主键包括积分申请奖扣等业务
*/
private String businessId;
/**
* 业务编码;积分申请point_apply积分奖励point_reward积分扣罚point_fine积分花费point_cost
*/
private String businessCode;
/**
* 附件访问地址
*/
private String url;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识;0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

174
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointApplyDTO.java

@ -0,0 +1,174 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 积分申请
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
public class PointApplyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 类别ID
*/
private String categoryId;
/**
* 类别名称
*/
private String categoryName;
/**
* 类别编码;德育积分moral_education党建积分party_building
*/
private String categoryCode;
/**
* 积分规则ID
*/
private String ruleId;
/**
* 积分规则名称
*/
private String ruleName;
/**
* 申请标题;30字内
*/
private String title;
/**
* 申请内容说明;1000字内
*/
private String statement;
/**
* 申请状态;0已提交1已驳回2已通过
*/
private String status;
/**
* 申请人所属网格名称
*/
private String gridName;
/**
* 申请人所属网格ID
*/
private String gridId;
/**
* 申请人所属组织ID
*/
private String agencyId;
/**
* 上级组织ID路径
*/
private String agencyPids;
/**
* 用户ID;申请人ID居民端用户ID
*/
private String userId;
/**
* 居民ID;申请人居民IDIC_RESI_USER表主键
*/
private String icResiUser;
/**
* 房屋ID;房屋或家庭ID
*/
private String houseId;
/**
* 房屋名称;完整拼接的名称
*/
private String houseAllName;
/**
* 头像
*/
private String headImgUrl;
/**
* 昵称
*/
private String nickname;
/**
* 性别;未知0男1女2
*/
private String gender;
/**
* 姓名
*/
private String name;
/**
* 身份证号
*/
private String idCard;
/**
* 手机号
*/
private String mobile;
/**
* 审核备注
*/
private String remark;
/**
* 删除标识;0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

32
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointApplyFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/6/14 14:08
*/
@NoArgsConstructor
@Data
public class PointApplyFormDTO implements Serializable {
private static final long serialVersionUID = 4850146857511834988L;
private String customerId;
private String userId;
@NotBlank(message = "申请类别不能为空", groups = {AddGroup.class})
private String ruleId;
@NotBlank(message = "标题不能为空", groups = {AddGroup.class})
private String title;
@NotBlank(message = "申请内容不能为空", groups = {AddGroup.class})
private String statement;
@NotBlank(message = "分类不能为空", groups = {AddGroup.class})
private String categoryCode;
private List<String> annexList;
private String gridId;
}

37
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/MyTotalPointResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/6/14 15:39
*/
@Data
public class MyTotalPointResultDTO implements Serializable {
private static final long serialVersionUID = 15299506166024546L;
/**
* 德育积分moral_education党建积分party_building活跃积分active
*/
private String categoryCode;
/**
* 总积分
*/
private Integer total;
/**
* 已花费积分
*/
private Integer spend;
/**
* 可用积分
*/
private Integer usable;
public MyTotalPointResultDTO() {
this.total = 0;
this.spend = 0;
this.usable = 0;
}
}

48
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/CommonConstant.java

@ -0,0 +1,48 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.common;
import com.epmet.commons.tools.constant.Constant;
/**
* 身边党员-积分排行 入参常量
*
* @author Mark sunlightcs@gmail.com
* @since 1.1.0
*/
public interface CommonConstant extends Constant {
/**
* 德育积分
*/
String MORAL_EDUCATION = "moral_education";
/**
* 党建积分
*/
String PARTY_BUILDING = "party_building";
/**
* 活跃积分
*/
String ACTIVE = "active";
/**
* 积分申请
*/
String POINT_APPLY = "point_apply";
/**
* 积分奖励
*/
String POINT_REWARD = "point_reward";
/**
* 积分扣罚
*/
String POINT_FINE = "point_fine";
/**
* 积分花费
*/
String POINT_COST = "point_cost";
}

49
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/ApplyStatusEnum.java

@ -0,0 +1,49 @@
package com.epmet.common.enu;
import java.util.Objects;
/**
* @author Administrator
*/
public enum ApplyStatusEnum {
//审核状态
AUDITING("0", "未审核"),
REJECT("1", "未通过"),
PASSED("2", "已通过");
private String code;
private String name;
ApplyStatusEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
ApplyStatusEnum[] applyStatusEnums = values();
for (ApplyStatusEnum applyStatusEnum : applyStatusEnums) {
if (Objects.equals(applyStatusEnum.getCode(), code)) {
return applyStatusEnum.getName();
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

84
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointApplyController.java

@ -0,0 +1,84 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.PointApplyDTO;
import com.epmet.dto.form.PointApplyFormDTO;
import com.epmet.service.PointApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 积分申请
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@RestController
@RequestMapping("apply")
public class PointApplyController {
@Autowired
private PointApplyService pointApplyService;
@RequestMapping("page")
public Result<PageData<PointApplyDTO>> page(@RequestParam Map<String, Object> params){
PageData<PointApplyDTO> page = pointApplyService.page(params);
return new Result<PageData<PointApplyDTO>>().ok(page);
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<PointApplyDTO> get(@PathVariable("id") String id){
PointApplyDTO data = pointApplyService.get(id);
return new Result<PointApplyDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody PointApplyDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
pointApplyService.save(dto);
return new Result();
}
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody PointApplyDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
pointApplyService.update(dto);
return new Result();
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
pointApplyService.delete(ids);
return new Result();
}
@NoRepeatSubmit
@PostMapping("submit")
public Result submit(@LoginUser TokenDto tokenDto, @RequestBody PointApplyFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
pointApplyService.submit(formDTO);
return new Result();
}
}

5
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java

@ -232,5 +232,10 @@ public class ResiPointController {
return new Result<GridPointRankResultDTO>().ok(userPointStatisticalDailyService.gridPointRank(tokenDto, formDTO));
}
@PostMapping("total")
public Result<List<MyTotalPointResultDTO>> totalPoint(@LoginUser TokenDto tokenDto) {
return new Result<List<MyTotalPointResultDTO>>().ok(userPointTotalService.totalPoint(tokenDto));
}
}

16
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveCalcDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.PointAditiveCalcEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 附加积分计算
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Mapper
public interface PointAditiveCalcDao extends BaseDao<PointAditiveCalcEntity> {
}

16
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAditiveRecordDao.java

@ -0,0 +1,16 @@
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> {
}

16
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointAnnexDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.PointAnnexEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 积分相关附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Mapper
public interface PointAnnexDao extends BaseDao<PointAnnexEntity> {
}

16
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointApplyDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.PointApplyEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 积分申请
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Mapper
public interface PointApplyDao extends BaseDao<PointApplyEntity> {
}

46
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveCalcEntity.java

@ -0,0 +1,46 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 附加积分计算
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("point_aditive_calc")
public class PointAditiveCalcEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 积分类别;德育积分moral_education党建积分party_building
*/
private String categoryCode;
/**
* 积分主体ID;居民端用户ID或房屋ID
*/
private String subjectId;
/**
* 已用积分;累计已花费
*/
private Integer spend;
/**
* 总分;累计积分
*/
private Integer total;
}

61
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAditiveRecordEntity.java

@ -0,0 +1,61 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 附加积分记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("point_aditive_record")
public class PointAditiveRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 标题;积分变动标题或业务场景标题
*/
private String title;
/**
* 说明;积分变动的说明
*/
private String statement;
/**
* 分值
*/
private Integer pointValue;
/**
* 积分类别;德育积分moral_education党建积分party_building
*/
private String categoryCode;
/**
* 积分主体ID;居民端用户ID或房屋ID
*/
private String subjectId;
/**
* 业务主键
*/
private String businessId;
/**
* 业务编码;积分申请point_apply积分奖励point_reward积分扣罚point_fine积分花费point_cost驳回积分申请point_reject
*/
private String businessCode;
}

45
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointAnnexEntity.java

@ -0,0 +1,45 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 积分相关附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("point_annex")
public class PointAnnexEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 业务ID;业务主键包括积分申请奖扣等业务
*/
private String businessId;
/**
* 业务编码;积分申请point_apply积分奖励point_reward积分扣罚point_fine积分花费point_cost
*/
private String businessCode;
/**
* 附件访问地址
*/
private String url;
/**
* 排序
*/
private Integer sort;
}

144
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointApplyEntity.java

@ -0,0 +1,144 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 积分申请
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("point_apply")
public class PointApplyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 类别ID
*/
private String categoryId;
/**
* 类别名称
*/
private String categoryName;
/**
* 类别编码;德育积分moral_education党建积分party_building
*/
private String categoryCode;
/**
* 积分规则ID
*/
private String ruleId;
/**
* 积分规则名称
*/
private String ruleName;
/**
* 申请标题;30字内
*/
private String title;
/**
* 申请内容说明;1000字内
*/
private String statement;
/**
* 申请状态;0已提交1已驳回2已通过
*/
private String status;
/**
* 申请人所属网格名称
*/
private String gridName;
/**
* 申请人所属网格ID
*/
private String gridId;
/**
* 申请人所属组织ID
*/
private String agencyId;
/**
* 上级组织ID路径
*/
private String agencyPids;
/**
* 用户ID;申请人ID居民端用户ID
*/
private String userId;
/**
* 居民ID;申请人居民IDIC_RESI_USER表主键
*/
private String icResiUser;
/**
* 房屋ID;房屋或家庭ID
*/
private String houseId;
/**
* 房屋名称;完整拼接的名称
*/
private String houseAllName;
/**
* 头像
*/
private String headImgUrl;
/**
* 昵称
*/
private String nickname;
/**
* 性别;未知0男1女2
*/
private String gender;
/**
* 姓名
*/
private String name;
/**
* 身份证号
*/
private String idCard;
/**
* 手机号
*/
private String mobile;
/**
* 审核备注
*/
private String remark;
}

78
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveCalcService.java

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PointAditiveCalcDTO;
import com.epmet.entity.PointAditiveCalcEntity;
import java.util.List;
import java.util.Map;
/**
* 附加积分计算
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
public interface PointAditiveCalcService extends BaseService<PointAditiveCalcEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PointAditiveCalcDTO>
* @author generator
* @date 2022-06-14
*/
PageData<PointAditiveCalcDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PointAditiveCalcDTO>
* @author generator
* @date 2022-06-14
*/
List<PointAditiveCalcDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PointAditiveCalcDTO
* @author generator
* @date 2022-06-14
*/
PointAditiveCalcDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-06-14
*/
void save(PointAditiveCalcDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-06-14
*/
void update(PointAditiveCalcDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-06-14
*/
void delete(String[] ids);
}

78
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAditiveRecordService.java

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.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);
}

78
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAnnexService.java

@ -0,0 +1,78 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PointAnnexDTO;
import com.epmet.entity.PointAnnexEntity;
import java.util.List;
import java.util.Map;
/**
* 积分相关附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
public interface PointAnnexService extends BaseService<PointAnnexEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PointAnnexDTO>
* @author generator
* @date 2022-06-14
*/
PageData<PointAnnexDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PointAnnexDTO>
* @author generator
* @date 2022-06-14
*/
List<PointAnnexDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PointAnnexDTO
* @author generator
* @date 2022-06-14
*/
PointAnnexDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-06-14
*/
void save(PointAnnexDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-06-14
*/
void update(PointAnnexDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-06-14
*/
void delete(String[] ids);
}

88
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointApplyService.java

@ -0,0 +1,88 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PointApplyDTO;
import com.epmet.dto.form.PointApplyFormDTO;
import com.epmet.entity.PointApplyEntity;
import java.util.List;
import java.util.Map;
/**
* 积分申请
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
public interface PointApplyService extends BaseService<PointApplyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PointApplyDTO>
* @author generator
* @date 2022-06-14
*/
PageData<PointApplyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PointApplyDTO>
* @author generator
* @date 2022-06-14
*/
List<PointApplyDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PointApplyDTO
* @author generator
* @date 2022-06-14
*/
PointApplyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2022-06-14
*/
void save(PointApplyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2022-06-14
*/
void update(PointApplyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2022-06-14
*/
void delete(String[] ids);
/**
* 申请德育积分/党建积分
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/6/14 14:14
*/
void submit(PointApplyFormDTO formDTO);
}

12
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java

@ -18,8 +18,10 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.MyTotalPointResultDTO;
import com.epmet.dto.result.ResiPointDetailResultDTO;
import com.epmet.dto.result.ResiPointRankListResultDTO;
import com.epmet.entity.UserPointTotalEntity;
@ -69,4 +71,14 @@ public interface UserPointTotalService extends BaseService<UserPointTotalEntity>
* @date 2020.07.22 15:58
**/
ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam);
/**
* 积分总分
*
* @Param tokenDto
* @Return {@link MyTotalPointResultDTO}
* @Author zhaoqifeng
* @Date 2022/6/14 15:46
*/
List<MyTotalPointResultDTO> totalPoint(TokenDto tokenDto);
}

82
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveCalcServiceImpl.java

@ -0,0 +1,82 @@
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));
}
}

84
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAditiveRecordServiceImpl.java

@ -0,0 +1,84 @@
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));
}
}

83
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAnnexServiceImpl.java

@ -0,0 +1,83 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.PointAnnexDao;
import com.epmet.dto.PointAnnexDTO;
import com.epmet.entity.PointAnnexEntity;
import com.epmet.service.PointAnnexService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 积分相关附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Service
public class PointAnnexServiceImpl extends BaseServiceImpl<PointAnnexDao, PointAnnexEntity> implements PointAnnexService {
@Override
public PageData<PointAnnexDTO> page(Map<String, Object> params) {
IPage<PointAnnexEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PointAnnexDTO.class);
}
@Override
public List<PointAnnexDTO> list(Map<String, Object> params) {
List<PointAnnexEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PointAnnexDTO.class);
}
private QueryWrapper<PointAnnexEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PointAnnexEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PointAnnexDTO get(String id) {
PointAnnexEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PointAnnexDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PointAnnexDTO dto) {
PointAnnexEntity entity = ConvertUtils.sourceToTarget(dto, PointAnnexEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PointAnnexDTO dto) {
PointAnnexEntity entity = ConvertUtils.sourceToTarget(dto, PointAnnexEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

153
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointApplyServiceImpl.java

@ -0,0 +1,153 @@
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.ApplyStatusEnum;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PointAnnexDao;
import com.epmet.dao.PointApplyDao;
import com.epmet.dto.PointApplyDTO;
import com.epmet.dto.form.PointApplyFormDTO;
import com.epmet.dto.result.HomeInfoResultDTO;
import com.epmet.entity.PointAnnexEntity;
import com.epmet.entity.PointApplyEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.PointApplyService;
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.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 积分申请
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-06-14
*/
@Service
public class PointApplyServiceImpl extends BaseServiceImpl<PointApplyDao, PointApplyEntity> implements PointApplyService {
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Resource
private PointAnnexDao pointAnnexDao;
@Override
public PageData<PointApplyDTO> page(Map<String, Object> params) {
IPage<PointApplyEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PointApplyDTO.class);
}
@Override
public List<PointApplyDTO> list(Map<String, Object> params) {
List<PointApplyEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PointApplyDTO.class);
}
private QueryWrapper<PointApplyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PointApplyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PointApplyDTO get(String id) {
PointApplyEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PointApplyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PointApplyDTO dto) {
PointApplyEntity entity = ConvertUtils.sourceToTarget(dto, PointApplyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PointApplyDTO dto) {
PointApplyEntity entity = ConvertUtils.sourceToTarget(dto, PointApplyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 申请德育积分/党建积分
*
* @param formDTO
* @Param formDTO
* @Return
* @Author zhaoqifeng
* @Date 2022/6/14 14:14
*/
@Override
public void submit(PointApplyFormDTO formDTO) {
PointApplyEntity entity = ConvertUtils.sourceToTarget(formDTO, PointApplyEntity.class);
//从缓存获取网格信息
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取网格缓存失败", "获取网格缓存失败");
}
//如果申请类型为德育积分,需要获取用户所在房屋
if (CommonConstant.MORAL_EDUCATION.equals(formDTO.getCategoryCode())) {
Result<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())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法申请", "没有绑定家庭,无法申请德育积分");
}
entity.setHouseId(result.getData().getHouseId());
}
entity.setAgencyId(gridInfo.getPid());
entity.setAgencyPids(gridInfo.getPids());
entity.setStatus(ApplyStatusEnum.AUDITING.getCode());
baseDao.insert(entity);
//保存附件
if (CollectionUtils.isNotEmpty(formDTO.getAnnexList())) {
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
formDTO.getAnnexList().forEach(url -> {
PointAnnexEntity annex = new PointAnnexEntity();
annex.setCustomerId(formDTO.getCustomerId());
annex.setBusinessId(entity.getId());
annex.setBusinessCode(CommonConstant.POINT_APPLY);
annex.setUrl(url);
annex.setSort(i.getAndIncrement());
pointAnnexDao.insert(annex);
});
}
}
}

77
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java

@ -17,15 +17,22 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.common.CommonConstant;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.PointAditiveCalcDao;
import com.epmet.dao.UserPointTotalDao;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.ResiPointRankFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.PointAditiveCalcEntity;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.UserPointTotalService;
@ -33,9 +40,9 @@ import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -50,8 +57,10 @@ import java.util.stream.Collectors;
@Slf4j
public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao, UserPointTotalEntity> implements UserPointTotalService {
@Autowired
EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Resource
private PointAditiveCalcDao pointAditiveCalcDao;
/**
* @Description 获取指定居民的积分信息
@ -203,4 +212,66 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
return result;
}
/**
* 积分总分
*
* @param tokenDto
* @Param tokenDto
* @Return {@link MyTotalPointResultDTO}
* @Author zhaoqifeng
* @Date 2022/6/14 15:46
*/
@Override
public List<MyTotalPointResultDTO> totalPoint(TokenDto tokenDto) {
List<MyTotalPointResultDTO> list = new ArrayList<MyTotalPointResultDTO>();
//活跃度积分
MyTotalPointResultDTO active = new MyTotalPointResultDTO();
active.setCategoryCode(CommonConstant.ACTIVE);
ResiPointDetailResultDTO activeTotal = baseDao.selectPointByCustomerUserId(tokenDto.getUserId(), tokenDto.getCustomerId());
if (null != activeTotal) {
active.setTotal(activeTotal.getAccumulatedPoint());
active.setUsable(activeTotal.getUsablePoint());
active.setSpend(activeTotal.getAccumulatedPoint() - activeTotal.getUsablePoint());
}
list.add(active);
//德育积分
MyTotalPointResultDTO education = new MyTotalPointResultDTO();
education.setCategoryCode(CommonConstant.MORAL_EDUCATION);
//获取居民绑定的家庭
Result<HomeInfoResultDTO> result = epmetUserOpenFeignClient.getHomeInfo();
if (!result.success() || null == result.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民绑定家庭信息失败", "获取居民绑定家庭信息失败");
}
if (StringUtils.isNotBlank(result.getData().getHouseId())) {
LambdaQueryWrapper<PointAditiveCalcEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAditiveCalcEntity::getCustomerId, tokenDto.getCustomerId());
wrapper.eq(PointAditiveCalcEntity::getSubjectId, result.getData().getHouseId());
wrapper.eq(PointAditiveCalcEntity::getCategoryCode, CommonConstant.MORAL_EDUCATION);
PointAditiveCalcEntity entity = pointAditiveCalcDao.selectOne(wrapper);
if (null != entity) {
education.setTotal(entity.getTotal());
education.setSpend(entity.getSpend());
education.setUsable(entity.getTotal() - entity.getSpend());
}
}
list.add(education);
//党建积分
MyTotalPointResultDTO party = new MyTotalPointResultDTO();
party.setCategoryCode(CommonConstant.PARTY_BUILDING);
LambdaQueryWrapper<PointAditiveCalcEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PointAditiveCalcEntity::getCustomerId, tokenDto.getCustomerId());
wrapper.eq(PointAditiveCalcEntity::getSubjectId, tokenDto.getUserId());
wrapper.eq(PointAditiveCalcEntity::getCategoryCode, CommonConstant.PARTY_BUILDING);
PointAditiveCalcEntity entity = pointAditiveCalcDao.selectOne(wrapper);
if (null != entity) {
party.setTotal(entity.getTotal());
party.setSpend(entity.getSpend());
party.setUsable(entity.getTotal() - entity.getSpend());
}
list.add(party);
return list;
}
}

22
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveCalcDao.xml

@ -0,0 +1,22 @@
<?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">
<resultMap type="com.epmet.entity.PointAditiveCalcEntity" id="pointAditiveCalcMap">
<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="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>

25
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAditiveRecordDao.xml

@ -0,0 +1,25 @@
<?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>

21
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAnnexDao.xml

@ -0,0 +1,21 @@
<?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.PointAnnexDao">
<resultMap type="com.epmet.entity.PointAnnexEntity" id="pointAnnexMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="businessId" column="BUSINESS_ID"/>
<result property="businessCode" column="BUSINESS_CODE"/>
<result property="url" column="URL"/>
<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>

41
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointApplyDao.xml

@ -0,0 +1,41 @@
<?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.PointApplyDao">
<resultMap type="com.epmet.entity.PointApplyEntity" id="pointApplyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="categoryId" column="CATEGORY_ID"/>
<result property="categoryName" column="CATEGORY_NAME"/>
<result property="categoryCode" column="CATEGORY_CODE"/>
<result property="ruleId" column="RULE_ID"/>
<result property="ruleName" column="RULE_NAME"/>
<result property="title" column="TITLE"/>
<result property="statement" column="STATEMENT"/>
<result property="status" column="STATUS"/>
<result property="gridName" column="GRID_NAME"/>
<result property="gridId" column="GRID_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="agencyPids" column="AGENCY_PIDS"/>
<result property="userId" column="USER_ID"/>
<result property="icResiUser" column="IC_RESI_USER"/>
<result property="houseId" column="HOUSE_ID"/>
<result property="houseAllName" column="HOUSE_ALL_NAME"/>
<result property="headImgUrl" column="HEAD_IMG_URL"/>
<result property="nickname" column="NICKNAME"/>
<result property="gender" column="GENDER"/>
<result property="name" column="NAME"/>
<result property="idCard" column="ID_CARD"/>
<result property="mobile" column="MOBILE"/>
<result property="remark" column="REMARK"/>
<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>

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/HomeInfoResultDTO.java

@ -16,6 +16,7 @@ public class HomeInfoResultDTO implements Serializable {
private static final long serialVersionUID = -6109420020924607393L;
private String icResiUserId;
private String houseId;
private String houseName;
private String houseCode;
private String qrCodeUrl;

3
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -806,4 +806,7 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/icVolunteerPoly/volunteerDataExtraction/{customerId}")
Result volunteerDataExtraction(@PathVariable("customerId") String customerId);
@PostMapping("/epmetuser/myHome/homeInfo")
Result<HomeInfoResultDTO> getHomeInfo();
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -595,4 +595,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "volunteerDataExtraction", customerId);
}
@Override
public Result<HomeInfoResultDTO> getHomeInfo() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeInfo");
}
}

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/MyHomeServiceImpl.java

@ -183,6 +183,7 @@ public class MyHomeServiceImpl implements MyHomeService {
if (null == houseInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败");
}
resultDto.setHouseId(houseInfo.getHomeId());
resultDto.setHouseName(houseInfo.getAllName());
resultDto.setHouseCode(houseInfo.getHouseCode());
resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl());

Loading…
Cancel
Save