diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index e3ad61dcc8..dd75b620ab 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.59 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.65 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 68b4f14a67..271ae2a11a 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.59 + 0.3.65 com.epmet epmet-cloud diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java index dcb84869e7..cece305fd2 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java @@ -171,13 +171,14 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { } Object RegisterResult = result.getData(); JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); - CustomerUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, CustomerUserResultDTO.class); + Map map = (Map)jsonObject.get("paUserResult"); + PaUserDTO userDTO = ConvertUtils.mapToEntity(map, PaUserDTO.class); //登陆 - if (formDTO.getIsLogon() && null == resultDTO.getPaUserResult()) { + if (formDTO.getIsLogon() && null == userDTO) { throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode()); } //注册 - if (!formDTO.getIsLogon() && null != resultDTO.getPaUserResult()) { + if (!formDTO.getIsLogon() && null != userDTO) { throw new RenException(EpmetErrorCode.MOBILE_USED.getCode()); } //3、发送短信验证码 @@ -216,10 +217,12 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { } Object RegisterResult = result.getData(); JSONObject jsonObject = JSON.parseObject(RegisterResult.toString()); - CustomerUserResultDTO resultDTO = ConvertUtils.mapToEntity(jsonObject, CustomerUserResultDTO.class); //2.用户不存在时不允许登陆 - PaUserDTO userDTO = resultDTO.getPaUserResult(); + Map map1 = (Map)jsonObject.get("paUserResult"); + PaUserDTO userDTO = ConvertUtils.mapToEntity(map1, PaUserDTO.class); + logger.info("map1的值:"+map1); + logger.info("userDTO的值:"+userDTO); if (null == userDTO || StringUtils.isBlank(userDTO.getId())) { throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode()); } @@ -236,13 +239,17 @@ public class PublicUserLoginServiceImpl implements PublicUserLoginService { //4-1.生成token String token = this.generateGovWxmpToken(userDTO.getId()); //4-2.判断是否存在信息,给customerId赋值 - PaCustomerDTO customerDTO = resultDTO.getPaCustomerResult(); + Map map2 = (Map)jsonObject.get("paCustomerResult"); + logger.info("map2的值:"+map2); + PaCustomerDTO customerDTO = ConvertUtils.mapToEntity(map2, PaCustomerDTO.class); String customerId = ""; if (null != customerDTO && !StringUtils.isBlank(customerDTO.getId())) { customerId = customerDTO.getId(); } //4-3.token存入redis - PaUserWechatDTO wechatDTO = resultDTO.getPaUserWechatResult(); + Map map3 = (Map)jsonObject.get("paUserWechatResult"); + logger.info("map3的值:"+map3); + PaUserWechatDTO wechatDTO = ConvertUtils.mapToEntity(map3, PaUserWechatDTO.class); String openid = wechatDTO.getWxOpenId(); String unionId = (null == wechatDTO.getUnionId() ? "" : wechatDTO.getUnionId()); this.saveLatestGovTokenDto(customerId, userDTO.getId(), openid, unionId, token); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 9ac10784bc..a01706e01d 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -507,6 +507,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { public PaCustomerDTO getCustomerInfo(String appId){ JSONObject jsonObject = new JSONObject(); String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.CUSTOMER_MSG_URL + appId, JSON.toJSONString(jsonObject)).getData(); + logger.info("ThirdLoginServiceImpl.getCustomerInfo:httpclient->url:"+AuthHttpUrlConstant.CUSTOMER_MSG_URL+",结果->"+data); JSONObject toResult = JSON.parseObject(data); Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); if (!mapToResult.success()) { @@ -515,8 +516,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { } Object PublicCustomerResultDTO = mapToResult.getData(); JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString()); - PublicCustomerResultDTO publicCustomerResultDTO = ConvertUtils.mapToEntity(json, PublicCustomerResultDTO.class); - PaCustomerDTO customer = publicCustomerResultDTO.getCustomer(); + Map map = (Map)json.get("customer"); + PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); + logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->"+customer); return customer; } @@ -527,6 +529,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { */ public UserWechatDTO getUserWeChat(WxLoginFormDTO resiLoginFormDTO){ String data = HttpClientManager.getInstance().sendPostByJSON(AuthHttpUrlConstant.RESI_AND_WORK_LOGIN_URL, JSON.toJSONString(resiLoginFormDTO)).getData(); + logger.info("ThirdLoginServiceImpl.getUserWeChat:httpclient->url:"+AuthHttpUrlConstant.RESI_AND_WORK_LOGIN_URL+",结果->"+data); JSONObject toResult = JSON.parseObject(data); Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); if (!mapToResult.success()) { @@ -536,6 +539,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { Object UserWeChatDTO = mapToResult.getData(); JSONObject json = JSON.parseObject(UserWeChatDTO.toString()); UserWechatDTO userWechatDTO = ConvertUtils.mapToEntity(json, UserWechatDTO.class); + logger.info("小程序登陆third服务获取微信用户信息userWechatDTO->"+userWechatDTO); return userWechatDTO; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 457788f5a9..3c883ea2ac 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -271,4 +271,10 @@ public class RedisKeys { return rootPrefix.concat("oper:user:shorId:").concat(shortUserId); } + /** + * 居民端积分核销结果 + * */ + public static String getPointVerificationResultKey(String userId){ + return rootPrefix.concat("resi:point:exchange:").concat(userId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 2f08f03683..27a081dacc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -171,6 +171,10 @@ public class RedisUtils { } } + public Object lindex(String key,Long index){ + return redisTemplate.opsForList().index(key,index); + } + public Object rightPop(String key) { return redisTemplate.opsForList().rightPop(key); } @@ -190,7 +194,7 @@ public class RedisUtils { } public String getString(String key) { - return getString(key, DEFAULT_EXPIRE); + return stringRedisTemplate.opsForValue().get(key); } /** diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java index edc8633f02..93c653e178 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ConvertUtils.java @@ -62,6 +62,9 @@ public class ConvertUtils { } public static T mapToEntity(Map map, Class entity) { + if (null == map){ + return null; + } T t = null; try { t = entity.newInstance(); diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index b4dc44a7df..ff64fc7166 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.28 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.29 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 3944de1695..197c44b18b 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.28 + 0.3.29 com.epmet epmet-cloud diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 851ac62764..c2105542bb 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -353,8 +353,6 @@ renren: - /resi/group/** - /resi/partymember/** - /gov/grid/** - - /heart/** - - /point/** management: endpoints: web: diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java index 764c81b2fe..f8f6832129 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result.work; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -65,22 +66,6 @@ public class AuditingUserDetailResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date signUpTime; - /** - * 返回文本:已拒绝5次 - */ - private String refusedCountDesc; - - /** - * 最近一次拒绝原因 - */ - private String latestRefusedReason; - - /** - * 最近一次拒绝的时间yyyy-MM-dd HH:mm:ss - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private Date latestAuditTime; - /** * 历史活动情况 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java index a6046ffd63..aa983d38f6 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java @@ -1,12 +1,15 @@ package com.epmet.dto.result.work; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** - * 描述一下 + * 报名审核-人员历史活动情况 返参DTO * * @author yinzuomei@elink-cn.com * @date 2020/7/23 16:15 @@ -51,4 +54,15 @@ public class UserHistoricalActResultDTO implements Serializable { *历史活动列表 */ private List actInfoList; + + public UserHistoricalActResultDTO() { + userId = StrConstant.EPMETY_STR; + headImgUrl = StrConstant.EPMETY_STR; + nickName = StrConstant.EPMETY_STR; + realName = StrConstant.EPMETY_STR; + signInActNum = NumConstant.ZERO; + signUpActNum = NumConstant.ZERO; + obtainPointsActNum = NumConstant.ZERO; + actInfoList = new ArrayList<>(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml index df911d5ab5..0179d90cbb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml +++ b/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.18 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.24 ports: - "8111:8111" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index af9cf135ba..df604298c2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.18 + 0.0.24 com.epmet epmet-heart diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index 046a2c6854..9310d818b4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -192,12 +192,12 @@ public class ResiActListController { * 活动详情-已结束-回顾稿 * * @param formDto - * @return com.epmet.commons.tools.utils.Result + * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 13:39 2020-07-21 **/ @PostMapping("summary/list") - public Result summaryList(@RequestBody ResiActContentFormDTO formDto) { + public Result> summaryList(@RequestBody ResiActContentFormDTO formDto) { ValidatorUtils.validateEntity(formDto, ResiActContentFormDTO.AddUserInternalGroup.class); return actSummaryService.summaryList(formDto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java index 175e54bdaf..fb0a64e4dc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -190,12 +190,20 @@ public class WorkActController { return new Result(); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 测试积分发放接口 + * @Date 2020/7/31 13:19 + **/ @PostMapping("testgrantpoint") public Result testGrantPoint(@RequestBody TestGrantFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO,TestGrantFormDTO.AddUserInternalGroup.class); workActService.testGrantPoint(formDTO); return new Result(); } + /** * @return com.epmet.commons.tools.utils.Result * @param formDTO diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java index cb4993d0b0..b9115a88d4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java @@ -23,6 +23,8 @@ import com.epmet.dto.result.resi.ResiActSummaryResultDTO; import com.epmet.entity.ActSummaryEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 活动回顾表 * @@ -36,9 +38,9 @@ public interface ActSummaryDao extends BaseDao { * 活动详情-已结束-回顾稿 * * @param formDto - * @return com.epmet.dto.result.resi.ResiActSummaryResultDTO + * @return java.util.List * @Author zhangyong - * @Date 15:11 2020-07-22 + * @Date 15:03 2020-07-31 **/ - ResiActSummaryResultDTO selectListSummary(ResiActContentFormDTO formDto); + List selectListSummary(ResiActContentFormDTO formDto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.java new file mode 100644 index 0000000000..7659967000 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/UserKindnessTimeLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserKindnessTimeLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户爱心时长记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-31 + */ +@Mapper +public interface UserKindnessTimeLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java new file mode 100644 index 0000000000..a1c8c8dcd6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/UserKindnessTimeLogEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户爱心时长记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-31 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_kindness_time_log") +public class UserKindnessTimeLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 居民端用户id + */ + private String resiUserId; + + /** + * 服务时长 + */ + private Integer kindnessTime; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java index 863626d44f..e32d66533b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java @@ -100,9 +100,9 @@ public interface ActSummaryService extends BaseService { * 活动详情-已结束-回顾稿 * * @param formDto - * @return com.epmet.commons.tools.utils.Result + * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 13:39 2020-07-21 **/ - Result summaryList(ResiActContentFormDTO formDto); + Result> summaryList(ResiActContentFormDTO formDto); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java index e3331cf7a1..9681011fd0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java @@ -106,8 +106,8 @@ public class ActSummaryServiceImpl extends BaseServiceImpl summaryList(ResiActContentFormDTO formDto) { - return new Result().ok(baseDao.selectListSummary(formDto)); + public Result> summaryList(ResiActContentFormDTO formDto) { + return new Result>().ok(baseDao.selectListSummary(formDto)); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java index f8c48c27a5..7b25b31eab 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -264,8 +264,12 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl> leaderboard(ResiActBaseFormDTO formDTO) { List resultDtoS = new ArrayList<>(); + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); // 获取排好序的 排行榜 List leaderboardList = baseDao.selectListLeaderboard(formDTO); if (leaderboardList.size() > NumConstant.ZERO){ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 06cd0afafd..8ac75314f7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -33,7 +33,7 @@ import com.epmet.constant.ActMessageConstant; import com.epmet.dao.VolunteerInfoDao; import com.epmet.dto.HeartUserInfoDTO; import com.epmet.dto.VolunteerInfoDTO; -import com.epmet.dto.form.WxUserInfoFormDTO; +import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; @@ -93,9 +93,9 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl selectVolunteerInfoByUserId(TokenDto tokenDto) { ResiVolunteerInfoResultDTO resultDTO = new ResiVolunteerInfoResultDTO(); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index bbc8c3a9c4..c228c937a0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -91,6 +91,8 @@ public class WorkActServiceImpl implements WorkActService { private ActSummaryDao actSummaryDao; @Autowired private ActGrantPointLogDao actGrantPointLogDao; + @Autowired + private UserKindnessTimeLogDao userKindnessTimeLogDao; /** * @return void * @author yinzuomei @@ -621,7 +623,7 @@ public class WorkActServiceImpl implements WorkActService { public void cancelAct(CancelActFormDTO formDTO) { ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); if(null==actInfoDTO){ - logger.error("act_info is null"); + logger.error("act_info is null actId="+formDTO.getActId()); return ; } if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ @@ -809,7 +811,7 @@ public class WorkActServiceImpl implements WorkActService { public void finishAct(String actId) { ActInfoDTO actInfoDTO=actInfoService.get(actId); if(null==actInfoDTO){ - logger.error("act_info is null"); + logger.error("act_info is null actId="+actId); return; } //校验是否可以结束 @@ -826,9 +828,18 @@ public class WorkActServiceImpl implements WorkActService { //发放积分调用事件 if(actInfoDTO.getReward()>0){ this.grantActPoints(actInfoDTO); + }else{ + logger.info("活动积分为"+actInfoDTO.getReward()+"无需发放积分"); } } + /** + * @return void + * @param actInfoDTO + * @author yinzuomei + * @description 活动发放积分 + * @Date 2020/7/31 13:12 + **/ private void grantActPoints(ActInfoDTO actInfoDTO) { //查询已经给分的用户 QueryWrapper wrapper = new QueryWrapper<>(); @@ -837,7 +848,7 @@ public class WorkActServiceImpl implements WorkActService { .eq("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE); List actUserRelationEntityList=actUserRelationDao.selectList(wrapper); if(null==actUserRelationEntityList||actUserRelationEntityList.size()<1){ - logger.info("不存在给分的记录,无需发送消息时间"); + logger.info(String.format("活动%s,不存在给分的记录,无需发送消息时间",actInfoDTO.getId())); return; } //查询当前用户所属组织信息 @@ -879,7 +890,7 @@ public class WorkActServiceImpl implements WorkActService { actGrantPointLogEntity.setResponseMsg(JSON.toJSONString(result)); actGrantPointLogDao.insert(actGrantPointLogEntity); if(!result.success()){ - logger.error("活动积分发放失败"); + logger.error("活动积分发放失败,act_grant_point_log.id="+actGrantPointLogEntity.getId()); } } @@ -925,6 +936,13 @@ public class WorkActServiceImpl implements WorkActService { logger.info("积分发方成功"); } + /** + * @return void + * @param actInfoDTO + * @author yinzuomei + * @description //发放爱心时长、参与活动并获得积分的次数 + * @Date 2020/7/31 13:15 + **/ private void updateHeartUserInfo(ActInfoDTO actInfoDTO) { List actUserRelationDTOList=actUserRelationService.getUserList(actInfoDTO.getId(),StrConstant.EPMETY_STR); for(ActUserRelationDTO actUserRelation:actUserRelationDTOList){ @@ -932,23 +950,46 @@ public class WorkActServiceImpl implements WorkActService { if(null==heartUserInfoDTO){ continue; } - if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ - heartUserInfoDTO.setObtainPointNum(heartUserInfoDTO.getObtainPointNum()+1); - } - //爱心时长发放(签到的。未签到但是有积分的) - if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){ - //已签到的 - heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); - }else{ - //未签到,但是有积分的 + if(actInfoDTO.getReward()>0){ if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ + heartUserInfoDTO.setObtainPointNum(heartUserInfoDTO.getObtainPointNum()+1); + } + } + if(actInfoDTO.getServiceMin()>0){ + //爱心时长发放(签到的。未签到但是有积分的) + if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){ + //已签到的 heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); + UserKindnessTimeLogEntity userKindnessTimeLogEntity=new UserKindnessTimeLogEntity(); + userKindnessTimeLogEntity.setActId(actInfoDTO.getId()); + userKindnessTimeLogEntity.setKindnessTime(actInfoDTO.getServiceMin()); + userKindnessTimeLogEntity.setResiUserId(actUserRelation.getUserId()); + userKindnessTimeLogDao.insert(userKindnessTimeLogEntity); + }else{ + //未签到,但是有积分的 + if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ + heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); + UserKindnessTimeLogEntity userKindnessTimeLogEntity=new UserKindnessTimeLogEntity(); + userKindnessTimeLogEntity.setActId(actInfoDTO.getId()); + userKindnessTimeLogEntity.setKindnessTime(actInfoDTO.getServiceMin()); + userKindnessTimeLogEntity.setResiUserId(actUserRelation.getUserId()); + userKindnessTimeLogDao.insert(userKindnessTimeLogEntity); + } } } - heartUserInfoService.update(heartUserInfoDTO); + if(actInfoDTO.getReward()>0||actInfoDTO.getServiceMin()>0){ + heartUserInfoService.update(heartUserInfoDTO); + } } } + /** + * @return void + * @param actId + * @author yinzuomei + * @description 活动结束后生成统计表 + * @Date 2020/7/31 13:15 + **/ private void saveActStatistical(String actId) { ActStatisticalDTO actStatisticalDTO=new ActStatisticalDTO(); actStatisticalDTO.setActId(actId); @@ -971,6 +1012,13 @@ public class WorkActServiceImpl implements WorkActService { actStatisticalService.save(actStatisticalDTO); } + /** + * @return void + * @param actId + * @author yinzuomei + * @description 保存活动结束日志 + * @Date 2020/7/31 13:16 + **/ private void saveActOperationRec(String actId) { ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); actOperationRecEntity.setActId(actId); @@ -980,6 +1028,13 @@ public class WorkActServiceImpl implements WorkActService { actOperationRecDao.insert(actOperationRecEntity); } + /** + * @return com.epmet.dto.ActInfoDTO + * @param actInfoDTO + * @author yinzuomei + * @description 校验是否可以结束 + * @Date 2020/7/31 13:16 + **/ private ActInfoDTO checkActInfoDTO(ActInfoDTO actInfoDTO) { //只有我发布的活动,我可以就结束 if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ @@ -1012,7 +1067,7 @@ public class WorkActServiceImpl implements WorkActService { public void summaryAct(SummaryActFormDTO formDTO) { ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); if(null==actInfoDTO){ - logger.info("act_info is null"); + logger.error("act_info is null actId="+formDTO.getActId()); return; } if(!actInfoDTO.getActStatus().equals(ActConstant.ACT_STATUS_FINISHED)){ @@ -1127,7 +1182,7 @@ public class WorkActServiceImpl implements WorkActService { //删除所有的草稿 this.deleteDraft(); publishActResultDTO.setActId(rePublishFormDTO.getActId()); - //发送消息通知-暂时不做了 + //发送消息通知-暂时不做了,前端默认串的是不通知 /*if(rePublishFormDTO.getNoticePassedPeople()){ this.noticePassedPeople(originalActInfo,newActInfoEntity); }*/ @@ -1135,14 +1190,4 @@ public class WorkActServiceImpl implements WorkActService { } - private void noticePassedPeople(ActInfoDTO originalActInfo, ActInfoEntity newActInfoEntity) { - /* List actUserRelationDTOList=actUserRelationDao.selectAuditingAndPassedList(originalActInfo.getId()); - if(null==actUserRelationDTOList||actUserRelationDTOList.size()<1){ - logger.info("不存在待审核人员、已经审核用户,无需发送站内信"); - return; - } - String originalTitle=originalActInfo.getTitle(); - - //活动地点、活动预计开始时间、活动预计结束时间、活动积分、签到时间开始、签到结束时间、签到地点*/ - } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java index f59170c609..a0aa461f52 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -34,6 +34,7 @@ import com.epmet.service.ActInfoService; import com.epmet.service.ActUserRelationService; import com.epmet.service.HeartUserInfoService; import com.epmet.service.WorkActUserService; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -102,9 +103,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { //赋值基本信息 for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ - auditingDTO.setRealName(userBaseInfoResultDTO.getRealName()); - auditingDTO.setNickName(userBaseInfoResultDTO.getNickname()); - auditingDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){ + auditingDTO.setRealName(userBaseInfoResultDTO.getRealName()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){ + auditingDTO.setNickName(userBaseInfoResultDTO.getNickname()); + } + if(StringUtils.isNotBlank((userBaseInfoResultDTO.getHeadImgUrl()))){ + auditingDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + } break; } } @@ -145,9 +152,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { //赋值基本信息 for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ - passedDTO.setRealName(userBaseInfoResultDTO.getRealName()); - passedDTO.setNickName(userBaseInfoResultDTO.getNickname()); - passedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){ + passedDTO.setRealName(userBaseInfoResultDTO.getRealName()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){ + passedDTO.setNickName(userBaseInfoResultDTO.getNickname()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){ + passedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + } break; } } @@ -189,9 +202,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { //赋值基本信息 for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ - rejectedDTO.setRealName(userBaseInfoResultDTO.getRealName()); - rejectedDTO.setNickName(userBaseInfoResultDTO.getNickname()); - rejectedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){ + rejectedDTO.setRealName(userBaseInfoResultDTO.getRealName()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){ + rejectedDTO.setNickName(userBaseInfoResultDTO.getNickname()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){ + rejectedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + } break; } } @@ -233,9 +252,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { //赋值基本信息 for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ - cancelDTO.setRealName(userBaseInfoResultDTO.getRealName()); - cancelDTO.setNickName(userBaseInfoResultDTO.getNickname()); - cancelDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){ + cancelDTO.setRealName(userBaseInfoResultDTO.getRealName()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){ + cancelDTO.setNickName(userBaseInfoResultDTO.getNickname()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){ + cancelDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + } break; } } @@ -295,10 +320,24 @@ public class WorkActUserServiceImpl implements WorkActUserService { resultDTO.setActUserRelationId(actUserRelationDTO.getId()); resultDTO.setActId(actUserRelationDTO.getActId()); resultDTO.setUserId(actUserRelationDTO.getUserId()); - resultDTO.setRealName(userBaseInfo.getRealName()); - resultDTO.setGender(userBaseInfo.getGender()); - resultDTO.setMobile(userBaseInfo.getMobile()); - resultDTO.setIdNum(userBaseInfo.getIdNum()); + if (StringUtils.isNotBlank(userBaseInfo.getRealName())) { + resultDTO.setRealName(userBaseInfo.getRealName()); + } else { + resultDTO.setRealName(StrConstant.EPMETY_STR); + } + if (StringUtils.isNotBlank(userBaseInfo.getGender())) { + resultDTO.setGender(userBaseInfo.getGender()); + } else { + resultDTO.setGender(StrConstant.EPMETY_STR); + } + if (StringUtils.isNotBlank(userBaseInfo.getMobile())) { + resultDTO.setMobile(userBaseInfo.getMobile()); + } else { + resultDTO.setMobile(StrConstant.EPMETY_STR); + } + if (StringUtils.isNotBlank(userBaseInfo.getIdNum())) { + resultDTO.setIdNum(userBaseInfo.getIdNum()); + } resultDTO.setAddress(userBaseInfo.getStreet()+userBaseInfo.getDistrict()+userBaseInfo.getBuildingAddress()); resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); /** @@ -320,8 +359,6 @@ public class WorkActUserServiceImpl implements WorkActUserService { historicalAuditResult.setLatestAuditTime(latestRefused.getCreatedTime()); historicalAuditResult.setLatestRefusedReason(latestRefused.getReason()); historicalAuditResult.setRefusedCountDesc(String.format("已拒绝%s次",refusedCount)); - resultDTO.setLatestAuditTime(latestRefused.getCreatedTime()); - resultDTO.setLatestRefusedReason(latestRefused.getReason()); resultDTO.setHistoricalAuditResult(historicalAuditResult); } }else if(ActConstant.ACT_USER_STATUS_PASSED.equals(resultDTO.getStatus())||ActConstant.ACT_USER_STATUS_REFUSED.equals(resultDTO.getStatus())){ @@ -352,9 +389,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { UserBaseInfoResultDTO userBaseInfoResultDTO=this.queryUserBaseInfo(formDTO.getUserId()); //基本信息 resultDTO.setUserId(formDTO.getUserId()); - resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); - resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); - resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getHeadImgUrl())){ + resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname())){ + resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); + } + if(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName())){ + resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); + } //参与活动统计值 HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId()); resultDTO.setSignInActNum(historicalActInfo.getSignInActNum()); @@ -503,9 +546,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { //基础信息赋值 for(UserBaseInfoResultDTO userBaseInfo:userInfoList){ if(joinedUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){ - joinedUserResultDTO.setRealName(userBaseInfo.getRealName()); - joinedUserResultDTO.setNickName(userBaseInfo.getNickname()); - joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + if(StringUtils.isNotBlank(userBaseInfo.getRealName())){ + joinedUserResultDTO.setRealName(userBaseInfo.getRealName()); + } + if(StringUtils.isNotBlank(userBaseInfo.getNickname())){ + joinedUserResultDTO.setNickName(userBaseInfo.getNickname()); + } + if(StringUtils.isNotBlank(userBaseInfo.getHeadImgUrl())){ + joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + } break; } @@ -536,9 +585,15 @@ public class WorkActUserServiceImpl implements WorkActUserService { //基础信息赋值 for(UserBaseInfoResultDTO userBaseInfo:userInfoList){ if(canceledUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){ - canceledUserResultDTO.setRealName(userBaseInfo.getRealName()); - canceledUserResultDTO.setNickName(userBaseInfo.getNickname()); - canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + if(StringUtils.isNotBlank(userBaseInfo.getRealName())){ + canceledUserResultDTO.setRealName(userBaseInfo.getRealName()); + } + if(StringUtils.isNotBlank(userBaseInfo.getNickname())){ + canceledUserResultDTO.setNickName(userBaseInfo.getNickname()); + } + if(StringUtils.isNotBlank(userBaseInfo.getHeadImgUrl())){ + canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + } break; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index 72477fb20d..c6e70a0bc3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -133,4 +133,8 @@ elink: appId: @elink.mq.appId@ #项目接入亿联云的应用Id token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret host: @elink.mq.host@ #亿联云消息网关服务地址 - sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql index 3cb7da4267..1cc390bad2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/epmet_heart.sql @@ -11,7 +11,7 @@ Target Server Version : 50728 File Encoding : 65001 - Date: 30/07/2020 14:11:45 + Date: 31/07/2020 17:50:23 */ SET NAMES utf8mb4; @@ -64,13 +64,13 @@ CREATE TABLE `act_customized` ( DROP TABLE IF EXISTS `act_grant_point_log`; CREATE TABLE `act_grant_point_log` ( `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `REWARD` int(11) NOT NULL, - `REMARK` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, - `OPERATOR_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `SEND_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, - `RESPONSE_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, + `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', + `ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动id', + `REWARD` int(11) NOT NULL COMMENT '积分值,其实就是活动设置的积分', + `REMARK` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `OPERATOR_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '当前操作工作人员id', + `SEND_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '发送消息体', + `RESPONSE_MSG` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '返回消息体', `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标记', `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', @@ -423,6 +423,24 @@ CREATE TABLE `latest_act_info` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '最近一次编辑的活动信息' ROW_FORMAT = Compact; +-- ---------------------------- +-- Table structure for user_kindness_time_log +-- ---------------------------- +DROP TABLE IF EXISTS `user_kindness_time_log`; +CREATE TABLE `user_kindness_time_log` ( + `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键', + `ACT_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '活动id', + `RESI_USER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '居民端用户id', + `KINDNESS_TIME` int(11) NOT NULL COMMENT '服务时长', + `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', + `CREATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人(工作人员id)', + `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间(操作的时间)', + `UPDATED_BY` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户爱心时长记录表' ROW_FORMAT = Dynamic; + -- ---------------------------- -- Table structure for volunteer_info -- ---------------------------- diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index ebbb774d7e..b3d4fb4fe0 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -65,14 +65,13 @@ 'signing_up' AS actCurrentState, -- 活动状态:报名中,未报满 IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i - LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' + LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND i.ACT_STATUS = 'published' AND = ]]> NOW() -- 报名截止时间 >= 当前时间 AND (i.ACT_QUOTA_CATEGORY = 0 OR i.ACT_QUOTA > IFNULL(c.signupNum, 0)) -- 不限名额或者报名人数未报满 AND i.CUSTOMER_ID = #{customerId} - GROUP BY i.ID ORDER BY i.ACT_QUOTA_CATEGORY DESC,i.CREATED_TIME DESC @@ -92,7 +91,7 @@ 'enough' AS actCurrentState, -- 活动状态:报名中,已报满 IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i - LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' + LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' AND i.ACT_STATUS = 'published' @@ -100,7 +99,6 @@ AND i.ACT_QUOTA_CATEGORY = 1 -- 固定名额 AND i.ACT_QUOTA = IFNULL(c.signupNum, 0) -- 名额已满 AND i.CUSTOMER_ID = #{customerId} - GROUP BY i.ID ORDER BY i.CREATED_TIME DESC @@ -120,14 +118,13 @@ 'end_sign_up' AS actCurrentState, -- 活动状态:未开始 IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i - LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' + LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' -- 活动开始时间 > 当前时间 并且 报名截止时间 < 当前时间 报名已结束,活动未开始 未开始 AND ( ]]> NOW() AND NOW() ) - AND i.ACT_STATUS != 'canceled' + AND i.ACT_STATUS = 'published' AND i.CUSTOMER_ID = #{customerId} - GROUP BY i.ID ORDER BY i.CREATED_TIME DESC @@ -147,14 +144,13 @@ 'in_progress' AS actCurrentState, -- 活动状态:进行中 IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i - LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' + LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' - -- 活动开始时间 <= 当前时间 并且活动结束时间 >= 当前时间 进行中 - AND ( NOW() AND = ]]> NOW() ) - AND i.ACT_STATUS != 'canceled' + -- 活动开始时间 <= 当前时间 进行中 + AND NOW() + AND i.ACT_STATUS = 'published' AND i.CUSTOMER_ID = #{customerId} - GROUP BY i.ID ORDER BY i.CREATED_TIME DESC @@ -174,13 +170,11 @@ 'finished' AS actCurrentState, -- 活动状态:已结束 IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i - LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' + LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' AND u.`STATUS` != 'refused' AND u.`STATUS` != 'canceled' AND u.USER_ID = #{userId} LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' - AND i.ACT_STATUS != 'canceled' - AND NOW() + AND i.ACT_STATUS = 'finished' AND i.CUSTOMER_ID = #{customerId} - GROUP BY i.ID ORDER BY i.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} @@ -199,11 +193,13 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'auditing' AS actCurrentState -- 活动状态 - FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' + FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' + AND u.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND u.`STATUS` = 'auditing' + AND i.ACT_STATUS = 'published' ORDER BY i.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} @@ -222,11 +218,13 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'passed' AS actCurrentState -- 活动状态 - FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' + FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' + AND u.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND u.`STATUS` = 'passed' + AND i.ACT_STATUS = 'published' ORDER BY i.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} @@ -245,11 +243,13 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'refused' AS actCurrentState -- 活动状态 - FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' + FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' + AND u.DEL_FLAG = '0' AND u.USER_ID = #{userId} AND u.`STATUS` = 'refused' + AND i.ACT_STATUS = 'published' ORDER BY i.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} @@ -268,11 +268,13 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'canceld' AS actCurrentState -- 活动状态 - FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND u.DEL_FLAG = '0' + FROM act_user_relation u LEFT JOIN act_info i ON i.ID = u.ACT_ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID WHERE i.DEL_FLAG = '0' + AND u.DEL_FLAG = '0' AND u.USER_ID = #{userId} - AND NOW() -- 活动结束时间 < 当前时间, 活动已结束 + AND u.`STATUS` = 'passed' + AND i.ACT_STATUS = 'finished' ORDER BY i.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} @@ -330,6 +332,7 @@ AND r.DEL_FLAG = '0' AND r.USER_ID = #{userId} AND NOW() BETWEEN DATE_SUB(i.ACT_START_TIME, INTERVAL 1 HOUR) AND i.ACT_END_TIME + AND i.ACT_STATUS = 'published' diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml index 6b3c8d92ea..f5ce7e4f29 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml @@ -32,6 +32,7 @@ FROM act_live_rec r WHERE r.DEL_FLAG = '0' AND r.ACT_ID = #{actId} + ORDER BY CREATED_TIME DESC diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml new file mode 100644 index 0000000000..8acc279dbf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/UserKindnessTimeLogDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointExchangeResponseResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointExchangeResponseResultDTO.java new file mode 100644 index 0000000000..76de81a0a1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointExchangeResponseResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName PointExchangeResponseResultDTO + * @Auth wangc + * @Date 2020-07-31 16:07 + */ +@Data +public class PointExchangeResponseResultDTO implements Serializable { + private static final long serialVersionUID = -6342757960284704496L; + /** + * 核销成功标识 + * */ + private boolean resultFlag; + + /** + * 失败原因 + * */ + private String failureReason; + + private Integer point; + + /** + * 工作人员昵称 + * */ + private String operatorName; + + /** + * 工作人员头像 + * */ + private String operatorProfile; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java index fef7e11cc5..2002f18597 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java @@ -4,8 +4,11 @@ package dto.form;/** * @date 2020-07-17 17:16 **/ +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; + /** * desc:发送积分dto * @author lyn @@ -13,6 +16,9 @@ import lombok.Data; */ @Data public class SendPointFormDTO { + + public interface SendPointGroup extends CustomerClientShowGroup{} + private String pointDesc; /** @@ -33,15 +39,18 @@ public class SendPointFormDTO { /** * 客户Id */ + @NotBlank(message = "客户Id不能为空", groups = SendPointGroup.class) private String customerId; /** * 被操作用户id */ + @NotBlank(message = "用户Id不能为空", groups = SendPointGroup.class) private String userId; /** * 加减分标识 plus/minus */ + @NotBlank(message = "加减标识不能为空", groups = SendPointGroup.class) private String actionFlag; @@ -53,6 +62,7 @@ public class SendPointFormDTO { /** * 备注 */ + @NotBlank(message = "积分备注不能为空", groups = SendPointGroup.class) private String remark; /** diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml index 25f8ce6da6..fb1d9455d4 100644 --- a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml +++ b/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.11 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.15 ports: - "8112:8112" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 91d6b84a35..b410ce31e2 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/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"> 4.0.0 - 0.0.11 + 0.0.15 epmet-point com.epmet diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java index d8e6ceac75..0a9c628604 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java @@ -40,6 +40,6 @@ public class MqSubcribeConfig { param.put("mqSubscribeList", subscribeFormDTOList); String jsonStrParam = JSON.toJSONString(param); Result result = HttpClientManager.getInstance().sendPostByHttps(mqServer, JSON.toJSONString(param)); - logger.error("subscriber==jsonStrParam:{}=====result:{}" ,jsonStrParam, JSON.toJSONString(result)); + logger.info("subscriber==jsonStrParam:{}=====result:{}" ,jsonStrParam, JSON.toJSONString(result)); } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java index 10b21cf105..14aab6e47a 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java @@ -3,9 +3,11 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.dto.form.mq.ReceiveMqMsg; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.service.UserPointActionLogService; import dto.form.SendPointFormDTO; import lombok.extern.slf4j.Slf4j; @@ -13,9 +15,12 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * desc: 积分相关消息回调controller * @@ -38,21 +43,21 @@ public class MqPointCallbackController { * @return */ @RequestMapping("activeSendPoint") - public String activeSendPoint(ReceiveMqMsg mqMsg) { + public Result activeSendPoint(@RequestBody ReceiveMqMsg mqMsg) { log.debug("activeSendPoint receive mqMsg:{}", JSON.toJSONString(mqMsg)); if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { log.warn("activeSendPoint mqMsg is empty"); - return "success"; + return new Result().ok(true); } - SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class); + List formDTO = JSON.parseArray(mqMsg.getMsg(), SendPointFormDTO.class); try { userPointActionLogService.grantPoint(formDTO); } catch (Exception e) { - logger.error("activeSendPoint consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + logger.error("activeSendPoint consume fail", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); } log.info("activeSendPoint consumer success,formDTO:{}", JSON.toJSONString(formDTO)); - return "success"; + return new Result().ok(true); } /** @@ -62,21 +67,22 @@ public class MqPointCallbackController { * @return */ @RequestMapping("registervolunteer") - public String registerVolunteer(ReceiveMqMsg mqMsg) { + public Result registerVolunteer(@RequestBody ReceiveMqMsg mqMsg) { log.debug("registerVolunteer receive mqMsg:{}", JSON.toJSONString(mqMsg)); if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { log.warn("registerVolunteer mqMsg is empty"); - return "success"; + return new Result().ok(true); } BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class); try { //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + userPointActionLogService.grantPointByEvent(EventEnum.REGISTER_VOLUNTEER.getEventTag(),formDTO); } catch (Exception e) { - logger.error("registerVolunteer consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + logger.error("registerVolunteer consume fail", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); } log.info("registerVolunteer consumer success,formDTO:{}", JSON.toJSONString(formDTO)); - return "success"; + return new Result().ok(true); } /** @@ -86,21 +92,22 @@ public class MqPointCallbackController { * @return */ @RequestMapping("pubactivelive") - public String pubActiveLive(ReceiveMqMsg mqMsg) { + public Result pubActiveLive(@RequestBody ReceiveMqMsg mqMsg) { log.debug("pubActiveLive receive mqMsg:{}", JSON.toJSONString(mqMsg)); if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { log.warn("pubActiveLive mqMsg is empty"); - return "success"; + return new Result().ok(true); } BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class); try { //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + userPointActionLogService.grantPointByEvent(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(),formDTO); } catch (Exception e) { - logger.error("pubActiveLive consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + logger.error("pubActiveLive consume fail", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); } log.info("pubActiveLive consumer success,formDTO:{}", JSON.toJSONString(formDTO)); - return "success"; + return new Result().ok(true); } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java index a0c7f479dd..bfbcff6ebb 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java @@ -52,8 +52,8 @@ public class PointRuleController { * @return */ @PostMapping(value = "list") - public Result> list(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleListFormDTO formDTO) { - formDTO.setCustomerId(tokenDTO.getCustomerId()); + public Result> list( @RequestBody PointRuleListFormDTO formDTO) { + formDTO.setCustomerId("3ef7e4bb195eb9e622d68b52509aa940"); ValidatorUtils.validateEntity(formDTO); return new Result>().ok(pointRuleService.list(formDTO)); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index f58da5b0fa..bca69b050a 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.ResiCommonUserIdFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.PointExchangeResponseResultDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.dto.result.ResiPointLogListResultDTO; import com.epmet.dto.result.ResiPointRankListResultDTO; @@ -129,4 +130,16 @@ public class ResiPointController { ValidatorUtils.validateEntity(pageUserParam,CommonPageUserFormDTO.PageUserGroup.class); return new Result>().ok(pointVerificationLogService.getMyExchangeRecord(pageUserParam)); } + + /** + * @Description 居民端积分兑换响应 + * @param tokenDto + * @return + * @author wangc + * @date 2020.07.31 16:17 + **/ + @PostMapping("exchangecallback") + public Result exchangeCallback(@LoginUser TokenDto tokenDto){ + return new Result().ok(pointVerificationLogService.resiExchangeCallback(tokenDto.getUserId())); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java index 2c8f5a214a..9361d09442 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.form.PointRuleListFormDTO; import com.epmet.entity.PointRuleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @@ -51,4 +52,6 @@ public interface PointRuleDao extends BaseDao { List selectListByFunctionId(PointRuleListFormDTO formDTO); int updateByCustomerId(PointRuleEntity entity); + + PointRuleEntity selectByEventCodeAndCustomerId(@Param("customerId") String customerId, @Param("eventCode") String eventCode); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java index 6f9ac3fb4c..821bb2e443 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -43,4 +43,12 @@ public interface UserPointActionLogDao extends BaseDao **/ List selectPointActionLogList(@Param("userId") String userId); + /** + * @Description 查询指定用户在某条规则下所得的积分总和 + * @param + * @return + * @author wangc + * @date 2020.07.31 15:11 + **/ + Integer selectSumByEvent(@Param("userId") String userId,@Param("eventId") String eventId, @Param("sourceId") String sourceId,@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java index 4e868d150f..e22fe14ca6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/PointRedis.java @@ -1,6 +1,8 @@ package com.epmet.redis; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.PointExchangeResponseResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -15,4 +17,17 @@ public class PointRedis { @Autowired private RedisUtils redisUtils; + + + public void lpush(String userId , PointExchangeResponseResultDTO verificationResult){ + redisUtils.leftPush(RedisKeys.getPointVerificationResultKey(userId),verificationResult); + } + public Object lindex(String userId,Long index){ + return redisUtils.lindex(RedisKeys.getPointVerificationResultKey(userId),index); + } + + public String checkIfQrCodeExpire(String shortId){ + String userId = (String)redisUtils.getString(RedisKeys.getShortUserIdKey(shortId)); + return userId; + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java index fa53b5be05..f0e58de53e 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java @@ -56,4 +56,14 @@ public interface PointRuleService extends BaseService { void update(TokenDto tokenDTO, PointRuleFormDTO formDTO); void add(TokenDto tokenDTO, PointRuleFormDTO formDTO); + + /** + * @Description 根据evetCode和客户Id查找积分规则详情 + * @param customerId + * @param eventCode + * @return + * @author wangc + * @date 2020.07.31 14:54 + **/ + PointRuleEntity getByEventCodeAndCustomerId(String customerId,String eventCode); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java index d8610aa2b0..be79309eec 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java @@ -23,6 +23,7 @@ import com.epmet.dto.PointVerificationLogDTO; import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.PointVerificationFormDTO; import com.epmet.dto.form.WorkPointVerificationFormDTO; +import com.epmet.dto.result.PointExchangeResponseResultDTO; import com.epmet.dto.result.PointVerificationResultDTO; import com.epmet.dto.result.ResiPointLogListResultDTO; import com.epmet.dto.result.WorkPointVerficationListResultDTO; @@ -125,4 +126,13 @@ public interface PointVerificationLogService extends BaseService grantPointParam); + /** + * @Description 通过事件推送进行积分加减 + * @param event + * @return + * @author wangc + * @date 2020.07.31 13:45 + **/ + void grantPointByEvent(String eventCode,BasePointEventMsg event); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 68c14c2739..c46ec497b7 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -169,6 +169,19 @@ public class PointRuleServiceImpl extends BaseServiceImpl 【】", JSON.toJSON(verificationParam))); + throw new RenException("用户二维码失效"); + } + DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(new Date()); PointVerificationResultDTO result = new PointVerificationResultDTO(); ResiCommonUserIdFormDTO userId = new ResiCommonUserIdFormDTO(); @@ -245,6 +255,12 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl [epmet:point:verification:userId] lpush #新元素插入表头 lindex key 0 #表头 + PointExchangeResponseResultDTO resultCache = new PointExchangeResponseResultDTO(); + resultCache.setResultFlag(true); + resultCache.setOperatorName(operatorName); + resultCache.setPoint(point * NumConstant.ONE_NEG); + //工作人员没有头像 + pointRedis.lpush(verificationParam.getUserId(),resultCache); + result.setSuccessFlag(true); List userParam = new LinkedList<>(); userParam.add(verificationParam.getUserId()); Result> userResult = - epmetUserOpenFeignClient.queryUserBaseInfo(userParam); + epmetUserOpenFeignClient.queryUserBaseInfo(userParam); String userHeadPhoto = ModuleConstant.EMPTY_STR; String userNickname = ModuleConstant.EMPTY_STR; if(userResult.success() && null != userResult.getData() && !userResult.getData().isEmpty()){ @@ -337,6 +360,18 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl implements UserPointActionLogService { - + private static Logger logger = LoggerFactory.getLogger(UserPointActionLogServiceImpl.class); @Autowired private UserPointTotalService userPointTotalService; @Autowired private UserPointStatisticalDailyService userPointStatisticalDailyService; - + @Autowired + private PointRuleServiceImpl pointRuleService; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -134,7 +148,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl> sortedMap = Maps.newLinkedHashMap(); map.entrySet().stream().sorted(Map.Entry.>comparingByKey().reversed()) .forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue())); - map.entrySet().forEach(e -> { + sortedMap.entrySet().forEach(e -> { ResiPointLogListResultDTO o = new ResiPointLogListResultDTO(); o.setDate(e.getKey()); o.setDailyList(e.getValue()); @@ -147,59 +161,164 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl grantPointList){ + if (CollectionUtils.isEmpty(grantPointList)){ + log.warn("grantPoint param is empty"); + return; + } + grantPointList.forEach(grantPoint->{ + plusPoint(grantPoint); + }); + + } + + /** + * @Description 通过事件推送进行积分加减 + * @param event + * @return + * @author wangc + * @date 2020.07.31 13:45 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void grantPointByEvent(String eventCode,BasePointEventMsg event) { + if(!StringUtils.equals(EventEnum.REGISTER_VOLUNTEER.getEventTag(),eventCode) && !StringUtils.equals(EventEnum.ACTIVE_INSERT_LIVE.getEventTag(),eventCode)){ + logger.error(String.format("无法识别事件类型与积分规则,消息体->【%s】", JSON.toJSON(event))); + throw new RenException("无法识别事件类型与积分规则"); + } + + PointRuleEntity ruleInfo = pointRuleService.getByEventCodeAndCustomerId(event.getCustomerId(),eventCode); + if(null != ruleInfo && StringUtils.equals(NumConstant.ONE_STR,ruleInfo.getEnabledFlag())){ + //校验是否达到上限 + if(ruleInfo.getUpLimit() > NumConstant.ZERO){ + Integer sum = baseDao.selectSumByEvent(event.getUserId(),eventCode,event.getSourceId(),event.getCustomerId()); + if(null == sum) sum = NumConstant.ZERO; + if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_PLUS,ruleInfo.getOperateType())){ + sum += ruleInfo.getPoint(); + if(ruleInfo.getPoint() < NumConstant.ZERO){ + //保证要加的积分是正数 + ruleInfo.setPoint(ruleInfo.getPoint() * NumConstant.ONE_NEG); + } + }else{ + //actionLog中存的是正负数,如果是减操作,则算出来的是负数相加 + sum -= ruleInfo.getPoint() * NumConstant.ONE_NEG; + sum *= NumConstant.ONE_NEG; + if(ruleInfo.getPoint() > NumConstant.ZERO){ + //保证要扣减的积分是负数 + ruleInfo.setPoint(ruleInfo.getPoint() * NumConstant.ONE_NEG); + } + } + //这里sum一定是正数 + if(ruleInfo.getUpLimit() < (sum + ruleInfo.getPoint())){ + log.info(String.format("该用户获取此类事件的积分已达上限,详细数据->【%s】", JSON.toJSON(event))); + return ; + } + } + + //完成校验,可以进行积分操作 + + + + //1.新增用户积分行为记录 + UserPointActionLogEntity action = new UserPointActionLogEntity(); + action.setCustomerId(event.getCustomerId()); + action.setPoint(ruleInfo.getPoint()); + action.setEventStatement(event.getRemark()); + action.setEventName(EventEnum.getEnum(eventCode).getEventDesc()); + action.setEventId(eventCode); + action.setActionFlag(event.getActionFlag()); + action.setUserId(event.getUserId()); + action.setCreatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId()); + action.setUpdatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId()); + action.setSourceId(event.getSourceId()); + action.setOperatorAgencyId(event.getOpAgencyId()); + baseDao.insert(action); + //2.新增/修改用户积分日统计 + DimIdGenerator.DimIdBean dimVal = DimIdGenerator.getDimIdBean(new Date()); + UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dimVal,UserPointStatisticalDailyEntity.class); + statistical.setPointChange(ruleInfo.getPoint()); + statistical.setActionFlag(event.getActionFlag()); + statistical.setCustomerId(event.getCustomerId()); + statistical.setUserId(event.getUserId()); + statistical.setCreatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId()); + statistical.setUpdatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId()); + userPointStatisticalDailyService.insertOrUpdate(statistical); + //3.新增/修改用户积分日统计 + UserPointTotalEntity point = new UserPointTotalEntity(); + point.setCustomerId(event.getCustomerId()); + point.setUserId(event.getUserId()); + point.setTotalPoint(ruleInfo.getPoint()); + point.setUsablePoint(ruleInfo.getPoint()); + point.setUsedPoint(NumConstant.ZERO); + point.setCreatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId()); + point.setUpdatedBy(StringUtils.isBlank(event.getOperatorId()) ? ModuleConstant.CREATED_BY_SYSTEM : event.getOperatorId()); + userPointTotalService.insertOrUpdate(point); + + + }else{ + log.error(String.format("未检测到该用户下有效的积分规则,消息体->【%s】", JSON.toJSON(event))); + throw new RenException("未检测到该用户下有效的积分规则"); + } + + + } + + private void plusPoint(SendPointFormDTO grantPoint) { + ValidatorUtils.validateEntity(grantPoint, SendPointFormDTO.SendPointGroup.class); + + if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,grantPoint.getActionFlag())){ //减 - if(grantPointParam.getPoint() > NumConstant.ZERO){ + if(grantPoint.getPoint() > NumConstant.ZERO){ //保证负数 - grantPointParam.setPoint(grantPointParam.getPoint() * NumConstant.ONE_NEG); + grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG); } }else{ //加 - if(grantPointParam.getPoint() < NumConstant.ZERO){ + if(grantPoint.getPoint() < NumConstant.ZERO){ //保证正数 - grantPointParam.setPoint(grantPointParam.getPoint() * NumConstant.ONE_NEG); + grantPoint.setPoint(grantPoint.getPoint() * NumConstant.ONE_NEG); } } //1.新增用户积分行为记录 UserPointActionLogEntity action = new UserPointActionLogEntity(); - action.setCustomerId(grantPointParam.getCustomerId()); - action.setPoint(grantPointParam.getPoint()); - action.setEventStatement(grantPointParam.getPointDesc()); + action.setCustomerId(grantPoint.getCustomerId()); + action.setPoint(grantPoint.getPoint()); + action.setEventStatement(grantPoint.getRemark()); 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()); + action.setActionFlag(grantPoint.getActionFlag()); + action.setUserId(grantPoint.getUserId()); + action.setCreatedBy(grantPoint.getOperatorId()); + action.setUpdatedBy(grantPoint.getOperatorId()); + action.setSourceId(grantPoint.getSourceId()); + action.setOperatorAgencyId(grantPoint.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()); + statistical.setPointChange(grantPoint.getPoint()); + statistical.setActionFlag(grantPoint.getActionFlag()); + statistical.setCustomerId(grantPoint.getCustomerId()); + statistical.setUserId(grantPoint.getUserId()); + statistical.setCreatedBy(grantPoint.getOperatorId()); + statistical.setUpdatedBy(grantPoint.getOperatorId()); userPointStatisticalDailyService.insertOrUpdate(statistical); - //3.新增/修改用户总积分 + //3.新增/修改用户积分日统计 UserPointTotalEntity point = new UserPointTotalEntity(); - point.setCustomerId(grantPointParam.getCustomerId()); - point.setUserId(grantPointParam.getUserId()); - point.setTotalPoint(grantPointParam.getPoint()); - point.setUsablePoint(grantPointParam.getPoint()); + point.setCustomerId(grantPoint.getCustomerId()); + point.setUserId(grantPoint.getUserId()); + point.setTotalPoint(grantPoint.getPoint()); + point.setUsablePoint(grantPoint.getPoint()); point.setUsedPoint(NumConstant.ZERO); - point.setCreatedBy(grantPointParam.getOperatorId()); - point.setUpdatedBy(grantPointParam.getOperatorId()); + point.setCreatedBy(grantPoint.getOperatorId()); + point.setUpdatedBy(grantPoint.getOperatorId()); userPointTotalService.insertOrUpdate(point); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java index c20c88fa00..a0ce1e17b2 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -90,4 +90,6 @@ public interface ModuleConstant extends Constant { String EVENT_NAME_EXCHANGE = "积分兑换"; String POINT_NOT_ENOUGH = "积分余额不足"; + + String CREATED_BY_SYSTEM = "SYSTEM"; } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml index 06e24d34cc..bf7eb31f91 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -116,4 +116,9 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml index 00eb03fc91..8e32e81668 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointAdjustmentLogDao.xml @@ -26,11 +26,10 @@ operator_name AS staffNickname, adjust_reason AS reason, DATE_FORMAT( created_time, '%Y-%m-%d %H:%i:%s' ) AS date, - CASE + CASE ADJUSTMENT_TYPE WHEN 'plus' THEN - CONCAT( '+', POINT ) ELSE CONCAT( '-', POINT ) - END AS POINT + CONCAT( '+', POINT ) ELSE POINT END AS POINT FROM point_adjustment_log WHERE diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml index 481ab2dc18..3f709bd3b5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml @@ -26,7 +26,7 @@ SELECT DISTINCT FUNCTION_ID FROM point_rule WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} UPDATE point_rule @@ -36,4 +36,12 @@ UP_LIMIT = #{upLimit,jdbcType=INTEGER} WHERE id = #{id,jdbcType=VARCHAR} and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml index bd81ab9aff..3ba551805c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -27,7 +27,7 @@ SELECT EVENT_NAME AS TITLE, EVENT_STATEMENT AS REMARK, - CASE ACTION_FLAG WHEN 'plus' THEN concat('+',POINT) WHEN 'minus' THEN concat('-',POINT) END AS point, + CASE ACTION_FLAG WHEN 'plus' THEN concat('+',POINT) ELSE POINT END AS point, DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') AS DATE, DATE_FORMAT(CREATED_TIME,'%H:%i') AS TIME FROM @@ -40,4 +40,22 @@ CREATED_TIME DESC + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java index 458176f17d..8e7de04d23 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java @@ -78,6 +78,11 @@ public class CodeCustomerDTO implements Serializable { */ private String userDesc; + /** + * 数据来源(dev:开发 test:体验 prod:生产) + */ + private String source; + /** * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java index 64a2b42e87..e41bfb5c75 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java @@ -43,4 +43,8 @@ public class UploadListFormDTO implements Serializable { * 页面条数 */ private Integer pageSize; + /** + * 数据来源(dev:开发 test:体验 prod:生产) + */ + private String source; } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java index d0090c3fa7..b5ca4824b2 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java @@ -16,15 +16,15 @@ public class CustomerUserResultDTO implements Serializable { private static final long serialVersionUID = 5214475907074876716L; /** - * 用户信息 + * 用户信息 【别名不能随便修改 否则影响程序】 */ private PaUserDTO paUserResult; /** - * 用户对应的客户信息 + * 用户对应的客户信息 【别名不能随便修改 否则影响程序】 */ private PaCustomerDTO paCustomerResult; /** - * 用户对应的微信基本信息 + * 用户对应的微信基本信息 【别名不能随便修改 否则影响程序】 */ private PaUserWechatDTO paUserWechatResult; } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/InitCustomerResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/InitCustomerResultDTO.java index 3d46c4cebc..4423265b70 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/InitCustomerResultDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/InitCustomerResultDTO.java @@ -17,15 +17,15 @@ public class InitCustomerResultDTO implements Serializable { private static final long serialVersionUID = 3253989119352850315L; /** - * 注册客户信息 + * 注册客户信息 【别名不能随便修改 否则影响程序】 */ private PaCustomerDTO paCustomer; /** - * 注册客户组织信息 + * 注册客户组织信息 【别名不能随便修改 否则影响程序】 */ private PaCustomerAgencyDTO paAgency; /** - * 注册客户管理员信息 + * 注册客户管理员信息 【别名不能随便修改 否则影响程序】 */ private PaUserDTO paUser; diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index 31edd74c55..c66841f3a4 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/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.82 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.91 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index 6aeb44ec0c..09db8600b6 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.82 + 0.0.91 com.epmet diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java index 0ef2d05e5a..64a4bb3376 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java @@ -10,10 +10,7 @@ import com.epmet.dto.form.RemoveBindFormDTO; import com.epmet.dto.result.GoToAuthResultDTO; import com.epmet.service.AppLetAuthorizationService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * @Author zxc @@ -32,9 +29,9 @@ public class AppLetAuthorizationController { * @author zxc */ @PostMapping("gotoauth") - public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO){ + public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO, @RequestHeader("source")String source){ ValidatorUtils.validateEntity(formDTO); - GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO); + GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO,source); return new Result().ok(goToAuthResultDTO); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java index 622f257d7b..1618c6ab10 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java @@ -41,4 +41,11 @@ public interface BusinessInfoDao extends BaseDao { */ void insertBusinessInfo(@Param("businessInfoList") List businessInfoList); + /** + * @Description 功能开通信息删除 + * @param + * @author zxc + */ + void deleteBusinessInfo(@Param("customerId")String customerId,@Param("clientType")String clientType); + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java index 60e77b7bcf..b84940828d 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java @@ -76,9 +76,9 @@ public interface CodeCustomerDao extends BaseDao { * 获取审核中代码列表 * @author zhaoqifeng * @date 2020/7/15 18:17 - * @param + * @param source * @return java.util.List */ - List selectAuditingCodeList(); + List selectAuditingCodeList(@Param("source") String source); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java index e233f5372b..438330ee82 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java @@ -41,4 +41,11 @@ public interface MiniCategoryInfoDao extends BaseDao { */ void insertCategoryInfo(@Param("miniCategoryInfoList") List miniCategoryInfoList); + /** + * @Description 小程序配置的类目信息删除 + * @param + * @author zxc + */ + void deleteCategoryInfo(@Param("customerId")String customerId,@Param("clientType")String clientType); + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java index 26e7dbf7e8..0d29f738df 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java @@ -40,6 +40,13 @@ public interface MiniInfoDao extends BaseDao { */ void insertMiniInfo(MiniInfoFormDTO formDTO); + /** + * @Description 删除小程序信息 + * @param formDTO + * @author zxc + */ + void deleteMiniInfo(MiniInfoFormDTO formDTO); + /** * @Description 根据原始ID查询 customerId 和 clientType * @param toUserName diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java index 361d4bb256..54c0538f53 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java @@ -41,4 +41,11 @@ public interface MiniNetworkInfoDao extends BaseDao { */ void insertNetworkInfo(@Param("networkInfoList") List networkInfoList); + /** + * @Description 小程序配置的合法域名信息删除 + * @param + * @author zxc + */ + void deleteNetworkInfo(@Param("customerId")String customerId,@Param("clientType")String clientType); + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java index 3f84ef9a4a..af21992505 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java @@ -78,6 +78,11 @@ public class CodeCustomerEntity extends BaseEpmetEntity { */ private String userDesc; + /** + * 数据来源(dev:开发 test:体验 prod:生产) + */ + private String source; + /** * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed */ diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java index fd659764b9..0d00e16505 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java @@ -17,7 +17,7 @@ public interface AppLetAuthorizationService { * @param tokenDto * @author zxc */ - GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO); + GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO,String source); /** * @Description 将公众号/小程序从开放平台帐号下解绑 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java index 588b428c5d..491d996c19 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java @@ -110,7 +110,7 @@ public interface CodeCustomerService extends BaseService { * @param * @return java.util.List */ - List getAuditingCodeList(); + List getAuditingCodeList(String source); /** * 删除旧代码记录 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java index dd50366b48..138d8e4dc7 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java @@ -55,14 +55,16 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic * @author zxc */ @Override - public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO) { + public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO,String source) { GoToAuthResultDTO result = new GoToAuthResultDTO(); String userId = tokenDto.getUserId(); //获取预授权码 String preAuthCode = componentVerifyTicketService.preAuthCode(); - String redirectUrl = WxMaCodeConstant.WEB_URL + formDTO.getClientType(); +// String redirectUrl = WxMaCodeConstant.WEB_URL + formDTO.getClientType(); + String redirectUrl = String.format(WxMaCodeConstant.WEB_URL,source,formDTO.getClientType()); String authUrl = String.format(WxMaCodeConstant.API_AUTH_REGISTER_URL, componentAppId, preAuthCode, redirectUrl); result.setUrl(authUrl); + log.info("返回URL:"+result.getUrl()); return result; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java index 92c1b86a9c..84251ee7dd 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java @@ -115,8 +115,8 @@ public class CodeCustomerServiceImpl extends BaseServiceImpl getAuditingCodeList() { - return baseDao.selectAuditingCodeList(); + public List getAuditingCodeList(String source) { + return baseDao.selectAuditingCodeList(source); } @Override diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 0410944f5a..6815a87804 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -152,6 +152,7 @@ public class CodeServiceImpl implements CodeService { //将上传信息存入表中 CodeCustomerDTO codeCustomerDTO = ConvertUtils.sourceToTarget(formDTO, CodeCustomerDTO.class); codeCustomerDTO.setCustomerName(paCustomerDTO.getCustomerName()); + codeCustomerDTO.setSource(paCustomerDTO.getSource()); codeCustomerDTO.setExtJson(extJson); codeCustomerDTO.setAppId(authInfo.getAuthorizerAppid()); codeCustomerDTO.setStatus(CodeConstant.UNAUDITED); @@ -162,7 +163,7 @@ public class CodeServiceImpl implements CodeService { @Override public PageData uploadList(UploadListFormDTO formDTO) { - List auditingList = codeCustomerService.getAuditingCodeList(); + List auditingList = codeCustomerService.getAuditingCodeList(formDTO.getSource()); if (null != auditingList && auditingList.size() > NumConstant.ZERO) { auditingList.forEach(code -> { //获取小程序调用令牌 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java index 51dc019d6c..c54dd03a31 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java @@ -125,7 +125,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe switch (infotype){ case ModuleConstant.TICKET_UNDERLINE_KEY: //接收票据 【component_verify_ticket】 String ComponentVerifyTicket = result.get(ModuleConstant.TICKET_KEY); - log.info(String.format(COMPONENT_VERIFY_TICKET)); + log.info(String.format(COMPONENT_VERIFY_TICKET,ComponentVerifyTicket)); // 缓存 ticket redisThird.setComponentVerifyTicket(ComponentVerifyTicket); // 存数据库 @@ -437,6 +437,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe miniInfoFormDTO.setCustomerId(customerId); miniInfoFormDTO.setClientType(clientType); //基础信息插入 + miniInfoDao.deleteMiniInfo(miniInfoFormDTO); miniInfoDao.insertMiniInfo(miniInfoFormDTO); String primaryId = miniInfoFormDTO.getId(); //todo 功能的开通状况信息插入 @@ -451,6 +452,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe businessInfoForm.setPrimaryId(primaryId); businessInfoList.add(businessInfoForm); }); + businessInfoDao.deleteBusinessInfo(customerId,clientType); businessInfoDao.insertBusinessInfo(businessInfoList); //todo 小程序配置的合法域名信息插入 Map miniProgramInfo = (Map) authorizerInfo.get(ModuleConstant.MINI_PROGRAM_INFO); @@ -465,6 +467,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe miniNetworkInfoForm.setPrimaryId(primaryId); networkInfoList.add(miniNetworkInfoForm); }); + miniNetworkInfoDao.deleteNetworkInfo(customerId,clientType); miniNetworkInfoDao.insertNetworkInfo(networkInfoList); //todo 小程序配置的类目信息插入 List categoryInfoList = new ArrayList<>(); @@ -481,6 +484,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe categoryInfoList.add(categoryInfo); }); }); + miniCategoryInfoDao.deleteCategoryInfo(customerId, clientType); miniCategoryInfoDao.insertCategoryInfo(categoryInfoList); } }else { @@ -501,6 +505,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe businessInfoForm.setPrimaryId(primaryId); businessInfoList.add(businessInfoForm); }); + businessInfoDao.deleteBusinessInfo(customerId,clientType); businessInfoDao.insertBusinessInfo(businessInfoList); } log.info("保存授权方基本信息结束"); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java index 5404602aed..2652afb556 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java @@ -210,6 +210,7 @@ public class PaCustomerServiceImpl extends BaseServiceImpl + + + + DELETE + FROM + business_info + WHERE + del_flag = 0 + AND customer_id = #{customerId} + AND client_type = #{clientType} + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml index 55885fd96a..17ebecfc64 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml @@ -38,6 +38,7 @@ LEFT JOIN code_audit_result car ON cc.ID = car.CODE_ID AND car.DEL_FLAG = '0' WHERE cc.DEL_FLAG = '0' + AND cc.SOURCE = #{source} AND cc.CUSTOMER_ID = #{customerId} @@ -85,7 +86,7 @@ AND template_id = #{templateId} UPDATE code_customer diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml index cf24463139..d7281d2a9f 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml @@ -72,7 +72,7 @@ WHERE cm.del_flag = '0' AND pc.del_flag = '0' - AND pc.source = '#{source}' + AND pc.source = #{source} ORDER BY cm.customer_id ASC, cm.client ASC diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml index 49aacc185b..10960ee45b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml @@ -24,4 +24,15 @@ ) + + + + DELETE + FROM + mini_category_info + WHERE + del_flag = 0 + AND customer_id = #{customerId} + AND client_type = #{clientType} + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml index 8b210f2f94..7a31b83279 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml @@ -6,7 +6,7 @@ - SELECT LAST_INSERT_ID() AS id + SELECT id AS id from mini_info where del_flag = 0 and customer_id = #{customerId} and client_type = #{clientType} order by created_time desc limit 1 INSERT INTO mini_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME, PRINCIPAL_NAME, SIGNATURE, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) @@ -32,6 +32,17 @@ ) + + + DELETE + FROM + mini_info + WHERE + del_flag = 0 + AND customer_id = #{customerId} + AND client_type = #{clientType} + +