Commit c12f35f28aee7f0e0477beb837f590398363a4ea

Authored by 娄高锋
2 parents 01692e22 c1569fe0

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

Showing 53 changed files with 2735 additions and 1024 deletions

Too many changes to show.

To preserve performance only 53 of 112 files are displayed.

src/main/java/com/bsth/controller/forms/ExportController.java
@@ -203,7 +203,7 @@ public class ExportController { @@ -203,7 +203,7 @@ public class ExportController {
203 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); 203 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
204 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 204 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
205 ReportUtils ee = new ReportUtils(); 205 ReportUtils ee = new ReportUtils();
206 - List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), 206 + List<Vehicleloading> vehicleloading = formsService.vehicleloading(/*map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),*/map.get("line").toString(),
207 map.get("date").toString()); 207 map.get("date").toString());
208 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 208 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
209 int i = 1; 209 int i = 1;
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
@@ -26,93 +26,90 @@ import com.bsth.service.realcontrol.ScheduleRealInfoService; @@ -26,93 +26,90 @@ import com.bsth.service.realcontrol.ScheduleRealInfoService;
26 @RestController 26 @RestController
27 @RequestMapping("mcy_forms") 27 @RequestMapping("mcy_forms")
28 public class MCY_FormsController { 28 public class MCY_FormsController {
29 - 29 +
30 @Autowired 30 @Autowired
31 FormsService formsService; 31 FormsService formsService;
32 - 32 +
33 @Autowired 33 @Autowired
34 ScheduleRealInfoService scheduleRealInfoService; 34 ScheduleRealInfoService scheduleRealInfoService;
35 -  
36 - //行车路单日报表  
37 - @RequestMapping(value = "/waybillday",method = RequestMethod.POST)  
38 - public List<Waybillday> waybillday(@RequestParam Map<String, Object> map){  
39 -  
40 -  
41 -// scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date) 35 +
  36 + // 行车路单日报表
  37 +
  38 + @RequestMapping(value = "/waybillday", method = RequestMethod.POST)
  39 + public List<Waybillday> waybillday(@RequestParam Map<String, Object> map) {
  40 +
  41 + // scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date)
42 return formsService.waybillday(map); 42 return formsService.waybillday(map);
43 } 43 }
44 -  
45 - //线路客流量报表  
46 - @RequestMapping(value = "/linepasswengerflow",method = RequestMethod.POST)  
47 - public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map){  
48 - 44 +
  45 + // 线路客流量报表
  46 +
  47 + @RequestMapping(value = "/linepasswengerflow", method = RequestMethod.POST)
  48 + public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map) {
  49 +
49 return formsService.linepasswengerflow(map); 50 return formsService.linepasswengerflow(map);
50 } 51 }
51 -  
52 -  
53 -  
54 - //班次车辆人员月报表  
55 - @RequestMapping(value = "/shiftuehiclemanth",method = RequestMethod.POST)  
56 - public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map){  
57 - 52 +
  53 + // 班次车辆人员月报表
  54 + @RequestMapping(value = "/shiftuehiclemanth", method = RequestMethod.POST)
  55 + public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map) {
  56 +
58 return formsService.shiftuehiclemanth(map); 57 return formsService.shiftuehiclemanth(map);
59 } 58 }
60 -  
61 -  
62 - //班次车辆人员日统计  
63 - @RequestMapping(value = "/shifday",method = RequestMethod.POST)  
64 - public List<Shifday> shifday(@RequestParam Map<String, Object> map){  
65 - 59 +
  60 + // 班次车辆人员日统计
  61 + @RequestMapping(value = "/shifday", method = RequestMethod.POST)
  62 + public List<Shifday> shifday(@RequestParam Map<String, Object> map) {
  63 +
66 return formsService.shifday(map); 64 return formsService.shifday(map);
67 } 65 }
68 -  
69 - //换人换车情况统计表  
70 - @RequestMapping(value = "/changetochange",method = RequestMethod.POST)  
71 - public List<Changetochange> changetochange(@RequestParam Map<String, Object> map){  
72 - 66 +
  67 + // 换人换车情况统计表
  68 + @RequestMapping(value = "/changetochange", method = RequestMethod.POST)
  69 + public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) {
  70 +
73 return formsService.changetochange(map); 71 return formsService.changetochange(map);
74 } 72 }
75 -  
76 - //路单数据  
77 - @RequestMapping(value = "/singledata",method = RequestMethod.POST)  
78 - public List<Singledata> singledata(@RequestParam Map<String, Object> map){  
79 - 73 +
  74 + // 路单数据
  75 + @RequestMapping(value = "/singledata", method = RequestMethod.POST)
  76 + public List<Singledata> singledata(@RequestParam Map<String, Object> map) {
  77 +
80 return formsService.singledata(map); 78 return formsService.singledata(map);
81 - }  
82 -  
83 - //车辆加注  
84 - @RequestMapping(value = "/vehicleloading",method = RequestMethod.POST)  
85 - public List<Vehicleloading> vehicleloading(@RequestParam String line ,@RequestParam String data){  
86 - return formsService.vehicleloading(line,data);  
87 } 79 }
88 -  
89 -  
90 - //运营服务阶段报表  
91 - @RequestMapping(value = "/operationservice",method = RequestMethod.POST)  
92 - public List<Operationservice> operationservice(@RequestParam Map<String, Object> map){  
93 - 80 +
  81 + // 车辆加注
  82 + @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST)
  83 + public List<Vehicleloading> vehicleloading(/*@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic,*/
  84 + @RequestParam String line, @RequestParam String data) {
  85 + return formsService.vehicleloading(/*gsdmVehic, fgsdmVehic, */line, data);
  86 + }
  87 +
  88 + // 运营服务阶段报表
  89 + @RequestMapping(value = "/operationservice", method = RequestMethod.POST)
  90 + public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) {
  91 +
94 return formsService.operationservice(map); 92 return formsService.operationservice(map);
95 } 93 }
96 -  
97 - //营运线路出车率统计表  
98 - @RequestMapping(value = "/turnoutrate",method = RequestMethod.POST)  
99 - public List<Turnoutrate> turnoutrate(@RequestParam Map<String, Object> map){  
100 -  
101 - return formsService.turnoutrate(map);  
102 - }  
103 -  
104 - //班次执行率统计表  
105 - @RequestMapping(value = "/executionrate",method = RequestMethod.POST)  
106 - public List<Executionrate> executionrate(@RequestParam Map<String, Object> map){  
107 -  
108 - return formsService.executionrate(map);  
109 - }  
110 -  
111 -  
112 - //营运线路名称统计表  
113 - @RequestMapping(value = "/allline",method = RequestMethod.POST)  
114 - public List<Allline> allline(@RequestParam Map<String, Object> map){  
115 -  
116 - return formsService.allline(map); 94 +
  95 + // 营运线路出车率统计表
  96 + @RequestMapping(value = "/turnoutrate", method = RequestMethod.POST)
  97 + public List<Turnoutrate> turnoutrate(@RequestParam Map<String, Object> map) {
  98 +
  99 + return formsService.turnoutrate(map);
  100 + }
  101 +
  102 + // 班次执行率统计表
  103 + @RequestMapping(value = "/executionrate", method = RequestMethod.POST)
  104 + public List<Executionrate> executionrate(@RequestParam Map<String, Object> map) {
  105 +
  106 + return formsService.executionrate(map);
  107 + }
  108 +
  109 + // 营运线路名称统计表
  110 + @RequestMapping(value = "/allline", method = RequestMethod.POST)
  111 + public List<Allline> allline(@RequestParam Map<String, Object> map) {
  112 +
  113 + return formsService.allline(map);
117 } 114 }
118 } 115 }
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
@@ -23,16 +23,40 @@ public class RealMapController { @@ -23,16 +23,40 @@ public class RealMapController {
23 * 根据线路获取站点路由及空间数据 23 * 根据线路获取站点路由及空间数据
24 */ 24 */
25 @RequestMapping(value = "/stationSpatialData") 25 @RequestMapping(value = "/stationSpatialData")
26 - public Map<String, Object> stationSpatialData(@RequestParam String idx){ 26 + public Map<String, Object> stationSpatialData(@RequestParam String idx) {
27 return realMapService.stationSpatialData(idx); 27 return realMapService.stationSpatialData(idx);
28 } 28 }
29 29
30 /** 30 /**
31 * 停车场 31 * 停车场
  32 + *
32 * @return 33 * @return
33 */ 34 */
34 @RequestMapping(value = "/carParkSpatialData") 35 @RequestMapping(value = "/carParkSpatialData")
35 - public Map<String, Object> carParkSpatialData(){ 36 + public Map<String, Object> carParkSpatialData() {
36 return realMapService.carParkSpatialData(); 37 return realMapService.carParkSpatialData();
37 } 38 }
  39 +
  40 +
  41 + /**
  42 + * @param @param lineCode
  43 + * @throws
  44 + * @Title: findRouteByLine
  45 + * @Description: TODO(获取线路的站点,路段路由)
  46 + */
  47 + @RequestMapping(value = "/findRouteByLine")
  48 + public Map<String, Object> findRouteByLine(@RequestParam String lineCode) {
  49 + return realMapService.findRouteByLine(lineCode);
  50 + }
  51 +
  52 +
  53 + /**
  54 + * 获取线路的路段路由 和 站点路由信息 (为前端站间距计算提供数据源)
  55 + * @param lineCode
  56 + * @return
  57 + */
  58 + @RequestMapping(value = "/findRouteAndStationByLine")
  59 + public Map<String, Object> findRouteAndStationByLine(@RequestParam String lineCode){
  60 + return realMapService.findRouteAndStationByLine(lineCode);
  61 + }
38 } 62 }
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
@@ -74,8 +74,8 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -74,8 +74,8 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
74 @RequestMapping(value = "/destroy", method = RequestMethod.POST) 74 @RequestMapping(value = "/destroy", method = RequestMethod.POST)
75 public Map<String, Object> destroy(@RequestParam String idsStr 75 public Map<String, Object> destroy(@RequestParam String idsStr
76 /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, 76 /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/,
77 - @RequestParam String remarks/*, @RequestParam String reason, @RequestParam(defaultValue = "0") int spaceNum*/) {  
78 - return scheduleRealInfoService.destroy(idsStr/*, spaceAdjust*/, remarks/*, reason, spaceNum*/); 77 + @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {
  78 + return scheduleRealInfoService.destroy(idsStr/*, spaceAdjust*/, remarks, adjustExps/*, spaceNum*/);
79 } 79 }
80 80
81 /** 81 /**
src/main/java/com/bsth/controller/schedule/BController.java 0 → 100644
  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/GuideboardInfoController.java deleted 100644 → 0
1 -package com.bsth.controller.schedule;  
2 -  
3 -import com.bsth.controller.BaseController;  
4 -import com.bsth.entity.schedule.GuideboardInfo;  
5 -import com.bsth.repository.schedule.GuideboardInfoRepository;  
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.PathVariable;  
10 -import org.springframework.web.bind.annotation.RequestMapping;  
11 -import org.springframework.web.bind.annotation.RequestMethod;  
12 -import org.springframework.web.bind.annotation.RestController;  
13 -  
14 -import java.util.List;  
15 -import java.util.Map;  
16 -  
17 -/**  
18 - * Created by xu on 16/5/11.  
19 - */  
20 -@RestController  
21 -@RequestMapping("gic")  
22 -@EnableConfigurationProperties(DataToolsProperties.class)  
23 -public class GuideboardInfoController extends BaseController<GuideboardInfo, Long> {  
24 - @Autowired  
25 - private DataToolsProperties dataToolsProperties;  
26 - @Autowired  
27 - private GuideboardInfoRepository guideboardInfoRepository;  
28 -  
29 - @Override  
30 - protected String getDataImportKtrClasspath() {  
31 - return dataToolsProperties.getGuideboardsDatainputktr();  
32 - }  
33 -  
34 - @Override  
35 - public GuideboardInfo findById(@PathVariable("id") Long aLong) {  
36 - return guideboardInfoRepository.findOneExtend(aLong);  
37 - }  
38 -  
39 -  
40 - @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET)  
41 - public List<Map<String, Object>> findLpName(Long ttid) {  
42 - return guideboardInfoRepository.findLpName(ttid);  
43 - }  
44 -}  
src/main/java/com/bsth/controller/schedule/basicinfo/CarsController.java 0 → 100644
  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/GuideboardInfoController.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.GuideboardInfo;
  6 +import com.bsth.repository.schedule.GuideboardInfoRepository;
  7 +import com.bsth.service.schedule.GuideboardInfoService;
  8 +import com.bsth.service.schedule.ScheduleException;
  9 +import com.bsth.service.schedule.utils.DataToolsProperties;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.boot.context.properties.EnableConfigurationProperties;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import java.util.HashMap;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + * 路牌管理控制器。
  23 + */
  24 +@RestController
  25 +@RequestMapping("gic")
  26 +@EnableConfigurationProperties(DataToolsProperties.class)
  27 +public class GuideboardInfoController extends BController<GuideboardInfo, Long> {
  28 + @Autowired
  29 + private GuideboardInfoService guideboardInfoService;
  30 +// @Autowired
  31 +// private DataToolsProperties dataToolsProperties;
  32 + @Autowired
  33 + private GuideboardInfoRepository guideboardInfoRepository;
  34 +//
  35 +// @Override
  36 +// protected String getDataImportKtrClasspath() {
  37 +// return dataToolsProperties.getGuideboardsDatainputktr();
  38 +// }
  39 +//
  40 +// @Override
  41 +// public GuideboardInfo findById(@PathVariable("id") Long aLong) {
  42 +// return guideboardInfoRepository.findOneExtend(aLong);
  43 +// }
  44 +//
  45 +//
  46 + @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET)
  47 + public List<Map<String, Object>> findLpName(Long ttid) {
  48 + return guideboardInfoRepository.findLpName(ttid);
  49 + }
  50 +
  51 + @RequestMapping(value = "/validate1", method = RequestMethod.GET)
  52 + public Map<String, Object> validate1(@RequestParam Map<String, Object> param) {
  53 + Map<String, Object> rtn = new HashMap<>();
  54 + try {
  55 + // 路牌编号验证
  56 + GuideboardInfo guideboardInfo = new GuideboardInfo(
  57 + param.get("xl.id_eq"),
  58 + param.get("lpNo_eq"),
  59 + null
  60 + );
  61 + guideboardInfoService.validate(guideboardInfo);
  62 + rtn.put("status", ResponseCode.SUCCESS);
  63 + } catch (ScheduleException exp) {
  64 + rtn.put("status", ResponseCode.ERROR);
  65 + rtn.put("msg", exp.getMessage());
  66 + }
  67 + return rtn;
  68 + }
  69 +
  70 + @RequestMapping(value = "/validate2", method = RequestMethod.GET)
  71 + public Map<String, Object> validate2(@RequestParam Map<String, Object> param) {
  72 + Map<String, Object> rtn = new HashMap<>();
  73 + try {
  74 + // 路牌名称验证
  75 + GuideboardInfo guideboardInfo = new GuideboardInfo(
  76 + param.get("xl.id_eq"),
  77 + null,
  78 + param.get("lpName_eq")
  79 + );
  80 + guideboardInfoService.validate(guideboardInfo);
  81 + rtn.put("status", ResponseCode.SUCCESS);
  82 + } catch (ScheduleException exp) {
  83 + rtn.put("status", ResponseCode.ERROR);
  84 + rtn.put("msg", exp.getMessage());
  85 + }
  86 + return rtn;
  87 + }
  88 +}
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -117,7 +117,7 @@ public class DayOfSchedule implements CommandLineRunner { @@ -117,7 +117,7 @@ public class DayOfSchedule implements CommandLineRunner {
117 @Override 117 @Override
118 public void run(String... arg0) throws Exception { 118 public void run(String... arg0) throws Exception {
119 //翻班线程 119 //翻班线程
120 -// Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 120 + Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
121 //入库 121 //入库
122 // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); 122 // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);
123 //首班出场指令补发器 123 //首班出场指令补发器
src/main/java/com/bsth/entity/Cars.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
3 import com.bsth.entity.sys.SysUser; 3 import com.bsth.entity.sys.SysUser;
  4 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 5
5 import javax.persistence.*; 6 import javax.persistence.*;
6 import java.io.Serializable; 7 import java.io.Serializable;
@@ -22,6 +23,7 @@ import java.util.Date; @@ -22,6 +23,7 @@ import java.util.Date;
22 23
23 @Entity 24 @Entity
24 @Table(name = "bsth_c_cars") 25 @Table(name = "bsth_c_cars")
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
25 public class Cars implements Serializable { 27 public class Cars implements Serializable {
26 28
27 /** 主键Id */ 29 /** 主键Id */
@@ -30,7 +32,7 @@ public class Cars implements Serializable { @@ -30,7 +32,7 @@ public class Cars implements Serializable {
30 private Integer id; 32 private Integer id;
31 33
32 /** 自编号/内部编号 */ 34 /** 自编号/内部编号 */
33 - @Column(nullable = false, length = 8, unique = true) 35 + @Column(nullable = false, length = 20, unique = true)
34 private String insideCode; 36 private String insideCode;
35 37
36 // 公司、分公司暂时不用关联实体 38 // 公司、分公司暂时不用关联实体
@@ -150,6 +152,26 @@ public class Cars implements Serializable { @@ -150,6 +152,26 @@ public class Cars implements Serializable {
150 /** 修改日期 */ 152 /** 修改日期 */
151 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 153 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
152 private Date updateDate; 154 private Date updateDate;
  155 +
  156 + public Cars() {}
  157 +
  158 + public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) {
  159 + if (id != null) {
  160 + this.id = Integer.valueOf(id.toString());
  161 + }
  162 + if (nbbh != null) {
  163 + this.insideCode = nbbh.toString();
  164 + }
  165 + if (clbh != null) {
  166 + this.carCode = clbh.toString();
  167 + }
  168 + if (cph != null) {
  169 + this.carPlate = cph.toString();
  170 + }
  171 + if (sbbh != null) {
  172 + this.equipmentCode = sbbh.toString();
  173 + }
  174 + }
153 175
154 public String getServiceNo() { 176 public String getServiceNo() {
155 return serviceNo; 177 return serviceNo;
src/main/java/com/bsth/entity/Line.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
3 import org.springframework.format.annotation.DateTimeFormat; 4 import org.springframework.format.annotation.DateTimeFormat;
4 5
5 import javax.persistence.*; 6 import javax.persistence.*;
@@ -23,6 +24,7 @@ import java.util.Date; @@ -23,6 +24,7 @@ import java.util.Date;
23 24
24 @Entity 25 @Entity
25 @Table(name = "bsth_c_line") 26 @Table(name = "bsth_c_line")
  27 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
26 public class Line implements Serializable { 28 public class Line implements Serializable {
27 29
28 @Id 30 @Id
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -128,6 +128,8 @@ public class ScheduleRealInfo { @@ -128,6 +128,8 @@ public class ScheduleRealInfo {
128 128
129 /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */ 129 /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
130 private int status; 130 private int status;
  131 +
  132 + private String adjustExps;
131 133
132 /** 是否是临加班次 */ 134 /** 是否是临加班次 */
133 private boolean sflj; 135 private boolean sflj;
@@ -817,4 +819,12 @@ public class ScheduleRealInfo { @@ -817,4 +819,12 @@ public class ScheduleRealInfo {
817 public void setLate(boolean late) { 819 public void setLate(boolean late) {
818 this.late = late; 820 this.late = late;
819 } 821 }
  822 +
  823 + public String getAdjustExps() {
  824 + return adjustExps;
  825 + }
  826 +
  827 + public void setAdjustExps(String adjustExps) {
  828 + this.adjustExps = adjustExps;
  829 + }
820 } 830 }
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
@@ -2,9 +2,9 @@ package com.bsth.entity.schedule; @@ -2,9 +2,9 @@ package com.bsth.entity.schedule;
2 2
3 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
4 import com.bsth.entity.sys.SysUser; 4 import com.bsth.entity.sys.SysUser;
  5 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5 6
6 import javax.persistence.*; 7 import javax.persistence.*;
7 -import javax.persistence.Table;  
8 import java.util.Date; 8 import java.util.Date;
9 9
10 /** 10 /**
@@ -17,6 +17,7 @@ import java.util.Date; @@ -17,6 +17,7 @@ import java.util.Date;
17 @NamedAttributeNode("xl") 17 @NamedAttributeNode("xl")
18 }) 18 })
19 }) 19 })
  20 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
20 public class GuideboardInfo { 21 public class GuideboardInfo {
21 22
22 /** 主键Id */ 23 /** 主键Id */
@@ -38,6 +39,10 @@ public class GuideboardInfo { @@ -38,6 +39,10 @@ public class GuideboardInfo {
38 @Column(nullable = false) 39 @Column(nullable = false)
39 private String lpType; 40 private String lpType;
40 41
  42 + /** 是否删除(标记) */
  43 + @Column(nullable = false)
  44 + private Boolean isCancel = false;
  45 +
41 /** 创建人 */ 46 /** 创建人 */
42 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) 47 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
43 private SysUser createBy; 48 private SysUser createBy;
@@ -53,6 +58,30 @@ public class GuideboardInfo { @@ -53,6 +58,30 @@ public class GuideboardInfo {
53 private Date updateDate; 58 private Date updateDate;
54 59
55 60
  61 + public GuideboardInfo() {}
  62 +
  63 + public GuideboardInfo(Object xlid, Object lpNo, Object lpName) {
  64 + Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString());
  65 + Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString());
  66 + String lpName_ = lpName == null ? null : String.valueOf(lpName);
  67 +
  68 + if (xlid_ != null) {
  69 + Line line = new Line();
  70 + line.setId(xlid_);
  71 + this.xl = line;
  72 + }
  73 +
  74 + this.lpNo = lpNo_;
  75 + this.lpName = lpName_;
  76 + }
  77 +
  78 + public GuideboardInfo(Integer xlid, Integer lpNo) {
  79 + this(xlid, lpNo, null);
  80 + }
  81 + public GuideboardInfo(Integer xlid, String lpName) {
  82 + this(xlid, null, lpName);
  83 + }
  84 +
56 public Long getId() { 85 public Long getId() {
57 return id; 86 return id;
58 } 87 }
@@ -124,4 +153,12 @@ public class GuideboardInfo { @@ -124,4 +153,12 @@ public class GuideboardInfo {
124 public void setUpdateDate(Date updateDate) { 153 public void setUpdateDate(Date updateDate) {
125 this.updateDate = updateDate; 154 this.updateDate = updateDate;
126 } 155 }
  156 +
  157 + public Boolean getIsCancel() {
  158 + return isCancel;
  159 + }
  160 +
  161 + public void setIsCancel(Boolean isCancel) {
  162 + this.isCancel = isCancel;
  163 + }
127 } 164 }
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -85,6 +85,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -85,6 +85,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
85 @Query(value="select s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') order by bcs") 85 @Query(value="select s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') order by bcs")
86 List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date); 86 List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date);
87 87
  88 + @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between str_to_date(?3,'%Y-%m-%d') and str_to_date(?4,'%Y-%m-%d') order by bcs")
  89 + List<ScheduleRealInfo> queryListWaybill4(String jName,String clZbh,String date,String enddate);
  90 +
88 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2") 91 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2")
89 List<ScheduleRealInfo> scheduleDaily(String line,String date); 92 List<ScheduleRealInfo> scheduleDaily(String line,String date);
90 93
src/main/java/com/bsth/service/forms/FormsService.java
@@ -30,7 +30,7 @@ public interface FormsService { @@ -30,7 +30,7 @@ public interface FormsService {
30 30
31 public List<Singledata> singledata(Map<String, Object> map); 31 public List<Singledata> singledata(Map<String, Object> map);
32 32
33 - public List<Vehicleloading> vehicleloading(String line,String data); 33 + public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line,String data);
34 34
35 public List<Operationservice> operationservice(Map<String, Object> map); 35 public List<Operationservice> operationservice(Map<String, Object> map);
36 36
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
1 package com.bsth.service.forms.impl; 1 package com.bsth.service.forms.impl;
2 2
3 -import java.math.BigDecimal;  
4 -import java.math.MathContext;  
5 -import java.math.RoundingMode;  
6 import java.sql.ResultSet; 3 import java.sql.ResultSet;
7 import java.sql.SQLException; 4 import java.sql.SQLException;
8 import java.text.NumberFormat; 5 import java.text.NumberFormat;
9 import java.text.ParseException; 6 import java.text.ParseException;
10 import java.text.SimpleDateFormat; 7 import java.text.SimpleDateFormat;
11 -import java.util.ArrayList;  
12 import java.util.Date; 8 import java.util.Date;
13 import java.util.HashMap; 9 import java.util.HashMap;
14 import java.util.List; 10 import java.util.List;
@@ -32,8 +28,6 @@ import com.bsth.entity.mcy_forms.Changetochange; @@ -32,8 +28,6 @@ import com.bsth.entity.mcy_forms.Changetochange;
32 import com.bsth.entity.mcy_forms.Executionrate; 28 import com.bsth.entity.mcy_forms.Executionrate;
33 import com.bsth.service.forms.FormsService; 29 import com.bsth.service.forms.FormsService;
34 import com.bsth.service.realcontrol.ScheduleRealInfoService; 30 import com.bsth.service.realcontrol.ScheduleRealInfoService;
35 -import com.bsth.util.ReportRelatedUtils;  
36 -import com.bsth.util.ReportUtils;  
37 31
38 @Service 32 @Service
39 public class FormsServiceImpl implements FormsService { 33 public class FormsServiceImpl implements FormsService {
@@ -47,14 +41,17 @@ public class FormsServiceImpl implements FormsService { @@ -47,14 +41,17 @@ public class FormsServiceImpl implements FormsService {
47 // 行车路单日报表 41 // 行车路单日报表
48 @Override 42 @Override
49 public List<Waybillday> waybillday(Map<String, Object> map) { 43 public List<Waybillday> waybillday(Map<String, Object> map) {
50 - List list1 = new ArrayList<>();//  
51 - String sql ="select x.schedule_date,x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name "  
52 - + "from bsth_c_s_sp_info_real x INNER join "  
53 - + "( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from" 44 + String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name "
  45 + + " from bsth_c_s_sp_info_real x INNER join "
  46 + + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from"
54 + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY " 47 + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY "
55 - + "where to_days(y.RQ)=to_days('"+map.get("date").toString() + "') and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) "  
56 - + "z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') "  
57 - + "and x.xl_bm='"+map.get("line").toString()+"' GROUP BY x.cl_zbh,j_gh"; 48 + + " where to_days(y.RQ)=to_days('"+map.get("date").toString() + "') and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) "
  49 + + " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') "
  50 + + " and x.xl_bm='"+map.get("line").toString()+"'"
  51 + /*+ " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'"
  52 + + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'"*/
  53 + + " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name";
  54 + //x.cl_zbh,j_gh
58 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() { 55 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
59 @Override 56 @Override
60 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException { 57 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
@@ -83,12 +80,18 @@ public class FormsServiceImpl implements FormsService { @@ -83,12 +80,18 @@ public class FormsServiceImpl implements FormsService {
83 // 线路客流量报表 80 // 线路客流量报表
84 @Override 81 @Override
85 public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) { 82 public List<Linepasswengerflow> linepasswengerflow(Map<String, Object> map) {
86 - String sql = " SELECT s.station_name,l.name,l.create_date from bsth_c_stationroute s "  
87 - + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code " 83 + String sql = " SELECT s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"
  84 + + " from bsth_c_stationroute s "
  85 + + " LEFT JOIN bsth_c_line l on s.line_code=l.line_code "
  86 + + " LEFT JOIN bsth_c_s_sp_info_real r on r.xl_bm=l.line_code"
88 + " where to_days(l.create_date)=to_days('"+map.get("date").toString() + "') " 87 + " where to_days(l.create_date)=to_days('"+map.get("date").toString() + "') "
89 - + " and l.line_code=" + map.get("line").toString()  
90 - + " GROUP BY s.station_name "; 88 + + " and l.line_code=" + map.get("line").toString()
  89 + + " AND r.gs_bm is not null"
  90 + /*+ " and r.gs_bm='"+map.get("gsdmLine").toString()+"'"
  91 + + " and r.fgs_bm='"+map.get("fgsdmLine").toString()+"'"*/
  92 + + " GROUP BY s.station_name,l.name,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
91 93
  94 + //s.station_name
92 List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() { 95 List<Linepasswengerflow> list = jdbcTemplate.query(sql, new RowMapper<Linepasswengerflow>() {
93 96
94 @Override 97 @Override
@@ -108,13 +111,17 @@ public class FormsServiceImpl implements FormsService { @@ -108,13 +111,17 @@ public class FormsServiceImpl implements FormsService {
108 111
109 @Override 112 @Override
110 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) { 113 public List<Shiftuehiclemanth> shiftuehiclemanth(Map<String, Object> map) {
111 - List list1 = new ArrayList<>();//  
112 - String sql = "select r.j_name,r.schedule_date_str,r.update_date,r.cl_zbh " + " from bsth_c_s_sp_info_real r "  
113 - + " LEFT JOIN bsth_c_s_ttinfo_detail d on r.lp_name=d.lp "  
114 - + " LEFT JOIN bsth_c_line_information l on l.line=r.lp_name " 114 + String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  115 + + " from bsth_c_s_sp_info_real r "
115 + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') " 116 + " where to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') "
116 - + " and to_days('" + map.get("endDate").toString() + "') " + " and r.xl_bm='"  
117 - + map.get("line").toString() + "' " + " GROUP BY r.j_name" + " ORDER BY r.j_name"; 117 + + " and to_days('" + map.get("endDate").toString() + "') "
  118 + + " and r.xl_bm='"+ map.get("line").toString() + "'"
  119 + + " AND r.gs_bm is not null"
  120 + /* + " and r.gs_bm='"+map.get("gsdmManth").toString()+"'"
  121 + + " and r.fgs_bm='"+map.get("fgsdmManth").toString()+"'"*/
  122 + + " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"
  123 + + " ORDER BY r.j_name";
  124 + //r.j_name
118 startDate = map.get("startDate").toString(); 125 startDate = map.get("startDate").toString();
119 endDate = map.get("endDate").toString(); 126 endDate = map.get("endDate").toString();
120 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { 127 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() {
@@ -123,11 +130,12 @@ public class FormsServiceImpl implements FormsService { @@ -123,11 +130,12 @@ public class FormsServiceImpl implements FormsService {
123 public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { 130 public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException {
124 Shiftuehiclemanth shif = new Shiftuehiclemanth(); 131 Shiftuehiclemanth shif = new Shiftuehiclemanth();
125 shif.setjName(arg0.getString("j_name")); 132 shif.setjName(arg0.getString("j_name"));
126 - 133 +
127 Map<String, Object> maps = new HashMap<>(); 134 Map<String, Object> maps = new HashMap<>();
128 135
129 maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate, 136 maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,
130 endDate); 137 endDate);
  138 +
131 shif.setJhlc(maps.get("jhlc").toString()); 139 shif.setJhlc(maps.get("jhlc").toString());
132 shif.setEmptMileage(maps.get("ksgl").toString()); 140 shif.setEmptMileage(maps.get("ksgl").toString());
133 shif.setRemMileage(maps.get("remMileage").toString()); 141 shif.setRemMileage(maps.get("remMileage").toString());
@@ -148,9 +156,15 @@ public class FormsServiceImpl implements FormsService { @@ -148,9 +156,15 @@ public class FormsServiceImpl implements FormsService {
148 // 班次车辆人员日统计 156 // 班次车辆人员日统计
149 @Override 157 @Override
150 public List<Shifday> shifday(Map<String, Object> map) { 158 public List<Shifday> shifday(Map<String, Object> map) {
151 - String sql = " select r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.schedule_date,r.cl_zbh,r.j_gh "  
152 - + " FROM bsth_c_s_sp_info_real r " + " where to_days(r.schedule_date)=to_days('"  
153 - + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString() + " GROUP BY r.j_name "; 159 + String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
  160 + + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  161 + + " FROM bsth_c_s_sp_info_real r "
  162 + + " where to_days(r.schedule_date)=to_days('"
  163 + + map.get("date").toString() + "') and r.xl_bm=" + map.get("line").toString()
  164 + /*+ " and r.gs_bm='"+map.get("gsdmShif").toString()+"'"
  165 + + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'"*/
  166 + + " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  167 + + " ORDER BY r.lp_name asc";
154 168
155 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { 169 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
156 170
@@ -166,14 +180,14 @@ public class FormsServiceImpl implements FormsService { @@ -166,14 +180,14 @@ public class FormsServiceImpl implements FormsService {
166 map = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"), 180 map = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
167 arg0.getString("schedule_date")); 181 arg0.getString("schedule_date"));
168 shifday.setJhlc(map.get("jhlc").toString());// 计划里程 182 shifday.setJhlc(map.get("jhlc").toString());// 计划里程
169 - // shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程 183 + //shifday.setSjjhlc(map.get("remMileage").toString());//实际计划里程
170 shifday.setYygl(map.get("yygl").toString());// 营运里程 184 shifday.setYygl(map.get("yygl").toString());// 营运里程
171 shifday.setEmptMileage(map.get("ksgl").toString());// 空驶里程 185 shifday.setEmptMileage(map.get("ksgl").toString());// 空驶里程
172 shifday.setRemMileage(map.get("remMileage").toString());// 抽减里程 186 shifday.setRemMileage(map.get("remMileage").toString());// 抽减里程
173 shifday.setAddMileage(map.get("addMileage").toString());// 增加里程 187 shifday.setAddMileage(map.get("addMileage").toString());// 增加里程
174 shifday.setTotalm(map.get("realMileage").toString());// 总里程 188 shifday.setTotalm(map.get("realMileage").toString());// 总里程
175 shifday.setJhbc(map.get("jhbc").toString());// 计划班次 189 shifday.setJhbc(map.get("jhbc").toString());// 计划班次
176 - // shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次 190 + //shifday.setSjjhbc(map.get("sjjhbc").toString());//实际计划班次
177 shifday.setCjbc(map.get("cjbc").toString());// 抽减班次 191 shifday.setCjbc(map.get("cjbc").toString());// 抽减班次
178 shifday.setLjbc(map.get("ljbc").toString());// 增加班次 192 shifday.setLjbc(map.get("ljbc").toString());// 增加班次
179 shifday.setSjbc(map.get("sjbc").toString());// 实际班次 193 shifday.setSjbc(map.get("sjbc").toString());// 实际班次
@@ -249,30 +263,56 @@ public class FormsServiceImpl implements FormsService { @@ -249,30 +263,56 @@ public class FormsServiceImpl implements FormsService {
249 // 路单数据 263 // 路单数据
250 @Override 264 @Override
251 public List<Singledata> singledata(Map<String, Object> map) { 265 public List<Singledata> singledata(Map<String, Object> map) {
  266 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  267 + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
  268 + Date d = null;
  269 + Date d1 = null;
  270 + try {
  271 + d = sdf.parse(map.get("startDate").toString());
  272 + d1 = sdf.parse(map.get("endDate").toString());
  273 + } catch (ParseException e) {
252 274
253 - String sql = " SELECT y.RQ,y.SSGSDM,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " + " FROM bsth_c_ylb y"  
254 - + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "'" + " and '"  
255 - + map.get("endDate").toString() + "'" + " and y.XLBM='" + map.get("line").toString() + "'"  
256 - + " GROUP BY y.NBBM "; 275 + e.printStackTrace();
  276 + }
  277 + String rq2 = sdf1.format(d);
  278 + String rq3 = sdf1.format(d1);
257 279
  280 + rq = rq2 + "-" + rq3;
  281 +
  282 + String sql = " SELECT r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  283 + + " FROM bsth_c_s_sp_info_real r "
  284 + + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
  285 + + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'"
  286 + + " and y.XLBM= '" + map.get("line").toString() + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y on r.cl_zbh=y.nbbm "
  287 + + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'"
  288 + + " and '"+ map.get("endDate").toString() + "'"
  289 + + " and r.xl_bm='" + map.get("line").toString() + "'"
  290 + + " AND r.gs_bm is not null"
  291 + /* + " and r.gs_bm='"+map.get("gsdmSing").toString()+"'"
  292 + + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"'"*/
  293 + + " GROUP BY r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
  294 +
  295 + startDate = map.get("startDate").toString();
  296 + endDate = map.get("endDate").toString();
258 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { 297 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
259 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  
260 - 298 + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
261 @Override 299 @Override
262 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { 300 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
263 Singledata sin = new Singledata(); 301 Singledata sin = new Singledata();
264 - sin.setrQ(sdf.format(arg0.getDate("rq")));  
265 - sin.setgS(arg0.getString("SSGSDM").toString());  
266 - sin.setxL(arg0.getString("XLBM").toString());  
267 - sin.setClzbh(arg0.getString("NBBM").toString());  
268 - sin.setJsy(arg0.getString("JSY").toString()); 302 + sin.setrQ(rq);
  303 + sin.setgS(arg0.getString("gs_name").toString());
  304 + sin.setxL(arg0.getString("xl_bm").toString());
  305 + sin.setClzbh(arg0.getString("cl_zbh").toString());
  306 + sin.setJsy(arg0.getString("j_gh").toString());
  307 + sin.setjName(arg0.getString("j_name").toString());
269 sin.setHyl(arg0.getString("YH").toString()); 308 sin.setHyl(arg0.getString("YH").toString());
270 sin.setJzl(arg0.getString("JZL").toString()); 309 sin.setJzl(arg0.getString("JZL").toString());
271 // sin.setJzl(arg0.getString(""));//非营业性用油 310 // sin.setJzl(arg0.getString(""));//非营业性用油
272 sin.setJhjl(arg0.getString("JZL")); 311 sin.setJhjl(arg0.getString("JZL"));
273 Map<String, Object> maps = new HashMap<>(); 312 Map<String, Object> maps = new HashMap<>();
274 - maps = scheduleRealInfoService.findKMBC2(sin.getJsy(), sin.getClzbh(), sin.getrQ());  
275 - sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString()); 313 + maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,
  314 + endDate);
  315 + //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
276 sin.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString()); 316 sin.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
277 sin.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString()); 317 sin.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString());
278 sin.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); 318 sin.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
@@ -289,22 +329,34 @@ public class FormsServiceImpl implements FormsService { @@ -289,22 +329,34 @@ public class FormsServiceImpl implements FormsService {
289 @Override 329 @Override
290 public List<Operationservice> operationservice(Map<String, Object> map) { 330 public List<Operationservice> operationservice(Map<String, Object> map) {
291 331
292 - String sql = " SELECT y.RQ,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " + " FROM bsth_c_ylb y" + " where y.RQ BETWEEN '"  
293 - + map.get("startDate").toString() + "'" + " and '" + map.get("endDate").toString() + "'"  
294 - + " and y.XLBM='" + map.get("line").toString() + "'" + " GROUP BY y.NBBM ";  
295 - 332 + String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  333 + + " FROM bsth_c_s_sp_info_real r "
  334 + // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM"
  335 + + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
  336 + + " where y.RQ BETWEEN '" + map.get("startDate").toString() + "' and '"+ map.get("endDate").toString() + "'"
  337 + + " and y.XLBM= '" + map.get("line").toString() + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y on r.cl_zbh=y.nbbm "
  338 + + " where r.schedule_date_str BETWEEN '"+ map.get("startDate").toString()
  339 + + "'" + " and '" + map.get("endDate").toString() + "'"
  340 + + " and r.xl_bm='" + map.get("line").toString() + "'"
  341 + /* + " and r.gs_bm='"+map.get("gsdmOperat").toString()+"'"
  342 + + " and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"*/
  343 + + " AND r.gs_bm is not null"
  344 + + " GROUP BY r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name";
  345 +
  346 + //r.j_name
  347 + startDate = map.get("startDate").toString();
  348 + endDate = map.get("endDate").toString();
296 List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() { 349 List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
297 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");  
298 350
299 @Override 351 @Override
300 public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { 352 public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
301 - Singledata sin = new Singledata();  
302 Operationservice op = new Operationservice(); 353 Operationservice op = new Operationservice();
303 - op.setXlName(arg0.getString("XLBM").toString()); 354 + op.setXlName(arg0.getString("xl_name").toString());
304 op.setJzl(arg0.getString("JZL").toString()); 355 op.setJzl(arg0.getString("JZL").toString());
305 op.setXhl(arg0.getString("YH").toString()); 356 op.setXhl(arg0.getString("YH").toString());
306 Map<String, Object> maps = new HashMap<>(); 357 Map<String, Object> maps = new HashMap<>();
307 - maps = scheduleRealInfoService.findKMBC2(sin.getJsy(), sin.getClzbh(), sin.getrQ()); 358 + maps = scheduleRealInfoService.findKMBC1(arg0.getString("j_name"), arg0.getString("cl_zbh"), startDate,
  359 + endDate);
308 op.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString()); 360 op.setXsgl(maps.get("yygl").toString() == null ? "" : maps.get("yygl").toString());
309 op.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString()); 361 op.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
310 op.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString()); 362 op.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
@@ -316,26 +368,36 @@ public class FormsServiceImpl implements FormsService { @@ -316,26 +368,36 @@ public class FormsServiceImpl implements FormsService {
316 368
317 // 车辆加注 369 // 车辆加注
318 @Override 370 @Override
319 - public List<Vehicleloading> vehicleloading(String line, String data) {  
320 -  
321 - String sql = " SELECT y.RQ,y.SSGSDM,y.XLBM,y.NBBM,y.JSY,y.YH,y.JZL " + " FROM bsth_c_ylb y "  
322 - + " where to_days(y.RQ)=to_days('" + data + "')" + " and y.XLBM='" + line + "' "  
323 - + " GROUP BY y.NBBM ";  
324 - 371 + public List<Vehicleloading> vehicleloading(/*String gsdmVehic,String fgsdmVehic,*/String line, String date) {
  372 +
  373 + String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
  374 + + " FROM bsth_c_s_sp_info_real r "
  375 + + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
  376 + + " where to_days(y.RQ)=to_days('" + date + "') and y.XLBM= '" + line + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y "
  377 + + " on r.cl_zbh=y.nbbm "
  378 + + " where to_days(r.schedule_date_str)=to_days('" + date + "')"
  379 + + " and r.xl_bm='" + line + "' "
  380 + + " AND r.gs_bm is not null"
  381 + /* + " and r.gs_bm='"+gsdmVehic +"'"
  382 + + " and r.fgs_bm='"+fgsdmVehic +"'"*/
  383 + + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
  384 +
  385 +
  386 + //r.cl_zbh
325 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() { 387 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() {
326 @Override 388 @Override
327 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException { 389 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
328 Vehicleloading ve = new Vehicleloading(); 390 Vehicleloading ve = new Vehicleloading();
329 - ve.setrQ(arg0.getString("RQ").toString());  
330 - ve.setgS(arg0.getString("SSDM").toString());  
331 - ve.setxL(arg0.getString("XLBM").toString());  
332 - ve.setClzbh(arg0.getString("NBBM").toString()); 391 + ve.setrQ(arg0.getString("schedule_date_str").toString());
  392 + ve.setgS(arg0.getString("gs_name").toString());
  393 + ve.setxL(arg0.getString("xl_name").toString());
  394 + ve.setClzbh(arg0.getString("cl_zbh").toString());
333 ve.setHyl(arg0.getString("YH").toString()); 395 ve.setHyl(arg0.getString("YH").toString());
334 ve.setJzl(arg0.getString("JZL").toString()); 396 ve.setJzl(arg0.getString("JZL").toString());
335 // ve.setLs(arg0.getString("").toString());//尿素 397 // ve.setLs(arg0.getString("").toString());//尿素
336 Map<String, Object> maps = new HashMap<>(); 398 Map<String, Object> maps = new HashMap<>();
337 - maps = scheduleRealInfoService.findKMBC2(arg0.getString("JSY"), arg0.getString("NBBM"),  
338 - arg0.getString("RQ")); 399 + maps = scheduleRealInfoService.findKMBC2(arg0.getString("j_gh"), arg0.getString("cl_zbh"),
  400 + arg0.getString("schedule_date_str"));
339 ve.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString()); 401 ve.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
340 ve.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次 402 ve.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次
341 ve.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次 403 ve.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次
@@ -367,13 +429,15 @@ public class FormsServiceImpl implements FormsService { @@ -367,13 +429,15 @@ public class FormsServiceImpl implements FormsService {
367 429
368 String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,b.warrant_car from " 430 String sql = " select b.xlgs, a.gs_bm,a.gs_name, a.fgs_bm,a.fgs_name , a.xl_bm,b.sbc,b.sxl,b.scl,a.jbc ,a.jxl ,a.jcl,a.gslsbm,a.fgsbm,b.warrant_car from "
369 + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl" 431 + " (select count(DISTINCT gs_bm) gslsbm, gs_bm, count(DISTINCT fgs_bm) fgsbm,fgs_bm,gs_name,fgs_name ,xl_bm, count(*) as jbc,COUNT(DISTINCT xl_bm) as jxl ,COUNT(DISTINCT cl_zbh) as jcl"
370 - + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"  
371 - + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"  
372 - + map.get("line").toString() + "' AND gs_bm is not null" 432 + + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+ map.get("startDate").toString() + "' "
  433 + + " and '" + map.get("endDate").toString() + "' and xl_bm='"+ map.get("line").toString() + "' "
  434 + + " AND gs_bm is not null "
  435 + /*+ " and gs_bm='"+ map.get("gsdmTurn").toString() + "'"
  436 + + " and fgs_bm='"+ map.get("fgsdmTurn").toString() + "'"*/
373 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" 437 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN ("
374 - + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl,t.warrant_car "  
375 - + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "  
376 - + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" 438 + + " SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl,t.warrant_car "
  439 + + " from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "
  440 + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '"
377 + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString() 441 + map.get("endDate").toString() + "' and xl_bm='" + map.get("line").toString()
378 + "' AND gs_bm is not null " 442 + "' AND gs_bm is not null "
379 + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name) b ON t.company=b.gs_bm) b on " 443 + "GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name) b ON t.company=b.gs_bm) b on "
@@ -412,6 +476,8 @@ public class FormsServiceImpl implements FormsService { @@ -412,6 +476,8 @@ public class FormsServiceImpl implements FormsService {
412 return list; 476 return list;
413 } 477 }
414 478
  479 +
  480 + //班次执行率统计表
415 @Override 481 @Override
416 public List<Executionrate> executionrate(Map<String, Object> map) { 482 public List<Executionrate> executionrate(Map<String, Object> map) {
417 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 483 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -435,6 +501,8 @@ public class FormsServiceImpl implements FormsService { @@ -435,6 +501,8 @@ public class FormsServiceImpl implements FormsService {
435 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" 501 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
436 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" 502 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
437 + map.get("line").toString() + "' AND gs_bm is not null" 503 + map.get("line").toString() + "' AND gs_bm is not null"
  504 + /*+ " and gs_bm='"+ map.get("gsdmEcecut").toString() + "'"
  505 + + " and fgs_bm='"+ map.get("fgsdmEcecut").toString() + "'"*/
438 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" 506 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN ("
439 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " 507 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl "
440 + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real " 508 + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "
@@ -501,6 +569,8 @@ public class FormsServiceImpl implements FormsService { @@ -501,6 +569,8 @@ public class FormsServiceImpl implements FormsService {
501 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '" 569 + " from bsth_c_s_sp_info" + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"
502 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='" 570 + map.get("startDate").toString() + "' and '" + map.get("endDate").toString() + "' and xl_bm='"
503 + map.get("line").toString() + "' AND gs_bm is not null" 571 + map.get("line").toString() + "' AND gs_bm is not null"
  572 + /*+ " and gs_bm='"+ map.get("gsdmAllline").toString() + "'"
  573 + + " and fgs_bm='"+ map.get("fgsdmAllline").toString() + "'"*/
504 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN (" 574 + " GROUP BY gs_bm,fgs_bm,xl_bm,gs_name,fgs_name ) a left JOIN ("
505 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl " 575 + "SELECT COUNT(*) as xlgs,b.gs_bm,b.fgs_bm,b.xl_bm,b.xl_name,b.gs_name,b.fgs_name, b.sbc,b.sxl ,b.scl "
506 + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real " 576 + "from bsth_c_line t RIGHT JOIN (select gs_bm,fgs_bm,xl_bm,xl_name,gs_name,fgs_name, count(*) as sbc,COUNT(DISTINCT xl_bm) as sxl ,COUNT(DISTINCT cl_zbh) as scl from bsth_c_s_sp_info_real "
src/main/java/com/bsth/service/realcontrol/RealMapService.java
@@ -9,4 +9,8 @@ public interface RealMapService { @@ -9,4 +9,8 @@ public interface RealMapService {
9 Map<String, Object> stationSpatialData(String idx); 9 Map<String, Object> stationSpatialData(String idx);
10 10
11 Map<String,Object> carParkSpatialData(); 11 Map<String,Object> carParkSpatialData();
  12 +
  13 + Map<String,Object> findRouteByLine(String lineCode);
  14 +
  15 + Map<String,Object> findRouteAndStationByLine(String lineCode);
12 } 16 }
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
1 package com.bsth.service.realcontrol; 1 package com.bsth.service.realcontrol;
2 2
3 -import java.util.Collection;  
4 -import java.util.List;  
5 -import java.util.Map;  
6 -  
7 -import org.springframework.stereotype.Service;  
8 -  
9 import com.bsth.controller.realcontrol.dto.ChangePersonCar; 3 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
10 import com.bsth.controller.realcontrol.dto.DfsjChange; 4 import com.bsth.controller.realcontrol.dto.DfsjChange;
11 import com.bsth.entity.realcontrol.ScheduleRealInfo; 5 import com.bsth.entity.realcontrol.ScheduleRealInfo;
12 import com.bsth.service.BaseService; 6 import com.bsth.service.BaseService;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.Collection;
  10 +import java.util.List;
  11 +import java.util.Map;
13 12
14 @Service 13 @Service
15 public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, Long>{ 14 public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, Long>{
@@ -18,7 +17,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -18,7 +17,7 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
18 17
19 Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj/*,String nbbm,String jsy,String spy*/); 18 Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj/*,String nbbm,String jsy,String spy*/);
20 19
21 - Map<String, Object> destroy(String idsStr/*, int spaceAdjust*/, String remarks/*, String reason, int spaceNum*/); 20 + Map<String, Object> destroy(String idsStr/*, int spaceAdjust*/, String remarks, String reason/*, int spaceNum*/);
22 21
23 List<Map<String, String>> findDriverByLine(String lineCode); 22 List<Map<String, String>> findDriverByLine(String lineCode);
24 23
src/main/java/com/bsth/service/realcontrol/dto/SectionRouteCoords.java 0 → 100644
  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/realcontrol/impl/RealChartsServiceImpl.java
@@ -218,7 +218,7 @@ public class RealChartsServiceImpl implements RealChartsService { @@ -218,7 +218,7 @@ public class RealChartsServiceImpl implements RealChartsService {
218 } 218 }
219 inStr = " (" + inStr.substring(1) + ")"; 219 inStr = " (" + inStr.substring(1) + ")";
220 220
221 - String sql = "select min(DFSJ) as STARTDATE,max(DFSJ) as ENDDATE,SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE from (SELECT SCHEDULE_DATE_STR,concat_ws('_',concat_ws('/', dfsj, fcsj_actual),fcno) AS DFSJ,XL_BM,XL_DIR,REAL_EXEC_DATE FROM bsth_c_s_sp_info_real WHERE schedule_date_str LIKE :month AND bc_type = 'normal' AND dfsj IS NOT NULL AND xl_bm IN "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE"; 221 + String sql = "select min(DFSJ) as STARTDATE,max(DFSJ) as ENDDATE,SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE from (SELECT SCHEDULE_DATE_STR,concat_ws('_',concat_ws('/', dfsj, fcsj_actual),fcno) AS DFSJ,XL_BM,XL_DIR,REAL_EXEC_DATE FROM bsth_c_s_sp_info_real WHERE schedule_date_str LIKE :month AND bc_type = 'normal' AND dfsj IS NOT NULL AND xl_bm IN "+inStr+" AND status !=-1) t group by SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE";
222 MapSqlParameterSource parameters = new MapSqlParameterSource(); 222 MapSqlParameterSource parameters = new MapSqlParameterSource();
223 parameters.addValue("month", month+"-%"); 223 parameters.addValue("month", month+"-%");
224 224
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
@@ -4,17 +4,18 @@ import com.bsth.common.ResponseCode; @@ -4,17 +4,18 @@ import com.bsth.common.ResponseCode;
4 import com.bsth.controller.realcontrol.dto.StationSpatialData; 4 import com.bsth.controller.realcontrol.dto.StationSpatialData;
5 import com.bsth.entity.CarPark; 5 import com.bsth.entity.CarPark;
6 import com.bsth.service.realcontrol.RealMapService; 6 import com.bsth.service.realcontrol.RealMapService;
  7 +import com.bsth.service.realcontrol.dto.SectionRouteCoords;
  8 +import com.bsth.util.TransGPS;
7 import com.google.common.base.Splitter; 9 import com.google.common.base.Splitter;
8 import org.slf4j.Logger; 10 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 11 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired; 12 import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.dao.DataAccessException;
11 import org.springframework.jdbc.core.BeanPropertyRowMapper; 14 import org.springframework.jdbc.core.BeanPropertyRowMapper;
12 import org.springframework.jdbc.core.JdbcTemplate; 15 import org.springframework.jdbc.core.JdbcTemplate;
13 import org.springframework.stereotype.Service; 16 import org.springframework.stereotype.Service;
14 17
15 -import java.util.HashMap;  
16 -import java.util.List;  
17 -import java.util.Map; 18 +import java.util.*;
18 19
19 /** 20 /**
20 * Created by panzhao on 2016/11/23. 21 * Created by panzhao on 2016/11/23.
@@ -36,13 +37,13 @@ public class RealMapServiceImpl implements RealMapService { @@ -36,13 +37,13 @@ public class RealMapServiceImpl implements RealMapService {
36 //拼接in语句 37 //拼接in语句
37 String inStr = ""; 38 String inStr = "";
38 for (String code : idArray) { 39 for (String code : idArray) {
39 - inStr += (",'" + code+"'"); 40 + inStr += (",'" + code + "'");
40 } 41 }
41 inStr = " (" + inStr.substring(1) + ")"; 42 inStr = " (" + inStr.substring(1) + ")";
42 43
43 - String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0"; 44 + String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in " + inStr + " and r.destroy=0";
44 45
45 - List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class)); 46 + List<StationSpatialData> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(StationSpatialData.class));
46 rs.put("status", ResponseCode.SUCCESS); 47 rs.put("status", ResponseCode.SUCCESS);
47 rs.put("list", list); 48 rs.put("list", list);
48 } catch (Exception e) { 49 } catch (Exception e) {
@@ -61,7 +62,7 @@ public class RealMapServiceImpl implements RealMapService { @@ -61,7 +62,7 @@ public class RealMapServiceImpl implements RealMapService {
61 try { 62 try {
62 String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0 and shapes_type='d'"; 63 String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0 and shapes_type='d'";
63 64
64 - List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class)); 65 + List<CarPark> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(CarPark.class));
65 rs.put("status", ResponseCode.SUCCESS); 66 rs.put("status", ResponseCode.SUCCESS);
66 rs.put("list", list); 67 rs.put("list", list);
67 } catch (Exception e) { 68 } catch (Exception e) {
@@ -71,4 +72,123 @@ public class RealMapServiceImpl implements RealMapService { @@ -71,4 +72,123 @@ public class RealMapServiceImpl implements RealMapService {
71 } 72 }
72 return rs; 73 return rs;
73 } 74 }
  75 +
  76 + @Override
  77 + public Map<String, Object> findRouteByLine(String lineCode) {
  78 + Map<String, Object> rs = new HashMap<>();
  79 + String sql = "SELECT r.ID,r.LINE_CODE,r.SECTION_CODE,r.SECTIONROUTE_CODE,r.DIRECTIONS,s.SECTION_NAME,ST_AsText(s.GSECTION_VECTOR) GSECTION_VECTOR,s.SECTION_DISTANCE,s.SECTION_TIME FROM bsth_c_sectionroute r INNER JOIN bsth_c_section s on r.section_code=s.section_code WHERE r.line_code=? and r.destroy=0 order by sectionroute_code";
  80 + List<SectionRouteCoords> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SectionRouteCoords.class), lineCode);
  81 +
  82 + //排序
  83 + Collections.sort(list, new Comparator<SectionRouteCoords>() {
  84 + @Override
  85 + public int compare(SectionRouteCoords o1, SectionRouteCoords o2) {
  86 + return Integer.parseInt(o1.getSectionrouteCode()) - Integer.parseInt(o2.getSectionrouteCode());
  87 + }
  88 + });
  89 +
  90 + List<String> upList = new ArrayList<>(),
  91 + downList = new ArrayList<>();
  92 +
  93 + String vectorStr = "";
  94 + for (SectionRouteCoords sr : list) {
  95 + vectorStr = sr.getGsectionVector();
  96 + vectorStr = vectorStr.substring(11, vectorStr.length() - 2);
  97 +
  98 + if (sr.getDirections() == 0)
  99 + upList.add(vectorStr);
  100 + else
  101 + downList.add(vectorStr);
  102 + }
  103 +
  104 + rs.put("up", upList);
  105 + rs.put("down", downList);
  106 + rs.put("up_bd", multiWgsToBd(upList));
  107 + rs.put("down_bd", multiWgsToBd(downList));
  108 + rs.put("up_gcj", multiWgsToGcj(upList));
  109 + rs.put("down_gcj", multiWgsToGcj(downList));
  110 +
  111 + rs.put("lineId", lineCode);
  112 + return rs;
  113 + }
  114 +
  115 + @Override
  116 + public Map<String, Object> findRouteAndStationByLine(String lineCode) {
  117 + Map<String, Object> rs = new HashMap<>();
  118 + try {
  119 + //查询路段信息
  120 + String sql = "select r.LINE_CODE,r.SECTION_CODE,r.SECTIONROUTE_CODE,s.SECTION_NAME,ST_AsText(s.GSECTION_VECTOR) as GSECTION_VECTOR, r.DIRECTIONS from bsth_c_sectionroute r INNER JOIN bsth_c_section s on r.section=s.id where r.line_code=? and r.destroy=0";
  121 + List<Map<String, Object>> secList = jdbcTemplate.queryForList(sql, lineCode);
  122 + rs.put("section", secList);
  123 +
  124 + //查询站点信息
  125 + sql="select r.STATION_NAME,r.STATION_ROUTE_CODE,r.LINE_CODE,r.STATION_CODE,r.STATION_MARK,s.G_LONX,s.G_LATY, r.DIRECTIONS from bsth_c_stationroute r INNER JOIN bsth_c_station s on r.station=s.id and r.line_code=? and r.destroy=0";
  126 + List<Map<String, Object>> stationList = jdbcTemplate.queryForList(sql, lineCode);
  127 + rs.put("station", stationList);
  128 +
  129 + rs.put("status", ResponseCode.SUCCESS);
  130 + } catch (DataAccessException e) {
  131 + logger.error("", e);
  132 + rs.put("status", ResponseCode.ERROR);
  133 + }
  134 + return rs;
  135 + }
  136 +
  137 + /**
  138 + * wgs 坐标数组转 百度
  139 + *
  140 + * @param list
  141 + * @return
  142 + */
  143 + private List<String> multiWgsToBd(List<String> list) {
  144 + List<String> bdList = new ArrayList<>();
  145 +
  146 + StringBuilder itemStr;
  147 + String[] subArr, cds;
  148 + TransGPS.Location location;
  149 + for (String item : list) {
  150 + subArr = item.split(",");
  151 +
  152 + itemStr = new StringBuilder();
  153 + for (String coord : subArr) {
  154 + cds = coord.split(" ");
  155 + //城建转经纬度
  156 + //Map<String, Double> map = JWDUtil.ConvertSHToJW(Double.parseDouble(cds[0]), Double.parseDouble(cds[1]));
  157 +
  158 +
  159 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(cds[0]), Double.parseDouble(cds[1]))));
  160 + itemStr.append(location.getLng() + " " + location.getLat() + ",");
  161 + }
  162 +
  163 + bdList.add(itemStr.substring(0, itemStr.length() - 1));
  164 + }
  165 + return bdList;
  166 + }
  167 +
  168 + /**
  169 + * wgs 坐标数组转 Gcj
  170 + *
  171 + * @param list
  172 + * @return
  173 + */
  174 + private List<String> multiWgsToGcj(List<String> list) {
  175 + List<String> gcjList = new ArrayList<>();
  176 +
  177 + StringBuilder itemStr;
  178 + String[] subArr, cds;
  179 + TransGPS.Location location;
  180 + for (String item : list) {
  181 + subArr = item.split(",");
  182 +
  183 + itemStr = new StringBuilder();
  184 + for (String coord : subArr) {
  185 + cds = coord.split(" ");
  186 + location = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(cds[0]), Double.parseDouble(cds[1])));
  187 + itemStr.append(location.getLng() + " " + location.getLat() + ",");
  188 + }
  189 +
  190 + gcjList.add(itemStr.substring(0, itemStr.length() - 1));
  191 + }
  192 + return gcjList;
  193 + }
74 } 194 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -33,7 +33,6 @@ import com.bsth.service.SectionRouteService; @@ -33,7 +33,6 @@ import com.bsth.service.SectionRouteService;
33 import com.bsth.service.impl.BaseServiceImpl; 33 import com.bsth.service.impl.BaseServiceImpl;
34 import com.bsth.service.realcontrol.ScheduleRealInfoService; 34 import com.bsth.service.realcontrol.ScheduleRealInfoService;
35 import com.bsth.util.*; 35 import com.bsth.util.*;
36 -import com.bsth.util.TransGPS.Location;  
37 import com.bsth.websocket.handler.SendUtils; 36 import com.bsth.websocket.handler.SendUtils;
38 import com.google.common.base.Splitter; 37 import com.google.common.base.Splitter;
39 import com.google.common.collect.ArrayListMultimap; 38 import com.google.common.collect.ArrayListMultimap;
@@ -155,7 +154,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -155,7 +154,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
155 } 154 }
156 155
157 @Override 156 @Override
158 - public Map<String, Object> destroy(String idsStr, /*int spaceAdjust, */String remarks/*, String reason, int spaceNum*/) { 157 + public Map<String, Object> destroy(String idsStr, /*int spaceAdjust, */String remarks, String reason/*, int spaceNum*/) {
159 158
160 Map<String, Object> map = new HashMap<>(); 159 Map<String, Object> map = new HashMap<>();
161 List<ScheduleRealInfo> rsList = new ArrayList<>(); 160 List<ScheduleRealInfo> rsList = new ArrayList<>();
@@ -171,7 +170,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -171,7 +170,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
171 map.put("msg", "不必要的重复烂班!"); 170 map.put("msg", "不必要的重复烂班!");
172 return map; 171 return map;
173 } 172 }
174 - 173 +
  174 + schedule.setAdjustExps(reason);
175 schedule.destroy(); 175 schedule.destroy();
176 schedule.addRemarks(remarks); 176 schedule.addRemarks(remarks);
177 177
@@ -991,7 +991,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -991,7 +991,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
991 return ""; 991 return "";
992 992
993 String gcjStr = ""; 993 String gcjStr = "";
994 - Location location; 994 + TransGPS.Location location;
995 for(String crd : array){ 995 for(String crd : array){
996 subArray = crd.split(" "); 996 subArray = crd.split(" ");
997 if(subArray.length != 2) 997 if(subArray.length != 2)
@@ -1680,7 +1680,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1680,7 +1680,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1680 @Override 1680 @Override
1681 public Map<String, Object> findKMBC1(String jName, String clZbh, 1681 public Map<String, Object> findKMBC1(String jName, String clZbh,
1682 String date, String enddate) { 1682 String date, String enddate) {
1683 - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill2(jName, clZbh, date, enddate); 1683 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill4(jName, clZbh, date, enddate);
1684 DecimalFormat format = new DecimalFormat("0.00"); 1684 DecimalFormat format = new DecimalFormat("0.00");
1685 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 1685 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
1686 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 1686 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
src/main/java/com/bsth/service/schedule/BService.java 0 → 100644
  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/CarsService.java 0 → 100644
  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/GuideboardInfoService.java
1 package com.bsth.service.schedule; 1 package com.bsth.service.schedule;
2 2
3 import com.bsth.entity.schedule.GuideboardInfo; 3 import com.bsth.entity.schedule.GuideboardInfo;
4 -import com.bsth.service.BaseService;  
5 4
6 /** 5 /**
7 * Created by xu on 16/5/11. 6 * Created by xu on 16/5/11.
8 */ 7 */
9 -public interface GuideboardInfoService extends BaseService<GuideboardInfo, Long> { 8 +public interface GuideboardInfoService extends BService<GuideboardInfo, Long> {
  9 + public void validate(GuideboardInfo guideboardInfo) throws ScheduleException;
  10 + public void toggleCancel(Long id) throws ScheduleException;
10 } 11 }
src/main/java/com/bsth/service/schedule/GuideboardInfoServiceImpl.java deleted 100644 → 0
1 -package com.bsth.service.schedule;  
2 -  
3 -import com.bsth.entity.schedule.GuideboardInfo;  
4 -import com.bsth.service.impl.BaseServiceImpl;  
5 -import org.springframework.stereotype.Service;  
6 -  
7 -/**  
8 - * Created by xu on 16/5/11.  
9 - */  
10 -@Service  
11 -public class GuideboardInfoServiceImpl extends BaseServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService {  
12 -}  
src/main/java/com/bsth/service/schedule/ScheduleException.java 0 → 100644
  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 0 → 100644
  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/CarsServiceImpl.java 0 → 100644
  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/GuideboardInfoServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.schedule.GuideboardInfo;
  4 +import com.bsth.entity.schedule.TTInfoDetail;
  5 +import com.bsth.service.schedule.GuideboardInfoService;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import com.bsth.service.schedule.TTInfoDetailService;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Service;
  10 +import org.springframework.util.CollectionUtils;
  11 +
  12 +import javax.transaction.Transactional;
  13 +import java.util.HashMap;
  14 +import java.util.List;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * 路牌信息服务。
  19 + */
  20 +@Service
  21 +public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService {
  22 + @Autowired
  23 + private TTInfoDetailService ttInfoDetailService;
  24 +
  25 + // 验证方法
  26 + @Transactional
  27 + public void validate(GuideboardInfo guideboardInfo) throws ScheduleException {
  28 + // 查询条件
  29 + Map<String, Object> param = new HashMap<>();
  30 + if (guideboardInfo.getId() != null)
  31 + param.put("id_ne", guideboardInfo.getId());
  32 +
  33 + if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) {
  34 + throw new ScheduleException("线路未选择");
  35 + } else {
  36 + param.put("xl.id_eq", guideboardInfo.getXl().getId());
  37 +
  38 +// param.put("isCancel_eq", false); // 作废的也算入判定区
  39 + if (guideboardInfo.getLpNo() != null) {
  40 + if (guideboardInfo.getLpName() != null) {
  41 + // 如果两个都写了,分开查询
  42 + param.put("lpNo_eq", guideboardInfo.getLpNo());
  43 + if (!CollectionUtils.isEmpty(list(param))) {
  44 + throw new ScheduleException("路牌编号重复");
  45 + }
  46 + param.remove("lpNo_eq");
  47 + param.put("lpName_eq", guideboardInfo.getLpName());
  48 + if (!CollectionUtils.isEmpty(list(param))) {
  49 + throw new ScheduleException("路牌名称重复");
  50 + }
  51 +
  52 + } else {
  53 + param.put("lpNo_eq", guideboardInfo.getLpNo());
  54 + if (!CollectionUtils.isEmpty(list(param))) {
  55 + throw new ScheduleException("路牌编号重复");
  56 + }
  57 + }
  58 + } else {
  59 + if (guideboardInfo.getLpName() != null) {
  60 + param.put("lpName_eq", guideboardInfo.getLpName());
  61 + if (!CollectionUtils.isEmpty(list(param))) {
  62 + throw new ScheduleException("路牌名字重复");
  63 + }
  64 + } else {
  65 + // 都为空
  66 + throw new ScheduleException("路牌编号名字都为空");
  67 + }
  68 + }
  69 + }
  70 +
  71 + }
  72 +
  73 + @Transactional
  74 + @Override
  75 + public void delete(Long aLong) throws ScheduleException {
  76 + // 删除操作就是作废操作
  77 + toggleCancel(aLong);
  78 + }
  79 +
  80 + // 作废方法
  81 + @Transactional
  82 + public void toggleCancel(Long id) throws ScheduleException {
  83 + GuideboardInfo guideboardInfo = findById(id);
  84 + Map<String, Object> param = new HashMap<>();
  85 + if (guideboardInfo.getIsCancel()) {
  86 + validate(guideboardInfo);
  87 + guideboardInfo.setIsCancel(false);
  88 + } else {
  89 + param.clear();
  90 + param.put("xl.id_eq", guideboardInfo.getXl().getId());
  91 + param.put("ttinfo.isCancel_eq", false);
  92 + param.put("lp.id_eq", guideboardInfo.getId());
  93 + List<TTInfoDetail> ttInfoDetailList = (List<TTInfoDetail>) ttInfoDetailService.list(param);
  94 + if (CollectionUtils.isEmpty(ttInfoDetailList)) {
  95 + guideboardInfo.setIsCancel(true);
  96 + } else {
  97 + throw new ScheduleException("在时刻表" +
  98 + ttInfoDetailList.get(0).getTtinfo().getName() +
  99 + "已使用,无法删除!");
  100 + }
  101 + }
  102 + }
  103 +
  104 +}
src/main/resources/static/pages/control/lineallot/allot.html
@@ -403,8 +403,9 @@ $(function(){ @@ -403,8 +403,9 @@ $(function(){
403 } 403 }
404 var f = arguments.callee 404 var f = arguments.callee
405 ,item = lsData[i]; 405 ,item = lsData[i];
406 -  
407 - $.get('/realSchedule/findRouteByLine', {lineCode: item.lineCode}, function(rs){ 406 +
  407 + //$.get('/realMap/findRouteByLine', {lineCode: item.lineCode}, function(rs){
  408 + $.get('/realSchedule/findRouteByLine', {lineCode: item.lineCode}, function(rs){
408 if(rs && rs.lineId){ 409 if(rs && rs.lineId){
409 cacheData[item.lineCode] = rs; 410 cacheData[item.lineCode] = rs;
410 i ++; 411 i ++;
src/main/resources/static/pages/forms/statement/allline.html
1 <style type="text/css"> 1 <style type="text/css">
2 - .table-bordered {  
3 - border: 1px solid; }  
4 - .table-bordered > thead > tr > th,  
5 - .table-bordered > thead > tr > td,  
6 - .table-bordered > tbody > tr > th,  
7 - .table-bordered > tbody > tr > td,  
8 - .table-bordered > tfoot > tr > th,  
9 - .table-bordered > tfoot > tr > td {  
10 - border: 1px solid; }  
11 - .table-bordered > thead > tr > th,  
12 - .table-bordered > thead > tr > td {  
13 - border-bottom-width: 2px;  
14 - text-align: center;}  
15 -  
16 - .table > tbody + tbody {  
17 - border-top: 1px solid; }  
18 - .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; }  
19 -.table-checkable tr > th:first-child, .table-checkable tr > td:first-child {  
20 - text-align: center;  
21 - max-width: initial;  
22 - min-width: 40px;  
23 - padding-left: 0;  
24 - padding-right: 0; 2 +.table-bordered {
  3 + border: 1px solid;
25 } 4 }
26 5
  6 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td,
  7 + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td,
  8 + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td {
  9 + border: 1px solid;
  10 +}
  11 +
  12 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
  13 + border-bottom-width: 2px;
  14 + text-align: center;
  15 +}
  16 +
  17 +.table>tbody+tbody {
  18 + border-top: 1px solid;
  19 +}
  20 +
  21 +.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
  22 + .table>thead>tr>td, .table>thead>tr>th {
  23 + text-align: center;
  24 +}
  25 +
  26 +.table-checkable tr>th:first-child, .table-checkable tr>td:first-child {
  27 + text-align: center;
  28 + max-width: initial;
  29 + min-width: 40px;
  30 + padding-left: 0;
  31 + padding-right: 0;
  32 +}
27 </style> 33 </style>
28 34
29 <div class="page-head"> 35 <div class="page-head">
@@ -37,51 +43,64 @@ @@ -37,51 +43,64 @@
37 <div class="portlet light porttlet-fit bordered"> 43 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 44 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 45 <form class="form-inline" action="" method="post">
40 - <div style="display: inline-block;">  
41 - <span class="item-label" style="width: 80px;">线路: </span>  
42 - <select class="form-control" name="line" id="line" style="width: 120px;"></select>  
43 - </div>  
44 - <div style="display: inline-block;margin-left: 15px;">  
45 - <span class="item-label" style="width: 80px;">开始时间: </span>  
46 - <input class="form-control" type="text" id="startDate" style="width: 120px;"/>  
47 - </div>  
48 - <div style="display: inline-block;margin-left: 15px;">  
49 - <span class="item-label" style="width: 80px;">结束时间: </span>  
50 - <input class="form-control" type="text" id="endDate" style="width: 120px;"/>  
51 - </div>  
52 - <div class="form-group">  
53 - <input class="btn btn-default" type="button" id="query" value="筛选"/>  
54 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
55 - </div> 46 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_allline">
  47 + <span class="item-label" style="width: 80px;">公司: </span>
  48 + <select class="form-control" name="company" id="gsdmAllline" style="width: 140px;"></select>
  49 + </div>
  50 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_allline">
  51 + <span class="item-label" style="width: 80px;">分公司: </span>
  52 + <select class="form-control" name="subCompany" id="fgsdmAllline" style="width: 140px;"></select>
  53 + </div> -->
  54 + <div style="display: inline-block;">
  55 + <span class="item-label" style="width: 80px;">线路: </span> <select
  56 + class="form-control" name="line" id="line" style="width: 120px;"></select>
  57 + </div>
  58 + <div style="display: inline-block; margin-left: 15px;">
  59 + <span class="item-label" style="width: 80px;">开始时间: </span> <input
  60 + class="form-control" type="text" id="startDate"
  61 + style="width: 120px;" />
  62 + </div>
  63 + <div style="display: inline-block; margin-left: 15px;">
  64 + <span class="item-label" style="width: 80px;">结束时间: </span> <input
  65 + class="form-control" type="text" id="endDate"
  66 + style="width: 120px;" />
  67 + </div>
  68 + <div class="form-group">
  69 + <input class="btn btn-default" type="button" id="query" value="筛选" />
  70 + <input class="btn btn-default" type="button" id="export"
  71 + value="导出" />
  72 + </div>
56 </form> 73 </form>
57 </div> 74 </div>
58 <div class="portlet-body"> 75 <div class="portlet-body">
59 - <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px">  
60 - <table class="table table-bordered table-hover table-checkable" id="forms1"> 76 + <div class="table-container"
  77 + style="margin-top: 20px; overflow: auto; min-width: 1000px">
  78 + <table class="table table-bordered table-hover table-checkable"
  79 + id="forms1">
61 <thead> 80 <thead>
62 <tr> 81 <tr>
63 <th colspan="15">营运线路名称统计表</th> 82 <th colspan="15">营运线路名称统计表</th>
64 </tr> 83 </tr>
65 <tr> 84 <tr>
66 - <td rowspan="2" style=" padding-top: 20px;">日期</td>  
67 - <td rowspan="2" style=" padding-top: 20px;">公司</td>  
68 - <td rowspan="2" style=" padding-top: 20px;">直属公司</td>  
69 - <td rowspan="2" style=" padding-top: 20px;">线路名称</td> 85 + <td rowspan="2" style="padding-top: 20px;">日期</td>
  86 + <td rowspan="2" style="padding-top: 20px;">公司</td>
  87 + <td rowspan="2" style="padding-top: 20px;">直属公司</td>
  88 + <td rowspan="2" style="padding-top: 20px;">线路名称</td>
70 <td colspan="2">出车数</td> 89 <td colspan="2">出车数</td>
71 - <td rowspan="2" >出车率</td>  
72 - <td colspan="2" >班次数</td>  
73 - <td rowspan="2" style=" padding-top: 20px;">班次执行率</td>  
74 - <td rowspan="2" style=" padding-top: 20px;">说明</td> 90 + <td rowspan="2">出车率</td>
  91 + <td colspan="2">班次数</td>
  92 + <td rowspan="2" style="padding-top: 20px;">班次执行率</td>
  93 + <td rowspan="2" style="padding-top: 20px;">说明</td>
75 </tr> 94 </tr>
76 <tr> 95 <tr>
77 <td>计划</td> 96 <td>计划</td>
78 <td>实际</td> 97 <td>实际</td>
79 - <td>计划</td> 98 + <td>计划</td>
80 <td>实际</td> 99 <td>实际</td>
81 </tr> 100 </tr>
82 </thead> 101 </thead>
83 <tbody id="tbody"> 102 <tbody id="tbody">
84 - 103 +
85 </tbody> 104 </tbody>
86 <tr> 105 <tr>
87 <td colspan="1">分类汇总</td> 106 <td colspan="1">分类汇总</td>
@@ -104,96 +123,178 @@ @@ -104,96 +123,178 @@
104 </div> 123 </div>
105 124
106 <script> 125 <script>
107 - $(function(){ 126 + $(function() {
108 // 关闭左侧栏 127 // 关闭左侧栏
109 if (!$('body').hasClass('page-sidebar-closed')) 128 if (!$('body').hasClass('page-sidebar-closed'))
110 $('.menu-toggler.sidebar-toggler').click(); 129 $('.menu-toggler.sidebar-toggler').click();
111 - 130 +
112 $("#startDate,#endDate").datetimepicker({ 131 $("#startDate,#endDate").datetimepicker({
113 format : 'YYYY-MM-DD', 132 format : 'YYYY-MM-DD',
114 locale : 'zh-cn' 133 locale : 'zh-cn'
115 }); 134 });
116 -  
117 - $.get('/basic/lineCode2Name',function(result){  
118 - var data=[];  
119 -  
120 - for(var code in result){  
121 - data.push({id: code, text: result[code]}); 135 +
  136 + var obj = [];
  137 + $.get('/user/companyData', function(result) {
  138 + obj = result;
  139 + var options = '';
  140 + for (var i = 0; i < obj.length; i++) {
  141 + options += '<option value="'+obj[i].companyCode+'">'
  142 + + obj[i].companyName + '</option>';
122 } 143 }
123 - initPinYinSelect2('#line',data,'');  
124 -  
125 - })  
126 144
127 - var line;  
128 - var startDate;  
129 - var endDate;  
130 - $("#query").on("click",function(){  
131 -  
132 - line = $("#line").val();  
133 - startDate1=$("#startDate").val();  
134 - endDate1=$("#endDate").val();  
135 -  
136 - if(startDate1!=''&&endDate1!=''){  
137 - $post('/mcy_forms/allline',{line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){  
138 - // 把数据填充到模版中  
139 - var tbodyHtml = template('allline',{list:result});  
140 - // 把渲染好的模版html文本追加到表格中  
141 - $('#tbody').html(tbodyHtml);  
142 - line = $("#line").val();  
143 - startDate = $("#startDate").val();  
144 - endDate = $("#endDate").val();  
145 - $("#sDate").text(startDate);  
146 - $("#eDate").text(endDate);  
147 -  
148 - var total_jh = 0;  
149 - var total_sj = 0,total_ccl = 0,total_bcjh = 0;  
150 - var total_bcjh = 0,total_bcsj = 0,total_bczxl = 0;  
151 - var total_gs=0;  
152 - var total_zhgs=0;  
153 - $.each(result, function(i, obj) {  
154 - total_gs +=Number(obj.gsgs);  
155 - total_zhgs +=Number(obj.fgsgs);  
156 - total_jh = Number(obj.cchjh)+Number(total_jh);  
157 - total_sj = Number(obj.cchsj)+Number(total_sj);  
158 -  
159 - total_ccl =(Number(total_sj)/Number(total_jh))*100;  
160 - total_bcjh = Number(obj.bcjh)+Number(total_bcjh);  
161 - total_bcsj = Number(obj.bcsj)+Number(total_bcsj);  
162 - total_bczxl = (Number(total_bcsj)/Number(total_bcjh))*100;  
163 -  
164 - });  
165 - $("#total_gs").text(total_gs);  
166 - $("#total_zhgs").text(total_zhgs);  
167 - $("#total_jh").text(total_jh);  
168 - $("#total_sj").text(total_sj);  
169 - $("#total_ccl").text(total_ccl.toFixed(2)+'%');  
170 - $("#total_bcjh").text(total_bcjh);  
171 - $("#total_bcsj").text(total_bcsj);  
172 - $("#total_bczxl").text(total_bczxl.toFixed(2)+'%');  
173 -  
174 - var temp = {};  
175 - var today_account = 0;  
176 -  
177 - temp["line"] = $("#line").text();  
178 - $.each(result, function(i, obj) {  
179 - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){  
180 - today_account++;  
181 - }  
182 - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");  
183 - });  
184 -  
185 - })  
186 -  
187 - }else{  
188 - alert("请选择时间范围!");  
189 - }  
190 - });  
191 -  
192 - $("#export").on("click",function(){  
193 - $post('/mcy_export/alllineExport',{line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){  
194 - window.open("/downloadFile/download?fileName=营运线路名称统计表"+moment(startDate).format("YYYYMMDD")); 145 + if (obj.length == 0) {
  146 + $("#gsdmDiv_allline").css('display', 'none');
  147 + $('#fgsdmDiv_allline').css('display', 'none');
  148 + } else if (obj.length == 1) {
  149 + $("#gsdmDiv_allline").css('display', 'none');
  150 + if (obj[0].children.length == 1 || obj[0].children.length == 0)
  151 + $('#fgsdmDiv_allline').css('display', 'none');
  152 + }
  153 + $('#gsdmAllline').html(options);
  154 + updateCompany();
195 }); 155 });
196 - }); 156 +
  157 + $("#gsdmAllline").on("change", updateCompany);
  158 + function updateCompany() {
  159 + var company = $('#gsdmAllline').val();
  160 + var options = '';
  161 + for (var i = 0; i < obj.length; i++) {
  162 + if (obj[i].companyCode == company) {
  163 + var children = obj[i].children;
  164 + for (var j = 0; j < children.length; j++) {
  165 + options += '<option value="'+children[j].code+'">'
  166 + + children[j].name + '</option>';
  167 + }
  168 + }
  169 + }
  170 + $('#fgsdmAllline').html(options);
  171 + }
  172 +
  173 + $.get('/basic/lineCode2Name', function(result) {
  174 + var data = [];
  175 +
  176 + for ( var code in result) {
  177 + data.push({
  178 + id : code,
  179 + text : result[code]
  180 + });
  181 + }
  182 + initPinYinSelect2('#line', data, '');
  183 +
  184 + })
  185 +
  186 + var line;
  187 + var startDate;
  188 + var endDate;
  189 + var gsdmAllline;
  190 + var fgsdmAllline;
  191 + $("#query").on("click",function() {
  192 + line = $("#line").val();
  193 + startDate1 = $("#startDate").val();
  194 + endDate1 = $("#endDate").val();
  195 + gsdmAllline = $("#gsdmAllline").val();
  196 + fgsdmAllline = $("#fgsdmAllline").val();
  197 + if (startDate1 != '' && endDate1 != '') {
  198 + $post('/mcy_forms/allline',{
  199 + /* gsdmAllline:gsdmAllline,fgsdmAllline:fgsdmAllline, */
  200 + line : line,
  201 + startDate : $("#startDate").val(),
  202 + endDate : $("#endDate").val(),
  203 + type : 'query'
  204 + },
  205 + function(result) {
  206 + // 把数据填充到模版中
  207 + var tbodyHtml = template('allline',
  208 + {
  209 + list : result
  210 + });
  211 + // 把渲染好的模版html文本追加到表格中
  212 + $('#tbody').html(tbodyHtml);
  213 + line = $("#line").val();
  214 + startDate = $("#startDate").val();
  215 + endDate = $("#endDate").val();
  216 + $("#sDate").text(startDate);
  217 + $("#eDate").text(endDate);
  218 +
  219 + var total_jh = 0;
  220 + var total_sj = 0, total_ccl = 0, total_bcjh = 0;
  221 + var total_bcjh = 0, total_bcsj = 0, total_bczxl = 0;
  222 + var total_gs = 0;
  223 + var total_zhgs = 0;
  224 + $
  225 + .each(
  226 + result,
  227 + function(i, obj) {
  228 + total_gs += Number(obj.gsgs);
  229 + total_zhgs += Number(obj.fgsgs);
  230 + total_jh = Number(obj.cchjh)
  231 + + Number(total_jh);
  232 + total_sj = Number(obj.cchsj)
  233 + + Number(total_sj);
  234 +
  235 + total_ccl = (Number(total_sj) / Number(total_jh)) * 100;
  236 + total_bcjh = Number(obj.bcjh)
  237 + + Number(total_bcjh);
  238 + total_bcsj = Number(obj.bcsj)
  239 + + Number(total_bcsj);
  240 + total_bczxl = (Number(total_bcsj) / Number(total_bcjh)) * 100;
  241 +
  242 + });
  243 + $("#total_gs").text(total_gs);
  244 + $("#total_zhgs").text(total_zhgs);
  245 + $("#total_jh").text(total_jh);
  246 + $("#total_sj").text(total_sj);
  247 + $("#total_ccl").text(
  248 + total_ccl.toFixed(2) + '%');
  249 + $("#total_bcjh").text(total_bcjh);
  250 + $("#total_bcsj").text(total_bcsj);
  251 + $("#total_bczxl").text(
  252 + total_bczxl.toFixed(2)
  253 + + '%');
  254 +
  255 + var temp = {};
  256 + var today_account = 0;
  257 +
  258 + temp["line"] = $("#line").text();
  259 + $
  260 + .each(
  261 + result,
  262 + function(i, obj) {
  263 + if (moment(
  264 + obj.schedule_date_str)
  265 + .format(
  266 + "YYYY-MM-DD") == moment(
  267 + obj.startDate)
  268 + .format(
  269 + "YYYY-MM-DD")) {
  270 + today_account++;
  271 + }
  272 + obj.updateDate = moment(
  273 + obj.startDate)
  274 + .format(
  275 + "YYYY-MM-DD HH:mm:ss");
  276 + });
  277 +
  278 + })
  279 +
  280 + } else {
  281 + alert("请选择时间范围!");
  282 + }
  283 + });
  284 +
  285 + $("#export").on(
  286 + "click",
  287 + function() {
  288 + $post('/mcy_export/alllineExport', {
  289 + line : line,
  290 + startDate : startDate,
  291 + endDate : endDate,
  292 + type : 'export'
  293 + }, function(result) {
  294 + window.open("/downloadFile/download?fileName=营运线路名称统计表"
  295 + + moment(startDate).format("YYYYMMDD"));
  296 + });
  297 + });
197 }); 298 });
198 </script> 299 </script>
199 <script type="text/html" id="allline"> 300 <script type="text/html" id="allline">
src/main/resources/static/pages/forms/statement/changetochange.html
1 <style type="text/css"> 1 <style type="text/css">
2 - .table-bordered {  
3 - border: 1px solid; }  
4 - .table-bordered > thead > tr > th,  
5 - .table-bordered > thead > tr > td,  
6 - .table-bordered > tbody > tr > th,  
7 - .table-bordered > tbody > tr > td,  
8 - .table-bordered > tfoot > tr > th,  
9 - .table-bordered > tfoot > tr > td {  
10 - border: 1px solid; }  
11 - .table-bordered > thead > tr > th,  
12 - .table-bordered > thead > tr > td {  
13 - border-bottom-width: 2px;  
14 - text-align: center;}  
15 -  
16 - .table > tbody + tbody {  
17 - border-top: 1px solid; }  
18 - .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; }  
19 -.table-checkable tr > th:first-child, .table-checkable tr > td:first-child {  
20 - text-align: center;  
21 - max-width: initial;  
22 - min-width: 40px;  
23 - padding-left: 0;  
24 - padding-right: 0; 2 +.table-bordered {
  3 + border: 1px solid;
25 } 4 }
26 5
  6 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td,
  7 + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td,
  8 + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td {
  9 + border: 1px solid;
  10 +}
  11 +
  12 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
  13 + border-bottom-width: 2px;
  14 + text-align: center;
  15 +}
  16 +
  17 +.table>tbody+tbody {
  18 + border-top: 1px solid;
  19 +}
  20 +
  21 +.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
  22 + .table>thead>tr>td, .table>thead>tr>th {
  23 + text-align: center;
  24 +}
  25 +
  26 +.table-checkable tr>th:first-child, .table-checkable tr>td:first-child {
  27 + text-align: center;
  28 + max-width: initial;
  29 + min-width: 40px;
  30 + padding-left: 0;
  31 + padding-right: 0;
  32 +}
27 </style> 33 </style>
28 34
29 <div class="page-head"> 35 <div class="page-head">
@@ -37,58 +43,71 @@ @@ -37,58 +43,71 @@
37 <div class="portlet light porttlet-fit bordered"> 43 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 44 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 45 <form class="form-inline" action="" method="post">
40 - <div style="display: inline-block;"> 46 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_change">
  47 + <span class="item-label" style="width: 80px;">公司: </span>
  48 + <select class="form-control" name="company" id="gsdmChange" style="width: 140px;"></select>
  49 + </div>
  50 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_change">
  51 + <span class="item-label" style="width: 80px;">分公司: </span>
  52 + <select class="form-control" name="subCompany" id="fgsdmChange" style="width: 140px;"></select>
  53 + </div>
  54 + <div style="display: inline-block;">
41 <span class="item-label" style="width: 80px;">线路: </span> 55 <span class="item-label" style="width: 80px;">线路: </span>
42 - <select class="form-control" name="line" id="line" style="width: 120px;"></select>  
43 - </div>  
44 - <div style="display: inline-block;margin-left: 15px;">  
45 - <span class="item-label" style="width: 80px;">开始时间: </span>  
46 - <input class="form-control" type="text" id="startDate" style="width: 120px;"/> 56 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
47 </div> 57 </div>
48 - <div style="display: inline-block;margin-left: 15px;">  
49 - <span class="item-label" style="width: 80px;">结束时间: </span>  
50 - <input class="form-control" type="text" id="endDate" style="width: 120px;"/>  
51 - </div>  
52 - <div style="display: inline-block;">  
53 - <span class="item-label" style="width: 120px;">类型: </span>  
54 - <select class="form-control" id="sel">  
55 - <option value="">请选择</option>  
56 - <option value="1">换人</option>  
57 - <option value="2">换车</option> 58 + <div style="display: inline-block; margin-left: 15px;">
  59 + <span class="item-label" style="width: 80px;">开始时间: </span> <input
  60 + class="form-control" type="text" id="startDate"
  61 + style="width: 120px;" />
  62 + </div>
  63 + <div style="display: inline-block; margin-left: 15px;">
  64 + <span class="item-label" style="width: 80px;">结束时间: </span> <input
  65 + class="form-control" type="text" id="endDate"
  66 + style="width: 120px;" />
  67 + </div>
  68 + <div style="display: inline-block;">
  69 + <span class="item-label" style="width: 120px;">类型: </span> <select
  70 + class="form-control" id="sel">
  71 + <option value="">请选择</option>
  72 + <option value="1">换人</option>
  73 + <option value="2">换车</option>
58 </select> 74 </select>
59 </div> 75 </div>
60 - <div class="form-group">  
61 - <input class="btn btn-default" type="button" id="query" value="筛选"/>  
62 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
63 - </div> 76 + <div class="form-group">
  77 + <input class="btn btn-default" type="button" id="query" value="筛选" />
  78 + <input class="btn btn-default" type="button" id="export"
  79 + value="导出" />
  80 + </div>
64 </form> 81 </form>
65 </div> 82 </div>
66 <div class="portlet-body"> 83 <div class="portlet-body">
67 - <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px">  
68 - <table class="table table-bordered table-hover table-checkable" id="forms"> 84 + <div class="table-container"
  85 + style="margin-top: 20px; overflow: auto; min-width: 1000px">
  86 + <table class="table table-bordered table-hover table-checkable"
  87 + id="forms">
69 <thead> 88 <thead>
70 <tr> 89 <tr>
71 <th colspan="15">换人换车情况统计表</th> 90 <th colspan="15">换人换车情况统计表</th>
72 </tr> 91 </tr>
73 <tr> 92 <tr>
74 - <td rowspan="3" style=" padding-top: 50px;">日期</td>  
75 - <td rowspan="3" style=" padding-top: 50px;">公司</td>  
76 - <td rowspan="3" style=" padding-top: 50px;">分公司</td>  
77 - <td rowspan="3" style=" padding-top: 50px;">线路</td>  
78 - <td rowspan="3" style=" padding-top: 50px;">路牌</td>  
79 - <td rowspan="3" style=" padding-top: 50px;">发生时间</td>  
80 - <td rowspan="3" style=" padding-top: 50px;">修改时间</td> 93 + <td rowspan="3" style="padding-top: 50px;">日期</td>
  94 + <td rowspan="3" style="padding-top: 50px;">公司</td>
  95 + <td rowspan="3" style="padding-top: 50px;">分公司</td>
  96 + <td rowspan="3" style="padding-top: 50px;">线路</td>
  97 + <td rowspan="3" style="padding-top: 50px;">路牌</td>
  98 + <td rowspan="3" style="padding-top: 50px;">发生时间</td>
  99 + <td rowspan="3" style="padding-top: 50px;">修改时间</td>
81 <td colspan="2">配车</td> 100 <td colspan="2">配车</td>
82 <td colspan="4">人员</td> 101 <td colspan="4">人员</td>
83 - <td rowspan="3" style=" padding-top: 50px;">原因</td>  
84 - <td rowspan="3" style=" padding-top: 50px;">修改人</td> 102 + <td rowspan="3" style="padding-top: 50px;">原因</td>
  103 + <td rowspan="3" style="padding-top: 50px;">修改人</td>
85 </tr> 104 </tr>
86 <tr> 105 <tr>
87 <td>计划</td> 106 <td>计划</td>
88 <td>实际</td> 107 <td>实际</td>
89 <td colspan="2">计划</td> 108 <td colspan="2">计划</td>
90 <td colspan="2">实际</td> 109 <td colspan="2">实际</td>
91 - 110 +
92 </tr> 111 </tr>
93 <tr> 112 <tr>
94 <td>车号</td> 113 <td>车号</td>
@@ -100,7 +119,7 @@ @@ -100,7 +119,7 @@
100 </tr> 119 </tr>
101 </thead> 120 </thead>
102 <tbody> 121 <tbody>
103 - 122 +
104 </tbody> 123 </tbody>
105 </table> 124 </table>
106 </div> 125 </div>
@@ -110,94 +129,121 @@ @@ -110,94 +129,121 @@
110 </div> 129 </div>
111 130
112 <script> 131 <script>
113 - $(function(){ 132 + $(function() {
114 // 关闭左侧栏 133 // 关闭左侧栏
115 if (!$('body').hasClass('page-sidebar-closed')) 134 if (!$('body').hasClass('page-sidebar-closed'))
116 $('.menu-toggler.sidebar-toggler').click(); 135 $('.menu-toggler.sidebar-toggler').click();
117 - 136 +
118 $("#startDate,#endDate").datetimepicker({ 137 $("#startDate,#endDate").datetimepicker({
119 format : 'YYYY-MM-DD', 138 format : 'YYYY-MM-DD',
120 locale : 'zh-cn' 139 locale : 'zh-cn'
121 }); 140 });
  141 +
122 142
123 - $('#line').select2({  
124 - ajax: {  
125 - url: '/realSchedule/findLine',  
126 - type: 'post',  
127 - dataType: 'json',  
128 - delay: 150,  
129 - data: function(params){  
130 - return{line: params.term};  
131 - },  
132 - processResults: function (data) {  
133 - return {  
134 - results: data  
135 - };  
136 - },  
137 - cache: true  
138 - },  
139 - templateResult: function(repo){  
140 - if (repo.loading) return repo.text;  
141 - var h = '<span>'+repo.text+'</span>';  
142 - return h;  
143 - },  
144 - escapeMarkup: function (markup) { return markup; },  
145 - minimumInputLength: 1,  
146 - templateSelection: function(repo){  
147 - return repo.text;  
148 - },  
149 - language: {  
150 - noResults: function(){  
151 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
152 - },  
153 - inputTooShort : function(e) {  
154 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
155 - },  
156 - searching : function() {  
157 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
158 - }  
159 - }  
160 - });  
161 - var line;  
162 - var startDate;  
163 - var endDate;  
164 - $("#query").on("click",function(){  
165 - line = $("#line").val();  
166 - sel = $("#sel").val();  
167 - var startDate1=$("#startDate").val();  
168 - var endDate1=$("#endDate").val(); 143 + var obj = [];
  144 + $.get('/user/companyData', function(result){
  145 + obj = result;
  146 + var options = '';
  147 + for(var i = 0; i < obj.length; i++){
  148 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  149 + }
  150 + if(obj.length ==0){
  151 + $("#gsdmDiv_change").css('display','none');
  152 + $('#fgsdmDiv_change').css('display','none');
  153 + }else if(obj.length ==1){
  154 + $("#gsdmDiv_change").css('display','none');
  155 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  156 + $('#fgsdmDiv_change').css('display','none');
  157 + }
  158 + $('#gsdmChange').html(options);
  159 + updateCompany();
  160 + });
  161 +
  162 + $("#gsdmChange").on("change",updateCompany);
  163 + function updateCompany(){
  164 + var company = $('#gsdmChange').val();
  165 + var options = '';
  166 + for(var i = 0; i < obj.length; i++){
  167 + if(obj[i].companyCode == company){
  168 + var children = obj[i].children;
  169 + for(var j = 0; j < children.length; j++){
  170 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  171 + }
  172 + }
  173 + }
  174 + $('#fgsdmChange').html(options);
  175 + }
  176 +
  177 + $.get('/basic/lineCode2Name',function(result){
  178 + var data=[];
169 179
170 - if(startDate1!=''&&endDate1!=''){  
171 - $post('/mcy_forms/changetochange',{sel:sel,line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){  
172 - startDate = $("#startDate").val();  
173 - endDate = $("#endDate").val();  
174 - $("#sDate").text(startDate);  
175 - $("#eDate").text(endDate);  
176 - var temp = {};  
177 - var today_account = 0;  
178 - temp["line"] = $("#line").text();  
179 - $.each(result, function(i, obj) {  
180 - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){  
181 - today_account++;  
182 - }  
183 - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");  
184 - });  
185 - // 把数据填充到模版中  
186 - var tbodyHtml = template('changetochange',{list:result});  
187 - // 把渲染好的模版html文本追加到表格中  
188 - $('#forms tbody').html(tbodyHtml);  
189 - }) 180 + for(var code in result){
  181 + data.push({id: code, text: result[code]});
  182 + }
  183 + initPinYinSelect2('#line',data,'');
  184 +
  185 + })
190 186
191 - }else{  
192 - alert("请选择时间范围!");  
193 - }  
194 - });  
195 -  
196 - $("#export").on("click",function(){  
197 - $post('/mcy_export/changetochangeExport',{startDate:startDate,endDate:endDate,type:'export'},function(result){  
198 - window.open("/downloadFile/download?fileName=换人换车情况日统计"+moment(startDate).format("YYYYMMDD"));  
199 - });  
200 - }); 187 + var line;
  188 + var startDate;
  189 + var endDate;
  190 + $("#query").on(
  191 + "click",
  192 + function() {
  193 + line = $("#line").val();
  194 + sel = $("#sel").val();
  195 + var startDate1 = $("#startDate").val();
  196 + var endDate1 = $("#endDate").val();
  197 +
  198 + if (startDate1 != '' && endDate1 != '') {
  199 + $post('/mcy_forms/changetochange', {
  200 + sel : sel,
  201 + line : line,
  202 + startDate : $("#startDate").val(),
  203 + endDate : $("#endDate").val(),
  204 + type : 'query'
  205 + }, function(result) {
  206 + startDate = $("#startDate").val();
  207 + endDate = $("#endDate").val();
  208 + $("#sDate").text(startDate);
  209 + $("#eDate").text(endDate);
  210 + var temp = {};
  211 + var today_account = 0;
  212 + temp["line"] = $("#line").text();
  213 + $.each(result, function(i, obj) {
  214 + if (moment(obj.schedule_date_str).format(
  215 + "YYYY-MM-DD") == moment(obj.startDate)
  216 + .format("YYYY-MM-DD")) {
  217 + today_account++;
  218 + }
  219 + obj.updateDate = moment(obj.startDate).format(
  220 + "YYYY-MM-DD HH:mm:ss");
  221 + });
  222 + // 把数据填充到模版中
  223 + var tbodyHtml = template('changetochange', {
  224 + list : result
  225 + });
  226 + // 把渲染好的模版html文本追加到表格中
  227 + $('#forms tbody').html(tbodyHtml);
  228 + })
  229 +
  230 + } else {
  231 + alert("请选择时间范围!");
  232 + }
  233 + });
  234 +
  235 + $("#export").on(
  236 + "click",
  237 + function() {
  238 + $post('/mcy_export/changetochangeExport', {
  239 + startDate : startDate,
  240 + endDate : endDate,
  241 + type : 'export'
  242 + }, function(result) {
  243 + window.open("/downloadFile/download?fileName=换人换车情况日统计"
  244 + + moment(startDate).format("YYYYMMDD"));
  245 + });
  246 + });
201 }); 247 });
202 </script> 248 </script>
203 <script type="text/html" id="changetochange"> 249 <script type="text/html" id="changetochange">
src/main/resources/static/pages/forms/statement/executionrate.html
@@ -37,6 +37,14 @@ @@ -37,6 +37,14 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 39 <form class="form-inline" action="" method="post">
  40 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_ececut">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdmEcecut" style="width: 140px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_ececut">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdmEcecut" style="width: 140px;"></select>
  47 + </div> -->
40 <div style="display: inline-block;"> 48 <div style="display: inline-block;">
41 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
42 <select class="form-control" name="line" id="line" style="width: 120px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
@@ -114,6 +122,42 @@ @@ -114,6 +122,42 @@
114 locale : 'zh-cn' 122 locale : 'zh-cn'
115 }); 123 });
116 124
  125 +
  126 + var obj = [];
  127 + $.get('/user/companyData', function(result){
  128 + obj = result;
  129 + var options = '';
  130 + for(var i = 0; i < obj.length; i++){
  131 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  132 + }
  133 +
  134 + if(obj.length ==0){
  135 + $("#gsdmDiv_ececut").css('display','none');
  136 + $('#fgsdmDiv_ececut').css('display','none');
  137 + }else if(obj.length ==1){
  138 + $("#gsdmDiv_ececut").css('display','none');
  139 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  140 + $('#fgsdmDiv_ececut').css('display','none');
  141 + }
  142 + $('#gsdmEcecut').html(options);
  143 + updateCompany();
  144 + });
  145 +
  146 + $("#gsdmEcecut").on("change",updateCompany);
  147 + function updateCompany(){
  148 + var company = $('#gsdmEcecut').val();
  149 + var options = '';
  150 + for(var i = 0; i < obj.length; i++){
  151 + if(obj[i].companyCode == company){
  152 + var children = obj[i].children;
  153 + for(var j = 0; j < children.length; j++){
  154 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  155 + }
  156 + }
  157 + }
  158 + $('#fgsdmEcecut').html(options);
  159 + }
  160 +
117 $.get('/basic/lineCode2Name',function(result){ 161 $.get('/basic/lineCode2Name',function(result){
118 var data=[]; 162 var data=[];
119 163
@@ -127,19 +171,23 @@ @@ -127,19 +171,23 @@
127 var line; 171 var line;
128 var startDate; 172 var startDate;
129 var endDate; 173 var endDate;
  174 + var gsdmEcecut;
  175 + var fgsdmEcecut;
130 $("#query").on("click",function(){ 176 $("#query").on("click",function(){
131 177
132 line = $("#line").val(); 178 line = $("#line").val();
133 startDate1=$("#startDate").val(); 179 startDate1=$("#startDate").val();
134 endDate1=$("#endDate").val(); 180 endDate1=$("#endDate").val();
135 - 181 + gsdmEcecut=$("#gsdmEcecut").val();
  182 + fgsdmEcecut=$("#fgsdmEcecut").val();
136 if(startDate1!=''&&endDate1!=''){ 183 if(startDate1!=''&&endDate1!=''){
137 - $post('/mcy_forms/executionrate',{line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ 184 + $post('/mcy_forms/executionrate',{/* gsdmEcecut:gsdmEcecut,fgsdmEcecut:fgsdmEcecut, */line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){
138 // 把数据填充到模版中 185 // 把数据填充到模版中
139 var tbodyHtml = template('executionrate',{list:result}); 186 var tbodyHtml = template('executionrate',{list:result});
140 // 把渲染好的模版html文本追加到表格中 187 // 把渲染好的模版html文本追加到表格中
141 $('#tbody').html(tbodyHtml); 188 $('#tbody').html(tbodyHtml);
142 line = $("#line").val(); 189 line = $("#line").val();
  190 +
143 startDate = $("#startDate").val(); 191 startDate = $("#startDate").val();
144 endDate = $("#endDate").val(); 192 endDate = $("#endDate").val();
145 $("#sDate").text(startDate); 193 $("#sDate").text(startDate);
src/main/resources/static/pages/forms/statement/linepassengerflow.html
@@ -27,6 +27,14 @@ @@ -27,6 +27,14 @@
27 <div class="portlet light porttlet-fit bordered"> 27 <div class="portlet light porttlet-fit bordered">
28 <div class="portlet-title"> 28 <div class="portlet-title">
29 <form class="form-inline" action=""> 29 <form class="form-inline" action="">
  30 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_line">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdmLine" style="width: 140px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_line">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdmLine" style="width: 140px;"></select>
  37 + </div> -->
30 <div style="display: inline-block;"> 38 <div style="display: inline-block;">
31 <span class="item-label" style="width: 80px;">线路: </span> 39 <span class="item-label" style="width: 80px;">线路: </span>
32 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 40 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -74,6 +82,43 @@ @@ -74,6 +82,43 @@
74 locale : 'zh-cn' 82 locale : 'zh-cn'
75 }); 83 });
76 84
  85 + var obj = [];
  86 + $.get('/user/companyData', function(result){
  87 + obj = result;
  88 + var options = '';
  89 + for(var i = 0; i < obj.length; i++){
  90 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  91 + }
  92 +
  93 + if(obj.length ==0){
  94 + $("#gsdmDiv_line").css('display','none');
  95 + $('#fgsdmDiv_line').css('display','none');
  96 + }else if(obj.length ==1){
  97 + $("#gsdmDiv_line").css('display','none');
  98 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  99 + $('#fgsdmDiv_line').css('display','none');
  100 + }
  101 + $('#gsdmLine').html(options);
  102 + updateCompany();
  103 + });
  104 +
  105 + $("#gsdmLine").on("change",updateCompany);
  106 + function updateCompany(){
  107 + var company = $('#gsdmLine').val();
  108 + var options = '';
  109 + for(var i = 0; i < obj.length; i++){
  110 + if(obj[i].companyCode == company){
  111 + var children = obj[i].children;
  112 + for(var j = 0; j < children.length; j++){
  113 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  114 + }
  115 + }
  116 + }
  117 + $('#fgsdmLine').html(options);
  118 + }
  119 +
  120 +
  121 +
77 $.get('/basic/lineCode2Name',function(result){ 122 $.get('/basic/lineCode2Name',function(result){
78 var data=[]; 123 var data=[];
79 124
@@ -85,10 +130,17 @@ @@ -85,10 +130,17 @@
85 130
86 }) 131 })
87 132
  133 +
  134 + var line;
  135 + var date;
  136 + var gsdmLine;
  137 + var fgsdmLine;
88 $("#query").on("click",function(){ 138 $("#query").on("click",function(){
89 var line = $("#line").val(); 139 var line = $("#line").val();
90 var date = $("#date").val(); 140 var date = $("#date").val();
91 - $post('/mcy_forms/linepasswengerflow',{line:line,date:date},function(result){ 141 + var gsdmLine = $("#gsdmLine").val();
  142 + var fgsdmLine = $("#fgsdmLine").val();
  143 + $post('/mcy_forms/linepasswengerflow',{/* gsdmLine:gsdmLine,fgsdmLine:fgsdmLine, */line:line,date:date,type:'query'},function(result){
92 $.each(result, function(i, obj) { 144 $.each(result, function(i, obj) {
93 obj.requestType = reqCodeMap[obj.requestType]; 145 obj.requestType = reqCodeMap[obj.requestType];
94 }); 146 });
src/main/resources/static/pages/forms/statement/operationservice.html
1 <style type="text/css"> 1 <style type="text/css">
2 - .table-bordered {  
3 - border: 1px solid; }  
4 - .table-bordered > thead > tr > th,  
5 - .table-bordered > thead > tr > td,  
6 - .table-bordered > tbody > tr > th,  
7 - .table-bordered > tbody > tr > td,  
8 - .table-bordered > tfoot > tr > th,  
9 - .table-bordered > tfoot > tr > td {  
10 - border: 1px solid; }  
11 - .table-bordered > thead > tr > th,  
12 - .table-bordered > thead > tr > td {  
13 - border-bottom-width: 2px;  
14 - text-align: center; }  
15 -  
16 - .table > tbody + tbody {  
17 - border-top: 1px solid; } 2 +.table-bordered {
  3 + border: 1px solid;
  4 +}
  5 +
  6 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td,
  7 + .table-bordered>tbody>tr>th, .table-bordered>tbody>tr>td,
  8 + .table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>td {
  9 + border: 1px solid;
  10 +}
  11 +
  12 +.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
  13 + border-bottom-width: 2px;
  14 + text-align: center;
  15 +}
  16 +
  17 +.table>tbody+tbody {
  18 + border-top: 1px solid;
  19 +}
18 </style> 20 </style>
19 21
20 <div class="page-head"> 22 <div class="page-head">
@@ -22,54 +24,53 @@ @@ -22,54 +24,53 @@
22 <h1>运营服务阶段报表</h1> 24 <h1>运营服务阶段报表</h1>
23 </div> 25 </div>
24 </div> 26 </div>
25 -  
26 -<div class="row">  
27 - <div class="col-md-12">  
28 - <div class="portlet light porttlet-fit bordered">  
29 - <div class="portlet-title">  
30 - <form class="form-inline" action="">  
31 - <!-- <div style="display: inline-block;">  
32 - <span class="item-label" style="width: 120px;">公司: </span>  
33 - <select class="form-control">  
34 - <option value="normal">请选择</option>  
35 - <option value="22">金高公司</option>  
36 - <option value="05">杨高公司</option>  
37 - <option value="26">南汇公司</option>  
38 - <option value="55">上南公司</option>  
39 - <option value="77">闵行公司</option>  
40 - </select>  
41 - <select class="form-control">  
42 - <option value="22">金高公司</option>  
43 - <option value="05">杨高公司</option>  
44 - <option value="26">南汇公司</option>  
45 - <option value="55">上南公司</option>  
46 - <option value="77">闵行公司</option>  
47 - </select>  
48 - </div> -->  
49 - <div style="display: inline-block;">  
50 - <span class="item-label" style="width: 80px;">线路: </span>  
51 - <select class="form-control" name="line" id="line" style="width: 136px;"></select>  
52 - </div>  
53 - <div style="display: inline-block;margin-left: 15px;">  
54 - <span class="item-label" style="width: 80px;">开始时间: </span>  
55 - <input class="form-control" type="text" id="startDate" style="width: 120px;"/>  
56 - </div>  
57 - <div style="display: inline-block;margin-left: 15px;">  
58 - <span class="item-label" style="width: 80px;">结束时间: </span>  
59 - <input class="form-control" type="text" id="endDate" style="width: 120px;"/>  
60 - </div>  
61 - <div style="display: inline-block;margin-left: 15px">  
62 - <span class="item-label" style="width: 150px;">统计: </span>  
63 - </div>  
64 - <div class="form-group">  
65 - <input class="btn btn-default" type="button" id="query" value="筛选"/>  
66 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
67 - </div>  
68 - </form>  
69 - </div>  
70 - <div class="portlet-body">  
71 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">  
72 - <table class="table table-bordered table-hover table-checkable" id="forms"> 27 +
  28 +<div class="row">
  29 + <div class="col-md-12">
  30 + <div class="portlet light porttlet-fit bordered">
  31 + <div class="portlet-title">
  32 + <form class="form-inline" action="" method="post">
  33 + <!--<div style="display: inline-block; margin-left: 33px;"
  34 + id="gsdmDiv_operat">
  35 + <span class="item-label" style="width: 80px;">公司: </span> <select
  36 + class="form-control" name="company" id="gsdmOperat"
  37 + style="width: 140px;"></select>
  38 + </div>
  39 + <div style="display: inline-block; margin-left: 24px;"
  40 + id="fgsdmDiv_operat">
  41 + <span class="item-label" style="width: 80px;">分公司: </span> <select
  42 + class="form-control" name="subCompany" id="fgsdmOperat"
  43 + style="width: 140px;"></select>
  44 + </div> -->
  45 + <div style="display: inline-block;">
  46 + <span class="item-label" style="width: 80px;">线路: </span> <select
  47 + class="form-control" name="line" id="line" style="width: 180px;"></select>
  48 + </div>
  49 + <div style="display: inline-block; margin-left: 15px;">
  50 + <span class="item-label" style="width: 80px;">开始时间: </span> <input
  51 + class="form-control" type="text" id="startDate"
  52 + style="width: 120px;" />
  53 + </div>
  54 + <div style="display: inline-block; margin-left: 15px;">
  55 + <span class="item-label" style="width: 80px;">结束时间: </span> <input
  56 + class="form-control" type="text" id="endDate"
  57 + style="width: 120px;" />
  58 + </div>
  59 + <div style="display: inline-block; margin-left: 15px">
  60 + <span class="item-label" style="width: 150px;">统计: </span>
  61 + </div>
  62 + <div class="form-group">
  63 + <input class="btn btn-default" type="button" id="query" value="筛选" />
  64 + <input class="btn btn-default" type="button" id="export"
  65 + value="导出" />
  66 + </div>
  67 + </form>
  68 + </div>
  69 + <div class="portlet-body">
  70 + <div class="table-container"
  71 + style="margin-top: 10px; overflow: auto; min-width: 906px">
  72 + <table class="table table-bordered table-hover table-checkable"
  73 + id="forms">
73 <thead> 74 <thead>
74 <tr> 75 <tr>
75 <th>序号</th> 76 <th>序号</th>
@@ -82,102 +83,133 @@ @@ -82,102 +83,133 @@
82 </tr> 83 </tr>
83 </thead> 84 </thead>
84 <tbody> 85 <tbody>
85 - 86 +
86 </tbody> 87 </tbody>
87 </table> 88 </table>
88 - </div>  
89 - </div>  
90 - </div>  
91 - </div>  
92 -</div>  
93 -  
94 -<script>  
95 - $(function(){  
96 - // 关闭左侧栏  
97 - if (!$('body').hasClass('page-sidebar-closed')) 89 + </div>
  90 + </div>
  91 + </div>
  92 + </div>
  93 +</div>
  94 +
  95 +<script>
  96 + $(function() {
  97 + // 关闭左侧栏
  98 + if (!$('body').hasClass('page-sidebar-closed'))
98 $('.menu-toggler.sidebar-toggler').click(); 99 $('.menu-toggler.sidebar-toggler').click();
99 -  
100 - $("#startDate,#endDate").datetimepicker({  
101 - format : 'YYYY-MM-DD',  
102 - locale : 'zh-cn' 100 +
  101 + $("#startDate,#endDate").datetimepicker({
  102 + format : 'YYYY-MM-DD',
  103 + locale : 'zh-cn'
103 }); 104 });
104 -  
105 -  
106 - $.get('/basic/lineCode2Name',function(result){  
107 - var data=[];  
108 -  
109 - for(var code in result){  
110 - data.push({id: code, text: result[code]}); 105 +
  106 + $.get('/basic/lineCode2Name', function(result) {
  107 + var data = [];
  108 +
  109 + for ( var code in result) {
  110 + data.push({
  111 + id : code,
  112 + text : result[code]
  113 + });
111 } 114 }
112 console.log(data); 115 console.log(data);
113 - initPinYinSelect2('#line',data,'');  
114 - 116 + initPinYinSelect2('#line', data, '');
  117 +
115 }) 118 })
116 -  
117 - $('#lpName').select2({  
118 - ajax: {  
119 - url: '/realSchedule/findLpName',  
120 - type: 'post',  
121 - dataType: 'json',  
122 - delay: 150,  
123 - data: function(params){  
124 - return{lpName: params.term};  
125 - },  
126 - processResults: function (data) {  
127 - return {  
128 - results: data  
129 - };  
130 - },  
131 - cache: true  
132 - },  
133 - templateResult: function(repo){  
134 - if (repo.loading) return repo.text;  
135 - var h = '<span>'+repo.text+'</span>';  
136 - return h;  
137 - },  
138 - escapeMarkup: function (markup) { return markup; },  
139 - minimumInputLength: 1,  
140 - templateSelection: function(repo){  
141 - return repo.text;  
142 - },  
143 - language: {  
144 - noResults: function(){  
145 - return '<span style="color:red;font-size: 12px;">没有搜索到路牌!</span>';  
146 - },  
147 - inputTooShort : function(e) {  
148 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入路牌搜索路牌</span>';  
149 - },  
150 - searching : function() {  
151 - return '<span style="color:gray;font-size: 12px;"> 正在搜索路牌...</span>';  
152 - }  
153 - }  
154 - });  
155 - $("#query").on("click",function(){  
156 - var line = $("#line").val();  
157 - var startDate = $("#startDate").val();  
158 - var endDate = $("#endDate").val();  
159 - var lpName = $("#lpName").val();  
160 - $post("/mcy_forms/operationservice",{line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){  
161 - $("#sDate").text(startDate);  
162 - $("#eDate").text(endDate);  
163 - var temp = {};  
164 - var today_account = 0;  
165 - temp["line"] = $("#line").text();  
166 - $.each(result, function(i, obj) {  
167 - if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){  
168 - today_account++;  
169 - }  
170 - obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");  
171 - });  
172 - console.log(result);  
173 - var operationservice = template('operationservice',{list:result});  
174 - // 把渲染好的模版html文本追加到表格中  
175 - $('#forms tbody').html(operationservice);  
176 -  
177 - });  
178 - });  
179 - });  
180 -</script> 119 +
  120 + var obj = [];
  121 + $.get('/user/companyData', function(result) {
  122 + obj = result;
  123 + var options = '';
  124 + for (var i = 0; i < obj.length; i++) {
  125 + options += '<option value="'+obj[i].companyCode+'">'
  126 + + obj[i].companyName + '</option>';
  127 + }
  128 +
  129 + if (obj.length == 0) {
  130 + $("#gsdmDiv_operat").css('display', 'none');
  131 + $('#fgsdmDiv_operat').css('display', 'none');
  132 + } else if (obj.length == 1) {
  133 + $("#gsdmDiv_operat").css('display', 'none');
  134 + if (obj[0].children.length == 1 || obj[0].children.length == 0)
  135 + $('#fgsdmDiv_operat').css('display', 'none');
  136 + }
  137 + $('#gsdmOperat').html(options);
  138 + updateCompany();
  139 + });
  140 +
  141 + $("#gsdmOperat").on("change", updateCompany);
  142 + function updateCompany() {
  143 + var company = $('#gsdmOperat').val();
  144 + var options = '';
  145 + for (var i = 0; i < obj.length; i++) {
  146 + if (obj[i].companyCode == company) {
  147 + var children = obj[i].children;
  148 + for (var j = 0; j < children.length; j++) {
  149 + options += '<option value="'+children[j].code+'">'
  150 + + children[j].name + '</option>';
  151 + }
  152 + }
  153 + }
  154 + $('#fgsdmOperat').html(options);
  155 + }
  156 +
  157 + $.get('/basic/lineCode2Name', function(result) {
  158 + var data = [];
  159 +
  160 + for ( var code in result) {
  161 + data.push({
  162 + id : code,
  163 + text : result[code]
  164 + });
  165 + }
  166 + initPinYinSelect2('#line', data, '');
  167 +
  168 + })
  169 +
  170 + $("#query").on(
  171 + "click",
  172 + function() {
  173 + var line = $("#line").val();
  174 + var startDate = $("#startDate").val();
  175 + var endDate = $("#endDate").val();
  176 + var lpName = $("#lpName").val();
  177 + /* var gsdmOperat = $("#gsdmOperat").val();
  178 + var fgsdmOperat = $("#fgsdmOperat").val(); */
  179 + $post("/mcy_forms/operationservice", {
  180 + /* gsdmOperat : gsdmOperat,
  181 + fgsdmOperat : fgsdmOperat, */
  182 + line : line,
  183 + startDate : startDate,
  184 + endDate : endDate,
  185 + lpName : lpName,
  186 + type:'query'
  187 + }, function(result) {
  188 + $("#sDate").text(startDate);
  189 + $("#eDate").text(endDate);
  190 + var temp = {};
  191 + var today_account = 0;
  192 + temp["line"] = $("#line").text();
  193 + $.each(result, function(i, obj) {
  194 + if (moment(obj.schedule_date_str).format(
  195 + "YYYY-MM-DD") == moment(obj.startDate)
  196 + .format("YYYY-MM-DD")) {
  197 + today_account++;
  198 + }
  199 + obj.updateDate = moment(obj.startDate).format(
  200 + "YYYY-MM-DD HH:mm:ss");
  201 + });
  202 + console.log(result);
  203 + var operationservice = template('operationservice', {
  204 + list : result
  205 + });
  206 + // 把渲染好的模版html文本追加到表格中
  207 + $('#forms tbody').html(operationservice);
  208 +
  209 + });
  210 + });
  211 + });
  212 +</script>
181 <script type="text/html" id="operationservice"> 213 <script type="text/html" id="operationservice">
182 {{each list as obj i}} 214 {{each list as obj i}}
183 <tr> 215 <tr>
@@ -192,7 +224,7 @@ @@ -192,7 +224,7 @@
192 {{/each}} 224 {{/each}}
193 {{if list.length == 0}} 225 {{if list.length == 0}}
194 <tr> 226 <tr>
195 - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 227 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
196 </tr> 228 </tr>
197 {{/if}} 229 {{/if}}
198 </script> 230 </script>
src/main/resources/static/pages/forms/statement/shifday.html
@@ -28,6 +28,14 @@ @@ -28,6 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action="" method="post"> 30 <form class="form-inline" action="" method="post">
  31 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_shif">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmShif" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_shif">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmShif" style="width: 140px;"></select>
  38 + </div> -->
31 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
32 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
33 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -97,6 +105,41 @@ $(function(){ @@ -97,6 +105,41 @@ $(function(){
97 locale : 'zh-cn' 105 locale : 'zh-cn'
98 }); 106 });
99 107
  108 + var obj = [];
  109 + $.get('/user/companyData', function(result){
  110 + obj = result;
  111 + var options = '';
  112 + for(var i = 0; i < obj.length; i++){
  113 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  114 + }
  115 +
  116 + if(obj.length ==0){
  117 + $("#gsdmDiv_shif").css('display','none');
  118 + $('#fgsdmDiv_shif').css('display','none');
  119 + }else if(obj.length ==1){
  120 + $("#gsdmDiv_shif").css('display','none');
  121 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  122 + $('#fgsdmDiv_shif').css('display','none');
  123 + }
  124 + $('#gsdmShif').html(options);
  125 + updateCompany();
  126 + });
  127 +
  128 + $("#gsdmShif").on("change",updateCompany);
  129 + function updateCompany(){
  130 + var company = $('#gsdmShif').val();
  131 + var options = '';
  132 + for(var i = 0; i < obj.length; i++){
  133 + if(obj[i].companyCode == company){
  134 + var children = obj[i].children;
  135 + for(var j = 0; j < children.length; j++){
  136 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  137 + }
  138 + }
  139 + }
  140 + $('#fgsdmShif').html(options);
  141 + }
  142 +
100 143
101 $.get('/basic/lineCode2Name',function(result){ 144 $.get('/basic/lineCode2Name',function(result){
102 var data=[]; 145 var data=[];
@@ -112,7 +155,9 @@ $(function(){ @@ -112,7 +155,9 @@ $(function(){
112 $("#query").on("click",function(){ 155 $("#query").on("click",function(){
113 var line = $("#line").val(); 156 var line = $("#line").val();
114 var date = $("#date").val(); 157 var date = $("#date").val();
115 - $post('/mcy_forms/shifday',{line:line,date:date},function(result){ 158 + /* var gsdmShif = $("#gsdmShif").val();
  159 + var fgsdmShif = $("#fgsdmShif").val(); */
  160 + $post('/mcy_forms/shifday',{/* gsdmShif:gsdmShif,fgsdmShif:fgsdmShif, */line:line,date:date},function(result){
116 $.each(result, function(i, obj) { 161 $.each(result, function(i, obj) {
117 obj.requestType = reqCodeMap[obj.requestType]; 162 obj.requestType = reqCodeMap[obj.requestType];
118 }); 163 });
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html
@@ -27,7 +27,15 @@ @@ -27,7 +27,15 @@
27 <div class="col-md-12"> 27 <div class="col-md-12">
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 - <form class="form-inline" action=""> 30 + <form class="form-inline" action="">
  31 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_manth">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmManth" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_manth">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmManth" style="width: 140px;"></select>
  38 + </div> -->
31 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
32 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
33 <select class="form-control" name="line" id="line" style="width: 136px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 136px;"></select>
@@ -87,6 +95,41 @@ @@ -87,6 +95,41 @@
87 locale : 'zh-cn' 95 locale : 'zh-cn'
88 }); 96 });
89 97
  98 + var obj = [];
  99 + $.get('/user/companyData', function(result){
  100 + obj = result;
  101 + var options = '';
  102 + for(var i = 0; i < obj.length; i++){
  103 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  104 + }
  105 +
  106 + if(obj.length ==0){
  107 + $("#gsdmDiv_manth").css('display','none');
  108 + $('#fgsdmDiv_manth').css('display','none');
  109 + }else if(obj.length ==1){
  110 + $("#gsdmDiv_manth").css('display','none');
  111 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  112 + $('#fgsdmDiv_manth').css('display','none');
  113 + }
  114 + $('#gsdmManth').html(options);
  115 + updateCompany();
  116 + });
  117 +
  118 + $("#gsdmManth").on("change",updateCompany);
  119 + function updateCompany(){
  120 + var company = $('#gsdmManth').val();
  121 + var options = '';
  122 + for(var i = 0; i < obj.length; i++){
  123 + if(obj[i].companyCode == company){
  124 + var children = obj[i].children;
  125 + for(var j = 0; j < children.length; j++){
  126 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  127 + }
  128 + }
  129 + }
  130 + $('#fgsdmManth').html(options);
  131 + }
  132 +
90 133
91 $.get('/basic/lineCode2Name',function(result){ 134 $.get('/basic/lineCode2Name',function(result){
92 var data=[]; 135 var data=[];
@@ -141,7 +184,9 @@ @@ -141,7 +184,9 @@
141 var startDate = $("#startDate").val(); 184 var startDate = $("#startDate").val();
142 var endDate = $("#endDate").val(); 185 var endDate = $("#endDate").val();
143 var lpName = $("#lpName").val(); 186 var lpName = $("#lpName").val();
144 - $post("/mcy_forms/shiftuehiclemanth",{line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){ 187 + /* var gsdmManth= $("#gsdmManth").val();
  188 + var fgsdmManth= $("#fgsdmManth").val(); */
  189 + $post("/mcy_forms/shiftuehiclemanth",{/* gsdmManth:gsdmManth,fgsdmManth:fgsdmManth, */line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
145 $("#sDate").text(startDate); 190 $("#sDate").text(startDate);
146 $("#eDate").text(endDate); 191 $("#eDate").text(endDate);
147 var temp = {}; 192 var temp = {};
@@ -153,7 +198,7 @@ @@ -153,7 +198,7 @@
153 } 198 }
154 obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); 199 obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");
155 }); 200 });
156 - console.log(result); 201 +
157 var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result}); 202 var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result});
158 // 把渲染好的模版html文本追加到表格中 203 // 把渲染好的模版html文本追加到表格中
159 $('#forms tbody').html(list_shiftuehiclemanth); 204 $('#forms tbody').html(list_shiftuehiclemanth);
src/main/resources/static/pages/forms/statement/singledata.html
@@ -28,6 +28,14 @@ @@ -28,6 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action=""> 30 <form class="form-inline" action="">
  31 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
  38 + </div> -->
31 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
32 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
33 <select class="form-control" name="line" id="line" style="width: 136px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 136px;"></select>
@@ -92,6 +100,41 @@ @@ -92,6 +100,41 @@
92 locale : 'zh-cn' 100 locale : 'zh-cn'
93 }); 101 });
94 102
  103 + var obj = [];
  104 + $.get('/user/companyData', function(result){
  105 + obj = result;
  106 + var options = '';
  107 + for(var i = 0; i < obj.length; i++){
  108 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  109 + }
  110 +
  111 + if(obj.length ==0){
  112 + $("#gsdmDiv_sing").css('display','none');
  113 + $('#fgsdmDiv_sing').css('display','none');
  114 + }else if(obj.length ==1){
  115 + $("#gsdmDiv_sing").css('display','none');
  116 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  117 + $('#fgsdmDiv_sing').css('display','none');
  118 + }
  119 + $('#gsdmSing').html(options);
  120 + updateCompany();
  121 + });
  122 +
  123 + $("#gsdmSing").on("change",updateCompany);
  124 + function updateCompany(){
  125 + var company = $('#gsdmSing').val();
  126 + var options = '';
  127 + for(var i = 0; i < obj.length; i++){
  128 + if(obj[i].companyCode == company){
  129 + var children = obj[i].children;
  130 + for(var j = 0; j < children.length; j++){
  131 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  132 + }
  133 + }
  134 + }
  135 + $('#fgsdmSing').html(options);
  136 + }
  137 +
95 138
96 $.get('/basic/lineCode2Name',function(result){ 139 $.get('/basic/lineCode2Name',function(result){
97 var data=[]; 140 var data=[];
@@ -104,50 +147,15 @@ @@ -104,50 +147,15 @@
104 147
105 }) 148 })
106 149
107 - $('#lpName').select2({  
108 - ajax: {  
109 - url: '/realSchedule/findLpName',  
110 - type: 'post',  
111 - dataType: 'json',  
112 - delay: 150,  
113 - data: function(params){  
114 - return{lpName: params.term};  
115 - },  
116 - processResults: function (data) {  
117 - return {  
118 - results: data  
119 - };  
120 - },  
121 - cache: true  
122 - },  
123 - templateResult: function(repo){  
124 - if (repo.loading) return repo.text;  
125 - var h = '<span>'+repo.text+'</span>';  
126 - return h;  
127 - },  
128 - escapeMarkup: function (markup) { return markup; },  
129 - minimumInputLength: 1,  
130 - templateSelection: function(repo){  
131 - return repo.text;  
132 - },  
133 - language: {  
134 - noResults: function(){  
135 - return '<span style="color:red;font-size: 12px;">没有搜索到路牌!</span>';  
136 - },  
137 - inputTooShort : function(e) {  
138 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入路牌搜索路牌</span>';  
139 - },  
140 - searching : function() {  
141 - return '<span style="color:gray;font-size: 12px;"> 正在搜索路牌...</span>';  
142 - }  
143 - }  
144 - }); 150 +
145 $("#query").on("click",function(){ 151 $("#query").on("click",function(){
146 var line = $("#line").val(); 152 var line = $("#line").val();
147 var startDate = $("#startDate").val(); 153 var startDate = $("#startDate").val();
148 var endDate = $("#endDate").val(); 154 var endDate = $("#endDate").val();
149 var lpName = $("#lpName").val(); 155 var lpName = $("#lpName").val();
150 - $post("/mcy_forms/singledata",{line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){ 156 + /* var gsdmSing = $("#gsdmSing").val();
  157 + var fgsdmSing = $("#fgsdmSing").val(); */
  158 + $post("/mcy_forms/singledata",{/* gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, */line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
151 $("#sDate").text(startDate); 159 $("#sDate").text(startDate);
152 $("#eDate").text(endDate); 160 $("#eDate").text(endDate);
153 var temp = {}; 161 var temp = {};
src/main/resources/static/pages/forms/statement/turnoutrate.html
@@ -37,6 +37,14 @@ @@ -37,6 +37,14 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 39 <form class="form-inline" action="" method="post">
  40 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_turn">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_turn">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select>
  47 + </div> -->
40 <div style="display: inline-block;"> 48 <div style="display: inline-block;">
41 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
42 <select class="form-control" name="line" id="line" style="width: 120px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
@@ -116,6 +124,42 @@ @@ -116,6 +124,42 @@
116 locale : 'zh-cn' 124 locale : 'zh-cn'
117 }); 125 });
118 126
  127 + var obj = [];
  128 + $.get('/user/companyData', function(result){
  129 + obj = result;
  130 + var options = '';
  131 + for(var i = 0; i < obj.length; i++){
  132 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  133 + }
  134 +
  135 + if(obj.length ==0){
  136 + $("#gsdmDiv_turn").css('display','none');
  137 + $('#fgsdmDiv_turn').css('display','none');
  138 + }else if(obj.length ==1){
  139 + $("#gsdmDiv_turn").css('display','none');
  140 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  141 + $('#fgsdmDiv_turn').css('display','none');
  142 + }
  143 + $('#gsdmTurn').html(options);
  144 + updateCompany();
  145 + });
  146 +
  147 + $("#gsdmTurn").on("change",updateCompany);
  148 + function updateCompany(){
  149 + var company = $('#gsdmTurn').val();
  150 + var options = '';
  151 + for(var i = 0; i < obj.length; i++){
  152 + if(obj[i].companyCode == company){
  153 + var children = obj[i].children;
  154 + for(var j = 0; j < children.length; j++){
  155 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  156 + }
  157 + }
  158 + }
  159 + $('#fgsdmTurn').html(options);
  160 + }
  161 +
  162 +
119 $.get('/basic/lineCode2Name',function(result){ 163 $.get('/basic/lineCode2Name',function(result){
120 var data=[]; 164 var data=[];
121 165
@@ -129,14 +173,17 @@ @@ -129,14 +173,17 @@
129 var line; 173 var line;
130 var startDate; 174 var startDate;
131 var endDate; 175 var endDate;
  176 + var gsdmTurn;
  177 + var fgsdmTurn;
132 $("#query").on("click",function(){ 178 $("#query").on("click",function(){
133 179
134 line = $("#line").val(); 180 line = $("#line").val();
135 startDate1=$("#startDate").val(); 181 startDate1=$("#startDate").val();
136 endDate1=$("#endDate").val(); 182 endDate1=$("#endDate").val();
137 - 183 + gsdmTurn=$("#gsdmTurn").val();
  184 + fgsdmTurn=$("#fgsdmTurn").val();
138 if(startDate1!=''&&endDate1!=''){ 185 if(startDate1!=''&&endDate1!=''){
139 - $post('/mcy_forms/turnoutrate',{line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){ 186 + $post('/mcy_forms/turnoutrate',{/* gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, */line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){
140 // 把数据填充到模版中 187 // 把数据填充到模版中
141 var tbodyHtml = template('turnoutrate',{list:result}); 188 var tbodyHtml = template('turnoutrate',{list:result});
142 // 把渲染好的模版html文本追加到表格中 189 // 把渲染好的模版html文本追加到表格中
src/main/resources/static/pages/forms/statement/vehicleloading.html
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 19
20 <div class="page-head"> 20 <div class="page-head">
21 <div class="page-title"> 21 <div class="page-title">
22 - <h1>车辆加注</h1> 22 + <h1>车辆加注/消耗量</h1>
23 </div> 23 </div>
24 </div> 24 </div>
25 25
@@ -28,6 +28,14 @@ @@ -28,6 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action="" method="post"> 30 <form class="form-inline" action="" method="post">
  31 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_vehic">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmVehic" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_vehic">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmVehic" style="width: 140px;"></select>
  38 + </div> -->
31 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
32 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
33 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -82,7 +90,40 @@ @@ -82,7 +90,40 @@
82 locale : 'zh-cn' 90 locale : 'zh-cn'
83 }); 91 });
84 92
85 - 93 + $.get('/user/companyData', function(result){
  94 + obj = result;
  95 + var options = '';
  96 + for(var i = 0; i < obj.length; i++){
  97 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  98 + }
  99 +
  100 + if(obj.length ==0){
  101 + $("#gsdmDiv_vehic").css('display','none');
  102 + $('#fgsdmDiv_vehic').css('display','none');
  103 + }else if(obj.length ==1){
  104 + $("#gsdmDiv_vehic").css('display','none');
  105 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  106 + $('#fgsdmDiv_vehic').css('display','none');
  107 + }
  108 + $('#gsdmVehic').html(options);
  109 + updateCompany();
  110 + });
  111 +
  112 + $("#gsdmVehic").on("change",updateCompany);
  113 + function updateCompany(){
  114 + var company = $('#gsdmVehic').val();
  115 + var options = '';
  116 + for(var i = 0; i < obj.length; i++){
  117 + if(obj[i].companyCode == company){
  118 + var children = obj[i].children;
  119 + for(var j = 0; j < children.length; j++){
  120 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  121 + }
  122 + }
  123 + }
  124 + $('#fgsdmVehic').html(options);
  125 + }
  126 +
86 $.get('/basic/lineCode2Name',function(result){ 127 $.get('/basic/lineCode2Name',function(result){
87 var data=[]; 128 var data=[];
88 129
@@ -94,50 +135,13 @@ @@ -94,50 +135,13 @@
94 135
95 }) 136 })
96 137
97 -  
98 - $('#lpName').select2({  
99 - ajax: {  
100 - url: '/realSchedule/findLpName',  
101 - type: 'post',  
102 - dataType: 'json',  
103 - delay: 150,  
104 - data: function(params){  
105 - return{lpName: params.term};  
106 - },  
107 - processResults: function (data) {  
108 - return {  
109 - results: data  
110 - };  
111 - },  
112 - cache: true  
113 - },  
114 - templateResult: function(repo){  
115 - if (repo.loading) return repo.text;  
116 - var h = '<span>'+repo.text+'</span>';  
117 - return h;  
118 - },  
119 - escapeMarkup: function (markup) { return markup; },  
120 - minimumInputLength: 1,  
121 - templateSelection: function(repo){  
122 - return repo.text;  
123 - },  
124 - language: {  
125 - noResults: function(){  
126 - return '<span style="color:red;font-size: 12px;">没有搜索到路牌!</span>';  
127 - },  
128 - inputTooShort : function(e) {  
129 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入路牌搜索路牌</span>';  
130 - },  
131 - searching : function() {  
132 - return '<span style="color:gray;font-size: 12px;"> 正在搜索路牌...</span>';  
133 - }  
134 - }  
135 - }); 138 +
136 $("#query").on("click",function(){ 139 $("#query").on("click",function(){
137 var line = $("#line").val(); 140 var line = $("#line").val();
138 var date = $("#date").val(); 141 var date = $("#date").val();
139 - $(".hidden").removeClass("hidden");  
140 - $post("/mcy_forms/vehicleloading",{line:line,data:date},function(result){ 142 + /* var gsdmVehic = $("#gsdmVehic").val();
  143 + var fgsdmVehic = $("#fgsdmVehic").val(); */
  144 + $post('/mcy_forms/vehicleloading',{line:line,data:date},function(result){
141 // 把数据填充到模版中 145 // 把数据填充到模版中
142 var tbodyHtml = template('vehicleloading',{list:result}); 146 var tbodyHtml = template('vehicleloading',{list:result});
143 // 把渲染好的模版html文本追加到表格中 147 // 把渲染好的模版html文本追加到表格中
src/main/resources/static/pages/forms/statement/waybillday.html
@@ -28,6 +28,14 @@ @@ -28,6 +28,14 @@
28 <div class="portlet light porttlet-fit bordered"> 28 <div class="portlet light porttlet-fit bordered">
29 <div class="portlet-title"> 29 <div class="portlet-title">
30 <form class="form-inline" action="" method="post"> 30 <form class="form-inline" action="" method="post">
  31 + <!-- <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_waybillday">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmWaybillday" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_waybillday">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmWaybillday" style="width: 140px;"></select>
  38 + </div> -->
31 <div style="display: inline-block;"> 39 <div style="display: inline-block;">
32 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
33 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -79,6 +87,42 @@ @@ -79,6 +87,42 @@
79 locale : 'zh-cn' 87 locale : 'zh-cn'
80 }); 88 });
81 89
  90 + var obj = [];
  91 + $.get('/user/companyData', function(result){
  92 + obj = result;
  93 + var options = '';
  94 + for(var i = 0; i < obj.length; i++){
  95 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  96 + }
  97 +
  98 + if(obj.length ==0){
  99 + $("#gsdmDiv_waybillday").css('display','none');
  100 + $('#fgsdmDiv_waybillday').css('display','none');
  101 + }else if(obj.length ==1){
  102 + $("#gsdmDiv_waybillday").css('display','none');
  103 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  104 + $('#fgsdmDiv_waybillday').css('display','none');
  105 + }
  106 + $('#gsdmWaybillday').html(options);
  107 + updateCompany();
  108 + });
  109 +
  110 + $("#gsdmWaybillday").on("change",updateCompany);
  111 + function updateCompany(){
  112 + var company = $('#gsdmWaybillday').val();
  113 + var options = '';
  114 + for(var i = 0; i < obj.length; i++){
  115 + if(obj[i].companyCode == company){
  116 + var children = obj[i].children;
  117 + for(var j = 0; j < children.length; j++){
  118 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  119 + }
  120 + }
  121 + }
  122 + $('#fgsdmWaybillday').html(options);
  123 + }
  124 +
  125 +
82 $.get('/basic/lineCode2Name',function(result){ 126 $.get('/basic/lineCode2Name',function(result){
83 var data=[]; 127 var data=[];
84 128
@@ -91,10 +135,15 @@ @@ -91,10 +135,15 @@
91 }) 135 })
92 var line; 136 var line;
93 var date; 137 var date;
  138 + var gsdmWaybillday;
  139 + var fgsdmWaybillday;
94 $("#query").on("click",function(){ 140 $("#query").on("click",function(){
95 line = $("#line").val(); 141 line = $("#line").val();
96 date = $("#date").val(); 142 date = $("#date").val();
97 - $post('/mcy_forms/waybillday',{line:line,date:$("#date").val(),type:'query'},function(result){ 143 + gsdmWaybillday=$("#gsdmWaybillday").val();
  144 + fgsdmWaybillday = $("#fgsdmWaybillday").val();
  145 +
  146 + $post('/mcy_forms/waybillday',{/* gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday, */line:line,date:$("#date").val(),type:'query'},function(result){
98 $.each(result, function(i, obj) { 147 $.each(result, function(i, obj) {
99 obj.requestType = reqCodeMap[obj.requestType]; 148 obj.requestType = reqCodeMap[obj.requestType];
100 }); 149 });
src/main/resources/static/pages/report/timetable/timetable.html
@@ -245,6 +245,7 @@ @@ -245,6 +245,7 @@
245 initPinYinSelect2('#line',data,''); 245 initPinYinSelect2('#line',data,'');
246 246
247 }) 247 })
  248 +
248 //查询 249 //查询
249 $("#query").on('click',function(){ 250 $("#query").on('click',function(){
250 console.log($("#gsdmTime").val()); 251 console.log($("#gsdmTime").val());
src/main/resources/static/pages/scheduleApp/Gruntfile.js
@@ -14,6 +14,9 @@ module.exports = function (grunt) { @@ -14,6 +14,9 @@ module.exports = function (grunt) {
14 }, 14 },
15 concat_route: { // 所有模块的route配置合并的js文件 15 concat_route: { // 所有模块的route配置合并的js文件
16 src: ['module/common/prj-common-ui-route-state.js'] 16 src: ['module/common/prj-common-ui-route-state.js']
  17 + },
  18 + concat_service: { // 所有模块的servie服务合并的js文件
  19 + src: ['module/common/prj-common-globalservice.js']
17 } 20 }
18 21
19 //, 22 //,
@@ -69,11 +72,13 @@ module.exports = function (grunt) { @@ -69,11 +72,13 @@ module.exports = function (grunt) {
69 'module/common/dts1/load/loadingWidget.js', // loading界面指令 72 'module/common/dts1/load/loadingWidget.js', // loading界面指令
70 'module/common/dts1/validation/remoteValidation.js',// 服务端验证指令 73 'module/common/dts1/validation/remoteValidation.js',// 服务端验证指令
71 'module/common/dts1/validation/remoteValidationt2.js',// 服务端验证指令(时刻表专用) 74 'module/common/dts1/validation/remoteValidationt2.js',// 服务端验证指令(时刻表专用)
  75 + 'module/common/dts1/validation/remoteValidation3.js',// 服务端验证指令
72 'module/common/dts1/select/saSelect.js', // select整合指令1 76 'module/common/dts1/select/saSelect.js', // select整合指令1
73 'module/common/dts1/select/saSelect2.js', // select整合指令2 77 'module/common/dts1/select/saSelect2.js', // select整合指令2
74 'module/common/dts1/select/saSelect3.js', // select整合指令3 78 'module/common/dts1/select/saSelect3.js', // select整合指令3
75 'module/common/dts1/select/saSelect4.js', // select整合指令4 79 'module/common/dts1/select/saSelect4.js', // select整合指令4
76 'module/common/dts1/select/saSelect5.js', // select整合指令5 80 'module/common/dts1/select/saSelect5.js', // select整合指令5
  81 + 'module/common/dts2/ttinfotable/mySelect.js', // select整合指令
77 'module/common/dts1/radioButton/saRadiogroup.js', // 单选框组整合指令 82 'module/common/dts1/radioButton/saRadiogroup.js', // 单选框组整合指令
78 'module/common/dts1/checkbox/saCheckboxgroup.js', // 多选框组整合指令 83 'module/common/dts1/checkbox/saCheckboxgroup.js', // 多选框组整合指令
79 'module/common/dts2/dateGroup/saDategroup.js', // 特殊日期选择指令 84 'module/common/dts2/dateGroup/saDategroup.js', // 特殊日期选择指令
@@ -104,6 +109,26 @@ module.exports = function (grunt) { @@ -104,6 +109,26 @@ module.exports = function (grunt) {
104 'module/core/ttInfoManage/detailedit/route.js' // 时刻表明细管理模块 109 'module/core/ttInfoManage/detailedit/route.js' // 时刻表明细管理模块
105 ], 110 ],
106 dest: 'module/common/prj-common-ui-route-state.js' 111 dest: 'module/common/prj-common-ui-route-state.js'
  112 + },
  113 + service: {
  114 + options: {
  115 + banner: '//所有模块service配置\n'
  116 + },
  117 + src: [
  118 + 'module/basicInfo/busInfoManage/service.js', // 车辆基础信息管理service
  119 + 'module/basicInfo/deviceInfoManage/service.js', // 设备信息管理service
  120 + 'module/basicInfo/employeeInfoManage/service.js', // 人员基础信息管理service
  121 + 'module/core/busConfig/service.js', // 车辆配置service
  122 + 'module/core/busLineInfoStat/service.js', // 线路运营概览service
  123 + 'module/core/employeeConfig/service.js', // 人员配置service
  124 + 'module/core/guideboardManage/service.js', // 路牌管理service
  125 + 'module/core/rerunManage/service.js', // 套跑管理service
  126 + 'module/core/schedulePlanManage/service.js', // 排班计划管理service
  127 + 'module/core/scheduleRuleManage/service.js', // 排班规则管理service
  128 + 'module/core/ttInfoManage/service.js', // 时刻表管理service
  129 + 'module/common/prj-common-globalservice-legacy.js' // 其他用service
  130 + ],
  131 + dest: 'module/common/prj-common-globalservice.js'
107 } 132 }
108 }, 133 },
109 134
@@ -440,4 +465,14 @@ module.exports = function (grunt) { @@ -440,4 +465,14 @@ module.exports = function (grunt) {
440 'clean:concat_route', 'concat:route' 465 'clean:concat_route', 'concat:route'
441 ]); 466 ]);
442 467
  468 + /*
  469 + 定义了一个service的grunt任务
  470 + 任务组有顺序,如下说明:
  471 + 1、clean:concat_route,清除合并生成的prj-common-globalservice.js文件
  472 + 2、concat:route,重新合并prj-common-globalservice.js文件
  473 + */
  474 + grunt.registerTask('service', [
  475 + 'clean:concat_service', 'concat:service'
  476 + ]);
  477 +
443 }; 478 };
444 \ No newline at end of file 479 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
@@ -33,8 +33,8 @@ @@ -33,8 +33,8 @@
33 <div class="portlet-body form"> 33 <div class="portlet-body form">
34 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> 34 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
35 <!--<div class="alert alert-danger display-hide">--> 35 <!--<div class="alert alert-danger display-hide">-->
36 - <!--<button class="close" data-close="alert"></button>-->  
37 - <!--您的输入有误,请检查下面的输入项--> 36 + <!--<button class="close" data-close="alert"></button>-->
  37 + <!--您的输入有误,请检查下面的输入项-->
38 <!--</div>--> 38 <!--</div>-->
39 39
40 40
@@ -45,9 +45,9 @@ @@ -45,9 +45,9 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <input type="text" class="form-control" 46 <input type="text" class="form-control"
47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode" 47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode"
48 - required ng-maxlength="8" 48 + required ng-maxlength="20"
49 remote-Validation 49 remote-Validation
50 - remotevtype="cl1" 50 + remotevtype="cars_zbh"
51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" 51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}"
52 placeholder="请输入车辆内部编码"/> 52 placeholder="请输入车辆内部编码"/>
53 </div> 53 </div>
@@ -56,10 +56,10 @@ @@ -56,10 +56,10 @@
56 内部编号必须填写 56 内部编号必须填写
57 </div> 57 </div>
58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength"> 58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength">
59 - 内部编号长度不能超过8 59 + 内部编号长度不能超过20
60 </div> 60 </div>
61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote"> 61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote">
62 - 内部编号不能重复 62 + {{$remote_msg}}
63 </div> 63 </div>
64 </div> 64 </div>
65 65
@@ -78,6 +78,7 @@ @@ -78,6 +78,7 @@
78 datatype="gsType" 78 datatype="gsType"
79 required > 79 required >
80 </sa-Select3> 80 </sa-Select3>
  81 +
81 </div> 82 </div>
82 <!-- 隐藏块,显示验证信息 --> 83 <!-- 隐藏块,显示验证信息 -->
83 <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> 84 <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required">
@@ -103,26 +104,40 @@ @@ -103,26 +104,40 @@
103 <label class="col-md-2 control-label">车辆编码*:</label> 104 <label class="col-md-2 control-label">车辆编码*:</label>
104 <div class="col-md-3"> 105 <div class="col-md-3">
105 <input type="text" class="form-control" 106 <input type="text" class="form-control"
106 - name="carCode" ng-model="ctrl.busInfoForSave.carCode"  
107 - required placeholder="请输入车辆编码"/> 107 + name="carCode" ng-model="ctrl.busInfoForSave.carCode"
  108 + required placeholder="请输入车辆编码"
  109 + remote-Validation
  110 + remotevtype="cars_clbh"
  111 + remotevparam="{{ {'carCode_eq': ctrl.busInfoForSave.carCode} | json}}"
  112 + />
108 </div> 113 </div>
109 <!-- 隐藏块,显示验证信息 --> 114 <!-- 隐藏块,显示验证信息 -->
110 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required"> 115 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required">
111 车辆编码必须填写 116 车辆编码必须填写
112 </div> 117 </div>
  118 + <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.remote">
  119 + {{$remote_msg}}
  120 + </div>
113 </div> 121 </div>
114 122
115 <div class="form-group has-success has-feedback"> 123 <div class="form-group has-success has-feedback">
116 <label class="col-md-2 control-label">车牌号*:</label> 124 <label class="col-md-2 control-label">车牌号*:</label>
117 <div class="col-md-3"> 125 <div class="col-md-3">
118 <input type="text" class="form-control" 126 <input type="text" class="form-control"
119 - name="carPlate" ng-model="ctrl.busInfoForSave.carPlate"  
120 - required placeholder="请输入车牌号"/> 127 + name="carPlate" ng-model="ctrl.busInfoForSave.carPlate"
  128 + required placeholder="请输入车牌号"
  129 + remote-Validation
  130 + remotevtype="cars_cph"
  131 + remotevparam="{{ {'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}"
  132 + />
121 </div> 133 </div>
122 <!-- 隐藏快,显示验证信息 --> 134 <!-- 隐藏快,显示验证信息 -->
123 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required"> 135 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required">
124 车牌号必须填写 136 车牌号必须填写
125 </div> 137 </div>
  138 + <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.remote">
  139 + {{$remote_msg}}
  140 + </div>
126 </div> 141 </div>
127 142
128 <div class="form-group has-success has-feedback"> 143 <div class="form-group has-success has-feedback">
@@ -149,62 +164,69 @@ @@ -149,62 +164,69 @@
149 <label class="col-md-2 control-label">终端号*:</label> 164 <label class="col-md-2 control-label">终端号*:</label>
150 <div class="col-md-3"> 165 <div class="col-md-3">
151 <input type="text" class="form-control" 166 <input type="text" class="form-control"
152 - name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"  
153 - required placeholder="请输入设备终端号"/> 167 + name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"
  168 + required placeholder="请输入设备终端号"
  169 + remote-Validation
  170 + remotevtype="cars_sbbh"
  171 + remotevparam="{{ {'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}"
  172 + />
154 </div> 173 </div>
155 <!-- 隐藏块,显示验证信息 --> 174 <!-- 隐藏块,显示验证信息 -->
156 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required"> 175 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required">
157 设备终端号必须填写 176 设备终端号必须填写
158 </div> 177 </div>
  178 + <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.remote">
  179 + {{$remote_msg}}
  180 + </div>
159 </div> 181 </div>
160 182
161 <div class="form-group"> 183 <div class="form-group">
162 <label class="col-md-2 control-label">车型类别:</label> 184 <label class="col-md-2 control-label">车型类别:</label>
163 <div class="col-md-4"> 185 <div class="col-md-4">
164 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carClass" 186 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carClass"
165 - placeholder="请输入车型类别"/> 187 + placeholder="请输入车型类别"/>
166 </div> 188 </div>
167 </div> 189 </div>
168 <div class="form-group"> 190 <div class="form-group">
169 <label class="col-md-2 control-label">技术速度:</label> 191 <label class="col-md-2 control-label">技术速度:</label>
170 <div class="col-md-4"> 192 <div class="col-md-4">
171 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.speed" 193 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.speed"
172 - placeholder="请输入技术速度"/> 194 + placeholder="请输入技术速度"/>
173 </div> 195 </div>
174 </div> 196 </div>
175 <div class="form-group"> 197 <div class="form-group">
176 <label class="col-md-2 control-label">座位数:</label> 198 <label class="col-md-2 control-label">座位数:</label>
177 <div class="col-md-4"> 199 <div class="col-md-4">
178 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carSeatnNumber" 200 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carSeatnNumber"
179 - placeholder="请输入座位数"/> 201 + placeholder="请输入座位数"/>
180 </div> 202 </div>
181 </div> 203 </div>
182 <div class="form-group"> 204 <div class="form-group">
183 <label class="col-md-2 control-label">载客标准:</label> 205 <label class="col-md-2 control-label">载客标准:</label>
184 <div class="col-md-4"> 206 <div class="col-md-4">
185 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carStandard" 207 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carStandard"
186 - placeholder="请输入载客标准"/> 208 + placeholder="请输入载客标准"/>
187 </div> 209 </div>
188 </div> 210 </div>
189 <div class="form-group"> 211 <div class="form-group">
190 <label class="col-md-2 control-label">标准油耗/开空调:</label> 212 <label class="col-md-2 control-label">标准油耗/开空调:</label>
191 <div class="col-md-4"> 213 <div class="col-md-4">
192 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.kburnStandard" 214 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.kburnStandard"
193 - placeholder="请输入标准油耗/开空调"/> 215 + placeholder="请输入标准油耗/开空调"/>
194 </div> 216 </div>
195 </div> 217 </div>
196 <div class="form-group"> 218 <div class="form-group">
197 <label class="col-md-2 control-label">标准油耗/关空调:</label> 219 <label class="col-md-2 control-label">标准油耗/关空调:</label>
198 <div class="col-md-4"> 220 <div class="col-md-4">
199 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.gburnStandard" 221 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.gburnStandard"
200 - placeholder="请输入标准油耗/关空调"/> 222 + placeholder="请输入标准油耗/关空调"/>
201 </div> 223 </div>
202 </div> 224 </div>
203 <div class="form-group"> 225 <div class="form-group">
204 <label class="col-md-2 control-label">报废号:</label> 226 <label class="col-md-2 control-label">报废号:</label>
205 <div class="col-md-4"> 227 <div class="col-md-4">
206 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode" 228 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode"
207 - placeholder="请输入报废号"/> 229 + placeholder="请输入报废号"/>
208 </div> 230 </div>
209 </div> 231 </div>
210 232
@@ -229,56 +251,56 @@ @@ -229,56 +251,56 @@
229 <label class="col-md-2 control-label">厂牌型号1:</label> 251 <label class="col-md-2 control-label">厂牌型号1:</label>
230 <div class="col-md-4"> 252 <div class="col-md-4">
231 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeOne" 253 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeOne"
232 - placeholder="请输入厂牌型号1"/> 254 + placeholder="请输入厂牌型号1"/>
233 </div> 255 </div>
234 </div> 256 </div>
235 <div class="form-group"> 257 <div class="form-group">
236 <label class="col-md-2 control-label">厂牌型号2:</label> 258 <label class="col-md-2 control-label">厂牌型号2:</label>
237 <div class="col-md-4"> 259 <div class="col-md-4">
238 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeTwo" 260 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeTwo"
239 - placeholder="请输入厂牌型号2"/> 261 + placeholder="请输入厂牌型号2"/>
240 </div> 262 </div>
241 </div> 263 </div>
242 <div class="form-group"> 264 <div class="form-group">
243 <label class="col-md-2 control-label">车辆等级标准:</label> 265 <label class="col-md-2 control-label">车辆等级标准:</label>
244 <div class="col-md-4"> 266 <div class="col-md-4">
245 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carGride" 267 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carGride"
246 - placeholder="请输入车辆等级标准"/> 268 + placeholder="请输入车辆等级标准"/>
247 </div> 269 </div>
248 </div> 270 </div>
249 <div class="form-group"> 271 <div class="form-group">
250 <label class="col-md-2 control-label">出厂排放标准:</label> 272 <label class="col-md-2 control-label">出厂排放标准:</label>
251 <div class="col-md-4"> 273 <div class="col-md-4">
252 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.emissionsStandard" 274 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.emissionsStandard"
253 - placeholder="请输入出场排放标准"/> 275 + placeholder="请输入出场排放标准"/>
254 </div> 276 </div>
255 </div> 277 </div>
256 <div class="form-group"> 278 <div class="form-group">
257 <label class="col-md-2 control-label">发动机号码1:</label> 279 <label class="col-md-2 control-label">发动机号码1:</label>
258 <div class="col-md-4"> 280 <div class="col-md-4">
259 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeOne" 281 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeOne"
260 - placeholder="请输入发动机号码1"/> 282 + placeholder="请输入发动机号码1"/>
261 </div> 283 </div>
262 </div> 284 </div>
263 <div class="form-group"> 285 <div class="form-group">
264 <label class="col-md-2 control-label">发动机号码2:</label> 286 <label class="col-md-2 control-label">发动机号码2:</label>
265 <div class="col-md-4"> 287 <div class="col-md-4">
266 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeTwo" 288 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeTwo"
267 - placeholder="请输入发动机号码2"/> 289 + placeholder="请输入发动机号码2"/>
268 </div> 290 </div>
269 </div> 291 </div>
270 <div class="form-group"> 292 <div class="form-group">
271 <label class="col-md-2 control-label">车架号码1:</label> 293 <label class="col-md-2 control-label">车架号码1:</label>
272 <div class="col-md-4"> 294 <div class="col-md-4">
273 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberOne" 295 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberOne"
274 - placeholder="请输入车架号码1"/> 296 + placeholder="请输入车架号码1"/>
275 </div> 297 </div>
276 </div> 298 </div>
277 <div class="form-group"> 299 <div class="form-group">
278 <label class="col-md-2 control-label">车架号码2:</label> 300 <label class="col-md-2 control-label">车架号码2:</label>
279 <div class="col-md-4"> 301 <div class="col-md-4">
280 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberTwo" 302 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberTwo"
281 - placeholder="请输入车架号码2"/> 303 + placeholder="请输入车架号码2"/>
282 </div> 304 </div>
283 </div> 305 </div>
284 <div class="form-group"> 306 <div class="form-group">
@@ -422,5 +444,4 @@ @@ -422,5 +444,4 @@
422 444
423 </div> 445 </div>
424 446
425 -  
426 </div> 447 </div>
427 \ No newline at end of file 448 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/form.html
@@ -45,9 +45,9 @@ @@ -45,9 +45,9 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <input type="text" class="form-control" 46 <input type="text" class="form-control"
47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode" 47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode"
48 - required ng-maxlength="8" 48 + required ng-maxlength="20"
49 remote-Validation 49 remote-Validation
50 - remotevtype="cl1" 50 + remotevtype="cars_zbh"
51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" 51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}"
52 placeholder="请输入车辆内部编码"/> 52 placeholder="请输入车辆内部编码"/>
53 </div> 53 </div>
@@ -56,10 +56,10 @@ @@ -56,10 +56,10 @@
56 内部编号必须填写 56 内部编号必须填写
57 </div> 57 </div>
58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength"> 58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength">
59 - 内部编号长度不能超过8 59 + 内部编号长度不能超过20
60 </div> 60 </div>
61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote"> 61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote">
62 - 内部编号不能重复 62 + {{$remote_msg}}
63 </div> 63 </div>
64 </div> 64 </div>
65 65
@@ -105,12 +105,19 @@ @@ -105,12 +105,19 @@
105 <div class="col-md-3"> 105 <div class="col-md-3">
106 <input type="text" class="form-control" 106 <input type="text" class="form-control"
107 name="carCode" ng-model="ctrl.busInfoForSave.carCode" 107 name="carCode" ng-model="ctrl.busInfoForSave.carCode"
108 - required placeholder="请输入车辆编码"/> 108 + required placeholder="请输入车辆编码"
  109 + remote-Validation
  110 + remotevtype="cars_clbh"
  111 + remotevparam="{{ {'carCode_eq': ctrl.busInfoForSave.carCode} | json}}"
  112 + />
109 </div> 113 </div>
110 <!-- 隐藏块,显示验证信息 --> 114 <!-- 隐藏块,显示验证信息 -->
111 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required"> 115 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required">
112 车辆编码必须填写 116 车辆编码必须填写
113 </div> 117 </div>
  118 + <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.remote">
  119 + {{$remote_msg}}
  120 + </div>
114 </div> 121 </div>
115 122
116 <div class="form-group has-success has-feedback"> 123 <div class="form-group has-success has-feedback">
@@ -118,12 +125,19 @@ @@ -118,12 +125,19 @@
118 <div class="col-md-3"> 125 <div class="col-md-3">
119 <input type="text" class="form-control" 126 <input type="text" class="form-control"
120 name="carPlate" ng-model="ctrl.busInfoForSave.carPlate" 127 name="carPlate" ng-model="ctrl.busInfoForSave.carPlate"
121 - required placeholder="请输入车牌号"/> 128 + required placeholder="请输入车牌号"
  129 + remote-Validation
  130 + remotevtype="cars_cph"
  131 + remotevparam="{{ {'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}"
  132 + />
122 </div> 133 </div>
123 <!-- 隐藏快,显示验证信息 --> 134 <!-- 隐藏快,显示验证信息 -->
124 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required"> 135 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required">
125 车牌号必须填写 136 车牌号必须填写
126 </div> 137 </div>
  138 + <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.remote">
  139 + {{$remote_msg}}
  140 + </div>
127 </div> 141 </div>
128 142
129 <div class="form-group has-success has-feedback"> 143 <div class="form-group has-success has-feedback">
@@ -151,12 +165,19 @@ @@ -151,12 +165,19 @@
151 <div class="col-md-3"> 165 <div class="col-md-3">
152 <input type="text" class="form-control" 166 <input type="text" class="form-control"
153 name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode" 167 name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"
154 - required placeholder="请输入设备终端号"/> 168 + required placeholder="请输入设备终端号"
  169 + remote-Validation
  170 + remotevtype="cars_sbbh"
  171 + remotevparam="{{ {'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}"
  172 + />
155 </div> 173 </div>
156 <!-- 隐藏块,显示验证信息 --> 174 <!-- 隐藏块,显示验证信息 -->
157 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required"> 175 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required">
158 设备终端号必须填写 176 设备终端号必须填写
159 </div> 177 </div>
  178 + <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.remote">
  179 + {{$remote_msg}}
  180 + </div>
160 </div> 181 </div>
161 182
162 <div class="form-group"> 183 <div class="form-group">
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
@@ -7,12 +7,12 @@ @@ -7,12 +7,12 @@
7 <th style="width: 50px;">序号</th> 7 <th style="width: 50px;">序号</th>
8 <th style="width: 130px;">车辆编号</th> 8 <th style="width: 130px;">车辆编号</th>
9 <th style="width: 130px;">内部编号</th> 9 <th style="width: 130px;">内部编号</th>
10 - <th >设备编号</th>  
11 - <th >车牌号</th>  
12 - <th style="width: 15%;">所在公司</th>  
13 - <th >所在分公司</th>  
14 - <th style="width: 10%">是否电车</th>  
15 - <th style="width: 21%">操作</th> 10 + <th style="width: 130px;">设备编号</th>
  11 + <th style="width: 130px;">车牌号</th>
  12 + <th style="width: 150px;">所在公司</th>
  13 + <th style="width: 100px;">所在分公司</th>
  14 + <th style="width: 80px">是否电车</th>
  15 + <th style="width: 100%">操作</th>
16 </tr> 16 </tr>
17 <tr role="row" class="filter"> 17 <tr role="row" class="filter">
18 <td></td> 18 <td></td>
@@ -23,8 +23,10 @@ @@ -23,8 +23,10 @@
23 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().insideCode_like" placeholder="输入内部编号..."/> 23 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().insideCode_like" placeholder="输入内部编号..."/>
24 </td> 24 </td>
25 <td> 25 <td>
  26 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().equipmentCode_like" placeholder="输入设备编号..."/>
26 </td> 27 </td>
27 <td> 28 <td>
  29 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carCode_like" placeholder="输入车牌号..."/>
28 </td> 30 </td>
29 <td> 31 <td>
30 <div> 32 <div>
@@ -47,18 +49,18 @@ @@ -47,18 +49,18 @@
47 </td> 49 </td>
48 <td> 50 <td>
49 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 51 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
50 - ng-click="ctrl.pageChanaged()"> 52 + ng-click="ctrl.doPage()">
51 <i class="fa fa-search"></i> 搜索</button> 53 <i class="fa fa-search"></i> 搜索</button>
52 54
53 <button class="btn btn-sm red btn-outline filter-cancel" 55 <button class="btn btn-sm red btn-outline filter-cancel"
54 - ng-click="ctrl.resetSearchCondition()"> 56 + ng-click="ctrl.reset()">
55 <i class="fa fa-times"></i> 重置</button> 57 <i class="fa fa-times"></i> 重置</button>
56 </td> 58 </td>
57 59
58 </tr> 60 </tr>
59 </thead> 61 </thead>
60 <tbody> 62 <tbody>
61 - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> 63 + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX">
62 <td> 64 <td>
63 <span ng-bind="$index + 1"></span> 65 <span ng-bind="$index + 1"></span>
64 </td> 66 </td>
@@ -96,9 +98,9 @@ @@ -96,9 +98,9 @@
96 </div> 98 </div>
97 99
98 <div style="text-align: right;"> 100 <div style="text-align: right;">
99 - <uib-pagination total-items="ctrl.pageInfo.totalItems"  
100 - ng-model="ctrl.pageInfo.currentPage"  
101 - ng-change="ctrl.pageChanaged()" 101 + <uib-pagination total-items="ctrl.page()['totalElements']"
  102 + ng-model="ctrl.page()['uiNumber']"
  103 + ng-change="ctrl.doPage()"
102 rotate="false" 104 rotate="false"
103 max-size="10" 105 max-size="10"
104 boundary-links="true" 106 boundary-links="true"
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
1 // 车辆基础信息维护 service controller等写在一起 1 // 车辆基础信息维护 service controller等写在一起
2 2
3 -angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) { 3 +angular.module('ScheduleApp').factory(
  4 + 'BusInfoManageService',
  5 + [
  6 + 'BusInfoManageService_g',
  7 + function(service) {
4 8
5 - /** 当前的查询条件信息 */  
6 - var currentSearchCondition = {  
7 - "carCode_like" : "",  
8 - "insideCode_like" : "",  
9 - "equipmentCode_like" : "",  
10 - "carPlate_like" : ""  
11 - };  
12 -  
13 - /** 当前第几页 */  
14 - var currentPageNo = 1;  
15 - return {  
16 - /**  
17 - * 获取查询条件信息,  
18 - * 用于给controller用来和页面数据绑定。  
19 - */  
20 - getSearchCondition: function() {  
21 - return currentSearchCondition;  
22 - },  
23 - /**  
24 - * 重置查询条件信息。  
25 - */  
26 - resetSearchCondition: function() {  
27 - var key;  
28 - for (key in currentSearchCondition) {  
29 - currentSearchCondition[key] = undefined;  
30 - }  
31 - currentPageNo = 1;  
32 - },  
33 - /**  
34 - * 设置当前页码。  
35 - * @param cpn 从1开始,后台是从0开始的  
36 - */  
37 - setCurrentPageNo: function(cpn) {  
38 - currentPageNo = cpn;  
39 - },  
40 - /**  
41 - * 组装查询参数,返回一个promise查询结果。  
42 - * @param params 查询参数  
43 - * @return 返回一个 promise  
44 - */  
45 - getPage: function() {  
46 - var params = currentSearchCondition; // 查询条件  
47 - params.page = currentPageNo - 1; // 服务端页码从0开始  
48 - return service.rest.list(params).$promise;  
49 - },  
50 - /**  
51 - * 获取明细信息。  
52 - * @param id 车辆id  
53 - * @return 返回一个 promise  
54 - */  
55 - getDetail: function(id) {  
56 - var params = {id: id};  
57 - return service.rest.get(params).$promise;  
58 - },  
59 - /**  
60 - * 保存信息。  
61 - * @param obj 车辆详细信息  
62 - * @return 返回一个 promise  
63 - */  
64 - saveDetail: function(obj) {  
65 - return service.rest.save(obj).$promise;  
66 - },  
67 - /**  
68 - * 数据导出。  
69 - * @returns {*|Function|promise|n}  
70 - */  
71 - dataExport: function() {  
72 - return service.dataTools.dataExport().$promise;  
73 - }  
74 - };  
75 -}]); 9 + /** 当前的查询条件信息 */
  10 + var currentSearchCondition = {
  11 + page: 0,
  12 + "carCode_like" : "",
  13 + "insideCode_like" : "",
  14 + "equipmentCode_like" : "",
  15 + "carPlate_like" : ""
  16 + };
  17 + // 当前查询返回的信息
  18 + var currentPage = { // 后台spring data返回的格式
  19 + totalElements: 0,
  20 + number: 0, // 后台返回的页码,spring返回从0开始
  21 + content: [],
76 22
77 -angular.module('ScheduleApp').controller('BusInfoManageCtrl', [  
78 - 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g',  
79 - function(busInfoManageService, $state, $uibModal, fileDownload) {  
80 - var self = this; 23 + uiNumber: 1 // 页面绑定的页码
  24 + };
81 25
82 - // 切换到form状态  
83 - self.goForm = function() {  
84 - //alert("切换");  
85 - $state.go("busInfoManage_form");  
86 - }; 26 + // 查询对象
  27 + var queryClass = service.rest;
87 28
88 - // 导入excel  
89 - self.importData = function() {  
90 - // large方式弹出模态对话框  
91 - var modalInstance = $uibModal.open({  
92 - templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',  
93 - size: "lg",  
94 - animation: true,  
95 - backdrop: 'static',  
96 - resolve: {  
97 - // 可以传值给controller 29 + return {
  30 + getQueryClass: function() {
  31 + return queryClass;
98 }, 32 },
99 - windowClass: 'center-modal',  
100 - controller: "BusInfoManageToolsCtrl",  
101 - controllerAs: "ctrl",  
102 - bindToController: true  
103 - });  
104 - modalInstance.result.then(  
105 - function() {  
106 - console.log("dataImport.html打开"); 33 + /**
  34 + * 获取查询条件信息,
  35 + * 用于给controller用来和页面数据绑定。
  36 + */
  37 + getSearchCondition: function() {
  38 + currentSearchCondition.page = currentPage.uiNumber - 1;
  39 + return currentSearchCondition;
107 }, 40 },
108 - function() {  
109 - console.log("dataImport.html消失");  
110 - }  
111 - );  
112 - };  
113 -  
114 - // 导出excel  
115 - self.exportData = function() {  
116 - busInfoManageService.dataExport().then(  
117 - function(result) {  
118 - fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls"); 41 + /**
  42 + * 组装查询参数,返回一个promise查询结果。
  43 + * @param params 查询参数
  44 + * @return 返回一个 promise
  45 + */
  46 + getPage: function(page) {
  47 + if (page) {
  48 + currentPage.totalElements = page.totalElements;
  49 + currentPage.number = page.number;
  50 + currentPage.content = page.content;
  51 + }
  52 + return currentPage;
119 }, 53 },
120 - function(result) {  
121 - console.log("exportData failed:" + result); 54 + resetStatus: function() {
  55 + currentSearchCondition = {page: 0};
  56 + currentPage = {
  57 + totalElements: 0,
  58 + number: 0,
  59 + content: [],
  60 + uiNumber: 1
  61 + };
  62 + },
  63 +
  64 + /**
  65 + * 数据导出。
  66 + * @returns {*|Function|promise|n}
  67 + */
  68 + dataExport: function() {
  69 + return service.dataTools.dataExport().$promise;
122 } 70 }
123 - );  
124 - };  
125 - }]); 71 + };
  72 +
  73 + }
  74 + ]
  75 +);
  76 +
  77 +// index.html控制器
  78 +angular.module('ScheduleApp').controller(
  79 + 'BusInfoManageCtrl',
  80 + [
  81 + 'BusInfoManageService',
  82 + '$state',
  83 + '$uibModal',
  84 + 'FileDownload_g',
  85 + function(busInfoManageService, $state, $uibModal, fileDownload) {
  86 + var self = this;
  87 +
  88 + // 切换到form状态
  89 + self.goForm = function() {
  90 + //alert("切换");
  91 + $state.go("busInfoManage_form");
  92 + };
  93 +
  94 + // 导入excel
  95 + self.importData = function() {
  96 + // large方式弹出模态对话框
  97 + var modalInstance = $uibModal.open({
  98 + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',
  99 + size: "lg",
  100 + animation: true,
  101 + backdrop: 'static',
  102 + resolve: {
  103 + // 可以传值给controller
  104 + },
  105 + windowClass: 'center-modal',
  106 + controller: "BusInfoManageToolsCtrl",
  107 + controllerAs: "ctrl",
  108 + bindToController: true
  109 + });
  110 + modalInstance.result.then(
  111 + function() {
  112 + console.log("dataImport.html打开");
  113 + },
  114 + function() {
  115 + console.log("dataImport.html消失");
  116 + }
  117 + );
  118 + };
  119 +
  120 + // 导出excel
  121 + self.exportData = function() {
  122 + busInfoManageService.dataExport().then(
  123 + function(result) {
  124 + fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls");
  125 + },
  126 + function(result) {
  127 + console.log("exportData failed:" + result);
  128 + }
  129 + );
  130 + };
  131 + }
  132 + ]
  133 +);
126 134
127 angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { 135 angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
128 var self = this; 136 var self = this;
@@ -160,143 +168,114 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusInfoManageToolsCtrl&#39;, [&#39;$modalInsta @@ -160,143 +168,114 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusInfoManageToolsCtrl&#39;, [&#39;$modalInsta
160 168
161 }]); 169 }]);
162 170
  171 +// list.html控制器
  172 +angular.module('ScheduleApp').controller(
  173 + 'BusInfoManageListCtrl',
  174 + [
  175 + 'BusInfoManageService',
  176 + '$scope',
  177 + function(service, $scope) {
  178 + var self = this;
  179 + var Cars = service.getQueryClass();
163 180
164 -angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) {  
165 - var self = this;  
166 - self.pageInfo = {  
167 - totalItems : 0,  
168 - currentPage : 1,  
169 - infos: []  
170 - }; 181 + self.page = function() {
  182 + return service.getPage();
  183 + };
171 184
172 - // 初始创建的时候,获取一次列表数据  
173 - busInfoManageService.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 - busInfoManageService.setCurrentPageNo(result.number + 1);  
179 - },  
180 - function(result) {  
181 - alert("出错啦!");  
182 - }  
183 - ); 185 + self.searchCondition = function() {
  186 + return service.getSearchCondition();
  187 + };
184 188
185 - //$scope.$watch("ctrl.pageInfo.currentPage", function() {  
186 - // alert("dfdfdf");  
187 - //}); 189 + self.doPage = function() {
  190 + var result = Cars.list(self.searchCondition(), function() {
  191 + if (!result.status) {
  192 + service.getPage(result);
  193 + }
  194 + });
  195 + };
  196 + self.reset = function() {
  197 + service.resetStatus();
  198 + var result = Cars.list(self.searchCondition(), function() {
  199 + if (!result.status) {
  200 + service.getPage(result);
  201 + }
  202 + });
  203 + };
188 204
189 - // 翻页的时候调用  
190 - self.pageChanaged = function() {  
191 - busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);  
192 - busInfoManageService.getPage().then(  
193 - function(result) {  
194 - self.pageInfo.totalItems = result.totalElements;  
195 - self.pageInfo.currentPage = result.number + 1;  
196 - self.pageInfo.infos = result.content;  
197 - busInfoManageService.setCurrentPageNo(result.number + 1);  
198 - },  
199 - function(result) {  
200 - alert("出错啦!");  
201 - }  
202 - );  
203 - };  
204 - // 获取查询条件数据  
205 - self.searchCondition = function() {  
206 - return busInfoManageService.getSearchCondition();  
207 - };  
208 - // 重置查询条件  
209 - self.resetSearchCondition = function() {  
210 - busInfoManageService.resetSearchCondition();  
211 - self.pageInfo.currentPage = 1;  
212 - self.pageChanaged();  
213 - };  
214 -}]); 205 + self.doPage();
  206 + }
  207 + ]
  208 +);
215 209
216 -angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) {  
217 - var self = this; 210 +// form.html控制器
  211 +angular.module('ScheduleApp').controller(
  212 + 'BusInfoManageFormCtrl',
  213 + [
  214 + 'BusInfoManageService',
  215 + '$stateParams',
  216 + '$state',
  217 + function(service, $stateParams, $state) {
  218 + var self = this;
  219 + var Cars = service.getQueryClass();
218 220
219 - // 报废日期 日期控件开关  
220 - self.scrapDateOpen = false;  
221 - self.scrapDate_open = function() {  
222 - self.scrapDateOpen = true;  
223 - }; 221 + // 报废日期 日期控件开关
  222 + self.scrapDateOpen = false;
  223 + self.scrapDate_open = function() {
  224 + self.scrapDateOpen = true;
  225 + };
224 226
225 - // 启用日期 日期控件开关  
226 - self.openDateOpen = false;  
227 - self.openDate_open = function() {  
228 - self.openDateOpen = true;  
229 - };  
230 - // 取消日期 日期控件开关  
231 - self.closeDateOpen = false;  
232 - self.closeDate_open = function() {  
233 - self.closeDateOpen = true;  
234 - }; 227 + // 启用日期 日期控件开关
  228 + self.openDateOpen = false;
  229 + self.openDate_open = function() {
  230 + self.openDateOpen = true;
  231 + };
  232 + // 取消日期 日期控件开关
  233 + self.closeDateOpen = false;
  234 + self.closeDate_open = function() {
  235 + self.closeDateOpen = true;
  236 + };
235 237
236 - // 欲保存的busInfo信息,绑定  
237 - self.busInfoForSave = {}; 238 + // 欲保存的busInfo信息,绑定
  239 + self.busInfoForSave = new Cars;
238 240
239 - // 获取传过来的id,有的话就是修改,获取一遍数据  
240 - var id = $stateParams.id;  
241 - if (id) {  
242 - self.busInfoForSave.id = id;  
243 - busInfoManageService.getDetail(id).then(  
244 - function(result) {  
245 - var key;  
246 - for (key in result) {  
247 - self.busInfoForSave[key] = result[key];  
248 - }  
249 - },  
250 - function(result) {  
251 - alert("出错啦!"); 241 + // 获取传过来的id,有的话就是修改,获取一遍数据
  242 + var id = $stateParams.id;
  243 + if (id) {
  244 + self.busInfoForSave = Cars.get({id: id}, function() {});
252 } 245 }
253 - );  
254 - }  
255 246
256 - // 提交方法  
257 - self.submit = function() {  
258 - console.log(self.busInfoForSave);  
259 - //if (self.busInfoForSave) {  
260 - // delete $stateParams.id;  
261 - //}  
262 - busInfoManageService.saveDetail(self.busInfoForSave).then(  
263 - function(result) {  
264 - // TODO:弹出框方式以后改  
265 - if (result.status == 'SUCCESS') {  
266 - alert("保存成功!"); 247 + // 提交方法
  248 + self.submit = function() {
  249 + console.log(self.busInfoForSave);
  250 + //if (self.busInfoForSave) {
  251 + // delete $stateParams.id;
  252 + //}
  253 + self.busInfoForSave.$save(function() {
267 $state.go("busInfoManage"); 254 $state.go("busInfoManage");
268 - } else {  
269 - alert("保存异常!");  
270 - }  
271 - },  
272 - function(result) {  
273 - // TODO:弹出框方式以后改  
274 - alert("出错啦!");  
275 - }  
276 - );  
277 - };  
278 -  
279 -}]); 255 + });
  256 + };
  257 + }
  258 + ]
  259 +);
280 260
281 -angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) {  
282 - var self = this;  
283 - self.title = "";  
284 - self.busInfoForDetail = {};  
285 - self.busInfoForDetail.id = $stateParams.id; 261 +// detail.html控制器
  262 +angular.module('ScheduleApp').controller(
  263 + 'BusInfoManageDetailCtrl',
  264 + [
  265 + 'BusInfoManageService',
  266 + '$stateParams',
  267 + function(service, $stateParams) {
  268 + var self = this;
  269 + var Cars = service.getQueryClass();
  270 + var id = $stateParams.id;
286 271
287 - // 当转向到此页面时,就获取明细信息并绑定  
288 - busInfoManageService.getDetail($stateParams.id).then(  
289 - function(result) {  
290 - var key;  
291 - for (key in result) {  
292 - self.busInfoForDetail[key] = result[key];  
293 - } 272 + self.title = "";
  273 + self.busInfoForDetail = {};
294 274
295 - self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";  
296 - },  
297 - function(result) {  
298 - // TODO:弹出框方式以后改  
299 - alert("出错啦!"); 275 + // 当转向到此页面时,就获取明细信息并绑定
  276 + self.busInfoForDetail = Cars.get({id: id}, function() {
  277 + self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";
  278 + });
300 } 279 }
301 - );  
302 -}]);  
303 \ No newline at end of file 280 \ No newline at end of file
  281 + ]
  282 +);
304 \ No newline at end of file 283 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/service.js 0 → 100644
  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 +}]);
0 \ No newline at end of file 84 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js 0 → 100644
  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 +}]);
0 \ No newline at end of file 25 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js 0 → 100644
  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/.gitkeep.txt 0 → 100644
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelect.js 0 → 100644
  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 +]);
0 \ No newline at end of file 45 \ No newline at end of file