Browse Source

Merge remote-tracking branch 'remotes/origin/dev' into release

master
jianjun 5 years ago
parent
commit
477d451010
  1. 45
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRegistrationResultDTO.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  4. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java
  5. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java
  6. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java
  7. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

45
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
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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;
}

2
epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services: services:
epmet-heart-server: epmet-heart-server:
container_name: epmet-heart-server-dev 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: ports:
- "8111:8111" - "8111:8111"
network_mode: host # 使用现有网络 network_mode: host # 使用现有网络

2
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.0.17</version> <version>0.0.18</version>
<parent> <parent>
<groupId>com.epmet</groupId> <groupId>com.epmet</groupId>
<artifactId>epmet-heart</artifactId> <artifactId>epmet-heart</artifactId>

4
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 tokenDto
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActRegistrationResultDTO>
* @Author zhangyong * @Author zhangyong
* @Date 16:26 2020-07-28 * @Date 16:26 2020-07-28
**/ **/
@PostMapping("registration") @PostMapping("registration")
public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { public Result<ResiActRegistrationResultDTO> registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class);
return actUserRelationService.registration(tokenDto, formDTO); return actUserRelationService.registration(tokenDto, formDTO);
} }

7
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.ActUserRelationDTO;
import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; import com.epmet.dto.form.resi.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -145,9 +146,9 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
* *
* @param tokenDto * @param tokenDto
* @param formDTO * @param formDTO
* @return com.epmet.commons.tools.utils.Result * @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.resi.ResiActRegistrationResultDTO>
* @Author zhangyong * @Author zhangyong
* @Date 15:54 2020-07-28 * @Date 17:14 2020-07-30
**/ **/
Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO); Result<ResiActRegistrationResultDTO> registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO);
} }

13
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.ResiActRegistrationFormDTO;
import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO;
import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.dto.result.resi.ResiActRegistrationResultDTO;
import com.epmet.entity.ActUserLogEntity; import com.epmet.entity.ActUserLogEntity;
import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.ActUserRelationEntity;
import com.epmet.entity.HeartUserInfoEntity; import com.epmet.entity.HeartUserInfoEntity;
@ -195,7 +196,7 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) { public Result<ResiActRegistrationResultDTO> registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
boolean satisfy = false; boolean satisfy = false;
@ -221,12 +222,18 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
boolean actTimeConflict = this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag); boolean actTimeConflict = this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag);
if (!actTimeConflict){ if (!actTimeConflict){
logger.info(EpmetErrorCode.ACT_TIME_CONFLICT); logger.info(EpmetErrorCode.ACT_TIME_CONFLICT);
throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode()); ResiActRegistrationResultDTO dto = new ResiActRegistrationResultDTO();
dto.setFlag(EpmetErrorCode.ACT_TIME_CONFLICT.getCode());
dto.setTip(EpmetErrorCode.ACT_TIME_CONFLICT.getMsg());
return new Result<ResiActRegistrationResultDTO>().ok(dto);
} }
} else { } else {
// 不满足,提示用户去认证志愿者 // 不满足,提示用户去认证志愿者
logger.info(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER); 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<ResiActRegistrationResultDTO>().ok(dto);
} }
return new Result(); return new Result();
} }

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -142,7 +142,7 @@
i.ACT_QUOTA actQuota, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'in_progress' AS actCurrentState, -- 活动状态:进行中 '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 FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' 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 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, i.ACT_QUOTA actQuota,
IFNULL(c.signupNum, 0) signupNum, -- 已报名人数 IFNULL(c.signupNum, 0) signupNum, -- 已报名人数
'finished' AS actCurrentState, -- 活动状态:已结束 '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 FROM act_info i
LEFT JOIN act_user_relation u ON i.ID = u.ACT_ID AND U.DEL_FLAG = '0' 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 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

Loading…
Cancel
Save