Browse Source

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

feature/dangjian
李鹏飞 6 years ago
parent
commit
74c52b1304
  1. 87
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/role/EvaluateRoleDTO.java
  2. 94
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateRoleController.java
  3. 33
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateRoleDao.java
  4. 53
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateRoleEntity.java
  5. 65
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateRoleExcel.java
  6. 47
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/redis/EvaluateRoleRedis.java
  7. 95
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateRoleService.java
  8. 104
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateRoleServiceImpl.java
  9. 20
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/evaluate/EvaluateRoleDao.xml
  10. 11
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java
  11. 20
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java
  12. 14
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  13. 10
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
  14. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

87
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/role/EvaluateRoleDTO.java

@ -0,0 +1,87 @@
/**
* 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.role;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 评价权限表 评价权限表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
public class EvaluateRoleDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 权限编码1.点赞2.吐槽
*/
private Integer roleCode;
/**
* 权限描述
*/
private String ruleDesc;
/**
* 可用标记(0-不可用1-可用)
*/
private String available;
/**
* 删除标识 01
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

94
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/controller/EvaluateRoleController.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.evaluate.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.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.modules.evaluate.excel.EvaluateRoleExcel;
import com.elink.esua.epdc.modules.evaluate.service.EvaluateRoleService;
import com.elink.esua.epdc.role.EvaluateRoleDTO;
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 2020-02-05
*/
@RestController
@RequestMapping("evaluaterole")
public class EvaluateRoleController {
@Autowired
private EvaluateRoleService evaluateRoleService;
@GetMapping("page")
public Result<PageData<EvaluateRoleDTO>> page(@RequestParam Map<String, Object> params){
PageData<EvaluateRoleDTO> page = evaluateRoleService.page(params);
return new Result<PageData<EvaluateRoleDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<EvaluateRoleDTO> get(@PathVariable("id") String id){
EvaluateRoleDTO data = evaluateRoleService.get(id);
return new Result<EvaluateRoleDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody EvaluateRoleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
evaluateRoleService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody EvaluateRoleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
evaluateRoleService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
evaluateRoleService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<EvaluateRoleDTO> list = evaluateRoleService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, EvaluateRoleExcel.class);
}
}

33
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/dao/EvaluateRoleDao.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.evaluate.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateRoleEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 评价权限表 评价权限表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Mapper
public interface EvaluateRoleDao extends BaseDao<EvaluateRoleEntity> {
}

53
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/entity/EvaluateRoleEntity.java

@ -0,0 +1,53 @@
/**
* 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.evaluate.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 评价权限表 评价权限表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_evaluate_role")
public class EvaluateRoleEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 权限编码1.点赞2.吐槽
*/
private Integer roleCode;
/**
* 权限描述
*/
private String ruleDesc;
/**
* 可用标记(0-不可用1-可用)
*/
private String available;
}

65
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/excel/EvaluateRoleExcel.java

