From 6b8131766ade76b1ca2b2968bfff7afe756a926d Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 5 Nov 2020 17:42:04 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8B=8B=E7=AB=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisUtils.java | 41 ++++++++- .../epmet/dto/form/UserBadgeUnitFormDTO.java | 48 ++++++++++ .../com/epmet/constant/UserRedisKeys.java | 10 ++ .../src/main/java/com/epmet/dao/BadgeDao.java | 10 ++ .../java/com/epmet/redis/UserBadgeRedis.java | 92 ++++++++++++++++--- .../src/main/resources/mapper/BadgeDao.xml | 39 ++++++++ 6 files changed, 227 insertions(+), 13 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 27a081dacc..db65ca6e0d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/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 List lrange(String key,long start,long end,Class clazz){ + List 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");}finally{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); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java new file mode 100644 index 0000000000..406f527bb9 --- /dev/null +++ b/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); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java index f4fffb6975..599beea58f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java +++ b/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(userId);} } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index 965f753b6e..3b3fa6c596 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; 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 +106,13 @@ public interface BadgeDao extends BaseDao { * @return void */ void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + /** + * @Description 查询客户的徽章 + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.05 15:50 + */ + List selectCustomerBadgePool(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index c9eaee4367..0fc766cdf6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -1,13 +1,26 @@ package com.epmet.redis; + +import cn.hutool.json.JSONUtil; 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.BadgeListResultDTO; 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 +29,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 userBadge, String customerId){ - redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1); + public void setCustomerBadge(List 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 +83,7 @@ public class UserBadgeRedis { } /** - * @Description 获取徽章审核 手机验证码 + * @Description 获取徽章审核 手机验证码 * @Param mobile * @author zxc * @date 2020/11/5 10:30 上午 @@ -76,4 +94,56 @@ public class UserBadgeRedis { return smsCode; } -} + /** + * @param userId + * @return java.util.List + * @Description 获取用户的全部勋章信息(点亮的 、 排序从前到后) + * @author wangc + * @date 2020.11.05 13:26 + */ + public List obtainUserBadge2List(String userId) { + //TODO 补偿 + return redisUtils.lrange(UserRedisKeys.getResiUserKey(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 orient = obtainUserBadge2List(userId); + UserBadgeUnitFormDTO unit = null; + + if (!CollectionUtils.isEmpty(orient)) { + Optional 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); + } + } + + //徽章池 + List badgePool = + Optional.ofNullable(JSON.parseArray(getCustomerBadge(customerId).toString(), UserBadgeListResultDTO.class)) + .orElse(badgeDao.selectCustomerBadgePool(customerId)); + if (CollectionUtils.isEmpty(badgePool)) { + log.error("com.epmet.redis.UserBadgeRedis.pushOrRemoveUserBadge4List,缓存中客户{}下的徽章池为空", customerId); + return NumConstant.ZERO; + } + + if (null == unit) { + Optional 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; + } + + } + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 322604bc70..d66bb7194a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -112,5 +112,44 @@ select * from badge where DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND ID = #{badgeId} + + \ No newline at end of file From cca7e6eb309fdb7f9f7ad3ca2be377cabc6d56f8 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 6 Nov 2020 09:11:51 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8B=8B=E7=AB=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/BadgeController.java | 5 +++++ .../main/java/com/epmet/redis/UserBadgeRedis.java | 5 ++++- .../main/java/com/epmet/service/BadgeService.java | 2 ++ .../com/epmet/service/impl/BadgeServiceImpl.java | 12 ++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index 92a2621013..463fa4874a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -100,5 +100,10 @@ public class BadgeController { return new Result(); } + @PostMapping("test-cache") + public Result testCache(){ + badgeService.testCache(); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 0fc766cdf6..da4eecfd5b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -127,8 +127,11 @@ public class UserBadgeRedis { } //徽章池 + Object badgeObj = getCustomerBadge(customerId); + List badgePool = - Optional.ofNullable(JSON.parseArray(getCustomerBadge(customerId).toString(), UserBadgeListResultDTO.class)) + null == badgeObj ? null : + Optional.ofNullable(JSON.parseArray(badgeObj.toString(), UserBadgeListResultDTO.class)) .orElse(badgeDao.selectCustomerBadgePool(customerId)); if (CollectionUtils.isEmpty(badgePool)) { log.error("com.epmet.redis.UserBadgeRedis.pushOrRemoveUserBadge4List,缓存中客户{}下的徽章池为空", customerId); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index 7b73e28561..f041e19286 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -147,4 +147,6 @@ public interface BadgeService extends BaseService { * @return void */ void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO); + + void testCache(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 021b0c734a..21462c8b7d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -33,12 +33,15 @@ 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.form.UserBadgeUnitFormDTO; 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.redis.UserBadgeRedis; import com.epmet.service.BadgeCertificationConfigService; import com.epmet.service.BadgeService; +import com.epmet.service.UserBadgeService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -61,6 +64,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Autowired private BadgeCertificationConfigService badgeCertificationConfigService; + @Autowired + private UserBadgeRedis badgeRedis; @Override @@ -245,4 +250,11 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); } + @Override + public void testCache() { + badgeRedis.pushOrRemoveUserBadge4List("test-wc","1","45687aa479955f9d06204d415238f7cc"); + List cache = badgeRedis.obtainUserBadge2List("test-wc"); + System.out.println(cache); + } + } \ No newline at end of file From b4b2f872e839fb9cca9645c4e705e0c00c205920 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 6 Nov 2020 09:36:20 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E8=AE=A2=E9=98=85=E7=9B=B8=E5=90=8C?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + .../com/epmet/constant/BadgeConstant.java | 6 + .../dto/UserBadgeCertificateRecordDTO.java | 2 +- .../com/epmet/dto/form/BadgeAuditFormDTO.java | 20 +++ .../java/com/epmet/dto/form/BadgeFormDTO.java | 8 ++ .../dto/result/BadgeAuditRecordResultDTO.java | 43 +++++++ .../dto/result/BadgeAuditingResultDTO.java | 43 +++++++ .../com/epmet/controller/BadgeController.java | 44 +++++++ .../src/main/java/com/epmet/dao/BadgeDao.java | 27 ++++ .../dao/UserBadgeCertificateRecordDao.java | 33 +++++ .../UserBadgeCertificateRecordEntity.java | 116 ++++++++++++++++++ .../java/com/epmet/service/BadgeService.java | 33 +++++ .../UserBadgeCertificateRecordService.java | 95 ++++++++++++++ .../epmet/service/impl/BadgeServiceImpl.java | 88 ++++++++++++- ...UserBadgeCertificateRecordServiceImpl.java | 100 +++++++++++++++ .../src/main/resources/mapper/BadgeDao.xml | 72 ++++++++++- .../mapper/UserBadgeCertificateRecordDao.xml | 32 +++++ 17 files changed, 754 insertions(+), 9 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 2242a9ef9c..e864c6b743 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -97,6 +97,7 @@ public enum EpmetErrorCode { //徽章管理 DUPLICATE_BADGE_NAME(8515, "徽章名已存在"), + DUPLICATE_PARTY_BADGE_NAME(8516, "不可删除党员徽章"), // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index 315bf66a30..f8b6dcc2e5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/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"; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java index ffa2be3013..820f0fa45c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java +++ b/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; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java new file mode 100644 index 0000000000..f7d3deac7d --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java index 4b35497e8b..e9702144f0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java +++ b/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; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java new file mode 100644 index 0000000000..363441ad46 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java new file mode 100644 index 0000000000..bbf6381d82 --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index 463fa4874a..12042c4fbd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/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; @@ -105,5 +108,46 @@ public class BadgeController { badgeService.testCache(); return new Result(); } + /** + * 待审核列表 + * @author zhaoqifeng + * @date 2020/11/5 9:51 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("auditinglist") + public Result> auditingList(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + List result = badgeService.auditingList(tokenDto, formDTO); + return new Result>().ok(result); + } + + /** + * 审核历史列表 + * @author zhaoqifeng + * @date 2020/11/5 10:59 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("auditrecord") + public Result> auditRecord(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + List result = badgeService.auditRecord(tokenDto, formDTO); + return new Result>().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(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index 3b3fa6c596..a0c2fb42b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +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; @@ -107,6 +109,31 @@ public interface BadgeDao extends BaseDao { */ 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 + */ + List 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 + */ + List selectAuditRecord(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, + @Param("pageSize") Integer pageSize); + /** * @Description 查询客户的徽章 * @param customerId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java new file mode 100644 index 0000000000..f7f4dba91c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +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 { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java new file mode 100644 index 0000000000..867ae11bdb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index f041e19286..9b13682b6f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/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; @@ -148,5 +151,35 @@ public interface BadgeService extends BaseService { */ void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO); + /** + * 待审核列表 + * @author zhaoqifeng + * @date 2020/11/5 9:50 + * @param tokenDto + * @param formDTO + * @return java.util.List + */ + List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO); + + /** + * 审核历史列表 + * @author zhaoqifeng + * @date 2020/11/5 10:59 + * @param tokenDto + * @param formDTO + * @return java.util.List + */ + List 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(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java new file mode 100644 index 0000000000..154c8685db --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-05 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-05 + */ + List list(Map 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); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 21462c8b7d..4f461457f8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -30,9 +30,13 @@ 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.UserBadgeCertificateRecordDTO; 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.form.UserBadgeUnitFormDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; @@ -41,6 +45,7 @@ import com.epmet.entity.BadgeEntity; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.BadgeCertificationConfigService; import com.epmet.service.BadgeService; +import com.epmet.service.UserBadgeCertificateRecordService; import com.epmet.service.UserBadgeService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -48,10 +53,7 @@ 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.*; /** * 徽章 @@ -65,6 +67,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Autowired private BadgeCertificationConfigService badgeCertificationConfigService; @Autowired + private UserBadgeCertificateRecordService userBadgeCertificateRecordService; + @Autowired private UserBadgeRedis badgeRedis; @@ -164,6 +168,9 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.insertBatch(badgeList); + if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { + //TODO 更新Redis + } } /** @@ -225,6 +232,9 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); + if (BadgeConstant.OFFLINE.equals(formDTO.getBadgeStatus())) { + //TODO 更新Redis + } } /** @@ -241,13 +251,83 @@ public class BadgeServiceImpl extends BaseServiceImpl imp BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId()); if (null == badgeEntity) { badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId()); + if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { + throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); + } badgeEntity.setCustomerId(tokenDto.getCustomerId()); badgeEntity.setDelFlag(NumConstant.ONE_STR); baseDao.insert(badgeEntity); } 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()); + //TODO 更新Redis + } + + /** + * 待审核列表 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/5 9:50 + */ + @Override + public List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); + list.forEach(item -> { + item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); + }); + return list; + } + + /** + * 审核历史列表 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/5 10:59 + */ + @Override + public List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); + list.forEach(item -> { + item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); + }); + return list; + } + + /** + * 审核 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/5 11:08 + */ + @Override + public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { + UserBadgeCertificateRecordDTO dto = new UserBadgeCertificateRecordDTO(); + dto.setId(formDTO.getRecordId()); + dto.setAuditStatus(formDTO.getAuditStatus()); + dto.setAuditRemark(formDTO.getAuditRemark()); + dto.setStaffId(tokenDto.getUserId()); + dto.setAuditTime(new Date()); + + userBadgeCertificateRecordService.update(dto); + + if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { + //TODO 更新Redis + } } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java new file mode 100644 index 0000000000..6f798abc79 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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 implements UserBadgeCertificateRecordService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserBadgeCertificateRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserBadgeCertificateRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public 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)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index d66bb7194a..978a9cf13b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -44,7 +44,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 @@ -65,7 +65,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} + + - \ No newline at end of file + + + + + + + From a3ec6bacde0e8381db0423a656a5689eafb8857f Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 15:29:08 +0800 Subject: [PATCH 09/15] =?UTF-8?q?url=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/CustomerAgencyController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 6701fc7bee..3d14c14ea7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -255,7 +255,7 @@ public class CustomerAgencyController { * @Author liushaowen * @Date 2020/11/6 13:51 */ - @PostMapping("getAgencyElementTree") + @PostMapping("getagencyelementtree") public Result getAgencyElementTree(String customerId){ if (StringUtils.isBlank(customerId)){ throw new RenException("customerId不能为空"); From 8b605530dff0b96658ef34bbe03393fce1cd9bda Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 6 Nov 2020 15:40:35 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/UserBadgeServiceImpl.java | 4 +--- .../src/main/resources/mapper/BadgeDao.xml | 2 +- .../src/main/resources/mapper/UserBadgeDao.xml | 15 ++++++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 32b0cef882..e152d83c20 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -20,7 +20,6 @@ import com.epmet.service.UserBadgeService; import com.epmet.service.UserBaseInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -28,8 +27,6 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; /** * @Author zxc @@ -251,6 +248,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { } userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); } + userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 978a9cf13b..e7d0243bf8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -42,7 +42,7 @@ WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' UNION ALL SELECT * FROM badge a - WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' + 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 diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 022d95e7f8..0f305f3303 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/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 From 949a6046a174947c61a07ff499a2e4479305be93 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 6 Nov 2020 16:01:28 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ResiUserBadgeDTO.java | 101 ++++++++++++++++++ .../src/main/java/com/epmet/dao/BadgeDao.java | 10 ++ .../java/com/epmet/dao/ResiUserBadgeDao.java | 33 ++++++ .../com/epmet/entity/ResiUserBadgeEntity.java | 71 ++++++++++++ .../epmet/service/ResiUserBadgeService.java | 95 ++++++++++++++++ .../epmet/service/impl/BadgeServiceImpl.java | 95 +++++++++------- .../impl/ResiUserBadgeServiceImpl.java | 101 ++++++++++++++++++ .../service/impl/UserBadgeServiceImpl.java | 3 + .../src/main/resources/mapper/BadgeDao.xml | 31 +++++- .../resources/mapper/ResiUserBadgeDao.xml | 23 ++++ 10 files changed, 521 insertions(+), 42 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java new file mode 100644 index 0000000000..21e910101f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 默认配置id:default + */ + 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; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index a0c2fb42b6..e20fd8a523 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -18,6 +18,7 @@ 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; @@ -142,4 +143,13 @@ public interface BadgeDao extends BaseDao { * @date 2020.11.05 15:50 */ List selectCustomerBadgePool(@Param("customerId") String customerId); + + /** + * 插入数据 + * @author zhaoqifeng + * @date 2020/11/6 14:46 + * @param entity + * @return void + */ + void insertBadge(BadgeDTO dto); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java new file mode 100644 index 0000000000..0448b16cee --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +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 { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java new file mode 100644 index 0000000000..4087df8fc6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +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 默认配置id:default + */ + 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; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java new file mode 100644 index 0000000000..b858776d51 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-06 + */ + List list(Map 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); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 36ea72d2ff..89c6b72a75 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -30,23 +30,17 @@ 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.ResiUserBadgeDTO; import com.epmet.dto.UserBadgeCertificateRecordDTO; -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.form.*; import com.epmet.dto.result.BadgeAuditRecordResultDTO; import com.epmet.dto.result.BadgeAuditingResultDTO; -import com.epmet.dto.form.UserBadgeUnitFormDTO; 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.redis.UserBadgeRedis; -import com.epmet.service.BadgeCertificationConfigService; -import com.epmet.service.BadgeService; -import com.epmet.service.UserBadgeCertificateRecordService; -import com.epmet.service.UserBadgeService; +import com.epmet.service.*; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -70,6 +64,10 @@ public class BadgeServiceImpl extends BaseServiceImpl imp private UserBadgeCertificateRecordService userBadgeCertificateRecordService; @Autowired private UserBadgeRedis badgeRedis; + @Autowired + private UserBadgeService userBadgeService; + @Autowired + private ResiUserBadgeService resiUserBadgeService; @Override @@ -127,7 +125,7 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 获取徽章列表 * - * @param customerId + * @param customerId 客户ID * @return java.util.List * @author zhaoqifeng * @date 2020/11/3 17:04 @@ -140,8 +138,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 添加徽章 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/4 10:09 @@ -168,16 +166,17 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.insertBatch(badgeList); + //更新Redis if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { - //TODO 更新Redis + 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 @@ -193,8 +192,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 编辑徽章 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/4 14:28 @@ -232,16 +231,15 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); - if (BadgeConstant.OFFLINE.equals(formDTO.getBadgeStatus())) { - //TODO 更新Redis - } + //更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); } /** * 删除徽章 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/4 15:34 @@ -254,9 +252,14 @@ public class BadgeServiceImpl extends BaseServiceImpl imp if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); } - badgeEntity.setCustomerId(tokenDto.getCustomerId()); - badgeEntity.setDelFlag(NumConstant.ONE_STR); - baseDao.insert(badgeEntity); + 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()); @@ -264,14 +267,15 @@ public class BadgeServiceImpl extends BaseServiceImpl imp baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); } badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); - //TODO 更新Redis + //更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); } /** * 待审核列表 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return java.util.List * @author zhaoqifeng * @date 2020/11/5 9:50 @@ -280,17 +284,15 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); - list.forEach(item -> { - item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); - }); + list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } /** * 审核历史列表 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return java.util.List * @author zhaoqifeng * @date 2020/11/5 10:59 @@ -299,25 +301,22 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); - list.forEach(item -> { - item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); - }); + list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } /** * 审核 * - * @param tokenDto - * @param formDTO + * @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 = new UserBadgeCertificateRecordDTO(); - dto.setId(formDTO.getRecordId()); + UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); dto.setAuditStatus(formDTO.getAuditStatus()); dto.setAuditRemark(formDTO.getAuditRemark()); dto.setStaffId(tokenDto.getUserId()); @@ -325,8 +324,22 @@ public class BadgeServiceImpl extends BaseServiceImpl imp 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())) { - //TODO 更新Redis + //更新Redis + OpenedOrClosedFormDTO openedOrClosedFormDTO = new OpenedOrClosedFormDTO(); + openedOrClosedFormDTO.setCustomerId(dto.getCustomerId()); + openedOrClosedFormDTO.setUserId(dto.getUserId()); + openedOrClosedFormDTO.setBadgeId(dto.getBadgeId()); + userBadgeService.openedOrClosed(openedOrClosedFormDTO); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java new file mode 100644 index 0000000000..7c0730af71 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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 implements ResiUserBadgeService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiUserBadgeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiUserBadgeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public 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)); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index e152d83c20..6b65ba600a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -20,6 +20,7 @@ import com.epmet.service.UserBadgeService; import com.epmet.service.UserBaseInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,6 +28,8 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zxc diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index e7d0243bf8..91267d3a5b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -17,6 +17,35 @@ + + 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}); + + update badge set BADGE_NAME = #{badgeName}, @@ -42,7 +71,7 @@ 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' + 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)) t ORDER BY diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml new file mode 100644 index 0000000000..221c9c3d3f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 06f4e7634dfb0eea7aa5848217026ceff843b782 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 16:19:05 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=88=86=E4=B8=BA=E4=B8=A4=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerAgencyController.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 3d14c14ea7..3135924fdd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -43,6 +43,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Map; +import java.util.Set; /** @@ -255,11 +256,25 @@ public class CustomerAgencyController { * @Author liushaowen * @Date 2020/11/6 13:51 */ - @PostMapping("getagencyelementtree") - public Result getAgencyElementTree(String customerId){ + @PostMapping("getagencyelementtreelist") + public Result> getAgencyElementTreeList(String customerId){ if (StringUtils.isBlank(customerId)){ throw new RenException("customerId不能为空"); } - return new Result().ok(customerAgencyService.getAgencyElementTree(customerId)); + return new Result>().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> getAgencyElementTreeKeys(String customerId){ + if (StringUtils.isBlank(customerId)){ + throw new RenException("customerId不能为空"); + } + return new Result>().ok(customerAgencyService.getAgencyElementTree(customerId).getDefaultKeys()); } } From 0c482e3c6ded0527a961b2bebbb0fc65776e4b85 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 17:12:11 +0800 Subject: [PATCH 13/15] =?UTF-8?q?user=5Fadvice=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/AgencyElementTreeResultDTO.java | 33 +++++++++++ .../java/com/epmet/dto/UserAdviceDTO.java | 55 ++++++++++++++++-- .../epmet/dto/form/OperAdviceListFormDTO.java | 33 +++++++++++ .../epmet/dto/form/ReplyAdviceFormDTO.java | 27 +++++++++ .../dto/result/AdviceDetailResultDTO.java | 55 ++++++++++++++++++ .../dto/result/OperAdviceListResultDTO.java | 44 +++++++++++++++ .../controller/UserAdviceController.java | 15 +++-- .../java/com/epmet/dao/UserAdviceDao.java | 12 ++-- .../com/epmet/entity/UserAdviceEntity.java | 56 +++++++++++++++++-- .../java/com/epmet/excel/UserAdviceExcel.java | 37 ++++++++++-- .../java/com/epmet/redis/UserAdviceRedis.java | 4 +- .../com/epmet/service/UserAdviceService.java | 29 +++++++--- .../service/impl/UserAdviceServiceImpl.java | 19 ++++++- .../main/resources/mapper/UserAdviceDao.xml | 25 ++++++++- 14 files changed, 404 insertions(+), 40 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java new file mode 100644 index 0000000000..90ee4f6f29 --- /dev/null +++ b/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 defaultKeys; + + private List list; + + @Data + public static class Agency{ + private String id; + + private String label; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + } + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java index 5521fa02c4..77e6494ee6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java +++ b/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; + /** * 删除标志 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java new file mode 100644 index 0000000000..e4c046e53c --- /dev/null +++ b/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; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java new file mode 100644 index 0000000000..f353919247 --- /dev/null +++ b/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 govImgList; + + private String govContent; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java new file mode 100644 index 0000000000..462f053373 --- /dev/null +++ b/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 imgList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java new file mode 100644 index 0000000000..82f5aba850 --- /dev/null +++ b/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; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 8237057e85..b98d644940 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -26,6 +26,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,15 +38,15 @@ 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; @@ -91,4 +92,10 @@ public class UserAdviceController { ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class); } -} \ No newline at end of file + @PostMapping("replyadvice") + public Result replyAdvice(ReplyAdviceFormDTO dto){ + ValidatorUtils.validateEntity(dto); + userAdviceService.replyAdvice(dto,loginUserUtil.getLoginUserId()); + return new Result(); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index 6ee2c40017..e198ef4b82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/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 { - -} \ No newline at end of file + void replyAdvice(@Param("adviceId") String adviceId, + @Param("replyContent") String replyContent, + @Param("govContent") String govContent, + @Param("replyUserId") String loginUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java index dcf168cc2d..78c246fa15 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java +++ b/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; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java index 31581f4373..9e93cb6bfc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java +++ b/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; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java index ab047022e7..d35e8427b9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java +++ b/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 { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 4e42bc095e..f13d6f9eda 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/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 { @@ -39,7 +40,7 @@ public interface UserAdviceService extends BaseService { * @param params * @return PageData * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ PageData page(Map params); @@ -49,7 +50,7 @@ public interface UserAdviceService extends BaseService { * @param params * @return java.util.List * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ List list(Map params); @@ -59,7 +60,7 @@ public interface UserAdviceService extends BaseService { * @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 { * @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 { * @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 { * @param ids * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * @Description 回复建议 + * @param dto + * @param loginUserId + * @return void + * @Author liushaowen + * @Date 2020/11/6 16:44 + */ + void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 41e1465a41..ceae0d177c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/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 implements UserAdviceService { @@ -101,4 +102,16 @@ public class UserAdviceServiceImpl extends BaseServiceImpl + + + + + + + - + + + @@ -21,5 +30,17 @@ + + 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} + - \ No newline at end of file + From 63d97ab7e960986543ffc855d8785fee0fce396b Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 17:16:59 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/UserAdviceController.java | 4 ++++ .../src/main/resources/mapper/UserAdviceDao.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index b98d644940..de9e8b00c6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/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; @@ -50,6 +51,9 @@ public class UserAdviceController { @Autowired private UserAdviceService userAdviceService; + @Autowired + private LoginUserUtil loginUserUtil; + @GetMapping("page") public Result> page(@RequestParam Map params){ PageData page = userAdviceService.page(params); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index ce16199f8e..0f7d01cd50 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -40,7 +40,7 @@ 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} + where id = #{adviceId} and del_flag = 0 From 8c6b1f60ddd7dc7f3beb688eb0da130d8773702f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 6 Nov 2020 17:40:03 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/badege/controller/BadgeController.java | 3 +-- .../java/com/epmet/modules/badege/service/BadgeService.java | 3 ++- .../epmet/modules/badege/service/impl/BadgeServiceImpl.java | 6 ++---- .../java/com/epmet/dto/form/CertificationAddFormDTO.java | 4 ++-- .../com/epmet/dto/result/CertificationDetailResultDTO.java | 2 +- .../main/java/com/epmet/controller/UserBadgeController.java | 3 +-- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 4 ++-- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 8 files changed, 12 insertions(+), 15 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java index da3bfca3d2..727e1ee1ae 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java +++ b/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); } /** diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java index 1b67df51f8..c9da1f12ed 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java +++ b/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 个人中心-取消/点亮徽章 diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index 4abc5853b6..53057f9492 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/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; } /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java index 76583e9559..ee9a71d7fc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java +++ b/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; /** * 认证说明 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java index 2120fe7fb0..cc17374704 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java +++ b/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 已认证 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index c0aa74d53e..a901d9202f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/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); } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 6b65ba600a..2f3f51ed86 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -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(); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 0f305f3303..a20a9c0e61 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -89,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,