lamphua преди 7 месеца
родител
ревизия
bd15f1dc7f

+ 7
- 7
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBorrowController.java Целия файл

97
         JSONArray yearProjectAmountArray = new JSONArray();
97
         JSONArray yearProjectAmountArray = new JSONArray();
98
         JSONObject yearProjectAmountObject = new JSONObject();
98
         JSONObject yearProjectAmountObject = new JSONObject();
99
         //每年借款金额
99
         //每年借款金额
100
-        if (cmcBorrow.getApplyDate() == null) {
100
+        if (cmcBorrow.getLendTime() == null) {
101
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
101
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
102
-                cmcBorrow.setApplyDate(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
102
+                cmcBorrow.setLendTime(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
103
                 List<CmcBorrow> yearList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
103
                 List<CmcBorrow> yearList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
104
                 yearObject.put(String.valueOf(i), yearList.size());
104
                 yearObject.put(String.valueOf(i), yearList.size());
105
                 BigDecimal amount = new BigDecimal(0);
105
                 BigDecimal amount = new BigDecimal(0);
109
                 }
109
                 }
110
                 amountObject.put(String.valueOf(i), amount);
110
                 amountObject.put(String.valueOf(i), amount);
111
             }
111
             }
112
-            cmcBorrow.setApplyDate(null);
112
+            cmcBorrow.setLendTime(null);
113
         }
113
         }
114
         else {
114
         else {
115
-            yearObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getApplyDate()), cmcBorrowService.selectCmcBorrowList(cmcBorrow).size());
115
+            yearObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getLendTime()), cmcBorrowService.selectCmcBorrowList(cmcBorrow).size());
116
             BigDecimal amount = new BigDecimal(0);
116
             BigDecimal amount = new BigDecimal(0);
117
             for (CmcBorrow borrow : cmcBorrowService.selectCmcBorrowList(cmcBorrow)) {
117
             for (CmcBorrow borrow : cmcBorrowService.selectCmcBorrowList(cmcBorrow)) {
118
                 if (borrow.getManagerAmount() != null)
118
                 if (borrow.getManagerAmount() != null)
119
                     amount = amount.add(borrow.getManagerAmount());
119
                     amount = amount.add(borrow.getManagerAmount());
120
             }
120
             }
121
-            amountObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getApplyDate()), amount);
121
+            amountObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getLendTime()), amount);
122
         }
122
         }
123
         getBorrowUsageStatistic(cmcBorrow, usageObject, usageAmountObject, yearProjectCountObject, yearProjectAmountObject);
123
         getBorrowUsageStatistic(cmcBorrow, usageObject, usageAmountObject, yearProjectCountObject, yearProjectAmountObject);
124
         yearArray.add(yearObject);
124
         yearArray.add(yearObject);
210
                     count ++;
210
                     count ++;
211
                 }
211
                 }
212
             }
212
             }
213
-            yearProjectCountObject.put(String.valueOf(i), count);
214
-            yearProjectAmountObject.put(String.valueOf(i), pyAmount);
213
+            yearProjectCountObject.put(i + "项目", count);
214
+            yearProjectAmountObject.put(i + "项目", pyAmount);
215
         }
215
         }
216
         cmcBorrow.setBorrowUsage("1");
216
         cmcBorrow.setBorrowUsage("1");
217
         usageList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
217
         usageList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);

+ 74
- 6
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSettleController.java Целия файл

87
         JSONObject yearObject = new JSONObject();
87
         JSONObject yearObject = new JSONObject();
88
         JSONArray amountArray = new JSONArray();
88
         JSONArray amountArray = new JSONArray();
89
         JSONObject amountObject = new JSONObject();
89
         JSONObject amountObject = new JSONObject();
