Commit 4f0d16f3515399c12867dde38401c1a66f8a82fc

Authored by 徐烜
2 parents d1af83ff 439176c9

Merge branch 'minhang' of http://192.168.168.201:8888/panzhaov5/bsth_control into minhang

Showing 29 changed files with 1635 additions and 639 deletions
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
1 1 package com.bsth.controller.realcontrol;
2 2  
3   -import java.util.HashMap;
4   -import java.util.List;
5   -import java.util.Map;
6   -
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RestController;
9   -
10 3 import com.alibaba.fastjson.JSON;
11 4 import com.alibaba.fastjson.serializer.PropertyFilter;
12 5 import com.bsth.data.BasicData;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.util.HashMap;
  10 +import java.util.List;
  11 +import java.util.Map;
13 12  
14 13 @RestController
15 14 @RequestMapping("/basic")
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/CarDeviceController.java
1   -package com.bsth.controller.schedule.basicinfo;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.controller.schedule.BController;
5   -import com.bsth.entity.CarDevice;
6   -import com.bsth.service.schedule.CarDeviceService;
7   -import com.bsth.service.schedule.ScheduleException;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RequestParam;
12   -import org.springframework.web.bind.annotation.RestController;
13   -
14   -import java.util.HashMap;
15   -import java.util.Map;
16   -
17   -/**
18   - * Created by xu on 16/12/15.
19   - */
20   -@RestController(value = "carDeviceController_sc")
21   -@RequestMapping("cde_sc")
22   -public class CarDeviceController extends BController<CarDevice, Long> {
23   - @Autowired
24   - private CarDeviceService carDeviceService;
25   -
26   - @RequestMapping(value = "/validate_qyrq", method = RequestMethod.GET)
27   - public Map<String, Object> validate_qyrq(@RequestParam Map<String, Object> param) {
28   - Map<String, Object> rtn = new HashMap<>();
29   -
30   - try {
31   - // 启用日期验证
32   - CarDevice carDevice = new CarDevice(
33   - param.get("id_eq"),
34   - param.get("xl_eq"),
35   - param.get("cl_eq"),
36   - param.get("qyrq_eq")
37   - );
38   - carDeviceService.validate_qyrq(carDevice);
39   - rtn.put("status", ResponseCode.SUCCESS);
40   - } catch (ScheduleException exp) {
41   - rtn.put("status", ResponseCode.ERROR);
42   - rtn.put("msg", exp.getMessage());
43   - }
44   -
45   - return rtn;
46   - }
47   -
48   -}
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.CarDevice;
  6 +import com.bsth.service.schedule.CarDeviceService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * Created by xu on 16/12/15.
  19 + */
  20 +@RestController(value = "carDeviceController_sc")
  21 +@RequestMapping("cde_sc")
  22 +public class CarDeviceController extends BController<CarDevice, Long> {
  23 + @Autowired
  24 + private CarDeviceService carDeviceService;
  25 +
  26 + @RequestMapping(value = "/validate_qyrq", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_qyrq(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 +
  30 + try {
  31 + // 启用日期验证
  32 + CarDevice carDevice = new CarDevice(
  33 + param.get("id_eq"),
  34 + param.get("xl_eq"),
  35 + param.get("cl_eq"),
  36 + param.get("qyrq_eq")
  37 + );
  38 + carDeviceService.validate_qyrq(carDevice);
  39 + rtn.put("status", ResponseCode.SUCCESS);
  40 + } catch (ScheduleException exp) {
  41 + rtn.put("status", ResponseCode.ERROR);
  42 + rtn.put("msg", exp.getMessage());
  43 + }
  44 +
  45 + return rtn;
  46 + }
  47 +
  48 +}
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/EmployeeController.java
1   -package com.bsth.controller.schedule.basicinfo;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.controller.schedule.BController;
5   -import com.bsth.entity.Personnel;
6   -import com.bsth.service.schedule.EmployeeService;
7   -import com.bsth.service.schedule.ScheduleException;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RequestParam;
12   -import org.springframework.web.bind.annotation.RestController;
13   -
14   -import java.util.HashMap;
15   -import java.util.Map;
16   -
17   -/**
18   - * 人员基础信息Controller
19   - */
20   -@RestController
21   -@RequestMapping("ee")
22   -public class EmployeeController extends BController<Personnel, Integer> {
23   - @Autowired
24   - private EmployeeService employeeService;
25   -
26   - @RequestMapping(value = "/validate_gh", method = RequestMethod.GET)
27   - public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) {
28   - Map<String, Object> rtn = new HashMap<>();
29   - try {
30   - // 工号验证
31   - Personnel personnel = new Personnel(
32   - param.get("id_eq"),
33   - param.get("companyCode_eq"),
34   - param.get("jobCode_eq")
35   - );
36   - employeeService.validate_gh(personnel);
37   - rtn.put("status", ResponseCode.SUCCESS);
38   - } catch (ScheduleException exp) {
39   - rtn.put("status", ResponseCode.ERROR);
40   - rtn.put("msg", exp.getMessage());
41   - }
42   -
43   - return rtn;
44   - }
45   -}
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.Personnel;
  6 +import com.bsth.service.schedule.EmployeeService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * 人员基础信息Controller
  19 + */
  20 +@RestController
  21 +@RequestMapping("ee")
  22 +public class EmployeeController extends BController<Personnel, Integer> {
  23 + @Autowired
  24 + private EmployeeService employeeService;
  25 +
  26 + @RequestMapping(value = "/validate_gh", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 + try {
  30 + // 工号验证
  31 + Personnel personnel = new Personnel(
  32 + param.get("id_eq"),
  33 + param.get("companyCode_eq"),
  34 + param.get("jobCode_eq")
  35 + );
  36 + employeeService.validate_gh(personnel);
  37 + rtn.put("status", ResponseCode.SUCCESS);
  38 + } catch (ScheduleException exp) {
  39 + rtn.put("status", ResponseCode.ERROR);
  40 + rtn.put("msg", exp.getMessage());
  41 + }
  42 +
  43 + return rtn;
  44 + }
  45 +}
... ...
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
1 1 package com.bsth.entity.realcontrol;
2 2  
3   -import javax.persistence.Entity;
4   -import javax.persistence.FetchType;
5   -import javax.persistence.GeneratedValue;
6   -import javax.persistence.Id;
7   -import javax.persistence.ManyToOne;
8   -import javax.persistence.NamedAttributeNode;
9   -import javax.persistence.NamedEntityGraph;
10   -import javax.persistence.NamedEntityGraphs;
11   -import javax.persistence.Table;
12   -
13 3 import com.fasterxml.jackson.annotation.JsonIgnore;
14 4  
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +
15 8  
16 9 /**
17 10 *
... ... @@ -95,6 +88,10 @@ public class ChildTaskPlan {
95 88 */
96 89 private String destroyReason;
97 90  
  91 + /** 创建日期 */
  92 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  93 + private Date createDate;
  94 +
98 95 /**
99 96 * 主排班计划
100 97 */
... ... @@ -233,4 +230,12 @@ public class ChildTaskPlan {
233 230 public boolean equals(Object obj) {
234 231 return this.id.equals(((ChildTaskPlan)obj).getId());
235 232 }
  233 +
  234 + public Date getCreateDate() {
  235 + return createDate;
  236 + }
  237 +
  238 + public void setCreateDate(Date createDate) {
  239 + this.createDate = createDate;
  240 + }
236 241 }
... ...
src/main/java/com/bsth/entity/schedule/BEntity.java
1   -package com.bsth.entity.schedule;
2   -
3   -import com.bsth.entity.sys.SysUser;
4   -
5   -import javax.persistence.*;
6   -import java.util.Date;
7   -
8   -/**
9   - * Created by xu on 16/12/14.
10   - */
11   -@MappedSuperclass
12   -public class BEntity {
13   -
14   - /** 创建人 */
15   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
16   - private SysUser createBy;
17   - /** 修改人 */
18   - @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
19   - private SysUser updateBy;
20   -
21   - /** 创建日期 */
22   - @Column(updatable = false, name = "create_date")
23   - private Date createDate;
24   - /** 修改日期 */
25   - @Column(name = "update_date")
26   - private Date updateDate;
27   -
28   - public SysUser getCreateBy() {
29   - return createBy;
30   - }
31   -
32   - public void setCreateBy(SysUser createBy) {
33   - this.createBy = createBy;
34   - }
35   -
36   - public SysUser getUpdateBy() {
37   - return updateBy;
38   - }
39   -
40   - public void setUpdateBy(SysUser updateBy) {
41   - this.updateBy = updateBy;
42   - }
43   -
44   - public Date getCreateDate() {
45   - return createDate;
46   - }
47   -
48   - public void setCreateDate(Date createDate) {
49   - this.createDate = createDate;
50   - }
51   -
52   - public Date getUpdateDate() {
53   - return updateDate;
54   - }
55   -
56   - public void setUpdateDate(Date updateDate) {
57   - this.updateDate = updateDate;
58   - }
59   -}
  1 +package com.bsth.entity.schedule;
  2 +
  3 +import com.bsth.entity.sys.SysUser;
  4 +
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +
  8 +/**
  9 + * Created by xu on 16/12/14.
  10 + */
  11 +@MappedSuperclass
  12 +public class BEntity {
  13 +
  14 + /** 创建人 */
  15 + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
  16 + private SysUser createBy;
  17 + /** 修改人 */
  18 + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
  19 + private SysUser updateBy;
  20 +
  21 + /** 创建日期 */
  22 + @Column(updatable = false, name = "create_date")
  23 + private Date createDate;
  24 + /** 修改日期 */
  25 + @Column(name = "update_date")
  26 + private Date updateDate;
  27 +
  28 + public SysUser getCreateBy() {
  29 + return createBy;
  30 + }
  31 +
  32 + public void setCreateBy(SysUser createBy) {
  33 + this.createBy = createBy;
  34 + }
  35 +
  36 + public SysUser getUpdateBy() {
  37 + return updateBy;
  38 + }
  39 +
  40 + public void setUpdateBy(SysUser updateBy) {
  41 + this.updateBy = updateBy;
  42 + }
  43 +
  44 + public Date getCreateDate() {
  45 + return createDate;
  46 + }
  47 +
  48 + public void setCreateDate(Date createDate) {
  49 + this.createDate = createDate;
  50 + }
  51 +
  52 + public Date getUpdateDate() {
  53 + return updateDate;
  54 + }
  55 +
  56 + public void setUpdateDate(Date updateDate) {
  57 + this.updateDate = updateDate;
  58 + }
  59 +}
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
1 1 package com.bsth.repository.realcontrol;
2 2  
3   -import java.util.List;
4   -import java.util.Map;
5   -
6   -import javax.transaction.Transactional;
7   -
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.repository.BaseRepository;
8 5 import org.springframework.data.jpa.repository.EntityGraph;
9 6 import org.springframework.data.jpa.repository.Modifying;
10 7 import org.springframework.data.jpa.repository.Query;
11 8 import org.springframework.stereotype.Repository;
12 9  
13   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
14   -import com.bsth.repository.BaseRepository;
  10 +import javax.transaction.Transactional;
  11 +import java.util.List;
  12 +import java.util.Map;
15 13  
16 14 @Repository
17 15 public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealInfo, Long>{
... ... @@ -35,11 +33,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
35 33 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName")
36 34 List<Map<String, Object>> dailyInfo(String line,String date);
37 35  
38   - @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp,"
39   - + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 "
40   - + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND "
41   - + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true)
42   - List<Object[]> historyMessage(String line,String date,String code);
  36 + @Query(value="select t.car_code,d.sender,d.txt_content,d.timestamp,0 as xlbm from ("
  37 + + " select equipment_code,car_code from bsth_c_cars where id in("
  38 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  39 + + " select id from bsth_c_line where line_code=?1 ))) t"
  40 + + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
  41 + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like %?4% ",nativeQuery=true)
  42 + List<Object[]> historyMessage(String line,long d,long t,String code);
43 43  
44 44 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs "
45 45 + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d "
... ... @@ -113,13 +113,13 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
113 113 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
114 114 List<ScheduleRealInfo> setLD(String date);
115 115  
116   - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh")
117   - List<ScheduleRealInfo> setLDGroup(String date);
  116 + @Query(value="select new map(xlBm as xlBm,lpName as lpName,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,lpName,clZbh ORDER BY xlBm,lpName,clZbh")
  117 + List<Map<String,Object>> setLDGroup(String date);
118 118  
119   - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh")
120   - List<ScheduleRealInfo> setLCYHGroup(String date);
  119 + @Query(value="select new map(xlBm as xlBm,clZbh as clZbh) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm,clZbh ORDER BY xlBm,clZbh")
  120 + List<Map<String,Object>> setLCYHGroup(String date);
121 121  
122   - @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm")
123   - List<ScheduleRealInfo> setDDRBGroup(String date);
  122 + @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm")
  123 + List<Map<String,Object>> setDDRBGroup(String date);
124 124  
125 125 }
... ...
src/main/java/com/bsth/service/forms/CommonService.java 0 → 100644
  1 +package com.bsth.service.forms;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.stereotype.Service;
  6 +
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  8 +import com.bsth.service.BaseService;
  9 +
  10 +@Service
  11 +public interface CommonService{
  12 +
  13 + Map<String,Object> findKMBC1(String jName,String clZbh, String date,String enddate);
  14 +
  15 + Map<String,Object> findKMBC2(String jName,String clZbh,String date);
  16 +}
