Browse Source

活动功能修改

feature/dangjian
李鹏飞 6 years ago
parent
commit
b4b95e746f
  1. 2
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/excel/TopicExcel.java
  2. 97
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java
  3. 18
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java
  4. 13
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java
  5. 116
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java
  6. 10
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java
  7. 113
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java
  8. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java
  9. 98
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActBannerController.java
  10. 45
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java
  11. 16
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserRelationController.java
  12. 33
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.java
  13. 12
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActInfoDao.java
  14. 13
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java
  15. 91
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActBannerEntity.java
  16. 8
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java
  17. 86
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActBannerExcel.java
  18. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActBannerRedis.java
  19. 98
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActBannerService.java
  20. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActInfoService.java
  21. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  22. 124
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActBannerServiceImpl.java
  23. 27
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  24. 24
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  25. 27
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml
  26. 52
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
  27. 61
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

2
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/excel/TopicExcel.java

@ -36,7 +36,7 @@ public class TopicExcel {
@Excel(name = "发言人")
private String nickname;
@Excel(name = "时间")
@Excel(name = "时间", format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
@Excel(name = "话题内容")

97
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActBannerDTO.java

@ -0,0 +1,97 @@
/**
* 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 java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@Data
public class ActBannerDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动ID
*/
private String actId;
/**
* 标题
*/
private String title;
/**
* banner图片
*/
private String bannerImg;
/**
* banner类型 0-活动1-连接
*/
private String bannerType;
/**
* 连接地址
*/
private String url;
/**
* 上下架状态 0-下架1-上架
*/
private String status;
/**
* 上下架时间
*/
private Date statusTime;
/**
* banner位置 0-顶部
*/
private String bannerPosition;
/**
* 浏览数量
*/
private Integer browseNum;
/**
* 创建部门ID
*/
private Long deptId;
/**
* 创建时间
*/
private Date createdTime;
}

18
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java

@ -190,5 +190,23 @@ public class ActInfoDTO implements Serializable {
*/
private Integer reward;
/**
* 活动名额类型
*/
private Integer actQuotaCategory;
/**
* 活动下架原因
*/
private String cancelReason;
/**
* 是否展示banner
*/
private String isBanner;
/**
* banner地址
*/
private String bannerUrl;
}

13
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java

@ -19,6 +19,7 @@ package com.elink.esua.epdc.activity.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ -37,6 +38,7 @@ public class ActInfoFormDTO implements Serializable {
/**
* 主键
*/
@NotBlank(message = "id不能为空")
private String id;
/**
@ -189,5 +191,16 @@ public class ActInfoFormDTO implements Serializable {
*/
private Integer reward;
/**
* 活动名额类型
*/
private Integer actQuotaCategory;
/**
* 活动下架原因
*/
@NotBlank(message = "下架原因不能为空")
private String cancelReason;
}

116
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActUserRelationAuditFormDTO.java

@ -0,0 +1,116 @@
/**
* 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.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
public class ActUserRelationAuditFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotBlank(message = "id不能为空")
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;
/**
* 未通过原因仅当未通过时录入并读取
*/
@NotBlank(message = "原因不能为空")
private String failureReason;
/**
* 审核时间
*/
private Date auditTime;
/**
* 报名时间
*/
private Date signupTime;
}

10
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java

@ -190,5 +190,15 @@ public class ActInfoResultDTO implements Serializable {
*/
private Integer reward;
/**
* 活动名额类型
*/
private Integer actQuotaCategory;
/**
* 活动下架原因
*/
private String cancelReason;
}

113
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserRelationResultDTO.java

@ -0,0 +1,113 @@
/**
* 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.result;
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 ActUserRelationResultDTO 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;
}

47
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java

@ -0,0 +1,47 @@
package com.elink.esua.epdc.constant;
public interface ActStateConstant {
/**
* 活动状态-上架
*/
String ACT_INFO_STATUS_GROUNDING = "1";
/**
* 活动状态-下架
*/
String ACT_INFO_STATUS_UNDERCARRIAGE = "0";
/**
* 活动BANNER状态-上架
*/
String ACT_BANNER_STATUS_GROUNDING = "1";
/**
* 活动BANNER状态-下架
*/
String ACT_BANNER_STATUS_UNDERCARRIAGE = "0";
/**
* 活动报名状态-报名
*/
String ACT_USER_RELATION_STATUS_APPLY = "0";
/**
* 活动报名状态-通过
*/
String ACT_USER_RELATION_STATUS_AUDITPASS = "1";
/**
* 活动报名状态-打卡
*/
String ACT_USER_RELATION_STATUS_CLOCK = "2";
/**
* 活动报名状态-取消
*/
String ACT_USER_RELATION_STATUS_CANCEL = "3";
/**
* 活动报名状态-审核驳回
*/
String ACT_USER_RELATION_STATUS_AUDITREJECT = "4";
}

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

