Browse Source

月份统计下穿

lamphua 3 weeks ago
parent
commit
abf14d9119
40 changed files with 1450 additions and 410 deletions
  1. 0
    4
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/file/FilesProjectController.java
  2. 0
    1
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBidController.java
  3. 46
    6
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBorrowController.java
  4. 25
    1
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarController.java
  5. 40
    8
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCheckController.java
  6. 0
    3
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcContractController.java
  7. 27
    3
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceController.java
  8. 379
    133
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcProjectController.java
  9. 38
    4
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSettleController.java
  10. 0
    2
      oa-back/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
  11. 0
    4
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/dto/FlowNextDto.java
  12. 0
    4
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/dto/FlowTaskDto.java
  13. 0
    3
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/vo/FlowQueryVo.java
  14. 0
    4
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/vo/ReturnTaskNodeVo.java
  15. 0
    4
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/flow/FindNextNodeUtil.java
  16. 0
    1
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/flow/FlowableUtils.java
  17. 0
    2
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/listener/FlowExecutionListener.java
  18. 0
    1
      oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowInstanceServiceImpl.java
  19. 107
    18
      oa-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcAgentServiceImpl.java
  20. 0
    6
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSettle.java
  21. 8
    0
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcProjectMapper.java
  22. 0
    3
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcContractService.java
  23. 8
    1
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcProjectService.java
  24. 12
    0
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcProjectServiceImpl.java
  25. 0
    1
      oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/TreeSelectNew.java
  26. 1
    1
      oa-back/ruoyi-system/src/main/resources/mapper/file/FilesAchievementMapper.xml
  27. 1
    0
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBorrowMapper.xml
  28. 12
    1
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml
  29. 10
    0
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCheckMapper.xml
  30. 12
    1
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml
  31. 35
    0
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProjectMapper.xml
  32. 11
    0
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSettleMapper.xml
  33. 2
    1
      oa-ui/src/api/oa/device/device.js
  34. 1
    1
      oa-ui/src/utils/echarts.js
  35. 133
    26
      oa-ui/src/views/statistics/components/borrowStatistics.vue
  36. 166
    53
      oa-ui/src/views/statistics/components/carDeviceStatistics.vue
  37. 19
    20
      oa-ui/src/views/statistics/components/contractStatistics.vue
  38. 209
    34
      oa-ui/src/views/statistics/components/projectStatistics.vue
  39. 142
    49
      oa-ui/src/views/statistics/components/settleStatistics.vue
  40. 6
    6
      oa-ui/src/views/statistics/components/topHead.vue

+ 0
- 4
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/file/FilesProjectController.java View File

@@ -7,7 +7,6 @@ import com.ruoyi.common.core.page.TableDataInfo;
7 7
 import com.ruoyi.common.enums.BusinessType;
8 8
 import com.ruoyi.common.utils.SnowFlake;
9 9
 import com.ruoyi.common.utils.poi.ExcelUtil;
10
-import com.ruoyi.file.service.IFilesStorageService;
11 10
 import com.ruoyi.oa.domain.CmcProject;
12 11
 import com.ruoyi.oa.service.ICmcProjectService;
13 12
 import com.ruoyi.system.service.ISysDeptService;
@@ -41,9 +40,6 @@ public class FilesProjectController extends BaseController {
41 40
     @Autowired
42 41
     private ISysUserService userService;
43 42
 
44
-    @Autowired
45
-    private IFilesStorageService filesStorageService;
46
-
47 43
     @Value("${cmc.profile}")
48 44
     private String profile;
49 45
 

+ 0
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBidController.java View File

@@ -9,7 +9,6 @@ import java.io.InputStream;
9 9
 import java.io.InputStreamReader;
10 10
 import java.net.HttpURLConnection;
11 11
 import java.net.URL;
12
-import java.net.URLEncoder;
13 12
 import java.nio.charset.StandardCharsets;
14 13
 import java.util.zip.GZIPInputStream;
15 14
 

+ 46
- 6
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBorrowController.java View File

@@ -4,7 +4,10 @@ import java.math.BigDecimal;
4 4
 import java.text.ParseException;
5 5
 import java.text.SimpleDateFormat;
6 6
 import java.util.Calendar;
7
+import java.util.HashMap;
7 8
 import java.util.List;
9
+import java.util.Map;
10
+
8 11
 import javax.servlet.http.HttpServletResponse;
9 12
 
10 13
 import com.alibaba.fastjson2.JSONArray;
@@ -81,8 +84,13 @@ public class CmcBorrowController extends BaseController
81 84
         JSONObject jsonObject = new JSONObject();
82 85
         JSONArray yearArray = new JSONArray();
83 86
         JSONObject yearObject = new JSONObject();
87
+        JSONArray monthArray = new JSONArray();
88
+        JSONObject monthObject = new JSONObject();
89
+        JSONArray monthAmountArray = new JSONArray();
90
+        JSONObject monthAmountObject = new JSONObject();
84 91
         JSONArray amountArray = new JSONArray();
85 92
         JSONObject amountObject = new JSONObject();
93
+        
86 94
         JSONArray usageArray = new JSONArray();
87 95
         JSONObject usageObject = new JSONObject();
88 96
         JSONArray usageAmountArray = new JSONArray();
@@ -91,8 +99,9 @@ public class CmcBorrowController extends BaseController
91 99
         JSONObject yearProjectCountObject = new JSONObject();
92 100
         JSONArray yearProjectAmountArray = new JSONArray();
93 101
         JSONObject yearProjectAmountObject = new JSONObject();
94
-        //每年借款金额
102
+        //整体
95 103
         if (cmcBorrow.getLendTime() == null) {
104
+            //每年借款金额
96 105
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
97 106
                 cmcBorrow.setLendTime(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
98 107
                 List<CmcBorrow> yearList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
@@ -106,23 +115,54 @@ public class CmcBorrowController extends BaseController
106 115
             }
107 116
             cmcBorrow.setLendTime(null);
108 117
         }
118
+        //年度
109 119
         else {
110
-            yearObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getLendTime()), cmcBorrowService.selectCmcBorrowList(cmcBorrow).size());
111
-            BigDecimal amount = new BigDecimal(0);
112
-            for (CmcBorrow borrow : cmcBorrowService.selectCmcBorrowList(cmcBorrow)) {
120
+            String year = new SimpleDateFormat("yyyy").format(cmcBorrow.getLendTime());
121
+            //该年借款次数
122
+            cmcBorrow.setLendTime(new SimpleDateFormat("yyyy").parse(year));
123
+            List<CmcBorrow> yearList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
124
+            yearObject.put(year, yearList.size());
125
+            BigDecimal yearAmount = new BigDecimal(0);
126
+            for (CmcBorrow borrow : yearList) {
113 127
                 if (borrow.getManagerAmount() != null)
114
-                    amount = amount.add(borrow.getManagerAmount());
128
+                    yearAmount = yearAmount.add(borrow.getManagerAmount());
129
+            }
130
+            amountObject.put(year, yearAmount);
131
+            
132
+            //按月份统计
133
+            for (int i = 1; i <= 12; i++) {
134
+                String monthStr = String.format("%02d", i);
135
+                String monthKey = year + "-" + monthStr;
136
+                String beginTimeString = monthKey + "-01";
137
+                
138
+                Map<String, Object> params = new HashMap<>();
139
+                params.put("beginTime", beginTimeString + " 00:00:00");
140
+                cmcBorrow.setParams(params);
141
+                cmcBorrow.setLendTime(new SimpleDateFormat("yyyy-MM").parse(beginTimeString));
142
+                List<CmcBorrow> monthBorrowList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
143
+                monthObject.put(monthKey, monthBorrowList.size());
144
+                
145
+                BigDecimal monthAmount = new BigDecimal(0);
146
+                for (CmcBorrow borrow : monthBorrowList) {
147
+                    if (borrow.getManagerAmount() != null)
148
+                        monthAmount = monthAmount.add(borrow.getManagerAmount());
149
+                }
150
+                monthAmountObject.put(monthKey, monthAmount);
115 151
             }
116
-            amountObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getLendTime()), amount);
152
+            cmcBorrow.setParams(null);
117 153
         }
118 154
         getBorrowUsageStatistic(cmcBorrow, usageObject, usageAmountObject, yearProjectCountObject, yearProjectAmountObject);
119 155
         yearArray.add(yearObject);
156
+        monthArray.add(monthObject);
157
+        monthAmountArray.add(monthAmountObject);
120 158
         amountArray.add(amountObject);
121 159
         usageArray.add(usageObject);
122 160
         usageAmountArray.add(usageAmountObject);
123 161
         yearProjectCountArray.add(yearProjectCountObject);
124 162
         yearProjectAmountArray.add(yearProjectAmountObject);
125 163
         jsonObject.put("year", yearArray);
164
+        jsonObject.put("month", monthArray);
165
+        jsonObject.put("monthAmount", monthAmountArray);
126 166
         jsonObject.put("amount", amountArray);
127 167
         jsonObject.put("usage", usageArray);
128 168
         jsonObject.put("usageAmount", usageAmountArray);

+ 25
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarController.java View File

@@ -91,6 +91,8 @@ public class CmcCarController extends BaseController
91 91
         JSONObject usageObject = new JSONObject();
92 92
         JSONArray approvalArray = new JSONArray();
93 93
         JSONArray dayArray = new JSONArray();
94
+        JSONArray monthArray = new JSONArray();
95
+        JSONObject monthObject = new JSONObject();
94 96
         CmcCar cmcCar = new CmcCar();
95 97
         cmcCar.setIsRent("0");
96 98
         cmcCar.setStatus("0");
@@ -117,20 +119,42 @@ public class CmcCarController extends BaseController
117 119
         }
118 120
         //年度
119 121
         else {
122
+            String yearStr = new SimpleDateFormat("yyyy").format(cmcCarApproval.getApplyDate());
120 123
             //输入年份派车次数
121
-            yearObject.put(new SimpleDateFormat("yyyy").format(cmcCarApproval.getApplyDate()), cmcCarApprovalService.selectCmcCarApprovalList(cmcCarApproval).size());
124
+            cmcCarApproval.setApplyDate(new SimpleDateFormat("yyyy").parse(yearStr));
125
+            List<CmcCarApproval> yearList = cmcCarApprovalService.selectCmcCarApprovalList(cmcCarApproval);
126
+            yearObject.put(yearStr, yearList.size());
127
+            
128
+            //月度统计
129
+            for (int i = 1; i <= 12; i++) {
130
+                String monthStr = String.format("%02d", i);
131
+                String monthKey = yearStr + "-" + monthStr;
132
+                String beginTimeString = monthKey + "-01";
133
+                
134
+                Map<String, Object> params = new HashMap<>();
135
+                params.put("beginTime", beginTimeString + " 00:00:00");
136
+                cmcCarApproval.setParams(params);
137
+                cmcCarApproval.setApplyDate(new SimpleDateFormat("yyyy-MM").parse(beginTimeString));
138
+                
139
+                List<CmcCarApproval> monthList = cmcCarApprovalService.selectCmcCarApprovalList(cmcCarApproval);
140
+                monthObject.put(monthKey, monthList.size());
141
+                cmcCarApproval.setParams(null);
142
+            }
122 143
         }
123 144
         getCarUsageStatistic(cmcCarApproval, usageObject);
124 145
         getCarApprovalStatistic(cmcCarApproval, approvalArray);
125 146
         getCarDayStatistic(cmcCarApproval, dayArray);
147
+        cmcCarApproval.setApplyDate(null);
126 148
         yearArray.add(yearObject);
127 149
         statusArray.add(statusObject);
128 150
         usageArray.add(usageObject);
151
+        monthArray.add(monthObject);
129 152
         jsonObject.put("year", yearArray);
130 153
         jsonObject.put("status", statusArray);
131 154
         jsonObject.put("usage", usageArray);
132 155
         jsonObject.put("approval", approvalArray);
133 156
         jsonObject.put("day", dayArray);
157
+        jsonObject.put("month", monthArray);
134 158
         jsonObject.getJSONArray("approval").sort((a,b)->((JSONObject)b).getIntValue("count") - ((JSONObject)a).getIntValue("count"));
135 159
         jsonObject.getJSONArray("day").sort((a,b)->((JSONObject)b).getIntValue("count") - ((JSONObject)a).getIntValue("count"));
136 160
         return success(jsonObject);

+ 40
- 8
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCheckController.java View File

@@ -4,13 +4,14 @@ import java.math.BigDecimal;
4 4
 import java.text.ParseException;
5 5
 import java.text.SimpleDateFormat;
6 6
 import java.util.Calendar;
7
+import java.util.HashMap;
7 8
 import java.util.List;
9
+import java.util.Map;
8 10
 import javax.servlet.http.HttpServletResponse;
9 11
 
10 12
 import com.alibaba.fastjson2.JSONArray;
11 13
 import com.alibaba.fastjson2.JSONObject;
12 14
 import com.ruoyi.oa.domain.CmcCheck;
13
-import com.ruoyi.oa.service.ICmcBudgetService;
14 15
 import org.springframework.beans.factory.annotation.Autowired;
15 16
 import org.springframework.web.bind.annotation.GetMapping;
16 17
 import org.springframework.web.bind.annotation.PostMapping;
@@ -41,9 +42,6 @@ public class CmcCheckController extends BaseController
41 42
     @Autowired
42 43
     private ICmcCheckService cmcCheckService;
43 44
 
44
-    @Autowired
45
-    private ICmcBudgetService cmcBudgetService;
46
-
47 45
     /**
48 46
      * 查询cmc项目核算列表
49 47
      */
@@ -90,7 +88,11 @@ public class CmcCheckController extends BaseController
90 88
         JSONObject yearProjectCountObject = new JSONObject();
91 89
         JSONArray yearProjectAmountArray = new JSONArray();
92 90
         JSONObject yearProjectAmountObject = new JSONObject();
93
-        //每年核算金额
91
+        JSONArray monthArray = new JSONArray();
92
+        JSONObject monthObject = new JSONObject();
93
+        JSONArray monthAmountArray = new JSONArray();
94
+        JSONObject monthAmountObject = new JSONObject();
95
+        //每年核算数量和金额
94 96
         if (cmcCheck.getCheckTime() == null) {
95 97
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
96 98
                 cmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
@@ -105,23 +107,53 @@ public class CmcCheckController extends BaseController
105 107
             cmcCheck.setCheckTime(null);
106 108
         }
107 109
         else {
108
-            yearObject.put(new SimpleDateFormat("yyyy").format(cmcCheck.getCheckTime()), cmcCheckService.selectCmcCheckList(cmcCheck).size());
110
+            String yearStr = new SimpleDateFormat("yyyy").format(cmcCheck.getCheckTime());
111
+            cmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse(yearStr));
112
+            List<CmcCheck> yearList = cmcCheckService.selectCmcCheckList(cmcCheck);
113
+            yearObject.put(yearStr, yearList.size());
109 114
             BigDecimal amount = new BigDecimal(0);
110
-            for (CmcCheck check : cmcCheckService.selectCmcCheckList(cmcCheck)) {
115
+            for (CmcCheck check : yearList) {
111 116
                 if (check.getTotalAdjust() != null)
112 117
                     amount = amount.add(check.getTotalAdjust());
113 118
             }
114
-            amountObject.put(new SimpleDateFormat("yyyy").format(cmcCheck.getCheckTime()), amount);
119
+            amountObject.put(yearStr, amount);
120
+            
121
+            //月度统计
122
+            for (int i = 1; i <= 12; i++) {
123
+                String monthStr = String.format("%02d", i);
124
+                String monthKey = yearStr + "-" + monthStr;
125
+                String beginTimeString = monthKey + "-01";
126
+                
127
+                Map<String, Object> params = new HashMap<>();
128
+                params.put("beginTime", beginTimeString + " 00:00:00");
129
+                cmcCheck.setParams(params);
130
+                cmcCheck.setCheckTime(new SimpleDateFormat("yyyy-MM").parse(beginTimeString));
131
+                
132
+                List<CmcCheck> monthList = cmcCheckService.selectCmcCheckList(cmcCheck);
133
+                monthObject.put(monthKey, monthList.size());
134
+                BigDecimal monthAmount = new BigDecimal(0);
135
+                for (CmcCheck check : monthList) {
136
+                    if (check.getTotalAdjust() != null)
137
+                        monthAmount = monthAmount.add(check.getTotalAdjust());
138
+                }
139
+                monthAmountObject.put(monthKey, monthAmount);
140
+                cmcCheck.setParams(null);
141
+            }
115 142
         }
143
+        cmcCheck.setCheckTime(null);
116 144
         getCheckProjectStatistic(cmcCheck, yearProjectCountObject, yearProjectAmountObject);
117 145
         yearArray.add(yearObject);
118 146
         amountArray.add(amountObject);
119 147
         yearProjectCountArray.add(yearProjectCountObject);
120 148
         yearProjectAmountArray.add(yearProjectAmountObject);
149
+        monthArray.add(monthObject);
150
+        monthAmountArray.add(monthAmountObject);
121 151
         jsonObject.put("year", yearArray);
122 152
         jsonObject.put("amount", amountArray);
123 153
         jsonObject.put("yearProjectCount", yearProjectCountArray);
124 154
         jsonObject.put("yearProjectAmount", yearProjectAmountArray);
155
+        jsonObject.put("month", monthArray);
156
+        jsonObject.put("monthAmount", monthAmountArray);
125 157
         return success(jsonObject);
126 158
     }
127 159
 

+ 0
- 3
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcContractController.java View File

@@ -42,9 +42,6 @@ public class CmcContractController extends BaseController
42 42
     @Autowired
43 43
     private ICmcContractService cmcContractService;
44 44
 
45
-    @Autowired
46
-    private ICmcContractPaidService cmcContractPaidService;
47
-
48 45
     /**
49 46
      * 查询cmc合同评审列表
50 47
      */

+ 27
- 3
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceController.java View File

@@ -99,6 +99,8 @@ public class CmcDeviceController extends BaseController
99 99
         JSONArray statusArray = new JSONArray();
100 100
         JSONObject statusObject = new JSONObject();
101 101
         JSONArray approvalArray = new JSONArray();
102
+        JSONArray monthArray = new JSONArray();
103
+        JSONObject monthObject = new JSONObject();
102 104
         CmcDevice cmcDevice = new CmcDevice();
103 105
         cmcDevice.setStatus("0");
104 106
         statusObject.put("被领用", cmcDeviceService.selectCmcDeviceList(cmcDevice).size());
@@ -114,7 +116,7 @@ public class CmcDeviceController extends BaseController
114 116
         statusObject.put("已处置", cmcDeviceService.selectCmcDeviceList(cmcDevice).size());
115 117
         //整体
