Commit 81e670d2510464b646416edabfe4704b2d026870

Authored by 潘钊
2 parents 297900f3 a16a2478

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/controller/report/ReportController.java
@@ -269,9 +269,11 @@ public class ReportController { @@ -269,9 +269,11 @@ public class ReportController {
269 269
270 @RequestMapping(value="/countBusMileage") 270 @RequestMapping(value="/countBusMileage")
271 public List<Map<String,Object>> countBusMileage(@RequestParam Map<String, Object> map){ 271 public List<Map<String,Object>> countBusMileage(@RequestParam Map<String, Object> map){
272 -  
273 return service.countByBusList(map); 272 return service.countByBusList(map);
274 } 273 }
275 274
276 - 275 + @RequestMapping(value="/countDjg")
  276 + public List<Map<String, Object>> countDjg(@RequestParam Map<String, Object> map){
  277 + return service.countDjg(map);
  278 + }
277 } 279 }
src/main/java/com/bsth/entity/CarDevice.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
3 import com.bsth.entity.schedule.BEntity; 3 import com.bsth.entity.schedule.BEntity;
  4 +import org.hibernate.annotations.Formula;
4 import org.joda.time.DateTime; 5 import org.joda.time.DateTime;
5 6
6 import javax.persistence.*; 7 import javax.persistence.*;
@@ -22,6 +23,16 @@ public class CarDevice extends BEntity { @@ -22,6 +23,16 @@ public class CarDevice extends BEntity {
22 @Column 23 @Column
23 private String gsName; 24 private String gsName;
24 25
  26 + /** 所属公司 varchar length(50) */
  27 + private String company;
  28 +
  29 + /** 分公司 varchar length(50)*/
  30 + private String brancheCompany;
  31 +
  32 + /** 组合公司分公司编码 */
  33 + @Formula(" concat(company, '_', branche_company) ")
  34 + private String cgsbm;
  35 +
25 /** 车辆id,关联bsth_c_cars */ 36 /** 车辆id,关联bsth_c_cars */
26 @Column(nullable = false) 37 @Column(nullable = false)
27 private Integer cl; 38 private Integer cl;
@@ -203,4 +214,20 @@ public class CarDevice extends BEntity { @@ -203,4 +214,20 @@ public class CarDevice extends BEntity {
203 public void setIsCancel(Boolean isCancel) { 214 public void setIsCancel(Boolean isCancel) {
204 this.isCancel = isCancel; 215 this.isCancel = isCancel;
205 } 216 }
  217 +
  218 + public String getCompany() {
  219 + return company;
  220 + }
  221 +
  222 + public void setCompany(String company) {
  223 + this.company = company;
  224 + }
  225 +
  226 + public String getBrancheCompany() {
  227 + return brancheCompany;
  228 + }
  229 +
  230 + public void setBrancheCompany(String brancheCompany) {
  231 + this.brancheCompany = brancheCompany;
  232 + }
206 } 233 }
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -147,16 +147,20 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -147,16 +147,20 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
147 List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); 147 List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date);
148 148
149 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) 149 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
  150 + @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.dfsj, (s.lpName+1)")
  151 + List<ScheduleRealInfo> scheduleByDateAndLineByGs(String gsdm,String fgsdm,String date);
  152 +
  153 + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
