Browse Source

Merge remote-tracking branch 'origin/dev_personal_center' into dev_temp

# Conflicts:
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
#	epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
#	epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
dev_shibei_match
zxc 5 years ago
parent
commit
5cbfc15809
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 41
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java
  3. 33
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java
  4. 37
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  5. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  6. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  7. 29
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  8. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  9. 3
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java
  10. 3
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java
  11. 6
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java
  12. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java
  13. 101
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java
  14. 55
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java
  15. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java
  16. 20
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java
  17. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java
  18. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java
  19. 33
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java
  20. 27
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java
  21. 48
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java
  22. 55
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java
  23. 43
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java
  24. 43
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java
  25. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java
  26. 44
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java
  27. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java
  28. 49
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
  29. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java
  30. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java
  31. 47
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
  32. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java
  33. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java
  34. 33
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java
  35. 71
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java
  36. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java
  37. 116
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java
  38. 37
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java
  39. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java
  40. 93
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java
  41. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
  42. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java
  43. 29
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java
  44. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java
  45. 147
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
  46. 101
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java
  47. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java
  48. 100
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java
  49. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
  50. 140
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
  51. 23
      epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml
  52. 25
      epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml
  53. 32
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml
  54. 17
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -97,6 +97,7 @@ public enum EpmetErrorCode {
//徽章管理
DUPLICATE_BADGE_NAME(8515, "徽章名已存在"),
DUPLICATE_PARTY_BADGE_NAME(8516, "不可删除党员徽章"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

41
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java

@ -9,16 +9,23 @@
package com.epmet.commons.tools.redis;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.support.atomic.RedisAtomicLong;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* Redis工具类
@ -171,10 +178,40 @@ public class RedisUtils {
}
}
public Object lindex(String key,Long index){
return redisTemplate.opsForList().index(key,index);
public Object lindex(String key,Long index){ return redisTemplate.opsForList().index(key,index);
}
public <T> List<T> lrange(String key,long start,long end,Class<T> clazz){
List<Object> content = redisTemplate.opsForList().range(key,start,end);
if(CollectionUtils.isEmpty(content)) return null;
return content.stream().map( o -> {
try {
T target = clazz.newInstance();
BeanUtils.copyProperties(o, target);
return target;
}catch (Exception e){throw new RenException("convert error");}
}).collect(Collectors.toList());
}
/**
* @Description Redis lrem :
* 根据参数 count 的值移除列表中与参数 value 相等的元素
* COUNT 的值可以是以下几种
* count > 0 : 从表头开始向表尾搜索移除与 value 相等的元素数量为 count
* count < 0 : 从表尾开始向表头搜索移除与 value 相等的元素数量为 count 的绝对值
* count = 0 : 移除表中所有与 value 相等的值
* 返回值 :
* 被移除元素的数量
* 列表不存在时返回 0
* @param key
* @param count
* @param o 这里的Object需要重写equals(FIXME 注意序列化)
* @return long
* @author wangc
* @date 2020.11.05 10:22
*/
public long lrem(String key,long count,Object o){ return redisTemplate.opsForList().remove(key,count,o);}
public Object rightPop(String key) {
return redisTemplate.opsForList().rightPop(key);
}

33
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
/**
* @description:
* @author: liushaowen
* @date: 2020/11/6 13:54
*/
@Data
public class AgencyElementTreeResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Set<String> defaultKeys;
private List<Agency> list;
@Data
public static class Agency{
private String id;
private String label;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<AgencyElementTreeResultDTO.Agency> children;
}
}

37
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.baomidou.mybatisplus.extension.api.R;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -32,12 +34,16 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.excel.CustomerAgencyExcel;
import com.epmet.service.CustomerAgencyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@ -243,6 +249,35 @@ public class CustomerAgencyController {
return new Result<StaffInAgencyListResultDTO>().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId()));
}
/**
* @Description 对外接口根据customerId返回Element UI中Tree结构的agency列表
* @param customerId
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2020/11/6 13:51
*/
@PostMapping("getagencyelementtreelist")
public Result<List<AgencyElementTreeResultDTO.Agency>> getAgencyElementTreeList(String customerId){
if (StringUtils.isBlank(customerId)){
throw new RenException("customerId不能为空");
}
return new Result<List<AgencyElementTreeResultDTO.Agency>>().ok(customerAgencyService.getAgencyElementTree(customerId).getList());
}
/**
* @Description 对外接口根据customerId返回Element UI中Tree结构的agency keys
* @param customerId
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2020/11/6 13:51
*/
@PostMapping("getagencyelementtreekeys")
public Result<Set<String>> getAgencyElementTreeKeys(String customerId){
if (StringUtils.isBlank(customerId)){
throw new RenException("customerId不能为空");
}
return new Result<Set<String>>().ok(customerAgencyService.getAgencyElementTree(customerId).getDefaultKeys());
}
/**
* @Description 对外接口-根据组织Id获取组织信息
* @author sun
@ -260,4 +295,4 @@ public class CustomerAgencyController {
Result<OrganizeTreeResultDTO> organizeTree(@PathVariable("agencyId") String agencyId) {
return new Result<OrganizeTreeResultDTO>().ok(customerAgencyService.organizeTree(agencyId));
}
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -176,6 +176,16 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
**/
AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId);
/**
* @Description 返回elementTree结构的agency树
* @param customerId
* @param pid
* @return java.util.List<com.epmet.dto.result.AgencyElementTreeResultDTO.Agency>
* @Author liushaowen
* @Date 2020/11/6 14:57
*/
List<AgencyElementTreeResultDTO.Agency> getAgencyElementTree(@Param("customerId") String customerId,@Param("pid") String pid);
/**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun
@ -196,4 +206,4 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @author sun
**/
List<OrganizeTreeResultDTO> selectAllSub(@Param("agencyId") String agencyId);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -225,4 +225,13 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @author sun
**/
OrganizeTreeResultDTO organizeTree(String agencyId);
}
/**
* @Description 运营端-返回element ui - tree 结构agency列表
* @param customerId
* @return com.epmet.dto.result.AgencyElementTreeResultDTO
* @Author liushaowen
* @Date 2020/11/6 14:02
*/
AgencyElementTreeResultDTO getAgencyElementTree(String customerId);
}