116 118
         if (cmcDeviceApproval.getApplyDate() == null) {
117
-            //每年派车次数
119
+            //每年设备申请次数
118 120
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
119 121
                 //总数
120 122
                 cmcDeviceApproval.setApplyDate(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
@@ -125,15 +127,37 @@ public class CmcDeviceController extends BaseController
125 127
         }
126 128
         //年度
127 129
         else {
128
-            //输入年份派车次数
129
-            yearObject.put(new SimpleDateFormat("yyyy").format(cmcDeviceApproval.getApplyDate()), cmcDeviceApprovalService.selectCmcDeviceApprovalList(cmcDeviceApproval).size());
130
+            String yearStr = new SimpleDateFormat("yyyy").format(cmcDeviceApproval.getApplyDate());
131
+            //输入年份设备申请次数
132
+            cmcDeviceApproval.setApplyDate(new SimpleDateFormat("yyyy").parse(yearStr));
133
+            List<CmcDeviceApproval> yearList = cmcDeviceApprovalService.selectCmcDeviceApprovalList(cmcDeviceApproval);
134
+            yearObject.put(yearStr, yearList.size());
135
+            
136
+            //月度统计
137
+            for (int i = 1; i <= 12; i++) {
138
+                String monthStr = String.format("%02d", i);
139
+                String monthKey = yearStr + "-" + monthStr;
140
+                String beginTimeString = monthKey + "-01";
141
+                
142
+                Map<String, Object> params = new HashMap<>();
143
+                params.put("beginTime", beginTimeString + " 00:00:00");
144
+                cmcDeviceApproval.setParams(params);
145
+                cmcDeviceApproval.setApplyDate(new SimpleDateFormat("yyyy-MM").parse(beginTimeString));
146
+                
147
+                List<CmcDeviceApproval> monthList = cmcDeviceApprovalService.selectCmcDeviceApprovalList(cmcDeviceApproval);
148
+                monthObject.put(monthKey, monthList.size());
149
+                cmcDeviceApproval.setParams(null);
150
+            }
130 151
         }
131 152
         getDeviceApprovalStatistic(cmcDeviceApproval, approvalArray);
153
+        cmcDeviceApproval.setApplyDate(null);
132 154
         yearArray.add(yearObject);
133 155
         statusArray.add(statusObject);
156
+        monthArray.add(monthObject);
134 157
         jsonObject.put("year", yearArray);
135 158
         jsonObject.put("status", statusArray);
136 159
         jsonObject.put("approval", approvalArray);
160
+        jsonObject.put("month", monthArray);
137 161
         jsonObject.getJSONArray("approval").sort((a,b)->((JSONObject)b).getIntValue("count") - ((JSONObject)a).getIntValue("count"));
138 162
         return success(jsonObject);
139 163
     }

+ 379
- 133
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcProjectController.java View File

@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
10 10
 import com.alibaba.fastjson2.JSONArray;
11 11
 import com.alibaba.fastjson2.JSONObject;
12 12
 import com.ruoyi.common.core.domain.entity.SysRole;
13
+import com.ruoyi.common.utils.DateUtils;
13 14
 import com.ruoyi.common.core.domain.entity.SysUser;
14 15
 import com.ruoyi.common.utils.StringUtils;
15 16
 import com.ruoyi.file.domain.FilesAchievement;
@@ -17,7 +18,6 @@ import com.ruoyi.file.service.IFilesAchievementService;
17 18
 import com.ruoyi.oa.domain.*;
18 19
 import com.ruoyi.oa.service.*;
19 20
 import com.ruoyi.system.service.ISysDeptService;
20
-import com.ruoyi.system.service.ISysRoleService;
21 21
 import com.ruoyi.system.service.ISysUserService;
22 22
 import com.ruoyi.web.controller.qyweixin.MessageController;
23 23
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,8 +37,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
37 37
  */
38 38
 @RestController
39 39
 @RequestMapping("/oa/project")