@ -0,0 +1,98 @@
/**
* 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.ActBannerDTO;
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.modules.activity.excel.ActBannerExcel;
import com.elink.esua.epdc.modules.activity.service.ActBannerService;
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;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@RestController
@RequestMapping("actbanner")
public class ActBannerController {
@Autowired
private ActBannerService actBannerService;
@GetMapping("page")
public Result<PageData<ActBannerDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActBannerDTO> page = actBannerService.page(params);
return new Result<PageData<ActBannerDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ActBannerDTO> get(@PathVariable("id") String id){
ActBannerDTO data = actBannerService.get(id);
return new Result<ActBannerDTO>().ok(data);
}
@GetMapping("grounding/{id}")
public Result<ActBannerDTO> grounding(@PathVariable("id") String id){
return actBannerService.grounding(id);
}
@PostMapping
public Result save(@RequestBody ActBannerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actBannerService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActBannerDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
actBannerService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
actBannerService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ActBannerDTO> list = actBannerService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActBannerExcel.class);
}
}

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

@ -17,8 +17,12 @@
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActInfoFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
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;
@ -26,12 +30,16 @@ 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.constant.ActStateConstant;
import com.elink.esua.epdc.modules.activity.excel.ActInfoExcel;
import com.elink.esua.epdc.modules.activity.service.ActBannerService;
import com.elink.esua.epdc.modules.activity.service.ActInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -48,11 +56,17 @@ public class ActInfoController {
@Autowired
private ActInfoService actInfoService;
@Autowired
private ActBannerService actBannerService;
@GetMapping("page")
public Result<PageData<ActInfoDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActInfoDTO> page = actInfoService.page(params);
return new Result<PageData<ActInfoDTO>>().ok(page);
public Result<PageData<ActInfoResultDTO>> page(@RequestParam Map<String, Object> params){
if(SecurityUser.getDeptId() != null){
params.put("deptId", SecurityUser.getDeptId());
}
System.out.println(params);
PageData<ActInfoResultDTO> page = actInfoService.getActInfoPageFromPC(params);
return new Result<PageData<ActInfoResultDTO>>().ok(page);
}
@GetMapping("{id}")
@ -62,11 +76,30 @@ public class ActInfoController {
}
@PostMapping
@Transactional(rollbackFor=Exception.class)
public Result save(@RequestBody ActInfoDTO dto){
//效验数据
dto.setActStatus(ActStateConstant.ACT_INFO_STATUS_GROUNDING);
dto.setPublishTime(new Date());
if(SecurityUser.getDeptId() != null){
dto.setDeptId(SecurityUser.getDeptId());
}
System.out.println(dto);
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
ActBannerDTO bannerDto = new ActBannerDTO();
actInfoService.save(dto);
//保存banner信息
bannerDto.setActId(dto.getId());
bannerDto.setTitle(dto.getTitle());
bannerDto.setBannerImg(dto.getBannerUrl());
bannerDto.setBannerType("0");
bannerDto.setBannerPosition("0");
bannerDto.setUrl("");
bannerDto.setStatus(dto.getIsBanner());
bannerDto.setStatusTime(new Date());
bannerDto.setDeptId(dto.getDeptId());
ValidatorUtils.validateEntity(bannerDto, AddGroup.class, DefaultGroup.class);
actBannerService.save(bannerDto);
return new Result();
}
@ -77,6 +110,12 @@ public class ActInfoController {
actInfoService.update(dto);
return new Result();
}
@PostMapping("cancel")
public Result cancel(@RequestBody ActInfoFormDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
return actInfoService.cancel(dto);
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){

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

@ -18,6 +18,8 @@
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
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;
@ -44,14 +46,14 @@ import java.util.Map;
@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);
public Result<PageData<ActUserRelationResultDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActUserRelationResultDTO> page = actUserRelationService.getActUserRelationPageFromPC(params);
return new Result<PageData<ActUserRelationResultDTO>>().ok(page);
}
@GetMapping("{id}")
@ -75,6 +77,12 @@ public class ActUserRelationController {
actUserRelationService.update(dto);
return new Result();
}
@PostMapping("audit")
public Result audit(@RequestBody ActUserRelationAuditFormDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
return actUserRelationService.audit(dto);
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){

33
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActBannerDao.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.ActBannerEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@Mapper
public interface ActBannerDao extends BaseDao<ActBannerEntity> {
}

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

@ -17,10 +17,14 @@
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 活动信息表
*
@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActInfoDao extends BaseDao<ActInfoEntity> {
/**
* 活动列表
* @Params: [params]
* @Return: java.util.List<com.elink.esua.epdc.dto.heart.ActInfoDTO>
* @Author: liuchuang
* @Date: 2019/9/5 19:42
*/
List<ActInfoResultDTO> getActInfoPageFromPC(Map<String, Object> params);
}

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