... ...
src/main/java/com/bsth/service/forms/impl/CommonServiceImpl.java 0 → 100644
  1 +package com.bsth.service.forms.impl;
  2 +
  3 +import java.text.DecimalFormat;
  4 +import java.util.HashMap;
  5 +import java.util.Iterator;
  6 +import java.util.List;
  7 +import java.util.Map;
  8 +import java.util.Set;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  12 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  13 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  14 +import com.bsth.service.forms.CommonService;
  15 +
  16 +@Service
  17 +public class CommonServiceImpl implements CommonService{
  18 +
  19 +
  20 + @Autowired
  21 + ScheduleRealInfoRepository scheduleRealInfoRepository;
  22 +
  23 + @Override
  24 + public Map<String, Object> findKMBC1(String jName, String clZbh,
  25 + String date, String enddate) {
  26 +
  27 + String sql=" select s from bsth_c_s_sp_info_real s "
  28 + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and "
  29 + + " to_days(s.schedule_date) BETWEEN to_days('" + date + "') and to_days('" + enddate + "')"
  30 + + " order by bcs";
  31 +
  32 +
  33 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill4(jName, clZbh, date, enddate);
  34 + DecimalFormat format = new DecimalFormat("0.00");
  35 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  36 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  37 + int jhbc = 0,cjbc = 0,ljbc = 0;
  38 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  39 + float addMileage = 0l,remMileage = 0l;
  40 + Map<String,Object> map = new HashMap<String, Object>();
  41 + for(ScheduleRealInfo scheduleRealInfo : list){
  42 + if(scheduleRealInfo != null){
  43 + //计划里程(主任务过滤掉临加班次),
  44 + //烂班里程(主任务烂班),
  45 + //临加里程(主任务临加),
  46 + //计划班次,烂班班次,增加班次
  47 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  48 + if(scheduleRealInfo.isSflj()){
  49 + addMileage += tempJhlc;
  50 + ljbc++;
  51 + }else{
  52 + jhlc += tempJhlc;
  53 + jhbc++;
  54 + if(scheduleRealInfo.getStatus() == -1){
  55 + remMileage += tempJhlc;
  56 + cjbc++;
  57 + }
  58 + }
  59 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  60 + //计算营运里程,空驶里程
  61 + if(childTaskPlans.isEmpty()){
  62 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  63 + || scheduleRealInfo.getBcType().equals("venting")){
  64 + ksgl += tempJhlc;
  65 + }else{
  66 + yygl += tempJhlc;
  67 + }
  68 + }else{
  69 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  70 + while(it.hasNext()){
  71 + ChildTaskPlan childTaskPlan = it.next();
  72 + if(childTaskPlan.getMileageType().equals("empty")){
  73 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  74 + }else{
  75 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  76 + }
  77 + }
  78 + }
  79 + }
  80 + }
  81 + map.put("jhlc", format.format(jhlc));
  82 + map.put("remMileage", format.format(remMileage));
  83 + map.put("addMileage", format.format(addMileage));
  84 + map.put("yygl", format.format(yygl));
  85 + map.put("ksgl", format.format(ksgl));
  86 + map.put("realMileage", format.format(yygl+ksgl));
  87 + map.put("jhbc", jhbc);
  88 + map.put("cjbc", cjbc);
  89 + map.put("ljbc", ljbc);
  90 + map.put("sjbc", jhbc-cjbc+ljbc);
  91 + return map;
  92 + }
  93 +
  94 +
  95 + @Override
  96 + public Map<String, Object> findKMBC2(String jName, String clZbh,String date) {
  97 +
  98 + String sql=" select s from bsth_c_s_sp_info_real s "
  99 + + " where s.j_gh ='" + jName + "' and s.cl_zbh ='" + clZbh + "' and "
  100 + + " to_days(s.schedule_date) =to_days('" + date + "')"
  101 + + " order by bcs";
  102 +
  103 +
  104 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh , date);
  105 +
  106 + DecimalFormat format = new DecimalFormat("0.00");
  107 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  108 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  109 + int jhbc = 0,cjbc = 0,ljbc = 0;
  110 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  111 + float addMileage = 0l,remMileage = 0l;
  112 + String j_Name="";
  113 + Map<String,Object> map = new HashMap<String, Object>();
  114 + for(ScheduleRealInfo scheduleRealInfo : list){
  115 + if(scheduleRealInfo != null){
  116 + j_Name=scheduleRealInfo.getjName();
  117 + //计划里程(主任务过滤掉临加班次),
  118 + //烂班里程(主任务烂班),
  119 + //临加里程(主任务临加),
  120 + //计划班次,烂班班次,增加班次
  121 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  122 + if(scheduleRealInfo.isSflj()){
  123 + addMileage += tempJhlc;
  124 + ljbc++;
  125 + }else{
  126 + jhlc += tempJhlc;
  127 + jhbc++;
  128 + if(scheduleRealInfo.getStatus() == -1){
  129 + remMileage += tempJhlc;
  130 + cjbc++;
  131 + }
  132 + }
  133 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  134 + //计算营运里程,空驶里程
  135 + if(childTaskPlans.isEmpty()){
  136 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  137 + || scheduleRealInfo.getBcType().equals("venting")){
  138 + ksgl += tempJhlc;
  139 + }else{
  140 + yygl += tempJhlc;
  141 + }
  142 + }else{
  143 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  144 + while(it.hasNext()){
  145 + ChildTaskPlan childTaskPlan = it.next();
  146 + if(childTaskPlan.getMileageType().equals("empty")){
  147 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  148 + }else{
  149 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  150 + }
  151 + }
  152 + }
  153 + }
  154 + }
  155 + map.put("j_name", j_Name);
  156 + map.put("jhlc", format.format(jhlc));
  157 + map.put("remMileage", format.format(remMileage));
  158 + map.put("addMileage", format.format(addMileage));
  159 + map.put("yygl", format.format(yygl));
  160 + map.put("ksgl", format.format(ksgl));
  161 + map.put("realMileage", format.format(yygl+ksgl));
  162 + map.put("jhbc", jhbc);
  163 + map.put("cjbc", cjbc);
  164 + map.put("ljbc", ljbc);
  165 + map.put("sjbc", jhbc-cjbc+ljbc);
  166 + return map;
  167 + }
  168 +
  169 +
  170 +
  171 +
  172 +}
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -24,7 +24,6 @@ import org.slf4j.LoggerFactory;
24 24 import org.springframework.beans.factory.annotation.Autowired;
25 25 import org.springframework.data.domain.Sort;
26 26 import org.springframework.data.domain.Sort.Direction;
27   -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
28 27 import org.springframework.stereotype.Service;
29 28  
30 29 import java.io.BufferedOutputStream;
... ... @@ -104,9 +103,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
104 103 @Autowired
105 104 private ScheduleRealInfoRepository scheduleRealInfoRepository;
106 105  
107   - @Autowired
108   - NamedParameterJdbcTemplate jdbcTemplate;
109   -
110 106  
111 107 // 运管处接口
112 108 private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint();
... ... @@ -308,31 +304,31 @@ public class TrafficManageServiceImpl implements TrafficManageService{
308 304 try {
309 305 sf.append("<DLDS>");
310 306 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
311   - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date);
  307 + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date);
