diff --git a/db/24年6月变更.sql b/db/24年6月变更.sql index d78feedc..791e39be 100644 --- a/db/24年6月变更.sql +++ b/db/24年6月变更.sql @@ -31,6 +31,7 @@ create table pay_committee_info facsimile varchar(100) null comment '传真', preparation_unit varchar(100) null comment '筹建单位', committee_name varchar(100) null comment '委员会名称', + member_number int null comment '委员数量', constraint Index_1 unique (id) ) diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/committee/entity/PayCommitteeInfo.java b/jero-boot-incoming-payment/src/main/java/com/jero/committee/entity/PayCommitteeInfo.java index 4edf7bd9..15d794e9 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/committee/entity/PayCommitteeInfo.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/committee/entity/PayCommitteeInfo.java @@ -231,4 +231,10 @@ public class PayCommitteeInfo { @TableField(value = "committee_name") @ApiModelProperty(value = "委员会名称") private String committeeName; + /** + * 委员数量 + */ + @TableField(value = "member_number") + @ApiModelProperty(value = "委员数量") + private Integer memberNumber; } \ No newline at end of file diff --git a/jero-boot-incoming-payment/src/main/java/com/jero/committee/service/PayCommitteeInfoService.java b/jero-boot-incoming-payment/src/main/java/com/jero/committee/service/PayCommitteeInfoService.java index 0135c90f..d9729b62 100644 --- a/jero-boot-incoming-payment/src/main/java/com/jero/committee/service/PayCommitteeInfoService.java +++ b/jero-boot-incoming-payment/src/main/java/com/jero/committee/service/PayCommitteeInfoService.java @@ -1,4 +1,5 @@ package com.jero.committee.service; +import cn.hutool.core.collection.CollStreamUtil; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -15,6 +16,8 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; + import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.committee.mapper.PayCommitteeInfoMapper; import com.jero.committee.entity.PayCommitteeInfo; @@ -61,8 +64,20 @@ public class PayCommitteeInfoService extends ServiceImpl committeeMemberInfoList = JSONArray.parseArray(result.getString("commiteeMemberInfoList"), CommitteeMemberInfoDTO.class); List payCommitteeMemberInfos = convertCommitteeMemberInfoDTO(committeeMemberInfoList); committeeMemberInfoService.saveOrUpdateBatch(payCommitteeMemberInfos); + //获取委员会会员数量 + Map> stringListMap = CollStreamUtil.groupByKey(payCommitteeMemberInfos, PayCommitteeMemberInfo::getCommitteeNumber); + List committeeInfoList = JSONArray.parseArray(result.getString("commiteeInfoList"), CommitteeInfoDTO.class); List payCommitteeInfos = convertCommitteeInfoDTO(committeeInfoList); + for (PayCommitteeInfo payCommitteeInfo : payCommitteeInfos) { + String committeeNumber = payCommitteeInfo.getCommitteeNumber(); + if (stringListMap.containsKey(committeeNumber)){ + List memberInfoList = stringListMap.get(committeeNumber); + payCommitteeInfo.setMemberNumber(memberInfoList.size()); + }else { + payCommitteeInfo.setMemberNumber(0); + } + } this.saveOrUpdateBatch(payCommitteeInfos); } @@ -135,8 +150,10 @@ public class PayCommitteeInfoService extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(PayCommitteeMemberInfo::getIdentificationNumber,identificationNumber); + wrapper.eq(PayCommitteeMemberInfo::getCommitteeNumber,committeeNumber); PayCommitteeMemberInfo committeeMemberInfo = committeeMemberInfoService.getOne(wrapper); if (committeeMemberInfo != null){ payCommitteeMemberInfo.setId(committeeMemberInfo.getId()); @@ -155,7 +172,7 @@ public class PayCommitteeInfoService extends ServiceImpl