Commit 113a678497dd223e0d04808eb437ee627fd3615e

Authored by 娄高锋
2 parents 129ccd3d 04ce23f6

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

minhang
Showing 57 changed files with 2480 additions and 2076 deletions
src/main/java/com/bsth/controller/schedule/CarConfigInfoController.java deleted 100644 → 0
1 -package com.bsth.controller.schedule;  
2 -  
3 -import com.bsth.controller.BaseController;  
4 -import com.bsth.entity.schedule.CarConfigInfo;  
5 -import com.bsth.repository.schedule.CarConfigInfoRepository;  
6 -import com.bsth.service.schedule.utils.DataToolsProperties;  
7 -import org.springframework.beans.factory.annotation.Autowired;  
8 -import org.springframework.boot.context.properties.EnableConfigurationProperties;  
9 -import org.springframework.web.bind.annotation.*;  
10 -  
11 -import java.util.List;  
12 -import java.util.Map;  
13 -  
14 -/**  
15 - * Created by xu on 16/5/9.  
16 - */  
17 -@RestController  
18 -@RequestMapping("cci")  
19 -@EnableConfigurationProperties(DataToolsProperties.class)  
20 -public class CarConfigInfoController extends BaseController<CarConfigInfo, Long> {  
21 - @Autowired  
22 - private DataToolsProperties dataToolsProperties;  
23 - @Autowired  
24 - private CarConfigInfoRepository carConfigInfoRepository;  
25 -  
26 - @Override  
27 - protected String getDataImportKtrClasspath() {  
28 - return dataToolsProperties.getCarsconfigDatainputktr();  
29 - }  
30 -  
31 - @Override  
32 - public CarConfigInfo findById(@PathVariable("id") Long aLong) {  
33 - return carConfigInfoRepository.findOneExtend(aLong);  
34 - }  
35 -  
36 - /**  
37 - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody  
38 - * @Title: save  
39 - * @Description: TODO(持久化对象)  
40 - * @param @param t  
41 - * @param @return 设定文件  
42 - * @return Map<String,Object> {status: 1(成功),-1(失败)}  
43 - * @throws  
44 - */  
45 - @RequestMapping(method = RequestMethod.POST)  
46 - public Map<String, Object> save(@RequestBody CarConfigInfo t){  
47 - return baseService.save(t);  
48 - }  
49 -  
50 - @RequestMapping(value = "/cars", method = RequestMethod.GET)  
51 - public List<Map<String, Object>> findCarConfigCars() {  
52 - return carConfigInfoRepository.findCarConfigCars();  
53 - }  
54 -  
55 - @RequestMapping(value = "/cars2", method = RequestMethod.GET)  
56 - public List<Map<String, Object>> findCarsFromConfig() {  
57 - return carConfigInfoRepository.findCarsFromConfig();  
58 - }  
59 -}  
src/main/java/com/bsth/controller/schedule/EmployeeConfigInfoController.java deleted 100644 → 0
1 -package com.bsth.controller.schedule;  
2 -  
3 -import com.bsth.controller.BaseController;  
4 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
5 -import com.bsth.repository.schedule.EmployeeConfigInfoRepository;  
6 -import com.bsth.service.schedule.utils.DataToolsProperties;  
7 -import org.springframework.beans.factory.annotation.Autowired;  
8 -import org.springframework.boot.context.properties.EnableConfigurationProperties;  
9 -import org.springframework.web.bind.annotation.*;  
10 -  
11 -import java.util.List;  
12 -import java.util.Map;  
13 -  
14 -/**  
15 - * Created by xu on 16/5/10.  
16 - */  
17 -@RestController  
18 -@RequestMapping("eci")  
19 -@EnableConfigurationProperties(DataToolsProperties.class)  
20 -public class EmployeeConfigInfoController extends BaseController<EmployeeConfigInfo, Long> {  
21 - @Autowired  
22 - private DataToolsProperties dataToolsProperties;  
23 - @Autowired  
24 - private EmployeeConfigInfoRepository employeeConfigInfoRepository;  
25 -  
26 - @Override  
27 - protected String getDataImportKtrClasspath() {  
28 - return dataToolsProperties.getEmployeesconfigDatainputktr();  
29 - }  
30 -  
31 - @Override  
32 - public EmployeeConfigInfo findById(@PathVariable("id") Long aLong) {  
33 - return employeeConfigInfoRepository.findOneExtend(aLong);  
34 - }  
35 -  
36 - /**  
37 - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody  
38 - * @Title: save  
39 - * @Description: TODO(持久化对象)  
40 - * @param @param t  
41 - * @param @return 设定文件  
42 - * @return Map<String,Object> {status: 1(成功),-1(失败)}  
43 - * @throws  
44 - */  
45 - @RequestMapping(method = RequestMethod.POST)  
46 - public Map<String, Object> save(@RequestBody EmployeeConfigInfo t){  
47 - return baseService.save(t);  
48 - }  
49 -  
50 - @RequestMapping(value = "/jsy", method = RequestMethod.GET)  
51 - public List<Map<String, Object>> findJsyFromConfig() {  
52 - return employeeConfigInfoRepository.findJsyFromConfig();  
53 - }  
54 -  
55 - @RequestMapping(value = "/spy", method = RequestMethod.GET)  
56 - public List<Map<String, Object>> findSpyFromConfig() {  
57 - return employeeConfigInfoRepository.findSpyFromConfig();  
58 - }  
59 -}  
src/main/java/com/bsth/controller/schedule/core/CarConfigInfoController.java 0 → 100644
  1 +package com.bsth.controller.schedule.core;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.schedule.CarConfigInfo;
  6 +import com.bsth.repository.schedule.CarConfigInfoRepository;
  7 +import com.bsth.service.schedule.CarConfigInfoService;
  8 +import com.bsth.service.schedule.ScheduleException;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +
  15 +import java.util.HashMap;
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +
  19 +/**
  20 + * Created by xu on 16/5/9.
  21 + */
  22 +@RestController
  23 +@RequestMapping("cci")
  24 +public class CarConfigInfoController extends BController<CarConfigInfo, Long> {
  25 + @Autowired
  26 + private CarConfigInfoRepository carConfigInfoRepository;
  27 + @Autowired
  28 + private CarConfigInfoService carConfigInfoService;
  29 +
  30 +
  31 + @RequestMapping(value = "/cars", method = RequestMethod.GET)
  32 + public List<Map<String, Object>> findCarConfigCars() {
  33 + return carConfigInfoRepository.findCarConfigCars();
  34 + }
  35 +
  36 + @RequestMapping(value = "/cars2", method = RequestMethod.GET)
  37 + public List<Map<String, Object>> findCarsFromConfig() {
  38 + return carConfigInfoRepository.findCarsFromConfig();
  39 + }
  40 +
  41 + @RequestMapping(value = "/validate_cars", method = RequestMethod.GET)
  42 + public Map<String, Object> validate_cars(@RequestParam Map<String, Object> param) {
  43 + Map<String, Object> rtn = new HashMap<>();
  44 + try {
  45 + // 车辆重复配置验证
  46 + CarConfigInfo carConfigInfo = new CarConfigInfo(
  47 + param.get("id_eq"),
  48 + param.get("xl.id_eq"),
  49 + param.get("xl.name_eq"),
  50 + param.get("cl.id_eq")
  51 + );
  52 + carConfigInfoService.validate_cars(carConfigInfo);
  53 + rtn.put("status", ResponseCode.SUCCESS);
  54 + } catch (ScheduleException exp) {
  55 + rtn.put("status", ResponseCode.ERROR);
  56 + rtn.put("msg", exp.getMessage());
  57 + }
  58 +
  59 + return rtn;
  60 + }
  61 +}
