From 591fe43687cab6881f0842c8ad6bdc6368a96d35 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 22 Aug 2022 14:42:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=E5=B9=B4=E5=BA=A6=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ActAndScheduleListFormDTO.java | 2 ++ .../dto/partyOrg/form/YearSearchFormDTO.java | 5 ++- .../result/YearSearchDetailResultDTO.java | 22 ++++++++++++ .../controller/IcPartyActController.java | 12 +++++-- .../partyOrg/service/IcPartyActService.java | 5 ++- .../service/impl/IcPartyActServiceImpl.java | 34 ++++++++++++++++++- .../mapper/partyOrg/IcPartyActDao.xml | 3 ++ 7 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchDetailResultDTO.java 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 19998a2448..03e24570ad 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 @@ -38,4 +38,6 @@ public class ActAndScheduleListFormDTO implements Serializable { * 当seachType = 'yearSearch'时,不需要查询党组织 */ private String searchType = ""; + + private String type = ""; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java index 983f48548d..db2d4d8de5 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java @@ -17,9 +17,12 @@ public class YearSearchFormDTO implements Serializable { public interface YearSearchForm{} - @NotBlank(message = "yaerId不能为空",groups = YearSearchForm.class) + @NotBlank(message = "yearId不能为空",groups = YearSearchForm.class) private String yearId; + @NotBlank(message = "type不能为空",groups = YearSearchForm.class) + private String type; + private String staffId; private String customerId; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchDetailResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchDetailResultDTO.java new file mode 100644 index 0000000000..24ff5a1061 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchDetailResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/8/22 09:27 + * @DESC + */ +@Data +public class YearSearchDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 8961924457475202790L; + + private String type; + private String frequency; + private List activityList; +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java index 89582f8b47..0e52bdad31 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java @@ -31,6 +31,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchDetailResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -232,11 +233,18 @@ public class IcPartyActController { * @author zxc * @date 2022/8/22 09:33 */ + @PostMapping("yearSearch01") + public Result> yearSearch01(@LoginUser TokenDto tokenDto, @RequestBody YearSearchFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icPartyActService.yearSearch01(formDTO)); + } + @PostMapping("yearSearch") - public Result> yearSearch(@LoginUser TokenDto tokenDto, @RequestBody YearSearchFormDTO formDTO){ + public Result> yearSearch(@LoginUser TokenDto tokenDto, @RequestBody YearSearchFormDTO formDTO){ formDTO.setStaffId(tokenDto.getUserId()); formDTO.setCustomerId(tokenDto.getCustomerId()); - return new Result>().ok(icPartyActService.yearSearch(formDTO)); + return new Result>().ok(icPartyActService.yearSearch(formDTO)); } @NoRepeatSubmit diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java index eeba74188a..434a0bf657 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java @@ -14,6 +14,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchDetailResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO; import java.util.List; @@ -105,5 +106,7 @@ public interface IcPartyActService extends BaseService { * @author zxc * @date 2022/8/22 09:33 */ - List yearSearch(YearSearchFormDTO formDTO); + List yearSearch01(YearSearchFormDTO formDTO); + + List yearSearch(YearSearchFormDTO 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 3b6869a53e..c48ab658dd 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 @@ -38,6 +38,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.YearSearchFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchDetailResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.PageHelper; @@ -351,7 +352,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl yearSearch(YearSearchFormDTO formDTO) { + public List yearSearch01(YearSearchFormDTO formDTO) { ActAndScheduleListFormDTO secondForm = ConvertUtils.sourceToTarget(formDTO, ActAndScheduleListFormDTO.class); secondForm.setSearchType("yearSearch"); disposeActAndScheduleListFormDTO(secondForm); @@ -376,6 +377,37 @@ public class IcPartyActServiceImpl extends BaseServiceImpl yearSearch(YearSearchFormDTO formDTO) { + ActAndScheduleListFormDTO secondForm = ConvertUtils.sourceToTarget(formDTO, ActAndScheduleListFormDTO.class); + secondForm.setSearchType("yearSearch"); + disposeActAndScheduleListFormDTO(secondForm); + List activityList = baseDao.getActivityList(secondForm); + List activityDetailList = new ArrayList<>(); + if (CollectionUtils.isEmpty(activityList)){ + return new ArrayList<>(); + } + activityList.forEach(al -> { + IcPartyActDetailResDTO icPartyActDetailResDTO = queryActDetail(formDTO.getCustomerId(), formDTO.getStaffId(), al.getActivityId()); + activityDetailList.add(icPartyActDetailResDTO); + }); + List result = new ArrayList<>(); + List activityTypeList = actTypeList(formDTO.getCustomerId()); + Map> groupByType = activityDetailList.stream().collect(Collectors.groupingBy(IcPartyActDetailResDTO::getActType)); + groupByType.forEach((type,list) -> { + YearSearchDetailResultDTO dto = new YearSearchDetailResultDTO(); + activityTypeList.forEach(at -> { + if (at.getValue().equals(type)){ + dto.setType(at.getLabel()); + dto.setFrequency(at.getFrequencyDesc()); + } + }); + dto.setActivityList(list); + result.add(dto); + }); + return result; + } + /** * Desc: * @param formDTO 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 ad7db30b76..00602f0c03 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 @@ -68,6 +68,9 @@ AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId} + + AND act_type = #{type} + AND pa.ORG_ID_PATH like concat('%',#{agencyId},'%')