Commit 602002b9a731cc8cd38f7f4660976f7294c82374

Authored by 娄高锋
1 parent 5bfe7ebd

添加 是否为营运线路 和 全部分公司 的筛选

src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -1237,6 +1237,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer @@ -1237,6 +1237,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer
1237 s.setYwlc(Arith.add(s.getYwlc()!=null?s.getYwlc():0, s_.getYwlc())); 1237 s.setYwlc(Arith.add(s.getYwlc()!=null?s.getYwlc():0, s_.getYwlc()));
1238 s.setQtlc(Arith.add(s.getQtlc()!=null?s.getQtlc():0, s_.getQtlc())); 1238 s.setQtlc(Arith.add(s.getQtlc()!=null?s.getQtlc():0, s_.getQtlc()));
1239 s.setLjlc(Arith.add(s.getLjlc()!=null?s.getLjlc():0, s_.getLjlc())); 1239 s.setLjlc(Arith.add(s.getLjlc()!=null?s.getLjlc():0, s_.getLjlc()));
  1240 + if(s_.getLjkslc() == null){
  1241 + s_.setLjkslc(0d);
  1242 + }
1240 s.setLjkslc(Arith.add(s.getLjkslc()!=null?s.getLjkslc():0, s_.getLjkslc())); 1243 s.setLjkslc(Arith.add(s.getLjkslc()!=null?s.getLjkslc():0, s_.getLjkslc()));
1241 s.setJhbcq(s.getJhbcq() + s_.getJhbcq()); 1244 s.setJhbcq(s.getJhbcq() + s_.getJhbcq());
1242 s.setJhbcz(s.getJhbcz() + s_.getJhbcz()); 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,6 +55,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
55 if(subCompany.length() != 0) 55 if(subCompany.length() != 0)
56 sql += " and fgs_bm = '"+subCompany+"'"; 56 sql += " and fgs_bm = '"+subCompany+"'";
57 57
  58 + sql += " order by gs_bm, fgs_bm, xl_bm";
  59 +
