Commit 94e0e6c144ee33c0187ebe58df475df05a909fa9

Authored by 潘钊
2 parents f3b59716 cf0771db

update

Showing 52 changed files with 2176 additions and 2030 deletions

Too many changes to show.

To preserve performance only 52 of 71 files are displayed.

src/main/java/com/bsth/controller/schedule/BController.java
1   -package com.bsth.controller.schedule;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.service.schedule.BService;
5   -import com.bsth.service.schedule.ScheduleException;
6   -import com.google.common.base.Splitter;
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.data.domain.PageRequest;
9   -import org.springframework.data.domain.Sort;
10   -import org.springframework.web.bind.annotation.*;
11   -
12   -import java.io.Serializable;
13   -import java.util.ArrayList;
14   -import java.util.HashMap;
15   -import java.util.List;
16   -import java.util.Map;
17   -
18   -/**
19   - * 基础控制器。
20   - */
21   -public class BController<T, ID extends Serializable> {
22   - @Autowired
23   - protected BService<T, ID> bService;
24   -
25   - // CRUD 操作
26   - // Create操作
27   - @RequestMapping(method = RequestMethod.POST)
28   - public Map<String, Object> save(@RequestBody T t) {
29   - T t_saved = bService.save(t);
30   - Map<String, Object> rtn = new HashMap<>();
31   - rtn.put("status", ResponseCode.SUCCESS);
32   - rtn.put("data", t_saved);
33   - return rtn;
34   - }
35   - // Update操作
36   - @RequestMapping(value="/{id}", method = RequestMethod.POST)
37   - public Map<String, Object> update(@RequestBody T t) {
38   - return save(t);
39   - }
40   - // Research操作
41   - @RequestMapping(value = "/{id}", method = RequestMethod.GET)
42   - public Map<String, Object> findById(@PathVariable("id") ID id) {
43   - T t = bService.findById(id);
44   - Map<String, Object> rtn = new HashMap<>();
45   - rtn.put("status", ResponseCode.SUCCESS);
46   - rtn.put("data", t);
47   - return rtn;
48   - }
49   - @RequestMapping(value = "/all", method = RequestMethod.GET)
50   - public Map<String, Object> list(@RequestParam Map<String, Object> param) {
51   - List<T> tList = bService.list(param);
52   - Map<String, Object> rtn = new HashMap<>();
53   - rtn.put("status", ResponseCode.SUCCESS);
54   - rtn.put("data", tList);
55   - return rtn;
56   - }
57   - @RequestMapping(method = RequestMethod.GET)
58   - public Map<String, Object> list(
59   - @RequestParam Map<String, Object> map,
60   - @RequestParam(defaultValue = "0") int page,
61   - @RequestParam(defaultValue = "10") int size,
62   - @RequestParam(defaultValue = "id") String order,
63   - @RequestParam(defaultValue = "DESC") String direction) {
64   - // 允许多个字段排序,order可以写单个字段,也可以写多个字段
65   - // 多个字段格式:{col1},{col2},{col3},....,{coln}
66   - List<String> order_columns = Splitter.on(",").trimResults().splitToList(order);
67   - // 多字段排序:DESC,ASC...
68   - List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction);
69   -
70   - Map<String, Object> rtn = new HashMap<>();
71   -
72   - if (order_dirs.size() == 1) { // 所有字段采用一种排序
73   - rtn.put("status", ResponseCode.SUCCESS);
74   - if (order_dirs.get(0).equals("ASC")) {
75   - rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns))));
76   - } else {
77   - rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns))));
78   - }
79   - } else if (order_columns.size() == order_dirs.size()) {
80   - List<Sort.Order> orderList = new ArrayList<>();
81   - for (int i = 0; i < order_columns.size(); i++) {
82   - if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) {
83   - orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i)));
84   - } else {
85   - orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i)));
86   - }
87   - }
88   - rtn.put("status", ResponseCode.SUCCESS);
89   - rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(orderList))));
90   - } else {
91   - throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致");
92   - }
93   -
94   - return rtn;
95   -
96   - }
97   -
98   - // Delete操作
99   - @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
100   - public Map<String, Object> delete(@PathVariable("id") ID id) {
101   - Map<String, Object> rtn = new HashMap<>();
102   - try {
103   - bService.delete(id);
104   - rtn.put("status", ResponseCode.SUCCESS);
105   - } catch (ScheduleException exp) {
106   - rtn.put("status", ResponseCode.ERROR);
107   - rtn.put("msg", exp.getMessage());
108   - }
109   -
110   - return rtn;
111   - }
112   -
113   -}
  1 +package com.bsth.controller.schedule;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.service.schedule.BService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import com.google.common.base.Splitter;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.data.domain.PageRequest;
  9 +import org.springframework.data.domain.Sort;
  10 +import org.springframework.web.bind.annotation.*;
  11 +
  12 +import java.io.Serializable;
  13 +import java.util.ArrayList;
  14 +import java.util.HashMap;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +/**
  19 + * 基础控制器。
  20 + */
  21 +public class BController<T, ID extends Serializable> {
  22 + @Autowired
  23 + protected BService<T, ID> bService;
  24 +
  25 + // CRUD 操作
  26 + // Create操作
  27 + @RequestMapping(method = RequestMethod.POST)
  28 + public Map<String, Object> save(@RequestBody T t) {
  29 + T t_saved = bService.save(t);
  30 + Map<String, Object> rtn = new HashMap<>();
  31 + rtn.put("status", ResponseCode.SUCCESS);
  32 + rtn.put("data", t_saved);
  33 + return rtn;
  34 + }
  35 + // Update操作
  36 + @RequestMapping(value="/{id}", method = RequestMethod.POST)
  37 + public Map<String, Object> update(@RequestBody T t) {
  38 + return save(t);
  39 + }
  40 + // Research操作
  41 + @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  42 + public Map<String, Object> findById(@PathVariable("id") ID id) {
  43 + T t = bService.findById(id);
  44 + Map<String, Object> rtn = new HashMap<>();
  45 + rtn.put("status", ResponseCode.SUCCESS);
  46 + rtn.put("data", t);
  47 + return rtn;
  48 + }
  49 + @RequestMapping(value = "/all", method = RequestMethod.GET)
  50 + public Map<String, Object> list(@RequestParam Map<String, Object> param) {
  51 + List<T> tList = bService.list(param);
  52 + Map<String, Object> rtn = new HashMap<>();
  53 + rtn.put("status", ResponseCode.SUCCESS);
  54 + rtn.put("data", tList);
  55 + return rtn;
  56 + }
  57 + @RequestMapping(method = RequestMethod.GET)
  58 + public Map<String, Object> list(
  59 + @RequestParam Map<String, Object> map,
  60 + @RequestParam(defaultValue = "0") int page,
  61 + @RequestParam(defaultValue = "10") int size,
  62 + @RequestParam(defaultValue = "id") String order,
  63 + @RequestParam(defaultValue = "DESC") String direction) {
  64 + // 允许多个字段排序,order可以写单个字段,也可以写多个字段
  65 + // 多个字段格式:{col1},{col2},{col3},....,{coln}
  66 + List<String> order_columns = Splitter.on(",").trimResults().splitToList(order);
  67 + // 多字段排序:DESC,ASC...
  68 + List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction);
  69 +
  70 + Map<String, Object> rtn = new HashMap<>();
  71 +
  72 + if (order_dirs.size() == 1) { // 所有字段采用一种排序
  73 + rtn.put("status", ResponseCode.SUCCESS);
  74 + if (order_dirs.get(0).equals("ASC")) {
  75 + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns))));
  76 + } else {
  77 + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns))));
  78 + }
  79 + } else if (order_columns.size() == order_dirs.size()) {
  80 + List<Sort.Order> orderList = new ArrayList<>();
  81 + for (int i = 0; i < order_columns.size(); i++) {
  82 + if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) {
  83 + orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i)));
  84 + } else {
  85 + orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i)));
  86 + }
  87 + }
  88 + rtn.put("status", ResponseCode.SUCCESS);
  89 + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(orderList))));
  90 + } else {
  91 + throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致");
  92 + }
  93 +
  94 + return rtn;
  95 +
  96 + }
  97 +
  98 + // Delete操作
  99 + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
  100 + public Map<String, Object> delete(@PathVariable("id") ID id) {
  101 + Map<String, Object> rtn = new HashMap<>();
  102 + try {
  103 + bService.delete(id);
  104 + rtn.put("status", ResponseCode.SUCCESS);
  105 + } catch (ScheduleException exp) {
  106 + rtn.put("status", ResponseCode.ERROR);
  107 + rtn.put("msg", exp.getMessage());
  108 + }
  109 +
  110 + return rtn;
  111 + }
  112 +
  113 +}
