ソースを参照

汇总列表样式调整

user5 8 ヶ月 前
コミット
5e9a24438f

+ 21 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/controller/DisposeRubbishController.java

@@ -1,5 +1,6 @@
 package com.jeeplus.test.wdt.disposeRubbish.controller;
 package com.jeeplus.test.wdt.disposeRubbish.controller;
 
 
+import com.google.common.collect.Lists;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.aop.logging.annotation.ApiLog;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.sys.service.OfficeService;
 import com.jeeplus.sys.service.OfficeService;
@@ -274,4 +275,24 @@ public class DisposeRubbishController {
         DisposeRubbish post = disposeRubbishService.getByNo ( no );
         DisposeRubbish post = disposeRubbishService.getByNo ( no );
         return ResponseEntity.ok ( post );
         return ResponseEntity.ok ( post );
     }
     }
+
+    /**
+     * 根据officeId查询详情汇总
+     */
+    @ApiLog("查询所有村落汇总信息")
+    @ApiOperation(value = "查询所有村落汇总信息")
+    @GetMapping("getAllOfficeDetailCollect")
+    public ResponseEntity<List<HashMap<String,Object>>> getAllOfficeDetailCollect() {
+        List<OfficeDTO> officeList = officeService.getOfficeOnHamlet ();
+        List<HashMap<String,Object>> result = Lists.newArrayList();
+        for (OfficeDTO officeDTO : officeList) {
+            HashMap<String,Object> map = disposeRubbishService.getAllOfficeDetailCollectByOfficeId ( officeDTO.getId() );
+            map.put("officeId",officeDTO.getId());
+            map.put("officeName",officeDTO.getName());
+            result.add(map);
+        }
+
+
+        return ResponseEntity.ok ( result );
+    }
 }
 }

+ 7 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/mapper/DisposeRubbishMapper.java

@@ -44,4 +44,11 @@ public interface DisposeRubbishMapper extends BaseMapper<DisposeRubbish> {
      * @return
      * @return
      */
      */
     DisposeRubbish getByNo(@Param("no") String no);
     DisposeRubbish getByNo(@Param("no") String no);
+
+    /**
+     * 获取当前月份的部门数据信息
+     * @param officeId
+     * @return
+     */
+    List<String> getYearMonthByOfficeIdList(String officeId);
 }
 }

+ 14 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/mapper/xml/DisposeRubbishMapper.xml

@@ -227,4 +227,18 @@
         order by update_time desc
         order by update_time desc
         limit 1
         limit 1
     </select>
     </select>
+
+
+    <select id="getYearMonthByOfficeIdList" resultType="java.lang.String">
+        SELECT
+            DATE_FORMAT(a.audit_pass_date, '%Y-%m') AS createDateStr
+		FROM
+			dispose_rubbish a
+        left join sys_user su on su.id = a.create_by_id and su.del_flag = 0
+		WHERE
+			a.del_flag = 0
+			AND su.office_id = #{officeId}
+            and DATE_FORMAT(a.audit_pass_date, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m');
+    </select>
+
 </mapper>
 </mapper>

+ 20 - 4
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/service/DisposeRubbishService.java

@@ -229,10 +229,6 @@ public class DisposeRubbishService extends ServiceImpl<DisposeRubbishMapper, Dis
             data.setSubsidy(subsidyB.toString());
             data.setSubsidy(subsidyB.toString());
             dataList.add(data);
             dataList.add(data);
         }
         }
-
-        //遍历查询出来的数据,对数据进行汇总处理
-        System.out.println();
-
         return dataList;
         return dataList;
     }
     }
     /**
     /**
@@ -305,4 +301,24 @@ public class DisposeRubbishService extends ServiceImpl<DisposeRubbishMapper, Dis
         return null;
         return null;
     }
     }
 
 
+
+
+    /**
+     * 根据id获取巡查工单信息
+     * @param officeId
+     * @return
+     */
+    public HashMap<String,Object> getAllOfficeDetailCollectByOfficeId(String officeId) {
+        HashMap<String,Object> map = new HashMap<String,Object>();
+        // 根据部门id查询所有年-月 信息汇总
+        List<String> allYearMonthByOfficeIdList = baseMapper.getAllYearMonthByOfficeId(officeId);
+        //获取当前月份的信息
+        List<String> getYearMonthByOfficeIdList = baseMapper.getYearMonthByOfficeIdList(officeId);
+
+        map.put("all",allYearMonthByOfficeIdList.size());
+        map.put("month",getYearMonthByOfficeIdList.size());
+
+        return map;
+    }
+
 }
 }