150 @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.dfsj, (s.lpName+1)") 154 @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.xlDir,s.realExecDate,s.dfsj, (s.lpName+1)")
151 List<ScheduleRealInfo> scheduleByDateAndLineQp2(String line,String date); 155 List<ScheduleRealInfo> scheduleByDateAndLineQp2(String line,String date);
152 156
153 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) 157 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
154 - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm,s.adjustExps,s.fcsj") 158 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out','ldks') order by s.xlBm,s.adjustExps,s.fcsj")
155 List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date); 159 List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date);
156 160
157 //按月统计 161 //按月统计
158 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) 162 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
159 - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out') order by s.xlBm") 163 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out','ldks') order by s.xlBm")
160 List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date); 164 List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date);
161 165
162 //按照时间段统计 166 //按照时间段统计
src/main/java/com/bsth/service/report/ReportService.java
@@ -46,4 +46,6 @@ public interface ReportService { @@ -46,4 +46,6 @@ public interface ReportService {
46 List<Map<String, Object>> countByList(Map<String, Object> map); 46 List<Map<String, Object>> countByList(Map<String, Object> map);
47 47
48 List<Map<String, Object>> countByBusList(Map<String, Object> map); 48 List<Map<String, Object>> countByBusList(Map<String, Object> map);
  49 +
  50 + List<Map<String, Object>> countDjg(Map<String, Object> map);
49 } 51 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -8,15 +8,19 @@ import com.bsth.entity.oil.Dlb; @@ -8,15 +8,19 @@ import com.bsth.entity.oil.Dlb;
8 import com.bsth.entity.oil.Ylb; 8 import com.bsth.entity.oil.Ylb;
9 import com.bsth.entity.realcontrol.ChildTaskPlan; 9 import com.bsth.entity.realcontrol.ChildTaskPlan;
10 import com.bsth.entity.realcontrol.ScheduleRealInfo; 10 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  11 +import com.bsth.entity.sys.Interval;
11 import com.bsth.repository.LineRepository; 12 import com.bsth.repository.LineRepository;
12 import com.bsth.repository.StationRouteRepository; 13 import com.bsth.repository.StationRouteRepository;
13 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 14 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
14 import com.bsth.service.report.CulateMileageService; 15 import com.bsth.service.report.CulateMileageService;
15 import com.bsth.service.report.ReportService; 16 import com.bsth.service.report.ReportService;
16 import com.bsth.util.Arith; 17 import com.bsth.util.Arith;
  18 +import com.bsth.util.ComparableChild;
17 import com.bsth.util.ComparableJob; 19 import com.bsth.util.ComparableJob;
18 import com.bsth.util.ReportUtils; 20 import com.bsth.util.ReportUtils;
19 import com.bsth.util.db.DBUtils_MS; 21 import com.bsth.util.db.DBUtils_MS;
  22 +import com.google.protobuf.StringValue;
  23 +
20 import org.apache.commons.lang.StringUtils; 24 import org.apache.commons.lang.StringUtils;
21 import org.slf4j.Logger; 25 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
@@ -57,6 +61,7 @@ public class ReportServiceImpl implements ReportService{ @@ -57,6 +61,7 @@ public class ReportServiceImpl implements ReportService{
57 LineRepository lineRepository; 61 LineRepository lineRepository;
58 @Autowired 62 @Autowired
59 StationRouteRepository stationRouteRepository; 63 StationRouteRepository stationRouteRepository;
  64 +
60 @Override 65 @Override
61 public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) { 66 public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) {
62 // TODO Auto-generated method stub 67 // TODO Auto-generated method stub
@@ -2221,5 +2226,244 @@ public class ReportServiceImpl implements ReportService{ @@ -2221,5 +2226,244 @@ public class ReportServiceImpl implements ReportService{
2221 } 2226 }
2222 return lMap; 2227 return lMap;
2223 } 2228 }
  2229 + @Override
  2230 + public List<Map<String, Object>> countDjg(Map<String, Object> map) {
  2231 + // TODO Auto-generated method stub
  2232 + List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>();
  2233 + String line=map.get("line").toString().trim();
  2234 + String date=map.get("date").toString();
  2235 + String gsbm=map.get("gsbm").toString();
  2236 + String fgsbm=map.get("fgsbm").toString();
  2237 + List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  2238 + if(line.equals("")){
  2239 + list=scheduleRealInfoRepository.scheduleByDateAndLineByGs(gsbm, fgsbm, date);
  2240 +
  2241 + }else{
  2242 + list=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2243 + }
  2244 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2245 +// Collections.sort(listInfo,new ComparableAcuals());
  2246 + //查询所有线路
  2247 + String xlSql="select line_code,spac_grade from bsth_c_line ";
  2248 + if(line.equals("")){
  2249 + xlSql +=" where company ='"+gsbm+"'";
  2250 + }else{
  2251 + xlSql +=" where line_code ='"+line+"'";
  2252 + }
  2253 +
  2254 + List<Map<String, Object>> xlList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, Object>>() {
  2255 + @Override
  2256 + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
  2257 + Map<String, Object> map=new HashMap<String,Object>();
  2258 + map.put("line",arg0.getString("line_code"));
  2259 + map.put("grade", arg0.getString("spac_grade"));
  2260 + return map;
  2261 + }
  2262 + });
  2263 + //查询大间隔时间
  2264 + String djgSql="select * from bsth_c_interval";
  2265 + List<Interval> djgList=jdbcTemplate.query(djgSql, new RowMapper<Interval>() {
  2266 + @Override
  2267 + public Interval mapRow(ResultSet arg0, int arg1) throws SQLException {
  2268 + Interval m=new Interval();
  2269 + m.setLevel(arg0.getString("level"));
  2270 + m.setPeak(arg0.getInt("peak"));
  2271 + m.setTrough(arg0.getInt("trough"));
  2272 + return m;
  2273 + }
  2274 + });
  2275 +
  2276 +
  2277 + for (int i = 0; i < xlList.size(); i++) {
  2278 + String lineCode=xlList.get(i).get("line").toString();
  2279 + String grade =xlList.get(i).get("grade").toString();
  2280 + int peak=0;
  2281 + int trough=0;
  2282 + for (int j = 0; j < djgList.size(); j++) {
  2283 + Interval il=djgList.get(j);
  2284 + if(il.getLevel().equals(grade)){
  2285 + peak=il.getPeak();
  2286 + trough=il.getTrough();
  2287 + continue;
  2288 + }
  2289 + }
  2290 + List<ScheduleRealInfo> list_=new ArrayList<ScheduleRealInfo>();
  2291 + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>();
  2292 + for (int j = 0; j < list.size(); j++) {
  2293 + ScheduleRealInfo sinfo=list.get(j);
  2294 + try {
  2295 + if(sinfo.getXlBm().equals(lineCode)){
  2296 + list_.add(sinfo);
  2297 + ScheduleRealInfo s=checkBc(sinfo);
  2298 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  2299 + if(!fcsj.equals("")){
  2300 + Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  2301 + s.setFcsjActualTime(fcsjAcual);
  2302 + s.setFcsjActual(fcsj);
  2303 + listInfo.add(s);
  2304 + }
  2305 +
  2306 + }
  2307 + } catch (ParseException e) {
  2308 + // TODO Auto-generated catch block
  2309 + e.printStackTrace();
  2310 + }
  2311 + }
  2312 + if(listInfo.size()>0){
  2313 + int sjbcs=culateService.culateSjbc(list_, "")+culateService.culateLjbc(list_, "");
  2314 + Map<String, Object> m=listDjg(gsbm,fgsbm,lineCode,sjbcs,peak,trough,listInfo,grade);
  2315 + lMap.add(m);
  2316 + }
  2317 +
  2318 + }
  2319 + return lMap;
  2320 + }
