Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_thirdplatform

feature/evaluate
sunyuchao 5 years ago
parent
commit
76eabba598
  1. 2
      epmet-auth/deploy/docker-compose-test.yml
  2. 18
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java
  3. 15
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java
  4. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  5. 27
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
  6. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java
  7. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  8. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  9. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  10. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
  11. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  12. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java
  13. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  14. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java
  15. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  16. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  17. 38
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  18. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  19. 2
      epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml
  20. 5
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java
  21. 4
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
  22. 4
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java
  23. 45
      epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java
  24. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  25. 2
      epmet-module/epmet-point/epmet-point-server/pom.xml
  26. 19
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
  27. 28
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
  28. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java
  29. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
  30. 7
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java
  31. 9
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java
  32. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java
  33. 32
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
  34. 72
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  35. 26
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  36. 29
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java
  37. 2
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml
  38. 1
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml
  39. 56
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml
  40. 2
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml
  41. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  42. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml
  43. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  44. 2
      epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml
  45. 2
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml
  46. 2
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml
  47. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  48. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  49. 46
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  50. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
  51. 7
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java
  52. 2
      epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml
  53. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  54. 15
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java
  55. 30
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java
  56. 30
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java
  57. 6
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java
  58. 40
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  59. 17
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java
  60. 6
      epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql
  61. 12
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml
  62. 2
      epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml
  63. 2
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/VerificationCodeFromDTO.java
  64. 2
      epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml
  65. 2
      epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml
  66. 2
      epmet-module/resi-mine/resi-mine-server/pom.xml
  67. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml
  68. 2
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  69. 1
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  70. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java
  71. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java
  72. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  73. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  74. 2
      epmet-user/epmet-user-server/deploy/docker-compose-test.yml
  75. 2
      epmet-user/epmet-user-server/pom.xml
  76. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java
  77. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java
  78. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  79. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  80. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  81. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml
  82. 7
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml
  83. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

2
epmet-auth/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-auth-server: epmet-auth-server:
container_name: epmet-auth-server-test container_name: epmet-auth-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.56 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.57
ports: ports:
- "8081:8081" - "8081:8081"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

18
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java

@ -1,18 +0,0 @@
package com.epmet.commons.tools.dto.form.mq.eventmsg;
import lombok.Data;
/**
* 结束活动发放活动积分消息体
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/27 9:26
*/
@Data
public class ActPointEventMsg extends BasePointEventMsg{
/**
* 参与活动的备注
*/
private String remark;
}

15
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java

@ -19,6 +19,11 @@ public class BasePointEventMsg implements Serializable {
*/ */
private String opAgencyId; private String opAgencyId;
/**
* 操作人Id当有固定的操作人时传入此值如果没有则为空
* */
private String operatorId;
/** /**
* 客户Id * 客户Id
*/ */
@ -42,4 +47,14 @@ public class BasePointEventMsg implements Serializable {
* 是否是通用事件通用事件不走规则 * 是否是通用事件通用事件不走规则
*/ */
private Boolean isCommon; private Boolean isCommon;
/**
* 备注
*/
private String remark;
/**
* 业务id eg活动id
*/
private String sourceId;
} }

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

@ -85,6 +85,7 @@ public enum EpmetErrorCode {
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),
NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"), NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"),
ACT_TIME_CONFLICT(8512, "报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。"), ACT_TIME_CONFLICT(8512, "报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。"),
ACT_REGISTRATION_SUCCESS(8513, "报名成功。"),
// 该错误不会提示给前端,只是后端传输错误信息用。 // 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

27
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result.resi;
import lombok.Data;
import java.io.Serializable;
/**
* 活动报名 - 返回值
*
* @Auther: zhangyong
* @Date: 2020-07-28 16:22
*/
@Data
public class ResiActRegistrationResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 异常编码
*/
private Integer flag;
/**
* 提示信息
*/
private String tip;
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java

@ -165,5 +165,5 @@ public class LatestDraftActInfoResultDTO implements Serializable {
/** /**
* 活动内容- * 活动内容-
*/ */
private List<ActDraftContentDTOResultDTO> actContentList; private List<ActDraftContentDTOResultDTO> actContent;
} }

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-heart-server: epmet-heart-server:
container_name: epmet-heart-server-dev container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.5 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.8
ports: ports:
- "8111:8111" - "8111:8111"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.5</version> <version>0.0.8</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId> <artifactId>epmet-heart</artifactId>

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java

@ -131,7 +131,7 @@ public class ResiActListController {
return actInfoService.latestAct(formDto); return actInfoService.latestAct(formDto);
} }
/* /**
* 正在进行中的活动 * 正在进行中的活动
* 进入活动的快捷入口, 前端只取第一条 * 进入活动的快捷入口, 前端只取第一条
* *
@ -158,8 +158,6 @@ public class ResiActListController {
return actInfoService.actLookBack(formDto); return actInfoService.actLookBack(formDto);
} }
//
/** /**
* 活动详情 * 活动详情
* *
@ -217,8 +215,6 @@ public class ResiActListController {
return actLiveRecService.liveRecList(map); return actLiveRecService.liveRecList(map);
} }
//
/** /**
* 取消活动报名 * 取消活动报名
* *
@ -298,12 +294,12 @@ public class ResiActListController {
* *
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActRegistrationResultDTO>
* @Author zhangyong * @Author zhangyong
* @Date 16:46 2020-07-23 * @Date 16:26 2020-07-28
**/ **/
@PostMapping("registration") @PostMapping("registration")
public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { public Result<ResiActRegistrationResultDTO> registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class);
return actUserRelationService.registration(tokenDto, formDTO); return actUserRelationService.registration(tokenDto, formDTO);
} }

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -145,9 +146,9 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
* *
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result<java.util.Map<java.lang.Integer,java.lang.String>>
* @Author zhangyong * @Author zhangyong
* @Date 16:46 2020-07-23 * @Date 15:54 2020-07-28
**/ **/
Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO); Result<ResiActRegistrationResultDTO> registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java

@ -368,7 +368,7 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
dto.setErrorTip(""); dto.setErrorTip("");
return new Result<ResiActAddressResultDTO>().ok(dto); return new Result<ResiActAddressResultDTO>().ok(dto);
} else { } else {
logger.info("您还未进入指定的签到范围~"); logger.info(EpmetErrorCode.NOT_IN_THE_SIGN_IN_RANGE.getMsg());
dto.setIsAddress(false); dto.setIsAddress(false);
dto.setErrorTip(EpmetErrorCode.NOT_IN_THE_SIGN_IN_RANGE.getMsg()); dto.setErrorTip(EpmetErrorCode.NOT_IN_THE_SIGN_IN_RANGE.getMsg());
return new Result<ResiActAddressResultDTO>().ok(dto); return new Result<ResiActAddressResultDTO>().ok(dto);

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java

@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
@ -109,7 +109,7 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
List<Object> dataContainer = new ArrayList<>(); List<Object> dataContainer = new ArrayList<>();
for (int k = 0; k < actLives.size(); k++) { for (int k = 0; k < actLives.size(); k++) {
Map<String, Object> base = new HashMap<>(); Map<String, Object> base = new HashMap<>(NumConstant.ONE);
base.put("nickname", userWxInfos.getData().get(k).getNickname()); base.put("nickname", userWxInfos.getData().get(k).getNickname());
base.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl()); base.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl());
base.put("desc", actLives.get(k).getDesc()); base.put("desc", actLives.get(k).getDesc());
@ -130,6 +130,9 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
logger.error("未查到用户基础信息"); logger.error("未查到用户基础信息");
throw new RenException("未查到用户基础信息"); throw new RenException("未查到用户基础信息");
} }
} else {
resultDto.setActLives(new ArrayList<>());
resultDto.setActLiveNum(NumConstant.ZERO);
} }
return new Result<ResiActLiveRecResultDTO>().ok(resultDto); return new Result<ResiActLiveRecResultDTO>().ok(resultDto);
} }
@ -221,13 +224,14 @@ public class ActLiveRecServiceImpl extends BaseServiceImpl<ActLiveRecDao, ActLiv
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_INSERT_LIVE.getEventClass()); mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_INSERT_LIVE.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_INSERT_LIVE.getEventTag()); mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_INSERT_LIVE.getEventTag());
List<ActPointEventMsg> actPointEventMsgList=new ArrayList<>(); List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>();
ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId()); actPointEventMsg.setCustomerId(formDTO.getCustomerId());
actPointEventMsg.setUserId(formDTO.getUserId()); actPointEventMsg.setUserId(formDTO.getUserId());
actPointEventMsg.setActionFlag(MqConstant.PLUS); actPointEventMsg.setActionFlag(MqConstant.PLUS);
actPointEventMsg.setIsCommon(false); actPointEventMsg.setIsCommon(false);
actPointEventMsg.setRemark(remark); actPointEventMsg.setRemark(remark);
actPointEventMsg.setSourceId(formDTO.getActId());
actPointEventMsgList.add(actPointEventMsg); actPointEventMsgList.add(actPointEventMsg);
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList));

52
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java