src/main/java/com/bsth/controller/schedule/core/EmployeeConfigInfoController.java 0 → 100644
  1 +package com.bsth.controller.schedule.core;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  6 +import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
  7 +import com.bsth.service.schedule.EmployeeConfigInfoService;
  8 +import com.bsth.service.schedule.ScheduleException;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +
  15 +import java.util.HashMap;
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +
  19 +/**
  20 + * Created by xu on 16/5/10.
  21 + */
  22 +@RestController
  23 +@RequestMapping("eci")
  24 +public class EmployeeConfigInfoController extends BController<EmployeeConfigInfo, Long> {
  25 + @Autowired
  26 + private EmployeeConfigInfoRepository employeeConfigInfoRepository;
  27 + @Autowired
  28 + private EmployeeConfigInfoService employeeConfigInfoService;
  29 +
  30 + @RequestMapping(value = "/jsy", method = RequestMethod.GET)
  31 + public List<Map<String, Object>> findJsyFromConfig() {
  32 + return employeeConfigInfoRepository.findJsyFromConfig();
  33 + }
  34 +
  35 + @RequestMapping(value = "/spy", method = RequestMethod.GET)
  36 + public List<Map<String, Object>> findSpyFromConfig() {
  37 + return employeeConfigInfoRepository.findSpyFromConfig();
  38 + }
  39 +
  40 +
  41 +
  42 + @RequestMapping(value = "/validate_jsy", method = RequestMethod.GET)
  43 + public Map<String, Object> validate_jsy(@RequestParam Map<String, Object> param) {
  44 + Map<String, Object> rtn = new HashMap<>();
  45 + try {
  46 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  47 + param.get("id_eq"),
  48 + param.get("xl.id_eq"),
  49 + param.get("xl.name_eq"),
  50 + param.get("jsy.id_eq"),
  51 + null
  52 + );
  53 + employeeConfigInfoService.validate_jsy(employeeConfigInfo);
  54 + rtn.put("status", ResponseCode.SUCCESS);
  55 + } catch (ScheduleException exp) {
  56 + rtn.put("status", ResponseCode.ERROR);
  57 + rtn.put("msg", exp.getMessage());
  58 + }
  59 +
  60 + return rtn;
  61 + }
  62 +
  63 + @RequestMapping(value = "/validate_spy", method = RequestMethod.GET)
  64 + public Map<String, Object> validate_spy(@RequestParam Map<String, Object> param) {
  65 + Map<String, Object> rtn = new HashMap<>();
  66 + try {
  67 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  68 + param.get("id_eq"),
  69 + param.get("xl.id_eq"),
  70 + param.get("xl.name_eq"),
  71 + null,
  72 + param.get("spy.id_eq")
  73 + );
  74 + employeeConfigInfoService.validate_spy(employeeConfigInfo);
  75 + rtn.put("status", ResponseCode.SUCCESS);
  76 + } catch (ScheduleException exp) {
  77 + rtn.put("status", ResponseCode.ERROR);
  78 + rtn.put("msg", exp.getMessage());
  79 + }
  80 + return rtn;
  81 + }
  82 +}
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
@@ -54,6 +54,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt; @@ -54,6 +54,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
54 try { 54 try {
55 // 路牌编号验证 55 // 路牌编号验证
56 GuideboardInfo guideboardInfo = new GuideboardInfo( 56 GuideboardInfo guideboardInfo = new GuideboardInfo(
  57 + param.get("id_eq"),
57 param.get("xl.id_eq"), 58 param.get("xl.id_eq"),
58 param.get("lpNo_eq"), 59 param.get("lpNo_eq"),
59 null 60 null
@@ -73,6 +74,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt; @@ -73,6 +74,7 @@ public class GuideboardInfoController extends BController&lt;GuideboardInfo, Long&gt;
73 try { 74 try {
74 // 路牌名称验证 75 // 路牌名称验证
75 GuideboardInfo guideboardInfo = new GuideboardInfo( 76 GuideboardInfo guideboardInfo = new GuideboardInfo(
  77 + param.get("id_eq"),
76 param.get("xl.id_eq"), 78 param.get("xl.id_eq"),
77 null, 79 null,
78 param.get("lpName_eq") 80 param.get("lpName_eq")
src/main/java/com/bsth/entity/Personnel.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
3 import com.bsth.entity.sys.SysUser; 3 import com.bsth.entity.sys.SysUser;
  4 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 5
5 import javax.persistence.*; 6 import javax.persistence.*;
6 import java.util.Date; 7 import java.util.Date;
@@ -21,6 +22,7 @@ import java.util.Date; @@ -21,6 +22,7 @@ import java.util.Date;
21 22
22 @Entity 23 @Entity
23 @Table(name = "bsth_c_personnel") 24 @Table(name = "bsth_c_personnel")
  25 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
24 public class Personnel { 26 public class Personnel {
25 27
26 /** 主键Id */ 28 /** 主键Id */
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java
@@ -13,6 +13,26 @@ public class Operationservice { @@ -13,6 +13,26 @@ public class Operationservice {
13 private String emptMileage;//空驶里程 13 private String emptMileage;//空驶里程
14 14
15 private String sjbc;//实际班次 15 private String sjbc;//实际班次
  16 +
  17 + private String jname;
  18 +
  19 + private String clzbh;
  20 +
  21 + public String getJname() {
  22 + return jname;
  23 + }
  24 +
  25 + public void setJname(String jname) {
  26 + this.jname = jname;
  27 + }
  28 +
  29 + public String getClzbh() {
  30 + return clzbh;
  31 + }
  32 +
  33 + public void setClzbh(String clzbh) {
  34 + this.clzbh = clzbh;
  35 + }
16 36
17 public String getXlName() { 37 public String getXlName() {
18 return xlName; 38 return xlName;
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
@@ -3,6 +3,7 @@ package com.bsth.entity.schedule; @@ -3,6 +3,7 @@ package com.bsth.entity.schedule;
3 import com.bsth.entity.Cars; 3 import com.bsth.entity.Cars;
4 import com.bsth.entity.Line; 4 import com.bsth.entity.Line;
5 import com.bsth.entity.sys.SysUser; 5 import com.bsth.entity.sys.SysUser;
  6 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6 7
7 import javax.persistence.*; 8 import javax.persistence.*;
8 import java.io.Serializable; 9 import java.io.Serializable;
@@ -19,6 +20,7 @@ import java.util.Date; @@ -19,6 +20,7 @@ import java.util.Date;
19 @NamedAttributeNode("cl") 20 @NamedAttributeNode("cl")
20 }) 21 })
21 }) 22 })
  23 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
22 public class CarConfigInfo implements Serializable { 24 public class CarConfigInfo implements Serializable {
23 25
24 /** 主健Id */ 26 /** 主健Id */
@@ -71,6 +73,25 @@ public class CarConfigInfo implements Serializable { @@ -71,6 +73,25 @@ public class CarConfigInfo implements Serializable {
71 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 73 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
72 private Date updateDate; 74 private Date updateDate;
73 75
  76 + public CarConfigInfo() {}
  77 + public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) {
  78 + if (id != null) {
  79 + this.id = Long.parseLong(id.toString());
  80 + }
  81 + if (xlid != null && xlname != null) {
  82 + Line line = new Line();
  83 + line.setId(Integer.valueOf(xlid.toString()));
  84 + line.setName(xlname.toString());
  85 + this.xl = line;
  86 + }
  87 + if (clid != null) {
  88 + Cars cars = new Cars();
  89 + cars.setId(Integer.valueOf(clid.toString()));
  90 + this.cl = cars;
  91 + }
  92 +
  93 + }
  94 +
74 public Long getId() { 95 public Long getId() {
75 return id; 96 return id;
76 } 97 }
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
@@ -4,6 +4,7 @@ import com.bsth.entity.Cars; @@ -4,6 +4,7 @@ import com.bsth.entity.Cars;
4 import com.bsth.entity.Line; 4 import com.bsth.entity.Line;
5 import com.bsth.entity.Personnel; 5 import com.bsth.entity.Personnel;
6 import com.bsth.entity.sys.SysUser; 6 import com.bsth.entity.sys.SysUser;
  7 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
7 import org.hibernate.annotations.Formula; 8 import org.hibernate.annotations.Formula;
8 9
9 import javax.persistence.*; 10 import javax.persistence.*;
@@ -22,6 +23,7 @@ import java.util.Date; @@ -22,6 +23,7 @@ import java.util.Date;
22 @NamedAttributeNode("xl") 23 @NamedAttributeNode("xl")
23 }) 24 })
24 }) 25 })
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
25 public class EmployeeConfigInfo { 27 public class EmployeeConfigInfo {
26 28
27 /** 主键Id */ 29 /** 主键Id */
@@ -67,6 +69,30 @@ public class EmployeeConfigInfo { @@ -67,6 +69,30 @@ public class EmployeeConfigInfo {
67 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 69 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
68 private Date updateDate; 70 private Date updateDate;
69 71
  72 + public EmployeeConfigInfo() {}
  73 +
  74 + public EmployeeConfigInfo(Object id, Object xlid, Object xlname, Object jsyid, Object spyid) {
  75 + if (id != null) {
  76 + this.id = Long.parseLong(id.toString());
  77 + }
  78 + if (xlid != null && xlname != null) {
  79 + Line line = new Line();
  80 + line.setId(Integer.valueOf(xlid.toString()));
  81 + line.setName(xlname.toString());
  82 + this.xl = line;
  83 + }
  84 + if (jsyid != null) {
  85 + Personnel personnel = new Personnel();
  86 + personnel.setId(Integer.valueOf(jsyid.toString()));
  87 + this.jsy = personnel;
  88 + }
  89 + if (spyid != null) {
  90 + Personnel personnel = new Personnel();
  91 + personnel.setId(Integer.valueOf(spyid.toString()));
  92 + this.spy = personnel;
  93 + }
  94 + }
  95 +
70 public Long getId() { 96 public Long getId() {
71 return id; 97 return id;
72 } 98 }
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
@@ -60,7 +60,11 @@ public class GuideboardInfo { @@ -60,7 +60,11 @@ public class GuideboardInfo {
60 60
61 public GuideboardInfo() {} 61 public GuideboardInfo() {}
62 62
63 - public GuideboardInfo(Object xlid, Object lpNo, Object lpName) { 63 + public GuideboardInfo(Object id, Object xlid, Object lpNo, Object lpName) {
  64 + if (id != null) {
  65 + this.id = Long.parseLong(id.toString());
  66 + }
  67 +
64 Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString()); 68 Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString());
65 Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString()); 69 Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString());
66 String lpName_ = lpName == null ? null : String.valueOf(lpName); 70 String lpName_ = lpName == null ? null : String.valueOf(lpName);
@@ -75,11 +79,11 @@ public class GuideboardInfo { @@ -75,11 +79,11 @@ public class GuideboardInfo {
75 this.lpName = lpName_; 79 this.lpName = lpName_;
76 } 80 }
77 81
78 - public GuideboardInfo(Integer xlid, Integer lpNo) {  
79 - this(xlid, lpNo, null); 82 + public GuideboardInfo(Object id, Integer xlid, Integer lpNo) {
  83 + this(id, xlid, lpNo, null);
80 } 84 }
81 - public GuideboardInfo(Integer xlid, String lpName) {  
82 - this(xlid, null, lpName); 85 + public GuideboardInfo(Object id, Integer xlid, String lpName) {
  86 + this(id, xlid, null, lpName);
83 } 87 }
84 88
85 public Long getId() { 89 public Long getId() {
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
@@ -163,8 +163,10 @@ public class SchedulePlanInfo { @@ -163,8 +163,10 @@ public class SchedulePlanInfo {
163 163
164 // TODO:关联的公司名称 164 // TODO:关联的公司名称
165 // TODO:关联的公司编码 165 // TODO:关联的公司编码
  166 + this.gsBm = xl.getCompany();
166 // TODO:关联的分公司名称 167 // TODO:关联的分公司名称
167 // TODO:关联的分公司编码 168 // TODO:关联的分公司编码
  169 + this.fgsBm = xl.getBrancheCompany();
168 // TODO:关联的出场顺序号 170 // TODO:关联的出场顺序号
169 171
170 // 关联的排班计划 172 // 关联的排班计划
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -300,13 +300,13 @@ public class FormsServiceImpl implements FormsService { @@ -300,13 +300,13 @@ public class FormsServiceImpl implements FormsService {
300 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { 300 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
301 Singledata sin = new Singledata(); 301 Singledata sin = new Singledata();
302 sin.setrQ(rq); 302 sin.setrQ(rq);
303 - sin.setgS(arg0.getString("gs_name").toString());  
304 - sin.setxL(arg0.getString("xl_bm").toString());  
305 - sin.setClzbh(arg0.getString("cl_zbh").toString());  
306 - sin.setJsy(arg0.getString("j_gh").toString());  
307 - sin.setjName(arg0.getString("j_name").toString());  
308 - sin.setHyl(arg0.getString("YH").toString());  
309 - sin.setJzl(arg0.getString("JZL").toString()); 303 + sin.setgS(arg0.getString("gs_name"));
  304 + sin.setxL(arg0.getString("xl_bm"));
  305 + sin.setClzbh(arg0.getString("cl_zbh"));
  306 + sin.setJsy(arg0.getString("j_gh"));
  307 + sin.setjName(arg0.getString("j_name"));
  308 + sin.setHyl(arg0.getString("YH"));
  309 + sin.setJzl(arg0.getString("JZL"));
310 // sin.setJzl(arg0.getString(""));//非营业性用油 310 // sin.setJzl(arg0.getString(""));//非营业性用油
311 sin.setJhjl(arg0.getString("JZL")); 311 sin.setJhjl(arg0.getString("JZL"));
312 Map<String, Object> maps = new HashMap<>(); 312 Map<String, Object> maps = new HashMap<>();
@@ -351,18 +351,25 @@ public class FormsServiceImpl implements FormsService { @@ -351,18 +351,25 @@ public class FormsServiceImpl implements FormsService {
351 @Override 351 @Override
352 public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { 352 public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
353 Operationservice op = new Operationservice(); 353 Operationservice op = new Operationservice();
354 - op.setXlName(arg0.getString("xl_name").toString());  
355 - op.setJzl(arg0.getString("JZL").toString());  
356 - op.setXhl(arg0.getString("YH").toString());  
357 - Map<String, Object> maps = new HashMap<>();  
358 - maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,  
359 - endDate);  
360 - op.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString());  
361 - op.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());  
362 - op.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString()); 354 + op.setXlName(arg0.getString("xl_name"));
  355 + op.setJzl(arg0.getString("JZL"));
  356 + op.setXhl(arg0.getString("YH"));
  357 + op.setClzbh(arg0.getString("cl_zbh"));
  358 + op.setJname(arg0.getString("j_name"));
  359 +
363 return op; 360 return op;
364 } 361 }
365 }); 362 });
  363 +
  364 + for(int i=0;i<list.size();i++){
  365 + Operationservice o=list.get(i);
  366 + Map<String, Object> maps = new HashMap<>();
  367 + maps = scheduleRealInfoService.findKMBC1(o.getJname(), o.getClzbh(), startDate,
  368 + endDate);
  369 + o.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString());
  370 + o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
  371 + o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
  372 + }
366 return list; 373 return list;
367 } 374 }
368 375
@@ -388,12 +395,12 @@ public class FormsServiceImpl implements FormsService { @@ -388,12 +395,12 @@ public class FormsServiceImpl implements FormsService {
388 @Override 395 @Override
389 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { 396 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
390 Vehicleloading ve = new Vehicleloading(); 397 Vehicleloading ve = new Vehicleloading();
391 - ve.setrQ(arg0.getString("schedule_date_str").toString());  
392 - ve.setgS(arg0.getString("gs_name").toString());  
393 - ve.setxL(arg0.getString("xl_name").toString());  
394 - ve.setClzbh(arg0.getString("cl_zbh").toString());  
395 - ve.setHyl(arg0.getString("YH").toString());  
396 - ve.setJzl(arg0.getString("JZL").toString()); 398 + ve.setrQ(arg0.getString("schedule_date_str"));
  399 + ve.setgS(arg0.getString("gs_name"));
  400 + ve.setxL(arg0.getString("xl_name"));
  401 + ve.setClzbh(arg0.getString("cl_zbh"));
  402 + ve.setHyl(arg0.getString("YH"));
  403 + ve.setJzl(arg0.getString("JZL"));
397 // ve.setLs(arg0.getString("").toString());//尿素 404 // ve.setLs(arg0.getString("").toString());//尿素
398 Map<String, Object> maps = new HashMap<>(); 405 Map<String, Object> maps = new HashMap<>();
399 maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), 406 maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
@@ -613,4 +620,4 @@ public class FormsServiceImpl implements FormsService { @@ -613,4 +620,4 @@ public class FormsServiceImpl implements FormsService {
613 620
614 return list; 621 return list;
615 } 622 }
616 -} 623 +}
617 \ No newline at end of file 624 \ No newline at end of file
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -1115,7 +1115,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1115,7 +1115,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1115 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 1115 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
1116 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 1116 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
1117 int jhbc = 0,cjbc = 0,ljbc = 0; 1117 int jhbc = 0,cjbc = 0,ljbc = 0;
1118 - double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; 1118 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0,jcclc=0;
1119 float addMileage = 0l,remMileage = 0l; 1119 float addMileage = 0l,remMileage = 0l;
1120 Map<String,Object> map = new HashMap<String, Object>(); 1120 Map<String,Object> map = new HashMap<String, Object>();
1121 for(ScheduleRealInfo scheduleRealInfo : list){ 1121 for(ScheduleRealInfo scheduleRealInfo : list){
@@ -1141,8 +1141,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1141,8 +1141,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1141 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 1141 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1142 //计算营运里程,空驶里程 1142 //计算营运里程,空驶里程
1143 if(childTaskPlans.isEmpty()){ 1143 if(childTaskPlans.isEmpty()){
1144 - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")  
1145 - || scheduleRealInfo.getBcType().equals("venting")){ 1144 + if(scheduleRealInfo.getBcType().equals("in") ||
  1145 + scheduleRealInfo.getBcType().equals("out")){
  1146 + ksgl += tempJhlc;
  1147 + jcclc +=tempJhlc;
  1148 + }else if(scheduleRealInfo.getBcType().equals("venting")){
1146 ksgl += tempJhlc; 1149 ksgl += tempJhlc;
1147 }else{ 1150 }else{
1148 if(scheduleRealInfo.getStatus() != -1){ 1151 if(scheduleRealInfo.getStatus() != -1){
@@ -1177,6 +1180,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1177,6 +1180,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1177 map.put("cjbc", cjbc); 1180 map.put("cjbc", cjbc);
1178 map.put("ljbc", ljbc); 1181 map.put("ljbc", ljbc);
1179 map.put("sjbc", jhbc-cjbc+ljbc); 1182 map.put("sjbc", jhbc-cjbc+ljbc);
  1183 + map.put("jcclc", jcclc);
1180 return map; 1184 return map;
1181 } 1185 }
1182 1186
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
1 package com.bsth.service.schedule; 1 package com.bsth.service.schedule;
2 2
3 import com.bsth.entity.schedule.CarConfigInfo; 3 import com.bsth.entity.schedule.CarConfigInfo;
4 -import com.bsth.service.BaseService;  
5 4
6 /** 5 /**
7 * Created by xu on 16/5/9. 6 * Created by xu on 16/5/9.
8 */ 7 */
9 -public interface CarConfigInfoService extends BaseService<CarConfigInfo, Long> { 8 +public interface CarConfigInfoService extends BService<CarConfigInfo, Long> {
  9 + public void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException;
  10 + public void toggleCancel(Long id) throws ScheduleException;
10 } 11 }
src/main/java/com/bsth/service/schedule/CarConfigInfoServiceImpl.java deleted 100644 → 0
1 -package com.bsth.service.schedule;  
2 -  
3 -import com.bsth.common.ResponseCode;  
4 -import com.bsth.entity.schedule.CarConfigInfo;  
5 -import com.bsth.entity.schedule.rule.ScheduleRule1Flat;  
6 -import com.bsth.repository.schedule.CarConfigInfoRepository;  
7 -import com.bsth.service.impl.BaseServiceImpl;  
8 -import org.springframework.beans.factory.annotation.Autowired;  
9 -import org.springframework.stereotype.Service;  
10 -  
11 -import javax.transaction.Transactional;  
12 -import java.util.*;  
13 -  
14 -/**  
15 - * Created by xu on 16/5/9.  
16 - */  
17 -@Service  
18 -public class CarConfigInfoServiceImpl extends BaseServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService {  
19 - @Autowired  
20 - private CarConfigInfoRepository carConfigInfoRepository;  
21 - @Autowired  
22 - private ScheduleRule1FlatService scheduleRule1FlatService;  
23 -  
24 - @Override  
25 - @Transactional  
26 - public Map<String, Object> delete(Long aLong) {  
27 - // 获取待作废的车辆配置  
28 - CarConfigInfo carConfigInfo = carConfigInfoRepository.findOne(aLong);  
29 - // 查询有无规则使用过此车辆配置  
30 - Map<String, Object> param = new HashMap<>();  
31 - param.put("carConfigInfo.id_eq", carConfigInfo.getId());  
32 - Iterator<ScheduleRule1Flat> scheduleRule1FlatIterator =  
33 - scheduleRule1FlatService.list(param).iterator();  
34 - boolean isExist = false;  
35 - while (scheduleRule1FlatIterator.hasNext()) {  
36 - ScheduleRule1Flat scheduleRule1Flat = scheduleRule1FlatIterator.next();  
37 - if (scheduleRule1Flat.getCarConfigInfo().getId().equals(carConfigInfo.getId())) {  
38 - isExist = true;  
39 - break;  
40 - }  
41 - }  
42 -  
43 - Map<String, Object> map = new HashMap<>();  
44 -  
45 - if (isExist) {  
46 - throw new RuntimeException("车辆配置已被规则使用,不能删除,请先修改规则!");  
47 - } else {  
48 - carConfigInfo.setIsCancel(true);  
49 - map.put("status", ResponseCode.SUCCESS);  
50 - }  
51 -  
52 - return map;  
53 -  
54 - }  
55 -}  
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
1 package com.bsth.service.schedule; 1 package com.bsth.service.schedule;
2 2
3 import com.bsth.entity.schedule.EmployeeConfigInfo; 3 import com.bsth.entity.schedule.EmployeeConfigInfo;
4 -import com.bsth.service.BaseService;  
5 4
6 /** 5 /**
7 * Created by xu on 16/5/10. 6 * Created by xu on 16/5/10.
8 */ 7 */
9 -public interface EmployeeConfigInfoService extends BaseService<EmployeeConfigInfo, Long> { 8 +public interface EmployeeConfigInfoService extends BService<EmployeeConfigInfo, Long> {
  9 + void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  10 + void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException;
  11 + public void toggleCancel(Long id) throws ScheduleException;
10 } 12 }
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoServiceImpl.java deleted 100644 → 0
1 -package com.bsth.service.schedule;  
2 -  
3 -import com.bsth.common.ResponseCode;  
4 -import com.bsth.entity.Line;  
5 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
6 -import com.bsth.entity.schedule.rule.ScheduleRule1Flat;  
7 -import com.bsth.repository.schedule.EmployeeConfigInfoRepository;  
8 -import com.bsth.service.impl.BaseServiceImpl;  
9 -import org.springframework.beans.factory.annotation.Autowired;  
10 -import org.springframework.stereotype.Service;  
11 -  
12 -import javax.transaction.Transactional;  
13 -import java.util.*;  
14 -  
15 -/**  
16 - * Created by xu on 16/5/10.  
17 - */  
18 -@Service  
19 -public class EmployeeConfigInfoServiceImpl extends BaseServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService {  
20 - @Autowired  
21 - private EmployeeConfigInfoRepository employeeConfigInfoRepository;  
22 - @Autowired  
23 - private ScheduleRule1FlatService scheduleRule1FlatService;  
24 -  
25 -  
26 - @Override  
27 - @Transactional  
28 - public Map<String, Object> delete(Long aLong) {  
29 - // 获取待作废的人员配置  
30 - EmployeeConfigInfo employeeConfigInfo = employeeConfigInfoRepository.findOne(aLong);  
31 - // 获取线路  
32 - Line xl = employeeConfigInfo.getXl();  
33 - // 查找线路的规则,比较人员配置信息  
34 - Map<String, Object> param = new HashMap<>();  
35 - param.put("xl.id_eq", xl.getId());  
36 - Iterator<ScheduleRule1Flat> employeeConfigInfoIterator = scheduleRule1FlatService.list(param).iterator();  
37 - List<String> ryConfigIds = new ArrayList<>();  
38 - while (employeeConfigInfoIterator.hasNext()) {  
39 - ScheduleRule1Flat scheduleRule1Flat = employeeConfigInfoIterator.next();  
40 - ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(",")));  
41 - }  
42 -  
43 - Map<String, Object> map = new HashMap<>();  
44 -  
45 - if (ryConfigIds.contains(employeeConfigInfo.getId().toString())) {  
46 - throw new RuntimeException("人员配置已被规则使用,不能删除,请先修改规则!");  
47 - } else {  
48 - employeeConfigInfo.setIsCancel(true);  
49 - map.put("status", ResponseCode.SUCCESS);  
50 - }  
51 -  
52 - return map;  
53 - }  
54 -  
55 -}  
src/main/java/com/bsth/service/schedule/impl/CarConfigInfoServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.schedule.CarConfigInfo;
  4 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  5 +import com.bsth.service.schedule.CarConfigInfoService;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import com.bsth.service.schedule.ScheduleRule1FlatService;
  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.List;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * Created by xu on 16/5/9.
  19 + */
  20 +@Service
  21 +public class CarConfigInfoServiceImpl extends BServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService {
  22 + @Autowired
  23 + private ScheduleRule1FlatService scheduleRule1FlatService;
  24 +
  25 + @Transactional
  26 + public void validate_cars(CarConfigInfo carConfigInfo) throws ScheduleException {
  27 + // 相同车辆不能同时配置
  28 + Map<String, Object> param = new HashMap<>();
  29 + if (carConfigInfo.getId() != null) {
  30 + param.put("id_ne", carConfigInfo.getId());
  31 + }
  32 +
  33 + if (carConfigInfo.getXl() == null ||
  34 + carConfigInfo.getXl().getId() == null ||
  35 + carConfigInfo.getXl().getName() == null) {
  36 + throw new ScheduleException("线路未选择");
  37 + } else {
  38 +// param.put("xl.id_eq", carConfigInfo.getXl().getId());
  39 + if (carConfigInfo.getCl() == null || carConfigInfo.getCl().getId() == null) {
  40 + throw new ScheduleException("车辆未选择");
  41 + } else {
  42 + param.put("cl.id_eq", carConfigInfo.getCl().getId());
  43 + if (!CollectionUtils.isEmpty(list(param))) {
  44 + throw new ScheduleException("车辆已经配置在" + carConfigInfo.getXl().getName() + "线路中!");
  45 + }
  46 + }
  47 + }
  48 +
  49 + }
  50 +
  51 + @Transactional
  52 + @Override
  53 + public void delete(Long aLong) throws ScheduleException {
  54 + toggleCancel(aLong);
  55 + }
  56 +
  57 + @Transactional
  58 + public void toggleCancel(Long id) throws ScheduleException {
  59 + CarConfigInfo carConfigInfo = findById(id);
  60 + Map<String, Object> param = new HashMap<>();
  61 + if (carConfigInfo.getIsCancel()) {
  62 + validate_cars(carConfigInfo);
  63 + carConfigInfo.setIsCancel(false);
  64 + } else {
  65 + param.clear();
  66 + param.put("carConfigInfo.id_eq", carConfigInfo.getId());
  67 + List<ScheduleRule1Flat> scheduleRule1Flats = (List<ScheduleRule1Flat>) scheduleRule1FlatService.list(param);
  68 + if (CollectionUtils.isEmpty(scheduleRule1Flats)) {
  69 + carConfigInfo.setIsCancel(true);
  70 + } else {
  71 + throw new ScheduleException("车辆配置已被规则使用,不能作废,请先修改规则!");
  72 + }
  73 + }
  74 + }
  75 +
  76 +}
src/main/java/com/bsth/service/schedule/impl/EmployeeConfigInfoServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.schedule.EmployeeConfigInfo;
  4 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  5 +import com.bsth.service.schedule.EmployeeConfigInfoService;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import com.bsth.service.schedule.ScheduleRule1FlatService;
  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.*;
  14 +
  15 +/**
  16 + * Created by xu on 16/5/10.
  17 + */
  18 +@Service
  19 +public class EmployeeConfigInfoServiceImpl extends BServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService {
  20 + @Autowired
  21 + private ScheduleRule1FlatService scheduleRule1FlatService;
  22 +
  23 + @Transactional
  24 + @Override
  25 + public void validate_jsy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
  26 + // 驾驶员不能重复配置
  27 + Map<String, Object> param = new HashMap<>();
  28 + if (employeeConfigInfo.getId() != null) {
  29 + param.put("id_ne", employeeConfigInfo.getId());
  30 + }
  31 +
  32 + if (employeeConfigInfo.getXl() == null ||
  33 + employeeConfigInfo.getXl().getId() == null ||
  34 + employeeConfigInfo.getXl().getName() == null) {
  35 + throw new ScheduleException("线路未选择");
  36 + } else {
  37 + if (employeeConfigInfo.getJsy() == null || employeeConfigInfo.getJsy().getId() == null) {
  38 + throw new ScheduleException("驾驶员未选择");
  39 + } else {
  40 + param.put("jsy.id_eq", employeeConfigInfo.getJsy().getId());
  41 + if (!CollectionUtils.isEmpty(list(param))) {
  42 + throw new ScheduleException("驾驶员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!");
  43 + }
  44 + }
  45 + }
  46 + }
  47 +
  48 + @Transactional
  49 + @Override
  50 + public void validate_spy(EmployeeConfigInfo employeeConfigInfo) throws ScheduleException {
  51 + // 售票员不能重复配置
  52 + Map<String, Object> param = new HashMap<>();
  53 + if (employeeConfigInfo.getId() != null) {
  54 + param.put("id_ne", employeeConfigInfo.getId());
  55 + }
  56 +
  57 + if (employeeConfigInfo.getXl() == null ||
  58 + employeeConfigInfo.getXl().getId() == null ||
  59 + employeeConfigInfo.getXl().getName() == null) {
  60 + throw new ScheduleException("线路未选择");
  61 + } else {
  62 + if (employeeConfigInfo.getSpy() == null || employeeConfigInfo.getSpy().getId() == null) {
  63 + throw new ScheduleException("售票员未选择");
  64 + } else {
  65 + param.put("spy.id_eq", employeeConfigInfo.getSpy().getId());
  66 + if (!CollectionUtils.isEmpty(list(param))) {
  67 + throw new ScheduleException("售票员已经配置在" + employeeConfigInfo.getXl().getName() + "线路中!");
  68 + }
  69 + }
  70 + }
  71 + }
  72 +
  73 + @Transactional
  74 + @Override
  75 + public void delete(Long aLong) throws ScheduleException {
  76 + toggleCancel(aLong);
  77 + }
  78 +
  79 + @Transactional
  80 + @Override
  81 + public void toggleCancel(Long id) throws ScheduleException {
  82 + EmployeeConfigInfo employeeConfigInfo = findById(id);
  83 + Map<String, Object> param = new HashMap<>();
  84 + if (employeeConfigInfo.getIsCancel()) {
  85 + validate_jsy(employeeConfigInfo);
  86 + validate_spy(employeeConfigInfo);
  87 + employeeConfigInfo.setIsCancel(false);
  88 + } else {
  89 + param.clear();
  90 + param.put("xl.id_eq", employeeConfigInfo.getXl().getId());
  91 + List<ScheduleRule1Flat> scheduleRule1Flats = (List<ScheduleRule1Flat>) scheduleRule1FlatService.list(param);
  92 + List<String> ryConfigIds = new ArrayList<>();
  93 + for (ScheduleRule1Flat scheduleRule1Flat : scheduleRule1Flats) {
  94 + ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(",")));
  95 + }
  96 +
  97 + if (ryConfigIds.contains(String.valueOf(id))) {
  98 + throw new ScheduleException("人员配置已被规则使用,不能作废,请先修改规则!");
  99 + } else {
  100 + employeeConfigInfo.setIsCancel(true);
  101 + }
  102 + }
  103 + }
  104 +
  105 +}
src/main/resources/application-dev.properties
@@ -6,7 +6,7 @@ spring.jpa.hibernate.ddl-auto= update @@ -6,7 +6,7 @@ spring.jpa.hibernate.ddl-auto= update
6 spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy 6 spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
7 #DATABASE 7 #DATABASE
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 -spring.jpa.show-sql= false 9 +spring.jpa.show-sql= true
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
src/main/resources/static/pages/base/line/js/line-add-form.js
@@ -94,7 +94,7 @@ $(function(){ @@ -94,7 +94,7 @@ $(function(){
94 $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); 94 $('#endStationEndTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
95 95
96 /** get请求获取公司表数据并填充公司下拉框选择值 */ 96 /** get请求获取公司表数据并填充公司下拉框选择值 */
97 - $get('/business/all', {upCode_eq: '77'}, function(array){ 97 + $get('/business/all', {upCode_eq: '88'}, function(array){
98 98
99 /** 公司下拉options属性值 */ 99 /** 公司下拉options属性值 */
100 var options = '<option value="">-- 请选择公司 --</option>'; 100 var options = '<option value="">-- 请选择公司 --</option>';
src/main/resources/static/pages/base/line/js/line-details-info.js
@@ -47,7 +47,7 @@ $(function(){ @@ -47,7 +47,7 @@ $(function(){
47 function selectTemp(callback) { 47 function selectTemp(callback) {
48 48
49 // 填充公司下拉框选择值 49 // 填充公司下拉框选择值
50 - $.get('/business/all', {upCode_eq: '77'}, function(array){ 50 + $.get('/business/all', {upCode_eq: '88'}, function(array){
51 51
52 // 公司下拉options属性值 52 // 公司下拉options属性值
53 var options = '<option value="">-- 请选择公司 --</option>'; 53 var options = '<option value="">-- 请选择公司 --</option>';
src/main/resources/static/pages/base/line/js/line-edit-form.js
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 function selectTemp(callback) { 42 function selectTemp(callback) {
43 43
44 // 填充公司下拉框选择值 44 // 填充公司下拉框选择值
45 - $.get('/business/all', {upCode_eq: '77'}, function(array){ 45 + $.get('/business/all', {upCode_eq: '88'}, function(array){
46 46
47 // 公司下拉options属性值 47 // 公司下拉options属性值
48 var options = '<option value="">-- 请选择公司 --</option>'; 48 var options = '<option value="">-- 请选择公司 --</option>';
src/main/resources/static/pages/base/line/js/line-list-table.js
@@ -202,7 +202,7 @@ @@ -202,7 +202,7 @@
202 } 202 }
203 203
204 /** 填充公司下拉框选择值 */ 204 /** 填充公司下拉框选择值 */
205 - $get('/business/all', {upCode_eq: '77'}, function(array){ 205 + $get('/business/all', {upCode_eq: '88'}, function(array){
206 206
207 // 公司下拉options属性值 207 // 公司下拉options属性值
208 var options = '<option value="">请选择...</option>'; 208 var options = '<option value="">请选择...</option>';
src/main/resources/static/pages/forms/statement/operationservice.html
@@ -112,7 +112,6 @@ @@ -112,7 +112,6 @@
112 text : result[code] 112 text : result[code]
113 }); 113 });
114 } 114 }
115 - console.log(data);  
116 initPinYinSelect2('#line', data, ''); 115 initPinYinSelect2('#line', data, '');
117 116
118 }) 117 })
@@ -199,7 +198,6 @@ @@ -199,7 +198,6 @@
199 obj.updateDate = moment(obj.startDate).format( 198 obj.updateDate = moment(obj.startDate).format(
200 "YYYY-MM-DD HH:mm:ss"); 199 "YYYY-MM-DD HH:mm:ss");
201 }); 200 });
202 - console.log(result);  
203 var operationservice = template('operationservice', { 201 var operationservice = template('operationservice', {
204 list : result 202 list : result
205 }); 203 });
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
@@ -39,14 +39,21 @@ @@ -39,14 +39,21 @@
39 </div> 39 </div>
40 <div style="display: inline-block; margin-left: 24px;"> 40 <div style="display: inline-block; margin-left: 24px;">
41 <span class="item-label" style="width: 80px;">线路: </span> 41 <span class="item-label" style="width: 80px;">线路: </span>
42 - <select class="form-control" name="line" id="line" style="width: 140px;"></select>  
43 - </div>  
44 - <div style="display: inline-block; margin-left: 8px;">  
45 - <span class="item-label" style="width: 80px;">方向: </span>  
46 - <select class="form-control" name="upDown" id="upDown" style="width: 140px;">  
47 - <option value="">请先选择线路</option> 42 + <select class="form-control" name="statu" id="statu" style="width: 140px;">
  43 + <option value="0">多线</option>
  44 + <option value="1">单线</option>
48 </select> 45 </select>
49 </div> 46 </div>
  47 + <div style="display: inline-block; margin-left: 0px;" id="line1">
  48 + <span class="item-label" style="width: 80px;"> - </span>
  49 + <select class="form-control" name="line" id="line" style="width: 140px;"/>
  50 + </div>
  51 +<!-- <div style="display: inline-block; margin-left: 8px;"> -->
  52 +<!-- <span class="item-label" style="width: 80px;">方向: </span> -->
  53 +<!-- <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> -->
  54 +<!-- <option value="">请先选择线路</option> -->
  55 +<!-- </select> -->
  56 +<!-- </div> -->
50 <div style="display: inline-block; margin-left: 10px"> 57 <div style="display: inline-block; margin-left: 10px">
51 <span class="item-label" style="width: 80px;">时刻类型: </span> 58 <span class="item-label" style="width: 80px;">时刻类型: </span>
52 <select class="form-control" name="model" id="model" style="width: 165px;"> 59 <select class="form-control" name="model" id="model" style="width: 165px;">
@@ -62,13 +69,9 @@ @@ -62,13 +69,9 @@
62 <span class="item-label" style="width: 80px;">结束时间: </span> 69 <span class="item-label" style="width: 80px;">结束时间: </span>
63 <input class="form-control" type="text" id="endDate" style="width: 140px;"/> 70 <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
64 </div> 71 </div>
65 - <div style="display: inline-block; margin-left: 10px;">  
66 - <span class="item-label" style="width: 80px;">时间段: </span>  
67 - <input class="form-control" type="text" id="times1" style="width: 60px;"/>  
68 - </div>  
69 - <div style="display: inline-block;">  
70 - <span class="item-label" style="width: 80px;"> - </span>  
71 - <input class="form-control" type="text" id="times2" style="width: 60px;"/> 72 + <div style="display: inline-block; margin-left: 24px" id="lp1">
  73 + <span class="item-label" style="width: 80px;">路牌: </span>
  74 + <select class="form-control" name="lp" id="lp" style="width: 140px;"></select>
72 </div> 75 </div>
73 <div class="form-group" style="margin-left: 10px"> 76 <div class="form-group" style="margin-left: 10px">
74 <input class="btn btn-default" type="button" id="query" value="筛选"/> 77 <input class="btn btn-default" type="button" id="query" value="筛选"/>
@@ -110,7 +113,7 @@ @@ -110,7 +113,7 @@
110 113
111 <script> 114 <script>
112 $(function(){ 115 $(function(){
113 - 116 +
114 // 关闭左侧栏 117 // 关闭左侧栏
115 if (!$('body').hasClass('page-sidebar-closed')) 118 if (!$('body').hasClass('page-sidebar-closed'))
116 $('.menu-toggler.sidebar-toggler').click(); 119 $('.menu-toggler.sidebar-toggler').click();
@@ -123,15 +126,7 @@ @@ -123,15 +126,7 @@
123 format : 'YYYY-MM-DD', 126 format : 'YYYY-MM-DD',
124 locale : 'zh-cn' 127 locale : 'zh-cn'
125 }); 128 });
126 - $("#times1").datetimepicker({  
127 - format : 'HH:mm',  
128 - locale : 'zh-cn'  
129 - });  
130 - $("#times2").datetimepicker({  
131 - format : 'HH:mm',  
132 - locale : 'zh-cn'  
133 - });  
134 - 129 +
135 var d = new Date(); 130 var d = new Date();
136 var year = d.getFullYear(); 131 var year = d.getFullYear();
137 var month = d.getMonth() + 1; 132 var month = d.getMonth() + 1;
@@ -142,10 +137,7 @@ @@ -142,10 +137,7 @@
142 day = "0" + day; 137 day = "0" + day;
143 $("#startDate").val(year + "-" + month + "-" + day); 138 $("#startDate").val(year + "-" + month + "-" + day);
144 $("#endDate").val(year + "-" + month + "-" + day); 139 $("#endDate").val(year + "-" + month + "-" + day);
145 -  
146 - $("#times1").val("06:00");  
147 - $("#times2").val("07:00");  
148 - 140 +
149 var obj = []; 141 var obj = [];
150 $.get('/user/companyData', function(result){ 142 $.get('/user/companyData', function(result){
151 obj = result; 143 obj = result;
@@ -179,26 +171,16 @@ @@ -179,26 +171,16 @@
179 $.get('/basic/lineCode2Name',function(result){ 171 $.get('/basic/lineCode2Name',function(result){
180 var data=[]; 172 var data=[];
181 173
182 - data.push({id: " ", text: "全部线路"});  
183 for(var code in result){ 174 for(var code in result){
184 data.push({id: code, text: result[code]}); 175 data.push({id: code, text: result[code]});
185 } 176 }
186 console.log(data); 177 console.log(data);
187 initPinYinSelect2('#line',data,''); 178 initPinYinSelect2('#line',data,'');
188 179
189 - line = "";  
190 - updateModel(); 180 + line = data[0].id;
191 181
192 - var params = {};  
193 - params['line'] = line;  
194 - $get('/busInterval/getDir', params, function(result){  
195 - dirData = createTreeData(result);  
196 - var options = '<option value="">全部方向</option>';;  
197 - $.each(dirData, function(i, g){  
198 - options += '<option value="'+g.name+'">'+g.name+'</option>';  
199 - });  
200 - $('#upDown').html(options);  
201 - }); 182 + updateModel();
  183 + updateLp("");
202 }) 184 })
203 185
204 $("#query").on("click", function (){ 186 $("#query").on("click", function (){
@@ -206,29 +188,28 @@ @@ -206,29 +188,28 @@
206 }); 188 });
207 189
208 var line = $("#line").val(); 190 var line = $("#line").val();
  191 + var statu = $("#statu").val();
209 var startDate = $("#startDate").val(); 192 var startDate = $("#startDate").val();
210 var endDate = $("#endDate").val(); 193 var endDate = $("#endDate").val();
211 var model = $("#model").val(); 194 var model = $("#model").val();
212 - var times = $("#times1").val() + "-" + $("#times2").val();  
213 - var upDown = $("#upDown").val();  
214 var company = $("#company").val(); 195 var company = $("#company").val();
215 var subCompany = $("#subCompany").val(); 196 var subCompany = $("#subCompany").val();
  197 + var lp = $("#lp").val();
216 function jsDoQuery(pagination){ 198 function jsDoQuery(pagination){
217 var params = {}; 199 var params = {};
218 -// line = $("#line").val(); 200 + line = $("#line").val();
219 startDate = $("#startDate").val(); 201 startDate = $("#startDate").val();
220 endDate = $("#endDate").val(); 202 endDate = $("#endDate").val();
221 model = $("#model").val(); 203 model = $("#model").val();
222 - times = $("#times1").val() + "-" + $("#times2").val();  
223 - upDown = $("#upDown").val();  
224 company = $("#company").val(); 204 company = $("#company").val();
225 subCompany = $("#subCompany").val(); 205 subCompany = $("#subCompany").val();
  206 + lp = $("#lp").val();
  207 + params['lp'] = lp;
226 params['line'] = line; 208 params['line'] = line;
  209 + params['statu'] = statu;
227 params['startDate'] = startDate; 210 params['startDate'] = startDate;
228 params['endDate'] = endDate; 211 params['endDate'] = endDate;
229 params['model'] = model; 212 params['model'] = model;
230 - params['times'] = times;  
231 - params['upDown'] = upDown;  
232 params['company'] = company; 213 params['company'] = company;
233 params['subCompany'] = subCompany; 214 params['subCompany'] = subCompany;
234 params['type'] = "query"; 215 params['type'] = "query";
@@ -254,21 +235,28 @@ @@ -254,21 +235,28 @@
254 // }); 235 // });
255 236
256 237
  238 + $("#lp1").hide();
  239 + $("#line1").hide();
  240 + $("#statu").on("change", function(){
  241 + statu = $("#statu").val();
  242 + if(statu == 0){
  243 + $("#line1").hide();
  244 + $("#lp1").hide();
  245 + }else{
  246 + $("#line1").show();
  247 + $("#lp1").show();
  248 + updateLp("");
  249 + }
  250 + updateModel();
  251 + });
257 $("#line").on("change", function(){ 252 $("#line").on("change", function(){
258 line = $("#line").val(); 253 line = $("#line").val();
259 - if(line == " ")  
260 - line = "";  
261 updateModel(); 254 updateModel();
262 - var params = {};  
263 - params['line'] = line;  
264 - $get('/busInterval/getDir', params, function(result){  
265 - dirData = createTreeData(result);  
266 - var options = '<option value="">全部方向</option>';  
267 - $.each(dirData, function(i, g){  
268 - options += '<option value="'+g.name+'">'+g.name+'</option>';  
269 - });  
270 - $('#upDown').html(options);  
271 - }); 255 + updateLp("");
  256 + });
  257 + $("#model").on("change", function(){
  258 + model = $("#model").val();
  259 + updateLp(model);
272 }); 260 });
273 $('#startDate').on("blur", function(){ 261 $('#startDate').on("blur", function(){
274 startDate = $("#startDate").val(); 262 startDate = $("#startDate").val();
@@ -288,7 +276,10 @@ @@ -288,7 +276,10 @@
288 flag = 1; 276 flag = 1;
289 var treeData = []; 277 var treeData = [];
290 var params = {}; 278 var params = {};
291 - params['line'] = line; 279 + if(statu == 0)
  280 + params['line'] = "";
  281 + if(statu == 1)
  282 + params['line'] = line;
292 params['startDate'] = startDate; 283 params['startDate'] = startDate;
293 params['endDate'] = endDate; 284 params['endDate'] = endDate;
294 $get('/pcpc/getModel', params, function(result){ 285 $get('/pcpc/getModel', params, function(result){
@@ -297,11 +288,26 @@ @@ -297,11 +288,26 @@
297 $.each(treeData, function(i, g){ 288 $.each(treeData, function(i, g){
298 options += '<option value="'+g.id+'">'+g.name+'</option>'; 289 options += '<option value="'+g.id+'">'+g.name+'</option>';
299 }); 290 });
300 - $('#model').html(options)/* .select2() */; 291 + $('#model').html(options);
301 flag = 0; 292 flag = 0;
302 }); 293 });
303 } 294 }
304 295
  296 + function updateLp(ttId){
  297 + var treeData = [];
  298 + var params = {};
  299 + params['line'] = line;
  300 + params['ttId'] = ttId;
  301 + $get('/busInterval/getLp', params, function(result){
  302 + treeData = createTreeData(result);
  303 + var options = '<option value="">全部路牌</option>';
  304 + $.each(treeData, function(i, g){
  305 +// options += '<option value="'+g.id+'">'+g.name+'</option>';
  306 + options += '<option value="'+g.name+'">'+g.name+'</option>';
  307 + });
  308 + $('#lp').html(options);
  309 + });
  310 + }
305 311
306 function _w_table_rowspan(_w_table_id, _w_table_colnum){ 312 function _w_table_rowspan(_w_table_id, _w_table_colnum){
307 _w_table_firsttd = ""; 313 _w_table_firsttd = "";
src/main/resources/static/pages/forms/statement/waybill.html
@@ -338,8 +338,8 @@ @@ -338,8 +338,8 @@
338 <td>{{remMileage}}</td> 338 <td>{{remMileage}}</td>
339 <td colspan="2">临加公里</td> 339 <td colspan="2">临加公里</td>
340 <td>{{addMileage}}</td> 340 <td>{{addMileage}}</td>
341 - <td colspan="2">营运公里</td>  
342 - <td colspan="3">{{yygl}}</td> 341 + <td colspan="3">营运公里</td>
  342 + <td colspan="2">{{yygl}}</td>
343 </tr> 343 </tr>
344 <tr> 344 <tr>
345 <td colspan="2">空驶公里</td> 345 <td colspan="2">空驶公里</td>
@@ -348,8 +348,8 @@ @@ -348,8 +348,8 @@
348 <td>{{realMileage}}</td> 348 <td>{{realMileage}}</td>
349 <td colspan="2">计划班次</td> 349 <td colspan="2">计划班次</td>
350 <td>{{jhbc}}</td> 350 <td>{{jhbc}}</td>
351 - <td colspan="2">烂班班次</td>  
352 - <td colspan="3">{{cjbc}}</td> 351 + <td colspan="3">烂班班次</td>
  352 + <td colspan="2">{{cjbc}}</td>
353 </tr> 353 </tr>
354 <tr> 354 <tr>
355 <td colspan="2">增加班次</td> 355 <td colspan="2">增加班次</td>
@@ -358,8 +358,8 @@ @@ -358,8 +358,8 @@
358 <td>{{sjbc}}</td> 358 <td>{{sjbc}}</td>
359 <td colspan="2"></td> 359 <td colspan="2"></td>
360 <td></td> 360 <td></td>
361 - <td colspan="2"></td>  
362 <td colspan="3"></td> 361 <td colspan="3"></td>
  362 + <td colspan="2"></td>
363 </tr> 363 </tr>
364 </script> 364 </script>
365 <script type="text/html" id="ludan_4"> 365 <script type="text/html" id="ludan_4">
src/main/resources/static/pages/forms/statement/waybillQp.html
@@ -334,32 +334,38 @@ @@ -334,32 +334,38 @@
334 <tr> 334 <tr>
335 <td colspan="2">计划公里</td> 335 <td colspan="2">计划公里</td>
336 <td>{{jhlc}}</td> 336 <td>{{jhlc}}</td>
  337 + <td colspan="2">营运公里</td>
  338 + <td >{{yygl}}</td>
337 <td colspan="2">烂班公里</td> 339 <td colspan="2">烂班公里</td>
338 <td>{{remMileage}}</td> 340 <td>{{remMileage}}</td>
339 - <td colspan="2">临加公里</td>  
340 - <td>{{addMileage}}</td>  
341 - <td colspan="2">营运公里</td>  
342 - <td colspan="3">{{yygl}}</td> 341 + <td colspan="3">空驶公里</td>
  342 + <td colspan="2">{{ksgl}}</td>
  343 +
  344 +
343 </tr> 345 </tr>
344 <tr> 346 <tr>
345 - <td colspan="2">空驶公里</td>  
346 - <td>{{ksgl}}</td>  
347 - <td colspan="2">总公里</td>  
348 - <td>{{realMileage}}</td>  
349 <td colspan="2">计划班次</td> 347 <td colspan="2">计划班次</td>
350 <td>{{jhbc}}</td> 348 <td>{{jhbc}}</td>
351 - <td colspan="2">烂班班次</td>  
352 - <td colspan="3">{{cjbc}}</td> 349 +
  350 + <td colspan="2">进出场公里</td>
  351 + <td>{{jcclc}}</td>
  352 + <td colspan="2">临加公里</td>
  353 + <td>{{addMileage}}</td>
  354 + <td colspan="3">烂班班次</td>
  355 + <td colspan="2">{{cjbc}}</td>
  356 +
353 </tr> 357 </tr>
354 <tr> 358 <tr>
355 - <td colspan="2">增加班次</td>  
356 - <td>{{ljbc}}</td> 359 +
357 <td colspan="2">实际班次</td> 360 <td colspan="2">实际班次</td>
358 <td>{{sjbc}}</td> 361 <td>{{sjbc}}</td>
359 - <td colspan="2"></td>  
360 - <td></td>  
361 - <td colspan="2"></td> 362 + <td colspan="2">总公里</td>
  363 + <td>{{realMileage}}</td>
  364 + <td colspan="2">临加班次</td>
  365 + <td>{{ljbc}}</td>
  366 +
362 <td colspan="3"></td> 367 <td colspan="3"></td>
  368 + <td colspan="2"></td>
363 </tr> 369 </tr>
364 </script> 370 </script>
365 <script type="text/html" id="ludan_4"> 371 <script type="text/html" id="ludan_4">
src/main/resources/static/pages/oil/checkJyryList.html
@@ -75,10 +75,10 @@ @@ -75,10 +75,10 @@
75 <input type="text" id="yyrq" class="form-control form-filter input-sm" name="yyrq"> 75 <input type="text" id="yyrq" class="form-control form-filter input-sm" name="yyrq">
76 </td> 76 </td>
77 <td> 77 <td>
78 -<!-- <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select> --> 78 + <select class="form-control" name="gsdm_like" id="jyryListGsdmId" ></select>
79 </td> 79 </td>
80 <td> 80 <td>
81 -<!-- <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select> --> 81 + <select class="form-control" name="fgsdm_like" id="jyryListFgsdmId" ></select>
82 </td> 82 </td>
83 <td> 83 <td>
84 </td> 84 </td>
@@ -166,7 +166,19 @@ $(function(){ @@ -166,7 +166,19 @@ $(function(){
166 params['jsy']=jsy; 166 params['jsy']=jsy;
167 params['id']=id; 167 params['id']=id;
168 $get('/ylxxb/check', params, function(){ 168 $get('/ylxxb/check', params, function(){
169 - jsDoQuery(null,true); 169 + var cells = $('tr.filter')[0].cells
  170 + ,params1 = {}
  171 + ,name;
  172 + $.each(cells, function(i, cell){
  173 + var items = $('input,select', cell);
  174 + for(var j = 0, item; item = items[j++];){
  175 + name = $(item).attr('name');
  176 + if(name){
  177 + params1[name] = $(item).val();
  178 + }
  179 + }
  180 + });
  181 + jsDoQuery(params1,true);
170 }); 182 });
171 } 183 }
172 }) 184 })
@@ -186,21 +198,22 @@ $(function(){ @@ -186,21 +198,22 @@ $(function(){
186 // jsDoQuery(null, true); 198 // jsDoQuery(null, true);
187 }); 199 });
188 200
189 - var gsqx="";  
190 - var fgsqx=""; 201 +// var gsqx="";
  202 +// var fgsqx="";
191 203
192 $.get('/user/companyData', function(result){ 204 $.get('/user/companyData', function(result){
193 obj = result; 205 obj = result;
194 - var options = '<option value="">请选择</option>'; 206 + var options = '';
  207 +// '<option value="">请选择</option>';
195 for(var i = 0; i < obj.length; i++){ 208 for(var i = 0; i < obj.length; i++){
196 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; 209 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
197 - setFgsqx(obj[i].companyCode);  
198 - gsqx +=obj[i].companyCode+","; 210 +// setFgsqx(obj[i].companyCode);
  211 +// gsqx +=obj[i].companyCode+",";
199 } 212 }
200 $('#jyryListGsdmId').html(options); 213 $('#jyryListGsdmId').html(options);
201 updateCompany(); 214 updateCompany();
202 }); 215 });
203 - function setFgsqx(gs){ 216 + /* function setFgsqx(gs){
204 var company =gs 217 var company =gs
205 var options = ''; 218 var options = '';
206 for(var i = 0; i < obj.length; i++){ 219 for(var i = 0; i < obj.length; i++){
@@ -211,11 +224,12 @@ $(function(){ @@ -211,11 +224,12 @@ $(function(){
211 } 224 }
212 } 225 }
213 } 226 }
214 - } 227 + } */
215 $("#jyryListGsdmId").on("change",updateCompany); 228 $("#jyryListGsdmId").on("change",updateCompany);
216 function updateCompany(){ 229 function updateCompany(){
217 var company = $('#jyryListGsdmId').val(); 230 var company = $('#jyryListGsdmId').val();
218 - var options = '<option value="">请选择</option>'; 231 + var options = '';
  232 +// '<option value="">请选择</option>';
219 for(var i = 0; i < obj.length; i++){ 233 for(var i = 0; i < obj.length; i++){
220 if(obj[i].companyCode == company){ 234 if(obj[i].companyCode == company){
221 var children = obj[i].children; 235 var children = obj[i].children;
@@ -230,7 +244,13 @@ $(function(){ @@ -230,7 +244,13 @@ $(function(){
230 244
231 //提交 245 //提交
232 $('tr.filter .filter-submit').on('click', function(){ 246 $('tr.filter .filter-submit').on('click', function(){
233 - if($("#yyrq").val()!=""){ 247 + var jyryGsdm=$("#jyryListGsdmId").val();
  248 + var jyryFgsdm=$("#jyryListFgsdmId").val();
  249 + if($("#yyrq").val()==""||$("#yyrq").val()==null ){
  250 + layer.msg('请选择日期.');
  251 + }else if(jyryGsdm=="" || jyryGsdm==null ||jyryFgsdm==""||jyryFgsdm==null){
  252 + layer.msg('请选择公司和分公司.');
  253 + }else{
234 var cells = $('tr.filter')[0].cells 254 var cells = $('tr.filter')[0].cells
235 ,params = {} 255 ,params = {}
236 ,name; 256 ,name;
@@ -245,8 +265,6 @@ $(function(){ @@ -245,8 +265,6 @@ $(function(){
245 }); 265 });
246 page = 0; 266 page = 0;
247 jsDoQuery(params, true); 267 jsDoQuery(params, true);
248 - }else{  
249 - layer.msg('请选择日期.');  
250 } 268 }
251 }); 269 });
252 270
@@ -283,7 +301,7 @@ $(function(){ @@ -283,7 +301,7 @@ $(function(){
283 } 301 }
284 params['fgsdm_in']=fgsqx1; 302 params['fgsdm_in']=fgsqx1;
285 } 303 }
286 - } */ 304 + } */
287 305
288 $get('/ylxxb/pagequery' ,params, function(data){ 306 $get('/ylxxb/pagequery' ,params, function(data){
289 $.each(data.dataList, function(i, obj) { 307 $.each(data.dataList, function(i, obj) {
@@ -296,7 +314,7 @@ $(function(){ @@ -296,7 +314,7 @@ $(function(){
296 if(pagination && data.dataList.length > 0){ 314 if(pagination && data.dataList.length > 0){
297 //重新分页 315 //重新分页
298 initPagination = true; 316 initPagination = true;
299 - showPagination(data); 317 + //showPagination(data);
300 } 318 }
301 layer.close(i); 319 layer.close(i);
302 }); 320 });
@@ -355,54 +373,49 @@ $(function(){ @@ -355,54 +373,49 @@ $(function(){
355 }); 373 });
356 374
357 375
358 -});  
359 -//改变状态  
360 -function changeEnabled(id,enabled){  
361 - debugger  
362 - $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){  
363 - jsDoQuery(null, true);  
364 - })  
365 -}  
366 376
367 -//改变状态  
368 -function startOptJsy(id){  
369 - $('#jsy'+id).select2({  
370 - placeholder: '搜索驾驶员...',  
371 - ajax: {  
372 - url: '/personnel/sreachPersonnel',  
373 - dataType: 'json',  
374 - delay: 150,  
375 - data: function(params){  
376 - return{jobCode: params.term}; 377 + //改变状态
  378 + function startOptJsy(id){
  379 + $('#jsy'+id).select2({
  380 + placeholder: '搜索驾驶员...',
  381 + ajax: {
  382 + url: '/personnel/sreachPersonnel',
  383 + dataType: 'json',
  384 + delay: 150,
  385 + data: function(params){
  386 + return{jobCode: params.term};
  387 + },
  388 + processResults: function (data) {
  389 + return {
  390 + results: data
  391 + };
  392 + },
  393 + cache: true
377 }, 394 },
378 - processResults: function (data) {  
379 - return {  
380 - results: data  
381 - };  
382 - },  
383 - cache: true  
384 - },  
385 - templateResult: function(repo){  
386 - if (repo.loading) return repo.text;  
387 - var h = '<span>'+repo.text+'</span>';  
388 - return h;  
389 - },  
390 - escapeMarkup: function (markup) { return markup; },  
391 - minimumInputLength: 1,  
392 - templateSelection: function(repo){  
393 - return repo.text;  
394 - },  
395 - language: {  
396 - noResults: function(){  
397 - return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>';  
398 - },  
399 - inputTooShort : function(e) {  
400 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>';  
401 - },  
402 - searching : function() {  
403 - return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>';  
404 - }  
405 - }  
406 - })  
407 -} 395 + templateResult: function(repo){
  396 + if (repo.loading) return repo.text;
  397 + var h = '<span>'+repo.text+'</span>';
  398 + return h;
  399 + },
  400 + escapeMarkup: function (markup) { return markup; },
  401 + minimumInputLength: 1,
  402 + templateSelection: function(repo){
  403 + return repo.text;
  404 + },
  405 + language: {
  406 + noResults: function(){
  407 + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>';
  408 + },
  409 + inputTooShort : function(e) {
  410 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>';
  411 + },
  412 + searching : function() {
  413 + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>';
  414 + }
  415 + }
  416 + })
  417 + }
  418 +
  419 +});
  420 +
408 </script> 421 </script>
409 \ No newline at end of file 422 \ No newline at end of file
src/main/resources/static/pages/oil/cylList.html
@@ -141,23 +141,24 @@ $(function(){ @@ -141,23 +141,24 @@ $(function(){
141 increaseArea: '20%' 141 increaseArea: '20%'
142 } 142 }
143 143
144 - var gsqx="";  
145 - var fgsqx=""; 144 +// var gsqx="";
  145 +// var fgsqx="";
146 146
147 $.get('/user/companyData', function(result){ 147 $.get('/user/companyData', function(result){
148 obj = result; 148 obj = result;
149 - var options = '<option value="">请选择</option>'; 149 + var options = '';
  150 +// '<option value="">请选择</option>';
150 for(var i = 0; i < obj.length; i++){ 151 for(var i = 0; i < obj.length; i++){
151 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; 152 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
152 - setFgsqx(obj[i].companyCode);  
153 - gsqx +=obj[i].companyCode+","; 153 +// setFgsqx(obj[i].companyCode);
  154 +// gsqx +=obj[i].companyCode+",";
154 } 155 }
155 $('#cylListGsdmId').html(options); 156 $('#cylListGsdmId').html(options);
156 updateCompany(); 157 updateCompany();
157 - jsDoQuery(null,true); 158 +// jsDoQuery(null,true);
158 }); 159 });
159 160
160 - function setFgsqx(gs){ 161 + /* function setFgsqx(gs){
161 var company =gs 162 var company =gs
162 var options = ''; 163 var options = '';
163 for(var i = 0; i < obj.length; i++){ 164 for(var i = 0; i < obj.length; i++){
@@ -168,12 +169,13 @@ $(function(){ @@ -168,12 +169,13 @@ $(function(){
168 } 169 }
169 } 170 }
170 } 171 }
171 - } 172 + } */
172 173
173 $("#cylListGsdmId").on("change",updateCompany); 174 $("#cylListGsdmId").on("change",updateCompany);
174 function updateCompany(){ 175 function updateCompany(){
175 var company = $('#cylListGsdmId').val(); 176 var company = $('#cylListGsdmId').val();
176 - var options = '<option value="">请选择</option>'; 177 + var options = '';
  178 +// '<option value="">请选择</option>';
177 for(var i = 0; i < obj.length; i++){ 179 for(var i = 0; i < obj.length; i++){
178 if(obj[i].companyCode == company){ 180 if(obj[i].companyCode == company){
179 var children = obj[i].children; 181 var children = obj[i].children;
@@ -188,25 +190,31 @@ $(function(){ @@ -188,25 +190,31 @@ $(function(){
188 //重置 190 //重置
189 $('tr.filter .filter-cancel').on('click', function(){ 191 $('tr.filter .filter-cancel').on('click', function(){
190 $('tr.filter input, select').val('').change(); 192 $('tr.filter input, select').val('').change();
191 - jsDoQuery(null, true); 193 +// jsDoQuery(null, true);
192 }); 194 });
193 195
194 //提交 196 //提交
195 $('tr.filter .filter-submit').on('click', function(){ 197 $('tr.filter .filter-submit').on('click', function(){
196 - var cells = $('tr.filter')[0].cells  
197 - ,params = {}  
198 - ,name;  
199 - $.each(cells, function(i, cell){  
200 - var items = $('input,select', cell);  
201 - for(var j = 0, item; item = items[j++];){  
202 - name = $(item).attr('name');  
203 - if(name){  
204 - params[name] = $(item).val(); 198 + var cylGsdm=$("#cylListGsdmId").val();
  199 + var cylFgsdm=$("#cylListFgsdmId").val();
  200 + if(cylGsdm=="" ||cylGsdm ==null ||cylFgsdm=="" ||cylFgsdm ==null){
  201 + layer.msg("请选择公司和分公司");
  202 + }else{
  203 + var cells = $('tr.filter')[0].cells
  204 + ,params = {}
  205 + ,name;
  206 + $.each(cells, function(i, cell){
  207 + var items = $('input,select', cell);
  208 + for(var j = 0, item; item = items[j++];){
  209 + name = $(item).attr('name');
  210 + if(name){
  211 + params[name] = $(item).val();
  212 + }
205 } 213 }
206 - }  
207 - });  
208 - page = 0;  
209 - jsDoQuery(params, true); 214 + });
  215 + page = 0;
  216 + jsDoQuery(params, true);
  217 + }
210 }); 218 });
211 219
212 220
@@ -222,7 +230,7 @@ $(function(){ @@ -222,7 +230,7 @@ $(function(){
222 params['order'] = 'nbbm'; 230 params['order'] = 'nbbm';
223 params['page'] = page; 231 params['page'] = page;
224 var i = 2; 232 var i = 2;
225 - var cylGsdm=$("#cylListGsdmId").val(); 233 + /* var cylGsdm=$("#cylListGsdmId").val();
226 var cylFgsdm=$("#cylListFgsdmId").val(); 234 var cylFgsdm=$("#cylListFgsdmId").val();
227 if(cylGsdm==''|| cylGsdm==null){ 235 if(cylGsdm==''|| cylGsdm==null){
228 params['gsdm_in']=gsqx; 236 params['gsdm_in']=gsqx;
@@ -240,8 +248,7 @@ $(function(){ @@ -240,8 +248,7 @@ $(function(){
240 } 248 }
241 params['fgsdm_in']=fgsqx1; 249 params['fgsdm_in']=fgsqx1;
242 } 250 }
243 - }  
244 - console.log(params); 251 + } */
245 $get('/cyl' ,params, function(data){ 252 $get('/cyl' ,params, function(data){
246 $.each(data.content, function(i, obj) { 253 $.each(data.content, function(i, obj) {
247 obj.updatetime = moment(obj.updatetime).format("YYYY-MM-DD"); 254 obj.updatetime = moment(obj.updatetime).format("YYYY-MM-DD");
src/main/resources/static/pages/oil/jyglList.html
@@ -202,39 +202,25 @@ $(function(){ @@ -202,39 +202,25 @@ $(function(){
202 //重置 202 //重置
203 $('tr.filter .filter-cancel').on('click', function(){ 203 $('tr.filter .filter-cancel').on('click', function(){
204 $('tr.filter input, select').val('').change(); 204 $('tr.filter input, select').val('').change();
205 - if($("#rq").val()!=""){  
206 - var cells = $('tr.filter')[0].cells  
207 - ,params = {}  
208 - ,name;  
209 - $.each(cells, function(i, cell){  
210 - var items = $('input,select', cell);  
211 - for(var j = 0, item; item = items[j++];){  
212 - name = $(item).attr('name');  
213 - if(name){  
214 - params[name] = $(item).val();  
215 - }  
216 - }  
217 - });  
218 - jsDoQuery(params, true);  
219 - }  
220 }); 205 });
221 206
222 207
223 - var gsqx="";  
224 - var fgsqx=""; 208 +// var gsqx="";
  209 +// var fgsqx="";
225 210
226 $.get('/user/companyData', function(result){ 211 $.get('/user/companyData', function(result){
227 obj = result; 212 obj = result;
228 - var options = '<option value="">请选择</option>'; 213 + var options = '';
  214 +// '<option value="">请选择</option>';
229 for(var i = 0; i < obj.length; i++){ 215 for(var i = 0; i < obj.length; i++){
230 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; 216 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
231 - setFgsqx(obj[i].companyCode);  
232 - gsqx +=obj[i].companyCode+","; 217 +// setFgsqx(obj[i].companyCode);
  218 +// gsqx +=obj[i].companyCode+",";
233 } 219 }
234 $('#jyglListGsdmId').html(options); 220 $('#jyglListGsdmId').html(options);
235 updateCompany(); 221 updateCompany();
236 }); 222 });
237 - function setFgsqx(gs){ 223 + /* function setFgsqx(gs){
238 var company =gs 224 var company =gs
239 var options = ''; 225 var options = '';
240 for(var i = 0; i < obj.length; i++){ 226 for(var i = 0; i < obj.length; i++){
@@ -245,11 +231,12 @@ $(function(){ @@ -245,11 +231,12 @@ $(function(){
245 } 231 }
246 } 232 }
247 } 233 }
248 - } 234 + } */
249 $("#jyglListGsdmId").on("change",updateCompany); 235 $("#jyglListGsdmId").on("change",updateCompany);
250 function updateCompany(){ 236 function updateCompany(){
251 var company = $('#jyglListGsdmId').val(); 237 var company = $('#jyglListGsdmId').val();
252 - var options = '<option value="">请选择</option>'; 238 + var options = '';
  239 +// '<option value="">请选择</option>';
253 for(var i = 0; i < obj.length; i++){ 240 for(var i = 0; i < obj.length; i++){
254 if(obj[i].companyCode == company){ 241 if(obj[i].companyCode == company){
255 var children = obj[i].children; 242 var children = obj[i].children;
@@ -262,7 +249,13 @@ $(function(){ @@ -262,7 +249,13 @@ $(function(){
262 } 249 }
263 //提交 250 //提交
264 $('tr.filter .filter-submit').on('click', function(){ 251 $('tr.filter .filter-submit').on('click', function(){
265 - if($("#rq").val()!=""){ 252 + var jyglGsdm=$("#jyglListGsdmId").val();
  253 + var jyglFgsdm=$("#jyglListFgsdmId").val();
  254 + if($("#rq").val()==""||$("#rq").val()==null){
  255 + layer.msg('请选择日期.');
  256 + }else if(jyglGsdm=="" || jyglGsdm==null || jyglFgsdm=="" || jyglFgsdm==null){
  257 + layer.msg('请选择公司和分公司.');
  258 + }else{
266 var cells = $('tr.filter')[0].cells 259 var cells = $('tr.filter')[0].cells
267 ,params = {} 260 ,params = {}
268 ,name; 261 ,name;
@@ -277,8 +270,6 @@ $(function(){ @@ -277,8 +270,6 @@ $(function(){
277 }); 270 });
278 page = 0; 271 page = 0;
279 jsDoQuery(params, true); 272 jsDoQuery(params, true);
280 - }else{  
281 - layer.msg('请选择日期.');  
282 } 273 }
283 }); 274 });
284 275
@@ -296,7 +287,7 @@ $(function(){ @@ -296,7 +287,7 @@ $(function(){
296 params['rq']=$("#rq").val(); 287 params['rq']=$("#rq").val();
297 288
298 var i = 2; 289 var i = 2;
299 - var jyglGsdm=$("#jyglListGsdmId").val(); 290 + /* var jyglGsdm=$("#jyglListGsdmId").val();
300 var jyglFgsdm=$("#jyglListFgsdmId").val(); 291 var jyglFgsdm=$("#jyglListFgsdmId").val();
301 if(jyglGsdm=="" || jyglGsdm==null){ 292 if(jyglGsdm=="" || jyglGsdm==null){
302 params['gsdm_in']=gsqx; 293 params['gsdm_in']=gsqx;
@@ -314,7 +305,7 @@ $(function(){ @@ -314,7 +305,7 @@ $(function(){
314 } 305 }
315 params['fgsdm_in']=fgsqx1; 306 params['fgsdm_in']=fgsqx1;
316 } 307 }
317 - } 308 + } */
318 $get('/cwjy/pagequery' ,params, function(data){ 309 $get('/cwjy/pagequery' ,params, function(data){
319 $.each(data.dataList, function(i, obj) { 310 $.each(data.dataList, function(i, obj) {
320 obj.yyrq = $("#rq").val(); 311 obj.yyrq = $("#rq").val();
src/main/resources/static/pages/oil/jyszList.html
@@ -127,22 +127,23 @@ $(function(){ @@ -127,22 +127,23 @@ $(function(){
127 checkboxClass: 'icheckbox_flat-blue', 127 checkboxClass: 'icheckbox_flat-blue',
128 increaseArea: '20%' 128 increaseArea: '20%'
129 } 129 }
130 - var gsqx="";  
131 - var fgsqx=""; 130 +// var gsqx="";
  131 +// var fgsqx="";
132 $.get('/user/companyData', function(result){ 132 $.get('/user/companyData', function(result){
133 obj = result; 133 obj = result;
134 - var options = '<option value="">请选择</option>'; 134 + var options = '';
  135 +// '<option value="">请选择</option>';
135 for(var i = 0; i < obj.length; i++){ 136 for(var i = 0; i < obj.length; i++){
136 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; 137 options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
137 - setFgsqx(obj[i].companyCode);  
138 - gsqx +=obj[i].companyCode+","; 138 +// setFgsqx(obj[i].companyCode);
  139 +// gsqx +=obj[i].companyCode+",";
139 } 140 }
140 $('#jyszListGsdmId').html(options); 141 $('#jyszListGsdmId').html(options);
141 updateCompany(); 142 updateCompany();
142 - jsDoQuery(null,true); 143 +// jsDoQuery(null,true);
143 }); 144 });
144 145
145 - function setFgsqx(gs){ 146 + /* function setFgsqx(gs){
146 var company =gs 147 var company =gs
147 for(var i = 0; i < obj.length; i++){ 148 for(var i = 0; i < obj.length; i++){
148 if(obj[i].companyCode == company){ 149 if(obj[i].companyCode == company){
@@ -152,7 +153,7 @@ $(function(){ @@ -152,7 +153,7 @@ $(function(){
152 } 153 }
153 } 154 }
154 } 155 }
155 - } 156 + } */
156 $("#jyszListGsdmId").on("change",updateCompany); 157 $("#jyszListGsdmId").on("change",updateCompany);
157 function updateCompany(){ 158 function updateCompany(){
158 var company = $('#jyszListGsdmId').val(); 159 var company = $('#jyszListGsdmId').val();
@@ -160,7 +161,7 @@ $(function(){ @@ -160,7 +161,7 @@ $(function(){
160 for(var i = 0; i < obj.length; i++){ 161 for(var i = 0; i < obj.length; i++){
161 if(obj[i].companyCode == company){ 162 if(obj[i].companyCode == company){
162 var children = obj[i].children; 163 var children = obj[i].children;
163 - options += '<option value="">请选择</option>'; 164 +// options += '<option value="">请选择</option>';
164 for(var j = 0; j < children.length; j++){ 165 for(var j = 0; j < children.length; j++){
165 options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; 166 options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
166 } 167 }
@@ -173,25 +174,31 @@ $(function(){ @@ -173,25 +174,31 @@ $(function(){
173 //重置 174 //重置
174 $('tr.filter .filter-cancel').on('click', function(){ 175 $('tr.filter .filter-cancel').on('click', function(){
175 $('tr.filter input, select').val('').change(); 176 $('tr.filter input, select').val('').change();
176 - jsDoQuery(null, true); 177 + //jsDoQuery(null, true);
177 }); 178 });
178 179
179 //提交 180 //提交
180 $('tr.filter .filter-submit').on('click', function(){ 181 $('tr.filter .filter-submit').on('click', function(){
181 - var cells = $('tr.filter')[0].cells  
182 - ,params = {}  
183 - ,name;  
184 - $.each(cells, function(i, cell){  
185 - var items = $('input,select', cell);  
186 - for(var j = 0, item; item = items[j++];){  
187 - name = $(item).attr('name');  
188 - if(name){  
189 - params[name] = $(item).val(); 182 + var jyszGsdm=$("#jyszListGsdmId").val();
  183 + var jyszFgsdm=$("#jyszListFgsdmId").val();
  184 + if(jyszGsdm=="" || jyszGsdm==null ||jyszFgsdm==""||jyszFgsdm==null){
  185 + layer.msg('请选择公司和分公司.');
  186 + }else{
  187 + var cells = $('tr.filter')[0].cells
  188 + ,params = {}
  189 + ,name;
  190 + $.each(cells, function(i, cell){
  191 + var items = $('input,select', cell);
  192 + for(var j = 0, item; item = items[j++];){
  193 + name = $(item).attr('name');
  194 + if(name){
  195 + params[name] = $(item).val();
  196 + }
190 } 197 }
191 - }  
192 - });  
193 - page = 0;  
194 - jsDoQuery(params, true); 198 + });
  199 + page = 0;
  200 + jsDoQuery(params, true);
  201 + }
195 }); 202 });
196 203
197 /* 204 /*
@@ -205,8 +212,8 @@ $(function(){ @@ -205,8 +212,8 @@ $(function(){
205 //更新时间排序 212 //更新时间排序
206 params['order'] = 'nbbm'; 213 params['order'] = 'nbbm';
207 params['page'] = page; 214 params['page'] = page;
208 - var i = layer.load(2);  
209 - var jyszGsdm=$("#jyszListGsdmId").val(); 215 + var i = 2;
  216 + /* var jyszGsdm=$("#jyszListGsdmId").val();
210 var jyszFgsdm=$("#jyszListFgsdmId").val(); 217 var jyszFgsdm=$("#jyszListFgsdmId").val();
211 if(jyszGsdm==''|| jyszGsdm==null){ 218 if(jyszGsdm==''|| jyszGsdm==null){
212 params['gsdm_in']=gsqx; 219 params['gsdm_in']=gsqx;
@@ -224,7 +231,7 @@ $(function(){ @@ -224,7 +231,7 @@ $(function(){
224 } 231 }
225 params['fgsdm_in']=fgsqx1; 232 params['fgsdm_in']=fgsqx1;
226 } 233 }
227 - } 234 + } */
228 $get('/cwjy' ,params, function(data){ 235 $get('/cwjy' ,params, function(data){
229 $.each(data.content, function(i, obj) { 236 $.each(data.content, function(i, obj) {
230 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD"); 237 obj.createDate = moment(obj.createDate).format("YYYY-MM-DD");
src/main/resources/static/pages/oil/list.html
@@ -58,45 +58,45 @@ @@ -58,45 +58,45 @@
58 id="datatable_ylb"> 58 id="datatable_ylb">
59 <thead> 59 <thead>
60 <tr role="row" class="filter"> 60 <tr role="row" class="filter">
61 - <td colspan="3">  
62 - <!-- 公司:  
63 - <select name="ssgsdm" id="ssgsdm">  
64 - <option value="">请选择...</option>  
65 - <option value="1">可用</option>  
66 - <option value="0">禁用</option>  
67 - </select> --> 61 + <td> 公司:</td>
  62 + <td colspan="2">
  63 +
  64 + <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select>
  65 +
68 </td> 66 </td>
69 <td> 67 <td>
70 - <!-- <select name="fgsdm"> -->  
71 - <!-- <option value="">请选择...</option> -->  
72 - <!-- <option value="1">可用</option> -->  
73 - <!-- <option value="0">禁用</option> -->  
74 - <!-- </select> -->  
75 -  
76 - 日期: 68 + 分公司:
77 </td> 69 </td>
78 <td colspan="2"> 70 <td colspan="2">
  71 +
  72 + <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select>
  73 + </td>
  74 +
  75 + <td>
  76 + 日期:
  77 + </td>
  78 + <td>
79 <input type="text" style="width: 80px" name="rq" id="rq"/> 79 <input type="text" style="width: 80px" name="rq" id="rq"/>
80 </td> 80 </td>
81 - <td colspan="2">  
82 - 线路: 81 + <td >
  82 + 线路:
83 </td> 83 </td>
84 <td colspan="3"> 84 <td colspan="3">
85 <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select> 85 <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
86 &nbsp; 86 &nbsp;
87 </td> 87 </td>
88 - <td colspan="2">  
89 - 内部编码: 88 + <td >
  89 + 内部编码:
90 </td> 90 </td>
91 <td colspan="3"> 91 <td colspan="3">
92 <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select> 92 <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select>
93 </td> 93 </td>
94 <td colspan="4"> 94 <td colspan="4">
95 - <button class="btn btn-sm green btn-outline filter-submit margin-bottom"> 95 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
96 <i class="fa fa-search"></i> 搜索 96 <i class="fa fa-search"></i> 搜索
97 </button> 97 </button>
98 98
99 - <button class="btn btn-sm red btn-outline filter-cancel"> 99 + <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
100 <i class="fa fa-times"></i> 重置 100 <i class="fa fa-times"></i> 重置
101 </button> 101 </button>
102 102
@@ -315,9 +315,6 @@ @@ -315,9 +315,6 @@
315 locale: 'zh-cn' 315 locale: 'zh-cn'
316 }); 316 });
317 317
318 - if ($("#rq").val() != "") {  
319 - jsDoQuery(null, true);  
320 - }  
321 var page = 0, initPagination; 318 var page = 0, initPagination;
322 var icheckOptions = { 319 var icheckOptions = {
323 radioClass: 'iradio_square-blue icheck', 320 radioClass: 'iradio_square-blue icheck',
@@ -331,7 +328,14 @@ @@ -331,7 +328,14 @@
331 328
332 //提交 329 //提交
333 $('tr.filter .filter-submit').on('click', function () { 330 $('tr.filter .filter-submit').on('click', function () {
334 - if ($("#rq").val() != "") { 331 + var ylbGsdm=$("#ylbListGsdmId").val();
  332 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  333 + console.log();
  334 + if ($("#rq").val() == "" || $("#rq").val() ==null){
  335 + layer.msg('请选择日期.');
  336 + }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
  337 + layer.msg('请选择公司和分公司.');
  338 + }else {
335 var cells = $('tr.filter')[0].cells 339 var cells = $('tr.filter')[0].cells
336 , params = {} 340 , params = {}
337 , name; 341 , name;
@@ -346,11 +350,51 @@ @@ -346,11 +350,51 @@
346 }); 350 });
347 page = 0; 351 page = 0;
348 jsDoQuery(params, true); 352 jsDoQuery(params, true);
349 - } else {  
350 - layer.msg('请选择日期.');  
351 - } 353 + }
352 }); 354 });
353 355
  356 +
  357 +// var gsqxdm="";
  358 +
  359 +
  360 + $.get('/user/companyData', function(result){
  361 + obj = result;
  362 + var options="";
  363 +// = '<option value="">请选择</option>';
  364 + for(var i = 0; i < obj.length; i++){
  365 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  366 +// setFgsqx(obj[i].companyCode);
  367 + }
  368 + $('#ylbListGsdmId').html(options);
  369 + updateCompany();
  370 + });
  371 + /* function setFgsqx(gs){
  372 + var company =gs
  373 + var options = '';
  374 + for(var i = 0; i < obj.length; i++){
  375 + if(obj[i].companyCode == company){
  376 + var children = obj[i].children;
  377 + for(var j = 0; j < children.length; j++){
  378 + gsqxdm +=company+""+children[j].code+",";
  379 + }
  380 + }
  381 + }
  382 + } */
  383 + $("#ylbListGsdmId").on("change",updateCompany);
  384 + function updateCompany(){
  385 + var company = $('#ylbListGsdmId').val();
  386 + var options ="";
  387 +// = '<option value="">请选择</option>';
  388 + for(var i = 0; i < obj.length; i++){
  389 + if(obj[i].companyCode == company){
  390 + var children = obj[i].children;
  391 + for(var j = 0; j < children.length; j++){
  392 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  393 + }
  394 + }
  395 + }
  396 + $('#ylbListFgsdmId').html(options);
  397 + }
354 /* 398 /*
355 * 获取数据 p: 要提交的参数, pagination: 是否重新分页 399 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
356 */ 400 */
@@ -362,6 +406,25 @@ @@ -362,6 +406,25 @@
362 params['order'] = 'nbbm'; 406 params['order'] = 'nbbm';
363 params['page'] = page; 407 params['page'] = page;
364 params['rq'] = $("#rq").val(); 408 params['rq'] = $("#rq").val();
  409 +
  410 + /* var ylbGsdm=$("#ylbListGsdmId").val();
  411 + var ylbFgsdm=$("#ylbListFgsdmId").val();
  412 + if(ylbGsdm==''|| ylbGsdm==null){
  413 + params['concat(ssgsdm,fgsdm)_in']=gsqxdm;
  414 + }else{
  415 + if(ylbFgsdm==''||ylbFgsdm==null){
  416 + var fgsqx1='';
  417 + for(var i = 0; i < obj.length; i++){
  418 + if(obj[i].companyCode == ylbGsdm){
  419 + var children = obj[i].children;
  420 + for(var j = 0; j < children.length; j++){
  421 + fgsqx1 +=children[j].code+",";
  422 + }
  423 + }
  424 + }
  425 + params['fgsdm_in']=fgsqx1;
  426 + }
  427 + } */
365 var i = layer.load(2); 428 var i = layer.load(2);
366 $get('/ylb', params, function (data) { 429 $get('/ylb', params, function (data) {
367 $.each(data.content, function (i, obj) { 430 $.each(data.content, function (i, obj) {
src/main/resources/static/pages/report/inoutstation.html
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </div> 36 </div>
37 <div style="display: inline-block;margin-left: 15px;"> 37 <div style="display: inline-block;margin-left: 15px;">
38 <span class="item-label" style="width: 80px;">线路: </span> 38 <span class="item-label" style="width: 80px;">线路: </span>
39 - <select class="form-control" name="line" id="line" onchange="sreachZd()" style="width: 180px;"></select> 39 + <select class="form-control sreach-zd" name="line" id="line" style="width: 180px;"></select>
40 </div> 40 </div>
41 </div> 41 </div>
42 <br/> 42 <br/>
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 <span class="item-label" style="width: 60px;">至: </span> 58 <span class="item-label" style="width: 60px;">至: </span>
59 <input class="form-control" type="text" id="date2" style="width: 180px;"/> 59 <input class="form-control" type="text" id="date2" style="width: 180px;"/>
60 <span class="item-label" style="width: 80px;">站点: </span> 60 <span class="item-label" style="width: 80px;">站点: </span>
61 - <select id="zdlx" onchange="sreachZd()"> 61 + <select id="zdlx" class="sreach-zd" >
62 <option value="">请选择</option> 62 <option value="">请选择</option>
63 <option value="0">上行</option> 63 <option value="0">上行</option>
64 <option value="1">下行</option> 64 <option value="1">下行</option>
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 </div> 68 </div>
69 <div class="form-group" style="display: inline-block;margin-left: 15px;"> 69 <div class="form-group" style="display: inline-block;margin-left: 15px;">
70 <input class="btn btn-default" type="button" id="query" value="查询"/> 70 <input class="btn btn-default" type="button" id="query" value="查询"/>
71 - <input class="btn btn-default" type="button" style="display: none;" onclick="clzd()" id="query2" value="查询"/> 71 + <input class="btn btn-default" type="button" style="display: none;" id="query2" value="查询"/>
72 <input class="btn btn-default" type="button" id="export" value="导出"/> 72 <input class="btn btn-default" type="button" id="export" value="导出"/>
73 <input class="btn btn-default" type="button" id="print" value="打印"/> 73 <input class="btn btn-default" type="button" id="print" value="打印"/>
74 <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> 74 <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
@@ -176,7 +176,6 @@ @@ -176,7 +176,6 @@
176 for(var code in result){ 176 for(var code in result){
177 data.push({id: code, text: result[code]}); 177 data.push({id: code, text: result[code]});
178 } 178 }
179 - console.log(data);  
180 initPinYinSelect2('#line',data,''); 179 initPinYinSelect2('#line',data,'');
181 180
182 }) 181 })
@@ -195,7 +194,6 @@ @@ -195,7 +194,6 @@
195 }else{ 194 }else{
196 $post('/report/queryListBczx',{clzbh:clzbh,date:date,line:line},function(result){ 195 $post('/report/queryListBczx',{clzbh:clzbh,date:date,line:line},function(result){
197 getTime(result); 196 getTime(result);
198 - console.log(result);  
199 var ludan_ll_2 = template('ludan_ll_2',{list:result}); 197 var ludan_ll_2 = template('ludan_ll_2',{list:result});
200 // 把渲染好的模版html文本追加到表格中 198 // 把渲染好的模版html文本追加到表格中
201 $('#forms .ludan_ll_2').html(ludan_ll_2); 199 $('#forms .ludan_ll_2').html(ludan_ll_2);
@@ -279,111 +277,119 @@ @@ -279,111 +277,119 @@
279 return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; 277 return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
280 } 278 }
281 } 279 }
282 - })  
283 -  
284 - });  
285 -  
286 -  
287 - function zdxx(fcsj,ddsj){  
288 - var rq=$("#date").val();  
289 - var line=$("#line").val();  
290 - var nbbm=$("#nbbm").val(); 280 + });
291 281
292 - $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){  
293 - var xlmc="线路: "+$("#select2-line-container").html();  
294 - var clmc="车辆: "+nbbm;  
295 - var rqmc="日期: "+rq;  
296 - var bcmc="班次: "+fcsj+"-"+ddsj;  
297 - $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);  
298 - console.log(result);  
299 - var ludan_ll_1 = template('ludan_ll_1',{list:result});  
300 - // 把渲染好的模版html文本追加到表格中  
301 - $('#forms1 .ludan_ll_1').html(ludan_ll_1); 282 + $("#forms tbody").on("click","tr",function(){
  283 + var rq=$("#date").val();
  284 + var line=$("#line").val();
  285 + var nbbm=$("#nbbm").val();
  286 + var params = new Array();
  287 + if($(this).children().size() < 2){
  288 + return;
  289 + }
  290 +
  291 + $(this).children().each(function(index){
  292 + params[index] = $(this).text();
302 }); 293 });
  294 + var id=params[0].split("\\")[0];
  295 + var fcsj = $('.in_carpark_fcsj[data-id='+id+']', '#forms').html();
  296 + var ddsj= $('.in_carpark_zdsj[data-id='+id+']', '#forms').html();
  297 +
  298 + $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
  299 + var xlmc="线路: "+$("#select2-line-container").html();
  300 + var clmc="车辆: "+nbbm;
  301 + var rqmc="日期: "+rq;
  302 + var bcmc="班次: "+fcsj+"-"+ddsj;
  303 + $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);
  304 + var ludan_ll_1 = template('ludan_ll_1',{list:result});
  305 + // 把渲染好的模版html文本追加到表格中
  306 + $('#forms1 .ludan_ll_1').html(ludan_ll_1);
  307 + });
  308 + })
303 309
304 - }  
305 -  
306 - function clzd(){  
307 - var date1=$("#date1").val();  
308 - var date2=$("#date2").val();  
309 - var line=$("#line").val();  
310 - var zdlx=$("#zdlx").val();  
311 - var zd=$("#zd").val();  
312 - console.log(nbbm);  
313 - if(date1=="" || date1==null){  
314 - layer.msg("请选择时间");  
315 - }else if( line=="" || line==null){  
316 - layer.msg("请选择线路");  
317 - }else if(date2 ==null || date2==""){  
318 - layer.msg("请选择时间");  
319 - }else if(zdlx=="" || zdlx==null){  
320 - layer.msg("请选择方向");  
321 - }else{  
322 - var xlmc="线路: "+$("#select2-line-container").html();  
323 - var rqmc="日期: "+date1+"-"+date2;  
324 - var sxmc="上下行: "+ zdlx;  
325 - var zdmc="";  
326 - if(zd==null || zd==""){  
327 - zdmc="站点: "  
328 - }else{  
329 - zdmc="站点: "+$("#select2-zd-container").html();  
330 - }  
331 - $("#dlzmx").html("到离站详细 "+xlmc+" "+rqmc+" "+sxmc+" "+zdmc);  
332 - $post('/report/queryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){  
333 - console.log(result);  
334 - var ludan_ll_1 = template('ludan_ll_1',{list:result});  
335 - // 把渲染好的模版html文本追加到表格中  
336 - $('#forms1 .ludan_ll_1').html(ludan_ll_1);  
337 - });  
338 - }  
339 - }  
340 -  
341 - function sreachZd(){  
342 - var line = $("#line").val();  
343 - var zdlx = $("#zdlx").val();  
344 - if(line==null|| line =="" || zdlx ==null || zdlx==""){  
345 -  
346 - }else{  
347 - $('#zd').select2({  
348 - placeholder: '搜索站点...',  
349 - ajax: {  
350 - url: '/report/sreachZd',  
351 - dataType: 'json',  
352 - delay: 150,  
353 - data: function(params){  
354 - return{line: line,zdlx:zdlx,zd:params.term}; 310 + $("#query2").click(function(){
  311 + var date1=$("#date1").val();
  312 + var date2=$("#date2").val();
  313 + var line=$("#line").val();
  314 + var zdlx=$("#zdlx").val();
  315 + var zd=$("#zd").val();
  316 + if(date1=="" || date1==null){
  317 + layer.msg("请选择时间");
  318 + }else if( line=="" || line==null){
  319 + layer.msg("请选择线路");
  320 + }else if(date2 ==null || date2==""){
  321 + layer.msg("请选择时间");
  322 + }else if(zdlx=="" || zdlx==null){
  323 + layer.msg("请选择方向");
  324 + }else{
  325 + var xlmc="线路: "+$("#select2-line-container").html();
  326 + var rqmc="日期: "+date1+"-"+date2;
  327 + var sxmc="上下行: "+ zdlx;
  328 + var zdmc="";
  329 + if(zd==null || zd==""){
  330 + zdmc="站点: "
  331 + }else{
  332 + zdmc="站点: "+$("#select2-zd-container").html();
  333 + }
  334 + $("#dlzmx").html("到离站详细 "+xlmc+" "+rqmc+" "+sxmc+" "+zdmc);
  335 + $post('/report/queryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){
  336 + var ludan_ll_1 = template('ludan_ll_1',{list:result});
  337 + // 把渲染好的模版html文本追加到表格中
  338 + $('#forms1 .ludan_ll_1').html(ludan_ll_1);
  339 + });
  340 + }
  341 + })
  342 +
  343 + $(".sreach-zd").click(function(){
  344 + var line = $("#line").val();
  345 + var zdlx = $("#zdlx").val();
  346 + if(line==null|| line =="" || zdlx ==null || zdlx==""){
  347 +
  348 + }else{
  349 + $('#zd').select2({
  350 + placeholder: '搜索站点...',
  351 + ajax: {
  352 + url: '/report/sreachZd',
  353 + dataType: 'json',
  354 + delay: 150,
  355 + data: function(params){
  356 + return{line: line,zdlx:zdlx,zd:params.term};
  357 + },
  358 + processResults: function (data) {
  359 + return {
  360 + results: data
  361 + };
  362 + },
  363 + cache: true
355 }, 364 },
356 - processResults: function (data) {  
357 - return {  
358 - results: data  
359 - };  
360 - },  
361 - cache: true  
362 - },  
363 - templateResult: function(repo){  
364 - if (repo.loading) return repo.text;  
365 - var h = '<span>'+repo.text+'</span>';  
366 - return h;  
367 - },  
368 - escapeMarkup: function (markup) { return markup; },  
369 - minimumInputLength: 1,  
370 - templateSelection: function(repo){  
371 - return repo.text;  
372 - },  
373 - language: {  
374 - noResults: function(){  
375 - return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>';  
376 - },  
377 - inputTooShort : function(e) {  
378 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>';  
379 - },  
380 - searching : function() {  
381 - return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>';  
382 - }  
383 - }  
384 - });  
385 - }  
386 - } 365 + templateResult: function(repo){
  366 + if (repo.loading) return repo.text;
  367 + var h = '<span>'+repo.text+'</span>';
  368 + return h;
  369 + },
  370 + escapeMarkup: function (markup) { return markup; },
  371 + minimumInputLength: 1,
  372 + templateSelection: function(repo){
  373 + return repo.text;
  374 + },
  375 + language: {
  376 + noResults: function(){
  377 + return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>';
  378 + },
  379 + inputTooShort : function(e) {
  380 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>';
  381 + },
  382 + searching : function() {
  383 + return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>';
  384 + }
  385 + }
  386 + });
  387 + }
  388 + })
  389 +
  390 +
  391 + });
  392 +
387 </script> 393 </script>
388 <script type="text/html" id="ludan_ll_1"> 394 <script type="text/html" id="ludan_ll_1">
389 {{each list as obj i}} 395 {{each list as obj i}}
@@ -426,7 +432,7 @@ @@ -426,7 +432,7 @@
426 {{else if obj.status==-1}} 432 {{else if obj.status==-1}}
427 (已烂班 ) 433 (已烂班 )
428 {{else}} 434 {{else}}
429 - <a onclick='zdxx("{{obj.fcsjActual}}","{{obj.zdsjActual}}")'> 435 + <a >
430 ({{obj.fcsjActual}} 436 ({{obj.fcsjActual}}
431 {{if obj.fast>0}} 437 {{if obj.fast>0}}
432 早点 {{obj.fast}}分钟 438 早点 {{obj.fast}}分钟
@@ -436,6 +442,8 @@ @@ -436,6 +442,8 @@
436 整点 442 整点
437 {{/if}} 443 {{/if}}
438 ) 444 )
  445 + <span class="in_carpark_fcsj" data-id="{{i+1}}" style="display:none">{{obj.fcsjActual}}</span>
  446 + <span class="in_carpark_zdsj" data-id="{{i+1}}" style="display:none">{{obj.zdsjActual}}</span>
439 </a> 447 </a>
440 {{/if}} 448 {{/if}}
441 449
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation.js
@@ -37,7 +37,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -37,7 +37,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
37 // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 37 // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证
38 var isParamAll = true; 38 var isParamAll = true;
39 for (var key in paramTemplate) { 39 for (var key in paramTemplate) {
40 - if (!$watch_rvparam_obj[key]) { 40 + if (key != "id" && !$watch_rvparam_obj[key]) { // id去掉
41 isParamAll = false; 41 isParamAll = false;
42 break; 42 break;
43 } 43 }
@@ -83,9 +83,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -83,9 +83,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
83 */ 83 */
84 attr.$observe("remotevparam", function(value) { 84 attr.$observe("remotevparam", function(value) {
85 if (value && value != "") { 85 if (value && value != "") {
86 - if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证  
87 - return;  
88 - } 86 + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
  87 + // return;
  88 + //}
89 $watch_rvparam_obj = JSON.parse(value); 89 $watch_rvparam_obj = JSON.parse(value);
90 $$internal_validate(ngModelCtrl, scope); 90 $$internal_validate(ngModelCtrl, scope);
91 } 91 }
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -105,9 +105,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -105,9 +105,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
105 */ 105 */
106 attr.$observe("remotevparam", function(value) { 106 attr.$observe("remotevparam", function(value) {
107 if (value && value != "") { 107 if (value && value != "") {
108 - if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证  
109 - return;  
110 - } 108 + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
  109 + // return;
  110 + //}
111 $watch_rvparam_obj = JSON.parse(value); 111 $watch_rvparam_obj = JSON.parse(value);
112 $$internal_validate(ngModelCtrl, scope); 112 $$internal_validate(ngModelCtrl, scope);
113 } 113 }
@@ -219,73 +219,73 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidationt2&#39;, [ @@ -219,73 +219,73 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidationt2&#39;, [
219 } 219 }
220 ]); 220 ]);
221 221
222 -/**  
223 - * remoteValidationt3 远程验证指令(监控依赖的model变化)  
224 - * 属性如下:  
225 - * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"  
226 - * remotemodel(必须):关联的model  
227 - * remotemodelcol(必须):关联的model属性  
228 - */  
229 -angular.module('ScheduleApp').directive(  
230 - 'remoteValidation3',  
231 - [  
232 - '$$SearchInfoService_g',  
233 - '$q',  
234 - function($$SearchInfoService_g, $q) {  
235 - return {  
236 - restrict: 'A', // 属性  
237 - require: '^ngModel', // 依赖所属指令的ngModel  
238 - compile: function(tElem, tAttrs) {  
239 - var remotevtype_attr = tAttrs['remotevtype'];  
240 - var remotemodel_attr = tAttrs['remotemodel'];  
241 - var remotemodelcol_attr = tAttrs['remotemodelcol'];  
242 - if (!remotevtype_attr) {  
243 - throw new Error("remotevtype属性必须填写");  
244 - }  
245 - if (!remotemodel_attr) {  
246 - throw new Error("remotemodel属性必须填写");  
247 - }  
248 - if (!remotemodelcol_attr) {  
249 - throw new Error("remotemodelcol属性必须填写");  
250 - }  
251 -  
252 - return {  
253 - pre: function(scope, element, attr) {  
254 -  
255 - },  
256 -  
257 - post: function(scope, element, attr, ngModelCtrl) {  
258 - ngModelCtrl.$asyncValidators.remote =  
259 - function(modelValue, viewValue) {  
260 - var deferred = $q.defer();  
261 -  
262 - // 远端验证service  
263 - var param = JSON.parse(attr['remotemodel']);  
264 - console.log(param);  
265 - param[remotemodelcol_attr] = modelValue;  
266 - $$SearchInfoService_g.validate[remotevtype_attr].remote.do(  
267 - param,  
268 - function(result) {  
269 - if (result.status == "SUCCESS") {  
270 - deferred.resolve();  
271 - } else {  
272 - scope.$remote_msg = result.msg;  
273 - deferred.reject();  
274 - }  
275 - },  
276 - function(result) {  
277 - deferred.reject();  
278 - }  
279 - );  
280 -  
281 - return deferred.promise;  
282 - };  
283 - }  
284 - };  
285 - }  
286 - }  
287 - }  
288 - ] 222 +/**
  223 + * remoteValidationt3 远程验证指令(监控依赖的model变化)
  224 + * 属性如下:
  225 + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
  226 + * remotemodel(必须):关联的model
  227 + * remotemodelcol(必须):关联的model属性
  228 + */
  229 +angular.module('ScheduleApp').directive(
  230 + 'remoteValidation3',
  231 + [
  232 + '$$SearchInfoService_g',
  233 + '$q',
  234 + function($$SearchInfoService_g, $q) {
  235 + return {
  236 + restrict: 'A', // 属性
  237 + require: '^ngModel', // 依赖所属指令的ngModel
  238 + compile: function(tElem, tAttrs) {
  239 + var remotevtype_attr = tAttrs['remotevtype'];
  240 + var remotemodel_attr = tAttrs['remotemodel'];
  241 + var remotemodelcol_attr = tAttrs['remotemodelcol'];
  242 + if (!remotevtype_attr) {
  243 + throw new Error("remotevtype属性必须填写");
  244 + }
  245 + if (!remotemodel_attr) {
  246 + throw new Error("remotemodel属性必须填写");
  247 + }
  248 + if (!remotemodelcol_attr) {
  249 + throw new Error("remotemodelcol属性必须填写");
  250 + }
  251 +
  252 + return {
  253 + pre: function(scope, element, attr) {
  254 +
  255 + },
  256 +
  257 + post: function(scope, element, attr, ngModelCtrl) {
  258 + ngModelCtrl.$asyncValidators.remote =
  259 + function(modelValue, viewValue) {
  260 + var deferred = $q.defer();
  261 +
  262 + // 远端验证service
  263 + var param = JSON.parse(attr['remotemodel']);
  264 + console.log(param);
  265 + param[remotemodelcol_attr] = modelValue;
  266 + $$SearchInfoService_g.validate[remotevtype_attr].remote.do(
  267 + param,
  268 + function(result) {
  269 + if (result.status == "SUCCESS") {
  270 + deferred.resolve();
  271 + } else {
  272 + scope.$remote_msg = result.msg;
  273 + deferred.reject();
  274 + }
  275 + },
  276 + function(result) {
  277 + deferred.reject();
  278 + }
  279 + );
  280 +
  281 + return deferred.promise;
  282 + };
  283 + }
  284 + };
  285 + }
  286 + }
  287 + }
  288 + ]
289 ); 289 );
290 290
291 angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) { 291 angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {
@@ -1698,49 +1698,49 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1698,49 +1698,49 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1698 }; 1698 };
1699 } 1699 }
1700 ]); 1700 ]);
1701 -/**  
1702 - * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选  
1703 - * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够  
1704 - * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:  
1705 - *  
1706 - * // TODO:  
1707 - */  
1708 -angular.module('ScheduleApp').directive('mySelect', [  
1709 - function() {  
1710 - return {  
1711 - restrict: 'E',  
1712 - template: '<div>bioxuxuan</div>',  
1713 - require: 'ngModel',  
1714 - compile: function(tElem, tAttrs) {  
1715 - return {  
1716 - pre: function(scope, element, attr) {  
1717 -  
1718 - },  
1719 - post: function(scope, element, attr, ngModelCtr) {  
1720 - // model -> view  
1721 - ngModelCtr.$formatters.push(function(modelValue) {  
1722 - // 监控model的变化  
1723 - if (typeof modelValue != "undefined") {  
1724 - console.log(modelValue);  
1725 -  
1726 - return modelValue;  
1727 - }  
1728 - });  
1729 -  
1730 - ngModelCtr.$render = function() {  
1731 - if (typeof scope.ctrl.say != "undefined") {  
1732 - element.find('div').css('color', 'red');  
1733 - }  
1734 - };  
1735 -  
1736 - ngModelCtr.$setViewValue("init value");  
1737 -  
1738 -  
1739 - }  
1740 - }  
1741 - }  
1742 - }  
1743 - } 1701 +/**
  1702 + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
  1703 + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
  1704 + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
  1705 + *
  1706 + * // TODO:
  1707 + */
  1708 +angular.module('ScheduleApp').directive('mySelect', [
  1709 + function() {
  1710 + return {
  1711 + restrict: 'E',
  1712 + template: '<div>bioxuxuan</div>',
  1713 + require: 'ngModel',
  1714 + compile: function(tElem, tAttrs) {
  1715 + return {
  1716 + pre: function(scope, element, attr) {
  1717 +
  1718 + },
  1719 + post: function(scope, element, attr, ngModelCtr) {
  1720 + // model -> view
  1721 + ngModelCtr.$formatters.push(function(modelValue) {
  1722 + // 监控model的变化
  1723 + if (typeof modelValue != "undefined") {
  1724 + console.log(modelValue);
  1725 +
  1726 + return modelValue;
  1727 + }
  1728 + });
  1729 +
  1730 + ngModelCtr.$render = function() {
  1731 + if (typeof scope.ctrl.say != "undefined") {
  1732 + element.find('div').css('color', 'red');
  1733 + }
  1734 + };
  1735 +
  1736 + ngModelCtr.$setViewValue("init value");
  1737 +
  1738 +
  1739 + }
  1740 + }
  1741 + }
  1742 + }
  1743 + }
1744 ]); 1744 ]);
1745 1745
1746 /** 1746 /**
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
@@ -204,7 +204,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -204,7 +204,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
204 { 204 {
205 list: { 205 list: {
206 method: 'GET', 206 method: 'GET',
207 - isArray: true 207 + isArray: true,
  208 + transformResponse: function(rs) {
  209 + var dst = angular.fromJson(rs);
  210 + if (dst.status == 'SUCCESS') {
  211 + return dst.data;
  212 + } else {
  213 + return dst; // 业务错误留给控制器处理
  214 + }
  215 + }
208 } 216 }
209 } 217 }
210 ), 218 ),
@@ -328,7 +336,42 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -328,7 +336,42 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
328 } 336 }
329 ) 337 )
330 }, 338 },
331 - 339 + cc_cars: { // 车辆不能重复配置
  340 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
  341 + remote: $resource( // $resource封装对象
  342 + '/cci/validate_cars',
  343 + {},
  344 + {
  345 + do: {
  346 + method: 'GET'
  347 + }
  348 + }
  349 + )
  350 + },
  351 + ec_jsy: { // 驾驶员不能重复配置
  352 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  353 + remote: $resource( // $resource封装对象
  354 + '/eci/validate_jsy',
  355 + {},
  356 + {
  357 + do: {
  358 + method: 'GET'
  359 + }
  360 + }
  361 + )
  362 + },
  363 + ec_spy: { // 售票员不能重复配置
  364 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  365 + remote: $resource( // $resource封装对象
  366 + '/eci/validate_spy',
  367 + {},
  368 + {
  369 + do: {
  370 + method: 'GET'
  371 + }
  372 + }
  373 + )
  374 + },
332 375
333 cde1: { // 车辆设备启用日期验证 376 cde1: { // 车辆设备启用日期验证
334 template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 377 template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
@@ -406,4 +449,3 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun @@ -406,4 +449,3 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
406 }]); 449 }]);
407 450
408 451
409 -  
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
1 -//所有模块service配置 1 +//所有模块service配置
2 // 车辆信息service 2 // 车辆信息service
3 angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { 3 angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
4 return { 4 return {
@@ -81,7 +81,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusInfoManageService_g&#39;, [&#39;$resource&#39;, fu @@ -81,7 +81,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusInfoManageService_g&#39;, [&#39;$resource&#39;, fu
81 } 81 }
82 ) 82 )
83 }; 83 };
84 -}]); 84 +}]);
85 // 车辆设备信息service 85 // 车辆设备信息service
86 angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { 86 angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
87 return $resource( 87 return $resource(
@@ -105,7 +105,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;DeviceInfoManageService_g&#39;, [&#39;$resource&#39;, @@ -105,7 +105,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;DeviceInfoManageService_g&#39;, [&#39;$resource&#39;,
105 } 105 }
106 } 106 }
107 ); 107 );
108 -}]); 108 +}]);
109 // 人员信息service 109 // 人员信息service
110 angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { 110 angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
111 return { 111 return {
@@ -154,30 +154,46 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService_g&#39;, [&#39;$resource @@ -154,30 +154,46 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeInfoManageService_g&#39;, [&#39;$resource
154 ) 154 )
155 }; 155 };
156 }]); 156 }]);
157 -  
158 -// 车辆配置service  
159 -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {  
160 - return {  
161 - rest : $resource(  
162 - '/cci/:id',  
163 - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},  
164 - {  
165 - list: {  
166 - method: 'GET',  
167 - params: {  
168 - page: 0  
169 - }  
170 - },  
171 - get: {  
172 - method: 'GET'  
173 - },  
174 - save: {  
175 - method: 'POST'  
176 - }  
177 - }  
178 - )  
179 - };  
180 -}]); 157 +
  158 +// 车辆配置service
  159 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  160 + return {
  161 + rest : $resource(
  162 + '/cci/:id',
  163 + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},
  164 + {
  165 + list: {
  166 + method: 'GET',
  167 + params: {
  168 + page: 0
  169 + },
  170 + transformResponse: function(rs) {
  171 + var dst = angular.fromJson(rs);
  172 + if (dst.status == 'SUCCESS') {
  173 + return dst.data;
  174 + } else {
  175 + return dst; // 业务错误留给控制器处理
  176 + }
  177 + }
  178 + },
  179 + get: {
  180 + method: 'GET',
  181 + transformResponse: function(rs) {
  182 + var dst = angular.fromJson(rs);
  183 + if (dst.status == 'SUCCESS') {
  184 + return dst.data;
  185 + } else {
  186 + return dst;
  187 + }
  188 + }
  189 + },
  190 + save: {
  191 + method: 'POST'
  192 + }
  193 + }
  194 + )
  195 + };
  196 +}]);
181 // 线路运营统计service 197 // 线路运营统计service
182 angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { 198 angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
183 return $resource( 199 return $resource(
@@ -193,42 +209,58 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusLineInfoStatService_g&#39;, [&#39;$resource&#39;, @@ -193,42 +209,58 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusLineInfoStatService_g&#39;, [&#39;$resource&#39;,
193 } 209 }
194 ); 210 );
195 }]); 211 }]);
196 -  
197 -// 人员配置service  
198 -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {  
199 - return {  
200 - rest : $resource(  
201 - '/eci/:id',  
202 - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'},  
203 - {  
204 - list: {  
205 - method: 'GET',  
206 - params: {  
207 - page: 0  
208 - }  
209 - },  
210 - get: {  
211 - method: 'GET'  
212 - },  
213 - save: {  
214 - method: 'POST'  
215 - },  
216 - delete: {  
217 - method: 'DELETE'  
218 - }  
219 - }  
220 - ),  
221 - validate: $resource( // TODO:  
222 - '/personnel/validate/:type',  
223 - {},  
224 - {  
225 - jobCode: {  
226 - method: 'GET'  
227 - }  
228 - }  
229 - )  
230 - };  
231 -}]); 212 +
  213 +// 人员配置service
  214 +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
  215 + return {
  216 + rest : $resource(
  217 + '/eci/:id',
  218 + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'},
  219 + {
  220 + list: {
  221 + method: 'GET',
  222 + params: {
  223 + page: 0
  224 + },
  225 + transformResponse: function(rs) {
  226 + var dst = angular.fromJson(rs);
  227 + if (dst.status == 'SUCCESS') {
  228 + return dst.data;
  229 + } else {
  230 + return dst; // 业务错误留给控制器处理
  231 + }
  232 + }
  233 + },
  234 + get: {
  235 + method: 'GET',
  236 + transformResponse: function(rs) {
  237 + var dst = angular.fromJson(rs);
  238 + if (dst.status == 'SUCCESS') {
  239 + return dst.data;
  240 + } else {
  241 + return dst;
  242 + }
  243 + }
  244 + },
  245 + save: {
  246 + method: 'POST'
  247 + },
  248 + delete: {
  249 + method: 'DELETE'
  250 + }
  251 + }
  252 + ),
  253 + validate: $resource( // TODO:
  254 + '/personnel/validate/:type',
  255 + {},
  256 + {
  257 + jobCode: {
  258 + method: 'GET'
  259 + }
  260 + }
  261 + )
  262 + };
  263 +}]);
232 // 路牌管理service 264 // 路牌管理service
233 angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { 265 angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {
234 return { 266 return {
@@ -268,7 +300,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;GuideboardManageService_g&#39;, [&#39;$resource&#39;, @@ -268,7 +300,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;GuideboardManageService_g&#39;, [&#39;$resource&#39;,
268 } 300 }
269 ) 301 )
270 }; 302 };
271 -}]); 303 +}]);
272 // 套跑管理service 304 // 套跑管理service
273 angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) { 305 angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) {
274 return { 306 return {
@@ -294,7 +326,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func @@ -294,7 +326,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func
294 } 326 }
295 ) 327 )
296 }; 328 };
297 -}]); 329 +}]);
298 // 排班计划管理service 330 // 排班计划管理service
299 angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) { 331 angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {
300 return { 332 return {
@@ -372,7 +404,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -372,7 +404,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
372 } 404 }
373 ) 405 )
374 }; 406 };
375 -}]); 407 +}]);
376 // 排班管理service 408 // 排班管理service
377 angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) { 409 angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {
378 return { 410 return {
@@ -399,7 +431,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource @@ -399,7 +431,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource
399 ) 431 )
400 }; 432 };
401 }]); 433 }]);
402 - 434 +
403 // 时刻表管理service 435 // 时刻表管理service
404 angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) { 436 angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {
405 return { 437 return {
@@ -490,413 +522,455 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;TimeTableDetailManageService_g&#39;, [&#39;$resou @@ -490,413 +522,455 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;TimeTableDetailManageService_g&#39;, [&#39;$resou
490 522
491 // TODO:导入数据 523 // TODO:导入数据
492 }; 524 };
493 -}]);  
494 -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用  
495 -  
496 -// 文件下载服务  
497 -angular.module('ScheduleApp').factory('FileDownload_g', function() {  
498 - return {  
499 - downloadFile: function (data, mimeType, fileName) {  
500 - var success = false;  
501 - var blob = new Blob([data], { type: mimeType });  
502 - try {  
503 - if (navigator.msSaveBlob)  
504 - navigator.msSaveBlob(blob, fileName);  
505 - else {  
506 - // Try using other saveBlob implementations, if available  
507 - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;  
508 - if (saveBlob === undefined) throw "Not supported";  
509 - saveBlob(blob, fileName);  
510 - }  
511 - success = true;  
512 - } catch (ex) {  
513 - console.log("saveBlob method failed with the following exception:");  
514 - console.log(ex);  
515 - }  
516 -  
517 - if (!success) {  
518 - // Get the blob url creator  
519 - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;  
520 - if (urlCreator) {  
521 - // Try to use a download link  
522 - var link = document.createElement('a');  
523 - if ('download' in link) {  
524 - // Try to simulate a click  
525 - try {  
526 - // Prepare a blob URL  
527 - var url = urlCreator.createObjectURL(blob);  
528 - link.setAttribute('href', url);  
529 -  
530 - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)  
531 - link.setAttribute("download", fileName);  
532 -  
533 - // Simulate clicking the download link  
534 - var event = document.createEvent('MouseEvents');  
535 - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);  
536 - link.dispatchEvent(event);  
537 - success = true;  
538 -  
539 - } catch (ex) {  
540 - console.log("Download link method with simulated click failed with the following exception:");  
541 - console.log(ex);  
542 - }  
543 - }  
544 -  
545 - if (!success) {  
546 - // Fallback to window.location method  
547 - try {  
548 - // Prepare a blob URL  
549 - // Use application/octet-stream when using window.location to force download  
550 - var url = urlCreator.createObjectURL(blob);  
551 - window.location = url;  
552 - console.log("Download link method with window.location succeeded");  
553 - success = true;  
554 - } catch (ex) {  
555 - console.log("Download link method with window.location failed with the following exception:");  
556 - console.log(ex);  
557 - }  
558 - }  
559 - }  
560 - }  
561 -  
562 - if (!success) {  
563 - // Fallback to window.open method  
564 - console.log("No methods worked for saving the arraybuffer, using last resort window.open");  
565 - window.open("", '_blank', '');  
566 - }  
567 - }  
568 - };  
569 -});  
570 -  
571 -  
572 -/**  
573 - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。  
574 - * 1、compile阶段使用的属性如下:  
575 - * required:用于和表单验证连接,指定成required="true"才有效。  
576 - * 2、link阶段使用的属性如下  
577 - * model:关联的模型对象  
578 - * name:表单验证时需要的名字  
579 - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加  
580 - * modelcolname1:关联的模型字段名字1(一般应该是编码字段)  
581 - * modelcolname2:关联的模型字段名字2(一般应该是名字字段)  
582 - * datacolname1;内部数据对应的字段名字1(与模型字段1对应)  
583 - * datacolname2:内部数据对应的字段名字2(与模型字段2对应)  
584 - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用  
585 - * placeholder:select placeholder字符串描述  
586 - *  
587 - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。  
588 - * $$SearchInfoService_g,内部使用的数据服务  
589 - */  
590 -// saSelect2指令使用的内部信service  
591 -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {  
592 - return {  
593 - xl: $resource(  
594 - '/line/:type',  
595 - {order: 'name', direction: 'ASC'},  
596 - {  
597 - list: {  
598 - method: 'GET',  
599 - isArray: true  
600 - }  
601 - }  
602 - ),  
603 - xlinfo: $resource(  
604 - '/lineInformation/:type',  
605 - {order: 'line.name', direction: 'ASC'},  
606 - {  
607 - list: {  
608 - method: 'GET',  
609 - isArray: true  
610 - }  
611 - }  
612 - ),  
613 - zd: $resource(  
614 - '/stationroute/stations',  
615 - {order: 'stationCode', direction: 'ASC'},  
616 - {  
617 - list: {  
618 - method: 'GET',  
619 - isArray: true  
620 - }  
621 - }  
622 - ),  
623 - tcc: $resource(  
624 - '/carpark/:type',  
625 - {order: 'parkCode', direction: 'ASC'},  
626 - {  
627 - list: {  
628 - method: 'GET',  
629 - isArray: true  
630 - }  
631 - }  
632 - ),  
633 - ry: $resource(  
634 - '/personnel/:type',  
635 - {order: 'personnelName', direction: 'ASC'},  
636 - {  
637 - list: {  
638 - method: 'GET',  
639 - isArray: true  
640 - }  
641 - }  
642 - ),  
643 - cl: $resource(  
644 - '/cars/:type',  
645 - {order: "insideCode", direction: 'ASC'},  
646 - {  
647 - list: {  
648 - method: 'GET',  
649 - isArray: true  
650 - }  
651 - }  
652 - ),  
653 - ttInfo: $resource(  
654 - '/tic/:type',  
655 - {order: "name", direction: 'ASC'},  
656 - {  
657 - list: {  
658 - method: 'GET',  
659 - isArray: true  
660 - }  
661 - }  
662 - ),  
663 - lpInfo: $resource(  
664 - '/gic/ttlpnames',  
665 - {order: "lpName", direction: 'ASC'},  
666 - {  
667 - list: {  
668 - method: 'GET',  
669 - isArray: true  
670 - }  
671 - }  
672 - ),  
673 - lpInfo2: $resource(  
674 - '/gic/:type',  
675 - {order: "lpName", direction: 'ASC'},  
676 - {  
677 - list: {  
678 - method: 'GET',  
679 - isArray: true  
680 - }  
681 - }  
682 - ),  
683 - cci: $resource(  
684 - '/cci/cars',  
685 - {},  
686 - {  
687 - list: {  
688 - method: 'GET',  
689 - isArray: true  
690 - }  
691 - }  
692 -  
693 - ),  
694 - cci2: $resource(  
695 - '/cci/:type',  
696 - {},  
697 - {  
698 - list: {  
699 - method: 'GET',  
700 - isArray: true  
701 - }  
702 - }  
703 - ),  
704 - cci3: $resource(  
705 - '/cci/cars2',  
706 - {},  
707 - {  
708 - list: {  
709 - method: 'GET',  
710 - isArray: true  
711 - }  
712 - }  
713 -  
714 - ),  
715 - eci: $resource(  
716 - '/eci/jsy',  
717 - {},  
718 - {  
719 - list: {  
720 - method: 'GET',  
721 - isArray: true  
722 - }  
723 - }  
724 - ),  
725 - eci2: $resource(  
726 - '/eci/spy',  
727 - {},  
728 - {  
729 - list: {  
730 - method: 'GET',  
731 - isArray: true  
732 - }  
733 - }  
734 - ),  
735 - eci3: $resource(  
736 - '/eci/:type',  
737 - {},  
738 - {  
739 - list: {  
740 - method: 'GET',  
741 - isArray: true  
742 - }  
743 - }  
744 - ),  
745 -  
746 -  
747 - validate: { // remoteValidation指令用到的resource  
748 - gbv1: { // 路牌序号验证  
749 - template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'},  
750 - remote: $resource(  
751 - '/gic/validate1',  
752 - {},  
753 - {  
754 - do: {  
755 - method: 'GET'  
756 - }  
757 - }  
758 - )  
759 - },  
760 - gbv2: { // 路牌名称验证  
761 - template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'},  
762 - remote: $resource(  
763 - '/gic/validate2',  
764 - {},  
765 - {  
766 - do: {  
767 - method: 'GET'  
768 - }  
769 - }  
770 - )  
771 - },  
772 -  
773 - cars_zbh: { // 自编号验证  
774 - template: {'insideCode_eq': '-1'}, // 查询参数模版  
775 - remote: $resource( // $resource封装对象  
776 - '/cars_sc/validate_zbh',  
777 - {},  
778 - {  
779 - do: {  
780 - method: 'GET'  
781 - }  
782 - }  
783 - )  
784 - },  
785 -  
786 - cars_sbbh: { // 验证设备编号  
787 - template: {'equipmentCode_eq': '-1'}, // 查询参数模版  
788 - remote: $resource( // $resource封装对象  
789 - '/cars_sc/validate_sbbh',  
790 - {},  
791 - {  
792 - do: {  
793 - method: 'GET'  
794 - }  
795 - }  
796 - )  
797 - },  
798 -  
799 - cars_clbh: { // 车辆编号验证  
800 - template: {'carCode_eq': '-1'}, // 查询参数模版  
801 - remote: $resource( // $resource封装对象  
802 - '/cars_sc/validate_clbh',  
803 - {},  
804 - {  
805 - do: {  
806 - method: 'GET'  
807 - }  
808 - }  
809 - )  
810 - },  
811 -  
812 - cars_cph: { // 车牌号验证  
813 - template: {'carPlate_eq': '-1'}, // 查询参数模版  
814 - remote: $resource( // $resource封装对象  
815 - '/cars_sc/validate_cph',  
816 - {},  
817 - {  
818 - do: {  
819 - method: 'GET'  
820 - }  
821 - }  
822 - )  
823 - },  
824 -  
825 -  
826 - cde1: { // 车辆设备启用日期验证  
827 - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒  
828 - remote: $resource( // $resource封装对象  
829 - '/cde//validate/qyrq',  
830 - {},  
831 - {  
832 - do: {  
833 - method: 'GET'  
834 - }  
835 - }  
836 - )  
837 - },  
838 - ttc1: { // 时刻表名字验证  
839 - template: {'xl.id_eq': -1, 'name_eq': 'ddd'},  
840 - remote: $resource( // $resource封装对象  
841 - '/tic/validate/equale',  
842 - {},  
843 - {  
844 - do: {  
845 - method: 'GET'  
846 - }  
847 - }  
848 - )  
849 - },  
850 - sheet: { // 时刻表sheet工作区验证  
851 - template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},  
852 - remote: $resource( // $resource封装对象  
853 - '/tidc/validate/sheet',  
854 - {},  
855 - {  
856 - do: {  
857 - method: 'POST',  
858 - headers: {  
859 - 'Content-Type': 'application/x-www-form-urlencoded'  
860 - },  
861 - transformRequest: function(obj) {  
862 - var str = [];  
863 - for (var p in obj) {  
864 - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));  
865 - }  
866 - return str.join("&");  
867 - }  
868 - }  
869 - }  
870 - )  
871 - },  
872 - sheetli: { // 时刻表线路标准验证  
873 - template: {'lineinfoid': -1},  
874 - remote: $resource( // $resource封装对象  
875 - '/tidc/validate/lineinfo',  
876 - {},  
877 - {  
878 - do: {  
879 - method: 'GET'  
880 - }  
881 - }  
882 - )  
883 - }  
884 - }  
885 -  
886 - //validate: $resource(  
887 - // '/cars/validate/:type',  
888 - // {},  
889 - // {  
890 - // insideCode: {  
891 - // method: 'GET'  
892 - // }  
893 - // }  
894 - //)  
895 -  
896 -  
897 -  
898 - }  
899 -}]);  
900 -  
901 -  
902 - 525 +}]);
  526 +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
  527 +
  528 +// 文件下载服务
  529 +angular.module('ScheduleApp').factory('FileDownload_g', function() {
  530 + return {
  531 + downloadFile: function (data, mimeType, fileName) {
  532 + var success = false;
  533 + var blob = new Blob([data], { type: mimeType });
  534 + try {
  535 + if (navigator.msSaveBlob)
  536 + navigator.msSaveBlob(blob, fileName);
  537 + else {
  538 + // Try using other saveBlob implementations, if available
  539 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  540 + if (saveBlob === undefined) throw "Not supported";
  541 + saveBlob(blob, fileName);
  542 + }
  543 + success = true;
  544 + } catch (ex) {
  545 + console.log("saveBlob method failed with the following exception:");
  546 + console.log(ex);
  547 + }
  548 +
  549 + if (!success) {
  550 + // Get the blob url creator
  551 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  552 + if (urlCreator) {
  553 + // Try to use a download link
  554 + var link = document.createElement('a');
  555 + if ('download' in link) {
  556 + // Try to simulate a click
  557 + try {
  558 + // Prepare a blob URL
  559 + var url = urlCreator.createObjectURL(blob);
  560 + link.setAttribute('href', url);
  561 +
  562 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  563 + link.setAttribute("download", fileName);
  564 +
  565 + // Simulate clicking the download link
  566 + var event = document.createEvent('MouseEvents');
  567 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  568 + link.dispatchEvent(event);
  569 + success = true;
  570 +
  571 + } catch (ex) {
  572 + console.log("Download link method with simulated click failed with the following exception:");
  573 + console.log(ex);
  574 + }
  575 + }
  576 +
  577 + if (!success) {
  578 + // Fallback to window.location method
  579 + try {
  580 + // Prepare a blob URL
  581 + // Use application/octet-stream when using window.location to force download
  582 + var url = urlCreator.createObjectURL(blob);
  583 + window.location = url;
  584 + console.log("Download link method with window.location succeeded");
  585 + success = true;
  586 + } catch (ex) {
  587 + console.log("Download link method with window.location failed with the following exception:");
  588 + console.log(ex);
  589 + }
  590 + }
  591 + }
  592 + }
  593 +
  594 + if (!success) {
  595 + // Fallback to window.open method
  596 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  597 + window.open("", '_blank', '');
  598 + }
  599 + }
  600 + };
  601 +});
  602 +
  603 +
  604 +/**
  605 + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
  606 + * 1、compile阶段使用的属性如下:
  607 + * required:用于和表单验证连接,指定成required="true"才有效。
  608 + * 2、link阶段使用的属性如下
  609 + * model:关联的模型对象
  610 + * name:表单验证时需要的名字
  611 + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  612 + * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
  613 + * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
  614 + * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
  615 + * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
  616 + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
  617 + * placeholder:select placeholder字符串描述
  618 + *
  619 + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
  620 + * $$SearchInfoService_g,内部使用的数据服务
  621 + */
  622 +// saSelect2指令使用的内部信service
  623 +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
  624 + return {
  625 + xl: $resource(
  626 + '/line/:type',
  627 + {order: 'name', direction: 'ASC'},
  628 + {
  629 + list: {
  630 + method: 'GET',
  631 + isArray: true
  632 + }
  633 + }
  634 + ),
  635 + xlinfo: $resource(
  636 + '/lineInformation/:type',
  637 + {order: 'line.name', direction: 'ASC'},
  638 + {
  639 + list: {
  640 + method: 'GET',
  641 + isArray: true
  642 + }
  643 + }
  644 + ),
  645 + zd: $resource(
  646 + '/stationroute/stations',
  647 + {order: 'stationCode', direction: 'ASC'},
  648 + {
  649 + list: {
  650 + method: 'GET',
  651 + isArray: true
  652 + }
  653 + }
  654 + ),
  655 + tcc: $resource(
  656 + '/carpark/:type',
  657 + {order: 'parkCode', direction: 'ASC'},
  658 + {
  659 + list: {
  660 + method: 'GET',
  661 + isArray: true
  662 + }
  663 + }
  664 + ),
  665 + ry: $resource(
  666 + '/personnel/:type',
  667 + {order: 'personnelName', direction: 'ASC'},
  668 + {
  669 + list: {
  670 + method: 'GET',
  671 + isArray: true
  672 + }
  673 + }
  674 + ),
  675 + cl: $resource(
  676 + '/cars/:type',
  677 + {order: "insideCode", direction: 'ASC'},
  678 + {
  679 + list: {
  680 + method: 'GET',
  681 + isArray: true
  682 + }
  683 + }
  684 + ),
  685 + ttInfo: $resource(
  686 + '/tic/:type',
  687 + {order: "name", direction: 'ASC'},
  688 + {
  689 + list: {
  690 + method: 'GET',
  691 + isArray: true
  692 + }
  693 + }
  694 + ),
  695 + lpInfo: $resource(
  696 + '/gic/ttlpnames',
  697 + {order: "lpName", direction: 'ASC'},
  698 + {
  699 + list: {
  700 + method: 'GET',
  701 + isArray: true
  702 + }
  703 + }
  704 + ),
  705 + lpInfo2: $resource(
  706 + '/gic/:type',
  707 + {order: "lpName", direction: 'ASC'},
  708 + {
  709 + list: {
  710 + method: 'GET',
  711 + isArray: true
  712 + }
  713 + }
  714 + ),
  715 + cci: $resource(
  716 + '/cci/cars',
  717 + {},
  718 + {
  719 + list: {
  720 + method: 'GET',
  721 + isArray: true
  722 + }
  723 + }
  724 +
  725 + ),
  726 + cci2: $resource(
  727 + '/cci/:type',
  728 + {},
  729 + {
  730 + list: {
  731 + method: 'GET',
  732 + isArray: true,
  733 + transformResponse: function(rs) {
  734 + var dst = angular.fromJson(rs);
  735 + if (dst.status == 'SUCCESS') {
  736 + return dst.data;
  737 + } else {
  738 + return dst; // 业务错误留给控制器处理
  739 + }
  740 + }
  741 + }
  742 + }
  743 + ),
  744 + cci3: $resource(
  745 + '/cci/cars2',
  746 + {},
  747 + {
  748 + list: {
  749 + method: 'GET',
  750 + isArray: true
  751 + }
  752 + }
  753 +
  754 + ),
  755 + eci: $resource(
  756 + '/eci/jsy',
  757 + {},
  758 + {
  759 + list: {
  760 + method: 'GET',
  761 + isArray: true
  762 + }
  763 + }
  764 + ),
  765 + eci2: $resource(
  766 + '/eci/spy',
  767 + {},
  768 + {
  769 + list: {
  770 + method: 'GET',
  771 + isArray: true
  772 + }
  773 + }
  774 + ),
  775 + eci3: $resource(
  776 + '/eci/:type',
  777 + {},
  778 + {
  779 + list: {
  780 + method: 'GET',
  781 + isArray: true
  782 + }
  783 + }
  784 + ),
  785 +
  786 +
  787 + validate: { // remoteValidation指令用到的resource
  788 + gbv1: { // 路牌序号验证
  789 + template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'},
  790 + remote: $resource(
  791 + '/gic/validate1',
  792 + {},
  793 + {
  794 + do: {
  795 + method: 'GET'
  796 + }
  797 + }
  798 + )
  799 + },
  800 + gbv2: { // 路牌名称验证
  801 + template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'},
  802 + remote: $resource(
  803 + '/gic/validate2',
  804 + {},
  805 + {
  806 + do: {
  807 + method: 'GET'
  808 + }
  809 + }
  810 + )
  811 + },
  812 +
  813 + cars_zbh: { // 自编号验证
  814 + template: {'insideCode_eq': '-1'}, // 查询参数模版
  815 + remote: $resource( // $resource封装对象
  816 + '/cars_sc/validate_zbh',
  817 + {},
  818 + {
  819 + do: {
  820 + method: 'GET'
  821 + }
  822 + }
  823 + )
  824 + },
  825 +
  826 + cars_sbbh: { // 验证设备编号
  827 + template: {'equipmentCode_eq': '-1'}, // 查询参数模版
  828 + remote: $resource( // $resource封装对象
  829 + '/cars_sc/validate_sbbh',
  830 + {},
  831 + {
  832 + do: {
  833 + method: 'GET'
  834 + }
  835 + }
  836 + )
  837 + },
  838 +
  839 + cars_clbh: { // 车辆编号验证
  840 + template: {'carCode_eq': '-1'}, // 查询参数模版
  841 + remote: $resource( // $resource封装对象
  842 + '/cars_sc/validate_clbh',
  843 + {},
  844 + {
  845 + do: {
  846 + method: 'GET'
  847 + }
  848 + }
  849 + )
  850 + },
  851 +
  852 + cars_cph: { // 车牌号验证
  853 + template: {'carPlate_eq': '-1'}, // 查询参数模版
  854 + remote: $resource( // $resource封装对象
  855 + '/cars_sc/validate_cph',
  856 + {},
  857 + {
  858 + do: {
  859 + method: 'GET'
  860 + }
  861 + }
  862 + )
  863 + },
  864 + cc_cars: { // 车辆不能重复配置
  865 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
  866 + remote: $resource( // $resource封装对象
  867 + '/cci/validate_cars',
  868 + {},
  869 + {
  870 + do: {
  871 + method: 'GET'
  872 + }
  873 + }
  874 + )
  875 + },
  876 + ec_jsy: { // 驾驶员不能重复配置
  877 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  878 + remote: $resource( // $resource封装对象
  879 + '/eci/validate_jsy',
  880 + {},
  881 + {
  882 + do: {
  883 + method: 'GET'
  884 + }
  885 + }
  886 + )
  887 + },
  888 + ec_spy: { // 售票员不能重复配置
  889 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  890 + remote: $resource( // $resource封装对象
  891 + '/eci/validate_spy',
  892 + {},
  893 + {
  894 + do: {
  895 + method: 'GET'
  896 + }
  897 + }
  898 + )
  899 + },
  900 +
  901 + cde1: { // 车辆设备启用日期验证
  902 + template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
  903 + remote: $resource( // $resource封装对象
  904 + '/cde//validate/qyrq',
  905 + {},
  906 + {
  907 + do: {
  908 + method: 'GET'
  909 + }
  910 + }
  911 + )
  912 + },
  913 + ttc1: { // 时刻表名字验证
  914 + template: {'xl.id_eq': -1, 'name_eq': 'ddd'},
  915 + remote: $resource( // $resource封装对象
  916 + '/tic/validate/equale',
  917 + {},
  918 + {
  919 + do: {
  920 + method: 'GET'
  921 + }
  922 + }
  923 + )
  924 + },
  925 + sheet: { // 时刻表sheet工作区验证
  926 + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},
  927 + remote: $resource( // $resource封装对象
  928 + '/tidc/validate/sheet',
  929 + {},
  930 + {
  931 + do: {
  932 + method: 'POST',
  933 + headers: {
  934 + 'Content-Type': 'application/x-www-form-urlencoded'
  935 + },
  936 + transformRequest: function(obj) {
  937 + var str = [];
  938 + for (var p in obj) {
  939 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  940 + }
  941 + return str.join("&");
  942 + }
  943 + }
  944 + }
  945 + )
  946 + },
  947 + sheetli: { // 时刻表线路标准验证
  948 + template: {'lineinfoid': -1},
  949 + remote: $resource( // $resource封装对象
  950 + '/tidc/validate/lineinfo',
  951 + {},
  952 + {
  953 + do: {
  954 + method: 'GET'
  955 + }
  956 + }
  957 + )
  958 + }
  959 + }
  960 +
  961 + //validate: $resource(
  962 + // '/cars/validate/:type',
  963 + // {},
  964 + // {
  965 + // insideCode: {
  966 + // method: 'GET'
  967 + // }
  968 + // }
  969 + //)
  970 +
  971 +
  972 +
  973 + }
  974 +}]);
  975 +
  976 +
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
@@ -509,100 +509,100 @@ ScheduleApp.config([ @@ -509,100 +509,100 @@ ScheduleApp.config([
509 509
510 } 510 }
511 ]); 511 ]);
512 -// ui route 配置  
513 -  
514 -/** 路牌管理配置所有模块页面route */  
515 -ScheduleApp.config([  
516 - '$stateProvider',  
517 - '$urlRouterProvider',  
518 - function($stateProvider, $urlRouterProvider) {  
519 - // 默认路由  
520 - //$urlRouterProvider.otherwise('/busConfig.html');  
521 -  
522 - $stateProvider  
523 - .state("guideboardManage", { // index页面  
524 - url: '/guideboardManage',  
525 - views: {  
526 - "": {  
527 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'  
528 - },  
529 - "guideboardManage_list@guideboardManage": {  
530 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'  
531 - }  
532 - },  
533 -  
534 - resolve: {  
535 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
536 - return $ocLazyLoad.load({  
537 - name: 'guideboardManage_module',  
538 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
539 - files: [  
540 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
541 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
542 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
543 - "pages/scheduleApp/module/core/guideboardManage/module.js"  
544 - ]  
545 - });  
546 - }]  
547 - }  
548 - })  
549 - .state('guideboardManage_form', { // 添加路牌form  
550 - url: '/guideboardManage_form',  
551 - views: {  
552 - '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/form.html'}  
553 - },  
554 - resolve: {  
555 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
556 - return $ocLazyLoad.load({  
557 - name: 'guideboardManage_form_module',  
558 - insertBefore: '#ng_load_plugins_before',  
559 - files: [  
560 - 'assets/bower_components/angular-ui-select/dist/select.min.css',  
561 - 'assets/bower_components/angular-ui-select/dist/select.min.js',  
562 - 'pages/scheduleApp/module/core/guideboardManage/module.js'  
563 - ]  
564 - });  
565 - }]  
566 - }  
567 - })  
568 - .state('guideboardManage_edit', { // 修改路牌form  
569 - url: '/guideboardManage_edit/:id',  
570 - views: {  
571 - '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/edit.html'}  
572 - },  
573 - resolve: {  
574 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
575 - return $ocLazyLoad.load({  
576 - name: 'guideboardManage_edit_module',  
577 - insertBefore: '#ng_load_plugins_before',  
578 - files: [  
579 - 'assets/bower_components/angular-ui-select/dist/select.min.css',  
580 - 'assets/bower_components/angular-ui-select/dist/select.min.js',  
581 - 'pages/scheduleApp/module/core/guideboardManage/module.js'  
582 - ]  
583 - });  
584 - }]  
585 - }  
586 - })  
587 - .state("guideboardManage_detail", { // 详细信息页面  
588 - url: '/guideboardManage_detail/:id',  
589 - views: {  
590 - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}  
591 - },  
592 - resolve: {  
593 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
594 - return $ocLazyLoad.load({  
595 - name: 'guideboardManage_detail_module',  
596 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
597 - files: [  
598 - "pages/scheduleApp/module/core/guideboardManage/module.js"  
599 - ]  
600 - });  
601 - }]  
602 - }  
603 - })  
604 -  
605 - 512 +// ui route 配置
  513 +
  514 +/** 路牌管理配置所有模块页面route */
  515 +ScheduleApp.config([
  516 + '$stateProvider',
  517 + '$urlRouterProvider',
  518 + function($stateProvider, $urlRouterProvider) {
  519 + // 默认路由
  520 + //$urlRouterProvider.otherwise('/busConfig.html');
  521 +
  522 + $stateProvider
  523 + .state("guideboardManage", { // index页面
  524 + url: '/guideboardManage',
  525 + views: {
  526 + "": {
  527 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'
  528 + },
  529 + "guideboardManage_list@guideboardManage": {
  530 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'
  531 + }
  532 + },
  533 +
  534 + resolve: {
  535 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  536 + return $ocLazyLoad.load({
  537 + name: 'guideboardManage_module',
  538 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  539 + files: [
  540 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  541 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  542 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  543 + "pages/scheduleApp/module/core/guideboardManage/module.js"
  544 + ]
  545 + });
  546 + }]
  547 + }
  548 + })
  549 + .state('guideboardManage_form', { // 添加路牌form
  550 + url: '/guideboardManage_form',
  551 + views: {
  552 + '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/form.html'}
  553 + },
  554 + resolve: {
  555 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  556 + return $ocLazyLoad.load({
  557 + name: 'guideboardManage_form_module',
  558 + insertBefore: '#ng_load_plugins_before',
  559 + files: [
  560 + 'assets/bower_components/angular-ui-select/dist/select.min.css',
  561 + 'assets/bower_components/angular-ui-select/dist/select.min.js',
  562 + 'pages/scheduleApp/module/core/guideboardManage/module.js'
  563 + ]
  564 + });
  565 + }]
  566 + }
  567 + })
  568 + .state('guideboardManage_edit', { // 修改路牌form
  569 + url: '/guideboardManage_edit/:id',
  570 + views: {
  571 + '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/edit.html'}
  572 + },
  573 + resolve: {
  574 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  575 + return $ocLazyLoad.load({
  576 + name: 'guideboardManage_edit_module',
  577 + insertBefore: '#ng_load_plugins_before',
  578 + files: [
  579 + 'assets/bower_components/angular-ui-select/dist/select.min.css',
  580 + 'assets/bower_components/angular-ui-select/dist/select.min.js',
  581 + 'pages/scheduleApp/module/core/guideboardManage/module.js'
  582 + ]
  583 + });
  584 + }]
  585 + }
  586 + })
  587 + .state("guideboardManage_detail", { // 详细信息页面
  588 + url: '/guideboardManage_detail/:id',
  589 + views: {
  590 + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}
  591 + },
  592 + resolve: {
  593 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  594 + return $ocLazyLoad.load({
  595 + name: 'guideboardManage_detail_module',
  596 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  597 + files: [
  598 + "pages/scheduleApp/module/core/guideboardManage/module.js"
  599 + ]
  600 + });
  601 + }]
  602 + }
  603 + })
  604 +
  605 +
606 }]); 606 }]);
607 // ui route 配置 607 // ui route 配置
608 608
@@ -952,117 +952,117 @@ ScheduleApp.config([ @@ -952,117 +952,117 @@ ScheduleApp.config([
952 }) 952 })
953 } 953 }
954 ]); 954 ]);
955 -// ui route 配置  
956 -  
957 -/** 时刻表管理配置route */  
958 -ScheduleApp.config([  
959 - '$stateProvider',  
960 - '$urlRouterProvider',  
961 - function($stateProvider, $urlRouterProvider) {  
962 - // 默认路由  
963 - //$urlRouterProvider.otherwise('/busConfig.html');  
964 -  
965 - $stateProvider  
966 - .state("ttInfoManage", { // index页面  
967 - url: '/ttInfoManage',  
968 - views: {  
969 - "": {  
970 - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html'  
971 - },  
972 - "ttInfoManage_list@ttInfoManage": {  
973 - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html'  
974 - }  
975 - },  
976 -  
977 - resolve: {  
978 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
979 - return $ocLazyLoad.load({  
980 - name: 'ttInfoManage_module',  
981 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
982 - files: [  
983 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
984 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
985 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
986 - ]  
987 - });  
988 - }]  
989 - }  
990 - })  
991 - .state("ttInfoManage_form", { // 添加时刻表信息form  
992 - url: '/ttInfoManage_form',  
993 - views: {  
994 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'}  
995 - },  
996 - resolve: {  
997 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
998 - return $ocLazyLoad.load({  
999 - name: 'ttInfoManage_form_module',  
1000 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
1001 - files: [  
1002 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
1003 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
1004 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
1005 - ]  
1006 - });  
1007 - }]  
1008 - }  
1009 - })  
1010 - .state("ttInfoManage_edit", { // 修改时刻表信息form  
1011 - url: '/ttInfoManage_edit/:id',  
1012 - views: {  
1013 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'}  
1014 - },  
1015 - resolve: {  
1016 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
1017 - return $ocLazyLoad.load({  
1018 - name: 'ttInfoManage_edit_module',  
1019 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
1020 - files: [  
1021 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
1022 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
1023 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
1024 - ]  
1025 - });  
1026 - }]  
1027 - }  
1028 - })  
1029 - .state("ttInfoManage_detail", { // 时刻表详细信息  
1030 - url: '/ttInfoManage_detail/:id',  
1031 - views: {  
1032 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'}  
1033 - },  
1034 - resolve: {  
1035 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
1036 - return $ocLazyLoad.load({  
1037 - name: 'ttInfoManage_detail_module',  
1038 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
1039 - files: [  
1040 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
1041 - ]  
1042 - });  
1043 - }]  
1044 - }  
1045 - })  
1046 - .state('ttInfoManage_test', { // TODO:测试页面  
1047 - url: '/ttInfoManage_test',  
1048 - views: {  
1049 - '': {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/test.html'}  
1050 - },  
1051 - resolve: {  
1052 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
1053 - return $ocLazyLoad.load({  
1054 - name: 'ttInfoManage_test_module',  
1055 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
1056 - files: [  
1057 - 'pages/scheduleApp/module/core/ttInfoManage/test.js'  
1058 - ]  
1059 - });  
1060 - }]  
1061 - }  
1062 - })  
1063 -  
1064 -  
1065 - } 955 +// ui route 配置
  956 +
  957 +/** 时刻表管理配置route */
  958 +ScheduleApp.config([
  959 + '$stateProvider',
  960 + '$urlRouterProvider',
  961 + function($stateProvider, $urlRouterProvider) {
  962 + // 默认路由
  963 + //$urlRouterProvider.otherwise('/busConfig.html');
  964 +
  965 + $stateProvider
  966 + .state("ttInfoManage", { // index页面
  967 + url: '/ttInfoManage',
  968 + views: {
  969 + "": {
  970 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html'
  971 + },
  972 + "ttInfoManage_list@ttInfoManage": {
  973 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html'
  974 + }
  975 + },
  976 +
  977 + resolve: {
  978 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  979 + return $ocLazyLoad.load({
  980 + name: 'ttInfoManage_module',
  981 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  982 + files: [
  983 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  984 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  985 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  986 + ]
  987 + });
  988 + }]
  989 + }
  990 + })
  991 + .state("ttInfoManage_form", { // 添加时刻表信息form
  992 + url: '/ttInfoManage_form',
  993 + views: {
  994 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'}
  995 + },
  996 + resolve: {
  997 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  998 + return $ocLazyLoad.load({
  999 + name: 'ttInfoManage_form_module',
  1000 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1001 + files: [
  1002 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1003 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1004 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  1005 + ]
  1006 + });
  1007 + }]
  1008 + }
  1009 + })
  1010 + .state("ttInfoManage_edit", { // 修改时刻表信息form
  1011 + url: '/ttInfoManage_edit/:id',
  1012 + views: {
  1013 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'}
  1014 + },
  1015 + resolve: {
  1016 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1017 + return $ocLazyLoad.load({
  1018 + name: 'ttInfoManage_edit_module',
  1019 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1020 + files: [
  1021 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1022 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1023 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  1024 + ]
  1025 + });
  1026 + }]
  1027 + }
  1028 + })
  1029 + .state("ttInfoManage_detail", { // 时刻表详细信息
  1030 + url: '/ttInfoManage_detail/:id',
  1031 + views: {
  1032 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'}
  1033 + },
  1034 + resolve: {
  1035 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1036 + return $ocLazyLoad.load({
  1037 + name: 'ttInfoManage_detail_module',
  1038 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1039 + files: [
  1040 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  1041 + ]
  1042 + });
  1043 + }]
  1044 + }
  1045 + })
  1046 + .state('ttInfoManage_test', { // TODO:测试页面
  1047 + url: '/ttInfoManage_test',
  1048 + views: {
  1049 + '': {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/test.html'}
  1050 + },
  1051 + resolve: {
  1052 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1053 + return $ocLazyLoad.load({
  1054 + name: 'ttInfoManage_test_module',
  1055 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1056 + files: [
  1057 + 'pages/scheduleApp/module/core/ttInfoManage/test.js'
  1058 + ]
  1059 + });
  1060 + }]
  1061 + }
  1062 + })
  1063 +
  1064 +
  1065 + }
1066 ]); 1066 ]);
1067 // ui route 配置 1067 // ui route 配置
1068 1068
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
@@ -76,11 +76,19 @@ @@ -76,11 +76,19 @@
76 searchexp="this.insideCode" 76 searchexp="this.insideCode"
77 required > 77 required >
78 </sa-Select5> 78 </sa-Select5>
  79 + <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id"
  80 + remote-Validation
  81 + remotevtype="cc_cars"
  82 + remotevparam="{{ {'id_eq': ctrl.busConfigForSave.id, 'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
  83 + />
79 </div> 84 </div>
80 <!-- 隐藏块,显示验证信息 --> 85 <!-- 隐藏块,显示验证信息 -->
81 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> 86 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
82 车辆必须选择 87 车辆必须选择
83 </div> 88 </div>
  89 + <div class="alert alert-danger well-sm" ng-show="myForm.cl_h.$error.remote">
  90 + {{$remote_msg}}
  91 + </div>
84 </div> 92 </div>
85 93
86 <div class="form-group has-success has-feedback"> 94 <div class="form-group has-success has-feedback">
src/main/resources/static/pages/scheduleApp/module/core/busConfig/form.html
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <sa-Select5 name="xl" 46 <sa-Select5 name="xl"
47 model="ctrl.busConfigForSave" 47 model="ctrl.busConfigForSave"
48 - cmaps="{'xl.id': 'id'}" 48 + cmaps="{'xl.id': 'id', 'xl.name': 'name'}"
49 dcname="xl.id" 49 dcname="xl.id"
50 icname="id" 50 icname="id"
51 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" 51 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
@@ -76,11 +76,19 @@ @@ -76,11 +76,19 @@
76 searchexp="this.insideCode" 76 searchexp="this.insideCode"
77 required > 77 required >
78 </sa-Select5> 78 </sa-Select5>
  79 + <input type="hidden" name="cl_h" ng-model="ctrl.busConfigForSave.cl.id"
  80 + remote-Validation
  81 + remotevtype="cc_cars"
  82 + remotevparam="{{ {'id_eq': ctrl.busConfigForSave.id, 'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
  83 + />
79 </div> 84 </div>
80 <!-- 隐藏块,显示验证信息 --> 85 <!-- 隐藏块,显示验证信息 -->
81 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required"> 86 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
82 车辆必须选择 87 车辆必须选择
83 </div> 88 </div>
  89 + <div class="alert alert-danger well-sm" ng-show="myForm.cl_h.$error.remote">
  90 + {{$remote_msg}}
  91 + </div>
84 </div> 92 </div>
85 93
86 <div class="form-group has-success has-feedback"> 94 <div class="form-group has-success has-feedback">
src/main/resources/static/pages/scheduleApp/module/core/busConfig/list.html
@@ -36,16 +36,16 @@ @@ -36,16 +36,16 @@
36 <td></td> 36 <td></td>
37 <td> 37 <td>
38 <label class="checkbox-inline input"> 38 <label class="checkbox-inline input">
39 - <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />作废 39 + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']" />作废
40 </label> 40 </label>
41 </td> 41 </td>
42 <td> 42 <td>
43 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 43 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
44 - ng-click="ctrl.pageChanaged()"> 44 + ng-click="ctrl.doPage()">
45 <i class="fa fa-search"></i> 搜索</button> 45 <i class="fa fa-search"></i> 搜索</button>
46 46
47 <button class="btn btn-sm red btn-outline filter-cancel" 47 <button class="btn btn-sm red btn-outline filter-cancel"
48 - ng-click="ctrl.resetSearchCondition()"> 48 + ng-click="ctrl.reset()">
49 <i class="fa fa-times"></i> 重置</button> 49 <i class="fa fa-times"></i> 重置</button>
50 </td> 50 </td>
51 51
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 53
54 </thead> 54 </thead>
55 <tbody> 55 <tbody>
56 - <tr ng-repeat="info in ctrl.pageInfo.infos" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> 56 + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}">
57 <td> 57 <td>
58 <span ng-bind="$index + 1"></span> 58 <span ng-bind="$index + 1"></span>
59 </td> 59 </td>
@@ -81,8 +81,8 @@ @@ -81,8 +81,8 @@
81 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> 81 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
82 <a ui-sref="busConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> 82 <a ui-sref="busConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
83 <a ui-sref="busConfig_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> 83 <a ui-sref="busConfig_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
84 - <a ng-click="ctrl.deleteEci(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a>  
85 - <a ng-click="ctrl.redoDeleteEci(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> 84 + <a ng-click="ctrl.toggleBusConfig(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a>
  85 + <a ng-click="ctrl.toggleBusConfig(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>
86 </td> 86 </td>
87 </tr> 87 </tr>
88 </tbody> 88 </tbody>
@@ -90,9 +90,9 @@ @@ -90,9 +90,9 @@
90 </div> 90 </div>
91 91
92 <div style="text-align: right;"> 92 <div style="text-align: right;">
93 - <uib-pagination total-items="ctrl.pageInfo.totalItems"  
94 - ng-model="ctrl.pageInfo.currentPage"  
95 - ng-change="ctrl.pageChanaged()" 93 + <uib-pagination total-items="ctrl.page()['totalElements']"
  94 + ng-model="ctrl.page()['uiNumber']"
  95 + ng-change="ctrl.doPage()"
96 rotate="false" 96 rotate="false"
97 max-size="10" 97 max-size="10"
98 boundary-links="true" 98 boundary-links="true"
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
1 // 车辆配置管理 service controller 等写在一起 1 // 车辆配置管理 service controller 等写在一起
2 -angular.module('ScheduleApp').factory('BusConfigService', ['BusConfigService_g', function(service) {  
3 - /** 当前的查询条件信息 */  
4 - var currentSearchCondition = {'isCancel_eq': false};  
5 -  
6 - /** 当前第几页 */  
7 - var currentPageNo = 1; 2 +angular.module('ScheduleApp').factory(
  3 + 'BusConfigService',
  4 + [
  5 + 'BusConfigService_g',
  6 + function(service) {
  7 + /** 当前的查询条件信息 */
  8 + var currentSearchCondition = {'isCancel_eq': false};
  9 +
  10 + // 当前查询返回的信息
  11 + var currentPage = { // 后台spring data返回的格式
  12 + totalElements: 0,
  13 + number: 0, // 后台返回的页码,spring返回从0开始
  14 + content: [],
  15 +
  16 + uiNumber: 1 // 页面绑定的页码
  17 + };
  18 +
  19 + // 查询对象
  20 + var queryClass = service.rest;
  21 +
  22 + return {
  23 + getQueryClass: function() {
  24 + return queryClass;
  25 + },
  26 + /**
  27 + * 获取查询条件信息,
  28 + * 用于给controller用来和页面数据绑定。
  29 + */
  30 + getSearchCondition: function() {
  31 + currentSearchCondition.page = currentPage.uiNumber - 1;
  32 + return currentSearchCondition;
  33 + },
  34 + /**
  35 + * 组装查询参数,返回一个promise查询结果。
  36 + * @param page 查询参数
  37 + * @return 返回一个 promise
  38 + */
  39 + getPage: function(page) {
  40 + if (page) {
  41 + currentPage.totalElements = page.totalElements;
  42 + currentPage.number = page.number;
  43 + currentPage.content = page.content;
  44 + }
  45 + return currentPage;
  46 + },
  47 + resetStatus: function() {
  48 + currentSearchCondition = {page: 0, 'isCancel_eq': false};
  49 + currentPage = {
  50 + totalElements: 0,
  51 + number: 0,
  52 + content: [],
  53 + uiNumber: 1
  54 + };
  55 + }
8 56
9 - return {  
10 - /**  
11 - * 获取查询条件信息,  
12 - * 用于给controller用来和页面数据绑定。  
13 - */  
14 - getSearchCondition: function() {  
15 - return currentSearchCondition;  
16 - },  
17 - /**  
18 - * 重置查询条件信息。  
19 - */  
20 - resetSearchCondition: function() {  
21 - var key;  
22 - for (key in currentSearchCondition) {  
23 - currentSearchCondition[key] = undefined;  
24 - }  
25 - currentSearchCondition['isCancel_eq'] = false;  
26 - },  
27 - /**  
28 - * 设置当前页码。  
29 - * @param cpn 从1开始,后台是从0开始的  
30 - */  
31 - setCurrentPageNo: function(cpn) {  
32 - currentPageNo = cpn;  
33 - },  
34 - /**  
35 - * 组装查询参数,返回一个promise查询结果。  
36 - * @param params 查询参数  
37 - * @return 返回一个 promise  
38 - */  
39 - getPage: function() {  
40 - var params = currentSearchCondition; // 查询条件  
41 - params.page = currentPageNo - 1; // 服务端页码从0开始  
42 - return service.rest.list(params).$promise;  
43 - },  
44 - /**  
45 - * 获取明细信息。  
46 - * @param id 车辆id  
47 - * @return 返回一个 promise  
48 - */  
49 - getDetail: function(id) {  
50 - var params = {id: id};  
51 - return service.rest.get(params).$promise;  
52 - },  
53 - /**  
54 - * 保存信息。  
55 - * @param obj 车辆详细信息  
56 - * @return 返回一个 promise  
57 - */  
58 - saveDetail: function(obj) {  
59 - return service.rest.save(obj).$promise;  
60 - },  
61 - /**  
62 - * 删除信息。  
63 - * @param id 主键id  
64 - * @returns {*|Function|promise|n}  
65 - */  
66 - deleteDetail: function(id) {  
67 - return service.rest.delete({id: id}).$promise; 57 + };
68 } 58 }
69 - };  
70 -  
71 -}]);  
72 -  
73 -angular.module('ScheduleApp').controller('BusConfigCtrl', ['BusConfigService', '$state', '$uibModal', function(busConfigService, $state, $uibModal) {  
74 - var self = this;  
75 -  
76 - // 切换到form状态  
77 - self.goForm = function() {  
78 - //alert("切换");  
79 - $state.go("busConfig_form");  
80 - };  
81 -  
82 - // 导入excel  
83 - self.importData = function() {  
84 - // large方式弹出模态对话框  
85 - var modalInstance = $uibModal.open({  
86 - templateUrl: '/pages/scheduleApp/module/core/busConfig/dataImport.html',  
87 - size: "lg",  
88 - animation: true,  
89 - backdrop: 'static',  
90 - resolve: {  
91 - // 可以传值给controller  
92 - },  
93 - windowClass: 'center-modal',  
94 - controller: "BusConfigToolsCtrl",  
95 - controllerAs: "ctrl",  
96 - bindToController: true  
97 - });  
98 - modalInstance.result.then(  
99 - function() {  
100 - console.log("dataImport.html打开");  
101 - },  
102 - function() {  
103 - console.log("dataImport.html消失");  
104 - }  
105 - );  
106 - };  
107 -}]); 59 + ]
  60 +);
  61 +
  62 +angular.module('ScheduleApp').controller(
  63 + 'BusConfigCtrl',
  64 + [
  65 + 'BusConfigService',
  66 + '$state',
  67 + '$uibModal',
  68 + function(busConfigService, $state, $uibModal) {
  69 + var self = this;
  70 +
  71 + // 切换到form状态
  72 + self.goForm = function() {
  73 + //alert("切换");
  74 + $state.go("busConfig_form");
  75 + };
  76 +
  77 + // 导入excel
  78 + self.importData = function() {
  79 + // large方式弹出模态对话框
  80 + var modalInstance = $uibModal.open({
  81 + templateUrl: '/pages/scheduleApp/module/core/busConfig/dataImport.html',
  82 + size: "lg",
  83 + animation: true,
  84 + backdrop: 'static',
  85 + resolve: {
  86 + // 可以传值给controller
  87 + },
  88 + windowClass: 'center-modal',
  89 + controller: "BusConfigToolsCtrl",
  90 + controllerAs: "ctrl",
  91 + bindToController: true
  92 + });
  93 + modalInstance.result.then(
  94 + function() {
  95 + console.log("dataImport.html打开");
  96 + },
  97 + function() {
  98 + console.log("dataImport.html消失");
  99 + }
  100 + );
  101 + };
  102 + }
  103 + ]
  104 +);
108 105
109 angular.module('ScheduleApp').controller('BusConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { 106 angular.module('ScheduleApp').controller('BusConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
110 var self = this; 107 var self = this;
@@ -142,205 +139,119 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusConfigToolsCtrl&#39;, [&#39;$modalInstance&#39; @@ -142,205 +139,119 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusConfigToolsCtrl&#39;, [&#39;$modalInstance&#39;
142 139
143 }]); 140 }]);
144 141
145 -angular.module('ScheduleApp').controller('BusConfigListCtrl', ['BusConfigService', function(busConfigService) {  
146 - var self = this;  
147 - self.pageInfo = {  
148 - totalItems : 0,  
149 - currentPage : 1,  
150 - infos: []  
151 - };  
152 -  
153 - // 初始创建的时候,获取一次列表数据  
154 - busConfigService.getPage().then(  
155 - function(result) {  
156 - self.pageInfo.totalItems = result.totalElements;  
157 - self.pageInfo.currentPage = result.number + 1;  
158 - self.pageInfo.infos = result.content;  
159 - busConfigService.setCurrentPageNo(result.number + 1);  
160 - },  
161 - function(result) {  
162 - alert("出错啦!");  
163 - }  
164 - );  
165 -  
166 - //$scope.$watch("ctrl.pageInfo.currentPage", function() {  
167 - // alert("dfdfdf");  
168 - //});  
169 -  
170 - // 翻页的时候调用  
171 - self.pageChanaged = function() {  
172 - busConfigService.setCurrentPageNo(self.pageInfo.currentPage);  
173 - busConfigService.getPage().then(  
174 - function(result) {  
175 - self.pageInfo.totalItems = result.totalElements;  
176 - self.pageInfo.currentPage = result.number + 1;  
177 - self.pageInfo.infos = result.content;  
178 - busConfigService.setCurrentPageNo(result.number + 1);  
179 - },  
180 - function(result) {  
181 - alert("出错啦!");  
182 - }  
183 - );  
184 - };  
185 - // 获取查询条件数据  
186 - self.searchCondition = function() {  
187 - return busConfigService.getSearchCondition();  
188 - };  
189 - // 重置查询条件  
190 - self.resetSearchCondition = function() {  
191 - busConfigService.resetSearchCondition();  
192 - self.pageInfo.currentPage = 1;  
193 - self.pageChanaged();  
194 - };  
195 -  
196 - // 删除时刻表  
197 - self.deleteEci = function(id) {  
198 - // TODO:  
199 - busConfigService.deleteDetail(id).then(  
200 - function(result) {  
201 - if (result.message) { // 暂时这样做,之后全局拦截  
202 - alert("失败:" + result.message);  
203 - } else {  
204 - alert("作废成功!");  
205 -  
206 - busConfigService.getPage().then(  
207 - function(result) {  
208 - self.pageInfo.totalItems = result.totalElements;  
209 - self.pageInfo.currentPage = result.number + 1;  
210 - self.pageInfo.infos = result.content;  
211 - busConfigService.setCurrentPageNo(result.number + 1);  
212 - },  
213 - function(result) {  
214 - alert("出错啦!");  
215 - }  
216 - );  
217 - }  
218 -  
219 - },  
220 - function(result) {  
221 - alert("出错啦!" + result);  
222 - }  
223 - );  
224 - };  
225 -  
226 - // 撤销修改  
227 - self.redoDeleteEci = function(id) {  
228 - busConfigService.getDetail(id).then(  
229 - function(result) {  
230 - result.isCancel = 'false';  
231 - busConfigService.saveDetail(result).then(  
232 - function(result) {  
233 - if (result.message) { // 暂时这样做,之后全局拦截  
234 - alert("失败:" + result.message);  
235 - } else {  
236 - alert("撤销成功!");  
237 -  
238 - busConfigService.getPage().then(  
239 - function(result) {  
240 - self.pageInfo.totalItems = result.totalElements;  
241 - self.pageInfo.currentPage = result.number + 1;  
242 - self.pageInfo.infos = result.content;  
243 - busConfigService.setCurrentPageNo(result.number + 1);  
244 - },  
245 - function(result) {  
246 - alert("出错啦!");  
247 - }  
248 - );  
249 - }  
250 - },  
251 - function(result) {  
252 - // TODO:弹出框方式以后改  
253 - alert("出错啦!"); 142 +// list.html控制器
  143 +angular.module('ScheduleApp').controller(
  144 + 'BusConfigListCtrl',
  145 + [
  146 + 'BusConfigService',
  147 + function(service) {
  148 + var self = this;
  149 + var BusConfig = service.getQueryClass();
  150 +
  151 + self.page = function() {
  152 + return service.getPage();
  153 + };
  154 +
  155 + self.searchCondition = function() {
  156 + return service.getSearchCondition();
  157 + };
  158 +
  159 + self.doPage = function() {
  160 + var page = BusConfig.list(self.searchCondition(), function() {
  161 + service.getPage(page);
  162 + });
  163 + };
  164 + self.reset = function() {
  165 + service.resetStatus();
  166 + var page = BusConfig.list(self.searchCondition(), function() {
  167 + service.getPage(page);
  168 + });
  169 + };
  170 + self.toggleBusConfig = function(id) {
  171 + BusConfig.delete({id: id}, function(result) {
  172 + if (result.message) { // 暂时这样做,之后全局拦截
  173 + alert("失败:" + result.message);
  174 + } else {
  175 + self.doPage();
254 } 176 }
255 - );  
256 - },  
257 - function(result) {  
258 - // TODO:弹出框方式以后改  
259 - alert("出错啦!");  
260 - }  
261 - );  
262 - };  
263 -  
264 -}]);  
265 -  
266 -angular.module('ScheduleApp').controller('BusConfigFormCtrl', ['BusConfigService', '$stateParams', '$state', '$scope', function(busConfigService, $stateParams, $state, $scope) {  
267 - var self = this;  
268 -  
269 - // 启用日期 日期控件开关  
270 - self.qyrqOpen = false;  
271 - self.qyrq_open = function() {  
272 - self.qyrqOpen = true;  
273 - };  
274 -  
275 - // 终止日期 日期控件开关  
276 - self.zzrqOpen = false;  
277 - self.zzrq_open = function() {  
278 - self.zzrqOpen = true;  
279 - }; 177 + });
  178 + };
280 179
281 - // 欲保存的busInfo信息,绑定  
282 - self.busConfigForSave = {xl:{}, cl:{}}; 180 + self.doPage();
283 181
284 - // 获取传过来的id,有的话就是修改,获取一遍数据  
285 - var id = $stateParams.id;  
286 - if (id) {  
287 - self.busConfigForSave.id = id;  
288 - busConfigService.getDetail(id).then(  
289 - function(result) {  
290 - var key;  
291 - for (key in result) {  
292 - self.busConfigForSave[key] = result[key];  
293 - }  
294 - },  
295 - function(result) {  
296 - alert("出错啦!"); 182 + }
  183 + ]
  184 +);
  185 +
  186 +// form.html控制器
  187 +angular.module('ScheduleApp').controller(
  188 + 'BusConfigFormCtrl',
  189 + [
  190 + 'BusConfigService',
  191 + '$stateParams',
  192 + '$state',
  193 + '$scope',
  194 + function(service, $stateParams, $state, $scope) {
  195 + var self = this;
  196 + var BusConfig = service.getQueryClass();
  197 +
  198 + // 启用日期 日期控件开关
  199 + self.qyrqOpen = false;
  200 + self.qyrq_open = function() {
  201 + self.qyrqOpen = true;
  202 + };
  203 +
  204 + // 终止日期 日期控件开关
  205 + self.zzrqOpen = false;
  206 + self.zzrq_open = function() {
  207 + self.zzrqOpen = true;
  208 + };
  209 +
  210 + // 欲保存的busInfo信息,绑定
  211 + self.busConfigForSave = new BusConfig;
  212 + self.busConfigForSave.xl = {};
  213 + self.busConfigForSave.cl = {};
  214 +
  215 + // 获取传过来的id,有的话就是修改,获取一遍数据
  216 + var id = $stateParams.id;
  217 + if (id) {
  218 + BusConfig.get({id: id}, function(value) {
  219 + self.busConfigForSave = value;
  220 + });
297 } 221 }
298 - );  
299 - }  
300 222
301 - // 提交方法  
302 - self.submit = function() {  
303 - console.log(self.busConfigForSave);  
304 - busConfigService.saveDetail(self.busConfigForSave).then(  
305 - function(result) {  
306 - // TODO:弹出框方式以后改  
307 - if (result.status == 'SUCCESS') {  
308 - alert("保存成功!"); 223 + // 提交方法
  224 + self.submit = function() {
  225 + self.busConfigForSave.$save(function() {
309 $state.go("busConfig"); 226 $state.go("busConfig");
310 - } else {  
311 - alert("保存异常!");  
312 - }  
313 - },  
314 - function(result) {  
315 - // TODO:弹出框方式以后改  
316 - alert("出错啦!");  
317 - }  
318 - );  
319 - }; 227 + });
  228 + };
320 }]); 229 }]);
321 230
322 -angular.module('ScheduleApp').controller('BusConfigDetailCtrl', ['BusConfigService', '$stateParams', function(busConfigService, $stateParams) {  
323 - var self = this;  
324 - self.title = "";  
325 - self.busConfigForDetail = {};  
326 - self.busConfigForDetail.id = $stateParams.id;  
327 -  
328 - // 当转向到此页面时,就获取明细信息并绑定  
329 - busConfigService.getDetail($stateParams.id).then(  
330 - function(result) {  
331 - var key;  
332 - for (key in result) {  
333 - self.busConfigForDetail[key] = result[key];  
334 - }  
335 -  
336 - self.title = "车辆 " + self.busConfigForDetail.cl.insideCode + " 配置详细信息";  
337 - },  
338 - function(result) {  
339 - // TODO:弹出框方式以后改  
340 - alert("出错啦!"); 231 +// detail.html控制器
  232 +angular.module('ScheduleApp').controller(
  233 + 'BusConfigDetailCtrl',
  234 + [
  235 + 'BusConfigService',
  236 + '$stateParams',
  237 + function(service, $stateParams) {
  238 + var self = this;
  239 + var BusConfig = service.getQueryClass();
  240 + var id = $stateParams.id;
  241 +
  242 + self.title = "";
  243 + self.busConfigForDetail = {};
  244 +
  245 + // 当转向到此页面时,就获取明细信息并绑定
  246 + BusConfig.get({id: id}, function(value) {
  247 + self.busConfigForDetail = value;
  248 + self.title = "车辆 " +
  249 + self.busConfigForDetail.cl.insideCode +
  250 + " 配置详细信息";
  251 + });
341 } 252 }
342 - );  
343 -}]); 253 + ]
  254 +);
344 255
345 256
346 257
src/main/resources/static/pages/scheduleApp/module/core/busConfig/service.js
@@ -9,10 +9,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, functi @@ -9,10 +9,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, functi
9 method: 'GET', 9 method: 'GET',
10 params: { 10 params: {
11 page: 0 11 page: 0
  12 + },
  13 + transformResponse: function(rs) {
  14 + var dst = angular.fromJson(rs);
  15 + if (dst.status == 'SUCCESS') {
  16 + return dst.data;
  17 + } else {
  18 + return dst; // 业务错误留给控制器处理
  19 + }
12 } 20 }
13 }, 21 },
14 get: { 22 get: {
15 - method: 'GET' 23 + method: 'GET',
  24 + transformResponse: function(rs) {
  25 + var dst = angular.fromJson(rs);
  26 + if (dst.status == 'SUCCESS') {
  27 + return dst.data;
  28 + } else {
  29 + return dst;
  30 + }
  31 + }
16 }, 32 },
17 save: { 33 save: {
18 method: 'POST' 34 method: 'POST'
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/edit.html
@@ -89,11 +89,19 @@ @@ -89,11 +89,19 @@
89 searchexp="this.personnelName + '<' + this.jobCode + '>'" 89 searchexp="this.personnelName + '<' + this.jobCode + '>'"
90 required > 90 required >
91 </sa-Select5> 91 </sa-Select5>
  92 + <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id"
  93 + remote-Validation
  94 + remotevtype="ec_jsy"
  95 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
  96 + />
92 </div> 97 </div>
93 <!-- 隐藏块,显示验证信息 --> 98 <!-- 隐藏块,显示验证信息 -->
94 <div class="alert alert-danger well-sm" ng-show="myForm.jsy.$error.required"> 99 <div class="alert alert-danger well-sm" ng-show="myForm.jsy.$error.required">
95 驾驶员必须选择 100 驾驶员必须选择
96 </div> 101 </div>
  102 + <div class="alert alert-danger well-sm" ng-show="myForm.jsy_h.$error.remote">
  103 + {{$remote_msg}}
  104 + </div>
97 </div> 105 </div>
98 106
99 <div class="form-group"> 107 <div class="form-group">
@@ -111,6 +119,15 @@ @@ -111,6 +119,15 @@
111 searchexp="this.personnelName + '<' + this.jobCode + '>'" 119 searchexp="this.personnelName + '<' + this.jobCode + '>'"
112 > 120 >
113 </sa-Select5> 121 </sa-Select5>
  122 + <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id"
  123 + remote-Validation
  124 + remotevtype="ec_jsy"
  125 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}"
  126 + />
  127 + </div>
  128 + <!-- 隐藏块,显示验证信息 -->
  129 + <div class="alert alert-danger well-sm" ng-show="myForm.spy_h.$error.remote">
  130 + {{$remote_msg}}
114 </div> 131 </div>
115 </div> 132 </div>
116 133
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/form.html
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <sa-Select5 name="xl" 46 <sa-Select5 name="xl"
47 model="ctrl.employeeConfigForSave" 47 model="ctrl.employeeConfigForSave"
48 - cmaps="{'xl.id' : 'id'}" 48 + cmaps="{'xl.id' : 'id', 'xl.name': 'name'}"
49 dcname="xl.id" 49 dcname="xl.id"
50 icname="id" 50 icname="id"
51 dsparams="{{ {type: 'ajax', param:{'type': 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" 51 dsparams="{{ {type: 'ajax', param:{'type': 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
@@ -89,11 +89,19 @@ @@ -89,11 +89,19 @@
89 searchexp="this.personnelName + '<' + this.jobCode + '>'" 89 searchexp="this.personnelName + '<' + this.jobCode + '>'"
90 required > 90 required >
91 </sa-Select5> 91 </sa-Select5>
  92 + <input type="hidden" name="jsy_h" ng-model="ctrl.employeeConfigForSave.jsy.id"
  93 + remote-Validation
  94 + remotevtype="ec_jsy"
  95 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
  96 + />
92 </div> 97 </div>
93 <!-- 隐藏块,显示验证信息 --> 98 <!-- 隐藏块,显示验证信息 -->
94 <div class="alert alert-danger well-sm" ng-show="myForm.jsy.$error.required"> 99 <div class="alert alert-danger well-sm" ng-show="myForm.jsy.$error.required">
95 驾驶员必须选择 100 驾驶员必须选择
96 </div> 101 </div>
  102 + <div class="alert alert-danger well-sm" ng-show="myForm.jsy_h.$error.remote">
  103 + {{$remote_msg}}
  104 + </div>
97 </div> 105 </div>
98 106
99 <div class="form-group"> 107 <div class="form-group">
@@ -111,6 +119,15 @@ @@ -111,6 +119,15 @@
111 searchexp="this.personnelName + '<' + this.jobCode + '>'" 119 searchexp="this.personnelName + '<' + this.jobCode + '>'"
112 > 120 >
113 </sa-Select5> 121 </sa-Select5>
  122 + <input type="hidden" name="spy_h" ng-model="ctrl.employeeConfigForSave.spy.id"
  123 + remote-Validation
  124 + remotevtype="ec_spy"
  125 + remotevparam="{{ {'id_eq': ctrl.employeeConfigForSave.id, 'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'spy.id_eq': ctrl.employeeConfigForSave.spy.id} | json}}"
  126 + />
  127 + </div>
  128 + <!-- 隐藏块,显示验证信息 -->
  129 + <div class="alert alert-danger well-sm" ng-show="myForm.spy_h.$error.remote">
  130 + {{$remote_msg}}
114 </div> 131 </div>
115 </div> 132 </div>
116 133
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
@@ -46,16 +46,16 @@ @@ -46,16 +46,16 @@
46 </td> 46 </td>
47 <td> 47 <td>
48 <label class="checkbox-inline"> 48 <label class="checkbox-inline">
49 - <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>作废 49 + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>作废
50 </label> 50 </label>
51 </td> 51 </td>
52 <td> 52 <td>
53 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 53 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
54 - ng-click="ctrl.pageChanaged()"> 54 + ng-click="ctrl.doPage()">
55 <i class="fa fa-search"></i> 搜索</button> 55 <i class="fa fa-search"></i> 搜索</button>
56 56
57 <button class="btn btn-sm red btn-outline filter-cancel" 57 <button class="btn btn-sm red btn-outline filter-cancel"
58 - ng-click="ctrl.resetSearchCondition()"> 58 + ng-click="ctrl.reset()">
59 <i class="fa fa-times"></i> 重置</button> 59 <i class="fa fa-times"></i> 重置</button>
60 </td> 60 </td>
61 61
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 63
64 </thead> 64 </thead>
65 <tbody> 65 <tbody>
66 - <tr ng-repeat="info in ctrl.pageInfo.infos" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> 66 + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}">
67 <td> 67 <td>
68 <span ng-bind="$index + 1"></span> 68 <span ng-bind="$index + 1"></span>
69 </td> 69 </td>
@@ -94,8 +94,8 @@ @@ -94,8 +94,8 @@
94 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> 94 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
95 <a ui-sref="employeeConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> 95 <a ui-sref="employeeConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
96 <a ui-sref="employeeConfig_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> 96 <a ui-sref="employeeConfig_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
97 - <a ng-click="ctrl.deleteEci(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a>  
98 - <a ng-click="ctrl.redoDeleteEci(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> 97 + <a ng-click="ctrl.toggleEmpConfig(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a>
  98 + <a ng-click="ctrl.toggleEmpConfig(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>
99 </td> 99 </td>
100 </tr> 100 </tr>
101 </tbody> 101 </tbody>
@@ -103,9 +103,9 @@ @@ -103,9 +103,9 @@
103 </div> 103 </div>
104 104
105 <div style="text-align: right;"> 105 <div style="text-align: right;">
106 - <uib-pagination total-items="ctrl.pageInfo.totalItems"  
107 - ng-model="ctrl.pageInfo.currentPage"  
108 - ng-change="ctrl.pageChanaged()" 106 + <uib-pagination total-items="ctrl.page()['totalElements']"
  107 + ng-model="ctrl.page()['uiNumber']"
  108 + ng-change="ctrl.doPage()"
109 rotate="false" 109 rotate="false"
110 max-size="10" 110 max-size="10"
111 boundary-links="true" 111 boundary-links="true"
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
1 // 人员配置管理 service controller 等写在一起 1 // 人员配置管理 service controller 等写在一起
2 2
3 -angular.module('ScheduleApp').factory('EmployeeConfigService', ['EmployeeConfigService_g', function(service) {  
4 - /** 当前的查询条件信息 */  
5 - var currentSearchCondition = {'isCancel_eq': false};  
6 -  
7 - /** 当前第几页 */  
8 - var currentPageNo = 1; 3 +angular.module('ScheduleApp').factory(
  4 + 'EmployeeConfigService',
  5 + [
  6 + 'EmployeeConfigService_g',
  7 + function(service) {
  8 + /** 当前的查询条件信息 */
  9 + var currentSearchCondition = {'isCancel_eq': false};
  10 + // 当前查询返回的信息
  11 + var currentPage = { // 后台spring data返回的格式
  12 + totalElements: 0,
  13 + number: 0, // 后台返回的页码,spring返回从0开始
  14 + content: [],
  15 +
  16 + uiNumber: 1 // 页面绑定的页码
  17 + };
  18 +
  19 + // 查询对象类
  20 + var queryClass = service.rest;
  21 +
  22 + return {
  23 + getQueryClass: function() {
  24 + return queryClass;
  25 + },
  26 + /**
  27 + * 获取查询条件信息,
  28 + * 用于给controller用来和页面数据绑定。
  29 + */
  30 + getSearchCondition: function() {
  31 + currentSearchCondition.page = currentPage.uiNumber - 1;
  32 + return currentSearchCondition;
  33 + },
  34 + /**
  35 + * 组装查询参数,返回一个promise查询结果。
  36 + * @param page 查询参数
  37 + * @return 返回一个 promise
  38 + */
  39 + getPage: function(page) {
  40 + if (page) {
  41 + currentPage.totalElements = page.totalElements;
  42 + currentPage.number = page.number;
  43 + currentPage.content = page.content;
  44 + }
  45 + return currentPage;
  46 + },
  47 + resetStatus: function() {
  48 + currentSearchCondition = {page: 0, 'isCancel_eq': false};
  49 + currentPage = {
  50 + totalElements: 0,
  51 + number: 0,
  52 + content: [],
  53 + uiNumber: 1
  54 + };
  55 + }
9 56
10 - return {  
11 - /**  
12 - * 获取查询条件信息,  
13 - * 用于给controller用来和页面数据绑定。  
14 - */  
15 - getSearchCondition: function() {  
16 - return currentSearchCondition;  
17 - },  
18 - /**  
19 - * 重置查询条件信息。  
20 - */  
21 - resetSearchCondition: function() {  
22 - var key;  
23 - for (key in currentSearchCondition) {  
24 - currentSearchCondition[key] = undefined;  
25 - }  
26 - currentSearchCondition['isCancel_eq'] = false;  
27 - },  
28 - /**  
29 - * 设置当前页码。  
30 - * @param cpn 从1开始,后台是从0开始的  
31 - */  
32 - setCurrentPageNo: function(cpn) {  
33 - currentPageNo = cpn;  
34 - },  
35 - /**  
36 - * 组装查询参数,返回一个promise查询结果。  
37 - * @param params 查询参数  
38 - * @return 返回一个 promise  
39 - */  
40 - getPage: function() {  
41 - var params = currentSearchCondition; // 查询条件  
42 - params.page = currentPageNo - 1; // 服务端页码从0开始  
43 - return service.rest.list(params).$promise;  
44 - },  
45 - /**  
46 - * 获取明细信息。  
47 - * @param id 车辆id  
48 - * @return 返回一个 promise  
49 - */  
50 - getDetail: function(id) {  
51 - var params = {id: id};  
52 - return service.rest.get(params).$promise;  
53 - },  
54 - /**  
55 - * 保存信息。  
56 - * @param obj 车辆详细信息  
57 - * @return 返回一个 promise  
58 - */  
59 - saveDetail: function(obj) {  
60 - return service.rest.save(obj).$promise;  
61 - },  
62 - /**  
63 - * 删除信息。  
64 - * @param id 主键id  
65 - * @returns {*|Function|promise|n}  
66 - */  
67 - deleteDetail: function(id) {  
68 - return service.rest.delete({id: id}).$promise; 57 + };
69 } 58 }
70 - };  
71 -}]);  
72 -  
73 -angular.module('ScheduleApp').controller('EmployeeConfigCtrl', ['EmployeeConfigService', '$state', '$uibModal', function(employeeConfigService, $state, $uibModal) {  
74 - var self = this;  
75 -  
76 - // 切换到form状态  
77 - self.goForm = function() {  
78 - //alert("切换");  
79 - $state.go("employeeConfig_form");  
80 - };  
81 -  
82 - // 导入excel  
83 - self.importData = function() {  
84 - // large方式弹出模态对话框  
85 - var modalInstance = $uibModal.open({  
86 - templateUrl: '/pages/scheduleApp/module/core/employeeConfig/dataImport.html',  
87 - size: "lg",  
88 - animation: true,  
89 - backdrop: 'static',  
90 - resolve: {  
91 - // 可以传值给controller  
92 - },  
93 - windowClass: 'center-modal',  
94 - controller: "EmployeeConfigToolsCtrl",  
95 - controllerAs: "ctrl",  
96 - bindToController: true  
97 - });  
98 - modalInstance.result.then(  
99 - function() {  
100 - console.log("dataImport.html打开");  
101 - },  
102 - function() {  
103 - console.log("dataImport.html消失");  
104 - }  
105 - );  
106 - };  
107 -}]); 59 + ]
  60 +);
  61 +
  62 +// index.html控制器
  63 +angular.module('ScheduleApp').controller(
  64 + 'EmployeeConfigCtrl',
  65 + [
  66 + 'EmployeeConfigService',
  67 + '$state',
  68 + '$uibModal',
  69 + function(service, $state, $uibModal) {
  70 + var self = this;
  71 +
  72 + // 切换到form状态
  73 + self.goForm = function() {
  74 + //alert("切换");
  75 + $state.go("employeeConfig_form");
  76 + };
  77 +
  78 + // 导入excel
  79 + self.importData = function() {
  80 + // large方式弹出模态对话框
  81 + var modalInstance = $uibModal.open({
  82 + templateUrl: '/pages/scheduleApp/module/core/employeeConfig/dataImport.html',
  83 + size: "lg",
  84 + animation: true,
  85 + backdrop: 'static',
  86 + resolve: {
  87 + // 可以传值给controller
  88 + },
  89 + windowClass: 'center-modal',
  90 + controller: "EmployeeConfigToolsCtrl",
  91 + controllerAs: "ctrl",
  92 + bindToController: true
  93 + });
  94 + modalInstance.result.then(
  95 + function() {
  96 + console.log("dataImport.html打开");
  97 + },
  98 + function() {
  99 + console.log("dataImport.html消失");
  100 + }
  101 + );
  102 + };
  103 + }
  104 + ]
  105 +);
108 106
109 angular.module('ScheduleApp').controller('EmployeeConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { 107 angular.module('ScheduleApp').controller('EmployeeConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
110 var self = this; 108 var self = this;
@@ -142,202 +140,114 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;EmployeeConfigToolsCtrl&#39;, [&#39;$modalInst @@ -142,202 +140,114 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;EmployeeConfigToolsCtrl&#39;, [&#39;$modalInst
142 140
143 }]); 141 }]);
144 142
145 -angular.module('ScheduleApp').controller('EmployeeConfigListCtrl', ['EmployeeConfigService', function(employeeConfigService) {  
146 - var self = this;  
147 - self.pageInfo = {  
148 - totalItems : 0,  
149 - currentPage : 1,  
150 - infos: []  
151 - }; 143 +// list.html控制器
  144 +angular.module('ScheduleApp').controller(
  145 + 'EmployeeConfigListCtrl',
  146 + [
  147 + 'EmployeeConfigService',
  148 + function(service) {
  149 + var self = this;
  150 + var EmpConfig = service.getQueryClass();
  151 +
  152 + self.page = function() {
  153 + return service.getPage();
  154 + };
  155 +
  156 + self.searchCondition = function() {
  157 + return service.getSearchCondition();
  158 + };
  159 + self.doPage = function() {
  160 + var page = EmpConfig.list(self.searchCondition(), function() {
  161 + service.getPage(page);
  162 + });
  163 + };
  164 + self.reset = function() {
  165 + service.resetStatus();
  166 + var page = EmpConfig.list(self.searchCondition(), function() {
  167 + service.getPage(page);
  168 + });
  169 + };
  170 +
  171 + self.toggleEmpConfig = function(id) {
  172 + EmpConfig.delete({id: id}, function(result) {
  173 + if (result.message) { // 暂时这样做,之后全局拦截
  174 + alert("失败:" + result.message);
  175 + } else {
  176 + self.doPage();
  177 + }
  178 + });
  179 + };
152 180
153 - // 初始创建的时候,获取一次列表数据  
154 - employeeConfigService.getPage().then(  
155 - function(result) {  
156 - self.pageInfo.totalItems = result.totalElements;  
157 - self.pageInfo.currentPage = result.number + 1;  
158 - self.pageInfo.infos = result.content;  
159 - employeeConfigService.setCurrentPageNo(result.number + 1);  
160 - },  
161 - function(result) {  
162 - alert("出错啦!"); 181 + self.doPage();
163 } 182 }
164 - );  
165 -  
166 - //$scope.$watch("ctrl.pageInfo.currentPage", function() {  
167 - // alert("dfdfdf");  
168 - //});  
169 -  
170 - // 翻页的时候调用  
171 - self.pageChanaged = function() {  
172 - employeeConfigService.setCurrentPageNo(self.pageInfo.currentPage);  
173 - employeeConfigService.getPage().then(  
174 - function(result) {  
175 - self.pageInfo.totalItems = result.totalElements;  
176 - self.pageInfo.currentPage = result.number + 1;  
177 - self.pageInfo.infos = result.content;  
178 - employeeConfigService.setCurrentPageNo(result.number + 1);  
179 - },  
180 - function(result) {  
181 - alert("出错啦!");  
182 - }  
183 - );  
184 - };  
185 - // 获取查询条件数据  
186 - self.searchCondition = function() {  
187 - return employeeConfigService.getSearchCondition();  
188 - };  
189 - // 重置查询条件  
190 - self.resetSearchCondition = function() {  
191 - employeeConfigService.resetSearchCondition();  
192 - self.pageInfo.currentPage = 1;  
193 - self.pageChanaged();  
194 - };  
195 -  
196 - // 删除时刻表  
197 - self.deleteEci = function(id) {  
198 - // TODO:  
199 - employeeConfigService.deleteDetail(id).then(  
200 - function(result) {  
201 - if (result.message) { // 暂时这样做,之后全局拦截  
202 - alert("失败:" + result.message);  
203 - } else {  
204 - alert("作废成功!");  
205 -  
206 - employeeConfigService.getPage().then(  
207 - function(result) {  
208 - self.pageInfo.totalItems = result.totalElements;  
209 - self.pageInfo.currentPage = result.number + 1;  
210 - self.pageInfo.infos = result.content;  
211 - employeeConfigService.setCurrentPageNo(result.number + 1);  
212 - },  
213 - function(result) {  
214 - alert("出错啦!");  
215 - }  
216 - );  
217 - }  
218 -  
219 - },  
220 - function(result) {  
221 - alert("出错啦!" + result);  
222 - }  
223 - );  
224 - };  
225 -  
226 - // 撤销修改  
227 - self.redoDeleteEci = function(id) {  
228 - employeeConfigService.getDetail(id).then(  
229 - function(result) {  
230 - result.isCancel = 'false';  
231 - employeeConfigService.saveDetail(result).then(  
232 - function(result) {  
233 - if (result.message) { // 暂时这样做,之后全局拦截  
234 - alert("失败:" + result.message);  
235 - } else {  
236 - alert("撤销成功!");  
237 -  
238 - employeeConfigService.getPage().then(  
239 - function(result) {  
240 - self.pageInfo.totalItems = result.totalElements;  
241 - self.pageInfo.currentPage = result.number + 1;  
242 - self.pageInfo.infos = result.content;  
243 - employeeConfigService.setCurrentPageNo(result.number + 1);  
244 - },  
245 - function(result) {  
246 - alert("出错啦!");  
247 - }  
248 - );  
249 - }  
250 - },  
251 - function(result) {  
252 - // TODO:弹出框方式以后改  
253 - alert("出错啦!"); 183 + ]
  184 +);
  185 +
  186 +// form.html控制器
  187 +angular.module('ScheduleApp').controller(
  188 + 'EmployeeConfigFormCtrl',
  189 + [
  190 + 'EmployeeConfigService',
  191 + '$stateParams',
  192 + '$state',
  193 + function(service, $stateParams, $state) {
  194 + var self = this;
  195 + var EmpConfig = service.getQueryClass();
  196 +
  197 + // 欲保存的busInfo信息,绑定
  198 + self.employeeConfigForSave = new EmpConfig;
  199 + self.employeeConfigForSave.xl = {};
  200 + self.employeeConfigForSave.jsy = {};
  201 + self.employeeConfigForSave.spy = {};
  202 +
  203 + // 获取传过来的id,有的话就是修改,获取一遍数据
  204 + var id = $stateParams.id;
  205 + if (id) {
  206 + EmpConfig.get({id: id}, function(value) {
  207 + self.employeeConfigForSave = value;
  208 + if (!self.employeeConfigForSave.spy) {
  209 + self.employeeConfigForSave.spy = {};
254 } 210 }
255 - );  
256 - },  
257 - function(result) {  
258 - // TODO:弹出框方式以后改  
259 - alert("出错啦!"); 211 + });
260 } 212 }
261 - );  
262 - };  
263 213
264 -}]); 214 + // 提交方法
  215 + self.submit = function() {
  216 + console.log(self.employeeConfigForSave);
265 217
266 -angular.module('ScheduleApp').controller('EmployeeConfigFormCtrl', ['EmployeeConfigService', '$stateParams', '$state', function(employeeConfigService, $stateParams, $state) {  
267 - var self = this;  
268 -  
269 - // 欲保存的busInfo信息,绑定  
270 - self.employeeConfigForSave = {xl:{}, jsy:{}, spy:{}};  
271 -  
272 - // 获取传过来的id,有的话就是修改,获取一遍数据  
273 - var id = $stateParams.id;  
274 - if (id) {  
275 - self.employeeConfigForSave.id = id;  
276 - employeeConfigService.getDetail(id).then(  
277 - function(result) {  
278 - var key;  
279 - for (key in result) {  
280 - self.employeeConfigForSave[key] = result[key]; 218 + // 如果自对象没id值,设置成null
  219 + if (self.employeeConfigForSave.spy && !self.employeeConfigForSave.spy.id) {
  220 + self.employeeConfigForSave.spy = null;
281 } 221 }
282 222
283 - if (!self.employeeConfigForSave.spy) {  
284 - self.employeeConfigForSave.spy = {};  
285 - }  
286 -  
287 - },  
288 - function(result) {  
289 - alert("出错啦!");  
290 - }  
291 - );  
292 - }  
293 -  
294 - // 提交方法  
295 - self.submit = function() {  
296 - console.log(self.employeeConfigForSave);  
297 -  
298 - // 如果自对象没id值,设置成null  
299 - if (self.employeeConfigForSave.spy && !self.employeeConfigForSave.spy.id) {  
300 - self.employeeConfigForSave.spy = null;  
301 - }  
302 -  
303 - employeeConfigService.saveDetail(self.employeeConfigForSave).then(  
304 - function(result) {  
305 - // TODO:弹出框方式以后改  
306 - if (result.status == 'SUCCESS') {  
307 - alert("保存成功!"); 223 + self.employeeConfigForSave.$save(function() {
308 $state.go("employeeConfig"); 224 $state.go("employeeConfig");
309 - } else {  
310 - alert("保存异常!");  
311 - }  
312 - },  
313 - function(result) {  
314 - // TODO:弹出框方式以后改  
315 - alert("出错啦!");  
316 - }  
317 - );  
318 - }; 225 + });
  226 + };
319 }]); 227 }]);
320 228
321 -angular.module('ScheduleApp').controller('EmployeeConfigDetailCtrl', ['EmployeeConfigService', '$stateParams', function(employeeConfigService, $stateParams) {  
322 - var self = this;  
323 - self.title = "";  
324 - self.employeeConfigForDetail = {};  
325 - self.employeeConfigForDetail.id = $stateParams.id;  
326 -  
327 - // 当转向到此页面时,就获取明细信息并绑定  
328 - employeeConfigService.getDetail($stateParams.id).then(  
329 - function(result) {  
330 - var key;  
331 - for (key in result) {  
332 - self.employeeConfigForDetail[key] = result[key];  
333 - }  
334 -  
335 - self.title = "驾驶员 " + self.employeeConfigForDetail.jsy.personnelName + " 配置详细信息";  
336 - },  
337 - function(result) {  
338 - // TODO:弹出框方式以后改  
339 - alert("出错啦!"); 229 +// detail.html控制器
  230 +angular.module('ScheduleApp').controller(
  231 + 'EmployeeConfigDetailCtrl',
  232 + [
  233 + 'EmployeeConfigService',
  234 + '$stateParams',
  235 + function(service, $stateParams) {
  236 + var self = this;
  237 + var EmpConfig = service.getQueryClass();
  238 + var id = $stateParams.id;
  239 +
  240 + self.title = "";
  241 + self.employeeConfigForDetail = {};
  242 +
  243 + // 当转向到此页面时,就获取明细信息并绑定
  244 + EmpConfig.get({id: id}, function(value) {
  245 + self.employeeConfigForDetail = value;
  246 + self.title = "驾驶员 " +
  247 + self.employeeConfigForDetail.jsy.personnelName +
  248 + " 配置详细信息";
  249 + });
340 } 250 }
341 - );  
342 -}]); 251 + ]
  252 +);
343 253
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/service.js
@@ -9,10 +9,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f @@ -9,10 +9,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f
9 method: 'GET', 9 method: 'GET',
10 params: { 10 params: {
11 page: 0 11 page: 0
  12 + },
  13 + transformResponse: function(rs) {
  14 + var dst = angular.fromJson(rs);
  15 + if (dst.status == 'SUCCESS') {
  16 + return dst.data;
  17 + } else {
  18 + return dst; // 业务错误留给控制器处理
  19 + }
12 } 20 }
13 }, 21 },
14 get: { 22 get: {
15 - method: 'GET' 23 + method: 'GET',
  24 + transformResponse: function(rs) {
  25 + var dst = angular.fromJson(rs);
  26 + if (dst.status == 'SUCCESS') {
  27 + return dst.data;
  28 + } else {
  29 + return dst;
  30 + }
  31 + }
16 }, 32 },
17 save: { 33 save: {
18 method: 'POST' 34 method: 'POST'
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/edit.html
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 name="lpNo" placeholder="请输入路牌编号..." min="1" required 63 name="lpNo" placeholder="请输入路牌编号..." min="1" required
64 remote-Validation 64 remote-Validation
65 remotevtype="gbv1" 65 remotevtype="gbv1"
66 - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}" 66 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
67 67
68 /> 68 />
69 </div> 69 </div>
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 name="lpName" placeholder="请输入路牌名字..." required 85 name="lpName" placeholder="请输入路牌名字..." required
86 remote-Validation 86 remote-Validation
87 remotevtype="gbv2" 87 remotevtype="gbv2"
88 - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}" 88 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
89 89
90 /> 90 />
91 </div> 91 </div>
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/form.html
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 name="lpNo" placeholder="请输入路牌编号..." min="1" required 63 name="lpNo" placeholder="请输入路牌编号..." min="1" required
64 remote-Validation 64 remote-Validation
65 remotevtype="gbv1" 65 remotevtype="gbv1"
66 - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}" 66 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
67 67
68 /> 68 />
69 </div> 69 </div>
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 name="lpName" placeholder="请输入路牌名字..." required 85 name="lpName" placeholder="请输入路牌名字..." required
86 remote-Validation 86 remote-Validation
87 remotevtype="gbv2" 87 remotevtype="gbv2"
88 - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}" 88 + remotevparam="{{ {'id_eq': ctrl.guideboardManageForForm.id, 'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
89 89
90 /> 90 />
91 </div> 91 </div>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/index.html
@@ -27,10 +27,10 @@ @@ -27,10 +27,10 @@
27 <span class="caption-subject bold uppercase">时刻表</span> 27 <span class="caption-subject bold uppercase">时刻表</span>
28 </div> 28 </div>
29 <div class="actions"> 29 <div class="actions">
30 - <a ui-sref="ttInfoManage_test" class="btn btn-circle blue">  
31 - <i class="fa fa-plus"></i>  
32 - 测试  
33 - </a> 30 + <!--<a ui-sref="ttInfoManage_test" class="btn btn-circle blue">-->
  31 + <!--<i class="fa fa-plus"></i>-->
  32 + <!--测试-->
  33 + <!--</a>-->
34 <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> 34 <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()">
35 <i class="fa fa-plus"></i> 35 <i class="fa fa-plus"></i>
36 添加时刻表 36 添加时刻表
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 <td></td> 37 <td></td>
38 <td> 38 <td>
39 <label class="checkbox-inline"> 39 <label class="checkbox-inline">
40 - <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>作废 40 + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>作废
41 </label> 41 </label>
42 </td> 42 </td>
43 <td></td> 43 <td></td>
src/main/resources/static/real_control_v2/fragments/geo/calc_station_space.html
@@ -75,12 +75,12 @@ @@ -75,12 +75,12 @@
75 setCalcText('计算下行数据'); 75 setCalcText('计算下行数据');
76 var downCalcRs = calcStationSpace(stations[1], fullSections[1]); 76 var downCalcRs = calcStationSpace(stations[1], fullSections[1]);
77 77
78 - var locData={  
79 - stations: {up: upCalcRs,down: downCalcRs}, 78 + var locData = {
  79 + stations: {up: upCalcRs, down: downCalcRs},
80 sections: {up: fullSections[0], down: fullSections[1]} 80 sections: {up: fullSections[0], down: fullSections[1]}
81 }; 81 };
82 82
83 - window.localStorage.setItem('control_route_distance_'+sch.xlBm, JSON.stringify(locData)); 83 + window.localStorage.setItem('control_route_distance_' + sch.xlBm, JSON.stringify(locData));
84 //console.log('结果', locData); 84 //console.log('结果', locData);
85 } 85 }
86 86
@@ -171,6 +171,13 @@ @@ -171,6 +171,13 @@
171 this.toDistance = distance; 171 this.toDistance = distance;
172 s = e; 172 s = e;
173 }); 173 });
  174 +
  175 + //首站
  176 + nearArray.splice(0, 0, {
  177 + distance: 0,
  178 + station: stations[0],
  179 + toDistance: 0
  180 + });
174 return nearArray; 181 return nearArray;
175 } 182 }
176 183
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
@@ -322,7 +322,8 @@ @@ -322,7 +322,8 @@
322 name: "添加子任务", 322 name: "添加子任务",
323 items: { 323 items: {
324 'add_sub_task_in': { 324 'add_sub_task_in': {
325 - name: '回场' 325 + name: '回场',
  326 + disabled: true
326 }, 327 },
327 'add_sub_task_out': { 328 'add_sub_task_out': {
328 name: '出场', 329 name: '出场',
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
@@ -191,7 +191,7 @@ @@ -191,7 +191,7 @@
191 <button type="button" class="uk-button uk-button-primary">提交子任务</button> 191 <button type="button" class="uk-button uk-button-primary">提交子任务</button>
192 192
193 <div class="ct-footer-left"> 193 <div class="ct-footer-left">
194 - <a id="betweenStationRangeCalc" data-drawer-id="cal_station_space_drawer">站点间公里不准?</a> 194 + <a id="betweenStationRangeCalc" data-drawer-id="station_route_spacing_chart_drawer">站点间公里不准?</a>
195 </div> 195 </div>
196 </div> 196 </div>
197 </div> 197 </div>
@@ -211,7 +211,7 @@ @@ -211,7 +211,7 @@
211 serviceForm = $('form[service_form]', modal), 211 serviceForm = $('form[service_form]', modal),
212 emptyForm = $('form[empty_form]', modal), 212 emptyForm = $('form[empty_form]', modal),
213 destroyForm = $('form[destroy_form]', modal), 213 destroyForm = $('form[destroy_form]', modal),
214 - sch, stationRoutes, parks, information, esCode; 214 + sch, stationRoutes, parks, information, esCode, timeLocStations;
215 var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; 215 var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
216 $(modal).on('init', function (e, data) { 216 $(modal).on('init', function (e, data) {
217 sch = data.sch; 217 sch = data.sch;
@@ -235,26 +235,17 @@ @@ -235,26 +235,17 @@
235 }); 235 });
236 //线路标准 236 //线路标准
237 information = gb_data_basic.getLineInformation(sch.xlBm); 237 information = gb_data_basic.getLineInformation(sch.xlBm);
  238 + //本地存储的站点耗时
  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 + }
238 246
239 - var routeOpts = '';  
240 - $.each(stationRoutes, function () {  
241 - routeOpts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>';  
242 - });  
243 - esCode = stationRoutes[stationRoutes.length - 1].stationCode;  
244 -  
245 - //营运起终点  
246 - $('select[name=startStation],select[name=endStation]', serviceForm).html(routeOpts);  
247 - //空驶起点  
248 - $('select[name=startStation]', emptyForm).html(routeOpts).val(esCode);  
249 - //烂班起终点  
250 - $('select[name=startStation],select[name=endStation]', destroyForm).html(routeOpts).val(esCode);  
251 -  
252 - //烂班原因  
253 - var adjustExpsOpts = '<option value="">请选择...</option>';  
254 - $.each(adjustExps, function (i, str) {  
255 - adjustExpsOpts += '<option value="' + str + '">' + str + '</option>';  
256 - });  
257 - $('select[name=destroyReason]', destroyForm).html(adjustExpsOpts); 247 + //设置默认值
  248 + setDefaultVal();
258 249
259 //切换营运终点 250 //切换营运终点
260 $('select[name=endStation]', serviceForm).val(esCode).on('change', function () { 251 $('select[name=endStation]', serviceForm).val(esCode).on('change', function () {
@@ -269,7 +260,7 @@ @@ -269,7 +260,7 @@
269 } 260 }
270 261
271 reClac(); 262 reClac();
272 - }); 263 + }).trigger('change');
273 264
274 265
275 //submit 266 //submit
@@ -285,35 +276,86 @@ @@ -285,35 +276,86 @@
285 });*/ 276 });*/
286 }); 277 });
287 278
  279 + function setDefaultVal() {
  280 + var routeOpts = '';
  281 + $.each(stationRoutes, function () {
  282 + routeOpts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>';
  283 + });
  284 + esCode = stationRoutes[stationRoutes.length - 1].stationCode;
  285 +
  286 + //营运起终点
  287 + $('select[name=startStation],select[name=endStation]', serviceForm).html(routeOpts);
  288 + //空驶起点
  289 + $('select[name=startStation]', emptyForm).html(routeOpts).val(esCode);
  290 + //烂班起终点
  291 + $('select[name=startStation],select[name=endStation]', destroyForm).html(routeOpts).val(esCode);
  292 +
  293 + //烂班原因
  294 + var adjustExpsOpts = '<option value="">请选择...</option>';
  295 + $.each(adjustExps, function (i, str) {
  296 + adjustExpsOpts += '<option value="' + str + '">' + str + '</option>';
  297 + });
  298 + $('select[name=destroyReason]', destroyForm).html(adjustExpsOpts);
  299 +
  300 + //营运开始时间
  301 + $('input[name=startDate]', serviceForm).val(sch.dfsj);
  302 + }
  303 +
