Browse Source

Merge remote-tracking branch 'origin/dev' into release

dev_shibei_match
wxz 5 years ago
parent
commit
2b707b7b38
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 27
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  5. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  6. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
  7. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  8. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  9. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  10. 4
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java
  11. 4
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/WorkPointVerificationFormDTO.java
  12. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  13. 2
      epmet-module/epmet-point/epmet-point-server/pom.xml
  14. 18
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java
  15. 28
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java
  16. 2
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java
  17. 19
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java
  18. 26
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java
  19. 27
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java
  20. 56
      epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml
  21. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  22. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  23. 3
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/CodeConstant.java
  24. 15
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  25. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java
  26. 22
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java
  27. 2
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml
  28. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  29. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/ResiUserBaseInfoResultDTO.java
  30. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  31. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  32. 2
      epmet-user/epmet-user-server/pom.xml
  33. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  34. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java
  35. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml
  36. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml

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, "您还未进入指定的签到范围~"),
NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"),
ACT_TIME_CONFLICT(8512, "报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。"),
ACT_REGISTRATION_SUCCESS(8513, "报名成功。"),
// 该错误不会提示给前端,只是后端传输错误信息用。
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-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-heart-server:
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.6
ports:
- "8111:8111"
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"
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>
<version>0.0.5</version>
<version>0.0.6</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId>

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

@ -293,17 +293,18 @@ public class ResiActListController {
return actSignInRecService.actSignIn(tokenDto, formDTO);
}
/**
/*
* 活动报名
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActRegistrationResultDTO>
* @Author zhangyong
* @Date 16:46 2020-07-23
* @Date 16:26 2020-07-28
**/
@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);
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.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Param;
@ -145,9 +146,9 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
*
* @param tokenDto
* @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
* @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);
}

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

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

@ -33,7 +33,6 @@ import com.epmet.dao.VolunteerInfoDao;
import com.epmet.dto.HeartUserInfoDTO;
import com.epmet.dto.form.WxUserInfoFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.entity.ActUserRelationEntity;
import com.epmet.entity.VolunteerInfoEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.VolunteerInfoRedis;

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

@ -3,7 +3,6 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.StrConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
@ -687,13 +686,13 @@ public class WorkActServiceImpl implements WorkActService {
@Override
@Transactional(rollbackFor = Exception.class)
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());
}
ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId());
Date actualStartTime= DateUtils.minStrToSecondDate(formDTO.getActualStartTime());
actInfoDTO.setActualStartTime(actualStartTime);
Date actualEndTime= DateUtils.minStrToSecondDate(formDTO.getActualEndTime());
actInfoDTO.setActualEndTime(actualEndTime);
actInfoDTO.setServiceMin(DateUtils.calculateMin(actualStartTime,actualEndTime));
actInfoService.update(actInfoDTO);
@ -778,7 +777,7 @@ public class WorkActServiceImpl implements WorkActService {
private void grantActPoints(ActInfoDTO actInfoDTO) {
//查询已经给分的用户
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("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE);
List<ActUserRelationEntity> actUserRelationEntityList=actUserRelationDao.selectList(wrapper);

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)
private String operatorId;
@NotBlank(message = "缺失经度信息" , groups = PointVerificationGroup.class)
private String longitude;
@NotBlank(message = "缺失维度信息" , groups = PointVerificationGroup.class)
private String dimension;
@NotBlank(message = "缺失地址信息" , groups = PointVerificationGroup.class)
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;
@Min(1)
private Integer pageNo;
private Integer pageNo = 1;
private Integer pageSize;
private Integer pageSize = 20;
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-point-server:
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.5
ports:
- "8112:8112"
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"
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>
<version>0.0.4</version>
<version>0.0.5</version>
<parent>
<artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId>

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

@ -1,10 +1,13 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CustomerUserFormDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.PointAdjustmentFormDTO;
import com.epmet.dto.result.CustomerUser4PointResultDTO;
import com.epmet.dto.result.CustomerUserDetailResultDTO;
import com.epmet.dto.result.PointAdjustmentResultDTO;
@ -69,5 +72,20 @@ public class AdjustmentController {
ValidatorUtils.validateEntity(param, IssueInitiatorFormDTO.UserIdGroup.class);
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());
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;
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.RestController;
@ -12,5 +23,22 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("work/exchange")
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/dao/PointVerificationLogDao.java

@ -54,5 +54,5 @@ public interface PointVerificationLogDao extends BaseDao<PointVerificationLogEnt
* @author wangc
* @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);
}

