Browse Source

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

# Conflicts:
#	epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
dev_shibei_match
zxc 5 years ago
parent
commit
590e34715b
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 7
      epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml
  3. 34
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  4. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerTemplateListFormDTO.java
  5. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java
  6. 11
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java
  7. 11
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java
  8. 17
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java
  9. 5
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java
  10. 13
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml
  11. 29
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java
  12. 21
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/OperListFormDTO.java
  13. 32
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java
  14. 39
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java
  15. 51
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java
  16. 85
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java
  17. 52
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java
  18. 111
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java
  19. 55
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java
  20. 17
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java
  21. 51
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java
  22. 27
      epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java
  23. 86
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeCertificationConfigDTO.java
  24. 96
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java
  25. 45
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java
  26. 42
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddBadgeFormDTO.java
  27. 24
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AuthFieldFormDTO.java
  28. 16
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java
  29. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeSendCodeFormDTO.java
  30. 67
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java
  31. 29
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java
  32. 40
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java
  33. 52
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java
  34. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OpenedOrClosedFormDTO.java
  35. 33
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeListFormDTO.java
  36. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserOperListFormDTO.java
  37. 40
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AuthFieldResultDTO.java
  38. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeDetailResultDTO.java
  39. 31
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java
  40. 60
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java
  41. 49
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java
  42. 67
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java
  43. 46
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  44. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  45. 104
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
  46. 116
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java
  47. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java
  48. 54
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeCertificationConfigDao.java
  49. 108
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
  50. 95
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java
  51. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java
  52. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeCertificationConfigEntity.java
  53. 66
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java
  54. 69
      epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java
  55. 127
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeCertificationConfigService.java
  56. 150
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
  57. 76
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java
  58. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java
  59. 149
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeCertificationConfigServiceImpl.java
  60. 248
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
  61. 239
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java
  62. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  63. 199
      epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql
  64. 42
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeCertificationConfigDao.xml
  65. 116
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml
  66. 175
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml
  67. 10
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

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

@ -95,6 +95,9 @@ public enum EpmetErrorCode {
SIGN_IN_TIME_NO(8513, "签到时间还未到~"),
SIGN_IN_TIME_END(8514, "签到时间已结束~"),
//徽章管理
DUPLICATE_BADGE_NAME(8515, "徽章名已存在"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),
OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"),
@ -110,6 +113,8 @@ public enum EpmetErrorCode {
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"),
OPER_UPLOAD_IMG_TYPE_ERROR(8715, "请上传PNG格式的图片"),
OPER_UPLOAD_IMG_SIZE_ERROR(8716, "请上传200*200的图片"),
// 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),

7
epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml

@ -173,6 +173,13 @@
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
<!-- 屏蔽logger -->
<logger name="org.springframework" level="INFO"/>
<logger name="org.apache" level="WARN"/>
<logger name="org.mybatis.spring" level="WARN"/>
<logger name="io.netty" level="WARN"/>
<logger name="org.redisson.connection" level="WARN"/>
<logger name="org.hibernate.validator" level="WARN"/>
</springProfile>
</configuration>

34
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -10,6 +10,7 @@ package com.epmet.controller;
import com.epmet.cloud.CloudStorageConfig;
import com.epmet.cloud.OssFactory;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
@ -39,6 +40,9 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
@ -223,6 +227,36 @@ public class OssController {
return ossService.uploadImg(file);
}
@PostMapping("uploadimg/badgeicon")
public Result<UploadImgResultDTO> badgeIcon(@RequestParam("file") MultipartFile file) throws IOException {
// 校验文件类型
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType())) {
log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType());
throw new RenException(EpmetErrorCode.OPER_UPLOAD_IMG_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_IMG_TYPE_ERROR.getMsg());
}
// 校验文件体积,不超过2m
long maxSize = 2 * 1024 * 1024;
long size = file.getSize();
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
BufferedImage bufferedImage = ImageIO.read(file.getInputStream());
int width = bufferedImage.getWidth();
int height = bufferedImage.getHeight();
if (width != 200 || height != 200) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_IMG_SIZE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_IMG_SIZE_ERROR.getMsg());
}
return ossService.uploadImg(file);
}
/**
* @param byteFile fileName
* @Description 外挂-文件上传

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerTemplateListFormDTO.java

@ -22,6 +22,10 @@ public class CustomerTemplateListFormDTO implements Serializable {
*/
@NotBlank(message="公共模板Id不能为空", groups = {AddUserInternalGroup.class})
private String publicId;
/**
* 模板关键词Id
*/
private String keyIds;
public interface AddUserInternalGroup {}
}

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GetTemplateListFormDTO.java

@ -26,6 +26,10 @@ public class GetTemplateListFormDTO implements Serializable {
* 模板类型(站内信提醒)
*/
private String templateType;
/**
* 模板关键词Id
*/
private String keyIds;
public interface AddUserInternalGroup {}
}

11
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java

@ -94,4 +94,15 @@ public interface PersonalTemplateDao extends BaseDao<PersonalTemplateEntity> {
* @author sun
*/
List<CustomerTemplateListResultDTO> selectCustomerTemplateList(CustomerTemplateListFormDTO formDTO);
/**
* 根据tid和keyIds查询是否已存在该模板类型数据
* @author zhaoqifeng
* @date 2020/11/2 10:31
* @param appId
* @param tid
* @param keyIds
* @return java.util.List<com.epmet.dto.PersonalTemplateDTO>
*/
List<PersonalTemplateDTO> selectListByKey(@Param("appId") String appId, @Param("tid") String tid, @Param("keyIds") String keyIds);
}

11
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java

@ -141,4 +141,15 @@ public interface PersonalTemplateService extends BaseService<PersonalTemplateEnt
* @author sun
*/
List<CustomerTemplateListResultDTO> customerTemplateList(CustomerTemplateListFormDTO formDTO);
/**
* 根据tid和keyIds查询是否已存在该模板类型数据
* @author zhaoqifeng
* @date 2020/11/2 10:29
* @param appId
* @param tid
* @param keyIds
* @return java.util.List<com.epmet.dto.PersonalTemplateDTO>
*/
List<PersonalTemplateDTO> getListByKey(String appId, String tid, String keyIds);
}

17
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java

@ -127,6 +127,7 @@ public class PersonalTemplateServiceImpl extends BaseServiceImpl<PersonalTemplat
*/
@Override
public List<GetTemplateListResultDTO> templateList(GetTemplateListFormDTO formDTO) {
formDTO.setKeyIds("5,4,2");
//根据客户Id、appId、模板类型查询小程序订阅消息模板列表
return baseDao.selectTemplateList(formDTO);
}
@ -138,7 +139,23 @@ public class PersonalTemplateServiceImpl extends BaseServiceImpl<PersonalTemplat
*/
@Override
public List<CustomerTemplateListResultDTO> customerTemplateList(CustomerTemplateListFormDTO formDTO) {
formDTO.setKeyIds("5,4,2");
return baseDao.selectCustomerTemplateList(formDTO);
}
/**
* 根据tid和keyIds查询是否已存在该模板类型数据
*
* @param appId
* @param tid
* @param keyIds
* @return java.util.List<com.epmet.dto.PersonalTemplateDTO>
* @author zhaoqifeng
* @date 2020/11/2 10:29
*/
@Override
public List<PersonalTemplateDTO> getListByKey(String appId, String tid, String keyIds) {
return baseDao.selectListByKey(appId, tid, keyIds);
}
}

5
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java