29
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1030,4 +1030,31 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return baseDao.selectorganizeTree(agencyId);
}
}
/**
* @param customerId
* @return com.epmet.dto.result.AgencyElementTreeResultDTO
* @Description 运营端-返回element ui - tree 结构agency列表
* @Author liushaowen
* @Date 2020/11/6 14:02
*/
@Override
public AgencyElementTreeResultDTO getAgencyElementTree(String customerId) {
List<AgencyElementTreeResultDTO.Agency> agencyList = baseDao.getAgencyElementTree(customerId, "0");
Set<String> defaultKeys = new HashSet<>();
traversalAgencyList(agencyList,0,defaultKeys);
AgencyElementTreeResultDTO dto = new AgencyElementTreeResultDTO();
dto.setList(agencyList);
dto.setDefaultKeys(defaultKeys);
return dto;
}
private void traversalAgencyList(List<AgencyElementTreeResultDTO.Agency> agencyList,int times,Set<String> set){
if (agencyList.size() > 0 && times < 2){
for (AgencyElementTreeResultDTO.Agency list : agencyList) {
set.add(list.getId());
times++;
traversalAgencyList(list.getChildren(),times,set);
}
}
}
}

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -373,4 +373,12 @@
</select>
<!-- sql递归 查询组织、组织下部门、组织下网格基本信息及递归查询下级信息 end-->
</mapper>
<resultMap id="elementTreeAgency" type="com.epmet.dto.result.AgencyElementTreeResultDTO$Agency">
<id column="ID" property="id"></id>
<result column="ORGANIZATION_NAME" property="label"></result>
<collection property="children" select="getAgencyElementTree" column="{pid=id,customerId=customer_id}"></collection>
</resultMap>
<select id="getAgencyElementTree" resultMap="elementTreeAgency">
select id,organization_name,customer_id from customer_agency where pid = #{pid} and customer_id = #{customerId}
</select>
</mapper>

3
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java

@ -64,8 +64,7 @@ public class BadgeController {
@PostMapping("certification/add")
public Result certificationAdd(@LoginUser TokenDto tokenDto,@RequestBody CertificationAddFormDTO certificationAddFormDTO){
ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class);
badgeService.certificationAdd(tokenDto,certificationAddFormDTO);
return new Result();
return badgeService.certificationAdd(tokenDto,certificationAddFormDTO);
}
/**

3
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java

@ -1,6 +1,7 @@
package com.epmet.modules.badege.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.dto.form.CertificationAddFormDTO;
@ -39,7 +40,7 @@ public interface BadgeService {
* @author zxc
* @date 2020/11/4 11:16 上午
*/
void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO);
Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO);
/**
* @Description 个人中心-取消/点亮徽章

6
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java

@ -86,12 +86,10 @@ public class BadgeServiceImpl implements BadgeService {
* @date 2020/11/4 11:16 上午
*/
@Override
public void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) {
public Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) {
certificationAddFormDTO.setUserId(tokenDto.getUserId());
Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO);
if (!result.success()){
throw new RenException("提交徽章认证失败......");
}
return result;
}
/**

6
epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java

@ -24,4 +24,10 @@ public interface BadgeConstant {
String SMS_CODE_KEY = "epmet:smsCode:badge:";
String PARTY ="party";
String ONLINE ="online";
String OFFLINE ="offline";
}

101
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 2020-11-06
*/
@Data
public class ResiUserBadgeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户Id 默认配置iddefault
*/
private String customerId;
/**
* 用户注册网格ID
*/
private String gridId;
/**
* 用户ID
*/
private String userId;
/**
* 徽章ID
*/
private String badgeId;
/**
* 是否开启(点亮) 1:点亮0:未点亮
*/
private Integer isOpened;
/**
* 认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected;
*/
private String certificationAutidStatus;
/**
* 删除标识 1删除0未删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

55
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java

@ -23,10 +23,10 @@ import lombok.Data;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@Data
public class UserAdviceDTO implements Serializable {
@ -43,18 +43,53 @@ public class UserAdviceDTO implements Serializable {
*/
private String customerId;
/**
* 客户名
*/
private String customerName;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织名
*/
private String agencyName;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名
*/
private String gridName;
/**
* userid
*/
private String userId;
/**
* 用户姓名
*/
private String userName;
/**
* 用户注册手机号
*/
private String regPhone;
/**
* 建议描述
*/
private String adviceContent;
/**
* 手机号
* 填写手机号
*/
private String phone;
@ -69,15 +104,25 @@ public class UserAdviceDTO implements Serializable {
private String replyContent;
/**
* 回复人
* 回复人id
*/
private String replyUser;
private String replyUserId;
/**
* 回复人姓名
*/
private String replyUserName;
/**
* 回复时间
*/
private Date replyTime;
/**
* 政府存证文字
*/
private String govContent;
/**
* 删除标志
*/

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java

@ -13,7 +13,7 @@ import java.util.Date;
public class UserBadgeCertificateRecordDTO implements Serializable {
private static final long serialVersionUID = 3207509834642386145L;
private String id;
private String customerId;
private String gridId;
private String userId;

20
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/5 11:06
*/
@NoArgsConstructor
@Data
public class BadgeAuditFormDTO implements Serializable {
private static final long serialVersionUID = 2209535364555130964L;
private String recordId;
private String auditStatus;
private String auditRemark;
}

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java

@ -13,4 +13,12 @@ import java.io.Serializable;
public class BadgeFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
private String badgeId;
/**
* 页码
*/
private Integer pageNo;
/**
* 每页显示数量
*/
private Integer pageSize;
}

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java

@ -37,7 +37,7 @@ public class CertificationAddFormDTO implements Serializable {
/**
*
*/
private String subName;
private String surname;
/**
*
@ -52,7 +52,7 @@ public class CertificationAddFormDTO implements Serializable {
/**
* 认证证件图片url
*/
private String certificate;
private String certificationImg;
/**
* 认证说明

33
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2020/11/5 17:25
*/
@Data
public class OperAdviceListFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String customerId;
private String isReply;
private String adviceType;
private String startTime;
private String endTime;
@Min(1)
private Integer pageNo;
@Min(1)
private Integer pageSize;
}

27
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @description:回复建议FormDTO
* @author: liushaowen
* @date: 2020/11/6 10:37
*/
@Data
public class ReplyAdviceFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotBlank(message = "adviceId不能为空")
private String adviceId;
@NotBlank(message = "回复内容不能为空")
private String replyContent;
private List<String> govImgList;
private String govContent;
}

48
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Objects;
/**
* @Description 用户-徽章缓存单元
* @ClassName UserBadgeUnitFormDTO
* @Auth wangc
* @Date 2020-11-05 10:00
*/
@Data
public class UserBadgeUnitFormDTO implements Serializable {
private static final long serialVersionUID = -4497394865738168850L;
/**
* 徽章Id
*/
private String badgeId;
/**
* 徽章图标 url
*/
private String badgeIcon;
/**
* 徽章名称
*/
private String badgeName;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserBadgeUnitFormDTO that = (UserBadgeUnitFormDTO) o;
return badgeId.equals(that.badgeId) &&
badgeIcon.equals(that.badgeIcon) &&
badgeName.equals(that.badgeName);
}
@Override
public int hashCode() {
return Objects.hash(badgeId, badgeIcon, badgeName);
}
}