19
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{
Date date = format.parse(verificationParam.getTimeParam());
if(NumConstant.ONE < verificationParam.getPageNo()){
PageHelper.startPage(verificationParam.getPageNo(),verificationParam.getPageSize());
}
List<WorkPointVerificationLogResultDTO> dataList =
baseDao.selectStaffVerificationLog(verificationParam.getStaffId(),getFirstDayDateOfMonth(date),getLastDayOfMonth(date));
result.setTotalPoint(
dataList.stream().mapToInt(o -> o.getPoint()).sum()
);
if(NumConstant.ONE < verificationParam.getPageNo()){
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());
Result<List<UserBaseInfoResultDTO>> userInfo =
epmetUserOpenFeignClient.queryUserBaseInfo(userIds);

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 =
baseDao.selectPointRankWithinTimeZone(pointRankFormDTO.getCustomerId(),pointRankFormDTO.getTimeDimension(),dimVal);
if(null == rankList || rankList.isEmpty()){
o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
return result;
if(NumConstant.ONE < pointRankFormDTO.getPageNo()){
return result;
}else {
o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
result.add(o);
return result;
}
}
//如果请求的是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself =
rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst().get();
if (null != myself) {
ResiPointRankResultDTO myself = null;
Optional<ResiPointRankResultDTO> opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst();
if(opt.isPresent()){
myself = opt.get();
o.setMyPoint(myself.getTotalPoint());
o.setMyRanking(myself.getRank());
} else {
}else{
o.setMyPoint(NumConstant.ZERO);
if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) {
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());
}
}
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()) {
toIndex = rankList.size();
}

