Browse Source

统计报表 临时人员费用 模块 sql 调整

ly 5 months ago
parent
commit
2b7d0fefb0

+ 1 - 2
src/main/java/com/liang/controller/StaMaterialController.java

@@ -6,9 +6,8 @@ import com.github.pagehelper.PageInfo;
6 6
 import com.liang.common.JsonTool;
7 7
 import com.liang.common.base.BaseController;
8 8
 import com.liang.common.base.BaseResult;
9
-import com.liang.entity.StaBudgetapproval;
10 9
 import com.liang.entity.StaMaterial;
11
-import com.liang.entity.UtilEntity;
10
+import com.liang.entity.baobiao.UtilEntity;
12 11
 import com.liang.service.PrjAnnualbudgetService;
13 12
 import com.liang.service.StaMaterialService;
14 13
 import org.springframework.data.domain.Page;

File diff suppressed because it is too large
+ 60 - 9
src/main/java/com/liang/controller/StaTempmemberController.java


+ 2 - 1
src/main/java/com/liang/dao/StaTempmemberDao.java

@@ -2,6 +2,7 @@ package com.liang.dao;
2 2
 
3 3
 import com.liang.entity.StaSourceFee;
4 4
 import com.liang.entity.StaTempmember;
5
+import com.spire.ms.System.Security.Cryptography.MACTripleDES;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 import org.springframework.data.domain.Pageable;
7 8
 