@ -180,6 +180,11 @@ public class SubscribeServiceImpl implements SubscribeService {
String keywords = String.join(",", formDTO.getNameList());
List<String> keyIdList = formDTO.getKidList().stream().map(Object::toString).collect(Collectors.toList());
String keyIds = String.join(",", keyIdList);
//根据tid和keyIds查询是否已存在该模板类型数据
List<PersonalTemplateDTO> list = personalTemplateService.getListByKey(formDTO.getAppId(), formDTO.getTid(), keyIds);
if (null != list && list.size() > NumConstant.ZERO) {
throw new RenException(formDTO.getTitle() + "已存在所选关键词[" + keywords + "]的模板");
}
//将公共模板存入数据库
PersonalTemplateDTO personalTemplateDTO = new PersonalTemplateDTO();
personalTemplateDTO.setCustomerId(authInfo.getCustomerId());

13
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml

@ -86,7 +86,8 @@
AND customer_id = #{customerId}
AND app_id = #{appId}
AND title = #{templateType}
ORDER BY CREATED_TIME DESC
AND key_ids = '5,4,2'<!-- 消息更新,详情内容,时间 -->
ORDER BY created_time ASC
</select>
<select id="selectCustomerTemplateList" resultType="com.epmet.dto.result.CustomerTemplateListResultDTO">
@ -102,6 +103,16 @@
AND cm.del_flag = '0'
AND pt.customer_id = #{customerId}
AND pt.tid = #{publicId}
AND key_ids = #{keyIds}<!-- 消息更新,详情内容,时间 -->
ORDER BY created_time ASC
</select>
<select id="selectListByKey" resultType="com.epmet.dto.PersonalTemplateDTO">
SELECT ID
FROM personal_template
WHERE DEL_FLAG = '0'
AND APP_ID=#{appId}
AND TID = #{tid}
AND KEY_IDS = #{keyIds}
</select>
</mapper>

29
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.resi.mine.dto.from;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 11:07 上午
*/
@Data
public class BadgeListFormDTO implements Serializable {
private static final long serialVersionUID = 9082922684993474574L;
public interface BadgeList{}
/**
* 用户ID
*/
private String userId;
/**
* 客户ID
*/
@NotBlank(message = "客户ID不能为空",groups = {BadgeList.class})
private String customerId;
}

21
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/OperListFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.resi.mine.dto.from;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 4:18 下午
*/
@Data
public class OperListFormDTO implements Serializable {
private static final long serialVersionUID = -1872129597916414752L;
public interface OperList{}
@NotBlank(message = "客户ID不能为空",groups = {OperList.class})
private String customerId;
}

32
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.resi.mine.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 11:08 上午
*/
@Data
public class BadgeListResultDTO implements Serializable {
private static final long serialVersionUID = -6542233940679158922L;
/**
* 徽章ID
*/
private String badgeId;
/**
* 徽章图片地址
*/
private String badgeIcon;
/**
* 徽章是否点亮
*/
private String isOpened;
private String badgeType;
}

39
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java

@ -0,0 +1,39 @@
package com.epmet.resi.mine.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/3 9:58
*/
@Data
public class InitInfoResultDTO implements Serializable {
private static final long serialVersionUID = 144944007101324497L;
/**
* 头像
*/
private String headImgUrl;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 路牌号
*/
private String street;
/**
* 小区名称
*/
private String district;
/**
* 详细地址
*/
private String buildingAddress;
}

51
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java

@ -0,0 +1,51 @@
package com.epmet.resi.mine.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 4:20 下午
*/
@Data
public class OperListResultDTO implements Serializable {
private static final long serialVersionUID = -6185696177370545937L;
/**
* 徽章ID
*/
private String badgeId;
/**
* 徽章名字
*/
private String badgeName;
/**
* 点亮状态 yes已点亮no未点亮
*/
private String isLighted;
/**
* 是否认证 yes 认证 no 已认证
*/
private String isCertificated;
/**
* 徽章图片地址
*/
private String badgeIcon;
/**
* 是否被驳回 true已驳回false未驳回
*/
private Boolean isReject;
/**
* 徽章类型党员徽章partynone
*/
private String badgeType;
}

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

@ -0,0 +1,85 @@
package com.epmet.modules.badege.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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.OpenedOrClosedFormDTO;
import com.epmet.modules.badege.service.BadgeService;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 10:42 上午
*/
@RestController
@RequestMapping("badge")
public class BadgeController {
@Autowired
private BadgeService badgeService;
/**
* @Description 个人中心-获取个人徽章点亮列表
* @Param badgeListFormDTO
* @author zxc
* @date 2020/11/3 4:11 下午
*/
@PostMapping("list")
public Result<List<BadgeListResultDTO>> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){
ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class);
return new Result<List<BadgeListResultDTO>>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO));
}
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param operListFormDTO
* @author zxc
* @date 2020/11/3 4:28 下午
*/
@PostMapping("operlist")
public Result<List<OperListResultDTO>> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){
ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class);
return new Result<List<OperListResultDTO>>().ok(badgeService.getOperList(tokenDto,operListFormDTO));
}
/**
* @Description 个人中心-提交徽章认证
* @Param tokenDto
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 11:16 上午
*/
@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();
}
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/5 9:23 上午
*/
@PostMapping("openedorclosed")
public Result openedOrClosed(@LoginUser TokenDto tokenDto,@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO){
ValidatorUtils.validateEntity(openedOrClosedFormDTO, OpenedOrClosedFormDTO.OpenedOrClosed.class);
badgeService.openedOrClosed(tokenDto,openedOrClosedFormDTO);
return new Result();
}
}

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

@ -0,0 +1,52 @@
package com.epmet.modules.badege.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 10:52 上午
*/
public interface BadgeService {
/**
* @Description 个人中心-获取个人徽章点亮列表
* @Param badgeListFormDTO
* @author zxc
* @date 2020/11/3 4:11 下午
*/
List<BadgeListResultDTO> getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO);
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param operListFormDTO
* @author zxc
* @date 2020/11/3 4:28 下午
*/
List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO);
/**
* @Description 个人中心-提交徽章认证
* @Param tokenDto
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 11:16 上午
*/
void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO);
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/5 9:23 上午
*/
void openedOrClosed(TokenDto tokenDto,OpenedOrClosedFormDTO openedOrClosedFormDTO);
}

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

@ -0,0 +1,111 @@
package com.epmet.modules.badege.service.impl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.dto.form.UserBadgeListFormDTO;
import com.epmet.dto.form.UserOperListFormDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.badege.service.BadgeService;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
import com.epmet.dto.form.CertificationAddFormDTO;
import com.epmet.resi.mine.dto.from.OperListFormDTO;
import com.epmet.resi.mine.dto.result.BadgeListResultDTO;
import com.epmet.resi.mine.dto.result.OperListResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 10:53 上午
*/
@Service
@Slf4j
public class BadgeServiceImpl implements BadgeService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* @Description 个人中心-获取个人徽章点亮列表
* @Param badgeListFormDTO
* @author zxc
* @date 2020/11/3 4:11 下午
*/
@Override
public List<BadgeListResultDTO> getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO) {
UserBadgeListFormDTO form = new UserBadgeListFormDTO();
form.setCustomerId(badgeListFormDTO.getCustomerId());
form.setUserId(tokenDto.getUserId());
Result<List<UserBadgeListResultDTO>> listResult = epmetUserOpenFeignClient.selectBadgeList(form);
if (!listResult.success()){
throw new RenException("获取徽章点亮列表失败......");
}
if (null == listResult.getData()){
return new ArrayList<>();
}
List<BadgeListResultDTO> result = ConvertUtils.sourceToTarget(listResult.getData(), BadgeListResultDTO.class);
return result;
}
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param operListFormDTO
* @author zxc
* @date 2020/11/3 4:28 下午
*/
@Override
public List<OperListResultDTO> getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO) {
UserOperListFormDTO userOperListFormDTO = new UserOperListFormDTO();
userOperListFormDTO.setCustomerId(operListFormDTO.getCustomerId());
userOperListFormDTO.setUserId(tokenDto.getUserId());
Result<List<UserOperListResultDTO>> listResult = epmetUserOpenFeignClient.selectOperList(userOperListFormDTO);
if (!listResult.success()){
throw new RenException("获取徽章列表失败......");
}
if (null == listResult.getData()){
return new ArrayList<>();
}
List<OperListResultDTO> result = ConvertUtils.sourceToTarget(listResult.getData(), OperListResultDTO.class);
return result;
}
/**
* @Description 个人中心-提交徽章认证
* @Param tokenDto
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 11:16 上午
*/
@Override
public void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) {
certificationAddFormDTO.setUserId(tokenDto.getUserId());
Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO);
if (!result.success()){
throw new RenException("提交徽章认证失败......");
}
}
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/5 9:23 上午
*/
@Override
public void openedOrClosed(TokenDto tokenDto,OpenedOrClosedFormDTO openedOrClosedFormDTO) {
openedOrClosedFormDTO.setUserId(tokenDto.getUserId());
Result result = epmetUserOpenFeignClient.openedOrClosed(openedOrClosedFormDTO);
if (!result.success()){
throw new RenException("取消/点亮徽章失败了......");
}
}
}

55
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java

@ -0,0 +1,55 @@
package com.epmet.modules.mine.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.EditInfoFormDTO;
import com.epmet.modules.mine.service.PersonalCenterService;
import com.epmet.resi.mine.dto.result.InitInfoResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 个人中心
* @author zhaoqifeng
* @date 2020/11/3 9:48
*/
@Slf4j
@RestController
@RequestMapping("personalcenter")
public class PersonalCenterController {
@Autowired
private PersonalCenterService personalCenterService;
/**
* 修改信息页面初始化
* @author zhaoqifeng
* @date 2020/11/3 10:03
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.mine.dto.result.InitInfoResultDTO>
*/
@PostMapping("initinfo")
public Result<InitInfoResultDTO> initInfo(@LoginUser TokenDto tokenDto) {
InitInfoResultDTO resultDTO = personalCenterService.initInfo(tokenDto);
return new Result<InitInfoResultDTO>().ok(resultDTO);
}
/**
* 修改信息
* @author zhaoqifeng
* @date 2020/11/3 10:03
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("editinfo")
public Result editInfo(@LoginUser TokenDto tokenDto, @RequestBody EditInfoFormDTO formDTO) {
personalCenterService.editInfo(tokenDto, formDTO);
return new Result();
}
}

17
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java

@ -0,0 +1,17 @@
package com.epmet.modules.mine.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.EditInfoFormDTO;
import com.epmet.resi.mine.dto.result.InitInfoResultDTO;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/3 9:50
*/
public interface PersonalCenterService {
InitInfoResultDTO initInfo(TokenDto tokenDto);
void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO);
}

51
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java

@ -0,0 +1,51 @@
package com.epmet.modules.mine.service.impl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.EditInfoFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.mine.service.PersonalCenterService;
import com.epmet.resi.mine.dto.result.InitInfoResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/3 9:50
*/
@Slf4j
@Service
public class PersonalCenterServiceImpl implements PersonalCenterService {
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public InitInfoResultDTO initInfo(TokenDto tokenDto) {
Result<ResiUserBaseInfoResultDTO> baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto);
if (!baseInfoResult.success()) {
throw new RenException(baseInfoResult.getCode(), baseInfoResult.getMsg());
}
InitInfoResultDTO resultDTO = new InitInfoResultDTO();
resultDTO.setHeadImgUrl(baseInfoResult.getData().getHeadImgUrl());
resultDTO.setSurname(baseInfoResult.getData().getSurname());
resultDTO.setName(baseInfoResult.getData().getName());
resultDTO.setStreet(baseInfoResult.getData().getStreet());
resultDTO.setDistrict(baseInfoResult.getData().getDistrict());
resultDTO.setBuildingAddress(baseInfoResult.getData().getBuildingAddress());
return resultDTO;
}
@Override
public void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
Result result = epmetUserOpenFeignClient.editUserInfo(formDTO);
if (!result.success()) {
throw new RenException(result.getCode(), result.getMsg());
}
}
}

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

