From 39d94d6824d77dfc7067b3ff8f3c2bc0ec700f8e Mon Sep 17 00:00:00 2001 From: Jackwang Date: Fri, 3 Sep 2021 09:13:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=BF=97=E6=84=BF=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/entity/ActInfoEntity.java | 10 ++ .../service/impl/ActInfoServiceImpl.java | 8 + .../controller/VactInfoController.java | 25 ++- .../modules/volunteer/dao/VactInfoDao.java | 14 +- .../volunteer/entity/VactInfoEntity.java | 12 +- .../volunteer/excel/VactInfoExcel.java | 142 +++++++++--------- .../volunteer/service/VactInfoService.java | 22 ++- .../service/impl/VactInfoServiceImpl.java | 34 ++++- .../resources/mapper/activity/ActInfoDao.xml | 10 +- .../mapper/volunteer/VactInfoDao.xml | 33 ++++ 10 files changed, 227 insertions(+), 83 deletions(-) diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java index cc01d61..2ed7dda 100644 --- a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActInfoEntity.java @@ -207,4 +207,14 @@ public class ActInfoEntity extends BaseEpdcEntity { */ private String volunteerFlag; + /** + * 活动类型:0社区活动 1志愿活动 + */ + private String actType; + + /** + * 志愿活动id + */ + private String vactId; + } diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java index 37f28de..da8d751 100644 --- a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java @@ -55,6 +55,7 @@ import com.elink.esua.epdc.modules.activity.service.ActInfoService; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.feign.JobFeignClient; import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; +import com.elink.esua.epdc.modules.volunteer.service.VactInfoService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -84,6 +85,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -138,6 +141,10 @@ public class ActInfoServiceImpl extends BaseServiceImpl> page(@RequestParam Map params){ - PageData page = vactInfoService.page(params); - return new Result>().ok(page); + public Result> page(@RequestParam Map params){ + PageData page = vactInfoService.page(params); + return new Result>().ok(page); } @GetMapping("{id}") @@ -87,8 +92,20 @@ public class VactInfoController { @GetMapping("export") public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = vactInfoService.list(params); + List list = vactInfoDao.getPageList(params); ExcelUtils.exportExcelToTarget(response, null, list, VactInfoExcel.class); } + /** + * @describe: 审核 + * @author wangtong + * @date 2021/9/2 13:53 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + @PostMapping("handleApply") + public Result handleApply(@RequestBody VactInfoDTO dto){ + return vactInfoService.handleApply(dto); + } + } \ 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 index effc616..7144b77 100644 --- 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 @@ -19,8 +19,12 @@ 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 com.elink.esua.epdc.volunteer.VactPageInfoDTO; 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 VactInfoDao extends BaseDao { - + + /** + * @describe: 后台管理-列表 + * @author wangtong + * @date 2021/9/1 19:06 + * @params [params] + * @return java.util.List + */ + List getPageList(Map params); } \ 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 index 84872e1..f6de22b 100644 --- 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 @@ -18,11 +18,11 @@ 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.math.BigDecimal; import java.util.Date; /** @@ -63,6 +63,16 @@ public class VactInfoEntity extends BaseEpdcEntity { */ private String actAddress; + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + /** * 报名要求 */ 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 index 15622dd..b933aab 100644 --- 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 @@ -20,8 +20,6 @@ package com.elink.esua.epdc.modules.volunteer.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import lombok.Data; -import java.util.Date; - /** * 志愿活动表 * @@ -31,89 +29,95 @@ import java.util.Date; @Data public class VactInfoExcel { - @Excel(name = "主键") - private String id; +// @Excel(name = "主键") +// private String id; + @Excel(name = "所属组织") + private String orgNames; @Excel(name = "标题") private String title; - @Excel(name = "活动头图") - private String headPic; + @Excel(name = "活动起止日期") + private String startEndTime; - @Excel(name = "活动开始时间") - private Date actStartTime; +// @Excel(name = "活动头图") +// private String headPic; - @Excel(name = "活动结束时间") - private Date actEndTime; +// @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 = "报名要求") +// private String requirement; - @Excel(name = "是否只允许志愿者参加 0否 1是") - private String volunteerFlag; +// @Excel(name = "活动内容") +// private String actContent; - @Excel(name = "联系人") - private String contacts; +// @Excel(name = "是否只允许志愿者参加 0否 1是") +// private String volunteerFlag; - @Excel(name = "联系电话") - private String tel; +// @Excel(name = "联系人") +// private String contacts; +// +// @Excel(name = "联系电话") +// private String tel; - @Excel(name = "审核状态:0-审核中,5-未通过,10-待发布,15已发布") + @Excel(name = "审核状态", + replace = { "审核中_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; +// @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 String 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/service/VactInfoService.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/service/VactInfoService.java index c42eb07..30755de 100644 --- 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 @@ -20,8 +20,10 @@ 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.commons.tools.utils.Result; import com.elink.esua.epdc.modules.volunteer.entity.VactInfoEntity; import com.elink.esua.epdc.volunteer.VactInfoDTO; +import com.elink.esua.epdc.volunteer.VactPageInfoDTO; import java.util.List; import java.util.Map; @@ -42,7 +44,7 @@ public interface VactInfoService extends BaseService { * @author generator * @date 2021-09-01 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 @@ -93,4 +95,22 @@ public interface VactInfoService extends BaseService { * @date 2021-09-01 */ void delete(String[] ids); + + /** + * @describe: 审核 + * @author wangtong + * @date 2021/9/2 13:53 + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + */ + Result handleApply(VactInfoDTO dto); + + /** + * @describe: 设置志愿活动状态为已发布 + * @author wangtong + * @date 2021/9/2 17:09 + * @params [vactId] + * @return void + */ + void updateVactState(String vactId); } \ 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 index 1bb3497..ecc22d4 100644 --- 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 @@ -23,11 +23,13 @@ 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.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 com.elink.esua.epdc.volunteer.VactPageInfoDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -50,12 +52,15 @@ public class VactInfoServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, VactInfoDTO.class); + public PageData page(Map params) { +// IPage page = baseDao.selectPage( +// getPage(params, FieldConstant.CREATED_TIME, false), +// getWrapper(params) +// ); +// return getPageData(page, VactInfoDTO.class); + IPage page = getPage(params); + List list = baseDao.getPageList(params); + return new PageData<>(list, page.getTotal()); } @Override @@ -101,4 +106,21 @@ public class VactInfoServiceImpl extends BaseServiceImpl + diff --git a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml index 99f43e1..5d03389 100644 --- a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml +++ b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactInfoDao.xml @@ -33,6 +33,39 @@ + \ No newline at end of file