@ -18,12 +18,16 @@
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 用户活动关系表
*
@ -41,4 +45,13 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
int isSignUp(@Param("userId")String userId, @Param("actId")String actId);
Result<ActUserRelationDTO> selectOneActUserRelationInfo(@Param("userId")String userId, @Param("actId")String actId);
/**
* 报名列表
* @Params: [params]
* @Return: java.util.List<com.elink.esua.epdc.dto.heart.ActInfoDTO>
* @Author: liuchuang
* @Date: 2019/9/5 19:42
*/
List<ActUserRelationResultDTO> getActUserRelationPageFromPC(Map<String, Object> params);
}

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

@ -0,0 +1,91 @@
/**
* 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;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_act_banner")
public class ActBannerEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 活动ID
*/
private String actId;
/**
* 标题
*/
private String title;
/**
* banner图片
*/
private String bannerImg;
/**
* banner类型 0-活动1-连接
*/
private String bannerType;
/**
* 连接地址
*/
private String url;
/**
* 上下架状态 0-下架1-上架
*/
private String status;
/**
* 上下架时间
*/
private Date statusTime;
/**
* banner位置 0-顶部
*/
private String bannerPosition;
/**
* 浏览数量
*/
private Integer browseNum;
/**
* 创建部门ID
*/
private Long deptId;
}

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

@ -98,6 +98,10 @@ public class ActInfoEntity extends BaseEpdcEntity {
* 活动签到打卡地点
*/
private String signinAddress;
/**
* 活动下架原因
*/
private String cancelReason;
/**
* 活动签到打卡位置经度
@ -188,5 +192,9 @@ public class ActInfoEntity extends BaseEpdcEntity {
* 活动奖励积分
*/
private Integer reward;
/**
* 活动名额类型
*/
private Integer actQuotaCategory;
}

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