... ...
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/basicinfo/CarsController.java
1   -package com.bsth.controller.schedule.basicinfo;
2   -
3   -import com.bsth.common.ResponseCode;
4   -import com.bsth.controller.schedule.BController;
5   -import com.bsth.entity.Cars;
6   -import com.bsth.service.schedule.CarsService;
7   -import com.bsth.service.schedule.ScheduleException;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RequestParam;
12   -import org.springframework.web.bind.annotation.RestController;
13   -
14   -import java.util.HashMap;
15   -import java.util.Map;
16   -
17   -/**
18   - * 车辆基础信息controller
19   - */
20   -@RestController(value = "carsController_sc")
21   -@RequestMapping("cars_sc")
22   -public class CarsController extends BController<Cars, Integer> {
23   - @Autowired
24   - private CarsService carsService;
25   -
26   - @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET)
27   - public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) {
28   - Map<String, Object> rtn = new HashMap<>();
29   - try {
30   - // 自编号验证
31   - Cars cars = new Cars(
32   - param.get("id_eq"),
33   - param.get("insideCode_eq"),
34   - null,
35   - null,
36   - null);
37   - carsService.validate_nbbh(cars);
38   - rtn.put("status", ResponseCode.SUCCESS);
39   - } catch (ScheduleException exp) {
40   - rtn.put("status", ResponseCode.ERROR);
41   - rtn.put("msg", exp.getMessage());
42   - }
43   - return rtn;
44   - }
45   -
46   - @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET)
47   - public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) {
48   - Map<String, Object> rtn = new HashMap<>();
49   - try {
50   - // 车辆编号验证
51   - Cars cars = new Cars(
52   - param.get("id_eq"),
53   - null,
54   - param.get("carCode_eq"),
55   - null,
56   - null);
57   - carsService.validate_clbh(cars);
58   - rtn.put("status", ResponseCode.SUCCESS);
59   - } catch (ScheduleException exp) {
60   - rtn.put("status", ResponseCode.ERROR);
61   - rtn.put("msg", exp.getMessage());
62   - }
63   - return rtn;
64   - }
65   -
66   - @RequestMapping(value = "/validate_cph", method = RequestMethod.GET)
67   - public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) {
68   - Map<String, Object> rtn = new HashMap<>();
69   - try {
70   - // 车牌号验证
71   - Cars cars = new Cars(
72   - param.get("id_eq"),
73   - null,
74   - null,
75   - param.get("carPlate_eq"),
76   - null);
77   - carsService.validate_cph(cars);
78   - rtn.put("status", ResponseCode.SUCCESS);
79   - } catch (ScheduleException exp) {
80   - rtn.put("status", ResponseCode.ERROR);
81   - rtn.put("msg", exp.getMessage());
82   - }
83   - return rtn;
84   - }
85   -
86   - @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET)
87   - public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) {
88   - Map<String, Object> rtn = new HashMap<>();
89   - try {
90   - // 设备编号验证
91   - Cars cars = new Cars(
92   - param.get("id_eq"),
93   - null,
94   - null,
95   - null,
96   - param.get("equipmentCode_eq")
97   - );
98   - carsService.validate_sbbh(cars);
99   - rtn.put("status", ResponseCode.SUCCESS);
100   - } catch (ScheduleException exp) {
101   - rtn.put("status", ResponseCode.ERROR);
102   - rtn.put("msg", exp.getMessage());
103   - }
104   - return rtn;
105   - }
106   -}
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.Cars;
  6 +import com.bsth.service.schedule.CarsService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * 车辆基础信息controller
  19 + */
  20 +@RestController(value = "carsController_sc")
  21 +@RequestMapping("cars_sc")
  22 +public class CarsController extends BController<Cars, Integer> {
  23 + @Autowired
  24 + private CarsService carsService;
  25 +
  26 + @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 + try {
  30 + // 自编号验证
  31 + Cars cars = new Cars(
  32 + param.get("id_eq"),
  33 + param.get("insideCode_eq"),
  34 + null,
  35 + null,
  36 + null);
  37 + carsService.validate_nbbh(cars);
  38 + rtn.put("status", ResponseCode.SUCCESS);
  39 + } catch (ScheduleException exp) {
  40 + rtn.put("status", ResponseCode.ERROR);
  41 + rtn.put("msg", exp.getMessage());
  42 + }
  43 + return rtn;
  44 + }
  45 +
  46 + @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET)
  47 + public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) {
  48 + Map<String, Object> rtn = new HashMap<>();
  49 + try {
  50 + // 车辆编号验证
  51 + Cars cars = new Cars(
  52 + param.get("id_eq"),
  53 + null,
  54 + param.get("carCode_eq"),
  55 + null,
  56 + null);
  57 + carsService.validate_clbh(cars);
  58 + rtn.put("status", ResponseCode.SUCCESS);
  59 + } catch (ScheduleException exp) {
  60 + rtn.put("status", ResponseCode.ERROR);
  61 + rtn.put("msg", exp.getMessage());
  62 + }
  63 + return rtn;
  64 + }
  65 +
  66 + @RequestMapping(value = "/validate_cph", method = RequestMethod.GET)
  67 + public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) {
  68 + Map<String, Object> rtn = new HashMap<>();
  69 + try {
  70 + // 车牌号验证
  71 + Cars cars = new Cars(
  72 + param.get("id_eq"),
  73 + null,
  74 + null,
  75 + param.get("carPlate_eq"),
  76 + null);
  77 + carsService.validate_cph(cars);
  78 + rtn.put("status", ResponseCode.SUCCESS);
  79 + } catch (ScheduleException exp) {
  80 + rtn.put("status", ResponseCode.ERROR);
  81 + rtn.put("msg", exp.getMessage());
  82 + }
  83 + return rtn;
  84 + }
  85 +
  86 + @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET)
  87 + public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) {
  88 + Map<String, Object> rtn = new HashMap<>();
  89 + try {
  90 + // 设备编号验证
  91 + Cars cars = new Cars(
  92 + param.get("id_eq"),
  93 + null,
  94 + null,
  95 + null,
  96 + param.get("equipmentCode_eq")
  97 + );
  98 + carsService.validate_sbbh(cars);
  99 + rtn.put("status", ResponseCode.SUCCESS);
  100 + } catch (ScheduleException exp) {
  101 + rtn.put("status", ResponseCode.ERROR);
  102 + rtn.put("msg", exp.getMessage());
  103 + }
  104 + return rtn;
  105 + }
  106 +}
... ...
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("xl.id_eq"),
  48 + param.get("xl.name_eq"),
  49 + param.get("cl.id_eq")
  50 + );
  51 + carConfigInfoService.validate_cars(carConfigInfo);
  52 + rtn.put("status", ResponseCode.SUCCESS);
  53 + } catch (ScheduleException exp) {
  54 + rtn.put("status", ResponseCode.ERROR);
  55 + rtn.put("msg", exp.getMessage());
  56 + }
  57 +
  58 + return rtn;
  59 + }
  60 +}
... ...
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("xl.id_eq"),
  48 + param.get("xl.name_eq"),
  49 + param.get("jsy.id_eq"),
  50 + null
  51 + );
  52 + employeeConfigInfoService.validate_jsy(employeeConfigInfo);
  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 +
  62 + @RequestMapping(value = "/validate_spy", method = RequestMethod.GET)
  63 + public Map<String, Object> validate_spy(@RequestParam Map<String, Object> param) {
  64 + Map<String, Object> rtn = new HashMap<>();
  65 + try {
  66 + EmployeeConfigInfo employeeConfigInfo = new EmployeeConfigInfo(
  67 + param.get("xl.id_eq"),
  68 + param.get("xl.name_eq"),
  69 + null,
  70 + param.get("spy.id_eq")
  71 + );
  72 + employeeConfigInfoService.validate_spy(employeeConfigInfo);
  73 + rtn.put("status", ResponseCode.SUCCESS);
  74 + } catch (ScheduleException exp) {
  75 + rtn.put("status", ResponseCode.ERROR);
  76 + rtn.put("msg", exp.getMessage());
  77 + }
  78 + return rtn;
  79 + }
  80 +}
... ...
src/main/java/com/bsth/entity/Personnel.java
1 1 package com.bsth.entity;
2 2  
3 3 import com.bsth.entity.sys.SysUser;
  4 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 5  
5 6 import javax.persistence.*;
6 7 import java.util.Date;
... ... @@ -21,6 +22,7 @@ import java.util.Date;
21 22  
22 23 @Entity
23 24 @Table(name = "bsth_c_personnel")
  25 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
24 26 public class Personnel {
25 27  
26 28 /** 主键Id */
... ...
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
... ... @@ -3,6 +3,7 @@ package com.bsth.entity.schedule;
3 3 import com.bsth.entity.Cars;
4 4 import com.bsth.entity.Line;
5 5 import com.bsth.entity.sys.SysUser;
  6 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6 7  
7 8 import javax.persistence.*;
8 9 import java.io.Serializable;
... ... @@ -19,6 +20,7 @@ import java.util.Date;
19 20 @NamedAttributeNode("cl")
20 21 })
21 22 })
  23 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