@ -39,6 +39,7 @@ import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserLogEntity; import com.epmet.entity.ActUserLogEntity;
import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.ActUserRelationEntity;
import com.epmet.entity.HeartUserInfoEntity; import com.epmet.entity.HeartUserInfoEntity;
@ -54,10 +55,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 用户活动关系表 * 用户活动关系表
@ -197,9 +195,10 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) { public Result<ResiActRegistrationResultDTO> registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
boolean satisfy = false; boolean satisfy = false;
ResiActRegistrationResultDTO resultDTO = new ResiActRegistrationResultDTO();
// 查询活动信息 // 查询活动信息
ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId()); ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId());
// >0 当前用户是志愿者 // >0 当前用户是志愿者
@ -207,15 +206,35 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
if (actInfoDTO.getVolunteerLimit()){ if (actInfoDTO.getVolunteerLimit()){
// 活动只能志愿者参加, 当前用户是否满足条件 // 活动只能志愿者参加, 当前用户是否满足条件
satisfy = this.volunteerParticipationAct(volunteerFlag); satisfy = this.volunteerParticipationAct(volunteerFlag);
if (!satisfy){
logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg());
resultDTO.setFlag(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
resultDTO.setTip(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
}
} else { } else {
// 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件 // 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件
satisfy = this.resiParticipationAct(formDTO.getUserId()); satisfy = this.resiParticipationAct(formDTO.getUserId());
if (!satisfy){
logger.info(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
resultDTO.setFlag(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
resultDTO.setTip(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
}
} }
if (satisfy){ if (satisfy){
// 开始报名 // 开始报名
this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag); boolean actTimeConflict = this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag);
if (!actTimeConflict){
logger.info(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg());
resultDTO.setFlag(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
resultDTO.setTip(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
}
} }
return new Result(); resultDTO.setFlag(EpmetErrorCode.ACT_REGISTRATION_SUCCESS.getCode());
resultDTO.setTip(EpmetErrorCode.ACT_REGISTRATION_SUCCESS.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(resultDTO);
} }
/** /**
@ -228,7 +247,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
* @Author zhangyong * @Author zhangyong
* @Date 15:31 2020-07-24 * @Date 15:31 2020-07-24
**/ **/
private void actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO, Integer volunteerFlag){ private boolean actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO, Integer volunteerFlag){
boolean signUp = true; boolean signUp = true;
Integer auditingNum = actUserLogService.countActTimesOfParticipation(formDTO.getUserId()); Integer auditingNum = actUserLogService.countActTimesOfParticipation(formDTO.getUserId());
if (auditingNum > NumConstant.ZERO){ if (auditingNum > NumConstant.ZERO){
@ -237,8 +256,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
Integer actTimeFlag = actInfoService.checkActTime(actInfoDTO); Integer actTimeFlag = actInfoService.checkActTime(actInfoDTO);
if (actTimeFlag > NumConstant.ZERO){ if (actTimeFlag > NumConstant.ZERO){
signUp = false; signUp = false;
logger.info("报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。"); return signUp;
throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
} }
} else { } else {
// 3.第一次报名 // 3.第一次报名
@ -249,7 +267,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
this.insertActUserLog(formDTO); this.insertActUserLog(formDTO);
} }
// 5.插入 用户活动关系表 // 5.插入 用户活动关系表
this.insertActUserRelation(formDTO, actInfoDTO); this.insertActUserRelation(formDTO, actInfoDTO);
return signUp;
} }
/** /**
@ -265,10 +284,8 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
if (volunteerFlag > NumConstant.ZERO){ if (volunteerFlag > NumConstant.ZERO){
satisfy = true; satisfy = true;
return satisfy; return satisfy;
} else {
logger.info("活动报名失败,请先认证志愿者");
throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
} }
return satisfy;
} }
/** /**
@ -289,12 +306,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
} }
} }
} }
if (!satisfy){ return satisfy;
logger.info("活动报名失败,请完善居民信息");
throw new RenException(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
} else {
return satisfy;
}
} }
/** /**

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java

@ -127,7 +127,7 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl<HeartUserInfoDao,
@Override @Override
public Result<List<ResiLeaderboardResultDTO>> leaderboard(ResiActBaseFormDTO formDTO) { public Result<List<ResiLeaderboardResultDTO>> leaderboard(ResiActBaseFormDTO formDTO) {
List<ResiLeaderboardResultDTO> resultDTOS = new ArrayList<>(); List<ResiLeaderboardResultDTO> resultDtoS = new ArrayList<>();
// 获取排好序的 排行榜 // 获取排好序的 排行榜
List<HeartUserInfoDTO> leaderboardList = baseDao.selectListLeaderboard(formDTO); List<HeartUserInfoDTO> leaderboardList = baseDao.selectListLeaderboard(formDTO);
if (leaderboardList.size() > NumConstant.ZERO){ if (leaderboardList.size() > NumConstant.ZERO){
@ -151,14 +151,14 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl<HeartUserInfoDao,
dto.setNickname(wx.getNickname()); dto.setNickname(wx.getNickname());
} }
} }
resultDTOS.add(dto); resultDtoS.add(dto);
} }
} else { } else {
logger.info("查询用户基本信息接口返回失败"); logger.info("查询用户基本信息接口返回失败");
throw new RenException("查询用户基本信息失败"); throw new RenException("查询用户基本信息失败");
} }
} }
return new Result<List<ResiLeaderboardResultDTO>>().ok(resultDTOS); return new Result<List<ResiLeaderboardResultDTO>>().ok(resultDtoS);
} }
@Override @Override

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -22,7 +22,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -33,7 +33,6 @@ import com.epmet.dao.VolunteerInfoDao;
import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.HeartUserInfoDTO;
import com.epmet.dto.form.WxUserInfoFormDTO; import com.epmet.dto.form.WxUserInfoFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.entity.ActUserRelationEntity;
import com.epmet.entity.VolunteerInfoEntity; import com.epmet.entity.VolunteerInfoEntity;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.VolunteerInfoRedis; import com.epmet.redis.VolunteerInfoRedis;
@ -103,8 +102,8 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass()); mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag()); mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag());
List<ActPointEventMsg> actPointEventMsgList=new ArrayList<>(); List<BasePointEventMsg> actPointEventMsgList=new ArrayList<>();
ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); BasePointEventMsg actPointEventMsg=new BasePointEventMsg();
actPointEventMsg.setCustomerId(formDTO.getCustomerId()); actPointEventMsg.setCustomerId(formDTO.getCustomerId());
actPointEventMsg.setUserId(formDTO.getUserId()); actPointEventMsg.setUserId(formDTO.getUserId());
actPointEventMsg.setActionFlag(MqConstant.PLUS); actPointEventMsg.setActionFlag(MqConstant.PLUS);

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -76,7 +76,7 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
LatestDraftActInfoResultDTO latestAct=latestActInfoService.getLatestActDraft(userId); LatestDraftActInfoResultDTO latestAct=latestActInfoService.getLatestActDraft(userId);
if(null!=latestAct){ if(null!=latestAct){
List<ActDraftContentDTOResultDTO> actContentList=latestActContentService.selectActContentList(latestAct.getActDraftId()); List<ActDraftContentDTOResultDTO> actContentList=latestActContentService.selectActContentList(latestAct.getActDraftId());
latestAct.setActContentList(actContentList); latestAct.setActContent(actContentList);
} }
return latestAct; return latestAct;
}else{ }else{

38
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -3,11 +3,10 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
@ -122,8 +121,9 @@ public class WorkActServiceImpl implements WorkActService {
sponsorResultDTO.setAgencyGridList(ConvertUtils.sourceToTarget(result.getData().getAgencyGridList(), Grid.class)); sponsorResultDTO.setAgencyGridList(ConvertUtils.sourceToTarget(result.getData().getAgencyGridList(), Grid.class));
return sponsorResultDTO; return sponsorResultDTO;
} }
}else{
logger.error("当前用户id获取为空");
} }
logger.error("当前用户id获取为空");
return null; return null;
} }
@ -687,13 +687,13 @@ public class WorkActServiceImpl implements WorkActService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void saveActualTime(SaveActualTimeFormDTO formDTO) { public void saveActualTime(SaveActualTimeFormDTO formDTO) {
if(formDTO.getActualStartTime().compareTo(formDTO.getActualEndTime())!=-1){ Date actualStartTime= DateUtils.minStrToSecondDate(formDTO.getActualStartTime());
Date actualEndTime= DateUtils.minStrToSecondDate(formDTO.getActualEndTime());
if(actualStartTime.compareTo(actualEndTime)!=-1){
throw new RenException(EpmetErrorCode.ACT_ACTUAL_START_TIME_ERROR.getCode()); throw new RenException(EpmetErrorCode.ACT_ACTUAL_START_TIME_ERROR.getCode());
} }
ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId());
Date actualStartTime= DateUtils.minStrToSecondDate(formDTO.getActualStartTime());
actInfoDTO.setActualStartTime(actualStartTime); actInfoDTO.setActualStartTime(actualStartTime);
Date actualEndTime= DateUtils.minStrToSecondDate(formDTO.getActualEndTime());
actInfoDTO.setActualEndTime(actualEndTime); actInfoDTO.setActualEndTime(actualEndTime);
actInfoDTO.setServiceMin(DateUtils.calculateMin(actualStartTime,actualEndTime)); actInfoDTO.setServiceMin(DateUtils.calculateMin(actualStartTime,actualEndTime));
actInfoService.update(actInfoDTO); actInfoService.update(actInfoDTO);
@ -778,7 +778,7 @@ public class WorkActServiceImpl implements WorkActService {
private void grantActPoints(ActInfoDTO actInfoDTO) { private void grantActPoints(ActInfoDTO actInfoDTO) {
//查询已经给分的用户 //查询已经给分的用户
QueryWrapper<ActUserRelationEntity> wrapper = new QueryWrapper<>(); QueryWrapper<ActUserRelationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(actInfoDTO.getId()), FieldConstant.ID, actInfoDTO.getId()) wrapper.eq(StringUtils.isNotBlank(actInfoDTO.getId()), "ACT_ID", actInfoDTO.getId())
.eq("PROCESS_FLAG",ActConstant.HANDLED) .eq("PROCESS_FLAG",ActConstant.HANDLED)
.eq("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE); .eq("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE);
List<ActUserRelationEntity> actUserRelationEntityList=actUserRelationDao.selectList(wrapper); List<ActUserRelationEntity> actUserRelationEntityList=actUserRelationDao.selectList(wrapper);
@ -799,19 +799,21 @@ public class WorkActServiceImpl implements WorkActService {
mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass());
//事件code //事件code
mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag());
List<ActPointEventMsg> actPointEventMsgList=new ArrayList<>(); List<BasePointEventMsg> basePointEventMsgArrayList=new ArrayList<>();
for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){ for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){
ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); BasePointEventMsg basePointEventMsg=new BasePointEventMsg();
actPointEventMsg.setOpAgencyId(opAgencyId); basePointEventMsg.setOpAgencyId(opAgencyId);
actPointEventMsg.setCustomerId(actInfoDTO.getCustomerId()); basePointEventMsg.setCustomerId(actInfoDTO.getCustomerId());
actPointEventMsg.setUserId(actUserRelationEntity.getUserId()); basePointEventMsg.setUserId(actUserRelationEntity.getUserId());
actPointEventMsg.setActionFlag(MqConstant.PLUS); basePointEventMsg.setActionFlag(MqConstant.PLUS);
actPointEventMsg.setPoint(actInfoDTO.getReward()); basePointEventMsg.setPoint(actInfoDTO.getReward());
actPointEventMsg.setIsCommon(true); basePointEventMsg.setIsCommon(true);
actPointEventMsg.setRemark(remark); basePointEventMsg.setRemark(remark);
actPointEventMsgList.add(actPointEventMsg); basePointEventMsg.setSourceId(actInfoDTO.getId());
basePointEventMsg.setOperatorId(loginUserUtil.getLoginUserId());
basePointEventMsgArrayList.add(basePointEventMsg);
} }
mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); mqBaseMsgDTO.setMsg(JSON.toJSONString(basePointEventMsgArrayList));
Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO); Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO);
if(!result.success()){ if(!result.success()){
logger.error("活动积分发放失败"); logger.error("活动积分发放失败");

26
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -59,7 +59,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'signing_up' AS actCurrentState, -- 活动状态:报名中,未报满 'signing_up' AS actCurrentState, -- 活动状态:报名中,未报满
@ -85,7 +85,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'enough' AS actCurrentState, -- 活动状态:报名中,已报满 'enough' AS actCurrentState, -- 活动状态:报名中,已报满
@ -112,7 +112,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'end_sign_up' AS actCurrentState, -- 活动状态:未开始 'end_sign_up' AS actCurrentState, -- 活动状态:未开始
@ -138,7 +138,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'in_progress' AS actCurrentState, -- 活动状态:进行中 'in_progress' AS actCurrentState, -- 活动状态:进行中
@ -164,7 +164,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'finished' AS actCurrentState, -- 活动状态:已结束 'finished' AS actCurrentState, -- 活动状态:已结束
@ -190,7 +190,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'auditing' AS actCurrentState -- 活动状态 'auditing' AS actCurrentState -- 活动状态
@ -213,7 +213,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'passed' AS actCurrentState -- 活动状态 'passed' AS actCurrentState -- 活动状态
@ -236,7 +236,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'refused' AS actCurrentState -- 活动状态 'refused' AS actCurrentState -- 活动状态
@ -259,7 +259,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'canceld' AS actCurrentState -- 活动状态 'canceld' AS actCurrentState -- 活动状态
@ -282,7 +282,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, i.ACT_QUOTA_CATEGORY actQuotaCategory,
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
case case
@ -391,12 +391,12 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
i.REWARD reward, i.REWARD reward,
i.REQUIREMENT requirement, i.REQUIREMENT requirement,
IF(i.VOLUNTEER_LIMIT = 1, true , false ) as volunteerLimit, -- 是否是志愿者(true:只有志愿者才可以参加活动1,false: 只要是居民就可以参加活动0) i.VOLUNTEER_LIMIT volunteerLimit, -- 是否是志愿者(true:只有志愿者才可以参加活动1,false: 只要是居民就可以参加活动0)
i.SPONSOR_NAME sponsor, i.SPONSOR_NAME sponsor,
DATE_FORMAT(i.ACTUAL_START_TIME,'%Y-%m-%d %H:%i') actualStartTime, DATE_FORMAT(i.ACTUAL_START_TIME,'%Y-%m-%d %H:%i') actualStartTime,
DATE_FORMAT(i.ACTUAL_END_TIME,'%Y-%m-%d %H:%i') actualEndTime, DATE_FORMAT(i.ACTUAL_END_TIME,'%Y-%m-%d %H:%i') actualEndTime,
@ -420,7 +420,7 @@
DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime, DATE_FORMAT(i.ACT_START_TIME,'%Y-%m-%d %H:%i') actStartTime,
DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime, DATE_FORMAT(i.ACT_END_TIME,'%Y-%m-%d %H:%i') actEndTime,
i.ACT_ADDRESS actAddress, i.ACT_ADDRESS actAddress,
IF(i.ACT_QUOTA_CATEGORY = 1, true , false ) as actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0)) i.ACT_QUOTA_CATEGORY actQuotaCategory, -- 活动名额类型(true:固定名额(1) false: 不限制名额(0))
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
i.SPONSOR_CONTACTS contacts, i.SPONSOR_CONTACTS contacts,
i.SPONSOR_TEL tel, i.SPONSOR_TEL tel,

2
epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-test.yml

@ -3,7 +3,7 @@ services:
epmet-oss-server: epmet-oss-server:
container_name: epmet-oss-server-test container_name: epmet-oss-server-test
# image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2 # image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-oss-server:0.3.23 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-oss-server:0.3.24
ports: ports:
- "8083:8083" - "8083:8083"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

5
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java

@ -53,6 +53,11 @@ public class UserPointActionLogDTO implements Serializable {
*/ */
private String actionFlag; private String actionFlag;
/**
* 来源Id可以是活动Id
* */
private String sourceId;
/** /**
* 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID * 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID
*/ */

4
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java

@ -44,10 +44,12 @@ public class PointVerificationFormDTO implements Serializable {
@NotBlank(message = "当前工作人员Id不能为空", groups = PointVerificationGroup.class) @NotBlank(message = "当前工作人员Id不能为空", groups = PointVerificationGroup.class)
private String operatorId; private String operatorId;
@NotBlank(message = "缺失经度信息" , groups = PointVerificationGroup.class)
private String longitude; private String longitude;
@NotBlank(message = "缺失维度信息" , groups = PointVerificationGroup.class)
private String dimension; private String dimension;
@NotBlank(message = "缺失地址信息" , groups = PointVerificationGroup.class)
private String address; private String address;
} }