58 list = jdbcTemplate.query(sql, 60 list = jdbcTemplate.query(sql,
59 new RowMapper<ScheduleRealInfo>(){ 61 new RowMapper<ScheduleRealInfo>(){
60 @Override 62 @Override
@@ -62,6 +64,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -62,6 +64,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
62 ScheduleRealInfo schedule = new ScheduleRealInfo(); 64 ScheduleRealInfo schedule = new ScheduleRealInfo();
63 schedule.setScheduleDateStr(rs.getString("schedule_date_str")); 65 schedule.setScheduleDateStr(rs.getString("schedule_date_str"));
64 schedule.setRealExecDate(rs.getString("real_exec_date")); 66 schedule.setRealExecDate(rs.getString("real_exec_date"));
  67 + schedule.setXlBm(rs.getString("xl_bm"));
65 schedule.setXlName(rs.getString("xl_name")); 68 schedule.setXlName(rs.getString("xl_name"));
66 schedule.setLpName(rs.getString("lp_name")); 69 schedule.setLpName(rs.getString("lp_name"));
67 schedule.setBcType(rs.getString("bc_type")); 70 schedule.setBcType(rs.getString("bc_type"));
@@ -325,7 +328,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -325,7 +328,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
325 Set<String> lineSet = getNotOperation(); 328 Set<String> lineSet = getNotOperation();
326 DecimalFormat df = new DecimalFormat("###0.##"); 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 if(map.get("company")!=null) 334 if(map.get("company")!=null)
330 company = map.get("company").toString(); 335 company = map.get("company").toString();
331 if(map.get("subCompany")!=null) 336 if(map.get("subCompany")!=null)
@@ -338,9 +343,27 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -338,9 +343,27 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
338 date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 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 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); 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 for(ScheduleRealInfo schedule : list){ 367 for(ScheduleRealInfo schedule : list){
345 String key = schedule.getXlName(); 368 String key = schedule.getXlName();
346 if(key == null || key.trim().equals("") || lineSet.contains(key)) 369 if(key == null || key.trim().equals("") || lineSet.contains(key))
@@ -1317,20 +1340,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1317,20 +1340,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1317 1340
1318 String xlbm = s.getXlBm(); 1341 String xlbm = s.getXlBm();
1319 boolean flag = false; 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 flag = true; 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 } else { 1349 } else {
1333 - flag = true; 1350 + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){
  1351 + flag = true;
  1352 + }
1334 } 1353 }
1335 if(!flag){ 1354 if(!flag){
1336 continue; 1355 continue;
@@ -1596,20 +1615,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1596,20 +1615,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1596 1615
1597 boolean flag = false; 1616 boolean flag = false;
1598 String xlbm = s.getXlBm(); 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 flag = true; 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 } else { 1624 } else {
1612 - flag = true; 1625 + if(lineNature.containsKey(xlbm) && !lineNature.get(xlbm)){
  1626 + flag = true;
  1627 + }
1613 } 1628 }
1614 if(!flag){ 1629 if(!flag){
1615 continue; 1630 continue;
@@ -2137,19 +2152,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -2137,19 +2152,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2137 2152
2138 String sql_="select * from bsth_c_s_sp_info_real " 2153 String sql_="select * from bsth_c_s_sp_info_real "
2139 + " WHERE schedule_date_str = '"+date+"' "; 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 sql_ += " and xl_bm = '"+line+"'"; 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 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," 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 + " r.gs_name,r.fgs_name,CONCAT(r.xl_bm,'_',r.id) as line_sch FROM ("+sql_+") AS r" 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 List<Map<String, Object>> tempList = jdbcTemplate.query(sql, 2170 List<Map<String, Object>> tempList = jdbcTemplate.query(sql,
2155 new RowMapper<Map<String, Object>>(){ 2171 new RowMapper<Map<String, Object>>(){
@@ -2184,20 +2200,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -2184,20 +2200,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2184 List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); 2200 List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
2185 for(Map<String, Object> m : tempList){ 2201 for(Map<String, Object> m : tempList){
2186 String xlbm = m.get("xlbm").toString(); 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 list.add(m); 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 } else { 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,7 +176,7 @@
176 $("#company").on("change",updateCompany); 176 $("#company").on("change",updateCompany);
177 function updateCompany(){ 177 function updateCompany(){
178 var company = $('#company').val(); 178 var company = $('#company').val();
179 - var options = ''; 179 + var options = '<option value="">全部分公司</option>';
180 for(var i = 0; i < obj.length; i++){ 180 for(var i = 0; i < obj.length; i++){
181 if(obj[i].companyCode == company){ 181 if(obj[i].companyCode == company){
182 var children = obj[i].children; 182 var children = obj[i].children;
@@ -219,7 +219,8 @@ @@ -219,7 +219,8 @@
219 var temp = tempData[$("#line").val()].split(":"); 219 var temp = tempData[$("#line").val()].split(":");
220 $("#company").val(temp[0]); 220 $("#company").val(temp[0]);
221 updateCompany(); 221 updateCompany();
222 - $("#subCompany").val(temp[1]); 222 +// $("#subCompany").val(temp[1]);
  223 + $("#subCompany").val("");
223 $("#company").attr("disabled", true); 224 $("#company").attr("disabled", true);
224 // $("#subCompany").attr("disabled", true); 225 // $("#subCompany").attr("disabled", true);
225 } 226 }
src/main/resources/static/pages/forms/statement/workDaily.html
@@ -28,11 +28,11 @@ @@ -28,11 +28,11 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form id="history" class="form-inline" action=""> 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 <span class="item-label" style="width: 80px;">公司: </span> 32 <span class="item-label" style="width: 80px;">公司: </span>
33 <select class="form-control" name="company" id="company" style="width: 160px;"></select> 33 <select class="form-control" name="company" id="company" style="width: 160px;"></select>
34 </div> 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 <span class="item-label" style="width: 80px;">分公司: </span> 36 <span class="item-label" style="width: 80px;">分公司: </span>
37 <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> 37 <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
38 </div> 38 </div>
@@ -40,11 +40,20 @@ @@ -40,11 +40,20 @@
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
42 </div> 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 <span class="item-label" style="width: 80px;">时间: </span> 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 </div> 55 </div>
47 - <div class="form-group"> 56 + <div class="form-group" style="margin-left: 10px;">
48 <input class="btn btn-default" type="button" id="query" value="筛选"/> 57 <input class="btn btn-default" type="button" id="query" value="筛选"/>
49 <input class="btn btn-default" type="button" id="export" value="导出"/> 58 <input class="btn btn-default" type="button" id="export" value="导出"/>
50 </div> 59 </div>
@@ -185,7 +194,7 @@ @@ -185,7 +194,7 @@
185 updateCompany(); 194 updateCompany();
186 $("#subCompany").val(temp[1]); 195 $("#subCompany").val(temp[1]);
187 $("#company").attr("disabled", true); 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,6 +203,7 @@
194 203
195 $("#query").on("click",jsDoQuery); 204 $("#query").on("click",jsDoQuery);
196 205
  206 + var sfyy = $("#sfyy").val();
197 var line = $("#line").val(); 207 var line = $("#line").val();
198 var date = $("#date").val(); 208 var date = $("#date").val();
199 var company = $("#company").val(); 209 var company = $("#company").val();
@@ -205,6 +215,7 @@ @@ -205,6 +215,7 @@
205 return; 215 return;
206 } 216 }
207 var params = {}; 217 var params = {};
  218 + sfyy = $("#sfyy").val();
208 line = $("#line").val(); 219 line = $("#line").val();
209 date = $("#date").val(); 220 date = $("#date").val();
210 company = $("#company").val(); 221 company = $("#company").val();
@@ -214,6 +225,7 @@ @@ -214,6 +225,7 @@
214 lineName = $('#subCompany option:selected').text(); 225 lineName = $('#subCompany option:selected').text();
215 if(line == " ") 226 if(line == " ")
216 line = ""; 227 line = "";
  228 + params['sfyy'] = sfyy;
217 params['line'] = line; 229 params['line'] = line;
218 params['date'] = date; 230 params['date'] = date;
219 params['type'] = "query"; 231 params['type'] = "query";
@@ -237,6 +249,7 @@ @@ -237,6 +249,7 @@
237 249
238 $("#export").on("click",function(){ 250 $("#export").on("click",function(){
239 var params = {}; 251 var params = {};
  252 + params['sfyy'] = sfyy;
240 params['line'] = line; 253 params['line'] = line;
241 params['date'] = date; 254 params['date'] = date;
242 params['type'] = "export"; 255 params['type'] = "export";