312 308 Map<String,Object> map = new HashMap<String,Object>();
313   - for(ScheduleRealInfo schRealInfo:listGroup){
  309 + for(Map<String,Object> schRealInfo:listGroup){
314 310 if(schRealInfo != null){
315 311 //根据车辆自编号查询车牌号
316   - map.put("insideCode_eq", schRealInfo.getClZbh());
  312 + map.put("insideCode_eq", schRealInfo.get("clZbh")+"");
317 313 Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map));
318 314 // 获取线路是否使用标识,如果未使用,则不查该线路数据
319   - line = lineRepository.findByLineCode(schRealInfo.getXlBm());
  315 + line = lineRepository.findByLineCode(schRealInfo.get("xlBm")+"");
320 316 if(line.getInUse() == null || line.getInUse() == 0){
321 317 continue;
322 318 }
323 319 sf.append("<DLD>");
324   - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>");
325   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>");
326   - sf.append("<LPBH>"+schRealInfo.getLpName()+"</LPBH>");
  320 + sf.append("<RQ>"+date+"</RQ>");
  321 + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>");
  322 + sf.append("<LPBH>"+schRealInfo.get("lpName")+"</LPBH>");
327 323 sf.append("<CPH>"+car.getCarPlate()+"</CPH>");
328   - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>");
  324 + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
329 325 sf.append("<LDList>");
330 326  
331 327 int seqNumber = 0;
332 328 for(ScheduleRealInfo scheduleRealInfo:list){
333   - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName()
  329 + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"")
334 330 .equals(scheduleRealInfo.getLpName())
335   - && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){
  331 + && (schRealInfo.get("clZbh")+"").equals(scheduleRealInfo.getClZbh())){
336 332 if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in")
337 333 || scheduleRealInfo.getBcType().equals("out")){
338 334 continue;
... ... @@ -390,22 +386,22 @@ public class TrafficManageServiceImpl implements TrafficManageService{
390 386 StringBuffer sf = new StringBuffer();
391 387 try {
392 388 sf.append("<LCYHS>");
393   - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date);
  389 + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLCYHGroup(date);
394 390 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
395 391 Map<String,Object> map = new HashMap<String,Object>();
396   - for(ScheduleRealInfo schRealInfo:listGroup){
  392 + for(Map<String,Object> schRealInfo:listGroup){
397 393 if(schRealInfo != null){
398 394 //计算总公里和空驶公里,营运公里=总公里-空驶公里
399 395 double totalKilometers = 0,emptyKilometers =0;
400 396 sf.append("<LCYH>");
401   - map.put("insideCode_eq", schRealInfo.getClZbh());
  397 + map.put("insideCode_eq", schRealInfo.get("clZbh")+"");
402 398 Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map));
403 399 // Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh());
404   - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>");
405   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>");
  400 + sf.append("<RQ>"+date+"</RQ>");
  401 + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>");
406 402 sf.append("<CPH>"+car.getCarPlate()+"</CPH>");
407 403 for(ScheduleRealInfo scheduleRealInfo:list){
408   - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh()
  404 + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("clZbh")+"")
409 405 .equals(scheduleRealInfo.getClZbh())){
410 406 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
411 407 //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班
... ... @@ -436,7 +432,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
436 432 sf.append("<YH>"+""+"</YH>");
437 433 sf.append("<JZYL>"+""+"</JZYL>");
438 434 sf.append("<DH>"+""+"</DH>");
439   - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>");
  435 + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
440 436 sf.append("<BBSCBZ>"+0+"</BBSCBZ>");
441 437 sf.append("</LCYH>");
442 438 }
... ... @@ -466,18 +462,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{
466 462 StringBuffer sf = new StringBuffer();
467 463 try {
468 464 sf.append("<DDRBS>");
469   - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date);
  465 + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setDDRBGroup(date);
470 466 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
471   - for(ScheduleRealInfo schRealInfo:listGroup){
  467 + for(Map<String,Object> schRealInfo:listGroup){
472 468 if(schRealInfo != null){
473 469 double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0;
474 470 int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0;
475 471 sf.append("<DDRB>");
476   - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>");
477   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>");
  472 + sf.append("<RQ>"+date+"</RQ>");
  473 + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>");
478 474 for(ScheduleRealInfo scheduleRealInfo:list){
479 475 if(scheduleRealInfo != null){
480   - if(scheduleRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm())){
  476 + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm())){
481 477 //计划
482 478 if(!scheduleRealInfo.isSflj()){
483 479 jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();
... ... @@ -540,7 +536,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
540 536 sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>");
541 537 sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>");
542 538 sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>");
543   - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>");
  539 + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
544 540 sf.append("<RBSCBZ>"+0+"</RBSCBZ>");
545 541 sf.append("</DDRB>");
546 542 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -613,11 +613,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
613 613  
614 614 @Override
615 615 public List<Object[]> historyMessage(String line, String date, String code) {
  616 +
  617 + String sql="select t.car_code,d.sender,d.txt_content,d.timestamp from ("
  618 + + " select equipment_code,car_code from bsth_c_cars where id in("
  619 + + " select cl from bsth_c_s_ccinfo where xl in ( "
  620 + + " select id from bsth_c_line where line_code=?1 ))) t"
  621 + + " left join bsth_v_directive_60 d on t.equipment_code=d.device_id "
  622 + + " where d.timestamp >=?2 and d.timestamp <=?3 and t.car_code like '%?4%'";
616 623 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
617   - List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, date, code);
  624 + long d= 0;
  625 + long t=0;
  626 + if(date.length()>0){
  627 + try {
  628 + d=sdf.parse(date+" 00:00:00").getTime();
  629 + t=sdf.parse(date+" 23:59:59").getTime();
  630 + } catch (ParseException e) {
  631 + // TODO Auto-generated catch block
  632 + e.printStackTrace();
  633 + }
  634 +
  635 + }
  636 +
  637 + List<Object[]> list = scheduleRealInfoRepository.historyMessage(line,d,t, code);
618 638 for(Object[] obj:list){
619 639 if(obj != null){
620   - obj[4] = sdf.format(new Date(Long.parseLong(obj[4].toString())));
  640 + obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString())));
  641 + obj[4] = BasicData.lineCode2NameMap.get(line);
621 642 }
622 643 }
623 644 return list;
... ... @@ -1129,10 +1150,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1129 1150 addMileage += tempJhlc;
1130 1151 ljbc++;
1131 1152 }else{
1132   - if(scheduleRealInfo.getBcType().equals("normal")){
  1153 + if( !(scheduleRealInfo.getBcType().equals("in")
  1154 + ||scheduleRealInfo.getBcType().equals("out")) ){
1133 1155 jhbc++;
  1156 + jhlc += tempJhlc;
1134 1157 }
1135   - jhlc += tempJhlc;
  1158 +
1136 1159 if(scheduleRealInfo.getStatus() == -1){
1137 1160 remMileage += tempJhlc;
1138 1161 cjbc++;
... ... @@ -1143,11 +1166,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1143 1166 if(childTaskPlans.isEmpty()){
1144 1167 if(scheduleRealInfo.getBcType().equals("in") ||
1145 1168 scheduleRealInfo.getBcType().equals("out")){
1146   - ksgl += tempJhlc;
1147 1169 jcclc +=tempJhlc;
1148   - }else if(scheduleRealInfo.getBcType().equals("venting")){
1149   - ksgl += tempJhlc;
1150   - }else{
  1170 + }
  1171 + //主任务 放空班次属于营运
  1172 +// else if(scheduleRealInfo.getBcType().equals("venting")){
  1173 +// ksgl += tempJhlc;
  1174 +// }
  1175 + else{
1151 1176 if(scheduleRealInfo.getStatus() != -1){
1152 1177 yygl += tempJhlc;
1153 1178 }
... ... @@ -1160,8 +1185,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1160 1185 ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1161 1186 }else{
1162 1187 if(childTaskPlan.isDestroy()){
1163   - remMileage += tempJhlc;
1164   - cjbc++;
  1188 + remMileage += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1189 +// cjbc++;
1165 1190 }else{
1166 1191 yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1167 1192 }
... ... @@ -1175,12 +1200,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1175 1200 map.put("addMileage", format.format(addMileage));
1176 1201 map.put("yygl", format.format(yygl));
1177 1202 map.put("ksgl", format.format(ksgl));
1178   - map.put("realMileage", format.format(yygl+ksgl));
  1203 + map.put("realMileage", format.format(yygl+ksgl+jcclc));
1179 1204 map.put("jhbc", jhbc);
1180 1205 map.put("cjbc", cjbc);
1181 1206 map.put("ljbc", ljbc);
1182 1207 map.put("sjbc", jhbc-cjbc+ljbc);
1183 1208 map.put("jcclc", jcclc);
  1209 + map.put("zkslc", ksgl+jcclc);
1184 1210 return map;
1185 1211 }
1186 1212  
... ... @@ -1259,115 +1285,121 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1259 1285 Map<String,Object> map = new HashMap<String, Object>();
1260 1286 for(ScheduleRealInfo scheduleRealInfo: list){
1261 1287 if(scheduleRealInfo != null){
1262   - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1263   - //计算实际里程,少驶里程,计划里程=实际里程+少驶里程
1264   - if(childTaskPlans.isEmpty()){
1265   - tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
1266   - jhlc += tempJhlc;
1267   - if(scheduleRealInfo.getStatus() == 2){
1268   - sjgl += tempJhlc;
1269   - }else if(scheduleRealInfo.getStatus() == -1){
1270   - ssgl += tempJhlc;
1271   - if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("路阻") != -1){
1272   - ssgl_lz += tempJhlc;
1273   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("吊慢") != -1){
1274   - ssgl_dm += tempJhlc;
1275   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("故障") != -1){
1276   - ssgl_gz += tempJhlc;
1277   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("纠纷") != -1){
1278   - ssgl_jf += tempJhlc;
1279   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("肇事") != -1){
1280   - ssgl_zs += tempJhlc;
1281   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺人") != -1){
1282   - ssgl_qr += tempJhlc;
1283   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺车") != -1){
1284   - ssgl_qc += tempJhlc;
1285   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("客稀") != -1){
1286   - ssgl_kx += tempJhlc;
1287   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("气候") != -1){
1288   - ssgl_qh += tempJhlc;
1289   - }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("援外") != -1){
1290   - ssgl_yw += tempJhlc;
1291   - }else{
1292   - ssgl_other += tempJhlc;
1293   - }
1294   -
  1288 +
  1289 + if(!(scheduleRealInfo.getBcType().equals("in")
  1290 + ||scheduleRealInfo.getBcType().equals("out")) ){
  1291 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  1292 + //计算实际里程,少驶里程,计划里程=实际里程+少驶里程
  1293 + if(childTaskPlans.isEmpty()){
  1294 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
1295 1295 //临加公里
1296 1296 if(scheduleRealInfo.isSflj()){
1297 1297 ljgl += tempJhlc;
  1298 + }else{
  1299 + jhlc += tempJhlc;
1298 1300 }
1299   - }else{
1300   - ssgl += tempJhlc;
1301   - ssgl_other += tempJhlc;
1302   - }
1303   - }else{
1304   - Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1305   - while(it.hasNext()){
1306   - ChildTaskPlan childTaskPlan = it.next();
1307   - childMileage = childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1308   - jhlc += childMileage;
1309   - if(childTaskPlan.isDestroy()){
1310   - ssgl += childMileage;
1311   - if(childTaskPlan.getDestroyReason().equals("路阻")){
1312   - ssgl_lz += childTaskPlan.getMileage();
1313   - }else if(childTaskPlan.getDestroyReason().equals("吊慢")){
1314   - ssgl_dm += childTaskPlan.getMileage();
1315   - }else if(childTaskPlan.getDestroyReason().equals("故障")){
1316   - ssgl_gz += childTaskPlan.getMileage();
1317   - }else if(childTaskPlan.getDestroyReason().equals("纠纷")){
1318   - ssgl_jf += childTaskPlan.getMileage();
1319   - }else if(childTaskPlan.getDestroyReason().equals("肇事")){
1320   - ssgl_zs += childTaskPlan.getMileage();
1321   - }else if(childTaskPlan.getDestroyReason().equals("缺人")){
1322   - ssgl_qr += childTaskPlan.getMileage();
1323   - }else if(childTaskPlan.getDestroyReason().equals("缺车")){
1324   - ssgl_qc += childTaskPlan.getMileage();
1325   - }else if(childTaskPlan.getDestroyReason().equals("客稀")){
1326   - ssgl_kx += childTaskPlan.getMileage();
1327   - }else if(childTaskPlan.getDestroyReason().equals("气候")){
1328   - ssgl_qh += childTaskPlan.getMileage();
1329   - }else if(childTaskPlan.getDestroyReason().equals("援外")){
1330   - ssgl_yw += childTaskPlan.getMileage();
  1301 + if(scheduleRealInfo.getStatus() == 2){
  1302 + sjgl += tempJhlc;
  1303 + }else if(scheduleRealInfo.getStatus() == -1){
  1304 + ssgl += tempJhlc;
  1305 + if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("路阻") != -1){
  1306 + ssgl_lz += tempJhlc;
  1307 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("吊慢") != -1){
  1308 + ssgl_dm += tempJhlc;
  1309 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("故障") != -1){
  1310 + ssgl_gz += tempJhlc;
  1311 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("纠纷") != -1){
  1312 + ssgl_jf += tempJhlc;
  1313 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("肇事") != -1){
  1314 + ssgl_zs += tempJhlc;
  1315 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺人") != -1){
  1316 + ssgl_qr += tempJhlc;
  1317 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("缺车") != -1){
  1318 + ssgl_qc += tempJhlc;
  1319 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("客稀") != -1){
  1320 + ssgl_kx += tempJhlc;
  1321 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("气候") != -1){
  1322 + ssgl_qh += tempJhlc;
  1323 + }else if((scheduleRealInfo.getRemarks()==null?"":scheduleRealInfo.getRemarks()).indexOf("援外") != -1){
  1324 + ssgl_yw += tempJhlc;
1331 1325 }else{
1332   - ssgl_other += childTaskPlan.getMileage();
  1326 + ssgl_other += tempJhlc;
1333 1327 }
  1328 +
  1329 +
1334 1330 }else{
1335   - sjgl += childMileage;
  1331 + ssgl += tempJhlc;
  1332 + ssgl_other += tempJhlc;
  1333 + }
  1334 + }else{
  1335 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1336 + while(it.hasNext()){
  1337 + ChildTaskPlan childTaskPlan = it.next();
  1338 + childMileage = childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1339 + jhlc += childMileage;
  1340 + if(childTaskPlan.isDestroy()){
  1341 + ssgl += childMileage;
  1342 + if(childTaskPlan.getDestroyReason().equals("路阻")){
  1343 + ssgl_lz += childTaskPlan.getMileage();
  1344 + }else if(childTaskPlan.getDestroyReason().equals("吊慢")){
  1345 + ssgl_dm += childTaskPlan.getMileage();
  1346 + }else if(childTaskPlan.getDestroyReason().equals("故障")){
  1347 + ssgl_gz += childTaskPlan.getMileage();
  1348 + }else if(childTaskPlan.getDestroyReason().equals("纠纷")){
  1349 + ssgl_jf += childTaskPlan.getMileage();
  1350 + }else if(childTaskPlan.getDestroyReason().equals("肇事")){
  1351 + ssgl_zs += childTaskPlan.getMileage();
  1352 + }else if(childTaskPlan.getDestroyReason().equals("缺人")){
  1353 + ssgl_qr += childTaskPlan.getMileage();
  1354 + }else if(childTaskPlan.getDestroyReason().equals("缺车")){
  1355 + ssgl_qc += childTaskPlan.getMileage();
  1356 + }else if(childTaskPlan.getDestroyReason().equals("客稀")){
  1357 + ssgl_kx += childTaskPlan.getMileage();
  1358 + }else if(childTaskPlan.getDestroyReason().equals("气候")){
  1359 + ssgl_qh += childTaskPlan.getMileage();
  1360 + }else if(childTaskPlan.getDestroyReason().equals("援外")){
  1361 + ssgl_yw += childTaskPlan.getMileage();
  1362 + }else{
  1363 + ssgl_other += childTaskPlan.getMileage();
  1364 + }
  1365 + }else{
  1366 + sjgl += childMileage;
  1367 + }
1336 1368 }
1337 1369 }
1338   - }
1339   -
1340   - //班次
1341   - jhbc++;
1342   - String[] fcsj = scheduleRealInfo.getFcsj().split(":");
1343   - String[] fcsjActual = (scheduleRealInfo.getFcsjActual()==null?"0:00":scheduleRealInfo.getFcsjActual()).split(":");
1344   - if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_0 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_1){
1345   - jhbc_m++;
1346   - }else if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_2 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_3){
1347   - jhbc_a++;
1348   - }
1349   - if(scheduleRealInfo.getStatus() == 2){
1350   - sjbc++;
1351   - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
1352   - sjbc_m++;
1353   - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
1354   - sjbc_a++;
  1370 +
  1371 + //班次
  1372 + jhbc++;
  1373 + String[] fcsj = scheduleRealInfo.getFcsj().split(":");
  1374 + String[] fcsjActual = (scheduleRealInfo.getFcsjActual()==null?"0:00":scheduleRealInfo.getFcsjActual()).split(":");
  1375 + if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_0 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_1){
  1376 + jhbc_m++;
  1377 + }else if((Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) > sj_2 && (Integer.parseInt(fcsj[0])*60+Integer.parseInt(fcsj[1])) < sj_3){
  1378 + jhbc_a++;
1355 1379 }
1356   - }
1357   - if(scheduleRealInfo.isSflj()){
1358   - ljbc++;
1359   - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
1360   - ljbc_m++;
1361   - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
1362   - ljbc_a++;
  1380 + if(scheduleRealInfo.getStatus() == 2){
  1381 + sjbc++;
  1382 + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
  1383 + sjbc_m++;
  1384 + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
  1385 + sjbc_a++;
  1386 + }
1363 1387 }
1364   - }
1365   - if(scheduleRealInfo.getBcType().equals("venting")){
1366   - fzbc++;
1367   - if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
1368   - fzbc_m++;
1369   - }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
1370   - fzbc_a++;
  1388 + if(scheduleRealInfo.isSflj()){
  1389 + ljbc++;
  1390 + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
  1391 + ljbc_m++;
  1392 + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
  1393 + ljbc_a++;
  1394 + }
  1395 + }
  1396 + if(scheduleRealInfo.getBcType().equals("venting")){
  1397 + fzbc++;
  1398 + if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_0 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_1){
  1399 + fzbc_m++;
  1400 + }else if((Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) > sj_2 && (Integer.parseInt(fcsjActual[0])*60+Integer.parseInt(fcsjActual[1])) < sj_3){
  1401 + fzbc_a++;
  1402 + }
1371 1403 }
1372 1404 }
1373 1405 }
... ...
src/main/java/com/bsth/service/schedule/CarDeviceService.java
1   -package com.bsth.service.schedule;
2   -
3   -import com.bsth.entity.CarDevice;
4   -
5   -/**
6   - * Created by xu on 16/12/15.
7   - */
8   -public interface CarDeviceService extends BService<CarDevice, Long> {
9   - void validate_qyrq(CarDevice carDevice) throws ScheduleException;
10   -}
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +
  5 +/**
  6 + * Created by xu on 16/12/15.
  7 + */
  8 +public interface CarDeviceService extends BService<CarDevice, Long> {
  9 + void validate_qyrq(CarDevice carDevice) throws ScheduleException;
  10 +}
... ...
src/main/java/com/bsth/service/schedule/EmployeeService.java
1   -package com.bsth.service.schedule;
2   -
3   -import com.bsth.entity.Personnel;
4   -
5   -/**
6   - * Created by xu on 16/12/15.
7   - */
8   -public interface EmployeeService extends BService<Personnel, Integer> {
9   - public void validate_gh(Personnel personnel) throws ScheduleException;
10   -}
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.Personnel;
  4 +
  5 +/**
  6 + * Created by xu on 16/12/15.
  7 + */
  8 +public interface EmployeeService extends BService<Personnel, Integer> {
  9 + public void validate_gh(Personnel personnel) throws ScheduleException;
  10 +}
... ...
src/main/java/com/bsth/service/schedule/impl/CarDeviceServiceImpl.java
1   -package com.bsth.service.schedule.impl;
2   -
3   -import com.bsth.entity.CarDevice;
4   -import com.bsth.entity.Cars;
5   -import com.bsth.service.CarsService;
6   -import com.bsth.service.schedule.CarDeviceService;
7   -import com.bsth.service.schedule.ScheduleException;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.stereotype.Service;
10   -import org.springframework.transaction.annotation.Transactional;
11   -import org.springframework.util.CollectionUtils;
12   -
13   -import java.util.HashMap;
14   -import java.util.Map;
15   -
16   -/**
17   - * Created by xu on 16/12/15.
18   - */
19   -@Service(value = "carDeviceServiceImpl_sc")
20   -public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implements CarDeviceService {
21   - @Autowired
22   - private CarsService carsService;
23   -
24   - @Transactional
25   - @Override
26   - public CarDevice save(CarDevice carDevice) {
27   - // 查找对应的车辆基础信息,更新设备编号数据
28   - Cars cars = carsService.findById(carDevice.getCl());
29   - cars.setEquipmentCode(carDevice.getNewDeviceNo());
30   - return super.save(carDevice);
31   - }
32   -
33   - @Transactional
34   - @Override
35   - public void validate_qyrq(CarDevice carDevice) throws ScheduleException {
36   - if (carDevice.getXl() == null) {
37   - throw new ScheduleException("线路未选择");
38   - }
39   - if (carDevice.getCl() == null) {
40   - throw new ScheduleException("车辆未选择");
41   - }
42   - Map<String, Object> param = new HashMap<>();
43   - if (carDevice.getId() != null) {
44   - param.put("id_ne", carDevice.getId());
45   - }
46   - param.put("xl_eq", carDevice.getXl());
47   - param.put("cl_eq", carDevice.getCl());
48   - param.put("qyrq_ge", carDevice.getQyrq());
49   - if (!CollectionUtils.isEmpty(list(param))) {
50   - throw new ScheduleException("启用日期必须比历史的启用日期大");
51   - }
52   - }
53   -
54   - @Transactional
55   - @Override
56   - public void delete(Long aLong) throws ScheduleException {
57   - toggleCancel(aLong);
58   - }
59   -
60   - @Transactional
61   - public void toggleCancel(Long id) throws ScheduleException {
62   - CarDevice carDevice = findById(id);
63   - if (carDevice.getIsCancel()) {
64   - carDevice.setIsCancel(false);
65   - } else {
66   - carDevice.setIsCancel(true);
67   - }
68   - }
69   -}
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.CarDevice;
  4 +import com.bsth.entity.Cars;
  5 +import com.bsth.service.CarsService;
  6 +import com.bsth.service.schedule.CarDeviceService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Service;
  10 +import org.springframework.transaction.annotation.Transactional;
  11 +import org.springframework.util.CollectionUtils;
  12 +
  13 +import java.util.HashMap;
  14 +import java.util.Map;
  15 +
  16 +/**
  17 + * Created by xu on 16/12/15.
  18 + */
  19 +@Service(value = "carDeviceServiceImpl_sc")
  20 +public class CarDeviceServiceImpl extends BServiceImpl<CarDevice, Long> implements CarDeviceService {
  21 + @Autowired
  22 + private CarsService carsService;
  23 +
  24 + @Transactional
  25 + @Override
  26 + public CarDevice save(CarDevice carDevice) {
  27 + // 查找对应的车辆基础信息,更新设备编号数据
  28 + Cars cars = carsService.findById(carDevice.getCl());
  29 + cars.setEquipmentCode(carDevice.getNewDeviceNo());
  30 + return super.save(carDevice);
  31 + }
  32 +
  33 + @Transactional
  34 + @Override
  35 + public void validate_qyrq(CarDevice carDevice) throws ScheduleException {
  36 + if (carDevice.getXl() == null) {
  37 + throw new ScheduleException("线路未选择");
  38 + }
  39 + if (carDevice.getCl() == null) {
  40 + throw new ScheduleException("车辆未选择");
  41 + }
  42 + Map<String, Object> param = new HashMap<>();
  43 + if (carDevice.getId() != null) {
  44 + param.put("id_ne", carDevice.getId());
  45 + }
  46 + param.put("xl_eq", carDevice.getXl());
  47 + param.put("cl_eq", carDevice.getCl());
  48 + param.put("qyrq_ge", carDevice.getQyrq());
  49 + if (!CollectionUtils.isEmpty(list(param))) {
  50 + throw new ScheduleException("启用日期必须比历史的启用日期大");
  51 + }
  52 + }
  53 +
  54 + @Transactional
  55 + @Override
  56 + public void delete(Long aLong) throws ScheduleException {
  57 + toggleCancel(aLong);
  58 + }
  59 +
  60 + @Transactional
  61 + public void toggleCancel(Long id) throws ScheduleException {
  62 + CarDevice carDevice = findById(id);
  63 + if (carDevice.getIsCancel()) {
  64 + carDevice.setIsCancel(false);
  65 + } else {
  66 + carDevice.setIsCancel(true);
  67 + }
  68 + }
  69 +}
... ...
src/main/java/com/bsth/service/schedule/impl/EmployeeServiceImpl.java
1   -package com.bsth.service.schedule.impl;
2   -
3   -import com.bsth.entity.Personnel;
4   -import com.bsth.service.schedule.EmployeeService;
5   -import com.bsth.service.schedule.ScheduleException;
6   -import org.springframework.stereotype.Service;
7   -import org.springframework.transaction.annotation.Transactional;
8   -import org.springframework.util.CollectionUtils;
9   -
10   -import java.util.HashMap;
11   -import java.util.Map;
12   -
13   -/**
14   - * Created by xu on 16/12/15.
15   - */
16   -@Service
17   -public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService {
18   - @Override
19   - @Transactional
20   - public void validate_gh(Personnel personnel) throws ScheduleException {
21   - // 查询条件
22   - Map<String, Object> param = new HashMap<>();
23   - if (personnel.getId() != null) {
24   - param.put("id_ne", personnel.getId());
25   - }
26   - param.put("companyCode_eq", personnel.getCompanyCode());
27   - param.put("jobCode_eq", personnel.getJobCode());
28   - if (!CollectionUtils.isEmpty(list(param))) {
29   - throw new ScheduleException("相同公司工号重复");
30   - }
31   - }
32   -}
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.Personnel;
  4 +import com.bsth.service.schedule.EmployeeService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import org.springframework.stereotype.Service;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +import org.springframework.util.CollectionUtils;
  9 +
  10 +import java.util.HashMap;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by xu on 16/12/15.
  15 + */
  16 +@Service
  17 +public class EmployeeServiceImpl extends BServiceImpl<Personnel, Integer> implements EmployeeService {
  18 + @Override
  19 + @Transactional
  20 + public void validate_gh(Personnel personnel) throws ScheduleException {
  21 + // 查询条件
  22 + Map<String, Object> param = new HashMap<>();
  23 + if (personnel.getId() != null) {
  24 + param.put("id_ne", personnel.getId());
  25 + }
  26 + param.put("companyCode_eq", personnel.getCompanyCode());
  27 + param.put("jobCode_eq", personnel.getJobCode());
  28 + if (!CollectionUtils.isEmpty(list(param))) {
  29 + throw new ScheduleException("相同公司工号重复");
  30 + }
  31 + }
  32 +}
... ...
src/main/resources/static/pages/forms/statement/historyMessage.html
... ... @@ -52,7 +52,6 @@
52 52 <tr class="hidden">
53 53 <th>序号</th>
54 54 <th>线路</th>
55   - <th>路牌</th>
56 55 <th>运营车辆</th>
57 56 <th>发送人</th>
58 57 <th>发送时间</th>
... ... @@ -151,17 +150,16 @@
151 150 {{each list as obj i}}
152 151 <tr>
153 152 <td>{{i+1}}</td>
  153 + <td>{{obj[4]}}</td>
154 154 <td>{{obj[0]}}</td>
155 155 <td>{{obj[1]}}</td>
156   - <td>{{obj[2]}}</td>
157 156 <td>{{obj[3]}}</td>
158   - <td>{{obj[4]}}</td>
159   - <td>{{obj[5]}}</td>
  157 + <td>{{obj[2]}}</td>
160 158 </tr>
161 159 {{/each}}
162 160 {{if list.length == 0}}
163 161 <tr>
164   - <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  162 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
165 163 </tr>
166 164 {{/if}}
167 165 </script>
168 166 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -332,30 +332,30 @@
332 332 </script>
333 333 <script type="text/html" id="ludan_3">
334 334 <tr>
  335 + <td colspan="2">计划班次</td>
  336 + <td>{{jhbc}}</td>
335 337 <td colspan="2">计划公里</td>
336 338 <td>{{jhlc}}</td>
337   - <td colspan="2">烂班公里</td>
338   - <td>{{remMileage}}</td>
  339 + <td colspan="2">烂班班次</td>
  340 + <td>{{cjbc}}</td>
  341 + <td colspan="3"> 烂班公里</td>
  342 + <td colspan="2">{{remMileage}}</td>
  343 + </tr>
  344 + <tr>
  345 + <td colspan="2">临加班次</td>
  346 + <td>{{ljbc}}</td>
339 347 <td colspan="2">临加公里</td>
340 348 <td>{{addMileage}}</td>
  349 + <td colspan="2">实际班次</td>
  350 + <td>{{sjbc}}</td>
341 351 <td colspan="3">营运公里</td>
342 352 <td colspan="2">{{yygl}}</td>
343 353 </tr>
344 354 <tr>
345 355 <td colspan="2">空驶公里</td>
346   - <td>{{ksgl}}</td>
  356 + <td>{{zkslc}}</td>
347 357 <td colspan="2">总公里</td>
348 358 <td>{{realMileage}}</td>
349   - <td colspan="2">计划班次</td>
350   - <td>{{jhbc}}</td>
351   - <td colspan="3">烂班班次</td>
352   - <td colspan="2">{{cjbc}}</td>
353   - </tr>
354   - <tr>
355   - <td colspan="2">增加班次</td>
356   - <td>{{ljbc}}</td>
357   - <td colspan="2">实际班次</td>
358   - <td>{{sjbc}}</td>
359 359 <td colspan="2"></td>
360 360 <td></td>
361 361 <td colspan="3"></td>
... ...
src/main/resources/static/pages/forms/statement/waybillQp.html
... ... @@ -336,10 +336,10 @@
336 336 <td>{{jhlc}}</td>
337 337 <td colspan="2">营运公里</td>
338 338 <td >{{yygl}}</td>
339   - <td colspan="2">烂班公里</td>
340   - <td>{{remMileage}}</td>
341   - <td colspan="3">空驶公里</td>
342   - <td colspan="2">{{ksgl}}</td>
  339 + <td colspan="2">空驶公里</td>
  340 + <td>{{ksgl}}</td>
  341 + <td colspan="3">烂班公里</td>
  342 + <td colspan="2">{{remMileage}}</td>
343 343  
344 344  
345 345 </tr>
... ...
src/main/resources/static/real_control_v2/css/ct_table.css
... ... @@ -18,7 +18,7 @@
18 18 background: #f5f5f5;
19 19 width: 100%;
20 20 line-height: 30px;
21   - z-index: 3;
  21 + z-index: 1;
22 22 }
23 23  
24 24 .ct_table>.ct_table_head dl {
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -318,13 +318,13 @@ li.map-panel{
318 318  
319 319 .uk-panel-box-danger {
320 320 background-color: #fff1f0;
321   - color: #d85030;
  321 + /*color: #d85030;*/
322 322 border-color: rgba(216,80,48,.3);
323 323 }
324 324  
325   -.uk-panel-box-danger .uk-panel-title {
  325 +/*.uk-panel-box-danger .uk-panel-title {
326 326 color: #d85030;
327   -}
  327 +}*/
328 328  
329 329 .uk-badge-default {
330 330 background-color: #a09b9c;
... ... @@ -353,6 +353,9 @@ li.map-panel{
353 353 color: #c3c3c3;
354 354 width: 20px;
355 355 line-height: 20px;
  356 + background: #fff;
  357 + text-align: center;
  358 + z-index: 99;
356 359 }
357 360  
358 361 .ct-bottom-drawer a.ct-bottom-drawer-close:hover{
... ... @@ -396,5 +399,110 @@ li.map-panel{
396 399 stroke: rgb(62, 80, 179);
397 400 fill: rgb(62, 80, 179);
398 401 width: 30px;
399   - height: 140px;
400   -}
401 402 \ No newline at end of file
  403 + height: 124px;
  404 + rx: 5;
  405 + transform: translate(-15px);
  406 +}
  407 +
  408 +
  409 +#station_route_spacing_chart_drawer svg g._item text{
  410 + writing-mode: tb;
  411 + transform: translate(0, 9px);
  412 + fill: #fff;
  413 +}
  414 +
  415 +#station_route_spacing_chart_drawer svg g._item path{
  416 + stroke-width: 5.4px;
  417 + stroke: #3e50b3;
  418 +}
  419 +
  420 +#station_route_spacing_chart_drawer svg g._item circle{
  421 + r: 3px;
  422 + fill: #ffffff;
  423 +}
  424 +
  425 +#station_route_spacing_chart_drawer svg g._item path.arc_path{
  426 + stroke-width:1.3px;
  427 + stroke:#3e50b3;
  428 + stroke-dasharray: 1000;
  429 + stroke-dashoffset: 1000;
  430 + fill: none;
  431 +
  432 + animation: dash .9s;
  433 + webkit-amimation: dash .9s;
  434 + animation-fill-mode: forwards;
  435 + -webkit-animation-fill-mode: forwards;
  436 +}
  437 +
  438 +@keyframes dash {
  439 + to {
  440 + stroke-dashoffset: 0;
  441 + stroke-dasharray: 4,4;
  442 + }
  443 +}
  444 +
  445 +@-webkit-keyframes dash{
  446 + to {
  447 + stroke-dashoffset: 0;
  448 + stroke-dasharray: 4,4;
  449 + }
  450 +}
  451 +
  452 +#station_route_spacing_chart_drawer svg g._item text.distance_text{
  453 + writing-mode: horizontal-tb;
  454 + fill: #3e50b3;
  455 +}
  456 +
  457 +#station_route_spacing_chart_drawer svg g._item rect.distance_rect{
  458 + height: 20px;
  459 + width: 40px;
  460 + fill: #fff !important;
  461 + stroke-width: 0;
  462 +}
  463 +
  464 +#station_route_spacing_chart_drawer .tl_desc_text{
  465 + position: absolute;
  466 + top: 5px;
  467 + left: 5px;
  468 + font-size: 12px;
  469 + color: #525050;
  470 + font-family: 微软雅黑;
  471 +}
  472 +
  473 +#station_route_spacing_chart_drawer svg g._item:first-child circle{
  474 + fill: #3e50b3;
  475 + r: 6px;
  476 +}
  477 +
  478 +#station_route_spacing_chart_drawer svg g._item:last-child circle{
  479 + fill: #3e50b3;
  480 + r: 6px;
  481 +}
  482 +
  483 +
  484 +/* 下行 */
  485 +#station_route_spacing_chart_drawer svg.down g._item rect{
  486 + stroke: #dd3829;
  487 + fill: #dd3829;
  488 +}
  489 +
  490 +#station_route_spacing_chart_drawer svg.down g._item path{
  491 + stroke: #dd3829;
  492 +}
  493 +
  494 +#station_route_spacing_chart_drawer svg.down g._item:first-child circle{
  495 + fill: #dd3829;
  496 +}
  497 +
  498 +#station_route_spacing_chart_drawer svg.down g._item text.distance_text{
  499 + fill: #dd3829;
  500 +}
  501 +
  502 +#station_route_spacing_chart_drawer svg.down g._item path.arc_path{
  503 + stroke: #dd3829;
  504 +}
  505 +
  506 +#station_route_spacing_chart_drawer svg.down g._item:last-child circle{
  507 + fill: #dd3829;
  508 +}
  509 +