2224 2321
  2322 + public ScheduleRealInfo checkBc(ScheduleRealInfo s){
  2323 + //如果班次有子任务 且 子任务中有属于营运的。把该子任务的发车时间设置成班次的发车时间
  2324 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  2325 + if(fcsj.equals("")){
  2326 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  2327 + if(!childTaskPlans.isEmpty()){
  2328 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  2329 + Collections.sort(listit, new ComparableChild());
  2330 + for (int i = 0; i < listit.size(); i++) {
  2331 + ChildTaskPlan c=listit.get(i);
  2332 + if(!c.isDestroy()){
  2333 + if(c.getMileageType().equals("service")){
  2334 + s.setFcsjActual(c.getStartDate());
  2335 + break;
  2336 + }
  2337 +
  2338 + }
  2339 + }
  2340 + }
  2341 + }
  2342 + return s;
  2343 + }
  2344 +
  2345 + public Map<String, Object> listDjg(String gsdm,String fgsdm,String line,int sjbcs,int peak,int trough,List<ScheduleRealInfo> listInfo,String grade){
  2346 + DecimalFormat df = new DecimalFormat("#0.00");
  2347 + Collections.sort(listInfo,new ComparableAcuals());
  2348 + List<ScheduleRealInfo> listInfo0=new ArrayList<ScheduleRealInfo>();
  2349 + List<ScheduleRealInfo> listInfo1=new ArrayList<ScheduleRealInfo>();
  2350 + for (int i = 0; i < listInfo.size(); i++) {
  2351 + ScheduleRealInfo s=listInfo.get(i);
  2352 + if(s.getXlDir().equals("0")){
  2353 + listInfo0.add(s);
  2354 + }else{
  2355 + listInfo0.add(s);
  2356 + }
  2357 +
  2358 + }
  2359 + Map<String, Object> map=new HashMap<String, Object>();
  2360 + map.put("line", line);
  2361 + map.put("xlName", BasicData.lineCode2NameMap.get(line));
  2362 + map.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  2363 + map.put("bcs", sjbcs);
  2364 + map.put("djgde", grade);
  2365 + int djgcs=0;
  2366 + List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>();
  2367 + for (int i = 0; i < listInfo0.size(); i++) {
  2368 + ScheduleRealInfo s=listInfo.get(i);
  2369 + Long fcsjTime=s.getFcsjActualTime();
  2370 + String time=s.getFcsjActual();
  2371 + String[] fcsjStr = time.split(":");
  2372 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  2373 + if(i<listInfo.size()-1){
  2374 + Long djg=0l;
  2375 + Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  2376 + if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
  2377 + djg = (long) (peak*60*1000);
  2378 + if(fscjNext-fcsjTime>djg){
  2379 + djgcs ++;
  2380 + Map<String, Object> m=new HashMap<String,Object>();
  2381 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  2382 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  2383 + m.put("djgde", grade);
  2384 + m.put("qJh", s.getFcsj());
  2385 + m.put("qSj", time);
  2386 + m.put("hJh", listInfo.get(i+1).getFcsj());
  2387 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  2388 + mapList.add(m);
  2389 + }
  2390 + }else{
  2391 + djg = (long) (trough*60*1000);
  2392 + if(fscjNext-fcsjTime>djg){
  2393 + djgcs ++;
  2394 + Map<String, Object> m=new HashMap<String,Object>();
  2395 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  2396 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  2397 + m.put("djgde", grade);
  2398 + m.put("qJh", s.getFcsj());
  2399 + m.put("qSj", time);
  2400 + m.put("hJh", listInfo.get(i+1).getFcsj());
  2401 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  2402 + mapList.add(m);
  2403 + }
  2404 + }
  2405 + }
  2406 + }
  2407 +
  2408 + for (int i = 0; i < listInfo1.size(); i++) {
  2409 + ScheduleRealInfo s=listInfo.get(i);
  2410 + Long fcsjTime=s.getFcsjActualTime();
  2411 + String time=s.getFcsjActual();
  2412 + String[] fcsjStr = time.split(":");
  2413 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  2414 + if(i<listInfo.size()-1){
  2415 + Long djg=0l;
  2416 + Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  2417 + if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
  2418 + djg = (long) (peak*60*1000);
  2419 + if(fscjNext-fcsjTime>djg){
  2420 + djgcs ++;
  2421 + Map<String, Object> m=new HashMap<String,Object>();
  2422 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  2423 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  2424 + m.put("djgde", grade);
  2425 + m.put("qJh", s.getFcsj());
  2426 + m.put("qSj", time);
  2427 + m.put("hJh", listInfo.get(i+1).getFcsj());
  2428 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  2429 + mapList.add(m);
  2430 + }
  2431 + }else{
  2432 + djg = (long) (trough*60*1000);
  2433 + if(fscjNext-fcsjTime>djg){
  2434 + djgcs ++;
  2435 + Map<String, Object> m=new HashMap<String,Object>();
  2436 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  2437 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  2438 + m.put("djgde", grade);
  2439 + m.put("qJh", s.getFcsj());
  2440 + m.put("qSj", time);
  2441 + m.put("hJh", listInfo.get(i+1).getFcsj());
  2442 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  2443 + mapList.add(m);
  2444 + }
  2445 + }
  2446 + }
  2447 + }
  2448 + double fsl=0.0;
  2449 + if(sjbcs>0){
  2450 + fsl=Arith.div(djgcs,sjbcs, 2)*100;
  2451 + }
  2452 +
  2453 + map.put("djgcs", djgcs);
  2454 + map.put("fsl", df.format(fsl)+"%");
  2455 + map.put("djgxx", mapList);
  2456 + return map;
  2457 + }
  2458 +
  2459 +}
  2460 +
  2461 +class ComparableAcuals implements Comparator<ScheduleRealInfo>{
  2462 +
  2463 + @Override
  2464 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  2465 + // TODO Auto-generated method stub
  2466 + return o1.getFcsjActualTime().compareTo(o2.getFcsjActualTime());
  2467 + }
  2468 +