4
epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java

@ -26,7 +26,7 @@ public class WorkPointVerificationFormDTO implements Serializable {
private String timeParam; private String timeParam;
@Min(1) @Min(1)
private Integer pageNo; private Integer pageNo = 1;
private Integer pageSize; private Integer pageSize = 20;
} }

45
epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java

@ -14,5 +14,50 @@ import lombok.Data;
@Data @Data
public class SendPointFormDTO { public class SendPointFormDTO {
private String pointDesc; private String pointDesc;
/**
* 积分
* */
private Integer point; private Integer point;
/**
* 操作人机关id
*/
private String opAgencyId;
/**
* 操作人Id当有固定的操作人时传入此值如果没有则为空
* */
private String operatorId;
/**
* 客户Id
*/
private String customerId;
/**
* 被操作用户id
*/
private String userId;
/**
* 加减分标识 plus/minus
*/
private String actionFlag;
/**
* 是否是通用事件通用事件不走规则
*/
private Boolean isCommon;
/**
* 备注
*/
private String remark;
/**
* 业务id eg活动id
*/
private String sourceId;
} }

2
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-point-server: epmet-point-server:
container_name: epmet-point-server-dev container_name: epmet-point-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.4 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.6
ports: ports:
- "8112:8112" - "8112:8112"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.4</version> <version>0.0.6</version>
<parent> <parent>
<artifactId>epmet-point</artifactId> <artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>

19
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java

@ -1,10 +1,13 @@
package com.epmet.controller; 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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CustomerUserFormDTO; import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.result.CustomerUser4PointResultDTO; import com.epmet.dto.result.CustomerUser4PointResultDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.PointAdjustmentResultDTO; import com.epmet.dto.result.PointAdjustmentResultDTO;
@ -69,5 +72,21 @@ public class AdjustmentController {
ValidatorUtils.validateEntity(param, IssueInitiatorFormDTO.UserIdGroup.class); ValidatorUtils.validateEntity(param, IssueInitiatorFormDTO.UserIdGroup.class);
return new Result<List<PointAdjustmentResultDTO>>().ok(pointAdjustmentLogService.adjustRecord(param)); return new Result<List<PointAdjustmentResultDTO>>().ok(pointAdjustmentLogService.adjustRecord(param));
} }
/**
* @Description 积分调整
* @param param
* @return
* @author wangc
* @date 2020.07.27 13:52
**/
@PostMapping("adjust")
public Result adjustPoint(@LoginUser TokenDto token, @RequestBody PointAdjustmentFormDTO param){
param.setOperatorId(token.getUserId());
param.setCustomerId(token.getCustomerId());
ValidatorUtils.validateEntity(param, PointAdjustmentFormDTO.PointAdjustmentGroup.class);
pointAdjustmentLogService.adjustPoint(param);
return new Result();
}
} }

28
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java

@ -1,5 +1,16 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.common.token.annotation.Login;
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.PointVerificationFormDTO;
import com.epmet.dto.result.PointVerificationResultDTO;
import com.epmet.service.PointVerificationLogService;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -12,5 +23,22 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("work/exchange") @RequestMapping("work/exchange")
public class ExchangeController { public class ExchangeController {
@Autowired
private PointVerificationLogService pointVerificationLogService;
/**
* @Description 积分核销
* @param verificationParam
* @return
* @author wangc
* @date 2020.07.27 14:03
**/
@PostMapping("execute")
public Result<PointVerificationResultDTO> execute(@LoginUser TokenDto token, @RequestBody PointVerificationFormDTO verificationParam){
verificationParam.setOperatorId(token.getUserId());
ValidatorUtils.validateEntity(verificationParam, PointVerificationFormDTO.PointVerificationGroup.class);
return new Result<PointVerificationResultDTO>().ok(pointVerificationLogService.verifyPoint(verificationParam));
}
} }

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java

@ -46,7 +46,7 @@ public class MqPointCallbackController {
} }
SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class); SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class);
try { try {
//TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. userPointActionLogService.grantPoint(formDTO);
} catch (Exception e) { } catch (Exception e) {
logger.error("activeSendPoint consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); logger.error("activeSendPoint consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg()));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg());

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java

@ -54,5 +54,5 @@ public interface PointVerificationLogDao extends BaseDao<PointVerificationLogEnt
* @author wangc * @author wangc
* @date 2020.07.25 13:17 * @date 2020.07.25 13:17
**/ **/
List<WorkPointVerificationLogResultDTO> selectStaffVerificationLog(String staffId, Date startDate, Date endDate); List<WorkPointVerificationLogResultDTO> selectStaffVerificationLog(@Param("staffId") String staffId, @Param("startDate") Date startDate,@Param("endDate") Date endDate);
} }

7
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java

@ -54,10 +54,15 @@ public class UserPointActionLogEntity extends BaseEpmetEntity {
private String actionFlag; private String actionFlag;
/** /**
* 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID * 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID
*/ */
private String eventId; private String eventId;
/**
* 来源Id可以是活动Id
* */
private String sourceId;
/** /**
* 活动描述 获取积分的原因相关内容用来拼接用户参加了xxx活动获取积分的文案取活动的名称积分调整文案其他 * 活动描述 获取积分的原因相关内容用来拼接用户参加了xxx活动获取积分的文案取活动的名称积分调整文案其他
如果是管理员手动调整扣减积分ACTION_FLAG为"minus"但是不会生成核销记录核销记录只保存用户使用积分兑换商品的核销详情 如果是管理员手动调整扣减积分ACTION_FLAG为"minus"但是不会生成核销记录核销记录只保存用户使用积分兑换商品的核销详情

9
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java

@ -23,6 +23,7 @@ import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO; import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.entity.UserPointActionLogEntity; import com.epmet.entity.UserPointActionLogEntity;
import dto.form.SendPointFormDTO;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -104,5 +105,13 @@ public interface UserPointActionLogService extends BaseService<UserPointActionLo
**/ **/
List<ResiPointLogListResultDTO> getMyPointRecord(CommonPageUserFormDTO pageUser); List<ResiPointLogListResultDTO> getMyPointRecord(CommonPageUserFormDTO pageUser);
/**
* @Description 消息网关回调进行积分发放
* @param grantPointParam
* @return
* @author wangc
* @date 2020.07.29 09:11
**/
void grantPoint(SendPointFormDTO grantPointParam);
} }

2
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java