... ...
src/main/resources/static/real_control_v2/fragments/geo/calc_station_space.html
1 1 <!-- 嵌入下抽屉 -->
  2 +<a class="ct-bottom-drawer-close"></a>
2 3 <div id="cal_station_space_drawer" style="width: 100%;height: 100%;">
3 4  
4 5 <div style="text-align: center;padding-top: 30px;" class="calcBeforePanel">
... ... @@ -10,7 +11,7 @@
10 11 <span style="color: grey;font-size: 12px;">该操作会借用本地计算能力进行,如果你同意,请点击下方按钮!</span>
11 12 </p>
12 13 <p style="margin: 9px 0 9px 0;">
13   - <button class="uk-button uk-button-large uk-button-primary" type="button" id="startCalcBtn">开始计算</button>
  14 + <button class="uk-button uk-button-large uk-button-primary" type="button" id="startCalcBtn">开始计算站距</button>
14 15 </p>
15 16 </div>
16 17  
... ... @@ -46,13 +47,17 @@
46 47 $('.calcBeforePanel', drawer).hide();
47 48 $('.pace', drawer).show();
48 49  
49   - startGeoCalc(spatialData);
  50 + if(!spatialData.section || spatialData.section.length==0){
  51 + alert('线路编码无法对查到路段信息,请通知系统管理员');
  52 + notify_err('线路编码无法对查到路段信息,请通知系统管理员');
  53 + }
  54 + else
  55 + startGeoCalc(spatialData);