90
-        //每年结算金额
91
-        if (cmcSettle.getProjectNumber() == null) {
90
+        JSONArray typeArray = new JSONArray();
91
+        JSONObject typeObject = new JSONObject();
92
+        JSONArray typeAmountArray = new JSONArray();
93
+        JSONObject typeAmountObject = new JSONObject();
94
+        JSONArray yearProjectCountArray = new JSONArray();
95
+        JSONObject yearProjectCountObject = new JSONObject();
96
+        JSONArray yearProjectAmountArray = new JSONArray();
97
+        JSONObject yearProjectAmountObject = new JSONObject();
98
+        //每年借款金额
99
+        if (cmcSettle.getGmTime() == null) {
92
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
100
             for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
93
-                cmcSettle.setProjectNumber(String.valueOf(i));
94
-                cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
101
+                cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse(String.valueOf(i)));
95
                 List<CmcSettle> yearList = cmcSettleService.selectCmcSettleList(cmcSettle);
102
                 List<CmcSettle> yearList = cmcSettleService.selectCmcSettleList(cmcSettle);
96
                 yearObject.put(String.valueOf(i), yearList.size());
103
                 yearObject.put(String.valueOf(i), yearList.size());
97
                 BigDecimal amount = new BigDecimal(0);
104
                 BigDecimal amount = new BigDecimal(0);
110
             cmcSettle.setGmTime(null);
117
             cmcSettle.setGmTime(null);
111
         }
118
         }
112
         else {
119
         else {
113
-            cmcSettle.setGmTime(new SimpleDateFormat("yyyy").parse("2000-01-01"));
114
-            yearObject.put(cmcSettle.getProjectNumber(), cmcSettleService.selectCmcSettleList(cmcSettle).size());
120
+            yearObject.put(new SimpleDateFormat("yyyy").format(cmcSettle.getGmTime()), cmcSettleService.selectCmcSettleList(cmcSettle).size());
115
             BigDecimal amount = new BigDecimal(0);
121
             BigDecimal amount = new BigDecimal(0);
116
             for (CmcSettle settle : cmcSettleService.selectCmcSettleList(cmcSettle)) {
122
             for (CmcSettle settle : cmcSettleService.selectCmcSettleList(cmcSettle)) {
117
                 CmcSettleSummary cmcSettleSummary = new CmcSettleSummary();
123
                 CmcSettleSummary cmcSettleSummary = new CmcSettleSummary();
125
             }
131
             }
126
             amountObject.put(new SimpleDateFormat("yyyy").format(cmcSettle.getGmTime()), amount);
132
             amountObject.put(new SimpleDateFormat("yyyy").format(cmcSettle.getGmTime()), amount);
127
         }
133
         }
134
+        getSettleTypeStatistic(cmcSettle, typeObject, typeAmountObject, yearProjectCountObject, yearProjectAmountObject);
128
         yearArray.add(yearObject);
135
         yearArray.add(yearObject);
129
         amountArray.add(amountObject);
136
         amountArray.add(amountObject);
137
+        typeArray.add(typeObject);
138
+        typeAmountArray.add(typeAmountObject);
139
+        yearProjectCountArray.add(yearProjectCountObject);
140
+        yearProjectAmountArray.add(yearProjectAmountObject);
130
         jsonObject.put("year", yearArray);
141
         jsonObject.put("year", yearArray);
131
         jsonObject.put("amount", amountArray);
142
         jsonObject.put("amount", amountArray);
143
+        jsonObject.put("type", typeArray);
144
+        jsonObject.put("typeAmount", typeAmountArray);
145
+        jsonObject.put("yearProjectCount", yearProjectCountArray);
146
+        jsonObject.put("yearProjectAmount", yearProjectAmountArray);
132
         return success(jsonObject);
147
         return success(jsonObject);
133
     }
148
     }
134
 
149
 
166
     {
181
     {
167
         return success(cmcSettleService.deleteCmcSettleBySettleIds(settleIds));
182
         return success(cmcSettleService.deleteCmcSettleBySettleIds(settleIds));
168
     }
183
     }