@ -0,0 +1,27 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2020/11/3 2:45 下午
*/
public interface BadgeConstant {
String BADGE_KEY = "epmet:badge:";
String BADGE = "badge";
String DEFAULT_CUSTOMER = "default";
String YES = "yes";
String NO = "no";
String REJECTED = "rejected";
String APPROVED = "approved";
String NONE ="none";
String SMS_CODE_KEY = "epmet:smsCode:badge:";
}

86
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeCertificationConfigDTO.java

@ -0,0 +1,86 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 徽章认证配置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Data
public class BadgeCertificationConfigDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户Id 默认配置iddefault
*/
private String customerId;
/**
* 徽章ID
*/
private String badgeId;
/**
* 认证信息类型 手机号:mobile全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark
*/
private String certificationType;
/**
* 删除标识 1删除0未删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

96
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 徽章
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Data
public class BadgeDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户Id 默认配置iddefault
*/
private String customerId;
/**
* 徽章名称
*/
private String badgeName;
/**
* 徽章图标url
*/
private String badgeIcon;
/**
* 固有徽章类型 前端页面跳转标识党员徽章party;none
*/
private String fixationBadgeType;
/**
* 状态 上线:online;下线:offline;
*/
private String badgeStatus;
/**
* 删除标识 1删除0未删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,45 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2020/11/4 1:46 下午
*/
@Data
public class UserBadgeCertificateRecordDTO implements Serializable {
private static final long serialVersionUID = 3207509834642386145L;
private String customerId;
private String gridId;
private String userId;
private String badgeId;
private String surname;
private String name;
private String mobile;
private String idNum;
private String certificationImg;
private String remark;
private String auditStatus;
private String auditRemark;
private String staffId;
private Date auditTime;
private String isLast;
private String delFlag;
private Integer revision;
private String createdBy;
private String updatedBy;
public UserBadgeCertificateRecordDTO() {
this.auditStatus = "auditing";
this.isLast = "yes";
this.delFlag = "0";
this.revision = 0;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

42
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddBadgeFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/4 9:47
*/
@NoArgsConstructor
@Data
public class AddBadgeFormDTO implements Serializable {
private static final long serialVersionUID = -5220529162950147825L;
/**
* 徽章名称
*/
@NotBlank(message = "徽章名称不能为空")
private String badgeName;
/**
* 徽章图标
*/
@NotBlank(message = "徽章图标不能为空")
private String badgeIcon;
/**
* 徽章状态 上线:online;下线:offline;
*/
@NotBlank(message = "徽章状态不能为空")
private String badgeStatus;
/**
* 认证信息类型数组 手机号:mobile姓名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark
*/
@NotEmpty(message = "认证信息类型不能为空")
private List<String> certificationTypes;
}

24
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AuthFieldFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 4:54 下午
*/
@Data
public class AuthFieldFormDTO implements Serializable {
private static final long serialVersionUID = 1976515427065841752L;
public interface AuthField{}
@NotBlank(message = "客户ID不能为空",groups = {AuthField.class})
private String customerId;
@NotBlank(message = "徽章ID不能为空",groups = {AuthField.class})
private String badgeId;
}

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

@ -0,0 +1,16 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/4 14:22
*/
@Data
public class BadgeFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
private String badgeId;
}

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeSendCodeFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 3:11 下午
*/
@Data
public class BadgeSendCodeFormDTO implements Serializable {
private static final long serialVersionUID = -3926070129364657241L;
public interface BadgeSendCode{}
@NotBlank(message = "手机号不能为空", groups = {BadgeSendCode.class})
private String mobile;
}

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

@ -0,0 +1,67 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 11:05 上午
*/
@Data
public class CertificationAddFormDTO implements Serializable {
private static final long serialVersionUID = 1330773325803513330L;
public interface CertificationAdd{}
private String userId;
/**
* 客户ID
*/
@NotBlank(message = "客户ID不能为空",groups = {CertificationAdd.class})
private String customerId;
/**
* 徽章ID
*/
private String badgeId;
/**
* 手机号
*/
private String mobile;
/**
*
*/
private String subName;
/**
*
*/
private String name;
/**
* 身份证号
*/
private String idCard;
/**
* 认证证件图片url
*/
private String certificate;
/**
* 认证说明
*/
private String remark;
/**
* 验证码
*/
private String code;
}

29
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 3:51 下午
*/
@Data
public class CertificationDetailFormDTO implements Serializable {
private static final long serialVersionUID = -398879254354767770L;
public interface CertificationDetail{}
@NotBlank(message = "客户ID不能为空",groups = {CertificationDetail.class})
private String customerId;
@NotBlank(message = "徽章ID不能为空",groups = {CertificationDetail.class})
private String badgeId;
/**
* 客户ID
*/
private String userId;
}

40
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java

@ -0,0 +1,40 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/4 14:23
*/
@Data
public class EditBadgeFormDTO implements Serializable {
private static final long serialVersionUID = 1578890423002035200L;
private String badgeId;
/**
* 徽章名称
*/
@NotBlank(message = "徽章名称不能为空")
private String badgeName;
/**
* 徽章图标
*/
@NotBlank(message = "徽章图标不能为空")
private String badgeIcon;
/**
* 徽章状态 上线:online;下线:offline;
*/
@NotBlank(message = "徽章状态不能为空")
private String badgeStatus;
/**
* 认证信息类型数组 手机号:mobile姓名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark
*/
@NotEmpty(message = "认证信息类型不能为空")
private List<String> certificationTypes;
}

52
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java

@ -0,0 +1,52 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/3 9:55
*/
@NoArgsConstructor
@Data
public class EditInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1280489016677129419L;
/**
* 头像
*/
@NotBlank(message = "头像不能为空")
private String userId;
/**
* 头像
*/
@NotBlank(message = "头像不能为空")
private String headImgUrl;
/**
*
*/
@NotBlank(message = "姓不能为空")
private String surname;
/**
*
*/
@NotBlank(message = "名不能为空")
private String name;
/**
* 路牌号
*/
@NotBlank(message = "路牌号不能为空")
private String street;
/**
* 小区名称
*/
private String district;
/**
* 详细地址
*/
private String buildingAddress;
}

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OpenedOrClosedFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 5:43 下午
*/
@Data
public class OpenedOrClosedFormDTO implements Serializable {
private static final long serialVersionUID = 483466676158603066L;
public interface OpenedOrClosed{}
@NotBlank(message = "客户ID不能为空",groups = {OpenedOrClosed.class})
private String customerId;
private String userId;
@NotBlank(message = "徽章ID不能为空",groups = {OpenedOrClosed.class})
private String badgeId;
}

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

@ -0,0 +1,33 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 11:07 上午
*/
@Data
public class UserBadgeListFormDTO implements Serializable {
private static final long serialVersionUID = 9002922684993474574L;
/**
* 用户ID
*/
private String userId;
/**
* 客户ID
*/
private String customerId;
public UserBadgeListFormDTO(String userId, String customerId) {
this.userId = userId;
this.customerId = customerId;
}
public UserBadgeListFormDTO() {
}
}

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserOperListFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 4:18 下午
*/
@Data
public class UserOperListFormDTO implements Serializable {
private static final long serialVersionUID = -1872129597916414712L;
private String userId;
private String customerId;
public UserOperListFormDTO(String userId, String customerId) {
this.userId = userId;
this.customerId = customerId;
}
public UserOperListFormDTO() {
}
}

40
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AuthFieldResultDTO.java

@ -0,0 +1,40 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 4:54 下午
*/
@Data
public class AuthFieldResultDTO implements Serializable {
private static final long serialVersionUID = 1856490232343125419L;
/**
* 中文名
*/
private String cnName;
/**
* 英文名字段
*/
private String enName;
/**
* 字段类型text文本img图片
*/
private String fieldType;
/**
* 是否必填
*/
private String isRequired;
/**
* 排序
*/
private Integer sort;
}

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeDetailResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/4 14:17
*/
@NoArgsConstructor
@Data
public class BadgeDetailResultDTO implements Serializable {
private static final long serialVersionUID = 7698898330565297328L;
private String badgeId;
private String badgeName;
private String badgeIcon;
private String badgeStatus;
private List<String> certificationTypes;
}

31
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java

@ -0,0 +1,31 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/3 16:58
*/
@NoArgsConstructor
@Data
public class BadgeListResultDTO {
/**
* 徽章Id
*/
private String badgeId;
/**
* 徽章名称
*/
private String badgeName;
/**
* 徽章图标url
*/
private String badgeIcon;
/**
* 徽章状态 上线:online;下线:offline;
*/
private String badgeStatus;
}

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

@ -0,0 +1,60 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/4 3:51 下午
*/
@Data
public class CertificationDetailResultDTO implements Serializable {
private static final long serialVersionUID = 6538150132908927308L;
/**
*
*/
private String surname;
/**
*
*/
private String name;
/**
* 身份证号
*/
private String idNum;
/**
* 是否认证 yes 认证 no 已认证
*/
private String isCertificated;
/**
* 手机号
*/
private String mobile;
/**
* 认证图片地址
*/
private String certificationImg;
/**
* 备注
*/
private String remark;
/**
* 审核结果
*/
private String authResult;
/**
* 驳回原因
*/
private String authReason;
}

49
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java

@ -0,0 +1,49 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 11:08 上午
*/
@Data
public class UserBadgeListResultDTO implements Serializable {
private static final long serialVersionUID = -6542233940679158922L;
/**
* 徽章ID
*/
private String badgeId;
/**
* 徽章图片地址
*/
private String badgeIcon;
/**
* 徽章是否点亮
*/
private String isOpened;
private String badgeType;
@JsonIgnore
private String customerId;
@JsonIgnore
private String badgeName;
@JsonIgnore
private String fixationBadgeType;
@JsonIgnore
private Boolean status;
public UserBadgeListResultDTO() {
this.badgeId = "";
this.badgeIcon = "";
this.isOpened = "0";
this.status = false;
}
}

67
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java