50 56 });
51 57 }
52 58  
53 59 function startGeoCalc(spatialData) {
54 60 setCalcText('初始化数据');
55   - //console.log('spatialData', spatialData);
56 61 //路段上下行分组排序
57 62 var sections = gb_common.groupBy(spatialData.section, 'DIRECTIONS');
58 63 sections[0].sort(sectionArrSort);
... ... @@ -71,25 +76,107 @@
71 76  
72 77 setCalcText('计算上行数据');
73 78 var upCalcRs = calcStationSpace(stations[0], fullSections[0]);
  79 + /*var upReverse = checkReverse(upCalcRs);
  80 + if(upReverse){
  81 +
  82 + }*/
74 83  
75 84 setCalcText('计算下行数据');
76 85 var downCalcRs = calcStationSpace(stations[1], fullSections[1]);
77 86  
  87 + var upSum = sumMileage(upCalcRs) / 1000
  88 + , downSum = sumMileage(downCalcRs) / 1000;
  89 + //线路标准
  90 + var info = gb_data_basic.getLineInformation(sch.xlBm);
  91 +
  92 + //计算误差值
  93 + var upDiff = (info.upMileage - upSum).toFixed(2),
  94 + downDiff = (info.downMileage - downSum).toFixed(2);
  95 +
  96 + //均摊误差值,统一数据
  97 + var upPlus = calcAvgDiff(upDiff, upCalcRs, info.upMileage);
  98 + var downPlus = calcAvgDiff(downDiff, downCalcRs, info.downMileage);
  99 +
  100 + //写入localStorage
78 101 var locData = {
79 102 stations: {up: upCalcRs, down: downCalcRs},
80 103 sections: {up: fullSections[0], down: fullSections[1]}
81 104 };
82 105  
83   - window.localStorage.setItem('control_route_distance_' + sch.xlBm, JSON.stringify(locData));
84   - //console.log('结果', locData);
  106 + //误差小于3公里才接受
  107 + upSuccess = Math.abs(upDiff) <= 3;
  108 + downSuccess = Math.abs(downDiff) <= 3;
  109 + if(upSuccess && downSuccess){
  110 + window.localStorage.setItem('control_route_distance_' + sch.xlBm, JSON.stringify(locData));
  111 + //刷新父页面
  112 + console.log('$(drawer).parents', $(drawer).parents('.uk-modal'));
  113 + $(drawer).parents('.uk-modal').trigger('refresh_station_space');
  114 + }
  115 +
  116 + //线路信息
  117 + var line = gb_data_basic.codeToLine[sch.xlBm];
  118 + var data = {
  119 + upSum: upSum,
  120 + downSum: downSum,
  121 + upMileage: info.upMileage,
  122 + downMileage: info.downMileage,
  123 + upDiff: upDiff,
  124 + downDiff: downDiff,
  125 + upSuccess: upSuccess,
  126 + downSuccess: downSuccess,
  127 + lineId: line.id,
  128 + upStationCount: upCalcRs.length,
  129 + downStationCount: downCalcRs.length,
  130 + upPlus: upPlus,
  131 + downPlus : downPlus
  132 + };
  133 + open_modal('/real_control_v2/fragments/geo/calc_station_space_rs.html' ,data, {bgclose:false, keyboard:false, modal:false});
  134 + //UIkit.modal.alert(template('cal_station_space_result-temp', data), {labels: {Ok: '我明白了'}});
  135 +
  136 + //跳转
  137 + drawerLoadPage('/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html'
  138 + , 'station_route_spacing_chart_drawer');
  139 + }
  140 +
  141 +
  142 + //均摊差值
  143 + function calcAvgDiff(diff, array, validate) {
  144 + //余数扔在第一个站距上
  145 + var more = (diff * 1000) % (array.length - 1);
  146 + if(more > 0)
  147 + array[1].toDistance = gb_common.accAdd(array[1].toDistance, more);
  148 +
  149 + var t = parseInt((diff * 1000) / (array.length - 1));
  150 + for(var i = 1; i < array.length; i++){
  151 + array[i].toDistance = gb_common.accAdd(array[i].toDistance, t);
  152 + }
  153 +
  154 + var sumGl=0;
  155 + $.each(array, function () {
  156 + this.toDistanceGl = parseFloat((this.toDistance / 1000).toFixed(2));
  157 + sumGl = gb_common.accAdd(sumGl, this.toDistanceGl);
  158 + });
  159 +
  160 + //丢失的精度
  161 + diff = ((validate * 1000) - (sumGl * 1000)) / 1000;
  162 + array[1].toDistanceGl = gb_common.accAdd(array[1].toDistanceGl, diff);
  163 + return t;
  164 + }
  165 +
  166 + function sumMileage(array) {
  167 + var sum = 0;
  168 + $.each(array, function () {
  169 + sum += this.toDistance;
  170 + });
  171 + return sum;
85 172 }
86 173  
87 174 function sectionArrSort(s1, s2) {
88   - return s1.SECTIONROUTE_CODE - s2.SECTIONROUTE_CODE;
  175 + return s1['SECTIONROUTE_CODE'] - s2['SECTIONROUTE_CODE'];
89 176 }
90 177  
91 178 function stationArrSort(s1, s2) {
92   - return s1.STATION_ROUTE_CODE - s2.STATION_ROUTE_CODE;
  179 + return s1['STATION_ROUTE_CODE'] - s2['STATION_ROUTE_CODE'];
93 180 }
94 181  
95 182 function setCalcText(t) {
... ... @@ -102,7 +189,7 @@
102 189  
103 190 var vs, temps;
104 191 for (var i = 0, section; section = sectionArray[i++];) {
105   - vs = section.GSECTION_VECTOR;
  192 + vs = section['GSECTION_VECTOR'];
106 193 temps = vs.substr(11, vs.length - 2).split(',');
107 194  
108 195 connectCoords(coords, temps);
... ... @@ -111,6 +198,34 @@
111 198 }
112 199  
113 200 function connectCoords(all, subArr) {
  201 +/* var point, len = all.length, inLine, overlap;
  202 +
  203 + var array = [];
  204 + $.each(subArr, function (i, p) {
  205 + var ts = p.split(' ');
  206 + array.push({latitude: parseFloat(ts[1]), longitude: parseFloat(ts[0])});
  207 + });
  208 +
  209 + //all 最后一个位于subArr 上的点位
  210 + for(var i = 0; i < len; i ++){
  211 + point = all[i];
  212 + for(var j = 1; j < array.length; j ++){
  213 + inLine = geolib.isPointInLine(point, array[j - 1], array[j]);
  214 + if(inLine)
  215 + overlap = {s1: i,s2: j};
  216 + }
  217 + }
  218 +
  219 + //拼接
  220 + if(overlap){
  221 + all = all.slice(0, overlap.s1 + 1);
  222 + array = array.slice(overlap.s2);
  223 + }
  224 +
  225 + for(var z = 0; z < array.length; z++){
  226 + all.push(array[z]);
  227 + }
  228 + return all;*/
114 229  
115 230 var point, ts, len = all.length, inLine, sIndex = 0;
116 231 if (len > 0) {
... ... @@ -141,14 +256,21 @@
141 256  
142 257 //计算站点间距
143 258 function calcStationSpace(stations, coords) {
  259 + //起始路段坐标点
  260 + var sei = calcPointToLineNearPoint({latitude: stations[0]['G_LATY'],longitude: stations[0]['G_LONX']
  261 + }, coords).index;
144 262  
145 263 var nearArray = [];
146   - for (var i = 1; i < stations.length; i++) {
  264 + if(sei > coords.length - 5){
  265 + //路段路由反向
  266 + coords.reverse();
  267 + }
147 268  
  269 + for (var i = 1; i < stations.length; i++) {
148 270 //点到线的最短距离 并计算交点坐标
149 271 var rs = calcPointToLineNearPoint({
150   - latitude: stations[i].G_LATY,
151   - longitude: stations[i].G_LONX
  272 + latitude: stations[i]['G_LATY'],
  273 + longitude: stations[i]['G_LONX']
152 274 }, coords);
153 275 rs.station = stations[i];
154 276  
... ... @@ -156,7 +278,6 @@
156 278 coords.splice(rs.index, 0, rs.intersection);
157 279  
158 280 nearArray.push(rs);
159   - //console.log('站点' + i + '计算结果', rs.intersection, rs);
160 281 }
161 282  
162 283 //根据交点截断line,并计算距离
... ... @@ -167,8 +288,7 @@
167 288 for (; s < e; s++) {
168 289 distance += geolib.getDistance(coords[s], coords[s + 1]);
169 290 }
170   -
171   - this.toDistance = distance;
  291 + this.toDistance = parseFloat(distance.toFixed(2));
172 292 s = e;
173 293 });
174 294  
... ... @@ -225,6 +345,13 @@
225 345 return {longitude: lon, latitude: lat};
226 346 }
227 347  
  348 + //页面切换
  349 + function drawerLoadPage(url, id) {
  350 + $(drawer).parent('.ct-bottom-drawer-body').load(url, function () {
  351 + $('#' + id).trigger('drawer-init', {sch: sch});
  352 + });
  353 + }
  354 +
228 355 })();
229 356 </script>
230 357 </div>
231 358 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/geo/calc_station_space_rs.html 0 → 100644
  1 +<div class="uk-modal ct-form-modal" id="calc_station_space_rs-modal">
  2 + <div class="uk-modal-dialog" style="width: 900px;">
  3 + <div class="uk-modal-header">
  4 + <h2>计算完成</h2></div>
  5 +
  6 + <div class="_modal_body">
  7 +
  8 + </div>
  9 +
  10 + <div class="uk-modal-footer uk-text-right" >
  11 + <button type="button" class="uk-button uk-button-primary uk-modal-close" autofocus>我明白了</button>
  12 + </div>
  13 + </div>
  14 +
  15 +
  16 + <script id="cal_station_space_result-temp" type="text/html">
  17 + <div>
  18 + <div>
  19 + <table class="uk-table">
  20 + <tr>
  21 + <th>走向</th>
  22 + <th>
  23 + 计算结果(总里程)
  24 + </th>
  25 + <th>
  26 + 线路标准(总里程)
  27 + </th>
  28 + <th>
  29 + 误差(公里)
  30 + </th>
  31 + <th>
  32 + 站点数
  33 + </th>
  34 + <th>
  35 + 处理
  36 + </th>
  37 + </tr>
  38 + <tr>
  39 + <td>
  40 + 上行
  41 + </td>
  42 + <td>
  43 + {{upSum}}
  44 + </td>
  45 + <td>
  46 + <a href="/pages/base/lineinformation/list.html?no={{lineId}}" target="_blank">
  47 + {{upMileage}}
  48 + </a>
  49 + </td>
  50 + <td>
  51 + {{upDiff}}
  52 + </td>
  53 + <td>
  54 + {{upStationCount}}
  55 + </td>
  56 + <td>
  57 + {{if upSuccess}}
  58 + <div> 每站{{if upPlus>0}}加{{else}}减{{/if}} {{upPlusAbs}} 米 </div>
  59 + {{else}}
  60 + <div style="color: red">误差过大,请确认基础数据的准确性!</div>
  61 + {{/if}}
  62 + </td>
  63 + </tr>
  64 +
  65 + <tr>
  66 + <td>
  67 + 下行
  68 + </td>
  69 + <td>
  70 + {{downSum}}
  71 + </td>
  72 + <td>
  73 + <a href="/pages/base/lineinformation/list.html?no={{lineId}}" target="_blank">
  74 + {{downMileage}}
  75 + </a>
  76 + </td>
  77 + <td>
  78 + {{downDiff}}
  79 + </td>
  80 + <td>
  81 + {{downStationCount}}
  82 + </td>
  83 + <td>
  84 + {{if downSuccess}}
  85 + <div>每站{{if downPlus>0}}加{{else}}减{{/if}} {{downPlusAbs}} 米 </div>
  86 + {{else}}
  87 + <div style="color: red">误差过大,请确认基础数据的准确性!</div>
  88 + {{/if}}
  89 + </td>
  90 + </tr>
  91 + </table>
  92 + </div>
  93 + <h6 style="color: #808080">如果希望计算结果更精准,请检查线路和站点走向,并确认站点准确的点在路段上</h6>
  94 + </div>
  95 + </script>
  96 +
  97 + <script>
  98 + (function () {
  99 + var modal = '#calc_station_space_rs-modal';
  100 +
  101 + $(modal).on('init', function (e,data) {
  102 + data.upPlusAbs = Math.abs(data.upPlus);
  103 + data.downPlusAbs = Math.abs(data.downPlus);
  104 +
  105 + var htmlStr = template('cal_station_space_result-temp', data);
  106 + $('._modal_body', modal).html(htmlStr);
  107 + });
  108 + })();
  109 + </script>
  110 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -188,8 +188,8 @@
