diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/form/VolunteerPointsRecordsFormDTO.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/form/VolunteerPointsRecordsFormDTO.java new file mode 100644 index 00000000..e461dd25 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/form/VolunteerPointsRecordsFormDTO.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.dto.user.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2021/7/19 16:07 + */ +@Data +public class VolunteerPointsRecordsFormDTO implements Serializable { + private static final long serialVersionUID = 1625467226873432125L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "每页条数必须大于0") + private Integer pageSize; + + /** + * 用户ID + */ + @NotBlank(message = "获取用户信息失败") + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/result/VolunteerPointsRecordsResultDTO.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/result/VolunteerPointsRecordsResultDTO.java index b3b70183..dd5a12ce 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/result/VolunteerPointsRecordsResultDTO.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-client/src/main/java/com/elink/esua/epdc/dto/user/result/VolunteerPointsRecordsResultDTO.java @@ -36,4 +36,9 @@ public class VolunteerPointsRecordsResultDTO implements Serializable { * 积分 */ private Integer volunteerPoints; + + /** + * 积分操作类型 0-减积分,1-加积分 + */ + private String operationType; } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/VolunteerPointsAnalysisCotroller.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/VolunteerPointsAnalysisCotroller.java index a880e9f3..d319fbb3 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/VolunteerPointsAnalysisCotroller.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/controller/VolunteerPointsAnalysisCotroller.java @@ -2,16 +2,16 @@ package com.elink.esua.epdc.modules.user.controller; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.user.form.VolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.user.result.DeptVolunteerResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsStaticResultDTO; import com.elink.esua.epdc.modules.user.service.VolunteerPointsAnalysisService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import java.util.List; import java.util.Map; /** @@ -68,4 +68,19 @@ public class VolunteerPointsAnalysisCotroller { PageData data = volunteerPointsAnalysisService.volunteerPointsRecords(params); return new Result>().ok(data); } + + /** + * 居民端-志愿者银行-用户公益积分记录 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2021/7/19 16:13 + */ + @GetMapping("charityPoints") + public Result> charityPoints(@RequestBody VolunteerPointsRecordsFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + List data = volunteerPointsAnalysisService.charityPoints(formDto); + return new Result>().ok(data); + } } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/VolunteerPointsAnalysisDao.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/VolunteerPointsAnalysisDao.java index 5e763e0d..120f7a28 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/VolunteerPointsAnalysisDao.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/dao/VolunteerPointsAnalysisDao.java @@ -1,6 +1,7 @@ package com.elink.esua.epdc.modules.user.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.elink.esua.epdc.dto.user.form.VolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.user.result.DeptVolunteerResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsStaticResultDTO; @@ -44,4 +45,14 @@ public interface VolunteerPointsAnalysisDao extends BaseMapper volunteerPointsRecords(Map params); + + /** + * 居民端-志愿者银行-用户公益积分记录 + * + * @param formDto + * @return java.util.List + * @author liuchuang + * @since 2021/7/19 16:14 + */ + List charityPoints(VolunteerPointsRecordsFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/VolunteerPointsAnalysisService.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/VolunteerPointsAnalysisService.java index fb408d22..dead2c9f 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/VolunteerPointsAnalysisService.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/VolunteerPointsAnalysisService.java @@ -1,10 +1,12 @@ package com.elink.esua.epdc.modules.user.service; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.user.form.VolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.user.result.DeptVolunteerResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsStaticResultDTO; +import java.util.List; import java.util.Map; /** @@ -42,4 +44,14 @@ public interface VolunteerPointsAnalysisService { * @since 2021/7/15 14:48 */ PageData volunteerPointsRecords(Map params); + + /** + * 居民端-志愿者银行-用户公益积分记录 + * + * @param formDto + * @return java.util.List + * @author liuchuang + * @since 2021/7/19 16:14 + */ + List charityPoints(VolunteerPointsRecordsFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/VolunteerPointsAnalysisServiceImpl.java b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/VolunteerPointsAnalysisServiceImpl.java index bd6f7f44..5f421ef5 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/VolunteerPointsAnalysisServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/java/com/elink/esua/epdc/modules/user/service/impl/VolunteerPointsAnalysisServiceImpl.java @@ -2,7 +2,9 @@ package com.elink.esua.epdc.modules.user.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.user.form.VolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.user.result.DeptVolunteerResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.user.result.VolunteerPointsStaticResultDTO; @@ -40,4 +42,11 @@ public class VolunteerPointsAnalysisServiceImpl extends BaseServiceImpl list = baseDao.volunteerPointsRecords(params); return new PageData<>(list, iPage.getTotal()); } + + @Override + public List charityPoints(VolunteerPointsRecordsFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + return baseDao.charityPoints(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/VolunteerPointsAnalysisDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/VolunteerPointsAnalysisDao.xml index a4e18b02..0903cb9d 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/VolunteerPointsAnalysisDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/user/VolunteerPointsAnalysisDao.xml @@ -121,4 +121,26 @@ ORDER BY l.`OPERATION_TIME` DESC + + diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/ApiVolunteerPointsRecordsFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/ApiVolunteerPointsRecordsFormDTO.java new file mode 100644 index 00000000..bfb2f829 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/ApiVolunteerPointsRecordsFormDTO.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2021/7/19 16:07 + */ +@Data +public class ApiVolunteerPointsRecordsFormDTO implements Serializable { + private static final long serialVersionUID = 1625467226873432125L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "每页条数必须大于0") + private Integer pageSize; + + /** + * 用户ID + */ + @NotBlank(message = "获取用户信息失败") + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/ApiVolunteerPointsRecordsResultDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/ApiVolunteerPointsRecordsResultDTO.java new file mode 100644 index 00000000..8b2a86d0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/ApiVolunteerPointsRecordsResultDTO.java @@ -0,0 +1,44 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2021/7/15 14:45 + */ +@Data +public class ApiVolunteerPointsRecordsResultDTO implements Serializable { + private static final long serialVersionUID = -286937478420813680L; + + /** + * 积分记录ID + */ + private String id; + + /** + * 昵称 + */ + private String nickname; + + /** + * 活动名称 + */ + private String actName; + + /** + * 积分记录时间 + */ + private String operationTime; + + /** + * 积分 + */ + private Integer volunteerPoints; + + /** + * 积分操作类型 0-减积分,1-加积分 + */ + private String operationType; +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPointsController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPointsController.java index 681ce6fe..8f1e5c2c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPointsController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiPointsController.java @@ -4,13 +4,16 @@ import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.form.ApiVolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.form.EpdcAppPointsRankingFormDTO; import com.elink.esua.epdc.dto.form.EpdcAppPointsRecordFormDTO; +import com.elink.esua.epdc.dto.result.ApiVolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.result.EpdcAppPointsRankingResultDTO; import com.elink.esua.epdc.dto.result.EpdcAppPointsRecordResultDTO; import com.elink.esua.epdc.service.PointsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -55,4 +58,18 @@ public class ApiPointsController { ValidatorUtils.validateEntity(formDto); return pointsService.listPointsRanking(userDetail, formDto); } + + /** + * 居民端-志愿者银行-用户公益积分记录 + * + * @param userDetail + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2021/7/19 16:32 + */ + @GetMapping("charityPoints") + public Result> charityPoints(@LoginUser TokenDto userDetail, ApiVolunteerPointsRecordsFormDTO formDto) { + return pointsService.charityPoints(userDetail, formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClient.java index c206e8ad..284adeb6 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AnalysisFeignClient.java @@ -2,10 +2,15 @@ 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.dto.form.ApiVolunteerPointsRecordsFormDTO; +import com.elink.esua.epdc.dto.result.ApiVolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.feign.fallback.AnalysisFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 数据分析模块调用 @@ -26,5 +31,15 @@ public interface AnalysisFeignClient { @GetMapping(value = "analysis/workLog/getCustomId", consumes = MediaType.APPLICATION_JSON_VALUE) Result getCustomId(); + /** + * 居民端-志愿者银行-用户公益积分记录 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2021/7/19 16:36 + */ + @GetMapping(value = "analysis/volunteer/charityPoints", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> charityPoints(ApiVolunteerPointsRecordsFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClientFallback.java index bb6072e5..491f7558 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AnalysisFeignClientFallback.java @@ -3,9 +3,13 @@ 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.form.ApiVolunteerPointsRecordsFormDTO; +import com.elink.esua.epdc.dto.result.ApiVolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.feign.AnalysisFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Author:songyunpeg * @Date:2020/9/9 15:42 @@ -17,4 +21,9 @@ public class AnalysisFeignClientFallback implements AnalysisFeignClient { public Result getCustomId() { return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "getCustomId"); } + + @Override + public Result> charityPoints(ApiVolunteerPointsRecordsFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "charityPoints", "formDto"); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PointsService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PointsService.java index 313a5934..a782b960 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PointsService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/PointsService.java @@ -2,8 +2,10 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.ApiVolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.form.EpdcAppPointsRankingFormDTO; import com.elink.esua.epdc.dto.form.EpdcAppPointsRecordFormDTO; +import com.elink.esua.epdc.dto.result.ApiVolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.result.EpdcAppPointsRankingResultDTO; import com.elink.esua.epdc.dto.result.EpdcAppPointsRecordResultDTO; @@ -42,4 +44,15 @@ public interface PointsService { * @Date: 2020-04-30 */ Result listPointsRanking(TokenDto userDetail, EpdcAppPointsRankingFormDTO formDto); + + /** + * 居民端-志愿者银行-用户公益积分记录 + * + * @param userDetail + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2021/7/19 16:34 + */ + Result> charityPoints(TokenDto userDetail, ApiVolunteerPointsRecordsFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PointsServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PointsServiceImpl.java index 61e3e36c..3c66fc6c 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PointsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/PointsServiceImpl.java @@ -2,10 +2,13 @@ package com.elink.esua.epdc.service.impl; import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.form.ApiVolunteerPointsRecordsFormDTO; import com.elink.esua.epdc.dto.form.EpdcAppPointsRankingFormDTO; import com.elink.esua.epdc.dto.form.EpdcAppPointsRecordFormDTO; +import com.elink.esua.epdc.dto.result.ApiVolunteerPointsRecordsResultDTO; import com.elink.esua.epdc.dto.result.EpdcAppPointsRankingResultDTO; import com.elink.esua.epdc.dto.result.EpdcAppPointsRecordResultDTO; +import com.elink.esua.epdc.feign.AnalysisFeignClient; import com.elink.esua.epdc.feign.PointsFeignClient; import com.elink.esua.epdc.service.PointsService; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +26,8 @@ public class PointsServiceImpl implements PointsService { @Autowired private PointsFeignClient pointsFeignClient; + @Autowired + private AnalysisFeignClient analysisFeignClient; @Override public Result> listPointsRecord(TokenDto userDetail, EpdcAppPointsRecordFormDTO formDto) { @@ -36,4 +41,10 @@ public class PointsServiceImpl implements PointsService { formDto.setNickName(userDetail.getNickname()); return pointsFeignClient.listPointsRankingFeignClient(formDto); } + + @Override + public Result> charityPoints(TokenDto userDetail, ApiVolunteerPointsRecordsFormDTO formDto) { + formDto.setUserId(userDetail.getUserId()); + return analysisFeignClient.charityPoints(formDto); + } }