@ -0,0 +1,67 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/11/3 4:20 下午
*/
@Data
public class UserOperListResultDTO implements Serializable {
private static final long serialVersionUID = -6185696177370545937L;
/**
* 徽章ID
*/
private String badgeId;
/**
* 徽章名字
*/
private String badgeName;
/**
* 点亮状态 yes已点亮no未点亮
*/
private String isLighted;
/**
* 是否认证 yes 认证 no 已认证
*/
private String isCertificated;
/**
* 徽章图片地址
*/
private String badgeIcon;
/**
* 是否被驳回 true已驳回false未驳回
*/
private Boolean isReject;
/**
* 徽章类型党员徽章partynone
*/
private String badgeType;
@JsonIgnore
private String customerId;
@JsonIgnore
private String isOpened;
@JsonIgnore
private String auditStatus;
public UserOperListResultDTO() {
this.badgeId = "";
this.badgeName = "";
this.isLighted = "no";
this.isCertificated = "no";
this.badgeIcon = "";
this.isReject = false;
}
}

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

@ -334,4 +334,50 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/customerstaff/getstaffbasicinfo")
Result<BasicInfoResultDTO> getStaffBasicInfo(@RequestBody StaffBasicInfoFromDTO fromDTO);
/**
* 修改个人信息
* @author zhaoqifeng
* @date 2020/11/3 10:28
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("/epmetuser/userresiinfo/edituserinfo")
Result editUserInfo(@RequestBody EditInfoFormDTO formDTO);
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
@PostMapping("/epmetuser/more/badge/badgelist")
Result<List<UserBadgeListResultDTO>> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO);
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param operListFormDTO
* @author zxc
* @date 2020/11/3 4:28 下午
*/
@PostMapping("/epmetuser/more/badge/badgeoperlist")
Result<List<UserOperListResultDTO>> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO);
/**
* @Description 徽章认证提交
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 4:30 下午
*/
@PostMapping("/epmetuser/more/badge/authbadgerecord")
Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO);
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/5 9:23 上午
*/
@PostMapping("/epmetuser/more/badge/openedorclosed")
Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO);
}

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

@ -225,4 +225,29 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<BasicInfoResultDTO> getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffBasicInfo", fromDTO);
}
@Override
public Result editUserInfo(EditInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editUserInfo", formDTO);
}
@Override
public Result<List<UserBadgeListResultDTO>> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectBadgeList", userBadgeListFormDTO);
}
@Override
public Result<List<UserOperListResultDTO>> selectOperList(UserOperListFormDTO userOperListFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectOperList", userOperListFormDTO);
}
@Override
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "authBadgeRecord", certificationAddFormDTO);
}
@Override
public Result openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "openedOrClosed", openedOrClosedFormDTO);
}
}

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

@ -0,0 +1,104 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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.BadgeFormDTO;
import com.epmet.dto.form.EditBadgeFormDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.service.BadgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/11/3 16:09
*/
@RestController
@RequestMapping("badge")
public class BadgeController {
@Autowired
private BadgeService badgeService;
/**
* 徽章列表
* @author zhaoqifeng
* @date 2020/11/4 14:27
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.BadgeListResultDTO>>
*/
@PostMapping("list")
public Result<List<BadgeListResultDTO>> list(@LoginUser TokenDto tokenDto) {
List<BadgeListResultDTO> result = badgeService.getList(tokenDto.getCustomerId());
return new Result<List<BadgeListResultDTO>>().ok(result);
}
/**
* 添加徽章
* @author zhaoqifeng
* @date 2020/11/4 14:27
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddBadgeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
badgeService.add(tokenDto, formDTO);
return new Result();
}
/**
* 徽章详情
* @author zhaoqifeng
* @date 2020/11/4 14:27
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.BadgeDetailResultDTO>
*/
@PostMapping("detail")
public Result<BadgeDetailResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) {
BadgeDetailResultDTO result = badgeService.detail(tokenDto, formDTO);
return new Result<BadgeDetailResultDTO>().ok(result);
}
/**
* 修改
* @author zhaoqifeng
* @date 2020/11/4 15:32
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditBadgeFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
badgeService.edit(tokenDto, formDTO);
return new Result();
}
/**
* 删除徽章
* @author zhaoqifeng
* @date 2020/11/4 15:34
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) {
badgeService.deleteBadge(tokenDto, formDTO);
return new Result();
}
}

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

@ -0,0 +1,116 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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.*;
import com.epmet.dto.result.AuthFieldResultDTO;
import com.epmet.dto.result.CertificationDetailResultDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import com.epmet.service.UserBadgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 11:16 上午
*/
@RestController
@RequestMapping("more/badge")
public class UserBadgeController {
@Autowired
private UserBadgeService userBadgeService;
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
@PostMapping("badgelist")
public Result<List<UserBadgeListResultDTO>> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO){
return new Result<List<UserBadgeListResultDTO>>().ok(userBadgeService.selectBadgeList(userBadgeListFormDTO));
}
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param userOperListFormDTO
* @author zxc
* @date 2020/11/3 4:42 下午
*/
@PostMapping("badgeoperlist")
public Result<List<UserOperListResultDTO>> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO){
return new Result<List<UserOperListResultDTO>>().ok(userBadgeService.selectOperList(userOperListFormDTO));
}
/**
* @Description 个人中心-提交徽章认证
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 1:36 下午
*/
@PostMapping("authbadgerecord")
public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){
userBadgeService.authBadgeRecord(certificationAddFormDTO);
return new Result();
}
/**
* @Description 发送验证码
* @Param badgeSendCodeFormDTO
* @author zxc
* @date 2020/11/4 3:14 下午
*/
@PostMapping("badgesendcode")
public Result badgeSendCode(@RequestBody BadgeSendCodeFormDTO badgeSendCodeFormDTO){
ValidatorUtils.validateEntity(badgeSendCodeFormDTO, BadgeSendCodeFormDTO.BadgeSendCode.class);
userBadgeService.badgeSendCode(badgeSendCodeFormDTO);
return new Result();
}
/**
* @Description 个人中心-获取徽章认证页面详情
* @Param tokenDto
* @Param certificationDetailFormDTO
* @author zxc
* @date 2020/11/4 4:03 下午
*/
@PostMapping("certification/detail")
public Result<CertificationDetailResultDTO> certificationDetail(@LoginUser TokenDto tokenDto,@RequestBody CertificationDetailFormDTO certificationDetailFormDTO){
ValidatorUtils.validateEntity(certificationDetailFormDTO);
return new Result<CertificationDetailResultDTO>().ok(userBadgeService.certificationDetail(tokenDto,certificationDetailFormDTO));
}
/**
* @Description 个人中心-查询徽章要显示的认证信息字段
* @Param authFieldFormDTO
* @author zxc
* @date 2020/11/4 5:05 下午
*/
@PostMapping("authfield")
public Result<List<AuthFieldResultDTO>> authField(@RequestBody AuthFieldFormDTO authFieldFormDTO){
ValidatorUtils.validateEntity(authFieldFormDTO, AuthFieldFormDTO.AuthField.class);
return new Result<List<AuthFieldResultDTO>>().ok(userBadgeService.authField(authFieldFormDTO));
}
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/4 5:47 下午
*/
@PostMapping("openedorclosed")
public Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO){
userBadgeService.openedOrClosed(openedOrClosedFormDTO);
return new Result();
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java

@ -26,10 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.excel.UserResiInfoExcel;
@ -163,4 +160,17 @@ public class UserResiInfoController {
return new Result<IssueInitiatorResultDTO>().ok(userResiInfoService.selectIssueInitiator(formDTO));
}
/**
* 修改个人信息
* @author zhaoqifeng
* @date 2020/11/3 10:28
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("edituserinfo")
public Result editUserInfo(@RequestBody EditInfoFormDTO formDTO) {
userResiInfoService.editUserInfo(formDTO);
return new Result();
}
}

54
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeCertificationConfigDao.java

@ -0,0 +1,54 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.BadgeCertificationConfigEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 徽章认证配置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Mapper
public interface BadgeCertificationConfigDao extends BaseDao<BadgeCertificationConfigEntity> {
/**
* 获取认证信息类型
* @author zhaoqifeng
* @date 2020/11/4 14:42
* @param customerId
* @param badgeId
* @return java.util.List<java.lang.String>
*/
List<String> getCertificationType(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/**
* 删除认证信息
* @author zhaoqifeng
* @date 2020/11/4 14:43
* @param customerId
* @param badgeId
* @return int
*/
int deleteConfig(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
}

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

@ -0,0 +1,108 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.entity.BadgeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
import java.util.List;
/**
* 徽章
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Mapper
public interface BadgeDao extends BaseDao<BadgeEntity> {
/**
* 获取徽章列表
* @author zhaoqifeng
* @date 2020/11/3 17:30
* @param customerId
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
*/
List<BadgeListResultDTO> selectList(@Param("customerId") String customerId);
/**
* 重名校验
* @author zhaoqifeng
* @date 2020/11/4 10:40
* @param customerId
* @param badgeName
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
*/
List<BadgeListResultDTO> getDuplicateName(@Param("customerId") String customerId, @Param("badgeName") String badgeName);
/**
* 编辑重名校验
* @author zhaoqifeng
* @date 2020/11/4 15:09
* @param customerId
* @param badgeId
* @param badgeName
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
*/
List<BadgeListResultDTO> getDuplicateNameForEdit(@Param("customerId") String customerId, @Param("badgeId") String badgeId,
@Param("badgeName") String badgeName);
/**
* 获取徽章详情
* @author zhaoqifeng
* @date 2020/11/4 14:30
* @param customerId
* @param badgeId
* @return com.epmet.dto.result.BadgeDetailResultDTO
*/
BadgeDetailResultDTO selectDetail(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/**
* 获取徽章信息
* @author zhaoqifeng
* @date 2020/11/4 15:16
* @param customerId
* @param badgeId
* @return com.epmet.entity.BadgeEntity
*/
BadgeEntity selectBadgeInfo(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
/**
* 更新徽章信息
* @author zhaoqifeng
* @date 2020/11/4 15:38
* @param entity
* @return void
*/
void updateBadge(BadgeEntity entity);
/**
* 删除徽章信息
* @author zhaoqifeng
* @date 2020/11/4 15:39
* @param customerId
* @param badgeId
* @return void
*/
void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId);
}

95
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java

@ -0,0 +1,95 @@
package com.epmet.dao;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
import com.epmet.dto.form.AuthFieldFormDTO;
import com.epmet.dto.form.OpenedOrClosedFormDTO;
import com.epmet.dto.form.UserBadgeListFormDTO;
import com.epmet.dto.result.AuthFieldResultDTO;
import com.epmet.dto.result.CertificationDetailResultDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 1:22 下午
*/
@Mapper
public interface UserBadgeDao {
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
List<UserBadgeListResultDTO> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO);
/**
* @Description 查询默认徽章和改名后的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 3:11 下午
*/
List<UserBadgeListResultDTO> selectAllBadge(UserBadgeListFormDTO userBadgeListFormDTO);
/**
* @Description 查询徽章认证记录
* @Param userId
* @author zxc
* @date 2020/11/3 5:25 下午
*/
List<UserOperListResultDTO> selectAuthRecord(@Param("userId")String userId);
/**
* @Description 根据UserId查询个人徽章点亮信息
* @Param userId
* @author zxc
* @date 2020/11/4 9:32 上午
*/
List<UserOperListResultDTO> selectBadgeByUserId(@Param("userId")String userId);
/**
* @Description 用户认证徽章记录表插入
* @Param userBadgeCertificateRecordDTO
* @author zxc
* @date 2020/11/4 2:13 下午
*/
void insertUserBadgeCertificateRecord(UserBadgeCertificateRecordDTO userBadgeCertificateRecordDTO);
/**
* @Description 更新认证徽章记录最新
* @Param badgeId
* @Param userId
* @author zxc
* @date 2020/11/4 2:16 下午
*/
void updateCertificateRecordIsLast(@Param("badgeId")String badgeId,@Param("userId")String userId);
/**
* @Description 查询单个徽章的认证记录
* @Param userId
* @Param badgeId
* @author zxc
* @date 2020/11/4 4:09 下午
*/
CertificationDetailResultDTO selectBadgeAuthRecord(@Param("userId")String userId, @Param("badgeId")String badgeId);
/**
* @Description 个人中心-查询徽章要显示的认证信息字段
* @Param authFieldFormDTO
* @author zxc
* @date 2020/11/4 5:05 下午
*/
List<AuthFieldResultDTO> selectAuthField(AuthFieldFormDTO authFieldFormDTO);
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/4 6:04 下午
*/
void updateIsOpen(OpenedOrClosedFormDTO openedOrClosedFormDTO);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java

@ -87,4 +87,13 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
* @Date 2020/7/22 10:58
**/
UserResiInfoDTO selectByUserId(String userId);
/**
* 根据用户ID更新
* @author zhaoqifeng
* @date 2020/11/3 14:16
* @param entity
* @return void
*/
void updateByUserId(UserResiInfoEntity entity);
}

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

@ -0,0 +1,56 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 徽章认证配置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("badge_certification_config")
public class BadgeCertificationConfigEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id 默认配置iddefault
*/
private String customerId;
/**
* 徽章ID
*/
private String badgeId;
/**
* 认证信息类型 手机号:mobile全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark
*/
private String certificationType;
}

