From c391c1c782156efedd48d01da6dda09d69f6ef41 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 29 Mar 2023 16:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=90=8D=E8=81=94=E5=BB=BA=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/PartyActivityResDTO.java | 46 ++++++++++++++ .../controller/IcPartyActivityController.java | 17 ++++++ .../epmet/dao/IcActivityUnitRelationDao.java | 9 +++ .../com/epmet/dao/IcServiceItemDictDao.java | 9 +++ .../IcActivityUnitRelationService.java | 7 +++ .../epmet/service/IcPartyActivityService.java | 10 ++++ .../service/IcServiceItemDictService.java | 8 +++ .../IcActivityUnitRelationServiceImpl.java | 11 ++++ .../impl/IcPartyActivityServiceImpl.java | 60 ++++++++++++++++--- .../impl/IcServiceItemDictServiceImpl.java | 12 +++- .../mapper/IcActivityUnitRelationDao.xml | 9 +++ .../resources/mapper/IcServiceItemDictDao.xml | 15 +++++ 12 files changed, 203 insertions(+), 10 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java new file mode 100644 index 0000000000..bb10867388 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/PartyActivityResDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @Description 居民端钉钉,查看联建活动详情 + * @Author yzm + * @Date 2023/3/29 15:59 + */ +@Data +public class PartyActivityResDTO { + private String activityId; + private String agencyName; + private String agencyId; + private List unitNameList; + private List serviceMatterNameList; + private String title; + private String target; + private String content; + private Integer peopleCount; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date activityTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date activityEndTime; + private String coverUrl; + private String address; + private String result; + /** + * 报名记录id + */ + private String signUpId; + /** + * 已报名总人数 + */ + private Integer signUpCount; + /** + * 是否报名:true:已报名;false:未报名 + */ + private Boolean signUpFlag; + +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java index e6c79a4b49..34a74214c4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java @@ -44,6 +44,7 @@ import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyActivitySignUpRecordFormDTO; import com.epmet.dto.form.SignUpParyActFormDTO; import com.epmet.dto.result.ImportTaskCommonResultDTO; +import com.epmet.dto.result.PartyActivityResDTO; import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcPartyActivityExcel; @@ -52,6 +53,7 @@ import com.epmet.service.IcPartyActivityService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; @@ -283,4 +285,19 @@ public class IcPartyActivityController implements ResultDataResolver { return new Result().ok(resultMap); } + /** + * 居民端钉钉,查看联建活动详情 + * + * @param tokenDto + * @param activityId + * @return + */ + @PostMapping("act-detail-resi/{activityId}") + public Result queryActDetailForResi(@LoginUser TokenDto tokenDto, @PathVariable("activityId") String activityId) { + if (StringUtils.isBlank(activityId)) { + return new Result(); + } + return new Result().ok(icPartyActivityService.queryActDetailForResi(tokenDto.getCustomerId(),tokenDto.getUserId(),activityId)); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java index be27ce119b..9fb70cfb2b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java @@ -5,6 +5,8 @@ import com.epmet.entity.IcActivityUnitRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 联建活动与单位关联表 * @@ -22,4 +24,11 @@ public interface IcActivityUnitRelationDao extends BaseDao selectActivityUntiNames(String activityId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java index c01c80b4d4..7a0ef4f766 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceItemDictDao.java @@ -39,4 +39,13 @@ public interface IcServiceItemDictDao extends BaseDao { IcServiceItemDictEntity selectMax(String customerId); String selectName(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode); + + /** + * 查询联建活动的服务事项名称 + * @param activityId + * @param customerId + * @return + */ + List selectActivityServiceItemName(@Param("activityId") String activityId, + @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java index 3d109db98b..fdc06e08bc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java @@ -22,6 +22,13 @@ public interface IcActivityUnitRelationService extends BaseService getUnitList(String activityId); + /** + * 获取联建活动关联的联建单位名称 + * @param activityId + * @return + */ + List getActivityUntiNames(String activityId); + /** * 物理删除删除活动所属单位 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java index c625db5c03..1cd0819acf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.form.PartyActivityFormDTO; +import com.epmet.dto.result.PartyActivityResDTO; import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyActivityEntity; @@ -143,4 +144,13 @@ public interface IcPartyActivityService extends BaseService queryDictOption(String type, String customerId); + + /** + * 查询联建活动的,服务事项名称列表 + * @param activityId + * @param customerId + * @return + */ + List getByActivityId(String activityId, String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java index d7bedf1d0b..a52e4dd0bf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java @@ -43,6 +43,17 @@ public class IcActivityUnitRelationServiceImpl extends BaseServiceImpl getActivityUntiNames(String activityId) { + return baseDao.selectActivityUntiNames(activityId); + } + /** * 删除活动所属单位 * diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index fba092c900..c0a8b816ee 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; @@ -40,10 +41,7 @@ import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.result.ActivityStatisticsDTO; -import com.epmet.dto.result.PartyActivitySignUpRecordResDTO; -import com.epmet.dto.result.UploadImgResultDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcActivityServiceRelationEntity; import com.epmet.entity.IcActivityUnitRelationEntity; @@ -91,8 +89,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceMatterid = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); List serviceMatterNameList=new ArrayList<>(); for(String id:serviceMatterid){ - String categoryName=icServiceItemDictService.getCategoryName(dto.getCustomerId(),id); + String categoryName=SpringContextUtils.getBean(IcServiceItemDictService.class).getCategoryName(dto.getCustomerId(),id); if(StringUtils.isNotBlank(categoryName)){ serviceMatterNameList.add(categoryName); } @@ -213,7 +211,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl serviceItemList = icServiceItemDictService.queryDictList(entity.getCustomerId()); + List serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(entity.getCustomerId()); Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); List services = icActivityServiceRelationService.getServiceList(id); List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); @@ -347,7 +345,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取服务事项字典 - List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + List serviceItemList = SpringContextUtils.getBean(IcServiceItemDictService.class).queryDictList(tokenDto.getCustomerId()); Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //数据组装 dtoList.forEach(dto -> { @@ -580,6 +578,50 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId) + .eq(IcPartyActivitySignUpRecordEntity::getUserId, userId) + .select(IcPartyActivitySignUpRecordEntity::getId); + IcPartyActivitySignUpRecordEntity signUpRecordEntity = partyActivitySignUpRecordDao.selectOne(queryWrapper); + if (null != signUpRecordEntity) { + resDTO.setSignUpId(signUpRecordEntity.getId()); + resDTO.setSignUpFlag(true); + } + // 主办方:组织名称 + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(resDTO.getAgencyId()); + if (null != agencyInfoCache) { + resDTO.setAgencyName(agencyInfoCache.getOrganizationName()); + } + // 联建单位: + resDTO.setUnitNameList(icActivityUnitRelationService.getActivityUntiNames(activityId)); + // 服务事项 + resDTO.setServiceMatterNameList(SpringContextUtils.getBean(IcServiceItemDictService.class).getByActivityId(activityId,activityEntity.getCustomerId())); + // 报名总人数 + LambdaQueryWrapper countWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(IcPartyActivitySignUpRecordEntity::getActivityId, activityId); + resDTO.setSignUpCount(partyActivitySignUpRecordDao.selectCount(countWrapper)); + return resDTO; + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 1e7b7f0271..a8516d398a 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -226,5 +226,15 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl getByActivityId(String activityId, String customerId) { + return baseDao.selectActivityServiceItemName(activityId,customerId); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml index f8947c98e4..e25faa3e66 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml @@ -22,5 +22,14 @@ DELETE FROM ic_activity_unit_relation WHERE ACTIVITY_ID = #{activityId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml index 4582741dbb..8359370be2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceItemDictDao.xml @@ -41,4 +41,19 @@ d.CUSTOMER_ID = #{customerId} AND d.CATEGORY_CODE = #{categoryCode} + + + \ No newline at end of file