Browse Source

Merge remote-tracking branch 'origin/dev_heart' into dev_heart

feature/dangjian
尹作梅 6 years ago
parent
commit
dfff7dd580
  1. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  2. 92
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java
  3. 94
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserLogController.java
  4. 33
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserLogDao.java
  5. 66
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserLogEntity.java
  6. 68
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserLogExcel.java
  7. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserLogRedis.java
  8. 95
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.java
  9. 104
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserLogServiceImpl.java
  10. 15
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  11. 21
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml
  12. 16
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java
  13. 1
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java
  14. 9
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java
  15. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java
  16. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java

@ -226,6 +226,14 @@ public interface AppUserService {
*/ */
Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto); Result volunteerAuthenticate(TokenDto tokenDto, EpdcCompleteVolunteerInfoFormDTO formDto);
/**
* 验证是否为志愿者
*
* @param tokenDto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author wanggongfeng
* @date 2019/12/13 14:41
*/
Result getVolunteerCountById(TokenDto tokenDto); Result getVolunteerCountById(TokenDto tokenDto);
} }

92
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserLogDTO.java

@ -0,0 +1,92 @@
/**
* 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 ActUserLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动ID
*/
private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 操作类别0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String operationType;
/**
* 审核不通过的原因
*/
private String failureReason;
/**
* 操作时间
*/
private Date operationTime;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

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

@ -0,0 +1,94 @@
/**
* 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.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.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.activity.ActUserLogDTO;
import com.elink.esua.epdc.modules.activity.excel.ActUserLogExcel;
import com.elink.esua.epdc.modules.activity.service.ActUserLogService;
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("actuserlog")
public class ActUserLogController {
@Autowired
private ActUserLogService actUserLogService;
@GetMapping("page")
public Result<PageData<ActUserLogDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActUserLogDTO> page = actUserLogService.page(params);
return new Result<PageData<ActUserLogDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ActUserLogDTO> get(@PathVariable("id") String id){
ActUserLogDTO data = actUserLogService.get(id);
return new Result<ActUserLogDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ActUserLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actUserLogService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActUserLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
actUserLogService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
actUserLogService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ActUserLogDTO> list = actUserLogService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActUserLogExcel.class);
}
}

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

@ -0,0 +1,33 @@
/**
* 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.ActUserLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户活动日志表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Mapper
public interface ActUserLogDao extends BaseDao<ActUserLogEntity> {
}

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

@ -0,0 +1,66 @@
/**
* 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_log")
public class ActUserLogEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 活动ID
*/
private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 操作类别0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String operationType;
/**
* 审核不通过的原因
*/
private String failureReason;
/**
* 操作时间
*/
private Date operationTime;
}

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