2225 } 2469 }
src/main/resources/static/pages/report/countInterval/countInterval.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>大间隔数据统计表</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block;margin-left: 28px; " id="gsdmDiv">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  41 + </div>
  42 + <div style="display: inline-block;margin-left: 15px;">
  43 + <span class="item-label" style="width: 80px;">时间: </span>
  44 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  45 + </div>
  46 + <div class="form-group" style="display: inline-block;margin-left: 15px;">
  47 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  48 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
  49 + </div>
  50 + </form>
  51 + </div>
  52 + <div class="portlet-body">
  53 + <div class="row" class="col-md-12">
  54 + <div class="col-md-5">
  55 + <div id="left_table" style="margin-top: 10px;overflow:auto;height: 860px">
  56 + <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info_inter">
  57 + <thead>
  58 + <tr class="hidden">
  59 + <th>分公司</th>
  60 + <th>线路</th>
  61 + <th>等级</th>
  62 + <th>班次数</th>
  63 + <th>发生次数</th>
  64 + <th>发生率</th>
  65 + </tr>
  66 + </thead>
  67 + <tbody>
  68 +
  69 + </tbody>
  70 + </table>
  71 + </div>
  72 + </div>
  73 + <div class="col-md-7" id="printArea">
  74 + <div class="table-container" id="table" style="margin-top: 10px;overflow:auto;">
  75 + <table class="table table-bordered table-hover table-checkable" id="forms">
  76 + <thead class="hidden">
  77 + <tr >
  78 + <th rowspan="2">分公司</th>
  79 + <th rowspan="2">线路</th>
  80 + <th rowspan="2">大间隔等级</th>
  81 + <th colspan="4">发生大间隔班次</th>
  82 + </tr>
  83 + <tr>
  84 + <th>计发</th>
  85 + <th>实发</th>
  86 + <th>计发</th>
  87 + <th>实发</th>
  88 + </tr>
  89 + </thead>
  90 + <tbody>
  91 +
  92 + </tbody>
  93 + </table>
  94 + </div>
  95 + </div>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + </div>
  100 +</div>
  101 +
  102 +<script>
  103 + $(function(){
  104 + // 关闭左侧栏
  105 + if (!$('body').hasClass('page-sidebar-closed'))
  106 + $('.menu-toggler.sidebar-toggler').click();
  107 +
  108 + $("#date").datetimepicker({
  109 + format : 'YYYY-MM-DD',
  110 + locale : 'zh-cn'
  111 + });
  112 +
  113 +
  114 + var d = new Date();
  115 + var year = d.getFullYear();
  116 + var month = d.getMonth() + 1;
  117 + var day = d.getDate();
  118 + if(month < 9)
  119 + month = "0" + month;
  120 + if(day < 9)
  121 + day = "0" + day;
  122 + $("#date").val(year + "-" + month + "-" + day);
  123 + var fage=false;
  124 + var obj = [];
  125 + var xlList;
  126 + $.get('/report/lineList',function(result){
  127 + xlList=result;
  128 + $.get('/user/companyData', function(result){
  129 + obj = result;
  130 + var options = '';
  131 + for(var i = 0; i < obj.length; i++){
  132 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  133 + }
  134 +
  135 + if(obj.length ==0){
  136 + $("#gsdmDiv").css('display','none');
  137 + }else if(obj.length ==1){
  138 + $("#gsdmDiv").css('display','none');
  139 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  140 + $('#fgsdmDiv').css('display','none');
  141 + }
  142 + $('#gsdm').html(options);
  143 + updateCompany();
  144 + });
  145 + })
  146 + $("#gsdm").on("change",updateCompany);
  147 + function updateCompany(){
  148 + var company = $('#gsdm').val();
  149 + var options = '';
  150 + for(var i = 0; i < obj.length; i++){
  151 + if(obj[i].companyCode == company){
  152 + var children = obj[i].children;
  153 + for(var j = 0; j < children.length; j++){
  154 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  155 + }
  156 + }
  157 + }
  158 + $('#fgsdm').html(options);
  159 + }
  160 +
  161 +
  162 + var tempData = {};
  163 + $.get('/report/lineList',function(xlList){
  164 + var data = [];
  165 + data.push({id: " ", text: "全部线路"});
  166 + $.get('/user/companyData', function(result){
  167 + for(var i = 0; i < result.length; i++){
  168 + var companyCode = result[i].companyCode;
  169 + var children = result[i].children;
  170 + for(var j = 0; j < children.length; j++){
  171 + var code = children[j].code;
  172 + for(var k=0;k < xlList.length;k++ ){
  173 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  174 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  175 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  176 + }
  177 + }
  178 + }
  179 + }
  180 + initPinYinSelect2('#line',data,'');
  181 +
  182 + });
  183 + });
  184 +
  185 + $("#line").on("change", function(){
  186 + if($("#line").val() == " "){
  187 + $("#gsdm").attr("disabled", false);
  188 + $("#fgsdm").attr("disabled", false);
  189 + } else {
  190 + var temp = tempData[$("#line").val()].split(":");
  191 + $("#gsdm").val(temp[0]);
  192 + updateCompany();
  193 + $("#fgsdm").val(temp[1]);
  194 + $("#gsdm").attr("disabled", true);
  195 + $("#fgsdm").attr("disabled", true);
  196 + }
  197 + });
  198 +
  199 + var date = '';
  200 + var gsbm="";
  201 + var fgsbm="";
  202 + var listRe=null;
  203 + var line = $("#line").val();
  204 + $("#query").on("click",function(){
  205 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  206 + layer.msg("请选择时间!");
  207 + return;
  208 + }
  209 +// $("#left_table").height($(window).height()-100);
  210 + line = $("#line").val();
  211 + date = $("#date").val();
  212 + gsbm =$("#gsdm").val();
  213 + fgsbm=$("#fgsdm").val();
  214 + $(".hidden").removeClass("hidden");
  215 + $get('/report/countDjg',{line:line,date:date,gsbm:gsbm,fgsbm:fgsbm},function(result){
  216 + listRe=result;
  217 + // 把数据填充到模版中
  218 + var tbodyHtml = template('list_inter_info',{list:result});
  219 + // 把渲染好的模版html文本追加到表格中
  220 + $('#info_inter tbody').html(tbodyHtml);
  221 +
  222 + $('.btn-intervalList').on('click', showIntervalList);
  223 +
  224 +
  225 + });
  226 + });
  227 +
  228 + function showIntervalList(){
  229 +
  230 + $("#info_inter tbody tr td button").css('background-color', 'blue');
  231 + $(this).css('background-color', '#99CCFF');
  232 + var line_ = $(this).data('id');
  233 + var listXx;
  234 + $.each(listRe, function (i, obj) {
  235 + if(obj.line==line_){
  236 + listXx=obj.djgxx;
  237 + }
  238 + });
  239 +// if(listXx.length>0){
  240 + $(".hidden").removeClass("hidden");
  241 + var interList = template('list_inter_info_xx',{list:listXx});
  242 + $('#forms tbody').html(interList);
  243 + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000);
  244 +// }
  245 +
  246 + }
  247 +
  248 + /* $("#export").on("click",function(){
  249 + $get('/realSchedule/historyMessage',{line:line,date:date,code:jName,type:"export_msg"},function(result){
  250 + window.open("/downloadFile/download?fileName=调度消息分析"+moment(date).format("YYYYMMDD"));
  251 + });
  252 + }); */
  253 +
  254 +
  255 +
  256 + });
  257 +</script>
  258 +<script type="text/html" id="list_inter_info">
  259 + {{each list as obj i}}
  260 + <tr>
  261 + <td width="20%">{{obj.fgsname}}</td>
  262 + <td width="20%">{{obj.xlName}}</td>
  263 + <td width="15%">{{obj.djgde}}</td>
  264 + <td width="15%">{{obj.bcs}}</td>
  265 + <td width="15%"><button type="button" class="btn btn-sm blue btn-intervalList"
  266 + data-id="{{obj.line}}">{{obj.djgcs}}</button></td>
  267 + <td width="15%" >{{obj.fsl}}</td>
  268 + </tr>
  269 + {{/each}}
  270 + {{if list.length == 0}}
  271 + <tr>
  272 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  273 + </tr>
  274 + {{/if}}
  275 +</script>
  276 +
  277 +<script type="text/html" id="list_inter_info_xx">
  278 + {{each list as obj i}}
  279 + <tr>
  280 + <td width="20%">{{obj.fgsname}}</td>
  281 + <td width="20%">{{obj.xlName}}</td>
  282 + <td width="10%">{{obj.djgde}}</td>
  283 + <td width="10%">{{obj.qJh}}</td>
  284 + <td width="10%">{{obj.qSj}}</td>
  285 + <td width="10%">{{obj.hJh}}</td>
  286 + <td width="10%">{{obj.hSj}}</td>
  287 + </tr>
  288 + {{/each}}
  289 + {{if list.length == 0}}
  290 + <tr>
  291 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  292 + </tr>
  293 + {{/if}}
  294 +</script>
  295 +
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 <div class="col-md-3"> 39 <div class="col-md-3">
40 <sa-Select5 name="xl" 40 <sa-Select5 name="xl"
41 model="ctrl.deviceInfoForSave" 41 model="ctrl.deviceInfoForSave"
42 - cmaps="{'xl': 'id', 'xlName': 'name', 'xlBm': 'lineCode'}" 42 + cmaps="{'xl': 'id', 'xlName': 'name', 'xlBm': 'lineCode', 'company': 'company', 'brancheCompany': 'brancheCompany'}"
43 dcname="xl" 43 dcname="xl"
44 icname="id" 44 icname="id"
45 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" 45 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
@@ -61,14 +61,15 @@ @@ -61,14 +61,15 @@
61 <div class="col-md-3"> 61 <div class="col-md-3">
62 <sa-Select5 name="cl" 62 <sa-Select5 name="cl"
63 model="ctrl.deviceInfoForSave" 63 model="ctrl.deviceInfoForSave"
64 - cmaps="{'cl': 'id', 'clZbh': 'insideCode', 'oldDeviceNo': 'equipmentCode'}" 64 + cmaps="{'cl' : 'cl.id', 'clZbh': 'cl.insideCode', 'oldDeviceNo': 'cl.equipmentCode'}"
65 dcname="cl" 65 dcname="cl"
66 - icname="id"  
67 - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}" 66 + icname="cl.id"
  67 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.deviceInfoForSave.xl}, atype:'cci2' } | json }}"
  68 + dsparamsextra="{'type':'all', 'isCancel_eq': false}"
