Browse Source

统计报表印刷费

ly 5 months ago
parent
commit
2f726e5ce4

+ 37 - 3
src/main/java/com/liang/controller/StaPrintingFeeController.java

@@ -1,5 +1,6 @@
1 1
 package com.liang.controller;
2 2
 
3
+import com.fasterxml.jackson.databind.ObjectMapper;
3 4
 import com.github.pagehelper.PageHelper;
4 5
 import com.github.pagehelper.PageInfo;
5 6
 import com.liang.common.JsonTool;
@@ -7,6 +8,8 @@ import com.liang.common.base.BaseController;
7 8
 import com.liang.common.base.BaseResult;
8 9
 import com.liang.entity.StaBudgetapproval;
9 10
 import com.liang.entity.StaPrintingFee;
11
+import com.liang.entity.baobiao.UtilEntity;
12
+import com.liang.service.PrjAnnualbudgetService;
10 13
 import com.liang.service.StaPrintingFeeService;
11 14
 import org.springframework.data.domain.Page;
12 15
 import org.springframework.data.domain.PageRequest;
@@ -34,6 +37,8 @@ public class StaPrintingFeeController extends BaseController {
34 37
      */
35 38
     @Resource
36 39
     private StaPrintingFeeService staPrintingFeeService;
40
+    @Resource
41
+    private PrjAnnualbudgetService prjAnnualbudgetService;
37 42
 
38 43
     /**
39 44
      * 分页查询
@@ -175,19 +180,31 @@ public class StaPrintingFeeController extends BaseController {
175 180
     //项目报表(印刷费用)页面
176 181
     @RequestMapping("/search")
177 182
     public String search(Model model) {
183
+        List<String> yearList = prjAnnualbudgetService.getYearList();
184
+        model.addAttribute("yearList", yearList);
178 185
         return "statistical/printingFee";
179 186
     }
180 187
 
181 188
     //印刷费用全部及条件查询
182 189
     @ResponseBody
183 190
     @RequestMapping(value = "/searchData", method = RequestMethod.POST)
184
-    public BaseResult searchData(@RequestParam(required = false, defaultValue = "", value = "MC") String mc,
191
+    public BaseResult searchData(@RequestParam(required = false, defaultValue = "", value = "XMMC") String xmmc,
185 192
                                  @RequestParam(required = false, defaultValue = "", value = "QSRQ") String qsrq,
186
-                                 @RequestParam(required = false, defaultValue = "", value = "JZRQ") String jzrq,
193
+                                 @RequestParam(required = false, defaultValue = "", value = "JSRQ") String jsrq,
194
+                                 @RequestParam(required = false, defaultValue = "", value = "ERPBH") String erpbh,
195
+                                 @RequestParam(required = false, defaultValue = "", value = "FYSQBH")String fysqbh,
196
+                                 @RequestParam(required = false, defaultValue = "", value = "NF")String nf,
187 197
                                  @RequestParam("page") Integer pageNum,
188 198
                                  @RequestParam("limit") Integer pageSize) {
189 199
         PageHelper.startPage(pageNum,pageSize);
190
-        List<HashMap<String, Object>> staFeasibilityreport = staPrintingFeeService.searchPrintingCost(mc, qsrq, jzrq);
200
+        Map<String, String> map = new HashMap<>();
201
+        map.put("xmmc",xmmc);
202
+        map.put("qsrq",qsrq);
203
+        map.put("jsrq",jsrq);
204
+        map.put("erpbh",erpbh);
205
+        map.put("bh",fysqbh);
206
+        map.put("nf",nf);
207
+        List<HashMap<String, Object>> staFeasibilityreport = staPrintingFeeService.searchPrintingCost(map);
191 208
         PageInfo<HashMap<String, Object>> pageinfo = new PageInfo<>(staFeasibilityreport);
192 209
         List<HashMap<String, Object>> rows = pageinfo.getList();
193 210
         int total = (int) pageinfo.getTotal();
@@ -196,4 +213,21 @@ public class StaPrintingFeeController extends BaseController {
196 213
         result.put(RESULT_TOTAL, total);
197 214
         return BaseResult.success(result);
198 215
     }
216
+    @ResponseBody
217
+    @RequestMapping(value = "/getAll/{formData}",method = RequestMethod.POST)
218
+    public  BaseResult getAll(@PathVariable(required = false) String formData)throws Exception{
219
+        Map<String, String> map = new HashMap<>();
220
+        ObjectMapper objectMapper = new ObjectMapper();
221
+        UtilEntity util = objectMapper.readValue(formData, UtilEntity.class);
222
+        map.put("xmmc",util.getXmmc());
223
+        map.put("qsrq",util.getQsrq());
224
+        map.put("jsrq",util.getJsrq());
225
+        map.put("erpbh",util.getErpbh());
226
+        map.put("bh",util.getFysqbh());
227
+        map.put("nf",util.getNf());
228
+        List<HashMap<String, Object>> staFeasibilityreport = staPrintingFeeService.searchPrintingCost(map);
229
+
230
+        return BaseResult.success(staFeasibilityreport);
231
+    }
232
+
199 233
 }

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

@@ -7,6 +7,7 @@ import org.springframework.data.domain.Pageable;
7 7
 
8 8
 import java.util.HashMap;
9 9
 import java.util.List;
10
+import java.util.Map;
10 11
 
11 12
 /**
12 13
  * 会议费(StaPrintingFee)表数据库访问层
@@ -112,5 +113,5 @@ public interface StaPrintingFeeDao {
112 113
      * @param JZRQ 创建结束日期
113 114
      * @return
114 115
      */
115
-    List<HashMap<String, Object>> searchPrintingCost(String MC, String QSRQ, String JZRQ);
116
+    List<HashMap<String, Object>> searchPrintingCost(Map map);
116 117
 }

