Commit 9751ebd7bc55a0cf67612bc9f8d237a14e26efe9
1 parent
32c718c5
bf
Showing
6 changed files
with
51 additions
and
5 deletions
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineController.java
| ... | ... | @@ -24,6 +24,7 @@ import java.io.File; |
| 24 | 24 | import java.lang.reflect.Field; |
| 25 | 25 | import java.lang.reflect.Method; |
| 26 | 26 | import java.util.*; |
| 27 | +import java.util.stream.Collectors; | |
| 27 | 28 | |
| 28 | 29 | /** |
| 29 | 30 | * 【请填写功能名称】Controller |
| ... | ... | @@ -94,6 +95,14 @@ public class BsthTLineController extends BaseController |
| 94 | 95 | public AjaxResult export(BsthTLine bsthTLine) throws NoSuchFieldException { |
| 95 | 96 | |
| 96 | 97 | List<BsthTLine> list = bsthTLineService.selectBsthTLineList(bsthTLine); |
| 98 | + List<BsthTLine> lines = bsthTLineService.usedBsthTLineReport(bsthTLine); | |
| 99 | + Map<String,List<BsthTLine>>map=lines.stream().collect(Collectors.groupingBy(BsthTLine::getLineName)); | |
| 100 | + for (int i = 0; i < list.size(); i++) { | |
| 101 | + BsthTLine tLine=list.get(i); | |
| 102 | + if(map.get(tLine.getLineName())!=null){ | |
| 103 | + list.set(i, map.get(tLine.getLineName()).get(0)); | |
| 104 | + } | |
| 105 | + } | |
| 97 | 106 | |
| 98 | 107 | List<DictData> dicts = dictDataService.selectDictDataList(null); |
| 99 | 108 | |
| ... | ... | @@ -287,8 +296,15 @@ public class BsthTLineController extends BaseController |
| 287 | 296 | |
| 288 | 297 | |
| 289 | 298 | /* |
| 290 | - | |
| 291 | - | |
| 299 | + //查询history整表 | |
| 300 | + //按lineName分组 | |
| 301 | + //createTime倒序 | |
| 302 | + //循环 如果createTime在所选时间内 | |
| 303 | + //相邻2条数据进行比较 | |
| 304 | + //new Bl 吧有差异的数据记录进去 | |
| 305 | + //放入一个list中 | |
| 306 | + //按公司和分公司分组 | |
| 307 | + 循环list统计那些字段有修改进行记录 | |
| 292 | 308 | |
| 293 | 309 | *//** |
| 294 | 310 | * 新增弹窗 | ... | ... |
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/mapper/BsthTLineMapper.java
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/IBsthTLineService.java
| ... | ... | @@ -67,5 +67,9 @@ public interface IBsthTLineService |
| 67 | 67 | boolean lineNameIsExistInBsthTLine(String lineName); |
| 68 | 68 | |
| 69 | 69 | List<BsthTLine> selectBsthTLineListAndExamine(BsthTLine bsthTLine); |
| 70 | + | |
| 71 | + | |
| 72 | + List<BsthTLine> usedBsthTLineReport(BsthTLine bsthTLine); | |
| 73 | + | |
| 70 | 74 | /*int createLineMonthReport();*/ |
| 71 | 75 | } | ... | ... |
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/impl/BsthTLineServiceImpl.java
| ... | ... | @@ -471,4 +471,10 @@ public class BsthTLineServiceImpl implements IBsthTLineService |
| 471 | 471 | return bsthTLineMapper.selectBsthTLineListAndExamine(bsthTLine); |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | + | |
| 475 | + @Override | |
| 476 | + public List<BsthTLine> usedBsthTLineReport(BsthTLine bsthTLine){ | |
| 477 | + return bsthTLineMapper.usedBsthTLineReport(bsthTLine); | |
| 478 | + } | |
| 479 | + | |
| 474 | 480 | } | ... | ... |
bsthLineProfiles/src/main/resources/mybatis/mybatis/system/BsthTLineMapper.xml
| ... | ... | @@ -213,6 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 213 | 213 | <if test="personAvg != null "> and person_avg = #{personAvg}</if> |
| 214 | 214 | <if test="startDate != null "> and start_date = #{startDate}</if> |
| 215 | 215 | <if test="nightParking != null and nightParking != ''"> and night_parking = #{nightParking}</if> |
| 216 | + <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time <= #{createTimeEnd}</if> | |
| 216 | 217 | </where> |
| 217 | 218 | </select> |
| 218 | 219 | |
| ... | ... | @@ -1717,4 +1718,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 1717 | 1718 | </select> |
| 1718 | 1719 | |
| 1719 | 1720 | |
| 1721 | + <select id="usedBsthTLineReport" parameterType="BsthTLine" resultMap="BsthTLineResult"> | |
| 1722 | + SELECT * from bsth_t_line_history | |
| 1723 | + WHERE id IN(SELECT max(id) FROM `bsth_t_line_history` where update_status=-1 | |
| 1724 | + <if test="createTimeEnd != null and createTimeEnd != ''"> and create_time <= #{createTimeEnd}</if> | |
| 1725 | + GROUP BY line_name) | |
| 1726 | + | |
| 1727 | + </select> | |
| 1728 | + | |
| 1729 | + | |
| 1720 | 1730 | </mapper> |
| 1721 | 1731 | \ No newline at end of file | ... | ... |
bsthLineProfiles/src/main/resources/templates/system/line/line.html
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | <head> |
| 5 | 5 | <th:block th:include="include :: header('线路档案信息')" /> |
| 6 | 6 | <th:block th:include="include :: select2-css" /> |
| 7 | + <th:block th:include="include :: datetimepicker-css" /> | |
| 7 | 8 | </head> |
| 8 | 9 | <body class="gray-bg"> |
| 9 | 10 | <div class="container-div" id="context"> |
| ... | ... | @@ -193,7 +194,9 @@ |
| 193 | 194 | class="time-input" placeholder="请选择轨交时间" name="metroTime" /></li> |
| 194 | 195 | <li><label>冷僻补贴:</label> <input type="text" |
| 195 | 196 | name="coldBonusType" /></li> |
| 196 | - | |
| 197 | + <li><label>日期截点:</label> <input type="text" | |
| 198 | + class="time-input" placeholder="日期截点" name="createTimeEnd" id="createTimeEnd"/> | |
| 199 | + </li> | |
| 197 | 200 | <li> |
| 198 | 201 | <el-button size="mini" type="primary" icon="el-icon-search" onClick="$.table.search();">搜索</el-button> |
| 199 | 202 | <el-button size="mini" icon="el-icon-refresh" onClick="$.form.reset();">重置</el-button> |
| ... | ... | @@ -243,7 +246,7 @@ |
| 243 | 246 | <!-- /.modal --> |
| 244 | 247 | </div> |
| 245 | 248 | |
| 246 | - | |
| 249 | +<th:block th:include="include :: datetimepicker-js" /> | |
| 247 | 250 | <script th:inline="javascript"> |
| 248 | 251 | |
| 249 | 252 | var companyList=[[${companyList}]]; |
| ... | ... | @@ -496,6 +499,7 @@ |
| 496 | 499 | var search = $.table.queryParams(params); |
| 497 | 500 | search.company=$('#company').select2('val'); |
| 498 | 501 | search.fCompany=$('#fCompany').select2('val'); |
| 502 | + search.createTimeEnd=$('#createTimeEnd').val()!=''?$('#createTimeEnd').val()+' 23:59:59':''; | |
| 499 | 503 | return search; |
| 500 | 504 | } |
| 501 | 505 | var editFlag = [[${@permission.hasPermi('system:line:edit')}]]; |
| ... | ... | @@ -830,6 +834,12 @@ |
| 830 | 834 | } |
| 831 | 835 | return true; |
| 832 | 836 | } |
| 837 | + | |
| 838 | + $("input[name='createTimeEnd']").datetimepicker({ | |
| 839 | + format : "yyyy-mm-dd", | |
| 840 | + minView : "month", | |
| 841 | + autoclose : true | |
| 842 | + }); | |
| 833 | 843 | </script> |
| 834 | 844 | |
| 835 | 845 | <style> | ... | ... |