55
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java

@ -0,0 +1,55 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @description:
* @author: liushaowen
* @date: 2020/11/5 17:37
*/
@Data
public class AdviceDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 建议id
*/
private String adviceId;
/**
* 建议内容
*/
private String adviceContent;
/**
* 电话
*/
private String phone;
/**
* 建议时间
*/
private String adviceTime;
/**
* 回复内容
*/
private String replyContent;
/**
* 回复时间
*/
private String replyTime;
/**
* 回复人
*/
private String replyUser;
/**
* 建议图片列表
*/
private List<String> imgList;
}

43
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/5 10:57
*/
@Data
public class BadgeAuditRecordResultDTO implements Serializable {
private static final long serialVersionUID = 6004101838042628105L;
/**
* 徽章Id
*/
private String badgeId;
/**
* 徽章名称
*/
private String badgeName;
/**
* 徽章图标url
*/
private String badgeIcon;
/**
* 用户Id
*/
private String userId;
/**
* 用户名
*/
private String userName;
/**
* 创建时间
*/
private Long createTime;
/**
* 用户名
*/
private String auditStatus;
}

43
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/5 9:34
*/
@NoArgsConstructor
@Data
public class BadgeAuditingResultDTO implements Serializable {
private static final long serialVersionUID = -361914591952483084L;
/**
* 徽章Id
*/
private String badgeId;
/**
* 徽章名称
*/
private String badgeName;
/**
* 徽章图标url
*/
private String badgeIcon;
/**
* 用户Id
*/
private String userId;
/**
* 用户名
*/
private String userName;
/**
* 创建时间
*/
private Long createTime;
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java

@ -26,7 +26,7 @@ public class CertificationDetailResultDTO implements Serializable {
/**
* 身份证号
*/
private String idNum;
private String idCard;
/**
* 是否认证 yes 认证 no 已认证

44
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2020/11/5 17:26
*/
@Data
public class OperAdviceListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户名
*/
private String customerName;
/**
* 建议id
*/
private String adviceId;
/**
* 是否回复 0否1是
*/
private String isReply;
/**
* 回复内容
*/
private String adviceContent;
/**
* 手机 空为*
*/
private String phone;
/**
* 建议类型 空为*
*/
private String adviceType;
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java

@ -23,4 +23,14 @@ public class UserRedisKeys {
public static String getResiUserKey(String userId){
return rootPrefix.concat("resi:user:").concat(userId);
}
/**
* @Description 用户勋章缓存 epmet:badge:user:[customerId]:[userId]
* @param userId
* @return epmet:badge:user:[customerId]:[userId]
* @author wangc
* @date 2020.11.05 13:34
*/
public static String getResiUserBadgeKey(String customerId,String userId){
return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(userId);}
}

49
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java

@ -5,8 +5,11 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.AddBadgeFormDTO;
import com.epmet.dto.form.BadgeAuditFormDTO;
import com.epmet.dto.form.BadgeFormDTO;
import com.epmet.dto.form.EditBadgeFormDTO;
import com.epmet.dto.result.BadgeAuditRecordResultDTO;
import com.epmet.dto.result.BadgeAuditingResultDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.service.BadgeService;
@ -100,5 +103,51 @@ public class BadgeController {
return new Result();
}
@PostMapping("test-cache")
public Result testCache(){
badgeService.testCache();
return new Result();
}
/**
* 待审核列表
* @author zhaoqifeng
* @date 2020/11/5 9:51
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO>>
*/
@PostMapping("auditinglist")
public Result<List<BadgeAuditingResultDTO>> auditingList(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) {
List<BadgeAuditingResultDTO> result = badgeService.auditingList(tokenDto, formDTO);
return new Result<List<BadgeAuditingResultDTO>>().ok(result);
}
/**
* 审核历史列表
* @author zhaoqifeng
* @date 2020/11/5 10:59
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO>>
*/
@PostMapping("auditrecord")
public Result<List<BadgeAuditRecordResultDTO>> auditRecord(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) {
List<BadgeAuditRecordResultDTO> result = badgeService.auditRecord(tokenDto, formDTO);
return new Result<List<BadgeAuditRecordResultDTO>>().ok(result);
}
/**
* 审核
* @author zhaoqifeng
* @date 2020/11/5 11:09
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("audit")
public Result audit(@LoginUser TokenDto tokenDto, @RequestBody BadgeAuditFormDTO formDTO) {
badgeService.audit(tokenDto, formDTO);
return new Result();
}
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java

@ -18,6 +18,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -26,6 +27,7 @@ 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.UserAdviceDTO;
import com.epmet.dto.form.ReplyAdviceFormDTO;
import com.epmet.excel.UserAdviceExcel;
import com.epmet.service.UserAdviceService;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,18 +39,21 @@ import java.util.Map;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@RestController
@RequestMapping("useradvice")
public class UserAdviceController {
@Autowired
private UserAdviceService userAdviceService;
@Autowired
private LoginUserUtil loginUserUtil;
@GetMapping("page")
public Result<PageData<UserAdviceDTO>> page(@RequestParam Map<String, Object> params){
PageData<UserAdviceDTO> page = userAdviceService.page(params);
@ -91,4 +96,10 @@ public class UserAdviceController {
ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class);
}
}
@PostMapping("replyadvice")
public Result replyAdvice(ReplyAdviceFormDTO dto){
ValidatorUtils.validateEntity(dto);
userAdviceService.replyAdvice(dto,loginUserUtil.getLoginUserId());
return new Result();
}
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java

@ -59,8 +59,7 @@ public class UserBadgeController {
*/
@PostMapping("authbadgerecord")
public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){
userBadgeService.authBadgeRecord(certificationAddFormDTO);
return new Result();
return userBadgeService.authBadgeRecord(certificationAddFormDTO);
}
/**

47
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.BadgeDTO;
import com.epmet.dto.result.BadgeAuditRecordResultDTO;
import com.epmet.dto.result.BadgeAuditingResultDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.entity.BadgeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -105,4 +109,47 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
* @return void
*/
void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/**
* 待审核列表
* @author zhaoqifeng
* @date 2020/11/5 10:01
* @param customerId
* @param pageNo
* @param pageSize
* @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO>
*/
List<BadgeAuditingResultDTO> selectAuditingList(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo,
@Param("pageSize") Integer pageSize);
/**
* 审核历史列表
* @author zhaoqifeng
* @date 2020/11/5 11:01
* @param customerId
* @param pageNo
* @param pageSize
* @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO>
*/
List<BadgeAuditRecordResultDTO> selectAuditRecord(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo,
@Param("pageSize") Integer pageSize);
/**
* @Description 查询客户的徽章
* @param customerId
* @return java.util.List<com.epmet.dto.result.UserBadgeListResultDTO>
* @author wangc
* @date 2020.11.05 15:50
*/
List<UserBadgeListResultDTO> selectCustomerBadgePool(@Param("customerId") String customerId);
/**
* 插入数据
* @author zhaoqifeng
* @date 2020/11/6 14:46
* @param entity
* @return void
*/
void insertBadge(BadgeDTO dto);
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiUserBadgeEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户徽章关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-06
*/
@Mapper
public interface ResiUserBadgeDao extends BaseDao<ResiUserBadgeEntity> {
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java

@ -20,14 +20,18 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.UserAdviceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@Mapper
public interface UserAdviceDao extends BaseDao<UserAdviceEntity> {
}
void replyAdvice(@Param("adviceId") String adviceId,
@Param("replyContent") String replyContent,
@Param("govContent") String govContent,
@Param("replyUserId") String loginUserId);
}

33
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.UserBadgeCertificateRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户认证徽章记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-05
*/
@Mapper
public interface UserBadgeCertificateRecordDao extends BaseDao<UserBadgeCertificateRecordEntity> {
}

71
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 2020-11-06
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_user_badge")
public class ResiUserBadgeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id 默认配置iddefault
*/
private String customerId;
/**
* 用户注册网格ID
*/
private String gridId;
/**
* 用户ID
*/
private String userId;
/**
* 徽章ID
*/
private String badgeId;
/**
* 是否开启(点亮) 1:点亮0:未点亮
*/
private Integer isOpened;
/**
* 认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected;
*/
private String certificationAutidStatus;
}