288 function reClac() { 304 function reClac() {
289 var serviceEnd = $('select[name=endStation]', serviceForm).val(); 305 var serviceEnd = $('select[name=endStation]', serviceForm).val();
290 //空驶起点 == 营运终点 306 //空驶起点 == 营运终点
291 $('select[name=startStation]', emptyForm).val(serviceEnd); 307 $('select[name=startStation]', emptyForm).val(serviceEnd);
292 308
  309 + //计算营运里程
  310 + var s = $('select[name=startStation]', serviceForm).val(),
  311 + e = $('select[name=endStation]', serviceForm).val();
  312 + var sMileage = calcMileage(s, e);
  313 + if(sMileage >= 0)
  314 + $('input[name=mileageType]', serviceForm).val(sMileage);
  315 +
293 if (serviceEnd != esCode) { 316 if (serviceEnd != esCode) {
294 //烂班起点 == 营运终点 317 //烂班起点 == 营运终点
295 $('select[name=startStation]', destroyForm).val(serviceEnd); 318 $('select[name=startStation]', destroyForm).val(serviceEnd);
296 } 319 }
297 } 320 }
298 321
  322 + function calcMileage(s, e) {
  323 + var mileage = 0, flag, code;
  324 + if (timeLocStations) {
  325 + $.each(timeLocStations, function () {
  326 + code = this.station.STATION_CODE;
  327 + if (code == s) {
  328 + flag = true;
  329 + }
  330 +
  331 + if (flag)
  332 + mileage += this.toDistance;
  333 +
  334 + if (code == e)
  335 + return false;
  336 + });
  337 + }
  338 + return mileage / 1000;
  339 + }
  340 +
