From b33c9aec8e4a5956ec0d08f2edf985bff57d0af8 Mon Sep 17 00:00:00 2001 From: Jackwang Date: Wed, 1 Sep 2021 16:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/VactInfoController.java | 94 +++++++++++ .../controller/VactOrgRelationController.java | 94 +++++++++++ .../modules/volunteer/dao/VactInfoDao.java | 33 ++++ .../volunteer/dao/VactOrgRelationDao.java | 33 ++++ .../volunteer/entity/VactInfoEntity.java | 146 ++++++++++++++++++ .../entity/VactOrgRelationEntity.java | 48 ++++++ .../volunteer/excel/VactInfoExcel.java | 119 ++++++++++++++ .../volunteer/excel/VactOrgRelationExcel.java | 62 ++++++++ .../volunteer/redis/VactInfoRedis.java | 47 ++++++ .../volunteer/redis/VactOrgRelationRedis.java | 47 ++++++ .../volunteer/service/VactInfoService.java | 96 ++++++++++++ .../service/VactOrgRelationService.java | 96 ++++++++++++ .../service/impl/VactInfoServiceImpl.java | 104 +++++++++++++ .../impl/VactOrgRelationServiceImpl.java | 104 +++++++++++++ .../mapper/volunteer/VactInfoDao.xml | 38 +++++ .../mapper/volunteer/VactOrgRelationDao.xml | 19 +++ 16 files changed, 1180 insertions(+) create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactInfoController.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactOrgRelationController.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactInfoDao.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactOrgRelationDao.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactInfoEntity.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactOrgRelationEntity.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactInfoExcel.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactOrgRelationExcel.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactInfoRedis.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactOrgRelationRedis.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactInfoService.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactOrgRelationService.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactInfoServiceImpl.java create mode 100644 epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactOrgRelationServiceImpl.java create mode 100644 epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml create mode 100644 epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactInfoController.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactInfoController.java new file mode 100644 index 0000000..318699c --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactInfoController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.excel.VactInfoExcel; +import com.elink.esua.epdc.modules.volunteer.service.VactInfoService; +import com.elink.esua.epdc.volunteer.VactInfoDTO; +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 2021-09-01 + */ +@RestController +@RequestMapping("vactinfo") +public class VactInfoController { + + @Autowired + private VactInfoService vactInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = vactInfoService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VactInfoDTO data = vactInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VactInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + vactInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VactInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + vactInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + vactInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = vactInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VactInfoExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactOrgRelationController.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactOrgRelationController.java new file mode 100644 index 0000000..885354e --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VactOrgRelationController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.excel.VactOrgRelationExcel; +import com.elink.esua.epdc.modules.volunteer.service.VactOrgRelationService; +import com.elink.esua.epdc.volunteer.VactOrgRelationDTO; +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 2021-09-01 + */ +@RestController +@RequestMapping("vactorgrelation") +public class VactOrgRelationController { + + @Autowired + private VactOrgRelationService vactOrgRelationService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = vactOrgRelationService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VactOrgRelationDTO data = vactOrgRelationService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VactOrgRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + vactOrgRelationService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VactOrgRelationDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + vactOrgRelationService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + vactOrgRelationService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = vactOrgRelationService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VactOrgRelationExcel.class); + } + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactInfoDao.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactInfoDao.java new file mode 100644 index 0000000..effc616 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactInfoDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.volunteer.entity.VactInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿活动表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-01 + */ +@Mapper +public interface VactInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactOrgRelationDao.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactOrgRelationDao.java new file mode 100644 index 0000000..1496481 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VactOrgRelationDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.volunteer.entity.VactOrgRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿活动 志愿组织 关联表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-01 + */ +@Mapper +public interface VactOrgRelationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactInfoEntity.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactInfoEntity.java new file mode 100644 index 0000000..84872e1 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactInfoEntity.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 2021-09-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_vact_info") +public class VactInfoEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 标题 + */ + private String title; + + /** + * 活动头图 + */ + private String headPic; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 报名要求 + */ + private String requirement; + + /** + * 活动内容 + */ + private String actContent; + + /** + * 是否只允许志愿者参加 0否 1是 + */ + private String volunteerFlag; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系电话 + */ + private String tel; + + /** + * 审核状态:0-审核中,5-未通过,10-待发布,15已发布 + */ + private String state; + + /** + * 审核理由 + */ + private String reason; + + /** + * 用户ID + */ + private String userId; + + /** + * 头像地址 + */ + private String faceImg; + + /** + * 党员标识:0否1是 + */ + private String partyFlag; + + /** + * 部门ID + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 所有部门ID + */ + private String allDeptIds; + + /** + * 所有部门名称 + */ + private String allDeptNames; + + /** + * 父所有部门 + */ + private String parentDeptIds; + + /** + * 父所有部门 + */ + private String parentDeptNames; + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactOrgRelationEntity.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactOrgRelationEntity.java new file mode 100644 index 0000000..05d74c7 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VactOrgRelationEntity.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 2021-09-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_vact_org_relation") +public class VactOrgRelationEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 志愿活动id + */ + private String vactId; + + /** + * 志愿组织id + */ + private Long volunteerOrgId; + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactInfoExcel.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactInfoExcel.java new file mode 100644 index 0000000..15622dd --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactInfoExcel.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 2021-09-01 + */ +@Data +public class VactInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "标题") + private String title; + + @Excel(name = "活动头图") + private String headPic; + + @Excel(name = "活动开始时间") + private Date actStartTime; + + @Excel(name = "活动结束时间") + private Date actEndTime; + + @Excel(name = "活动地点") + private String actAddress; + + @Excel(name = "报名要求") + private String requirement; + + @Excel(name = "活动内容") + private String actContent; + + @Excel(name = "是否只允许志愿者参加 0否 1是") + private String volunteerFlag; + + @Excel(name = "联系人") + private String contacts; + + @Excel(name = "联系电话") + private String tel; + + @Excel(name = "审核状态:0-审核中,5-未通过,10-待发布,15已发布") + private String state; + + @Excel(name = "审核理由") + private String reason; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "头像地址") + private String faceImg; + + @Excel(name = "党员标识:0否1是") + private String partyFlag; + + @Excel(name = "部门ID") + private String deptId; + + @Excel(name = "部门名称") + private String deptName; + + @Excel(name = "所有部门ID") + private String allDeptIds; + + @Excel(name = "所有部门名称") + private String allDeptNames; + + @Excel(name = "父所有部门") + private String parentDeptIds; + + @Excel(name = "父所有部门") + private String parentDeptNames; + + @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; + + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactOrgRelationExcel.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactOrgRelationExcel.java new file mode 100644 index 0000000..1c6f085 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VactOrgRelationExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 2021-09-01 + */ +@Data +public class VactOrgRelationExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "志愿活动id") + private String vactId; + + @Excel(name = "志愿组织id") + private Long volunteerOrgId; + + @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; + + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactInfoRedis.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactInfoRedis.java new file mode 100644 index 0000000..e0a1388 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 2021-09-01 + */ +@Component +public class VactInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactOrgRelationRedis.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactOrgRelationRedis.java new file mode 100644 index 0000000..38f4f3b --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VactOrgRelationRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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 2021-09-01 + */ +@Component +public class VactOrgRelationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactInfoService.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactInfoService.java new file mode 100644 index 0000000..c42eb07 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactInfoService.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.entity.VactInfoEntity; +import com.elink.esua.epdc.volunteer.VactInfoDTO; + +import java.util.List; +import java.util.Map; + +/** + * 志愿活动表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-01 + */ +public interface VactInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VactInfoDTO + * @author generator + * @date 2021-09-01 + */ + VactInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-01 + */ + void save(VactInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-01 + */ + void update(VactInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-01 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactOrgRelationService.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactOrgRelationService.java new file mode 100644 index 0000000..755ddd4 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactOrgRelationService.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.entity.VactOrgRelationEntity; +import com.elink.esua.epdc.volunteer.VactOrgRelationDTO; + +import java.util.List; +import java.util.Map; + +/** + * 志愿活动 志愿组织 关联表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-09-01 + */ +public interface VactOrgRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-09-01 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-09-01 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VactOrgRelationDTO + * @author generator + * @date 2021-09-01 + */ + VactOrgRelationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-01 + */ + void save(VactOrgRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-09-01 + */ + void update(VactOrgRelationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-09-01 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactInfoServiceImpl.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactInfoServiceImpl.java new file mode 100644 index 0000000..1bb3497 --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactInfoServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.dao.VactInfoDao; +import com.elink.esua.epdc.modules.volunteer.entity.VactInfoEntity; +import com.elink.esua.epdc.modules.volunteer.redis.VactInfoRedis; +import com.elink.esua.epdc.modules.volunteer.service.VactInfoService; +import com.elink.esua.epdc.volunteer.VactInfoDTO; +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 2021-09-01 + */ +@Service +public class VactInfoServiceImpl extends BaseServiceImpl implements VactInfoService { + + @Autowired + private VactInfoRedis vactInfoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VactInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VactInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public VactInfoDTO get(String id) { + VactInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VactInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VactInfoDTO dto) { + VactInfoEntity entity = ConvertUtils.sourceToTarget(dto, VactInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VactInfoDTO dto) { + VactInfoEntity entity = ConvertUtils.sourceToTarget(dto, VactInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactOrgRelationServiceImpl.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactOrgRelationServiceImpl.java new file mode 100644 index 0000000..0edd1fa --- /dev/null +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VactOrgRelationServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.elink.esua.epdc.modules.volunteer.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.volunteer.dao.VactOrgRelationDao; +import com.elink.esua.epdc.modules.volunteer.entity.VactOrgRelationEntity; +import com.elink.esua.epdc.modules.volunteer.redis.VactOrgRelationRedis; +import com.elink.esua.epdc.modules.volunteer.service.VactOrgRelationService; +import com.elink.esua.epdc.volunteer.VactOrgRelationDTO; +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 2021-09-01 + */ +@Service +public class VactOrgRelationServiceImpl extends BaseServiceImpl implements VactOrgRelationService { + + @Autowired + private VactOrgRelationRedis vactOrgRelationRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, VactOrgRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VactOrgRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public VactOrgRelationDTO get(String id) { + VactOrgRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, VactOrgRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VactOrgRelationDTO dto) { + VactOrgRelationEntity entity = ConvertUtils.sourceToTarget(dto, VactOrgRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VactOrgRelationDTO dto) { + VactOrgRelationEntity entity = ConvertUtils.sourceToTarget(dto, VactOrgRelationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml new file mode 100644 index 0000000..99f43e1 --- /dev/null +++ b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml new file mode 100644 index 0000000..b1b7f15 --- /dev/null +++ b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file