66
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 徽章
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("badge")
public class BadgeEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id 默认配置iddefault
*/
private String customerId;
/**
* 徽章名称
*/
private String badgeName;
/**
* 徽章图标url
*/
private String badgeIcon;
/**
* 固有徽章类型 前端页面跳转标识党员徽章party;none
*/
private String fixationBadgeType;
/**
* 状态 上线:online;下线:offline;
*/
private String badgeStatus;
}

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

@ -0,0 +1,69 @@
package com.epmet.redis;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.dto.result.UserBadgeListResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE;
/**
* @Author zxc
* @DateTime 2020/11/3 2:21 下午
*/
@Component
public class UserBadgeRedis {
@Autowired
private RedisUtils redisUtils;
/**
* @Description 获取徽章信息
* @Param customerId
* @author zxc
* @date 2020/11/3 2:50 下午
*/
public Object getCustomerBadge(String customerId){
Object userBadge = redisUtils.hGet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE);
return userBadge;
}
/**
* @Description 存放徽章信息
* @Param userBadge
* @Param customerId
* @author zxc
* @date 2020/11/3 2:51 下午
*/
public void setCustomerBadge(List<UserBadgeListResultDTO> userBadge, String customerId){
redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1);
}
/**
* @Description 存放徽章审核 手机验证码
* @Param mobile
* @author zxc
* @date 2020/11/5 10:30 上午
*/
public void saveBadgeSmsCode(String mobile, String smsCode) {
String smsCodeKey = BadgeConstant.SMS_CODE_KEY + mobile;
redisUtils.set(smsCodeKey, smsCode, MINUTE_THIRTY_EXPIRE);
}
/**
* @Description 获取徽章审核 手机验证码
* @Param mobile
* @author zxc
* @date 2020/11/5 10:30 上午
*/
public String getBadgeSmsCode(String mobile) {
String smsCodeKey = BadgeConstant.SMS_CODE_KEY + mobile;
String smsCode = (String) redisUtils.get(smsCodeKey);
return smsCode;
}
}

127
epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeCertificationConfigService.java

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

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

@ -0,0 +1,150 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
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.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.entity.BadgeEntity;
import java.util.List;
import java.util.Map;
/**
* 徽章
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
public interface BadgeService extends BaseService<BadgeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<BadgeDTO>
* @author generator
* @date 2020-11-03
*/
PageData<BadgeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<BadgeDTO>
* @author generator
* @date 2020-11-03
*/
List<BadgeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return BadgeDTO
* @author generator
* @date 2020-11-03
*/
BadgeDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-11-03
*/
void save(BadgeDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-11-03
*/
void update(BadgeDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-11-03
*/
void delete(String[] ids);
/**
* 获取徽章列表
* @author zhaoqifeng
* @date 2020/11/3 17:04
* @param customerId
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
*/
List<BadgeListResultDTO> getList(String customerId);
/**
* 添加徽章
* @author zhaoqifeng
* @date 2020/11/4 10:09
* @param tokenDto
* @param formDTO
* @return void
*/
void add(TokenDto tokenDto, AddBadgeFormDTO formDTO);
/**
* 徽章详情
* @author zhaoqifeng
* @date 2020/11/4 14:25
* @param tokenDto
* @param formDTO
* @return com.epmet.dto.result.BadgeDetailResultDTO
*/
BadgeDetailResultDTO detail(TokenDto tokenDto, BadgeFormDTO formDTO);
/**
* 编辑徽章
* @author zhaoqifeng
* @date 2020/11/4 14:28
* @param tokenDto
* @param formDTO
* @return void
*/
void edit(TokenDto tokenDto, EditBadgeFormDTO formDTO);
/**
* 删除徽章
* @author zhaoqifeng
* @date 2020/11/4 15:34
* @param tokenDto
* @param formDTO
* @return void
*/
void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO);
}

76
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java

@ -0,0 +1,76 @@
package com.epmet.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AuthFieldResultDTO;
import com.epmet.dto.result.CertificationDetailResultDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.dto.result.UserOperListResultDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/11/3 11:18 上午
*/
public interface UserBadgeService {
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
List<UserBadgeListResultDTO> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO);
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param userOperListFormDTO
* @author zxc
* @date 2020/11/3 4:42 下午
*/
List<UserOperListResultDTO> selectOperList(UserOperListFormDTO userOperListFormDTO);
/**
* @Description 个人中心-提交徽章认证
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 1:36 下午
*/
Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO);
/**
* @Description 发送验证码
* @Param badgeSendCodeFormDTO
* @author zxc
* @date 2020/11/4 3:14 下午
*/
void badgeSendCode(BadgeSendCodeFormDTO badgeSendCodeFormDTO);
/**
* @Description 个人中心-获取徽章认证页面详情
* @Param tokenDto
* @Param certificationDetailFormDTO
* @author zxc
* @date 2020/11/4 4:03 下午
*/
CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO);
/**
* @Description 个人中心-查询徽章要显示的认证信息字段
* @Param authFieldFormDTO
* @author zxc
* @date 2020/11/4 5:05 下午
*/
List<AuthFieldResultDTO> authField(AuthFieldFormDTO authFieldFormDTO);
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/4 5:47 下午
*/
void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java

@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.entity.UserResiInfoEntity;
@ -151,4 +148,13 @@ public interface UserResiInfoService extends BaseService<UserResiInfoEntity> {
* @date 2020/5/11 10:59
*/
IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO);
/**
* 修改个人信息
* @author zhaoqifeng
* @date 2020/11/3 10:29
* @param formDTO
* @return void
*/
void editUserInfo(EditInfoFormDTO formDTO);
}

149
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeCertificationConfigServiceImpl.java

@ -0,0 +1,149 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.BadgeCertificationConfigDao;
import com.epmet.dto.BadgeCertificationConfigDTO;
import com.epmet.entity.BadgeCertificationConfigEntity;
import com.epmet.service.BadgeCertificationConfigService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 徽章认证配置
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Service
public class BadgeCertificationConfigServiceImpl extends BaseServiceImpl<BadgeCertificationConfigDao, BadgeCertificationConfigEntity> implements BadgeCertificationConfigService {
@Override
public PageData<BadgeCertificationConfigDTO> page(Map<String, Object> params) {
IPage<BadgeCertificationConfigEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, BadgeCertificationConfigDTO.class);
}
@Override
public List<BadgeCertificationConfigDTO> list(Map<String, Object> params) {
List<BadgeCertificationConfigEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, BadgeCertificationConfigDTO.class);
}
private QueryWrapper<BadgeCertificationConfigEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<BadgeCertificationConfigEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public BadgeCertificationConfigDTO get(String id) {
BadgeCertificationConfigEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, BadgeCertificationConfigDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(BadgeCertificationConfigDTO dto) {
BadgeCertificationConfigEntity entity = ConvertUtils.sourceToTarget(dto, BadgeCertificationConfigEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(BadgeCertificationConfigDTO dto) {
BadgeCertificationConfigEntity entity = ConvertUtils.sourceToTarget(dto, BadgeCertificationConfigEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 获取认证信息类型
*
* @param customerId
* @param badgeId
* @return java.util.List<java.lang.String>
* @author zhaoqifeng
* @date 2020/11/4 14:39
*/
@Override
public List<String> getCertificationType(String customerId, String badgeId) {
List<String> list = baseDao.getCertificationType(customerId, badgeId);
if (CollectionUtils.isEmpty(list)) {
list = baseDao.getCertificationType("default", badgeId);
}
return list;
}
/**
* 保存认证信息配置
*
* @param list
* @return void
* @author zhaoqifeng
* @date 2020/11/4 15:28
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void saveConfig(String customerId, String badgeId, List<BadgeCertificationConfigEntity> list) {
baseDao.deleteConfig(customerId, badgeId);
insertBatch(list);
}
/**
* 删除配置
*
* @param customerId
* @param badgeId
* @return void
* @author zhaoqifeng
* @date 2020/11/4 15:41
*/
@Override
public void deleteConfig(String customerId, String badgeId) {
baseDao.deleteConfig(customerId, badgeId);
}
}

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

@ -0,0 +1,248 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.constant.BadgeConstant;
import com.epmet.dao.BadgeDao;
import com.epmet.dto.BadgeDTO;
import com.epmet.dto.form.AddBadgeFormDTO;
import com.epmet.dto.form.BadgeFormDTO;
import com.epmet.dto.form.EditBadgeFormDTO;
import com.epmet.dto.result.BadgeDetailResultDTO;
import com.epmet.dto.result.BadgeListResultDTO;
import com.epmet.entity.BadgeCertificationConfigEntity;
import com.epmet.entity.BadgeEntity;
import com.epmet.service.BadgeCertificationConfigService;
import com.epmet.service.BadgeService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 徽章
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-11-03
*/
@Service
public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> implements BadgeService {
@Autowired
private BadgeCertificationConfigService badgeCertificationConfigService;
@Override
public PageData<BadgeDTO> page(Map<String, Object> params) {
IPage<BadgeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, BadgeDTO.class);
}
@Override
public List<BadgeDTO> list(Map<String, Object> params) {
List<BadgeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, BadgeDTO.class);
}
private QueryWrapper<BadgeEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<BadgeEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public BadgeDTO get(String id) {
BadgeEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, BadgeDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(BadgeDTO dto) {
BadgeEntity entity = ConvertUtils.sourceToTarget(dto, BadgeEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(BadgeDTO dto) {
BadgeEntity entity = ConvertUtils.sourceToTarget(dto, BadgeEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 获取徽章列表
*
* @param customerId
* @return java.util.List<com.epmet.dto.result.BadgeListResultDTO>
* @author zhaoqifeng
* @date 2020/11/3 17:04
*/
@Override
public List<BadgeListResultDTO> getList(String customerId) {
return baseDao.selectList(customerId);
}
/**
* 添加徽章
*
* @param tokenDto
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2020/11/4 10:09
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void add(TokenDto tokenDto, AddBadgeFormDTO formDTO) {
//重名校验
List<BadgeListResultDTO> list = baseDao.getDuplicateName(tokenDto.getCustomerId(), formDTO.getBadgeName());
if (CollectionUtils.isNotEmpty(list)) {
throw new RenException(EpmetErrorCode.DUPLICATE_BADGE_NAME.getCode());
}
BadgeEntity entity = ConvertUtils.sourceToTarget(formDTO, BadgeEntity.class);
entity.setCustomerId(tokenDto.getCustomerId());
entity.setFixationBadgeType(BadgeConstant.NONE);
insert(entity);
//保存徽章认证配置
List<BadgeCertificationConfigEntity> badgeList = new ArrayList<>();
formDTO.getCertificationTypes().forEach(item -> {
BadgeCertificationConfigEntity badge = new BadgeCertificationConfigEntity();
badge.setBadgeId(entity.getId());
badge.setCertificationType(item);
badge.setCustomerId(tokenDto.getCustomerId());
badgeList.add(badge);
});
badgeCertificationConfigService.insertBatch(badgeList);
}
/**
* 徽章详情
*
* @param tokenDto
* @param formDTO
* @return com.epmet.dto.result.BadgeDetailResultDTO
* @author zhaoqifeng
* @date 2020/11/4 14:25
*/
@Override
public BadgeDetailResultDTO detail(TokenDto tokenDto, BadgeFormDTO formDTO) {
BadgeDetailResultDTO result = baseDao.selectDetail(tokenDto.getCustomerId(), formDTO.getBadgeId());
List<String> types = badgeCertificationConfigService.getCertificationType(tokenDto.getCustomerId(), formDTO.getBadgeId());
result.setCertificationTypes(types);
return result;
}
/**
* 编辑徽章
*
* @param tokenDto
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2020/11/4 14:28
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(TokenDto tokenDto, EditBadgeFormDTO formDTO) {
//重名校验
List<BadgeListResultDTO> list = baseDao.getDuplicateNameForEdit(tokenDto.getCustomerId(), formDTO.getBadgeId(), formDTO.getBadgeName());
if (CollectionUtils.isNotEmpty(list)) {
throw new RenException(EpmetErrorCode.DUPLICATE_BADGE_NAME.getCode());
}
BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId());
if (null == badgeEntity) {
badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId());
badgeEntity.setCustomerId(tokenDto.getCustomerId());
badgeEntity.setBadgeName(formDTO.getBadgeName());
badgeEntity.setBadgeIcon(formDTO.getBadgeIcon());
badgeEntity.setBadgeStatus(formDTO.getBadgeStatus());
baseDao.insert(badgeEntity);
} else {
badgeEntity.setBadgeName(formDTO.getBadgeName());
badgeEntity.setBadgeIcon(formDTO.getBadgeIcon());
badgeEntity.setBadgeStatus(formDTO.getBadgeStatus());
baseDao.updateBadge(badgeEntity);
}
//保存徽章认证配置
List<BadgeCertificationConfigEntity> badgeList = new ArrayList<>();
formDTO.getCertificationTypes().forEach(item -> {
BadgeCertificationConfigEntity badge = new BadgeCertificationConfigEntity();
badge.setBadgeId(formDTO.getBadgeId());
badge.setCertificationType(item);
badge.setCustomerId(tokenDto.getCustomerId());
badgeList.add(badge);
});
badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList);
}
/**
* 删除徽章
*
* @param tokenDto
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2020/11/4 15:34
*/
@Override
public void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO) {
BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId());
if (null == badgeEntity) {
badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId());
badgeEntity.setCustomerId(tokenDto.getCustomerId());
badgeEntity.setDelFlag(NumConstant.ONE_STR);
baseDao.insert(badgeEntity);
} else {
baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId());
}
badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId());
}
}

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

@ -0,0 +1,239 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dao.UserBadgeDao;
import com.epmet.dto.UserBadgeCertificateRecordDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.redis.UserBadgeRedis;
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;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author zxc
* @DateTime 2020/11/3 11:18 上午
*/
@Service
@Slf4j
public class UserBadgeServiceImpl implements UserBadgeService {
@Autowired
private UserBadgeDao userBadgeDao;
@Autowired
private UserBadgeRedis userBadgeRedis;
@Autowired
private UserBaseInfoService userBaseInfoService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
@Override
public List<UserBadgeListResultDTO> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) {
Object userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
if (null == userBadge){
List<UserBadgeListResultDTO> resultUserBadge = new ArrayList<>();
List<UserBadgeListResultDTO> userBadgeListResultDTOS = userBadgeDao.selectAllBadge(userBadgeListFormDTO);
if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){
Map<String, List<UserBadgeListResultDTO>> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId));
resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER));
List<UserBadgeListResultDTO> badgeByCustomer = groupByCustomer.get(userBadgeListFormDTO.getCustomerId());
resultUserBadge.forEach(r -> {
badgeByCustomer.forEach(b -> {
if (r.getBadgeId().equals(b.getBadgeId())){
BeanUtils.copyProperties(b,r);
}
});
});
userBadgeRedis.setCustomerBadge(resultUserBadge,userBadgeListFormDTO.getCustomerId());
userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId());
}
}
List<UserBadgeListResultDTO> redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class);
List<UserBadgeListResultDTO> userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO);
if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){
return redisUserBadgeList;
}
redisUserBadgeList.forEach(u -> {
userBadgeListResultDTOS.forEach(badge -> {
if (u.getBadgeId().equals(badge.getBadgeId())){
badge.setBadgeIcon(u.getBadgeIcon());
u.setStatus(true);
}
});
});
redisUserBadgeList.forEach(u -> {
if (!u.getStatus()){
userBadgeListResultDTOS.add(u);
}
});
return userBadgeListResultDTOS;
}
/**
* @Description 个人中心-获取徽章可操作列表点亮取消认证
* @Param userOperListFormDTO
* @author zxc
* @date 2020/11/3 4:42 下午
*/
@Override
public List<UserOperListResultDTO> selectOperList(UserOperListFormDTO userOperListFormDTO) {
List<UserOperListResultDTO> userAuthBadgeList = userBadgeDao.selectAuthRecord(userOperListFormDTO.getUserId());
Object userBadge = userBadgeRedis.getCustomerBadge(userOperListFormDTO.getCustomerId());
List<UserOperListResultDTO> userOperListResultDTOS = JSON.parseArray(userBadge.toString(), UserOperListResultDTO.class);
// 没有任何记录
if (CollectionUtils.isEmpty(userAuthBadgeList)){
userOperListResultDTOS.forEach(u -> {
u.setIsLighted(u.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES);
u.setIsCertificated(BadgeConstant.NO);
u.setIsReject(false);
});
return userOperListResultDTOS;
}
List<UserOperListResultDTO> badgeIsOpenedList = userBadgeDao.selectBadgeByUserId(userOperListFormDTO.getUserId());
userOperListResultDTOS.forEach(ub -> {
userAuthBadgeList.forEach(u -> {
if (ub.getBadgeId().equals(u.getBadgeId())){
ub.setIsReject(u.getAuditStatus().equals(BadgeConstant.REJECTED) ? true : false);
ub.setIsCertificated(u.getAuditStatus().equals(BadgeConstant.APPROVED) ? BadgeConstant.YES : BadgeConstant.NO);
}
});
if (CollectionUtils.isEmpty(badgeIsOpenedList)){
ub.setIsLighted(BadgeConstant.NO);
}else {
badgeIsOpenedList.forEach(b -> {
if (ub.getBadgeId().equals(b.getBadgeId())){
ub.setIsLighted(b.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES);
}
});
}
});
return userOperListResultDTOS;
}
/**
* @Description 个人中心-提交徽章认证
* @Param certificationAddFormDTO
* @author zxc
* @date 2020/11/4 1:36 下午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) {
if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())){
String smsCode = userBadgeRedis.getBadgeSmsCode(certificationAddFormDTO.getMobile());
if (!StringUtils.isNotBlank(smsCode)){
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
}
UserBadgeCertificateRecordDTO form = ConvertUtils.sourceToTarget(certificationAddFormDTO, UserBadgeCertificateRecordDTO.class);
List<String> userIds = new ArrayList<>();
userIds.add(certificationAddFormDTO.getUserId());
List<UserBaseInfoResultDTO> userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(userIds);
if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)){
throw new RenException("查询用户基本信息集合为空......");
}
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());
userBadgeDao.insertUserBadgeCertificateRecord(form);
return new Result();
}
/**
* @Description 发送验证码
* @Param badgeSendCodeFormDTO
* @author zxc
* @date 2020/11/4 3:14 下午
*/
@Override
public void badgeSendCode(BadgeSendCodeFormDTO badgeSendCodeFormDTO) {
//1、校验手机号是否符合规范
if (!PhoneValidatorUtils.isMobile(badgeSendCodeFormDTO.getMobile())) {
log.error(String.format("发送短信验证码异常,手机号[%s],code[%s],msg[%s]", badgeSendCodeFormDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg()));
throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode());
}
//3、发送短信验证码
SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO();
sendVerificationCodeFormDTO.setMobile(badgeSendCodeFormDTO.getMobile());
sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM);
Result<SendVerificationCodeResultDTO> smsCodeResult=epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO);
if (!smsCodeResult.success()) {
log.error(String.format("发送短信验证码异常,手机号[%s],code[%s],msg[%s]", badgeSendCodeFormDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg()));
throw new RenException(smsCodeResult.getCode());
}
//4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis)
userBadgeRedis.saveBadgeSmsCode(badgeSendCodeFormDTO.getMobile(),smsCodeResult.getData().getCode());
log.info(String.format("发送短信验证码成功,手机号[%s]", badgeSendCodeFormDTO.getMobile()));
}
/**
* @Description 个人中心-获取徽章认证页面详情
* @Param tokenDto
* @Param certificationDetailFormDTO
* @author zxc
* @date 2020/11/4 4:03 下午
*/
@Override
public CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO) {
certificationDetailFormDTO.setUserId(tokenDto.getUserId());
return userBadgeDao.selectBadgeAuthRecord(certificationDetailFormDTO.getUserId(), certificationDetailFormDTO.getBadgeId());
}
/**
* @Description 个人中心-查询徽章要显示的认证信息字段
* @Param authFieldFormDTO
* @author zxc
* @date 2020/11/4 5:05 下午
*/
@Override
public List<AuthFieldResultDTO> authField(AuthFieldFormDTO authFieldFormDTO) {
List<AuthFieldResultDTO> authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO);
if (CollectionUtils.isEmpty(authFieldResultDTOS)){
return new ArrayList<>();
}
return authFieldResultDTOS;
}
/**
* @Description 个人中心-取消/点亮徽章
* @Param openedOrClosedFormDTO
* @author zxc
* @date 2020/11/4 5:47 下午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO) {
userBadgeDao.updateIsOpen(openedOrClosedFormDTO);
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -325,4 +325,22 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
return userResiInfoDao.selectIssueInitiator(formDTO);
}
/**
* 修改个人信息
*
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2020/11/3 10:29
*/
@Override
public void editUserInfo(EditInfoFormDTO formDTO) {
//更新居民注册信息表
baseDao.updateByUserId(ConvertUtils.sourceToTarget(formDTO, UserResiInfoEntity.class));
//更新baseInfo
UserBaseInfoEntity baseInfo = ConvertUtils.sourceToTarget(formDTO, UserBaseInfoEntity.class);
baseInfo.setRealName(formDTO.getSurname() + formDTO.getName());
userBaseInfoService.insertOrUpdate(baseInfo);
}
}