@ -0,0 +1,86 @@
/**
* 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;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@Data
public class ActBannerExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "活动ID")
private String actId;
@Excel(name = "标题")
private String title;
@Excel(name = "banner图片")
private String bannerImg;
@Excel(name = "banner类型 0-活动,1-连接")
private String bannerType;
@Excel(name = "连接地址")
private String url;
@Excel(name = "上下架状态 0-下架,1-上架")
private String status;
@Excel(name = "上下架时间")
private Date statusTime;
@Excel(name = "banner位置 0-顶部")
private String bannerPosition;
@Excel(name = "浏览数量")
private Integer browseNum;
@Excel(name = "创建部门ID")
private Long deptId;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "删除标识 0-否,1-是")
private String delFlag;
@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/ActBannerRedis.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;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@Component
public class ActBannerRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

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

@ -0,0 +1,98 @@
/**
* 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.activity.ActBannerDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity;
import java.util.List;
import java.util.Map;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
public interface ActBannerService extends BaseService<ActBannerEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ActBannerDTO>
* @author generator
* @date 2019-12-19
*/
PageData<ActBannerDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ActBannerDTO>
* @author generator
* @date 2019-12-19
*/
List<ActBannerDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ActBannerDTO
* @author generator
* @date 2019-12-19
*/
ActBannerDTO get(String id);
Result grounding(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2019-12-19
*/
void save(ActBannerDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2019-12-19
*/
void update(ActBannerDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2019-12-19
*/
void delete(String[] ids);
}

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

@ -18,8 +18,11 @@
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActInfoFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity;
import java.util.List;
@ -43,6 +46,8 @@ public interface ActInfoService extends BaseService<ActInfoEntity> {
*/
PageData<ActInfoDTO> page(Map<String, Object> params);
PageData<ActInfoResultDTO> getActInfoPageFromPC(Map<String, Object> params);
/**
* 默认查询
*
@ -83,6 +88,8 @@ public interface ActInfoService extends BaseService<ActInfoEntity> {
*/
void update(ActInfoDTO dto);
Result cancel(ActInfoFormDTO dto);
/**
* 批量删除
*

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

@ -17,6 +17,8 @@
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
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;
@ -64,6 +66,8 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
*/
ActUserRelationDTO get(String id);
PageData<ActUserRelationResultDTO> getActUserRelationPageFromPC (Map<String, Object> params);
/**
* 默认保存
*
@ -84,6 +88,8 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
*/
void update(ActUserRelationDTO dto);
Result audit(ActUserRelationAuditFormDTO dto);
/**
* 批量删除
*

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

@ -0,0 +1,124 @@
/**
* 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.activity.ActBannerDTO;
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.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.modules.activity.dao.ActBannerDao;
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity;
import com.elink.esua.epdc.modules.activity.redis.ActBannerRedis;
import com.elink.esua.epdc.modules.activity.service.ActBannerService;
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.Date;
import java.util.List;
import java.util.Map;
/**
* 爱心互助活动banner 爱心互助活动banner
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-19
*/
@Service
public class ActBannerServiceImpl extends BaseServiceImpl<ActBannerDao, ActBannerEntity> implements ActBannerService {
@Autowired
private ActBannerRedis actBannerRedis;
@Override
public PageData<ActBannerDTO> page(Map<String, Object> params) {
IPage<ActBannerEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ActBannerDTO.class);
}
@Override
public List<ActBannerDTO> list(Map<String, Object> params) {
List<ActBannerEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ActBannerDTO.class);
}
private QueryWrapper<ActBannerEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ActBannerEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ActBannerDTO get(String id) {
ActBannerEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActBannerDTO.class);
}
@Override
public Result grounding(String id) {
ActBannerEntity entity = baseDao.selectById(id);
ActBannerEntity updateEntity = new ActBannerEntity();
updateEntity.setId(id);
updateEntity.setStatusTime(new Date());
// 上架
if (ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE.equals(entity.getStatus())) {
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_GROUNDING);
updateById(updateEntity);
// 下架
} else if (ActStateConstant.ACT_BANNER_STATUS_GROUNDING.equals(entity.getStatus())) {
updateEntity.setStatus(ActStateConstant.ACT_BANNER_STATUS_UNDERCARRIAGE);
updateById(updateEntity);
}
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActBannerDTO dto) {
ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActBannerDTO dto) {
ActBannerEntity entity = ConvertUtils.sourceToTarget(dto, ActBannerEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

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

@ -20,11 +20,15 @@ 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.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActInfoFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
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.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.entity.ActInfoEntity;
import com.elink.esua.epdc.modules.activity.redis.ActInfoRedis;
@ -36,6 +40,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -59,6 +64,12 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
);
return getPageData(page, ActInfoDTO.class);
}
@Override
public PageData<ActInfoResultDTO> getActInfoPageFromPC(Map<String, Object> params) {
IPage<ActInfoResultDTO> page = getPage(params);
List<ActInfoResultDTO> list = baseDao.getActInfoPageFromPC(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ActInfoDTO> list(Map<String, Object> params) {
@ -95,6 +106,22 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result cancel(ActInfoFormDTO dto) {
ActInfoEntity entity = baseDao.selectById(dto.getId());
if (ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE.equals(entity.getActStatus())) {
return new Result().error("活动已取消");
} else if (new Date().compareTo(entity.getSignupEndTime()) > 0) {
return new Result().error("已过报名时间不可取消");
}
ActInfoEntity updateEntity = new ActInfoEntity();
updateEntity.setId(dto.getId());
updateEntity.setCancelReason(dto.getCancelReason());
updateEntity.setActStatus(ActStateConstant.ACT_INFO_STATUS_UNDERCARRIAGE);
updateById(updateEntity);
return new Result();
}
@Override
@Transactional(rollbackFor = Exception.class)

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

@ -21,11 +21,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.form.ActUserRelationAuditFormDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
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.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
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;
@ -64,6 +67,12 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
);
return getPageData(page, ActUserRelationDTO.class);
}
@Override
public PageData<ActUserRelationResultDTO> getActUserRelationPageFromPC(Map<String, Object> params) {
IPage<ActUserRelationResultDTO> page = getPage(params);
List<ActUserRelationResultDTO> list = baseDao.getActUserRelationPageFromPC(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ActUserRelationDTO> list(Map<String, Object> params) {
@ -100,6 +109,21 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result audit(ActUserRelationAuditFormDTO dto) {
ActUserRelationEntity entity = baseDao.selectById(dto.getId());
if (ActStateConstant.ACT_USER_RELATION_STATUS_APPLY.equals(entity.getStatus())) {
ActUserRelationEntity updateEntity = new ActUserRelationEntity();
updateEntity.setId(dto.getId());
updateEntity.setStatus(dto.getStatus());
updateEntity.setFailureReason(dto.getFailureReason());
updateEntity.setAuditTime(new Date());
updateById(updateEntity);
return new Result();
}
return new Result().error("不可操作");
}
@Override
@Transactional(rollbackFor = Exception.class)

27
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActBannerDao.xml

@ -0,0 +1,27 @@
<?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.ActBannerDao">
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActBannerEntity" id="actBannerMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="title" column="TITLE"/>
<result property="bannerImg" column="BANNER_IMG"/>
<result property="bannerType" column="BANNER_TYPE"/>
<result property="url" column="URL"/>
<result property="status" column="STATUS"/>
<result property="statusTime" column="STATUS_TIME"/>
<result property="bannerPosition" column="BANNER_POSITION"/>
<result property="browseNum" column="BROWSE_NUM"/>
<result property="deptId" column="DEPT_ID"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<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>

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

@ -59,6 +59,7 @@
<result property="signinLatitude" column="SIGNIN_LATITUDE"/>
<result property="clockRadius" column="CLOCK_RADIUS"/>
<result property="actQuota" column="ACT_QUOTA"/>
<result property="actQuotaCategory" column="ACT_QUOTA_CATEGORY"/>
<result property="signupNum" column="SIGNUP_NUM"/>
<result property="clockNum" column="CLOCK_NUM"/>
<result property="actShareNum" column="ACT_SHARE_NUM"/>
@ -74,6 +75,57 @@
<result property="punishmentPoints" column="PUNISHMENT_POINTS"/>
<result property="reward" column="REWARD"/>
</resultMap>
<select id="getActInfoPageFromPC" resultMap="actResultMap">
SELECT
actInfo.ID,
actInfo.TITLE,
actInfo.HEAD_PIC,
actInfo.SIGNUP_START_TIME,
actInfo.SIGNUP_END_TIME,
actInfo.ACT_START_TIME,
actInfo.ACT_END_TIME,
actInfo.ACT_ADDRESS,
actInfo.ACT_LONGITUDE,
actInfo.ACT_LATITUDE,
actInfo.SIGNIN_START_TIME,
actInfo.SIGNIN_END_TIME,
actInfo.SIGNIN_ADDRESS,
actInfo.SIGNIN_LONGITUDE,
actInfo.SIGNIN_LATITUDE,
actInfo.CLOCK_RADIUS,
actInfo.ACT_QUOTA_CATEGORY,
actInfo.ACT_QUOTA,
actInfo.SIGNUP_NUM,
actInfo.CLOCK_NUM,
actInfo.ACT_SHARE_NUM,
actInfo.ACT_BROWSE_NUM,
actInfo.CONTACTS,
actInfo.TEL,
actInfo.REQUIREMENT,
actInfo.ACT_CONTENT,
actInfo.ACT_STATUS,
actInfo.CANCEL_REASON,
actInfo.PUBLISH_TIME,
actInfo.SPONSOR,
actInfo.DEPT_ID,
actInfo.PUNISHMENT_POINTS,
actInfo.REWARD
FROM
epdc_act_info actInfo
WHERE
actInfo.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( actInfo.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="deptId != null and deptId != ''">
AND actInfo.DEPT_ID = #{deptId}
</if>
<if test="actStatus != null and actStatus != ''">
AND actInfo.ACT_STATUS = #{actStatus}
</if>
ORDER BY
actInfo.CREATED_TIME DESC
</select>
</mapper>

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

@ -25,6 +25,28 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<resultMap type="com.elink.esua.epdc.activity.result.ActUserRelationResultDTO" id="actUserRelationResultMap">
<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}
@ -39,6 +61,45 @@
and ACT_ID = #{actId}
and status not in ('3' ,'4')
</select>
<select id="getActUserRelationPageFromPC" resultMap="actUserRelationResultMap">
SELECT
relation.ID,
relation.ACT_ID,
relation.USER_ID,
relation.NICKNAME,
relation.FACE_IMG,
relation.PARTY_FLAG,
relation.REAL_NAME,
relation.SEX,
relation.AGE,
relation.MOBILE,
relation.IDENTITY_NO,
relation.STATUS,
relation.FAILURE_REASON,
relation.AUDIT_TIME,
relation.SIGNUP_TIME
FROM
epdc_act_user_relation relation
WHERE
relation.DEL_FLAG = '0'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( relation.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="status != null and status != ''">
AND relation.STATUS = #{status}
</if>
<if test="mobile != null and mobile != ''">
AND relation.MOBILE = #{mobile}
</if>
<if test="realName != null and realName != ''">
AND relation.REAL_NAME = #{realName}
</if>
<if test="actId != null and actId != ''">
AND relation.ACT_ID = #{actId}
</if>
ORDER BY
relation.CREATED_TIME DESC
</select>
</mapper>
Loading…
Cancel
Save