@ -0,0 +1,65 @@
/**
* 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.evaluate.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 2020-02-05
*/
@Data
public class EvaluateRoleExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "权限编码(1.点赞,2.吐槽)")
private Integer roleCode;
@Excel(name = "权限描述")
private String ruleDesc;
@Excel(name = "可用标记(0-不可用,1-可用)")
private String available;
@Excel(name = "删除标识 0:否,1:是")
private String delFlag;
@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-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/redis/EvaluateRoleRedis.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.evaluate.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 2020-02-05
*/
@Component
public class EvaluateRoleRedis {
@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-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/EvaluateRoleService.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.evaluate.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateRoleEntity;
import com.elink.esua.epdc.role.EvaluateRoleDTO;
import java.util.List;
import java.util.Map;
/**
* 评价权限表 评价权限表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2020-02-05
*/
public interface EvaluateRoleService extends BaseService<EvaluateRoleEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<EvaluateRoleDTO>
* @author generator
* @date 2020-02-05
*/
PageData<EvaluateRoleDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<EvaluateRoleDTO>
* @author generator
* @date 2020-02-05
*/
List<EvaluateRoleDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return EvaluateRoleDTO
* @author generator
* @date 2020-02-05
*/
EvaluateRoleDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-02-05
*/
void save(EvaluateRoleDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-02-05
*/
void update(EvaluateRoleDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-02-05
*/
void delete(String[] ids);
}

104
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/evaluate/service/impl/EvaluateRoleServiceImpl.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.evaluate.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.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.modules.evaluate.entity.EvaluateRoleEntity;
import com.elink.esua.epdc.modules.evaluate.dao.EvaluateRoleDao;
import com.elink.esua.epdc.modules.evaluate.redis.EvaluateRoleRedis;
import com.elink.esua.epdc.role.EvaluateRoleDTO;
import com.elink.esua.epdc.modules.evaluate.service.EvaluateRoleService;
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 2020-02-05
*/
@Service
public class EvaluateRoleServiceImpl extends BaseServiceImpl<EvaluateRoleDao, EvaluateRoleEntity> implements EvaluateRoleService {
@Autowired
private EvaluateRoleRedis evaluateRoleRedis;
@Override
public PageData<EvaluateRoleDTO> page(Map<String, Object> params) {
IPage<EvaluateRoleEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, EvaluateRoleDTO.class);
}
@Override
public List<EvaluateRoleDTO> list(Map<String, Object> params) {
List<EvaluateRoleEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, EvaluateRoleDTO.class);
}
private QueryWrapper<EvaluateRoleEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<EvaluateRoleEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public EvaluateRoleDTO get(String id) {
EvaluateRoleEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, EvaluateRoleDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(EvaluateRoleDTO dto) {
EvaluateRoleEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateRoleEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(EvaluateRoleDTO dto) {
EvaluateRoleEntity entity = ConvertUtils.sourceToTarget(dto, EvaluateRoleEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

20
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/evaluate/EvaluateRoleDao.xml

@ -0,0 +1,20 @@
<?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.evaluate.dao.EvaluateRoleDao">
<resultMap type="com.elink.esua.epdc.modules.evaluate.entity.EvaluateRoleEntity" id="evaluateRoleMap">
<result property="id" column="ID"/>
<result property="roleCode" column="ROLE_CODE"/>
<result property="ruleDesc" column="RULE_DESC"/>
<result property="available" column="AVAILABLE"/>
<result property="delFlag" column="DEL_FLAG"/>
<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>

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

@ -17,6 +17,7 @@
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActInfoAppFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoAppResultDTO;
import com.elink.esua.epdc.activity.result.ActInfoDetailAppResultDTO;
@ -74,5 +75,13 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
ActInfoDetailAppResultDTO getRejectDetailByApp(ActInfoAppFormDTO formDto);
ActInfoDetailAppResultDTO getCancelDetailByApp(ActInfoAppFormDTO formDto);
/**
* @Description: 根据活动id查询活动已报名人数
* @Param: [actId]
* @return: ActInfoDTO
* @Author: zy
* @Date: 2020-02-05
*/
ActInfoDTO queryActSignupNum(String actId);
}

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

@ -21,9 +21,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActBannerDTO;
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.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.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.modules.activity.dao.ActBannerDao;
@ -74,12 +74,18 @@ public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBanne
return ConvertUtils.sourceToTarget(entityList, ActBannerDTO.class);
}
private QueryWrapper<ActBannerEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<ActBannerEntity> getWrapper(Map<String, Object> params) {
String id = "";
String status = "";
if (params.containsKey(FieldConstant.ID_HUMP)) {
id = (String) params.get(FieldConstant.ID_HUMP);
}
if (params.containsKey("status")) {
status = params.get("status").toString();
}
QueryWrapper<ActBannerEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id)
.eq(StringUtils.isNotBlank(status), "STATUS", status);
return wrapper;
}
@ -127,4 +133,4 @@ public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBanne
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}
}

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

@ -30,6 +30,7 @@ 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.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.modules.activity.dao.ActInfoDao;
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.redis.ActUserRelationRedis;
@ -61,6 +62,9 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
@Autowired
private ActInfoService actInfoService;
@Autowired
private ActInfoDao actInfoDao;
@Override
public PageData<ActUserRelationDTO> page(Map<String, Object> params) {
IPage<ActUserRelationEntity> page = baseDao.selectPage(
@ -172,8 +176,12 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
//更新epdc_act_info的已报名名额
ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId());
actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() + 1);
actInfoService.update(actInfoDTO);
}else{
return new Result().error("已报名" + data);
return new Result().error("已报名");
}
return new Result().ok("报名成功");
@ -200,6 +208,10 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
//更新epdc_act_info的已报名名额
ActInfoDTO actInfoDTO = actInfoDao.queryActSignupNum(actUserRelationDTO.getActId());
actInfoDTO.setSignupNum(actInfoDTO.getSignupNum() - 1);
actInfoService.update(actInfoDTO);
}else{
return new Result().error("未报名");
}

10
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml

@ -453,4 +453,14 @@
actInfo.CREATED_TIME DESC
</select>
<select id="queryActSignupNum" resultType="com.elink.esua.epdc.activity.ActInfoDTO" parameterType="String">
SELECT
ID id,
SIGNUP_NUM signupNum
FROM
epdc_act_info
WHERE
id = #{actId}
AND DEL_FLAG = 0
</select>
</mapper>

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

@ -52,6 +52,7 @@
select count(*) countNum from epdc_act_user_relation where USER_ID = #{userId}
and ACT_ID = #{actId}
and status not in ('3' ,'4')
and DEL_FLAG = 0
</select>
<select id="selectOneActUserRelationInfo" resultType="com.elink.esua.epdc.activity.ActUserRelationDTO" parameterType="String">
@ -245,5 +246,4 @@
and status = '0'
</select>
</mapper>
Loading…
Cancel
Save