40
-public class CmcProjectController extends BaseController
41
-{
40
+public class CmcProjectController extends BaseController {
42 41
     @Autowired
43 42
     private ICmcProjectService cmcProjectService;
44 43
 
@@ -60,9 +59,6 @@ public class CmcProjectController extends BaseController
60 59
     @Autowired
61 60
     private ISysUserService userService;
62 61
 
63
-    @Autowired
64
-    private ISysRoleService roleService;
65
-
66 62
     @Autowired
67 63
     private ICmcManageDeptService cmcManageDeptService;
68 64
 
@@ -82,8 +78,7 @@ public class CmcProjectController extends BaseController
82 78
      * 查询cmc项目列表
83 79
      */
84 80
     @GetMapping("/list")
85
-    public TableDataInfo list(CmcProject cmcProject)
86
-    {
81
+    public TableDataInfo list(CmcProject cmcProject) {
87 82
         startPage();
88 83
         List<CmcProject> list = new ArrayList<>();
89 84
         if (cmcProject.getUndertakingDept() != null && cmcProject.getUndertakingDept().equals("113"))
@@ -105,8 +100,7 @@ public class CmcProjectController extends BaseController
105 100
      * 模糊查询cmc项目列表
106 101
      */
107 102
     @GetMapping("/listFuzzy")
108
-    public TableDataInfo listFuzzy(CmcProject cmcProject)
109
-    {
103
+    public TableDataInfo listFuzzy(CmcProject cmcProject) {
110 104
         startPage();
111 105
         List<CmcProject> list = cmcProjectService.selectCmcProjectListFuzzy(cmcProject);
112 106
         for (CmcProject project : list) {
@@ -125,8 +119,7 @@ public class CmcProjectController extends BaseController
125 119
      */
126 120
     @Log(title = "cmc项目", businessType = BusinessType.EXPORT)
127 121
     @PostMapping("/export")
128
-    public void export(HttpServletResponse response, CmcProject cmcProject)
129
-    {
122
+    public void export(HttpServletResponse response, CmcProject cmcProject) {
130 123
         List<CmcProject> list = new ArrayList<>();
131 124
         if (cmcProject.getUndertakingDept() != null && cmcProject.getUndertakingDept().equals("113"))
132 125
             list = cmcProjectService.selectCmcInvestProjectList(cmcProject);
@@ -152,8 +145,7 @@ public class CmcProjectController extends BaseController
152 145
      * 获取cmc项目详细信息
153 146
      */
154 147
     @GetMapping(value = "/{projectId}")
155
-    public AjaxResult getInfo(@PathVariable("projectId") String projectId)
156
-    {
148
+    public AjaxResult getInfo(@PathVariable("projectId") String projectId) {
157 149
         CmcProject cmcProject = cmcProjectService.selectCmcProjectByProjectId(projectId);
158 150
         if (cmcProject != null) {
159 151
             cmcProject.setUndertakingDeptName(deptIdToName(cmcProject));
@@ -170,8 +162,7 @@ public class CmcProjectController extends BaseController
170 162
      * 项目自动编号
171 163
      */
172 164
     @GetMapping("/projectNumber")
173
-    public AjaxResult getProjectNumberByYear(CmcProject cmcProject)
174
-    {
165
+    public AjaxResult getProjectNumberByYear(CmcProject cmcProject) {
175 166
         List<CmcProject> list = cmcProjectService.selectCmcAllProjectList(cmcProject);
176 167
         String number = "0";
177 168
         String projectNumber = "";
@@ -188,10 +179,10 @@ public class CmcProjectController extends BaseController
188 179
      * 项目类型列表
189 180
      */
190 181
     @GetMapping("/projectType")
191
-    public AjaxResult getProjectType()
192
-    {
182
+    public AjaxResult getProjectType() {
193 183
         List<String> typeList = new ArrayList<>();
194
-        Map<Object, List<CmcProject>> projectType = cmcProjectService.selectCmcAllProjectList(new CmcProject()).stream().collect(Collectors.groupingBy(item -> Optional.ofNullable(item.getProjectType())));
184
+        Map<Object, List<CmcProject>> projectType = cmcProjectService.selectCmcAllProjectList(new CmcProject()).stream()
185
+                .collect(Collectors.groupingBy(item -> Optional.ofNullable(item.getProjectType())));
195 186
         projectType.forEach((k, v) -> {
196 187
             if (k != Optional.empty())
197 188
                 typeList.add(k.toString().substring(k.toString().indexOf("[") + 1, k.toString().indexOf("]")));
@@ -208,6 +199,16 @@ public class CmcProjectController extends BaseController
208 199
         JSONObject jsonObject = new JSONObject();
209 200
         JSONArray yearArray = new JSONArray();
210 201
         JSONObject yearObject = new JSONObject();
202
+        JSONArray monthArray = new JSONArray();
203
+        JSONObject monthObject = new JSONObject();
204
+        JSONArray monthCompleteArray = new JSONArray();
205
+        JSONObject monthCompleteObject = new JSONObject();
206
+        JSONArray monthArchiveArray = new JSONArray();
207
+        JSONObject monthArchiveObject = new JSONObject();
208
+        JSONArray monthSettleArray = new JSONArray();
209
+        JSONObject monthSettleObject = new JSONObject();
210
+        JSONArray monthCheckArray = new JSONArray();
211
+        JSONObject monthCheckObject = new JSONObject();
211 212
         JSONArray sourceArray = new JSONArray();
212 213
         JSONObject sourceObject = new JSONObject();
213 214
         JSONArray typeArray = new JSONArray();
@@ -222,96 +223,294 @@ public class CmcProjectController extends BaseController
222 223
         JSONObject settleObject = new JSONObject();
223 224
         JSONArray checkArray = new JSONArray();
224 225
         JSONObject checkObject = new JSONObject();
225
-        //整体
226
+        String beginTime = "";
227
+        String endTime = "";
228
+        // 整体
226 229
         if (cmcProject.getProjectNumber() == null) {
227
-            //每年项目数量
228
-            for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
229
-                //总数
230
-                cmcProject.setProjectNumber(String.valueOf(i));
231
-                List<CmcProject> yearList = cmcProjectService.selectCmcAllProjectList(cmcProject);
232
-                yearObject.put(String.valueOf(i), yearList.size());
233
-                //已完成
234
-                cmcProject.setIsComplete("1");
235
-                List<CmcProject> completeList = cmcProjectService.selectCmcAllProjectList(cmcProject);
236
-                completeObject.put(cmcProject.getProjectNumber(), completeList.size());
237
-                cmcProject.setIsComplete(null);
238
-                //已归档
239
-                List<String> projectNumberList = new ArrayList<>();
240
-                CmcArchive cmcArchive = new CmcArchive();
241
-                cmcArchive.setProjectNumber(String.valueOf(i));
242
-                cmcArchive.setArchiveTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
243
-                List<CmcArchive> archiveList = cmcArchiveService.selectCmcArchiveList(cmcArchive);
244
-                for (CmcArchive archive : archiveList) {
245
-                    projectNumberList.add(archive.getProjectNumber());
230
+            // 每年项目数量
231
+            if (cmcProject.getParams().size() == 0) {
232
+                for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
233
+                    // 总数
234
+                    cmcProject.setProjectNumber(String.valueOf(i));
235
+                    List<CmcProject> yearList = cmcProjectService.selectCmcAllProjectList(cmcProject);
236
+                    yearObject.put(String.valueOf(i), yearList.size());
237
+                    // 已完成
238
+                    cmcProject.setIsComplete("1");
239
+                    List<CmcProject> completeList = cmcProjectService.selectCmcAllProjectList(cmcProject);
240
+                    completeObject.put(cmcProject.getProjectNumber(), completeList.size());
241
+                    cmcProject.setIsComplete(null);
242
+                    // 获取当年登记的项目ID列表
243
+                    List<String> yearProjectIds = yearList.stream()
244
+                            .map(p -> p.getProjectId())
245
+                            .filter(id -> id != null)
246
+                            .collect(Collectors.toList());
247
+
248
+                    // 已归档 - 统计当年登记的项目中有多少已归档
249
+                    List<String> yearArchiveProjectIds = new ArrayList<>();
250
+                    CmcArchive cmcArchive = new CmcArchive();
251
+                    cmcArchive.setProjectNumber(String.valueOf(i));
252
+                    cmcArchive.setArchiveTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
253
+                    List<CmcArchive> archiveList = cmcArchiveService.selectCmcArchiveList(cmcArchive);
254
+                    for (CmcArchive archive : archiveList) {
255
+                        if (yearProjectIds.contains(archive.getProjectId())) {
256
+                            yearArchiveProjectIds.add(archive.getProjectId());
257
+                        }
258
+                    }
259
+                    FilesAchievement filesAchievement = new FilesAchievement();
260
+                    filesAchievement.setProjectNumber(String.valueOf(i));
261
+                    List<FilesAchievement> achievementList = filesAchievementService
262
+                            .selectProjectAchievementList(filesAchievement);
263
+                    for (FilesAchievement achievement : achievementList) {
264
+                        if (achievement.getProjectId() != null && yearProjectIds.contains(achievement.getProjectId())) {
265
+                            yearArchiveProjectIds.add(achievement.getProjectId());
266
+                        }
267
+                    }
268
+                    archiveObject.put(String.valueOf(i), yearArchiveProjectIds.stream().distinct().count());
269
+
270
+                    // 已结算 - 统计当年登记的项目中有多少已结算
271
+                    CmcSettle cmcSettle = new CmcSettle();
272
+                    cmcSettle.setProjectNumber(String.valueOf(i));
273
+                    cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
274
+                    List<CmcSettle> settleList = cmcSettleService.selectCmcSettleList(cmcSettle);
275
+                    long yearSettleCount = settleList.stream()
276
+                            .filter(s -> s.getProjectId() != null && yearProjectIds.contains(s.getProjectId()))
277
+                            .count();
278
+                    settleObject.put(String.valueOf(i), yearSettleCount);
279
+
280
+                    // 已核算 - 统计当年登记的项目中有多少已核算
281
+                    CmcCheck cmcCheck = new CmcCheck();
282
+                    cmcCheck.setProjectNumber(String.valueOf(i));
283
+                    cmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
284
+                    List<CmcCheck> checkList = cmcCheckService.selectCmcCheckList(cmcCheck);
285
+                    long yearCheckCount = checkList.stream()
286
+                            .filter(c -> c.getProjectId() != null && yearProjectIds.contains(c.getProjectId()))
287
+                            .count();
288
+                    checkObject.put(String.valueOf(i), yearCheckCount);
246 289
                 }
247
-                FilesAchievement filesAchievement = new FilesAchievement();
248
-                filesAchievement.setProjectNumber(String.valueOf(i));
249
-                List<FilesAchievement> achievementList = filesAchievementService.selectProjectAchievementList(filesAchievement);
250
-                for (FilesAchievement achievement : achievementList) {
251
-                    projectNumberList.add(achievement.getProjectNumber());
290
+                cmcProject.setProjectNumber(null);
291
+            } else {
292
+                beginTime = (String) cmcProject.getParams().get("beginTime");
293
+                endTime = (String) cmcProject.getParams().get("endTime");
294
+                List<String> monthList = DateUtils.getMonthBetweenDate(beginTime, endTime);
295
+                for (int i = 0; i < monthList.size(); i++) {
296
+                    String beginTimeString = monthList.get(i) + "-01";
297
+                    Calendar calendar = Calendar.getInstance();
298
+                    calendar.set(Calendar.YEAR, Integer.parseInt(monthList.get(i).split("-")[0]));
299
+                    calendar.set(Calendar.MONTH, Integer.parseInt(monthList.get(i).split("-")[1]) - 1);
300
+                    String endTimeString = monthList.get(i) + "-" + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
301
+                    Map<String, Object> params = new HashMap<>();
302
+                    params.put("beginTime", beginTimeString + " 00:00:00");
303
+                    params.put("endTime", endTimeString + " 23:59:59");
304
+                    cmcProject.setParams(params);
305
+                    List<CmcProject> monthProjectList = cmcProjectService.selectCmcProjectListByRange(cmcProject);
306
+                    monthObject.put(monthList.get(i), monthProjectList.size());
307
+
308
+                    // 已完成
309
+                    cmcProject.setIsComplete("1");
310
+                    List<CmcProject> monthCompleteList = cmcProjectService.selectCmcProjectListByRange(cmcProject);
311
+                    monthCompleteObject.put(monthList.get(i), monthCompleteList.size());
312
+                    cmcProject.setIsComplete(null);
313
+
314
+                    // 获取当月登记的项目ID列表
315
+                    List<String> monthProjectIds = monthProjectList.stream()
316
+                            .map(p -> p.getProjectId())
317
+                            .filter(id -> id != null)
318
+                            .collect(Collectors.toList());
319
+
320
+                    // 已归档 - 统计当月登记的项目中有多少已归档
321
+                    List<String> monthArchiveProjectIds = new ArrayList<>();
322
+                    CmcArchive monthCmcArchive = new CmcArchive();
323
+                    monthCmcArchive.setArchiveTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
324
+                    List<CmcArchive> monthArchiveList = cmcArchiveService.selectCmcArchiveList(monthCmcArchive);
325
+                    for (CmcArchive archive : monthArchiveList) {
326
+                        if (monthProjectIds.contains(archive.getProjectId())) {
327
+                            monthArchiveProjectIds.add(archive.getProjectId());
328
+                        }
329
+                    }
330
+                    FilesAchievement monthFilesAchievement = new FilesAchievement();
331
+                    List<FilesAchievement> monthAchievementList = filesAchievementService
332
+                            .selectProjectAchievementList(monthFilesAchievement);
333
+                    for (FilesAchievement achievement : monthAchievementList) {
334
+                        if (achievement.getProjectId() != null
335
+                                && monthProjectIds.contains(achievement.getProjectId())) {
336
+                            monthArchiveProjectIds.add(achievement.getProjectId());
337
+                        }
338
+                    }
339
+                    monthArchiveObject.put(monthList.get(i), monthArchiveProjectIds.stream().distinct().count());
340
+
341
+                    // 已结算 - 统计当月登记的项目中有多少已结算
342
+                    CmcSettle monthCmcSettle = new CmcSettle();
343
+                    monthCmcSettle.setProjectNumber(cmcProject.getProjectNumber());
344
+                    monthCmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
345
+                    List<CmcSettle> monthSettleList = cmcSettleService.selectCmcSettleList(monthCmcSettle);
346
+                    long monthSettleCount = monthSettleList.stream()
347
+                            .filter(s -> s.getProjectId() != null && monthProjectIds.contains(s.getProjectId()))
348
+                            .count();
349
+                    monthSettleObject.put(monthList.get(i), monthSettleCount);
350
+
351
+                    // 已核算 - 统计当月登记的项目中有多少已核算
352
+                    CmcCheck monthCmcCheck = new CmcCheck();
353
+                    monthCmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
354
+                    List<CmcCheck> monthCheckList = cmcCheckService.selectCmcCheckList(monthCmcCheck);
355
+                    long monthCheckCount = monthCheckList.stream()
356
+                            .filter(c -> c.getProjectId() != null && monthProjectIds.contains(c.getProjectId()))
357
+                            .count();
358
+                    monthCheckObject.put(monthList.get(i), monthCheckCount);
252 359
                 }
253
-                archiveObject.put(String.valueOf(i), projectNumberList.stream().distinct().count());
254
-                //已结算
255
-                CmcSettle cmcSettle = new CmcSettle();
256
-                cmcSettle.setProjectNumber(String.valueOf(i));
257
-                cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
258
-                List<CmcSettle> settleList = cmcSettleService.selectCmcSettleList(cmcSettle);
259
-                settleObject.put(String.valueOf(i), settleList.size());
260
-                //已核算
261
-                CmcCheck cmcCheck = new CmcCheck();
262
-                cmcCheck.setProjectNumber(String.valueOf(i));
263
-                cmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
264
-                List<CmcCheck> checkList = cmcCheckService.selectCmcCheckList(cmcCheck);
265
-                checkObject.put(String.valueOf(i), checkList.size());
266 360
             }
267
-            cmcProject.setProjectNumber(null);
268 361
 
269 362
         }
270
-        //年度
363
+        // 年度
271 364
         else {
272
-            //输入年份项目数量
365
+            // 输入年份项目数量
273 366
             List<CmcProject> yearList = cmcProjectService.selectCmcAllProjectList(cmcProject);
274
-            //总数
275
-            yearObject.put(cmcProject.getProjectNumber(),  yearList.size());
276
-            //已完成
367
+            // 总数
368
+            yearObject.put(cmcProject.getProjectNumber(), yearList.size());
369
+            // 按月份统计
370
+            for (int i = 1; i <= 12; i++) {
371
+                String month = i < 10 ? "0" + i : String.valueOf(i);
372
+                String beginTimeString = cmcProject.getProjectNumber() + "-" + month + "-01";
373
+                Calendar calendar = Calendar.getInstance();
374
+                calendar.set(Calendar.YEAR, Integer.parseInt(cmcProject.getProjectNumber()));
375
+                calendar.set(Calendar.MONTH, i - 1);
376
+                String endTimeString = cmcProject.getProjectNumber() + "-" + month + "-"
377
+                        + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
378
+                String monthKey = cmcProject.getProjectNumber() + "-" + month;
379
+
380
+                // 总数
381
+                Map<String, Object> params = new HashMap<>();
382
+                params.put("beginTime", beginTimeString + " 00:00:00");
383
+                params.put("endTime", endTimeString + " 23:59:59");
384
+                cmcProject.setParams(params);
385
+                List<CmcProject> monthProjectList = cmcProjectService.selectCmcProjectListByRange(cmcProject);
386
+                monthObject.put(monthKey, monthProjectList.size());
387
+
388
+                // 已完成
389
+                cmcProject.setIsComplete("1");
390
+                List<CmcProject> monthCompleteList = cmcProjectService.selectCmcProjectListByRange(cmcProject);
391
+                monthCompleteObject.put(monthKey, monthCompleteList.size());
392
+                cmcProject.setIsComplete(null);
393
+
394
+                // 获取当月登记的项目ID列表
395
+                List<String> monthProjectIds = monthProjectList.stream()
396
+                        .map(p -> p.getProjectId())
397
+                        .filter(id -> id != null)
398
+                        .collect(Collectors.toList());
399
+
400
+                // 已归档 - 统计当月登记的项目中有多少已归档
401
+                List<String> monthArchiveProjectIds = new ArrayList<>();
402
+                CmcArchive monthCmcArchive = new CmcArchive();
403
+                monthCmcArchive.setProjectNumber(cmcProject.getProjectNumber());
404
+                monthCmcArchive.setArchiveTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
405
+                List<CmcArchive> monthArchiveList = cmcArchiveService.selectCmcArchiveList(monthCmcArchive);
406
+                for (CmcArchive archive : monthArchiveList) {
407
+                    if (monthProjectIds.contains(archive.getProjectId())) {
408
+                        monthArchiveProjectIds.add(archive.getProjectId());
409
+                    }
410
+                }
411
+                FilesAchievement monthFilesAchievement = new FilesAchievement();
412
+                monthFilesAchievement.setProjectNumber(cmcProject.getProjectNumber());
413
+                List<FilesAchievement> monthAchievementList = filesAchievementService
414
+                        .selectProjectAchievementList(monthFilesAchievement);
415
+                for (FilesAchievement achievement : monthAchievementList) {
416
+                    if (achievement.getProjectId() != null && monthProjectIds.contains(achievement.getProjectId())) {
417
+                        monthArchiveProjectIds.add(achievement.getProjectId());
418
+                    }
419
+                }
420
+                monthArchiveObject.put(monthKey, monthArchiveProjectIds.stream().distinct().count());
421
+
422
+                // 已结算 - 统计当月登记的项目中有多少已结算
423
+                CmcSettle monthCmcSettle = new CmcSettle();
424
+                monthCmcSettle.setProjectNumber(cmcProject.getProjectNumber());
425
+                monthCmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
426
+                List<CmcSettle> monthSettleList = cmcSettleService.selectCmcSettleList(monthCmcSettle);
427
+                long monthSettleCount = monthSettleList.stream()
428
+                        .filter(s -> s.getProjectId() != null && monthProjectIds.contains(s.getProjectId()))
429
+                        .count();
430
+                monthSettleObject.put(monthKey, monthSettleCount);
431
+
432
+                // 已核算 - 统计当月登记的项目中有多少已核算
433
+                CmcCheck monthCmcCheck = new CmcCheck();
434
+                monthCmcCheck.setProjectNumber(cmcProject.getProjectNumber());
435
+                monthCmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
436
+                List<CmcCheck> monthCheckList = cmcCheckService.selectCmcCheckList(monthCmcCheck);
437
+                long monthCheckCount = monthCheckList.stream()
438
+                        .filter(c -> c.getProjectId() != null && monthProjectIds.contains(c.getProjectId()))
439
+                        .count();
440
+                monthCheckObject.put(monthKey, monthCheckCount);
441
+            }
442
+            // 已完成
277 443
             cmcProject.setIsComplete("1");
278 444
             List<CmcProject> completeList = cmcProjectService.selectCmcAllProjectList(cmcProject);
279 445
             completeObject.put(cmcProject.getProjectNumber(), completeList.size());
280 446
             cmcProject.setIsComplete(null);
281
-            //已归档
282
-            List<String> projectNumberList = new ArrayList<>();
447
+
448
+            // 获取当年登记的项目ID列表
449
+            List<CmcProject> yearProjectList = cmcProjectService.selectCmcAllProjectList(cmcProject);
450
+            List<String> yearProjectIds = yearProjectList.stream()
451
+                    .map(p -> p.getProjectId())
452
+                    .filter(id -> id != null)
453
+                    .collect(Collectors.toList());
454
+
455
+            // 已归档 - 统计当年登记的项目中有多少已归档
456
+            List<String> yearArchiveProjectIds = new ArrayList<>();
283 457
             CmcArchive cmcArchive = new CmcArchive();
284 458
             cmcArchive.setProjectNumber(cmcProject.getProjectNumber());
285 459
             cmcArchive.setArchiveTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
286 460
             List<CmcArchive> archiveList = cmcArchiveService.selectCmcArchiveList(cmcArchive);
287 461
             for (CmcArchive archive : archiveList) {
288
-                projectNumberList.add(archive.getProjectNumber());
462
+                if (yearProjectIds.contains(archive.getProjectId())) {
463
+                    yearArchiveProjectIds.add(archive.getProjectId());
464
+                }
289 465
             }
290 466
             FilesAchievement filesAchievement = new FilesAchievement();
291 467
             filesAchievement.setProjectNumber(cmcProject.getProjectNumber());
292
-            List<FilesAchievement> achievementList = filesAchievementService.selectProjectAchievementList(filesAchievement);
468
+            List<FilesAchievement> achievementList = filesAchievementService
469
+                    .selectProjectAchievementList(filesAchievement);
293 470
             for (FilesAchievement achievement : achievementList) {
294
-                projectNumberList.add(achievement.getProjectNumber());
471
+                if (achievement.getProjectId() != null && yearProjectIds.contains(achievement.getProjectId())) {
472
+                    yearArchiveProjectIds.add(achievement.getProjectId());
473
+                }
295 474
             }
296
-            archiveObject.put(cmcProject.getProjectNumber(), projectNumberList.stream().distinct().count());
297
-            //已结算
475
+            archiveObject.put(cmcProject.getProjectNumber(), yearArchiveProjectIds.stream().distinct().count());
476
+
477
+            // 已结算 - 统计当年登记的项目中有多少已结算
298 478
             CmcSettle cmcSettle = new CmcSettle();
299 479
             cmcSettle.setProjectNumber(cmcProject.getProjectNumber());
300 480
             cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
301 481
             List<CmcSettle> settleList = cmcSettleService.selectCmcSettleList(cmcSettle);
302
-            settleObject.put(cmcProject.getProjectNumber(), settleList.size());
303
-            //已核算
482
+            long yearSettleCount = settleList.stream()
483
+                    .filter(s -> s.getProjectId() != null && yearProjectIds.contains(s.getProjectId()))
484
+                    .count();
485
+            settleObject.put(cmcProject.getProjectNumber(), yearSettleCount);
486
+
487
+            // 已核算 - 统计当年登记的项目中有多少已核算
304 488
             CmcCheck cmcCheck = new CmcCheck();
305 489
             cmcCheck.setProjectNumber(cmcProject.getProjectNumber());
306 490
             cmcCheck.setCheckTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
307 491
             List<CmcCheck> checkList = cmcCheckService.selectCmcCheckList(cmcCheck);
308
-            checkObject.put(cmcProject.getProjectNumber(), checkList.size());
492
+            long yearCheckCount = checkList.stream()
493
+                    .filter(c -> c.getProjectId() != null && yearProjectIds.contains(c.getProjectId()))
494
+                    .count();
495
+            checkObject.put(cmcProject.getProjectNumber(), yearCheckCount);
309 496
 
310 497
         }
311
-        getProjectSourceStatistic(cmcProject, sourceObject);
312
-        getProjectTypeStatistic(cmcProject, typeObject);
313
-        getProjectDeptStatistic(cmcProject, deptObject);
498
+        if (!endTime.equals("")) {
499
+            Calendar calendar = Calendar.getInstance();
500
+            calendar.set(Calendar.YEAR, Integer.parseInt(endTime.split("-")[0]));
501
+            calendar.set(Calendar.MONTH, Integer.parseInt(endTime.split("-")[1]) - 1);
502
+            endTime = endTime.split("-")[0] + "-" + endTime.split("-")[1] + "-"
503
+                    + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
504
+        }
505
+        getProjectSourceStatistic(cmcProject, sourceObject, beginTime, endTime);
506
+        getProjectTypeStatistic(cmcProject, typeObject, beginTime, endTime);
507
+        getProjectDeptStatistic(cmcProject, deptObject, beginTime, endTime);
314 508
         yearArray.add(yearObject);
509
+        monthArray.add(monthObject);
510
+        monthCompleteArray.add(monthCompleteObject);
511
+        monthArchiveArray.add(monthArchiveObject);
512
+        monthSettleArray.add(monthSettleObject);
513
+        monthCheckArray.add(monthCheckObject);
315 514
         sourceArray.add(sourceObject);
316 515
         deptArray.add(deptObject);
317 516
         typeArray.add(typeObject);
@@ -320,6 +519,11 @@ public class CmcProjectController extends BaseController
320 519
         settleArray.add(settleObject);
321 520
         checkArray.add(checkObject);
322 521
         jsonObject.put("year", yearArray);
522
+        jsonObject.put("month", monthArray);
523
+        jsonObject.put("monthComplete", monthCompleteArray);
524
+        jsonObject.put("monthArchive", monthArchiveArray);
525
+        jsonObject.put("monthSettle", monthSettleArray);
526
+        jsonObject.put("monthCheck", monthCheckArray);
323 527
         jsonObject.put("source", sourceArray);
324 528
         jsonObject.put("dept", deptArray);
325 529
         jsonObject.put("type", typeArray);
@@ -339,10 +543,9 @@ public class CmcProjectController extends BaseController
339 543
         cmcProject.setRegisterTime(new Date());
340 544
         cmcProject.setIsFinished("0");
341 545
         if (cmcProject.getUndertakingDept().contains(",")) {
342
-            cmcProject.setLeadDept(cmcProject.getUndertakingDept().substring(0,3));
546
+            cmcProject.setLeadDept(cmcProject.getUndertakingDept().substring(0, 3));
343 547
             cmcProject.setJoinDept(cmcProject.getUndertakingDept().substring(4));
344
-        }
345
-        else
548
+        } else
346 549
             cmcProject.setLeadDept(cmcProject.getUndertakingDept());
347 550
         return toAjax(cmcProjectService.insertCmcProject(cmcProject));
348 551
     }
@@ -352,8 +555,7 @@ public class CmcProjectController extends BaseController
352 555
      */
353 556
     @Log(title = "cmc项目", businessType = BusinessType.UPDATE)
354 557
     @PutMapping
355
-    public AjaxResult edit(@RequestBody CmcProject cmcProject)
356
-    {
558
+    public AjaxResult edit(@RequestBody CmcProject cmcProject) {
357 559
         if (cmcProject.getProjectLeader() != null) {
358 560
             SysUser user = userService.selectUserById(cmcProject.getProjectLeader());
359 561
             List<SysRole> sysRoleList = user.getRoles();
@@ -365,7 +567,7 @@ public class CmcProjectController extends BaseController
365 567
                     isProjectLeader = true;
366 568
                 }
367 569
             }
368
-            //新增项目负责人角色
570
+            // 新增项目负责人角色
369 571
             if (!isProjectLeader) {
370 572
                 Long[] newRoles = new Long[roles.length + 1];
371 573
                 System.arraycopy(roles, 0, newRoles, 0, roles.length);
@@ -382,13 +584,15 @@ public class CmcProjectController extends BaseController
382 584
     @PostMapping("/sendMessage")
383 585
     public AjaxResult sendMessage(@RequestBody CmcProject cmcProject) throws IOException {
384 586
         String message = "经营发展部已发起项目登记:  \n>" +
385
-                "登记人: <font color='info'>" + userService.selectUserById(cmcProject.getProjectRegistrant()).getNickName() + "</font>  \n>" +
587
+                "登记人: <font color='info'>" + userService.selectUserById(cmcProject.getProjectRegistrant()).getNickName()
588
+                + "</font>  \n>" +
386 589
                 "项目编号:" + cmcProject.getProjectNumber() + "  \n>" +
387 590
                 "项目名称:" + cmcProject.getProjectName() + "  \n>" +
388 591
                 "  \n>" +
389 592
                 "项目类型:<font color='comment'>" + cmcProject.getProjectType() + "</font>  \n>" +
390
-                "项目来源:" + (cmcProject.getProjectSource().equals("0") ? "院内" : "院外") +"  \n>" +
391
-                "甲方单位:" + cmcPartyAService.selectCmcPartyAByPartyAId(cmcProject.getPartyAId()).getPartyAName() + "  \n>" +
593
+                "项目来源:" + (cmcProject.getProjectSource().equals("0") ? "院内" : "院外") + "  \n>" +
594
+                "甲方单位:" + cmcPartyAService.selectCmcPartyAByPartyAId(cmcProject.getPartyAId()).getPartyAName() + "  \n>"
595
+                +
392 596
                 "  \n>" +
393 597
                 "承担部门:<font color='warning'>" + deptIdToName(cmcProject) + "</font>  \n>" +
394 598
                 "请您确认承担部门,及时跟进项目流转  \n>" +
@@ -400,9 +604,9 @@ public class CmcProjectController extends BaseController
400 604
             managerList.add("YuSiHan");
401 605
             String[] deptId = deptString.split(",");
402 606
             for (String dept : deptId) {
403
-                    List<SysUser> manageList = getManageId(dept, "");
404
-                    for (SysUser manager : manageList) {
405
-                        managerList.add(manager.getPinyin());
607
+                List<SysUser> manageList = getManageId(dept, "");
608
+                for (SysUser manager : manageList) {
609
+                    managerList.add(manager.getPinyin());
406 610
 
407 611
                 }
408 612
             }
@@ -415,9 +619,8 @@ public class CmcProjectController extends BaseController
415 619
      * 删除cmc项目
416 620
      */
417 621
     @Log(title = "cmc项目", businessType = BusinessType.DELETE)
418
-	@DeleteMapping("/{projectIds}")
419
-    public AjaxResult remove(@PathVariable String[] projectIds)
420
-    {
622
+    @DeleteMapping("/{projectIds}")
623
+    public AjaxResult remove(@PathVariable String[] projectIds) {
421 624
         cmcProjectWorkService.deleteCmcProjectWorkByProjectIds(projectIds);
422 625
         return success(cmcProjectService.deleteCmcProjectByProjectIds(projectIds));
423 626
     }
@@ -426,7 +629,8 @@ public class CmcProjectController extends BaseController
426 629
         String underTakingDept = cmcProject.getUndertakingDept();
427 630
         String undertakingDeptName = cmcProject.getUndertakingDeptName();
428 631
         StringBuilder underTakingDeptNames = new StringBuilder();
429
-        if (underTakingDept != null && !underTakingDept.equals("") && (undertakingDeptName == null || undertakingDeptName.equals(""))) {
632
+        if (underTakingDept != null && !underTakingDept.equals("")
633
+                && (undertakingDeptName == null || undertakingDeptName.equals(""))) {
430 634
             for (String dept : underTakingDept.split(","))
431 635
                 underTakingDeptNames.append(deptService.selectDeptById(Long.parseLong(dept)).getDeptName()).append(",");
432 636
             cmcProject.setUndertakingDeptName(underTakingDeptNames.substring(0, underTakingDeptNames.length() - 1));
@@ -438,38 +642,41 @@ public class CmcProjectController extends BaseController
438 642
         String qualityInspector = cmcProject.getQualityInspector();
439 643
         String qualityInspectorName = cmcProject.getQualityInspectorName();
440 644
         StringBuilder qualityInspectorNames = new StringBuilder();
441
-        if (qualityInspector != null && !qualityInspector.equals("") && (qualityInspectorName == null || qualityInspectorName.equals(""))) {
645
+        if (qualityInspector != null && !qualityInspector.equals("")
646
+                && (qualityInspectorName == null || qualityInspectorName.equals(""))) {
442 647
             for (String inspector : qualityInspector.split(","))
443
-                qualityInspectorNames.append(userService.selectUserById(Long.parseLong(inspector)).getNickName()).append(",");
648
+                qualityInspectorNames.append(userService.selectUserById(Long.parseLong(inspector)).getNickName())
649
+                        .append(",");
444 650
             cmcProject.setQualityInspectorName(qualityInspectorNames.substring(0, qualityInspectorNames.length() - 1));
445 651
         }
446 652
     }
447 653
 
448 654
     public CmcContract joinContract(CmcProject cmcProject) {
449 655
         CmcContract contract = new CmcContract();
450
-            CmcProjectContract cmcProjectContract = new CmcProjectContract();
451
-            cmcProjectContract.setProjectId(cmcProject.getProjectId());
452
-            List<CmcProjectContract> cmcProjectContractList = cmcProjectContractService.selectCmcProjectContractList(cmcProjectContract);
453
-            cmcProjectContractList.forEach(projectContract -> {
454
-                try {
455
-                    CmcContract cmcContract = cmcContractService.selectCmcContractByContractId(projectContract.getContractId());
456
-                    if (contract.getContractCode() != null)
457
-                        contract.setContractCode(contract.getContractCode() + "、" + cmcContract.getContractCode());
458
-                    else
459
-                        contract.setContractCode(cmcContract.getContractCode());
460
-                    if (contract.getContractNumber() != null)
461
-                        contract.setContractNumber(contract.getContractNumber() + "、" + cmcContract.getContractNumber());
462
-                    else
463
-                        contract.setContractNumber(cmcContract.getContractNumber());
464
-                    if (contract.getContractName() != null)
465
-                        contract.setContractName(contract.getContractName() + "、" + cmcContract.getContractName());
466
-                    else
467
-                        contract.setContractName(cmcContract.getContractName());
468
-                }
469
-                catch (Exception e){
470
-                    System.out.println(cmcProjectContractList);
471
-                }
472
-            });
656
+        CmcProjectContract cmcProjectContract = new CmcProjectContract();
657
+        cmcProjectContract.setProjectId(cmcProject.getProjectId());
658
+        List<CmcProjectContract> cmcProjectContractList = cmcProjectContractService
659
+                .selectCmcProjectContractList(cmcProjectContract);
660
+        cmcProjectContractList.forEach(projectContract -> {
661
+            try {
662
+                CmcContract cmcContract = cmcContractService
663
+                        .selectCmcContractByContractId(projectContract.getContractId());
664
+                if (contract.getContractCode() != null)
665
+                    contract.setContractCode(contract.getContractCode() + "、" + cmcContract.getContractCode());
666
+                else
667
+                    contract.setContractCode(cmcContract.getContractCode());
668
+                if (contract.getContractNumber() != null)
669
+                    contract.setContractNumber(contract.getContractNumber() + "、" + cmcContract.getContractNumber());
670
+                else
671
+                    contract.setContractNumber(cmcContract.getContractNumber());
672
+                if (contract.getContractName() != null)
673
+                    contract.setContractName(contract.getContractName() + "、" + cmcContract.getContractName());
674
+                else
675
+                    contract.setContractName(cmcContract.getContractName());
676
+            } catch (Exception e) {
677
+                System.out.println(cmcProjectContractList);
678
+            }
679
+        });
473 680
         return contract;
474 681
     }
475 682
 
@@ -484,37 +691,76 @@ public class CmcProjectController extends BaseController
484 691
         return userList;
485 692
     }
486 693
 
487
-    //院内外项目数量
488
-    public void getProjectSourceStatistic(CmcProject cmcProject, JSONObject sourceObject) {
694
+    // 院内外项目数量
695
+    public void getProjectSourceStatistic(CmcProject cmcProject, JSONObject sourceObject, String beginTime,
696
+            String endTime) {
489 697
         cmcProject.setProjectSource("1");
490
-        sourceObject.put("院外", cmcProjectService.selectCmcAllProjectList(cmcProject).size());
698
+        if (beginTime.equals("")) {
699
+            sourceObject.put("院外", cmcProjectService.selectCmcAllProjectList(cmcProject).size());
700
+        } else {
701
+            Map<String, Object> params = new HashMap<>();
702
+            params.put("beginTime", beginTime + " 00:00:00");
703
+            params.put("endTime", endTime + " 23:59:59");
704
+            cmcProject.setParams(params);
705
+            sourceObject.put("院外", cmcProjectService.selectCmcProjectListByRange(cmcProject).size());
706
+        }
491 707
         cmcProject.setProjectSource("0");
492
-        sourceObject.put("院内", cmcProjectService.selectCmcAllProjectList(cmcProject).size());
708
+        if (beginTime.equals("")) {
709
+            sourceObject.put("院内", cmcProjectService.selectCmcAllProjectList(cmcProject).size());
710
+        } else {
711
+            Map<String, Object> params = new HashMap<>();
712
+            params.put("beginTime", beginTime + " 00:00:00");
713
+            params.put("endTime", endTime + " 23:59:59");
714
+            cmcProject.setParams(params);
715
+            sourceObject.put("院内", cmcProjectService.selectCmcProjectListByRange(cmcProject).size());
716
+        }
493 717
         cmcProject.setProjectSource(null);
494 718
     }
495 719
 
496
-    //各类型项目数量
497
-    public void getProjectTypeStatistic(CmcProject cmcProject, JSONObject typeObject) {
498
-        //类型太多,循环效率不高-直接用Java特性进行分组统计
499
-        Map<Object, Long> typeGroup = cmcProjectService.selectCmcAllProjectList(cmcProject).stream().collect(Collectors.groupingBy(item -> Optional.ofNullable(item.getProjectType()), Collectors.counting()));
720
+    // 各类型项目数量
721
+    public void getProjectTypeStatistic(CmcProject cmcProject, JSONObject typeObject, String beginTime,
722
+            String endTime) {
723
+        List<CmcProject> projectList;
724
+        if (beginTime.equals("")) {
725
+            projectList = cmcProjectService.selectCmcAllProjectList(cmcProject);
726
+        } else {
727
+            Map<String, Object> params = new HashMap<>();
728
+            params.put("beginTime", beginTime + " 00:00:00");
729
+            params.put("endTime", endTime + " 23:59:59");
730
+            cmcProject.setParams(params);
731
+            projectList = cmcProjectService.selectCmcProjectListByRange(cmcProject);
732
+        }
733
+        Map<Object, Long> typeGroup = projectList.stream().collect(
734
+                Collectors.groupingBy(item -> Optional.ofNullable(item.getProjectType()), Collectors.counting()));
500 735
         List<Map.Entry<Object, Long>> typeList = new ArrayList<>(typeGroup.entrySet());
501 736
         typeList.sort(Map.Entry.comparingByValue());
502 737
         typeList.forEach((item) -> {
503 738
             if (item.getKey() != Optional.empty())
504
-                typeObject.put(item.toString().substring(item.toString().indexOf("[") + 1, item.toString().indexOf("]")), item.getValue());
739
+                typeObject.put(
740
+                        item.toString().substring(item.toString().indexOf("[") + 1, item.toString().indexOf("]")),
741
+                        item.getValue());
505 742
         });
506 743
     }
507 744
 
508
-    //各部门承担项目数量
509
-    public void getProjectDeptStatistic(CmcProject cmcProject, JSONObject deptObject) {
745
+    // 各部门承担项目数量
746
+    public void getProjectDeptStatistic(CmcProject cmcProject, JSONObject deptObject, String beginTime,
747
+            String endTime) {
510 748
         for (int i = 107; i <= 115; i++) {
511 749
             cmcProject.setUndertakingDept(String.valueOf(i));
512 750
             List<CmcProject> deptList = new ArrayList<>();
513
-            if (i != 113)
514
-                deptList = cmcProjectService.selectCmcProjectList(cmcProject);
515
-            else
516
-                deptList = cmcProjectService.selectCmcInvestProjectList(cmcProject);
517
-            deptObject.put(deptService.selectDeptById((long)i).getDeptName(), deptList.size());
751
+            if (beginTime.equals("")) {
752
+                if (i != 113)
753
+                    deptList = cmcProjectService.selectCmcProjectList(cmcProject);
754
+                else
755
+                    deptList = cmcProjectService.selectCmcInvestProjectList(cmcProject);
756
+            } else {
757
+                Map<String, Object> params = new HashMap<>();
758
+                params.put("beginTime", beginTime + " 00:00:00");
759
+                params.put("endTime", endTime + " 23:59:59");
760
+                cmcProject.setParams(params);
761
+                deptList = cmcProjectService.selectCmcProjectListByRange(cmcProject);
762
+            }
763
+            deptObject.put(deptService.selectDeptById((long) i).getDeptName(), deptList.size());
518 764
         }
519 765
         cmcProject.setUndertakingDept(null);
520 766
     }

+ 38
- 4
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSettleController.java View File

@@ -141,7 +141,11 @@ public class CmcSettleController extends BaseController
141 141
         JSONObject yearProjectCountObject = new JSONObject();
142 142
         JSONArray yearProjectAmountArray = new JSONArray();
143 143
         JSONObject yearProjectAmountObject = new JSONObject();
144
-        //每年借款金额
144
+        JSONArray monthArray = new JSONArray();
145
+        JSONObject monthObject = new JSONObject();
146
+        JSONArray monthAmountArray = new JSONArray();
147
+        JSONObject monthAmountObject = new JSONObject();
148
+        //每年结算数量和金额
145 149
         if (cmcSettle.getGmTime() == null) {
146 150
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
147 151
                 cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
@@ -156,27 +160,57 @@ public class CmcSettleController extends BaseController
156 160
             cmcSettle.setGmTime(null);
157 161
         }
158 162
         else {
159
-            yearObject.put(new SimpleDateFormat("yyyy").format(cmcSettle.getGmTime()), cmcSettleService.selectCmcSettleList(cmcSettle).size());
163
+            String yearStr = new SimpleDateFormat("yyyy").format(cmcSettle.getGmTime());
164
+            cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse(yearStr));
165
+            List<CmcSettle> yearList = cmcSettleService.selectCmcSettleList(cmcSettle);
166
+            yearObject.put(yearStr, yearList.size());
160 167
             BigDecimal amount = new BigDecimal(0);
161
-            for (CmcSettle settle : cmcSettleService.selectCmcSettleList(cmcSettle)) {
168
+            for (CmcSettle settle : yearList) {
162 169
                 if (settle.getAmount() != null)
163 170
                     amount = amount.add(settle.getAmount());
164 171
             }
165
-            amountObject.put(new SimpleDateFormat("yyyy").format(cmcSettle.getGmTime()), amount);
172
+            amountObject.put(yearStr, amount);
173
+            
174
+            //月度统计
175
+            for (int i = 1; i <= 12; i++) {
176
+                String monthStr = String.format("%02d", i);
177
+                String monthKey = yearStr + "-" + monthStr;
178
+                String beginTimeString = monthKey + "-01";
179
+                
180
+                Map<String, Object> params = new HashMap<>();
181
+                params.put("beginTime", beginTimeString + " 00:00:00");
182
+                cmcSettle.setParams(params);
183
+                cmcSettle.setGmTime(new SimpleDateFormat("yyyy-MM").parse(beginTimeString));
184
+                
185
+                List<CmcSettle> monthList = cmcSettleService.selectCmcSettleList(cmcSettle);
186
+                monthObject.put(monthKey, monthList.size());
187
+                BigDecimal monthAmount = new BigDecimal(0);
188
+                for (CmcSettle settle : monthList) {
189
+                    if (settle.getAmount() != null)
190
+                        monthAmount = monthAmount.add(settle.getAmount());
191
+                }
192
+                monthAmountObject.put(monthKey, monthAmount);
193
+                cmcSettle.setParams(null);
194
+            }
166 195
         }
167 196
         getSettleTypeStatistic(cmcSettle, typeObject, typeAmountObject, yearProjectCountObject, yearProjectAmountObject);
197
+        cmcSettle.setGmTime(null);
168 198
         yearArray.add(yearObject);
169 199
         amountArray.add(amountObject);
170 200
         typeArray.add(typeObject);
171 201
         typeAmountArray.add(typeAmountObject);
172 202
         yearProjectCountArray.add(yearProjectCountObject);
173 203
         yearProjectAmountArray.add(yearProjectAmountObject);
204
+        monthArray.add(monthObject);
205
+        monthAmountArray.add(monthAmountObject);
174 206
         jsonObject.put("year", yearArray);
175 207
         jsonObject.put("amount", amountArray);
176 208
         jsonObject.put("type", typeArray);
177 209
         jsonObject.put("typeAmount", typeAmountArray);
178 210
         jsonObject.put("yearProjectCount", yearProjectCountArray);
179 211
         jsonObject.put("yearProjectAmount", yearProjectAmountArray);
212
+        jsonObject.put("month", monthArray);
213
+        jsonObject.put("monthAmount", monthAmountArray);
180 214
         return success(jsonObject);
181 215
     }
182 216
 

+ 0
- 2
oa-back/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java View File

@@ -11,9 +11,7 @@ import com.ruoyi.common.constant.Constants;
11 11
 import com.ruoyi.common.exception.file.FileNameLengthLimitExceededException;
12 12
 import com.ruoyi.common.exception.file.FileSizeLimitExceededException;
13 13
 import com.ruoyi.common.exception.file.InvalidExtensionException;
14
-import com.ruoyi.common.utils.DateUtils;
15 14
 import com.ruoyi.common.utils.StringUtils;
16
-import com.ruoyi.common.utils.uuid.Seq;
17 15
 
18 16
 /**
19 17
  * 文件上传工具类

+ 0
- 4
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/dto/FlowNextDto.java View File

@@ -1,12 +1,8 @@
1 1
 package com.ruoyi.flowable.domain.dto;
2 2
 
3
-import com.ruoyi.common.core.domain.entity.SysRole;
4
-import com.ruoyi.common.core.domain.entity.SysUser;
5 3
 import lombok.Data;
6 4
 
7 5
 import java.io.Serializable;
8
-import java.util.List;
9
-
10 6
 /**
11 7
  * 动态人员、组
12 8
  * @author Tony

+ 0
- 4
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/dto/FlowTaskDto.java View File

@@ -1,7 +1,6 @@
1 1
 package com.ruoyi.flowable.domain.dto;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4
-import com.ruoyi.common.core.domain.entity.SysUser;
5 4
 import io.swagger.annotations.ApiModel;
6 5
 import io.swagger.annotations.ApiModelProperty;
7 6
 import lombok.Getter;
@@ -9,9 +8,6 @@ import lombok.Setter;
9 8
 
10 9
 import java.io.Serializable;
11 10
 import java.util.Date;
12
-import java.util.List;
13
-import java.util.Map;
14
-
15 11
 /**
16 12
  * <p>工作流任务<p>
17 13
  *

+ 0
- 3
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/vo/FlowQueryVo.java View File

@@ -4,9 +4,6 @@ import io.swagger.annotations.ApiModel;
4 4
 import io.swagger.annotations.ApiModelProperty;
5 5
 import lombok.Data;
6 6
 
7
-import java.util.List;
8
-import java.util.Map;
9
-
10 7
 /**
11 8
  * <p>流程任务<p>
12 9
  *

+ 0
- 4
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/domain/vo/ReturnTaskNodeVo.java View File

@@ -3,10 +3,6 @@ package com.ruoyi.flowable.domain.vo;
3 3
 import io.swagger.annotations.ApiModel;
4 4
 import io.swagger.annotations.ApiModelProperty;
5 5
 import lombok.Data;
6
-
7
-import java.util.List;
8
-import java.util.Map;
9
-
10 6
 /**
11 7
  * <p>可退回节点<p>
12 8
  *

+ 0
- 4
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/flow/FindNextNodeUtil.java View File

@@ -5,12 +5,9 @@ import com.googlecode.aviator.Expression;
5 5
 //import com.greenpineyu.fel.FelEngine;
6 6
 //import com.greenpineyu.fel.FelEngineImpl;
7 7
 //import com.greenpineyu.fel.context.FelContext;
8
-import org.apache.commons.lang3.StringUtils;
9 8
 import org.flowable.bpmn.model.Process;
10 9
 import org.flowable.bpmn.model.*;
11 10
 import org.flowable.engine.RepositoryService;
12
-import org.flowable.engine.TaskService;
13
-import org.flowable.engine.repository.Model;
14 11
 import org.flowable.engine.repository.ProcessDefinition;
15 12
 import org.flowable.task.api.history.HistoricTaskInstance;
16 13
 
@@ -188,7 +185,6 @@ public class FindNextNodeUtil {
188 185
 
189 186
                 SubProcess sp = (SubProcess) flowElement1;
190 187
                 if (sp.getLoopCharacteristics() != null) {
191
-                    String inputDataItem = sp.getLoopCharacteristics().getInputDataItem();
192 188
                     UserTask userTask = new UserTask();
193 189
                     userTask.setId(sp.getId());
194 190
                     userTask.setLoopCharacteristics(sp.getLoopCharacteristics());

+ 0
- 1
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/flow/FlowableUtils.java View File

@@ -4,7 +4,6 @@ import lombok.extern.slf4j.Slf4j;
4 4
 import org.flowable.bpmn.model.*;
5 5
 import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
6 6
 import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
7
-import org.flowable.task.api.Task;
8 7
 import org.flowable.task.api.history.HistoricTaskInstance;
9 8
 
10 9
 import java.util.*;

+ 0
- 2
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/listener/FlowExecutionListener.java View File

@@ -1,7 +1,6 @@
1 1
 package com.ruoyi.flowable.listener;
2 2
 
3 3
 import lombok.extern.slf4j.Slf4j;
4
-import org.flowable.common.engine.api.delegate.Expression;
5 4
 import org.flowable.engine.delegate.DelegateExecution;
6 5
 import org.flowable.engine.delegate.ExecutionListener;
7 6
 import org.springframework.stereotype.Component;
@@ -27,7 +26,6 @@ public class FlowExecutionListener implements ExecutionListener {
27 26
     /**
28 27
      * 流程设计器添加的参数
29 28
      */
30
-    private Expression param;
31 29
 
32 30
     @Override
33 31
     public void notify(DelegateExecution execution) {

+ 0
- 1
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowInstanceServiceImpl.java View File

@@ -31,7 +31,6 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
31 31
      */
32 32
     @Override
33 33
     public void stopProcessInstance(FlowTaskVo vo) {
34
-        String taskId = vo.getTaskId();
35 34
 
36 35
     }
37 36
 

+ 107
- 18
oa-back/ruoyi-system/src/main/java/com/ruoyi/llm/service/impl/CmcAgentServiceImpl.java View File

@@ -34,6 +34,12 @@ import io.milvus.v2.service.vector.request.SearchReq;
34 34
 import io.milvus.v2.service.vector.request.data.BaseVector;
35 35
 import io.milvus.v2.service.vector.request.data.FloatVec;
36 36
 import io.milvus.v2.service.vector.response.SearchResp;
37
+import okhttp3.MediaType;
38
+import okhttp3.OkHttpClient;
39
+import okhttp3.Request;
40
+import okhttp3.RequestBody;
41
+import okhttp3.Response;
42
+
37 43
 import org.apache.poi.hwpf.HWPFDocument;
38 44
 import org.apache.poi.hwpf.usermodel.Paragraph;
39 45
 import org.apache.poi.hwpf.usermodel.Range;
@@ -53,6 +59,7 @@ import org.springframework.beans.factory.annotation.Value;
53 59
 import org.springframework.stereotype.Service;
54 60
 import org.springframework.web.multipart.MultipartFile;
55 61
 
62
+import com.fasterxml.jackson.databind.JsonNode;
56 63
 import com.fasterxml.jackson.databind.ObjectMapper;
57 64
 import com.ruoyi.llm.domain.ChapterStreamResponse;
58 65
 
@@ -1074,7 +1081,7 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1074 1081
 
1075 1082
     /**
1076 1083
      * 调用LLM生成回答
1077
-     * 
1084
+     *
1078 1085
      * @return
1079 1086
      */
1080 1087
     public String generateAnswer(String prompt) throws IOException {
@@ -1093,6 +1100,69 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1093 1100
         return content;
1094 1101
     }
1095 1102
 
1103
+    // /**
1104
+    // * 调用LLM生成回答
1105
+    // *
1106
+    // * @return
1107
+    // */
1108
+    // public String generateAnswer(String prompt) throws IOException {
1109
+    // String apiUrl = "https://dashscope.aliyuncs.com/compatible-mode/v1"; // 注意没有
1110
+    // /chat/completions
1111
+    // String apiKey = "sk-750a17cc723847f28b31fa1bc17c255c";
1112
+    // String model = "Qwen/Qwen3-Next-80B-A3B-Instruct";
1113
+
1114
+    // // 方式1:确保 ChatModel 内部正确拼接 /chat/completions
1115
+    // ChatModel chatModel = ChatModel.of(apiUrl)
1116
+    // .model(model)
1117
+    // .apiKey(apiKey)
1118
+    // .timeout(java.time.Duration.ofSeconds(240))
1119
+    // .build();
1120
+
1121
+    // // 方式2:直接构造请求,避免框架问题
1122
+    // // 构建 messages 列表
1123
+    // List<Map<String, String>> messages = new ArrayList<>();
1124
+    // Map<String, String> userMessage = new HashMap<>();
1125
+    // userMessage.put("role", "user");
1126
+    // userMessage.put("content", prompt);
1127
+    // messages.add(userMessage);
1128
+
1129
+    // // 构建请求体
1130
+    // Map<String, Object> requestBody = new HashMap<>();
1131
+    // requestBody.put("model", model);
1132
+    // requestBody.put("messages", messages);
1133
+    // requestBody.put("stream", false);
1134
+
1135
+    // // 发送 HTTP 请求
1136
+    // OkHttpClient client = new OkHttpClient.Builder()
1137
+    // .connectTimeout(240, TimeUnit.SECONDS)
1138
+    // .readTimeout(240, TimeUnit.SECONDS)
1139
+    // .build();
1140
+
1141
+    // String jsonBody = new ObjectMapper().writeValueAsString(requestBody);
1142
+
1143
+    // Request request = new Request.Builder()
1144
+    // .url("https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions")
1145
+    // .addHeader("Content-Type", "application/json")
1146
+    // .addHeader("Authorization", "Bearer " + apiKey)
1147
+    // .post(RequestBody.create(jsonBody, MediaType.parse("application/json")))
1148
+    // .build();
1149
+
1150
+    // try (Response response = client.newCall(request).execute()) {
1151
+    // String responseBody = response.body().string();
1152
+    // if (!response.isSuccessful()) {
1153
+    // // 打印原始响应,帮助诊断
1154
+    // System.err.println("HTTP Error: " + response.code());
1155
+    // System.err.println("Response: " + responseBody);
1156
+    // throw new RuntimeException("API call failed: " + responseBody);
1157
+    // }
1158
+    // // 解析 JSON 响应
1159
+    // JsonNode jsonNode = new ObjectMapper().readTree(responseBody);
1160
+    // String content =
1161
+    // jsonNode.path("choices").get(0).path("message").path("content").asText();
1162
+    // return content;
1163
+    // }
1164
+    // }
1165
+
1096 1166
     /**
1097 1167
      * 流式调用LLM生成回答 - 使用Flux
1098 1168
      * 
@@ -1114,6 +1184,26 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1114 1184
                 .filter(content -> content != null && !content.isEmpty());
1115 1185
     }
1116 1186
 
1187
+    // /**
1188
+    // * 流式调用LLM生成回答 - NVIDIA API
1189
+    // *
1190
+    // * @param prompt 提示词
1191
+    // * @return Flux<String> 流式输出
1192
+    // */
1193
+    // public Flux<String> generateAnswerFlux(String prompt) {
1194
+    // String apiUrl = "https://dashscope.aliyuncs.com/compatible-mode/v1";
1195
+    // String apiKey = "sk-750a17cc723847f28b31fa1bc17c255c";
1196
+    // String model = "Qwen/Qwen3-Next-80B-A3B-Instruct";
1197
+
1198
+    // ChatModel chatModel = ChatModel.of(apiUrl)
1199
+    // .model(model).apiKey(apiKey)
1200
+    // .timeout(java.time.Duration.ofSeconds(240))
1201
+    // .build();
1202
+    // return chatModel.prompt(Prompt.of(prompt)).stream()
1203
+    // .map(resp -> resp.getContent())
1204
+    // .filter(content -> content != null && !content.isEmpty());
1205
+    // }
1206
+
1117 1207
     /**
1118 1208
      * 从Milvus检索相关文档
1119 1209
      * 
@@ -1513,7 +1603,7 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1513 1603
      */
1514 1604
     private List<String> extractTitlesFromOutput(String output) {
1515 1605
         List<String> titles = new ArrayList<>();
1516
-        
1606
+
1517 1607
         // 提取【详细目录】部分
1518 1608
         if (output.contains("【详细目录】")) {
1519 1609
             int startIndex = output.indexOf("【详细目录】") + "【详细目录】".length();
@@ -1522,27 +1612,27 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1522 1612
             if (nextTagIndex > startIndex) {
1523 1613
                 endIndex = nextTagIndex;
1524 1614
             }
1525
-            
1615
+
1526 1616
             String directoryContent = output.substring(startIndex, endIndex).trim();
1527 1617
             String[] lines = directoryContent.split("\n");
1528
-            
1618
+
1529 1619
             // 使用栈来跟踪当前路径,只提取叶子节点标题
1530 1620
             Stack<String> levelStack = new Stack<>();
1531
-            
1621
+
1532 1622
             for (String line : lines) {
1533 1623
                 line = line.trim().replace("*", "").replace("#", "").replace("-", "");
1534 1624
                 if (!line.contains("6.") || line.isEmpty()) {
1535 1625
                     continue;
1536 1626
                 }
1537
-                
1627
+
1538 1628
                 String[] parts = line.split(" ", 2);
1539 1629
                 if (parts.length < 2) {
1540 1630
                     continue;
1541 1631
                 }
1542
-                
1632
+
1543 1633
                 String number = parts[0].trim();
1544 1634
                 int dotCount = number.split("\\.").length - 1;
1545
-                
1635
+
1546 1636
                 // 维护栈:弹出同级或更高级别的标题
1547 1637
                 while (!levelStack.isEmpty()) {
1548 1638
                     String topNumber = levelStack.peek().split(" ", 2)[0].trim();
@@ -1553,11 +1643,10 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1553 1643
                         break;
1554 1644
                     }
1555 1645
                 }
1556
-                
1646
+
1557 1647
                 // 如果栈顶是当前标题的直接父节点,且下一行不是子标题,则当前标题是叶子节点
1558
-                boolean isLeaf = true;
1559 1648
                 levelStack.push(line);
1560
-                
1649
+
1561 1650
                 // 检查是否是叶子节点(没有子标题)
1562 1651
                 // 通过检查该行后面是否有更高级别的标题来判断
1563 1652
                 // 这里我们采用简化策略:只有三级标题(6.x.x)才视为叶子节点
@@ -1565,7 +1654,7 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1565 1654
                     titles.add(line);
1566 1655
                 }
1567 1656
             }
1568
-            
1657
+
1569 1658
             // 如果没有三级标题,则返回二级标题作为叶子节点
1570 1659
             if (titles.isEmpty()) {
1571 1660
                 for (String line : lines) {
@@ -1573,22 +1662,22 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
1573 1662
                     if (!line.contains("6.") || line.isEmpty()) {
1574 1663
                         continue;
1575 1664
                     }
1576
-                    
1665
+
1577 1666
                     String[] parts = line.split(" ", 2);
1578 1667
                     if (parts.length < 2) {
1579 1668
                         continue;
1580 1669
                     }
1581
-                    
1670
+
1582 1671
                     String number = parts[0].trim();
1583 1672
                     int dotCount = number.split("\\.").length - 1;
1584
-                    
1673
+
1585 1674
                     if (dotCount == 2) {
1586 1675
                         titles.add(line);
1587 1676
                     }
1588 1677
                 }
1589 1678
             }
1590 1679
         }
1591
-        
1680
+
1592 1681
         return titles;
1593 1682
     }
1594 1683
 
@@ -2295,12 +2384,12 @@ public class CmcAgentServiceImpl implements ICmcAgentService {
2295 2384
                 // 从数据库output字段中提取最新的章节标题列表(而不是从Word文件中提取)
2296 2385
                 // 这样可以确保使用用户修改并保存后的目录结构
2297 2386
                 List<String> allTitles = extractTitlesFromOutput(output);
2298
-                
2387
+
2299 2388
                 // 如果从数据库中没有提取到标题,回退到从Word文件中提取
2300 2389
                 if (allTitles.isEmpty()) {
2301 2390
                     allTitles = extractSubTitles(profilePath + "/" + file.getOriginalFilename(), "技术文件");
2302 2391
                 }
2303
-                
2392
+
2304 2393
                 List<String> targetTitles = new ArrayList<>();
2305 2394
 
2306 2395
                 if (selectedNode != null && !selectedNode.isEmpty()) {

+ 0
- 6
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSettle.java View File

@@ -36,12 +36,6 @@ public class CmcSettle extends BaseEntity
36 36
     @Excel(name = "其他项目名称")
37 37
     private String xmName;
38 38
 
39
-    /** 结算内容 */
40
-    private String content;
41
-
42
-    /** 表格编号 */
43
-    private String tableNumber;
44
-
45 39
     /** 实际结算总金额 */
46 40
     @Excel(name = "实际结算总金额")
47 41
     private BigDecimal amount;

+ 8
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcProjectMapper.java View File

@@ -59,6 +59,14 @@ public interface CmcProjectMapper
59 59
      */
60 60
     public List<CmcProject> selectCmcAllProjectList(CmcProject cmcProject);
61 61
 
62
+    /**
63
+     * 按时间范围查询cmc项目列表
64
+     *
65
+     * @param cmcProject cmc项目
66
+     * @return cmc项目集合
67
+     */
68
+    public List<CmcProject> selectCmcProjectListByRange(CmcProject cmcProject);
69
+
62 70
     /**
63 71
      * 新增cmc项目
64 72
      * 

+ 0
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcContractService.java View File

@@ -1,9 +1,6 @@
1 1
 package com.ruoyi.oa.service;
2 2
 
3 3
 import java.util.List;
4
-import java.util.Map;
5
-
6
-import com.alibaba.fastjson2.JSONArray;
7 4
 import com.ruoyi.oa.domain.CmcContract;
8 5
 
9 6
 /**

+ 8
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcProjectService.java View File

@@ -2,7 +2,6 @@ package com.ruoyi.oa.service;
2 2
 
3 3
 import java.util.List;
4 4
 import com.ruoyi.oa.domain.CmcProject;
5
-import com.ruoyi.oa.domain.CmcProject;
6 5
 
7 6
 /**
8 7
  * cmc项目Service接口
@@ -60,6 +59,14 @@ public interface ICmcProjectService
60 59
      */
61 60
     public List<CmcProject> selectCmcAllProjectList(CmcProject cmcProject);
62 61
 
62
+    /**
63
+     * 按时间范围查询cmc项目列表
64
+     *
65
+     * @param cmcProject cmc项目
66
+     * @return cmc项目集合
67
+     */
68
+    public List<CmcProject> selectCmcProjectListByRange(CmcProject cmcProject);
69
+
63 70
     /**
64 71
      * 新增cmc项目
65 72
      * 

+ 12
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcProjectServiceImpl.java View File

@@ -91,6 +91,18 @@ public class CmcProjectServiceImpl implements ICmcProjectService
91 91
         return cmcProjectMapper.selectCmcAllProjectList(cmcProject);
92 92
     }
93 93
 
94
+    /**
95
+     * 按时间范围查询cmc项目列表
96
+     *
97
+     * @param cmcProject cmc项目
98
+     * @return cmc项目集合
99
+     */
100
+    @Override
101
+    public List<CmcProject> selectCmcProjectListByRange(CmcProject cmcProject)
102
+    {
103
+        return cmcProjectMapper.selectCmcProjectListByRange(cmcProject);
104
+    }
105
+
94 106
     /**
95 107
      * 新增cmc项目
96 108
      * 

+ 0
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/system/domain/TreeSelectNew.java View File

@@ -7,7 +7,6 @@ import com.ruoyi.common.core.domain.entity.SysUser;
7 7
 import com.ruoyi.common.utils.spring.SpringUtils;
8 8
 import com.ruoyi.system.mapper.SysUserMapper;
9 9
 import com.ruoyi.system.mapper.SysUserPostMapper;
10
-import com.ruoyi.system.service.ISysDeptService;
11 10
 
12 11
 import java.io.Serializable;
13 12
 import java.util.List;

+ 1
- 1
oa-back/ruoyi-system/src/main/resources/mapper/file/FilesAchievementMapper.xml View File

@@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
74 74
     </select>
75 75
 
76 76
     <select id="selectProjectAchievementList" parameterType="FilesAchievement" resultMap="FilesAchievementResult">
77
-        select distinct p.project_number from files_achievement as f LEFT JOIN cmc_project as p on f.project_id = p.project_id
77
+        select distinct p.project_number, p.project_id from files_achievement as f LEFT JOIN cmc_project as p on f.project_id = p.project_id
78 78
         <where>
79 79
             (p.project_number REGEXP '^[0-9]+W[0-9]' or p.project_number REGEXP '^[0-9]+C[0-9]') AND NOT (p.project_number REGEXP '[/\\*-]')
80 80
             <if test="projectNumber != null  and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>

+ 1
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBorrowMapper.xml View File

@@ -141,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
141 141
             <if test="dszTime != null "> and b.dsz_time = #{dszTime}</if>
142 142
             <if test="lendTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', lendTime) == '2000' "> and b.lend_time is not null</if>
143 143
             <if test="lendTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', lendTime) != '2000' "> and YEAR(b.lend_time) = YEAR(#{lendTime})</if>
144
+            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(b.lend_time) = MONTH(#{lendTime})</if>
144 145
             <if test="unionTime != null "> and b.union_time = #{unionTime}</if>
145 146
         </where>
146 147
         order by b.apply_date desc

+ 12
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml View File

@@ -137,7 +137,9 @@
137 137
             <if test="projectId != null  and projectId != ''"> and ca.project_id = #{projectId}</if>
138 138
             <if test="applyReason != null  and applyReason != ''"> and ca.apply_reason = #{applyReason}</if>
139 139
             <if test="passengers != null "> and ca.passengers = #{passengers}</if>
140
-            <if test="applyDate != null "> and YEAR(ca.apply_date) = YEAR(#{applyDate})</if>
140
+            <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) == '2000' "> and ca.apply_date is not null</if>
141
+            <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) != '2000' "> and YEAR(ca.apply_date) = YEAR(#{applyDate})</if>
142
+            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(ca.apply_date) = MONTH(#{applyDate})</if>
141 143
             <if test="beginDate != null "> and ca.begin_date = #{beginDate}</if>
142 144
             <if test="endDate != null "> and ca.end_date = #{endDate}</if>
143 145
             <if test="days != null "> and ca.days = #{days}</if>
@@ -273,4 +275,13 @@
273 275
             #{carApplyId}
274 276
         </foreach>
275 277
     </delete>
278
+
279
+    <select id="selectCmcCarApprovalListByRange" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
280
+        <include refid="selectCmcCarApprovalVo"/>
281
+        <where>
282
+            <if test="params.beginTime != null and params.beginTime != ''"> and ca.apply_date &gt;= #{params.beginTime}</if>
283
+            <if test="params.endTime != null and params.endTime != ''"> and ca.apply_date &lt;= #{params.endTime}</if>
284
+        </where>
285
+        order by ca.apply_date desc
286
+    </select>
276 287
 </mapper>

+ 10
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCheckMapper.xml View File

@@ -81,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
81 81
             <if test="zjlUserId != null "> and c.zjl_user_id = #{zjlUserId}</if>
82 82
             <if test="checkTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', checkTime) == '2000' "> and c.check_time is not null</if>
83 83
             <if test="checkTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', checkTime) != '2000' "> and YEAR(c.check_time) = YEAR(#{checkTime})</if>
84
+            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(c.check_time) = MONTH(#{checkTime})</if>
84 85
             <if test="zjlComment != null  and zjlComment != ''"> and c.zjl_comment = #{zjlComment}</if>
85 86
         </where>
86 87
     </select>
@@ -162,4 +163,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
162 163
             #{checkId}
163 164
         </foreach>
164 165
     </delete>
166
+
167
+    <select id="selectCmcCheckListByRange" parameterType="CmcCheck" resultMap="CmcCheckResult">
168
+        <include refid="selectCmcCheckVo"/>
169
+        <where>
170
+            <if test="params.beginTime != null and params.beginTime != ''"> and c.check_time &gt;= #{params.beginTime}</if>
171
+            <if test="params.endTime != null and params.endTime != ''"> and c.check_time &lt;= #{params.endTime}</if>
172
+        </where>
173
+        order by c.check_time desc
174
+    </select>
165 175
 </mapper>

+ 12
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml View File

@@ -81,7 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
81 81
             <if test="repairDevices != null  and repairDevices != ''"> and find_in_set(#{repairDevices}, da.repair_devices)</if>
82 82
             <if test="projectId != null  and projectId != ''"> and da.project_id = #{projectId}</if>
83 83
             <if test="applyReason != null  and applyReason != ''"> and da.apply_reason = #{applyReason}</if>
84
-            <if test="applyDate != null "> and YEAR(da.apply_date) = YEAR(#{applyDate})</if>
84
+            <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) == '2000' "> and da.apply_date is not null</if>
85
+            <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) != '2000' "> and YEAR(da.apply_date) = YEAR(#{applyDate})</if>
86
+            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(da.apply_date) = MONTH(#{applyDate})</if>
85 87
             <if test="returnDate != null "> and da.return_date = #{returnDate}</if>
86 88
             <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
87 89
             <if test="endDate != null "> and da.end_date = #{endDate}</if>
@@ -190,4 +192,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
190 192
             #{deviceApplyId}
191 193
         </foreach>
192 194
     </delete>
195
+
196
+    <select id="selectCmcDeviceApprovalListByRange" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
197
+        <include refid="selectCmcDeviceApprovalVo"/>
198
+        <where>
199
+            <if test="params.beginTime != null and params.beginTime != ''"> and da.apply_date &gt;= #{params.beginTime}</if>
200
+            <if test="params.endTime != null and params.endTime != ''"> and da.apply_date &lt;= #{params.endTime}</if>
201
+        </where>
202
+        order by da.apply_date desc
203
+    </select>
193 204
 </mapper>

+ 35
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProjectMapper.xml View File

@@ -436,4 +436,39 @@
436 436
             #{projectId}
437 437
         </foreach>
438 438
     </delete>
439
+
440
+    <select id="selectCmcProjectListByRange" parameterType="CmcProject" resultMap="CmcProjectResult">
441
+        <include refid="selectCmcProjectVo"/>
442
+        <where>
443
+            (p.project_number REGEXP '^[0-9]+W[0-9]' or p.project_number REGEXP '^[0-9]+C[0-9]') AND NOT (p.project_number REGEXP '[/\\*-]')
444
+            <if test="projectId != null  and projectId != ''"> and p.project_id = #{projectId}</if>
445
+            <if test="projectNumber != null  and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>
446
+            <if test="projectName != null  and projectName != ''"> and p.project_name like concat('%', #{projectName}, '%')</if>
447
+            <if test="projectLeader != null "> and p.project_leader = #{projectLeader}</if>
448
+            <if test="isFinished != null  and isFinished != ''"> and p.is_finished = #{isFinished}</if>
449
+            <if test="isComplete != null  and isComplete != ''"> and p.is_complete = #{isComplete}</if>
450
+            <if test="projectSource != null  and projectSource != ''"> and p.project_source = #{projectSource}</if>
451
+            <if test="partyAId != null  and partyAId != ''"> and p.party_a_id = #{partyAId}</if>
452
+            <if test="contactPerson != null  and contactPerson != ''"> and p.contact_person = #{contactPerson}</if>
453
+            <if test="telephone != null  and telephone != ''"> and p.telephone = #{telephone}</if>
454
+            <if test="projectType != null  and projectType != ''"> and p.project_type = #{projectType}</if>
455
+            <if test="projectLevel != null  and projectLevel != ''"> and p.project_level = #{projectLevel}</if>
456
+            <if test="projectRegistrant != null "> and p.project_registrant = #{projectRegistrant}</if>
457
+            <if test="undertakingDept != null  and undertakingDept != ''"> and p.undertaking_dept like concat('%', #{undertakingDept}, '%')</if>
458
+            <if test="projectPlanner != null "> and p.project_planner = #{projectPlanner}</if>
459
+            <if test="siteLeader != null "> and p.site_leader = #{siteLeader}</if>
460
+            <if test="planTime != null "> and p.plan_time = #{planTime}</if>
461
+            <if test="entryTime != null "> and p.entry_time = #{entryTime}</if>
462
+            <if test="exitTime != null "> and p.exit_time = #{exitTime}</if>
463
+            <if test="participates != null  and participates != ''"> and find_in_set(#{participates}, p.participates)</if>
464
+            <if test="params.beginTime != null and params.beginTime != ''">
465
+                and date_format(p.register_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
466
+            </if>
467
+            <if test="params.endTime != null and params.endTime != ''">
468
+                and date_format(p.register_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
469
+            </if>
470
+        </where>
471
+        group by p.project_id
472
+        order by p.register_time desc, p.project_number desc
473
+    </select>
439 474
 </mapper>

+ 11
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSettleMapper.xml View File

@@ -153,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
153 153
             <if test="gmUserId != null "> and s.gm_user_id = #{gmUserId}</if>
154 154
             <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) == '2000' "> and s.gm_time is not null</if>
155 155
             <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) != '2000' "> and YEAR(s.gm_time) = YEAR(#{gmTime})</if>
156
+            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(s.gm_time) = MONTH(#{gmTime})</if>
156 157
             <if test="gmComment != null  and gmComment != ''"> and s.gm_comment = #{gmComment}</if>
157 158
         </where>
158 159
         group by s.settle_id
@@ -285,4 +286,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
285 286
             #{settleId}
286 287
         </foreach>
287 288
     </delete>
289
+
290
+    <select id="selectCmcSettleListByRange" parameterType="CmcSettle" resultMap="CmcSettleResult">
291
+        <include refid="selectCmcSettleVo"/>
292
+        <where>
293
+            ss.content = '实际结算总金额'
294
+            <if test="params.beginTime != null and params.beginTime != ''"> and s.gm_time &gt;= #{params.beginTime}</if>
295
+            <if test="params.endTime != null and params.endTime != ''"> and s.gm_time &lt;= #{params.endTime}</if>
296
+        </where>
297
+        order by s.gm_time desc
298
+    </select>
288 299
 </mapper>

+ 2
- 1
oa-ui/src/api/oa/device/device.js View File

@@ -67,9 +67,10 @@ export function delDevice(deviceId) {
67 67
 }
68 68
 
69 69
 // 设备统计
70
-export function getDeviceStatistic() {
70
+export function getDeviceStatistic(params) {
71 71
   return request({
72 72
     url: '/oa/device/statistic',
73 73
     method: 'get',
74
+    params: params
74 75
   })
75 76
 }

+ 1
- 1
oa-ui/src/utils/echarts.js View File

@@ -18,7 +18,7 @@ export  function echartsSetoption(chart, option) {
18 18
     chart.resize();
19 19
   });
20 20
 }
21
-export function ehcartsInit(myCharts,id,options){
21
+export function echartsInit(myCharts,id,options){
22 22
   disposeCharts(myCharts);
23 23
   let chartDom = document.getElementById(id);
24 24
   myCharts = echarts.init(chartDom);

+ 133
- 26
oa-ui/src/views/statistics/components/borrowStatistics.vue View File

@@ -21,7 +21,7 @@
21 21
 </template>
22 22
 
23 23
 <script>
24
-import { ehcartsInit } from '@/utils/echarts'
24
+import { echartsInit } from '@/utils/echarts'
25 25
 import { getBorrowStatistic } from '@/api/oa/borrow/borrow';
26 26
 let borrowYearChart, borrowAmountChart, borrowUsageChart, borrowProjectChart
27 27
 export default {
@@ -37,6 +37,20 @@ export default {
37 37
     },
38 38
     borrowUsageAmount() {
39 39
       // this.initBorrowUsageAmountPie(this.activeYear)
40
+    },
41
+    borrowYear() {
42
+      if (this.isYearView) {
43
+        this.initBorrowYearBar();
44
+      }
45
+    },
46
+    borrowData: {
47
+      handler(newVal) {
48
+        if (newVal) {
49
+          this.initDatas();
50
+        }
51
+      },
52
+      immediate: true,
53
+      deep: true
40 54
     }
41 55
   },
42 56
   data() {
@@ -46,11 +60,15 @@ export default {
46 60
       borrowUsage: {},
47 61
       borrowUsageAmount: {},
48 62
       borrowYear: {},
63
+      borrowMonth: {},
64
+      borrowMonthAmount: {},
49 65
       yearProjectAmount: {},
50 66
       yearProjectCount: {},
51 67
       sumBorrowAmount: 0,
52 68
       dataLoading: false,
53
-      activeYear: ''
69
+      activeYear: '',
70
+      isYearView: true,
71
+      mainChart: null
54 72
     }
55 73
   },
56 74
   created() {
@@ -72,35 +90,48 @@ export default {
72 90
         this.borrowUsage = this.borrowData.usage[0];
73 91
         this.borrowUsageAmount = this.borrowData.usageAmount[0];
74 92
         this.borrowYear = this.borrowData.year[0];
93
+        this.borrowMonth = this.borrowData.month ? this.borrowData.month[0] : {};
94
+        this.borrowMonthAmount = this.borrowData.monthAmount ? this.borrowData.monthAmount[0] : {};
75 95
         this.yearProjectAmount = this.borrowData.yearProjectAmount[0];
76 96
         this.yearProjectCount = this.borrowData.yearProjectCount[0];
77 97
         let sum = Object.values(this.borrowAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
78
-        this.sumBorrowAmount = (sum / 10000).toFixed(1)
98
+        this.sumBorrowAmount = (sum / 10000).toFixed(2)
79 99
       }
80 100
     },
81 101
     clickYear(charts) {
82 102
       let that = this;
83
-      charts.on('click', function (event) {
103
+      that.mainChart = charts;
104
+      charts.off('click');
105
+      charts.on('click', async function (event) {
84 106
         if (event) {
85
-          that.activeYear = event.name;
86
-          let year = event.name + '-01-01'
87
-          if (event.name == "") {
88
-            year = ''
89
-          }
90
-          that.dataLoading = true
91
-          getBorrowStatistic({ lendTime: year }).then(res => {
107
+          if (event.name === '' || event.name === undefined) {
108
+            that.isYearView = true;
109
+            that.activeYear = '';
110
+            that.initBorrowYearBar();
111
+            that.initBorrowAmountLine();
112
+          } else {
113
+            that.activeYear = event.name;
114
+            that.isYearView = false;
115
+            that.dataLoading = true;
116
+            let res = await getBorrowStatistic({ lendTime: event.name + '-01-01' });
117
+            that.borrowYear = res.data.year[0];
118
+            that.borrowAmount = res.data.amount[0];
119
+            that.borrowMonth = res.data.month ? res.data.month[0] : {};
120
+            that.borrowMonthAmount = res.data.monthAmount ? res.data.monthAmount[0] : {};
92 121
             that.borrowUsage = res.data.usage[0];
93 122
             that.borrowUsageAmount = res.data.usageAmount[0];
94
-            that.dataLoading = false
95
-          })
123
+            that.dataLoading = false;
124
+            that.initBorrowMonthChart();
125
+            that.initBorrowAmountLine();
126
+          }
96 127
         }
97 128
       })
98 129
     },
99 130
     initBorrowYearBar() {
100 131
       let option = {
101 132
         title: {
102
-          text: '各年借款次数',
103
-          subtext: '共计借款次数:' + Object.values(this.borrowYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次'
133
+          text: '借款次数',
134
+          subtext: '借款次数:' + Object.values(this.borrowYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次'
104 135
         },
105 136
         grid: {
106 137
           left: '1%',
@@ -156,15 +187,20 @@ export default {
156 187
           }
157 188
         ]
158 189
       };
159
-      let charts = ehcartsInit(borrowYearChart, 'borrowBar', option);
190
+      let charts = echartsInit(borrowYearChart, 'borrowBar', option);
160 191
       this.clickYear(charts)
161 192
     },
162 193
     initBorrowAmountLine() {
194
+      let xData = this.isYearView ? Object.keys(this.borrowAmount) : Object.keys(this.borrowMonthAmount);
195
+      let amountData = this.isYearView ? Object.values(this.borrowAmount) : Object.values(this.borrowMonthAmount);
196
+      let titleText = this.isYearView ? '借款金额' : this.activeYear + '年借款金额';
197
+      let sumAmount = amountData.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
198
+      
163 199
       let option = {
164 200
         title: {
165
-          text: '各年借款金额',
166
-          subtext: '借款总额:' + (Object.values(this.borrowAmount).reduce((accumulator, currentValue) => { return accumulator + currentValue }, 0)).toFixed(2) + '元' +
167
-            '(约' + this.sumBorrowAmount + '万元)'
201
+          text: titleText,
202
+          subtext: '借款总额:' + sumAmount.toFixed(2) + '元' +
203
+            '(约' + (sumAmount / 10000).toFixed(2) + '万元)'
168 204
         },
169 205
         grid: {
170 206
           left: '1%',
@@ -184,7 +220,7 @@ export default {
184 220
         },
185 221
         xAxis: {
186 222
           type: 'category',
187
-          data: Object.keys(this.borrowAmount),
223
+          data: xData,
188 224
         },
189 225
         yAxis: {
190 226
           type: 'value',
@@ -193,7 +229,7 @@ export default {
193 229
         series: [
194 230
           {
195 231
             min: 0,
196
-            data: Object.values(this.borrowAmount),
232
+            data: amountData,
197 233
             type: 'line',
198 234
             smooth: true,
199 235
             label: {
@@ -202,14 +238,14 @@ export default {
202 238
               formatter: function (params) {
203 239
                 let value = params.value;
204 240
                 if (value >= 10000) {
205
-                  return '约' + (value / 10000).toFixed(1) + '万元'
241
+                  return '约' + (value / 10000).toFixed(2) + '万元'
206 242
                 }
207 243
               }
208 244
             }
209 245
           }
210 246
         ]
211 247
       };
212
-      ehcartsInit(borrowAmountChart, 'borrowLine', option);
248
+      echartsInit(borrowAmountChart, 'borrowLine', option);
213 249
     },
214 250
     initBorrowUsagePie(year) {
215 251
       let option = {
@@ -286,7 +322,7 @@ export default {
286 322
           },
287 323
         ]
288 324
       };
289
-      ehcartsInit(borrowUsageChart, 'borrowUsagePie', option);
325
+      echartsInit(borrowUsageChart, 'borrowUsagePie', option);
290 326
     },
291 327
     initBorrowProjectLineBar(year) {
292 328
       let option = {
@@ -337,14 +373,85 @@ export default {
337 373
               formatter: function (params) {
338 374
                 let value = params.value;
339 375
                 if (value >= 10000) {
340
-                  return '约' + (value / 10000).toFixed(1) + '万元'
376
+                  return '约' + (value / 10000).toFixed(2) + '万元'
341 377
                 }
342 378
               }
343 379
             }
344 380
           },
345 381
         ]
346 382
       };
347
-      ehcartsInit(borrowProjectChart, 'borrowProject', option);
383
+      echartsInit(borrowProjectChart, 'borrowProject', option);
384
+    },
385
+    initBorrowMonthChart() {
386
+      let option = {
387
+        title: {
388
+          text: this.activeYear + '年借款次数',
389
+          subtext: '借款次数:' + Object.values(this.borrowMonth).reduce((a, b) => a + b, 0) + '次'
390
+        },
391
+        grid: {
392
+          left: '1%',
393
+          right: '1%',
394
+          bottom: '0%',
395
+          height: '60%',
396
+          containLabel: true
397
+        },
398
+        graphic: [
399
+          {
400
+            type: 'text',
401
+            name: '',
402
+            right: '0',
403
+            top: '20%',
404
+            style: {
405
+              text: '返回',
406
+              fill: '#409EFF',
407
+              fontSize: 12,
408
+              fontWeight: ''
409
+            },
410
+            onclick: () => { this.goBackToYear(); }
411
+          }
412
+        ],
413
+        tooltip: {
414
+          trigger: 'axis',
415
+          axisPointer: {
416
+            type: 'none',
417
+            label: {
418
+              backgroundColor: '#6a7985'
419
+            }
420
+          }
421
+        },
422
+        xAxis: {
423
+          name: '月',
424
+          type: 'category',
425
+          data: Object.keys(this.borrowMonth),
426
+        },
427
+        yAxis: {
428
+          type: 'value',
429
+          name: '单位:次'
430
+        },
431
+        series: [
432
+          {
433
+            data: Object.values(this.borrowMonth),
434
+            type: 'bar',
435
+            smooth: true,
436
+            label: {
437
+              show: true,
438
+              position: 'top'
439
+            },
440
+            itemStyle: {
441
+              color: '#3498DB'
442
+            }
443
+          }
444
+        ]
445
+      };
446
+      let charts = echartsInit(borrowYearChart, 'borrowBar', option);
447
+    },
448
+    goBackToYear() {
449
+      this.isYearView = true;
450
+      this.activeYear = '';
451
+      this.initDatas();
452
+      this.initBorrowYearBar();
453
+      this.initBorrowAmountLine();
454
+      this.initBorrowUsagePie('');
348 455
     },
349 456
   },
350 457
 }

+ 166
- 53
oa-ui/src/views/statistics/components/carDeviceStatistics.vue View File

@@ -12,14 +12,14 @@
12 12
         <div class="left-top" id="deviceYearBar"></div>
13 13
         <div class="left-top" id="deviceStatusPie"></div>
14 14
       </div>
15
-      <div class="middle">
15
+      <div class="middle" v-loading="deviceDataLoading">
16 16
         <div class="middle-chart" id="deviceApprovalBar"></div>
17 17
       </div>
18 18
       <div class="right">
19 19
         <div class="right-top" id="carYearBar"></div>
20
-        <div class="right-top" id="carStatusPie" v-loading="dataLoading"></div>
20
+        <div class="right-top" id="carStatusPie" v-loading="carDataLoading"></div>
21 21
       </div>
22
-      <div class="right" v-loading="dataLoading">
22
+      <div class="right" v-loading="carDataLoading">
23 23
         <div class="right-top" id="carApprovalBar"></div>
24 24
         <div class="right-top" id="carDayBar"></div>
25 25
       </div>
@@ -28,7 +28,7 @@
28 28
 </template>
29 29
 
30 30
 <script>
31
-import { ehcartsInit } from '@/utils/echarts'
31
+import { echartsInit } from '@/utils/echarts'
32 32
 import { getCarStatistic } from '@/api/oa/car/car';
33 33
 import { getDeviceStatistic } from '@/api/oa/device/device';
34 34
 let deviceYearChart, deviceStatusChart, deviceApprovalChart, carYearChart, carStatusChart, carApprovalChart, carDayChart
@@ -65,7 +65,12 @@ export default {
65 65
       carYear: {},
66 66
       carUsage: {},
67 67
       carDay: {},
68
-      dataLoading:false,
68
+      deviceDataLoading: false,
69
+      carDataLoading: false,
70
+      isYearView: true,
71
+      activeYear: '',
72
+      deviceMonth: {},
73
+      carMonth: {}
69 74
     }
70 75
   },
71 76
   created() {
@@ -89,6 +94,9 @@ export default {
89 94
         this.deviceApproval = this.deviceData.approval;
90 95
         this.deviceStatus = this.deviceData.status[0];
91 96
         this.deviceYear = this.deviceData.year[0];
97
+        if (this.deviceData.month) {
98
+          this.deviceMonth = this.deviceData.month[0];
99
+        }
92 100
       }
93 101
     },
94 102
     async initCarDatas() {
@@ -98,32 +106,104 @@ export default {
98 106
         this.carYear = this.carData.year[0];
99 107
         this.carUsage = this.carData.usage[0];
100 108
         this.carDay = this.carData.day;
109
+        if (this.carData.month) {
110
+          this.carMonth = this.carData.month[0];
111
+        }
101 112
       }
102 113
     },
103
-    clickYear(charts) {
114
+    clickDeviceYear(charts) {
104 115
       let that = this;
116
+      charts.off('click');
105 117
       charts.on('click', function (event) {
106 118
         if (event) {
107
-          that.activeYear = event.name;
108
-          let year = event.name + '-01-01'
109
-          if (event.name == "") {
110
-            year = ''
119
+          if (event.name === '' || event.name === undefined) {
120
+            that.isYearView = true;
121
+            that.activeYear = '';
122
+            that.initDeviceYearBar();
123
+          } else {
124
+            that.activeYear = event.name;
125
+            that.isYearView = false;
126
+            that.deviceDataLoading = true;
127
+            getDeviceStatistic({ applyDate: event.name + '-01-01' }).then(res => {
128
+              if (res.data.month) {
129
+                that.deviceMonth = res.data.month[0];
130
+              }
131
+              that.deviceApproval = res.data.approval;
132
+              that.deviceYear = res.data.year[0];
133
+              that.deviceDataLoading = false;
134
+              that.initDeviceYearBar();
135
+              that.initDeviceApprovalBar();
136
+            })
137
+          }
138
+        }
139
+      })
140
+    },
141
+    clickCarYear(charts) {
142
+      let that = this;
143
+      charts.off('click');
144
+      charts.on('click', function (event) {
145
+        if (event) {
146
+          if (event.name === '' || event.name === undefined) {
147
+            that.isYearView = true;
148
+            that.activeYear = '';
149
+            that.initCarYearBar();
150
+          } else {
151
+            that.activeYear = event.name;
152
+            that.isYearView = false;
153
+            that.carDataLoading = true;
154
+            getCarStatistic({ applyDate: event.name + '-01-01' }).then(res => {
155
+              if (res.data.month) {
156
+                that.carMonth = res.data.month[0];
157
+              }
158
+              that.carApproval = res.data.approval;
159
+              that.carUsage = res.data.usage[0];
160
+              that.carDay = res.data.day;
161
+              that.carYear = res.data.year[0];
162
+              that.carDataLoading = false;
163
+              that.initCarYearBar();
164
+              that.initCarUsagePie();
165
+              that.initCarApprovalBar();
166
+              that.initCarDayBar();
167
+            })
111 168
           }
112
-          that.dataLoading = true
113
-          getCarStatistic({ applyDate: year }).then(res => {
114
-            that.carApproval = res.data.approval;
115
-            that.carUsage = res.data.usage[0];
116
-            that.carDay = res.data.day;
117
-            that.dataLoading = false
118
-          })
119 169
         }
120 170
       })
121 171
     },
172
+    goBackToYear() {
173
+      this.isYearView = true;
174
+      this.activeYear = '';
175
+      this.deviceMonth = {};
176
+      this.carMonth = {};
177
+      this.initDeviceDatas();
178
+      this.initCarDatas();
179
+      this.initDeviceYearBar();
180
+      this.initDeviceApprovalBar();
181
+      this.initCarYearBar();
182
+      this.initCarUsagePie();
183
+      this.initCarApprovalBar();
184
+      this.initCarDayBar();
185
+    },
186
+    goBackToCarYear() {
187
+      this.isYearView = true;
188
+      this.activeYear = '';
189
+      this.carMonth = {};
190
+      this.initCarDatas();
191
+      this.initCarYearBar();
192
+      this.initCarUsagePie();
193
+      this.initCarApprovalBar();
194
+      this.initCarDayBar();
195
+    },
122 196
     initDeviceYearBar() {
197
+      let xData = this.isYearView ? Object.keys(this.deviceYear) : Object.keys(this.deviceMonth);
198
+      let deviceData = this.isYearView ? Object.values(this.deviceYear) : Object.values(this.deviceMonth);
199
+      let titleText = this.isYearView ? '设备申领次数' : this.activeYear + '年设备申领次数';
200
+      let subtext = this.isYearView ? '设备申领次数:' + Object.values(this.deviceYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次' : '设备申领次数:' + Object.values(this.deviceMonth).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次';
201
+      let xName = this.isYearView ? '年' : '月';
202
+      
123 203
       let option = {
124 204
         title: {
125
-          text: '各年设备申领次数',
126
-          subtext: ''
205
+          text: titleText,
206
+          subtext: subtext
127 207
         },
128 208
         grid: {
129 209
           left: '1%',
@@ -132,6 +212,19 @@ export default {
132 212
           height: '60%',
133 213
           containLabel: true
134 214
         },
215
+        graphic: this.isYearView ? [] : [{
216
+          type: 'text',
217
+          name: '',
218
+          right: '0',
219
+          top: '20%',
220
+          style: {
221
+            text: '返回',
222
+            fill: '#409EFF',
223
+            fontSize: 12,
224
+            fontWeight: ''
225
+          },
226
+          onclick: () => { this.goBackToYear(); }
227
+        }],
135 228
         tooltip: {
136 229
           trigger: 'axis',
137 230
           axisPointer: {
@@ -142,9 +235,9 @@ export default {
142 235
           }
143 236
         },
144 237
         xAxis: {
145
-          name: '年',
238
+          name: xName,
146 239
           type: 'category',
147
-          data: Object.keys(this.deviceYear),
240
+          data: xData,
148 241
         },
149 242
         yAxis: {
150 243
           type: 'value',
@@ -152,7 +245,7 @@ export default {
152 245
         },
153 246
         series: [
154 247
           {
155
-            data: Object.values(this.deviceYear),
248
+            data: deviceData,
156 249
             type: 'bar',
157 250
             smooth: true,
158 251
             label: {
@@ -165,7 +258,8 @@ export default {
165 258
           }
166 259
         ]
167 260
       };
168
-      let charts = ehcartsInit(deviceYearChart, 'deviceYearBar', option);
261
+      let charts = echartsInit(deviceYearChart, 'deviceYearBar', option);
262
+      this.clickDeviceYear(charts);
169 263
     },
170 264
     initDeviceStatusPie() {
171 265
       let option = {
@@ -241,14 +335,15 @@ export default {
241 335
           },
242 336
         ]
243 337
       };
244
-      ehcartsInit(deviceStatusChart, 'deviceStatusPie', option);
338
+      echartsInit(deviceStatusChart, 'deviceStatusPie', option);
245 339
     },
246 340
     initDeviceApprovalBar() {
247 341
       let xData = this.deviceApproval.map(item => item.count)
248 342
       let yData = this.deviceApproval.map(item => item.name)
343
+      let titleText = this.isYearView ? '设备申请次数榜' : this.activeYear + '年设备申请次数榜';
249 344
       let option = {
250 345
         title: {
251
-          text: '各类设备申请次数榜'
346
+          text: titleText
252 347
         },
253 348
         tooltip: {
254 349
           trigger: 'axis',
@@ -313,13 +408,19 @@ export default {
313 408
           }
314 409
         ]
315 410
       };
316
-      ehcartsInit(deviceApprovalChart, 'deviceApprovalBar', option);
411
+      echartsInit(deviceApprovalChart, 'deviceApprovalBar', option);
317 412
     },
318 413
     initCarYearBar(){
414
+      let xData = this.isYearView ? Object.keys(this.carYear) : Object.keys(this.carMonth);
415
+      let carData = this.isYearView ? Object.values(this.carYear) : Object.values(this.carMonth);
416
+      let titleText = this.isYearView ? '用车申请次数' : this.activeYear + '年用车申请次数';
417
+      let subtext = this.isYearView ? '用车申请次数:' + Object.values(this.carYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次' : '用车申请次数:' + Object.values(this.carMonth).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次';
418
+      let xName = this.isYearView ? '年' : '月';
419
+      
319 420
       let option = {
320 421
         title: {
321
-          text: '各年用车申请次数',
322
-          subtext: ''
422
+          text: titleText,
423
+          subtext: subtext
323 424
         },
324 425
         grid: {
325 426
           left: '1%',
@@ -328,21 +429,30 @@ export default {
328 429
           height: '60%',
329 430
           containLabel: true
330 431
         },
331
-        // legend: {},
332
-        graphic: [
333
-          {
334
-            type: 'text',
335
-            name: '',
336
-            right: '0',
337
-            top: '20%',
338
-            style: {
339
-              text: '全部年份',
340
-              fill: '#000', // 文本颜色  
341
-              fontSize: 12, // 文本大小  
342
-              fontWeight: '' // 文本粗细  
343
-            }
432
+        graphic: this.isYearView ? [{
433
+          type: 'text',
434
+          name: '',
435
+          right: '0',
436
+          top: '20%',
437
+          style: {
438
+            text: '全部年份',
439
+            fill: '#000',
440
+            fontSize: 12,
441
+            fontWeight: ''
344 442
           }
345
-        ],
443
+        }] : [{
444
+          type: 'text',
445
+          name: '',
446
+          right: '0',
447
+          top: '20%',
448
+          style: {
449
+            text: '返回',
450
+            fill: '#409EFF',
451
+            fontSize: 12,
452
+            fontWeight: ''
453
+          },
454
+          onclick: () => { this.goBackToCarYear(); }
455
+        }],
346 456
         tooltip: {
347 457
           trigger: 'axis',
348 458
           axisPointer: {
@@ -353,9 +463,9 @@ export default {
353 463
           }
354 464
         },
355 465
         xAxis: {
356
-          name: '年',
466
+          name: xName,
357 467
           type: 'category',
358
-          data: Object.keys(this.carYear),
468
+          data: xData,
359 469
         },
360 470
         yAxis: {
361 471
           type: 'value',
@@ -363,7 +473,7 @@ export default {
363 473
         },
364 474
         series: [
365 475
           {
366
-            data: Object.values(this.carYear),
476
+            data: carData,
367 477
             type: 'bar',
368 478
             smooth: true,
369 479
             label: {
@@ -376,13 +486,14 @@ export default {
376 486
           }
377 487
         ]
378 488
       };
379
-      let charts = ehcartsInit(carYearChart, 'carYearBar', option);
380
-      this.clickYear(charts)
489
+      let charts = echartsInit(carYearChart, 'carYearBar', option);
490
+      this.clickCarYear(charts)
381 491
     },
382 492
     initCarUsagePie(){
493
+      let titleText = this.isYearView ? '车辆申请类型' : this.activeYear + '年车辆申请类型';
383 494
       let option = {
384 495
         title: {
385
-          text: '车辆申请类型',
496
+          text: titleText,
386 497
         },
387 498
         tooltip: {
388 499
           trigger: 'item',
@@ -423,14 +534,15 @@ export default {
423 534
           },
424 535
         ]
425 536
       };
426
-      ehcartsInit(carStatusChart, 'carStatusPie', option);
537
+      echartsInit(carStatusChart, 'carStatusPie', option);
427 538
     },
428 539
     initCarApprovalBar(){
429 540
       let xData = this.carApproval.map(item => item.count)
430 541
       let yData = this.carApproval.map(item => item.name)
542
+      let titleText = this.isYearView ? '车辆使用次数榜' : this.activeYear + '年车辆使用次数榜';
431 543
       let option = {
432 544
         title: {
433
-          text: '车辆使用次数榜'
545
+          text: titleText
434 546
         },
435 547
         tooltip: {
436 548
           trigger: 'axis',
@@ -495,14 +607,15 @@ export default {
495 607
           }
496 608
         ]
497 609
       };
498
-      ehcartsInit(carApprovalChart, 'carApprovalBar', option);
610
+      echartsInit(carApprovalChart, 'carApprovalBar', option);
499 611
     },
500 612
     initCarDayBar(){
501 613
       let xData = this.carDay.map(item => item.count)
502 614
       let yData = this.carDay.map(item => item.name)
615
+      let titleText = this.isYearView ? '车辆使用天数榜' : this.activeYear + '年车辆使用天数榜';
503 616
       let option = {
504 617
         title: {
505
-          text: '车辆使用天数榜'
618
+          text: titleText
506 619
         },
507 620
         tooltip: {
508 621
           trigger: 'axis',
@@ -567,7 +680,7 @@ export default {
567 680
           }
568 681
         ]
569 682
       };
570
-      ehcartsInit(carDayChart, 'carDayBar', option);
683
+      echartsInit(carDayChart, 'carDayBar', option);
571 684
     }
572 685
   },
573 686
 }

+ 19
- 20
oa-ui/src/views/statistics/components/contractStatistics.vue View File

@@ -8,7 +8,7 @@
8 8
             range-separator="-" start-placeholder="开始月份" end-placeholder="结束月份" :default-time="['00:00:00', '23:59:59']"
9 9
             @change="queryList"></el-date-picker>
10 10
         </div>
11
-        <!-- 每合同额柱状图 -->
11
+        <!-- 每合同额柱状图 -->
12 12
         <div class="left-top" id="amountBar"></div>
13 13
         <div class="left-bottom">
14 14
           <div class="pie1" id="cwamountPie"></div>
@@ -28,7 +28,7 @@
28 28
 </template>
29 29
 
30 30
 <script>
31
-import { ehcartsInit } from "@/utils/echarts";
31
+import { echartsInit } from "@/utils/echarts";
32 32
 import { getContractStatistic } from "@/api/oa/contract/contract";
33 33
 import { getSubContractStatistic } from "@/api/oa/contract/subContract";
34 34
 let amountChart,
@@ -243,9 +243,10 @@ export default {
243 243
       });
244 244
     },
245 245
     initChartSubYear() {
246
+      let yearTitle = this.activeYear ? this.activeYear + "合同数统计" : "合同数统计";
246 247
       let option = {
247 248
         title: {
248
-          text: "各年合同数统计",
249
+          text: yearTitle,
249 250
           subtext:
250 251
             "承接合同总数:" +
251 252
             Object.values(this.contractYear).reduce(
@@ -293,7 +294,7 @@ export default {
293 294
           },
294 295
         },
295 296
         xAxis: {
296
-          // name: '',
297
+          // name: '',
297 298
           type: "category",
298 299
           data: Object.keys(this.contractYear),
299 300
         },
@@ -348,12 +349,13 @@ export default {
348 349
           },
349 350
         ],
350 351
       };
351
-      this.mainChart = ehcartsInit(amountChart, "amountBar", option);
352
+      this.mainChart = echartsInit(amountChart, "amountBar", option);
352 353
     },
353 354
     initAmountBar() {
355
+      let yearTitle = this.activeYear ? this.activeYear + "合同额统计" : "合同额统计";
354 356
       let option = {
355 357
         title: {
356
-          text: "各年合同额统计",
358
+          text: yearTitle,
357 359
           subtext:
358 360
             "承接合同总额:" +
359 361
             Object.values(this.contractAmount)
@@ -392,7 +394,7 @@ export default {
392 394
           },
393 395
         },
394 396
         xAxis: {
395
-          name: "",
397
+          name: "",
396 398
           type: "category",
397 399
           data: Object.keys(this.contractAmount),
398 400
         },
@@ -507,7 +509,7 @@ export default {
507 509
           },
508 510
         ],
509 511
       };
510
-      ehcartsInit(subYearChart, "subYearLine", option);
512
+      echartsInit(subYearChart, "subYearLine", option);
511 513
     },
512 514
     initChartCwAomunt(year) {
513 515
       let option = {
@@ -564,7 +566,7 @@ export default {
564 566
           },
565 567
         ],
566 568
       };
567
-      ehcartsInit(cwAmountChart, "cwamountPie", option);
569
+      echartsInit(cwAmountChart, "cwamountPie", option);
568 570
     },
569 571
     initChartCwSource(year) {
570 572
       let option = {
@@ -610,14 +612,14 @@ export default {
610 612
           },
611 613
         ],
612 614
       };
613
-      ehcartsInit(cwSourceChart, "cwSourcePie", option);
615
+      echartsInit(cwSourceChart, "cwSourcePie", option);
614 616
     },
615 617
     initChartSubAmount() {
616 618
       let option = {
617 619
         title: {
618
-          text: "各年分包合同额统计",
620
+          text: "分包合同额统计",
619 621
           subtext:
620
-            "共计合同额:" +
622
+            "合同额:" +
621 623
             Object.values(this.subAmount).reduce(
622 624
               (accumulator, currentValue) => accumulator + currentValue,
623 625
               0
@@ -644,7 +646,7 @@ export default {
644 646
           },
645 647
         },
646 648
         xAxis: {
647
-          name: "",
649
+          name: "",
648 650
           type: "category",
649 651
           data: Object.keys(this.subAmount),
650 652
         },
@@ -678,7 +680,7 @@ export default {
678 680
           },
679 681
         ],
680 682
       };
681
-      ehcartsInit(subAmountChart, "subAmountBar", option);
683
+      echartsInit(subAmountChart, "subAmountBar", option);
682 684
     },
683 685
 
684 686
     initChartSubCwAomunt(year) {
@@ -736,7 +738,7 @@ export default {
736 738
           },
737 739
         ],
738 740
       };
739
-      ehcartsInit(subCwAmountChart, "subCwAmountPie", option);
741
+      echartsInit(subCwAmountChart, "subCwAmountPie", option);
740 742
     },
741 743
     initChartSubCwSource(year) {
742 744
       let option = {
@@ -782,7 +784,7 @@ export default {
782 784
           },
783 785
         ],
784 786
       };
785
-      ehcartsInit(subSourceChart, "subSourcePie", option);
787
+      echartsInit(subSourceChart, "subSourcePie", option);
786 788
     },
787 789
   },
788 790
 };
@@ -808,7 +810,7 @@ export default {
808 810
       position: absolute;
809 811
       right: 66px;
810 812
       top: 54px;
811
-      z-index: 9999;
813
+      z-index: 1;
812 814
     }
813 815
 
814 816
     .left-top {
@@ -867,8 +869,5 @@ export default {
867 869
     }
868 870
   }
869 871
 
870
-  .right {
871
-    // flex: 1;
872
-  }
873 872
 }
874 873
 </style>

+ 209
- 34
oa-ui/src/views/statistics/components/projectStatistics.vue View File

@@ -9,7 +9,12 @@
9 9
     <div class="titles">项目统计</div>
10 10
     <div class="warpper">
11 11
       <div class="left">
12
-        <!-- 年份项目柱状图 -->
12
+        <div class="date-range">
13
+          <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="monthrange"
14
+            range-separator="-" start-placeholder="开始月份" end-placeholder="结束月份" :default-time="['00:00:00', '23:59:59']"
15
+            @change="queryList"></el-date-picker>
16
+        </div>
17
+        <!-- 年份/月度项目图表 -->
13 18
         <div class="bar" id="yearNumber"></div>
14 19
         <div class="pie-box" v-loading="dataLoading">
15 20
           <!-- 院内院外饼图 -->
@@ -29,7 +34,7 @@
29 34
 
30 35
 <script>
31 36
 import * as echarts from 'echarts'
32
-import { disposeCharts, echartsSetoption, ehcartsInit } from '@/utils/echarts'
37
+import { disposeCharts, echartsSetoption, echartsInit } from '@/utils/echarts'
33 38
 import { getProjectStatistic } from '@/api/oa/project/project'
34 39
 let barYearChart, sourceChart, deptChart, typeChart
35 40
 export default {
@@ -42,6 +47,11 @@ export default {
42 47
   data() {
43 48
     return {
44 49
       year: {},
50
+      month: {},
51
+      monthComplete: {},
52
+      monthArchive: {},
53
+      monthSettle: {},
54
+      monthCheck: {},
45 55
       type: {},
46 56
       source: {},
47 57
       dept: {},
@@ -52,11 +62,16 @@ export default {
52 62
       loading: true,
53 63
       activeYear: '',
54 64
       dataLoading: false,
65
+      isYearView: true,
66
+      mainChart: null,
67
+      dateRange: [],
55 68
     }
56 69
   },
57 70
   watch: {
58 71
     year() {
59
-      this.initChartBar();
72
+      if (this.isYearView) {
73
+        this.initChartBar();
74
+      }
60 75
     },
61 76
     source() {
62 77
       this.initChartSource(this.activeYear);
@@ -86,8 +101,10 @@ export default {
86 101
   methods: {
87 102
     async initDatas() {
88 103
       this.loading = true;
104
+      this.isYearView = true;
89 105
       if (Object.keys(this.datas).length !== 0) {
90 106
         this.year = this.datas.year[0];
107
+        this.month = this.datas.month ? this.datas.month[0] : {};
91 108
         this.type = this.datas.type[0];
92 109
         this.source = this.datas.source[0];
93 110
         this.dept = this.datas.dept[0];
@@ -99,11 +116,42 @@ export default {
99 116
       }
100 117
 
101 118
     },
119
+    async queryList() {
120
+      this.loading = true;
121
+      let params = {};
122
+      if (this.dateRange && this.dateRange.length === 2) {
123
+        params.params = {
124
+          beginTime: this.dateRange[0],
125
+          endTime: this.dateRange[1]
126
+        };
127
+      }
128
+      let res = await getProjectStatistic(params);
129
+      if (this.dateRange && this.dateRange.length === 2) {
130
+        this.year = res.data.month ? res.data.month[0] : {};
131
+        this.month = res.data.month ? res.data.month[0] : {};
132
+        this.archive = res.data.monthArchive ? res.data.monthArchive[0] : {};
133
+        this.complete = res.data.monthComplete ? res.data.monthComplete[0] : {};
134
+        this.settle = res.data.monthSettle ? res.data.monthSettle[0] : {};
135
+        this.check = res.data.monthCheck ? res.data.monthCheck[0] : {};
136
+      } else {
137
+        this.year = res.data.year[0];
138
+        this.month = res.data.month ? res.data.month[0] : {};
139
+        this.archive = res.data.archive[0];
140
+        this.complete = res.data.complete[0];
141
+        this.settle = res.data.settle[0];
142
+        this.check = res.data.check[0];
143
+      }
144
+      this.type = res.data.type[0];
145
+      this.source = res.data.source[0];
146
+      this.dept = res.data.dept[0];
147
+      this.loading = false;
148
+      this.initChartBar();
149
+    },
102 150
     initChartBar() {
103 151
       let option = {
104 152
         title: {
105
-          text: '各年项目个数统计',
106
-          subtext: '共计项目:' + Object.values(this.year).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '个'
153
+          text: '项目个数统计',
154
+          subtext: '项目数量:' + Object.values(this.year).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '个'
107 155
         },
108 156
         grid: {
109 157
           left: '1%',
@@ -120,7 +168,7 @@ export default {
120 168
             right: '0',
121 169
             top: '20%',
122 170
             style: {
123
-              text: '全部年份',
171
+              text: '返回',
124 172
               fill: '#000', // 文本颜色  
125 173
               fontSize: 12, // 文本大小  
126 174
               fontWeight: '' // 文本粗细  
@@ -137,7 +185,7 @@ export default {
137 185
           }
138 186
         },
139 187
         xAxis: {
140
-          name: '',
188
+          name: '',
141 189
           type: 'category',
142 190
           data: Object.keys(this.year),
143 191
         },
@@ -217,28 +265,152 @@ export default {
217 265
           },
218 266
         ]
219 267
       };
220
-      let charts = ehcartsInit(barYearChart, 'yearNumber', option);
221
-      this.clickYear(charts)
268
+      this.mainChart = echartsInit(barYearChart, 'yearNumber', option);
269
+      this.clickYear(this.mainChart)
222 270
     },
223 271
     clickYear(charts) {
224 272
       let that = this;
225
-      charts.on('click', function (event) {
273
+      that.mainChart = charts;
274
+      charts.off('click');
275
+      charts.on('click', async function (event) {
226 276
         if (event) {
227
-          that.activeYear = event.name;
228
-          let projectNumber = event.name
229
-          if (event.name == "") {
230
-            projectNumber = ''
231
-          }
232
-          that.dataLoading = true
233
-          getProjectStatistic({ projectNumber }).then(res => {
277
+          if (event.name === '' || event.name === undefined) {
278
+            that.initDatas();
279
+            that.isYearView = true;
280
+            that.activeYear = '';
281
+          } else {
282
+            that.activeYear = event.name;
283
+            that.isYearView = false;
284
+            that.dataLoading = true;
285
+            let res = await getProjectStatistic({ projectNumber: event.name });
286
+            that.year = res.data.year[0];
287
+            that.month = res.data.month ? res.data.month[0] : {};
288
+            that.monthComplete = res.data.monthComplete ? res.data.monthComplete[0] : {};
289
+            that.monthArchive = res.data.monthArchive ? res.data.monthArchive[0] : {};
290
+            that.monthSettle = res.data.monthSettle ? res.data.monthSettle[0] : {};
291
+            that.monthCheck = res.data.monthCheck ? res.data.monthCheck[0] : {};
234 292
             that.type = res.data.type[0];
235 293
             that.source = res.data.source[0];
236 294
             that.dept = res.data.dept[0];
237
-            that.dataLoading = false
238
-          })
295
+            that.archive = res.data.archive[0];
296
+            that.complete = res.data.complete[0];
297
+            that.settle = res.data.settle[0];
298
+            that.check = res.data.check[0];
299
+            that.dataLoading = false;
300
+            that.initMonthChart();
301
+          }
239 302
         }
240 303
       })
241 304
     },
305
+    initMonthChart() {
306
+      let option = {
307
+        title: {
308
+          text: this.activeYear + '月度项目个数统计',
309
+          subtext: '项目数量:' + Object.values(this.month).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '个'
310
+        },
311
+        grid: {
312
+          left: '1%',
313
+          right: '1%',
314
+          bottom: '0%',
315
+          height: '60%',
316
+          containLabel: true
317
+        },
318
+        legend:{},
319
+        graphic: [
320
+          {
321
+            type: 'text',
322
+            name: '',
323
+            right: '0',
324
+            top: '20%',
325
+            style: {
326
+              text: '返回',
327
+              fill: '#000',
328
+              fontSize: 12,
329
+              fontWeight: ''
330
+            }
331
+          }
332
+        ],
333
+        tooltip: {
334
+          trigger: 'axis',
335
+          axisPointer: {
336
+            type: 'none',
337
+            label: {
338
+              backgroundColor: '#6a7985'
339
+            }
340
+          }
341
+        },
342
+        xAxis: {
343
+          name: '月',
344
+          type: 'category',
345
+          data: Object.keys(this.month),
346
+        },
347
+        yAxis: {
348
+          type: 'value',
349
+          name: '单位:个'
350
+        },
351
+        series: [{
352
+            name:'已归档',
353
+            type: 'line',
354
+            data: Object.values(this.monthArchive),
355
+            smooth: true,
356
+            areaStyle: {},
357
+            label: {
358
+              show: true,
359
+              position: 'top',
360
+            },
361
+            z:4
362
+          },
363
+          {
364
+            name:'已完成',
365
+            type: 'line',
366
+            data: Object.values(this.monthComplete),
367
+            smooth: true,
368
+            areaStyle: {},
369
+            label: {
370
+              show: true,
371
+              position: 'top',
372
+            },
373
+            z:2
374
+          },
375
+          {
376
+            name:'已结算',
377
+            type: 'line',
378
+            data: Object.values(this.monthSettle),
379
+            smooth: true,
380
+            areaStyle: {},
381
+            label: {
382
+              show: true,
383
+              position: 'top',
384
+            },
385
+            z:3
386
+          },
387
+          {
388
+            name:'已核算',
389
+            type: 'line',
390
+            data: Object.values(this.monthCheck),
391
+            smooth: true,
392
+            areaStyle: {},
393
+            label: {
394
+              show: true,
395
+              position: 'top',
396
+            },
397
+            z:5
398
+          },
399
+          {
400
+            name:'总数',
401
+            type: 'line',
402
+            data: Object.values(this.month),
403
+            smooth: true,
404
+            label: {
405
+              show: true,
406
+              position: 'top',
407
+            },
408
+          }
409
+        ]
410
+      };
411
+      this.mainChart = echartsInit(barYearChart, 'yearNumber', option);
412
+      this.clickYear(this.mainChart);
413
+    },
242 414
     initChartSource(year) {
243 415
       let option = {
244 416
         title: {
@@ -283,12 +455,12 @@ export default {
283 455
           }
284 456
         ]
285 457
       };
286
-      ehcartsInit(sourceChart, 'sourceNumber', option);
458
+      echartsInit(sourceChart, 'sourceNumber', option);
287 459
     },
288 460
     initChartDept(year) {
289 461
       let option = {
290 462
         title: {
291
-          text: year + '部门承担项目情况',
463
+          text: year + '部门承担项目情况',
292 464
         },
293 465
         tooltip: {
294 466
           trigger: 'item',
@@ -332,7 +504,7 @@ export default {
332 504
           }
333 505
         ]
334 506
       };
335
-      ehcartsInit(deptChart, 'deptNumber', option);
507
+      echartsInit(deptChart, 'deptNumber', option);
336 508
     },
337 509
     initTypeBar(year) {
338 510
       let option = {
@@ -402,7 +574,7 @@ export default {
402 574
           }
403 575
         ]
404 576
       };
405
-      ehcartsInit(typeChart, 'typeNumber', option);
577
+      echartsInit(typeChart, 'typeNumber', option);
406 578
     },
407 579
   },
408 580
 }
@@ -422,15 +594,23 @@ export default {
422 594
 
423 595
   .left {
424 596
     flex: 1.5;
597
+    position: relative;
425 598
 
426
-    .bar {
427
-      width: 100%;
428
-      height: 300px;
429
-      padding: 10px;
430
-      border: 1px solid #ececec;
599
+    .date-range {
600
+      position: absolute;
601
+      right: 66px;
602
+      top: 54px;
603
+      z-index: 1;
431 604
     }
432 605
 
433
-    .pie-box {
606
+    .bar {
607
+        width: 100%;
608
+        height: 300px;
609
+        padding: 10px;
610
+        border: 1px solid #ececec;
611
+      }
612
+
613
+      .pie-box {
434 614
       width: 100%;
435 615
       height: 300px;
436 616
       display: flex;
@@ -461,10 +641,5 @@ export default {
461 641
       border: 1px solid #ececec;
462 642
     }
463 643
   }
464
-
465
-  .right {
466
-    // flex: 1;
467
-    // display: flex;
468
-  }
469 644
 }
470 645
 </style>

+ 142
- 49
oa-ui/src/views/statistics/components/settleStatistics.vue View File

@@ -21,8 +21,9 @@
21 21
 </template>
22 22
 
23 23
 <script>
24
-import { ehcartsInit } from '@/utils/echarts'
24
+import { echartsInit } from '@/utils/echarts'
25 25
 import { getSettleStatistic } from '@/api/oa/settle/settle';
26
+import { getCheckStatistic } from '@/api/oa/budget/check';
26 27
 let settleYearChart, settleAmountChart, settleTypeChart, settleProjectChart
27 28
 export default {
28 29
   props: {
@@ -62,7 +63,12 @@ export default {
62 63
       checkYear: {},
63 64
       checkAmount: {},
64 65
       dataLoading: false,
65
-      activeYear: ''
66
+      activeYear: '',
67
+      isYearView: true,
68
+      settleMonth: {},
69
+      settleMonthAmount: {},
70
+      checkMonth: {},
71
+      checkMonthAmount: {}
66 72
     }
67 73
   },
68 74
   created() {
@@ -86,8 +92,14 @@ export default {
86 92
         this.settleYear = this.settleData.year[0];
87 93
         this.yearSettleProjectAmount = this.settleData.yearProjectAmount[0];
88 94
         this.yearSettleProjectCount = this.settleData.yearProjectCount[0];
95
+        if (this.settleData.month) {
96
+          this.settleMonth = this.settleData.month[0];
97
+        }
98
+        if (this.settleData.monthAmount) {
99
+          this.settleMonthAmount = this.settleData.monthAmount[0];
100
+        }
89 101
         let sum = Object.values(this.settleAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
90
-        this.sumSettleAmount = (sum / 10000).toFixed(1)
102
+        this.sumSettleAmount = (sum / 10000).toFixed(2)
91 103
         this.loading = false;
92 104
       } else {
93 105
         this.loading = true;
@@ -99,8 +111,14 @@ export default {
99 111
         this.checkYear = this.checkData.year[0];
100 112
         this.yearCheckProjectAmount = this.checkData.yearProjectAmount[0];
101 113
         this.yearCheckProjectCount = this.checkData.yearProjectCount[0];
114
+        if (this.checkData.month) {
115
+          this.checkMonth = this.checkData.month[0];
116
+        }
117
+        if (this.checkData.monthAmount) {
118
+          this.checkMonthAmount = this.checkData.monthAmount[0];
119
+        }
102 120
         let sum = Object.values(this.checkAmount).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
103
-        this.sumCheckAmount = (sum / 10000).toFixed(1)
121
+        this.sumCheckAmount = (sum / 10000).toFixed(2)
104 122
         this.loading = false;
105 123
       } else {
106 124
         this.loading = true;
@@ -108,27 +126,84 @@ export default {
108 126
     },
109 127
     clickYear(charts) {
110 128
       let that = this;
129
+      charts.off('click');
111 130
       charts.on('click', function (event) {
112 131
         if (event) {
113
-          that.activeYear = event.name;
114
-          let year = event.name + '-01-01'
115
-          if (event.name == "") {
116
-            year = ''
132
+          if (event.name === '' || event.name === undefined) {
133
+            that.isYearView = true;
134
+            that.activeYear = '';
135
+            that.initSettleYearBar();
136
+            that.initSettleAmountLine();
137
+          } else {
138
+            that.activeYear = event.name;
139
+            that.isYearView = false;
140
+            that.dataLoading = true;
141
+            Promise.all([
142
+              getSettleStatistic({ gmTime: event.name + '-01-01' }),
143
+              getCheckStatistic({ checkTime: event.name + '-01-01' })
144
+            ]).then(([settleRes, checkRes]) => {
145
+              // 处理结算数据
146
+              if (settleRes.data.month) {
147
+                that.settleMonth = settleRes.data.month[0];
148
+              }
149
+              if (settleRes.data.monthAmount) {
150
+                that.settleMonthAmount = settleRes.data.monthAmount[0];
151
+              }
152
+              that.settleType = settleRes.data.type[0];
153
+              that.settleTypeAmount = settleRes.data.typeAmount[0];
154
+              if (settleRes.data.year) {
155
+                that.settleYear = settleRes.data.year[0];
156
+              }
157
+              if (settleRes.data.amount) {
158
+                that.settleAmount = settleRes.data.amount[0];
159
+              }
160
+              // 处理核算数据
161
+              if (checkRes.data.month) {
162
+                that.checkMonth = checkRes.data.month[0];
163
+              }
164
+              if (checkRes.data.monthAmount) {
165
+                that.checkMonthAmount = checkRes.data.monthAmount[0];
166
+              }
167
+              if (checkRes.data.year) {
168
+                that.checkYear = checkRes.data.year[0];
169
+              }
170
+              if (checkRes.data.amount) {
171
+                that.checkAmount = checkRes.data.amount[0];
172
+              }
173
+              that.dataLoading = false;
174
+              that.initSettleYearBar();
175
+              that.initSettleAmountLine();
176
+            })
117 177
           }
118
-          that.dataLoading = true
119
-          getSettleStatistic({ gmTime: year }).then(res => {
120
-            that.settleType = res.data.type[0];
121
-            that.settleTypeAmount = res.data.typeAmount[0];
122
-            that.dataLoading = false
123
-          })
124 178
         }
125 179
       })
126 180
     },
181
+    goBackToYear() {
182
+      this.isYearView = true;
183
+      this.activeYear = '';
184
+      this.settleMonth = {};
185
+      this.settleMonthAmount = {};
186
+      this.checkMonth = {};
187
+      this.checkMonthAmount = {};
188
+      this.initSettleDatas();
189
+      this.initCheckDatas();
190
+      this.initSettleYearBar();
191
+      this.initSettleAmountLine();
192
+    },
127 193
     initSettleYearBar() {
194
+      let xData = this.isYearView ? Object.keys(this.settleYear) : Object.keys(this.settleMonth);
195
+      let settleData = this.isYearView ? Object.values(this.settleYear) : Object.values(this.settleMonth);
196
+      let checkData = this.isYearView ? Object.values(this.checkYear) : Object.values(this.checkMonth);
197
+      let titleText = this.isYearView ? '结算次数' : this.activeYear + '年结算次数';
198
+      let settleSum = this.isYearView ? Object.values(this.settleYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) : Object.values(this.settleMonth).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
199
+      let checkSum = this.isYearView ? Object.values(this.checkYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) : Object.values(this.checkMonth).reduce((accumulator, currentValue) => accumulator + currentValue, 0);
200
+      let subtext = '结算次数:' + settleSum + '次\n核算次数:' + checkSum + '次';
201
+      let xName = this.isYearView ? '年' : '月';
202
+      
128 203
       let option = {
129 204
         title: {
130
-          text: '各年结算次数',
131
-          subtext: '共计结算次数:' + Object.values(this.settleYear).reduce((accumulator, currentValue) => accumulator + currentValue, 0) + '次'
205
+          text: titleText,
206
+          subtext: subtext
132 207
         },
133 208
         grid: {
134 209
           left: '1%',
@@ -138,20 +213,30 @@ export default {
138 213
           containLabel: true
139 214
         },
140 215
         legend: {},
141
-        graphic: [
142
-          {
143
-            type: 'text',
144
-            name: '',
145
-            right: '0',
146
-            top: '20%',
147
-            style: {
148
-              text: '全部年份',
149
-              fill: '#000', // 文本颜色  
150
-              fontSize: 12, // 文本大小  
151
-              fontWeight: '' // 文本粗细  
152
-            }
216
+        graphic: this.isYearView ? [{
217
+          type: 'text',
218
+          name: '',
219
+          right: '0',
220
+          top: '20%',
221
+          style: {
222
+            text: '全部年份',
223
+            fill: '#000',
224
+            fontSize: 12,
225
+            fontWeight: ''
153 226
           }
154
-        ],
227
+        }] : [{
228
+          type: 'text',
229
+          name: '',
230
+          right: '0',
231
+          top: '20%',
232
+          style: {
233
+            text: '返回',
234
+            fill: '#409EFF',
235
+            fontSize: 12,
236
+            fontWeight: ''
237
+          },
238
+          onclick: () => { this.goBackToYear(); }
239
+        }],
155 240
         tooltip: {
156 241
           trigger: 'axis',
157 242
           axisPointer: {
@@ -162,9 +247,9 @@ export default {
162 247
           }
163 248
         },
164 249
         xAxis: {
165
-          name: '年',
250
+          name: xName,
166 251
           type: 'category',
167
-          data: Object.keys(this.settleYear),
252
+          data: xData,
168 253
         },
169 254
         yAxis: {
170 255
           type: 'value',
@@ -173,7 +258,7 @@ export default {
173 258
         series: [
174 259
           {
175 260
             name: "结算",
176
-            data: Object.values(this.settleYear),
261
+            data: settleData,
177 262
             type: 'bar',
178 263
             smooth: true,
179 264
             label: {
@@ -186,7 +271,7 @@ export default {
186 271
           },
187 272
           {
188 273
             name: "核算",
189
-            data: Object.values(this.checkYear),
274
+            data: checkData,
190 275
             type: 'bar',
191 276
             smooth: true,
192 277
             label: {
@@ -199,18 +284,26 @@ export default {
199 284
           }
200 285
         ]
201 286
       };
202
-      let charts = ehcartsInit(settleYearChart, 'settleBar', option);
287
+      let charts = echartsInit(settleYearChart, 'settleBar', option);
203 288
       this.clickYear(charts)
204 289
     },
205 290
     initSettleAmountLine() {
291
+      let xData = this.isYearView ? Object.keys(this.settleAmount) : Object.keys(this.settleMonthAmount);
292
+      let settleData = this.isYearView ? Object.values(this.settleAmount) : Object.values(this.settleMonthAmount);
293
+      let checkData = this.isYearView ? Object.values(this.checkAmount) : Object.values(this.checkMonthAmount);
294
+      let titleText = this.isYearView ? '结算金额' : this.activeYear + '年结算金额';
295
+      
296
+      let settleSum = settleData.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
297
+      let checkSum = checkData.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
298
+      
206 299
       let option = {
207 300
         title: {
208
-          text: '各年结算金额',
209
-          subtext: '结算总额:' + (Object.values(this.settleAmount).reduce((accumulator, currentValue) => {return accumulator + currentValue}, 0)).toFixed(2) + '元' +
210
-            '(约' + this.sumSettleAmount + '万元)' +
301
+          text: titleText,
302
+          subtext: '结算总额:' + settleSum.toFixed(2) + '元' +
303
+            '(约' + (settleSum / 10000).toFixed(2) + '万元)' +
211 304
             "\n" + 
212
-            '核算总额:' + (Object.values(this.checkAmount).reduce((accumulator, currentValue) => {return accumulator + currentValue}, 0)).toFixed(2) + '元' +
213
-            '(约' + this.sumCheckAmount + '万元)'
305
+            '核算总额:' + checkSum.toFixed(2) + '元' +
306
+            '(约' + (checkSum / 10000).toFixed(2) + '万元)'
214 307
         },
215 308
         grid: {
216 309
           left: '1%',
@@ -234,7 +327,7 @@ export default {
234 327
         },
235 328
         xAxis: {
236 329
           type: 'category',
237
-          data: Object.keys(this.settleAmount),
330
+          data: xData,
238 331
         },
239 332
         yAxis: {
240 333
           type: 'value',
@@ -243,7 +336,7 @@ export default {
243 336
         series: [
244 337
           {
245 338
             name: "结算",
246
-            data: Object.values(this.settleAmount),
339
+            data: settleData,
247 340
             type: 'line',
248 341
             smooth: true,
249 342
             label: {
@@ -252,14 +345,14 @@ export default {
252 345
               formatter: function (params) {
253 346
                 let value = params.value;
254 347
                 if (value >= 10000) {
255
-                  return '约' + (value / 10000).toFixed(1) + '万元'
348
+                  return '约' + (value / 10000).toFixed(2) + '万元'
256 349
                 }
257 350
               }
258 351
             }
259 352
           },
260 353
           {
261 354
             name: "核算",
262
-            data: Object.values(this.checkAmount),
355
+            data: checkData,
263 356
             type: 'line',
264 357
             smooth: true,
265 358
             label: {
@@ -268,14 +361,14 @@ export default {
268 361
               formatter: function (params) {
269 362
                 let value = params.value;
270 363
                 if (value >= 10000) {
271
-                  return '约' + (value / 10000).toFixed(1) + '万元'
364
+                  return '约' + (value / 10000).toFixed(2) + '万元'
272 365
                 }
273 366
               }
274 367
             }
275 368
           }
276 369
         ]
277 370
       };
278
-      ehcartsInit(settleAmountChart, 'settleLine', option);
371
+      echartsInit(settleAmountChart, 'settleLine', option);
279 372
     },
280 373
     initSettleTypePie(year) {
281 374
       let option = {
@@ -352,7 +445,7 @@ export default {
352 445
           },
353 446
         ]
354 447
       };
355
-      ehcartsInit(settleTypeChart, 'settleTypePie', option);
448
+      echartsInit(settleTypeChart, 'settleTypePie', option);
356 449
     },
357 450
     initSettleProjectLineBar(year) {
358 451
       let option = {
@@ -404,7 +497,7 @@ export default {
404 497
               formatter: function (params) {
405 498
                 let value = params.value;
406 499
                 if (value >= 10000) {
407
-                  return '约' + (value / 10000).toFixed(1) + '万元'
500
+                  return '约' + (value / 10000).toFixed(2) + '万元'
408 501
                 }
409 502
               }
410 503
             }
@@ -425,14 +518,14 @@ export default {
425 518
               formatter: function (params) {
426 519
                 let value = params.value;
427 520
                 if (value >= 10000) {
428
-                  return '约' + (value / 10000).toFixed(1) + '万元'
521
+                  return '约' + (value / 10000).toFixed(2) + '万元'
429 522
                 }
430 523
               }
431 524
             }
432 525
           }
433 526
         ]
434 527
       };
435
-      ehcartsInit(settleProjectChart, 'settleProject', option);
528
+      echartsInit(settleProjectChart, 'settleProject', option);
436 529
     },
437 530
   },
438 531
 }

+ 6
- 6
oa-ui/src/views/statistics/components/topHead.vue View File

@@ -82,7 +82,7 @@
82 82
 import upSrc from '@/assets/icons/up.png'
83 83
 import downSrc from '@/assets/icons/down.png'
84 84
 import * as echarts from 'echarts'
85
-import { ehcartsInit } from '@/utils/echarts'
85
+import { echartsInit } from '@/utils/echarts'
86 86
 let thisYearChart, contractYearChart, deviceYearChart, borrowYearChart, settleYearChart
87 87
 export default {
88 88
   props: {
@@ -292,7 +292,7 @@ export default {
292 292
           }
293 293
         ]
294 294
       };
295
-      ehcartsInit(thisYearChart, 'thisYear', option);
295
+      echartsInit(thisYearChart, 'thisYear', option);
296 296
     },
297 297
     initChartTwo() {
298 298
       let option = {
@@ -334,7 +334,7 @@ export default {
334 334
           }
335 335
         ]
336 336
       };
337
-      ehcartsInit(contractYearChart, 'thisContract', option);
337
+      echartsInit(contractYearChart, 'thisContract', option);
338 338
     },
339 339
     initChartThree() {
340 340
       let option = {
@@ -376,7 +376,7 @@ export default {
376 376
           }
377 377
         ]
378 378
       };
379
-      ehcartsInit(deviceYearChart, 'thisDevice', option);
379
+      echartsInit(deviceYearChart, 'thisDevice', option);
380 380
     },
381 381
     initChartFour() {
382 382
       let option = {
@@ -418,7 +418,7 @@ export default {
418 418
           }
419 419
         ]
420 420
       };
421
-      ehcartsInit(borrowYearChart, 'thisBorrow', option);
421
+      echartsInit(borrowYearChart, 'thisBorrow', option);
422 422
     },
423 423
     initChartFive() {
424 424
       let option = {
@@ -460,7 +460,7 @@ export default {
460 460
           }
461 461
         ]
462 462
       };
463
-      ehcartsInit(settleYearChart, 'thisSettle', option);
463
+      echartsInit(settleYearChart, 'thisSettle', option);
464 464
     },
465 465
     getProjectYearSub(year) {
466 466
       let arr = Object.values(year).slice(-2);

Loading…
Cancel
Save