Browse Source

志愿者功能调整

feature/screenDataPush
songyunpeng 4 years ago
parent
commit
3f38fd32a4
  1. 7
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/BehaviorEnum.java
  2. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcAppVolunteerRankFormDTO.java
  3. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcCompleteUserInfoDTO.java
  4. 15
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/EpdcVolunteerRankDTO.java
  5. 14
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerRankEntity.java
  6. 3
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerRankServiceImpl.java
  7. 13
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml
  8. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml
  9. 25
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/PointsFeignClient.java
  10. 23
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/feign/fallback/PointsFeignClientFallback.java
  11. 6
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java
  12. 2
      esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml
  13. 12
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/PointsLogsController.java
  14. 17
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/UsersFeignClient.java
  15. 7
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/feign/fallback/UsersFeignClientFallback.java
  16. 8
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/PointsLogsService.java
  17. 77
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java
  18. 2
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml
  19. 15
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcGetVolunteerRankDTO.java
  20. 12
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserController.java
  21. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java
  22. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java
  23. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java
  24. 17
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml
  25. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

7
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;

5
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;
}

5
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;
}

15
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;
}
}

14
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;
}
}

3
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<VolunteerRankDao,
public List<EpdcVolunteerRankDTO> 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);
}

13
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerRankDao.xml

@ -24,10 +24,19 @@
</resultMap>
<select id="leaderboard" resultType="com.elink.esua.epdc.volunteer.EpdcVolunteerRankDTO">
select substr(NICKNAME,locate('-',NICKNAME)+1) as NICKNAME,FACE_IMG,PARTY_FLAG,KINDNESS_TIME,PARTICIPATION_NUM,SORT
select substr(NICKNAME,locate('-',NICKNAME)+1) as NICKNAME,FACE_IMG,PARTY_FLAG,KINDNESS_TIME,PARTICIPATION_NUM,SORT,
VOLUNTEER_DEPT_ID as volunteerDeptId,VOLUNTEER_POINTS as volunteerPoints,VOLUNTEER_POINTS_TOTAL as volunteerPointsTotal
from epdc_volunteer_rank
where DEL_FLAG = '0' and SHOW_FLAG = '1'
order by sort
<if test='type != "" and type != null and type=="0"'>
order by KINDNESS_TIME desc
</if>
<if test='type != "" and type != null and type=="1"'>
order by PARTICIPATION_NUM desc
</if>
<if test='type != "" and type != null and type=="2"'>
order by VOLUNTEER_POINTS desc
</if>
LIMIT #{formDto.pageIndex},#{formDto.pageSize}
</select>
<delete id="clearGenerateRankingList">

2
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml

@ -150,6 +150,7 @@
<spring.datasource.druid.username>jinshui_epdc_test</spring.datasource.druid.username>
<spring.datasource.druid.password>jinshui@833066</spring.datasource.druid.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>115.29.142.202:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
@ -180,6 +181,7 @@
<spring.datasource.druid.username>jinshui_epdc_test</spring.datasource.druid.username>
<spring.datasource.druid.password>jinshui@833066</spring.datasource.druid.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>115.29.142.202:8848</nacos.server-addr>
<nacos.ip>47.104.94.220</nacos.ip>

25
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<String> topicIdList);
}

23
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<String> topicIdList) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_POINTS_SERVER, "deletePointsByTopic", topicIdList);
}
}

6
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<PartyTopicDao, PartyT
@Autowired
private PartyTopicImgDao partyTopicImgDao;
@Autowired
private PointsFeignClient pointsFeignClient;
@Override
public PageData<PartyTopicDTO> page(Map<String, Object> params) {
IPage<PartyTopicEntity> page = baseDao.selectPage(
@ -162,6 +167,7 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
list.add(entity);
}
updateBatchById(list);
pointsFeignClient.deletePointsByTopic(formDto.getIds());
return new Result();
}

2
esua-epdc/epdc-module/epdc-points/epdc-points-server/pom.xml

@ -149,6 +149,7 @@
<spring.datasource.druid.username>jinshui_epdc_test</spring.datasource.druid.username>
<spring.datasource.druid.password>jinshui@833066</spring.datasource.druid.password>
<!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>115.29.142.202:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
@ -180,6 +181,7 @@
<spring.datasource.druid.username>jinshui_epdc_test</spring.datasource.druid.username>
<spring.datasource.druid.password>jinshui@833066</spring.datasource.druid.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>115.29.142.202:8848</nacos.server-addr>
<nacos.ip>47.104.94.220</nacos.ip>