56
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java

@ -19,7 +19,6 @@ package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -27,10 +26,10 @@ import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@Data
@EqualsAndHashCode(callSuper=false)
@ -44,18 +43,53 @@ public class UserAdviceEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 客户名
*/
private String customerName;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织名
*/
private String agencyName;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名
*/
private String gridName;
/**
* userid
*/
private String userId;
/**
* 用户姓名
*/
private String userName;
/**
* 用户注册手机号
*/
private String regPhone;
/**
* 建议描述
*/
private String adviceContent;
/**
* 手机号
* 填写手机号
*/
private String phone;
@ -70,13 +104,23 @@ public class UserAdviceEntity extends BaseEpmetEntity {
private String replyContent;
/**
* 回复人
* 回复人id
*/
private String replyUserId;
/**
* 回复人姓名
*/
private String replyUser;
private String replyUserName;
/**
* 回复时间
*/
private Date replyTime;
/**
* 政府存证文字
*/
private String govContent;
}

116
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java

@ -0,0 +1,116 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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 2020-11-05
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("user_badge_certificate_record")
public class UserBadgeCertificateRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 用户注册网格ID
*/
private String gridId;
/**
* 用户ID
*/
private String userId;
/**
* 徽章ID
*/
private String badgeId;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 手机号
*/
private String mobile;
/**
* 身份证号 网格内去重
*/
private String idNum;
/**
* 认证证件图片
*/
private String certificationImg;
/**
* 认证说明(备注)
*/
private String remaek;
/**
* 审核状态 approved:审核通过rejected:审核驳回;auditing:审核中
*/
private String auditStatus;
/**
* 审核意见
*/
private String auditRemark;
/**
* 审核人 审核人Id
*/
private String staffId;
/**
* 审核时间
*/
private Date auditTime;
/**
* 是否是最新纪录yes最新纪录no非最新纪录
*/
private String isLast;
}

37
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java

@ -23,10 +23,10 @@ import lombok.Data;
import java.util.Date;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@Data
public class UserAdviceExcel {
@ -37,13 +37,34 @@ public class UserAdviceExcel {
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "客户名")
private String customerName;
@Excel(name = "组织ID")
private String agencyId;
@Excel(name = "组织名")
private String agencyName;
@Excel(name = "网格ID")
private String gridId;
@Excel(name = "网格名")
private String gridName;
@Excel(name = "userid")
private String userId;
@Excel(name = "用户姓名")
private String userName;
@Excel(name = "用户注册手机号")
private String regPhone;
@Excel(name = "建议描述")
private String adviceContent;
@Excel(name = "手机号")
@Excel(name = "填写手机号")
private String phone;
@Excel(name = "问题分类(gov政府software软件,逗号分隔)")
@ -52,12 +73,18 @@ public class UserAdviceExcel {
@Excel(name = "回复内容")
private String replyContent;
@Excel(name = "回复人")
private String replyUser;
@Excel(name = "回复人id")
private String replyUserId;
@Excel(name = "回复人姓名")
private String replyUserName;
@Excel(name = "回复时间")
private Date replyTime;
@Excel(name = "政府存证文字")
private String govContent;
@Excel(name = "删除标志")
private String delFlag;

4
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java

@ -22,10 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@Component
public class UserAdviceRedis {

93
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java

@ -1,13 +1,25 @@
package com.epmet.redis;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.UserRedisKeys;
import com.epmet.dao.BadgeDao;
import com.epmet.dto.form.UserBadgeUnitFormDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.service.UserBadgeService;
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.Component;
import java.util.List;
import java.util.Optional;
import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE;
@ -16,45 +28,50 @@ import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE;
* @DateTime 2020/11/3 2:21 下午
*/
@Component
@Slf4j
public class UserBadgeRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private BadgeDao badgeDao;
@Autowired
private UserBadgeService badgeService;
/**
* @Description 获取客户徽章信息
* @Description 获取客户徽章信息
* @Param customerId
* @author zxc
* @date 2020/11/3 2:50 下午
*/
public Object getCustomerBadge(String customerId){
public Object getCustomerBadge(String customerId) {
Object userBadge = redisUtils.hGet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE);
return userBadge;
}
/**
* @Description 存放客户徽章信息
* @Description 存放客户徽章信息
* @Param userBadge
* @Param customerId
* @author zxc
* @date 2020/11/3 2:51 下午
*/
public void setCustomerBadge(List<UserBadgeListResultDTO> userBadge, String customerId){
redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1);
public void setCustomerBadge(List<UserBadgeListResultDTO> userBadge, String customerId) {
redisUtils.hSet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(), -1);
}
/**
* @Description 删除客户徽章信息
* @Description 删除客户徽章信息
* @Param customerId
* @author zxc
* @date 2020/11/5 3:06 下午
*/
public void delCustomerBadge(String customerId){
redisUtils.hDel(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE);
public void delCustomerBadge(String customerId) {
redisUtils.hDel(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE);
}
/**
* @Description 存放徽章审核 手机验证码
* @Description 存放徽章审核 手机验证码
* @Param mobile
* @author zxc
* @date 2020/11/5 10:30 上午
@ -65,7 +82,7 @@ public class UserBadgeRedis {
}
/**
* @Description 获取徽章审核 手机验证码
* @Description 获取徽章审核 手机验证码
* @Param mobile
* @author zxc
* @date 2020/11/5 10:30 上午
@ -76,4 +93,58 @@ public class UserBadgeRedis {
return smsCode;
}
}
/**
* @param userId
* @return java.util.List<com.epmet.dto.form.UserBadgeUnitFormDTO>
* @Description 获取用户的全部勋章信息(点亮的 排序从前到后)
* @author wangc
* @date 2020.11.05 13:26
*/
public List<UserBadgeUnitFormDTO> obtainUserBadge2List(String userId,String customerId) {
//TODO 补偿
return redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class);
}
/**
* 用户点亮或取消徽章
* @param
* @return int
* @Description 入栈时使用lpush 出栈时使用lrem
* @author wangc
* @date 2020.11.05 13:37
*/
public long pushOrRemoveUserBadge4List(String userId, String badgeId, String customerId) {
List<UserBadgeUnitFormDTO> orient = obtainUserBadge2List(userId,customerId);
UserBadgeUnitFormDTO unit = null;
if (!CollectionUtils.isEmpty(orient)) {
Optional<UserBadgeUnitFormDTO> opt = orient.stream().filter(badge -> StringUtils.equals(badgeId, badge.getBadgeId())).findFirst();
if (opt.isPresent()) {
unit = opt.get();
return redisUtils.lrem(UserRedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ONE, unit);
}
}
//徽章池
Object badgeObj = getCustomerBadge(customerId);
List<UserBadgeListResultDTO> badgePool =
null == badgeObj ? badgeDao.selectCustomerBadgePool(customerId) : JSON.parseArray(badgeObj.toString(), UserBadgeListResultDTO.class);
if (CollectionUtils.isEmpty(badgePool)) {
log.error("com.epmet.redis.UserBadgeRedis.pushOrRemoveUserBadge4List,缓存中客户{}下的徽章池为空", customerId);
return NumConstant.ZERO;
}
if (null == unit) {
Optional<UserBadgeListResultDTO> poolOpt =
badgePool.stream().filter(badge -> StringUtils.equals(badge.getBadgeId(), badgeId)).findFirst();
if (poolOpt.isPresent()) unit = ConvertUtils.sourceToTarget(poolOpt.get(), UserBadgeUnitFormDTO.class);
else return NumConstant.ZERO;
}
redisUtils.leftPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId), unit);
return NumConstant.ONE;
}
}