188 188  
189 189 function selectedDl(sch) {
190 190 //默认选中项
191   - $('[name=lineSelect]', f).val(sch.xlBm).trigger('change');
192   - $('[name=lpName]', f).val(sch.lpName).trigger('change');
  191 + $('[name=lineSelect]', modal).val(sch.xlBm).trigger('change');
  192 + $('[name=lpName]', modal).val(sch.lpName).trigger('change');
193 193 var dl = $('.main-schedule-table', modal).find('dl[data-id=' + sch.id + ']').trigger('click');
194 194 //滚动到可视区域
195 195 var cont = $('.main-schedule-wrap', modal);
... ... @@ -209,7 +209,7 @@
209 209  
210 210 //刷新主任务表格
211 211 var m_s_table_update = function (e, opts) {
212   - var lineCode = $('[name=lineSelect]', f).val();
  212 + var lineCode = $('[name=lineSelect]', modal).val();
213 213 //重新获取班次数据
214 214 schList = gb_schedule_table.findScheduleByLine(lineCode);
215 215 lp2SchMap = gb_common.groupBy(schList, 'lpName');
... ... @@ -291,10 +291,12 @@
291 291 gb_common.$del('/childTask/' + id, function (rs) {
292 292 gb_schedule_table.updateSchedule(rs.t);
293 293 notify_succ('删除子任务成功!');
294   - //刷新班次列表
295   - m_s_table_update();
296   - //选中班次
297   - selectedDl(rs.t);
  294 + setTimeout(function () {
  295 + //刷新班次列表
  296 + m_s_table_update();
  297 + //选中班次
  298 + selectedDl(rs.t);
  299 + }, 300);
298 300 });
299 301 }, '确定删除');
300 302 };
... ... @@ -322,8 +324,7 @@
322 324 name: "添加子任务",
323 325 items: {
324 326 'add_sub_task_in': {
325   - name: '回场',
326   - disabled: true
  327 + name: '回场'
327 328 },
328 329 'add_sub_task_out': {
329 330 name: '出场',
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
... ... @@ -9,7 +9,22 @@
9 9 <div class="uk-panel uk-panel-box uk-panel-box-primary">
10 10 <div class="uk-panel-badge uk-badge">营运</div>
11 11 <h3 class="uk-panel-title">线路上站点间</h3>
12   - <form class="uk-form uk-form-horizontal" service_form>
  12 + <form class="uk-form uk-form-horizontal inpark_form" service_form>
  13 + <input type="hidden" name="type2" value="1">
  14 + <input type="hidden" name="mileageType" value="service">
  15 + <div class="uk-grid">
  16 + <div class="uk-width-3-10">
  17 + <div class="uk-form-row">
  18 + <label class="uk-form-label">班次类型 </label>
  19 + </div>
  20 + </div>
  21 + <div class="uk-width-7-10 pl5">
  22 + <select name="type1" class="ct_focus" disabled>
  23 + <option value="正常">正常</option>
  24 + <option value="临加">临加</option>
  25 + </select>
  26 + </div>
  27 + </div>
13 28 <div class="uk-grid">
14 29 <div class="uk-width-3-10">
15 30 <div class="uk-form-row">
... ... @@ -37,7 +52,7 @@
37 52 </div>
38 53 </div>
39 54 <div class="uk-width-7-10 pl5">
40   - <input type="text" name="mileageType" required>
  55 + <input type="text" name="mileage" required>
41 56 </div>
42 57 </div>
43 58 <div class="uk-grid">
... ... @@ -67,7 +82,22 @@
67 82 <div class="uk-panel uk-panel-box uk-panel-box-secondary">
68 83 <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div>
69 84 <h3 class="uk-panel-title">进场</h3>
70   - <form class="uk-form uk-form-horizontal" empty_form>
  85 + <form class="uk-form uk-form-horizontal inpark_form" empty_form>
  86 + <input type="hidden" name="type2" value="2">
  87 + <input type="hidden" name="mileageType" value="empty">
  88 + <div class="uk-grid">
  89 + <div class="uk-width-3-10">
  90 + <div class="uk-form-row">
  91 + <label class="uk-form-label">班次类型 </label>
  92 + </div>
  93 + </div>
  94 + <div class="uk-width-7-10 pl5">
  95 + <select name="type1" class="ct_focus">
  96 + <option value="正常">正常</option>
  97 + <option value="临加">临加</option>
  98 + </select>
  99 + </div>
  100 + </div>
71 101 <div class="uk-grid">
72 102 <div class="uk-width-3-10">
73 103 <div class="uk-form-row">
... ... @@ -95,8 +125,8 @@
95 125 </div>
96 126 </div>
97 127 <div class="uk-width-7-10 pl5">
98   - <input type="text" name="mileageType" required style="width: calc(100% - 62px);">
99   - <a style="font-size: 12px;">路径(3)</a>
  128 + <input type="text" name="mileage" required style="width: calc(100% - 62px);">
  129 + <a style="font-size: 12px;color: grey;cursor: default;" data-uk-tooltip title="可选择回场路径,设置途径点位。暂不开放" id="inpark_paths_link">路径(<span>0</span>)</a>
100 130 </div>
101 131 </div>
102 132 <div class="uk-grid">
... ... @@ -126,7 +156,13 @@
126 156 <div class="uk-panel uk-panel-box uk-panel-box-danger">
127 157 <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div>
128 158 <h3 class="uk-panel-title">线路上站点间</h3>
129   - <form class="uk-form uk-form-horizontal" destroy_form>
  159 + <form class="uk-form uk-form-horizontal inpark_form" destroy_form>
  160 + <input type="hidden" value="正常" name="type1">
  161 + <input type="hidden" value="1" name="type2">
  162 + <input type="hidden" name="mileageType" value="service">
  163 + <input type="hidden" name="destroy" value="true">
  164 + <div class="uk-grid" style="height: 30px;">
  165 + </div>
130 166 <div class="uk-grid">
131 167 <div class="uk-width-3-10">
132 168 <div class="uk-form-row">
... ... @@ -154,7 +190,7 @@
154 190 </div>
155 191 </div>
156 192 <div class="uk-width-7-10 pl5">
157   - <input type="text" name="mileageType" required>
  193 + <input type="text" name="mileage" required>
158 194 </div>
159 195 </div>
160 196 <div class="uk-grid">
... ... @@ -182,13 +218,13 @@
182 218 </div>
183 219  
184 220 <form class="uk-form" style="margin-top: 15px; padding: 0 10px 0 0;">
185   - <textarea placeholder="备注" style="width: 100%;height: 70px;"></textarea>
  221 + <textarea placeholder="备注" style="width: 100%;height: 70px;" id="globalRemarks"></textarea>
186 222 </form>
187 223 </div>
188 224  
189 225 <div class="uk-modal-footer uk-text-right">
190 226 <button type="button" class="uk-button uk-modal-close">取消</button>
191   - <button type="button" class="uk-button uk-button-primary">提交子任务</button>
  227 + <button type="button" class="uk-button uk-button-primary" id="submitChildTaskBtn">提交子任务</button>
192 228  
193 229 <div class="ct-footer-left">
194 230 <a id="betweenStationRangeCalc" data-drawer-id="station_route_spacing_chart_drawer">站点间公里不准?</a>
... ... @@ -197,8 +233,6 @@
197 233 </div>
198 234  
199 235 <div class="ct-bottom-drawer">
200   - <a class="ct-bottom-drawer-close"></a>
201   -
202 236 <div class="ct-bottom-drawer-body"></div>
203 237 </div>
204 238  
... ... @@ -215,34 +249,26 @@
215 249 var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
216 250 $(modal).on('init', function (e, data) {
217 251 sch = data.sch;
218   - //var formHtml = template('sub-task-inpark-form-temp', {sch:sch, adjustExps: adjustExps});
219   - //$('form', modal).html(formHtml);
220   - //字典转换
221   - //dictionaryUtils.transformDom($('.nt-dictionary', modal));
222 252  
223 253 //站点路由
224 254 stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) {
225 255 return a.stationRouteCode - b.stationRouteCode;
226 256 }), 'directions')[sch.xlDir];
227 257 //空驶终点(停车场)
  258 + //切换进场终点
  259 + $('select[name=endStation]', emptyForm).on('change', inparkNavigation);
228 260 $.get('/basic/parks', function (rs) {
229 261 parks = rs;
230 262 var opts = '';
231 263 for (var code in parks) {
232 264 opts += '<option value="' + code + '">' + parks[code] + '</option>';
233 265 }
234   - $('select[name=endStation]', emptyForm).html(opts).val(information.carPark);
  266 + $('select[name=endStation]', emptyForm).html(opts).val(information.carPark).trigger('change');
235 267 });
236 268 //线路标准
237 269 information = gb_data_basic.getLineInformation(sch.xlBm);
238 270 //本地存储的站点耗时
239   - try {
240   - timeLocStations = window.localStorage.getItem('control_route_distance_' + sch.xlBm);
241   - if (timeLocStations)
242   - timeLocStations = JSON.parse(timeLocStations).stations[sch.xlDir == 0 ? 'up' : 'down'];
243   - } catch (e) {
244   - console.log(e);
245   - }
  271 + getLocStationsSpace();
246 272  
247 273 //设置默认值
248 274 setDefaultVal();
... ... @@ -263,18 +289,81 @@
263 289 }).trigger('change');
264 290  
265 291  
  292 + var dataArray = [];
  293 + var fs = $('form.inpark_form', modal).formValidation({
  294 + framework: 'uikit',
  295 + locale: 'zh_CN'
  296 + });
  297 + fs.on('success.form.fv', function(e) {
  298 + e.preventDefault();
  299 + if($(this).is(':hidden'))
  300 + return;
  301 + dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this)
  302 + , {remarks: $('#globalRemarks',modal).val(), 'schedule.id': sch.id}));
  303 + $(this).data('valid', true);
  304 +
  305 + if(allValidSuccess()){
  306 + var i = 0;
  307 + (function () {
  308 + var f = arguments.callee;
  309 + if(i >= dataArray.length){
  310 + UIkit.modal(modal).hide();
  311 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch});
  312 + return;
  313 + }
  314 + var data = dataArray[i];
  315 + gb_common.$post('/childTask', data, function (rs) {
  316 + notify_succ('子任务添加成功');
  317 + gb_schedule_table.updateSchedule(rs.t);
  318 + i++;
  319 + f();
  320 + });
  321 + })();
  322 + }
  323 + });
  324 +
  325 + //校验不过
  326 + fs.on('err.field.fv', function () {
  327 + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled');
  328 + });
  329 +
266 330 //submit
267   - /*var f = $('form', modal).formValidation({
268   - framework: 'uikit',
269   - locale: 'zh_CN',
270   - });
271   - f.on('success.form.fv', function(e) {
272   - disabled_submit_btn(this);
273   - e.preventDefault();
274   - var data = $(this).serializeJSON();
275   -
276   - });*/
  331 + $('#submitChildTaskBtn', modal).on('click', function () {
  332 + $(this).addClass('disabled').attr('disabled','disabled');
  333 + dataArray = [];
  334 + fs.data('valid', false);
  335 + fs.formValidation('validate');
  336 + //fs.submit();
  337 + });
  338 +
  339 + //选择烂班原因
  340 + $('select[name=destroyReason]', destroyForm).on('change', function () {
  341 + var e =$('#globalRemarks', modal);
  342 + e.val(e.val() + $(this).val() + ',');
  343 + });
277 344 });
  345 +
  346 + function allValidSuccess() {
  347 + var flag = true;
  348 + $('form.inpark_form:visible', modal).each(function (i, f) {
  349 + if(!$(f).data('valid')){
  350 + flag = false;
  351 + return false;
  352 + }
  353 + });
  354 + return flag;
  355 + }
  356 +
  357 + //获取表单disabled 项的值
  358 + function getDisabledVal(f) {
  359 + var rs = {};
  360 + $('input,select', f).each(function () {
  361 + if($(this).attr('disabled')){
  362 + rs[$(this).attr('name')]=$(this).val();
  363 + }
  364 + });
  365 + return rs;
  366 + }
