Commit 5afa1c14ba12849d9eb33ab468973aad8519b86c
1 parent
461ec576
bf
Showing
3 changed files
with
45 additions
and
19 deletions
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineHistoryReportController.java
| @@ -52,6 +52,7 @@ import com.ruoyi.project.system.user.service.IUserService; | @@ -52,6 +52,7 @@ import com.ruoyi.project.system.user.service.IUserService; | ||
| 52 | import com.ruoyi.project.utils.ExcelUtils; | 52 | import com.ruoyi.project.utils.ExcelUtils; |
| 53 | 53 | ||
| 54 | import javax.servlet.ServletOutputStream; | 54 | import javax.servlet.ServletOutputStream; |
| 55 | +import javax.servlet.http.HttpServletRequest; | ||
| 55 | import javax.servlet.http.HttpServletResponse; | 56 | import javax.servlet.http.HttpServletResponse; |
| 56 | 57 | ||
| 57 | @Controller | 58 | @Controller |
| @@ -200,8 +201,7 @@ public class BsthTLineHistoryReportController extends BaseController | @@ -200,8 +201,7 @@ public class BsthTLineHistoryReportController extends BaseController | ||
| 200 | @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) | 201 | @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) |
| 201 | @RequestMapping("/export2") | 202 | @RequestMapping("/export2") |
| 202 | @ResponseBody | 203 | @ResponseBody |
| 203 | - public void export(HttpServletResponse response,BsthTLine bsthTLine) throws NoSuchFieldException { | ||
| 204 | - | 204 | + public void export(HttpServletResponse response, BsthTLine bsthTLine, HttpServletRequest request) throws NoSuchFieldException { |
| 205 | //查询变更记录 | 205 | //查询变更记录 |
| 206 | List<LineHistoryReport> list =bsthTLineService.getLineHistoryReport(bsthTLine); | 206 | List<LineHistoryReport> list =bsthTLineService.getLineHistoryReport(bsthTLine); |
| 207 | 207 |
bsthLineProfiles/src/main/resources/mybatis/mybatis/system/BsthTLineMapper.xml
| @@ -1075,6 +1075,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -1075,6 +1075,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 1075 | <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time <= #{createTimeEnd}</if> | 1075 | <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time <= #{createTimeEnd}</if> |
| 1076 | <if test="historyId != null and historyId != ''"> and history_id is not null</if> | 1076 | <if test="historyId != null and historyId != ''"> and history_id is not null</if> |
| 1077 | <if test="updateStatus != null and updateStatus != ''"> and update_status #{updateStatus}</if> | 1077 | <if test="updateStatus != null and updateStatus != ''"> and update_status #{updateStatus}</if> |
| 1078 | + <if test="lineUpdateType != null and lineUpdateType != ''"> and line_update_type =#{lineUpdateType}</if> | ||
| 1078 | </where> | 1079 | </where> |
| 1079 | </select> | 1080 | </select> |
| 1080 | 1081 | ||
| @@ -1777,6 +1778,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -1777,6 +1778,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 1777 | h2.has_timelists hasTimelistsOld,h2.is_metro isMetroOld,h2.metro_time metroTimeOld,h2.cold_bonus_type coldBonusTypeOld,h2.night_parking nightParkingOld,h2.start_date startDateOld, | 1778 | h2.has_timelists hasTimelistsOld,h2.is_metro isMetroOld,h2.metro_time metroTimeOld,h2.cold_bonus_type coldBonusTypeOld,h2.night_parking nightParkingOld,h2.start_date startDateOld, |
| 1778 | h2.line_update_type lineUpdateTypeOld,h2.revenue_type revenueTypeOld | 1779 | h2.line_update_type lineUpdateTypeOld,h2.revenue_type revenueTypeOld |
| 1779 | FROM bsth_t_line_history h1 LEFT JOIN bsth_t_line_history h2 on h1.history_id=h2.id | 1780 | FROM bsth_t_line_history h1 LEFT JOIN bsth_t_line_history h2 on h1.history_id=h2.id |
| 1781 | + <where> | ||
| 1782 | + <if test="createTimeStr != null and createTimeStr != ''"> and h1.create_time >= #{createTimeStr}</if> | ||
| 1783 | + <if test="createTimeEnd != null and createTimeEnd != ''"> and h1.create_time <= #{createTimeEnd}</if> | ||
| 1784 | + <if test="lineName != null and lineName != ''"> and h1.line_name =#{lineName}</if> | ||
| 1785 | + <if test="lineUpdateType != null and lineUpdateType != ''"> and h1.line_update_type =#{lineUpdateType}</if> | ||
| 1786 | + </where> | ||
| 1780 | </select> | 1787 | </select> |
| 1781 | 1788 | ||
| 1782 | </mapper> | 1789 | </mapper> |
| 1783 | \ No newline at end of file | 1790 | \ No newline at end of file |
bsthLineProfiles/src/main/resources/templates/system/historyReport/historyReport.html
| @@ -17,22 +17,24 @@ | @@ -17,22 +17,24 @@ | ||
| 17 | </li> --> | 17 | </li> --> |
| 18 | <li> | 18 | <li> |
| 19 | <label>线路名:</label> | 19 | <label>线路名:</label> |
| 20 | - <input type="text" name="lineName"/> | 20 | + <input type="text" name="lineName" id="lineName"/> |
| 21 | </li> | 21 | </li> |
| 22 | <li> | 22 | <li> |
| 23 | <label>性质:</label> | 23 | <label>性质:</label> |
| 24 | - <select name="lineUpdateType" th:with="type=${@dict.getType('lineUpdateType')}"> | 24 | + <select name="lineUpdateType" id="lineUpdateType" th:with="type=${@dict.getType('lineUpdateType')}"> |
| 25 | <option value=""></option> | 25 | <option value=""></option> |
| 26 | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" | 26 | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" |
| 27 | th:value="${dict.dictValue}"></option> | 27 | th:value="${dict.dictValue}"></option> |
| 28 | </select> | 28 | </select> |
| 29 | </li> | 29 | </li> |
| 30 | - <li> | ||
| 31 | - <label>开通日期:</label> | ||
| 32 | - <input type="text" name="startDate" autocomplete="off"/> | 30 | + <li ><label>审批日期:</label> |
| 31 | + <li class="select-time"> | ||
| 32 | + <input type="text" class="time-input" id="createTimeStr" placeholder="开始时间" name="params[beginTime]" lay-key="1"> | ||
| 33 | + <span>-</span> | ||
| 34 | + <input type="text" class="time-input" id="createTimeEnd" placeholder="结束时间" name="params[endTime]" lay-key="2"> | ||
| 35 | + </li> | ||
| 33 | </li> | 36 | </li> |
| 34 | <li> | 37 | <li> |
| 35 | - | ||
| 36 | <el-button size="mini" type="primary" icon="el-icon-search" onClick="$.table.search();">搜索</el-button> | 38 | <el-button size="mini" type="primary" icon="el-icon-search" onClick="$.table.search();">搜索</el-button> |
| 37 | <el-button size="mini" icon="el-icon-refresh" onClick="$.form.reset();">重置</el-button> | 39 | <el-button size="mini" icon="el-icon-refresh" onClick="$.form.reset();">重置</el-button> |
| 38 | </li> | 40 | </li> |
| @@ -74,12 +76,20 @@ | @@ -74,12 +76,20 @@ | ||
| 74 | } | 76 | } |
| 75 | 77 | ||
| 76 | dicts = allDicts; | 78 | dicts = allDicts; |
| 77 | - | ||
| 78 | - | 79 | + |
| 80 | + function queryParams(params) { | ||
| 81 | + var search = $.table.queryParams(params); | ||
| 82 | + var createTimeStr=$('#createTimeStr').val()!=''?$('#createTimeStr').val()+' 23:59':''; | ||
| 83 | + var createTimeEnd=$('#createTimeEnd').val()!=''?$('#createTimeEnd').val()+' 23:59':''; | ||
| 84 | + search.createTimeStr=createTimeStr; | ||
| 85 | + search.createTimeEnd=createTimeEnd; | ||
| 86 | + return search; | ||
| 87 | + } | ||
| 79 | var options = { | 88 | var options = { |
| 80 | url: prefix + "/list", | 89 | url: prefix + "/list", |
| 81 | exportUrl: prefix + "/export", | 90 | exportUrl: prefix + "/export", |
| 82 | modalName: "线路档案修改月报表", | 91 | modalName: "线路档案修改月报表", |
| 92 | + queryParams: queryParams, | ||
| 83 | columns: [{ | 93 | columns: [{ |
| 84 | checkbox: true | 94 | checkbox: true |
| 85 | }, | 95 | }, |
| @@ -150,17 +160,26 @@ | @@ -150,17 +160,26 @@ | ||
| 150 | }; | 160 | }; |
| 151 | $.table.init(options); | 161 | $.table.init(options); |
| 152 | }); | 162 | }); |
| 153 | - | ||
| 154 | - $("input[name='startDate']").datetimepicker({ | ||
| 155 | - format : "yyyy-mm", | ||
| 156 | - startView: 3, | ||
| 157 | - minView : 3, | ||
| 158 | - maxView : 3, | ||
| 159 | - autoclose : true | ||
| 160 | - }); | 163 | + |
| 164 | + $("input[name='createTimeStr']").datetimepicker({ | ||
| 165 | + format: "yyyy-mm-dd", | ||
| 166 | + minView: "month", | ||
| 167 | + autoclose: true | ||
| 168 | + }); | ||
| 169 | + $("input[name='createTimeEnd']").datetimepicker({ | ||
| 170 | + format: "yyyy-mm-dd", | ||
| 171 | + minView: "month", | ||
| 172 | + autoclose: true | ||
| 173 | + }); | ||
| 161 | function report(){ | 174 | function report(){ |
| 175 | + var createTimeStr=$('#createTimeStr').val()!=''?$('#createTimeStr').val()+' 23:59':''; | ||
| 176 | + var createTimeEnd=$('#createTimeEnd').val()!=''?$('#createTimeEnd').val()+' 23:59':''; | ||
| 177 | + var lineName=$('#lineName').val(); | ||
| 178 | + var lineUpdateType=$('#lineUpdateType').val(); | ||
| 179 | + | ||
| 162 | $.modal.confirm("确定导出统计报表吗?", function() { | 180 | $.modal.confirm("确定导出统计报表吗?", function() { |
| 163 | - location.href ="/system/historyReport/export2"; | 181 | + location.href ="/system/historyReport/export2?createTimeStr="+createTimeStr+'&createTimeEnd='+createTimeEnd |
| 182 | + +'&lineName='+lineName+'&lineUpdateType='+lineUpdateType; | ||
| 164 | }); | 183 | }); |
| 165 | } | 184 | } |
| 166 | </script> | 185 | </script> |