@@ -143,7 +144,7 @@ public interface StaTempmemberDao {
143 144
      * @param JZRQ      创建结束日期
144 145
      * @return
145 146
      */
146
-    List<HashMap<String, Object>> searchTemeMemberCost(String MC, String SSBMNAME, String SQRQStart, String SQRQEnd, String QSRQ, String JZRQ);
147
+    List<HashMap<String, Object>> searchTemeMemberCost(Map map);
147 148
 
148 149
 
149 150
     StaTempmember getXm(Map map);

+ 108 - 0
src/main/java/com/liang/entity/baobiao/LsUtilEntity.java

@@ -0,0 +1,108 @@
1
+package com.liang.entity.baobiao;
2
+
3
+import com.fasterxml.jackson.annotation.JsonProperty;
4
+
5
+import java.io.Serializable;
6
+
7
+/**
8
+ * @Author ly
9
+ * @Date 2024/7/4 11:28
10
+ * @Version 1.0
11
+ */
12
+public class LsUtilEntity implements Serializable {
13
+    @JsonProperty("XMMC")
14
+    private String xmmc;
15
+
16
+    @JsonProperty("QSRQ")
17
+    private String qsrq;
18
+
19
+    @JsonProperty("JSRQ")
20
+    private String jsrq;
21
+
22
+    @JsonProperty("ERPBH")
23
+    private String erpbh;
24
+    @JsonProperty("NF")
25
+    private String nf;
26
+    @JsonProperty("FYSQBH")
27
+    private String fysqbh;
28
+
29
+    @JsonProperty("XM")
30
+    private String xm;
31
+
32
+    @JsonProperty("PYQSSJ")
33
+    private String pyqssj;
34
+    @JsonProperty("PYDQSSJ")
35
+    private String pydqssj;
36
+
37
+    public String getXmmc() {
38
+        return xmmc;
39
+    }
40
+
41
+    public void setXmmc(String xmmc) {
42
+        this.xmmc = xmmc;
43
+    }
44
+
45
+    public String getQsrq() {
46
+        return qsrq;
47
+    }
48
+
49
+    public void setQsrq(String qsrq) {
50
+        this.qsrq = qsrq;
51
+    }
52
+
53
+    public String getJsrq() {
54
+        return jsrq;
55
+    }
56
+
57
+    public void setJsrq(String jsrq) {
58
+        this.jsrq = jsrq;
59
+    }
60
+
61
+    public String getErpbh() {
62
+        return erpbh;
63
+    }
64
+
65
+    public void setErpbh(String erpbh) {
66
+        this.erpbh = erpbh;
67
+    }
68
+
69
+    public String getNf() {
70
+        return nf;
71
+    }
72
+
73
+    public void setNf(String nf) {
74
+        this.nf = nf;
75
+    }
76
+
77
+    public String getFysqbh() {
78
+        return fysqbh;
79
+    }
80
+
81
+    public void setFysqbh(String fysqbh) {
82
+        this.fysqbh = fysqbh;
83
+    }
84
+
85
+    public String getXm() {
86
+        return xm;
87
+    }
88
+
89
+    public void setXm(String xm) {
90
+        this.xm = xm;
91
+    }
92
+
93
+    public String getPyqssj() {
94
+        return pyqssj;
95
+    }
96
+
97
+    public void setPyqssj(String pyqssj) {
98
+        this.pyqssj = pyqssj;
99
+    }
100
+
101
+    public String getPYDQSSJ() {
102
+        return pydqssj;
103
+    }
104
+
105
+    public void setPYDQSSJ(String PYDQSSJ) {
106
+        this.pydqssj = PYDQSSJ;
107
+    }
108
+}

+ 1 - 1
src/main/java/com/liang/entity/UtilEntity.java

@@ -1,4 +1,4 @@
1
-package com.liang.entity;
1
+package com.liang.entity.baobiao;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonProperty;
4 4
 

+ 1 - 1
src/main/java/com/liang/service/StaTempmemberService.java

@@ -128,7 +128,7 @@ public interface StaTempmemberService {
128 128
      * @param JZRQ      创建结束日期
129 129
      * @return
130 130
      */
131
-    List<HashMap<String, Object>> searchTemeMemberCost(String MC, String SSBMNAME, String SQRQStart, String SQRQEnd, String QSRQ, String JZRQ);
131
+    List<HashMap<String, Object>> searchTemeMemberCost(Map map);
132 132
 
133 133
     StaTempmember getXm(Map map);
134 134
 

+ 2 - 2
src/main/java/com/liang/service/impl/StaTempmemberServiceImpl.java

@@ -118,8 +118,8 @@ public class StaTempmemberServiceImpl implements StaTempmemberService {
118 118
     }
119 119
 
120 120
     @Override
121
-    public List<HashMap<String, Object>> searchTemeMemberCost(String MC, String SSBMNAME, String SQRQStart, String SQRQEnd, String QSRQ, String JZRQ) {
122
-        return this.staTempmemberDao.searchTemeMemberCost(MC, SSBMNAME, SQRQStart, SQRQEnd, QSRQ, JZRQ);
121
+    public List<HashMap<String, Object>> searchTemeMemberCost(Map map) {
122
+        return this.staTempmemberDao.searchTemeMemberCost(map);
123 123
     }
124 124
 
125 125
     @Override

+ 50 - 30
src/main/resources/mapper/StaTempmemberDao.xml

@@ -296,54 +296,74 @@
296 296
     </select>
297 297
 
298 298
     <!-- 通过条件查询临时费用信息 -->
299
-    <select id="searchTemeMemberCost" resultType="Map">
300
-        SELECT sta_TempMember.ID,
299
+    <select id="searchTemeMemberCost" resultType="HashMap">
300
+        SELECT
301
+        sta_TempMember.ID,
301 302
         sys_dept_info.dept_name AS BM,
302 303
         sta_BudgetApproval.XMMC,
304
+        sta_BudgetApproval.SQJE,
305
+        sta_BudgetApproval.ERPBH,
306
+        sta_Reimbursement.BZJE,
307
+        sta_BudgetApproval.BH AS ApprovalBH,
308
+        sta_BudgetApproval.NF,
303 309
         base_Person.XM AS XMFZR,
310
+        base_ProjectType.XMLXMC,
304 311
         sta_TempMember.XM,
305 312
         sta_TempMember.SFZH,
306
-        CAST(sta_TempMember.QSRQ AS date) AS QSRQ,
307
-        CAST(sta_TempMember.JSRQ AS date) AS JSRQ,
313
+        CAST ( sta_TempMember.QSRQ AS DATE ) AS QSRQ,
314
+        CAST ( sta_TempMember.JSRQ AS DATE ) AS JSRQ,
308 315
         sta_TempMember.FYSQ,
309 316
         sta_TempMember.BZFY,
310 317
         sta_TempMember.BYXX,
311 318
         sta_TempMember.ZY,
312 319
         sta_TempMember.XL,
313 320
         sta_TempMember.GZDD,
314
-        sta_BudgetApproval.BH,
321
+        sta_BudgetApproval.BH AS BudgetBH,
315 322
         CASE
316
-        WHEN sta_BudgetApproval.SFBYJ = 0 THEN '否'
317
-        WHEN sta_BudgetApproval.SFBYJ = 1 THEN '是'
318
-        ELSE CAST(sta_BudgetApproval.SFBYJ AS varchar(11))
323
+
324
+        WHEN sta_BudgetApproval.SFBYJ = 0 THEN
325
+        '否'
326
+        WHEN sta_BudgetApproval.SFBYJ = 1 THEN
327
+        '是' ELSE CAST ( sta_BudgetApproval.SFBYJ AS VARCHAR ( 11 ) )
319 328
         END AS SFBYJ,
320
-        CAST(sta_BudgetApproval.SQSJ AS date) AS SQSJ
321
-        FROM sta_TempMember,
322
-        sta_BudgetApproval,
323
-        prj_Project,
324
-        base_Person,
325
-        sys_dept_info
326
-        WHERE sta_TempMember.ZB = sta_BudgetApproval.ID
327
-        AND sta_BudgetApproval.XMID = prj_Project.ID
328
-        AND sta_BudgetApproval.XMFZR = base_Person.ID
329
-        AND sta_BudgetApproval.SSBM = sys_dept_info.dept_id
330
-        <if test="MC != null and MC != ''">
331
-            AND sta_BudgetApproval.XMMC LIKE '%${MC}%'
329
+        CAST ( sta_BudgetApproval.SQSJ AS DATE ) AS SQSJ
330
+        FROM
331
+        sta_TempMember
332
+        LEFT JOIN sta_BudgetApproval ON sta_TempMember.ZB = sta_BudgetApproval.ID
333
+        LEFT JOIN prj_Project ON sta_BudgetApproval.XMID = prj_Project.ID
334
+        LEFT JOIN base_Person ON sta_BudgetApproval.XMFZR = base_Person.ID
335
+        LEFT JOIN sys_dept_info ON sta_BudgetApproval.SSBM = sys_dept_info.dept_id
336
+        LEFT JOIN base_ProjectType ON sta_BudgetApproval.XMLX = base_ProjectType.XMLX
337
+        LEFT JOIN sta_Reimbursement ON sta_BudgetApproval.ID = sta_Reimbursement.FYSQ
338
+        WHERE
339
+        sta_BudgetApproval.XMMC != 'NULL'
340
+        AND sta_BudgetApproval.SPZT != '作废'
341
+        <if test="xmmc != null and xmmc != ''">
342
+            AND sta_BudgetApproval.XMMC LIKE '%'+#{xmmc}+'%'
343
+        </if>
344
+        <if test="xm != null and xm != ''">
345
+            AND sta_TempMember.XM LIKE '%'+#{xm}+'%'
346
+        </if>
347
+        <if test="erpbh != null and erpbh != ''">
348
+            AND sta_BudgetApproval.ERPBH Like '%'+#{erpbh}+'%'
349
+        </if>
350
+        <if test="bh != null and bh != ''">
351
+            AND sta_BudgetApproval.BH like '%'+#{bh}+'%'
332 352
         </if>
333
-        <if test="SSBMNAME != null and SSBMNAME != ''">
334
-            AND sta_TempMember.XM LIKE '%${SSBMNAME}%'
353
+        <if test="nf != null and nf != ''">
354
+            AND sta_BudgetApproval.NF = #{nf}
335 355
         </if>
336
-        <if test="SQRQStart != null and SQRQStart != ''">
337
-            AND sta_TempMember.QSRQ  <![CDATA[>= ]]> #{SQRQStart}
356
+        <if test="pyqssj != null and pyqssj != ''">
357
+            AND sta_TempMember.QSRQ  <![CDATA[>= ]]> #{pyqssj}
338 358
         </if>
339
-        <if test="SQRQEnd != null and SQRQEnd != ''">
340
-            AND sta_TempMember.JSRQ  <![CDATA[<= ]]> #{SQRQEnd}
359
+        <if test="pyjssj != null and pyjssj != ''">
360
+            AND sta_TempMember.JSRQ  <![CDATA[<= ]]> #{pyjssj}
341 361
         </if>
342
-        <if test="QSRQ != null and QSRQ != ''">
343
-            AND sta_BudgetApproval.SQSJ  <![CDATA[>= ]]> #{QSRQ}
362
+        <if test="qsrq != null and qsrq != ''">
363
+            AND sta_BudgetApproval.SQSJ  <![CDATA[>= ]]> #{qsrq}
344 364
         </if>
345
-        <if test="JZRQ != null and JZRQ != ''">
346
-            AND sta_BudgetApproval.SQSJ  <![CDATA[<= ]]> #{JZRQ}
365
+        <if test="jsrq != null and jsrq != ''">
366
+            AND sta_BudgetApproval.SQSJ  <![CDATA[<= ]]> #{jsrq}
347 367
         </if>
348 368
     </select>
349 369
     <select id="getXm" resultMap="StaTempmemberMap" parameterType="map">

+ 61 - 30
src/main/resources/templates/statistical/tempMember.html

@@ -27,25 +27,29 @@
27 27
                         <div class="layui-inline" style="margin-right: 10px;">
28 28
                             <label class="layui-form-label" style="width: 80px;">项目名称</label>
29 29
                             <div class="layui-input-inline" style="width: 224px;">
30
-                                <input type="text" id="xmmc" name="xmmc" autocomplete="off" class="layui-input">
30
+                                <input type="text" id="XMMC" name="XMMC" autocomplete="off" class="layui-input">
31 31
                             </div>
32 32
                         </div>
33 33
                         <div class="layui-inline" style="margin-right: 10px;">
34 34
                             <label class="layui-form-label" style="width: 80px;">erp编号</label>
35 35
                             <div class="layui-input-inline" style="width: 140px;">
36
-                                <input type="text" id="erpbh" name="erpbh" autocomplete="off" class="layui-input">
36
+                                <input type="text" id="ERPBH" name="ERPBH" autocomplete="off" class="layui-input">
37 37
                             </div>
38 38
                         </div>
39 39
                         <div class="layui-inline" style="margin-right: 10px;">
40 40
                             <label class="layui-form-label" style="width: 80px;">费用申请号</label>
41 41
                             <div class="layui-input-inline" style="width: 140px;">
42
-                                <input type="text" id="fysqbh" name="fysqbh" autocomplete="off" class="layui-input">
42
+                                <input type="text" id="FYSQBH" name="FYSQBH" autocomplete="off" class="layui-input">
43 43
                             </div>
44 44
                         </div>
45 45
                         <div class="layui-inline" style="margin-right: 10px;">
46
-                            <label class="layui-form-label" style="width: 80px;">年度</label>
47
-                            <div class="layui-input-inline" style="width: 140px;">
48
-                                <input type="text" id="nf" name="nf" autocomplete="off" class="layui-input">
46
+                            <label class="layui-form-label" style="width: 60px">年份</label>
47
+                            <div class="layui-input-inline" style="width: 150px">
48
+                                <select name="NF" id="NF" lay-filter="status">
49
+                                    <option value="">全部</option>
50
+                                    <option th:each="item:${yearList}" th:text="${item.nf}"
51
+                                            th:value="${item.nf}"></option>
52
+                                </select>
49 53
                             </div>
50 54
                         </div>
51 55
                     </div>
@@ -58,25 +62,25 @@
58 62
                             </div>
59 63
                             <div class="layui-form-mid">-</div>
60 64
                             <div class="layui-input-inline" style="width: 100px;">
61
-                                <input type="text" name="JZRQ" id="JZRQ" placeholder="结束日期" class="layui-input" readonly>
65
+                                <input type="text" name="JSRQ" id="JSRQ" placeholder="结束日期" class="layui-input" readonly>
62 66
                             </div>
63 67
                         </div>
64 68
                         <div class="layui-inline">
65 69
                             <label class="layui-form-label" style="width: 80px">临时人员姓名</label>
66 70
                             <div class="layui-input-inline" style="width: 140px">
67
-                                <input type="text" id="SSBMNAME" name="SSBMNAME" class="layui-input"
71
+                                <input type="text" id="XM" name="XM" class="layui-input"
68 72
                                        autocomplete="off"/>
69 73
                             </div>
70 74
                         </div>
71 75
                         <div class="layui-inline">
72 76
                             <label class="layui-form-label" style="width: 80px">聘用日期</label>
73 77
                             <div class="layui-input-inline" style="width: 100px;">
74
-                                <input type="text" name="SQRQStart" id="SQRQStart" placeholder="开始日期"
78
+                                <input type="text" name="PYQSSJ" id="PYQSSJ" placeholder="开始日期"
75 79
                                        class="layui-input" readonly>
76 80
                             </div>
77 81
                             <div class="layui-form-mid">-</div>
78 82
                             <div class="layui-input-inline" style="width: 100px;">
79
-                                <input type="text" name="SQRQEnd" id="SQRQEnd" placeholder="结束日期" class="layui-input"
83
+                                <input type="text" name="PYDQSSJ" id="PYDQSSJ" placeholder="结束日期" class="layui-input"
80 84
                                        readonly>
81 85
                             </div>
82 86
                         </div>
@@ -98,7 +102,9 @@
98 102
         </fieldset>
99 103
 
100 104
         <script type="text/html" id="toolbarDemo">
101
-
105
+            <button class="layui-btn layui-btn-sm" lay-event="export" style="background-color: #2f363c" >
106
+                <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>批量导出
107
+            </button>
102 108
         </script>
103 109
 
104 110
         <input type="hidden" id="userId" name="userId" class="layui-input" th:value="${userId}">
@@ -131,16 +137,16 @@
131 137
 
132 138
         //日期
133 139
         laydate.render({
134
-            elem: '#SQRQStart'
140
+            elem: '#PYQSSJ'
135 141
         });
136 142
         laydate.render({
137
-            elem: '#SQRQEnd'
143
+            elem: '#PYDQSSJ'
138 144
         });
139 145
         laydate.render({
140 146
             elem: '#QSRQ'
141 147
         });
142 148
         laydate.render({
143
-            elem: '#JZRQ'
149
+            elem: '#JSRQ'
144 150
         });
145 151
 
146 152
         var currTable = table.render({
@@ -153,21 +159,24 @@
153 159
                 [
154 160
                     {type: "checkbox", fixed: 'left'},
155 161
                     {type: 'numbers', align: 'center'},
162
+                    {field: 'XMMC', width: '10%', title: '项目名称'},
156 163
                     {field: 'BM', width: '7%', title: '项目部门'},
157
-                    {field: 'XMMC', width: '15%', title: '项目名称', sort: true},
164
+                    {field: 'XMLXMC',width: '10%',title: '项目类型'},
165
+                    {field: 'ERPBH',width: '10%',title: 'ERP编号'},
166
+                    {field: 'ApprovalBH', width: '15%', title: '科研费号'},
167
+                    {field: 'NF',width: '5%',title: '年份'},
158 168
                     {field: 'XMFZR', width: '7%', title: '项目负责人'},
159 169
                     {field: 'XM', width: '9%', title: '临聘人员姓名'},
160 170
                     {field: 'SFZH', width: '15%', title: '身份证号'},
161
-                    {field: 'QSRQ', width: '10%', title: '起始日期'},
162
-                    {field: 'JSRQ', width: '10%', title: '结束日期'},
163
-                    {field: 'FYSQ', width: '10%', title: '申请费用'},
164
-                    {field: 'BZFY', width: '10%', title: '报账费用'},
171
+                    {field: 'QSRQ', width: '10%', title: '聘用起始时间'},
172
+                    {field: 'JSRQ', width: '10%', title: '聘用截止时间'},
173
+                    {field: 'SQJE', width: '7%', title: '申请费用'},
174
+                    {field: 'BZJE', width: '7%', title: '报账费用'},
165 175
                     {field: 'BYXX', width: '7%', title: '毕业学校'},
166 176
                     {field: 'ZY', width: '7%', title: '专业'},
167 177
                     {field: 'XL', width: '7%', title: '学历'},
168 178
                     {field: 'GZDD', width: '10%', title: '工作地点'},
169
-                    {field: 'BH', width: '15%', title: '科研费号'},
170
-                    {field: 'SFBYJ', width: '10%', title: '是否备用金'},
179
+                    {field: 'SFBYJ', width: '7%', title: '是否备用金'},
171 180
                     {field: 'SQSJ', width: '10%', title: '申请时间'},
172 181
                     {field: 'ID', width: '0', title: 'id', hide: true}
173 182
                 ]
@@ -211,12 +220,16 @@
211 220
         // 监听重置操作
212 221
         form.on('submit(data-reset-btn)', function (data) {
213 222
             form.val("search-form", {
214
-                "MC": '',
215
-                "SSBMNAME": '',
216
-                'SQRQStart': '',
217
-                'SQRQEnd': '',
223
+                "XMMC": '',
224
+                "ERPBH": '',
225
+                'FYSQB': '',
218 226
                 'QSRQ': '',
219
-                'JZRQ': ''
227
+                'JSRQ': '',
228
+                'XM': '',
229
+                'PYQSSJ': '',
230
+                'PYDQSSJ': '',
231
+                'NF': '',
232
+
220 233
             });
221 234
             // 执行搜索重载
222 235
             currTable.reload({
@@ -238,10 +251,28 @@
238 251
                 }
239 252
             });
240 253
         });
241
-        var cancelIndex;
242
-        /**
243
-         * toolbar监听事件
244
-         */
254
+        // 条件,批量导出
255
+        table.on('toolbar(currentTableFilter)', function (obj) {
256
+            if (obj.event ==='export'){
257
+                var formData = form.val('search-form');
258
+                console.log(formData);
259
+                var formDataString = JSON.stringify(formData);
260
+                AjaxUtil.post({
261
+                    url:AjaxUtil.ctx +'staTempmember/getAll/'+formDataString,
262
+                    contentType: "application/json",
263
+                    timeout: 15000, //大批量导出时会出现超时问题
264
+                    success: function(res){
265
+                        console.log(res);
266
+                        table.exportFile('currentTableId',res.data,'xlsx');
267
+                    },
268
+                    error:function (error) {
269
+                        Message.error(error,2000)
270
+
271
+                    }
272
+                });
273
+            }
274
+
275
+        });
245 276
     });
246 277
 
247 278