From a9bbcd5726d6409c8257113bba2e77028de91ade Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 30 Jul 2020 17:09:51 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=8A=B6=E6=80=81SQL?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/ActInfoDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 75d62f1059..957e8f9dfb 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 @@ -142,7 +142,7 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'in_progress' AS actCurrentState, -- 活动状态:进行中 - IF(u.USER_ID = #{userId},'1','0') as signupFlag -- 用户报名状态(0-未报名,1已报名) + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID @@ -168,7 +168,7 @@ i.ACT_QUOTA actQuota, IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 'finished' AS actCurrentState, -- 活动状态:已结束 - IF(u.USER_ID = #{userId},'1','0') as signupFlag -- 用户报名状态(0-未报名,1已报名) + IF(u.USER_ID = #{userId},'signed_up','no_signed_up') as signupFlag FROM act_info i LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` = 'passed' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID From 910a7e8d791c545eb3808bc0b89dcaf787073e93 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 30 Jul 2020 17:20:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/ResiActRegistrationResultDTO.java | 45 +++++++++++++++++++ .../controller/ResiActListController.java | 4 +- .../epmet/service/ActUserRelationService.java | 7 +-- .../impl/ActUserRelationServiceImpl.java | 13 ++++-- 4 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java 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 new file mode 100644 index 0000000000..14e8cbd9b3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java @@ -0,0 +1,45 @@ +/** + * 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.result.resi; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@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 73605d19a9..046a2c6854 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 f77b373208..91ec9355da 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,6 +24,7 @@ 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; @@ -145,9 +146,9 @@ public interface ActUserRelationService extends BaseService * @Author zhangyong - * @Date 15:54 2020-07-28 + * @Date 17:14 2020-07-30 **/ - 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 e9e675b7e4..f8c48c27a5 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,6 +39,7 @@ 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; @@ -195,7 +196,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) { formDTO.setUserId(tokenDto.getUserId()); boolean satisfy = false; @@ -221,12 +222,18 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl().ok(dto); } } else { // 不满足,提示用户去认证志愿者 logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER); - throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); + ResiActRegistrationResultDTO dto = new ResiActRegistrationResultDTO(); + dto.setFlag(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); + dto.setTip(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getMsg()); + return new Result().ok(dto); } return new Result(); } From f934c7c319fee9f26d45426c1f7a0718fc95f4fb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 30 Jul 2020 17:39:29 +0800 Subject: [PATCH 3/3] 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 54f4d3a219..df911d5ab5 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.17 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.18 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 e551f4bc82..af9cf135ba 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.17 + 0.0.18 com.epmet epmet-heart