Browse Source

王公峰:活动报名

feature/dangjian
wanggongfeng 6 years ago
parent
commit
2a368b7e04
  1. 52
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActInfoController.java
  2. 28
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java
  3. 20
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java
  4. 31
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java
  5. 37
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java
  6. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  7. 137
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java
  8. 93
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java
  9. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java
  10. 40
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java
  11. 111
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java
  12. 95
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java
  13. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java
  14. 106
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  15. 110
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  16. 36
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
  17. 1
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java
  18. 6
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java

52
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActInfoController.java

@ -0,0 +1,52 @@
package com.elink.esua.epdc.controller;
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.service.ActInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 用户模块
*
* @author yujintao
* @email yujintao@elink-cn.comuser/completeInfo
* @date 2019/9/6 19:30
*/
@RestController
@RequestMapping("heart")
public class ApiActInfoController {
@Autowired
private ActInfoService heartActivityService;
/**
* 活动报名
*
* @param tokenDto
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author wanggongfeng
* @date 2019/12/13 14:41
*/
@PostMapping("act/signup")
public Result activitySignUp(@LoginUser TokenDto tokenDto, @PathVariable("actId") String actId) {
ValidatorUtils.validateEntity(actId);
String userId = tokenDto.getUserId();
Result result = heartActivityService.isSignUp(userId, actId);
if((int)result.getData() == 0){
//未报名
heartActivityService.activitySignUp(tokenDto);
}
return null;
}
}

28
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java

@ -0,0 +1,28 @@
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.feign.fallback.ActInfoFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
/**
*
* 社群-话题模块调用
*
* @Authorliuchuang
* @Date2019/11/6 15:36
*/
@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = ActInfoFeignClientFallback.class)
public interface ActInfoFeignClient {
/**
* 获取党员详情已认证或未认证的党员用户
*
* @param userId
* @return
*/
@GetMapping("heart/actuserrelation/isSignUp/{userId}/{actId}")
Result isSignUp(@PathVariable("userId") String userId,@PathVariable("actId") String actId);
}

20
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java

@ -0,0 +1,20 @@
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.feign.ActInfoFeignClient;
import org.springframework.stereotype.Component;
/**
* @Authorwanggongfeng
* @Date2019/12/16 15:11
*/
@Component
public class ActInfoFeignClientFallback implements ActInfoFeignClient {
@Override
public Result isSignUp(String userId,String actId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "isSignUp", userId,actId);
}
}

31
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java

@ -0,0 +1,31 @@
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.utils.Result;
/**
* @author wanggongfeng
* @date 2019/9/7 9:50
*/
public interface ActInfoService {
/**
* 是否报名
* @param userId
* @param actId
* @Author wanggongfeng
* @return
*/
Result isSignUp(String userId, String actId);
/**
* 活动报名
* @param tokenDto
* @Author wanggongeng
* @return
*/
Result activitySignUp(TokenDto tokenDto);
}

37
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java

@ -0,0 +1,37 @@
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.feign.ActInfoFeignClient;
import com.elink.esua.epdc.service.ActInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author yujintao
* @email yujintao@elink-cn.com
* @date 2019/9/7 9:50
*/
@Slf4j
@Service
public class ActInfoServiceImpl implements ActInfoService {
@Autowired
private ActInfoFeignClient actInfoFeignClient;
@Override
public Result isSignUp(String userId, String actId) {
Result<Integer> dataResult = actInfoFeignClient.isSignUp(userId,actId);
return dataResult;
}
@Override
public Result activitySignUp(TokenDto tokenDto) {
//Result<Integer> dataResult = actInfoFeignClient.activitySignUp(tokenDto);
return null;
}
}

9
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java