12
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<String> idList) {
return pointsLogsService.deletePointsByTopic(idList);
}
}

17
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<com.elink.esua.epdc.pointcommons.tools.dto.BehaviorResultDto>
* @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> epdcUserPointsFormDTO);
/**
* @param formDTO
* @return com.elink.esua.epdc.dto.UserDTO

7
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> epdcUserPointsFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateBatchUserPoints", epdcUserPointsFormDTO);
}
@Override
public Result<UserDTO> handleUserPoints(EpdcUserPointsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "handleUserPoints", formDTO);

8
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<PointsLogsEntity> {
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<String> idList);
}

77
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<PointsLogsDao, Points
return null;
}
@Override
public Result deletePointsByTopic(List<String> idList) {
if(idList.size() == 0){
return new Result().error();
}
QueryWrapper<PointsLogsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("REFERENCE_ID",idList);
List<PointsLogsEntity> pointsLogsEntities = baseDao.selectList(queryWrapper);
if(pointsLogsEntities.size() == 0) {
return new Result();
}
//组装 用户 - 扣减积分
List<EpdcUserPointsFormDTO> epdcUserPointsFormDTOList = new ArrayList<>();
//整理epdcUserPointsFormDTOList为 用户ID - 用户扣除的总分
Map<String, IntSummaryStatistics> 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<EpdcUserPointsFormDTO> formDTOS) {
for (EpdcUserPointsFormDTO formDto : formDTOS) {
//根据动作编码获取动作信息
Result<BehaviorResultDto> behaviorCodeInfoByBehaviorCode = pointsBehaviorService.getBehaviorCodeInfoByBehaviorCode(BehaviorEnum.TOPIC_VIOLATIONS.getValue());
Result<UserDTO> 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<Long> userGridIdByUserId = usersFeignClient.getUserGridIdByUserId(formDto.getUserId());
Result<ParentAndAllDeptDTO> 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");

2
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}

15
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;
}
/**
* 志愿者部门ID
*/
private String volunteerDeptId;
/**
* 志愿者公益积分
*/
private Integer volunteerPoints;
/**
* 志愿公益累计积分
*/
private Integer volunteerPointsTotal;
}

12
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<com.elink.esua.epdc.pointcommons.tools.dto.BehaviorResultDto>
* @Description 更新用户积分信息
* @Author songyunpeng
* @Date 2020/4/29
* @Param [dto]
**/
@PostMapping(value = "updateBatchUserPoints")
public Result updateBatchUserPoints(@RequestBody List<EpdcUserPointsFormDTO> epdcUserPointsFormDTO){
return userService.updateBatchUserPoints(epdcUserPointsFormDTO);
}
/**
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.pointcommons.tools.dto.BehaviorResultDto>
* @Description 更新用户积分信息

8
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<UserEntity> {
* @return void
**/
void updateUserPoints(EpdcUserPointsFormDTO epdcUserPointsFormDTO);
/**
* @Description 批量更新用户积分
* @Author songyunpeng
* @Date 2020/12/11
* @Param [epdcUserPointsFormDTO]
* @return void
**/
void updateBatchUserPoints(@Param("list") List<EpdcUserPointsFormDTO> list);
/**
* @Description 获取用户绑定网格接口 - 未绑定 获取第一次扫码网格
* @Author songyunpeng

8
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<UserEntity> {
* @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> epdcUserPointsFormDTO);
/**
* @Description 获取用户积分接口
* @Author songyunpeng

5
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<UserDao, UserEntity> implem
baseDao.updateUserPoints(epdcUserPointsFormDTO);
return new Result();
}
@Override
public Result updateBatchUserPoints(List<EpdcUserPointsFormDTO> epdcUserPointsFormDTO) {
baseDao.updateBatchUserPoints(epdcUserPointsFormDTO);
return new Result();
}
@Override
public Result<EpdcAppUserPointsResultDTO> getPointsByUserId(String userId) {

17
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

@ -16,6 +16,23 @@
<update id="resetPoints">
update epdc_user set points = 0 where DEL_FLAG = '0' and UPDATED_TIME = now()
</update>
<update id="updateBatchUserPoints">
update epdc_user
<trim prefix="set" suffixOverrides=",">
<trim prefix="points =case" suffix="end,">
<foreach collection="list" item="item" index="index">
<if test="item.points != null">
when id=#{item.userId}
then points + #{item.points}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
#{item.userId}
</foreach>
</update>
<delete id="deleteAuditFailureByOpenId">
DELETE FROM epdc_user WHERE WX_OPEN_ID = #{wxOpenId} AND STATE = '2'

5
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')

Loading…
Cancel
Save