68 iterobjname="item" 69 iterobjname="item"
69 - iterobjexp="item.insideCode" 70 + iterobjexp="item.cl.insideCode + '<' + item.xl.name + '>'"
70 searchph="请输拼音..." 71 searchph="请输拼音..."
71 - searchexp="this.insideCode" 72 + searchexp="this.cl.insideCode + '<' + this.xl.name + '>'"
72 required > 73 required >
73 </sa-Select5> 74 </sa-Select5>
74 </div> 75 </div>
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 <div class="col-md-3"> 39 <div class="col-md-3">
40 <sa-Select5 name="xl" 40 <sa-Select5 name="xl"
41 model="ctrl.deviceInfoForSave" 41 model="ctrl.deviceInfoForSave"
42 - cmaps="{'xl': 'id', 'xlName': 'name', 'xlBm': 'lineCode'}" 42 + cmaps="{'xl': 'id', 'xlName': 'name', 'xlBm': 'lineCode', 'company': 'company', 'brancheCompany': 'brancheCompany'}"
43 dcname="xl" 43 dcname="xl"
44 icname="id" 44 icname="id"
45 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" 45 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
@@ -61,14 +61,15 @@ @@ -61,14 +61,15 @@
61 <div class="col-md-3"> 61 <div class="col-md-3">
62 <sa-Select5 name="cl" 62 <sa-Select5 name="cl"
63 model="ctrl.deviceInfoForSave" 63 model="ctrl.deviceInfoForSave"
64 - cmaps="{'cl': 'id', 'clZbh': 'insideCode', 'oldDeviceNo': 'equipmentCode'}" 64 + cmaps="{'cl' : 'cl.id', 'clZbh': 'cl.insideCode', 'oldDeviceNo': 'cl.equipmentCode'}"
65 dcname="cl" 65 dcname="cl"
66 - icname="id"  
67 - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'cl' } | json }}" 66 + icname="cl.id"
  67 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.deviceInfoForSave.xl}, atype:'cci2' } | json }}"
  68 + dsparamsextra="{'type':'all', 'isCancel_eq': false}"
68 iterobjname="item" 69 iterobjname="item"
69 - iterobjexp="item.insideCode" 70 + iterobjexp="item.cl.insideCode + '<' + item.xl.name + '>'"
70 searchph="请输拼音..." 71 searchph="请输拼音..."
71 - searchexp="this.insideCode" 72 + searchexp="this.cl.insideCode + '<' + this.xl.name + '>'"
72 required > 73 required >
73 </sa-Select5> 74 </sa-Select5>
74 </div> 75 </div>
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
@@ -10,9 +10,7 @@ @@ -10,9 +10,7 @@
10 <th style="width: 100px;">启用日期</th> 10 <th style="width: 100px;">启用日期</th>
11 <th>旧设备编号</th> 11 <th>旧设备编号</th>
12 <th>新设备编号</th> 12 <th>新设备编号</th>
13 - <th>旧SIM卡</th>  
14 - <th>新SIM卡</th>  
15 - <th style="width: 180px;">更新时间</th> 13 + <th style="width: 180px;">操作人/操作时间</th>
16 <th style="width: 80px;" >状态</th> 14 <th style="width: 80px;" >状态</th>
17 <th style="width: 150pt;">操作</th> 15 <th style="width: 150pt;">操作</th>
18 </tr> 16 </tr>
@@ -39,8 +37,6 @@ @@ -39,8 +37,6 @@
39 <td></td> 37 <td></td>
40 <td></td> 38 <td></td>
41 <td></td> 39 <td></td>
42 - <td></td>  
43 - <td></td>  
44 <td> 40 <td>
45 <label class="checkbox-inline input"> 41 <label class="checkbox-inline input">
46 <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />已作废 42 <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />已作废
@@ -79,13 +75,18 @@ @@ -79,13 +75,18 @@
79 <span ng-bind="info.newDeviceNo"></span> 75 <span ng-bind="info.newDeviceNo"></span>
80 </td> 76 </td>
81 <td> 77 <td>
82 - <span ng-bind="info.oldSimNo"></span>  
83 - </td>  
84 - <td>  
85 - <span ng-bind="info.newSimNo"></span>  
86 - </td>  
87 - <td>  
88 - <span ng-bind="info.updateDate | date:'yyyy-MM-dd HH:mm:ss'"></span> 78 + <div>
  79 + <a href="#">
  80 + <i class="fa fa-user"></i>
  81 + <span ng-bind="info.updateBy.userName"></span>
  82 + </a>
  83 + </div>
  84 + <div>
  85 + <a href="#">
  86 + <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  87 + </a>
  88 + </div>
  89 +
89 </td> 90 </td>
90 <td> 91 <td>
91 <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span> 92 <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span>
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html
@@ -86,6 +86,18 @@ @@ -86,6 +86,18 @@
86 </td> 86 </td>
87 <td> 87 <td>
88 <span ng-bind="info.personnelType | dict:'sexType':'未知'"></span> 88 <span ng-bind="info.personnelType | dict:'sexType':'未知'"></span>
  89 +
  90 + <!--<div ng-if="info.personnelType == '1'">-->
  91 + <!--<a href="#">-->
  92 + <!--<i class="fa fa-male"></i>-->
  93 + <!--</a>-->
  94 + <!--</div>-->
  95 + <!--<div ng-if="info.personnelType == '2'">-->
  96 + <!--<a href="#">-->
  97 + <!--<i class="fa fa-female"></i>-->
  98 + <!--</a>-->
  99 + <!--</div>-->
  100 +
89 </td> 101 </td>
90 <td> 102 <td>
91 <span ng-bind="info.company"></span> 103 <span ng-bind="info.company"></span>
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
@@ -143,7 +143,13 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -143,7 +143,13 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
143 if (mc.indexOf('_') > 0) { 143 if (mc.indexOf('_') > 0) {
144 scope[ctrlAs].model[mc] = $item[ic]; 144 scope[ctrlAs].model[mc] = $item[ic];
145 } else { 145 } else {
146 - eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";"); 146 + try {
  147 + eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";");
  148 + } catch (e) {
  149 + // TODO:
  150 + eval("scope[ctrlAs].model" + "." + mc + " = null;");
  151 + }
  152 +