184
+
185
+    //各用途结算次数
186
+    public void getSettleTypeStatistic(CmcSettle cmcSettle, JSONObject typeObject, JSONObject typeAmountObject, JSONObject yearProjectCountObject, JSONObject yearProjectAmountObject) {
187
+        cmcSettle.setXmName(" ");
188
+        List<CmcSettle> typeList = cmcSettleService.selectCmcSettleList(cmcSettle);
189
+        typeObject.put("项目结算", typeList.size());
190
+        BigDecimal pAmount = new BigDecimal(0);
191
+        for (CmcSettle settle : typeList) {
192
+            CmcSettleSummary cmcSettleSummary = new CmcSettleSummary();
193
+            cmcSettleSummary.setSettleId(settle.getSettleId());
194
+            cmcSettleSummary.setContent("实际结算总金额");
195
+            if (cmcSettleSummaryService.selectCmcSettleSummaryList(cmcSettleSummary).size() > 0) {
196
+                CmcSettleSummary settleSummary = cmcSettleSummaryService.selectCmcSettleSummaryList(cmcSettleSummary).get(0);
197
+                if (settleSummary.getAmount() != null)
198
+                    pAmount = pAmount.add(settleSummary.getAmount());
199
+            }
200
+        }
201
+        typeAmountObject.put("项目结算", pAmount);
202
+        for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
203
+            BigDecimal pyAmount = new BigDecimal(0);
204
+            int count = 0;
205
+            for (CmcSettle settle : typeList) {
206
+                CmcSettleSummary cmcSettleSummary = new CmcSettleSummary();
207
+                cmcSettleSummary.setSettleId(settle.getSettleId());
208
+                cmcSettleSummary.setContent("实际结算总金额");
209
+                if (cmcSettleSummaryService.selectCmcSettleSummaryList(cmcSettleSummary).size() > 0) {
210
+                    CmcSettleSummary settleSummary = cmcSettleSummaryService.selectCmcSettleSummaryList(cmcSettleSummary).get(0);
211
+                    if (settleSummary.getAmount() != null && settle.getProjectNumber() != null && settle.getProjectNumber().contains(String.valueOf(i))) {
212
+                        pyAmount = pyAmount.add(settleSummary.getAmount());
213
+                        count ++;
214
+                    }
215
+                }
216
+            }
217
+            yearProjectCountObject.put(i + "项目", count);
218
+            yearProjectAmountObject.put(i + "项目", pyAmount);
219
+        }
220
+        cmcSettle.setXmName(null);
221
+        cmcSettle.setProjectId("0");
222
+        typeList = cmcSettleService.selectCmcSettleList(cmcSettle);
223
+        typeObject.put("其他结算", typeList.size());
224
+        BigDecimal oAmount = new BigDecimal(0);
225
+        for (CmcSettle settle : typeList) {
226
+            CmcSettleSummary cmcSettleSummary = new CmcSettleSummary();
227
+            cmcSettleSummary.setSettleId(settle.getSettleId());
228
+            cmcSettleSummary.setContent("实际结算总金额");
229
+            if (cmcSettleSummaryService.selectCmcSettleSummaryList(cmcSettleSummary).size() > 0) {
230
+                CmcSettleSummary settleSummary = cmcSettleSummaryService.selectCmcSettleSummaryList(cmcSettleSummary).get(0);
231
+                if (settleSummary.getAmount() != null)
232
+                    oAmount = oAmount.add(settleSummary.getAmount());
233
+            }
234
+        }
235
+        typeAmountObject.put("其他结算", oAmount);
236
+    }
169
 }
237
 }

+ 2
- 2
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBorrowMapper.xml Целия файл

122
             <if test="applyDept != null  and applyDept != ''"> and b.apply_dept = #{applyDept}</if>
122
             <if test="applyDept != null  and applyDept != ''"> and b.apply_dept = #{applyDept}</if>
123
             <if test="applier != null "> and b.applier = #{applier}</if>
123
             <if test="applier != null "> and b.applier = #{applier}</if>
124
             <if test="remark != null "> and b.remark = #{remark}</if>
124
             <if test="remark != null "> and b.remark = #{remark}</if>