299 341
300 //------ 下抽屉 ------ 342 //------ 下抽屉 ------
301 $('#betweenStationRangeCalc', modal).on('click', function () { 343 $('#betweenStationRangeCalc', modal).on('click', function () {
302 var id = $(this).data('drawer-id'); 344 var id = $(this).data('drawer-id');
303 - switchBtmDrawer(id, '/real_control_v2/fragments/geo/calc_station_space.html'); 345 + switchBtmDrawer(id, '/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html');
304 }); 346 });
305 347
306 var btmDrawer = $('.ct-bottom-drawer', modal); 348 var btmDrawer = $('.ct-bottom-drawer', modal);
307 //打开事件 349 //打开事件
308 btmDrawer.on('drawer_show', function () { 350 btmDrawer.on('drawer_show', function () {
309 var url = $(this).data('url'); 351 var url = $(this).data('url');
310 - if(!url){ 352 + if (!url) {
311 alert('无效的地址'); 353 alert('无效的地址');
312 } 354 }
313 355
314 - var drawerPanel=$(this).data('name'); 356 + var drawerPanel = $(this).data('name');
315 $('.ct-bottom-drawer-body', btmDrawer).load(url, function () { 357 $('.ct-bottom-drawer-body', btmDrawer).load(url, function () {
316 - $('#'+drawerPanel).trigger('drawer-init', {sch: sch}); 358 + $('#' + drawerPanel).trigger('drawer-init', {sch: sch});
317 }); 359 });
318 }); 360 });
319 361
@@ -329,4 +371,4 @@ @@ -329,4 +371,4 @@
329 } 371 }
330 })(); 372 })();
331 </script> 373 </script>
332 -</div> 374 +</div>
333 \ No newline at end of file 375 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/station_route_spacing_chart.html 0 → 100644
  1 +<!-- 站点路由间距图 -->
  2 +<div id="station_route_spacing_chart_drawer" style="width: 100%;height: 100%;font-size: 0;">
  3 + <div style="width: 80%;height: 100%;display: inline-block;font-size: 14px;">
  4 +
  5 + </div>
  6 +
  7 + <div style="width: 20%;height: 100%;display: inline-block;">
  8 +
  9 + </div>
  10 +
  11 + <script>
  12 +
  13 + (function () {
  14 + var drawer = '#station_route_spacing_chart_drawer'
  15 + , sch, locData;
  16 +
  17 + $(drawer).on('drawer-init', function (e, data) {
  18 + //console.log('data', data);
  19 + sch = data.sch;
  20 + locData = window.localStorage.getItem('control_route_distance_' + sch.xlBm);
  21 +
  22 + if(locData)
  23 + drawCharts();
  24 + else
  25 + drawerLoadPage('/real_control_v2/fragments/geo/calc_station_space.html','cal_station_space_drawer');
  26 + });
  27 +
  28 + function drawCharts() {
  29 + //console.log('开始绘图', locData);
  30 + var stations;
  31 + try {
  32 + stations = JSON.parse(locData).stations[sch.xlDir == 0 ? 'up' : 'down'];
  33 + }catch (e){
  34 + alert('数据异常!!');
  35 + return;
  36 + }
  37 +
  38 + console.log('stations..', stations);
  39 + }
  40 +
  41 + //页面切换
  42 + function drawerLoadPage(url, id) {
  43 + $(drawer).parent('.ct-bottom-drawer-body').load(url, function () {
  44 + $('#' + id).trigger('drawer-init', {sch: sch});
  45 + });
  46 + }
  47 + })();
  48 + </script>
  49 +</div>
0 \ No newline at end of file 50 \ No newline at end of file