diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActInfoController.java new file mode 100644 index 000000000..1c1562f95 --- /dev/null +++ b/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; + + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ActInfoFeignClient.java new file mode 100644 index 000000000..6cb3155c8 --- /dev/null +++ b/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; + +/** + * + * 社群-话题模块调用 + * + * @Author:liuchuang + * @Date:2019/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); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ActInfoFeignClientFallback.java new file mode 100644 index 000000000..cd8218cf5 --- /dev/null +++ b/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; + +/** + * @Author:wanggongfeng + * @Date:2019/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); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActInfoService.java new file mode 100644 index 000000000..b4af87f3e --- /dev/null +++ b/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); + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActInfoServiceImpl.java new file mode 100644 index 000000000..f8cd2ed91 --- /dev/null +++ b/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 dataResult = actInfoFeignClient.isSignUp(userId,actId); + return dataResult; + } + + @Override + public Result activitySignUp(TokenDto tokenDto) { + //Result dataResult = actInfoFeignClient.activitySignUp(tokenDto); + return null; + } + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index de01a201f..e6d238fff 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/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; diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserRelationDTO.java new file mode 100644 index 000000000..e365873d9 --- /dev/null +++ b/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 + *

+ * 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.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; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java new file mode 100644 index 000000000..6de4355eb --- /dev/null +++ b/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 + *

+ * 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.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> page(@RequestParam Map params){ + PageData page = actUserRelationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ActUserRelationDTO data = actUserRelationService.get(id); + return new Result().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 params, HttpServletResponse response) throws Exception { + List list = actUserRelationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ActUserRelationExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java new file mode 100644 index 000000000..fa9d25419 --- /dev/null +++ b/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 + *

+ * 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.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); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java new file mode 100644 index 000000000..169e3cb1e --- /dev/null +++ b/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 + *

+ * 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.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 { + /** + * 查询用户是否已报名活动 + * @param userId + * @param actId + * @return + */ + int isSignUp(@Param("userId")String userId, @Param("actId")String actId); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserRelationEntity.java new file mode 100644 index 000000000..751a2c228 --- /dev/null +++ b/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 + *

+ * 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.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; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserRelationExcel.java new file mode 100644 index 000000000..89fd60f88 --- /dev/null +++ b/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 + *

+ * 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.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; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserRelationRedis.java new file mode 100644 index 000000000..e013353ff --- /dev/null +++ b/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 + *

+ * 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.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; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java new file mode 100644 index 000000000..94d6cdb24 --- /dev/null +++ b/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 + *

+ * 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.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 { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-12-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-12-16 + */ + List list(Map 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); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 000000000..0ad66994c --- /dev/null +++ b/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 + *

+ * 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.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 implements ActUserRelationService { + + @Autowired + private ActUserRelationRedis actUserRelationRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper 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; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml new file mode 100644 index 000000000..ae2f726b6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java index 1c1a2890e..783f14260 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppVolunteerInfoController.java +++ b/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") diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java index 3de549008..78614bad2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java +++ b/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 { */ Result getVolunteerCountById(String userId); + /** + * 插入一条志愿者数据 + * @param epdcCompleteVolunteerInfoFormDTO + * @author wanggongfeng + * @return + */ Result insertVolunteerInfo(EpdcCompleteVolunteerInfoFormDTO epdcCompleteVolunteerInfoFormDTO); } \ No newline at end of file