Bläddra i källkod

develop data report

java110 2 år sedan
förälder
incheckning
7d2b2ef419

+ 70 - 0
java110-db/src/main/resources/mapper/report/ReportOrderStatisticsServiceDaoImplMapper.xml

@@ -109,4 +109,74 @@
         and t.state = '20200407'
         and t.state = '20200407'
     </select>
     </select>
 
 
+
+    <!-- 查询保养单 -->
+    <select id="getMaintainanceOrderCount" parameterType="Map" resultType="Map">
+        select count(1) maintainanceCount
+        from maintainance_task t
+        where 1=1
+        and t.community_id = #{communityId}
+        and t.create_time &gt; #{startDate}
+        and t.create_time &lt; #{endDate}
+        and t.status_cd = '0'
+    </select>
+
+    <!-- 查询未完成保养单 -->
+    <select id="getUndoMaintainanceOrderCount" parameterType="Map" resultType="Map">
+        select count(1) maintainanceCount
+        from maintainance_task t
+        where 1=1
+        and t.community_id = #{communityId}
+        and t.create_time &gt; #{startDate}
+        and t.create_time &lt; #{endDate}
+        and t.status_cd = '0'
+        and t.state in ('20200405','20200406')
+    </select>
+
+    <!-- 查询已完成保养单 -->
+    <select id="getFinishMaintainanceOrderCount" parameterType="Map" resultType="Map">
+        select count(1) maintainanceCount
+        from maintainance_task t
+        where 1=1
+        and t.community_id = #{communityId}
+        and t.create_time &gt; #{startDate}
+        and t.create_time &lt; #{endDate}
+        and t.status_cd = '0'
+        and t.state = '20200407'
+    </select>
+
+    <!-- 查询保养单 -->
+    <select id="getNotepadOrderCount" parameterType="Map" resultType="Map">
+        select count(1) notepadCount
+        from notepad t
+        left join building_room br on t.room_id = br.room_id and br.status_cd = '0'
+        where 1=1
+        and br.community_id = #{communityId}
+        and t.create_time &gt; #{startDate}
+        and t.create_time &lt; #{endDate}
+        and t.status_cd = '0'
+    </select>
+
+    <!-- 查询未完成保养单 -->
+    <select id="getChargeMachineOrderCount" parameterType="Map" resultType="Map">
+        select count(1) chargeMachineCount
+        from charge_machine_order t
+        where 1=1
+        and t.community_id = #{communityId}
+        and t.create_time &gt; #{startDate}
+        and t.create_time &lt; #{endDate}
+        and t.status_cd = '0'
+    </select>
+
+    <!-- 查询已完成保养单 -->
+    <select id="getChargeMonthOrderCount" parameterType="Map" resultType="Map">
+        select ifnull(sum(t.received_amount),0.0) chargeMonthMoney
+        from charge_month_order t
+        where 1=1
+        and t.community_id = #{communityId}
+        and t.create_time &gt; #{startDate}
+        and t.create_time &lt; #{endDate}
+        and t.status_cd = '0'
+    </select>
+
 </mapper>
 </mapper>

+ 18 - 0
java110-interface/src/main/java/com/java110/intf/report/IReportOrderStatisticsInnerServiceSMO.java

@@ -65,4 +65,22 @@ public interface IReportOrderStatisticsInnerServiceSMO {
 
 
     @RequestMapping(value = "/getFinishInspectionOrderCount", method = RequestMethod.POST)
     @RequestMapping(value = "/getFinishInspectionOrderCount", method = RequestMethod.POST)
     double getFinishInspectionOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
     double getFinishInspectionOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getMaintainanceOrderCount", method = RequestMethod.POST)
+    double getMaintainanceOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getUndoMaintainanceOrderCount", method = RequestMethod.POST)
+    double getUndoMaintainanceOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getFinishMaintainanceOrderCount", method = RequestMethod.POST)
+    double getFinishMaintainanceOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getNotepadOrderCount", method = RequestMethod.POST)
+    double getNotepadOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getChargeMachineOrderCount", method = RequestMethod.POST)
+    double getChargeMachineOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
+
+    @RequestMapping(value = "/getChargeMonthOrderCount", method = RequestMethod.POST)
+    double getChargeMonthOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto);
 }
 }

+ 44 - 2
service-report/src/main/java/com/java110/report/cmd/dataReport/QueryOrderDataReportCmd.java

