diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index acacd98237..fc9f181a20 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -25,7 +25,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; @@ -1091,16 +1090,38 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList) { + for (AgencyTreeResultDTO dto : agencyList) { + if (CollectionUtils.isEmpty(dto.getSubAgencyList())) { + dto.setSubAgencyList(null); + } else { + setAgencyList(dto.getSubAgencyList()); + } + } } } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java new file mode 100644 index 0000000000..94ac78be16 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/act/LineChartDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.act; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/9/18 9:37 上午 + * @DESC + */ +@Data +public class LineChartDTO implements Serializable { + + private static final long serialVersionUID = -8479227864670104465L; + + private Integer value; + + private String month; + + public LineChartDTO() { + this.value = NumConstant.ZERO; + } +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java index c4082b67c9..db9e155e6a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/dao/GroupActInfoDao.java @@ -19,6 +19,7 @@ package com.epmet.modules.act.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.act.entity.GroupActInfoEntity; +import com.epmet.resi.group.dto.act.LineChartDTO; import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; import com.epmet.resi.group.dto.act.form.OrganizationalLifeFormDTO; import com.epmet.resi.group.dto.act.result.OrganizationalLifeResultDTO; @@ -67,4 +68,31 @@ public interface GroupActInfoDao extends BaseDao { List selectLineChart(@Param("groupIds") List groupId,@Param("leaderFlag")Boolean leaderFlag, @Param("yearId")String yearId); + /** + * @Description 查询我创建的活动 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:23 上午 + */ + List selectMyCreateActTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + + /** + * @Description 查询应参与的活动 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:25 上午 + */ + List selectShouldJoinActTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + + /** + * @Description 查询活动签到次数 + * @Param userId + * @Param yearId + * @author zxc + * @date 2021/9/18 9:27 上午 + */ + List selectSignInTypeMonth(@Param("userId")String userId,@Param("yearId")String yearId); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java index 62ea68fdca..f44543bac0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/act/service/impl/GroupActInfoServiceImpl.java @@ -59,6 +59,7 @@ import com.epmet.modules.invitation.service.InvitationRecordService; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.resi.group.dto.act.GroupActIdDTO; import com.epmet.resi.group.dto.act.GroupActInfoDTO; +import com.epmet.resi.group.dto.act.LineChartDTO; import com.epmet.resi.group.dto.act.OrganizationalLifeLineChartDTO; import com.epmet.resi.group.dto.act.form.*; import com.epmet.resi.group.dto.act.result.ActDetailByLinkResultDTO; @@ -886,7 +887,7 @@ public class GroupActInfoServiceImpl extends BaseServiceImpl myActs = baseDao.selectMyCreateActTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + List joinActs = baseDao.selectShouldJoinActTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + List signInActs = baseDao.selectSignInTypeMonth(formDTO.getUserId(), formDTO.getYearId()); + // 折线图组装 + List lineChart = lineChart(formDTO.getYearId()); + lineChart.forEach(l ->{ + if (!CollectionUtils.isEmpty(myActs)){ + myActs.forEach(m -> { + if (l.getMonth().equals(m.getMonth())){ + l.setOrganizationalActCount(m.getValue()); + } + }); + } + if (!CollectionUtils.isEmpty(joinActs)){ + joinActs.forEach(j -> { + if (l.getMonth().equals(j.getMonth())){ + l.setShouldJoinActCount(j.getValue()); + } + }); + } + if (!CollectionUtils.isEmpty(signInActs)){ + signInActs.forEach(s -> { + if (l.getMonth().equals(s.getMonth())){ + l.setActSignCount(s.getValue()); + } + }); + } + }); + result.setOrganizationalActCount(CollectionUtils.isEmpty(myActs) ? NumConstant.ZERO : myActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setShouldJoinActCount(CollectionUtils.isEmpty(joinActs) ? NumConstant.ZERO : joinActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setActSignCount(CollectionUtils.isEmpty(signInActs) ? NumConstant.ZERO : signInActs.stream().collect(Collectors.summingInt(LineChartDTO::getValue))); + result.setLineChart(lineChart); + return result; } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml index 6ebd2be427..dd6534f874 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/GroupActInfoDao.xml @@ -64,4 +64,47 @@ AND DATE_FORMAT( CREATED_TIME, '%Y' ) = #{yearId} GROUP BY month + + + + + + + + + \ No newline at end of file