22 24 public class CarConfigInfo implements Serializable {
23 25  
24 26 /** 主健Id */
... ... @@ -71,6 +73,22 @@ public class CarConfigInfo implements Serializable {
71 73 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
72 74 private Date updateDate;
73 75  
  76 + public CarConfigInfo() {}
  77 + public CarConfigInfo(Object xlid, Object xlname, Object clid) {
  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 (clid != null) {
  85 + Cars cars = new Cars();
  86 + cars.setId(Integer.valueOf(clid.toString()));
  87 + this.cl = cars;
  88 + }
  89 +
  90 + }
  91 +
74 92 public Long getId() {
75 93 return id;
76 94 }
... ...
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
... ... @@ -4,6 +4,7 @@ import com.bsth.entity.Cars;
4 4 import com.bsth.entity.Line;
5 5 import com.bsth.entity.Personnel;
6 6 import com.bsth.entity.sys.SysUser;
  7 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
7 8 import org.hibernate.annotations.Formula;
8 9  
9 10 import javax.persistence.*;
... ... @@ -22,6 +23,7 @@ import java.util.Date;
22 23 @NamedAttributeNode("xl")
23 24 })
24 25 })
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
25 27 public class EmployeeConfigInfo {
26 28  
27 29 /** 主键Id */
... ... @@ -67,6 +69,27 @@ public class EmployeeConfigInfo {
67 69 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
68 70 private Date updateDate;
69 71  
  72 + public EmployeeConfigInfo() {}
  73 +
  74 + public EmployeeConfigInfo(Object xlid, Object xlname, Object jsyid, Object spyid) {
  75 + if (xlid != null && xlname != null) {
  76 + Line line = new Line();
  77 + line.setId(Integer.valueOf(xlid.toString()));
  78 + line.setName(xlname.toString());
  79 + this.xl = line;
  80 + }
  81 + if (jsyid != null) {
  82 + Personnel personnel = new Personnel();
  83 + personnel.setId(Integer.valueOf(jsyid.toString()));
  84 + this.jsy = personnel;
  85 + }
  86 + if (spyid != null) {
  87 + Personnel personnel = new Personnel();
  88 + personnel.setId(Integer.valueOf(spyid.toString()));
  89 + this.spy = personnel;
  90 + }
  91 + }
  92 +
70 93 public Long getId() {
71 94 return id;
72 95 }
... ...
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
... ... @@ -163,8 +163,10 @@ public class SchedulePlanInfo {
163 163  
164 164 // TODO:关联的公司名称
165 165 // TODO:关联的公司编码
  166 + this.gsBm = xl.getCompany();
166 167 // TODO:关联的分公司名称
167 168 // TODO:关联的分公司编码
  169 + this.fgsBm = xl.getBrancheCompany();
168 170 // TODO:关联的出场顺序号
169 171  
170 172 // 关联的排班计划
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -525,7 +525,8 @@ public class FormsServiceImpl implements FormsService {
525 525 tu.setRq(rq);
526 526 tu.setGs(arg0.getString("gs_name").toString());
527 527 tu.setZhgs(arg0.getString("fgs_name").toString());
528   - tu.setXl(arg0.getString("xlgs"));
  528 + //tu.setXl(arg0.getString("xlgs"));这个是根据公司判断线路有几条
  529 + tu.setXl(arg0.getString("sxl"));
529 530 tu.setXlmc(arg0.getString("sxl"));
530 531 tu.setCchjh(arg0.getString("jcl").toString());
531 532 tu.setCchsj(arg0.getString("scl").toString());
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -133,7 +133,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
133 133 DO:{
134 134 if(model.length() != 0){
135 135 for(Long tt : ttList){
136   - if(tt == schedule.getSpId()){
  136 + if((long)tt == (long)schedule.getSpId()){
137 137 resList.add(schedule);
138 138 break DO;
139 139 }
... ...
src/main/java/com/bsth/service/realcontrol/dto/SectionRouteCoords.java
1   -package com.bsth.service.realcontrol.dto;
2   -
3   -/**
4   - * 线调地图 路段路由DTO
5   - * Created by panzhao on 2016/12/1.
6   - */
7   -public class SectionRouteCoords {
8   -
9   - private int id;
10   -
11   - private String lineCode;
12   -
13   - private String sectionCode;
14   -
15   - private String sectionrouteCode;
16   -
17   - private int directions;
18   -
19   - private String sectionName;
20   -
21   - private String gsectionVector;
22   -
23   - private Float sectionDistance;
24   -
25   - private Float sectionTime;
26   -
27   - public int getId() {
28   - return id;
29   - }
30   -
31   - public void setId(int id) {
32   - this.id = id;
33   - }
34   -
35   - public String getLineCode() {
36   - return lineCode;
37   - }
38   -
39   - public void setLineCode(String lineCode) {
40   - this.lineCode = lineCode;
41   - }
42   -
43   - public String getSectionCode() {
44   - return sectionCode;
45   - }
46   -
47   - public void setSectionCode(String sectionCode) {
48   - this.sectionCode = sectionCode;
49   - }
50   -
51   - public String getSectionrouteCode() {
52   - return sectionrouteCode;
53   - }
54   -
55   - public void setSectionrouteCode(String sectionrouteCode) {
56   - this.sectionrouteCode = sectionrouteCode;
57   - }
58   -
59   - public int getDirections() {
60   - return directions;
61   - }
62   -
63   - public void setDirections(int directions) {
64   - this.directions = directions;
65   - }
66   -
67   - public String getSectionName() {
68   - return sectionName;
69   - }
70   -
71   - public void setSectionName(String sectionName) {
72   - this.sectionName = sectionName;
73   - }
74   -
75   - public String getGsectionVector() {
76   - return gsectionVector;
77   - }
78   -
79   - public void setGsectionVector(String gsectionVector) {
80   - this.gsectionVector = gsectionVector;
81   - }
82   -
83   - public Float getSectionDistance() {
84   - return sectionDistance;
85   - }
86   -
87   - public void setSectionDistance(Float sectionDistance) {
88   - this.sectionDistance = sectionDistance;
89   - }
90   -
91   - public Float getSectionTime() {
92   - return sectionTime;
93   - }
94   -
95   - public void setSectionTime(Float sectionTime) {
96   - this.sectionTime = sectionTime;
97   - }
98   -}
  1 +package com.bsth.service.realcontrol.dto;
  2 +
  3 +/**
  4 + * 线调地图 路段路由DTO
  5 + * Created by panzhao on 2016/12/1.
  6 + */
  7 +public class SectionRouteCoords {
  8 +
  9 + private int id;
  10 +
  11 + private String lineCode;
  12 +
  13 + private String sectionCode;
  14 +
  15 + private String sectionrouteCode;
  16 +
  17 + private int directions;
  18 +
  19 + private String sectionName;
  20 +
  21 + private String gsectionVector;
  22 +
  23 + private Float sectionDistance;
  24 +
  25 + private Float sectionTime;
  26 +
  27 + public int getId() {
  28 + return id;
  29 + }
  30 +
  31 + public void setId(int id) {
  32 + this.id = id;
  33 + }
  34 +
  35 + public String getLineCode() {
  36 + return lineCode;
  37 + }
  38 +
  39 + public void setLineCode(String lineCode) {
  40 + this.lineCode = lineCode;
  41 + }
  42 +
  43 + public String getSectionCode() {
  44 + return sectionCode;
  45 + }
  46 +
  47 + public void setSectionCode(String sectionCode) {
  48 + this.sectionCode = sectionCode;
  49 + }
  50 +
  51 + public String getSectionrouteCode() {
  52 + return sectionrouteCode;
  53 + }
  54 +
  55 + public void setSectionrouteCode(String sectionrouteCode) {
  56 + this.sectionrouteCode = sectionrouteCode;
  57 + }
  58 +
  59 + public int getDirections() {
  60 + return directions;
  61 + }
  62 +
  63 + public void setDirections(int directions) {
  64 + this.directions = directions;
  65 + }
  66 +
  67 + public String getSectionName() {
  68 + return sectionName;
  69 + }
  70 +
  71 + public void setSectionName(String sectionName) {
  72 + this.sectionName = sectionName;
  73 + }
  74 +
  75 + public String getGsectionVector() {
  76 + return gsectionVector;
  77 + }
  78 +
  79 + public void setGsectionVector(String gsectionVector) {
  80 + this.gsectionVector = gsectionVector;
  81 + }
  82 +
  83 + public Float getSectionDistance() {
  84 + return sectionDistance;
  85 + }
  86 +
  87 + public void setSectionDistance(Float sectionDistance) {
  88 + this.sectionDistance = sectionDistance;
  89 + }
  90 +
  91 + public Float getSectionTime() {
  92 + return sectionTime;
  93 + }
  94 +
  95 + public void setSectionTime(Float sectionTime) {
  96 + this.sectionTime = sectionTime;
  97 + }
  98 +}
... ...
src/main/java/com/bsth/service/schedule/BService.java
1   -package com.bsth.service.schedule;
2   -
3   -import org.springframework.data.domain.Page;
4   -import org.springframework.data.domain.Pageable;
5   -
6   -import java.io.Serializable;
7   -import java.util.List;
8   -import java.util.Map;
9   -
10   -/**
11   - * 基础service接口。
12   - */
13   -public interface BService<T, ID extends Serializable> {
14   - // CRUD 操作
15   - // Create,Update操作
16   - T save(T t);
17   - <S extends T> List<S> bulkSave(List<S> entities); // 批量保存(TODO:待测试)
18   - // Research操作
19   - T findById(ID id);
20   - List<T> findAll();
21   - Page<T> list(Map<String, Object> param, Pageable pageable);
22   - List<T> list(Map<String, Object> param);
23   - // Delete操作
24   - void delete(ID id) throws ScheduleException;
25   -}
  1 +package com.bsth.service.schedule;
  2 +
  3 +import org.springframework.data.domain.Page;
  4 +import org.springframework.data.domain.Pageable;
  5 +
  6 +import java.io.Serializable;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +/**
  11 + * 基础service接口。
  12 + */
  13 +public interface BService<T, ID extends Serializable> {
  14 + // CRUD 操作
  15 + // Create,Update操作
  16 + T save(T t);
  17 + <S extends T> List<S> bulkSave(List<S> entities); // 批量保存(TODO:待测试)
  18 + // Research操作
  19 + T findById(ID id);
  20 + List<T> findAll();
  21 + Page<T> list(Map<String, Object> param, Pageable pageable);
  22 + List<T> list(Map<String, Object> param);
  23 + // Delete操作
  24 + void delete(ID id) throws ScheduleException;
  25 +}
... ...
src/main/java/com/bsth/service/schedule/CarConfigInfoService.java
1 1 package com.bsth.service.schedule;
2 2  
3 3 import com.bsth.entity.schedule.CarConfigInfo;
4   -import com.bsth.service.BaseService;
5 4  
6 5 /**
7 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/CarsService.java
1   -package com.bsth.service.schedule;
2   -
3   -import com.bsth.entity.Cars;
4   -
5   -/**
6   - * Created by xu on 16/12/8.
7   - */
8   -public interface CarsService extends BService<Cars, Integer> {
9   - public void validate_nbbh(Cars cars) throws ScheduleException;
10   - public void validate_clbh(Cars cars) throws ScheduleException;
11   - public void validate_cph(Cars cars) throws ScheduleException;
12   - public void validate_sbbh(Cars cars) throws ScheduleException;
13   -}
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.Cars;
  4 +
  5 +/**
  6 + * Created by xu on 16/12/8.
  7 + */
  8 +public interface CarsService extends BService<Cars, Integer> {
  9 + public void validate_nbbh(Cars cars) throws ScheduleException;
  10 + public void validate_clbh(Cars cars) throws ScheduleException;
  11 + public void validate_cph(Cars cars) throws ScheduleException;
  12 + public void validate_sbbh(Cars cars) throws ScheduleException;
  13 +}
... ...
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoService.java
1 1 package com.bsth.service.schedule;
2 2  
3 3 import com.bsth.entity.schedule.EmployeeConfigInfo;
4   -import com.bsth.service.BaseService;
5 4  
6 5 /**
7 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/PeopleCarPlanServiceImpl.java
... ... @@ -497,7 +497,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
497 497 DO:{
498 498 if(model.length() != 0){
499 499 for(Long tt : ttList){
500   - if(tt == schedule.getSpId()){
  500 + if((long)tt == (long)schedule.getSpId()){
501 501 String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
502 502 if(!keyMap.containsKey(key))
503 503 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
... ...
src/main/java/com/bsth/service/schedule/ScheduleException.java
1   -package com.bsth.service.schedule;
2   -
3   -/**
4   - * Created by xu on 16/12/5.
5   - */
6   -public class ScheduleException extends Exception {
7   - public ScheduleException(String message) {
8   - super("计划调度业务错误==>>" + message);
9   - }
10   -}
  1 +package com.bsth.service.schedule;
  2 +
  3 +/**
  4 + * Created by xu on 16/12/5.
  5 + */
  6 +public class ScheduleException extends Exception {
  7 + public ScheduleException(String message) {
  8 + super("计划调度业务错误==>>" + message);
  9 + }
  10 +}
... ...
src/main/java/com/bsth/service/schedule/impl/BServiceImpl.java
1   -package com.bsth.service.schedule.impl;
2   -
3   -import com.bsth.entity.search.CustomerSpecs;
4   -import com.bsth.repository.BaseRepository;
5   -import com.bsth.service.schedule.BService;
6   -import com.bsth.service.schedule.ScheduleException;
7   -import org.slf4j.Logger;
8   -import org.slf4j.LoggerFactory;
9   -import org.springframework.beans.factory.annotation.Autowired;
10   -import org.springframework.beans.factory.annotation.Value;
11   -import org.springframework.data.domain.Page;
12   -import org.springframework.data.domain.Pageable;
13   -import org.springframework.data.jpa.domain.Specification;
14   -
15   -import javax.persistence.EntityManager;
16   -import java.io.Serializable;
17   -import java.util.ArrayList;
18   -import java.util.List;
19   -import java.util.Map;
20   -
21   -/**
22   - * 基础BService实现。
23   - */
24   -public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> {
25   - @Autowired
26   - private BaseRepository<T, ID> baseRepository;
27   - @Autowired
28   - private EntityManager entityManager;
29   - @Value("${hibernate.jdbc.batch_size}")
30   - private int batchSize;
31   -
32   - /** 日志记录器 */
33   - protected Logger logger = LoggerFactory.getLogger(this.getClass());
34   -
35   - // CRUD 操作
36   - // Create,Update操作
37   - @Override
38   - public T save(T t) {
39   - if (logger.isDebugEnabled()) {
40   - logger.debug("save...");
41   - }
42   - return baseRepository.save(t);
43   - }
44   - @Override
45   - public <S extends T> List<S> bulkSave(List<S> entities) {
46   - if (logger.isDebugEnabled()) {
47   - logger.debug("bulkSave...");
48   - }
49   -
50   - // 不使用内部批量保存,自己实现批量保存
51   - final List<S> savedEntities = new ArrayList<>(entities.size());
52   - int i = 0;
53   - for (S t : entities) {
54   - entityManager.persist(t);
55   - savedEntities.add(t);
56   - i++;
57   - if (i % batchSize == 0) {
58   - entityManager.flush();
59   - entityManager.clear();
60   - }
61   - }
62   - return savedEntities;
63   - }
64   -
65   - // Research操作
66   - @Override
67   - public T findById(ID id) {
68   - if (logger.isDebugEnabled()) {
69   - logger.debug("findById...");
70   - }
71   -
72   - return baseRepository.findOne(id);
73   - }
74   - @Override
75   - public List<T> findAll() {
76   - if (logger.isDebugEnabled()) {
77   - logger.debug("findAll...");
78   - }
79   -
80   - return (List<T>) baseRepository.findAll();
81   - }
82   - @Override
83   - public Page<T> list(Map<String, Object> param, Pageable pageable) {
84   - if (logger.isDebugEnabled()) {
85   - logger.debug("list(...,pageable)...");
86   - }
87   -
88   - // 自定义查询参数
89   - Specification<T> specification = new CustomerSpecs<>(param);
90   - return baseRepository.findAll(specification, pageable);
91   - }
92   - @Override
93   - public List<T> list(Map<String, Object> param) {
94   - if (logger.isDebugEnabled()) {
95   - logger.debug("list...");
96   - }
97   -
98   - // 自定义查询参数
99   - Specification<T> specification = new CustomerSpecs<>(param);
100   - return baseRepository.findAll(specification);
101   - }
102   - // Delete操作
103   - @Override
104   - public void delete(ID id) throws ScheduleException {
105   - if (logger.isDebugEnabled()) {
106   - logger.debug("delete...");
107   - }
108   -
109   - baseRepository.delete(id);
110   - }
111   -}
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.search.CustomerSpecs;
  4 +import com.bsth.repository.BaseRepository;
  5 +import com.bsth.service.schedule.BService;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.beans.factory.annotation.Value;
  11 +import org.springframework.data.domain.Page;
  12 +import org.springframework.data.domain.Pageable;
  13 +import org.springframework.data.jpa.domain.Specification;
  14 +
  15 +import javax.persistence.EntityManager;
  16 +import java.io.Serializable;
  17 +import java.util.ArrayList;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + * 基础BService实现。
  23 + */
  24 +public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> {
  25 + @Autowired
  26 + private BaseRepository<T, ID> baseRepository;
  27 + @Autowired
  28 + private EntityManager entityManager;
  29 + @Value("${hibernate.jdbc.batch_size}")
  30 + private int batchSize;
  31 +
  32 + /** 日志记录器 */
  33 + protected Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + // CRUD 操作
  36 + // Create,Update操作
  37 + @Override
  38 + public T save(T t) {
  39 + if (logger.isDebugEnabled()) {
  40 + logger.debug("save...");
  41 + }
  42 + return baseRepository.save(t);
  43 + }
  44 + @Override
  45 + public <S extends T> List<S> bulkSave(List<S> entities) {
  46 + if (logger.isDebugEnabled()) {
  47 + logger.debug("bulkSave...");
  48 + }
  49 +
  50 + // 不使用内部批量保存,自己实现批量保存
  51 + final List<S> savedEntities = new ArrayList<>(entities.size());
  52 + int i = 0;
  53 + for (S t : entities) {
  54 + entityManager.persist(t);
  55 + savedEntities.add(t);
  56 + i++;
  57 + if (i % batchSize == 0) {
  58 + entityManager.flush();
  59 + entityManager.clear();
  60 + }
  61 + }
  62 + return savedEntities;
  63 + }
  64 +
  65 + // Research操作
  66 + @Override
  67 + public T findById(ID id) {
  68 + if (logger.isDebugEnabled()) {
  69 + logger.debug("findById...");
  70 + }
  71 +
  72 + return baseRepository.findOne(id);
  73 + }
  74 + @Override
  75 + public List<T> findAll() {
  76 + if (logger.isDebugEnabled()) {
  77 + logger.debug("findAll...");
  78 + }
  79 +
  80 + return (List<T>) baseRepository.findAll();
  81 + }
  82 + @Override
  83 + public Page<T> list(Map<String, Object> param, Pageable pageable) {
  84 + if (logger.isDebugEnabled()) {
  85 + logger.debug("list(...,pageable)...");
  86 + }
  87 +
  88 + // 自定义查询参数
  89 + Specification<T> specification = new CustomerSpecs<>(param);
  90 + return baseRepository.findAll(specification, pageable);
  91 + }
  92 + @Override
  93 + public List<T> list(Map<String, Object> param) {
  94 + if (logger.isDebugEnabled()) {
  95 + logger.debug("list...");
  96 + }
  97 +
  98 + // 自定义查询参数
  99 + Specification<T> specification = new CustomerSpecs<>(param);
  100 + return baseRepository.findAll(specification);
  101 + }
  102 + // Delete操作
  103 + @Override
  104 + public void delete(ID id) throws ScheduleException {
  105 + if (logger.isDebugEnabled()) {
  106 + logger.debug("delete...");
  107 + }
  108 +
  109 + baseRepository.delete(id);
  110 + }
  111 +}
... ...
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/CarsServiceImpl.java
1   -package com.bsth.service.schedule.impl;
2   -
3   -import com.bsth.entity.Cars;
4   -import com.bsth.service.schedule.CarsService;
5   -import com.bsth.service.schedule.ScheduleException;
6   -import org.springframework.stereotype.Service;
7   -import org.springframework.transaction.annotation.Transactional;
8   -import org.springframework.util.CollectionUtils;
9   -
10   -import java.util.HashMap;
11   -import java.util.Map;
12   -
13   -/**
14   - * Created by xu on 16/12/8.
15   - */
16   -@Service(value = "carsServiceImpl_sc")
17   -public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService {
18   -
19   - @Override
20   - @Transactional
21   - public void validate_nbbh(Cars cars) throws ScheduleException {
22   - // 查询条件
23   - Map<String, Object> param = new HashMap<>();
24   - if (cars.getId() != null) {
25   - param.put("id_ne", cars.getId());
26   - }
27   - param.put("insideCode_eq", cars.getInsideCode());
28   - if (!CollectionUtils.isEmpty(list(param))) {
29   - throw new ScheduleException("车辆内部编号/自编号重复");
30   - }
31   - }
32   -
33   - @Override
34   - @Transactional
35   - public void validate_clbh(Cars cars) throws ScheduleException {
36   - // 查询条件
37   - Map<String, Object> param = new HashMap<>();
38   - if (cars.getId() != null) {
39   - param.put("id_ne", cars.getId());
40   - }
41   - param.put("carCode_eq", cars.getCarCode());
42   - if (!CollectionUtils.isEmpty(list(param))) {
43   - throw new ScheduleException("车辆编号重复");
44   - }
45   - }
46   -
47   - @Override
48   - @Transactional
49   - public void validate_cph(Cars cars) throws ScheduleException {
50   - // 查询条件
51   - Map<String, Object> param = new HashMap<>();
52   - if (cars.getId() != null) {
53   - param.put("id_ne", cars.getId());
54   - }
55   - param.put("carPlate_eq", cars.getCarPlate());
56   - if (!CollectionUtils.isEmpty(list(param))) {
57   - throw new ScheduleException("车牌号重复");
58   - }
59   - }
60   -
61   - @Override
62   - @Transactional
63   - public void validate_sbbh(Cars cars) throws ScheduleException {
64   - // 查询条件
65   - Map<String, Object> param = new HashMap<>();
66   - if (cars.getId() != null) {
67   - param.put("id_ne", cars.getId());
68   - }
69   - param.put("equipmentCode_eq", cars.getEquipmentCode());
70   - if (!CollectionUtils.isEmpty(list(param))) {
71   - throw new ScheduleException("设备编号重复");
72   - }
73   - }
74   -}
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.Cars;
  4 +import com.bsth.service.schedule.CarsService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import org.springframework.stereotype.Service;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +import org.springframework.util.CollectionUtils;
  9 +
  10 +import java.util.HashMap;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by xu on 16/12/8.
  15 + */
  16 +@Service(value = "carsServiceImpl_sc")
  17 +public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService {
  18 +
  19 + @Override
  20 + @Transactional
  21 + public void validate_nbbh(Cars cars) throws ScheduleException {
  22 + // 查询条件
  23 + Map<String, Object> param = new HashMap<>();
  24 + if (cars.getId() != null) {
  25 + param.put("id_ne", cars.getId());
  26 + }
  27 + param.put("insideCode_eq", cars.getInsideCode());
  28 + if (!CollectionUtils.isEmpty(list(param))) {
  29 + throw new ScheduleException("车辆内部编号/自编号重复");
  30 + }
  31 + }
  32 +
  33 + @Override
  34 + @Transactional
  35 + public void validate_clbh(Cars cars) throws ScheduleException {
  36 + // 查询条件
  37 + Map<String, Object> param = new HashMap<>();
  38 + if (cars.getId() != null) {
  39 + param.put("id_ne", cars.getId());
  40 + }
  41 + param.put("carCode_eq", cars.getCarCode());
  42 + if (!CollectionUtils.isEmpty(list(param))) {
  43 + throw new ScheduleException("车辆编号重复");
  44 + }
  45 + }
  46 +
  47 + @Override
  48 + @Transactional
  49 + public void validate_cph(Cars cars) throws ScheduleException {
  50 + // 查询条件
  51 + Map<String, Object> param = new HashMap<>();
  52 + if (cars.getId() != null) {
  53 + param.put("id_ne", cars.getId());
  54 + }
  55 + param.put("carPlate_eq", cars.getCarPlate());
  56 + if (!CollectionUtils.isEmpty(list(param))) {
  57 + throw new ScheduleException("车牌号重复");
  58 + }
  59 + }
  60 +
  61 + @Override
  62 + @Transactional
  63 + public void validate_sbbh(Cars cars) throws ScheduleException {
  64 + // 查询条件
  65 + Map<String, Object> param = new HashMap<>();
  66 + if (cars.getId() != null) {
  67 + param.put("id_ne", cars.getId());
  68 + }
  69 + param.put("equipmentCode_eq", cars.getEquipmentCode());
  70 + if (!CollectionUtils.isEmpty(list(param))) {
  71 + throw new ScheduleException("设备编号重复");
  72 + }
  73 + }
  74 +}
... ...
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/static/pages/forms/statement/correctStatis.html
... ... @@ -147,7 +147,7 @@
147 147 initPinYinSelect2('#line',data,'');
148 148  
149 149 line = "";
150   - updateModel();
  150 +// updateModel();
151 151 });
152 152  
153 153 var obj = [];
... ... @@ -285,17 +285,17 @@
285 285 line = $("#line").val();
286 286 if(line == " ")
287 287 line = "";
288   - updateModel();
  288 +// updateModel();
289 289 });
290 290 $('#startDate').on("blur", function(){
291 291 startDate = $("#startDate").val();
292 292 endDate = $("#endDate").val();
293   - updateModel();
  293 +// updateModel();
294 294 });
295 295 $('#endDate').on("blur", function(){
296 296 startDate = $("#startDate").val();
297 297 endDate = $("#endDate").val();
298   - updateModel();
  298 +// updateModel();
299 299 });
300 300  
301 301  
... ...
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -98,7 +98,6 @@
98 98 for(var code in result){
99 99 data.push({id: code, text: result[code]});
100 100 }
101   - console.log(data);
102 101 initPinYinSelect2('#line',data,'');
103 102  
104 103 })
... ... @@ -106,9 +105,10 @@
106 105 var date;
107 106 $("#query").on("click",function(){
108 107 line = $("#line").val();
  108 + var lineName=$("#select2-line-container").html();
109 109 date = $("#date").val();
110 110 $get('/realSchedule/dailyInfo',{line:line,date:date,type:'query'},function(result){
111   - $("#form_line").text(line);
  111 + $("#form_line").text(lineName);
112 112 $("#form_date").text(date);
113 113 var total_zgl = 0,total_ksgl = 0,total_yh = 0,total_bcs = 0;
114 114 $.each(result, function(i, obj) {
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/service.js
1   -// 车辆信息service
2   -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
3   - return {
4   - rest: $resource(
5   - '/cars_sc/:id',
6   - {order: 'carCode', direction: 'ASC', id: '@id_route'},
7   - {
8   - list: {
9   - method: 'GET',
10   - params: {
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   - }
20   - }
21   - },
22   - 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   - }
32   - },
33   - save: {
34   - method: 'POST'
35   - }
36   - }
37   - ),
38   - import: $resource(
39   - '/cars/importfile',
40   - {},
41   - {
42   - do: {
43   - method: 'POST',
44   - headers: {
45   - 'Content-Type': 'application/x-www-form-urlencoded'
46   - },
47   - transformRequest: function(obj) {
48   - var str = [];
49   - for (var p in obj) {
50   - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
51   - }
52   - return str.join("&");
53   - }
54   - }
55   - }
56   - ),
57   - validate: $resource(
58   - '/cars/validate/:type',
59   - {},
60   - {
61   - insideCode: {
62   - method: 'GET'
63   - }
64   - }
65   - ),
66   - dataTools: $resource(
67   - '/cars/:type',
68   - {},
69   - {
70   - dataExport: {
71   - method: 'GET',
72   - responseType: "arraybuffer",
73   - params: {
74   - type: "dataExport"
75   - },
76   - transformResponse: function(data, headers){
77   - return {data : data};
78   - }
79   - }
80   - }
81   - )
82   - };
  1 +// 车辆信息service
  2 +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest: $resource(
  5 + '/cars_sc/:id',
  6 + {order: 'carCode', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  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 + }
  20 + }
  21 + },
  22 + 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 + }
  32 + },
  33 + save: {
  34 + method: 'POST'
  35 + }
  36 + }
  37 + ),
  38 + import: $resource(
  39 + '/cars/importfile',
  40 + {},
  41 + {
  42 + do: {
  43 + method: 'POST',
  44 + headers: {
  45 + 'Content-Type': 'application/x-www-form-urlencoded'
  46 + },
  47 + transformRequest: function(obj) {
  48 + var str = [];
  49 + for (var p in obj) {
  50 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  51 + }
  52 + return str.join("&");
  53 + }
  54 + }
  55 + }
  56 + ),
  57 + validate: $resource(
  58 + '/cars/validate/:type',
  59 + {},
  60 + {
  61 + insideCode: {
  62 + method: 'GET'
  63 + }
  64 + }
  65 + ),
  66 + dataTools: $resource(
  67 + '/cars/:type',
  68 + {},
  69 + {
  70 + dataExport: {
  71 + method: 'GET',
  72 + responseType: "arraybuffer",
  73 + params: {
  74 + type: "dataExport"
  75 + },
  76 + transformResponse: function(data, headers){
  77 + return {data : data};
  78 + }
  79 + }
  80 + }
  81 + )
  82 + };
