Commit 39625aaa02b16de1707848d0c4f37afba4f30019

Authored by 廖磊
1 parent 975edcaa

计算烂班详细忽略空驶主任务下的营运子任务

调度日报对同车相同发车时间进行排序
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -3210,6 +3210,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3210,6 +3210,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3210 String zdsj1 = ""; 3210 String zdsj1 = "";
3211 String zdsjActual1 = ""; 3211 String zdsjActual1 = "";
3212 List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleDdrb(line, date); 3212 List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleDdrb(line, date);
  3213 +
  3214 + /*
  3215 + * 对计划发车时间相同的班次进行排序 out最前 in最后
  3216 + */
  3217 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  3218 + String minfcsj = "02:00";
  3219 + List<Line> lineList = lineRepository.findLineByCode(line);
  3220 + if (lineList.size() > 0) {
  3221 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  3222 + + " id = ("
  3223 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  3224 + + ")";
  3225 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  3226 + }
  3227 + String[] minSjs = minfcsj.split(":");
  3228 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  3229 + for (int i = 0; i < listInfo.size(); i++) {
  3230 + ScheduleRealInfo s = listInfo.get(i);
  3231 + if (s.getBcType().equals("out")) {
  3232 + s.setRemark("1");
  3233 + } else if (s.getBcType().equals("in")) {
  3234 + s.setRemark("3");
  3235 + } else {
  3236 + s.setRemark("2");
  3237 + }
  3238 + String[] fcsj = s.getFcsj().split(":");
  3239 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  3240 +
  3241 + Long fscjT = 0L;
  3242 + if (fcsjL < minSj) {
  3243 + Calendar calendar = new GregorianCalendar();
  3244 + calendar.setTime(s.getScheduleDate());
  3245 + calendar.add(calendar.DATE, 1);
  3246 + s.setScheduleDate(calendar.getTime());
  3247 + try {
  3248 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  3249 + } catch (ParseException e) {
  3250 + // TODO Auto-generated catch block
  3251 + e.printStackTrace();
  3252 + }
  3253 +
  3254 + } else {
  3255 + try {
  3256 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  3257 + } catch (ParseException e) {
  3258 + // TODO Auto-generated catch block
  3259 + e.printStackTrace();
  3260 + }
  3261 + ;
  3262 + }
  3263 + s.setFcsjT(fscjT);
  3264 + }
  3265 + List<ScheduleRealInfo> listInfo2=new ArrayList<ScheduleRealInfo>();
  3266 + listInfo2.addAll(listInfo);
  3267 + Collections.sort(listInfo, new compareLpFcsjType());
  3268 + Collections.sort(listInfo2,new compareDirLpFcsjType());
3213 for (int i = 0; i < listInfo.size(); i++) { 3269 for (int i = 0; i < listInfo.size(); i++) {
3214 ScheduleRealInfo t = listInfo.get(i); 3270 ScheduleRealInfo t = listInfo.get(i);
3215 if (!lpName.equals(t.getLpName())) { 3271 if (!lpName.equals(t.getLpName())) {
@@ -3228,8 +3284,44 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3228,8 +3284,44 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3228 lpName = t.getLpName(); 3284 lpName = t.getLpName();
3229 list.add(t); 3285 list.add(t);
3230 } 3286 }
3231 - 3287 +/*
3232 List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleDdrb2(line, date); 3288 List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleDdrb2(line, date);
  3289 + for (int i = 0; i < listInfo2.size(); i++) {
  3290 + ScheduleRealInfo s = listInfo2.get(i);
  3291 + if (s.getBcType().equals("out")) {
  3292 + s.setRemark("1");
  3293 + } else if (s.getBcType().equals("in")) {
  3294 + s.setRemark("3");
  3295 + } else {
  3296 + s.setRemark("2");
  3297 + }
  3298 + String[] fcsj = s.getFcsj().split(":");
  3299 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  3300 +
  3301 + Long fscjT = 0L;
  3302 + if (fcsjL < minSj) {
  3303 + Calendar calendar = new GregorianCalendar();
  3304 + calendar.setTime(s.getScheduleDate());
  3305 + calendar.add(calendar.DATE, 1);
  3306 + s.setScheduleDate(calendar.getTime());
  3307 + try {
  3308 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  3309 + } catch (ParseException e) {
  3310 + // TODO Auto-generated catch block
  3311 + e.printStackTrace();
  3312 + }
  3313 +
  3314 + } else {
  3315 + try {
  3316 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  3317 + } catch (ParseException e) {
  3318 + // TODO Auto-generated catch block
  3319 + e.printStackTrace();
  3320 + }
  3321 + ;
  3322 + }
  3323 + s.setFcsjT(fscjT);
  3324 + }*/
3233 List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>(); 3325 List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>();
3234 List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>(); 3326 List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>();
3235 List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>(); 3327 List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>();
@@ -5612,6 +5704,23 @@ class AccountXlbm implements Comparator&lt;Map&lt;String, Object&gt;&gt; { @@ -5612,6 +5704,23 @@ class AccountXlbm implements Comparator&lt;Map&lt;String, Object&gt;&gt; {
5612 } 5704 }
5613 } 5705 }
5614 5706
  5707 +class compareLpFcsjType implements Comparator<ScheduleRealInfo> {
  5708 + @Override
  5709 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  5710 + // TODO Auto-generated method stub
  5711 + return (o1.getLpName()+o1.getFcsjT() + o1.getRemark()).compareTo(o2.getLpName()+o2.getFcsjT() + o2.getRemark());
  5712 + }
  5713 +
  5714 +}
  5715 +
  5716 +class compareDirLpFcsjType implements Comparator<ScheduleRealInfo> {
  5717 + @Override
  5718 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  5719 + // TODO Auto-generated method stub
  5720 + return (o1.getXlDir()+o1.getFcsjT() + o1.getRemark()+o1.getLpName()).compareTo(o2.getXlDir()+o2.getFcsjT() + o2.getRemark()+o2.getLpName());
  5721 + }
  5722 +
  5723 +}