147 } 153 }
148 } 154 }
149 }; 155 };
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteWarningValidation.js
1 -/**  
2 - * remoteWarn指令:远程验证警告,作为属性放在某个指令上。  
3 - * TODO:暂时没法整合到form上,类似$error这样  
4 - * 属性如下:  
5 - * remotewtype(必须):验证类型(在service中有对应映射),如rvtype="xl"  
6 - * remotewparam(必须):后端判定查询参数,如rvparam={{ {'xl.id_eq': '123'} | json }}  
7 - * remotewmsgprop(必须):警告信息属性名  
8 - */  
9 -angular.module('ScheduleApp').directive('remoteWarn', [  
10 - '$$SearchInfoService_g',  
11 - function($$SearchInfoService_g) {  
12 - return {  
13 - restrict: "A", // 属性  
14 - required: "^ngModel", // 依赖所属指令的ngModel  
15 - compile: function(tElem, tAttrs) {  
16 - // 验证属性  
17 - if (!tAttrs["remotewtype"]) { // 验证类型  
18 - throw {msg : "remotewtype属性必须填写"};  
19 - }  
20 - if (!$$SearchInfoService_g.validate[tAttrs["remotewtype"]]) {  
21 - throw {msg : tAttrs["remotevtype"] + "验证类型不存在"};  
22 - }  
23 - if (!tAttrs["remotewparam"]) { // 查询参数  
24 - throw {msg : "remotevparam属性必须填写"};  
25 - }  
26 - if (!tAttrs["remotewmsgprop"]) { // 警告信息属性名  
27 - throw {msg : "remotewmsgprop属性必须填写"}  
28 - }  
29 -  
30 - // 监听获取的数据  
31 - var $watch_rvtype = undefined;  
32 - var $watch_rvparam_obj = undefined;  
33 - var $remotewmsgprop = undefined;  
34 -  
35 - // 验证数据  
36 - var $$internal_validate = function(ngModelCtrl, scope) {  
37 - if ($watch_rvtype && $watch_rvparam_obj && $remotewmsgprop) {  
38 - // 获取查询参数模版  
39 - var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template;  
40 - if (!paramTemplate) {  
41 - throw {msg : $watch_rvtype + "查询模版不存在"};  
42 - }  
43 -  
44 - // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证  
45 - var isParamAll = true;  
46 - for (var key in paramTemplate) {  
47 - if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉  
48 - isParamAll = false;  
49 - break;  
50 - }  
51 - }  
52 -  
53 - if (!isParamAll) {  
54 - scope["ctrl"][$remotewmsgprop] = undefined;  
55 - } else { // 开始验证警告  
56 - $$SearchInfoService_g.validate[$watch_rvtype].remote.do(  
57 - $watch_rvparam_obj,  
58 - function(result) {  
59 - if (result.status == "SUCCESS") {  
60 - scope["ctrl"][$remotewmsgprop] = undefined;  
61 - } else {  
62 - scope["ctrl"][$remotewmsgprop] = result.msg;  
63 - }  
64 - },  
65 - function(result) {  
66 - scope["ctrl"][$remotewmsgprop] = undefined;  
67 - }  
68 - );  
69 - }  
70 - }  
71 -  
72 - };  
73 -  
74 - return {  
75 - pre: function(scope, element, attr) {  
76 -  
77 - },  
78 -  
79 - post: function(scope, element, attr, ngModelCtrl) {  
80 - /**  
81 - * 监控验证类型属性变化。  
82 - */  
83 - attr.$observe("remotewtype", function(value) {  
84 - if (value && value != "") {  
85 - $watch_rvtype = value;  
86 - $$internal_validate(ngModelCtrl, scope);  
87 - }  
88 - });  
89 -  
90 - /**  
91 - * 监控查询结果属性变化。  
92 - */  
93 - attr.$observe("remotewparam", function(value) {  
94 - if (value && value != "") {  
95 - $watch_rvparam_obj = JSON.parse(value);  
96 - $$internal_validate(ngModelCtrl, scope);  
97 - }  
98 - });  
99 -  
100 - /**  
101 - * 监控警告信息属性名变化。  
102 - */  
103 - attr.$observe("remotewmsgprop", function(value) {  
104 - if (value && value != "") {  
105 - $remotewmsgprop = value;  
106 - $$internal_validate(ngModelCtrl, scope);  
107 - }  
108 - });  
109 -  
110 - }  
111 - };  
112 - }  
113 - };  
114 - } 1 +/**
  2 + * remoteWarn指令:远程验证警告,作为属性放在某个指令上。
  3 + * TODO:暂时没法整合到form上,类似$error这样
  4 + * 属性如下:
  5 + * remotewtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
  6 + * remotewparam(必须):后端判定查询参数,如rvparam={{ {'xl.id_eq': '123'} | json }}
  7 + * remotewmsgprop(必须):警告信息属性名
  8 + */
  9 +angular.module('ScheduleApp').directive('remoteWarn', [
  10 + '$$SearchInfoService_g',
  11 + function($$SearchInfoService_g) {
  12 + return {
  13 + restrict: "A", // 属性
  14 + required: "^ngModel", // 依赖所属指令的ngModel
  15 + compile: function(tElem, tAttrs) {
  16 + // 验证属性
  17 + if (!tAttrs["remotewtype"]) { // 验证类型
  18 + throw {msg : "remotewtype属性必须填写"};
  19 + }
  20 + if (!$$SearchInfoService_g.validate[tAttrs["remotewtype"]]) {
  21 + throw {msg : tAttrs["remotevtype"] + "验证类型不存在"};
  22 + }
  23 + if (!tAttrs["remotewparam"]) { // 查询参数
  24 + throw {msg : "remotevparam属性必须填写"};
  25 + }
  26 + if (!tAttrs["remotewmsgprop"]) { // 警告信息属性名
  27 + throw {msg : "remotewmsgprop属性必须填写"}
  28 + }
  29 +
  30 + // 监听获取的数据
  31 + var $watch_rvtype = undefined;
  32 + var $watch_rvparam_obj = undefined;
  33 + var $remotewmsgprop = undefined;
  34 +
  35 + // 验证数据
  36 + var $$internal_validate = function(ngModelCtrl, scope) {
  37 + if ($watch_rvtype && $watch_rvparam_obj && $remotewmsgprop) {
  38 + // 获取查询参数模版
  39 + var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template;
  40 + if (!paramTemplate) {
  41 + throw {msg : $watch_rvtype + "查询模版不存在"};
  42 + }
  43 +
  44 + // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证
  45 + var isParamAll = true;
  46 + for (var key in paramTemplate) {
  47 + if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉
  48 + isParamAll = false;
  49 + break;
  50 + }
  51 + }
  52 +
  53 + if (!isParamAll) {
  54 + scope["ctrl"][$remotewmsgprop] = undefined;
  55 + } else { // 开始验证警告
  56 + $$SearchInfoService_g.validate[$watch_rvtype].remote.do(
  57 + $watch_rvparam_obj,
  58 + function(result) {
  59 + if (result.status == "SUCCESS") {
  60 + scope["ctrl"][$remotewmsgprop] = undefined;
  61 + } else {
  62 + scope["ctrl"][$remotewmsgprop] = result.msg;
  63 + }
  64 + },
  65 + function(result) {
  66 + scope["ctrl"][$remotewmsgprop] = undefined;
  67 + }
  68 + );
  69 + }
  70 + }
  71 +
  72 + };
  73 +
  74 + return {
  75 + pre: function(scope, element, attr) {
  76 +
  77 + },
  78 +
  79 + post: function(scope, element, attr, ngModelCtrl) {
  80 + /**
  81 + * 监控验证类型属性变化。
  82 + */
  83 + attr.$observe("remotewtype", function(value) {
  84 + if (value && value != "") {
  85 + $watch_rvtype = value;
  86 + $$internal_validate(ngModelCtrl, scope);
  87 + }
  88 + });
  89 +
  90 + /**
  91 + * 监控查询结果属性变化。
  92 + */
  93 + attr.$observe("remotewparam", function(value) {
  94 + if (value && value != "") {
  95 + $watch_rvparam_obj = JSON.parse(value);
  96 + $$internal_validate(ngModelCtrl, scope);
  97 + }
  98 + });
  99 +
  100 + /**
  101 + * 监控警告信息属性名变化。
  102 + */
  103 + attr.$observe("remotewmsgprop", function(value) {
  104 + if (value && value != "") {
  105 + $remotewmsgprop = value;
  106 + $$internal_validate(ngModelCtrl, scope);
  107 + }
  108 + });
  109 +
  110 + }
  111 + };
  112 + }
  113 + };
  114 + }
115 ]); 115 ]);
116 \ No newline at end of file 116 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -1563,7 +1563,13 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1563,7 +1563,13 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1563 if (mc.indexOf('_') > 0) { 1563 if (mc.indexOf('_') > 0) {
1564 scope[ctrlAs].model[mc] = $item[ic]; 1564 scope[ctrlAs].model[mc] = $item[ic];
1565 } else { 1565 } else {
1566 - eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";"); 1566 + try {
  1567 + eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";");
  1568 + } catch (e) {
  1569 + // TODO:
  1570 + eval("scope[ctrlAs].model" + "." + mc + " = null;");
  1571 + }
  1572 +