35
epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java

@ -22,8 +22,11 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.BadgeDTO;
import com.epmet.dto.form.AddBadgeFormDTO;
import com.epmet.dto.form.BadgeAuditFormDTO;
import com.epmet.dto.form.BadgeFormDTO;
import com.epmet.dto.form.EditBadgeFormDTO;
import com.epmet.dto.result.BadgeAuditRecordResultDTO;
import com.epmet.dto.result.BadgeAuditingResultDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.entity.BadgeEntity;
@ -147,4 +150,36 @@ public interface BadgeService extends BaseService<BadgeEntity> {
* @return void
*/
void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO);
/**
* 待审核列表
* @author zhaoqifeng
* @date 2020/11/5 9:50
* @param tokenDto
* @param formDTO
* @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO>
*/
List<BadgeAuditingResultDTO> auditingList(TokenDto tokenDto, BadgeFormDTO formDTO);
/**
* 审核历史列表
* @author zhaoqifeng
* @date 2020/11/5 10:59
* @param tokenDto
* @param formDTO
* @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO>
*/
List<BadgeAuditRecordResultDTO> auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO);
/**
* 审核
* @author zhaoqifeng
* @date 2020/11/5 11:08
* @param tokenDto
* @param formDTO
* @return void
*/
void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO);
void testCache();
}

95
epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ResiUserBadgeDTO;
import com.epmet.entity.ResiUserBadgeEntity;
import java.util.List;
import java.util.Map;
/**
* 用户徽章关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-06
*/
public interface ResiUserBadgeService extends BaseService<ResiUserBadgeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ResiUserBadgeDTO>
* @author generator
* @date 2020-11-06
*/
PageData<ResiUserBadgeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ResiUserBadgeDTO>
* @author generator
* @date 2020-11-06
*/
List<ResiUserBadgeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ResiUserBadgeDTO
* @author generator
* @date 2020-11-06
*/
ResiUserBadgeDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-11-06
*/
void save(ResiUserBadgeDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-11-06
*/
void update(ResiUserBadgeDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-11-06
*/
void delete(String[] ids);
}

29
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java

@ -20,16 +20,17 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserAdviceDTO;
import com.epmet.dto.form.ReplyAdviceFormDTO;
import com.epmet.entity.UserAdviceEntity;
import java.util.List;
import java.util.Map;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
public interface UserAdviceService extends BaseService<UserAdviceEntity> {
@ -39,7 +40,7 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @param params
* @return PageData<UserAdviceDTO>
* @author generator
* @date 2020-11-04
* @date 2020-11-06
*/
PageData<UserAdviceDTO> page(Map<String, Object> params);
@ -49,7 +50,7 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @param params
* @return java.util.List<UserAdviceDTO>
* @author generator
* @date 2020-11-04
* @date 2020-11-06
*/
List<UserAdviceDTO> list(Map<String, Object> params);
@ -59,7 +60,7 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @param id
* @return UserAdviceDTO
* @author generator
* @date 2020-11-04
* @date 2020-11-06
*/
UserAdviceDTO get(String id);
@ -69,7 +70,7 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @param dto
* @return void
* @author generator
* @date 2020-11-04
* @date 2020-11-06
*/
void save(UserAdviceDTO dto);
@ -79,7 +80,7 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @param dto
* @return void
* @author generator
* @date 2020-11-04
* @date 2020-11-06
*/
void update(UserAdviceDTO dto);
@ -89,7 +90,17 @@ public interface UserAdviceService extends BaseService<UserAdviceEntity> {
* @param ids
* @return void
* @author generator
* @date 2020-11-04
* @date 2020-11-06
*/
void delete(String[] ids);
}
/**
* @Description 回复建议
* @param dto
* @param loginUserId
* @return void
* @Author liushaowen
* @Date 2020/11/6 16:44
*/
void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId);
}

