Commit fe5a4f473e1f69d6376ebcd347f393ed31c1a179

Authored by ljq
1 parent 84308faa

路单调整、禁发出场班次、指令重发功能

src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -154,7 +154,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
154 154 /**
155 155 *
156 156 * @Title: realOutAdjust
157   - * @Description: TODO(实发调整)智能调度
  157 + * @Description: TODO(实发未发)智能调度
158 158 * @param @param id 班次ID
159 159 * @param @param fcsjActual 实际发车时间 HH:mm
160 160 * @param @param remarks 备注
... ...
src/main/java/com/bsth/data/pilot80/PilotReport.java
... ... @@ -93,7 +93,7 @@ public class PilotReport {
93 93 if (outSch.getJhlc() == null)
94 94 outSch = dayOfSchedule.next(outSch);
95 95 //下发调度指令
96   - DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统", "同意出场;");
  96 + //DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统", "同意出场;");
97 97 }
98 98 break;
99 99 }
... ...
src/main/java/com/bsth/data/zndd/AutomaticSch.java
... ... @@ -15,7 +15,9 @@ import com.bsth.entity.StationRoute;
15 15 import com.bsth.entity.directive.D60;
16 16 import com.bsth.entity.realcontrol.LineConfig;
17 17 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  18 +import com.bsth.entity.sys.SysUser;
18 19 import com.bsth.repository.StationRouteRepository;
  20 +import com.bsth.security.util.SecurityUtils;
19 21 import com.bsth.service.directive.DirectiveService;
20 22 import com.bsth.service.realcontrol.ScheduleRealInfoService;
21 23 import com.bsth.util.HttpClientUtils;
... ... @@ -62,7 +64,7 @@ public class AutomaticSch {
62 64 private static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
63 65 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
64 66  
65   - private Map<String,String> drivreMap =new HashMap<>(); //自动重发map
  67 + private Map<String,Long> drivreMap =new HashMap<>(); //自动重发map
66 68 // 当日60指令缓存
67 69 private ConcurrentMap<Integer, D60> d60Map = new ConcurrentHashMap<>();//d60map
68 70  
... ... @@ -118,14 +120,14 @@ public class AutomaticSch {
118 120  
119 121 }
120 122  
121   - //实发调整检测 -- 车辆GPS掉线的情况下,车辆该出站了
  123 + //实发未发检测 -- 车辆GPS掉线的情况下,车辆该出站了
122 124 /**
123 125 * 1。已过待发时间还没发车的
124 126 * 2.设备离线
125 127 * --上一班次还没有抵达终点不做操作
126 128 */
127 129 public void sftz(){
128   - logger.warn("实发调整扫描开始");
  130 + logger.warn("实发未发扫描开始");
129 131 try {
130 132 //获取所有线路
131 133 Map<String, String> lineMap = BasicData.lineCode2NameMap;
... ... @@ -136,7 +138,7 @@ public class AutomaticSch {
136 138 //1.离线 2.实发时间为空 3.已过待发时间还没发车的
137 139 long time = System.currentTimeMillis();//实际时间+2分钟
138 140 //超过待发时间 实发时间还是null的
139   - if (sr.getFcsjT() + (1000*2) < time) {
  141 + if (sr.getFcsjT() + (1000*3) < time) {
140 142  
141 143 //起点站实际到达时间为null的情况下
142 144 if (StringUtils.isEmpty(sr.getQdzArrDatesj())) {
... ... @@ -167,9 +169,9 @@ public class AutomaticSch {
167 169  
168 170 }
169 171 }catch (Exception e){
170   - logger.error("自动调度,实发调整推送失败---",e);
  172 + logger.error("自动调度,实发未发推送失败---",e);
171 173 }
172   - logger.warn("实发调整扫描结束");
  174 + logger.warn("实发未发扫描结束");
173 175 }
174 176  
175 177 //实发撤销检测 -- 出现快一慢三的情况 && 指令重发
... ... @@ -239,7 +241,7 @@ public class AutomaticSch {
239 241 }
240 242  
241 243 /**
242   - * 指令重发
  244 + * 指令重发 -- 芦潮港1路
243 245 * 指令下发后设备未响应后 5分钟后重新发送一次 还未响应的话 未来一小时不自动发送该设备
244 246 */
245 247 public void drivresponse(){
... ... @@ -254,18 +256,38 @@ public class AutomaticSch {
254 256 String lineCode;
255 257 for (Map.Entry<String, String> ts : lineMap.entrySet()) {
256 258 lineCode = ts.getKey();
  259 + if (!lineCode.equals("12101"))
  260 + return;
  261 +
257 262 oldSchDateList = dayOfSchedule.findByLineCode(lineCode);
258 263 for (ScheduleRealInfo t : oldSchDateList){
259 264 //指令重发
260   - //1.待发时间是要超过当前时间的,2.当实际发车时间不为空的
261   - //3.状态 驾驶员未响应的
262   - if(t.getFcsjT() < new Date().getTime() && t.getFcsjActual() != null){
263   -
  265 + //1.班次已经执行过的
  266 + //2.驾驶员未确认的
  267 + //3.
  268 + Long t1 = 1000L * 60 * 5;
  269 + Long sj = new Date().getTime();
  270 + if(t.getStatus() == 2 && t.getDirectiveState() != 200 && t.getBcType().equals("normal")){
  271 + //还未下发的
  272 + if (drivreMap.get(t.getClZbh()) == null){
  273 + //下发或者处置
  274 + drivreMap.put(t.getClZbh(),new Date().getTime());
  275 + directiveService.send60DispatchZndd(t.getId(), "智能调度");
  276 +
  277 + //下发实际超过5分钟的
  278 + } else if (drivreMap.get(t.getClZbh()) + t1 <= sj){
  279 + directiveService.send60DispatchZndd(t.getId(), "智能调度");
  280 + //更新下发时间
  281 + drivreMap.put(t.getClZbh(),new Date().getTime());
  282 + //下发时间未超过5分钟返回
  283 + }
264 284 }
265   -
266   -
267 285 }
268 286 }
  287 +
  288 +
  289 +
  290 +
269 291 }catch (Exception e){
270 292 logger.error("自动调度,指令重发---",e);
271 293 }
... ...
src/main/java/com/bsth/data/zndd/ZnddThread.java
... ... @@ -65,18 +65,21 @@ public class ZnddThread extends Thread{
65 65 //DKL(); //大客流 以接口方式
66 66 //automaticSch.mz();
67 67 //automaticSch.dfTz();//大间隔
68   - //automaticSch.drivresponse(); //设备重发
69 68 for (znddStatus zs : znddStatusList) {
70 69  
71 70 if (zs.getOpenStatus().equals("0")) {
72 71 if (zs.getType().equals("sftz")) {
73   - automaticSch.sftz();//实发调整
  72 + automaticSch.sftz();//实发未发
74 73 logger.info("实发执行完毕");
75 74 }
76 75 if (zs.getType().equals("ycsf")) {
77 76 automaticSch.sfCX();// 异常实发 - 实发撤销
78 77 logger.info("异常实发执行完毕");
79 78 }
  79 + if (zs.getType().equals("zlcf")){
  80 + automaticSch.drivresponse();
  81 + logger.info("设备重发执行完毕");
  82 + }
80 83 }
81 84 }
82 85 }catch (Exception e){
... ...
src/main/java/com/bsth/service/directive/DirectiveService.java
... ... @@ -43,6 +43,7 @@ public interface DirectiveService extends BaseService&lt;D60, Integer&gt;{
43 43 */
44 44 int send60Dispatch(Long id, String sender);
45 45  
  46 + int send60DispatchZndd(Long id, String sender);
46 47 //60营运指令
47 48 int send60Operation(String nbbm, int state, int upDown, String sender);
48 49  
... ...
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
... ... @@ -179,6 +179,81 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
179 179 return code;
180 180 }
181 181  
  182 +
  183 + public int send60DispatchZndd(ScheduleRealInfo sch, int finish, String sender, String txtPrefix) {
  184 + D60 d60 = null;
  185 + try {
  186 + if (sch.isDestroy()) {
  187 + logger.warn("烂班不允许发送调度指令....");
  188 + return -1;
  189 + }
  190 +
  191 + //待发应到时间
  192 + String dfsj = fmtHHmm.print(sch.getDfsjT() + (sch.getBcsj() * 60 * 1000));
  193 + String text = "(自动补发命令)"+sch.getFcsjActual() +"发出的,由"
  194 + + sch.getQdzName() + "发往" + sch.getZdzName() + ";还未确认,请尽快确认";
  195 +
  196 + if(sch.getBcType().equals("venting")){
  197 + text += " (直放)";
  198 + }
  199 + else if(sch.getBcType().equals("major")){
  200 + text += " (放站到"+sch.getMajorStationName()+"带客)";
  201 + } else if ("ldks".equals(sch.getBcType())) {
  202 + text += " (两点空驶)";
  203 + }
  204 +
  205 + //下发0x02指令 调度指令(闹钟有效)
  206 + long t = System.currentTimeMillis() + 1000 * 30,
  207 + alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT();
  208 +
  209 + if(StringUtils.isNotEmpty(txtPrefix)){
  210 + text = txtPrefix + text;
  211 + }
  212 + text = StringEscapeUtils.unescapeHtml4(text);
  213 + int state = 0;//营运状态
  214 + if(dayOfSchedule.emptyService(sch))
  215 + state = 1;
  216 + d60 = new DirectiveCreator().createD60_02(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir())
  217 + , state, new Date(alarmTime));
  218 +
  219 + d60.setLineCode(sch.getXlBm());
  220 + } catch (Exception e) {
  221 + logger.error("生成调度指令时出现异常", e);
  222 + return -1;
  223 + }
  224 +
  225 + if (null == d60)
  226 + return -1;
  227 +
  228 + d60.setSender(sender);
  229 +
  230 + JSONObject jObj = JSON.parseObject(JSON.toJSONString(d60));
  231 +
  232 + //进场或者出场班次时,附加lock 标识
  233 + if (null != sch.getBcType()
  234 + && (sch.getBcType().equals("out") || sch.getBcType().equals("in"))) {
  235 +
  236 + jObj.put("lock", 1);
  237 + }
  238 +
  239 + // 发送指令
  240 + int code = GatewayHttpUtils.postJson(jObj.toJSONString());
  241 +
  242 + d60.setDispatch(true);
  243 + d60.setSch(sch);
  244 + d60.setHttpCode(code);
  245 +
  246 + if (code == 0) {
  247 + sch.setDirectiveState(60);
  248 + // 通知页面
  249 + sendD60ToPage(sch);
  250 + } else {
  251 + d60.setErrorText("网关通讯失败, code: " + code);
  252 + }
  253 + dayOfDirectives.put60(d60);
  254 + return code;
  255 + }
  256 +
182 257 /**
183 258 * @Title: sendDirectiveState @Description: TODO(向页面推送班次指令状态) @throws
184 259 */
... ... @@ -204,7 +279,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
204 279 int finish = dayOfSchedule.doneSum(sch.getClZbh());
205 280 return send60Dispatch(sch, finish, sender, "");
206 281 }
207   -
  282 +
  283 + @Override
  284 + public int send60DispatchZndd(Long id, String sender) {
  285 + ScheduleRealInfo sch = dayOfSchedule.get(id);
  286 + // 车辆已完成班次
  287 + int finish = dayOfSchedule.doneSum(sch.getClZbh());
  288 + return send60DispatchZndd(sch, finish, sender, "");
  289 + }
  290 +
208 291 @Override
209 292 public int send60Operation(String nbbm, int state, int upDown, String sender) {
210 293 logger.info("切换运营状态, nbbm: " + nbbm + " ,state: " + state + " ,upDown:" + upDown);
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -2864,14 +2864,20 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2864 2864 Map.put("jhlc",Arith.add(culateService.culateJhgl(scheduleRealInfos),culateService.culateJhJccgl(scheduleRealInfos)));
2865 2865 Map.put("remMileage",culateService.culateLbgl(scheduleRealInfos));
2866 2866 Map.put("addMileage", culateService.culateLjgl(lists));
  2867 + Map<String,Double> remmap = culateService.culateLbgl_yy_ks(lists);
  2868 + map.put("remMileage_yy", remmap.get("remMileage_yy")); //营运烂班公里
  2869 + map.put("remMileage_ks", remmap.get("remMileage_ks")); //空驶烂班公里
  2870 + Map<String,Double> ljmap = culateService.culateLjgl_yy_ks(lists);
  2871 + map.put("addMileage_yy", ljmap.get("addMileage_yy")); //临加烂班公里
  2872 + map.put("addMileage_ks", ljmap.get("addMileage_ks")); //临加烂班公里
2867 2873 double yygl=Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists));
2868 2874 Map.put("yygl", yygl);
2869 2875 double ksgl=Arith.add(culateService.culateKsgl(scheduleRealInfos),culateService.culateJccgl(lists));
2870 2876 Map.put("ksgl",ksgl);
2871 2877 Map.put("realMileage", Arith.add(yygl ,ksgl));
2872 2878 Map.put("jhbc", culateService.culateJhbc(scheduleRealInfos,""));
2873   - Map.put("cjbc", culateService.culateLbbc(scheduleRealInfos));
2874   - Map.put("ljbc", culateService.culateLjbc(lists, ""));
  2879 + Map.put("cjbc", culateService.culateLbbc_yy_ks(scheduleRealInfos));
  2880 + Map.put("ljbc", culateService.culateLjbc_yy_ks(lists, ""));
2875 2881 int sjbc =culateService.culateLjbc(lists, "")+culateService.culateSjbc(lists, "");
2876 2882 Map.put("sjbc", sjbc);
2877 2883  
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1129,14 +1129,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1129 1129 map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos), culateMieageService.culateJhJccgl(scheduleRealInfos)));
1130 1130 map.put("remMileage", culateMieageService.culateLbgl(scheduleRealInfos));
1131 1131 map.put("addMileage", culateMieageService.culateLjgl(lists));
  1132 + Map<String,Double> remmap = culateService.culateLbgl_yy_ks(lists);
  1133 + map.put("remMileage_yy", remmap.get("remMileage_yy")); //营运烂班公里
  1134 + map.put("remMileage_ks", remmap.get("remMileage_ks")); //空驶烂班公里
  1135 + Map<String,Double> ljmap = culateService.culateLjgl_yy_ks(lists);
  1136 + map.put("addMileage_yy", ljmap.get("addMileage_yy")); //临加烂班公里
  1137 + map.put("addMileage_ks", ljmap.get("addMileage_ks")); //临加烂班公里
  1138 +
1132 1139 double yygl = Arith.add(culateMieageService.culateSjgl(lists), culateMieageService.culateLjgl(lists));
1133 1140 map.put("yygl", yygl);
1134 1141 double ksgl = Arith.add(culateMieageService.culateKsgl(scheduleRealInfos), culateMieageService.culateJccgl(lists));
1135 1142 map.put("ksgl", ksgl);
1136 1143 map.put("realMileage", Arith.add(yygl, ksgl));
1137 1144 map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos, ""));
1138   - map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
1139   - map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
  1145 + map.put("cjbc", culateMieageService.culateLbbc_yy_ks(scheduleRealInfos));
  1146 + map.put("ljbc", culateMieageService.culateLjbc_yy_ks(lists, ""));