@ -178,7 +178,7 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl<PointAdjustme
if(null == param.getPoint()) throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); if(null == param.getPoint()) throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
Date currentTime = new Date(); Date currentTime = new Date();
Integer point = param.getPoint(); Integer point = param.getPoint();
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,param.getAdjustmentType())){ if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,param.getAdjustmentType()) || param.getAdjustmentType().toLowerCase().contains("m")){
if(point > NumConstant.ZERO){ if(point > NumConstant.ZERO){
point *= NumConstant.ONE_NEG; point *= NumConstant.ONE_NEG;
} }

32
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java

@ -185,11 +185,24 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
try{ try{
Date date = format.parse(verificationParam.getTimeParam()); Date date = format.parse(verificationParam.getTimeParam());
if(NumConstant.ONE < verificationParam.getPageNo()){
PageHelper.startPage(verificationParam.getPageNo(),verificationParam.getPageSize());
}
List<WorkPointVerificationLogResultDTO> dataList = List<WorkPointVerificationLogResultDTO> dataList =
baseDao.selectStaffVerificationLog(verificationParam.getStaffId(),getFirstDayDateOfMonth(date),getLastDayOfMonth(date)); baseDao.selectStaffVerificationLog(verificationParam.getStaffId(),getFirstDayDateOfMonth(date),getLastDayOfMonth(date));
result.setTotalPoint( if(NumConstant.ONE < verificationParam.getPageNo()){
dataList.stream().mapToInt(o -> o.getPoint()).sum() result.setTotalPoint(
); dataList.stream().mapToInt(o -> o.getPoint()).sum()
);
}else{
int fromIndex = verificationParam.getPageNo() * verificationParam.getPageSize();
int toIndex = (verificationParam.getPageNo() + 1) * verificationParam.getPageSize();
if(toIndex > dataList.size()) {
toIndex = dataList.size();
}
dataList = dataList.subList(fromIndex,toIndex);
}
List<String> userIds = dataList.stream().map(data -> data.getUserId()).collect(Collectors.toList()); List<String> userIds = dataList.stream().map(data -> data.getUserId()).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> userInfo = Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds); epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
@ -223,7 +236,8 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public PointVerificationResultDTO verifyPoint(PointVerificationFormDTO verificationParam) { public PointVerificationResultDTO verifyPoint(PointVerificationFormDTO verificationParam) {
Date currentTime = new Date();
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(new Date());
PointVerificationResultDTO result = new PointVerificationResultDTO(); PointVerificationResultDTO result = new PointVerificationResultDTO();
ResiCommonUserIdFormDTO userId = new ResiCommonUserIdFormDTO(); ResiCommonUserIdFormDTO userId = new ResiCommonUserIdFormDTO();
userId.setUserId(verificationParam.getUserId()); userId.setUserId(verificationParam.getUserId());
@ -247,7 +261,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
String agencyId = ModuleConstant.EMPTY_STR; String agencyId = ModuleConstant.EMPTY_STR;
String operatorName = ModuleConstant.EMPTY_STR; String operatorName = ModuleConstant.EMPTY_STR;
PointVerificationStatisticalDailyEntity statistical = new PointVerificationStatisticalDailyEntity(); PointVerificationStatisticalDailyEntity statistical = new PointVerificationStatisticalDailyEntity();
if(staffResult.success() && null != staffResult.getData()){ if(staffResult.success() && null != staffResult.getData()){
statistical = ConvertUtils.sourceToTarget(staffResult.getData(),PointVerificationStatisticalDailyEntity.class); statistical = ConvertUtils.sourceToTarget(staffResult.getData(),PointVerificationStatisticalDailyEntity.class);
customerId = staffResult.getData().getCustomerId(); customerId = staffResult.getData().getCustomerId();
@ -257,6 +271,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
//1.记录积分行为日志 - 居民端 //1.记录积分行为日志 - 居民端
UserPointActionLogEntity action = new UserPointActionLogEntity(); UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(customerId);
action.setCreatedBy(verificationParam.getOperatorId()); action.setCreatedBy(verificationParam.getOperatorId());
action.setUserId(verificationParam.getUserId()); action.setUserId(verificationParam.getUserId());
action.setActionFlag(ModuleConstant.OPERATION_TYPE_MINUS); action.setActionFlag(ModuleConstant.OPERATION_TYPE_MINUS);
@ -278,7 +293,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
verificationLog.setAddress(verificationParam.getAddress()); verificationLog.setAddress(verificationParam.getAddress());
pointVerificationLogDao.insert(verificationLog); pointVerificationLogDao.insert(verificationLog);
//3.记录积分日统计表 //3.记录积分日统计表
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(currentTime);
UserPointStatisticalDailyEntity userStatistical = ConvertUtils.sourceToTarget(dim,UserPointStatisticalDailyEntity.class); UserPointStatisticalDailyEntity userStatistical = ConvertUtils.sourceToTarget(dim,UserPointStatisticalDailyEntity.class);
userStatistical.setUserId(verificationParam.getUserId()); userStatistical.setUserId(verificationParam.getUserId());
userStatistical.setActionFlag(ModuleConstant.OPERATION_TYPE_EXCHANGE); userStatistical.setActionFlag(ModuleConstant.OPERATION_TYPE_EXCHANGE);
@ -287,6 +302,11 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl<PointVerifi
userPointStatisticalDailyService.insertOrUpdate(userStatistical); userPointStatisticalDailyService.insertOrUpdate(userStatistical);
//4.记录积分核销日统计 - 政府端 //4.记录积分核销日统计 - 政府端
statistical.setVerificatedPoint(point * NumConstant.ONE_NEG); statistical.setVerificatedPoint(point * NumConstant.ONE_NEG);
statistical.setDateId(dim.getDateId());
statistical.setWeekId(dim.getWeekId());
statistical.setMonthId(dim.getMonthId());
statistical.setQuarterId(dim.getQuarterId());
statistical.setYearId(dim.getYearId());
pointVerificationStatisticalDailyService.insertOrUpdate(statistical); pointVerificationStatisticalDailyService.insertOrUpdate(statistical);
//5.更新用户总积分表 //5.更新用户总积分表
UserPointTotalEntity userPoint = new UserPointTotalEntity(); UserPointTotalEntity userPoint = new UserPointTotalEntity();

72
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

@ -20,6 +20,8 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
@ -29,10 +31,18 @@ import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.result.ResiPointLogListResultDTO; import com.epmet.dto.result.ResiPointLogListResultDTO;
import com.epmet.dto.result.ResiPointLogPeriodResultDTO; import com.epmet.dto.result.ResiPointLogPeriodResultDTO;
import com.epmet.entity.UserPointActionLogEntity; import com.epmet.entity.UserPointActionLogEntity;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.service.UserPointActionLogService; import com.epmet.service.UserPointActionLogService;
import com.epmet.service.UserPointStatisticalDailyService;
import com.epmet.service.UserPointTotalService;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import dto.form.SendPointFormDTO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -48,6 +58,10 @@ import java.util.stream.Collectors;
@Service @Service
public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActionLogDao, UserPointActionLogEntity> implements UserPointActionLogService { public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActionLogDao, UserPointActionLogEntity> implements UserPointActionLogService {
@Autowired
private UserPointTotalService userPointTotalService;
@Autowired
private UserPointStatisticalDailyService userPointStatisticalDailyService;
@Override @Override
public PageData<UserPointActionLogDTO> page(Map<String, Object> params) { public PageData<UserPointActionLogDTO> page(Map<String, Object> params) {
@ -131,4 +145,62 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
return result; return result;
} }
/**
* @Description 消息网关回调进行积分发放
* @param grantPointParam
* @return
* @author wangc
* @date 2020.07.29 09:11
**/
@Override
public void grantPoint(SendPointFormDTO grantPointParam){
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPointParam.getActionFlag())){
//减
if(grantPointParam.getPoint() > NumConstant.ZERO){
//保证负数
grantPointParam.setPoint(grantPointParam.getPoint() * NumConstant.ONE_NEG);
}
}else{
//加
if(grantPointParam.getPoint() < NumConstant.ZERO){
//保证正数
grantPointParam.setPoint(grantPointParam.getPoint() * NumConstant.ONE_NEG);
}
}
//1.新增用户积分行为记录
UserPointActionLogEntity action = new UserPointActionLogEntity();
action.setCustomerId(grantPointParam.getCustomerId());
action.setPoint(grantPointParam.getPoint());
action.setEventStatement(grantPointParam.getPointDesc());
action.setEventName(EventEnum.ACTIVE_SEND_POINT.getEventDesc());
action.setEventId(EventEnum.ACTIVE_INSERT_LIVE.getEventTag());
action.setActionFlag(grantPointParam.getActionFlag());
action.setUserId(grantPointParam.getUserId());
action.setCreatedBy(grantPointParam.getOperatorId());
action.setUpdatedBy(grantPointParam.getOperatorId());
action.setSourceId(grantPointParam.getSourceId());
action.setOperatorAgencyId(grantPointParam.getOpAgencyId());
baseDao.insert(action);
//2.新增/修改用户积分日统计
DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date());
UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class);
statistical.setPointChange(grantPointParam.getPoint());
statistical.setActionFlag(grantPointParam.getActionFlag());
statistical.setCustomerId(grantPointParam.getCustomerId());
statistical.setUserId(grantPointParam.getUserId());
statistical.setCreatedBy(grantPointParam.getOperatorId());
statistical.setUpdatedBy(grantPointParam.getOperatorId());
userPointStatisticalDailyService.insertOrUpdate(statistical);
//3.新增/修改用户总积分
UserPointTotalEntity point = new UserPointTotalEntity();
point.setCustomerId(grantPointParam.getCustomerId());
point.setUserId(grantPointParam.getUserId());
point.setTotalPoint(grantPointParam.getPoint());
point.setUsablePoint(grantPointParam.getPoint());
point.setUsedPoint(NumConstant.ZERO);
point.setCreatedBy(grantPointParam.getOperatorId());
point.setUpdatedBy(grantPointParam.getOperatorId());
userPointTotalService.insertOrUpdate(point);
}
} }

26
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java

@ -147,19 +147,24 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
List<ResiPointRankResultDTO> rankList = List<ResiPointRankResultDTO> rankList =
baseDao.selectPointRankWithinTimeZone(pointRankFormDTO.getCustomerId(),pointRankFormDTO.getTimeDimension(),dimVal); baseDao.selectPointRankWithinTimeZone(pointRankFormDTO.getCustomerId(),pointRankFormDTO.getTimeDimension(),dimVal);
if(null == rankList || rankList.isEmpty()){ if(null == rankList || rankList.isEmpty()){
o.setMyPoint(NumConstant.ZERO); if(NumConstant.ONE < pointRankFormDTO.getPageNo()){
o.setMyRanking(NumConstant.ZERO); return result;
}else {
return result; o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
result.add(o);
return result;
}
} }
//如果请求的是第一页 //如果请求的是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) { if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself = ResiPointRankResultDTO myself = null;
rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst().get(); Optional<ResiPointRankResultDTO> opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst();
if (null != myself) { if(opt.isPresent()){
myself = opt.get();
o.setMyPoint(myself.getTotalPoint()); o.setMyPoint(myself.getTotalPoint());
o.setMyRanking(myself.getRank()); o.setMyRanking(myself.getRank());
} else { }else{
o.setMyPoint(NumConstant.ZERO); o.setMyPoint(NumConstant.ZERO);
if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) { if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE); o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE);
@ -167,8 +172,9 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl<UserPo
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank()); o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank());
} }
} }
int fromIndex = pointRankFormDTO.getPageNo() * pointRankFormDTO.getPageSize();
int toIndex = (pointRankFormDTO.getPageNo() + 1) * pointRankFormDTO.getPageSize(); int fromIndex = (pointRankFormDTO.getPageNo() - 1) * pointRankFormDTO.getPageSize();
int toIndex = pointRankFormDTO.getPageNo() * pointRankFormDTO.getPageSize();
if(toIndex > rankList.size()) { if(toIndex > rankList.size()) {
toIndex = rankList.size(); toIndex = rankList.size();
} }

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

