From ee039c628bb546627e364aa9031f87f9dd74c743 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 30 Jul 2020 14:42:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/ResiVolunteerInfoResultDTO.java | 86 +++++++++++++++++++ .../controller/ResiVolunteerController.java | 23 +++++ .../java/com/epmet/dao/VolunteerInfoDao.java | 11 +++ .../epmet/service/VolunteerInfoService.java | 10 +++ .../impl/VolunteerInfoServiceImpl.java | 26 ++++++ .../resources/mapper/VolunteerInfoDao.xml | 10 +++ .../epmet/feign/EpmetUserOpenFeignClient.java | 18 +++- .../EpmetUserOpenFeignClientFallback.java | 6 ++ .../controller/UserBaseInfoController.java | 4 +- 9 files changed, 188 insertions(+), 6 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiVolunteerInfoResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiVolunteerInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiVolunteerInfoResultDTO.java new file mode 100644 index 0000000000..20995ac5a4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiVolunteerInfoResultDTO.java @@ -0,0 +1,86 @@ +package com.epmet.dto.result.resi; +import lombok.Data; + +import java.io.Serializable; + +/** + * 志愿者信息+用户基础信息 返回值 + * @Auther: zhangyong + * @Date: 2020-07-28 14:40 + */ + +@Data +public class ResiVolunteerInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index a2768b99bd..4125f45f5f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -23,6 +23,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.ResiUserBaseInfoResultDTO; +import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -44,9 +46,30 @@ public class ResiVolunteerController { @Autowired private VolunteerInfoService volunteerInfoService; + /** + * 志愿者认证 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:59 2020-07-30 + **/ @PostMapping("authenticate") public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class); return volunteerInfoService.authenticate(tokenDto, formDTO); } + + /** + * 志愿者认证界面,获取用户基础信息+志愿者信息 + * + * @param tokenDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 15:20 2020-07-28 + **/ + @PostMapping("selectvolunteerinfo") + public Result selectVolunteerInfo(@LoginUser TokenDto tokenDTO){ + return volunteerInfoService.selecVolunteerInfoByUserId(tokenDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java index 5ceec37857..7b557dbaa1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.VolunteerInfoDTO; import com.epmet.entity.VolunteerInfoEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -52,4 +53,14 @@ public interface VolunteerInfoDao extends BaseDao { * @Date 15:05 2020-07-23 **/ void updateVolunteerInfoByUserId(VolunteerInfoEntity entity); + + /** + * 根据用户id,查询志愿者信息 + * + * @param userId + * @return java.lang.String + * @Author zhangyong + * @Date 14:33 2020-07-23l + **/ + VolunteerInfoDTO selectVolunteerInfoByUserId(@Param("userId") String userId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 6938871d5b..0ca916c51d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; import java.util.List; @@ -47,4 +48,13 @@ public interface VolunteerInfoService extends BaseService { **/ Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO); + /** + * 志愿者认证界面,获取用户基础信息+志愿者信息 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:05 2020-07-30 + **/ + Result selecVolunteerInfoByUserId(TokenDto tokenDto); } 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 7d219aca27..15b2519c4d 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 @@ -24,6 +24,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -31,8 +32,11 @@ import com.epmet.commons.tools.utils.SendMqMsgUtils; 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.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.result.ResiUserBaseInfoResultDTO; +import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.VolunteerInfoRedis; @@ -134,4 +138,26 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl selecVolunteerInfoByUserId(TokenDto tokenDto) { + ResiVolunteerInfoResultDTO resultDTO = new ResiVolunteerInfoResultDTO(); + // 获取用户基本信息 + Result userBaseInfo = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); + if (userBaseInfo.success()){ + resultDTO = ConvertUtils.sourceToTarget(userBaseInfo.getData(), ResiVolunteerInfoResultDTO.class); + // 判断是不是志愿者 + Integer volunteerFlag = baseDao.queryVolunteerFlagByUserId(tokenDto.getUserId()); + if (volunteerFlag > NumConstant.ZERO){ + // 获取志愿者信息 + VolunteerInfoDTO dto = baseDao.selectVolunteerInfoByUserId(tokenDto.getUserId()); + resultDTO.setVolunteerIntroduce(dto.getVolunteerIntroduce()); + resultDTO.setVolunteerSignature(dto.getVolunteerSignature()); + } + } else { + logger.error("获取用户基本信息失败"); + throw new RenException("获取用户基本信息失败!"); + } + return new Result().ok(resultDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml index 3555334a07..13d1cb7660 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -44,4 +44,14 @@ WHERE DEL_FLAG = '0' AND USER_ID = #{userId} + + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 67c3a83204..5aa0a5e9dd 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -1,6 +1,8 @@ package com.epmet.feign; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.GovStaffRoleDTO; @@ -11,10 +13,7 @@ import com.epmet.dto.result.*; import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -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 org.springframework.web.bind.annotation.*; import java.util.List; @@ -229,4 +228,15 @@ public interface EpmetUserOpenFeignClient { **/ @GetMapping(value = "epmetuser/customerstaff/getCustsomerStaffByIdAndPhone") Result> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO); + + /** + * 获取用户基础信息 + * + * @param tokenDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:10 2020-07-30 + **/ + @PostMapping("/epmetuser/userbaseinfo/selectuserbaseinfo") + Result selectUserBaseInfo(@RequestBody TokenDto tokenDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 0637ffc307..9c3fc1d0ba 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -1,6 +1,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffDTO; @@ -167,4 +168,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustsomerStaffByIdAndPhone", formDTO); } + + @Override + public Result selectUserBaseInfo(TokenDto tokenDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectUserBaseInfo", tokenDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index 2273048c93..26c6cf8c3c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -158,8 +158,8 @@ public class UserBaseInfoController { * @Author zhangyong * @Date 15:20 2020-07-28 **/ - @PostMapping("selecuserbaseinfo") - public Result selecUserBaseInfo(@LoginUser TokenDto tokenDTO){ + @PostMapping("selectuserbaseinfo") + public Result selectUserBaseInfo(@LoginUser TokenDto tokenDTO){ return userBaseInfoService.selecUserBaseInfoByUserId(tokenDTO.getUserId()); } } From 3c233719ff548c011346e2d3fc6e3ef0448bd143 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 30 Jul 2020 14:44:14 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/ResiVolunteerController.java | 2 +- .../src/main/java/com/epmet/service/VolunteerInfoService.java | 2 +- .../java/com/epmet/service/impl/VolunteerInfoServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 4125f45f5f..bd6dcd48bb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -70,6 +70,6 @@ public class ResiVolunteerController { **/ @PostMapping("selectvolunteerinfo") public Result selectVolunteerInfo(@LoginUser TokenDto tokenDTO){ - return volunteerInfoService.selecVolunteerInfoByUserId(tokenDTO); + return volunteerInfoService.selectVolunteerInfoByUserId(tokenDTO); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 0ca916c51d..224da29b05 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -56,5 +56,5 @@ public interface VolunteerInfoService extends BaseService { * @Author zhangyong * @Date 14:05 2020-07-30 **/ - Result selecVolunteerInfoByUserId(TokenDto tokenDto); + Result selectVolunteerInfoByUserId(TokenDto tokenDto); } 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 15b2519c4d..06cd0afafd 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 @@ -140,7 +140,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl selecVolunteerInfoByUserId(TokenDto tokenDto) { + public Result selectVolunteerInfoByUserId(TokenDto tokenDto) { ResiVolunteerInfoResultDTO resultDTO = new ResiVolunteerInfoResultDTO(); // 获取用户基本信息 Result userBaseInfo = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); From ce730717011309a436629817c2c40eed4fa8b112 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Jul 2020 15:03:16 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96role=E6=97=B6=E6=B7=BB=E5=8A=A0app=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserResiInfoServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 37c52c4583..061b9148ef 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -150,8 +150,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl Date: Thu, 30 Jul 2020 15:05:58 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E9=83=A8=E7=BD=B2user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/deploy/docker-compose-dev.yml | 2 +- epmet-user/epmet-user-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index d7a3ab5278..075306db4f 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.92 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.93 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index d0ba44872e..8581bc4f18 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.92 + 0.3.93 com.epmet epmet-user From 426b339e4961f3b1c2cf034736e87cc250e10b9a Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 30 Jul 2020 15:39:09 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 4 +- .../resi/ResiActRegistrationResultDTO.java | 27 ----------- .../controller/ResiActListController.java | 4 +- .../epmet/service/ActUserRelationService.java | 5 +- .../impl/ActUserRelationServiceImpl.java | 46 ++++++++----------- 5 files changed, 26 insertions(+), 60 deletions(-) delete mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 78c341fcb4..23c6567af2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -83,9 +83,9 @@ public enum EpmetErrorCode { // 爱心互助 居民端 NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), - NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"), + // 活动报名失败,弹窗:志愿者认证 + NON_CERTIFIED_VOLUNTEER(8511, "是否认证志愿者,完成报名"), ACT_TIME_CONFLICT(8512, "报名失败。您本次报名活动时间与已报名活动时间间隔较短,为了不影响您已报名的活动,请选择其他时间的活动,谢谢。"), - ACT_REGISTRATION_SUCCESS(8513, "报名成功。"), // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java deleted file mode 100644 index 96ca7a6e61..0000000000 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.epmet.dto.result.resi; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 活动报名 - 返回值 - * - * @Auther: zhangyong - * @Date: 2020-07-28 16:22 - */ -@Data -public class ResiActRegistrationResultDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 异常编码 - */ - private Integer flag; - - /** - * 提示信息 - */ - private String tip; -} 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..73605d19a9 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 @@ -294,12 +294,12 @@ public class ResiActListController { * * @param tokenDto * @param formDTO - * @return com.epmet.commons.tools.utils.Result + * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 16:26 2020-07-28 **/ @PostMapping("registration") - public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { + public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class); return actUserRelationService.registration(tokenDto, formDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java index a290d59c5f..f77b373208 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java @@ -24,7 +24,6 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; -import com.epmet.dto.result.resi.ResiActRegistrationResultDTO; import com.epmet.entity.ActUserRelationEntity; import org.apache.ibatis.annotations.Param; @@ -146,9 +145,9 @@ public interface ActUserRelationService extends BaseService> + * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 15:54 2020-07-28 **/ - Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO); + Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO 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 3f677f0d5d..e9e675b7e4 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 @@ -39,7 +39,6 @@ import com.epmet.dto.ActUserRelationDTO; import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.dto.result.UserRoleResultDTO; -import com.epmet.dto.result.resi.ResiActRegistrationResultDTO; import com.epmet.entity.ActUserLogEntity; import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.HeartUserInfoEntity; @@ -48,6 +47,7 @@ import com.epmet.redis.ActUserRelationRedis; import com.epmet.service.ActInfoService; import com.epmet.service.ActUserLogService; import com.epmet.service.ActUserRelationService; +import com.epmet.utils.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -195,46 +195,40 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) { + public Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); boolean satisfy = false; - ResiActRegistrationResultDTO resultDTO = new ResiActRegistrationResultDTO(); + // 查询活动信息 ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId()); // >0 当前用户是志愿者 Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getUserId()); - if (actInfoDTO.getVolunteerLimit()){ - // 活动只能志愿者参加, 当前用户是否满足条件 - satisfy = this.volunteerParticipationAct(volunteerFlag); - if (!satisfy){ - logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg()); - resultDTO.setFlag(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); - resultDTO.setTip(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg()); - return new Result().ok(resultDTO); - } + if (NumConstant.ZERO < volunteerFlag){ + // 志愿者身份,可参加所有活动 + satisfy = true; } else { - // 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件 - satisfy = this.resiParticipationAct(formDTO.getUserId()); - if (!satisfy){ - logger.info(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); - resultDTO.setFlag(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); - resultDTO.setTip(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); - return new Result().ok(resultDTO); + // 如果用户不是志愿者,则需判断,当前活动 非志愿者是非可报名 + if (actInfoDTO.getVolunteerLimit()){ + // 活动只能志愿者参加, 当前用户是否满足条件 + satisfy = this.volunteerParticipationAct(volunteerFlag); + } else { + // 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件 + satisfy = this.resiParticipationAct(formDTO.getUserId()); } } if (satisfy){ // 开始报名 boolean actTimeConflict = this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag); if (!actTimeConflict){ - logger.info(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg()); - resultDTO.setFlag(EpmetErrorCode.ACT_TIME_CONFLICT.getCode()); - resultDTO.setTip(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg()); - return new Result().ok(resultDTO); + logger.info(EpmetErrorCode.ACT_TIME_CONFLICT); + throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode()); } + } else { + // 不满足,提示用户去认证志愿者 + logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER); + throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); } - resultDTO.setFlag(EpmetErrorCode.ACT_REGISTRATION_SUCCESS.getCode()); - resultDTO.setTip(EpmetErrorCode.ACT_REGISTRATION_SUCCESS.getMsg()); - return new Result().ok(resultDTO); + return new Result(); } /** From c8063455e7f46d51bbaad1871a6564a2d9d5b886 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 30 Jul 2020 15:45:51 +0800 Subject: [PATCH 6/7] =?UTF-8?q?historicalact=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/work/UserHistoricalActInfoDTO.java | 23 ++++++++++++++++++ .../service/impl/WorkActUserServiceImpl.java | 6 ++++- .../resources/mapper/ActUserRelationDao.xml | 24 +++++++++++++------ 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java index c4bbb1f100..fc921fdb7e 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java @@ -53,4 +53,27 @@ public class UserHistoricalActInfoDTO implements Serializable { * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 */ private String processFlag; + + + // 新增以下参数 + /** + * 活动状态( + 已发布/报名中:published; + 已取消:canceled; + 已结束:finished) + */ + private String actStatus; + + /** + * 当前状态(已报名/待审核auditing, + 审核通过passed, + 审核不通过refused + 取消报名canceled, + ) + */ + private String userActStatus; + /** + * true已签到、false未签到 + */ + private Boolean signInFlag; } 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 c31ad005a6..4efe296e17 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 @@ -359,7 +359,11 @@ public class WorkActUserServiceImpl implements WorkActUserService { resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum()); resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum()); //历史活动列表 - resultDTO.setActInfoList(actUserRelationDao.selectAllByUserId(formDTO.getUserId())); + List actInfoList=actUserRelationDao.selectAllByUserId(formDTO.getUserId()); + for(UserHistoricalActInfoDTO userHistoricalActInfoDTO:actInfoList){ + + } + resultDTO.setActInfoList(actInfoList); return resultDTO; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml index e6ddb723fc..343f3babd3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -138,7 +138,7 @@ From e19f4d2ae97d06ee00f88211930765a023fe5dd5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 30 Jul 2020 15:47:28 +0800 Subject: [PATCH 7/7] heart+1 --- .../epmet-heart-server/deploy/docker-compose-dev.yml | 2 +- epmet-module/epmet-heart/epmet-heart-server/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 917a45aa95..730ba2347b 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.13 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.14 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 056fdd1f99..a481eb29b8 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.13 + 0.0.14 com.epmet epmet-heart