From 95e24d4f63be651b54e0a51bcc2a2e8f0be0483f Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.com> Date: Tue, 30 Nov 2021 17:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B1=E5=BB=BA=E8=81=94=E7=9B=9F=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=20PC=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/constant/HeartImageConstant.java | 15 ++ .../esua/epdc/volunteer/MutualityImgDTO.java | 91 ++++++++++++ .../epdc/volunteer/VolunteerUnionActDTO.java | 119 +++++++++++++++ .../volunteer/VolunteerUnionActImagesDTO.java | 21 +++ .../VolunteerUnionActController.java | 94 ++++++++++++ .../controller/VolunteerUnionController.java | 12 ++ .../volunteer/dao/MutualityImgDao.java | 58 ++++++++ .../volunteer/dao/VolunteerUnionActDao.java | 57 ++++++++ .../volunteer/dao/VolunteerUnionDao.java | 11 ++ .../volunteer/entity/MutualityImgEntity.java | 61 ++++++++ .../entity/VolunteerUnionActEntity.java | 71 +++++++++ .../excel/VolunteerUnionActExcel.java | 74 ++++++++++ .../volunteer/redis/MutualityImgRedis.java | 47 ++++++ .../redis/VolunteerUnionActRedis.java | 47 ++++++ .../service/MutualityImgService.java | 127 ++++++++++++++++ .../service/VolunteerUnionActService.java | 97 +++++++++++++ .../service/VolunteerUnionService.java | 9 ++ .../service/impl/MutualityImgServiceImpl.java | 135 ++++++++++++++++++ .../impl/VolunteerUnionActServiceImpl.java | 131 +++++++++++++++++ .../impl/VolunteerUnionServiceImpl.java | 5 + .../mapper/volunteer/MutualityImgDao.xml | 34 +++++ .../mapper/volunteer/VolunteerUnionActDao.xml | 59 ++++++++ .../mapper/volunteer/VolunteerUnionDao.xml | 9 ++ 23 files changed, 1384 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartImageConstant.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/MutualityImgDTO.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActDTO.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActImagesDTO.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionActController.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/MutualityImgDao.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionActDao.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/MutualityImgEntity.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerUnionActEntity.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerUnionActExcel.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/MutualityImgRedis.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerUnionActRedis.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/MutualityImgService.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionActService.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/MutualityImgServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionActServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/MutualityImgDao.xml create mode 100644 esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionActDao.xml diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartImageConstant.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartImageConstant.java new file mode 100644 index 00000000..ac485f10 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/HeartImageConstant.java @@ -0,0 +1,15 @@ +package com.elink.esua.epdc.constant; + +/** + * 活动模块图片常量 + * + * @author zy + * @since 2020/10/22 17:51 + */ +public interface HeartImageConstant { + + /** + * 共建联盟活动 - 精彩瞬间 + */ + String IMAGE_TYPE_VOLUNTEER_UNION_ACT = "volunteer_union_act"; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/MutualityImgDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/MutualityImgDTO.java new file mode 100644 index 00000000..c54be7bc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/MutualityImgDTO.java @@ -0,0 +1,91 @@ +/** + * 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.volunteer; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +@Data +public class MutualityImgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 图片类型 + */ + private String imgType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0:未删除,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActDTO.java new file mode 100644 index 00000000..3e5910d5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActDTO.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.volunteer; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import lombok.Data; + + +/** + * 共建联盟活动 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +@Data +public class VolunteerUnionActDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 共建联盟名称 + */ + private String unionName; + + /** + * 共建联盟id + */ + private String unionId; + + /** + * 活动名称 + */ + private String title; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 简介 + */ + private String content; + + /** + * 排序 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * [0] 活动开始时间 + * [1] 活动结束时间 + */ + private Date[] actTime; + + /** + * 精彩瞬间照片 + */ + private List images; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActImagesDTO.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActImagesDTO.java new file mode 100644 index 00000000..064075ea --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/volunteer/VolunteerUnionActImagesDTO.java @@ -0,0 +1,21 @@ +package com.elink.esua.epdc.volunteer; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片详情 + **/ +@Data +public class VolunteerUnionActImagesDTO implements Serializable { + + private String name; + + private String url; + + /** + * 图片上传顺序 + **/ + private Integer imgSort; +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionActController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionActController.java new file mode 100644 index 00000000..ce051364 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionActController.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.UpdateGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.modules.volunteer.excel.VolunteerUnionActExcel; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerUnionActService; +import com.elink.esua.epdc.volunteer.VolunteerUnionActDTO; +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-11-30 + */ +@RestController +@RequestMapping("volunteerunionact") +public class VolunteerUnionActController { + + @Autowired + private VolunteerUnionActService volunteerUnionActService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = volunteerUnionActService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + VolunteerUnionActDTO data = volunteerUnionActService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody VolunteerUnionActDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + volunteerUnionActService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody VolunteerUnionActDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + volunteerUnionActService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + volunteerUnionActService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = volunteerUnionActService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, VolunteerUnionActExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionController.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionController.java index 4b54e4c3..6b24277b 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionController.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/controller/VolunteerUnionController.java @@ -116,4 +116,16 @@ public class VolunteerUnionController { return volunteerUnionService.getVolunteerUnionDetail(dto); } + /** + * 共建联盟 下拉列表 + * + * @param + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 15:03 2021-11-30 + **/ + @GetMapping("optionVolunteerUnion") + public Result optionVolunteerUnion() { + return volunteerUnionService.optionVolunteerUnion(); + } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/MutualityImgDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/MutualityImgDao.java new file mode 100644 index 00000000..cdb209de --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/MutualityImgDao.java @@ -0,0 +1,58 @@ +/** + * 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.MutualityImgEntity; +import com.elink.esua.epdc.volunteer.VolunteerUnionActImagesDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +@Mapper +public interface MutualityImgDao extends BaseDao { + + /** + * 删除照片 + * + * @param referenceId + * @param imgType + * @return void + * @author zy + * @since 2021/9/3 18:30 + */ + void modifyImagesByReferenceIdAndImgType(@Param("referenceId") String referenceId, @Param("imgType") String imgType); + + /** + * 照片列表查询 + * + * @param referenceId + * @param imgType + * @return java.util.List + * @Author zhangyong + * @Date 16:28 2021-11-30 + **/ + List selectListImagesByReferenceIdAndImgType(@Param("referenceId") String referenceId, @Param("imgType") String imgType); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionActDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionActDao.java new file mode 100644 index 00000000..4a81015c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionActDao.java @@ -0,0 +1,57 @@ +/** + * 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.VolunteerUnionActEntity; +import com.elink.esua.epdc.volunteer.VolunteerUnionActDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 共建联盟活动 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +@Mapper +public interface VolunteerUnionActDao extends BaseDao { + + /** + * PC 列表 + * + * @param params + * @return java.util.List + * @Author zhangyong + * @Date 15:21 2021-11-30 + **/ + List getPageList(Map params); + + /** + * 详情查看 + * + * @param id + * @return com.elink.esua.epdc.volunteer.VolunteerUnionActDTO + * @Author zhangyong + * @Date 17:14 2021-11-30 + **/ + VolunteerUnionActDTO selectVolunteerUnionActDetailById(@Param("id") String id); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionDao.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionDao.java index 2c84b304..426c2c3a 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionDao.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerUnionDao.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.dto.VolunteerUnionFormDTO; import com.elink.esua.epdc.modules.volunteer.entity.VolunteerUnionEntity; import com.elink.esua.epdc.volunteer.VolunteerUnionDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -46,4 +47,14 @@ public interface VolunteerUnionDao extends BaseDao { * @return com.elink.esua.epdc.commons.tools.utils.Result */ List getVolunteerPioneerList(VolunteerUnionFormDTO formDto); + + /** + * 共建联盟 下拉列表 + * + * @param + * @return java.util.List> + * @Author zhangyong + * @Date 15:02 2021-11-30 + **/ + List> optionVolunteerUnion(); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/MutualityImgEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/MutualityImgEntity.java new file mode 100644 index 00000000..9df02c31 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/MutualityImgEntity.java @@ -0,0 +1,61 @@ +/** + * 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-11-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_mutuality_img") +public class MutualityImgEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 图片类型 + */ + private String imgType; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerUnionActEntity.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerUnionActEntity.java new file mode 100644 index 00000000..c803f43e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/entity/VolunteerUnionActEntity.java @@ -0,0 +1,71 @@ +/** + * 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-11-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_volunteer_union_act") +public class VolunteerUnionActEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 共建联盟id + */ + private String unionId; + + /** + * 活动名称 + */ + private String title; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 简介 + */ + private String content; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerUnionActExcel.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerUnionActExcel.java new file mode 100644 index 00000000..72c55211 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/excel/VolunteerUnionActExcel.java @@ -0,0 +1,74 @@ +/** + * 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-11-30 + */ +@Data +public class VolunteerUnionActExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "共建联盟id") + private String unionId; + + @Excel(name = "活动名称") + private String title; + + @Excel(name = "活动开始时间") + private Date actStartTime; + + @Excel(name = "活动结束时间") + private Date actEndTime; + + @Excel(name = "简介") + private String content; + + @Excel(name = "排序") + private Integer sort; + + @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; + + @Excel(name = "删除标识") + private String delFlag; + + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/MutualityImgRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/MutualityImgRedis.java new file mode 100644 index 00000000..3ccf07a2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/MutualityImgRedis.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-11-30 + */ +@Component +public class MutualityImgRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerUnionActRedis.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerUnionActRedis.java new file mode 100644 index 00000000..43e25e64 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/redis/VolunteerUnionActRedis.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-11-30 + */ +@Component +public class VolunteerUnionActRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/MutualityImgService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/MutualityImgService.java new file mode 100644 index 00000000..be7bb966 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/MutualityImgService.java @@ -0,0 +1,127 @@ +/** + * 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.MutualityImgEntity; +import com.elink.esua.epdc.volunteer.MutualityImgDTO; +import com.elink.esua.epdc.volunteer.VolunteerUnionActImagesDTO; + +import java.util.List; +import java.util.Map; + +/** + * 图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +public interface MutualityImgService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-30 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-30 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return MutualityImgDTO + * @author generator + * @date 2021-11-30 + */ + MutualityImgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-30 + */ + void save(MutualityImgDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-30 + */ + void update(MutualityImgDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-30 + */ + void delete(String[] ids); + + /** + * 保存图片 + * @Params: [images, eventId, imgType] + * @Return: boolean + * @Author: zy + * @Date: 2019/9/8 17:12 + */ + boolean saveImages(List images, String referenceId, String imgType); + + /** + * 删除照片 + * + * @param referenceId + * @param imgType + * @return void + * @author zy + * @since 2021/9/3 18:29 + */ + void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType); + + /** + * 照片列表查询 + * + * @param referenceId + * @param imgType + * @return java.util.List + * @Author zhangyong + * @Date 16:28 2021-11-30 + **/ + List selectListImagesByReferenceIdAndImgType(String referenceId, String imgType); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionActService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionActService.java new file mode 100644 index 00000000..35b1a9a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionActService.java @@ -0,0 +1,97 @@ +/** + * 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.VolunteerUnionActEntity; +import com.elink.esua.epdc.volunteer.VolunteerUnionActDTO; + +import java.util.List; +import java.util.Map; + +/** + * 共建联盟活动 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +public interface VolunteerUnionActService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-11-30 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-11-30 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return VolunteerUnionActDTO + * @author generator + * @date 2021-11-30 + */ + VolunteerUnionActDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-30 + */ + void save(VolunteerUnionActDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-11-30 + */ + void update(VolunteerUnionActDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-11-30 + */ + void delete(String[] ids); +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionService.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionService.java index 37dde3da..746b2c79 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionService.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VolunteerUnionService.java @@ -112,4 +112,13 @@ public interface VolunteerUnionService extends BaseService * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result getVolunteerUnionDetail(VolunteerUnionFormDTO dto); + + /** + * 共建联盟 下拉列表 + * @param unionName 共建联盟名称,模糊查询 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @Author zhangyong + * @Date 15:03 2021-11-30 + **/ + Result optionVolunteerUnion(); } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/MutualityImgServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/MutualityImgServiceImpl.java new file mode 100644 index 00000000..eac99a6b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/MutualityImgServiceImpl.java @@ -0,0 +1,135 @@ +/** + * 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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.modules.volunteer.dao.MutualityImgDao; +import com.elink.esua.epdc.modules.volunteer.entity.MutualityImgEntity; +import com.elink.esua.epdc.modules.volunteer.redis.MutualityImgRedis; +import com.elink.esua.epdc.modules.volunteer.service.MutualityImgService; +import com.elink.esua.epdc.volunteer.MutualityImgDTO; +import com.elink.esua.epdc.volunteer.VolunteerUnionActImagesDTO; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +@Service +public class MutualityImgServiceImpl extends BaseServiceImpl implements MutualityImgService { + + @Autowired + private MutualityImgRedis mutualityImgRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, MutualityImgDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, MutualityImgDTO.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 MutualityImgDTO get(String id) { + MutualityImgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, MutualityImgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(MutualityImgDTO dto) { + MutualityImgEntity entity = ConvertUtils.sourceToTarget(dto, MutualityImgEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(MutualityImgDTO dto) { + MutualityImgEntity entity = ConvertUtils.sourceToTarget(dto, MutualityImgEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveImages(List images, String referenceId, String imgType) { + if (null == images || images.isEmpty()) { + return true; + } + List imgEntities = new ArrayList<>(images.size()); + MutualityImgEntity entity = null; + for (int i = 0; i < images.size(); i++) { + entity = new MutualityImgEntity(); + entity.setReferenceId(referenceId); + entity.setImgUrl(images.get(i).getUrl()); + entity.setImgType(imgType); + entity.setSort(images.get(i).getImgSort()); + imgEntities.add(entity); + } + return insertBatch(imgEntities); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void modifyImagesByReferenceIdAndImgType(String referenceId, String imgType) { + baseDao.modifyImagesByReferenceIdAndImgType(referenceId, imgType); + } + + @Override + public List selectListImagesByReferenceIdAndImgType(String referenceId, String imgType) { + return baseDao.selectListImagesByReferenceIdAndImgType(referenceId, imgType); + } +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionActServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionActServiceImpl.java new file mode 100644 index 00000000..f9c94000 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionActServiceImpl.java @@ -0,0 +1,131 @@ +/** + * 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.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.constant.HeartImageConstant; +import com.elink.esua.epdc.modules.volunteer.dao.VolunteerUnionActDao; +import com.elink.esua.epdc.modules.volunteer.entity.VolunteerUnionActEntity; +import com.elink.esua.epdc.modules.volunteer.redis.VolunteerUnionActRedis; +import com.elink.esua.epdc.modules.volunteer.service.MutualityImgService; +import com.elink.esua.epdc.modules.volunteer.service.VolunteerUnionActService; +import com.elink.esua.epdc.volunteer.VolunteerUnionActDTO; +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; + +/** + * 共建联盟活动 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-11-30 + */ +@Service +public class VolunteerUnionActServiceImpl extends BaseServiceImpl implements VolunteerUnionActService { + + @Autowired + private VolunteerUnionActRedis volunteerUnionActRedis; + @Autowired + private MutualityImgService mutualityImgService; + + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.getPageList(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, VolunteerUnionActDTO.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 VolunteerUnionActDTO get(String id) { + VolunteerUnionActDTO result = baseDao.selectVolunteerUnionActDetailById(id); + if (null != result.getActStartTime() && null != result.getActEndTime()) { + Date[] actTime = {result.getActStartTime(), result.getActEndTime()}; + result.setActTime(actTime); + } + result.setImages(mutualityImgService.selectListImagesByReferenceIdAndImgType(result.getId(), HeartImageConstant.IMAGE_TYPE_VOLUNTEER_UNION_ACT)); + return result; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(VolunteerUnionActDTO dto) { + VolunteerUnionActEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerUnionActEntity.class); + if (null != dto.getActTime() && NumConstant.TWO == dto.getActTime().length) { + entity.setActStartTime(dto.getActTime()[NumConstant.ZERO]); + entity.setActEndTime(dto.getActTime()[NumConstant.ONE]); + } + insert(entity); + + // 新增图片 + mutualityImgService.saveImages(dto.getImages(), entity.getId(), HeartImageConstant.IMAGE_TYPE_VOLUNTEER_UNION_ACT); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(VolunteerUnionActDTO dto) { + VolunteerUnionActEntity entity = ConvertUtils.sourceToTarget(dto, VolunteerUnionActEntity.class); + if (null != dto.getActTime() && NumConstant.TWO == dto.getActTime().length) { + entity.setActStartTime(dto.getActTime()[NumConstant.ZERO]); + entity.setActEndTime(dto.getActTime()[NumConstant.ONE]); + } + + updateById(entity); + + // 删除图片 + mutualityImgService.modifyImagesByReferenceIdAndImgType(entity.getId(), HeartImageConstant.IMAGE_TYPE_VOLUNTEER_UNION_ACT); + // 新增图片 + mutualityImgService.saveImages(dto.getImages(), entity.getId(), HeartImageConstant.IMAGE_TYPE_VOLUNTEER_UNION_ACT); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionServiceImpl.java b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionServiceImpl.java index 363266b0..374ddc97 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/volunteer/service/impl/VolunteerUnionServiceImpl.java @@ -121,4 +121,9 @@ public class VolunteerUnionServiceImpl extends BaseServiceImpl> result = baseDao.optionVolunteerUnion(); + return new Result().ok(result); + } } diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/MutualityImgDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/MutualityImgDao.xml new file mode 100644 index 00000000..066d2301 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/MutualityImgDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + update epdc_mutuality_img set del_flag = '1' where REFERENCE_ID = #{referenceId} and IMG_TYPE = #{imgType} + + + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionActDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionActDao.xml new file mode 100644 index 00000000..4d92e49b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionActDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionDao.xml b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionDao.xml index c9b60f69..1e87b928 100644 --- a/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionDao.xml +++ b/esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/volunteer/VolunteerUnionDao.xml @@ -41,5 +41,14 @@ + +