wangbo 3 years ago
parent
commit
e2b88e7125

+ 3 - 3
operation_manager/src/main/java/com/huaxu/order/controller/WorkOrderStatisticsController.java

@@ -156,7 +156,7 @@ public class WorkOrderStatisticsController {
                 endDate = subMonth(startDate, 1);
                 break;
             case 1:
-                maintainerCount = userCenterClient.findMaintainerCount(String.format("%-12",startDate));
+                maintainerCount = userCenterClient.findMaintainerCount(String.format("%s-12",startDate));
                 startDate = String.format("%s-01-01", startDate);
                 endDate = subYear(startDate, 1);
                 break;
@@ -174,7 +174,7 @@ public class WorkOrderStatisticsController {
         } else if (type == 1) {
             statistics = workOrderManageService.eventYearStatistics(workOrderManageDto);
         }
-        DecimalFormat df = new DecimalFormat("#.00");
+        DecimalFormat df = new DecimalFormat("#0.00");
         for(Map<String,Object> map : statistics){
             double number = 0;
             if(maintainerCount > 0){
@@ -227,7 +227,7 @@ public class WorkOrderStatisticsController {
 
     private List<StatisticsDto> CalculatePercentage(List<StatisticsDto> list) {
         double total = 0;
-        DecimalFormat df = new DecimalFormat("#.00");
+        DecimalFormat df = new DecimalFormat("#0.00");
         for (StatisticsDto statisticsDto : list) {
             if (statisticsDto.getStatisticsValue() != null) {
                 total += statisticsDto.getStatisticsValue();

+ 1 - 1
operation_manager/src/main/java/com/huaxu/order/service/impl/WorkOrderManageServiceImpl.java

@@ -193,7 +193,7 @@ public class WorkOrderManageServiceImpl implements WorkOrderManageService {
         for(int i=0;i<list.size();i++){
             Map<String,Object> map =list.get(i);
             int month = Integer.parseInt(map.get("日期").toString().substring(5,7));
-            list.get(month-1).put("数量",map.get("数量"));
+            result.get(month-1).put("数量",map.get("数量"));
         }
         return result;
     }

+ 4 - 10
operation_manager/src/main/resources/mapper/order/WorkOrderManageMapper.xml

@@ -915,8 +915,6 @@
 
   <!--事件数据月统计-->
   <select id="eventMonthStatistics" resultType="map">
-    select 数量,日期 from
-    (
     select count(1) 数量,date_format(date_create,'%Y-%m-%d') 日期
     from sc_work_order_manage t1
     <where>
@@ -954,15 +952,12 @@
       </if>
     </where>
     group by date_format(date_create,'%Y-%m-%d')
-    ) a
-    order by 日期
+    order by date_format(date_create,'%Y-%m-%d')
   </select>
 
   <!--事件数据年统计-->
   <select id="eventYearStatistics" resultType="map">
-    select 数量,日期 from
-    (
-    select count(1) 数量,date_format(date_create,'%Y-%c') 日期
+    select count(1) 数量,date_format(date_create,'%Y-%m') 日期
     from sc_work_order_manage t1
     <where>
       t1.date_create &gt;= date_format(#{order.startDate,jdbcType=VARCHAR},'%Y-%m-%d')
@@ -998,9 +993,8 @@
         </if>
       </if>
     </where>
-    group by date_format(date_create,'%Y-%c')
-    ) a
-    order by 日期
+    group by date_format(date_create,'%Y-%m')
+    order by date_format(date_create,'%Y-%m')
   </select>
 
   <!--上报类型统计-->