@ -1046,6 +1046,15 @@ public class AppUserServiceImpl implements AppUserService {
return result;
}
/**
* 志愿者认证
*
* @param tokenDto
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author wanggongfeng
* @date 2019/12/13 14:41
*/
@Override
public Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto) {
Boolean isVolunteer = true;

137
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java

@ -0,0 +1,137 @@
/**
* 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.elink.esua.epdc.activity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
public class ActUserRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动ID
*/
private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String faceImg;
/**
* 党员标识0-1-
*/
private String partyFlag;
/**
* 报名人真实姓名
*/
private String realName;
/**
* 性别(0-1-)
*/
private String sex;
/**
* 年龄
*/
private Integer age;
/**
* 联系电话
*/
private String mobile;
/**
* 身份证号
*/
private String identityNo;
/**
* 当前状态0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String status;
/**
* 未通过原因仅当未通过时录入并读取
*/
private String failureReason;
/**
* 审核时间
*/
private Date auditTime;
/**
* 报名时间
*/
private Date signupTime;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

93
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java

@ -0,0 +1,93 @@
/**
* 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.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.modules.activity.excel.ActUserRelationExcel;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@RestController
@RequestMapping("actuserrelation")
public class ActUserRelationController {
@Autowired
private ActUserRelationService actUserRelationService;
@GetMapping("page")
public Result<PageData<ActUserRelationDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActUserRelationDTO> page = actUserRelationService.page(params);
return new Result<PageData<ActUserRelationDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ActUserRelationDTO> get(@PathVariable("id") String id){
ActUserRelationDTO data = actUserRelationService.get(id);
return new Result<ActUserRelationDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ActUserRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actUserRelationService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActUserRelationDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
actUserRelationService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
actUserRelationService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ActUserRelationDTO> list = actUserRelationService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActUserRelationExcel.class);
}
}

47
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java

@ -0,0 +1,47 @@
/**
* 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.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 用户活动关系表
*
* @author wanggongfeng
* @since v1.0.0 2019-12-16
*/
@RestController
@RequestMapping("actuserrelation")
public class AppActUserRelationController {
@Autowired
private ActUserRelationService actUserRelationService;
@GetMapping("isSignUp/{userId}/{actId}")
public Result isSignUp(@PathVariable("userId") String userId,@PathVariable("actId") String actId){
int data = actUserRelationService.isSignUp(userId,actId);
return new Result().ok(data);
}
}

40
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java

@ -0,0 +1,40 @@
/**
* 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.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Mapper
public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
/**
* 查询用户是否已报名活动
* @param userId
* @param actId
* @return
*/
int isSignUp(@Param("userId")String userId, @Param("actId")String actId);
}

111
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java

@ -0,0 +1,111 @@
/**
* 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.elink.esua.epdc.modules.activity.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_act_user_relation")
public class ActUserRelationEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 活动ID
*/
private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String faceImg;
/**
* 党员标识0-1-
*/
private String partyFlag;
/**
* 报名人真实姓名
*/
private String realName;
/**
* 性别(0-1-)
*/
private String sex;
/**
* 年龄
*/
private Integer age;
/**
* 联系电话
*/
private String mobile;
/**
* 身份证号
*/
private String identityNo;
/**
* 当前状态0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String status;
/**
* 未通过原因仅当未通过时录入并读取
*/
private String failureReason;
/**
* 审核时间
*/
private Date auditTime;
/**
* 报名时间
*/
private Date signupTime;
}

95
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java