@@ -99,20 +99,62 @@ public class QueryOrderDataReportCmd extends Cmd {
         data.put("value", inspectionOrderCount);
         data.put("value", inspectionOrderCount);
         datas.add(data);
         datas.add(data);
 
 
-        // todo 查询 报修单
+        // todo 查询 未完成巡检
         double undoInspectionOrderCount = orderStatisticsImpl.getUndoInspectionOrderCount(queryStatisticsDto);
         double undoInspectionOrderCount = orderStatisticsImpl.getUndoInspectionOrderCount(queryStatisticsDto);
         data = new JSONObject();
         data = new JSONObject();
         data.put("name","未完成巡检");
         data.put("name","未完成巡检");
         data.put("value", undoInspectionOrderCount);
         data.put("value", undoInspectionOrderCount);
         datas.add(data);
         datas.add(data);
 
 
-        // todo 查询 报修单
+        // todo 查询 完成巡检
         double finishInspectionOrderCount = orderStatisticsImpl.getFinishInspectionOrderCount(queryStatisticsDto);
         double finishInspectionOrderCount = orderStatisticsImpl.getFinishInspectionOrderCount(queryStatisticsDto);
         data = new JSONObject();
         data = new JSONObject();
         data.put("name","完成巡检");
         data.put("name","完成巡检");
         data.put("value", finishInspectionOrderCount);
         data.put("value", finishInspectionOrderCount);
         datas.add(data);
         datas.add(data);
 
 
+        // todo 查询 保养
+        double maintainanceOrderCount = orderStatisticsImpl.getMaintainanceOrderCount(queryStatisticsDto);
+        data = new JSONObject();
+        data.put("name","保养");
+        data.put("value", maintainanceOrderCount);
+        datas.add(data);
+
+        // todo 查询 未完成 保养
+        double undoMaintainanceOrderCount = orderStatisticsImpl.getUndoMaintainanceOrderCount(queryStatisticsDto);
+        data = new JSONObject();
+        data.put("name","未完成保养");
+        data.put("value", undoMaintainanceOrderCount);
+        datas.add(data);
+
+        // todo 查询 已完成 保养
+        double finishMaintainanceOrderCount = orderStatisticsImpl.getFinishMaintainanceOrderCount(queryStatisticsDto);
+        data = new JSONObject();
+        data.put("name","完成保养");
+        data.put("value", finishMaintainanceOrderCount);
+        datas.add(data);
+
+        // todo 查询 业主反馈
+        double notepadOrderCount = orderStatisticsImpl.getNotepadOrderCount(queryStatisticsDto);
+        data = new JSONObject();
+        data.put("name","保养");
+        data.put("value", notepadOrderCount);
+        datas.add(data);
+
+        // todo 查询 充电订单
+        double chargeMachineOrderCount = orderStatisticsImpl.getChargeMachineOrderCount(queryStatisticsDto);
+        data = new JSONObject();
+        data.put("name","充电订单");
+        data.put("value", chargeMachineOrderCount);
+        datas.add(data);
+
+        // todo 查询 月卡金额
+        double chargeMonthOrderMoney = orderStatisticsImpl.getChargeMonthOrderCount(queryStatisticsDto);
+        data = new JSONObject();
+        data.put("name","月卡实收");
+        data.put("value", chargeMonthOrderMoney);
+        datas.add(data);
+
 
 
         context.setResponseEntity(ResultVo.createResponseEntity(datas));
         context.setResponseEntity(ResultVo.createResponseEntity(datas));
     }
     }

+ 12 - 0
service-report/src/main/java/com/java110/report/dao/IReportOrderStatisticsServiceDao.java

@@ -40,4 +40,16 @@ public interface IReportOrderStatisticsServiceDao {
     double getUndoInspectionOrderCount(Map info);
     double getUndoInspectionOrderCount(Map info);
 
 
     double getFinishInspectionOrderCount(Map info);
     double getFinishInspectionOrderCount(Map info);
+
+    double getMaintainanceOrderCount(Map info);
+
+    double getUndoMaintainanceOrderCount(Map info);
+
+    double getFinishMaintainanceOrderCount(Map info);
+
+    double getNotepadOrderCount(Map info);
+
+    double getChargeMachineOrderCount(Map info);
+
+    double getChargeMonthOrderCount(Map info);
 }
 }

+ 78 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportOrderStatisticsServiceDaoImpl.java

@@ -147,4 +147,82 @@ public class ReportOrderStatisticsServiceDaoImpl extends BaseServiceDao implemen
         return Double.parseDouble(infos.get(0).get("inspectionCount").toString());
         return Double.parseDouble(infos.get(0).get("inspectionCount").toString());
     }
     }
 
 