95
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
import com.epmet.entity.UserBadgeCertificateRecordEntity;
import java.util.List;
import java.util.Map;
/**
* 用户认证徽章记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-05
*/
public interface UserBadgeCertificateRecordService extends BaseService<UserBadgeCertificateRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<UserBadgeCertificateRecordDTO>
* @author generator
* @date 2020-11-05
*/
PageData<UserBadgeCertificateRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<UserBadgeCertificateRecordDTO>
* @author generator
* @date 2020-11-05
*/
List<UserBadgeCertificateRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return UserBadgeCertificateRecordDTO
* @author generator
* @date 2020-11-05
*/
UserBadgeCertificateRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-11-05
*/
void save(UserBadgeCertificateRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-11-05
*/
void update(UserBadgeCertificateRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-11-05
*/
void delete(String[] ids);
}

147
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java

@ -30,25 +30,24 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.constant.BadgeConstant;
import com.epmet.dao.BadgeDao;
import com.epmet.dto.BadgeDTO;
import com.epmet.dto.form.AddBadgeFormDTO;
import com.epmet.dto.form.BadgeFormDTO;
import com.epmet.dto.form.EditBadgeFormDTO;
import com.epmet.dto.ResiUserBadgeDTO;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.BadgeAuditRecordResultDTO;
import com.epmet.dto.result.BadgeAuditingResultDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.entity.BadgeCertificationConfigEntity;
import com.epmet.entity.BadgeEntity;
import com.epmet.service.BadgeCertificationConfigService;
import com.epmet.service.BadgeService;
import com.epmet.redis.UserBadgeRedis;
import com.epmet.service.*;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 徽章
@ -61,6 +60,14 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
@Autowired
private BadgeCertificationConfigService badgeCertificationConfigService;
@Autowired
private UserBadgeCertificateRecordService userBadgeCertificateRecordService;
@Autowired
private UserBadgeRedis badgeRedis;
@Autowired
private UserBadgeService userBadgeService;
@Autowired
private ResiUserBadgeService resiUserBadgeService;
@Override
@ -118,7 +125,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
/**
* 获取徽章列表
*
* @param customerId
* @param customerId 客户ID
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
* @author zhaoqifeng
* @date 2020/11/3 17:04
@ -131,8 +138,8 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
/**
* 添加徽章
*
* @param tokenDto
* @param formDTO
* @param tokenDto token
* @param formDTO 入参
* @return void
* @author zhaoqifeng
* @date 2020/11/4 10:09
@ -159,13 +166,17 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
badgeList.add(badge);
});
badgeCertificationConfigService.insertBatch(badgeList);
//更新Redis
if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) {
userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId());
}
}
/**
* 徽章详情
*
* @param tokenDto
* @param formDTO
* @param tokenDto token
* @param formDTO 入参
* @return com.epmet.dto.result.BadgeDetailResultDTO
* @author zhaoqifeng
* @date 2020/11/4 14:25
@ -181,8 +192,8 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
/**
* 编辑徽章
*
* @param tokenDto
* @param formDTO
* @param tokenDto token
* @param formDTO 入参
* @return void
* @author zhaoqifeng
* @date 2020/11/4 14:28
@ -220,13 +231,15 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
badgeList.add(badge);
});
badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList);
//更新Redis
userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId());
}
/**
* 删除徽章
*
* @param tokenDto
* @param formDTO
* @param tokenDto token
* @param formDTO 入参
* @return void
* @author zhaoqifeng
* @date 2020/11/4 15:34
@ -236,13 +249,105 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId());
if (null == badgeEntity) {
badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId());
badgeEntity.setCustomerId(tokenDto.getCustomerId());
badgeEntity.setDelFlag(NumConstant.ONE_STR);
baseDao.insert(badgeEntity);
if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) {
throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode());
}
BadgeDTO badgeDTO = ConvertUtils.sourceToTarget(badgeEntity, BadgeDTO.class);
badgeDTO.setCustomerId(tokenDto.getCustomerId());
badgeDTO.setDelFlag(NumConstant.ONE_STR);
badgeDTO.setCreatedBy(tokenDto.getUserId());
badgeDTO.setCreatedTime(new Date());
badgeDTO.setUpdatedBy(tokenDto.getUserId());
badgeDTO.setUpdatedTime(new Date());
baseDao.insertBadge(badgeDTO);
} else {
if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) {
throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode());
}
baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId());
}
badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId());
//更新Redis
userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId());
}
/**
* 待审核列表
*
* @param tokenDto token
* @param formDTO 入参
* @return java.util.List<com.epmet.dto.result.BadgeAuditingResultDTO>
* @author zhaoqifeng
* @date 2020/11/5 9:50
*/
@Override
public List<BadgeAuditingResultDTO> auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
List<BadgeAuditingResultDTO> list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize());
list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY));
return list;
}
/**
* 审核历史列表
*
* @param tokenDto token
* @param formDTO 入参
* @return java.util.List<com.epmet.dto.result.BadgeAuditRecordResultDTO>
* @author zhaoqifeng
* @date 2020/11/5 10:59
*/
@Override
public List<BadgeAuditRecordResultDTO> auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) {
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
List<BadgeAuditRecordResultDTO> list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize());
list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY));
return list;
}
/**
* 审核
*
* @param tokenDto token
* @param formDTO 入参
* @return void
* @author zhaoqifeng
* @date 2020/11/5 11:08
*/
@Override
public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) {
UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId());
dto.setAuditStatus(formDTO.getAuditStatus());
dto.setAuditRemark(formDTO.getAuditRemark());
dto.setStaffId(tokenDto.getUserId());
dto.setAuditTime(new Date());
userBadgeCertificateRecordService.update(dto);
ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO();
resiUserBadgeDTO.setCustomerId(dto.getCustomerId());
resiUserBadgeDTO.setBadgeId(dto.getBadgeId());
resiUserBadgeDTO.setGridId(dto.getGridId());
resiUserBadgeDTO.setUserId(dto.getUserId());
resiUserBadgeDTO.setIsOpened(NumConstant.ZERO);
resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus());
resiUserBadgeService.save(resiUserBadgeDTO);
if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) {
//更新Redis
OpenedOrClosedFormDTO openedOrClosedFormDTO = new OpenedOrClosedFormDTO();
openedOrClosedFormDTO.setCustomerId(dto.getCustomerId());
openedOrClosedFormDTO.setUserId(dto.getUserId());
openedOrClosedFormDTO.setBadgeId(dto.getBadgeId());
userBadgeService.openedOrClosed(openedOrClosedFormDTO);
}
}
@Override
public void testCache() {
badgeRedis.pushOrRemoveUserBadge4List("test-wc","1","45687aa479955f9d06204d415238f7cc");
List<UserBadgeUnitFormDTO> cache = badgeRedis.obtainUserBadge2List("test-wc","45687aa479955f9d06204d415238f7cc");
System.out.println(cache);
}
}

101
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java

