diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java index c4e80bc8..0e8a49cc 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java @@ -310,7 +310,12 @@ public enum BehaviorEnum { /** * 内容评论的点踩 */ - NOTICE_COMMENT_OPPOSITION("notice_comment_opposition"); + NOTICE_COMMENT_OPPOSITION("notice_comment_opposition"), + + /** + * 话题违规,积分扣除 + */ + TOPIC_VIOLATIONS("topic_violations"); private String value; diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppVolunteerRankFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppVolunteerRankFormDTO.java index 76fbac22..0a765e3e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppVolunteerRankFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppVolunteerRankFormDTO.java @@ -24,4 +24,9 @@ public class EpdcAppVolunteerRankFormDTO implements Serializable { */ @Min(value = 1, message = "页容量必须大于0") private Integer pageSize; + + /** + * 排序字段 0 :爱心时长 1:参与次数 2:公益积分 + */ + private String type; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java index 469cfea3..a380c7dd 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java @@ -98,4 +98,9 @@ public class EpdcCompleteUserInfoDTO implements Serializable { * 志愿者标签 */ private String volunteerTagId; + + /** + * 志愿者所属部门 + */ + private String volunteerDeptId; } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java index c847ccd6..2205f6b6 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java @@ -63,6 +63,17 @@ public class EpdcVolunteerRankDTO implements Serializable { */ private Integer participationNum; + /** + * 志愿者部门ID + */ + private String volunteerDeptId; + /** + * 志愿者公益积分 + */ + private Integer volunteerPoints; + /** + * 志愿公益累计积分 + */ + private Integer volunteerPointsTotal; - -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java index 6f95006f..41873d93 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java @@ -87,5 +87,17 @@ public class VolunteerRankEntity extends BaseEpdcEntity { * 是否显示(0-不显示,1-显示) */ private String showFlag; + /** + * 志愿者部门ID + */ + private String volunteerDeptId; + /** + * 志愿者公益积分 + */ + private Integer volunteerPoints; + /** + * 志愿公益累计积分 + */ + private Integer volunteerPointsTotal; -} \ No newline at end of file +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java index 569ac3d6..1b91f67c 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java @@ -115,6 +115,9 @@ public class VolunteerRankServiceImpl extends BaseServiceImpl leaderboard(EpdcAppVolunteerRankFormDTO formDto){ int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); formDto.setPageIndex(pageIndex); + if(StringUtils.isBlank(formDto.getType())){ + formDto.setType("0"); + } return baseDao.leaderboard(formDto); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml index 52d48209..722af5f7 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml @@ -24,10 +24,19 @@ diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml index 09f8e0b5..4f9ec176 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml @@ -150,6 +150,7 @@ jinshui_epdc_test jinshui@833066 + false 115.29.142.202:8848 @@ -180,6 +181,7 @@ jinshui_epdc_test jinshui@833066 + true 115.29.142.202:8848 47.104.94.220 diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java new file mode 100644 index 00000000..bc4d875f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java @@ -0,0 +1,25 @@ +package com.elink.esua.epdc.feign; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.feign.fallback.PointsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * 积分管理模块 + * + * @author work@yujt.net.cn + * @date 2019/9/18 15:37 + */ +@FeignClient(name = ServiceConstant.EPDC_POINTS_SERVER, fallback = PointsFeignClientFallback.class) +public interface PointsFeignClient { + + + @PostMapping(value = "points/pointslogs/deletePointsByReferenceId", consumes = MediaType.APPLICATION_JSON_VALUE) + Result deletePointsByTopic(List topicIdList); + +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java new file mode 100644 index 00000000..37b827a5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java @@ -0,0 +1,23 @@ +package com.elink.esua.epdc.feign.fallback; + +import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.PointsLogsBindUnIdDTO; +import com.elink.esua.epdc.feign.PointsFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author work@yujt.net.cn + * @date 2019/9/18 15:38 + */ +@Component +public class PointsFeignClientFallback implements PointsFeignClient { + + @Override + public Result deletePointsByTopic(List topicIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_POINTS_SERVER, "deletePointsByTopic", topicIdList); + } +} diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java index 13e8440c..e713aabe 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java @@ -47,6 +47,7 @@ import com.elink.esua.epdc.entity.PartyTopicEntity; import com.elink.esua.epdc.entity.PartyTopicUserAttitudeEntity; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.ContentSecurityFeignClient; +import com.elink.esua.epdc.feign.PointsFeignClient; import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO; import com.elink.esua.epdc.service.PartyTopicImgService; @@ -90,6 +91,10 @@ public class PartyTopicServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -162,6 +167,7 @@ public class PartyTopicServiceImpl extends BaseServiceImpljinshui_epdc_test jinshui@833066 + false 115.29.142.202:8848 @@ -180,6 +181,7 @@ jinshui_epdc_test jinshui@833066 + true 115.29.142.202:8848 47.104.94.220 diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java index dda59d3b..f61ae76f 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java @@ -181,4 +181,16 @@ public class PointsLogsController { return pointsLogsService.maBindUnIdLogs(formDto); } + /** + * @Description 话题积分恶意刷分 积分调整 + * @Author songyunpeng + * @Date 2021/7/15 + * @Param [idList] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + @PostMapping("deletePointsByReferenceId") + public Result deletePointsByTopic(@RequestBody List idList) { + return pointsLogsService.deletePointsByTopic(idList); + } + } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java index 47d41623..eee0e501 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java @@ -8,7 +8,12 @@ import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.feign.fallback.UsersFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** @@ -38,6 +43,16 @@ public interface UsersFeignClient { @PostMapping(value = "app-user/user/updateUserPoints", consumes = MediaType.APPLICATION_JSON_VALUE) Result updateUserPoints(@RequestBody EpdcUserPointsFormDTO epdcUserPointsFormDTO); + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 批量更新用户积分信息 + * @Author songyunpeng + * @Date 2020/4/29 + * @Param [dto] + **/ + @PostMapping(value = "app-user/user/updateBatchUserPoints", consumes = MediaType.APPLICATION_JSON_VALUE) + Result updateBatchUserPoints(@RequestBody List epdcUserPointsFormDTO); + /** * @param formDTO * @return com.elink.esua.epdc.dto.UserDTO diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java index ef21e6da..190bd604 100644 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java @@ -9,6 +9,8 @@ import com.elink.esua.epdc.dto.epdc.form.EpdcUserPointsFormDTO; import com.elink.esua.epdc.feign.UsersFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @author songyunpeng * @date 2020/4/28 9:30 @@ -26,6 +28,11 @@ public class UsersFeignClientFallback implements UsersFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserPoints", epdcUserPointsFormDTO); } + @Override + public Result updateBatchUserPoints(List epdcUserPointsFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateBatchUserPoints", epdcUserPointsFormDTO); + } + @Override public Result handleUserPoints(EpdcUserPointsFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "handleUserPoints", formDTO); diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java index 2e8dc356..05e6a16a 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java @@ -245,4 +245,12 @@ public interface PointsLogsService extends BaseService { Result maBindUnIdLogs(PointsLogsBindUnIdDTO formDto); Result test(); + /** + * @Description 话题积分恶意刷分 积分调整 + * @Author songyunpeng + * @Date 2021/7/15 + * @Param [idList] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result deletePointsByTopic(List idList); } diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java index 1d577fa1..1b815ac6 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java @@ -24,6 +24,7 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.constant.PointsConstant; +import com.elink.esua.epdc.commons.tools.enums.BehaviorEnum; import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum; import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationModeEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; @@ -55,6 +56,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.stream.Collectors; /** * 积分记录表 积分记录表 @@ -562,6 +564,81 @@ public class PointsLogsServiceImpl extends BaseServiceImpl idList) { + if(idList.size() == 0){ + return new Result().error(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("REFERENCE_ID",idList); + List pointsLogsEntities = baseDao.selectList(queryWrapper); + if(pointsLogsEntities.size() == 0) { + return new Result(); + } + //组装 用户 - 扣减积分 + List epdcUserPointsFormDTOList = new ArrayList<>(); + //整理epdcUserPointsFormDTOList为 用户ID - 用户扣除的总分 + Map collect = pointsLogsEntities.stream().collect(Collectors.groupingBy(PointsLogsEntity::getUserId, Collectors.summarizingInt(PointsLogsEntity::getPoints))); + collect.forEach((k, v) -> { + EpdcUserPointsFormDTO epdcUserPointsFormDTO = new EpdcUserPointsFormDTO(); + epdcUserPointsFormDTO.setUserId(k); + epdcUserPointsFormDTO.setPoints(-Integer.parseInt(String.valueOf(v.getSum()))); + epdcUserPointsFormDTOList.add(epdcUserPointsFormDTO); + }); + //新增扣除积分记录: + insertTopicPointsLog(epdcUserPointsFormDTOList); + //扣除用户表相应积分 + usersFeignClient.updateBatchUserPoints(epdcUserPointsFormDTOList); + return new Result(); + } + /** + * @Description 新增扣除积分记录 + * @Author songyunpeng + * @Date 2021/7/15 + * @Param [epdcUserPointsFormDTOList] + * @return void + **/ + private void insertTopicPointsLog(List formDTOS) { + for (EpdcUserPointsFormDTO formDto : formDTOS) { + //根据动作编码获取动作信息 + Result behaviorCodeInfoByBehaviorCode = pointsBehaviorService.getBehaviorCodeInfoByBehaviorCode(BehaviorEnum.TOPIC_VIOLATIONS.getValue()); + Result userById = usersFeignClient.getUserById(formDto.getUserId()); + if(!userById.success()){ + throw new RenException("扣除话题积分记录 - 获取用户信息失败"); + } + UserDTO userDto = userById.getData(); + PointsLogsEntity pointsLogsEntity = new PointsLogsEntity(); + pointsLogsEntity.setUserId(formDto.getUserId()); + pointsLogsEntity.setNickname(userDto.getNickname()); + pointsLogsEntity.setFaceImg(userDto.getFaceImg()); + pointsLogsEntity.setOperationTime(new Date()); + pointsLogsEntity.setOperationMode(PointsOperationModeEnum.OPERATION_MODE_ADMIN.getOperationMode()); + pointsLogsEntity.setRuleCode(PointsConstant.behaviorCodeCode); + pointsLogsEntity.setBehaviorCode(BehaviorEnum.TOPIC_VIOLATIONS.getValue()); + pointsLogsEntity.setOperationDesc(behaviorCodeInfoByBehaviorCode.getData().getBehaviorDesc()); + pointsLogsEntity.setPoints(-formDto.getPoints()); + pointsLogsEntity.setOperationType("0"); + pointsLogsEntity.setReferenceId(formDto.getUserId()); + pointsLogsEntity.setLavePoints(userDto.getPoints() + formDto.getPoints()); + pointsLogsEntity.setRemark(""); + pointsLogsEntity.setRealName(userDto.getRealName()); + + // 赋值积分所属部门 + Result userGridIdByUserId = usersFeignClient.getUserGridIdByUserId(formDto.getUserId()); + Result parentAndAllDept = adminFeignClient.getParentAndAllDept(userGridIdByUserId.getData()); + ParentAndAllDeptDTO parentAndAllDeptDTO = parentAndAllDept.getData(); + pointsLogsEntity.setGrid(parentAndAllDeptDTO.getGrid()); + pointsLogsEntity.setGridId(parentAndAllDeptDTO.getGridId()); + pointsLogsEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); + pointsLogsEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); + pointsLogsEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); + pointsLogsEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); + + insert(pointsLogsEntity); + } + + } + private void insertLogs() { PointsLogsEntity entity = new PointsLogsEntity(); entity.setUserId("f093eaa6b6ace23b631e2e61e02b9e58"); diff --git a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml index 2ad48004..89f51559 100755 --- a/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml +++ b/esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml @@ -33,7 +33,7 @@ FROM epdc_points_logs l WHERE l.DEL_FLAG = 0 - AND l.USER_ID = #{userId} + AND l.USER_ID = #{userId} and BEHAVIOR_CODE != 'join_act' ORDER BY l.OPERATION_TIME DESC LIMIT #{pageIndex}, #{pageSize} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java index 5de780bd..88ffc3f7 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java @@ -119,4 +119,17 @@ public class EpdcGetVolunteerRankDTO implements Serializable { */ private String delFlag; -} \ No newline at end of file + /** + * 志愿者部门ID + */ + private String volunteerDeptId; + /** + * 志愿者公益积分 + */ + private Integer volunteerPoints; + /** + * 志愿公益累计积分 + */ + private Integer volunteerPointsTotal; + +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java index f7071d69..6f3d7439 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java @@ -340,6 +340,18 @@ public class UserController { return userService.updateUserPoints(epdcUserPointsFormDTO); } + /** + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Description 更新用户积分信息 + * @Author songyunpeng + * @Date 2020/4/29 + * @Param [dto] + **/ + @PostMapping(value = "updateBatchUserPoints") + public Result updateBatchUserPoints(@RequestBody List epdcUserPointsFormDTO){ + return userService.updateBatchUserPoints(epdcUserPointsFormDTO); + } + /** * @return com.elink.esua.epdc.commons.tools.utils.Result * @Description 更新用户积分信息 diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java index 0172f545..0452dbd2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -297,6 +297,14 @@ public interface UserDao extends BaseDao { * @return void **/ void updateUserPoints(EpdcUserPointsFormDTO epdcUserPointsFormDTO); + /** + * @Description 批量更新用户积分 + * @Author songyunpeng + * @Date 2020/12/11 + * @Param [epdcUserPointsFormDTO] + * @return void + **/ + void updateBatchUserPoints(@Param("list") List list); /** * @Description 获取用户绑定网格接口 - 未绑定 获取第一次扫码网格 * @Author songyunpeng diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java index 6cd23a99..96de755a 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -401,6 +401,14 @@ public interface UserService extends BaseService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result updateUserPoints(EpdcUserPointsFormDTO epdcUserPointsFormDTO); + /** + * @Description 批量更新用户积分信息 + * @Author songyunpeng + * @Date 2020/12/11 + * @Param [epdcUserPointsFormDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result + **/ + Result updateBatchUserPoints(List epdcUserPointsFormDTO); /** * @Description 获取用户积分接口 * @Author songyunpeng diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java index 670bff76..edb0184e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -1482,6 +1482,11 @@ public class UserServiceImpl extends BaseServiceImpl implem baseDao.updateUserPoints(epdcUserPointsFormDTO); return new Result(); } + @Override + public Result updateBatchUserPoints(List epdcUserPointsFormDTO) { + baseDao.updateBatchUserPoints(epdcUserPointsFormDTO); + return new Result(); + } @Override public Result getPointsByUserId(String userId) { diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index 29648194..5d236b13 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -16,6 +16,23 @@ update epdc_user set points = 0 where DEL_FLAG = '0' and UPDATED_TIME = now() + + update epdc_user + + + + + when id=#{item.userId} + then points + #{item.points} + + + + + where id in + + #{item.userId} + + DELETE FROM epdc_user WHERE WX_OPEN_ID = #{wxOpenId} AND STATE = '2' diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml index 76288ab7..89e51f09 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -199,7 +199,10 @@ vi.VOLUNTEER_NICKNAME as NICKNAME, eu.PARTY_FLAG, vi.KINDNESS_TIME, - vi.PARTICIPATION_NUM + vi.PARTICIPATION_NUM, + vi.VOLUNTEER_DEPT_ID, + vi.VOLUNTEER_POINTS, + vi.VOLUNTEER_POINTS_TOTAL from epdc_volunteer_info vi left join epdc_user eu on eu.id = vi.USER_ID WHERE vi.DEL_FLAG = '0' AND vi.AUDIT_STATUS IN ('0', '1')