@ -0,0 +1,68 @@
/**
* 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 ActUserLogExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "活动ID")
private String actId;
@Excel(name = "用户ID")
private String userId;
@Excel(name = "操作类别(0-报名,1-审核通过,2-打卡,3-取消报名,4-审核不通过)")
private String operationType;
@Excel(name = "审核不通过的原因")
private String failureReason;
@Excel(name = "操作时间")
private Date operationTime;
@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/ActUserLogRedis.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 ActUserLogRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

95
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserLogService.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.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.ActUserLogDTO;
import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity;
import java.util.List;
import java.util.Map;
/**
* 用户活动日志表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
public interface ActUserLogService extends BaseService<ActUserLogEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ActUserLogDTO>
* @author generator
* @date 2019-12-16
*/
PageData<ActUserLogDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ActUserLogDTO>
* @author generator
* @date 2019-12-16
*/
List<ActUserLogDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ActUserLogDTO
* @author generator
* @date 2019-12-16
*/
ActUserLogDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2019-12-16
*/
void save(ActUserLogDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2019-12-16
*/
void update(ActUserLogDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2019-12-16
*/
void delete(String[] ids);
}

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

@ -0,0 +1,104 @@
/**
* 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.ActUserLogDao;
import com.elink.esua.epdc.activity.ActUserLogDTO;
import com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity;
import com.elink.esua.epdc.modules.activity.redis.ActUserLogRedis;
import com.elink.esua.epdc.modules.activity.service.ActUserLogService;
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 ActUserLogServiceImpl extends BaseServiceImpl<ActUserLogDao, ActUserLogEntity> implements ActUserLogService {
@Autowired
private ActUserLogRedis actUserLogRedis;
@Override
public PageData<ActUserLogDTO> page(Map<String, Object> params) {
IPage<ActUserLogEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ActUserLogDTO.class);
}
@Override
public List<ActUserLogDTO> list(Map<String, Object> params) {
List<ActUserLogEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ActUserLogDTO.class);
}
private QueryWrapper<ActUserLogEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ActUserLogEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ActUserLogDTO get(String id) {
ActUserLogEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActUserLogDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActUserLogDTO dto) {
ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActUserLogDTO dto) {
ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActUserLogDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
@ -27,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao; import com.elink.esua.epdc.modules.activity.dao.ActUserRelationDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; 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.redis.ActUserRelationRedis;
import com.elink.esua.epdc.modules.activity.service.ActUserLogService;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService; import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -34,6 +36,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -49,6 +52,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Autowired @Autowired
private ActUserRelationRedis actUserRelationRedis; private ActUserRelationRedis actUserRelationRedis;
@Autowired
private ActUserLogService actUserLogService;
@Override @Override
public PageData<ActUserRelationDTO> page(Map<String, Object> params) { public PageData<ActUserRelationDTO> page(Map<String, Object> params) {
IPage<ActUserRelationEntity> page = baseDao.selectPage( IPage<ActUserRelationEntity> page = baseDao.selectPage(
@ -108,8 +114,17 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
int data = baseDao.isSignUp(actUserRelationDTO.getUserId(),actUserRelationDTO.getActId()); int data = baseDao.isSignUp(actUserRelationDTO.getUserId(),actUserRelationDTO.getActId());
if(data == 0){ if(data == 0){
//未报名该活动,进行报名 //未报名该活动,进行报名
//存储活动人员关系表
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class); ActUserRelationEntity entity = ConvertUtils.sourceToTarget(actUserRelationDTO, ActUserRelationEntity.class);
insert(entity); insert(entity);
//存储活动日志表
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setActId(actUserRelationDTO.getActId());
actUserLogDTO.setUserId(actUserRelationDTO.getUserId());
actUserLogDTO.setOperationType("0");
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
}else{ }else{
return "已报名"; return "已报名";
} }

21
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserLogDao.xml

@ -0,0 +1,21 @@
<?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.ActUserLogDao">
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActUserLogEntity" id="actUserLogMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="userId" column="USER_ID"/>
<result property="operationType" column="OPERATION_TYPE"/>
<result property="failureReason" column="FAILURE_REASON"/>
<result property="operationTime" column="OPERATION_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>
</mapper>

16
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java

@ -354,20 +354,6 @@ public class EpdcAppUserController {
return userService.getUserLastSwitchGird(openId); return userService.getUserLastSwitchGird(openId);
} }
/**
* 根据用户id 进行志愿者认证
* @param userId
* @author wanggongfeng
* @return
*/
@GetMapping("getVolunteerCountById/{userId}")
public Result<Integer> getVolunteerCountById(@PathVariable("userId") String userId) {
return userService.getVolunteerCountById(userId);
}
/*@GetMapping("insertVolunteerInfo")
public Result<Integer> insertVolunteerInfo(@RequestBody TokenDto tokenDto, @RequestBody EpdcCompleteUserInfoFormDTO formDto) {
//return userService.insertVolunteerInfo(fromDto);
return null;
}*/
} }

1
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java

@ -157,5 +157,4 @@ public interface UserDao extends BaseDao<UserEntity> {
**/ **/
List<EpdcWorkUserResultDTO> selectPartyAuthenticationFailedList(EpdcWorkUserFromDTO workUserFromDto); List<EpdcWorkUserResultDTO> selectPartyAuthenticationFailedList(EpdcWorkUserFromDTO workUserFromDto);
int getVolunteerCountById(@Param("userId") String userId);
} }

9
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java

@ -268,12 +268,5 @@ public interface UserService extends BaseService<UserEntity> {
**/ **/
Result handleUserPoints(EpdcUserPointsFormDTO formDTO); Result handleUserPoints(EpdcUserPointsFormDTO formDTO);
/**
* 根据用户id 进行志愿者认证
* @param userId
* @author wanggongfeng
* @return
* @Date 2019/12/13 16:39
*/
Result<Integer> getVolunteerCountById(String userId);
} }

5
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

@ -806,10 +806,5 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return ConvertUtils.sourceToTarget(userEntity, UserDTO.class); return ConvertUtils.sourceToTarget(userEntity, UserDTO.class);
} }
@Override
public Result<Integer> getVolunteerCountById(String userId) {
return new Result<Integer>().ok(baseDao.getVolunteerCountById(userId));
}
} }

4
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml

@ -352,8 +352,6 @@
LIMIT #{pageIndex},#{pageSize} LIMIT #{pageIndex},#{pageSize}
</select> </select>
<select id="getVolunteerCountById" resultType="Integer">
SELECT IFNULL(count(*),0) count FROM `epdc_volunteer_info` where del_flag = '0' and id = #{id}
</select>
</mapper> </mapper>

Loading…
Cancel
Save