diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java index 5789e543e8..b6b33564d2 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java @@ -30,4 +30,6 @@ public class ActAndScheduleListFormDTO implements Serializable { private String customerId; private String staffId; + private String agencyId; + private String path; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java index 611d4bf6ed..20b1e69408 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.resi.partymember.dto.partyOrg.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -30,16 +32,22 @@ public class ActAndScheduleListResultDTO implements Serializable { private static final long serialVersionUID = -9050507457068805831L; private String activityId; + private String staffId; private String topic; private String address; private String holdTime; private String type; private String isPublicValue; + private String isPublish; private String joinTypeValue; - private Boolean isMe; + private String joinUserType; + private List joinOrgList; + private List joinOrgs; + private Boolean isMe = false; } + @Data public static class ScheduleListDTO implements Serializable{ private static final long serialVersionUID = 5372167729733804267L; @@ -48,6 +56,24 @@ public class ActAndScheduleListResultDTO implements Serializable { private String title; private String remindTime; private String remark; - private Boolean isMe; + private Boolean isMe = false; + private String staffId; + } + + @Data + public static class JoinOrgDTO implements Serializable{ + + private static final long serialVersionUID = -981758371558960097L; + + private String partyOrgId; + private String partyOrgName; + } + + public ActAndScheduleListResultDTO() { + this.scheduleTotal = NumConstant.ZERO; + this.activityTotal = NumConstant.ZERO; + this.dateId = ""; + this.activityList = new ArrayList<>(); + this.scheduleList = new ArrayList<>(); } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java index 374dd39b7d..83774e4a62 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyActDao.java @@ -3,6 +3,8 @@ package com.epmet.modules.partyOrg.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -22,4 +24,6 @@ public interface IcPartyActDao extends BaseDao { * @return */ List actTypeList(String customerId); + + List getActivityList(ActAndScheduleListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java index 93fa4d8a64..bf28e8663b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java @@ -3,6 +3,7 @@ package com.epmet.modules.partyOrg.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity; import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO; import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO; import org.apache.ibatis.annotations.Mapper; @@ -104,4 +105,6 @@ public interface IcPartyOrgDao extends BaseDao { * @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity */ IcPartyOrgEntity selectByCustomerIdAndFirstOrg(@Param("customerId") String customerId); + + List getPartyOrg(@Param("orgIds")List orgIds); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java index 48aa6fd599..131ef13279 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java @@ -2,8 +2,10 @@ package com.epmet.modules.partyOrg.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partyOrg.entity.IcScheduleEntity; +import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -22,4 +24,6 @@ public interface IcScheduleDao extends BaseDao { List getScheduleAndActCount(HomeMonthTotalFormDTO formDTO); + List getScheduleList(ActAndScheduleListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java index 05deb51cad..fdefb4989a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java @@ -11,10 +11,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.SpringContextUtils; -import com.epmet.modules.partyOrg.dao.IcPartyActDao; -import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao; -import com.epmet.modules.partyOrg.dao.IcScheduleDao; -import com.epmet.modules.partyOrg.dao.ResiPartymemberAttachmentDao; +import com.epmet.modules.partyOrg.dao.*; import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity; import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity; @@ -40,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * 党建组织活动 @@ -57,6 +55,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl activityList = baseDao.getActivityList(formDTO); + if (CollectionUtils.isNotEmpty(activityList)){ + List partyOrgIdsNoDistinct = new ArrayList<>(); + activityList.forEach(a -> { + partyOrgIdsNoDistinct.addAll(a.getJoinOrgList().stream().map(m -> m.getPartyOrgId()).collect(Collectors.toList())); + }); + List partyOrgIds = partyOrgIdsNoDistinct.stream().distinct().collect(Collectors.toList()); + List partyOrg = partyOrgDao.getPartyOrg(partyOrgIds); + activityList.forEach(a -> { + a.setIsMe(formDTO.getStaffId().equals(a.getStaffId())); + a.getJoinOrgList().forEach(po -> partyOrg.stream().filter(p -> p.getPartyOrgId().equals(po.getPartyOrgId())).forEach(p -> po.setPartyOrgName(p.getPartyOrgName()))); + a.setJoinOrgs(a.getJoinOrgList().stream().map(m -> m.getPartyOrgName()).collect(Collectors.toList())); + }); + } + List scheduleList = scheduleDao.getScheduleList(formDTO); + if (CollectionUtils.isNotEmpty(scheduleList)){ + scheduleList.forEach(s -> { + s.setIsMe(formDTO.getStaffId().equals(s.getStaffId())); + }); + } + ActAndScheduleListResultDTO result = new ActAndScheduleListResultDTO(); + result.setActivityList(activityList); + result.setScheduleList(scheduleList); + return result; } /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml index 066206184f..3f36691815 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml @@ -17,4 +17,47 @@ ORDER BY d.SORT ASC + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml index 1af1738da2..43c5697437 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml @@ -146,5 +146,18 @@ and ORG_PID = '0' + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml index d4cd5a8674..990fa16220 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml @@ -38,10 +38,24 @@ AND CUSTOMER_ID = #{customerId} AND HOLD_YEAR_ID = #{yearId} - AND CREATED_BY = #{staffId} + AND PUBLISH_STAFF_ID = #{staffId} AND PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%') GROUP BY HOLD_MONTH_ID)t GROUP BY t.monthId + \ No newline at end of file