From 8453c34fa2da546e2b529086dfdd1d875d6bbe4c Mon Sep 17 00:00:00 2001 From: Jackwang Date: Fri, 3 Sep 2021 17:06:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=97=E6=84=BF=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E4=B8=8E=E7=BB=84=E7=BB=87=E5=85=B3=E8=81=94=E5=85=B3?= =?UTF-8?q?=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../volunteer/dao/VactOrgRelationDao.java | 11 ++++++++- .../modules/volunteer/dao/VolunteerDao.java | 9 +++++++ .../service/impl/VactInfoServiceImpl.java | 24 +++++++++++++++++++ .../mapper/volunteer/VactOrgRelationDao.xml | 5 ++++ .../mapper/volunteer/VolunteerDao.xml | 7 ++++++ 5 files changed, 55 insertions(+), 1 deletion(-) 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 index 1496481..7692d6d 100644 --- 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 @@ -20,6 +20,7 @@ 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; +import org.apache.ibatis.annotations.Param; /** * 志愿活动 志愿组织 关联表 @@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface VactOrgRelationDao extends BaseDao { - + + /** + * @describe: 删除公益活动 组织关联 + * @author wangtong + * @date 2021/9/3 16:51 + * @params [vactId] + * @return void + */ + void deleteByVactId(@Param("vactId") String vactId); } \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerDao.java b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerDao.java index 1eb62d9..e9f81e7 100644 --- a/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerDao.java +++ b/epdc-cloud-heart/src/main/java/com/elink/esua/epdc/modules/volunteer/dao/VolunteerDao.java @@ -71,4 +71,13 @@ public interface VolunteerDao extends BaseDao { * @return com.elink.esua.epdc.volunteer.AppVolunteerDetailDTO */ AppVolunteerDetailDTO selectAppDetailById(@Param("userId") String userId); + + /** + * @describe: 通过用户id查询关联的组织id + * @author wangtong + * @date 2021/9/3 16:59 + * @params [userId] + * @return java.util.List + */ + List getOrgIdListByUserId(@Param("userId") String userId); } \ 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 65f1056..8e63913 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 @@ -26,9 +26,13 @@ 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.dao.VactOrgRelationDao; +import com.elink.esua.epdc.modules.volunteer.dao.VolunteerDao; import com.elink.esua.epdc.modules.volunteer.entity.VactInfoEntity; +import com.elink.esua.epdc.modules.volunteer.entity.VactOrgRelationEntity; import com.elink.esua.epdc.modules.volunteer.redis.VactInfoRedis; import com.elink.esua.epdc.modules.volunteer.service.VactInfoService; +import com.elink.esua.epdc.modules.volunteer.service.VactOrgRelationService; import com.elink.esua.epdc.volunteer.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -36,6 +40,7 @@ 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; @@ -53,6 +58,15 @@ public class VactInfoServiceImpl extends BaseServiceImpl page(Map params) { // IPage page = baseDao.selectPage( @@ -134,9 +148,19 @@ public class VactInfoServiceImpl extends BaseServiceImpl relationList = new ArrayList(); + List orgIdList = volunteerDao.getOrgIdListByUserId(formDto.getUserId()); + for(Long orgId : orgIdList){ + VactOrgRelationEntity relationEntity = new VactOrgRelationEntity(); + relationEntity.setVactId(entity.getId()); + relationEntity.setVolunteerOrgId(orgId); + relationList.add(relationEntity); + } + vactOrgRelationService.insertBatch(relationList); return new Result().ok("提交成功"); } diff --git a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml index b1b7f15..ffab4e9 100644 --- a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml +++ b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VactOrgRelationDao.xml @@ -14,6 +14,11 @@ + + update epdc_vact_org_relation set del_flag='1',UPDATED_TIME=now() + where del_flag='0' + and VACT_ID=#{vactId} + \ No newline at end of file diff --git a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VolunteerDao.xml b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VolunteerDao.xml index 3d7d4a6..c11e3a0 100644 --- a/epdc-cloud-heart/src/main/resources/mapper/volunteer/VolunteerDao.xml +++ b/epdc-cloud-heart/src/main/resources/mapper/volunteer/VolunteerDao.xml @@ -105,6 +105,13 @@ where v.DEL_FLAG='0' and v.USER_ID=#{userId} + \ No newline at end of file