Ver código fonte

年度预算增加年预算、已申请、已报账金额

ly 3 dias atrás
pai
commit
9e8c9f7ad4

+ 4 - 0
src/main/java/com/liang/controller/PrjAnnualbudgetController.java

@@ -188,6 +188,9 @@ public class PrjAnnualbudgetController extends BaseController {
188 188
         return BaseResult.success(result);
189 189
     }
190 190
 
191
+    @Resource
192
+    private SysDeptInfoService sysDeptInfoService;
193
+
191 194
     @ApiOperation(value = "页面初始化", notes = "页面初始化")
192 195
     @RequestMapping(value = "/init_mylist", method = RequestMethod.GET)
193 196
     public String init_mylist(Model model) {
@@ -201,6 +204,7 @@ public class PrjAnnualbudgetController extends BaseController {
201 204
         List<String> yearList = prjAnnualbudgetService.getYearList();
202 205
         model.addAttribute("yearList", yearList);
203 206
 
207
+        model.addAttribute("dept",sysDeptInfoService.getDeptName());
204 208
         return "annualbudget/mylist";
205 209
     }
206 210
         @RequestMapping(value = "/ViewXGSQ", method = RequestMethod.GET)

+ 14 - 0
src/main/java/com/liang/entity/PrjAnnualbudget.java

@@ -96,6 +96,20 @@ public class PrjAnnualbudget implements Serializable {
96 96
      */
97 97
     private Integer sfxg;
98 98
 
99
+    /**
100
+     * 年度出资额
101
+     */
102
+    private Double czje;
103
+
104
+    /**
105
+     * 年度报账额
106
+     */
107
+    private Double bzze;
108
+
109
+    /**
110
+     * 申请金额
111
+     */
112
+    private Double sqje;
99 113
 
100 114
 }
101 115
 

+ 23 - 1
src/main/resources/mapper/PrjAnnualbudgetDao.xml

@@ -20,6 +20,10 @@
20 20
         <result property="ssbm" column="SSBM" jdbcType="INTEGER"/>
21 21
         <result property="xmzxq" column="XMZXQ" jdbcType="VARCHAR"/>
22 22
         <result property="sfxg" column="SFXG" jdbcType="INTEGER"/>
23
+        <result property="czje" column="CZJE" jdbcType="DOUBLE"/>
24
+        <result property="bzze" column="BZZE" jdbcType="DOUBLE"/>
25
+        <result property="sqje" column="SQJE" jdbcType="DOUBLE"/>
26
+
23 27
     </resultMap>
24 28
 
25 29
     <!--查询单个-->
@@ -349,9 +353,27 @@
349 353
         r.XM AS XMFZRXM,
350 354
         d.dept_name AS SSBMMC,
351 355
         u.name AS SQRXM,
352
-        bd.XMZYS
356
+        bd.XMZYS,
357
+        pf.CZJE * 10000 AS CZJE,
358
+        COALESCE(
359
+        -- 在子查询里先对BZJE列的NULL值替换为0,再进行关联、筛选、分组求和
360
+        (SELECT SUM(sb.BZJE)
361
+        FROM sta_BudgetApproval sb
362
+        where sb.NYS = a.ID AND sb.SPZT != '作废'
363
+        ),
364
+        0.00
365
+        ) AS BZZE,
366
+        COALESCE(
367
+        -- 在子查询里先对BZJE列的NULL值替换为0,再进行关联、筛选、分组求和
368
+        (SELECT SUM(sb.SQJE)
369
+        FROM sta_BudgetApproval sb
370
+        where sb.NYS = a.ID AND sb.SPZT != '作废'
371
+        ),
372
+        0.00
373
+        ) AS SQJE
353 374
         FROM
354 375
         prj_AnnualBudget a
376
+        LEFT JOIN prj_FeeScheme pf ON a.RWS = pf.ZB and a.NF =  pf.NF
355 377
         LEFT JOIN base_ProjectType t ON t.XMLX = a.XMLX
356 378
         LEFT JOIN base_Person r ON r.ID = a.XMFZR
357 379
         LEFT JOIN sys_user_info u ON u.user_id = a.SQR

+ 24 - 9
src/main/resources/templates/annualbudget/mylist.html

@@ -48,6 +48,7 @@
48 48
                                 </select>
49 49
                             </div>
50 50
                         </div>
51
+                        <br/>
51 52
                         <div class="layui-inline">
52 53
                             <label class="layui-form-label" style="width: 60px">项目类型</label>
53 54
                             <div class="layui-input-inline" style="width: 145px">
@@ -58,7 +59,7 @@
58 59
                                 </select>
59 60
                             </div>
60 61
                         </div>
61
-                        <br/>
62
+
62 63
                         <div class="layui-inline">
63 64
                             <label class="layui-form-label" style="width: 60px">所属部门</label>
64 65
                             <div class="layui-input-inline" style="width: 145px"><!--
@@ -169,19 +170,32 @@
169 170
             cols: [
170 171
                 [
171 172
                     {type: "checkbox", fixed: 'left'},
172
-                    {type: 'numbers', align: 'center'},
173
-                    {field: 'spzt', width: '13%', title: '审批状态'},
173
+                    {type: 'numbers', align: 'center',title: '序号'},
174
+                    {field: 'spzt', width: '7%', title: '审批状态'},
174 175
                     {field: 'rwsmc', width: '20%', title: '项目名称'},
175 176
                     // {field: 'mc', width: '20%', title: '名称'},
176
-                    {field: 'mc', width: '20%', title: '年度预算名称'},
177
+
177 178
                     {field: 'erpbh', width: '8%', title: 'ERP编号'},
178
-                    {field: 'xmlxmc', width: '12%', title: '项目类型'},
179
-                    {field: 'xmfzrxm', width: '7%', title: '项目负责人'},
180
-                    {field: 'ssbmmc', width: '10%', title: '所属部门'},
179
+                    {field: 'czje',width: '7%',title: '年预算(元)',align: 'right'},
180
+                    {field: 'sqje', width: '7%',title: '已申请(元)',align: 'right'},
181
+                    {field: 'bzze',width: '7%',title: '已报账(元)',align: 'right'},
182
+                    {templet: function (row) {
183
+                            const czjeValue = Number(row.czje); // 将获取到的值转换为数值类型
184
+                            const bzzeValue = Number(row.sqje);
185
+                            if (!isNaN(czjeValue) &&!isNaN(bzzeValue) && bzzeValue!== 0) { // 避免除数为0
186
+                                const syl =  (bzzeValue / czjeValue) * 100;
187
+                                return syl.toFixed(2) + '%';// 乘以100转换为百分比形式
188
+                            }
189
+                            return '0%'; // 如果出现异常情况(比如除数为0等),返回默认值0
190
+                        }, width: '7%',title: '使用率(%)',align: 'right'},
181 191
                     {field: 'nf', width: '5%', title: '年份'},
192
+                    {field: 'ssbmmc', width: '10%', title: '所属部门'},
182 193
                     {field: 'sqrxm', width: '6%', title: '申请人'},
183 194
                     {field: 'sqsj', width: '8%', title: '申请时间', align: 'center'},
184
-                    {field: 'sm', width: '10%', title: '说明'}
195
+                    {field: 'xmlxmc', width: '12%', title: '项目类型'},
196
+                    {field: 'xmfzrxm', width: '7%', title: '项目负责人'},
197
+                    {field: 'mc', width: '20%', title: '年度预算名称'},
198
+                   /* {field: 'sm', width: '10%', title: '说明'}*/
185 199
                 ]
186 200
             ],
187 201
             autoSort: false,
@@ -224,7 +238,8 @@
224 238
                 "rwsmc": '',
225 239
                 "ssbmmc": '',
226 240
                 "nf": '',
227
-                "spzt": ''
241
+                "spzt": '',
242
+                "xmmc": ''
228 243
             });
229 244
             // 执行搜索重载
230 245
             currTable.reload({

+ 1 - 1
src/main/resources/templates/annualbudget/view_xgsq.html

@@ -54,7 +54,7 @@
54 54
       cols: [
55 55
         [
56 56
           {type: "checkbox", fixed: 'left'},
57
-          {type: 'numbers', align: 'center'},
57
+          {type: 'numbers', align: 'center',title: '序号'},
58 58
           {field: 'spzt', width: '12%', title: '审批状态', sort: true},
59 59
           {field: 'xmlxmc', width: '10%', title: '类型', sort: true},
60 60
           {field: 'xm', width: '35%', title: '项目/申请', sort: true},