1140 1147 int sjbc = culateMieageService.culateLjbc(lists, "") + culateMieageService.culateSjbc(lists, "");
1141 1148 map.put("sjbc", sjbc);
1142 1149 // map=new HashMap<String,Object>();
... ... @@ -2226,11 +2233,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2226 2233 map.put("jhbc", culateService.culateJhbc(list, ""));//计划班次
2227 2234 map.put("jhlc", Arith.add(culateService.culateJhgl(list),
2228 2235 culateService.culateJhJccgl(list))); //计划总里程
2229   - map.put("cjbc", culateService.culateLbbc(list));//烂班班次
  2236 + map.put("cjbc", culateService.culateLbbc_yy_ks(list));//烂班班次
2230 2237 map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
2231   - map.put("ljbc", culateService.culateLjbc(lists, ""));//临加班次
  2238 + Map<String,Double> remmap = culateService.culateLbgl_yy_ks(list);
  2239 + map.put("remMileage_yy", remmap.get("remMileage_yy")); //营运烂班公里
  2240 + map.put("remMileage_ks", remmap.get("remMileage_ks")); //空驶烂班公里
  2241 +
  2242 +
  2243 + map.put("ljbc", culateService.culateLjbc_yy_ks(lists, ""));//临加班次
2232 2244 double ljgl = culateService.culateLjgl(lists);
2233 2245 map.put("addMileage", ljgl); //临加公里
  2246 + Map<String,Double> ljmap = culateService.culateLjgl_yy_ks(list);
  2247 + map.put("addMileage_yy", ljmap.get("addMileage_yy")); //临加烂班公里
  2248 + map.put("addMileage_ks", ljmap.get("addMileage_ks")); //临加烂班公里
  2249 +