83 83 }]);
84 84 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js
1   -// 车辆设备信息service
2   -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
3   - return $resource(
4   - '/cde/:id',
5   - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'},
6   - {
7   - list: {
8   - method: 'GET',
9   - params: {
10   - page: 0
11   - }
12   - },
13   - get: {
14   - method: 'GET'
15   - },
16   - save: {
17   - method: 'POST'
18   - },
19   - delete: {
20   - method: 'DELETE'
21   - }
22   - }
23   - );
  1 +// 车辆设备信息service
  2 +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
  3 + return $resource(
  4 + '/cde/:id',
  5 + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'},
  6 + {
  7 + list: {
  8 + method: 'GET',
  9 + params: {
  10 + page: 0
  11 + }
  12 + },
  13 + get: {
  14 + method: 'GET'
  15 + },
  16 + save: {
  17 + method: 'POST'
  18 + },
  19 + delete: {
  20 + method: 'DELETE'
  21 + }
  22 + }
  23 + );
24 24 }]);
25 25 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js
1   -// 人员信息service
2   -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
3   - return {
4   - rest : $resource(
5   - '/personnel/:id',
6   - {order: 'jobCode', direction: 'ASC', id: '@id_route'},
7   - {
8   - list: {
9   - method: 'GET',
10   - params: {
11   - page: 0
12   - }
13   - },
14   - get: {
15   - method: 'GET'
16   - },
17   - save: {
18   - method: 'POST'
19   - }
20   - }
21   - ),
22   - validate: $resource(
23   - '/personnel/validate/:type',
24   - {},
25   - {
26   - jobCode: {
27   - method: 'GET'
28   - }
29   - }
30   - ),
31   - dataTools: $resource(
32   - '/personnel/:type',
33   - {},
34   - {
35   - dataExport: {
36   - method: 'GET',
37   - responseType: "arraybuffer",
38   - params: {
39   - type: "dataExport"
40   - },
41   - transformResponse: function(data, headers){
42   - return {data : data};
43   - }
44   - }
45   - }
46   - )
47   - };
48   -}]);
  1 +// 人员信息service
  2 +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/personnel/:id',
  6 + {order: 'jobCode', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + }
  20 + }
  21 + ),
  22 + validate: $resource(
  23 + '/personnel/validate/:type',
  24 + {},
  25 + {
  26 + jobCode: {
  27 + method: 'GET'
  28 + }
  29 + }
  30 + ),
  31 + dataTools: $resource(
  32 + '/personnel/:type',
  33 + {},
  34 + {
  35 + dataExport: {
  36 + method: 'GET',
  37 + responseType: "arraybuffer",
  38 + params: {
  39 + type: "dataExport"
  40 + },
  41 + transformResponse: function(data, headers){
  42 + return {data : data};
  43 + }
  44 + }
  45 + }
  46 + )
  47 + };
  48 +}]);
