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 59a602b124..b977a2e76f 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
@@ -76,6 +76,8 @@ public enum EpmetErrorCode {
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),
+ NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"),
+ ACT_TIME_CONFLICT(8512, "活动时间冲突"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
index ad18a98c8b..5b6859f190 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
@@ -247,4 +247,11 @@ public class ActInfoDTO implements Serializable {
*/
private String delFlag;
-}
\ No newline at end of file
+ // 虚字段
+
+ /**
+ * 用户id
+ */
+ private String userId;
+
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java
deleted file mode 100644
index fa7e943ebf..0000000000
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ActUserClockLogFormDTO.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package com.epmet.dto.form.resi;
-
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-
-/**
- * 用户活动打卡参数
- *
- * @author zhangyong
- * @since v1.0.0 2020-07-14
- */
-@Data
-public class ActUserClockLogFormDTO implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * 用户ID
- */
- private String userId;
- /**
- * 活动ID
- */
- @NotBlank(message = "活动ID不能为空")
- private String actId;
- /**
- * 打卡类型(0-打卡,1-更新打卡)
- */
- @NotBlank(message = "打卡类型不能为空")
- private String clockType;
- /**
- * 打卡位置经度
- */
- @NotBlank(message = "打卡位置经度不能为空")
- private BigDecimal clockLongitude;
- /**
- * 打卡位置纬度
- */
- @NotBlank(message = "打卡位置纬度不能为空")
- private BigDecimal clockLatitude;
- /**
- * 打卡地址
- */
- @NotBlank(message = "打卡地址不能为空")
- private String clockAddress;
- /**
- * 打卡描述
- */
- @NotBlank(message = "打卡描述不能为空")
- private String clockDesc;
- /**
- * 打卡是否有效(0-否,1-是)
- */
- @NotBlank(message = "打卡是否有效不能为空")
- private String effectiveFlag;
- /**
- * 打卡图片
- */
- private ArrayList images;
-}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java
new file mode 100644
index 0000000000..378b38e40c
--- /dev/null
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form.resi;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * 活动报名参数
+ *
+ * @author zhangyong
+ * @since v1.0.0 2020-07-20
+ */
+@Data
+public class ResiActRegistrationFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
+ /**
+ * 添加用户操作的内部异常分组
+ * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差...
+ */
+ public interface AddUserInternalGroup {}
+
+ // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
+
+ /**
+ * 用户Id
+ */
+ private String userId;
+
+ /**
+ * 活动ID
+ */
+ @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class })
+ private String actId;
+
+ /**
+ * 客户ID
+ */
+ @NotBlank(message = "客户ID不能为空", groups = { AddUserInternalGroup.class })
+ private String customerId;
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java
index a587969ca2..54363137f7 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java
@@ -21,7 +21,6 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
-import java.awt.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java
index 26b8591599..497f36f06e 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java
@@ -34,6 +34,17 @@ public class ResiVolunteerAuthenticateFormDTO implements Serializable {
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
+ /**
+ * 用户id
+ */
+ private String userId;
+
+ /**
+ * 客户id
+ */
+ @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class })
+ private String customerId;
+
/**
* 姓
*/
@@ -97,7 +108,7 @@ public class ResiVolunteerAuthenticateFormDTO implements Serializable {
* 头像
*/
@NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
- private String headImgUrl;
+ private String avatarUrl;
/**
* 志愿者签名
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
index f98f1bc474..c8e1660cd3 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetUserFeignClient.java
@@ -1,7 +1,10 @@
package com.epmet.feign;
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.form.UserRoleFormDTO;
+import com.epmet.dto.form.WxUserInfoFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.feign.fallback.EpmetUserFeignClientFallBack;
@@ -43,4 +46,15 @@ public interface EpmetUserFeignClient {
**/
@PostMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}", consumes = MediaType.APPLICATION_JSON_VALUE)
Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId);
+
+ /**
+ * 同步-居民基础信息、用户微信信息
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 14:37 2020-07-23
+ **/
+ @PostMapping("epmetuser/user/updateUserBaseAndWxUserInfo")
+ Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO formDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
index 71447cb0a6..1238fceed5 100644
--- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
+++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallBack.java
@@ -1,9 +1,10 @@
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.UserWechatDTO;
+import com.epmet.dto.form.WxUserInfoFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
@@ -28,4 +29,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result> getUserRoleInfoByUserId(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId);
}
+
+ @Override
+ public Result updateUserBaseAndWxUserInfo(WxUserInfoFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateUserBaseAndWxUserInfo", formDTO);
+ }
}
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 7231d7132a..721723b58e 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
@@ -282,4 +282,18 @@ public class ResiActListController {
return actSignInRecService.actSignIn(tokenDto, formDTO);
}
+ /**
+ * 活动报名
+ *
+ * @param tokenDto
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 16:46 2020-07-23
+ **/
+ @PostMapping("registration")
+ public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
+ return actUserRelationService.registration(tokenDto, formDTO);
+ }
+
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
index 1d4cf03f8b..802096fd8f 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
@@ -215,4 +215,14 @@ public interface ActInfoDao extends BaseDao {
* @Date 09:56 2020-07-22
**/
List selectListActContent(@Param("actId") String actId);
+
+ /**
+ * 查询当前报名的活动开始时间-结束时间,是否与其他已报名,未结束的活动,存在交集情况
+ *
+ * @param actInfoDTO
+ * @return java.lang.Integer
+ * @Author zhangyong
+ * @Date 17:17 2020-07-23
+ **/
+ Integer checkActTime(ActInfoDTO actInfoDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java
index 6e02e27e48..348a259dde 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java
@@ -51,4 +51,14 @@ public interface ActUserLogDao extends BaseDao {
* @Date 2020/7/23 14:13
**/
ActUserLogDTO selectLatestRefused(@Param("actId") String actId, @Param("userId") String userId);
-}
\ No newline at end of file
+
+ /**
+ * 查询我累计【报名过】的活动次数
+ *
+ * @param userId
+ * @return java.lang.Integer
+ * @Author zhangyong
+ * @Date 16:12 2020-07-23
+ **/
+ Integer countActTimesOfParticipation(@Param("userId") String userId);
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java
index 4a22ba2ce6..71e1fc67cd 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java
@@ -66,4 +66,14 @@ public interface HeartUserInfoDao extends BaseDao {
* @Date 18:06 2020-07-22
**/
List selectListLeaderboard(ResiActBaseFormDTO formDTO);
+
+ /**
+ * 根据用户id,修改用户信息表
+ *
+ * @param dto
+ * @return void
+ * @Author zhangyong
+ * @Date 16:27 2020-07-23
+ **/
+ void updateHeartUserInfoByUserId(HeartUserInfoDTO dto);
}
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 2d23a8d37c..5ceec37857 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
@@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.VolunteerInfoEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
/**
* 志愿者信息
@@ -29,5 +30,26 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface VolunteerInfoDao extends BaseDao {
-
-}
\ No newline at end of file
+
+ /**
+ * 查询用户是否是志愿者身份
+ * >0 是
+ * 0 不是
+ *
+ * @param userId
+ * @return java.lang.String
+ * @Author zhangyong
+ * @Date 14:33 2020-07-23l
+ **/
+ Integer queryVolunteerFlagByUserId(@Param("userId") String userId);
+
+ /**
+ * 根据用户ID,修改志愿者信息
+ *
+ * @param entity
+ * @return void
+ * @Author zhangyong
+ * @Date 15:05 2020-07-23
+ **/
+ void updateVolunteerInfoByUserId(VolunteerInfoEntity entity);
+}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java
index 6d1a11c42b..484e911fe1 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java
@@ -44,8 +44,8 @@ public class VolunteerInfoEntity extends BaseEpmetEntity {
private String userId;
/**
- * 客户id
- */
+ * 客户id
+ */
private String customerId;
/**
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java
index ec70e7e44b..4f67a60cd8 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java
@@ -26,6 +26,8 @@ import com.epmet.dto.result.resi.*;
import com.epmet.entity.ActInfoEntity;
import com.epmet.commons.tools.utils.Result;
+
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -212,4 +214,14 @@ public interface ActInfoService extends BaseService {
* @Date 13:39 2020-07-21
**/
Result rejectDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto);
+
+ /**
+ * 查询当前报名的活动开始时间-结束时间,是否与其他已报名,未结束的活动,存在交集情况
+ *
+ * @param actInfoDTO
+ * @return java.lang.Integer
+ * @Author zhangyong
+ * @Date 17:17 2020-07-23
+ **/
+ Integer checkActTime(ActInfoDTO actInfoDTO);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java
index 8edb4ef9c5..4eb8fbe83d 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java
@@ -92,4 +92,14 @@ public interface ActUserLogService extends BaseService {
* @date 2020-07-19
*/
void delete(String[] ids);
-}
\ No newline at end of file
+
+ /**
+ * 查询我累计报名过的活动次数
+ *
+ * @param userId
+ * @return java.lang.Integer
+ * @Author zhangyong
+ * @Date 16:12 2020-07-23
+ **/
+ Integer countActTimesOfParticipation(String userId);
+}
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 17d7d0c93b..f3a135ee6a 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
@@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
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.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Param;
@@ -138,4 +139,15 @@ public interface ActUserRelationService extends BaseService {
* @Date 17:42 2020-07-22
**/
Result> leaderboard(ResiActBaseFormDTO formDTO);
+
+ /**
+ * 根据用户id,修改用户信息表
+ *
+ * @param dto
+ * @return void
+ * @Author zhangyong
+ * @Date 16:27 2020-07-23
+ **/
+ void updateHeartUserInfoByUserId(HeartUserInfoDTO dto);
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
index 550e13d878..18e96e4c23 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
@@ -370,4 +370,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) {
@@ -168,4 +193,79 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl NumConstant.ZERO){
+ satisfy = true;
+ } else {
+ logger.info("活动报名失败,请先认证志愿者");
+ throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode());
+ }
+ } else {
+ // 活动不限制志愿者身份,但要求是 居民身份
+ Result> userRoleInfo = epmetUserFeignClient.getUserRoleInfoByUserId(formDTO.getUserId());
+ for (UserRoleResultDTO roleResultDTO :userRoleInfo.getData()){
+ if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleResultDTO.getRoleKey())){
+ satisfy = true;
+ }
+ }
+ if (!satisfy){
+ logger.info("活动报名失败,请完善居民信息");
+ throw new RenException(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
+ }
+ }
+ if (satisfy){
+ this.actStartSignUp(actInfoDTO, formDTO);
+ }
+ return new Result();
+ }
+
+ private void actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO){
+ boolean signUp = true;
+ Integer auditingNum = actUserLogService.countActTimesOfParticipation(formDTO.getUserId());
+ if (auditingNum > NumConstant.ZERO){
+ // 2.判断本次报名的活动与之前未结束的活动报名时间 是否产生交集,产生则 报名失败
+ actInfoDTO.setUserId(formDTO.getUserId());
+ Integer actTimeFlag = actInfoService.checkActTime(actInfoDTO);
+ if (actTimeFlag > NumConstant.ZERO){
+ signUp = false;
+ logger.info("活动报名失败,活动时间冲突");
+ throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
+ }
+ } else {
+ // 3.第一次报名
+ HeartUserInfoEntity entity = new HeartUserInfoEntity();
+ entity.setCustomerId(formDTO.getCustomerId());
+ entity.setUserId(formDTO.getUserId());
+ entity.setVolunteerFlag(true);
+ entity.setKindnessTime(NumConstant.ZERO);
+ entity.setParticipationNum(NumConstant.ZERO);
+ entity.setObtainPointNum(NumConstant.ZERO);
+ heartUserInfoDao.insert(entity);
+ }
+ if (signUp){
+ // 4.插入用户活动关系表
+ ActUserRelationEntity entity = new ActUserRelationEntity();
+ entity.setActId(formDTO.getActId());
+ entity.setUserId(formDTO.getUserId());
+ entity.setStatus(ActUserRelationStatusConstant.AUDITING);
+ baseDao.insert(entity);
+
+ // 5.插入活动日志表
+ ActUserLogEntity userLogEntity = new ActUserLogEntity();
+ userLogEntity.setActId(formDTO.getActId());
+ userLogEntity.setUserId(formDTO.getUserId());
+ userLogEntity.setOperationType(ActUserRelationStatusConstant.AUDITING);
+ actUserLogService.insert(userLogEntity);
+ }
+ }
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java
index 72e98f3ab0..fead42e055 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java
@@ -150,4 +150,9 @@ public class HeartUserInfoServiceImpl extends BaseServiceImpl>().ok(resultDTOS);
}
+
+ @Override
+ public void updateHeartUserInfoByUserId(HeartUserInfoDTO dto) {
+ baseDao.updateHeartUserInfoByUserId(dto);
+ }
}
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 88dd354a4c..84e78622c8 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
@@ -20,16 +20,21 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
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.entity.VolunteerInfoEntity;
+import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.redis.VolunteerInfoRedis;
+import com.epmet.service.HeartUserInfoService;
import com.epmet.service.VolunteerInfoService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,19 +57,33 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl NumConstant.ZERO){
+ // 是志愿者:更新志愿者信息表
+ baseDao.updateVolunteerInfoByUserId(volunteerInfoEntity);
+ } else {
+ // 不是志愿者:插入志愿者信息表
+ baseDao.insert(volunteerInfoEntity);
+ // 更新用户信息表的 是否是志愿者标识
+ HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO();
+ userInfoDTO.setUserId(tokenDto.getUserId());
+ userInfoDTO.setVolunteerFlag(true);
+ heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO);
+ }
+ // 更新用户基础信息表 并 更新用户微信表
+ WxUserInfoFormDTO wxUserInfoFormDTO = ConvertUtils.sourceToTarget(formDTO, WxUserInfoFormDTO.class);
+ return epmetUserFeignClient.updateUserBaseAndWxUserInfo(wxUserInfoFormDTO);
}
}
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
index 4b50ae3bd4..2680e43176 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
@@ -444,4 +444,17 @@
AND c.ACT_ID = #{actId}
ORDER BY c.ORDER_NUM ASC
+
+
+
+ SELECT
+ COUNT(1)
+ FROM act_info
+ WHERE DEL_FLAG = '0'
+ AND USER_ID = #{userId}
+ AND ACT_STATUS = 'published'
+ AND ((#{actStartTime} BETWEEN ACT_START_TIME AND ACT_END_TIME OR #{actEndTime} BETWEEN ACT_START_TIME AND ACT_END_TIME)
+ or (ACT_START_TIME BETWEEN #{actStartTime} AND #{actEndTime} OR ACT_END_TIME BETWEEN #{actStartTime} AND #{actEndTime}));
+
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml
index 5df946833d..ed56feda4b 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml
@@ -42,4 +42,14 @@
order by acl.CREATED_TIME desc
limit 1
-
\ No newline at end of file
+
+
+
+ SELECT
+ COUNT(1)
+ FROM act_user_log
+ WHERE DEL_FLAG = '0'
+ AND USER_ID = #{userId}
+ AND OPERATION_TYPE = 'auditing'
+
+
diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml
index 1c4fdba03f..107007c2dc 100644
--- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml
+++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml
@@ -55,4 +55,27 @@
ORDER BY ui.KINDNESS_TIME DESC, ui.PARTICIPATION_NUM DESC
LIMIT #{pageNo}, #{pageSize}
+
+
+ UPDATE heart_user_info
+ SET
+
+ VOLUNTEER_FLAG = 1,
+
+
+ KINDNESS_TIME = #{kindnessTime},
+
+
+ PARTICIPATION_NUM = #{participationNum},
+
+
+ OBTAIN_POINT_NUM = #{obtainPointNum},
+
+
+ UPDATED_BY = #{userId},
+
+ UPDATED_TIME = now()
+ WHERE DEL_FLAG = '0'
+ AND USER_ID = #{userId}
+
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 48854253bb..3555334a07 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
@@ -17,5 +17,31 @@
+
+ SELECT
+ count(1)
+ FROM volunteer_info
+ WHERE DEL_FLAG = '0'
+ AND USER_ID = #{userId}
+
-
\ No newline at end of file
+
+ UPDATE volunteer_info
+ SET
+
+ CUSTOMER_ID = #{customerId},
+
+
+ VOLUNTEER_INTRODUCE = #{volunteerIntroduce},
+
+
+ VOLUNTEER_SIGNATURE = #{volunteerSignature},
+
+
+ UPDATED_BY = #{userId},
+
+ UPDATED_TIME = now()
+ WHERE DEL_FLAG = '0'
+ AND USER_ID = #{userId}
+
+
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
index 9c0f40c8ef..3d028bdfe7 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java
@@ -132,4 +132,18 @@ public class UserController {
return new Result().ok(userService.saveWxUser(formDTO));
}
+ /**
+ * 居民端个人信息-同步用户微信信息
+ * 供Feign调用
+ *
+ * @param wxUserInfoFormDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author zhangyong
+ * @Date 14:51 2020-07-23
+ **/
+ @PostMapping("updateUserBaseAndWxUserInfo")
+ public Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { ;
+ ValidatorUtils.validateEntity(wxUserInfoFormDTO);
+ return userService.updateWxUserInfo(wxUserInfoFormDTO);
+ }
}