199
epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql

@ -0,0 +1,199 @@
/*
Navicat Premium Data Transfer
Source Server : 亿
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 192.168.1.130:3306
Source Schema : epmet_user
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 03/11/2020 10:36:00
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for badege
-- ----------------------------
DROP TABLE IF EXISTS `badege`;
CREATE TABLE `badege`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`BADEGE_NAME` varchar(32) NOT NULL COMMENT '徽章名称',
`BADEGE_ICON` varchar(256) NOT NULL COMMENT '徽章图标url',
`FIXATION_BADEGE_TYPE` varchar(32) NOT NULL DEFAULT 'none' COMMENT '固有徽章类型 前端页面跳转标识,党员徽章:party;无:none',
`BADEGE_STATUS` varchar(16) NOT NULL COMMENT '状态 上线:online;下线:offline;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`, `CUSTOMER_ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='徽章';
-- ----------------------------
-- Records of badege
-- ----------------------------
BEGIN;
INSERT INTO `badege`
VALUES ('1', 'default', '党员徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg',
'party', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
INSERT INTO `badege`
VALUES ('2', 'default', '人大代表徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg',
'none', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
INSERT INTO `badege`
VALUES ('3', 'default', '政协委员徽章',
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg',
'none', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00');
COMMIT;
-- ----------------------------
-- Table structure for badege_certification_config
-- ----------------------------
DROP TABLE IF EXISTS `badege_certification_config`;
CREATE TABLE `badege_certification_config`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`CERTIFICATION_TYPE` varchar(16) NOT NULL COMMENT '认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='徽章认证配置';
-- ----------------------------
-- Records of badege_certification_config
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for badege_certification_config_field
-- ----------------------------
DROP TABLE IF EXISTS `badege_certification_config_field`;
CREATE TABLE `badege_certification_config_field`
(
`ID` varchar(64) NOT NULL,
`CN_NAME` varchar(64) NOT NULL COMMENT '中文名',
`EN_NAME` varchar(64) NOT NULL COMMENT '英文名(字段名)',
`FIELD_TYPE` varchar(32) NOT NULL COMMENT '字段类型 img:图片,text:文本',
`IS_REQUIRED` tinyint(1) NOT NULL COMMENT '是否必填',
`CERTIFICATION_TYPE` varchar(255) NOT NULL COMMENT '认证信息类型',
`SORT` int(10) NOT NULL COMMENT '字段排序',
`DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除标识 1删除0未删除',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT =' 徽章认证配置字段表\n';
-- ----------------------------
-- Records of badege_certification_config_field
-- ----------------------------
BEGIN;
INSERT INTO `badege_certification_config_field`
VALUES ('a5be5d931cf411eb8dcfc03fd56f7847', '手机号', 'mobile', 'text', 1, 'mobile', 3, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c01dd81cf411eb8dcfc03fd56f7847', '', 'subName', 'text', 1, 'fullName', 0, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c01de81cf411eb8dcfc03fd56f7847', '', 'name', 'text', 1, 'fullName', 1, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c22e511cf411eb8dcfc03fd56f7847', '身份证', 'idcard', 'text', 1, 'idcard', 2, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c4c2c11cf411eb8dcfc03fd56f7847', '认证证件', 'certificate', 'img', 1, 'certificate', 4, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
INSERT INTO `badege_certification_config_field`
VALUES ('a5c608301cf411eb8dcfc03fd56f7847', '认证说明(备注)', 'remark', 'text', 1, 'remark', 5, 0, 0, 'APP_USER',
'2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06');
COMMIT;
-- ----------------------------
-- Table structure for resi_user_badege
-- ----------------------------
DROP TABLE IF EXISTS `resi_user_badege`;
CREATE TABLE `resi_user_badege`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default',
`GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`IS_OPENED` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启(点亮) 1:点亮;0:未点亮',
`CERTIFICATION_AUTID_STATUS` varchar(16) NOT NULL DEFAULT 'auditing' COMMENT '认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected;',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='用户徽章关系表';
-- ----------------------------
-- Records of resi_user_badege
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for user_badege_certificate_record
-- ----------------------------
DROP TABLE IF EXISTS `user_badege_certificate_record`;
CREATE TABLE `user_badege_certificate_record`
(
`ID` varchar(64) NOT NULL COMMENT '主键ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ',
`GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID',
`USER_ID` varchar(64) NOT NULL COMMENT '用户ID',
`BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID',
`SURNAME` varchar(8) DEFAULT NULL COMMENT '',
`NAME` varchar(16) DEFAULT NULL COMMENT '',
`ID_NUM` varchar(32) DEFAULT NULL COMMENT '身份证号 网格内去重',
`CERTIFICATION_IMG` varchar(512) DEFAULT NULL COMMENT '认证证件图片',
`REMAEK` varchar(128) DEFAULT NULL COMMENT '认证说明(备注)',
`AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auditing' COMMENT '审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中',
`AUDIT_REMARK` varchar(128) DEFAULT NULL COMMENT '审核意见',
`STAFF_ID` varchar(32) DEFAULT NULL COMMENT '审核人 审核人Id',
`AUDIT_TIME` datetime DEFAULT NULL COMMENT '审核时间',
`DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`),
KEY `IDX_USER_ID` (`USER_ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='用户认证徽章记录表';
-- ----------------------------
-- Records of user_badege_certificate_record
-- ----------------------------
BEGIN;
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

42
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeCertificationConfigDao.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.BadgeCertificationConfigDao">
<resultMap type="com.epmet.entity.BadgeCertificationConfigEntity" id="badgeCertificationConfigMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="badgeId" column="BADGE_ID"/>
<result property="certificationType" column="CERTIFICATION_TYPE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteConfig">
DELETE a
FROM
badge_certification_config a
WHERE
EXISTS (
SELECT
*
FROM
( SELECT ID FROM badge_certification_config
WHERE CUSTOMER_ID = #{customerId}
AND BADGE_ID = #{badgeId}
AND DEL_FLAG = '0' ) b
WHERE
a.ID = b.ID)
</delete>
<select id="getCertificationType" resultType="java.lang.String">
select CERTIFICATION_TYPE from badge_certification_config
where CUSTOMER_ID = #{customerId}
and BADGE_ID = #{badgeId}
and DEL_FLAG = '0'
</select>
</mapper>

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

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.BadgeDao">
<resultMap type="com.epmet.entity.BadgeEntity" id="badgeMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="badgeName" column="BADGE_NAME"/>
<result property="badgeIcon" column="BADGE_ICON"/>
<result property="fixationBadgeType" column="FIXATION_BADGE_TYPE"/>
<result property="badgeStatus" column="BADGE_STATUS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateBadge" parameterType="com.epmet.entity.BadgeEntity">
update badge set
BADGE_NAME = #{badgeName},
BADGE_ICON = #{badgeIcon},
BADGE_STATUS = #{badgeStatus}
where ID = #{id} AND CUSTOMER_ID = #{customerId}
</update>
<update id="deleteBadge">
update badge set
DEL_FLAG = '1'
where ID = #{badgeId} AND CUSTOMER_ID = #{customerId}
</update>
<select id="selectList" resultType="com.epmet.dto.result.BadgeListResultDTO">
SELECT
ID AS "badgeId",
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
FROM
(
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0')) t
ORDER BY
CREATED_TIME DESC
</select>
<select id="getDuplicateName" resultType="com.epmet.dto.result.BadgeListResultDTO">
SELECT
*
FROM
(SELECT
ID AS "badgeId",
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
FROM
(
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a
WHERE BADGE_NAME = #{badgeName}
</select>
<select id="selectDetail" resultType="com.epmet.dto.result.BadgeDetailResultDTO">
SELECT
*
FROM
(SELECT
ID AS "badgeId",
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
FROM
(
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a
WHERE badgeId = #{badgeId}
</select>
<select id="getDuplicateNameForEdit" resultType="com.epmet.dto.result.BadgeListResultDTO">
SELECT
*
FROM
(SELECT
ID AS "badgeId",
BADGE_NAME,
BADGE_ICON,
BADGE_STATUS
FROM
(
SELECT * FROM badge
WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0'
UNION ALL
SELECT * FROM badge a
WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0'
AND NOT EXISTS
( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a
WHERE BADGE_NAME = #{badgeName} AND badgeId != #{badgeId}
</select>
<select id="selectBadgeInfo" resultType="com.epmet.entity.BadgeEntity">
select * from badge where DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND ID = #{badgeId}
</select>
</mapper>

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

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.UserBadgeDao">
<!-- 更新认证徽章记录最新 -->
<update id="updateCertificateRecordIsLast">
UPDATE user_badge_certificate_record
SET is_last = 'no'
WHERE DEL_FLAG = '0'
AND BADGE_ID = #{badgeId}
AND USER_ID = #{userId}
</update>
<!-- 个人中心-取消/点亮徽章 -->
<update id="updateIsOpen">
UPDATE resi_user_badge
SET IS_OPENED = (case when IS_OPENED = 1 THEN 0 ELSE 1 END),
UPDATED_TIME = NOW()
WHERE DEL_FLAG = '0'
AND USER_ID = #{userId}
AND BADGE_ID = #{badgeId}
</update>
<!-- 查询已经点亮的徽章 -->
<select id="selectBadgeList" resultType="com.epmet.dto.result.UserBadgeListResultDTO">
SELECT
ub.BADGE_ID,
ub.IS_OPENED,
b.FIXATION_BADGE_TYPE as badgeType
FROM resi_user_badge ub
LEFT JOIN badge b ON b.ID = ub.BADGE_ID
WHERE ub.DEL_FLAG = '0'
AND b.DEL_FLAG = 0
AND ub.CERTIFICATION_AUTID_STATUS = 'pass'
AND b.CUSTOMER_ID = 'default'
AND ub.USER_ID = #{userId}
ORDER BY ub.UPDATED_TIME DESC
</select>
<!-- 查询默认徽章和改名后的徽章 -->
<select id="selectAllBadge" resultType="com.epmet.dto.result.UserBadgeListResultDTO">
SELECT
id AS badgeId,
CUSTOMER_ID,
BADGE_NAME,
BADGE_ICON,
FIXATION_BADGE_TYPE AS badgeType
FROM badge
WHERE
DEL_FLAG = '0'
AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = 'zxc')
</select>
<!-- 查询徽章认证记录 -->
<select id="selectAuthRecord" resultType="com.epmet.dto.result.UserOperListResultDTO">
SELECT
CUSTOMER_ID,
BADGE_ID,
CERTIFICATION_IMG,
AUDIT_STATUS
FROM user_badge_certificate_record
WHERE DEL_FLAG = 0
AND IS_LAST = 'yes'
AND USER_ID = #{userId}
</select>
<!-- 根据UserId查询个人徽章点亮信息 -->
<select id="selectBadgeByUserId" resultType="com.epmet.dto.result.UserOperListResultDTO">
SELECT
BADGE_ID,
IS_OPENED
FROM resi_user_badge
WHERE
DEL_FLAG = '0'
AND CERTIFICATION_AUTID_STATUS = 'pass'
AND USER_ID = #{userId}
</select>
<!-- 查询单个徽章的认证记录 -->
<select id="selectBadgeAuthRecord" resultType="com.epmet.dto.result.CertificationDetailResultDTO">
SELECT
SURNAME,
NAME,
ID_NUM,
( CASE WHEN AUDIT_STATUS = 'approved' THEN 'yes' ELSE 'no' END ) AS isCertificated,
MOBILE,
CERTIFICATION_IMG,
REMAEK AS remark,
CUSTOMER_ID,
BADGE_ID,
CERTIFICATION_IMG,
AUDIT_STATUS,
AUDIT_STATUS AS authResult,
AUDIT_REMARK AS authReason
FROM
user_badge_certificate_record
WHERE
DEL_FLAG = 0
AND IS_LAST = 'yes'
AND BADGE_ID = #{badgeId}
AND USER_ID = #{userId}
</select>
<!-- 个人中心-查询徽章要显示的认证信息字段 -->
<select id="selectAuthField" resultType="com.epmet.dto.result.AuthFieldResultDTO">
SELECT
cf.CN_NAME,
cf.EN_NAME,
cf.FIELD_TYPE,
cf.IS_REQUIRED,
cf.SORT
FROM badge_certification_config_field cf
LEFT JOIN badge_certification_config cc ON cc.CERTIFICATION_TYPE = cf.CERTIFICATION_TYPE
WHERE cf.DEL_FLAG = 0
AND cc.DEL_FLAG = 0
AND cc.CUSTOMER_ID = #{customerId}
AND cc.BADGE_ID = #{badgeId}
ORDER BY cf.SORT
</select>
<!-- 徽章审核记录表插入 -->
<insert id="insertUserBadgeCertificateRecord">
INSERT INTO user_badge_certificate_record (
ID,
CUSTOMER_ID,
GRID_ID,
USER_ID,
BADGE_ID,
SURNAME,
NAME,
MOBILE,
ID_NUM,
CERTIFICATION_IMG,
REMAEK,
AUDIT_STATUS,
AUDIT_REMARK,
STAFF_ID,
AUDIT_TIME,
IS_LAST,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
)
VALUES
(
REPLACE ( UUID(), '-', '' ),
#{customerId},
#{gridId},
#{userId},
#{badgeId},
#{surname},
#{name},
#{mobile},
#{idNum},
#{certificationImg},
#{remark},
#{auditStatus},
#{auditRemark},
#{staffId},
#{auditTime},
#{isLast},
#{delFlag},
#{revision},
#{createdBy},
NOW(),
#{updatedBy},
NOW()
)
</insert>
</mapper>

10
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -37,6 +37,16 @@
uri.updated_by AS "updatedby",
uri.updated_time AS "updatedtime"
</sql>
<update id="updateByUserId">
update user_resi_info set
SURNAME = #{surname},
NAME = #{name},
STREET = #{street},
DISTRICT = #{district},
BUILDING_ADDRESS = #{buildingAddress}
where USER_ID = #{userId}
and DEL_FLAG = '0'
</update>
<!-- 查询用户注册信息 -->
<select id="selectUserResiInfoDTO" parameterType="com.epmet.dto.form.UserResiInfoFormDTO"

Loading…
Cancel
Save