@ -156,29 +156,34 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
baseDao.selectUserPointRank(pointRankFormDTO.getCustomerId()); baseDao.selectUserPointRank(pointRankFormDTO.getCustomerId());
//当排行榜没有数据时 //当排行榜没有数据时
if(null == rankList || rankList.isEmpty()){ if(null == rankList || rankList.isEmpty()){
o.setMyPoint(NumConstant.ZERO); if(NumConstant.ONE < pointRankFormDTO.getPageNo()){
o.setMyRanking(NumConstant.ZERO); return result;
}else {
result.add(o); o.setMyPoint(NumConstant.ZERO);
return result; o.setMyRanking(NumConstant.ZERO);
result.add(o);
return result;
}
} }
//如果当前请求不是第一页 //如果当前请求不是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) { if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself = ResiPointRankResultDTO myself = null;
rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst().get(); Optional<ResiPointRankResultDTO> opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst();
if (null != myself) { if(opt.isPresent()){
myself = opt.get();
o.setMyPoint(myself.getTotalPoint()); o.setMyPoint(myself.getTotalPoint());
o.setMyRanking(myself.getRank()); o.setMyRanking(myself.getRank());
} else { } else {
if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) { if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE); o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE);
} else { } else {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank()); o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank());
} }
} }
int fromIndex = pointRankFormDTO.getPageNo() * pointRankFormDTO.getPageSize();
int toIndex = (pointRankFormDTO.getPageNo() + 1) * pointRankFormDTO.getPageSize(); int fromIndex = (pointRankFormDTO.getPageNo() - 1) * pointRankFormDTO.getPageSize();
int toIndex = pointRankFormDTO.getPageNo() * pointRankFormDTO.getPageSize();
if(toIndex > rankList.size()) { if(toIndex > rankList.size()) {
toIndex = rankList.size(); toIndex = rankList.size();
} }
@ -218,7 +223,7 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl<UserPointTotalDao
@Override @Override
public void insertOrUpdate(UserPointTotalEntity entity) { public void insertOrUpdate(UserPointTotalEntity entity) {
UserPointTotalEntity existed = baseDao.selectIfExisted(entity.getUserId()); UserPointTotalEntity existed = baseDao.selectIfExisted(entity.getUserId());
if(null != existed && StringUtils.isBlank(existed.getId())){ if(null != existed && StringUtils.isNotBlank(existed.getId())){
existed.setUsedPoint(null == existed.getUsedPoint() ? entity.getUsedPoint() : entity.getUsedPoint() + existed.getUsedPoint()); existed.setUsedPoint(null == existed.getUsedPoint() ? entity.getUsedPoint() : entity.getUsedPoint() + existed.getUsedPoint());
existed.setUsablePoint(null == existed.getUsablePoint() ? entity.getUsablePoint() : entity.getUsablePoint() + existed.getUsablePoint()); existed.setUsablePoint(null == existed.getUsablePoint() ? entity.getUsablePoint() : entity.getUsablePoint() + existed.getUsablePoint());
existed.setTotalPoint(null == existed.getTotalPoint() ? entity.getTotalPoint() : entity.getTotalPoint() + existed.getTotalPoint()); existed.setTotalPoint(null == existed.getTotalPoint() ? entity.getTotalPoint() : entity.getTotalPoint() + existed.getTotalPoint());

2
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml

@ -27,7 +27,7 @@
adjust_reason AS reason, adjust_reason AS reason,
DATE_FORMAT( created_time, '%Y-%m-%d %H:%i:%s' ) AS date, DATE_FORMAT( created_time, '%Y-%m-%d %H:%i:%s' ) AS date,
CASE CASE
action_flag ADJUSTMENT_TYPE
WHEN 'plus' THEN WHEN 'plus' THEN
CONCAT( '+', POINT ) ELSE CONCAT( '-', POINT ) CONCAT( '+', POINT ) ELSE CONCAT( '-', POINT )
END AS POINT END AS POINT

1
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml

@ -9,6 +9,7 @@
<result property="customerId" column="CUSTOMER_ID"/> <result property="customerId" column="CUSTOMER_ID"/>
<result property="actionFlag" column="ACTION_FLAG"/> <result property="actionFlag" column="ACTION_FLAG"/>
<result property="eventId" column="EVENT_ID"/> <result property="eventId" column="EVENT_ID"/>
<result property="sourceId" column="SOURCE_ID" />
<result property="eventStatement" column="EVENT_STATEMENT"/> <result property="eventStatement" column="EVENT_STATEMENT"/>
<result property="eventName" column="EVENT_NAME"/> <result property="eventName" column="EVENT_NAME"/>
<result property="point" column="POINT"/> <result property="point" column="POINT"/>

56
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml

@ -25,38 +25,42 @@
<!-- 查询客户下周/月度用户积分排行榜 传参:客户Id | 维度 | 维度值 --> <!-- 查询客户下周/月度用户积分排行榜 传参:客户Id | 维度 | 维度值 -->
<!-- user_point_statistical_daily中的action_flag有三种key值,plus(获取),exchange(积分兑换),minus(调整、惩罚),当action_flag为minus时,point_change为负值,其余均为正数 --> <!-- user_point_statistical_daily中的action_flag有三种key值,plus(获取),exchange(积分兑换),minus(调整、惩罚),当action_flag为minus时,point_change为负值,其余均为正数 -->
<select id="selectPointRankWithinTimeZone" resultType="com.epmet.dto.result.ResiPointRankResultDTO"> <select id="selectPointRankWithinTimeZone" resultType="com.epmet.dto.result.ResiPointRankResultDTO">
SELECT SELECT IF ( @point > point.TOTAL_POINT,
IF @rank := @rank + 1,
( @point > point.TOTAL_POINT, @rank := @rank + 1, @rank := @rank + 0 ) AS rank, @rank := @rank + 0
point.user_id, ) AS rank,
point.TOTAL_POINT, point.user_id,
-- CASE WHEN point.TOTAL_POINT <![CDATA[>=]]> 0 THEN point.TOTAL_POINT ELSE 0 END AS totalPoint, point.TOTAL_POINT,
@point := point.TOTAL_POINT @point := point.TOTAL_POINT
FROM FROM
( (
SELECT SELECT
USER_ID, total.USER_ID,
SUM( POINT_CHANGE ) AS TOTAL_POINT IFNULL( SUM( daily.POINT_CHANGE ), 0 ) AS POINT_CHANGE,
IF
( POINT_CHANGE <![CDATA[ < ]]> 0, 0, IFNULL( SUM( daily.POINT_CHANGE ), 0 ) ) AS TOTAL_POINT
FROM FROM
user_point_statistical_daily user_point_total total
LEFT JOIN user_point_statistical_daily daily ON daily.USER_ID = total.USER_ID
AND daily.DEL_FLAG = '0'
AND daily.USER_ID = total.USER_ID
AND daily.CUSTOMER_ID = #{customerId}
<if test='dimension == "week"'>
AND daily.WEEK_ID = #{dimensionId}
</if>
<if test='dimension == "month"'>
AND daily.MONTH_ID = #{dimensionId}
</if>
AND ( daily.ACTION_FLAG = 'plus' OR daily.ACTION_FLAG = 'minus' )
WHERE WHERE
DEL_FLAG = '0' total.DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId} AND total.DEL_FLAG = '0'
<if test='dimension == "week"'>
AND WEEK_ID = #{dimensionId}
</if>
<if test='dimension == "month"'>
AND MONTH_ID = #{dimensionId}
</if>
AND ACTION_FLAG = 'plus'
OR ACTION_FLAG = 'minus'
GROUP BY GROUP BY
USER_ID total.USER_ID
ORDER BY ORDER BY
TOTAL_POINT DESC TOTAL_POINT DESC
) point, ) point,
( SELECT @point := NULL, @rank := 1 ) a ( SELECT @point := NULL, @rank := 1 ) a
</select> </select>
<!-- 查询有无指定日期的积分日统计 userId dateId actionFlag--> <!-- 查询有无指定日期的积分日统计 userId dateId actionFlag-->

2
epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml

@ -48,7 +48,7 @@
<select id="selectIfExisted" resultType="com.epmet.entity.UserPointTotalEntity"> <select id="selectIfExisted" resultType="com.epmet.entity.UserPointTotalEntity">
SELECT SELECT
ID, ID,
USERD_POINT, USED_POINT,
USABLE_POINT, USABLE_POINT,
TOTAL_POINT TOTAL_POINT
FROM FROM

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-third-server: epmet-third-server:
container_name: epmet-third-server-dev container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.72 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.75
ports: ports:
- "8110:8110" - "8110:8110"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-third-server: epmet-third-server:
container_name: epmet-third-server-test container_name: epmet-third-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.65 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.72
ports: ports:
- "8110:8110" - "8110:8110"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.72</version> <version>0.0.75</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>

2
epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
gov-mine-server: gov-mine-server:
container_name: gov-mine-server-test container_name: gov-mine-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-mine-server:0.3.32 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-mine-server:0.3.33
ports: ports:
- "8098:8098" - "8098:8098"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
gov-org-server: gov-org-server:
container_name: gov-org-server-dev container_name: gov-org-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.77 image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.80
ports: ports:
- "8092:8092" - "8092:8092"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
gov-org-server: gov-org-server:
container_name: gov-org-server-test container_name: gov-org-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.76 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.77
ports: ports:
- "8092:8092" - "8092:8092"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/gov-org/gov-org-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.3.77</version> <version>0.3.80</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>gov-org</artifactId> <artifactId>gov-org</artifactId>

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -154,8 +154,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
//cx代表市 //cx代表市
//yz代表区 //yz代表区
map.put("areaCode",areaCode); map.put("areaCode",areaCode);
map.put("cityCode",areaCode.substring(NumConstant.ZERO,areaCode.length()-NumConstant.TWO)); //map.put("cityCode",areaCode.substring(NumConstant.ZERO,areaCode.length()-NumConstant.TWO));
map.put("provinceCode",areaCode.substring(NumConstant.ZERO,areaCode.length()-NumConstant.FOUR)); //map.put("provinceCode",areaCode.substring(NumConstant.ZERO,areaCode.length()-NumConstant.FOUR));
map.put("pageSize",listCustomerGridFormDTO.getPageSize()); map.put("pageSize",listCustomerGridFormDTO.getPageSize());
map.put("pageNo",listCustomerGridFormDTO.getPageNo()); map.put("pageNo",listCustomerGridFormDTO.getPageNo());

46
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -65,7 +65,7 @@
SELECT c.* SELECT c.*
FROM FROM
(
( (
SELECT SELECT
@ -98,52 +98,10 @@
a.area_code = #{areaCode} a.area_code = #{areaCode}
ORDER BY ORDER BY
CONVERT ( gridName USING gbk ) ASC CONVERT ( gridName USING gbk ) ASC
LIMIT 0,999999999999
)
UNION
(
SELECT
b.id AS grid_id,
b.customer_id,
concat(agency.fullname , '-' ,b.grid_name) as gridName
FROM
CUSTOMER_GRID b
LEFT JOIN (
SELECT
a1.id,
CASE
WHEN a2.ORGANIZATION_NAME IS NULL THEN
a1.ORGANIZATION_NAME ELSE concat( a2.ORGANIZATION_NAME, '-', a1.ORGANIZATION_NAME )
END AS fullname
FROM
customer_agency a1
LEFT JOIN customer_agency a2 ON a1.PID = a2.ID
AND a1.del_flag = '0'
WHERE
a1.del_flag = '0'
) agency ON b.PID = agency.ID
) c
WHERE
b.del_flag = 0
AND
b.area_code LIKE CONCAT(#{cityCode},'%')
AND <![CDATA[ b.area_code <> #{areaCode}
]]>
ORDER BY
b.area_code DESC ,CONVERT ( gridName USING gbk ) ASC
LIMIT 0,999999999999
)
) AS c
LIMIT #{pageNo}, #{pageSize} LIMIT #{pageNo}, #{pageSize}
</select> </select>

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -121,7 +121,7 @@
<select id="selectActSponsorGrid" resultType="com.epmet.dto.result.ActSponsorGridInfo" parameterType="java.lang.String"> <select id="selectActSponsorGrid" resultType="com.epmet.dto.result.ActSponsorGridInfo" parameterType="java.lang.String">
SELECT SELECT
csg.GRID_ID, csg.GRID_ID,
CONCAT( ca.ORGANIZATION_NAME, '-', cg.GRID_NAME ) AS agencyGridName, CONCAT( ca.ORGANIZATION_NAME, '-', cg.GRID_NAME ) AS agencyGridName
FROM FROM
customer_staff_grid csg customer_staff_grid csg
LEFT JOIN customer_grid cg ON ( csg.GRID_ID = cg.ID AND cg.DEL_FLAG = '0' ) LEFT JOIN customer_grid cg ON ( csg.GRID_ID = cg.ID AND cg.DEL_FLAG = '0' )

7
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java

@ -28,6 +28,11 @@ public class DraftDetailResultDTO implements Serializable {
*/ */
private String title; private String title;
/**
* 标题审核状态
*/
private String titleAuditStatus;
/** /**
* 发布单位名称 * 发布单位名称
*/ */
@ -36,7 +41,7 @@ public class DraftDetailResultDTO implements Serializable {
/** /**
* 发布日期 * 发布日期
*/ */
@JsonFormat(pattern="yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date publishDate; private Date publishDate;
/** /**

2
epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
gov-voice-server: gov-voice-server:
container_name: gov-voice-server-test container_name: gov-voice-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.59 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.62
ports: ports:
- "8105:8105" - "8105:8105"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -255,7 +255,7 @@ public class ArticleController {
articleService.updateAuditStatusFailById(draftId, syncScanResult); articleService.updateAuditStatusFailById(draftId, syncScanResult);
} }
} catch (Exception e) { } catch (Exception e) {
articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL, null);
log.error("scanContent exception draftId:{} return result null", e); log.error("scanContent exception draftId:{} return result null", e);
} }
} }

15
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java

@ -75,10 +75,11 @@ public interface DraftDao extends BaseDao<DraftEntity> {
/** /**
* 草稿列表 * 草稿列表
* @author zhaoqifeng *
* @date 2020/6/3 14:54
* @param userId * @param userId
* @return java.util.List<com.epmet.dto.result.DraftListResultDTO> * @return java.util.List<com.epmet.dto.result.DraftListResultDTO>
* @author zhaoqifeng
* @date 2020/6/3 14:54
*/ */
List<DraftListResultDTO> selectDraftList(@Param("userId") String userId); List<DraftListResultDTO> selectDraftList(@Param("userId") String userId);
@ -102,5 +103,13 @@ public interface DraftDao extends BaseDao<DraftEntity> {
int deleteDraft(String draftId); int deleteDraft(String draftId);
int updateAuditStatusById(@Param("draftId") String draftId, @Param("statusFlag") String statusFlag); /**
* desc:修改审核状态2个状态至少填一个
*
* @param draftId
* @param statusFlag
* @param titleAuditStatus
* @return
*/
int updateAuditStatusById(@Param("draftId") String draftId, @Param("statusFlag") String statusFlag, @Param("titleAuditStatus") String titleAuditStatus);
} }

30
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java

@ -18,7 +18,6 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -43,24 +42,29 @@ public class ArticleEntity extends BaseEpmetEntity {
*/ */
private String customerId; private String customerId;
/** /**
* 草稿ID * 草稿ID
*/ */
private String draftId; private String draftId;
/** /**
* 文章标题 * 文章标题
*/ */
private String title; private String title;
/** /**
* 文章内容 精简内容 * 标题审核状态
*/ */
private String titleAuditStatus;
/**
* 文章内容 精简内容
*/
private String previewContent; private String previewContent;
/** /**
* 是否置顶 * 是否置顶
*/ */
private Integer isTop; private Integer isTop;
/** /**

30
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java

@ -18,7 +18,6 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -38,24 +37,29 @@ public class DraftEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 客户ID * 客户ID
*/ */
private String customerId; private String customerId;
/** /**
* 文章标题 * 文章标题
*/ */
private String title; private String title;
/** /**
* 文章内容 精简内容 * 标题审核状态
*/ */
private String titleAuditStatus;
/**
* 文章内容 精简内容
*/
private String previewContent; private String previewContent;
/** /**
* 是否置顶 * 是否置顶
*/ */
private Integer isTop; private Integer isTop;
/** /**

6
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java

@ -200,12 +200,14 @@ public interface ArticleService extends BaseService<ArticleEntity> {
DraftContentSaveResultDTO saveDraft(TokenDto tokenDto, DraftContentFromDTO fromDTO); DraftContentSaveResultDTO saveDraft(TokenDto tokenDto, DraftContentFromDTO fromDTO);
/** /**
* desc:政府端点审核结果处理异常后 修改草稿审核状态 * desc:政府端点审核结果处理异常后 修改草稿审核状态 2选1
*
* @param draftId * @param draftId
* @param statusFlag * @param statusFlag
* @param titleAuditStatus
* @return * @return
*/ */
void updateDraftPublishStatus(String draftId,String statusFlag); void updateDraftPublishStatus(String draftId, String statusFlag, String titleAuditStatus);
/** /**
* desc:人工发布文章 不走审核接口 * desc:人工发布文章 不走审核接口

40
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -970,13 +970,19 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (!isOk) { if (!isOk) {
this.sendMsg(draftEntity.getCustomerId(), draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle())); this.sendMsg(draftEntity.getCustomerId(), draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL, null);
return null; return null;
} }
SyncScanResult result = null; SyncScanResult result = null;
try { try {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO();
TextTaskDTO titleTextTask = new TextTaskDTO();
titleTextTask.setDataId(ModuleConstant.SCAN_TITLE_PREFIX.concat(StrConstant.UNDER_LINE).concat(draftEntity.getId()));
titleTextTask.setContent(draftEntity.getTitle());
textScanParamDTO.getTasks().add(titleTextTask);
DraftCoverDTO draftCoverDTO = draftCoverDao.selectCoverIdAndUrlByDraftId(draftId); DraftCoverDTO draftCoverDTO = draftCoverDao.selectCoverIdAndUrlByDraftId(draftId);
if (draftCoverDTO != null) { if (draftCoverDTO != null) {
ImgTaskDTO taskDTO = new ImgTaskDTO(); ImgTaskDTO taskDTO = new ImgTaskDTO();
@ -1021,7 +1027,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} }
} }
result = new SyncScanResult(); result = new SyncScanResult();
if (imgSyncScanResult != null) { if (imgSyncScanResult != null) {
SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData(); SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData();
@ -1042,7 +1047,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} catch (Exception e) { } catch (Exception e) {
log.error("scanContent exception", e); log.error("scanContent exception", e);
this.sendMsg(draftEntity.getCustomerId(), draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle())); this.sendMsg(draftEntity.getCustomerId(), draftEntity.getTitle(), String.format(ModuleConstant.MSG_ARTICLE_PUBLISH_ERROR, draftEntity.getTitle()));
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL, null);
} }
log.debug("scanContent result:{}", JSON.toJSONString(result)); log.debug("scanContent result:{}", JSON.toJSONString(result));
return result; return result;
@ -1092,18 +1097,21 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg());
} }
if (syncScanResult.isAllPass()) { if (syncScanResult.isAllPass()) {
this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED); this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED, null);
} else { } else {
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL, null);
} }
boolean coverFail = false, contentFail = false; boolean coverFail = false, contentFail = false, titleFail = false;
try { try {
List<String> failDataIds = syncScanResult.getFailDataIds(); List<String> failDataIds = syncScanResult.getFailDataIds();
for (String id : failDataIds) { for (String id : failDataIds) {
if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) {
draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE), ""), ModuleConstant.AUDIT_STATUS_FAIL); draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE), ""), ModuleConstant.AUDIT_STATUS_FAIL);
coverFail = true; coverFail = true;
} else if (id.indexOf(ModuleConstant.SCAN_TITLE_PREFIX) >= NumConstant.ZERO) {
this.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL, ModuleConstant.AUDIT_STATUS_FAIL);
titleFail = true;
} else { } else {
draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL); draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_FAIL);
contentFail = true; contentFail = true;
@ -1113,18 +1121,28 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
successDataIds.forEach(id -> { successDataIds.forEach(id -> {
if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) { if (id.indexOf(ModuleConstant.SCAN_COVER_PREFIX) >= NumConstant.ZERO) {
draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE), ""), ModuleConstant.AUDIT_STATUS_PASS); draftCoverDao.updateAuditStatusById(id.replace(ModuleConstant.SCAN_COVER_PREFIX.concat(StrConstant.UNDER_LINE), ""), ModuleConstant.AUDIT_STATUS_PASS);
} else if (id.indexOf(ModuleConstant.SCAN_TITLE_PREFIX) >= NumConstant.ZERO) {
this.updateDraftPublishStatus(draftId, null, ModuleConstant.AUDIT_STATUS_PASS);
} else { } else {
draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS); draftContentDao.updateAuditStatusById(id, ModuleConstant.AUDIT_STATUS_PASS);
} }
}); });
if (coverFail || contentFail) { if (coverFail || contentFail || titleFail) {
String auditMsg = ""; String auditMsg = "";
if (coverFail && contentFail) { if (titleFail && coverFail && contentFail) {
auditMsg = ModuleConstant.DRAFT_TITLE_CONTENT_AND_COVER;
} else if (coverFail && contentFail) {
auditMsg = ModuleConstant.DRAFT_CONTENT_AND_COVER; auditMsg = ModuleConstant.DRAFT_CONTENT_AND_COVER;
} else if (titleFail && coverFail) {
auditMsg = ModuleConstant.DRAFT_TITLE_AND_COVER;
} else if (titleFail && contentFail) {
auditMsg = ModuleConstant.DRAFT_TITLE_AND_CONTENT;
} else if (contentFail) { } else if (contentFail) {
auditMsg = ModuleConstant.DRAFT_CONTENT; auditMsg = ModuleConstant.DRAFT_CONTENT;
} else if (coverFail) { } else if (coverFail) {
auditMsg = ModuleConstant.DRAFT_COVER; auditMsg = ModuleConstant.DRAFT_COVER;
} else if (titleFail) {
auditMsg = ModuleConstant.DRAFT_TITLE;
} }
this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(), auditMsg)); this.sendMsg(draft.getCustomerId(), draft.getTitle(), String.format(ModuleConstant.MSG_AUDIT_CONTENT, draft.getTitle(), auditMsg));
} }
@ -1154,8 +1172,8 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
} }
@Override @Override
public void updateDraftPublishStatus(String draftId, String statusFlag) { public void updateDraftPublishStatus(String draftId, String statusFlag, String titleAuditStatus) {
draftDao.updateAuditStatusById(draftId, statusFlag); draftDao.updateAuditStatusById(draftId, statusFlag, titleAuditStatus);
} }
@Override @Override
@ -1164,7 +1182,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
try { try {
//校验草稿状态 并更新为已发布 //校验草稿状态 并更新为已发布
DraftEntity draftEntity = checkDraftStatus(draftId); DraftEntity draftEntity = checkDraftStatus(draftId);
this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED); this.updateDraftPublishStatus(draftId, DraftConstant.PUBLISHED, null);
//复制 草稿到文章(草稿内容,封面,属性) //复制 草稿到文章(草稿内容,封面,属性)
ArticleEntity articleEntity = this.publishDraftToArticle(draftEntity, ArticleConstant.PUBLISH_WAY_MANUAL); ArticleEntity articleEntity = this.publishDraftToArticle(draftEntity, ArticleConstant.PUBLISH_WAY_MANUAL);
UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId); UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = this.updateCustomerTag(tokenDto, draftId);

17
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -66,22 +66,27 @@ public interface ModuleConstant {
/** /**
* 草稿未找到异常模板 * 草稿未找到异常模板
* */ */
String SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE = "未找到指定草稿,草稿Id:【%s】"; String SPECIFIED_DRAFT_NOT_FOUNT_EXCEPTION_TEMPLATE = "未找到指定草稿,草稿Id:【%s】";
/** /**
* 内容审核 封面图片前缀用于标识这个Id是封面图片 * 内容审核 封面图片前缀用于标识这个Id是封面图片
* */ */
String SCAN_COVER_PREFIX = "cover_"; String SCAN_COVER_PREFIX = "cover_";
/**
* 内容审核 标题前缀用于标识这个Id是标题
*/
String SCAN_TITLE_PREFIX = "title_";
/** /**
* 文章站内消息标题 * 文章站内消息标题
* */ */
String MSG_TITLE = "您有一条文章【%s】的消息"; String MSG_TITLE = "您有一条文章【%s】的消息";
/** /**
* 文章未审核通过 消息内容模版 * 文章未审核通过 消息内容模版
* */ */
String MSG_AUDIT_CONTENT = "您好,您发布的【%s】文章%s审核未通过,请重新编辑后发布,谢谢。"; String MSG_AUDIT_CONTENT = "您好,您发布的【%s】文章%s审核未通过,请重新编辑后发布,谢谢。";
/** /**
@ -116,11 +121,15 @@ public interface ModuleConstant {
String DRAFT_ID_IS_NULL = "草稿ID不能为空"; String DRAFT_ID_IS_NULL = "草稿ID不能为空";
String DRAFT_TITLE_CONTENT_AND_COVER = "标题、内容和封面";
String DRAFT_TITLE_AND_COVER = "标题和封面";
String DRAFT_TITLE_AND_CONTENT = "标题和内容";
String DRAFT_CONTENT_AND_COVER = "内容和封面"; String DRAFT_CONTENT_AND_COVER = "内容和封面";
String DRAFT_CONTENT = "内容"; String DRAFT_CONTENT = "内容";
String DRAFT_COVER = "封面"; String DRAFT_COVER = "封面";
String DRAFT_TITLE = "标题";
String DRAFT_CONTENT_IS_NULL = "文章封面不能为空"; String DRAFT_CONTENT_IS_NULL = "文章封面不能为空";

6
epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql

@ -1,2 +1,6 @@
ALTER TABLE `epmet_gov_voice`.`article` ALTER TABLE `epmet_gov_voice`.`article`
ADD COLUMN `PUBLISH_WAY` varchar(16) NOT NULL DEFAULT 'autoAudit' COMMENT '发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit' AFTER `TAGS`; ADD COLUMN `PUBLISH_WAY` varchar(16) NOT NULL DEFAULT 'autoAudit' COMMENT '发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit' AFTER `TAGS`;
ALTER TABLE `epmet_gov_voice`.`draft`
ADD COLUMN `TITLE_AUDIT_STATUS` varchar(32) NULL COMMENT '标题审核状态 通过:pass;失败:fail;审核中:auditing' AFTER `TITLE`;
ALTER TABLE `epmet_gov_voice`.`article`
ADD COLUMN `TITLE_AUDIT_STATUS` varchar(32) NULL COMMENT '标题审核状态 通过:pass;失败:fail;审核中:auditing' AFTER `TITLE`;

12
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

@ -155,6 +155,7 @@
SELECT SELECT
d.id AS draft_id, d.id AS draft_id,
d.TITLE, d.TITLE,
d.TITLE_AUDIT_STATUS,
d.PUBLISHER_NAME, d.PUBLISHER_NAME,
d.PUBLISH_DATE, d.PUBLISH_DATE,
0 AS visit_record_count, 0 AS visit_record_count,
@ -185,6 +186,15 @@
update draft set DEL_FLAG='1' where id=#{draftId} update draft set DEL_FLAG='1' where id=#{draftId}
</update> </update>
<update id="updateAuditStatusById"> <update id="updateAuditStatusById">
update draft set STATUS_FLAG =#{statusFlag,jdbcType=VARCHAR} where id=#{draftId,jdbcType=VARCHAR} update draft
<set>
<if test="titleAuditStatus != null and titleAuditStatus!= ''">
STATUS_FLAG =#{statusFlag,jdbcType=VARCHAR}
</if>
<if test="titleAuditStatus != null and titleAuditStatus!= ''">
TITLE_AUDIT_STATUS = #{titleAuditStatus,jdbcType=VARCHAR}
</if>
</set>
where id=#{draftId,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

2
epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
oper-customize-server: oper-customize-server:
container_name: oper-customize-server-test container_name: oper-customize-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-customize-server:0.3.23 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/oper-customize-server:0.3.24
ports: ports:
- "8089:8089" - "8089:8089"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/VerificationCodeFromDTO.java

@ -32,7 +32,7 @@ public class VerificationCodeFromDTO implements Serializable {
private String mobile; private String mobile;
/** /**
* 行为记录表ID * 行为记录表ID partymember_visit.id
*/ */
@NotBlank(message = "行为记录表ID不能为空") @NotBlank(message = "行为记录表ID不能为空")
private String visitId; private String visitId;

2
epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
resi-mine-server: resi-mine-server:
container_name: resi-mine-server-dev container_name: resi-mine-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.30 image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.31
ports: ports:
- "8094:8094" - "8094:8094"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
resi-mine-server: resi-mine-server:
container_name: resi-mine-server-test container_name: resi-mine-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-mine-server:0.3.29 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-mine-server:0.3.30
ports: ports:
- "8094:8094" - "8094:8094"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/resi-mine/resi-mine-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.3.30</version> <version>0.3.31</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>resi-mine</artifactId> <artifactId>resi-mine</artifactId>

2
epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
resi-partymember-server: resi-partymember-server:
container_name: resi-partymember-server-dev container_name: resi-partymember-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.55 image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.56
ports: ports:
- "8096:8096" - "8096:8096"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.3.55</version> <version>0.3.56</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>resi-partymember</artifactId> <artifactId>resi-partymember</artifactId>

1
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -560,6 +560,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
userResiInfoDTO.setResiVisitId(partyMemberInfoDTO.getPartymemberVisitId()); userResiInfoDTO.setResiVisitId(partyMemberInfoDTO.getPartymemberVisitId());
userResiInfoDTO.setDistrict(partyMemberInfoDTO.getEstate()); userResiInfoDTO.setDistrict(partyMemberInfoDTO.getEstate());
userResiInfoDTO.setBuildingAddress(partyMemberInfoDTO.getBuilding()); userResiInfoDTO.setBuildingAddress(partyMemberInfoDTO.getBuilding());
userResiInfoDTO.setCustomerId(partyMemberInfoDTO.getCustomerId());
epmetUserFeignClient.saveResiInfo(userResiInfoDTO); epmetUserFeignClient.saveResiInfo(userResiInfoDTO);
} }
} }

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

@ -17,9 +17,11 @@
package com.epmet.dto; package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
@ -51,7 +53,8 @@ public class UserResiInfoDTO implements Serializable {
/** /**
* 手机号(注册手机号) * 手机号(注册手机号)
*/ */
private String regMobile; @NotBlank(message = "手机号不能为空")
private String regMobile;
/** /**
* 姓氏 * 姓氏
@ -121,6 +124,7 @@ public class UserResiInfoDTO implements Serializable {
/** /**
* 客户Id (customer.id) * 客户Id (customer.id)
*/ */
@NotBlank(message = "客户Id不能为空")
private String customerId; private String customerId;
/** /**

10
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java

@ -63,4 +63,14 @@ public class ResiUserBaseInfoResultDTO implements Serializable {
* 楼栋单元 * 楼栋单元
*/ */
private String buildingAddress; private String buildingAddress;
/**
* 昵称(目前来源于微信昵称后续系统可支持用户有昵称)
*/
private String nickname;
/**
* 头像目前来源于微信后续系统顾客支持上传头像
*/
private String headImgUrl;
} }

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

@ -24,8 +24,8 @@ import java.util.List;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09 * @date 2020/6/4 13:09
*/ */
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "localhost:8087") //@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "localhost:8087")
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class)
public interface EpmetUserOpenFeignClient { public interface EpmetUserOpenFeignClient {
/** /**

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-user-server: epmet-user-server:
container_name: epmet-user-server-dev container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.84 image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.87
ports: ports:
- "8087:8087" - "8087:8087"
network_mode: host # 不会创建新的网络 network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-user-server: epmet-user-server:
container_name: epmet-user-server-test container_name: epmet-user-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.81 image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.86
ports: ports:
- "8087:8087" - "8087:8087"
network_mode: host # 不会创建新的网络 network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.3.84</version> <version>0.3.87</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId> <artifactId>epmet-user</artifactId>

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

@ -149,6 +149,7 @@ public class UserResiInfoController {
**/ **/
@PostMapping("saveResiInfo") @PostMapping("saveResiInfo")
public Result saveResiInfo (@RequestBody UserResiInfoDTO userResiInfoDTO) { public Result saveResiInfo (@RequestBody UserResiInfoDTO userResiInfoDTO) {
ValidatorUtils.validateEntity(userResiInfoDTO);
return userResiInfoService.saveResiInfo(userResiInfoDTO); return userResiInfoService.saveResiInfo(userResiInfoDTO);
} }

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

@ -39,8 +39,8 @@ import java.util.List;
public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> { public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
/** /**
* @return com.epmet.dto.UserResiInfoDTO
* @param userResiInfoFormDTO * @param userResiInfoFormDTO
* @return com.epmet.dto.UserResiInfoDTO
* @Author yinzuomei * @Author yinzuomei
* @Description 查询用户注册信息 * @Description 查询用户注册信息
* @Date 2020/3/30 11:10 * @Date 2020/3/30 11:10
@ -48,23 +48,23 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
UserResiInfoResultDTO selectUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO); UserResiInfoResultDTO selectUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO);
/** /**
* @Description 查询用户注册信息 不按照客户Id查询
* @param userResiInfoFormDTO * @param userResiInfoFormDTO
* @return UserResiInfoResultDTO * @return UserResiInfoResultDTO
* @Description 查询用户注册信息 不按照客户Id查询
* @author wangc * @author wangc
* @date 2020.05.21 13:18 * @date 2020.05.21 13:18
**/ **/
UserResiInfoResultDTO selectUserResiInfoNotByCustId(UserResiInfoFormDTO userResiInfoFormDTO); UserResiInfoResultDTO selectUserResiInfoNotByCustId(UserResiInfoFormDTO userResiInfoFormDTO);
/** /**
* @Author sun * @Author sun
* @Description 根据手机号查询居民注册信息(user_resi_info)表数据 * @Description 根据手机号查询居民注册信息(user_resi_info)表数据
**/ **/
List<UserResiInfoDTO> selectResiInfoByMobile(String regMobile); List<UserResiInfoDTO> selectResiInfoByMobile(@Param("regMobile") String regMobile, @Param("customerId") String customerId);
/** /**
* @return java.util.List<com.epmet.dto.UserResiInfoDTO>
* @param userIdList * @param userIdList
* @return java.util.List<com.epmet.dto.UserResiInfoDTO>
* @Author yinzuomei * @Author yinzuomei
* @Description 根据userId集合查询用户注册信息 * @Description 根据userId集合查询用户注册信息
* @Date 2020/4/7 18:26 * @Date 2020/4/7 18:26
@ -72,8 +72,8 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
List<UserResiInfoResultDTO> selectListUserResiInfoDTO(@Param("userIdList") List<String> userIdList); List<UserResiInfoResultDTO> selectListUserResiInfoDTO(@Param("userIdList") List<String> userIdList);
/** /**
* @Description 根据userId查询议题发起人
* @param formDTO * @param formDTO
* @Description 根据userId查询议题发起人
* @author zxc * @author zxc
* @date 2020/5/11 11:18 * @date 2020/5/11 11:18
*/ */

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -222,13 +222,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
if (null == roleList || roleList.size() == 0) { if (null == roleList || roleList.size() == 0) {
return new Result<List<RoleInfoResultDTO>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); return new Result<List<RoleInfoResultDTO>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
} }
List<RoleInfoResultDTO> staffRoleList = roleList.stream().map(p -> { List<RoleInfoResultDTO> staffRoleList = roleList.stream()
RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO(); .filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey()))
staffRoleResultDTO.setRoleId(p.getId()); .map(p -> {
staffRoleResultDTO.setRoleName(p.getRoleName()); RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO();
staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly()); staffRoleResultDTO.setRoleId(p.getId());
return staffRoleResultDTO; staffRoleResultDTO.setRoleName(p.getRoleName());
}).collect(Collectors.toList()); staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly());
return staffRoleResultDTO;
}).collect(Collectors.toList());
return new Result<List<RoleInfoResultDTO>>().ok(staffRoleList); return new Result<List<RoleInfoResultDTO>>().ok(staffRoleList);
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java