278 367  
279 368 function setDefaultVal() {
280 369 var routeOpts = '';
... ... @@ -299,6 +388,70 @@
299 388  
300 389 //营运开始时间
301 390 $('input[name=startDate]', serviceForm).val(sch.dfsj);
  391 + //营运班次类型
  392 + $('input[name=type1]', serviceForm).val(sch['sflj']?'临加':'正常');
  393 + }
  394 +
  395 + //点击 路径
  396 + $('#inpark_paths_link', modal).on('click', function () {
  397 +
  398 + });
  399 +
  400 + //进场导航
  401 + var drivingRouteResult;
  402 + function inparkNavigation() {
  403 + var start = $('select[name=startStation]', emptyForm).val()
  404 + ,end = $('select[name=endStation]', emptyForm).val();
  405 +
  406 + if(!end) return;
  407 +
  408 + var station = getStationByCode(start).station
  409 + ,park = gb_data_basic.getCarparkByCode(end);
  410 +
  411 + if(!park){
  412 + notify_err('无法找到停车场的坐标对照!!!');
  413 + return;
  414 + }
  415 + var tArray = park['gCenterPoint'].split(' ');
  416 + var sCoord = TransGPS.wgsToBD(station['gLaty'], station['gLonx'])
  417 + ,eCoord = TransGPS.wgsToBD(parseFloat(tArray[1]), parseFloat(tArray[0]));
  418 +
  419 + var sp = new BMap.Point(sCoord.lng,sCoord.lat);
  420 + var ep = new BMap.Point(eCoord.lng,eCoord.lat);
  421 +
  422 + var driving = new BMap.DrivingRoute('上海', {
  423 + onSearchComplete: function (rs) {
  424 + drivingRouteResult = rs;
  425 + calcInparkMileage(0);
  426 + }
  427 + });
  428 + driving.search(sp,ep);
  429 + }
  430 +
  431 + function calcInparkMileage(index) {
  432 + var count = drivingRouteResult.getNumPlans();
  433 +
  434 + //选择方案
  435 + var routePlan = drivingRouteResult.getPlan(index);
  436 + //里程
  437 + var mileage = routePlan.getDistance(false);
  438 + $('input[name=mileage]', emptyForm).val(mileage / 1000);
  439 + //结束时间
  440 + var duratio = routePlan.getDuration(false);
  441 + var st = $('input[name=startDate]', emptyForm).val();
  442 + var ets = moment(st, 'HH:mm').add(duratio, 'seconds').format('HH:mm');
  443 + $('input[name=endDate]', emptyForm).val(ets);
  444 +
  445 +
  446 + $('#inpark_paths_link span', modal).text(count);
  447 + }
  448 +
  449 + function getStationByCode(code) {
  450 + for(var i = 0; i < stationRoutes.length; i++){
  451 + if(stationRoutes[i]['stationCode']==code)
  452 + return stationRoutes[i];
  453 + }
  454 + return null;
302 455 }
303 456  
304 457 function reClac() {
... ... @@ -311,33 +464,78 @@
311 464 e = $('select[name=endStation]', serviceForm).val();
312 465 var sMileage = calcMileage(s, e);
313 466 if(sMileage >= 0)
314   - $('input[name=mileageType]', serviceForm).val(sMileage);
  467 + $('input[name=mileage]', serviceForm).val(sMileage);
315 468  
  469 + //营运结束时间
  470 + var et = sch.dfsjT + (parseInt(sMileage / sch.jhlc * sch.bcsj) * 60 * 1000)
  471 + ,ets = et > sch.zdsjT?sch.zdsj:moment(et).format('HH:mm');
  472 + $('input[name=endDate]', serviceForm).val(ets);
  473 +
  474 + //有烂班
316 475 if (serviceEnd != esCode) {
317 476 //烂班起点 == 营运终点
318 477 $('select[name=startStation]', destroyForm).val(serviceEnd);
  478 + //计算烂班公里
  479 + s = $('select[name=startStation]', destroyForm).val();
  480 + e = $('select[name=endStation]', destroyForm).val();
  481 + var dMileage = calcMileage(s, e);
  482 + $('input[name=mileage]', destroyForm).val(dMileage);
  483 + //烂班开始时间
  484 + $('input[name=startDate]', destroyForm).val(ets);
319 485 }
  486 +
  487 + //进场开始时间
  488 + $('input[name=startDate]', emptyForm).val(ets);
  489 +
  490 + //重新导航
  491 + inparkNavigation();
320 492 }
321 493  
322 494 function calcMileage(s, e) {
323 495 var mileage = 0, flag, code;
324 496 if (timeLocStations) {
  497 + //空间坐标计算的站距
325 498 $.each(timeLocStations, function () {
326   - code = this.station.STATION_CODE;
327   - if (code == s) {
  499 + code = this.station['STATION_CODE'];
  500 + if (flag)
  501 + mileage = gb_common.accAdd(mileage, this.toDistanceGl);
  502 + if (code == s)
328 503 flag = true;
329   - }
330   -
  504 + if (code == e)
  505 + return false;
  506 + });
  507 + }
  508 + else{
  509 + //从原始站点路由字段里取值
  510 + $.each(stationRoutes, function () {
  511 + code = this['stationCode'];
331 512 if (flag)
332   - mileage += this.toDistance;
333   -
  513 + mileage = gb_common.accAdd(mileage, this.distances);
  514 + if (code == s)
  515 + flag = true;
334 516 if (code == e)
335 517 return false;
336 518 });
337 519 }
338   - return mileage / 1000;
  520 + return mileage;
339 521 }
340 522  
  523 + //从本地localStorage获取站间距数据
  524 + function getLocStationsSpace() {
  525 + try {
  526 + timeLocStations = window.localStorage.getItem('control_route_distance_' + sch.xlBm);
  527 + if (timeLocStations)
  528 + timeLocStations = JSON.parse(timeLocStations).stations[sch.xlDir == 0 ? 'up' : 'down'];
  529 + } catch (e) {
  530 + console.log(e);
  531 + }
  532 + }
  533 +
  534 + //站间距计算后刷新
  535 + $(modal).on('refresh_station_space', function () {
  536 + getLocStationsSpace();
  537 + reClac();
  538 + });
341 539  
342 540 //------ 下抽屉 ------
343 541 $('#betweenStationRangeCalc', modal).on('click', function () {
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_other.html
... ... @@ -175,19 +175,23 @@
175 175 for (var code in parks)
176 176 park_opts += '<option value="' + code + '">' + parks[code] + '</option>';
177 177  
178   - var qdz = $('[name=startStation]', f), zdz = $('[name=endStation]', f);
  178 + var qdz = $('[name=startStation]', f), zdz = $('[name=endStation]', f), mType = $('[name=mileageType]', f);
179 179 switch ($(this).val()) {
180 180 case '3'://出场
181 181 qdz.html(park_opts).val(information.carPark);
182 182 zdz.html(opts);
  183 + mType.val('empty');
183 184 break;
184 185 case '2'://进场
185 186 qdz.html(opts);
186 187 zdz.html(park_opts).val(information.carPark);
  188 + mType.val('empty');
187 189 break;
188 190 default:
189 191 qdz.html(opts);
190 192 zdz.html(opts).val(lastCode);
  193 + mType.val('service');
  194 +
191 195 }
192 196 });
193 197  
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html
1 1 <!-- 站点路由间距图 -->
  2 +<a class="ct-bottom-drawer-close" style="right: calc(20% + 10px);"></a>
2 3 <div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;">
  4 + <div class="tl_desc_text" style="z-index: 999;">
  5 + (鼠标滚轮滚动)单位:米 | <a class="delete_route_spacing_link" style="color: red;">删除</a>
  6 + </div>
3 7 <div class="svg_wrap"></div>
4 8  
5 9 <div class="drawer_right_map" >
... ... @@ -10,19 +14,75 @@
10 14  
11 15 (function () {
12 16 var drawer = '#station_route_spacing_chart_drawer'
13   - , sch, locData, stationArr;
  17 + , sch, locData, stationArr, len;
  18 + var cy = 120;
  19 + var tCy = cy - 15;
  20 + //站点marker对照
  21 + var map, markers = {};
  22 +
  23 + $('.delete_route_spacing_link', drawer).on('click', function () {
  24 + alt_confirm('确定要删除【'+sch.xlName+'】基于空间坐标计算的站间距数据?', function () {
  25 + window.localStorage.removeItem('control_route_distance_' + sch.xlBm);
  26 + toGeoCalcPage();
  27 + }, '确定删除');
  28 + });
14 29  
15   - //var xScale;
16 30 $(drawer).on('drawer-init', function (e, data) {
17 31 sch = data.sch;
18 32 locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm);
19 33  
20 34 if(locData)
21 35 drawCharts();
22   - else
23   - drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer');
  36 + else{
  37 + toGeoCalcPage();
  38 + return;
  39 + }
  40 +
  41 + setTimeout(initMap, 800);
24 42 });
25   -
  43 +
  44 + function initMap() {
  45 + //初始化地图
  46 + map = new BMap.Map($('.drawer_right_map', drawer)[0]);
  47 + //中心点和缩放级别
  48 + map.centerAndZoom(new BMap.Point(121.544336, 31.221315), 15);
  49 + map.enableScrollWheelZoom();
  50 +
  51 + //绘制线路
  52 + var routes = JSON.parse(locData).sections[sch.xlDir==0?'up':'down'];
  53 +
  54 + var pos = [], bdCoord;
  55 + $.each(routes, function () {
  56 + bdCoord = TransGPS.wgsToBD(this.latitude, this.longitude);
  57 + pos.push(new BMap.Point(bdCoord.lng, bdCoord.lat));
  58 + });
  59 +
  60 + var polyline = new BMap.Polyline(pos, {strokeWeight:6, strokeColor: 'blue'});
  61 + map.addOverlay(polyline);
  62 +
  63 + //绘制站点
  64 + var station;
  65 + $.each(stationArr, function () {
  66 + station=this.station;
  67 + bdCoord = TransGPS.wgsToBD(station.G_LATY, station.G_LONX);
  68 +
  69 + var point = new BMap.Point(bdCoord.lng, bdCoord.lat);
  70 + var marker = new BMap.Marker(point);
  71 +
  72 + //根据站点名称 计算marker 宽度
  73 + var w = station.STATION_NAME.length * 12 + 4;
  74 + station.stationName = station.STATION_NAME;
  75 + station.directions = station.DIRECTIONS;
  76 + var icon = new BMap.Icon(gb_map_imap.createStationIcon(station, w), new BMap.Size(w-2,24), {anchor: new BMap.Size((w-2)/2,24)})
  77 + marker.setIcon(icon);
  78 +
  79 + map.addOverlay(marker);
  80 + markers[station.STATION_CODE] = marker;
  81 + });
  82 +
  83 + autoPosition();
  84 + }
  85 +
26 86 function drawCharts() {
27 87 try {
28 88 stationArr = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down'];
... ... @@ -31,41 +91,161 @@
31 91 return;
32 92 }
33 93  
34   - var width = 1500;
  94 + //console.log('locData...', JSON.parse(locData));
  95 + len = stationArr.length;
  96 + var width = cx(len - 1) + 20;
35 97 var svgCont = $('<div style="width: '+width+'px;" class="svg_cont_body"></div>');
36   - var svg = d3.select(svgCont[0]).append('svg');
  98 + var svg = d3.select(svgCont[0]).append('svg').classed({down: sch.xlDir==0?false:true});
37 99  
38 100 //初始化 X 比例尺
39 101 var sum=0;
40 102 $.each(stationArr, function () {
41   - sum += this.toDistance;
  103 + sum += this.toDistance;
42 104 });
43 105  
44   - console.log('stations', stationArr);
45 106 var items = svg.selectAll('g._item').data(stationArr)
46 107 .enter()
47 108 .append('g')
  109 + .attr('data-code', function (d) {
  110 + return d.station.STATION_CODE;
  111 + })
48 112 .classed({_item: true});
49 113  
50 114 //rect
51   - items.append('rect').attr('x', xScale).attr('y', 40);
  115 + items.append('rect').attr('x', xScale).attr('y', cy);
  116 + //text
  117 + items.append('text').attr('x', xScale).attr('y', cy)
  118 + .text(stationText).attr('title', stationText);
  119 +
  120 + //path
  121 + items.append('path').attr('d', function (d, i) {
  122 + return i>=len-1?'':line([i , i + 1]);
  123 + });
  124 +
  125 + //上弧线
  126 + items.append('path').classed({arc_path: true}).attr('d', route_arc_path);
  127 +
  128 + //path circle
  129 + items.append('circle').attr('cx', function (d, i) {
  130 + return cx(i);
  131 + }).attr('cy', tCy);
  132 +
  133 + //站距
  134 + items.filter(secFilter).append('rect')
  135 + .attr('x', function (d, i) {
  136 + return cx(i) - 6;
  137 + })
  138 + .attr('y', tCy - 42)
  139 + .classed({distance_rect: true})
  140 + .style('transform', distTranslate);
  141 +
  142 + items.filter(secFilter).append('text')
  143 + .attr('x', xScale)
  144 + .attr('y', tCy - 26)
  145 + .text(function (d, i) {
  146 + return d.toDistance;
  147 + })
  148 + .classed({distance_text: true})
  149 + .style('transform', distTranslate);
  150 +
52 151 $('.svg_wrap', drawer).append(svgCont);
53 152 }
54 153  
  154 + var xpdd = 20;
  155 + //var halfWidth = 15;
55 156 var xScale = function (d, i) {
  157 + return cx(i);
  158 + };
  159 +
  160 + var cx = function (i) {
56 161 var sum=0;
57 162 for(var j = 0; j <= i; j++){
58 163 sum+=stationArr[j].toDistance;
59 164 }
60   - return sum / 5;
  165 + return sum / 2.5 + xpdd;
  166 + };
  167 +
  168 + var stationText = function (d) {
  169 + return d.station['STATION_NAME'];
  170 + };
  171 +
  172 + var line = d3.svg.line().x(cx).y(tCy);
  173 +
  174 + var route_arc_path = function (d, i) {
  175 + if(i >= len - 1) return;
  176 + var x1 = cx(i);
  177 + var x2 = cx(i + 1);
  178 +
  179 + var c1 = (x1 + (x2 - x1) / 3) + ' ' + (tCy - 40);
  180 + var c2 = (x2 - (x2 - x1) / 3) +' '+ (tCy - 40);
  181 +
  182 + return 'M'+x1+' '+tCy+' C '+ c1 +', '+ c2 +', '+ x2 +' '+tCy;
  183 + };
  184 +
  185 + var secFilter = function (d, i) {
  186 + return i > 0;
  187 + };
  188 +
  189 + //地图定位
  190 + var posMarker, posing=false;
  191 + function autoPosition() {
  192 + var left = Math.abs(parseInt($('.svg_cont_body', drawer).css('left').replace('px', '')));
  193 +
  194 + var g;
  195 + $('svg g._item text', drawer).each(function () {
  196 + if($(this).attr('x') > left){
  197 + g = $(this).parent();
  198 + return false;
  199 + }
  200 + });
  201 + posMarker = markers[g.data('code')];
  202 +
  203 + if(posing) return;
  204 + posing = true;
  205 + setTimeout(function () {
  206 + map.panTo(posMarker.point/*, {noAnimation: true}*/);
  207 + posing = false;
  208 + }, 500);
  209 + }
  210 +
  211 + var distTranslate = function (d, i) {
  212 + return 'translate('+(d.toDistance / 2.5 / 2 - 16)+'px, 0px)';
61 213 };
62 214  
  215 + function toGeoCalcPage() {
  216 + drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer');
  217 + }
  218 +
63 219 //页面切换
64 220 function drawerLoadPage(url, id) {
65 221 $(drawer).parent('.ct-bottom-drawer-body').load(url, function () {
66 222 $('#' + id).trigger('drawer-init', {sch: sch});
67 223 });
68 224 }
  225 +
  226 + var threshold = 30;
  227 + $(drawer).on('mousewheel', '.svg_cont_body', function (e) {
  228 + var event = e.originalEvent;
  229 + var code = delta = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;
  230 +
  231 + var left = parseInt($(this).css('left').replace('px',''))
  232 + ,width = $(this).width()
  233 + ,max = width - $(this).parent().width();
  234 + if(code > 0){
  235 + left += threshold;
  236 + if(left >= 0)
  237 + left = 0;
  238 + $(this).css('left', left + 'px');
  239 + }
  240 + else{
  241 + left -= threshold;
  242 + if(Math.abs(left) >= max)
  243 + left = -max;
  244 + $(this).css('left', left + 'px');
  245 + }
  246 +
  247 + autoPosition();
  248 + });
69 249 })();
70 250 </script>
71   -</div>
72 251 \ No newline at end of file
  252 + </div>