+ 2 - 1
src/main/java/com/liang/service/StaPrintingFeeService.java

@@ -7,6 +7,7 @@ import org.springframework.data.domain.PageRequest;
7 7
 
8 8
 import java.util.HashMap;
9 9
 import java.util.List;
10
+import java.util.Map;
10 11
 
11 12
 /**
12 13
  * 会议费(StaPrintingFee)表服务接口
@@ -95,5 +96,5 @@ public interface StaPrintingFeeService {
95 96
      * @param jzrq 创建结束日期
96 97
      * @return
97 98
      */
98
-    List<HashMap<String, Object>> searchPrintingCost(String mc, String qsrq, String jzrq);
99
+    List<HashMap<String, Object>> searchPrintingCost(Map map);
99 100
 }

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

@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
12 12
 import javax.annotation.Resource;
13 13
 import java.util.HashMap;
14 14
 import java.util.List;
15
+import java.util.Map;
15 16
 
16 17
 /**
17 18
  * 打印费(StaPrintingFee)表服务实现类
@@ -104,7 +105,7 @@ public class StaPrintingFeeServiceImpl implements StaPrintingFeeService {
104 105
     }
105 106
 
106 107
     @Override
107
-    public List<HashMap<String, Object>> searchPrintingCost(String mc, String qsrq, String jzrq) {
108
-        return this.staPrintingFeeDao.searchPrintingCost(mc, qsrq, jzrq);
108
+    public List<HashMap<String, Object>> searchPrintingCost(Map map) {
109
+        return this.staPrintingFeeDao.searchPrintingCost(map);
109 110
     }
110 111
 }

+ 49 - 19
src/main/resources/mapper/StaPrintingFeeDao.xml

@@ -113,26 +113,56 @@
113 113
                                                               where SQKYFH like #{sqkyfh} + '%'
114 114
                                                               order by ID desc </select>
115 115
     <!--  项目报表(打印费)查询  -->
116
-    <select id="searchPrintingCost" resultType="Map">
117
-        SELECT sta_PrintingFee.ID,sys_dept_info.dept_name AS
118
-        BM,sta_BudgetApproval.XMMC,sta_BudgetApproval.BH,base_ProjectType.XMLXMC,base_Person.XM AS
119
-        XMFZR,sta_PrintingFee.SQKYFH,sta_PrintingFee.FYSQ,BZJEH,sta_PrintingFee.BZJEBH, CASE WHEN
120
-        sta_BudgetApproval.SFBYJ = 0 THEN '否' WHEN sta_BudgetApproval.SFBYJ = 1 THEN '是' ELSE
121
-        CAST(sta_BudgetApproval.SFBYJ AS varchar(11)) END AS SFBYJ, CAST(sta_BudgetApproval.SQSJ AS date) AS SQSJ FROM
122
-        sta_PrintingFee , sta_BudgetApproval ,prj_Project,sys_dept_info,base_Person,base_ProjectType WHERE
123
-        sta_PrintingFee.ZB = sta_BudgetApproval.ID AND sta_BudgetApproval.XMID = prj_Project.ID AND
124
-        sta_BudgetApproval.SSBM = sys_dept_info.dept_id AND sta_BudgetApproval.XMLX = base_ProjectType.XMLX AND
125
-        sta_BudgetApproval.XMFZR = base_Person.ID
126
-        <if test="MC != null and MC != ''">AND sta_BudgetApproval.XMMC LIKE '%${MC}%'</if>
127
-        <if test="QSRQ != null and QSRQ != ''">
128
-            AND sta_BudgetApproval.SQSJ
129
-            <![CDATA[ >= ]]>
130
-            #{QSRQ}
116
+    <select id="searchPrintingCost" resultType="HashMap">
117
+        SELECT
118
+        sta_PrintingFee.ID,
119
+        sys_dept_info.dept_name AS BM,
120
+        sta_BudgetApproval.XMMC,
121
+        sta_BudgetApproval.SQJE,
122
+        sta_Reimbursement.BZJE,
123
+        sta_Reimbursement.BHSJE,
124
+        sta_BudgetApproval.NF,
125
+        sta_BudgetApproval.ERPBH,
126
+        sta_BudgetApproval.BH,
127
+        base_ProjectType.XMLXMC,
128
+        base_Person.XM AS XMFZR,
129
+        sta_PrintingFee.SQKYFH,
130
+        sta_PrintingFee.FYSQ,
131
+        sta_PrintingFee.BZJEH,
132
+        sta_PrintingFee.BZJEBH,
133
+        CASE
134
+
135
+        WHEN sta_BudgetApproval.SFBYJ = 0 THEN
136
+        '否'
137
+        WHEN sta_BudgetApproval.SFBYJ = 1 THEN
138
+        '是' ELSE CAST ( sta_BudgetApproval.SFBYJ AS VARCHAR ( 11 ) )
139
+        END AS SFBYJ,
140
+        CAST ( sta_BudgetApproval.SQSJ AS DATE ) AS SQSJ
141
+        FROM
142
+        sta_PrintingFee
143
+        LEFT JOIN sta_BudgetApproval ON sta_PrintingFee.ZB = sta_BudgetApproval.ID
144
+        INNER JOIN prj_Project ON sta_BudgetApproval.XMID = prj_Project.ID
145
+        INNER JOIN sys_dept_info ON sta_BudgetApproval.SSBM = sys_dept_info.dept_id
146
+        INNER JOIN base_Person ON sta_BudgetApproval.XMFZR = base_Person.ID
147
+        INNER JOIN base_ProjectType ON sta_BudgetApproval.XMLX = base_ProjectType.XMLX
148
+        INNER JOIN sta_Reimbursement ON sta_BudgetApproval.ID = sta_Reimbursement.FYSQ
149
+        <if test="xmmc != null and xmmc != ''">
150
+            AND sta_BudgetApproval.XMMC LIKE '%'+#{xmmc}+'%'
151
+                                           </if>
152
+        <if test="qsrq != null and qsrq != ''">
153
+            AND sta_BudgetApproval.SQSJ<![CDATA[ >= ]]>#{qsrq}
131 154
         </if>
132
-        <if test="JZRQ != null and JZRQ != ''">
133
-            AND sta_BudgetApproval.SQSJ
134
-            <![CDATA[ <= ]]>
135
-            #{JZRQ}
155
+        <if test="jsrq != null and jsrq != ''">
156
+            AND sta_BudgetApproval.SQSJ<![CDATA[ <= ]]>#{jsrq}
157
+        </if>
158
+        <if test="erpbh != null and erpbh != ''">
159
+            AND sta_BudgetApproval.ERPBH LIKE '%'+#{erpbh}+'%'
160
+        </if>
161
+        <if test="bh != null and bh != ''">
162
+            AND sta_BudgetApproval.BH LIKE '%'+#{bh}+'%'
163
+        </if>
164
+        <if test="nf != null and nf != ''">
165
+            AND sta_BudgetApproval.NF = #{nf}
136 166
         </if>
137 167
     </select>
138 168
 </mapper>

+ 51 - 21
src/main/resources/templates/statistical/printingFee.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,7 +62,7 @@
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" style="margin-right: 10px; margin-left: 10px;">
@@ -77,6 +81,9 @@
77 81
         </fieldset>
78 82
 
79 83
         <script type="text/html" id="toolbarDemo">
84
+            <button class="layui-btn layui-btn-sm" lay-event="export" style="background-color: #2f363c" >
85
+                <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>批量导出
86
+            </button>
80 87
 
81 88
         </script>
82 89
 
@@ -119,7 +126,7 @@
119 126
             elem: '#QSRQ'
120 127
         });
121 128
         laydate.render({
122
-            elem: '#JZRQ'
129
+            elem: '#JSRQ'
123 130
         });
124 131
 
125 132
 
@@ -133,15 +140,16 @@
133 140
                 [
134 141
                     {type: "checkbox", fixed: 'left'},
135 142
                     {type: 'numbers', align: 'center',title: '序号'},
136
-                    {field: 'BM', width: '7%', title: '项目部门'},
137 143
                     {field: 'XMMC', width: '15%', title: '项目名称', sort: true},
138
-                    {field: 'BH', width: '10%', title: '项目编号'},
139
-                    {field: '', width: '10%', title: '申请科研费号'},
144
+                    {field: 'BM', width: '7%', title: '项目部门'},
145
+                    {field: 'ERPBH', width: '10%', title: '项目编号'},
146
+                    {field: 'BH', width: '10%', title: '申请科研费号'},
147
+                    {field: 'NF', width: '7%', title: '年份'},
140 148
                     {field: 'XMLXMC', width: '10%', title: '项目类型'},
141 149
                     {field: 'XMFZR', width: '9%', title: '项目负责人'},
142
-                    {field: 'FYSQ', width: '15%', title: '申请金额'},
143
-                    {field: 'BZJEH', width: '10%', title: '报账金额(含税)'},
144
-                    {field: 'BZJEBH', width: '10%', title: '报账金额(不含税)'},
150
+                    {field: 'SQJE', width: '10%', title: '申请金额'},
151
+                    {field: 'BZJE', width: '10%', title: '报账金额(含税)'},
152
+                    {field: 'BHSJE', width: '10%', title: '报账金额(不含税)'},
145 153
                     {field: 'SFBYJ', width: '10%', title: '是否备用金'},
146 154
                     {field: 'SQSJ', width: '10%', title: '申请时间'},
147 155
                     {field: 'ID', width: '0', title: 'id', hide: true}
@@ -186,9 +194,12 @@
186 194
         // 监听重置操作
187 195
         form.on('submit(data-reset-btn)', function (data) {
188 196
             form.val("search-form", {
189
-                "MC": '',
190
-                "QSRQ": '',
191
-                'JZRQ': ''
197
+                "XMMC": '',
198
+                "ERPBH": '',
199
+                'FYSQBH': '',
200
+                'QSRQ': '',
201
+                'JSRQ': '',
202
+                'NF': ''
192 203
             });
193 204
             // 执行搜索重载
194 205
             currTable.reload({
@@ -210,10 +221,29 @@
210 221
                 }
211 222
             });
212 223
         });
213
-        var cancelIndex;
214
-        /**
215
-         * toolbar监听事件
216
-         */
224
+
225
+        // 条件,批量导出
226
+        table.on('toolbar(currentTableFilter)', function (obj) {
227
+            if (obj.event ==='export'){
228
+                var formData = form.val('search-form');
229
+                console.log(formData);
230
+                var formDataString = JSON.stringify(formData);
231
+                AjaxUtil.post({
232
+                    url:AjaxUtil.ctx +'staPrintingFee/getAll/'+formDataString,
233
+                    contentType: "application/json",
234
+                    timeout: 15000, //大批量导出时会出现超时问题
235
+                    success: function(res){
236
+                        console.log(res);
237
+                        table.exportFile('currentTableId',res.data,'xlsx');
238
+                    },
239
+                    error:function (error) {
240
+                        Message.error(error,2000)
241
+
242
+                    }
243
+                });
244
+            }
245
+
246
+        });
217 247
     });
218 248
 
219 249