... ...
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelect.js
1   -/**
2   - * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
3   - * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
4   - * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
5   - *
6   - * // TODO:
7   - */
8   -angular.module('ScheduleApp').directive('mySelect', [
9   - function() {
10   - return {
11   - restrict: 'E',
12   - template: '<div>bioxuxuan</div>',
13   - require: 'ngModel',
14   - compile: function(tElem, tAttrs) {
15   - return {
16   - pre: function(scope, element, attr) {
17   -
18   - },
19   - post: function(scope, element, attr, ngModelCtr) {
20   - // model -> view
21   - ngModelCtr.$formatters.push(function(modelValue) {
22   - // 监控model的变化
23   - if (typeof modelValue != "undefined") {
24   - console.log(modelValue);
25   -
26   - return modelValue;
27   - }
28   - });
29   -
30   - ngModelCtr.$render = function() {
31   - if (typeof scope.ctrl.say != "undefined") {
32   - element.find('div').css('color', 'red');
33   - }
34   - };
35   -
36   - ngModelCtr.$setViewValue("init value");
37   -
38   -
39   - }
40   - }
41   - }
42   - }
43   - }
  1 +/**
  2 + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
  3 + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
  4 + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
  5 + *
  6 + * // TODO:
  7 + */
  8 +angular.module('ScheduleApp').directive('mySelect', [
  9 + function() {
  10 + return {
  11 + restrict: 'E',
  12 + template: '<div>bioxuxuan</div>',
  13 + require: 'ngModel',
  14 + compile: function(tElem, tAttrs) {
  15 + return {
  16 + pre: function(scope, element, attr) {
  17 +
  18 + },
  19 + post: function(scope, element, attr, ngModelCtr) {
  20 + // model -> view
  21 + ngModelCtr.$formatters.push(function(modelValue) {
  22 + // 监控model的变化
  23 + if (typeof modelValue != "undefined") {
  24 + console.log(modelValue);
  25 +
  26 + return modelValue;
  27 + }
  28 + });
  29 +
  30 + ngModelCtr.$render = function() {
  31 + if (typeof scope.ctrl.say != "undefined") {
  32 + element.find('div').css('color', 'red');
  33 + }
  34 + };
  35 +
  36 + ngModelCtr.$setViewValue("init value");
  37 +
  38 +
  39 + }
  40 + }
  41 + }
  42 + }
  43 + }
44 44 ]);
45 45 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelectTemplate.html
1   -<div class="input-group" name="指令compile阶段设定1"
2   - ng-model="$saSelectCtrl.$$internalmodel">
3   - <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
4   - theme="bootstrap" >
5   - <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match>
6   - <ui-select-choices repeat="指令compile阶段设定3"
7   - refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
8   - refresh-delay="10">
9   -
10   - 指令compile阶段设定777
11   -
12   - </ui-select-choices>
13   - </ui-select>
14   - <span class="input-group-btn">
15   - <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
16   - <span class="glyphicon glyphicon-trash"></span>
17   - </button>
18   - </span>
  1 +<div class="input-group" name="指令compile阶段设定1"
  2 + ng-model="$saSelectCtrl.$$internalmodel">
  3 + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
  4 + theme="bootstrap" >
  5 + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match>
  6 + <ui-select-choices repeat="指令compile阶段设定3"
  7 + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
  8 + refresh-delay="10">
  9 +
  10 + 指令compile阶段设定777
  11 +
  12 + </ui-select-choices>
  13 + </ui-select>
  14 + <span class="input-group-btn">
  15 + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
  16 + <span class="glyphicon glyphicon-trash"></span>
  17 + </button>
  18 + </span>
19 19 </div>
20 20 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation.js
... ... @@ -83,9 +83,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
83 83 */
84 84 attr.$observe("remotevparam", function(value) {
85 85 if (value && value != "") {
86   - if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
87   - return;
88   - }
  86 + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
  87 + // return;
  88 + //}
89 89 $watch_rvparam_obj = JSON.parse(value);
90 90 $$internal_validate(ngModelCtrl, scope);
91 91 }
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation3.js
1   -/**
2   - * remoteValidationt3 远程验证指令(监控依赖的model变化)
3   - * 属性如下:
4   - * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
5   - * remotemodel(必须):关联的model
6   - * remotemodelcol(必须):关联的model属性
7   - */
8   -angular.module('ScheduleApp').directive(
9   - 'remoteValidation3',
10   - [
11   - '$$SearchInfoService_g',
12   - '$q',
13   - function($$SearchInfoService_g, $q) {
14   - return {
15   - restrict: 'A', // 属性
16   - require: '^ngModel', // 依赖所属指令的ngModel
17   - compile: function(tElem, tAttrs) {
18   - var remotevtype_attr = tAttrs['remotevtype'];
19   - var remotemodel_attr = tAttrs['remotemodel'];
20   - var remotemodelcol_attr = tAttrs['remotemodelcol'];
21   - if (!remotevtype_attr) {
22   - throw new Error("remotevtype属性必须填写");
23   - }
24   - if (!remotemodel_attr) {
25   - throw new Error("remotemodel属性必须填写");
26   - }
27   - if (!remotemodelcol_attr) {
28   - throw new Error("remotemodelcol属性必须填写");
29   - }
30   -
31   - return {
32   - pre: function(scope, element, attr) {
33   -
34   - },
35   -
36   - post: function(scope, element, attr, ngModelCtrl) {
37   - ngModelCtrl.$asyncValidators.remote =
38   - function(modelValue, viewValue) {
39   - var deferred = $q.defer();
40   -
41   - // 远端验证service
42   - var param = JSON.parse(attr['remotemodel']);
43   - console.log(param);
44   - param[remotemodelcol_attr] = modelValue;
45   - $$SearchInfoService_g.validate[remotevtype_attr].remote.do(
46   - param,
47   - function(result) {
48   - if (result.status == "SUCCESS") {
49   - deferred.resolve();
50   - } else {
51   - scope.$remote_msg = result.msg;
52   - deferred.reject();
53   - }
54   - },
55   - function(result) {
56   - deferred.reject();
57   - }
58   - );
59   -
60   - return deferred.promise;
61   - };
62   - }
63   - };
64   - }
65   - }
66   - }
67   - ]
  1 +/**
  2 + * remoteValidationt3 远程验证指令(监控依赖的model变化)
  3 + * 属性如下:
  4 + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
  5 + * remotemodel(必须):关联的model
  6 + * remotemodelcol(必须):关联的model属性
  7 + */
  8 +angular.module('ScheduleApp').directive(
  9 + 'remoteValidation3',
  10 + [
  11 + '$$SearchInfoService_g',
  12 + '$q',
  13 + function($$SearchInfoService_g, $q) {
  14 + return {
  15 + restrict: 'A', // 属性
  16 + require: '^ngModel', // 依赖所属指令的ngModel
  17 + compile: function(tElem, tAttrs) {
  18 + var remotevtype_attr = tAttrs['remotevtype'];
  19 + var remotemodel_attr = tAttrs['remotemodel'];
  20 + var remotemodelcol_attr = tAttrs['remotemodelcol'];
  21 + if (!remotevtype_attr) {
  22 + throw new Error("remotevtype属性必须填写");
  23 + }
  24 + if (!remotemodel_attr) {
  25 + throw new Error("remotemodel属性必须填写");
  26 + }
  27 + if (!remotemodelcol_attr) {
  28 + throw new Error("remotemodelcol属性必须填写");
  29 + }
  30 +
  31 + return {
  32 + pre: function(scope, element, attr) {
  33 +
  34 + },
  35 +
  36 + post: function(scope, element, attr, ngModelCtrl) {
  37 + ngModelCtrl.$asyncValidators.remote =
  38 + function(modelValue, viewValue) {
  39 + var deferred = $q.defer();
  40 +
  41 + // 远端验证service
  42 + var param = JSON.parse(attr['remotemodel']);
  43 + console.log(param);
  44 + param[remotemodelcol_attr] = modelValue;
  45 + $$SearchInfoService_g.validate[remotevtype_attr].remote.do(
  46 + param,
  47 + function(result) {
  48 + if (result.status == "SUCCESS") {
  49 + deferred.resolve();
  50 + } else {
  51 + scope.$remote_msg = result.msg;
  52 + deferred.reject();
  53 + }
  54 + },
  55 + function(result) {
  56 + deferred.reject();
  57 + }
  58 + );
  59 +
  60 + return deferred.promise;
  61 + };
  62 + }
  63 + };
  64 + }
  65 + }
  66 + }
  67 + ]
68 68 );
69 69 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/mySelect.js
1   -/**
2   - * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
3   - * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
4   - * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
5   - *
6   - * // TODO:
7   - */
8   -angular.module('ScheduleApp').directive('mySelect', [
9   - function() {
10   - return {
11   - restrict: 'E',
12   - template: '<div>bioxuxuan</div>',
13   - require: 'ngModel',
14   - compile: function(tElem, tAttrs) {
15   - return {
16   - pre: function(scope, element, attr) {
17   -
18   - },
19   - post: function(scope, element, attr, ngModelCtr) {
20   - // model -> view
21   - ngModelCtr.$formatters.push(function(modelValue) {
22   - // 监控model的变化
23   - if (typeof modelValue != "undefined") {
24   - console.log(modelValue);
25   -
26   - return modelValue;
27   - }
28   - });
29   -
30   - ngModelCtr.$render = function() {
31   - if (typeof scope.ctrl.say != "undefined") {
32   - element.find('div').css('color', 'red');
33   - }
34   - };
35   -
36   - ngModelCtr.$setViewValue("init value");
37   -
38   -
39   - }
40   - }
41   - }
42   - }
43   - }
  1 +/**
  2 + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
  3 + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
  4 + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
  5 + *
  6 + * // TODO:
  7 + */
  8 +angular.module('ScheduleApp').directive('mySelect', [
  9 + function() {
  10 + return {
  11 + restrict: 'E',
  12 + template: '<div>bioxuxuan</div>',
  13 + require: 'ngModel',
  14 + compile: function(tElem, tAttrs) {
  15 + return {
  16 + pre: function(scope, element, attr) {
  17 +
  18 + },
  19 + post: function(scope, element, attr, ngModelCtr) {
  20 + // model -> view
  21 + ngModelCtr.$formatters.push(function(modelValue) {
  22 + // 监控model的变化
  23 + if (typeof modelValue != "undefined") {
  24 + console.log(modelValue);
  25 +
  26 + return modelValue;
  27 + }
  28 + });
  29 +
  30 + ngModelCtr.$render = function() {
  31 + if (typeof scope.ctrl.say != "undefined") {
  32 + element.find('div').css('color', 'red');
  33 + }
  34 + };
  35 +
  36 + ngModelCtr.$setViewValue("init value");
  37 +
  38 +
  39 + }
  40 + }
  41 + }
  42 + }
  43 + }
44 44 ]);
45 45 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/mySelectTemplate.html
1   -<div class="input-group" name="指令compile阶段设定1"
2   - ng-model="$saSelectCtrl.$$internalmodel">
3   - <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
4   - theme="bootstrap" >
5   - <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match>
6   - <ui-select-choices repeat="指令compile阶段设定3"
7   - refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
8   - refresh-delay="10">
9   -
10   - 指令compile阶段设定777
11   -
12   - </ui-select-choices>
13   - </ui-select>
14   - <span class="input-group-btn">
15   - <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
16   - <span class="glyphicon glyphicon-trash"></span>
17   - </button>
18   - </span>
  1 +<div class="input-group" name="指令compile阶段设定1"
  2 + ng-model="$saSelectCtrl.$$internalmodel">
  3 + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
  4 + theme="bootstrap" >
  5 + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match>
  6 + <ui-select-choices repeat="指令compile阶段设定3"
  7 + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
  8 + refresh-delay="10">
  9 +
  10 + 指令compile阶段设定777
  11 +
  12 + </ui-select-choices>
  13 + </ui-select>
  14 + <span class="input-group-btn">
  15 + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
  16 + <span class="glyphicon glyphicon-trash"></span>
  17 + </button>
  18 + </span>
19 19 </div>
20 20 \ No newline at end of file
... ...
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 105 */
106 106 attr.$observe("remotevparam", function(value) {
107 107 if (value && value != "") {
108   - if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
109   - return;
110   - }
  108 + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
  109 + // return;
  110 + //}
111 111 $watch_rvparam_obj = JSON.parse(value);
112 112 $$internal_validate(ngModelCtrl, scope);
113 113 }
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
... ... @@ -328,7 +328,42 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
328 328 }
329 329 )
330 330 },
331   -
  331 + cc_cars: { // 车辆不能重复配置
  332 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
  333 + remote: $resource( // $resource封装对象
  334 + '/cci/validate_cars',
  335 + {},
  336 + {
  337 + do: {
  338 + method: 'GET'
  339 + }
  340 + }
  341 + )
  342 + },
  343 + ec_jsy: { // 驾驶员不能重复配置
  344 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  345 + remote: $resource( // $resource封装对象
  346 + '/eci/validate_jsy',
  347 + {},
  348 + {
  349 + do: {
  350 + method: 'GET'
  351 + }
  352 + }
  353 + )
  354 + },
  355 + ec_spy: { // 售票员不能重复配置
  356 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  357 + remote: $resource( // $resource封装对象
  358 + '/eci/validate_spy',
  359 + {},
  360 + {
  361 + do: {
  362 + method: 'GET'
  363 + }
  364 + }
  365 + )
  366 + },
332 367  
333 368 cde1: { // 车辆设备启用日期验证
334 369 template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
... ... @@ -406,4 +441,3 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
406 441 }]);
407 442  
408 443  
409   -
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -166,10 +166,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusConfigService_g&#39;, [&#39;$resource&#39;, functi
166 166 method: 'GET',
167 167 params: {
168 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 + }
169 177 }
170 178 },
171 179 get: {
172   - method: '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 + }
173 189 },
174 190 save: {
175 191 method: 'POST'
... ... @@ -205,10 +221,26 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;EmployeeConfigService_g&#39;, [&#39;$resource&#39;, f
205 221 method: 'GET',
206 222 params: {
207 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 + }
208 232 }
209 233 },
210 234 get: {
211   - method: '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 + }
212 244 },
213 245 save: {
214 246 method: 'POST'
... ... @@ -821,7 +853,42 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;$$SearchInfoService_g&#39;, [&#39;$resource&#39;, fun
821 853 }
822 854 )
823 855 },
824   -
  856 + cc_cars: { // 车辆不能重复配置
  857 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'cl.id_eq': -1}, // 查询参数模版
  858 + remote: $resource( // $resource封装对象
  859 + '/cci/validate_cars',
  860 + {},
  861 + {
  862 + do: {
  863 + method: 'GET'
  864 + }
  865 + }
  866 + )
  867 + },
  868 + ec_jsy: { // 驾驶员不能重复配置
  869 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'jsy.id_eq': -1}, // 查询参数模版
  870 + remote: $resource( // $resource封装对象
  871 + '/eci/validate_jsy',
  872 + {},
  873 + {
  874 + do: {
  875 + method: 'GET'
  876 + }
  877 + }
  878 + )
  879 + },
  880 + ec_spy: { // 售票员不能重复配置
  881 + template: {'xl.id_eq': -1, 'xl.name_eq': '-1', 'spy.id_eq': -1}, // 查询参数模版
  882 + remote: $resource( // $resource封装对象
  883 + '/eci/validate_spy',
  884 + {},
  885 + {
  886 + do: {
  887 + method: 'GET'
  888 + }
  889 + }
  890 + )
  891 + },