2234 2250 map.put("sjbc", culateService.culateSjbc(lists, "") + culateService.culateLjbc(lists, ""));
2235 2251 double ksgl = culateService.culateKsgl(list);//子任务空驶公里
2236 2252 double jccgl = culateService.culateJccgl(lists);//空驶班次公里
... ...
src/main/java/com/bsth/service/report/CulateMileageService.java
... ... @@ -10,15 +10,18 @@ public interface CulateMileageService {
10 10  
11 11 List<Map<String,Object>> jobFwqk(List<ScheduleRealInfo> lists);
12 12 double culateLbgl(List<ScheduleRealInfo> lists);
  13 +
  14 + Map<String,Double> culateLbgl_yy_ks(List<ScheduleRealInfo> lists);
13 15 int culateLbbc(List<ScheduleRealInfo> lists);
14   -
  16 + int culateLbbc_yy_ks(List<ScheduleRealInfo> lists);
15 17 List<Map<String,Object>> jobLjqk(List<ScheduleRealInfo> lists);
16 18 double culateLjksgl(List<ScheduleRealInfo> lists);
17 19 double culateLjgl(List<ScheduleRealInfo> lists);
  20 + Map<String,Double> culateLjgl_yy_ks(List<ScheduleRealInfo> lists);
18 21 double culateLjgl_(List<ScheduleRealInfo> lists,String item);
19 22 double culateLjgl_spy(List<ScheduleRealInfo> lists);
20 23 int culateLjbc(List<ScheduleRealInfo> lists,String item);
21   -
  24 + int culateLjbc_yy_ks(List<ScheduleRealInfo> lists,String item);
22 25 double culateJhgl(List<ScheduleRealInfo> lists);
23 26 double culateJhgl_(List<ScheduleRealInfo> lists,String item);
24 27  
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -211,6 +211,64 @@ public class CulateMileageServiceImpl implements CulateMileageService{
211 211 return zlblc;
212 212 }
213 213  
  214 +
  215 + @Override
  216 + public Map<String,Double> culateLbgl_yy_ks(List<ScheduleRealInfo> lists) {
  217 + Map<String,Double> remMileageMap = new HashMap<>();
  218 + Double remMileage_yy = 0.0,remMileage_ks = 0.0;
  219 + // TODO Auto-generated method stub
  220 + for (int i = 0; i < lists.size(); i++) {
  221 + ScheduleRealInfo scheduleRealInfo=lists.get(i);
  222 + /*if (!isInOut(scheduleRealInfo)) {*/
  223 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  224 + if(childTaskPlans.isEmpty()){
  225 + if(scheduleRealInfo.isDestroy()){
  226 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  227 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  228 + remMileage_ks = Arith.add(remMileage_ks,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
  229 + }else {
  230 + remMileage_yy = Arith.add(remMileage_yy,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
  231 + }
  232 + }else{
  233 + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  234 + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
  235 + double cjlc=Arith.sub(jhlcOrig,jhlc);
  236 + if(cjlc>0){
  237 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  238 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  239 + remMileage_ks =Arith.add(remMileage_ks, cjlc);
  240 + }else {
  241 + remMileage_yy=Arith.add(remMileage_yy, cjlc);
  242 + }
  243 + }
  244 + }
  245 + }else{
  246 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  247 + while (it.hasNext()) {
  248 + ChildTaskPlan childTaskPlan = it.next();
  249 + if(childTaskPlan.getCcId()==null){
  250 + if(childTaskPlan.getMileageType().equals("service")){
  251 + if (childTaskPlan.isDestroy()) {
  252 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  253 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  254 + remMileage_ks = Arith.add(remMileage_ks,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
  255 + }else {
  256 + remMileage_yy = Arith.add(remMileage_yy,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
  257 + }
  258 + }
  259 + }
  260 + }
  261 + }
  262 + }
  263 +
  264 + }
  265 +
  266 + remMileageMap.put("remMileage_yy",remMileage_yy);
  267 + remMileageMap.put("remMileage_ks",remMileage_ks);
  268 + return remMileageMap;
  269 + }
  270 +
  271 +
214 272 @Override
215 273 public int culateLbbc(List<ScheduleRealInfo> lists) {
216 274 // TODO Auto-generated method stub
... ... @@ -248,6 +306,43 @@ public class CulateMileageServiceImpl implements CulateMileageService{
248 306 }
249 307  
250 308 @Override
  309 + public int culateLbbc_yy_ks(List<ScheduleRealInfo> lists) {
  310 + // TODO Auto-generated method stub
  311 + int lbbc=0;
  312 + for (int i = 0; i < lists.size(); i++) {
  313 + ScheduleRealInfo scheduleRealInfo=lists.get(i);
  314 + /*if (!isInOut(scheduleRealInfo)) {*/
  315 + if(!scheduleRealInfo.isCcService()){
  316 + if(scheduleRealInfo.getStatus() == -1){
  317 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  318 + boolean b = false;
  319 + if(!childTaskPlans.isEmpty()){ //(20231031)烂班班次,子任务如果有营运里程,视为实际班次。
  320 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  321 + while (it.hasNext()) {
  322 + ChildTaskPlan c = it.next();
  323 + if("service".equals(c.getMileageType()) && !c.isDestroy()){
  324 + BigDecimal mileage = new BigDecimal(c.getMileage());
  325 + if(mileage.compareTo(BigDecimal.ZERO) == 1){ //大于0
  326 + b = true;
  327 + }
  328 + }
  329 + if(b){
  330 + break;
  331 + }
  332 + }
  333 + }
  334 + if(!b){
  335 + lbbc++;
  336 + }
  337 + }
  338 + }
  339 +
  340 + }
  341 + return lbbc;
  342 + }
  343 +
  344 +
  345 + @Override
251 346 public List<Map<String, Object>> jobLjqk(List<ScheduleRealInfo> lists) {
252 347 // TODO Auto-generated method stub
253 348 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
... ... @@ -437,6 +532,87 @@ public class CulateMileageServiceImpl implements CulateMileageService{
437 532 return ljgl;
438 533 }
439 534  
  535 +
  536 +
  537 + @Override
  538 + public Map<String,Double> culateLjgl_yy_ks(List<ScheduleRealInfo> lists){
  539 + Map<String,Double> raddMileageMap = new HashMap<>();
  540 + Double addMileage_yy = 0.0,addMileage_ks = 0.0;
  541 + // TODO Auto-generated method stub
  542 + double ljgl=0;
  543 + for (int i = 0; i < lists.size(); i++) {
  544 + ScheduleRealInfo scheduleRealInfo=lists.get(i);
  545 + /*if (!isInOut(scheduleRealInfo)) {*/
  546 + if(!scheduleRealInfo.isDestroy()){
  547 + if(scheduleRealInfo.isSflj()){
  548 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  549 + if(childTaskPlans.isEmpty()){
  550 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  551 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  552 + addMileage_ks=Arith.add(addMileage_ks,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
  553 + }else {
  554 + addMileage_yy=Arith.add(addMileage_yy,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
  555 + }
  556 + }else{
  557 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  558 + while (it.hasNext()) {
  559 + ChildTaskPlan childTaskPlan = it.next();
  560 + if(childTaskPlan.getMileageType().equals("service") && childTaskPlan.getCcId()==null){
  561 + if (!childTaskPlan.isDestroy()) {
  562 + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  563 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  564 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  565 + addMileage_ks=Arith.add(addMileage_ks,jhgl);
  566 + }else {
  567 + addMileage_yy=Arith.add(addMileage_yy,jhgl);
  568 + }
  569 + }
  570 + }
  571 + }
  572 + }
  573 + }else{
  574 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  575 + if(childTaskPlans.isEmpty()){
  576 + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  577 + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
  578 + double zjlc=Arith.sub(jhlc, jhlcOrig);
  579 + if(zjlc>0){
  580 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  581 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  582 + addMileage_ks=Arith.add(addMileage_ks,ljgl);
  583 + }else {
  584 + addMileage_yy=Arith.add(addMileage_yy,ljgl);
  585 + }
  586 + }
  587 + }else{
  588 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  589 + while (it.hasNext()) {
  590 + ChildTaskPlan childTaskPlan = it.next();
  591 + if(childTaskPlan.getCcId()==null){
  592 + if("service".equals(childTaskPlan.getMileageType())&&"临加".equals(childTaskPlan.getType1())){
  593 + if (!childTaskPlan.isDestroy()) {
  594 + Float jhgl=childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  595 + if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  596 + || scheduleRealInfo.getBcType().equals("venting") || scheduleRealInfo.getBcType().equals("ldks")){
  597 + addMileage_ks=Arith.add(addMileage_ks,jhgl);
  598 + }else {
  599 + addMileage_yy=Arith.add(addMileage_yy,jhgl);
  600 + }
  601 + }
  602 + }
  603 + }
  604 + }
  605 + }
  606 + }
  607 + }
  608 +
  609 + }
  610 +
  611 + raddMileageMap.put("addMileage_yy",addMileage_yy);
  612 + raddMileageMap.put("addMileage_ks",addMileage_ks);
  613 + return raddMileageMap;
  614 +
  615 + }
440 616 @Override
441 617 public int culateLjbc(List<ScheduleRealInfo> lists,String item) {
442 618 // TODO Auto-generated method stub
... ... @@ -479,6 +655,48 @@ public class CulateMileageServiceImpl implements CulateMileageService{
479 655 }
480 656  
481 657 @Override
  658 + public int culateLjbc_yy_ks(List<ScheduleRealInfo> lists,String item) {
  659 + // TODO Auto-generated method stub
  660 + int ljbc=0;
  661 + for (int i = 0; i < lists.size(); i++) {
  662 + ScheduleRealInfo scheduleRealInfo=lists.get(i);
  663 + /*if (!isInOut(scheduleRealInfo)) {*/
  664 + if(scheduleRealInfo.isSflj()){
  665 + if(item.equals("zgf") || item.equals("wgf")){
  666 + String time="";
  667 + if(scheduleRealInfo.getFcsjActual()!=null){
  668 + time=scheduleRealInfo.getFcsjActual();
  669 + }
  670 + if(time.equals("")){
  671 + if(scheduleRealInfo.getDfsj()!=null){
  672 + time=scheduleRealInfo.getDfsj();
  673 + }
  674 + }
  675 + if(!time.equals("")){
  676 + String[] fcsjStr = time.split(":");
  677 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  678 +
  679 + if(item.equals("zgf")){
  680 + if(fcsj>=zgf1 && fcsj<=zgf2){
  681 + ljbc++;
  682 + }
  683 + }else if(item.equals("wgf")){
  684 + if(fcsj>=wgf1 && fcsj<=wgf2){
  685 + ljbc++;
  686 + }
  687 + }
  688 + }
  689 + }else{
  690 + ljbc++;
  691 + }
  692 + }
  693 +
  694 + }
  695 + return ljbc;
  696 + }
  697 +
  698 +
  699 + @Override
482 700 public double culateJhgl(List<ScheduleRealInfo> lists) {
483 701 // TODO Auto-generated method stub
484 702 double jhgl=0;
... ...
src/main/resources/static/pages/forms/mould/waybill_minhang_dl.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -580,27 +580,32 @@
580 580 <td>{{jhlc}}</td>
581 581 <td colspan="3">烂班班次</td>
582 582 <td colspan="2">{{cjbc}}</td>
583   - <td colspan="3"> 烂班公里</td>
584   - <td colspan="2">{{remMileage}}</td>
  583 + <td colspan="3"> 烂班营运公里</td>
  584 + <td colspan="2">{{remMileage_yy}}</td>
  585 +
  586 +
585 587 </tr>
586 588 <tr>
587   - <td colspan="2">临加班次</td>
  589 + <td colspan="2">烂班空驶公里</td>
  590 + <td>{{remMileage_ks}}</td>
  591 + <td colspan="1">临加班次</td>
588 592 <td>{{ljbc}}</td>
589   - <td colspan="1">临加公里</td>
590   - <td>{{addMileage}}</td>
591   - <td colspan="3">实际班次</td>
592   - <td colspan="2">{{sjbc}}</td>
593   - <td colspan="3">营运公里</td>
594   - <td colspan="2">{{yygl}}</td>
  593 + <td colspan="3">临加营运公里</td>
  594 + <td colspan="2">{{addMileage_yy}}</td>
  595 + <td colspan="3">临加空驶公里</td>
  596 + <td colspan="2">{{addMileage_ks}}</td>
  597 +
  598 +
  599 +
595 600 </tr>
596 601 <tr>
597   - <td colspan="2">空驶公里</td>
598   - <td>{{zkslc}}</td>
599   - <td colspan="1">总公里</td>
600   - <td>{{realMileage}}</td>
601   - <td colspan="3"></td>
602   - <td colspan="2"></td>
603   - <td colspan="3"></td>
604   - <td colspan="2"></td>
  602 + <td colspan="2">实际班次</td>
  603 + <td >{{sjbc}}</td>
  604 + <td colspan="1">营运公里</td>
  605 + <td >{{yygl}}</td>
  606 + <td colspan="3">空驶公里</td>
  607 + <td colspan="2">{{zkslc}}</td>
  608 + <td colspan="3">总公里</td>
  609 + <td colspan="2">{{realMileage}}</td>
605 610 </tr>
606 611 </script>
... ...
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js
... ... @@ -113,12 +113,12 @@ var gb_dataZndd = (function (){
113 113 alt_confirm(content, function () {
114 114 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
115 115 id: that.data('id'),
116   - remarks:'自动调度实发调整-车辆掉线',
  116 + remarks:'自动调度实发未发-车辆掉线',
117 117 fcsjActual:that.data('fcsj')
118 118  
119 119 }, function (rs) {
120 120 gb_schedule_table.updateSchedule(rs.ts);
121   - notify_succ('实发调整操作成功!');
  121 + notify_succ('实发未发操作成功!');
122 122 //calc 应发未发
123 123 that.parent().parent().remove();
124 124 });
... ... @@ -284,11 +284,11 @@ var gb_dataZndd = (function (){
284 284 debugger
285 285 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
286 286 id: sch.sch.id,
287   - remarks:'自动调度实发调整-车辆掉线',
  287 + remarks:'自动调度实发未发-车辆掉线',
288 288 fcsjActual: sch.sch.dfsj,
289 289 }, function (rs) {
290 290 gb_schedule_table.updateSchedule(rs.ts);
291   - notify_succ('实发调整操作成功!');
  291 + notify_succ('实发未发操作成功!');
292 292 });
293 293  
294 294  
... ...
src/main/resources/static/real_control_v2/zndd/type/sftz_1.html
... ... @@ -2,7 +2,7 @@
2 2 <div class="uk-modal-dialog" style="width: 850px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5   - <h2>实发调整<i class="uk-icon-question-circle uk-icon-hover"></i></h2></div>
  5 + <h2>实发未发<i class="uk-icon-question-circle uk-icon-hover"></i></h2></div>
6 6 <form class="uk-form uk-form-horizontal"> </form>
7 7 </div>
8 8  
... ... @@ -40,11 +40,11 @@
40 40  
41 41 gb_common.$post('/realSchedule/realOutAdjust_zndd', {
42 42 id: sch.sch.id,
43   - remarks:"_自动调度实发调整-车辆掉线",
  43 + remarks:"_自动调度实发未发-车辆掉线",
44 44 fcsjActual:data.fcsjActual,
45 45 }, function (rs) {
46 46 gb_schedule_table.updateSchedule(rs.ts);
47   - notify_succ('实发调整操作成功!');
  47 + notify_succ('实发未发操作成功!');
48 48 //calc 应发未发
49 49 gb_schedule_table.calc_yfwf_num(sch.xlBm);
50 50  
... ... @@ -150,7 +150,7 @@
150 150 <div class="uk-grid">
151 151 <div class="uk-width-4-2">
152 152 <div class="uk-form-row">
153   - <h3>实发调整信息</h3>
  153 + <h3>实发未发信息</h3>
154 154 </div>
155 155 </div>
156 156 </div>
... ... @@ -209,7 +209,7 @@
209 209 <div class="uk-form-row">
210 210 <label class="uk-form-label">待发时间</label>
211 211 <div class="uk-form-controls">
212   - <input value="{{sch.fcsj}}" disabled>
  212 + <input value="{{sch.dfsj}}" disabled>
213 213 </div>
214 214 </div>
215 215 </div>
... ... @@ -217,7 +217,7 @@
217 217 <div class="uk-form-row">
218 218 <label class="uk-form-label">待发时间</label>
219 219 <div class="uk-form-controls">
220   - <input value="{{sch.fcsj}}" disabled>
  220 + <input value="{{sch.dfsj}}" disabled>
221 221 </div>
222 222 </div>
223 223 </div>
... ...
src/main/resources/static/real_control_v2/zndd/zndd.html
... ... @@ -17,7 +17,7 @@
17 17 </li>
18 18 <li>
19 19 <input id="s3" name="s1" value="SFTZ" type="checkbox" class="switch">
20   - <label for="s3">实发调整</label>
  20 + <label for="s3">实发未发</label>
21 21 </li>
22 22 <li>
23 23 <input id="s4" name="s1" value="WD" type="checkbox" class="switch">
... ...