Jelajahi Sumber

fix: 查询显示党员数

zhangying 2 bulan lalu
induk
melakukan
59464aeaa0

+ 23 - 0
src/main/java/com/ghsc/partybuild/service/impl/IntegratedQueryServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ghsc.partybuild.service.impl;
 
+import com.ghsc.partybuild.mapper.PartyTotalCQuery;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ghsc.partybuild.mapper.IntegratedQueryCQuery;
@@ -7,20 +8,42 @@ import com.ghsc.partybuild.service.IntegratedQueryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @Service("integrateQueryService")
 public class IntegratedQueryServiceImpl implements IntegratedQueryService {
     @Autowired
     private IntegratedQueryCQuery integratedQueryCquery;
 
+    @Autowired
+    private PartyTotalCQuery partyTotalCquery;
+
     @Override
     public PageInfo<HashMap<String, Object>> getDepartmentAdvanceList(int pageNum, int pageSize, String dzzmc, String[] zzlb, String[] jczzfl, String jldzzrqStart, String jldzzrqEnd, String gjjmrqStart, String gjjmrqEnd, Integer memberCountStart, Integer memberCountEnd, Integer djkpxxYear, Integer[] judgeLevel, Integer honourYear, Integer honourlevel, Integer[] honourType
             , Integer djkpxxYearDzb, Integer[] judgeLevelDzb,String dzzdm) {
         PageHelper.startPage(pageNum, pageSize);
         List<HashMap<String, Object>> list = integratedQueryCquery.departmentAdvanceList(dzzmc, zzlb, jczzfl, jldzzrqStart, jldzzrqEnd, gjjmrqStart, gjjmrqEnd, memberCountStart, memberCountEnd,
                 djkpxxYear, judgeLevel, honourYear, honourlevel, honourType, djkpxxYearDzb, judgeLevelDzb,dzzdm);
+
+        // 设置党员数量
+        List<String> dzzdmList = list.stream().map(it -> it.get("DZZDM").toString()).collect(Collectors.toList());
+        List<HashMap<String, Object>> zgUserlList = new ArrayList<>();
+        if (dzzdmList.size() > 0) {
+            zgUserlList = partyTotalCquery.selectZgUsertotalList(dzzdmList, null);
+        }
+        for (HashMap<String, Object> item : list) {
+            String itDzzdm = item.get("DZZDM").toString();
+            List<HashMap<String, Object>> zgList = zgUserlList.stream().filter(it -> it.get("DZZDM").toString().equals(itDzzdm)).collect(Collectors.toList());
+            Object numZguser = 0;
+            if (zgList.size() > 0) {
+                numZguser = zgList.get(0).get("NUM_ZGUSER");
+            }
+            item.put("MEMBERCOUNT", numZguser); // 设置职工数量为在岗党员数(前端显示用的MEMBERCOUNT)
+        }
+
         PageInfo<HashMap<String, Object>> result = new PageInfo(list);
         return result;
     }

+ 17 - 0
src/main/java/com/ghsc/partybuild/service/impl/PartyServiceImpl.java

@@ -61,6 +61,8 @@ public class PartyServiceImpl implements PartyService {
     private BigDataCQuery bigDataCquery;
     @Autowired
     private PartyTwoCQuery partyTwoCquery;
+    @Autowired
+    private PartyTotalCQuery partyTotalCquery;
 
     private static Integer[] levelType = new Integer[]{100, 200, 300, 400, 500};
 
@@ -117,6 +119,21 @@ public class PartyServiceImpl implements PartyService {
         PageHelper.startPage(pageNum, pageSize);
         List<HashMap<String, Object>> list = partyCquery.selectPartyList(appConfig.gddwdm, parentCode, dzzmc, dzzdm, zzlb, jczzfl, jldzzrqBegin, jldzzrqEnd, isContainParent, zzfbType, hjYear, zzlbStrList, ssdzzmc, dwjb, jmrqBegintime, jmrqEndtime, jczzflList, partyGroupId,notIncludeDzzdmList);
 
+        // 设置党员数量
+        List<String> dzzdmList = list.stream().map(it -> it.get("DZZDM").toString()).collect(Collectors.toList());
+        List<HashMap<String, Object>> zgUserlList = new ArrayList<>();
+        if (dzzdmList.size() > 0) {
+            zgUserlList = partyTotalCquery.selectZgUsertotalList(dzzdmList, null);
+        }
+        for (HashMap<String, Object> item : list) {
+            String itDzzdm = item.get("DZZDM").toString();
+            List<HashMap<String, Object>> zgList = zgUserlList.stream().filter(it -> it.get("DZZDM").toString().equals(itDzzdm)).collect(Collectors.toList());
+            Object numZguser = 0;
+            if (zgList.size() > 0) {
+                numZguser = zgList.get(0).get("NUM_ZGUSER");
+            }
+            item.put("USERCOUNT", numZguser); // 设置职工数量为在岗党员数(前端显示用的USERCOUNT)
+        }
 
         PageInfo<HashMap<String, Object>> result = new PageInfo(list);
         return result;

+ 1 - 0
src/main/java/com/ghsc/partybuild/service/impl/PartyTotalServiceImpl.java

@@ -294,6 +294,7 @@ public class PartyTotalServiceImpl implements PartyTotalService {
 
 
             item.put("NUM_ZGUSER", numZguser);//在岗党员数
+            item.put("USERCOUNT", numZguser); // 设置职工数量为在岗党员数(前端显示用的USERCOUNT)
             item.put("NUM_LTX", numLtx);//离退休党员数
             item.put("NUM_SQRD", numSqrd);//申请入党数
             item.put("NUM_JJFZ", numJjfz);//积极分子数