5615 class compareFcsjType implements Comparator<ScheduleRealInfo> { 5724 class compareFcsjType implements Comparator<ScheduleRealInfo> {
5616 @Override 5725 @Override
5617 public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) { 5726 public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
@@ -863,6 +863,8 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -863,6 +863,8 @@ public class CulateMileageServiceImpl implements CulateMileageService{
863 if (sch.isSflj()) 863 if (sch.isSflj())
864 continue; 864 continue;
865 cts = sch.getcTasks(); 865 cts = sch.getcTasks();
  866 + if(isInOut(sch))
  867 + continue;
866 //有子任务 868 //有子任务
867 if (cts != null && cts.size() > 0) { 869 if (cts != null && cts.size() > 0) {
868 for(ChildTaskPlan c : cts){ 870 for(ChildTaskPlan c : cts){
@@ -881,8 +883,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -881,8 +883,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
881 } 883 }
882 } 884 }
883 } 885 }
884 - else if(isInOut(sch))  
885 - continue; 886 +
886 //主任务烂班 887 //主任务烂班
887 else if(sch.getStatus() == -1 && !sch.isCcService()){ 888 else if(sch.getStatus() == -1 && !sch.isCcService()){
888 if(sch.getAdjustExps().equals(item) || 889 if(sch.getAdjustExps().equals(item) ||
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -159,30 +159,58 @@ @@ -159,30 +159,58 @@
159 var type = "query"; 159 var type = "query";
160 $(".hidden").removeClass("hidden"); 160 $(".hidden").removeClass("hidden");
161 var i = layer.load(2); 161 var i = layer.load(2);
162 - $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){  
163 - // 把数据填充到模版中  
164 - var tbodyHtml = template('list_history',{list:result});  
165 - // 把渲染好的模版html文本追加到表格中  
166 - $('#forms tbody').html(tbodyHtml);  
167 - layer.close(i);  
168 -  
169 - if(result.length == 0)  
170 - $("#export").attr('disabled',"true");  
171 - else  
172 - $("#export").removeAttr("disabled"); 162 + console.log("code:"+code);
  163 + if(code==""||code==null){
  164 + $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){
  165 + // 把数据填充到模版中
  166 + var tbodyHtml = template('list_history',{list:result});
  167 + // 把渲染好的模版html文本追加到表格中
  168 + $('#forms tbody').html(tbodyHtml);
  169 + layer.close(i);
  170 +
  171 + if(result.length == 0)
  172 + $("#export").attr('disabled',"true");
  173 + else
  174 + $("#export").removeAttr("disabled");
  175 +
  176 + });
  177 + }else{
  178 + $get('/report/historyMessageList',{line:line,date:date,code:code,type:type},function(result){
  179 + // 把数据填充到模版中
  180 + var tbodyHtml = template('list_history_msg',{list:result});
  181 + // 把渲染好的模版html文本追加到表格中
  182 + $('#forms tbody').html(tbodyHtml);
  183 + layer.close(i);
  184 +
  185 + if(result.length == 0)
  186 + $("#export").attr('disabled',"true");
  187 + else
  188 + $("#export").removeAttr("disabled");
  189 +
  190 + });
  191 + }
173 192
174 - });  
175 }); 193 });
176 194
177 $("#export").on("click",function(){ 195 $("#export").on("click",function(){
178 var type = "export"; 196 var type = "export";
179 var i = layer.load(2); 197 var i = layer.load(2);
180 - $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){ 198 + if(code==""||code==null){
  199 + $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){
181 window.open("/downloadFile/download?fileName=" 200 window.open("/downloadFile/download?fileName="
182 +moment(date).format("YYYYMMDD") 201 +moment(date).format("YYYYMMDD")
183 +"-"+lineName+"-调度历史消息"); 202 +"-"+lineName+"-调度历史消息");
184 layer.close(i); 203 layer.close(i);
185 }); 204 });
  205 + }else{
  206 + $get('/report/historyMessageList',{line:line,date:date,code:code,type:"export_msg"},function(result){
  207 + window.open("/downloadFile/download?fileName="
  208 + +moment(date).format("YYYYMMDD")+"-"+lineName+"-调度消息分析");
  209 + layer.close(i);
  210 +
  211 + });
  212 +
  213 + }
186 }); 214 });
187 215
188 }); 216 });
@@ -203,4 +231,24 @@ @@ -203,4 +231,24 @@
203 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 231 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
204 </tr> 232 </tr>
205 {{/if}} 233 {{/if}}
  234 +</script>
  235 +
  236 +<script type="text/html" id="list_history_msg">
  237 + {{each list as obj i}}
  238 + <tr>
  239 + <td>{{i+1}}</td>
  240 + <td>{{obj[0]}}</td>
  241 + <!--<td>{{obj[6]}}</td>-->
  242 + <td>{{obj[1]}}</td>
  243 + <td>{{obj[2]}}</td>
  244 + <td>{{obj[3]}}</td>
  245 + <td>{{obj[4]}}</td>
  246 + </tr>
  247 + {{/each}}
  248 + {{if list.length == 0}}
  249 + <tr>
  250 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  251 + </tr>
  252 + {{/if}}
  253 +</script>
206 </script> 254 </script>
207 \ No newline at end of file 255 \ No newline at end of file