825 892  
826 893 cde1: { // 车辆设备启用日期验证
827 894 template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/edit.html
... ... @@ -76,11 +76,19 @@
76 76 searchexp="this.insideCode"
77 77 required >
78 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="{{ {'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
  83 + />
79 84 </div>
80 85 <!-- 隐藏块,显示验证信息 -->
81 86 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
82 87 车辆必须选择
83 88 </div>
  89 + <div class="alert alert-danger well-sm" ng-show="myForm.cl_h.$error.remote">
  90 + {{$remote_msg}}
  91 + </div>
84 92 </div>
85 93  
86 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 45 <div class="col-md-3">
46 46 <sa-Select5 name="xl"
47 47 model="ctrl.busConfigForSave"
48   - cmaps="{'xl.id': 'id'}"
  48 + cmaps="{'xl.id': 'id', 'xl.name': 'name'}"
49 49 dcname="xl.id"
50 50 icname="id"
51 51 dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
... ... @@ -76,11 +76,19 @@
76 76 searchexp="this.insideCode"
77 77 required >
78 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="{{ {'xl.id_eq': ctrl.busConfigForSave.xl.id, 'xl.name_eq': ctrl.busConfigForSave.xl.name, 'cl.id_eq': ctrl.busConfigForSave.cl.id} | json}}"
  83 + />
79 84 </div>
80 85 <!-- 隐藏块,显示验证信息 -->
81 86 <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
82 87 车辆必须选择
83 88 </div>
  89 + <div class="alert alert-danger well-sm" ng-show="myForm.cl_h.$error.remote">
  90 + {{$remote_msg}}
  91 + </div>
84 92 </div>
85 93  
86 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 36 <td></td>
37 37 <td>
38 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 40 </label>
41 41 </td>
42 42 <td>
43 43 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
44   - ng-click="ctrl.pageChanaged()">
  44 + ng-click="ctrl.doPage()">
45 45 <i class="fa fa-search"></i> 搜索</button>
46 46  
47 47 <button class="btn btn-sm red btn-outline filter-cancel"
48   - ng-click="ctrl.resetSearchCondition()">
  48 + ng-click="ctrl.reset()">
49 49 <i class="fa fa-times"></i> 重置</button>
50 50 </td>
51 51  
... ... @@ -53,7 +53,7 @@
53 53  
54 54 </thead>
55 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 57 <td>
58 58 <span ng-bind="$index + 1"></span>
59 59 </td>
... ... @@ -81,8 +81,8 @@
81 81 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
82 82 <a ui-sref="busConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
83 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 86 </td>
87 87 </tr>
88 88 </tbody>
... ... @@ -90,9 +90,9 @@
90 90 </div>
91 91  
92 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 96 rotate="false"
97 97 max-size="10"
98 98 boundary-links="true"
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
1 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 106 angular.module('ScheduleApp').controller('BusConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
110 107 var self = this;
... ... @@ -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 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 9 method: 'GET',
10 10 params: {
11 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 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 33 save: {
18 34 method: 'POST'
... ...
src/main/resources/static/pages/scheduleApp/module/core/busLineInfoStat/service.js
1   -// 线路运营统计service
2   -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
3   - return $resource(
4   - '/bic/:id',
5   - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询
6   - {
7   - list: {
8   - method: 'GET',
9   - params: {
10   - page: 0
11   - }
12   - }
13   - }
14   - );
15   -}]);
  1 +// 线路运营统计service
  2 +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
  3 + return $resource(
  4 + '/bic/:id',
  5 + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询
  6 + {
  7 + list: {
  8 + method: 'GET',
  9 + params: {
  10 + page: 0
  11 + }
  12 + }
  13 + }
  14 + );
  15 +}]);
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/edit.html
... ... @@ -89,11 +89,19 @@
89 89 searchexp="this.personnelName + '<' + this.jobCode + '>'"
90 90 required >
91 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="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
  96 + />