+    @Override
+    public double getMaintainanceOrderCount(Map info) {
+        logger.debug("查询 getMaintainanceOrderCount 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportOrderStatisticsServiceDaoImpl.getMaintainanceOrderCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("maintainanceCount").toString());
+    }
+
+    @Override
+    public double getUndoMaintainanceOrderCount(Map info) {
+        logger.debug("查询 getUndoMaintainanceOrderCount 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportOrderStatisticsServiceDaoImpl.getUndoMaintainanceOrderCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("maintainanceCount").toString());
+    }
+
+    @Override
+    public double getFinishMaintainanceOrderCount(Map info) {
+        logger.debug("查询 getFinishMaintainanceOrderCount 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportOrderStatisticsServiceDaoImpl.getFinishMaintainanceOrderCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("maintainanceCount").toString());
+    }
+
+    @Override
+    public double getNotepadOrderCount(Map info) {
+        logger.debug("查询 getNotepadOrderCount 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportOrderStatisticsServiceDaoImpl.getNotepadOrderCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("notepadCount").toString());
+    }
+
+    @Override
+    public double getChargeMachineOrderCount(Map info) {
+        logger.debug("查询 getChargeMachineOrderCount 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportOrderStatisticsServiceDaoImpl.getChargeMachineOrderCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("chargeMachineCount").toString());
+    }
+
+    @Override
+    public double getChargeMonthOrderCount(Map info) {
+        logger.debug("查询 getChargeMonthOrderCount 入参 info : {}", JSONObject.toJSONString(info));
+
+        List<Map> infos = sqlSessionTemplate.selectList("reportOrderStatisticsServiceDaoImpl.getChargeMonthOrderCount", info);
+
+        if (infos == null || infos.size() < 1) {
+            return 0;
+        }
+
+        return Double.parseDouble(infos.get(0).get("chargeMonthMoney").toString());
+    }
+
 }
 }

+ 36 - 0
service-report/src/main/java/com/java110/report/smo/impl/ReportOrderStatisticsInnerServiceSMOImpl.java

@@ -100,4 +100,40 @@ public class ReportOrderStatisticsInnerServiceSMOImpl extends BaseServiceSMO imp
         return info;
         return info;
     }
     }
 
 
+    @Override
+    public double getMaintainanceOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportOrderStatisticsServiceDaoImpl.getMaintainanceOrderCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public double getUndoMaintainanceOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportOrderStatisticsServiceDaoImpl.getUndoMaintainanceOrderCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public double getFinishMaintainanceOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportOrderStatisticsServiceDaoImpl.getFinishMaintainanceOrderCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public double getNotepadOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportOrderStatisticsServiceDaoImpl.getNotepadOrderCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public double getChargeMachineOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportOrderStatisticsServiceDaoImpl.getChargeMachineOrderCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
+    @Override
+    public double getChargeMonthOrderCount(@RequestBody QueryStatisticsDto queryStatisticsDto) {
+        double info = reportOrderStatisticsServiceDaoImpl.getChargeMonthOrderCount(BeanConvertUtil.beanCovertMap(queryStatisticsDto));
+        return info;
+    }
+
 }
 }

+ 42 - 0
service-report/src/main/java/com/java110/report/statistics/IOrderStatistics.java

@@ -59,4 +59,46 @@ public interface IOrderStatistics {
     double getUndoInspectionOrderCount(QueryStatisticsDto queryStatisticsDto);
     double getUndoInspectionOrderCount(QueryStatisticsDto queryStatisticsDto);
 
 
     double getFinishInspectionOrderCount(QueryStatisticsDto queryStatisticsDto);
     double getFinishInspectionOrderCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询保养单
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getMaintainanceOrderCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询未完成保养
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getUndoMaintainanceOrderCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询已完成保养
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getFinishMaintainanceOrderCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询业主反馈
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getNotepadOrderCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询充电金额
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getChargeMachineOrderCount(QueryStatisticsDto queryStatisticsDto);
+
+    /**
+     * 查询月卡实收
+     * @param queryStatisticsDto
+     * @return
+     */
+    double getChargeMonthOrderCount(QueryStatisticsDto queryStatisticsDto);
 }
 }

+ 30 - 0
service-report/src/main/java/com/java110/report/statistics/impl/OrderStatisticsImpl.java

@@ -80,4 +80,34 @@ public class OrderStatisticsImpl implements IOrderStatistics {
     public double getFinishInspectionOrderCount(QueryStatisticsDto queryStatisticsDto) {
     public double getFinishInspectionOrderCount(QueryStatisticsDto queryStatisticsDto) {
         return reportOrderStatisticsInnerServiceSMOImpl.getFinishInspectionOrderCount(queryStatisticsDto);
         return reportOrderStatisticsInnerServiceSMOImpl.getFinishInspectionOrderCount(queryStatisticsDto);
     }
     }
+
+    @Override
+    public double getMaintainanceOrderCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportOrderStatisticsInnerServiceSMOImpl.getMaintainanceOrderCount(queryStatisticsDto);
+    }
+
+    @Override
+    public double getUndoMaintainanceOrderCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportOrderStatisticsInnerServiceSMOImpl.getUndoMaintainanceOrderCount(queryStatisticsDto);
+    }
+
+    @Override
+    public double getFinishMaintainanceOrderCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportOrderStatisticsInnerServiceSMOImpl.getFinishMaintainanceOrderCount(queryStatisticsDto);
+    }
+
+    @Override
+    public double getNotepadOrderCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportOrderStatisticsInnerServiceSMOImpl.getNotepadOrderCount(queryStatisticsDto);
+    }
+
+    @Override
+    public double getChargeMachineOrderCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportOrderStatisticsInnerServiceSMOImpl.getChargeMachineOrderCount(queryStatisticsDto);
+    }
+
+    @Override
+    public double getChargeMonthOrderCount(QueryStatisticsDto queryStatisticsDto) {
+        return reportOrderStatisticsInnerServiceSMOImpl.getChargeMonthOrderCount(queryStatisticsDto);
+    }
 }
 }