@ -0,0 +1,101 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.ResiUserBadgeDao;
import com.epmet.dto.ResiUserBadgeDTO;
import com.epmet.entity.ResiUserBadgeEntity;
import com.epmet.service.ResiUserBadgeService;
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 2020-11-06
*/
@Service
public class ResiUserBadgeServiceImpl extends BaseServiceImpl<ResiUserBadgeDao, ResiUserBadgeEntity> implements ResiUserBadgeService {
@Override
public PageData<ResiUserBadgeDTO> page(Map<String, Object> params) {
IPage<ResiUserBadgeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ResiUserBadgeDTO.class);
}
@Override
public List<ResiUserBadgeDTO> list(Map<String, Object> params) {
List<ResiUserBadgeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ResiUserBadgeDTO.class);
}
private QueryWrapper<ResiUserBadgeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResiUserBadgeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ResiUserBadgeDTO get(String id) {
ResiUserBadgeEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ResiUserBadgeDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ResiUserBadgeDTO dto) {
ResiUserBadgeEntity entity = ConvertUtils.sourceToTarget(dto, ResiUserBadgeEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ResiUserBadgeDTO dto) {
ResiUserBadgeEntity entity = ConvertUtils.sourceToTarget(dto, ResiUserBadgeEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java

@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.UserAdviceDao;
import com.epmet.dto.UserAdviceDTO;
import com.epmet.dto.form.ReplyAdviceFormDTO;
import com.epmet.entity.UserAdviceEntity;
import com.epmet.redis.UserAdviceRedis;
import com.epmet.service.UserAdviceService;
@ -38,10 +39,10 @@ import java.util.List;
import java.util.Map;
/**
* 用户建议
* user_advice
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-11-04
* @since v1.0.0 2020-11-06
*/
@Service
public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAdviceEntity> implements UserAdviceService {
@ -101,4 +102,16 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}
/**
* @param dto
* @param loginUserId
* @return void
* @Description 回复建议
* @Author liushaowen
* @Date 2020/11/6 16:44
*/
@Override
public void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId) {
baseDao.replyAdvice(dto.getAdviceId(),dto.getReplyContent(),dto.getGovContent(),loginUserId);
}
}

100
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java

@ -0,0 +1,100 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.UserBadgeCertificateRecordDao;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
import com.epmet.entity.UserBadgeCertificateRecordEntity;
import com.epmet.service.UserBadgeCertificateRecordService;
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 2020-11-05
*/
@Service
public class UserBadgeCertificateRecordServiceImpl extends BaseServiceImpl<UserBadgeCertificateRecordDao, UserBadgeCertificateRecordEntity> implements UserBadgeCertificateRecordService {
@Override
public PageData<UserBadgeCertificateRecordDTO> page(Map<String, Object> params) {
IPage<UserBadgeCertificateRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, UserBadgeCertificateRecordDTO.class);
}
@Override
public List<UserBadgeCertificateRecordDTO> list(Map<String, Object> params) {
List<UserBadgeCertificateRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, UserBadgeCertificateRecordDTO.class);
}
private QueryWrapper<UserBadgeCertificateRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<UserBadgeCertificateRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public UserBadgeCertificateRecordDTO get(String id) {
UserBadgeCertificateRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, UserBadgeCertificateRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(UserBadgeCertificateRecordDTO dto) {
UserBadgeCertificateRecordEntity entity = ConvertUtils.sourceToTarget(dto, UserBadgeCertificateRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(UserBadgeCertificateRecordDTO dto) {
UserBadgeCertificateRecordEntity entity = ConvertUtils.sourceToTarget(dto, UserBadgeCertificateRecordEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

20
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -148,8 +148,8 @@ public class UserBadgeServiceImpl implements UserBadgeService {
userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId());
form.setGridId(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId());
form.setIdNum(certificationAddFormDTO.getIdCard());
form.setCertificationImg(certificationAddFormDTO.getCertificate());
form.setSurname(certificationAddFormDTO.getSubName());
form.setCertificationImg(certificationAddFormDTO.getCertificationImg());
form.setSurname(certificationAddFormDTO.getSurname());
userBadgeDao.insertUserBadgeCertificateRecord(form);
return new Result();
}
@ -218,8 +218,9 @@ public class UserBadgeServiceImpl implements UserBadgeService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO) {
userBadgeDao.updateIsOpen(openedOrClosedFormDTO);
public void openedOrClosed(OpenedOrClosedFormDTO form) {
userBadgeDao.updateIsOpen(form);
userBadgeRedis.pushOrRemoveUserBadge4List(form.getUserId(),form.getBadgeId(),form.getCustomerId());
}
/**
@ -239,15 +240,18 @@ public class UserBadgeServiceImpl implements UserBadgeService {
List<UserBadgeListResultDTO> badgeByCustomer = groupByCustomer.get(customerId);
if (!CollectionUtils.isEmpty(badgeByCustomer)) {
resultUserBadge.forEach(r -> {
badgeByCustomer.forEach(b -> {
if (r.getBadgeId().equals(b.getBadgeId())) {
BeanUtils.copyProperties(b, r);
for (int i = NumConstant.ZERO; i < badgeByCustomer.size(); i++) {
if (r.getBadgeId().equals(badgeByCustomer.get(i).getBadgeId())) {
BeanUtils.copyProperties(badgeByCustomer.get(i), r);
badgeByCustomer.remove(badgeByCustomer.get(i));
}
});
}
});
resultUserBadge.addAll(badgeByCustomer);
}
userBadgeRedis.setCustomerBadge(resultUserBadge, customerId);
}
userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId);
}
}

140
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

@ -17,6 +17,35 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<insert id="insertBadge">
INSERT INTO badge
(`ID`,
`CUSTOMER_ID`,
`BADGE_NAME`,
`BADGE_ICON`,
`FIXATION_BADGE_TYPE`,
`BADGE_STATUS`,
`DEL_FLAG`,
`REVISION`,
`CREATED_BY`,
`CREATED_TIME`,
`UPDATED_BY`,
`UPDATED_TIME`)
VALUES
(#{id},
#{customerId},
#{badgeName},
#{badgeIcon},
#{fixationBadgeType},
#{badgeStatus},
#{delFlag},
#{revision},
#{createdBy},
#{createdTime},
#{updatedBy},
#{updatedTime});
</insert>
<update id="updateBadge" parameterType="com.epmet.entity.BadgeEntity">
update badge set
BADGE_NAME = #{badgeName},
@ -44,7 +73,7 @@
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0')) t
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t
ORDER BY
CREATED_TIME DESC
</select>
@ -65,7 +94,7 @@
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME)) t) a
WHERE BADGE_NAME = #{badgeName}
</select>
<select id="selectDetail" resultType="com.epmet.dto.result.BadgeDetailResultDTO">
@ -85,7 +114,7 @@
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME )) t) a
WHERE badgeId = #{badgeId}
</select>
<select id="getDuplicateNameForEdit" resultType="com.epmet.dto.result.BadgeListResultDTO">
@ -105,12 +134,115 @@
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME )) t) a
WHERE BADGE_NAME = #{badgeName} AND badgeId != #{badgeId}
</select>
<select id="selectBadgeInfo" resultType="com.epmet.entity.BadgeEntity">
select * from badge where DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND ID = #{badgeId}
</select>
<select id="selectAuditingList" resultType="com.epmet.dto.result.BadgeAuditingResultDTO">
SELECT
ubcr.ID,
badge.BADGE_NAME,
badge.BADGE_ICON,
ubcr.USER_ID,
ubi.REAL_NAME AS "userName",
unix_timestamp(ubcr.CREATED_TIME) AS "createTime"
FROM
user_badge_certificate_record ubcr
LEFT JOIN user_base_info ubi ON ubcr.USER_ID = ubi.USER_ID
LEFT JOIN (SELECT
ID,
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
FROM
(
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID AND b.DEL_FLAG = '0')) t) badge ON ubcr.BADGE_ID = badge.ID
WHERE
AUDIT_STATUS = 'auditing'
AND ubcr.DEL_FLAG = '0'
AND ubcr.CUSTOMER_ID = #{customerId}
ORDER BY ubcr.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectAuditRecord" resultType="com.epmet.dto.result.BadgeAuditRecordResultDTO">
SELECT
ubcr.ID,
badge.BADGE_NAME,
badge.BADGE_ICON,
ubcr.USER_ID,
ubi.REAL_NAME AS "userName",
unix_timestamp(ubcr.CREATED_TIME) AS "createTime"
FROM
user_badge_certificate_record ubcr
LEFT JOIN user_base_info ubi ON ubcr.USER_ID = ubi.USER_ID
LEFT JOIN (SELECT
ID,
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
FROM
(
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID AND b.DEL_FLAG = '0')) t) badge ON ubcr.BADGE_ID = badge.ID
WHERE
AUDIT_STATUS != 'auditing'
AND ubcr.DEL_FLAG = '0'
AND ubcr.CUSTOMER_ID = #{customerId}
ORDER BY ubcr.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<!-- 查询客户的徽章 -->
<select id="selectCustomerBadgePool" resultType="com.epmet.dto.result.UserBadgeListResultDTO">
SELECT
temp.badgeId,
temp.BADGE_ICON,
temp.BADGE_NAME,
temp.CUSTOMER_ID,
temp.UPDATED_TIME
FROM(
SELECT
ID AS badgeId,
CUSTOMER_ID,
BADGE_NAME ,
BADGE_ICON ,
UPDATED_TIME
FROM
BADGE
WHERE
DEL_FLAG = '0'
AND BADGE_STATUS = 'online'
AND CUSTOMER_ID = #{customerId}
UNION
SELECT
outter.ID AS badgeId,
outter.CUSTOMER_ID,
outter.BADGE_NAME,
outter.BADGE_ICON,
outter.UPDATED_TIME
FROM
BADGE outter
WHERE
DEL_FLAG = '0'
AND BADGE_STATUS = 'online'
AND CUSTOMER_ID = 'default'
AND NOT EXISTS ( SELECT id FROM badge WHERE del_flag = '0' AND customer_id = #{customerId} AND ID = outter.ID AND badge_status = 'online' )
) AS temp ORDER BY temp.UPDATED_TIME DESC
</select>
</mapper>

23
epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml

@ -0,0 +1,23 @@
<?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.ResiUserBadgeDao">
<resultMap type="com.epmet.entity.ResiUserBadgeEntity" id="resiUserBadgeMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
<result property="badgeId" column="BADGE_ID"/>
<result property="isOpened" column="IS_OPENED"/>
<result property="certificationAutidStatus" column="CERTIFICATION_AUTID_STATUS"/>
<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-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml

@ -6,13 +6,22 @@
<resultMap type="com.epmet.entity.UserAdviceEntity" id="userAdviceMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="agencyName" column="AGENCY_NAME"/>
<result property="gridId" column="GRID_ID"/>
<result property="gridName" column="GRID_NAME"/>
<result property="userId" column="USER_ID"/>
<result property="userName" column="USER_NAME"/>
<result property="regPhone" column="REG_PHONE"/>
<result property="adviceContent" column="ADVICE_CONTENT"/>
<result property="phone" column="PHONE"/>
<result property="adviceType" column="ADVICE_TYPE"/>
<result property="replyContent" column="REPLY_CONTENT"/>
<result property="replyUser" column="REPLY_USER"/>
<result property="replyUserId" column="REPLY_USER_ID"/>
<result property="replyUserName" column="REPLY_USER_NAME"/>
<result property="replyTime" column="REPLY_TIME"/>
<result property="govContent" column="GOV_CONTENT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
@ -21,5 +30,17 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="replyAdvice" >
update user_advice
set
reply_content = #{replyContent},
reply_user_id = #{replyUserId},
reply_time = now(),
gov_content = #{govContent},
reply_user_name = (select real_name from oper_user where user_id = #{replyUserId} and del_flag = 0),
updated_by = #{replyUserId},
updated_time = now()
where id = #{adviceId} and del_flag = 0
</update>
</mapper>
</mapper>

32
epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml

@ -0,0 +1,32 @@
<?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.UserBadgeCertificateRecordDao">
<resultMap type="com.epmet.entity.UserBadgeCertificateRecordEntity" id="userBadgeCertificateRecordMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
<result property="badgeId" column="BADGE_ID"/>
<result property="surname" column="SURNAME"/>
<result property="name" column="NAME"/>
<result property="mobile" column="MOBILE"/>
<result property="idNum" column="ID_NUM"/>
<result property="certificationImg" column="CERTIFICATION_IMG"/>
<result property="remaek" column="REMAEK"/>
<result property="auditStatus" column="AUDIT_STATUS"/>
<result property="auditRemark" column="AUDIT_REMARK"/>
<result property="staffId" column="STAFF_ID"/>
<result property="auditTime" column="AUDIT_TIME"/>
<result property="isLast" column="IS_LAST"/>
<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>

17
epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml

@ -47,11 +47,16 @@
BADGE_NAME,
BADGE_ICON,
FIXATION_BADGE_TYPE AS badgeType
FROM badge
WHERE
DEL_FLAG = '0'
AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = #{customerId})
AND BADGE_STATUS = 'online'
FROM (
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t
ORDER BY
CREATED_TIME DESC
</select>
<!-- 查询徽章认证记录 -->
@ -84,7 +89,7 @@
SELECT
SURNAME,
NAME,
ID_NUM,
ID_NUM AS idCard,
( CASE WHEN AUDIT_STATUS = 'approved' THEN 'yes' ELSE 'no' END ) AS isCertificated,
MOBILE,
CERTIFICATION_IMG,

Loading…
Cancel
Save