@ -194,8 +194,7 @@ public class GridLatestServiceImpl extends BaseServiceImpl<GridLatestDao, GridLa
return allData; return allData;
} }
allData.forEach(info -> { allData.forEach(info -> {
if(StringUtils.isBlank(info.getUserName())){ if(StringUtils.isNotBlank(info.getUserId())){
info.setUserName(ModuleConstant.EMPTY_STR);
UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId()); UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId());
if(null != cache) { if(null != cache) {
info.setRegisteredGrid(cache.getRegisteredGridName()); info.setRegisteredGrid(cache.getRegisteredGridName());

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

@ -19,6 +19,7 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.common.token.util.UserUtil;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
@ -33,6 +34,7 @@ import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.UserResiInfoDao; import com.epmet.dao.UserResiInfoDao;
import com.epmet.dao.UserWechatDao; import com.epmet.dao.UserWechatDao;
import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserResiRegisterVisitDTO;
import com.epmet.dto.UserRoleDTO; import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.IssueInitiatorResultDTO;
@ -164,8 +166,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO); userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}*/ }*/
//2:再次判断手机号是否可用 //2:再次判断手机号是否在客户下可用
if (!getResiInfoByMobile(userResiInfoDTO.getRegMobile())) { if (!getResiInfoByMobile(userResiInfoDTO.getRegMobile(), userResiInfoDTO.getCustomerId())) {
//手机号验证失败则更新行为记录表数据 返回前台结果 //手机号验证失败则更新行为记录表数据 返回前台结果
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO); userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode()); return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
@ -221,15 +223,17 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
//1:更新居民注册访问记录表数据 //1:更新居民注册访问记录表数据
userResiRegisterVisitService.updateResiVisitOperate(verificationCodeFormDTO); userResiRegisterVisitService.updateResiVisitOperate(verificationCodeFormDTO);
//2:判断手机号是否可用 //2:判断手机号是否可用
if (!getResiInfoByMobile(verificationCodeFormDTO.getMobile())) { //2020-07-29 根据要注册的网格获取客户Id
UserResiRegisterVisitDTO registerVisitDTO = userResiRegisterVisitService.get(verificationCodeFormDTO.getResiVisitId());
if (!getResiInfoByMobile(verificationCodeFormDTO.getMobile(), registerVisitDTO.getCustomerId())) {
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode()); return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
} }
//3:调用短信服务 生成验证码发送短信 //3:调用短信服务 生成验证码发送短信
SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO();
sendVerificationCodeFormDTO.setMobile(verificationCodeFormDTO.getMobile()); sendVerificationCodeFormDTO.setMobile(verificationCodeFormDTO.getMobile());
sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER); sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER);
Result<SendVerificationCodeResultDTO> result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); Result<SendVerificationCodeResultDTO> result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO);
if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getCode())){ if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getCode())) {
return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode());
} }
//4:删除缓存中可能存在的旧验证码 //4:删除缓存中可能存在的旧验证码
@ -244,7 +248,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
Result result = new Result(); Result result = new Result();
//判断手机号是否可用 //判断手机号是否可用
if (getResiInfoByMobile(userResiInfoDTO.getRegMobile())) { if (getResiInfoByMobile(userResiInfoDTO.getRegMobile(), userResiInfoDTO.getCustomerId())) {
//数据存入居民注册表 //数据存入居民注册表
saveUserResiInfo(userResiInfoDTO); saveUserResiInfo(userResiInfoDTO);
//居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一 //居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
@ -280,12 +284,17 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
* 判断手机号是否可用-根据手机号查询居民注册信息(user_resi_info)表数据 * 判断手机号是否可用-根据手机号查询居民注册信息(user_resi_info)表数据
* *
* @param mobile * @param mobile
* @param customerId
* @return * @return
* @Author sun * @Author sun
*/ */
private Boolean getResiInfoByMobile(String mobile) { private Boolean getResiInfoByMobile(String mobile, String customerId) {
if (StringUtils.isBlank(customerId)) {
customerId = UserUtil.getCurrentUser().getCustomerId();
log.info("getResiInfoByMobile UserUtil.getCustomerId:{}", customerId);
}
Boolean bl = true; Boolean bl = true;
List<UserResiInfoDTO> list = userResiInfoDao.selectResiInfoByMobile(mobile); List<UserResiInfoDTO> list = userResiInfoDao.selectResiInfoByMobile(mobile, customerId);
if (list.size() > 0) { if (list.size() > 0) {
bl = false; bl = false;
} }

4
epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml

@ -81,7 +81,9 @@
MOBILE mobile, MOBILE mobile,
STREET street, STREET street,
DISTRICT district, DISTRICT district,
BUILDING_ADDRESS buildingAddress BUILDING_ADDRESS buildingAddress,
NICKNAME nickname,
HEAD_IMG_URL headImgUrl
FROM user_base_info FROM user_base_info
WHERE DEL_FLAG = '0' WHERE DEL_FLAG = '0'
AND USER_ID = #{userId} AND USER_ID = #{userId}

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

@ -98,8 +98,11 @@
SELECT SELECT
<include refid="sql"></include> <include refid="sql"></include>
FROM user_resi_info uri FROM user_resi_info uri
WHERE uri.del_flag = '0' LEFT JOIN user_customer uc ON uri.USER_ID = uc.USER_ID
AND uri.reg_mobile = #{regMobile} WHERE
uri.DEL_FLAG = '0'
AND uri.REG_MOBILE = #{regMobile,jdbcType=VARCHAR}
AND uc.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</select> </select>
<!-- 根据userId集合查询用户注册信息 --> <!-- 根据userId集合查询用户注册信息 -->

1
epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

@ -103,6 +103,7 @@
user_base_info base on wechat.USER_ID = base.USER_ID user_base_info base on wechat.USER_ID = base.USER_ID
WHERE WHERE
wechat.DEL_FLAG = '0' wechat.DEL_FLAG = '0'
AND (wechat.NICKNAME IS NOT NULL OR wechat.NICKNAME <![CDATA[ <> ]]> '')
<foreach collection="userIds" item="item" open="AND (" separator=" OR " close=" )"> <foreach collection="userIds" item="item" open="AND (" separator=" OR " close=" )">
wechat.USER_ID = #{item} wechat.USER_ID = #{item}
</foreach> </foreach>

Loading…
Cancel
Save