125
-            <if test="applyDate != null "> and YEAR(b.apply_date) = YEAR(#{applyDate})</if>
125
+            <if test="applyDate != null "> and b.apply_date = #{applyDate}</if>
126
             <if test="applyAmount != null "> and b.apply_amount = #{applyAmount}</if>
126
             <if test="applyAmount != null "> and b.apply_amount = #{applyAmount}</if>
127
             <if test="managerAmount != null "> and b.manager_amount = #{managerAmount}</if>
127
             <if test="managerAmount != null "> and b.manager_amount = #{managerAmount}</if>
128
             <if test="deptComment != null  and deptComment != ''"> and b.dept_comment = #{deptComment}</if>
128
             <if test="deptComment != null  and deptComment != ''"> and b.dept_comment = #{deptComment}</if>
141
             <if test="managerTime != null "> and b.manager_time = #{managerTime}</if>
141
             <if test="managerTime != null "> and b.manager_time = #{managerTime}</if>
142
             <if test="zjlTime != null "> and b.zjl_time = #{zjlTime}</if>
142
             <if test="zjlTime != null "> and b.zjl_time = #{zjlTime}</if>
143
             <if test="dszTime != null "> and b.dsz_time = #{dszTime}</if>
143
             <if test="dszTime != null "> and b.dsz_time = #{dszTime}</if>
144
-            <if test="lendTime != null "> and b.lend_time = #{lendTime}</if>
144
+            <if test="lendTime != null "> and YEAR(b.lend_time) = YEAR(#{lendTime})</if>
145
             <if test="unionTime != null "> and b.union_time = #{unionTime}</if>
145
             <if test="unionTime != null "> and b.union_time = #{unionTime}</if>
146
         </where>
146
         </where>
147
         order by b.apply_date desc
147
         order by b.apply_date desc

+ 2
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSettleMapper.xml Целия файл

119
             <if test="projectNumber != null  and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>
119
             <if test="projectNumber != null  and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>
120
             <if test="undertakingDept != null  and undertakingDept != ''"> and find_in_set(#{undertakingDept}, p.undertaking_dept)</if>
120
             <if test="undertakingDept != null  and undertakingDept != ''"> and find_in_set(#{undertakingDept}, p.undertaking_dept)</if>
121
             <if test="reportDept != null  and reportDept != ''"> and s.report_dept = #{reportDept}</if>
121
             <if test="reportDept != null  and reportDept != ''"> and s.report_dept = #{reportDept}</if>
122
-            <if test="xmName != null"> and s.xm_name like concat('%', #{xmName}, '%')</if>
122
+            <if test="xmName != null"> and s.xm_name = #{xmName}</if>
123
             <if test="workloadReport != null  and workloadReport != ''"> and s.workload_report = #{workloadReport}</if>
123
             <if test="workloadReport != null  and workloadReport != ''"> and s.workload_report = #{workloadReport}</if>
124
             <if test="reporter != null "> and s.reporter = #{reporter}</if>
124
             <if test="reporter != null "> and s.reporter = #{reporter}</if>
125
             <if test="reportTime != null "> and s.report_time = #{reportTime}</if>
125
             <if test="reportTime != null "> and s.report_time = #{reportTime}</if>
138
             <if test="managerComment != null  and managerComment != ''"> and s.manager_comment = #{managerComment}</if>
138
             <if test="managerComment != null  and managerComment != ''"> and s.manager_comment = #{managerComment}</if>
139
             <if test="gmUserId != null "> and s.gm_user_id = #{gmUserId}</if>
139
             <if test="gmUserId != null "> and s.gm_user_id = #{gmUserId}</if>
140
             <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) == '2000' "> and s.gm_time is not null</if>
140
             <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) == '2000' "> and s.gm_time is not null</if>
141
+            <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) != '2000' "> and YEAR(s.gm_time) = YEAR(#{gmTime})</if>
141
             <if test="gmComment != null  and gmComment != ''"> and s.gm_comment = #{gmComment}</if>
142
             <if test="gmComment != null  and gmComment != ''"> and s.gm_comment = #{gmComment}</if>
142
         </where>
143
         </where>
143
         order by s.report_time desc
144
         order by s.report_time desc

+ 4
- 4
oa-ui/src/views/statistics/components/borrowStatistics.vue Целия файл

1
 <!--
1
 <!--
2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-10-18 11:17:48
3
  * @Date: 2024-10-18 11:17:48
4
- * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-10-23 17:00:10
4
+ * @LastEditors: wrh
5
+ * @LastEditTime: 2024-10-24 14:54:45
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div style="width:100%;" v-loading="loading">
8
   <div style="width:100%;" v-loading="loading">
107
             year = ''
107
             year = ''
108
           }
108
           }
109
           that.dataLoading = true
109
           that.dataLoading = true
110
-          getBorrowStatistic({ applyDate: year }).then(res => {
110
+          getBorrowStatistic({ lendTime: year }).then(res => {
111
             that.borrowUsage = res.data.usage[0];
111
             that.borrowUsage = res.data.usage[0];
112
             that.borrowUsageAmount = res.data.usageAmount[0];
112
             that.borrowUsageAmount = res.data.usageAmount[0];
113
             that.dataLoading = false
113
             that.dataLoading = false
328
         xAxis: [
328
         xAxis: [
329
           {
329
           {
330
             type: 'category',
330
             type: 'category',
331
-            data: Object.keys(this.yearProjectAmount).map(item => item + '项目'),
331
+            data: Object.keys(this.yearProjectAmount),
332
             axisPointer: {
332
             axisPointer: {
333
               type: 'shadow'
333
               type: 'shadow'
334
             }
334
             }

Loading…
Отказ
Запис