Commit 602002b9a731cc8cd38f7f4660976f7294c82374
1 parent
5bfe7ebd
添加 是否为营运线路 和 全部分公司 的筛选
Showing
4 changed files
with
79 additions
and
50 deletions
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| ... | ... | @@ -1237,6 +1237,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 1237 | 1237 | s.setYwlc(Arith.add(s.getYwlc()!=null?s.getYwlc():0, s_.getYwlc())); |
| 1238 | 1238 | s.setQtlc(Arith.add(s.getQtlc()!=null?s.getQtlc():0, s_.getQtlc())); |
| 1239 | 1239 | s.setLjlc(Arith.add(s.getLjlc()!=null?s.getLjlc():0, s_.getLjlc())); |
| 1240 | + if(s_.getLjkslc() == null){ | |
| 1241 | + s_.setLjkslc(0d); | |
| 1242 | + } | |
| 1240 | 1243 | s.setLjkslc(Arith.add(s.getLjkslc()!=null?s.getLjkslc():0, s_.getLjkslc())); |
| 1241 | 1244 | s.setJhbcq(s.getJhbcq() + s_.getJhbcq()); |
| 1242 | 1245 | s.setJhbcz(s.getJhbcz() + s_.getJhbcz()); | ... | ... |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -55,6 +55,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 55 | 55 | if(subCompany.length() != 0) |
| 56 | 56 | sql += " and fgs_bm = '"+subCompany+"'"; |
| 57 | 57 | |
| 58 | + sql += " order by gs_bm, fgs_bm, xl_bm"; | |
| 59 | + | |
| 58 | 60 | list = jdbcTemplate.query(sql, |
| 59 | 61 | new RowMapper<ScheduleRealInfo>(){ |
| 60 | 62 | @Override |
| ... | ... | @@ -62,6 +64,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 62 | 64 | ScheduleRealInfo schedule = new ScheduleRealInfo(); |
| 63 | 65 | schedule.setScheduleDateStr(rs.getString("schedule_date_str")); |
| 64 | 66 | schedule.setRealExecDate(rs.getString("real_exec_date")); |
| 67 | + schedule.setXlBm(rs.getString("xl_bm")); | |
| 65 | 68 | schedule.setXlName(rs.getString("xl_name")); |
| 66 | 69 | schedule.setLpName(rs.getString("lp_name")); |
| 67 | 70 | schedule.setBcType(rs.getString("bc_type")); |
| ... | ... | @@ -325,7 +328,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 325 | 328 | Set<String> lineSet = getNotOperation(); |
| 326 | 329 | DecimalFormat df = new DecimalFormat("###0.##"); |
| 327 | 330 | |
| 328 | - String company = "", subCompany = ""; | |
| 331 | + String sfyy = "", company = "", subCompany = ""; | |
| 332 | + if(map.get("sfyy")!=null) | |
| 333 | + sfyy = map.get("sfyy").toString(); | |
| 329 | 334 | if(map.get("company")!=null) |
| 330 | 335 | company = map.get("company").toString(); |
| 331 | 336 | if(map.get("subCompany")!=null) |
| ... | ... | @@ -338,9 +343,27 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 338 | 343 | date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| 339 | 344 | } |
| 340 | 345 | |
| 341 | - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); | |
| 346 | + List<ScheduleRealInfo> schedules = this.getSchedule(company, subCompany, line, date); | |
| 347 | + Map<String, Boolean> lineNature = lineService.lineNature(); | |
| 342 | 348 | |
| 349 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 343 | 350 | Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); |
| 351 | + | |
| 352 | + //是否营运 | |
| 353 | + for(ScheduleRealInfo schedule : schedules){ | |
| 354 | + String xlbm = schedule.getXlBm(); | |
| 355 | + if(sfyy.length() == 0 || sfyy.equals("0")){ | |
| 356 | + list.add(schedule); | |
| 357 | + } else if(sfyy.equals("1")){ | |
| 358 | + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 359 | + list.add(schedule); | |
| 360 | + } | |
| 361 | + } else { | |
| 362 | + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 363 | + list.add(schedule); | |
| 364 | + } | |
| 365 | + } | |
| 366 | + } | |
| 344 | 367 | for(ScheduleRealInfo schedule : list){ |
| 345 | 368 | String key = schedule.getXlName(); |
| 346 | 369 | if(key == null || key.trim().equals("") || lineSet.contains(key)) |
| ... | ... | @@ -1317,20 +1340,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1317 | 1340 | |
| 1318 | 1341 | String xlbm = s.getXlBm(); |
| 1319 | 1342 | boolean flag = false; |
| 1320 | - if(sfyy.length() != 0){ | |
| 1321 | - if(sfyy.equals("0")){ | |
| 1343 | + if(sfyy.length() == 0 || sfyy.equals("0")){ | |
| 1344 | + flag = true; | |
| 1345 | + } else if(sfyy.equals("1")){ | |
| 1346 | + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 1322 | 1347 | flag = true; |
| 1323 | - } else if(sfyy.equals("1")){ | |
| 1324 | - if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 1325 | - flag = true; | |
| 1326 | - } | |
| 1327 | - } else { | |
| 1328 | - if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 1329 | - flag = true; | |
| 1330 | - } | |
| 1331 | 1348 | } |
| 1332 | 1349 | } else { |
| 1333 | - flag = true; | |
| 1350 | + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 1351 | + flag = true; | |
| 1352 | + } | |
| 1334 | 1353 | } |
| 1335 | 1354 | if(!flag){ |
| 1336 | 1355 | continue; |
| ... | ... | @@ -1596,20 +1615,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1596 | 1615 | |
| 1597 | 1616 | boolean flag = false; |
| 1598 | 1617 | String xlbm = s.getXlBm(); |
| 1599 | - if(sfyy.length() != 0){ | |
| 1600 | - if(sfyy.equals("0")){ | |
| 1618 | + if(sfyy.length() == 0 || sfyy.equals("0")){ | |
| 1619 | + flag = true; | |
| 1620 | + } else if(sfyy.equals("1")){ | |
| 1621 | + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 1601 | 1622 | flag = true; |
| 1602 | - } else if(sfyy.equals("1")){ | |
| 1603 | - if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 1604 | - flag = true; | |
| 1605 | - } | |
| 1606 | - } else { | |
| 1607 | - if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 1608 | - flag = true; | |
| 1609 | - } | |
| 1610 | 1623 | } |
| 1611 | 1624 | } else { |
| 1612 | - flag = true; | |
| 1625 | + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 1626 | + flag = true; | |
| 1627 | + } | |
| 1613 | 1628 | } |
| 1614 | 1629 | if(!flag){ |
| 1615 | 1630 | continue; |
| ... | ... | @@ -2137,19 +2152,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 2137 | 2152 | |
| 2138 | 2153 | String sql_="select * from bsth_c_s_sp_info_real " |
| 2139 | 2154 | + " WHERE schedule_date_str = '"+date+"' "; |
| 2140 | - if(line.equals("")){ | |
| 2141 | - if(company.length() != 0) | |
| 2142 | - sql_ += " and gs_bm='"+company+"'"; | |
| 2143 | - if(subCompany.length() != 0) | |
| 2144 | - sql_ += " and fgs_bm='"+subCompany+"'"; | |
| 2145 | - }else{ | |
| 2155 | + if(!line.equals("")){ | |
| 2146 | 2156 | sql_ += " and xl_bm = '"+line+"'"; |
| 2147 | 2157 | } |
| 2158 | + if(company.length() != 0){ | |
| 2159 | + sql_ += " and gs_bm='"+company+"'"; | |
| 2160 | + } | |
| 2161 | + if(subCompany.length() != 0){ | |
| 2162 | + sql_ += " and fgs_bm='"+subCompany+"'"; | |
| 2163 | + } | |
| 2148 | 2164 | |
| 2149 | 2165 | |
| 2150 | 2166 | String sql="SELECT r.id,r.schedule_date_str,r.xl_name,r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.fcsj," |
| 2151 | 2167 | + " r.gs_name,r.fgs_name,CONCAT(r.xl_bm,'_',r.id) as line_sch FROM ("+sql_+") AS r" |
| 2152 | - + " order by r.xl_name,r.id "; | |
| 2168 | + + " order by r.gs_bm,r.fgs_bm,r.xl_bm,r.id "; | |
| 2153 | 2169 | |
| 2154 | 2170 | List<Map<String, Object>> tempList = jdbcTemplate.query(sql, |
| 2155 | 2171 | new RowMapper<Map<String, Object>>(){ |
| ... | ... | @@ -2184,20 +2200,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 2184 | 2200 | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); |
| 2185 | 2201 | for(Map<String, Object> m : tempList){ |
| 2186 | 2202 | String xlbm = m.get("xlbm").toString(); |
| 2187 | - if(sfyy.length() != 0){ | |
| 2188 | - if(sfyy.equals("0")){ | |
| 2203 | + if(sfyy.length() == 0 || sfyy.equals("0")){ | |
| 2204 | + list.add(m); | |
| 2205 | + } else if(sfyy.equals("1")){ | |
| 2206 | + if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 2189 | 2207 | list.add(m); |
| 2190 | - } else if(sfyy.equals("1")){ | |
| 2191 | - if(lineNature.containsKey(xlbm) && lineNature.get(xlbm)){ | |
| 2192 | - list.add(m); | |
| 2193 | - } | |
| 2194 | - } else { | |
| 2195 | - if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 2196 | - list.add(m); | |
| 2197 | - } | |
| 2198 | 2208 | } |
| 2199 | 2209 | } else { |
| 2200 | - list.add(m); | |
| 2210 | + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){ | |
| 2211 | + list.add(m); | |
| 2212 | + } | |
| 2201 | 2213 | } |
| 2202 | 2214 | } |
| 2203 | 2215 | ... | ... |
src/main/resources/static/pages/forms/statement/commandState.html
| ... | ... | @@ -176,7 +176,7 @@ |
| 176 | 176 | $("#company").on("change",updateCompany); |
| 177 | 177 | function updateCompany(){ |
| 178 | 178 | var company = $('#company').val(); |
| 179 | - var options = ''; | |
| 179 | + var options = '<option value="">全部分公司</option>'; | |
| 180 | 180 | for(var i = 0; i < obj.length; i++){ |
| 181 | 181 | if(obj[i].companyCode == company){ |
| 182 | 182 | var children = obj[i].children; |
| ... | ... | @@ -219,7 +219,8 @@ |
| 219 | 219 | var temp = tempData[$("#line").val()].split(":"); |
| 220 | 220 | $("#company").val(temp[0]); |
| 221 | 221 | updateCompany(); |
| 222 | - $("#subCompany").val(temp[1]); | |
| 222 | +// $("#subCompany").val(temp[1]); | |
| 223 | + $("#subCompany").val(""); | |
| 223 | 224 | $("#company").attr("disabled", true); |
| 224 | 225 | // $("#subCompany").attr("disabled", true); |
| 225 | 226 | } | ... | ... |
src/main/resources/static/pages/forms/statement/workDaily.html
| ... | ... | @@ -28,11 +28,11 @@ |
| 28 | 28 | <div class="portlet light porttlet-fit bordered"> |
| 29 | 29 | <div class="portlet-title"> |
| 30 | 30 | <form id="history" class="form-inline" action=""> |
| 31 | - <div style="display: inline-block; margin-left: 10px;" id="company1"> | |
| 31 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> | |
| 32 | 32 | <span class="item-label" style="width: 80px;">公司: </span> |
| 33 | 33 | <select class="form-control" name="company" id="company" style="width: 160px;"></select> |
| 34 | 34 | </div> |
| 35 | - <div style="display: inline-block; margin-left: 10px;" id="subCompany1"> | |
| 35 | + <div style="display: inline-block; margin-left: 5px;" id="subCompany1"> | |
| 36 | 36 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 37 | 37 | <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> |
| 38 | 38 | </div> |
| ... | ... | @@ -40,11 +40,20 @@ |
| 40 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 41 | 41 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 42 | 42 | </div> |
| 43 | - <div style="display: inline-block;margin-left: 10px;"> | |
| 43 | + <div style="margin-top: 10px"></div> | |
| 44 | + <div style="display: inline-block; margin-left: 5px"> | |
| 45 | + <span class="item-label" style="width: 80px;">是否营运: </span> | |
| 46 | + <select class="form-control" name="sfyy" id="sfyy" style="width: 160px;"> | |
| 47 | + <option value="0">全部线路</option> | |
| 48 | + <option value="1" selected="selected">营运线路</option> | |
| 49 | + <option value="2">非营运线路</option> | |
| 50 | + </select> | |
| 51 | + </div> | |
| 52 | + <div style="display: inline-block;margin-left: 19px;"> | |
| 44 | 53 | <span class="item-label" style="width: 80px;">时间: </span> |
| 45 | - <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 54 | + <input class="form-control" type="text" id="date" style="width: 160px;"/> | |
| 46 | 55 | </div> |
| 47 | - <div class="form-group"> | |
| 56 | + <div class="form-group" style="margin-left: 10px;"> | |
| 48 | 57 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 49 | 58 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 50 | 59 | </div> |
| ... | ... | @@ -185,7 +194,7 @@ |
| 185 | 194 | updateCompany(); |
| 186 | 195 | $("#subCompany").val(temp[1]); |
| 187 | 196 | $("#company").attr("disabled", true); |
| 188 | - $("#subCompany").attr("disabled", true); | |
| 197 | +// $("#subCompany").attr("disabled", true); | |
| 189 | 198 | } |
| 190 | 199 | }); |
| 191 | 200 | |
| ... | ... | @@ -194,6 +203,7 @@ |
| 194 | 203 | |
| 195 | 204 | $("#query").on("click",jsDoQuery); |
| 196 | 205 | |
| 206 | + var sfyy = $("#sfyy").val(); | |
| 197 | 207 | var line = $("#line").val(); |
| 198 | 208 | var date = $("#date").val(); |
| 199 | 209 | var company = $("#company").val(); |
| ... | ... | @@ -205,6 +215,7 @@ |
| 205 | 215 | return; |
| 206 | 216 | } |
| 207 | 217 | var params = {}; |
| 218 | + sfyy = $("#sfyy").val(); | |
| 208 | 219 | line = $("#line").val(); |
| 209 | 220 | date = $("#date").val(); |
| 210 | 221 | company = $("#company").val(); |
| ... | ... | @@ -214,6 +225,7 @@ |
| 214 | 225 | lineName = $('#subCompany option:selected').text(); |
| 215 | 226 | if(line == " ") |
| 216 | 227 | line = ""; |
| 228 | + params['sfyy'] = sfyy; | |
| 217 | 229 | params['line'] = line; |
| 218 | 230 | params['date'] = date; |
| 219 | 231 | params['type'] = "query"; |
| ... | ... | @@ -237,6 +249,7 @@ |
| 237 | 249 | |
| 238 | 250 | $("#export").on("click",function(){ |
| 239 | 251 | var params = {}; |
| 252 | + params['sfyy'] = sfyy; | |
| 240 | 253 | params['line'] = line; |
| 241 | 254 | params['date'] = date; |
| 242 | 255 | params['type'] = "export"; | ... | ... |