73 253 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/common.js
... ... @@ -215,7 +215,7 @@ var gb_common = (function () {
215 215 data.push({value: this});
216 216 });
217 217 init_autocomplete(element, data);
218   - }
  218 + };
219 219  
220 220 var init_autocom_pinyin = function (element, data) {
221 221 // init autocomplete
... ... @@ -240,7 +240,7 @@ var gb_common = (function () {
240 240 release && release(rs);
241 241 }
242 242 });
243   - }
  243 + };
244 244  
245 245 var init_autocomplete = function (element, data) {
246 246 var autocomplete = UIkit.autocomplete(element, {
... ... @@ -262,7 +262,7 @@ var gb_common = (function () {
262 262 release && release(rs);
263 263 }
264 264 });
265   - }
  265 + };
266 266  
267 267 // function whichTransitionEvent() {
268 268 // var t;
... ... @@ -281,6 +281,49 @@ var gb_common = (function () {
281 281 // }
282 282 // }
283 283  
  284 + var accAdd = function(a, b) {
  285 + var c, d, e;
  286 + try {
  287 + c = a.toString().split(".")[1].length;
  288 + } catch (f) {
  289 + c = 0;
  290 + }
  291 + try {
  292 + d = b.toString().split(".")[1].length;
  293 + } catch (f) {
  294 + d = 0;
  295 + }
  296 + return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e;
  297 + };
  298 +
  299 + function mul(a, b) {
  300 + var c = 0,
  301 + d = a.toString(),
  302 + e = b.toString();
  303 + try {
  304 + c += d.split(".")[1].length;
  305 + } catch (f) {}
  306 + try {
  307 + c += e.split(".")[1].length;
  308 + } catch (f) {}
  309 + return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
  310 + }
  311 +
  312 + var numSubtr = function (a, b) {
  313 + var c, d, e;
  314 + try {
  315 + c = a.toString().split(".")[1].length;
  316 + } catch (f) {
  317 + c = 0;
  318 + }
  319 + try {
  320 + d = b.toString().split(".")[1].length;
  321 + } catch (f) {
  322 + d = 0;
  323 + }
  324 + return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e;
  325 + };
  326 +
284 327 return {
285 328 reqCode80: reqCode80,
286 329 groupBy: groupBy,
... ... @@ -295,7 +338,9 @@ var gb_common = (function () {
295 338 lineAutocomplete: lineAutocomplete,
296 339 personAutocomplete: personAutocomplete,
297 340 carAutocomplete: carAutocomplete,
298   - init_autocomplete: init_autocomplete
  341 + init_autocomplete: init_autocomplete,
  342 + accAdd : accAdd,
  343 + numSubtr: numSubtr
299 344  
300 345 //whichTransitionEvent:whichTransitionEvent
301 346 };
... ...
src/main/resources/static/real_control_v2/js/data/data_basic.js
... ... @@ -44,7 +44,6 @@ var gb_data_basic = (function () {
44 44 ep.emit('lineInformations', informations);
45 45 });
46 46  
47   -
48 47 //人员信息
49 48 $.get('/basic/all_personnel', function (rs) {
50 49 //转换成自动补全组件需要的数据
... ... @@ -62,6 +61,18 @@ var gb_data_basic = (function () {
62 61 ep.emit('all_personnel', data);
63 62 });
64 63  
  64 + var carparks={};
  65 + //停车场数据
  66 + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) {
  67 + $.each(rs.list, function () {
  68 + carparks[this.parkCode] = this;
  69 + });
  70 + });
  71 +
  72 + var getCarparkByCode = function (code) {
  73 + return carparks[code];
  74 + }
  75 +
65 76 //line code to name
66 77 $.get('/basic/lineCode2Name', function (rs) {
67 78 ep.emit('lineCode2Name', rs);
... ... @@ -113,6 +124,7 @@ var gb_data_basic = (function () {
113 124 allPersonnel: function () {
114 125 return allPersonnel;
115 126 },
116   - findCodeByLinename: findCodeByLinename
  127 + findCodeByLinename: findCodeByLinename,
  128 + getCarparkByCode: getCarparkByCode
117 129 };
118 130 })();
... ...
src/main/resources/static/real_control_v2/js/line_schedule/legend.js
1   -/* 图例相关 */
2   -
3   -var gb_sch_legend = (function () {
4   -
5   - var locaKey = 'sch_legend_flag';
6   - var storage = window.localStorage;
7   -
8   - var animationend = 'webkitAnimationEnd animationend';
9   - var initLegend = function (cont) {
10   - //双击展开
11   - $('.schedule-wrap i.uk-icon-question-circle', cont).dblclick(openLegend);
12   -
13   - //关闭事件
14   - $('.schedule-wrap .fixed_legend_close', cont).on('click', function () {
15   - //隐藏 fixed_legend
16   - $('.schedule-wrap .fixed_legend').each(function () {
17   - var anim = 'uk-animation-slide-top uk-animation-reverse';
18   - if (!$(this).parents('.header-title').is(':hidden')) {
19   - $(this).addClass(anim).one(animationend, function () {
20   - var icon=$(this).removeClass(anim).hide().parents('.header-title').find('.uk-icon-question-circle');
21   -
22   - icon.addClass('uk-animation-slide-top').show().one(animationend, function () {
23   - $(this).removeClass('uk-animation-slide-top');
24   - });
25   - });
26   - }
27   - else {
28   - $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show();
29   - }
30   - });
31   -
32   - //记录状态
33   - storage.setItem(locaKey, 0);
34   - });
35   -
36   - var flag=storage.getItem(locaKey);
37   - if(flag && flag==1)
38   - openLegend();
39   - };
40   -
41   -
42   - //展开图例
43   - var openLegend = function () {
44   - $('.qtip.sch-tl-tip').qtip('destroy', true);
45   -
46   - //隐藏ICON
47   - $('.schedule-wrap i.uk-icon-question-circle').hide();
48   -
49   - var anim = 'uk-animation-slide-top';
50   - //显示 fixed_legend
51   - $('.schedule-wrap .fixed_legend').each(function () {
52   - if (!$(this).parents('.header-title').is(':hidden')) {
53   - $(this).addClass(anim).one('webkitAnimationEnd animationend', function () {
54   - $(this).removeClass(anim);
55   - });
56   - }
57   - });
58   - $('.schedule-wrap .fixed_legend').css('display', 'inline-block');
59   -
60   - //记录状态
61   - storage.setItem(locaKey, 1);
62   - };
63   -
64   - return {
65   - init: initLegend
66   - };
  1 +/* 图例相关 */
  2 +
  3 +var gb_sch_legend = (function () {
  4 +
  5 + var locaKey = 'sch_legend_flag';
  6 + var storage = window.localStorage;
  7 +
  8 + var animationend = 'webkitAnimationEnd animationend';
  9 + var initLegend = function (cont) {
  10 + //双击展开
  11 + $('.schedule-wrap i.uk-icon-question-circle', cont).dblclick(openLegend);
  12 +
  13 + //关闭事件
  14 + $('.schedule-wrap .fixed_legend_close', cont).on('click', function () {
  15 + //隐藏 fixed_legend
  16 + $('.schedule-wrap .fixed_legend').each(function () {
  17 + var anim = 'uk-animation-slide-top uk-animation-reverse';
  18 + if (!$(this).parents('.header-title').is(':hidden')) {
  19 + $(this).addClass(anim).one(animationend, function () {
  20 + var icon=$(this).removeClass(anim).hide().parents('.header-title').find('.uk-icon-question-circle');
  21 +
  22 + icon.addClass('uk-animation-slide-top').show().one(animationend, function () {
  23 + $(this).removeClass('uk-animation-slide-top');
  24 + });
  25 + });
  26 + }
  27 + else {
  28 + $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show();
  29 + }
  30 + });
  31 +
  32 + //记录状态
  33 + storage.setItem(locaKey, 0);
  34 + });
  35 +
  36 + var flag=storage.getItem(locaKey);
  37 + if(flag && flag==1)
  38 + openLegend();
  39 + };
  40 +
  41 +
  42 + //展开图例
  43 + var openLegend = function () {
  44 + $('.qtip.sch-tl-tip').qtip('destroy', true);
  45 +
  46 + //隐藏ICON
  47 + $('.schedule-wrap i.uk-icon-question-circle').hide();
  48 +
  49 + var anim = 'uk-animation-slide-top';
  50 + //显示 fixed_legend
  51 + $('.schedule-wrap .fixed_legend').each(function () {
  52 + if (!$(this).parents('.header-title').is(':hidden')) {
  53 + $(this).addClass(anim).one('webkitAnimationEnd animationend', function () {
  54 + $(this).removeClass(anim);
  55 + });
  56 + }
  57 + });
  58 + $('.schedule-wrap .fixed_legend').css('display', 'inline-block');
  59 +
  60 + //记录状态
  61 + storage.setItem(locaKey, 1);
  62 + };
  63 +
  64 + return {
  65 + init: initLegend
  66 + };
67 67 })();
68 68 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -75,17 +75,10 @@ var gb_main_ep = new EventProxy(),
75 75 //modal hide remove dom
76 76 $(document).on('hide.uk.modal', '.uk-modal', function() {
77 77 $(this).remove();
78   -/* //如果modal内部存在context-menu,则注销
79   - var ctx = $('.context-menu-item', this);
80   - debugger
81   - if(ctx.length > 0){
82   - //ctx.contextMenu('destroy');
83   - $.contextMenu('destroy', ctx);
84   - }*/
85 78 });
86 79  
87 80 $(document).on('click', '.ct-bottom-drawer-close', function () {
88   - $(this).parent().removeClass('open');
  81 + $(this).parents('.ct-bottom-drawer').removeClass('open');
89 82 });
90 83  
91 84 function connectArr(arr, separator, transFun) {
... ... @@ -113,19 +106,19 @@ var notify_wait = function(t) {
113 106 UIkit.notify("<i class='uk-icon-spinner uk-icon-spin'></i> " + t, {
114 107 status: 'info'
115 108 });
116   -}
  109 +};
117 110  
118 111 var notify_succ = function(t) {
119 112 UIkit.notify("<i class='uk-icon-check'></i> " + t, {
120 113 status: 'success'
121 114 });
122   -}
  115 +};
123 116  
124 117 var notify_err = function(t) {
125 118 UIkit.notify("<i class='uk-icon-times'></i> " + t, {
126 119 status: 'danger'
127 120 });
128   -}
  121 +};
129 122  
130 123 var alt_confirm = function(content, succ, okBtn) {
131 124 var modalEl = UIkit.modal.confirm(content, function() {
... ... @@ -138,11 +131,11 @@ var alt_confirm = function(content, succ, okBtn) {
138 131 }
139 132 ,center: true
140 133 });
141   -}
  134 +};
142 135  
143 136 var isArray = function(obj) {
144 137 return Object.prototype.toString.call(obj) === '[object Array]';
145   -}
  138 +};
146 139  
147 140 var notify_err_form = function(t, form) {
148 141 $('.uk-alert-danger', form).remove();
... ... @@ -152,7 +145,7 @@ var notify_err_form = function(t, form) {
152 145 '</div>');
153 146  
154 147 enable_submit_btn(form);
155   -}
  148 +};
156 149  
157 150 var enable_submit_btn = function(form) {
158 151 var subBtn = $('button[type=submit]', form);
... ... @@ -166,14 +159,14 @@ var disabled_submit_btn = function(form) {
166 159 if (subBtn) {
167 160 subBtn.addClass('disabled').attr('disabled','disabled');
168 161 }
169   -}
  162 +};
170 163  
171 164 var show_modal = function(id, dom) {
172 165 $(document.body).append(dom);
173 166 return UIkit.modal(id, {
174 167 bgclose: false
175 168 }).show();
176   -}
  169 +};
177 170  
178 171 var open_modal = function(pageUrl, data, opt) {
179 172 $.get(pageUrl, function(dom) {
... ... @@ -196,8 +189,8 @@ var open_modal = function(pageUrl, data, opt) {
196 189 function showUpdateDescription() {
197 190 //更新说明
198 191 var updateDescription={
199   - date: '2016-12-15',
200   - text: '<h5>1、双击电子路单title右侧 ? 号图标,可将图例固定在上发。</h5><h5>2、每辆车最后一个班次,实发栏会显示计划和实际终点时间。</h5><h5>3、修复了子任务添加1分钟后再删除,弹出完整性约束校验失败 的问题。</h5>'
  192 + date: '2016-12-20',
  193 + text: '<h5>1、回场子任务开放使用。</h5>'
201 194 };
202 195  
203 196 var storage = window.localStorage
... ...