@ -0,0 +1,95 @@
/**
* 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.elink.esua.epdc.modules.activity.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
public class ActUserRelationExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "活动ID")
private String actId;
@Excel(name = "用户ID")
private String userId;
@Excel(name = "用户昵称")
private String nickname;
@Excel(name = "用户头像")
private String faceImg;
@Excel(name = "党员标识(0-否,1-是)")
private String partyFlag;
@Excel(name = "报名人真实姓名")
private String realName;
@Excel(name = "性别(0-女,1-男)")
private String sex;
@Excel(name = "年龄")
private Integer age;
@Excel(name = "联系电话")
private String mobile;
@Excel(name = "身份证号")
private String identityNo;
@Excel(name = "当前状态(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)")
private String status;
@Excel(name = "未通过原因(仅当未通过时录入,并读取)")
private String failureReason;
@Excel(name = "审核时间")
private Date auditTime;
@Excel(name = "报名时间")
private Date signupTime;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java

@ -0,0 +1,47 @@
/**
* 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.elink.esua.epdc.modules.activity.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Component
public class ActUserRelationRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

106
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java

@ -0,0 +1,106 @@
/**
* 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.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import java.util.List;
import java.util.Map;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
public interface ActUserRelationService extends BaseService<ActUserRelationEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ActUserRelationDTO>
* @author generator
* @date 2019-12-16
*/
PageData<ActUserRelationDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ActUserRelationDTO>
* @author generator
* @date 2019-12-16
*/
List<ActUserRelationDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ActUserRelationDTO
* @author generator
* @date 2019-12-16
*/
ActUserRelationDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2019-12-16
*/
void save(ActUserRelationDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2019-12-16
*/
void update(ActUserRelationDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2019-12-16
*/
void delete(String[] ids);
/**
* 单条查询
*
* @param userId 人员ID
* @param actId 活动ID
* @return ActInfoDTO
* @author wanggongfeng
* @date 2019-12-16
*/
int isSignUp(String userId,String actId);
}

110
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java

@ -0,0 +1,110 @@
/**
* 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.elink.esua.epdc.modules.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import com.elink.esua.epdc.modules.activity.redis.ActUserRelationRedis;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Service
public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationDao, ActUserRelationEntity> implements ActUserRelationService {
@Autowired
private ActUserRelationRedis actUserRelationRedis;
@Override
public PageData<ActUserRelationDTO> page(Map<String, Object> params) {
IPage<ActUserRelationEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ActUserRelationDTO.class);
}
@Override
public List<ActUserRelationDTO> list(Map<String, Object> params) {
List<ActUserRelationEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ActUserRelationDTO.class);
}
private QueryWrapper<ActUserRelationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ActUserRelationEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ActUserRelationDTO get(String id) {
ActUserRelationEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActUserRelationDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActUserRelationDTO dto) {
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActUserRelationDTO dto) {
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public int isSignUp(String userId,String actId) {
int data = baseDao.isSignUp(userId,actId);
return data;
}
}

36
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao">
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity" id="actUserRelationMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="userId" column="USER_ID"/>
<result property="nickname" column="NICKNAME"/>
<result property="faceImg" column="FACE_IMG"/>
<result property="partyFlag" column="PARTY_FLAG"/>
<result property="realName" column="REAL_NAME"/>
<result property="sex" column="SEX"/>
<result property="age" column="AGE"/>
<result property="mobile" column="MOBILE"/>
<result property="identityNo" column="IDENTITY_NO"/>
<result property="status" column="STATUS"/>
<result property="failureReason" column="FAILURE_REASON"/>
<result property="auditTime" column="AUDIT_TIME"/>
<result property="signupTime" column="SIGNUP_TIME"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="isSignUp" resultType="int" parameterType="String">
select count(*) countNum from epdc_act_user_relation where USER_ID = #{userId}
and ACT_ID = #{actId}
and status not in ('3' ,'4')
</select>
</mapper>

1
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java

@ -39,6 +39,7 @@ public class EpdcAppVolunteerInfoController {
/**
* 插入一条志愿者数据
* @param epdcCompleteVolunteerInfoFormDTO
* @author wanggongfeng
* @return
*/
@GetMapping("insertVolunteerInfo")

6
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java

@ -145,5 +145,11 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
*/
Result<Integer> getVolunteerCountById(String userId);
/**
* 插入一条志愿者数据
* @param epdcCompleteVolunteerInfoFormDTO
* @author wanggongfeng
* @return
*/
Result<Integer> insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO);
}
Loading…
Cancel
Save