瀏覽代碼

Merge branch 'nacyy' of http://8.155.30.116:3000/CQ_JD/nazw into nacyy

tml 3 月之前
父節點
當前提交
ed08e4877f

+ 2 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/dao/HandleDeptDao.java

@@ -18,6 +18,8 @@ public interface HandleDeptDao {
 
     HandleDept findOne(long id);
 
+    HandleDept selectOne(Long id);
+
     //添加
    // BaseResult insert(HandleDept handleDept);
 

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/entity/HandleDept.java

@@ -16,7 +16,7 @@ public class HandleDept implements Serializable {
      * 办理部门表id
      */
 
-    private long id;
+    private Long id;
 
     /**
      * 部门名称

+ 13 - 2
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/HandleBusinessServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
 
 /**
@@ -74,12 +75,17 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
         List<HandleDept> handleDepts = handleDeptDao.findById(handleBusiness.getId());
         // 获取分页后的 HandleMatters 对象
         List<HandleMatters> allHandleMatters = new ArrayList<>();
+        LinkedHashSet<HandleDept> allHandleDepts = new LinkedHashSet<>();
         int total = 0;
         for (HandleDept handleDept : handleDepts) {
             long deptId = handleDept.getId();
             List<HandleMatters> handleMattersList = handleMattersDao.findByDeptIdAndWindowNum(deptId,windowNum);
             allHandleMatters.addAll(handleMattersList);
             total += handleMattersDao.queryCount(deptId,windowNum);
+            for (HandleMatters handleMatters : handleMattersList) {
+                HandleDept dept = handleDeptDao.selectOne(handleMatters.getDeptId().longValue());
+                allHandleDepts.add(dept);
+            }
         }
         // 计算分页参数
         int offset = (currentPage - 1) * pageSize;
@@ -92,7 +98,7 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
         int totalPages = (int) Math.ceil((double) total / pageSize);
         // 将数据放入 map 中
         map.put("handleBusiness", handleBusiness);
-        map.put("handleDepts", handleDepts);
+        map.put("handleDepts", allHandleDepts);
         map.put("handleMatters", ss);
         map.put("totalPages", totalPages);
         map.put("total", total);
@@ -108,10 +114,15 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
         HandleBusiness handleBusiness = handleBusinessDao.findById(query.getBusinessId());
         List<HandleDept> handleDepts = handleDeptDao.findById(handleBusiness.getId());
         ArrayList<Object> handleMatter = new ArrayList<>();
+        LinkedHashSet<HandleDept> allHandleDepts = new LinkedHashSet<>();
         for (HandleDept handleDept : handleDepts) {
             List<HandleMatters> HandleMatters = handleMattersDao.findByIdByKey(handleDept.getId(), query.getKeyword(),query.getWindowNum());
             handleMatter.addAll(HandleMatters);
             total += handleMattersDao.findByIdByKeyCount(handleDept.getId(), query.getKeyword(), query.getWindowNum());
+            for (HandleMatters handleMatters : HandleMatters) {
+                HandleDept dept = handleDeptDao.selectOne(handleMatters.getDeptId().longValue());
+                allHandleDepts.add(dept);
+            }
         }
 
         // 计算分页参数
@@ -126,7 +137,7 @@ public class HandleBusinessServiceImpl implements HandleBusinessService{
 
         map.put("handleMatters", ss);
         map.put("handleBusiness", handleBusiness);
-        map.put("handleDepts", handleDepts);
+        map.put("handleDepts", allHandleDepts);
         map.put("total", total);
         map.put("totalPages", totalPages);
         return map;

+ 3 - 0
nngkxxdp/src/main/resources/mapper/HandleDeptDao.xml

@@ -21,4 +21,7 @@
     <select id="findOne" resultType="com.example.nngkxxdp.entity.HandleDept">
         select * from t_handle_dept where id=#{id}
     </select>
+    <select id="selectOne" resultType="com.example.nngkxxdp.entity.HandleDept">
+        select * from t_handle_dept where id=#{id}
+    </select>
 </mapper>

+ 2 - 2
nngkxxdp/src/main/resources/mapper/HandleMattersDao.xml

@@ -73,8 +73,8 @@
         </if>
     </select>
     <select id="findByDeptIdAndWindowNum" resultType="com.example.nngkxxdp.entity.HandleMatters">
-        select hm.id,hm.matters_name,hm.window_num,hm.url from t_handle_matters hm
-        where hm.deptId=#{deptId}
+        select * from t_handle_matters
+        where deptId=#{deptId}
         <if test="windowNum != null and windowNum != ''">
             and window_num like concat('%', #{windowNum}, '%')
         </if>