1567 } 1573 }
1568 } 1574 }
1569 }; 1575 };
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/edit.html
@@ -69,8 +69,8 @@ @@ -69,8 +69,8 @@
69 cmaps="{'rerunTtinfo.id' : 'id'}" 69 cmaps="{'rerunTtinfo.id' : 'id'}"
70 dcname="rerunTtinfo.id" 70 dcname="rerunTtinfo.id"
71 icname="id" 71 icname="id"
72 - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}, atype:'ttInfo' } | json }}"  
73 - dsparamsextra="{'type':'all'}" 72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id}, atype:'ttInfo' } | json }}"
  73 + dsparamsextra="{'type':'all', 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}"
74 iterobjname="item" 74 iterobjname="item"
75 iterobjexp="item.name + '-' + item.xl.name" 75 iterobjexp="item.name + '-' + item.xl.name"
76 searchph="请输拼音..." 76 searchph="请输拼音..."
@@ -138,7 +138,7 @@ @@ -138,7 +138,7 @@
138 cmaps="{'useXl.id' : 'id'}" 138 cmaps="{'useXl.id' : 'id'}"
139 dcname="useXl.id" 139 dcname="useXl.id"
140 icname="id" 140 icname="id"
141 - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'xl' } | json }}" 141 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
142 iterobjname="item" 142 iterobjname="item"
143 iterobjexp="item.name" 143 iterobjexp="item.name"
144 searchph="请输拼音..." 144 searchph="请输拼音..."
@@ -153,7 +153,7 @@ @@ -153,7 +153,7 @@
153 </div> 153 </div>
154 <div class="form-group has-success has-feedback" 154 <div class="form-group has-success has-feedback"
155 ng-if="ctrl.rerunManageForSave.rerunType == 'dylp'"> 155 ng-if="ctrl.rerunManageForSave.rerunType == 'dylp'">
156 - <label class="col-md-2 control-label">路牌*:</label> 156 + <label class="col-md-2 control-label">路牌2*:</label>
157 <div class="col-md-3"> 157 <div class="col-md-3">
158 <sa-Select5 name="useLp" 158 <sa-Select5 name="useLp"
159 model="ctrl.rerunManageForSave" 159 model="ctrl.rerunManageForSave"
@@ -161,7 +161,7 @@ @@ -161,7 +161,7 @@
161 dcname="useLp.id" 161 dcname="useLp.id"
162 icname="id" 162 icname="id"
163 dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.useXl.id}, atype:'lpInfo2' } | json }}" 163 dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.useXl.id}, atype:'lpInfo2' } | json }}"
164 - dsparamsextra="{'type':'all'}" 164 + dsparamsextra="{'type':'all', 'isCancel_eq': false}"
165 iterobjname="item" 165 iterobjname="item"
166 iterobjexp="'路牌' + item.lpName" 166 iterobjexp="'路牌' + item.lpName"
167 searchph="请输拼音..." 167 searchph="请输拼音..."
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/form.html
@@ -69,8 +69,8 @@ @@ -69,8 +69,8 @@
69 cmaps="{'rerunTtinfo.id' : 'id'}" 69 cmaps="{'rerunTtinfo.id' : 'id'}"
70 dcname="rerunTtinfo.id" 70 dcname="rerunTtinfo.id"
71 icname="id" 71 icname="id"
72 - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id, 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}, atype:'ttInfo' } | json }}"  
73 - dsparamsextra="{'type':'all'}" 72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.rerunXl.id}, atype:'ttInfo' } | json }}"
  73 + dsparamsextra="{'type':'all', 'isCancel_eq': false, 'isEnableDisTemplate_eq': true}"
74 iterobjname="item" 74 iterobjname="item"
75 iterobjexp="item.name + '-' + item.xl.name" 75 iterobjexp="item.name + '-' + item.xl.name"
76 searchph="请输拼音..." 76 searchph="请输拼音..."
@@ -153,15 +153,15 @@ @@ -153,15 +153,15 @@
153 </div> 153 </div>
154 <div class="form-group has-success has-feedback" 154 <div class="form-group has-success has-feedback"
155 ng-if="ctrl.rerunManageForSave.rerunType == 'dylp'"> 155 ng-if="ctrl.rerunManageForSave.rerunType == 'dylp'">
156 - <label class="col-md-2 control-label">路牌*:</label> 156 + <label class="col-md-2 control-label">路牌2*:</label>
157 <div class="col-md-3"> 157 <div class="col-md-3">
158 <sa-Select5 name="useLp" 158 <sa-Select5 name="useLp"
159 model="ctrl.rerunManageForSave" 159 model="ctrl.rerunManageForSave"
160 cmaps="{'useLp.id' : 'id'}" 160 cmaps="{'useLp.id' : 'id'}"
161 dcname="useLp.id" 161 dcname="useLp.id"
162 icname="id" 162 icname="id"
163 - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.useXl.id, 'isCancel_eq': false}, atype:'lpInfo2' } | json }}"  
164 - dsparamsextra="{'type':'all'}" 163 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.useXl.id}, atype:'lpInfo2' } | json }}"
  164 + dsparamsextra="{'type':'all', 'isCancel_eq': false}"
165 iterobjname="item" 165 iterobjname="item"
166 iterobjexp="'路牌' + item.lpName" 166 iterobjexp="'路牌' + item.lpName"
167 searchph="请输拼音..." 167 searchph="请输拼音..."
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/list.html
@@ -5,12 +5,11 @@ @@ -5,12 +5,11 @@
5 <tr role="row" class="heading"> 5 <tr role="row" class="heading">
6 <th style="width: 50px;">序号</th> 6 <th style="width: 50px;">序号</th>
7 <th style="width: 150px;">套跑线路</th> 7 <th style="width: 150px;">套跑线路</th>
8 - <th style="width: 80px">套跑路牌</th>  
9 - <th >时刻表</th> 8 + <th style="width: 180px">套跑时刻表/路牌</th>
  9 + <th style="width: 100px">套跑类型</th>