92 97 </div>
93 98 <!-- 隐藏块,显示验证信息 -->
94 99 <div class="alert alert-danger well-sm" ng-show="myForm.jsy.$error.required">
95 100 驾驶员必须选择
96 101 </div>
  102 + <div class="alert alert-danger well-sm" ng-show="myForm.jsy_h.$error.remote">
  103 + {{$remote_msg}}
  104 + </div>
97 105 </div>
98 106  
99 107 <div class="form-group">
... ... @@ -111,6 +119,15 @@
111 119 searchexp="this.personnelName + '<' + this.jobCode + '>'"
112 120 >
113 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="{{ {'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 131 </div>
115 132 </div>
116 133  
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/form.html
... ... @@ -45,7 +45,7 @@
45 45 <div class="col-md-3">
46 46 <sa-Select5 name="xl"
47 47 model="ctrl.employeeConfigForSave"
48   - cmaps="{'xl.id' : 'id'}"
  48 + cmaps="{'xl.id' : 'id', 'xl.name': 'name'}"
49 49 dcname="xl.id"
50 50 icname="id"
51 51 dsparams="{{ {type: 'ajax', param:{'type': 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
... ... @@ -89,11 +89,19 @@
89 89 searchexp="this.personnelName + '<' + this.jobCode + '>'"
90 90 required >
91 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="{{ {'xl.id_eq': ctrl.employeeConfigForSave.xl.id, 'xl.name_eq': ctrl.employeeConfigForSave.xl.name, 'jsy.id_eq': ctrl.employeeConfigForSave.jsy.id} | json}}"
  96 + />
92 97 </div>
93 98 <!-- 隐藏块,显示验证信息 -->
94 99 <div class="alert alert-danger well-sm" ng-show="myForm.jsy.$error.required">
95 100 驾驶员必须选择
96 101 </div>
  102 + <div class="alert alert-danger well-sm" ng-show="myForm.jsy_h.$error.remote">
  103 + {{$remote_msg}}
  104 + </div>
97 105 </div>
98 106  
99 107 <div class="form-group">
... ... @@ -111,6 +119,15 @@
111 119 searchexp="this.personnelName + '<' + this.jobCode + '>'"
112 120 >
113 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="{{ {'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 131 </div>
115 132 </div>
116 133  
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
... ... @@ -46,16 +46,16 @@
46 46 </td>
47 47 <td>
48 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 50 </label>
51 51 </td>
52 52 <td>
53 53 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
54   - ng-click="ctrl.pageChanaged()">
  54 + ng-click="ctrl.doPage()">
55 55 <i class="fa fa-search"></i> 搜索</button>
56 56  
57 57 <button class="btn btn-sm red btn-outline filter-cancel"
58   - ng-click="ctrl.resetSearchCondition()">
  58 + ng-click="ctrl.reset()">