27
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());
//当排行榜没有数据时
if(null == rankList || rankList.isEmpty()){
o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
result.add(o);
return result;
if(NumConstant.ONE < pointRankFormDTO.getPageNo()){
return result;
}else {
o.setMyPoint(NumConstant.ZERO);
o.setMyRanking(NumConstant.ZERO);
result.add(o);
return result;
}
}
//如果当前请求不是第一页
if(NumConstant.ONE == pointRankFormDTO.getPageNo()) {
ResiPointRankResultDTO myself =
rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst().get();
if (null != myself) {
ResiPointRankResultDTO myself = null;
Optional<ResiPointRankResultDTO> opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst();
if(opt.isPresent()){
myself = opt.get();
o.setMyPoint(myself.getTotalPoint());
o.setMyRanking(myself.getRank());
} else {
if (rankList.get(rankList.size() - NumConstant.ONE).getTotalPoint() > NumConstant.ZERO) {
o.setMyRanking(rankList.get(rankList.size() - NumConstant.ONE).getRank() + NumConstant.ONE);
} else {
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()) {
toIndex = rankList.size();
}

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

@ -25,38 +25,42 @@
<!-- 查询客户下周/月度用户积分排行榜 传参:客户Id | 维度 | 维度值 -->
<!-- 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
IF
( @point > point.TOTAL_POINT, @rank := @rank + 1, @rank := @rank + 0 ) AS rank,
point.user_id,
point.TOTAL_POINT,
-- CASE WHEN point.TOTAL_POINT <![CDATA[>=]]> 0 THEN point.TOTAL_POINT ELSE 0 END AS totalPoint,
@point := point.TOTAL_POINT
SELECT IF ( @point > point.TOTAL_POINT,
@rank := @rank + 1,
@rank := @rank + 0
) AS rank,
point.user_id,
point.TOTAL_POINT,
@point := point.TOTAL_POINT
FROM
(
(
SELECT
USER_ID,
SUM( POINT_CHANGE ) AS TOTAL_POINT
total.USER_ID,
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
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
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
<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'
total.DEL_FLAG = '0'
AND total.DEL_FLAG = '0'
GROUP BY
USER_ID
total.USER_ID
ORDER BY
TOTAL_POINT DESC
) point,
( SELECT @point := NULL, @rank := 1 ) a
TOTAL_POINT DESC
) point,
( SELECT @point := NULL, @rank := 1 ) a
</select>
<!-- 查询有无指定日期的积分日统计 userId dateId actionFlag-->

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
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.73
ports:
- "8110:8110"
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"
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>
<version>0.0.72</version>
<version>0.0.73</version>
<parent>
<groupId>com.epmet</groupId>

3
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/CodeConstant.java

@ -49,6 +49,9 @@ public interface CodeConstant {
String OPER_UPLOAD = "上传代码";
String OPER_SUBMIT = "提交审核";
String OPER_SUCCESS = "审核成功";
String OPER_FAILED = "审核被拒绝";
String OPER_DELAY = "审核延后";
String OPER_UNDO = "审核撤回";
String OPER_RELEASE = "发布";
}

15
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java

@ -178,18 +178,18 @@ public class CodeServiceImpl implements CodeService {
if (result.getStatus() == NumConstant.ZERO) {
code.setStatus(CodeConstant.AUDIT_SUCCESS);
auditResult.setResult(CodeConstant.AUDIT_SUCCESS);
codeOperationHistoryService.updateDescribe(code.getId(), "审核成功");
saveOperation(formDTO.getCustomerId(), code.getId(), code.getUserVersion(), CodeConstant.OPER_SUCCESS, "审核成功");
} else if (result.getStatus() == NumConstant.ONE) {
code.setStatus(CodeConstant.AUDIT_FAILED);
auditResult.setResult(CodeConstant.AUDIT_FAILED);
auditResult.setReason(result.getReason());
auditResult.setScreenShot(result.getScreenshot());
codeOperationHistoryService.updateDescribe(code.getId(), result.getReason());
saveOperation(formDTO.getCustomerId(), code.getId(), code.getUserVersion(), CodeConstant.OPER_FAILED, result.getReason());
} else if (result.getStatus() == NumConstant.FOUR) {
code.setStatus(CodeConstant.DELAY);
auditResult.setResult(CodeConstant.DELAY);
auditResult.setReason(result.getReason());
codeOperationHistoryService.updateDescribe(code.getId(), "审核延后");
saveOperation(formDTO.getCustomerId(), code.getId(), code.getUserVersion(), CodeConstant.OPER_DELAY, result.getReason());
}
codeCustomerService.update(code);
codeAuditResultService.update(auditResult);
@ -238,6 +238,7 @@ public class CodeServiceImpl implements CodeService {
codeAuditResultDTO.setResult(CodeConstant.AUDITING);
codeAuditResultService.save(codeAuditResultDTO);
} else {
codeAuditResultDTO.setAuditId(wxResult.getData());
codeAuditResultDTO.setResult(CodeConstant.AUDITING);
codeAuditResultService.update(codeAuditResultDTO);
}
@ -349,10 +350,10 @@ public class CodeServiceImpl implements CodeService {
request.setAuditId(codeAuditResultDTO.getAuditId());
WxMaNewsReq wxMaNewsReq = new WxMaNewsReq();
wxMaNewsReq.setMediaId(mediaId);
WxResult<WxMaNewsResult> wxAuditResult = wxMaCodeService.getMaterial(authInfo.getAuthorizerAccessToken(), wxMaNewsReq);
wxAuditResult.getData().getNewsItem().forEach(news -> {
urlList.add(news.getUrl());
});
WxResult<byte[]> wxAuditResult = wxMaCodeService.getMaterial(authInfo.getAuthorizerAccessToken(), wxMaNewsReq);
MultipartFile file = new MockMultipartFile("file", "QRCode.jpg", "image/jpeg", wxAuditResult.getData());
Result<UploadImgResultDTO> uploadResult = ossFeignClient.uploadQrCode(file);
urlList.add(uploadResult.getData().getUrl());
});
result.setScreenshotUrl(urlList);
return result;

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java

@ -110,7 +110,7 @@ public interface WxMaCodeService {
* @author zhaoqifeng
* @date 2020/7/16 14:52
*/
WxResult<WxMaNewsResult> getMaterial(String accessToken, WxMaNewsReq request);
WxResult<byte[]> getMaterial(String accessToken, WxMaNewsReq request);
/**
* 设置服务器郁闷

22
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java

@ -10,6 +10,7 @@ import com.epmet.wxapi.result.*;
import com.epmet.wxapi.service.WxMaCodeService;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -19,7 +20,9 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* 描述一下
@ -198,19 +201,16 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
}
@Override
public WxResult<WxMaNewsResult> getMaterial(String accessToken, WxMaNewsReq request) {
WxResult<WxMaNewsResult> result = new WxResult<>();
public WxResult<byte[]> getMaterial(String accessToken, WxMaNewsReq request) {
WxResult<byte[]> result = new WxResult<>();
String url = WxMaCodeConstant.GET_MATERIAL_URL + "?" + "access_token=" + accessToken;
Result<String> statusResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request));
Result<byte[]> statusResult = HttpClientManager.getInstance().getByteArray(url, toMap(request));
if (!statusResult.success()) {
result.setErrorCode(statusResult.getCode());
result.setErrorMsg(statusResult.getMsg());
return result;
}
Gson gson = new Gson();
InputStream inputStream = gson.fromJson(statusResult.getData(), InputStream.class);
WxMaNewsResult newsResult = gson.fromJson(statusResult.getData(), WxMaNewsResult.class);
result.ok(newsResult);
result.ok(statusResult.getData());
return result;
}
@ -279,4 +279,12 @@ public class WxMaCodeServiceImpl implements WxMaCodeService {
Gson gson = gsonBuilder.create();
return gson.toJson(object);
}
private Map<String, Object> toMap(Object object) {
Gson gson = new Gson();
if(object == null){
return Collections.emptyMap();
}
return gson.fromJson(toJson(object), new TypeToken<Map<String, Object>>() {}.getType());
}
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-org-server:
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.78
ports:
- "8092:8092"
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"
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>
<version>0.3.77</version>
<version>0.3.78</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-org</artifactId>

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 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
* @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)
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class)
public interface EpmetUserOpenFeignClient {
/**

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
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.86
ports:
- "8087:8087"
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"
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>
<version>0.3.84</version>
<version>0.3.86</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

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) {
return new Result<List<RoleInfoResultDTO>>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
List<RoleInfoResultDTO> staffRoleList = roleList.stream().map(p -> {
RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO();
staffRoleResultDTO.setRoleId(p.getId());
staffRoleResultDTO.setRoleName(p.getRoleName());
staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly());
return staffRoleResultDTO;
}).collect(Collectors.toList());
List<RoleInfoResultDTO> staffRoleList = roleList.stream()
.filter(p -> !RoleKeyConstants.ROLE_KEY_ROOT_MANAGER.equals(p.getRoleKey()))
.map(p -> {
RoleInfoResultDTO staffRoleResultDTO = new RoleInfoResultDTO();
staffRoleResultDTO.setRoleId(p.getId());
staffRoleResultDTO.setRoleName(p.getRoleName());
staffRoleResultDTO.setFullTimeOnly(p.getFullTimeOnly());
return staffRoleResultDTO;
}).collect(Collectors.toList());
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;
}
allData.forEach(info -> {
if(StringUtils.isBlank(info.getUserName())){
info.setUserName(ModuleConstant.EMPTY_STR);
if(StringUtils.isNotBlank(info.getUserId())){
UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId());
if(null != cache) {
info.setRegisteredGrid(cache.getRegisteredGridName());

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

@ -81,7 +81,9 @@
MOBILE mobile,
STREET street,
DISTRICT district,
BUILDING_ADDRESS buildingAddress
BUILDING_ADDRESS buildingAddress,
NICKNAME nickname,
HEAD_IMG_URL headImgUrl
FROM user_base_info
WHERE DEL_FLAG = '0'
AND USER_ID = #{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
WHERE
wechat.DEL_FLAG = '0'
AND (wechat.NICKNAME IS NOT NULL OR wechat.NICKNAME <![CDATA[ <> ]]> '')
<foreach collection="userIds" item="item" open="AND (" separator=" OR " close=" )">
wechat.USER_ID = #{item}
</foreach>

Loading…
Cancel
Save