10 <th style="width: 150px;">线路</th> 10 <th style="width: 150px;">线路</th>
11 <th style="width: 50px">路牌</th> 11 <th style="width: 50px">路牌</th>
12 <th width="100px">车辆</th> 12 <th width="100px">车辆</th>
13 - <th width="100px">套跑类型</th>  
14 <th width="80px">状态</th> 13 <th width="80px">状态</th>
15 <th style="width: 21%">操作</th> 14 <th style="width: 21%">操作</th>
16 </tr> 15 </tr>
@@ -35,7 +34,6 @@ @@ -35,7 +34,6 @@
35 <td></td> 34 <td></td>
36 <td></td> 35 <td></td>
37 <td></td> 36 <td></td>
38 - <td></td>  
39 <td> 37 <td>
40 <label class="checkbox-inline"> 38 <label class="checkbox-inline">
41 <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>已作废 39 <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>已作废
@@ -62,10 +60,31 @@ @@ -62,10 +60,31 @@
62 <span ng-bind="info.rerunXl.name"></span> 60 <span ng-bind="info.rerunXl.name"></span>
63 </td> 61 </td>
64 <td> 62 <td>
65 - <span ng-bind="info.rerunLp.lpName"></span> 63 + <div>
  64 + <a href="#"
  65 + tooltip-animation="false"
  66 + tooltip-placement="top"
  67 + uib-tooltip="{{'套跑时刻表:' + info.rerunTtinfo.name}}"
  68 + tooltip-class="headClass">
  69 + <i class="fa fa-table" aria-hidden="true"></i>
  70 + <span ng-bind="info.rerunTtinfo.name"></span>
  71 + </a>
  72 + </div>
  73 + <div>
  74 + <a href="#"
  75 + tooltip-animation="false"
  76 + tooltip-placement="top"
  77 + uib-tooltip="{{'套跑路牌:' + info.rerunLp.lpName}}"
  78 + tooltip-class="headClass">
  79 + <i class="fa fa-map-signs" aria-hidden="true"></i>
  80 + <span ng-bind="info.rerunLp.lpName"></span>
  81 + </a>
  82 +
  83 + </div>
  84 +
66 </td> 85 </td>
67 <td> 86 <td>
68 - <span ng-bind="info.rerunTtinfo.name"></span> 87 + <span ng-bind="info.rerunType | dict:'rerunType':'未知' "></span>
69 </td> 88 </td>
70 <td> 89 <td>
71 <span ng-bind="info.useXl.name"></span> 90 <span ng-bind="info.useXl.name"></span>
@@ -77,9 +96,6 @@ @@ -77,9 +96,6 @@
77 <span ng-bind="info.useCarConfig.cl.insideCode"></span> 96 <span ng-bind="info.useCarConfig.cl.insideCode"></span>
78 </td> 97 </td>
79 <td> 98 <td>
80 - <span ng-bind="info.rerunType | dict:'rerunType':'未知' "></span>  
81 - </td>  
82 - <td>  
83 <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span> 99 <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span>
84 <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span> 100 <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span>
85 </td> 101 </td>
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
@@ -64,19 +64,20 @@ @@ -64,19 +64,20 @@
64 <div class="form-group has-success has-feedback"> 64 <div class="form-group has-success has-feedback">
65 <label class="col-md-2 control-label">车辆配置*:</label> 65 <label class="col-md-2 control-label">车辆配置*:</label>
66 <div class="col-md-3"> 66 <div class="col-md-3">
67 - <sa-Select3 model="ctrl.scheduleRuleManageForSave"  
68 - name="cl"  
69 - placeholder="请输拼音..."  
70 - dcvalue="{{ctrl.scheduleRuleManageForSave.carConfigInfo.id}}" 67 + <sa-Select5 name="cl"
  68 + model="ctrl.scheduleRuleManageForSave"
  69 + cmaps="{'carConfigInfo.id' : 'id'}"
71 dcname="carConfigInfo.id" 70 dcname="carConfigInfo.id"
72 icname="id" 71 icname="id"
73 - icnames="cl.insideCode"  
74 - datatype="cci2"  
75 - dataassociate="true"  
76 - dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"  
77 - mlp="true" 72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id}, atype:'cci2' } | json }}"
  73 + dsparamsextra="{'type':'all', 'isCancel_eq': false}"
  74 + iterobjname="item"
  75 + iterobjexp="item.cl.insideCode + '<' + item.xl.name + '>'"
  76 + searchph="请输拼音..."
  77 + searchexp="this.cl.insideCode + '<' + this.xl.name + '>'"
78 required > 78 required >
79 - </sa-Select3> 79 + </sa-Select5>
  80 +
80 </div> 81 </div>
81 <!-- 隐藏块,显示验证信息 --> 82 <!-- 隐藏块,显示验证信息 -->
82 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> 83 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/form.html
@@ -64,19 +64,19 @@ @@ -64,19 +64,19 @@
64 <div class="form-group has-success has-feedback"> 64 <div class="form-group has-success has-feedback">
65 <label class="col-md-2 control-label">车辆*:</label> 65 <label class="col-md-2 control-label">车辆*:</label>
66 <div class="col-md-3"> 66 <div class="col-md-3">
67 - <sa-Select3 model="ctrl.scheduleRuleManageForSave"  
68 - name="cl"  
69 - placeholder="请输拼音..."  
70 - dcvalue="{{ctrl.scheduleRuleManageForSave.carConfigInfo.id}}" 67 + <sa-Select5 name="cl"
  68 + model="ctrl.scheduleRuleManageForSave"
  69 + cmaps="{'carConfigInfo.id' : 'id'}"
71 dcname="carConfigInfo.id" 70 dcname="carConfigInfo.id"
72 icname="id" 71 icname="id"
73 - icnames="cl.insideCode"  
74 - datatype="cci2"  
75 - dataassociate="true"  
76 - dataparam="{{ {'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id} | json }}"  
77 - mlp="true" 72 + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.scheduleRuleManageForSave.xl.id}, atype:'cci2' } | json }}"
  73 + dsparamsextra="{'type':'all', 'isCancel_eq': false}"
  74 + iterobjname="item"
  75 + iterobjexp="item.cl.insideCode + '<' + item.xl.name + '>'"
  76 + searchph="请输拼音..."
  77 + searchexp="this.cl.insideCode + '<' + this.xl.name + '>'"
78 required > 78 required >
79 - </sa-Select3> 79 + </sa-Select5>
80 </div> 80 </div>
81 <!-- 隐藏块,显示验证信息 --> 81 <!-- 隐藏块,显示验证信息 -->
82 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> 82 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">