59 59 <i class="fa fa-times"></i> 重置</button>
60 60 </td>
61 61  
... ... @@ -63,7 +63,7 @@
63 63  
64 64 </thead>
65 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 67 <td>
68 68 <span ng-bind="$index + 1"></span>
69 69 </td>
... ... @@ -94,8 +94,8 @@
94 94 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
95 95 <a ui-sref="employeeConfig_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a>
96 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 99 </td>
100 100 </tr>
101 101 </tbody>
... ... @@ -103,9 +103,9 @@
103 103 </div>
104 104  
105 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 109 rotate="false"
110 110 max-size="10"
111 111 boundary-links="true"
... ...
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
1 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 107 angular.module('ScheduleApp').controller('EmployeeConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
110 108 var self = this;
... ... @@ -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 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 9 method: 'GET',
10 10 params: {
11 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 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 33 save: {
18 34 method: 'POST'
... ...
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/edit.html
1   -<div class="page-head">
2   - <div class="page-title">
3   - <h1>路牌管理</h1>
4   - </div>
5   -</div>
6   -
7   -<ul class="page-breadcrumb breadcrumb">
8   - <li>
9   - <a href="/pages/home.html" data-pjax="">首页</a>
10   - <i class="fa fa-circle"></i>
11   - </li>
12   - <li>
13   - <span class="active">运营计划管理</span>
14   - <i class="fa fa-circle"></i>
15   - </li>
16   - <li>
17   - <a ui-sref="guideboardManage">路牌管理</a>
18   - <i class="fa fa-circle"></i>
19   - </li>
20   - <li>
21   - <span class="active">修改路牌</span>
22   - </li>
23   -</ul>
24   -
25   -<div class="portlet light bordered" ng-controller="GuideboardManageFormCtrl as ctrl">
26   - <div class="portlet-title">
27   - <div class="caption">
28   - <i class="icon-equalizer font-red-sunglo"></i> <span
29   - class="caption-subject font-red-sunglo bold uppercase">表单</span>
30   - </div>
31   - </div>
32   -
33   - <div class="portlet-body form">
34   - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
35   -
36   - <div class="form-body">
37   - <div class="form-group has-success has-feedback">
38   - <label class="col-md-2 control-label">线路*:</label>
39   - <div class="col-md-3">
40   - <sa-Select5 name="xl"
41   - model="ctrl.guideboardManageForForm"
42   - cmaps="{'xl.id' : 'id'}"
43   - dcname="xl.id"
44   - icname="id"
45   - dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
46   - iterobjname="item"
47   - iterobjexp="item.name"
48   - searchph="请输拼音..."
49   - searchexp="this.name"
50   - required >
51   - </sa-Select5>
52   - </div>
53   - <!-- 隐藏块,显示验证信息 -->
54   - <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
55   - 线路必须选择
56   - </div>
57   - </div>
58   -
59   - <div class="form-group has-success has-feedback">
60   - <label class="col-md-2 control-label">路牌编号:</label>
61   - <div class="col-md-3">
62   - <input type="number" class="form-control" ng-model="ctrl.guideboardManageForForm.lpNo"
63   - name="lpNo" placeholder="请输入路牌编号..." min="1" required
64   - remote-Validation
65   - remotevtype="gbv1"
66   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
67   -
68   - />
69   - </div>
70   - <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.required">
71   - 路牌编号必须填写
72   - </div>
73   - <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.number">
74   - 必须输入数字
75   - </div>
76   - <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.remote">
77   - {{$remote_msg}}
78   - </div>
79   - </div>
80   -
81   - <div class="form-group has-success has-feedback">
82   - <label class="col-md-2 control-label">路牌名称*:</label>
83   - <div class="col-md-3">
84   - <input type="text" class="form-control" ng-model="ctrl.guideboardManageForForm.lpName"
85   - name="lpName" placeholder="请输入路牌名字..." required
86   - remote-Validation
87   - remotevtype="gbv2"
88   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
89   -
90   - />
91   - </div>
92   -
93   - <!-- 隐藏块,显示验证信息 -->
94   - <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.required">
95   - 路牌名称必须填写
96   - </div>
97   - <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.remote">
98   - {{$remote_msg}}
99   - </div>
100   - </div>
101   -
102   - <!-- 路牌类型暂时是普通路牌,默认填写了 -->
103   -
104   -
105   - </div>
106   -
107   - <div class="form-actions">
108   - <div class="row">
109   - <div class="col-md-offset-3 col-md-4">
110   - <button type="submit" class="btn green" ng-disabled="!myForm.$valid">
111   - <i class="fa fa-check">提交</i>
112   - </button>
113   - <a type="button" class="btn default" ui-sref="guideboardManage">
114   - <i class="fa fa-times">取消</i>
115   - </a>
116   - </div>
117   - </div>
118   - </div>
119   -
120   - </form>
121   -
122   - </div>
123   -
124   -</div>
125   -
126   -
127   -
128   -
129   -
130   -
131   -
132   -
133   -
134   -
135   -
136   -
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>路牌管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax="">首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="guideboardManage">路牌管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">修改路牌</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="GuideboardManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 +
  36 + <div class="form-body">
  37 + <div class="form-group has-success has-feedback">
  38 + <label class="col-md-2 control-label">线路*:</label>
  39 + <div class="col-md-3">
  40 + <sa-Select5 name="xl"
  41 + model="ctrl.guideboardManageForForm"
  42 + cmaps="{'xl.id' : 'id'}"
  43 + dcname="xl.id"
  44 + icname="id"
  45 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  46 + iterobjname="item"
  47 + iterobjexp="item.name"
  48 + searchph="请输拼音..."
  49 + searchexp="this.name"
  50 + required >
  51 + </sa-Select5>
  52 + </div>
  53 + <!-- 隐藏块,显示验证信息 -->
  54 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  55 + 线路必须选择
  56 + </div>
  57 + </div>
  58 +
  59 + <div class="form-group has-success has-feedback">
  60 + <label class="col-md-2 control-label">路牌编号:</label>
  61 + <div class="col-md-3">
  62 + <input type="number" class="form-control" ng-model="ctrl.guideboardManageForForm.lpNo"
  63 + name="lpNo" placeholder="请输入路牌编号..." min="1" required
  64 + remote-Validation
  65 + remotevtype="gbv1"
  66 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
  67 +
  68 + />
  69 + </div>
  70 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.required">
  71 + 路牌编号必须填写
  72 + </div>
  73 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.number">
  74 + 必须输入数字
  75 + </div>
  76 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.remote">
  77 + {{$remote_msg}}
  78 + </div>
  79 + </div>
  80 +
  81 + <div class="form-group has-success has-feedback">
  82 + <label class="col-md-2 control-label">路牌名称*:</label>
  83 + <div class="col-md-3">
  84 + <input type="text" class="form-control" ng-model="ctrl.guideboardManageForForm.lpName"
  85 + name="lpName" placeholder="请输入路牌名字..." required
  86 + remote-Validation
  87 + remotevtype="gbv2"
  88 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
  89 +
  90 + />
  91 + </div>
  92 +
  93 + <!-- 隐藏块,显示验证信息 -->
  94 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.required">
  95 + 路牌名称必须填写
  96 + </div>
  97 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.remote">
  98 + {{$remote_msg}}
  99 + </div>
  100 + </div>
  101 +
  102 + <!-- 路牌类型暂时是普通路牌,默认填写了 -->
  103 +
  104 +
  105 + </div>
  106 +
  107 + <div class="form-actions">
  108 + <div class="row">
  109 + <div class="col-md-offset-3 col-md-4">
  110 + <button type="submit" class="btn green" ng-disabled="!myForm.$valid">
  111 + <i class="fa fa-check">提交</i>
  112 + </button>
  113 + <a type="button" class="btn default" ui-sref="guideboardManage">
  114 + <i class="fa fa-times">取消</i>
  115 + </a>
  116 + </div>
  117 + </div>
  118 + </div>
  119 +
  120 + </form>
  121 +
  122 + </div>
  123 +
  124 +</div>
  125 +
  126 +
  127 +
  128 +
  129 +
  130 +
  131 +
  132 +
  133 +
  134 +
  135 +
  136 +
... ...
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/form.html
1   -<div class="page-head">
2   - <div class="page-title">
3   - <h1>路牌管理</h1>
4   - </div>
5   -</div>
6   -
7   -<ul class="page-breadcrumb breadcrumb">
8   - <li>
9   - <a href="/pages/home.html" data-pjax="">首页</a>
10   - <i class="fa fa-circle"></i>
11   - </li>
12   - <li>
13   - <span class="active">运营计划管理</span>
14   - <i class="fa fa-circle"></i>
15   - </li>
16   - <li>
17   - <a ui-sref="guideboardManage">路牌管理</a>
18   - <i class="fa fa-circle"></i>
19   - </li>
20   - <li>
21   - <span class="active">添加路牌</span>
22   - </li>
23   -</ul>
24   -
25   -<div class="portlet light bordered" ng-controller="GuideboardManageFormCtrl as ctrl">
26   - <div class="portlet-title">
27   - <div class="caption">
28   - <i class="icon-equalizer font-red-sunglo"></i> <span
29   - class="caption-subject font-red-sunglo bold uppercase">表单</span>
30   - </div>
31   - </div>
32   -
33   - <div class="portlet-body form">
34   - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
35   -
36   - <div class="form-body">
37   - <div class="form-group has-success has-feedback">
38   - <label class="col-md-2 control-label">线路*:</label>
39   - <div class="col-md-3">
40   - <sa-Select5 name="xl"
41   - model="ctrl.guideboardManageForForm"
42   - cmaps="{'xl.id' : 'id'}"
43   - dcname="xl.id"
44   - icname="id"
45   - dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
46   - iterobjname="item"
47   - iterobjexp="item.name"
48   - searchph="请输拼音..."
49   - searchexp="this.name"
50   - required >
51   - </sa-Select5>
52   - </div>
53   - <!-- 隐藏块,显示验证信息 -->
54   - <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
55   - 线路必须选择
56   - </div>
57   - </div>
58   -
59   - <div class="form-group has-success has-feedback">
60   - <label class="col-md-2 control-label">路牌编号:</label>
61   - <div class="col-md-3">
62   - <input type="number" class="form-control" ng-model="ctrl.guideboardManageForForm.lpNo"
63   - name="lpNo" placeholder="请输入路牌编号..." min="1" required
64   - remote-Validation
65   - remotevtype="gbv1"
66   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
67   -
68   - />
69   - </div>
70   - <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.required">
71   - 路牌编号必须填写
72   - </div>
73   - <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.number">
74   - 必须输入数字
75   - </div>
76   - <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.remote">
77   - {{$remote_msg}}
78   - </div>
79   - </div>
80   -
81   - <div class="form-group has-success has-feedback">
82   - <label class="col-md-2 control-label">路牌名称*:</label>
83   - <div class="col-md-3">
84   - <input type="text" class="form-control" ng-model="ctrl.guideboardManageForForm.lpName"
85   - name="lpName" placeholder="请输入路牌名字..." required
86   - remote-Validation
87   - remotevtype="gbv2"
88   - remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
89   -
90   - />
91   - </div>
92   -
93   - <!-- 隐藏块,显示验证信息 -->
94   - <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.required">
95   - 路牌名称必须填写
96   - </div>
97   - <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.remote">
98   - {{$remote_msg}}
99   - </div>
100   - </div>
101   -
102   - <!-- 路牌类型暂时是普通路牌,默认填写了 -->
103   -
104   -
105   - </div>
106   -
107   - <div class="form-actions">
108   - <div class="row">
109   - <div class="col-md-offset-3 col-md-4">
110   - <button type="submit" class="btn green"
111   - ng-disabled="!myForm.$valid"
112   - >
113   - <i class="fa fa-check">提交</i>
114   - </button>
115   - <a type="button" class="btn default" ui-sref="guideboardManage">
116   - <i class="fa fa-times">取消</i>
117   - </a>
118   - </div>
119   - </div>
120   - </div>
121   -
122   - </form>
123   -
124   - </div>
125   -
126   -</div>
127   -
128   -
129   -
130   -
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>路牌管理</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax="">首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <a ui-sref="guideboardManage">路牌管理</a>
  18 + <i class="fa fa-circle"></i>
  19 + </li>
  20 + <li>
  21 + <span class="active">添加路牌</span>
  22 + </li>
  23 +</ul>
  24 +
  25 +<div class="portlet light bordered" ng-controller="GuideboardManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 +
  36 + <div class="form-body">
  37 + <div class="form-group has-success has-feedback">
  38 + <label class="col-md-2 control-label">线路*:</label>
  39 + <div class="col-md-3">
  40 + <sa-Select5 name="xl"
  41 + model="ctrl.guideboardManageForForm"
  42 + cmaps="{'xl.id' : 'id'}"
  43 + dcname="xl.id"
  44 + icname="id"
  45 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  46 + iterobjname="item"
  47 + iterobjexp="item.name"
  48 + searchph="请输拼音..."
  49 + searchexp="this.name"
  50 + required >
  51 + </sa-Select5>
  52 + </div>
  53 + <!-- 隐藏块,显示验证信息 -->
  54 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  55 + 线路必须选择
  56 + </div>
  57 + </div>
  58 +
  59 + <div class="form-group has-success has-feedback">
  60 + <label class="col-md-2 control-label">路牌编号:</label>
  61 + <div class="col-md-3">
  62 + <input type="number" class="form-control" ng-model="ctrl.guideboardManageForForm.lpNo"
  63 + name="lpNo" placeholder="请输入路牌编号..." min="1" required
  64 + remote-Validation
  65 + remotevtype="gbv1"
  66 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
  67 +
  68 + />
  69 + </div>
  70 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.required">
  71 + 路牌编号必须填写
  72 + </div>
  73 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.number">
  74 + 必须输入数字
  75 + </div>
  76 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.remote">
  77 + {{$remote_msg}}
  78 + </div>
  79 + </div>
  80 +
  81 + <div class="form-group has-success has-feedback">
  82 + <label class="col-md-2 control-label">路牌名称*:</label>
  83 + <div class="col-md-3">
  84 + <input type="text" class="form-control" ng-model="ctrl.guideboardManageForForm.lpName"
  85 + name="lpName" placeholder="请输入路牌名字..." required
  86 + remote-Validation
  87 + remotevtype="gbv2"
  88 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
  89 +
  90 + />
  91 + </div>
  92 +
  93 + <!-- 隐藏块,显示验证信息 -->
  94 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.required">
  95 + 路牌名称必须填写
  96 + </div>
  97 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.remote">
  98 + {{$remote_msg}}
  99 + </div>
  100 + </div>
  101 +
  102 + <!-- 路牌类型暂时是普通路牌,默认填写了 -->
  103 +
  104 +
  105 + </div>
  106 +
  107 + <div class="form-actions">
  108 + <div class="row">
  109 + <div class="col-md-offset-3 col-md-4">
  110 + <button type="submit" class="btn green"
  111 + ng-disabled="!myForm.$valid"
  112 + >
  113 + <i class="fa fa-check">提交</i>
  114 + </button>
  115 + <a type="button" class="btn default" ui-sref="guideboardManage">
  116 + <i class="fa fa-times">取消</i>
  117 + </a>
  118 + </div>
  119 + </div>
  120 + </div>
  121 +
  122 + </form>
  123 +
  124 + </div>
  125 +
  126 +</div>
  127 +
  128 +
  129 +
  130 +
... ...