Commit fc1c0faf61f86967a73e38e054af94dfbeeb5a85

Authored by zq
2 parents 252e46b9 42cdfcb4

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

Showing 64 changed files with 2610 additions and 1288 deletions

Too many changes to show.

To preserve performance only 64 of 91 files are displayed.

src/main/java/com/bsth/common/Constants.java
@@ -32,4 +32,5 @@ public class Constants { @@ -32,4 +32,5 @@ public class Constants {
32 public static final String UPSTREAM_URL = "/control/upstream"; 32 public static final String UPSTREAM_URL = "/control/upstream";
33 33
34 public static final String SESSION_USERNAME = "sessionUserName"; 34 public static final String SESSION_USERNAME = "sessionUserName";
  35 + public static final String COMPANY_AUTHORITYS = "cmyAuths";
35 } 36 }
src/main/java/com/bsth/controller/BaseController2.java
@@ -5,10 +5,13 @@ import com.bsth.common.ResponseCode; @@ -5,10 +5,13 @@ import com.bsth.common.ResponseCode;
5 import com.bsth.service.BaseService; 5 import com.bsth.service.BaseService;
6 import com.bsth.service.schedule.utils.DataImportExportService; 6 import com.bsth.service.schedule.utils.DataImportExportService;
7 import com.google.common.base.Splitter; 7 import com.google.common.base.Splitter;
  8 +import jxl.Sheet;
  9 +import jxl.Workbook;
8 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.data.domain.Page; 11 import org.springframework.data.domain.Page;
10 import org.springframework.data.domain.PageRequest; 12 import org.springframework.data.domain.PageRequest;
11 import org.springframework.data.domain.Sort; 13 import org.springframework.data.domain.Sort;
  14 +import org.springframework.util.CollectionUtils;
12 import org.springframework.web.bind.annotation.*; 15 import org.springframework.web.bind.annotation.*;
13 import org.springframework.web.multipart.MultipartFile; 16 import org.springframework.web.multipart.MultipartFile;
14 17
@@ -164,11 +167,24 @@ public class BaseController2<T, ID extends Serializable> { @@ -164,11 +167,24 @@ public class BaseController2<T, ID extends Serializable> {
164 */ 167 */
165 @RequestMapping(value = "/dataExport", method = RequestMethod.GET) 168 @RequestMapping(value = "/dataExport", method = RequestMethod.GET)
166 public void dataExport(HttpServletResponse response) throws Exception { 169 public void dataExport(HttpServletResponse response) throws Exception {
  170 + dataExport(response, null);
  171 + }
  172 +
  173 + @RequestMapping(value = "/dataExportExt", method = RequestMethod.GET)
  174 + public void dataExport(HttpServletResponse response, @RequestParam Map<String, Object> param) throws Exception {
167 // 1、使用ktr转换获取输出文件 175 // 1、使用ktr转换获取输出文件
168 File ktrfile = new File(this.getClass().getResource(getDataExportKtrClasspath()).toURI()); 176 File ktrfile = new File(this.getClass().getResource(getDataExportKtrClasspath()).toURI());
169 - File outputfile = dataImportExportService.fileDataOutput(  
170 - getDataExportFilename(),  
171 - ktrfile); 177 + File outputfile = null;
  178 + if (!CollectionUtils.isEmpty(param)) {
  179 + outputfile = dataImportExportService.fileDataOutput(
  180 + getDataExportFilename(),
  181 + ktrfile,
  182 + param);
  183 + } else {
  184 + outputfile = dataImportExportService.fileDataOutput(
  185 + getDataExportFilename(),
  186 + ktrfile);
  187 + }
172 188
173 System.out.println(outputfile.getName()); 189 System.out.println(outputfile.getName());
174 String filePath = outputfile.getAbsolutePath(); 190 String filePath = outputfile.getAbsolutePath();
@@ -225,4 +241,52 @@ public class BaseController2&lt;T, ID extends Serializable&gt; { @@ -225,4 +241,52 @@ public class BaseController2&lt;T, ID extends Serializable&gt; {
225 throw new RuntimeException("必须override,并指定ktr classpath"); 241 throw new RuntimeException("必须override,并指定ktr classpath");
226 } 242 }
227 243
  244 +
  245 + public static class ExcelFileOutput {
  246 + private String fileName;
  247 + private List<Map<String, Object>> sheetnames = new ArrayList<>();
  248 +
  249 + public String getFileName() {
  250 + return fileName;
  251 + }
  252 +
  253 + public void setFileName(String fileName) {
  254 + this.fileName = fileName;
  255 + }
  256 +
  257 + public List<Map<String, Object>> getSheetnames() {
  258 + return sheetnames;
  259 + }
  260 +
  261 + public void setSheetnames(List<Map<String, Object>> sheetnames) {
  262 + this.sheetnames = sheetnames;
  263 + }
  264 + }
  265 +
  266 + /**
  267 + * 上传Excel文件,返回文件全路径名,工作区名称列表。
  268 + * @param file
  269 + * @return
  270 + * @throws Exception
  271 + */
  272 + @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
  273 + public ExcelFileOutput fileUpload(MultipartFile file) throws Exception {
  274 + // 返回对象
  275 + ExcelFileOutput rs = new ExcelFileOutput();
  276 +
  277 + // 上传文件
  278 + File file1 = dataImportExportService.uploadFile(file);
  279 + // 获取文件的sheet
  280 + Workbook book = Workbook.getWorkbook(file1);
  281 + for (Sheet sheet : book.getSheets()) {
  282 + String sheetname = sheet.getName();
  283 + Map<String, Object> s = new HashMap<>();
  284 + s.put("name", sheetname);
  285 + rs.getSheetnames().add(s);
  286 + }
  287 +
  288 + rs.setFileName(file1.getAbsolutePath());
  289 + return rs;
  290 + }
  291 +
228 } 292 }
src/main/java/com/bsth/controller/CarsController.java
1 package com.bsth.controller; 1 package com.bsth.controller;
2 2
  3 +import com.bsth.common.ResponseCode;
3 import com.bsth.entity.Cars; 4 import com.bsth.entity.Cars;
  5 +import com.bsth.service.schedule.utils.DataImportExportService;
4 import com.bsth.service.schedule.utils.DataToolsProperties; 6 import com.bsth.service.schedule.utils.DataToolsProperties;
5 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.boot.context.properties.EnableConfigurationProperties; 8 import org.springframework.boot.context.properties.EnableConfigurationProperties;
7 -import org.springframework.web.bind.annotation.*; 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;
8 13
  14 +import java.io.File;
  15 +import java.util.HashMap;
9 import java.util.Map; 16 import java.util.Map;
10 17
11 /** 18 /**
@@ -14,24 +21,12 @@ import java.util.Map; @@ -14,24 +21,12 @@ import java.util.Map;
14 @RestController 21 @RestController
15 @RequestMapping("cars") 22 @RequestMapping("cars")
16 @EnableConfigurationProperties(DataToolsProperties.class) 23 @EnableConfigurationProperties(DataToolsProperties.class)
17 -public class CarsController extends BaseController<Cars, Integer> { 24 +public class CarsController extends BaseController2<Cars, Integer> {
18 25
19 @Autowired 26 @Autowired
20 private DataToolsProperties dataToolsProperties; 27 private DataToolsProperties dataToolsProperties;
21 -  
22 - /**  
23 - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody  
24 - * @Title: save  
25 - * @Description: TODO(持久化对象)  
26 - * @param @param t  
27 - * @param @return 设定文件  
28 - * @return Map<String,Object> {status: 1(成功),-1(失败)}  
29 - * @throws  
30 - */  
31 - @RequestMapping(method = RequestMethod.POST)  
32 - public Map<String, Object> save(@RequestBody Cars t){  
33 - return baseService.save(t);  
34 - } 28 + @Autowired
  29 + private DataImportExportService dataImportExportService;
35 30
36 /** 31 /**
37 * 验证。 32 * 验证。
@@ -44,6 +39,48 @@ public class CarsController extends BaseController&lt;Cars, Integer&gt; { @@ -44,6 +39,48 @@ public class CarsController extends BaseController&lt;Cars, Integer&gt; {
44 return baseService.validateEquale(map); 39 return baseService.validateEquale(map);
45 } 40 }
46 41
  42 + // uploadFile post
  43 +
  44 + // 验证excel sheet
  45 + @RequestMapping(value = "/validate/sheet", method = RequestMethod.GET)
  46 + public Map<String, Object> validateSheet() throws Exception {
  47 + Map<String, Object> rtn = new HashMap<>();
  48 +
  49 + // TODO:
  50 +
  51 + rtn.put("status", ResponseCode.SUCCESS);
  52 + return rtn;
  53 + }
  54 +
  55 + @RequestMapping(value = "/importfile", method = RequestMethod.POST)
  56 + public Map<String, Object> importData(
  57 + @RequestParam Map<String, Object> form)
  58 + throws Exception {
  59 + Map<String, Object> rtn = new HashMap<>();
  60 +
  61 + // TODO:
  62 + String filename = (String) form.get("filename");
  63 +
  64 +
  65 + try {
  66 + // 获取ktr转换文件绝对路径
  67 + File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI());
  68 + System.out.println(ktrfile.getAbsolutePath());
  69 + // 导入数据
  70 + dataImportExportService.fileDataImport(new File(filename), ktrfile);
  71 +
  72 + rtn.put("status", ResponseCode.SUCCESS);
  73 + rtn.put("msg", "导入成功");
  74 + } catch (Exception exp) {
  75 + exp.printStackTrace();
  76 + rtn.put("status", ResponseCode.ERROR);
  77 + rtn.put("msg", exp.getLocalizedMessage());
  78 + }
  79 +
  80 + return rtn;
  81 + }
  82 +
  83 +
47 @Override 84 @Override
48 protected String getDataImportKtrClasspath() { 85 protected String getDataImportKtrClasspath() {
49 return dataToolsProperties.getCarsDatainputktr(); 86 return dataToolsProperties.getCarsDatainputktr();
src/main/java/com/bsth/controller/forms/ExportController.java
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
13 import org.springframework.web.bind.annotation.RequestParam; 13 import org.springframework.web.bind.annotation.RequestParam;
14 import org.springframework.web.bind.annotation.RestController; 14 import org.springframework.web.bind.annotation.RestController;
15 15
  16 +import com.bsth.entity.mcy_forms.Changetochange;
16 import com.bsth.entity.mcy_forms.Linepasswengerflow; 17 import com.bsth.entity.mcy_forms.Linepasswengerflow;
17 import com.bsth.entity.mcy_forms.Operationservice; 18 import com.bsth.entity.mcy_forms.Operationservice;
18 import com.bsth.entity.mcy_forms.Shifday; 19 import com.bsth.entity.mcy_forms.Shifday;
@@ -274,7 +275,48 @@ public class ExportController { @@ -274,7 +275,48 @@ public class ExportController {
274 return resList; 275 return resList;
275 } 276 }
276 277
277 - 278 +
  279 + //换人换车情况日统计
  280 + @RequestMapping(value = "/changetochangeExport",method = RequestMethod.POST)
  281 + public List<Map<String, Object>> changetochangeExport(@RequestParam Map<String, Object> map){
  282 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  283 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  284 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  285 + ReportUtils ee = new ReportUtils();
  286 + List<Changetochange> changetochange = formsService.changetochange(map);
  287 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  288 + for(Changetochange l : changetochange){
  289 + Map<String, Object> m = new HashMap<String, Object>();
  290 + m.put("rq",l.getRq());
  291 + m.put("gs",l.getGs());
  292 + m.put("fgs",l.getFgs());
  293 + m.put("xl",l.getXl());
  294 + m.put("lp",l.getLp());
  295 + m.put("fssj",l.getFssj());
  296 + m.put("xgsj",l.getXgsj());
  297 + m.put("pcch",l.getPcch());
  298 + m.put("pcry",l.getPcry());
  299 + m.put("jhch",l.getJhch());
  300 + m.put("jhgh",l.getJhgh());
  301 + m.put("sjch",l.getSjch());
  302 + m.put("sjgh",l.getSjgh());
  303 + m.put("yy",l.getYy());
  304 + m.put("xgr",l.getXgr());
  305 + resList.add(m);
  306 + }
  307 +
  308 + try {
  309 + listI.add(resList.iterator());
  310 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  311 + ee.excelReplace(listI, new Object[] { map }, path+"mould\\changetochange.xls",
  312 + path+"export\\换人换车情况日统计" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  313 + } catch (Exception e) {
  314 + e.printStackTrace();
  315 + }
  316 + return resList;
  317 + }
  318 +
  319 +
278 320
279 321
280 322
src/main/java/com/bsth/controller/oil/YlbController.java
@@ -49,8 +49,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -49,8 +49,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
49 */ 49 */
50 @RequestMapping(value = "/obtain",method = RequestMethod.GET) 50 @RequestMapping(value = "/obtain",method = RequestMethod.GET)
51 public Map<String, Object> obtain(@RequestParam Map<String, Object> map){ 51 public Map<String, Object> obtain(@RequestParam Map<String, Object> map){
52 - String rq=map.get("rq").toString();  
53 - Map<String, Object> list=yblService.obtain(rq); 52 + Map<String, Object> list=yblService.obtain(map);
54 System.out.println(); 53 System.out.println();
55 return list; 54 return list;
56 } 55 }
src/main/java/com/bsth/controller/realcontrol/RealMapController.java 0 → 100644
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.service.realcontrol.RealMapService;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RequestParam;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * 线调 地图监控相关
  13 + * Created by panzhao on 2016/11/23.
  14 + */
  15 +@RestController
  16 +@RequestMapping("realMap")
  17 +public class RealMapController {
  18 +
  19 + @Autowired
  20 + RealMapService realMapService;
  21 +
  22 + /**
  23 + * 根据线路获取站点路由及空间数据
  24 + */
  25 + @RequestMapping(value = "/stationSpatialData")
  26 + public Map<String, Object> stationSpatialData(@RequestParam String idx){
  27 + return realMapService.stationSpatialData(idx);
  28 + }
  29 +}
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 package com.bsth.controller.realcontrol; 1 package com.bsth.controller.realcontrol;
2 2
3 -import java.io.UnsupportedEncodingException;  
4 -import java.net.URLDecoder;  
5 -import java.util.*;  
6 -  
7 -import org.apache.commons.lang3.StringEscapeUtils;  
8 -import org.drools.core.runtime.help.impl.XStreamJSon.JSonAbortWorkItemConverter;  
9 -import org.joda.time.format.DateTimeFormat;  
10 -import org.joda.time.format.DateTimeFormatter;  
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 -import org.springframework.web.bind.annotation.PathVariable;  
13 -import org.springframework.web.bind.annotation.RequestMapping;  
14 -import org.springframework.web.bind.annotation.RequestMethod;  
15 -import org.springframework.web.bind.annotation.RequestParam;  
16 -import org.springframework.web.bind.annotation.RestController;  
17 -  
18 -import com.alibaba.fastjson.JSON;  
19 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
20 import com.bsth.controller.BaseController; 4 import com.bsth.controller.BaseController;
21 import com.bsth.controller.realcontrol.dto.ChangePersonCar; 5 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
@@ -23,9 +7,14 @@ import com.bsth.controller.realcontrol.dto.DfsjChange; @@ -23,9 +7,14 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
23 import com.bsth.data.BasicData; 7 import com.bsth.data.BasicData;
24 import com.bsth.data.schedule.DayOfSchedule; 8 import com.bsth.data.schedule.DayOfSchedule;
25 import com.bsth.entity.realcontrol.ScheduleRealInfo; 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
26 -import com.bsth.security.util.SecurityUtils;  
27 import com.bsth.service.realcontrol.ScheduleRealInfoService; 10 import com.bsth.service.realcontrol.ScheduleRealInfoService;
28 -import com.google.common.base.Splitter; 11 +import org.apache.commons.lang3.StringEscapeUtils;
  12 +import org.joda.time.format.DateTimeFormat;
  13 +import org.joda.time.format.DateTimeFormatter;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.web.bind.annotation.*;
  16 +
  17 +import java.util.*;
29 18
30 @RestController 19 @RestController
31 @RequestMapping("/realSchedule") 20 @RequestMapping("/realSchedule")
src/main/java/com/bsth/controller/realcontrol/dto/StationSpatialData.java 0 → 100644
  1 +package com.bsth.controller.realcontrol.dto;
  2 +
  3 +/**
  4 + * Created by panzhao on 2016/11/23.
  5 + */
  6 +public class StationSpatialData {
  7 +
  8 + private String lineCode;
  9 +
  10 + private String stationName;
  11 +
  12 + private String stationCode;
  13 +
  14 + private String stationMark;
  15 +
  16 + private int directions;
  17 +
  18 + private Float distances;
  19 +
  20 + private Float toTime;
  21 +
  22 + private Integer versions;
  23 +
  24 + private Float gLonx;
  25 +
  26 + private Float gLaty;
  27 +
  28 + private Float radius;
  29 +
  30 + private String shapesType;
  31 +
  32 + private String gPolygonGrid;
  33 +
  34 + private Integer stationRouteCode;
  35 +
  36 + public String getLineCode() {
  37 + return lineCode;
  38 + }
  39 +
  40 + public void setLineCode(String lineCode) {
  41 + this.lineCode = lineCode;
  42 + }
  43 +
  44 + public String getStationName() {
  45 + return stationName;
  46 + }
  47 +
  48 + public void setStationName(String stationName) {
  49 + this.stationName = stationName;
  50 + }
  51 +
  52 + public String getStationCode() {
  53 + return stationCode;
  54 + }
  55 +
  56 + public void setStationCode(String stationCode) {
  57 + this.stationCode = stationCode;
  58 + }
  59 +
  60 + public String getStationMark() {
  61 + return stationMark;
  62 + }
  63 +
  64 + public void setStationMark(String stationMark) {
  65 + this.stationMark = stationMark;
  66 + }
  67 +
  68 + public int getDirections() {
  69 + return directions;
  70 + }
  71 +
  72 + public void setDirections(int directions) {
  73 + this.directions = directions;
  74 + }
  75 +
  76 + public Float getDistances() {
  77 + return distances;
  78 + }
  79 +
  80 + public void setDistances(Float distances) {
  81 + this.distances = distances;
  82 + }
  83 +
  84 + public Float getToTime() {
  85 + return toTime;
  86 + }
  87 +
  88 + public void setToTime(Float toTime) {
  89 + this.toTime = toTime;
  90 + }
  91 +
  92 + public Integer getVersions() {
  93 + return versions;
  94 + }
  95 +
  96 + public void setVersions(Integer versions) {
  97 + this.versions = versions;
  98 + }
  99 +
  100 + public Float getgLonx() {
  101 + return gLonx;
  102 + }
  103 +
  104 + public void setgLonx(Float gLonx) {
  105 + this.gLonx = gLonx;
  106 + }
  107 +
  108 + public Float getgLaty() {
  109 + return gLaty;
  110 + }
  111 +
  112 + public void setgLaty(Float gLaty) {
  113 + this.gLaty = gLaty;
  114 + }
  115 +
  116 + public Float getRadius() {
  117 + return radius;
  118 + }
  119 +
  120 + public void setRadius(Float radius) {
  121 + this.radius = radius;
  122 + }
  123 +
  124 + public String getShapesType() {
  125 + return shapesType;
  126 + }
  127 +
  128 + public void setShapesType(String shapesType) {
  129 + this.shapesType = shapesType;
  130 + }
  131 +
  132 + public String getgPolygonGrid() {
  133 + return gPolygonGrid;
  134 + }
  135 +
  136 + public void setgPolygonGrid(String gPolygonGrid) {
  137 + this.gPolygonGrid = gPolygonGrid;
  138 + }
  139 +
  140 + public Integer getStationRouteCode() {
  141 + return stationRouteCode;
  142 + }
  143 +
  144 + public void setStationRouteCode(Integer stationRouteCode) {
  145 + this.stationRouteCode = stationRouteCode;
  146 + }
  147 +}
src/main/java/com/bsth/controller/schedule/TTInfoDetailController.java
1 package com.bsth.controller.schedule; 1 package com.bsth.controller.schedule;
2 2
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
4 -import com.bsth.controller.BaseController; 4 +import com.bsth.controller.BaseController2;
5 import com.bsth.entity.CarPark; 5 import com.bsth.entity.CarPark;
6 import com.bsth.entity.LineInformation; 6 import com.bsth.entity.LineInformation;
7 import com.bsth.entity.StationRoute; 7 import com.bsth.entity.StationRoute;
@@ -38,7 +38,7 @@ import java.util.regex.Pattern; @@ -38,7 +38,7 @@ import java.util.regex.Pattern;
38 */ 38 */
39 @RestController 39 @RestController
40 @RequestMapping("tidc") 40 @RequestMapping("tidc")
41 -public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> { 41 +public class TTInfoDetailController extends BaseController2<TTInfoDetail, Long> {
42 @Autowired 42 @Autowired
43 private TTInfoDetailService ttInfoDetailService; 43 private TTInfoDetailService ttInfoDetailService;
44 @Autowired 44 @Autowired
@@ -56,53 +56,13 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; { @@ -56,53 +56,13 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
56 @Autowired 56 @Autowired
57 private DataToolsProperties dataToolsProperties; 57 private DataToolsProperties dataToolsProperties;
58 58
59 -  
60 - public static class ExcelFileOutput {  
61 - private String fileName;  
62 - private List<Map<String, Object>> sheetnames = new ArrayList<>();  
63 -  
64 - public String getFileName() {  
65 - return fileName;  
66 - }  
67 -  
68 - public void setFileName(String fileName) {  
69 - this.fileName = fileName;  
70 - }  
71 -  
72 - public List<Map<String, Object>> getSheetnames() {  
73 - return sheetnames;  
74 - }  
75 -  
76 - public void setSheetnames(List<Map<String, Object>> sheetnames) {  
77 - this.sheetnames = sheetnames;  
78 - }  
79 - }  
80 -  
81 /** 59 /**
82 * 1、上传Excel文件,返回文件全路径名,工作区名称列表。 60 * 1、上传Excel文件,返回文件全路径名,工作区名称列表。
83 * @param file 61 * @param file
84 * @return 62 * @return
85 * @throws Exception 63 * @throws Exception
86 */ 64 */
87 - @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)  
88 - public ExcelFileOutput fileUpload(MultipartFile file) throws Exception {  
89 - // 返回对象  
90 - ExcelFileOutput rs = new ExcelFileOutput();  
91 -  
92 - // 上传文件  
93 - File file1 = dataImportExportService.uploadFile(file);  
94 - // 获取文件的sheet  
95 - Workbook book = Workbook.getWorkbook(file1);  
96 - for (Sheet sheet : book.getSheets()) {  
97 - String sheetname = sheet.getName();  
98 - Map<String, Object> s = new HashMap<>();  
99 - s.put("name", sheetname);  
100 - rs.getSheetnames().add(s);  
101 - }  
102 65
103 - rs.setFileName(file1.getAbsolutePath());  
104 - return rs;  
105 - }  
106 66
107 /** 67 /**
108 * 2、验证sheet(以后放到规则引擎里去做)。 68 * 2、验证sheet(以后放到规则引擎里去做)。
@@ -441,21 +401,6 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; { @@ -441,21 +401,6 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
441 return ttInfoDetailService.getEditInfo(xlid, ttid); 401 return ttInfoDetailService.getEditInfo(xlid, ttid);
442 } 402 }
443 403
444 - /**  
445 - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody  
446 - * @Title: save  
447 - * @Description: TODO(持久化对象)  
448 - * @param @param t  
449 - * @param @return 设定文件  
450 - * @return Map<String,Object> {status: 1(成功),-1(失败)}  
451 - * @throws  
452 - */  
453 - @RequestMapping(method = RequestMethod.POST)  
454 - public Map<String, Object> save(@RequestBody TTInfoDetail t){  
455 -  
456 - return baseService.save(t);  
457 - }  
458 -  
459 @Override 404 @Override
460 public TTInfoDetail findById(@PathVariable("id") Long aLong) { 405 public TTInfoDetail findById(@PathVariable("id") Long aLong) {
461 return ttInfoDetailRepository.findOneExtend(aLong); 406 return ttInfoDetailRepository.findOneExtend(aLong);
src/main/java/com/bsth/controller/sys/CompanyAuthorityController.java 0 → 100644
  1 +package com.bsth.controller.sys;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.bsth.controller.BaseController;
  5 +import com.bsth.entity.sys.CompanyAuthority;
  6 +import com.bsth.service.sys.CompanyAuthorityService;
  7 +import org.apache.commons.lang3.StringEscapeUtils;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import java.util.List;
  14 +import java.util.Map;
  15 +
  16 +/**
  17 + * Created by panzhao on 2016/11/22.
  18 + */
  19 +@RestController
  20 +@RequestMapping("companyAuthority")
  21 +public class CompanyAuthorityController extends BaseController<CompanyAuthority, Integer>{
  22 +
  23 + @Autowired
  24 + CompanyAuthorityService companyAuthorityService;
  25 +
  26 + @RequestMapping(value = "save")
  27 + public Map<String, Object> save(@RequestParam Integer roleId, @RequestParam String authJsonStr){
  28 + authJsonStr = StringEscapeUtils.unescapeHtml4(authJsonStr);
  29 + System.out.println(authJsonStr);
  30 + List<CompanyAuthority> list = JSONArray.parseArray(authJsonStr, CompanyAuthority.class);
  31 + return companyAuthorityService.save(roleId, list);
  32 + }
  33 +}
src/main/java/com/bsth/controller/sys/UserController.java
1 package com.bsth.controller.sys; 1 package com.bsth.controller.sys;
2 2
3 -import java.util.HashMap;  
4 -import java.util.Map;  
5 -  
6 -import javax.servlet.http.HttpServletRequest;  
7 -import javax.servlet.http.HttpSession;  
8 - 3 +import com.bsth.common.Constants;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.controller.BaseController;
  6 +import com.bsth.controller.sys.dto.CompanyData;
  7 +import com.bsth.controller.sys.util.RSAUtils;
  8 +import com.bsth.entity.sys.CompanyAuthority;
  9 +import com.bsth.entity.sys.SysUser;
  10 +import com.bsth.security.util.SecurityUtils;
  11 +import com.bsth.service.sys.CompanyAuthorityService;
  12 +import com.bsth.service.sys.SysUserService;
  13 +import com.google.common.collect.ArrayListMultimap;
9 import org.apache.commons.lang3.StringUtils; 14 import org.apache.commons.lang3.StringUtils;
10 import org.slf4j.Logger; 15 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 16 import org.slf4j.LoggerFactory;
@@ -18,13 +23,9 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -18,13 +23,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
18 import org.springframework.web.bind.annotation.RequestParam; 23 import org.springframework.web.bind.annotation.RequestParam;
19 import org.springframework.web.bind.annotation.RestController; 24 import org.springframework.web.bind.annotation.RestController;
20 25
21 -import com.bsth.common.Constants;  
22 -import com.bsth.common.ResponseCode;  
23 -import com.bsth.controller.BaseController;  
24 -import com.bsth.controller.sys.util.RSAUtils;  
25 -import com.bsth.entity.sys.SysUser;  
26 -import com.bsth.security.util.SecurityUtils;  
27 -import com.bsth.service.sys.SysUserService; 26 +import javax.servlet.http.HttpServletRequest;
  27 +import javax.servlet.http.HttpSession;
  28 +import java.util.*;
28 29
29 @RestController 30 @RestController
30 @RequestMapping("user") 31 @RequestMapping("user")
@@ -34,6 +35,9 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -34,6 +35,9 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
34 35
35 @Autowired 36 @Autowired
36 SysUserService sysUserService; 37 SysUserService sysUserService;
  38 +
  39 + @Autowired
  40 + CompanyAuthorityService companyAuthorityService;
37 41
38 @RequestMapping(value = "/login/jCryptionKey") 42 @RequestMapping(value = "/login/jCryptionKey")
39 public Map<String, Object> jCryptionKey(HttpServletRequest request){ 43 public Map<String, Object> jCryptionKey(HttpServletRequest request){
@@ -97,7 +101,11 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -97,7 +101,11 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
97 SecurityUtils.login(user, request); 101 SecurityUtils.login(user, request);
98 //session里写入用户名,webSocket连接时标识身份用 102 //session里写入用户名,webSocket连接时标识身份用
99 session.setAttribute(Constants.SESSION_USERNAME, user.getUserName()); 103 session.setAttribute(Constants.SESSION_USERNAME, user.getUserName());
100 - 104 +
  105 + //获取公司权限数据
  106 + List<CompanyAuthority> cmyAuths=companyAuthorityService.findByUser(user);
  107 + session.setAttribute(Constants.COMPANY_AUTHORITYS, cmyAuths);
  108 +
101 captchaMap.remove(userName); 109 captchaMap.remove(userName);
102 rs.put("status", ResponseCode.SUCCESS); 110 rs.put("status", ResponseCode.SUCCESS);
103 } catch (Exception e) { 111 } catch (Exception e) {
@@ -106,6 +114,43 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -106,6 +114,43 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
106 } 114 }
107 return rs; 115 return rs;
108 } 116 }
  117 +
  118 + /**
  119 + * 返回当前用户的公司权限数据,用于构建页面级联下拉框
  120 + * @return
  121 + */
  122 + @RequestMapping("companyData")
  123 + public List<CompanyData> companyData(HttpServletRequest request){
  124 + List<CompanyData> rs = new ArrayList<>();
  125 + CompanyData companyData;
  126 +
  127 + ArrayListMultimap<String, CompanyAuthority> map = ArrayListMultimap.create();
  128 + List<CompanyAuthority> cmyAuths = (List<CompanyAuthority>) request.getSession().getAttribute(Constants.COMPANY_AUTHORITYS);
  129 +
  130 + for(CompanyAuthority cAuth : cmyAuths){
  131 + map.put(cAuth.getCompanyCode()+"_"+cAuth.getCompanyName(), cAuth);
  132 + }
  133 +
  134 + Set<String> keys = map.keySet();
  135 + String[] temps;
  136 + for(String k : keys){
  137 + temps = k.split("_");
  138 +
  139 + companyData = new CompanyData();
  140 + companyData.setCompanyCode(temps[0]);
  141 + companyData.setCompanyName(temps[1]);
  142 + companyData.setChildren(new ArrayList<CompanyData.ChildrenCompany>());
  143 +
  144 + cmyAuths = map.get(k);
  145 + for(CompanyAuthority c : cmyAuths){
  146 + companyData.getChildren().add(new CompanyData.ChildrenCompany(c.getSubCompanyCode(), c.getSubCompanyName()));
  147 + }
  148 +
  149 + rs.add(companyData);
  150 + }
  151 +
  152 + return rs;
  153 + }
109 154
110 @RequestMapping(value = "/login/captchaStatus") 155 @RequestMapping(value = "/login/captchaStatus")
111 public int captchaStatus(String userName){ 156 public int captchaStatus(String userName){
@@ -162,7 +207,7 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -162,7 +207,7 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
162 * @Description: TODO(修改密码) 207 * @Description: TODO(修改密码)
163 * @param oldPWD 208 * @param oldPWD
164 * 原始密码 209 * 原始密码
165 - * @param newwPWD 210 + * @param newPWD
166 * 新密码 211 * 新密码
167 * @param cnewPWD 212 * @param cnewPWD
168 * 确认新密码 213 * 确认新密码
src/main/java/com/bsth/controller/sys/dto/CompanyData.java 0 → 100644
  1 +package com.bsth.controller.sys.dto;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/11/22.
  7 + */
  8 +public class CompanyData {
  9 +
  10 + private String companyCode;
  11 +
  12 + private String companyName;
  13 +
  14 + private List<ChildrenCompany> children;
  15 +
  16 + public String getCompanyCode() {
  17 + return companyCode;
  18 + }
  19 +
  20 + public void setCompanyCode(String companyCode) {
  21 + this.companyCode = companyCode;
  22 + }
  23 +
  24 + public String getCompanyName() {
  25 + return companyName;
  26 + }
  27 +
  28 + public void setCompanyName(String companyName) {
  29 + this.companyName = companyName;
  30 + }
  31 +
  32 + public List<ChildrenCompany> getChildren() {
  33 + return children;
  34 + }
  35 +
  36 + public void setChildren(List<ChildrenCompany> children) {
  37 + this.children = children;
  38 + }
  39 +
  40 + public static class ChildrenCompany {
  41 + private String code;
  42 +
  43 + private String name;
  44 +
  45 + public ChildrenCompany(String code, String name){
  46 + this.code = code;
  47 + this.name = name;
  48 + }
  49 +
  50 + public String getName() {
  51 + return name;
  52 + }
  53 +
  54 + public void setName(String name) {
  55 + this.name = name;
  56 + }
  57 +
  58 + public String getCode() {
  59 + return code;
  60 + }
  61 +
  62 + public void setCode(String code) {
  63 + this.code = code;
  64 + }
  65 + }
  66 +}
src/main/java/com/bsth/data/BasicData.java
@@ -308,9 +308,9 @@ public class BasicData implements CommandLineRunner { @@ -308,9 +308,9 @@ public class BasicData implements CommandLineRunner {
308 if (StringUtils.isEmpty(jobCode)) 308 if (StringUtils.isEmpty(jobCode))
309 continue; 309 continue;
310 310
311 - if (jobCode.indexOf("-") != -1) { 311 + /*if (jobCode.indexOf("-") != -1) {
312 jobCode = jobCode.split("-")[1]; 312 jobCode = jobCode.split("-")[1];
313 - } 313 + }*/
314 if (p.getPosts() != null) { 314 if (p.getPosts() != null) {
315 if (p.getPosts().equals("1")) 315 if (p.getPosts().equals("1"))
316 jsyTempMap.put(jobCode, p); 316 jsyTempMap.put(jobCode, p);
src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
@@ -41,8 +41,8 @@ public class ArrivalData_GPS implements CommandLineRunner{ @@ -41,8 +41,8 @@ public class ArrivalData_GPS implements CommandLineRunner{
41 41
42 @Override 42 @Override
43 public void run(String... arg0) throws Exception { 43 public void run(String... arg0) throws Exception {
44 - logger.info("ArrivalData_GPS,30,10");  
45 - //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 40, 10, TimeUnit.SECONDS); 44 + logger.info("ArrivalData_GPS,30,06");
  45 + //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 40, 6, TimeUnit.SECONDS);
46 } 46 }
47 47
48 @Component 48 @Component
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
1 package com.bsth.data.gpsdata; 1 package com.bsth.data.gpsdata;
2 2
3 -import java.io.BufferedReader;  
4 -import java.io.InputStreamReader;  
5 -import java.util.*;  
6 -import java.util.concurrent.TimeUnit;  
7 - 3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.BasicData;
  6 +import com.bsth.data.forecast.ForecastRealServer;
  7 +import com.bsth.data.schedule.DayOfSchedule;
  8 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  9 +import com.bsth.util.ConfigUtil;
  10 +import com.google.common.collect.TreeMultimap;
8 import org.apache.commons.lang3.StringUtils; 11 import org.apache.commons.lang3.StringUtils;
9 import org.apache.http.HttpEntity; 12 import org.apache.http.HttpEntity;
10 import org.apache.http.client.methods.CloseableHttpResponse; 13 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -17,15 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -17,15 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.boot.CommandLineRunner; 20 import org.springframework.boot.CommandLineRunner;
18 import org.springframework.stereotype.Component; 21 import org.springframework.stereotype.Component;
19 22
20 -import com.alibaba.fastjson.JSON;  
21 -import com.alibaba.fastjson.JSONObject;  
22 -import com.bsth.Application;  
23 -import com.bsth.data.BasicData;  
24 -import com.bsth.data.forecast.ForecastRealServer;  
25 -import com.bsth.data.schedule.DayOfSchedule;  
26 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
27 -import com.bsth.util.ConfigUtil;  
28 -import com.google.common.collect.TreeMultimap; 23 +import java.io.BufferedReader;
  24 +import java.io.InputStreamReader;
  25 +import java.util.*;
29 26
30 /** 27 /**
31 * 28 *
@@ -68,7 +65,7 @@ public class GpsRealData implements CommandLineRunner{ @@ -68,7 +65,7 @@ public class GpsRealData implements CommandLineRunner{
68 @Override 65 @Override
69 public void run(String... arg0) throws Exception { 66 public void run(String... arg0) throws Exception {
70 logger.info("gpsDataLoader,20,6"); 67 logger.info("gpsDataLoader,20,6");
71 - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS); 68 + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
72 } 69 }
73 70
74 public GpsEntity add(GpsEntity gps) { 71 public GpsEntity add(GpsEntity gps) {
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
1 package com.bsth.data.schedule; 1 package com.bsth.data.schedule;
2 2
3 -import java.text.ParseException;  
4 -import java.text.SimpleDateFormat;  
5 -import java.util.ArrayList;  
6 -import java.util.Collection;  
7 -import java.util.Collections;  
8 -import java.util.HashMap;  
9 -import java.util.HashSet;  
10 -import java.util.Iterator;  
11 -import java.util.LinkedList;  
12 -import java.util.List;  
13 -import java.util.Map;  
14 -import java.util.Set;  
15 -import java.util.concurrent.TimeUnit;  
16 -  
17 -import com.bsth.data.schedule.thread.SubmitToTrafficManage;  
18 -import org.apache.commons.lang3.StringUtils;  
19 -import org.joda.time.DateTime;  
20 -import org.joda.time.format.DateTimeFormat;  
21 -import org.joda.time.format.DateTimeFormatter;  
22 -import org.slf4j.Logger;  
23 -import org.slf4j.LoggerFactory;  
24 -import org.springframework.beans.factory.annotation.Autowired;  
25 -import org.springframework.boot.CommandLineRunner;  
26 -import org.springframework.stereotype.Component;  
27 -  
28 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
29 import com.alibaba.fastjson.JSONArray; 4 import com.alibaba.fastjson.JSONArray;
30 import com.bsth.Application; 5 import com.bsth.Application;
@@ -34,6 +9,7 @@ import com.bsth.data.gpsdata.GpsRealData; @@ -34,6 +9,7 @@ import com.bsth.data.gpsdata.GpsRealData;
34 import com.bsth.data.schedule.thread.ScheduleLateThread; 9 import com.bsth.data.schedule.thread.ScheduleLateThread;
35 import com.bsth.data.schedule.thread.SchedulePstThread; 10 import com.bsth.data.schedule.thread.SchedulePstThread;
36 import com.bsth.data.schedule.thread.ScheduleRefreshThread; 11 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
  12 +import com.bsth.data.schedule.thread.SubmitToTrafficManage;
37 import com.bsth.entity.realcontrol.LineConfig; 13 import com.bsth.entity.realcontrol.LineConfig;
38 import com.bsth.entity.realcontrol.ScheduleRealInfo; 14 import com.bsth.entity.realcontrol.ScheduleRealInfo;
39 import com.bsth.entity.schedule.SchedulePlanInfo; 15 import com.bsth.entity.schedule.SchedulePlanInfo;
@@ -44,6 +20,19 @@ import com.bsth.util.DateUtils; @@ -44,6 +20,19 @@ import com.bsth.util.DateUtils;
44 import com.bsth.websocket.handler.SendUtils; 20 import com.bsth.websocket.handler.SendUtils;
45 import com.google.common.collect.ArrayListMultimap; 21 import com.google.common.collect.ArrayListMultimap;
46 import com.google.common.collect.TreeMultimap; 22 import com.google.common.collect.TreeMultimap;
  23 +import org.apache.commons.lang3.StringUtils;
  24 +import org.joda.time.format.DateTimeFormat;
  25 +import org.joda.time.format.DateTimeFormatter;
  26 +import org.slf4j.Logger;
  27 +import org.slf4j.LoggerFactory;
  28 +import org.springframework.beans.factory.annotation.Autowired;
  29 +import org.springframework.boot.CommandLineRunner;
  30 +import org.springframework.stereotype.Component;
  31 +
  32 +import java.text.ParseException;
  33 +import java.text.SimpleDateFormat;
  34 +import java.util.*;
  35 +import java.util.concurrent.TimeUnit;
47 36
48 /** 37 /**
49 * 38 *
src/main/java/com/bsth/data/schedule/thread/SchedulePstThread.java
1 package com.bsth.data.schedule.thread; 1 package com.bsth.data.schedule.thread;
2 2
3 -import java.util.LinkedList;  
4 -  
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.stereotype.Component;  
7 -  
8 import com.bsth.data.schedule.DayOfSchedule; 3 import com.bsth.data.schedule.DayOfSchedule;
9 import com.bsth.entity.realcontrol.ScheduleRealInfo; 4 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 5 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.orm.jpa.JpaObjectRetrievalFailureException;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import javax.persistence.EntityNotFoundException;
  13 +import java.util.LinkedList;
11 14
12 /** 15 /**
13 - *  
14 - * @ClassName: SchedulePstThread  
15 - * @Description: TODO(班次异步持久化)  
16 - * @author PanZhao  
17 - * @date 2016年8月24日 上午1:47:05  
18 - * 16 + * @author PanZhao
  17 + * @ClassName: SchedulePstThread
  18 + * @Description: TODO(班次异步持久化)
  19 + * @date 2016年8月24日 上午1:47:05
19 */ 20 */
20 @Component 21 @Component
21 -public class SchedulePstThread extends Thread{  
22 -  
23 - @Autowired  
24 - ScheduleRealInfoRepository scheduleRepository;  
25 -  
26 - @Override  
27 - public void run() {  
28 - LinkedList<ScheduleRealInfo> list = DayOfSchedule.pstBuffer;  
29 -  
30 - ScheduleRealInfo schedule;  
31 - for (int i = 0; i < 1000; i++) {  
32 - schedule = list.poll();  
33 - if (null == schedule)  
34 - break;  
35 -  
36 - scheduleRepository.save(schedule);  
37 - }  
38 - } 22 +public class SchedulePstThread extends Thread {
  23 +
  24 + @Autowired
  25 + ScheduleRealInfoRepository scheduleRepository;
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Override
  30 + public void run() {
  31 +
  32 + LinkedList<ScheduleRealInfo> list = DayOfSchedule.pstBuffer;
  33 +
  34 + ScheduleRealInfo schedule;
  35 + for (int i = 0; i < 1000; i++) {
  36 + schedule = list.poll();
  37 + if (null == schedule)
  38 + break;
  39 +
  40 + try {
  41 + scheduleRepository.save(schedule);
  42 + }
  43 + catch (JpaObjectRetrievalFailureException e1){
  44 + logger.error("JpaObjectRetrievalFailureException error.... 可忽略");
  45 + }
  46 + catch(EntityNotFoundException e2){
  47 + logger.error("EntityNotFoundException error.... 可忽略");
  48 + }
  49 + catch (Exception e) {
  50 + logger.error("", e);
  51 + }
  52 + }
  53 + }
39 } 54 }
src/main/java/com/bsth/entity/mcy_forms/Changetochange.java
1 package com.bsth.entity.mcy_forms; 1 package com.bsth.entity.mcy_forms;
2 2
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_chtoch")
3 public class Changetochange { 12 public class Changetochange {
  13 + @Id
  14 + @GeneratedValue
  15 + private Integer id;
  16 +
  17 + private String rq;//日期
  18 +
  19 + private String gs;//公司
  20 +
  21 + private String fgs;//分公司
  22 +
  23 + private String xl;//线路
  24 +
  25 + private String lp;//路牌
  26 +
  27 + private String fssj;//发生时间
  28 +
  29 + private String xgsj;//修改时间
  30 +
  31 + private String pcch;//配车车号
  32 +
  33 + private String pcry;//配车人员
  34 +
  35 + private String jhch;//计划车号
  36 +
  37 + private String jhgh;//计划工号
  38 +
  39 + private String sjch;//实际车号
  40 +
  41 + private String sjgh;//实际工号
  42 +
  43 + private String yy;//原因
  44 +
  45 + private String xgr;//修改人
  46 +
  47 +
  48 + public Integer getId() {
  49 + return id;
  50 + }
  51 +
  52 + public void setId(Integer id) {
  53 + this.id = id;
  54 + }
  55 +
  56 + public String getRq() {
  57 + return rq;
  58 + }
  59 +
  60 + public void setRq(String rq) {
  61 + this.rq = rq;
  62 + }
  63 +
  64 + public String getGs() {
  65 + return gs;
  66 + }
  67 +
  68 + public void setGs(String gs) {
  69 + this.gs = gs;
  70 + }
  71 +
  72 + public String getFgs() {
  73 + return fgs;
  74 + }
  75 +
  76 + public void setFgs(String fgs) {
  77 + this.fgs = fgs;
  78 + }
  79 +
  80 + public String getXl() {
  81 + return xl;
  82 + }
  83 +
  84 + public void setXl(String xl) {
  85 + this.xl = xl;
  86 + }
  87 +
  88 + public String getLp() {
  89 + return lp;
  90 + }
  91 +
  92 + public void setLp(String lp) {
  93 + this.lp = lp;
  94 + }
  95 +
  96 + public String getFssj() {
  97 + return fssj;
  98 + }
  99 +
  100 + public void setFssj(String fssj) {
  101 + this.fssj = fssj;
  102 + }
  103 +
  104 + public String getXgsj() {
  105 + return xgsj;
  106 + }
  107 +
  108 + public void setXgsj(String xgsj) {
  109 + this.xgsj = xgsj;
  110 + }
  111 +
  112 + public String getPcch() {
  113 + return pcch;
  114 + }
  115 +
  116 + public void setPcch(String pcch) {
  117 + this.pcch = pcch;
  118 + }
  119 +
  120 + public String getPcry() {
  121 + return pcry;
  122 + }
  123 +
  124 + public void setPcry(String pcry) {
  125 + this.pcry = pcry;
  126 + }
  127 +
  128 +
  129 + public String getJhch() {
  130 + return jhch;
  131 + }
  132 +
  133 + public void setJhch(String jhch) {
  134 + this.jhch = jhch;
  135 + }
  136 +
  137 + public String getJhgh() {
  138 + return jhgh;
  139 + }
  140 +
  141 + public void setJhgh(String jhgh) {
  142 + this.jhgh = jhgh;
  143 + }
  144 +
  145 + public String getSjch() {
  146 + return sjch;
  147 + }
  148 +
  149 + public void setSjch(String sjch) {
  150 + this.sjch = sjch;
  151 + }
  152 +
  153 + public String getSjgh() {
  154 + return sjgh;
  155 + }
  156 +
  157 + public void setSjgh(String sjgh) {
  158 + this.sjgh = sjgh;
  159 + }
  160 +
  161 + public String getYy() {
  162 + return yy;
  163 + }
  164 +
  165 + public void setYy(String yy) {
  166 + this.yy = yy;
  167 + }
  168 +
  169 + public String getXgr() {
  170 + return xgr;
  171 + }
  172 +
  173 + public void setXgr(String xgr) {
  174 + this.xgr = xgr;
  175 + }
  176 +
4 177
5 178
6 } 179 }
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -2,13 +2,11 @@ package com.bsth.entity.realcontrol; @@ -2,13 +2,11 @@ package com.bsth.entity.realcontrol;
2 2
3 import com.bsth.entity.sys.SysUser; 3 import com.bsth.entity.sys.SysUser;
4 import com.fasterxml.jackson.annotation.JsonIgnore; 4 import com.fasterxml.jackson.annotation.JsonIgnore;
5 -  
6 -import javax.persistence.*;  
7 -  
8 import org.apache.commons.lang3.StringUtils; 5 import org.apache.commons.lang3.StringUtils;
9 import org.joda.time.format.DateTimeFormat; 6 import org.joda.time.format.DateTimeFormat;
10 import org.joda.time.format.DateTimeFormatter; 7 import org.joda.time.format.DateTimeFormatter;
11 8
  9 +import javax.persistence.*;
12 import java.util.Date; 10 import java.util.Date;
13 import java.util.HashSet; 11 import java.util.HashSet;
14 import java.util.Set; 12 import java.util.Set;
@@ -49,11 +47,6 @@ public class ScheduleRealInfo { @@ -49,11 +47,6 @@ public class ScheduleRealInfo {
49 47
50 /** 车辆自编号 */ 48 /** 车辆自编号 */
51 private String clZbh; 49 private String clZbh;
52 -  
53 - /** 报道时间(格式 HH:mm)  
54 - private String bdTime; */  
55 - /** 出场时间(格式 HH:mm)  
56 - private String ccTime;*/  
57 50
58 /** 驾驶员工号 */ 51 /** 驾驶员工号 */
59 private String jGh; 52 private String jGh;
@@ -143,15 +136,6 @@ public class ScheduleRealInfo { @@ -143,15 +136,6 @@ public class ScheduleRealInfo {
143 @Transient 136 @Transient
144 private boolean late; 137 private boolean late;
145 138
146 - /**实际里程*/  
147 - private Float realMileage;  
148 -  
149 - /** 增加公里 */  
150 - private Float addMileage;  
151 -  
152 - /** 抽减公里 */  
153 - private Float remMileage;  
154 -  
155 /** 备注*/ 139 /** 备注*/
156 private String remarks; 140 private String remarks;
157 141
@@ -169,16 +153,126 @@ public class ScheduleRealInfo { @@ -169,16 +153,126 @@ public class ScheduleRealInfo {
169 private Integer opDirectiveState; 153 private Integer opDirectiveState;
170 154
171 /** 起点站计划到达时间 */ 155 /** 起点站计划到达时间 */
  156 + @Transient
172 private String qdzArrDatejh; 157 private String qdzArrDatejh;
173 - 158 +
174 /** 起点站实际到达时间 */ 159 /** 起点站实际到达时间 */
  160 + @Transient
175 private String qdzArrDatesj; 161 private String qdzArrDatesj;
176 - 162 +
177 /** 子任务 */ 163 /** 子任务 */
178 @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/) 164 @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/)
179 private Set<ChildTaskPlan> cTasks = new HashSet<>(); 165 private Set<ChildTaskPlan> cTasks = new HashSet<>();
180 -  
181 - /** ---------------- 166 +
  167 + /** 关联的公司名称 */
  168 + private String gsName;
  169 + /** 关联的公司编码 */
  170 + private String gsBm;
  171 + /** 关联的分公司名称 */
  172 + private String fgsName;
  173 + /** 关联的分公司编码 */
  174 + private String fgsBm;
  175 + /** 出场顺序号 */
  176 + private Integer ccno;
  177 +
  178 + //待发调试(是否自动调整)
  179 + private boolean dfAuto;
  180 + //是否有GPS信号
  181 + private boolean online;
  182 +
  183 + public boolean isDfAuto() {
  184 + return dfAuto;
  185 + }
  186 +
  187 + public void setDfAuto(boolean dfAuto) {
  188 + this.dfAuto = dfAuto;
  189 + }
  190 +
  191 + public boolean isOnline() {
  192 + return online;
  193 + }
  194 +
  195 + public void setOnline(boolean online) {
  196 + this.online = online;
  197 + }
  198 +
  199 + public String getQdzArrDatejh() {
  200 + return qdzArrDatejh;
  201 + }
  202 +
  203 + public void setQdzArrDatejh(String qdzArrDatejh) {
  204 + this.qdzArrDatejh = qdzArrDatejh;
  205 + }
  206 +
  207 + public String getQdzArrDatesj() {
  208 + return qdzArrDatesj;
  209 + }
  210 +
  211 + public void setQdzArrDatesj(String qdzArrDatesj) {
  212 + this.qdzArrDatesj = qdzArrDatesj;
  213 + }
  214 +
  215 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  216 + this.cTasks = cTasks;
  217 + }
  218 +
  219 + public String getGsName() {
  220 + return gsName;
  221 + }
  222 +
  223 + public void setGsName(String gsName) {
  224 + this.gsName = gsName;
  225 + }
  226 +
  227 + public String getGsBm() {
  228 + return gsBm;
  229 + }
  230 +
  231 + public void setGsBm(String gsBm) {
  232 + this.gsBm = gsBm;
  233 + }
  234 +
  235 + public String getFgsName() {
  236 + return fgsName;
  237 + }
  238 +
  239 + public void setFgsName(String fgsName) {
  240 + this.fgsName = fgsName;
  241 + }
  242 +
  243 + public String getFgsBm() {
  244 + return fgsBm;
  245 + }
  246 +
  247 + public void setFgsBm(String fgsBm) {
  248 + this.fgsBm = fgsBm;
  249 + }
  250 +
  251 + public Integer getCcno() {
  252 + return ccno;
  253 + }
  254 +
  255 + public void setCcno(Integer ccno) {
  256 + this.ccno = ccno;
  257 + }
  258 +
  259 + public static DateTimeFormatter getFmtHHmm() {
  260 + return fmtHHmm;
  261 + }
  262 +
  263 + public static void setFmtHHmm(DateTimeFormatter fmtHHmm) {
  264 + ScheduleRealInfo.fmtHHmm = fmtHHmm;
  265 + }
  266 +
  267 + public static DateTimeFormatter getFmtyyyyMMddHHmm() {
  268 + return fmtyyyyMMddHHmm;
  269 + }
  270 +
  271 + public static void setFmtyyyyMMddHHmm(DateTimeFormatter fmtyyyyMMddHHmm) {
  272 + ScheduleRealInfo.fmtyyyyMMddHHmm = fmtyyyyMMddHHmm;
  273 + }
  274 +
  275 + /** ----------------
182 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) 276 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
183 private RealTimeModel sjfcModel; 277 private RealTimeModel sjfcModel;
184 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) 278 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@@ -460,30 +554,6 @@ public class ScheduleRealInfo { @@ -460,30 +554,6 @@ public class ScheduleRealInfo {
460 this.status = status; 554 this.status = status;
461 } 555 }
462 556
463 - public Float getRealMileage() {  
464 - return realMileage;  
465 - }  
466 -  
467 - public void setRealMileage(Float realMileage) {  
468 - this.realMileage = realMileage;  
469 - }  
470 -  
471 - public Float getAddMileage() {  
472 - return addMileage;  
473 - }  
474 -  
475 - public void setAddMileage(Float addMileage) {  
476 - this.addMileage = addMileage;  
477 - }  
478 -  
479 - public Float getRemMileage() {  
480 - return remMileage;  
481 - }  
482 -  
483 - public void setRemMileage(Float remMileage) {  
484 - this.remMileage = remMileage;  
485 - }  
486 -  
487 public String getRemarks() { 557 public String getRemarks() {
488 return remarks; 558 return remarks;
489 } 559 }
src/main/java/com/bsth/entity/sys/CompanyAuthority.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/11/22.
  7 + */
  8 +@Entity
  9 +@Table(name = "bsth_c_sys_company_auth")
  10 +public class CompanyAuthority {
  11 +
  12 + @Id
  13 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  14 + private Integer id;
  15 +
  16 + /** 公司代码 */
  17 + private String companyCode;
  18 +
  19 + /** 公司名称 */
  20 + private String companyName;
  21 +
  22 + /** 分公司代码 */
  23 + private String subCompanyCode;
  24 +
  25 + /** 分公司代码 */
  26 + private String subCompanyName;
  27 +
  28 + private Integer roleId;
  29 +
  30 + public String getSubCompanyName() {
  31 + return subCompanyName;
  32 + }
  33 +
  34 + public void setSubCompanyName(String subCompanyName) {
  35 + this.subCompanyName = subCompanyName;
  36 + }
  37 +
  38 + public String getSubCompanyCode() {
  39 + return subCompanyCode;
  40 + }
  41 +
  42 + public void setSubCompanyCode(String subCompanyCode) {
  43 + this.subCompanyCode = subCompanyCode;
  44 + }
  45 +
  46 + public String getCompanyName() {
  47 + return companyName;
  48 + }
  49 +
  50 + public void setCompanyName(String companyName) {
  51 + this.companyName = companyName;
  52 + }
  53 +
  54 + public String getCompanyCode() {
  55 + return companyCode;
  56 + }
  57 +
  58 + public void setCompanyCode(String companyCode) {
  59 + this.companyCode = companyCode;
  60 + }
  61 +
  62 + public Integer getId() {
  63 + return id;
  64 + }
  65 +
  66 + public void setId(Integer id) {
  67 + this.id = id;
  68 + }
  69 +
  70 + public Integer getRoleId() {
  71 + return roleId;
  72 + }
  73 +
  74 + public void setRoleId(Integer roleId) {
  75 + this.roleId = roleId;
  76 + }
  77 +}
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -29,22 +29,23 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -29,22 +29,23 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
29 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs") 29 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs")
30 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName); 30 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName);
31 31
  32 + //把sum(addMileage) 替换为0 数据表去掉了 add_mileage 字段
32 @Query(value="select new map(clZbh as clZbh,jGh as jGh,jName as jName,sum(jhlc) as zgl," 33 @Query(value="select new map(clZbh as clZbh,jGh as jGh,jName as jName,sum(jhlc) as zgl,"
33 - + "sum(addMileage) as ksgl,count(jName) as bcs) from ScheduleRealInfo s where" 34 + + " 0 as ksgl,count(jName) as bcs) from ScheduleRealInfo s where"
34 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName") 35 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName")
35 List<Map<String, Object>> dailyInfo(String line,String date); 36 List<Map<String, Object>> dailyInfo(String line,String date);
36 37
37 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp," 38 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp,"
38 + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 " 39 + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 "
39 + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " 40 + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND "
40 - + "r.schedule_date like %?2% and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true) 41 + + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true)
41 List<Object[]> historyMessage(String line,String date,String code); 42 List<Object[]> historyMessage(String line,String date,String code);
42 43
43 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " 44 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs "
44 + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d " 45 + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d "
45 + " ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " 46 + " ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND "
46 - + " r.schedule_date like %?2% and r.cl_zbh like %?3% group by "  
47 - + " lp_name,xl_name,cl_zbh order by d.timestamp",nativeQuery=true) 47 + + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% group by "
  48 + + " lp_name,xl_name,cl_zbh",nativeQuery=true)
48 List<Object[]> historyMessageCount(String line,String date,String code); 49 List<Object[]> historyMessageCount(String line,String date,String code);
49 50
50 @Query(value = "select max(id) from ScheduleRealInfo") 51 @Query(value = "select max(id) from ScheduleRealInfo")
@@ -100,10 +101,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -100,10 +101,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
100 void deleteByLineCodeAndDate(String xlBm, String schDate); 101 void deleteByLineCodeAndDate(String xlBm, String schDate);
101 102
102 //去掉了 xlBm is not null 103 //去掉了 xlBm is not null
103 - @Query(value="select s from ScheduleRealInfo s where (s.xlBm = ?1 or s.xlBm is not null) and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2") 104 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2")
104 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); 105 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date);
105 106
106 - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where (s.xlBm = ?1 or s.xlBm is not null) and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh") 107 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh")
107 List<Map<String,Object>> yesterdayDataList(String line,String date); 108 List<Map<String,Object>> yesterdayDataList(String line,String date);
108 109
109 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") 110 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
src/main/java/com/bsth/repository/sys/CompanyAuthorityRepository.java 0 → 100644
  1 +package com.bsth.repository.sys;
  2 +
  3 +import com.bsth.entity.sys.CompanyAuthority;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.data.jpa.repository.Modifying;
  6 +import org.springframework.data.jpa.repository.Query;
  7 +import org.springframework.stereotype.Repository;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * Created by panzhao on 2016/11/22.
  13 + */
  14 +@Repository
  15 +public interface CompanyAuthorityRepository extends BaseRepository<CompanyAuthority, Integer>{
  16 +
  17 + @Modifying
  18 + @Query(value="DELETE FROM CompanyAuthority WHERE roleId = ?1")
  19 + void deleteByRoleId(Integer roleId);
  20 +
  21 + @Query(value = "select ca from CompanyAuthority ca where ca.roleId in ?1")
  22 + List<CompanyAuthority> findByRoles(List<Integer> idx);
  23 +}
src/main/java/com/bsth/repository/sys/ModuleRepository.java
1 package com.bsth.repository.sys; 1 package com.bsth.repository.sys;
2 2
3 -import java.util.List;  
4 -import java.util.Set;  
5 - 3 +import com.bsth.entity.sys.Module;
  4 +import com.bsth.repository.BaseRepository;
6 import org.springframework.data.jpa.domain.Specification; 5 import org.springframework.data.jpa.domain.Specification;
7 -import org.springframework.data.jpa.repository.EntityGraph;  
8 import org.springframework.data.jpa.repository.Query; 6 import org.springframework.data.jpa.repository.Query;
9 import org.springframework.stereotype.Repository; 7 import org.springframework.stereotype.Repository;
10 8
11 -import com.bsth.entity.sys.Module;  
12 -import com.bsth.repository.BaseRepository; 9 +import java.util.List;
  10 +import java.util.Set;
13 11
14 @Repository 12 @Repository
15 -public interface ModuleRepository extends BaseRepository<Module, Integer>{  
16 -  
17 - @Query("select m from Module m where m.groupType in ?1")  
18 - List<Module> findByGroupType(String[] groupType);  
19 -  
20 - List<Module> findByPId(Integer pId);  
21 -  
22 - @Query("select m from Module m where m.id in ?1")  
23 - Set<Module> findByIds(List<Integer> ids);  
24 -  
25 - @Override  
26 - List<Module> findAll(Specification<Module> spec); 13 +public interface ModuleRepository extends BaseRepository<Module, Integer> {
  14 +
  15 + @Query("select m from Module m where m.groupType in ?1")
  16 + List<Module> findByGroupType(String[] groupType);
  17 +
  18 + List<Module> findByPId(Integer pId);
  19 +
  20 + @Query("select m from Module m where m.id in ?1")
  21 + Set<Module> findByIds(List<Integer> ids);
  22 +
  23 + @Override
  24 + List<Module> findAll(Specification<Module> spec);
  25 +
27 } 26 }
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -3,8 +3,10 @@ package com.bsth.service.forms.impl; @@ -3,8 +3,10 @@ package com.bsth.service.forms.impl;
3 import java.sql.ResultSet; 3 import java.sql.ResultSet;
4 import java.sql.SQLException; 4 import java.sql.SQLException;
5 import java.text.DecimalFormat; 5 import java.text.DecimalFormat;
  6 +import java.text.ParseException;
6 import java.text.SimpleDateFormat; 7 import java.text.SimpleDateFormat;
7 import java.util.ArrayList; 8 import java.util.ArrayList;
  9 +import java.util.Date;
8 import java.util.HashMap; 10 import java.util.HashMap;
9 import java.util.Iterator; 11 import java.util.Iterator;
10 import java.util.List; 12 import java.util.List;
@@ -226,11 +228,66 @@ public class FormsServiceImpl implements FormsService{ @@ -226,11 +228,66 @@ public class FormsServiceImpl implements FormsService{
226 } 228 }
227 229
228 //换人换车情况日统计 230 //换人换车情况日统计
229 - @Override  
230 - public List<Changetochange> changetochange(Map<String, Object> map) {  
231 -  
232 - return null;  
233 - } 231 + String rq;
  232 + @Override
  233 + public List<Changetochange> changetochange(Map<String, Object> map) {
  234 +
  235 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd") ;
  236 + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日") ;
  237 + Date d = null ;
  238 + Date d1 = null ;
  239 + try {
  240 + d = sdf.parse(map.get("startDate").toString());
  241 + d1 = sdf.parse(map.get("endDate").toString());
  242 + } catch (ParseException e) {
  243 +
  244 + e.printStackTrace();
  245 + }
  246 + String rq2=sdf1.format(d);
  247 + String rq3=sdf1.format(d1);
  248 +
  249 + rq=rq2+"-"+ rq3;
  250 +
  251 + String sql=" select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 ";
  252 + if(!map.get("startDate").toString().equals(" ")&&!map.get("endDate").toString().equals(" ")){
  253 + sql+= "and DATE_FORMAT( c.rq,'%Y-%m-%d') BETWEEN '"+map.get("startDate").toString()+"' and '"+map.get("endDate").toString()+"'";
  254 + }
  255 + if(!map.get("line").equals("")){
  256 + sql+="and line_code='"+map.get("line")+"'";
  257 + }
  258 + if(map.get("sel").equals("2")){
  259 + sql+=" and c.pcch!=c.pcry";
  260 + }else if(map.get("sel").equals("1")){
  261 + sql+=" and c.jhgh!=c.sjgh";
  262 + }
  263 +
  264 +
  265 + List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() {
  266 +
  267 + @Override
  268 + public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
  269 + Changetochange chan= new Changetochange();
  270 +
  271 + chan.setRq(rq);
  272 + chan.setGs(arg0.getString("gs").toString());
  273 + chan.setFgs(arg0.getString("fgs").toString());
  274 + chan.setXl(arg0.getString("xl").toString());
  275 + chan.setLp(arg0.getString("lp").toString());
  276 + chan.setFssj(arg0.getString("fssj").toString());
  277 + chan.setXgsj(arg0.getString("xgsj").toString());
  278 + chan.setPcch(arg0.getString("pcch").toString());
  279 + chan.setPcry(arg0.getString("pcry").toString());
  280 + chan.setJhch(arg0.getString("jhch").toString());
  281 + chan.setJhgh(arg0.getString("jhgh").toString());
  282 + chan.setSjch(arg0.getString("sjch").toString());
  283 + chan.setSjgh(arg0.getString("sjgh").toString());
  284 + chan.setYy(arg0.getString("yy").toString());
  285 + chan.setXgr(arg0.getString("xgr").toString());
  286 + return chan;
  287 + }
  288 + });
  289 + return list;
  290 + }
234 291
235 292
236 //路单数据 293 //路单数据
src/main/java/com/bsth/service/oil/YlbService.java
@@ -7,7 +7,7 @@ import com.bsth.entity.oil.Ylb; @@ -7,7 +7,7 @@ import com.bsth.entity.oil.Ylb;
7 import com.bsth.service.BaseService; 7 import com.bsth.service.BaseService;
8 8
9 public interface YlbService extends BaseService<Ylb, Integer>{ 9 public interface YlbService extends BaseService<Ylb, Integer>{
10 - Map<String, Object> obtain(String rq); 10 + Map<String, Object> obtain(Map<String, Object> map);
11 String obtainDsq(); 11 String obtainDsq();
12 Map<String, Object> sort(Map<String, Object> map); 12 Map<String, Object> sort(Map<String, Object> map);
13 13
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -85,7 +85,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -85,7 +85,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
85 //前一天所有车辆最后进场班次信息 85 //前一天所有车辆最后进场班次信息
86 List<Ylb> ylListBe=repository.obtainYlbefore(rq); 86 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
87 //从排班表中计算出行驶的总里程 87 //从排班表中计算出行驶的总里程
88 - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("1024",rq); 88 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq);
89 89
90 for(int x=0;x<listpb.size();x++){ 90 for(int x=0;x<listpb.size();x++){
91 91
@@ -151,7 +151,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -151,7 +151,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
151 */ 151 */
152 @Transactional 152 @Transactional
153 @Override 153 @Override
154 - public Map<String, Object> obtain(String rq) { 154 + public Map<String, Object> obtain(Map<String, Object> map2) {
  155 + String rq=map2.get("rq").toString();
  156 + String line="";
  157 + if(map2.get("xlbm_eq")!=null){
  158 + line=map2.get("xlbm_eq").toString();
  159 + }
  160 +
155 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 161 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
156 //保留两位小数 162 //保留两位小数
157 DecimalFormat df = new DecimalFormat("#.00"); 163 DecimalFormat df = new DecimalFormat("#.00");
@@ -164,7 +170,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -164,7 +170,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
164 //前一天所有车辆最后进场班次信息 170 //前一天所有车辆最后进场班次信息
165 List<Ylb> ylListBe=repository.obtainYlbefore(rq); 171 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
166 //从排班表中计算出行驶的总里程 172 //从排班表中计算出行驶的总里程
167 - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("1024",rq); 173 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq);
168 174
169 for(int x=0;x<listpb.size();x++){ 175 for(int x=0;x<listpb.size();x++){
170 176
src/main/java/com/bsth/service/realcontrol/RealMapService.java 0 → 100644
  1 +package com.bsth.service.realcontrol;
  2 +
  3 +import java.util.Map;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/11/23.
  7 + */
  8 +public interface RealMapService {
  9 + Map<String, Object> stationSpatialData(String idx);
  10 +}
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java 0 → 100644
  1 +package com.bsth.service.realcontrol.impl;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.realcontrol.dto.StationSpatialData;
  5 +import com.bsth.service.realcontrol.RealMapService;
  6 +import com.google.common.base.Splitter;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  11 +import org.springframework.jdbc.core.JdbcTemplate;
  12 +import org.springframework.stereotype.Service;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +/**
  19 + * Created by panzhao on 2016/11/23.
  20 + */
  21 +@Service
  22 +public class RealMapServiceImpl implements RealMapService {
  23 +
  24 + @Autowired
  25 + JdbcTemplate jdbcTemplate;
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Override
  30 + public Map<String, Object> stationSpatialData(String idx) {
  31 + Map<String, Object> rs = new HashMap();
  32 +
  33 + try {
  34 + List<String> idArray = Splitter.on(",").splitToList(idx);
  35 + //拼接in语句
  36 + String inStr = "";
  37 + for (String code : idArray) {
  38 + inStr += (",'" + code+"'");
  39 + }
  40 + inStr = " (" + inStr.substring(1) + ")";
  41 +
  42 + 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";
  43 +
  44 + List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class));
  45 + rs.put("status", ResponseCode.SUCCESS);
  46 + rs.put("list", list);
  47 + } catch (Exception e) {
  48 + logger.error("", e);
  49 + rs.put("status", ResponseCode.ERROR);
  50 + rs.put("msg", "查询站点空间数据出现异常!");
  51 + }
  52 +
  53 + return rs;
  54 + }
  55 +}
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
1 package com.bsth.service.realcontrol.impl; 1 package com.bsth.service.realcontrol.impl;
2 2
3 -import java.text.DecimalFormat;  
4 -import java.text.ParseException;  
5 -import java.text.SimpleDateFormat;  
6 -import java.util.ArrayList;  
7 -import java.util.Collection;  
8 -import java.util.Collections;  
9 -import java.util.Date;  
10 -import java.util.HashMap;  
11 -import java.util.HashSet;  
12 -import java.util.Iterator;  
13 -import java.util.List;  
14 -import java.util.Map;  
15 -import java.util.Set;  
16 -  
17 -import com.bsth.entity.realcontrol.LineConfig;  
18 -import org.apache.commons.lang3.StringUtils;  
19 -import org.joda.time.format.DateTimeFormat;  
20 -import org.joda.time.format.DateTimeFormatter;  
21 -import org.slf4j.Logger;  
22 -import org.slf4j.LoggerFactory;  
23 -import org.springframework.beans.factory.annotation.Autowired;  
24 -import org.springframework.stereotype.Service;  
25 -  
26 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
27 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
28 import com.bsth.common.ResponseCode; 5 import com.bsth.common.ResponseCode;
@@ -39,6 +16,7 @@ import com.bsth.entity.Cars; @@ -39,6 +16,7 @@ import com.bsth.entity.Cars;
39 import com.bsth.entity.Line; 16 import com.bsth.entity.Line;
40 import com.bsth.entity.Personnel; 17 import com.bsth.entity.Personnel;
41 import com.bsth.entity.realcontrol.ChildTaskPlan; 18 import com.bsth.entity.realcontrol.ChildTaskPlan;
  19 +import com.bsth.entity.realcontrol.LineConfig;
42 import com.bsth.entity.realcontrol.ScheduleRealInfo; 20 import com.bsth.entity.realcontrol.ScheduleRealInfo;
43 import com.bsth.entity.schedule.CarConfigInfo; 21 import com.bsth.entity.schedule.CarConfigInfo;
44 import com.bsth.entity.schedule.EmployeeConfigInfo; 22 import com.bsth.entity.schedule.EmployeeConfigInfo;
@@ -54,17 +32,25 @@ import com.bsth.security.util.SecurityUtils; @@ -54,17 +32,25 @@ import com.bsth.security.util.SecurityUtils;
54 import com.bsth.service.SectionRouteService; 32 import com.bsth.service.SectionRouteService;
55 import com.bsth.service.impl.BaseServiceImpl; 33 import com.bsth.service.impl.BaseServiceImpl;
56 import com.bsth.service.realcontrol.ScheduleRealInfoService; 34 import com.bsth.service.realcontrol.ScheduleRealInfoService;
57 -import com.bsth.util.DateUtils;  
58 -import com.bsth.util.ReportRelatedUtils;  
59 -import com.bsth.util.ReportUtils;  
60 -import com.bsth.util.TimeUtils;  
61 -import com.bsth.util.TransGPS; 35 +import com.bsth.util.*;
62 import com.bsth.util.TransGPS.Location; 36 import com.bsth.util.TransGPS.Location;
63 import com.bsth.websocket.handler.SendUtils; 37 import com.bsth.websocket.handler.SendUtils;
64 import com.google.common.base.Splitter; 38 import com.google.common.base.Splitter;
65 import com.google.common.collect.ArrayListMultimap; 39 import com.google.common.collect.ArrayListMultimap;
66 import com.google.common.collect.Lists; 40 import com.google.common.collect.Lists;
67 import com.google.common.collect.Multimap; 41 import com.google.common.collect.Multimap;
  42 +import org.apache.commons.lang3.StringUtils;
  43 +import org.joda.time.format.DateTimeFormat;
  44 +import org.joda.time.format.DateTimeFormatter;
  45 +import org.slf4j.Logger;
  46 +import org.slf4j.LoggerFactory;
  47 +import org.springframework.beans.factory.annotation.Autowired;
  48 +import org.springframework.stereotype.Service;
  49 +
  50 +import java.text.DecimalFormat;
  51 +import java.text.ParseException;
  52 +import java.text.SimpleDateFormat;
  53 +import java.util.*;
68 54
69 @Service 55 @Service
70 public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long> 56 public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long>
@@ -289,6 +275,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -289,6 +275,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
289 rs.put("msg", "驾驶员工号不能为空!"); 275 rs.put("msg", "驾驶员工号不能为空!");
290 return rs; 276 return rs;
291 } 277 }
  278 + //截取工号
  279 + if(t.getsGh().indexOf("-") != -1){
  280 + t.setsGh(t.getsGh().split("-")[1]);
  281 + }
292 282
293 t.setScheduleDateStr(schDate); 283 t.setScheduleDateStr(schDate);
294 t.setScheduleDate(sdfyyyyMMdd.parse(schDate)); 284 t.setScheduleDate(sdfyyyyMMdd.parse(schDate));
@@ -454,12 +444,16 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -454,12 +444,16 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
454 444
455 @Override 445 @Override
456 public void adjustDriver(ScheduleRealInfo schedule, String driver, String driverName) { 446 public void adjustDriver(ScheduleRealInfo schedule, String driver, String driverName) {
  447 + if(driver.indexOf("-") != -1)
  448 + driver = driver.split("-")[1];
457 schedule.setjGh(driver); 449 schedule.setjGh(driver);
458 schedule.setjName(driverName); 450 schedule.setjName(driverName);
459 } 451 }
460 452
461 @Override 453 @Override
462 public void adjustConductor(ScheduleRealInfo schedule, String conductor, String conductorName) { 454 public void adjustConductor(ScheduleRealInfo schedule, String conductor, String conductorName) {
  455 + if(conductor.indexOf("-") != -1)
  456 + conductor = conductor.split("-")[1];
463 schedule.setsGh(conductor); 457 schedule.setsGh(conductor);
464 schedule.setsName(conductorName); 458 schedule.setsName(conductorName);
465 } 459 }
@@ -1135,8 +1129,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1135,8 +1129,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1135 addMileage += tempJhlc; 1129 addMileage += tempJhlc;
1136 ljbc++; 1130 ljbc++;
1137 }else{ 1131 }else{
  1132 + if(scheduleRealInfo.getBcType().equals("normal")){
  1133 + jhbc++;
  1134 + }
1138 jhlc += tempJhlc; 1135 jhlc += tempJhlc;
1139 - jhbc++;  
1140 if(scheduleRealInfo.getStatus() == -1){ 1136 if(scheduleRealInfo.getStatus() == -1){
1141 remMileage += tempJhlc; 1137 remMileage += tempJhlc;
1142 cjbc++; 1138 cjbc++;
@@ -1285,6 +1281,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1285,6 +1281,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1285 if(scheduleRealInfo.isSflj()){ 1281 if(scheduleRealInfo.isSflj()){
1286 ljgl += tempJhlc; 1282 ljgl += tempJhlc;
1287 } 1283 }
  1284 + }else{
  1285 + ssgl += tempJhlc;
  1286 + ssgl_other += tempJhlc;
1288 } 1287 }
1289 }else{ 1288 }else{
1290 Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1289 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
@@ -1522,7 +1521,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1522,7 +1521,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1522 if(scheduleRealInfo.getXlBm().equals(yesterdayDataList.get(i).get("xlBm")) && scheduleRealInfo.getClZbh().equals(yesterdayDataList.get(i).get("clZbh")) 1521 if(scheduleRealInfo.getXlBm().equals(yesterdayDataList.get(i).get("xlBm")) && scheduleRealInfo.getClZbh().equals(yesterdayDataList.get(i).get("clZbh"))
1523 && scheduleRealInfo.getjGh().equals(yesterdayDataList.get(i).get("jGh"))){ 1522 && scheduleRealInfo.getjGh().equals(yesterdayDataList.get(i).get("jGh"))){
1524 //根据线路代码获取公司 1523 //根据线路代码获取公司
1525 - Line li = lineRepository.findByLineCode(line); 1524 + Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm());
1526 yesterdayDataList.get(i).put("company", li.getCompany()); 1525 yesterdayDataList.get(i).put("company", li.getCompany());
1527 //计算总公里 1526 //计算总公里
1528 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 1527 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
src/main/java/com/bsth/service/schedule/utils/DataImportExportService.java
@@ -24,6 +24,7 @@ public interface DataImportExportService { @@ -24,6 +24,7 @@ public interface DataImportExportService {
24 * @throws Exception 24 * @throws Exception
25 */ 25 */
26 void fileDataImport(MultipartFile datafile, File ktrFile) throws Exception; 26 void fileDataImport(MultipartFile datafile, File ktrFile) throws Exception;
  27 + void fileDataImport(File datafile, File ktrFile) throws Exception;
27 28
28 /** 29 /**
29 * 数据导出。 30 * 数据导出。
src/main/java/com/bsth/service/schedule/utils/DataImportExportServiceImpl.java
@@ -111,6 +111,31 @@ public class DataImportExportServiceImpl implements DataImportExportService, Ini @@ -111,6 +111,31 @@ public class DataImportExportServiceImpl implements DataImportExportService, Ini
111 } 111 }
112 112
113 @Override 113 @Override
  114 + public void fileDataImport(File datafile, File ktrFile) throws Exception {
  115 +// // 1、上传数据文件
  116 +// File uploadFile = datafile;
  117 +
  118 + // 2、使用kettle运行封装数据导入逻辑的ktr转换文件
  119 + // 2.1、初始化kettle(组件初始化已经做了)
  120 + // 2.2、创建转换元数据,转换
  121 + TransMeta transMeta = new TransMeta(ktrFile.getAbsolutePath());
  122 + Trans trans = new Trans(transMeta);
  123 + // 2.3、设定命名参数,用于指定数据文件,注意每个ktr必须都有以下指定的命名参数
  124 + trans.setParameterValue("filepath", datafile.getAbsolutePath()); // 指定导入数据文件的位置
  125 + trans.setParameterValue("erroroutputdir", dataToolsProperties.getTransErrordir()); // ktr转换错误输出目录
  126 + // TODO:可以考虑设定日志输出
  127 + // 2.4、执行转换
  128 + trans.execute(null);
  129 + // 2.5、等待转换结束
  130 + trans.waitUntilFinished();
  131 +
  132 + // 3、判定ktr错误数,注意这种错误代表部分数据错误,不会终止转换执行,一般设计ktr的时候,会有错误输出文件,TODO:以后考虑使用日志实时输出
  133 + if (trans.getErrors() > 0) {
  134 + throw new Exception("转换数据部分错误,请查看相关错误输出文件!");
  135 + }
  136 + }
  137 +
  138 + @Override
114 public File fileDataOutput(String fileName, File ktrFile) throws Exception { 139 public File fileDataOutput(String fileName, File ktrFile) throws Exception {
115 return fileDataOutput(fileName, ktrFile, null); 140 return fileDataOutput(fileName, ktrFile, null);
116 } 141 }
src/main/java/com/bsth/service/sys/CompanyAuthorityService.java 0 → 100644
  1 +package com.bsth.service.sys;
  2 +
  3 +import com.bsth.entity.sys.CompanyAuthority;
  4 +import com.bsth.entity.sys.SysUser;
  5 +import com.bsth.service.BaseService;
  6 +
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +/**
  11 + * Created by panzhao on 2016/11/22.
  12 + */
  13 +public interface CompanyAuthorityService extends BaseService<CompanyAuthority, Integer> {
  14 + Map<String,Object> save(Integer roleId, List<CompanyAuthority> list);
  15 +
  16 + List<CompanyAuthority> findByUser(SysUser user);
  17 +}
src/main/java/com/bsth/service/sys/impl/CompanyAuthorityServiceImpl.java 0 → 100644
  1 +package com.bsth.service.sys.impl;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.sys.CompanyAuthority;
  5 +import com.bsth.entity.sys.Role;
  6 +import com.bsth.entity.sys.SysUser;
  7 +import com.bsth.repository.sys.CompanyAuthorityRepository;
  8 +import com.bsth.service.impl.BaseServiceImpl;
  9 +import com.bsth.service.sys.CompanyAuthorityService;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Service;
  14 +import org.springframework.transaction.annotation.Transactional;
  15 +
  16 +import java.util.*;
  17 +
  18 +/**
  19 + * Created by panzhao on 2016/11/22.
  20 + */
  21 +@Service
  22 +public class CompanyAuthorityServiceImpl extends BaseServiceImpl<CompanyAuthority, Integer> implements CompanyAuthorityService {
  23 +
  24 + @Autowired
  25 + CompanyAuthorityRepository companyAuthorityRepository;
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Transactional
  30 + @Override
  31 + public Map<String, Object> save(Integer roleId, List<CompanyAuthority> list) {
  32 + Map<String, Object> rs = new HashMap();
  33 +
  34 + try {
  35 + for(CompanyAuthority cauth : list){
  36 + cauth.setRoleId(roleId);
  37 + }
  38 +
  39 + //删除原数据
  40 + companyAuthorityRepository.deleteByRoleId(roleId);
  41 +
  42 + //重新写入数据
  43 + companyAuthorityRepository.save(list);
  44 +
  45 + rs.put("status", ResponseCode.SUCCESS);
  46 + } catch (Exception e) {
  47 + logger.error("", e);
  48 + rs.put("status", ResponseCode.ERROR);
  49 + }
  50 +
  51 + return rs;
  52 + }
  53 +
  54 + @Override
  55 + public List<CompanyAuthority> findByUser(SysUser user) {
  56 + Set<Role> roles = user.getRoles();
  57 + if(roles == null || roles.size() == 0)
  58 + return null;
  59 +
  60 + List<Integer> idx = new ArrayList<>();
  61 + for(Role r : roles)
  62 + idx.add(r.getId());
  63 +
  64 + List<CompanyAuthority> cAuths = companyAuthorityRepository.findByRoles(idx);
  65 + return cAuths;
  66 + }
  67 +}
src/main/java/com/bsth/service/sys/impl/ModuleServiceImpl.java
1 package com.bsth.service.sys.impl; 1 package com.bsth.service.sys.impl;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashMap;  
5 -import java.util.HashSet;  
6 -import java.util.List;  
7 -import java.util.Map;  
8 -import java.util.Set;  
9 -  
10 -import org.springframework.beans.factory.annotation.Autowired;  
11 -import org.springframework.data.domain.Sort;  
12 -import org.springframework.data.domain.Sort.Direction;  
13 -import org.springframework.stereotype.Service;  
14 -  
15 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
16 import com.bsth.entity.sys.Module; 4 import com.bsth.entity.sys.Module;
17 import com.bsth.entity.sys.Role; 5 import com.bsth.entity.sys.Role;
@@ -20,12 +8,23 @@ import com.bsth.repository.sys.ModuleRepository; @@ -20,12 +8,23 @@ import com.bsth.repository.sys.ModuleRepository;
20 import com.bsth.security.util.SecurityUtils; 8 import com.bsth.security.util.SecurityUtils;
21 import com.bsth.service.impl.BaseServiceImpl; 9 import com.bsth.service.impl.BaseServiceImpl;
22 import com.bsth.service.sys.ModuleService; 10 import com.bsth.service.sys.ModuleService;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.jdbc.core.JdbcTemplate;
  13 +import org.springframework.jdbc.core.RowMapper;
  14 +import org.springframework.stereotype.Service;
  15 +
  16 +import java.sql.ResultSet;
  17 +import java.sql.SQLException;
  18 +import java.util.*;
23 19
24 @Service 20 @Service
25 public class ModuleServiceImpl extends BaseServiceImpl<Module, Integer> implements ModuleService{ 21 public class ModuleServiceImpl extends BaseServiceImpl<Module, Integer> implements ModuleService{
26 22
27 @Autowired 23 @Autowired
28 ModuleRepository moduleRepository; 24 ModuleRepository moduleRepository;
  25 +
  26 + @Autowired
  27 + JdbcTemplate jdbcTemplate;
29 28
30 @Override 29 @Override
31 public List<Module> findByGroupType(String group) { 30 public List<Module> findByGroupType(String group) {
@@ -62,26 +61,38 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen @@ -62,26 +61,38 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen
62 SysUser user = SecurityUtils.getCurrentUser(); 61 SysUser user = SecurityUtils.getCurrentUser();
63 Set<Role> roles = user.getRoles(); 62 Set<Role> roles = user.getRoles();
64 63
65 - List<Module> all = (List<Module>) moduleRepository.findAll(new Sort(Direction.ASC, "id"))  
66 - ,results = new ArrayList<>();  
67 - 64 + String inCond = "";
  65 + for(Role r : roles)
  66 + inCond += ("," + r.getId());
  67 +
  68 + inCond = "(" + inCond.substring(1) + ")";
  69 +
  70 + String sql = "select ID,CREATE_DATE,`ENABLE`,GROUP_TYPE,ICON,MAPP_SYMBOL,NAME,P_ID,PATH,UPDATE_DATE,CONTAINER from bsth_c_sys_module m where id in (select modules from bsth_c_sys_role_modules where roles in "+inCond+") or group_type != 3";
  71 + List<Module> all = jdbcTemplate.query(sql, new ModuleRowMapper())
  72 + ,rs = new ArrayList<>();
  73 +
68 Map<Integer, Module> map = new HashMap<>(); 74 Map<Integer, Module> map = new HashMap<>();
69 for(Module m : all){ 75 for(Module m : all){
70 map.put(m.getId(), m); 76 map.put(m.getId(), m);
71 - for(Role r : roles){  
72 - if(m.getRoles().contains(r))  
73 - results.add(m);  
74 - } 77 + if(m.getGroupType().equals("3"))
  78 + rs.add(m);
75 } 79 }
76 80
77 //上层目录和组节点 81 //上层目录和组节点
78 Set<Module> pSet = new HashSet<>(); 82 Set<Module> pSet = new HashSet<>();
79 - for(Module m : results){ 83 + for(Module m : rs){
80 searchParentNode(m, map, pSet); 84 searchParentNode(m, map, pSet);
81 } 85 }
82 - results.addAll(pSet);  
83 -  
84 - return results; 86 + rs.addAll(pSet);
  87 +
  88 + //排序
  89 + Collections.sort(rs, new Comparator<Module>() {
  90 + @Override
  91 + public int compare(Module o1, Module o2) {
  92 + return o1.getId() - o2.getId();
  93 + }
  94 + });
  95 + return rs;
85 } 96 }
86 97
87 /** 98 /**
@@ -105,4 +116,24 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen @@ -105,4 +116,24 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen
105 searchParentNode(pModule, idMap, pSet); 116 searchParentNode(pModule, idMap, pSet);
106 } 117 }
107 } 118 }
  119 +
  120 + public class ModuleRowMapper implements RowMapper<Module>{
  121 +
  122 + @Override
  123 + public Module mapRow(ResultSet rs, int rowNum) throws SQLException {
  124 + Module module = new Module();
  125 + module.setId(rs.getInt("ID"));
  126 + module.setCreateDate(rs.getDate("CREATE_DATE"));
  127 + module.setEnable(rs.getBoolean("ENABLE"));
  128 + module.setGroupType(rs.getString("GROUP_TYPE"));
  129 + module.setIcon(rs.getString("ICON"));
  130 + module.setMappSymbol(rs.getString("MAPP_SYMBOL"));
  131 + module.setName(rs.getString("NAME"));
  132 + module.setpId(rs.getInt("P_ID"));
  133 + module.setPath(rs.getString("PATH"));
  134 + module.setUpdateDate(rs.getDate("UPDATE_DATE"));
  135 + module.setContainer(rs.getString("CONTAINER"));
  136 + return module;
  137 + }
  138 + }
108 } 139 }
src/main/resources/application-dev.properties
@@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 spring.jpa.show-sql= false 9 spring.jpa.show-sql= false
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 -spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 +spring.datasource.url= jdbc:mysql://192.168.168.201/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 spring.datasource.password= 123456 13 spring.datasource.password= 123456
14 #DATASOURCE 14 #DATASOURCE
src/main/resources/application-prod.properties
@@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 spring.jpa.show-sql= false 9 spring.jpa.show-sql= false
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 -spring.datasource.url= jdbc:mysql://192.168.168.171:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 +spring.datasource.url= jdbc:mysql://192.168.40.100:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 -spring.datasource.password= root2jsp 13 +spring.datasource.password= root@JSP2jsp
14 #DATASOURCE 14 #DATASOURCE
15 spring.datasource.max-active=100 15 spring.datasource.max-active=100
16 spring.datasource.max-idle=8 16 spring.datasource.max-idle=8
@@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1
26 ## 26 ##
27 #222.66.0.204:5555 27 #222.66.0.204:5555
28 ##\u5B9E\u65F6gps 28 ##\u5B9E\u65F6gps
29 -http.gps.real.url= http://192.168.168.171:8080/transport_server/rtgps/ 29 +http.gps.real.url= http://192.168.40.82:8080/transport_server/rtgps/
30 ##\u6D88\u606F\u4E0B\u53D1 30 ##\u6D88\u606F\u4E0B\u53D1
31 -http.send.directive = http://192.168.168.171:8080/transport_server/message/  
32 \ No newline at end of file 31 \ No newline at end of file
  32 +http.send.directive = http://192.168.40.82:8080/transport_server/message/
33 \ No newline at end of file 33 \ No newline at end of file
src/main/resources/datatools/config-prod.properties
@@ -5,13 +5,13 @@ datatools.kettle_properties=/datatools/kettle.properties @@ -5,13 +5,13 @@ datatools.kettle_properties=/datatools/kettle.properties
5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) 5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正)
6 6
7 #数据库ip地址 7 #数据库ip地址
8 -datatools.kvars_dbip=192.168.168.171 8 +datatools.kvars_dbip=192.168.40.100
9 #数据库用户名 9 #数据库用户名
10 datatools.kvars_dbuname=root 10 datatools.kvars_dbuname=root
11 #数据库密码 11 #数据库密码
12 -datatools.kvars_dbpwd=root2jsp 12 +datatools.kvars_dbpwd=root@JSP2jsp
13 #数据库库名 13 #数据库库名
14 -datatools.kvars_dbdname=control 14 +datatools.kvars_dbdname=qp_control
15 15
16 # 3、上传数据配置信息 16 # 3、上传数据配置信息
17 # 上传文件目录配置(根据不同的环境需要修正) 17 # 上传文件目录配置(根据不同的环境需要修正)
src/main/resources/datatools/ktrs/ttinfodetailoutputforedit.ktr
@@ -11,17 +11,17 @@ @@ -11,17 +11,17 @@
11 <parameters> 11 <parameters>
12 <parameter> 12 <parameter>
13 <name>tempfilepath</name> 13 <name>tempfilepath</name>
14 - <default_value/> 14 + <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;runtime_temp&#x2f;bsth_control_u_d_files&#x2f;temp&#x2f;test</default_value>
15 <description>&#x9ed8;&#x8ba4;&#x8f93;&#x51fa;&#x7684;&#x6587;&#x4ef6;&#x8def;&#x5f84;&#x540d;</description> 15 <description>&#x9ed8;&#x8ba4;&#x8f93;&#x51fa;&#x7684;&#x6587;&#x4ef6;&#x8def;&#x5f84;&#x540d;</description>
16 </parameter> 16 </parameter>
17 <parameter> 17 <parameter>
18 <name>ttid</name> 18 <name>ttid</name>
19 - <default_value/> 19 + <default_value>63</default_value>
20 <description>&#x65f6;&#x523b;&#x8868;id</description> 20 <description>&#x65f6;&#x523b;&#x8868;id</description>
21 </parameter> 21 </parameter>
22 <parameter> 22 <parameter>
23 <name>xlid</name> 23 <name>xlid</name>
24 - <default_value/> 24 + <default_value>63017</default_value>
25 <description>&#x7ebf;&#x8def;id</description> 25 <description>&#x7ebf;&#x8def;id</description>
26 </parameter> 26 </parameter>
27 </parameters> 27 </parameters>
@@ -1212,6 +1212,156 @@ @@ -1212,6 +1212,156 @@
1212 <type>String</type> 1212 <type>String</type>
1213 <format/> 1213 <format/>
1214 </field> 1214 </field>
  1215 + <field>
  1216 + <name>fcno31_id</name>
  1217 + <type>String</type>
  1218 + <format/>
  1219 + </field>
  1220 + <field>
  1221 + <name>fcno31_fcsj</name>
  1222 + <type>String</type>
  1223 + <format/>
  1224 + </field>
  1225 + <field>
  1226 + <name>fcno31_zdname</name>
  1227 + <type>String</type>
  1228 + <format/>
  1229 + </field>
  1230 + <field>
  1231 + <name>fcno31_bctype</name>
  1232 + <type>String</type>
  1233 + <format/>
  1234 + </field>
  1235 + <field>
  1236 + <name>fcno31_xldir</name>
  1237 + <type>String</type>
  1238 + <format/>
  1239 + </field>
  1240 + <field>
  1241 + <name>fcno31_isfb</name>
  1242 + <type>String</type>
  1243 + <format/>
  1244 + </field>
  1245 + <field>
  1246 + <name>fcno32_id</name>
  1247 + <type>String</type>
  1248 + <format/>
  1249 + </field>
  1250 + <field>
  1251 + <name>fcno32_fcsj</name>
  1252 + <type>String</type>
  1253 + <format/>
  1254 + </field>
  1255 + <field>
  1256 + <name>fcno32_zdname</name>
  1257 + <type>String</type>
  1258 + <format/>
  1259 + </field>
  1260 + <field>
  1261 + <name>fcno32_bctype</name>
  1262 + <type>String</type>
  1263 + <format/>
  1264 + </field>
  1265 + <field>
  1266 + <name>fcno32_xldir</name>
  1267 + <type>String</type>
  1268 + <format/>
  1269 + </field>
  1270 + <field>
  1271 + <name>fcno32_isfb</name>
  1272 + <type>String</type>
  1273 + <format/>
  1274 + </field>
  1275 + <field>
  1276 + <name>fcno33_id</name>
  1277 + <type>String</type>
  1278 + <format/>
  1279 + </field>
  1280 + <field>
  1281 + <name>fcno33_fcsj</name>
  1282 + <type>String</type>
  1283 + <format/>
  1284 + </field>
  1285 + <field>
  1286 + <name>fcno33_zdname</name>
  1287 + <type>String</type>
  1288 + <format/>
  1289 + </field>
  1290 + <field>
  1291 + <name>fcno33_bctype</name>
  1292 + <type>String</type>
  1293 + <format/>
  1294 + </field>
  1295 + <field>
  1296 + <name>fcno33_xldir</name>
  1297 + <type>String</type>
  1298 + <format/>
  1299 + </field>
  1300 + <field>
  1301 + <name>fcno33_isfb</name>
  1302 + <type>String</type>
  1303 + <format/>
  1304 + </field>
  1305 + <field>
  1306 + <name>fcno34_id</name>
  1307 + <type>String</type>
  1308 + <format/>
  1309 + </field>
  1310 + <field>
  1311 + <name>fcno34_fcsj</name>
  1312 + <type>String</type>
  1313 + <format/>
  1314 + </field>
  1315 + <field>
  1316 + <name>fcno34_zdname</name>
  1317 + <type>String</type>
  1318 + <format/>
  1319 + </field>
  1320 + <field>
  1321 + <name>fcno34_bctype</name>
  1322 + <type>String</type>
  1323 + <format/>
  1324 + </field>
  1325 + <field>
  1326 + <name>fcno34_xldir</name>
  1327 + <type>String</type>
  1328 + <format/>
  1329 + </field>
  1330 + <field>
  1331 + <name>fcno34_isfb</name>
  1332 + <type>String</type>
  1333 + <format/>
  1334 + </field>
  1335 + <field>
  1336 + <name>fcno35_id</name>
  1337 + <type>String</type>
  1338 + <format/>
  1339 + </field>
  1340 + <field>
  1341 + <name>fcno35_fcsj</name>
  1342 + <type>String</type>
  1343 + <format/>
  1344 + </field>
  1345 + <field>
  1346 + <name>fcno35_zdname</name>
  1347 + <type>String</type>
  1348 + <format/>
  1349 + </field>
  1350 + <field>
  1351 + <name>fcno35_bctype</name>
  1352 + <type>String</type>
  1353 + <format/>
  1354 + </field>
  1355 + <field>
  1356 + <name>fcno35_xldir</name>
  1357 + <type>String</type>
  1358 + <format/>
  1359 + </field>
  1360 + <field>
  1361 + <name>fcno35_isfb</name>
  1362 + <type>String</type>
  1363 + <format/>
  1364 + </field>
1215 </fields> 1365 </fields>
1216 <custom> 1366 <custom>
1217 <header_font_name>arial</header_font_name> 1367 <header_font_name>arial</header_font_name>
@@ -3776,6 +3926,426 @@ @@ -3776,6 +3926,426 @@
3776 <target_null_string/> 3926 <target_null_string/>
3777 <target_aggregation_type>-</target_aggregation_type> 3927 <target_aggregation_type>-</target_aggregation_type>
3778 </field> 3928 </field>
  3929 + <field>
  3930 + <field_name>id</field_name>
  3931 + <key_value>31</key_value>
  3932 + <target_name>fcno31_id</target_name>
  3933 + <target_type>String</target_type>
  3934 + <target_format/>
  3935 + <target_length>-1</target_length>
  3936 + <target_precision>-1</target_precision>
  3937 + <target_decimal_symbol/>
  3938 + <target_grouping_symbol/>
  3939 + <target_currency_symbol/>
  3940 + <target_null_string/>
  3941 + <target_aggregation_type>-</target_aggregation_type>
  3942 + </field>
  3943 + <field>
  3944 + <field_name>fcsj</field_name>
  3945 + <key_value>31</key_value>
  3946 + <target_name>fcno31_fcsj</target_name>
  3947 + <target_type>String</target_type>
  3948 + <target_format/>
  3949 + <target_length>-1</target_length>
  3950 + <target_precision>-1</target_precision>
  3951 + <target_decimal_symbol/>
  3952 + <target_grouping_symbol/>
  3953 + <target_currency_symbol/>
  3954 + <target_null_string/>
  3955 + <target_aggregation_type>-</target_aggregation_type>
  3956 + </field>
  3957 + <field>
  3958 + <field_name>fczdName</field_name>
  3959 + <key_value>31</key_value>
  3960 + <target_name>fcno31_zdname</target_name>
  3961 + <target_type>String</target_type>
  3962 + <target_format/>
  3963 + <target_length>-1</target_length>
  3964 + <target_precision>-1</target_precision>
  3965 + <target_decimal_symbol/>
  3966 + <target_grouping_symbol/>
  3967 + <target_currency_symbol/>
  3968 + <target_null_string/>
  3969 + <target_aggregation_type>-</target_aggregation_type>
  3970 + </field>
  3971 + <field>
  3972 + <field_name>bc_type</field_name>
  3973 + <key_value>31</key_value>
  3974 + <target_name>fcno31_bctype</target_name>
  3975 + <target_type>String</target_type>
  3976 + <target_format/>
  3977 + <target_length>-1</target_length>
  3978 + <target_precision>-1</target_precision>
  3979 + <target_decimal_symbol/>
  3980 + <target_grouping_symbol/>
  3981 + <target_currency_symbol/>
  3982 + <target_null_string/>
  3983 + <target_aggregation_type>-</target_aggregation_type>
  3984 + </field>
  3985 + <field>
  3986 + <field_name>xl_dir</field_name>
  3987 + <key_value>31</key_value>
  3988 + <target_name>fcno31_xldir</target_name>
  3989 + <target_type>String</target_type>
  3990 + <target_format/>
  3991 + <target_length>-1</target_length>
  3992 + <target_precision>-1</target_precision>
  3993 + <target_decimal_symbol/>
  3994 + <target_grouping_symbol/>
  3995 + <target_currency_symbol/>
  3996 + <target_null_string/>
  3997 + <target_aggregation_type>-</target_aggregation_type>
  3998 + </field>
  3999 + <field>
  4000 + <field_name>isfb</field_name>
  4001 + <key_value>31</key_value>
  4002 + <target_name>fcno31_isfb</target_name>
  4003 + <target_type>String</target_type>
  4004 + <target_format/>
  4005 + <target_length>-1</target_length>
  4006 + <target_precision>-1</target_precision>
  4007 + <target_decimal_symbol/>
  4008 + <target_grouping_symbol/>
  4009 + <target_currency_symbol/>
  4010 + <target_null_string/>
  4011 + <target_aggregation_type>-</target_aggregation_type>
  4012 + </field>
  4013 + <field>
  4014 + <field_name>id</field_name>
  4015 + <key_value>32</key_value>
  4016 + <target_name>fcno32_id</target_name>
  4017 + <target_type>String</target_type>
  4018 + <target_format/>
  4019 + <target_length>-1</target_length>
  4020 + <target_precision>-1</target_precision>
  4021 + <target_decimal_symbol/>
  4022 + <target_grouping_symbol/>
  4023 + <target_currency_symbol/>
  4024 + <target_null_string/>
  4025 + <target_aggregation_type>-</target_aggregation_type>
  4026 + </field>
  4027 + <field>
  4028 + <field_name>fcsj</field_name>
  4029 + <key_value>32</key_value>
  4030 + <target_name>fcno32_fcsj</target_name>
  4031 + <target_type>String</target_type>
  4032 + <target_format/>
  4033 + <target_length>-1</target_length>
  4034 + <target_precision>-1</target_precision>
  4035 + <target_decimal_symbol/>
  4036 + <target_grouping_symbol/>
  4037 + <target_currency_symbol/>
  4038 + <target_null_string/>
  4039 + <target_aggregation_type>-</target_aggregation_type>
  4040 + </field>
  4041 + <field>
  4042 + <field_name>fczdName</field_name>
  4043 + <key_value>32</key_value>
  4044 + <target_name>fcno32_zdname</target_name>
  4045 + <target_type>String</target_type>
  4046 + <target_format/>
  4047 + <target_length>-1</target_length>
  4048 + <target_precision>-1</target_precision>
  4049 + <target_decimal_symbol/>
  4050 + <target_grouping_symbol/>
  4051 + <target_currency_symbol/>
  4052 + <target_null_string/>
  4053 + <target_aggregation_type>-</target_aggregation_type>
  4054 + </field>
  4055 + <field>
  4056 + <field_name>bc_type</field_name>
  4057 + <key_value>32</key_value>
  4058 + <target_name>fcno32_bctype</target_name>
  4059 + <target_type>String</target_type>
  4060 + <target_format/>
  4061 + <target_length>-1</target_length>
  4062 + <target_precision>-1</target_precision>
  4063 + <target_decimal_symbol/>
  4064 + <target_grouping_symbol/>
  4065 + <target_currency_symbol/>
  4066 + <target_null_string/>
  4067 + <target_aggregation_type>-</target_aggregation_type>
  4068 + </field>
  4069 + <field>
  4070 + <field_name>xl_dir</field_name>
  4071 + <key_value>32</key_value>
  4072 + <target_name>fcno32_xldir</target_name>
  4073 + <target_type>String</target_type>
  4074 + <target_format/>
  4075 + <target_length>-1</target_length>
  4076 + <target_precision>-1</target_precision>
  4077 + <target_decimal_symbol/>
  4078 + <target_grouping_symbol/>
  4079 + <target_currency_symbol/>
  4080 + <target_null_string/>
  4081 + <target_aggregation_type>-</target_aggregation_type>
  4082 + </field>
  4083 + <field>
  4084 + <field_name>isfb</field_name>
  4085 + <key_value>32</key_value>
  4086 + <target_name>fcno32_isfb</target_name>
  4087 + <target_type>String</target_type>
  4088 + <target_format/>
  4089 + <target_length>-1</target_length>
  4090 + <target_precision>-1</target_precision>
  4091 + <target_decimal_symbol/>
  4092 + <target_grouping_symbol/>
  4093 + <target_currency_symbol/>
  4094 + <target_null_string/>
  4095 + <target_aggregation_type>-</target_aggregation_type>
  4096 + </field>
  4097 + <field>
  4098 + <field_name>id</field_name>
  4099 + <key_value>33</key_value>
  4100 + <target_name>fcno33_id</target_name>
  4101 + <target_type>String</target_type>
  4102 + <target_format/>
  4103 + <target_length>-1</target_length>
  4104 + <target_precision>-1</target_precision>
  4105 + <target_decimal_symbol/>
  4106 + <target_grouping_symbol/>
  4107 + <target_currency_symbol/>
  4108 + <target_null_string/>
  4109 + <target_aggregation_type>-</target_aggregation_type>
  4110 + </field>
  4111 + <field>
  4112 + <field_name>fcsj</field_name>
  4113 + <key_value>33</key_value>
  4114 + <target_name>fcno33_fcsj</target_name>
  4115 + <target_type>String</target_type>
  4116 + <target_format/>
  4117 + <target_length>-1</target_length>
  4118 + <target_precision>-1</target_precision>
  4119 + <target_decimal_symbol/>
  4120 + <target_grouping_symbol/>
  4121 + <target_currency_symbol/>
  4122 + <target_null_string/>
  4123 + <target_aggregation_type>-</target_aggregation_type>
  4124 + </field>
  4125 + <field>
  4126 + <field_name>fczdName</field_name>
  4127 + <key_value>33</key_value>
  4128 + <target_name>fcno33_zdname</target_name>
  4129 + <target_type>String</target_type>
  4130 + <target_format/>
  4131 + <target_length>-1</target_length>
  4132 + <target_precision>-1</target_precision>
  4133 + <target_decimal_symbol/>
  4134 + <target_grouping_symbol/>
  4135 + <target_currency_symbol/>
  4136 + <target_null_string/>
  4137 + <target_aggregation_type>-</target_aggregation_type>
  4138 + </field>
  4139 + <field>
  4140 + <field_name>bc_type</field_name>
  4141 + <key_value>33</key_value>
  4142 + <target_name>fcno33_bctype</target_name>
  4143 + <target_type>String</target_type>
  4144 + <target_format/>
  4145 + <target_length>-1</target_length>
  4146 + <target_precision>-1</target_precision>
  4147 + <target_decimal_symbol/>
  4148 + <target_grouping_symbol/>
  4149 + <target_currency_symbol/>
  4150 + <target_null_string/>
  4151 + <target_aggregation_type>-</target_aggregation_type>
  4152 + </field>
  4153 + <field>
  4154 + <field_name>xl_dir</field_name>
  4155 + <key_value>33</key_value>
  4156 + <target_name>fcno33_xldir</target_name>
  4157 + <target_type>String</target_type>
  4158 + <target_format/>
  4159 + <target_length>-1</target_length>
  4160 + <target_precision>-1</target_precision>
  4161 + <target_decimal_symbol/>
  4162 + <target_grouping_symbol/>
  4163 + <target_currency_symbol/>
  4164 + <target_null_string/>
  4165 + <target_aggregation_type>-</target_aggregation_type>
  4166 + </field>
  4167 + <field>
  4168 + <field_name>isfb</field_name>
  4169 + <key_value>33</key_value>
  4170 + <target_name>fcno33_isfb</target_name>
  4171 + <target_type>String</target_type>
  4172 + <target_format/>
  4173 + <target_length>-1</target_length>
  4174 + <target_precision>-1</target_precision>
  4175 + <target_decimal_symbol/>
  4176 + <target_grouping_symbol/>
  4177 + <target_currency_symbol/>
  4178 + <target_null_string/>
  4179 + <target_aggregation_type>-</target_aggregation_type>
  4180 + </field>
  4181 + <field>
  4182 + <field_name>id</field_name>
  4183 + <key_value>34</key_value>
  4184 + <target_name>fcno34_id</target_name>
  4185 + <target_type>String</target_type>
  4186 + <target_format/>
  4187 + <target_length>-1</target_length>
  4188 + <target_precision>-1</target_precision>
  4189 + <target_decimal_symbol/>
  4190 + <target_grouping_symbol/>
  4191 + <target_currency_symbol/>
  4192 + <target_null_string/>
  4193 + <target_aggregation_type>-</target_aggregation_type>
  4194 + </field>
  4195 + <field>
  4196 + <field_name>fcsj</field_name>
  4197 + <key_value>34</key_value>
  4198 + <target_name>fcno34_fcsj</target_name>
  4199 + <target_type>String</target_type>
  4200 + <target_format/>
  4201 + <target_length>-1</target_length>
  4202 + <target_precision>-1</target_precision>
  4203 + <target_decimal_symbol/>
  4204 + <target_grouping_symbol/>
  4205 + <target_currency_symbol/>
  4206 + <target_null_string/>
  4207 + <target_aggregation_type>-</target_aggregation_type>
  4208 + </field>
  4209 + <field>
  4210 + <field_name>fczdName</field_name>
  4211 + <key_value>34</key_value>
  4212 + <target_name>fcno34_zdname</target_name>
  4213 + <target_type>String</target_type>
  4214 + <target_format/>
  4215 + <target_length>-1</target_length>
  4216 + <target_precision>-1</target_precision>
  4217 + <target_decimal_symbol/>
  4218 + <target_grouping_symbol/>
  4219 + <target_currency_symbol/>
  4220 + <target_null_string/>
  4221 + <target_aggregation_type>-</target_aggregation_type>
  4222 + </field>
  4223 + <field>
  4224 + <field_name>bc_type</field_name>
  4225 + <key_value>34</key_value>
  4226 + <target_name>fcno34_bctype</target_name>
  4227 + <target_type>String</target_type>
  4228 + <target_format/>
  4229 + <target_length>-1</target_length>
  4230 + <target_precision>-1</target_precision>
  4231 + <target_decimal_symbol/>
  4232 + <target_grouping_symbol/>
  4233 + <target_currency_symbol/>
  4234 + <target_null_string/>
  4235 + <target_aggregation_type>-</target_aggregation_type>
  4236 + </field>
  4237 + <field>
  4238 + <field_name>xl_dir</field_name>
  4239 + <key_value>34</key_value>
  4240 + <target_name>fcno34_xldir</target_name>
  4241 + <target_type>String</target_type>
  4242 + <target_format/>
  4243 + <target_length>-1</target_length>
  4244 + <target_precision>-1</target_precision>
  4245 + <target_decimal_symbol/>
  4246 + <target_grouping_symbol/>
  4247 + <target_currency_symbol/>
  4248 + <target_null_string/>
  4249 + <target_aggregation_type>-</target_aggregation_type>
  4250 + </field>
  4251 + <field>
  4252 + <field_name>isfb</field_name>
  4253 + <key_value>34</key_value>
  4254 + <target_name>fcno34_isfb</target_name>
  4255 + <target_type>String</target_type>
  4256 + <target_format/>
  4257 + <target_length>-1</target_length>
  4258 + <target_precision>-1</target_precision>
  4259 + <target_decimal_symbol/>
  4260 + <target_grouping_symbol/>
  4261 + <target_currency_symbol/>
  4262 + <target_null_string/>
  4263 + <target_aggregation_type>-</target_aggregation_type>
  4264 + </field>
  4265 + <field>
  4266 + <field_name>id</field_name>
  4267 + <key_value>35</key_value>
  4268 + <target_name>fcno35_id</target_name>
  4269 + <target_type>String</target_type>
  4270 + <target_format/>
  4271 + <target_length>-1</target_length>
  4272 + <target_precision>-1</target_precision>
  4273 + <target_decimal_symbol/>
  4274 + <target_grouping_symbol/>
  4275 + <target_currency_symbol/>
  4276 + <target_null_string/>
  4277 + <target_aggregation_type>-</target_aggregation_type>
  4278 + </field>
  4279 + <field>
  4280 + <field_name>fcsj</field_name>
  4281 + <key_value>35</key_value>
  4282 + <target_name>fcno35_fcsj</target_name>
  4283 + <target_type>String</target_type>
  4284 + <target_format/>
  4285 + <target_length>-1</target_length>
  4286 + <target_precision>-1</target_precision>
  4287 + <target_decimal_symbol/>
  4288 + <target_grouping_symbol/>
  4289 + <target_currency_symbol/>
  4290 + <target_null_string/>
  4291 + <target_aggregation_type>-</target_aggregation_type>
  4292 + </field>
  4293 + <field>
  4294 + <field_name>fczdName</field_name>
  4295 + <key_value>35</key_value>
  4296 + <target_name>fcno35_zdname</target_name>
  4297 + <target_type>String</target_type>
  4298 + <target_format/>
  4299 + <target_length>-1</target_length>
  4300 + <target_precision>-1</target_precision>
  4301 + <target_decimal_symbol/>
  4302 + <target_grouping_symbol/>
  4303 + <target_currency_symbol/>
  4304 + <target_null_string/>
  4305 + <target_aggregation_type>-</target_aggregation_type>
  4306 + </field>
  4307 + <field>
  4308 + <field_name>bc_type</field_name>
  4309 + <key_value>35</key_value>
  4310 + <target_name>fcno35_bctype</target_name>
  4311 + <target_type>String</target_type>
  4312 + <target_format/>
  4313 + <target_length>-1</target_length>
  4314 + <target_precision>-1</target_precision>
  4315 + <target_decimal_symbol/>
  4316 + <target_grouping_symbol/>
  4317 + <target_currency_symbol/>
  4318 + <target_null_string/>
  4319 + <target_aggregation_type>-</target_aggregation_type>
  4320 + </field>
  4321 + <field>
  4322 + <field_name>xl_dir</field_name>
  4323 + <key_value>35</key_value>
  4324 + <target_name>fcno35_xldir</target_name>
  4325 + <target_type>String</target_type>
  4326 + <target_format/>
  4327 + <target_length>-1</target_length>
  4328 + <target_precision>-1</target_precision>
  4329 + <target_decimal_symbol/>
  4330 + <target_grouping_symbol/>
  4331 + <target_currency_symbol/>
  4332 + <target_null_string/>
  4333 + <target_aggregation_type>-</target_aggregation_type>
  4334 + </field>
  4335 + <field>
  4336 + <field_name>isfb</field_name>
  4337 + <key_value>35</key_value>
  4338 + <target_name>fcno35_isfb</target_name>
  4339 + <target_type>String</target_type>
  4340 + <target_format/>
  4341 + <target_length>-1</target_length>
  4342 + <target_precision>-1</target_precision>
  4343 + <target_decimal_symbol/>
  4344 + <target_grouping_symbol/>
  4345 + <target_currency_symbol/>
  4346 + <target_null_string/>
  4347 + <target_aggregation_type>-</target_aggregation_type>
  4348 + </field>
3779 </fields> 4349 </fields>
3780 <cluster_schema/> 4350 <cluster_schema/>
3781 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 4351 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
src/main/resources/ms-jdbc.properties
  1 +#ms.mysql.driver= com.mysql.jdbc.Driver
  2 +#ms.mysql.url= jdbc:mysql://192.168.40.82:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false
  3 +#ms.mysql.username= root
  4 +#ms.mysql.password= 123456
  5 +
1 ms.mysql.driver= com.mysql.jdbc.Driver 6 ms.mysql.driver= com.mysql.jdbc.Driver
2 ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false 7 ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false
3 ms.mysql.username= root 8 ms.mysql.username= root
4 ms.mysql.password= 123456 9 ms.mysql.password= 123456
5 -  
6 -#ms.mysql.driver= com.mysql.jdbc.Driver  
7 -#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8  
8 -#ms.mysql.username= root  
9 -#ms.mysql.password= root2jsp  
10 \ No newline at end of file 10 \ No newline at end of file
src/main/resources/static/index.html
@@ -145,7 +145,7 @@ tr.row-active td { @@ -145,7 +145,7 @@ tr.row-active td {
145 <div class="page-header-inner "> 145 <div class="page-header-inner ">
146 <!-- LOGO --> 146 <!-- LOGO -->
147 <div class="page-logo"> 147 <div class="page-logo">
148 - <a href="index.html" class="logo-default logo-default-text" > 闵行公交调度系统 </a> 148 + <a href="index.html" class="logo-default logo-default-text" > 青浦公交调度系统 </a>
149 <div class="menu-toggler sidebar-toggler"> 149 <div class="menu-toggler sidebar-toggler">
150 </div> 150 </div>
151 </div> 151 </div>
src/main/resources/static/login.html
@@ -180,7 +180,7 @@ h3.logo-text{ @@ -180,7 +180,7 @@ h3.logo-text{
180 <div class="wrapper ng-scope"> 180 <div class="wrapper ng-scope">
181 <div id="loginPanel" class="dialog dialog-shadow"> 181 <div id="loginPanel" class="dialog dialog-shadow">
182 <br> 182 <br>
183 - <h3 class="logo-text">闵行公交调度系统 </h3> 183 + <h3 class="logo-text">青浦公交调度系统 </h3>
184 <hr> 184 <hr>
185 <form style="padding: 0px 35px;"> 185 <form style="padding: 0px 35px;">
186 <div class="form-group" style="margin-bottom: 0"> 186 <div class="form-group" style="margin-bottom: 0">
src/main/resources/static/pages/control/line/index.html
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 <div class="portlet-title banner" > 18 <div class="portlet-title banner" >
19 <div class="caption col_hide_1280" style="color: #FFF;"> 19 <div class="caption col_hide_1280" style="color: #FFF;">
20 <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span 20 <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span
21 - class="caption-subject bold" style="font-size: 24px;">闵行公交线路调度系统</span> 21 + class="caption-subject bold" style="font-size: 24px;">青浦公交线路调度系统</span>
22 </div> 22 </div>
23 <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;"> 23 <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;">
24 <span class="top_username"></span> <span class="operation_mode_text animated" ></span> 24 <span class="top_username"></span> <span class="operation_mode_text animated" ></span>
src/main/resources/static/pages/forms/mould/changetochange.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
@@ -80,44 +80,18 @@ @@ -80,44 +80,18 @@
80 locale : 'zh-cn' 80 locale : 'zh-cn'
81 }); 81 });
82 82
83 - $('#line').select2({  
84 - ajax: {  
85 - url: '/realSchedule/findLine',  
86 - type: 'post',  
87 - dataType: 'json',  
88 - delay: 150,  
89 - data: function(params){  
90 - return{line: params.term};  
91 - },  
92 - processResults: function (data) {  
93 - return {  
94 - results: data  
95 - };  
96 - },  
97 - cache: true  
98 - },  
99 - templateResult: function(repo){  
100 - if (repo.loading) return repo.text;  
101 - var h = '<span>'+repo.text+'</span>';  
102 - return h;  
103 - },  
104 - escapeMarkup: function (markup) { return markup; },  
105 - minimumInputLength: 1,  
106 - templateSelection: function(repo){  
107 - return repo.text;  
108 - },  
109 - language: {  
110 - noResults: function(){  
111 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
112 - },  
113 - inputTooShort : function(e) {  
114 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
115 - },  
116 - searching : function() {  
117 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
118 - }  
119 - }  
120 - }); 83 + $.get('/basic/lineCode2Name',function(result){
  84 + var data=[];
  85 +
  86 + for(var code in result){
  87 + data.push({id: code, text: result[code]});
  88 + }
  89 + console.log(data);
  90 + initPinYinSelect2('#line',data,'');
  91 +
  92 + })
  93 +
  94 +
121 $('#code').select2({ 95 $('#code').select2({
122 ajax: { 96 ajax: {
123 url: '/realSchedule/sreachVehic', 97 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/forms/statement/changetochange.html
@@ -10,63 +10,98 @@ @@ -10,63 +10,98 @@
10 border: 1px solid; } 10 border: 1px solid; }
11 .table-bordered > thead > tr > th, 11 .table-bordered > thead > tr > th,
12 .table-bordered > thead > tr > td { 12 .table-bordered > thead > tr > td {
13 - border-bottom-width: 2px; } 13 + border-bottom-width: 2px;
  14 + text-align: center;}
14 15
15 .table > tbody + tbody { 16 .table > tbody + tbody {
16 border-top: 1px solid; } 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;
  25 +}
  26 +
17 </style> 27 </style>
18 28
19 <div class="page-head"> 29 <div class="page-head">
20 <div class="page-title"> 30 <div class="page-title">
21 - <h1>鎹汉鎹㈣溅鎯呭喌缁熻琛</h1> 31 + <h1>换人换车情况统计表</h1>
22 </div> 32 </div>
23 </div> 33 </div>
24 34
25 <div class="row"> 35 <div class="row">
26 <div class="col-md-12"> 36 <div class="col-md-12">
27 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
  38 + <div class="portlet-title">
  39 + <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 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 + </select>
  59 + </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>
  64 + </form>
  65 + </div>
28 <div class="portlet-body"> 66 <div class="portlet-body">
29 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 67 + <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px">
30 <table class="table table-bordered table-hover table-checkable" id="forms"> 68 <table class="table table-bordered table-hover table-checkable" id="forms">
31 <thead> 69 <thead>
32 <tr> 70 <tr>
33 - <th colspan="13">鎹汉鎹㈣溅鎯呭喌缁熻琛</th> 71 + <th colspan="15">换人换车情况统计表</th>
34 </tr> 72 </tr>
35 - <!-- <tr>  
36 - <td colspan="12">杞﹂槦 绔 <span id="sDate"></span>鑷<span id="eDate"></span></td>  
37 - </tr> -->  
38 <tr> 73 <tr>
39 - <td rowspan="3">鏃ユ湡</td>  
40 - <td rowspan="3">鍏徃</td>  
41 - <td rowspan="3">鍒嗗叕鍙</td>  
42 - <td rowspan="3">绾胯矾</td>  
43 - <td rowspan="3">璺墝</td>  
44 - <td rowspan="3">鍙戠敓鏃堕棿</td>  
45 - <td rowspan="3">淇敼鏃堕棿</td>  
46 - <td colspan="3">閰嶈溅</td>  
47 - <td colspan="3">浜哄憳</td>  
48 - <td rowspan="3">鍘熷洜</td>  
49 - <td rowspan="3">淇敼浜</td> 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>
  81 + <td colspan="2">配车</td>
  82 + <td colspan="4">人员</td>
  83 + <td rowspan="3" style=" padding-top: 50px;">原因</td>
  84 + <td rowspan="3" style=" padding-top: 50px;">修改人</td>
50 </tr> 85 </tr>
51 <tr> 86 <tr>
52 - <td>璁″垝</td>  
53 - <td>瀹為檯</td>  
54 - <td>璁″垝</td>  
55 - <td>瀹為檯</td> 87 + <td>计划</td>
  88 + <td>实际</td>
  89 + <td colspan="2">计划</td>
  90 + <td colspan="2">实际</td>
  91 +
56 </tr> 92 </tr>
57 <tr> 93 <tr>
58 - <td>璁″垝</td>  
59 - <td>瀹為檯</td>  
60 - <td>璁″垝</td>  
61 - <td>瀹為檯</td> 94 + <td>车号</td>
  95 + <td>车号</td>
  96 + <td>工号</td>
  97 + <td>人员</td>
  98 + <td>工号</td>
  99 + <td>人员</td>
62 </tr> 100 </tr>
63 </thead> 101 </thead>
64 - <tbody class="list_correctForm"> 102 + <tbody>
65 103
66 </tbody> 104 </tbody>
67 - <tbody class="list_correctForm_statistics">  
68 -  
69 - </tbody>  
70 </table> 105 </table>
71 </div> 106 </div>
72 </div> 107 </div>
@@ -76,7 +111,7 @@ @@ -76,7 +111,7 @@
76 111
77 <script> 112 <script>
78 $(function(){ 113 $(function(){
79 - // 鍏抽棴宸︿晶鏍 114 + // 关闭左侧栏
80 if (!$('body').hasClass('page-sidebar-closed')) 115 if (!$('body').hasClass('page-sidebar-closed'))
81 $('.menu-toggler.sidebar-toggler').click(); 116 $('.menu-toggler.sidebar-toggler').click();
82 117
@@ -113,162 +148,81 @@ @@ -113,162 +148,81 @@
113 }, 148 },
114 language: { 149 language: {
115 noResults: function(){ 150 noResults: function(){
116 - return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒扮嚎璺紒</span>';  
117 - },  
118 - inputTooShort : function(e) {  
119 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆绾胯矾鎼滅储绾胯矾</span>';  
120 - },  
121 - searching : function() {  
122 - return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储绾胯矾...</span>';  
123 - }  
124 - }  
125 - });  
126 - $('#lpName').select2({  
127 - ajax: {  
128 - url: '/realSchedule/findLpName',  
129 - type: 'post',  
130 - dataType: 'json',  
131 - delay: 150,  
132 - data: function(params){  
133 - return{lpName: params.term};  
134 - },  
135 - processResults: function (data) {  
136 - return {  
137 - results: data  
138 - };  
139 - },  
140 - cache: true  
141 - },  
142 - templateResult: function(repo){  
143 - if (repo.loading) return repo.text;  
144 - var h = '<span>'+repo.text+'</span>';  
145 - return h;  
146 - },  
147 - escapeMarkup: function (markup) { return markup; },  
148 - minimumInputLength: 1,  
149 - templateSelection: function(repo){  
150 - return repo.text;  
151 - },  
152 - language: {  
153 - noResults: function(){  
154 - return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒拌矾鐗岋紒</span>'; 151 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
155 }, 152 },
156 inputTooShort : function(e) { 153 inputTooShort : function(e) {
157 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆璺墝鎼滅储璺墝</span>'; 154 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
158 }, 155 },
159 searching : function() { 156 searching : function() {
160 - return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储璺墝...</span>'; 157 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
161 } 158 }
162 } 159 }
163 }); 160 });
164 - $('#code').select2({  
165 - ajax: {  
166 - url: '/realSchedule/sreachVehic',  
167 - dataType: 'json',  
168 - delay: 150,  
169 - data: function(params){  
170 - return{nbbm: params.term};  
171 - },  
172 - processResults: function (data) {  
173 - return {  
174 - results: data  
175 - };  
176 - },  
177 - cache: true  
178 - },  
179 - templateResult: function(repo){  
180 - if (repo.loading) return repo.text;  
181 - var h = '<span>'+repo.text+'</span>';  
182 - h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');  
183 - return h;  
184 - },  
185 - escapeMarkup: function (markup) { return markup; },  
186 - minimumInputLength: 1,  
187 - templateSelection: function(repo){  
188 - return repo.text;  
189 - },  
190 - language: {  
191 - noResults: function(){  
192 - return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒拌溅杈嗭紒</span>';  
193 - },  
194 - inputTooShort : function(e) {  
195 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆鑷紪鍙锋悳绱㈣溅杈</span>';  
196 - },  
197 - searching : function() {  
198 - return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储杞﹁締...</span>';  
199 - }  
200 - }  
201 - });  
202 - 161 + var line;
  162 + var startDate;
  163 + var endDate;
203 $("#query").on("click",function(){ 164 $("#query").on("click",function(){
204 - var line = $("#line").val();  
205 - var startDate = $("#startDate").val();  
206 - var endDate = $("#endDate").val();  
207 - var lpName = $("#lpName").val();  
208 - var code = $("#code").val();  
209 - $post("/realSchedule/correctForm",{line:line,startDate:startDate,endDate:endDate,lpName:lpName,code:code},function(result){  
210 - $("#sDate").text(startDate);  
211 - $("#eDate").text(endDate);  
212 - var temp = {};  
213 - var today_account = 0;  
214 - temp["line"] = $("#line").text() ;  
215 - temp["totalAdjustment"] = result.length;  
216 -  
217 - $.each(result, function(i, obj) {  
218 - if(moment(obj.scheduleDate).format("YYYY-MM-DD") == moment(obj.updateDate).format("YYYY-MM-DD")){  
219 - today_account++;  
220 - }  
221 - obj.updateDate = moment(obj.updateDate).format("YYYY-MM-DD HH:mm:ss");  
222 - });  
223 -  
224 - temp["todayAdjustment"] = today_account;  
225 - temp["beforeAdjustment"] = result.length-today_account;  
226 - temp["historyAdjustment"] = 0;  
227 -  
228 - var list_correctForm = template('list_correctForm',{list:result});  
229 - // 鎶婃覆鏌撳ソ鐨勬ā鐗坔tml鏂囨湰杩藉姞鍒拌〃鏍间腑  
230 - $('#forms .list_correctForm').html(list_correctForm);  
231 -  
232 - var list_correctForm_statistics = template('list_correctForm_statistics',temp);  
233 - $('#forms .list_correctForm_statistics').html(list_correctForm_statistics);  
234 - }); 165 + line = $("#line").val();
  166 + sel = $("#sel").val();
  167 + var startDate1=$("#startDate").val();
  168 + var endDate1=$("#endDate").val();
  169 +
  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 + })
  190 +
  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"));
235 }); 199 });
236 }); 200 });
  201 + });
237 </script> 202 </script>
238 -<script type="text/html" id="list_correctForm"> 203 +<script type="text/html" id="changetochange">
239 {{each list as obj i}} 204 {{each list as obj i}}
240 <tr> 205 <tr>
241 - <td>{{obj.xlName}}</td>  
242 - <td>{{obj.lpName}}</td>  
243 - <td>{{obj.clZbh}}</td>  
244 - <td>{{obj.jName}}</td>  
245 - <td>{{obj.sName}}</td>  
246 - <td>{{obj.fcsj}}</td>  
247 - <td>{{obj.fcsjActual}}</td>  
248 - <td>{{obj.zdsj}}</td>  
249 - <td>{{obj.zdsjActual}}</td>  
250 - <td>{{obj.updateBy}}</td>  
251 - <td>{{obj.updateDate}}</td>  
252 - <td>{{obj.remarks}}</td> 206 + <td>{{obj.rq}}</td>
  207 + <td>{{obj.gs}}</td>
  208 + <td>{{obj.fgs}}</td>
  209 + <td>{{obj.xl}}</td>
  210 + <td>{{obj.lp}}</td>
  211 + <td>{{obj.fssj}}</td>
  212 + <td>{{obj.xgsj}}</td>
  213 + <td>{{obj.pcch}}</td>
  214 + <td>{{obj.pcry}}</td>
  215 + <td>{{obj.jhgh}}</td>
  216 + <td>{{obj.jhch}}</td>
  217 + <td>{{obj.sjgh}}</td>
  218 + <td>{{obj.sjch}}</td>
  219 + <td>{{obj.yy}}</td>
  220 + <td>{{obj.xgr}}</td>
253 </tr> 221 </tr>
254 {{/each}} 222 {{/each}}
255 {{if list.length == 0}} 223 {{if list.length == 0}}
256 <tr> 224 <tr>
257 - <td colspan="12"><h6 class="muted">娌℃湁鎵惧埌鐩稿叧鏁版嵁</h6></td> 225 + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td>
258 </tr> 226 </tr>
259 {{/if}} 227 {{/if}}
260 </script> 228 </script>
261 -<script type="text/html" id="list_correctForm_statistics">  
262 - <tr>  
263 - <td colspan="2">绾胯矾:</td>  
264 - <td>{{line}}</td>  
265 - <td>璋冩暣鎬绘暟</td>  
266 - <td>{{totalAdjustment}}</td>  
267 - <td>浜嬪厛璋冩暣</td>  
268 - <td>{{beforeAdjustment}}</td>  
269 - <td>褰撴棩璋冩暣</td>  
270 - <td>{{todayAdjustment}}</td>  
271 - <td>鍘嗗彶璋冩暣</td>  
272 - <td colspan="2">{{historyAdjustment}}</td>  
273 - </tr>  
274 -</script>  
275 \ No newline at end of file 229 \ No newline at end of file
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -107,44 +107,19 @@ @@ -107,44 +107,19 @@
107 locale : 'zh-cn' 107 locale : 'zh-cn'
108 }); 108 });
109 109
110 - $('#line').select2({  
111 - ajax: {  
112 - url: '/realSchedule/findLine',  
113 - type: 'post',  
114 - dataType: 'json',  
115 - delay: 150,  
116 - data: function(params){  
117 - return{line: params.term};  
118 - },  
119 - processResults: function (data) {  
120 - return {  
121 - results: data  
122 - };  
123 - },  
124 - cache: true  
125 - },  
126 - templateResult: function(repo){  
127 - if (repo.loading) return repo.text;  
128 - var h = '<span>'+repo.text+'</span>';  
129 - return h;  
130 - },  
131 - escapeMarkup: function (markup) { return markup; },  
132 - minimumInputLength: 1,  
133 - templateSelection: function(repo){  
134 - return repo.text;  
135 - },  
136 - language: {  
137 - noResults: function(){  
138 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
139 - },  
140 - inputTooShort : function(e) {  
141 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
142 - },  
143 - searching : function() {  
144 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
145 - }  
146 - }  
147 - }); 110 +
  111 + $.get('/basic/lineCode2Name',function(result){
  112 + var data=[];
  113 +
  114 + for(var code in result){
  115 + data.push({id: code, text: result[code]});
  116 + }
  117 + console.log(data);
  118 + initPinYinSelect2('#line',data,'');
  119 +
  120 + })
  121 +
  122 +
148 $('#lpName').select2({ 123 $('#lpName').select2({
149 ajax: { 124 ajax: {
150 url: '/realSchedule/findLpName', 125 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/daily.html
@@ -92,45 +92,16 @@ @@ -92,45 +92,16 @@
92 locale : 'zh-cn' 92 locale : 'zh-cn'
93 }); 93 });
94 94
95 - $('#line').select2({  
96 - ajax: {  
97 - url: '/realSchedule/findLine',  
98 - type: 'post',  
99 - dataType: 'json',  
100 - delay: 150,  
101 - data: function(params){  
102 - return{line: params.term};  
103 - },  
104 - processResults: function (data) {  
105 - return {  
106 - results: data  
107 - };  
108 - },  
109 - cache: true  
110 - },  
111 - templateResult: function(repo){  
112 - if (repo.loading) return repo.text;  
113 - var h = '<span>'+repo.text+'</span>';  
114 - return h;  
115 - },  
116 - escapeMarkup: function (markup) { return markup; },  
117 - minimumInputLength: 1,  
118 - templateSelection: function(repo){  
119 - return repo.text;  
120 - },  
121 - language: {  
122 - noResults: function(){  
123 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
124 - },  
125 - inputTooShort : function(e) {  
126 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
127 - },  
128 - searching : function() {  
129 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
130 - }  
131 - }  
132 - });  
133 - 95 + $.get('/basic/lineCode2Name',function(result){
  96 + var data=[];
  97 +
  98 + for(var code in result){
  99 + data.push({id: code, text: result[code]});
  100 + }
  101 + console.log(data);
  102 + initPinYinSelect2('#line',data,'');
  103 +
  104 + })
134 var line; 105 var line;
135 var date; 106 var date;
136 $("#query").on("click",function(){ 107 $("#query").on("click",function(){
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -80,44 +80,16 @@ @@ -80,44 +80,16 @@
80 locale : 'zh-cn' 80 locale : 'zh-cn'
81 }); 81 });
82 82
83 - $('#line').select2({  
84 - ajax: {  
85 - url: '/realSchedule/findLine',  
86 - type: 'post',  
87 - dataType: 'json',  
88 - delay: 150,  
89 - data: function(params){  
90 - return{line: params.term};  
91 - },  
92 - processResults: function (data) {  
93 - return {  
94 - results: data  
95 - };  
96 - },  
97 - cache: true  
98 - },  
99 - templateResult: function(repo){  
100 - if (repo.loading) return repo.text;  
101 - var h = '<span>'+repo.text+'</span>';  
102 - return h;  
103 - },  
104 - escapeMarkup: function (markup) { return markup; },  
105 - minimumInputLength: 1,  
106 - templateSelection: function(repo){  
107 - return repo.text;  
108 - },  
109 - language: {  
110 - noResults: function(){  
111 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
112 - },  
113 - inputTooShort : function(e) {  
114 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
115 - },  
116 - searching : function() {  
117 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
118 - } 83 + $.get('/basic/lineCode2Name',function(result){
  84 + var data=[];
  85 +
  86 + for(var code in result){
  87 + data.push({id: code, text: result[code]});
119 } 88 }
120 - }); 89 + console.log(data);
  90 + initPinYinSelect2('#line',data,'');
  91 +
  92 + })
121 $('#code').select2({ 93 $('#code').select2({
122 ajax: { 94 ajax: {
123 url: '/realSchedule/sreachVehic', 95 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/forms/statement/jobSummary.html
@@ -194,43 +194,17 @@ @@ -194,43 +194,17 @@
194 locale : 'zh-cn' 194 locale : 'zh-cn'
195 }); 195 });
196 196
197 - $('#line').select2({  
198 - ajax: {  
199 - url: '/realSchedule/findLine',  
200 - dataType: 'json',  
201 - delay: 150,  
202 - data: function(params){  
203 - return{line: params.term};  
204 - },  
205 - processResults: function (data) {  
206 - return {  
207 - results: data  
208 - };  
209 - },  
210 - cache: true  
211 - },  
212 - templateResult: function(repo){  
213 - if (repo.loading) return repo.text;  
214 - var h = '<span>'+repo.text+'</span>';  
215 - return h;  
216 - },  
217 - escapeMarkup: function (markup) { return markup; },  
218 - minimumInputLength: 1,  
219 - templateSelection: function(repo){  
220 - return repo.text;  
221 - },  
222 - language: {  
223 - noResults: function(){  
224 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
225 - },  
226 - inputTooShort : function(e) {  
227 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
228 - },  
229 - searching : function() {  
230 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
231 - }  
232 - }  
233 - }); 197 + $.get('/basic/lineCode2Name',function(result){
  198 + var data=[];
  199 +
  200 + for(var code in result){
  201 + data.push({id: code, text: result[code]});
  202 + }
  203 + console.log(data);
  204 + initPinYinSelect2('#line',data,'');
  205 +
  206 + })
  207 +
234 }); 208 });
235 </script> 209 </script>
236 <script type="text/html" id="list_forms"> 210 <script type="text/html" id="list_forms">
src/main/resources/static/pages/forms/statement/linepassengerflow.html
@@ -21,12 +21,12 @@ @@ -21,12 +21,12 @@
21 <h1>线路客流量报表</h1> 21 <h1>线路客流量报表</h1>
22 </div> 22 </div>
23 </div> 23 </div>
24 -  
25 -<div class="row">  
26 - <div class="col-md-12">  
27 - <div class="portlet light porttlet-fit bordered">  
28 - <div class="portlet-title">  
29 - <form class="form-inline" action=""> 24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
30 <div style="display: inline-block;"> 30 <div style="display: inline-block;">
31 <span class="item-label" style="width: 80px;">线路: </span> 31 <span class="item-label" style="width: 80px;">线路: </span>
32 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 32 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -38,10 +38,10 @@ @@ -38,10 +38,10 @@
38 <div class="form-group"> 38 <div class="form-group">
39 <input class="btn btn-default" type="button" id="query" value="筛选"/> 39 <input class="btn btn-default" type="button" id="query" value="筛选"/>
40 <input class="btn btn-default" type="button" id="export" value="导出"/> 40 <input class="btn btn-default" type="button" id="export" value="导出"/>
41 - </div>  
42 - </form>  
43 - </div>  
44 - <div class="portlet-body"> 41 + </div>
  42 + </form>
  43 + </div>
  44 + <div class="portlet-body">
45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
46 <table class="table table-bordered table-hover table-checkable" id="forms"> 46 <table class="table table-bordered table-hover table-checkable" id="forms">
47 <thead> 47 <thead>
@@ -56,63 +56,34 @@ @@ -56,63 +56,34 @@
56 56
57 </tbody> 57 </tbody>
58 </table> 58 </table>
59 - </div>  
60 - </div>  
61 - </div>  
62 - </div>  
63 -</div>  
64 -  
65 -<script> 59 + </div>
  60 + </div>
  61 + </div>
  62 + </div>
  63 +</div>
  64 +
  65 +<script>
66 $(function(){ 66 $(function(){
67 - var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};  
68 - // 关闭左侧栏  
69 - if (!$('body').hasClass('page-sidebar-closed')) 67 + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
  68 + // 关闭左侧栏
  69 + if (!$('body').hasClass('page-sidebar-closed'))
70 $('.menu-toggler.sidebar-toggler').click(); 70 $('.menu-toggler.sidebar-toggler').click();
71 -  
72 - $("#date").datetimepicker({  
73 - format : 'YYYY-MM-DD',  
74 - locale : 'zh-cn' 71 +
  72 + $("#date").datetimepicker({
  73 + format : 'YYYY-MM-DD',
  74 + locale : 'zh-cn'
75 }); 75 });
76 76
77 - $('#line').select2({  
78 - ajax: {  
79 - url: '/realSchedule/findLine',  
80 - type: 'post',  
81 - dataType: 'json',  
82 - delay: 150,  
83 - data: function(params){  
84 - return{line: params.term};  
85 - },  
86 - processResults: function (data) {  
87 - return {  
88 - results: data  
89 - };  
90 - },  
91 - cache: true  
92 - },  
93 - templateResult: function(repo){  
94 - if (repo.loading) return repo.text;  
95 - var h = '<span>'+repo.text+'</span>';  
96 - return h;  
97 - },  
98 - escapeMarkup: function (markup) { return markup; },  
99 - minimumInputLength: 1,  
100 - templateSelection: function(repo){  
101 - return repo.text;  
102 - },  
103 - language: {  
104 - noResults: function(){  
105 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
106 - },  
107 - inputTooShort : function(e) {  
108 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
109 - },  
110 - searching : function() {  
111 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
112 - }  
113 - }  
114 - });  
115 - 77 + $.get('/basic/lineCode2Name',function(result){
  78 + var data=[];
  79 +
  80 + for(var code in result){
  81 + data.push({id: code, text: result[code]});
  82 + }
  83 + console.log(data);
  84 + initPinYinSelect2('#line',data,'');
  85 +
  86 + })
116 87
117 $("#query").on("click",function(){ 88 $("#query").on("click",function(){
118 var line = $("#line").val(); 89 var line = $("#line").val();
@@ -126,10 +97,10 @@ @@ -126,10 +97,10 @@
126 // 把渲染好的模版html文本追加到表格中 97 // 把渲染好的模版html文本追加到表格中
127 $('#forms tbody').html(tbodyHtml); 98 $('#forms tbody').html(tbodyHtml);
128 }); 99 });
129 - });  
130 - });  
131 -</script>  
132 -<script type="text/html" id="list_linepasswengerflow"> 100 + });
  101 + });
  102 +</script>
  103 +<script type="text/html" id="list_linepasswengerflow">
133 {{each list as obj i}} 104 {{each list as obj i}}
134 <tr> 105 <tr>
135 <td>{{i+1}}</td> 106 <td>{{i+1}}</td>
@@ -142,5 +113,5 @@ @@ -142,5 +113,5 @@
142 <tr> 113 <tr>
143 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 114 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
144 </tr> 115 </tr>
145 - {{/if}} 116 + {{/if}}
146 </script> 117 </script>
147 \ No newline at end of file 118 \ No newline at end of file
src/main/resources/static/pages/forms/statement/operationservice.html
@@ -102,44 +102,18 @@ @@ -102,44 +102,18 @@
102 locale : 'zh-cn' 102 locale : 'zh-cn'
103 }); 103 });
104 104
105 - $('#line').select2({  
106 - ajax: {  
107 - url: '/realSchedule/findLine',  
108 - type: 'post',  
109 - dataType: 'json',  
110 - delay: 150,  
111 - data: function(params){  
112 - return{line: params.term};  
113 - },  
114 - processResults: function (data) {  
115 - return {  
116 - results: data  
117 - };  
118 - },  
119 - cache: true  
120 - },  
121 - templateResult: function(repo){  
122 - if (repo.loading) return repo.text;  
123 - var h = '<span>'+repo.text+'</span>';  
124 - return h;  
125 - },  
126 - escapeMarkup: function (markup) { return markup; },  
127 - minimumInputLength: 1,  
128 - templateSelection: function(repo){  
129 - return repo.text;  
130 - },  
131 - language: {  
132 - noResults: function(){  
133 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
134 - },  
135 - inputTooShort : function(e) {  
136 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
137 - },  
138 - searching : function() {  
139 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
140 - }  
141 - }  
142 - }); 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]});
  111 + }
  112 + console.log(data);
  113 + initPinYinSelect2('#line',data,'');
  114 +
  115 + })
  116 +
143 $('#lpName').select2({ 117 $('#lpName').select2({
144 ajax: { 118 ajax: {
145 url: '/realSchedule/findLpName', 119 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
43 </div> 43 </div>
44 <div class="portlet-body"> 44 <div class="portlet-body">
45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
46 <table class="table table-bordered table-hover table-checkable" id="forms"> 47 <table class="table table-bordered table-hover table-checkable" id="forms">
47 <thead> 48 <thead>
48 <tr> 49 <tr>
@@ -82,23 +83,23 @@ @@ -82,23 +83,23 @@
82 <td>援外</td> 83 <td>援外</td>
83 <td>其他</td> 84 <td>其他</td>
84 <td>全日</td> 85 <td>全日</td>
85 - <td>6:31~<br>8:30</td>  
86 - <td>16:01~<br>18:00</td> 86 + <td>早高峰</td>
  87 + <td>晚高峰</td>
87 <td>全日</td> 88 <td>全日</td>
88 - <td>6:31~<br>8:30</td>  
89 - <td>16:01~<br>18:00</td> 89 + <td>早高峰</td>
  90 + <td>晚高峰</td>
90 <td>全日</td> 91 <td>全日</td>
91 - <td>6:31~<br>8:30</td>  
92 - <td>16:01~<br>18:00</td> 92 + <td>早高峰</td>
  93 + <td>晚高峰</td>
93 <td>全日</td> 94 <td>全日</td>
94 - <td>6:31~<br>8:30</td>  
95 - <td>16:01~<br>18:00</td> 95 + <td>早高峰</td>
  96 + <td>晚高峰</td>
96 <td>全日</td> 97 <td>全日</td>
97 - <td>6:31~<br>8:30</td>  
98 - <td>16:01~<br>18:00</td> 98 + <td>早高峰</td>
  99 + <td>晚高峰</td>
99 <td>全日</td> 100 <td>全日</td>
100 - <td>6:31~<br>8:30</td>  
101 - <td>16:01~<br>18:00</td> 101 + <td>早高峰</td>
  102 + <td>晚高峰</td>
102 </tr> 103 </tr>
103 </thead> 104 </thead>
104 105
@@ -260,44 +261,18 @@ @@ -260,44 +261,18 @@
260 locale : 'zh-cn' 261 locale : 'zh-cn'
261 }); 262 });
262 263
263 - $('#line').select2({  
264 - ajax: {  
265 - url: '/realSchedule/findLine',  
266 - dataType: 'json',  
267 - delay: 150,  
268 - data: function(params){  
269 - return{line: params.term};  
270 - },  
271 - processResults: function (data) {  
272 - return {  
273 - results: data  
274 - };  
275 - },  
276 - cache: true  
277 - },  
278 - templateResult: function(repo){  
279 - if (repo.loading) return repo.text;  
280 - var h = '<span>'+repo.text+'</span>';  
281 - return h;  
282 - },  
283 - escapeMarkup: function (markup) { return markup; },  
284 - minimumInputLength: 1,  
285 - templateSelection: function(repo){  
286 - return repo.text;  
287 - },  
288 - language: {  
289 - noResults: function(){  
290 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
291 - },  
292 - inputTooShort : function(e) {  
293 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
294 - },  
295 - searching : function() {  
296 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
297 - }  
298 - }  
299 - });  
300 - 264 +
  265 +
  266 + $.get('/basic/lineCode2Name',function(result){
  267 + var data=[];
  268 +
  269 + for(var code in result){
  270 + data.push({id: code, text: result[code]});
  271 + }
  272 + console.log(data);
  273 + initPinYinSelect2('#line',data,'');
  274 +
  275 + })
301 //查询 276 //查询
302 $("#query").on('click',function(){ 277 $("#query").on('click',function(){
303 var line = $("#line").val(); 278 var line = $("#line").val();
src/main/resources/static/pages/forms/statement/shifday.html
@@ -97,44 +97,17 @@ $(function(){ @@ -97,44 +97,17 @@ $(function(){
97 locale : 'zh-cn' 97 locale : 'zh-cn'
98 }); 98 });
99 99
100 - $('#line').select2({  
101 - ajax: {  
102 - url: '/realSchedule/findLine',  
103 - type: 'post',  
104 - dataType: 'json',  
105 - delay: 150,  
106 - data: function(params){  
107 - return{line: params.term};  
108 - },  
109 - processResults: function (data) {  
110 - return {  
111 - results: data  
112 - };  
113 - },  
114 - cache: true  
115 - },  
116 - templateResult: function(repo){  
117 - if (repo.loading) return repo.text;  
118 - var h = '<span>'+repo.text+'</span>';  
119 - return h;  
120 - },  
121 - escapeMarkup: function (markup) { return markup; },  
122 - minimumInputLength: 1,  
123 - templateSelection: function(repo){  
124 - return repo.text;  
125 - },  
126 - language: {  
127 - noResults: function(){  
128 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
129 - },  
130 - inputTooShort : function(e) {  
131 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
132 - },  
133 - searching : function() {  
134 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
135 - }  
136 - }  
137 - }); 100 +
  101 + $.get('/basic/lineCode2Name',function(result){
  102 + var data=[];
  103 +
  104 + for(var code in result){
  105 + data.push({id: code, text: result[code]});
  106 + }
  107 + console.log(data);
  108 + initPinYinSelect2('#line',data,'');
  109 +
  110 + })
138 111
139 $("#query").on("click",function(){ 112 $("#query").on("click",function(){
140 var line = $("#line").val(); 113 var line = $("#line").val();
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html
@@ -87,44 +87,17 @@ @@ -87,44 +87,17 @@
87 locale : 'zh-cn' 87 locale : 'zh-cn'
88 }); 88 });
89 89
90 - $('#line').select2({  
91 - ajax: {  
92 - url: '/realSchedule/findLine',  
93 - type: 'post',  
94 - dataType: 'json',  
95 - delay: 150,  
96 - data: function(params){  
97 - return{line: params.term};  
98 - },  
99 - processResults: function (data) {  
100 - return {  
101 - results: data  
102 - };  
103 - },  
104 - cache: true  
105 - },  
106 - templateResult: function(repo){  
107 - if (repo.loading) return repo.text;  
108 - var h = '<span>'+repo.text+'</span>';  
109 - return h;  
110 - },  
111 - escapeMarkup: function (markup) { return markup; },  
112 - minimumInputLength: 1,  
113 - templateSelection: function(repo){  
114 - return repo.text;  
115 - },  
116 - language: {  
117 - noResults: function(){  
118 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
119 - },  
120 - inputTooShort : function(e) {  
121 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
122 - },  
123 - searching : function() {  
124 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
125 - }  
126 - }  
127 - }); 90 +
  91 + $.get('/basic/lineCode2Name',function(result){
  92 + var data=[];
  93 +
  94 + for(var code in result){
  95 + data.push({id: code, text: result[code]});
  96 + }
  97 + console.log(data);
  98 + initPinYinSelect2('#line',data,'');
  99 +
  100 + })
128 $('#lpName').select2({ 101 $('#lpName').select2({
129 ajax: { 102 ajax: {
130 url: '/realSchedule/findLpName', 103 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/singledata.html
@@ -92,44 +92,18 @@ @@ -92,44 +92,18 @@
92 locale : 'zh-cn' 92 locale : 'zh-cn'
93 }); 93 });
94 94
95 - $('#line').select2({  
96 - ajax: {  
97 - url: '/realSchedule/findLine',  
98 - type: 'post',  
99 - dataType: 'json',  
100 - delay: 150,  
101 - data: function(params){  
102 - return{line: params.term};  
103 - },  
104 - processResults: function (data) {  
105 - return {  
106 - results: data  
107 - };  
108 - },  
109 - cache: true  
110 - },  
111 - templateResult: function(repo){  
112 - if (repo.loading) return repo.text;  
113 - var h = '<span>'+repo.text+'</span>';  
114 - return h;  
115 - },  
116 - escapeMarkup: function (markup) { return markup; },  
117 - minimumInputLength: 1,  
118 - templateSelection: function(repo){  
119 - return repo.text;  
120 - },  
121 - language: {  
122 - noResults: function(){  
123 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
124 - },  
125 - inputTooShort : function(e) {  
126 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
127 - },  
128 - searching : function() {  
129 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
130 - }  
131 - }  
132 - }); 95 +
  96 + $.get('/basic/lineCode2Name',function(result){
  97 + var data=[];
  98 +
  99 + for(var code in result){
  100 + data.push({id: code, text: result[code]});
  101 + }
  102 + console.log(data);
  103 + initPinYinSelect2('#line',data,'');
  104 +
  105 + })
  106 +
133 $('#lpName').select2({ 107 $('#lpName').select2({
134 ajax: { 108 ajax: {
135 url: '/realSchedule/findLpName', 109 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/statisticsDaily .html
@@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
43 </div> 43 </div>
44 <div class="portlet-body"> 44 <div class="portlet-body">
45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
46 <table class="table table-bordered table-hover table-checkable" id="forms"> 47 <table class="table table-bordered table-hover table-checkable" id="forms">
47 <thead> 48 <thead>
48 <tr> 49 <tr>
@@ -70,7 +71,7 @@ @@ -70,7 +71,7 @@
70 <td rowspan="2">原因</td> 71 <td rowspan="2">原因</td>
71 </tr> 72 </tr>
72 <tr> 73 <tr>
73 - <td>路阻</td> 74 + <td width="31px">路阻</td>
74 <td>吊慢</td> 75 <td>吊慢</td>
75 <td>故障</td> 76 <td>故障</td>
76 <td>纠纷</td> 77 <td>纠纷</td>
@@ -82,23 +83,23 @@ @@ -82,23 +83,23 @@
82 <td>援外</td> 83 <td>援外</td>
83 <td>其他</td> 84 <td>其他</td>
84 <td>全日</td> 85 <td>全日</td>
85 - <td>6:31~8:30</td>  
86 - <td>16:01~18:00</td> 86 + <td>早高峰</td>
  87 + <td>晚高峰</td>
87 <td>全日</td> 88 <td>全日</td>
88 - <td>6:31~8:30</td>  
89 - <td>16:01~18:00</td> 89 + <td>早高峰</td>
  90 + <td>晚高峰</td>
90 <td>全日</td> 91 <td>全日</td>
91 - <td>6:31~8:30</td>  
92 - <td>16:01~18:00</td> 92 + <td>早高峰</td>
  93 + <td>晚高峰</td>
93 <td>全日</td> 94 <td>全日</td>
94 - <td>6:31~8:30</td>  
95 - <td>16:01~18:00</td> 95 + <td>早高峰</td>
  96 + <td>晚高峰</td>
96 <td>全日</td> 97 <td>全日</td>
97 - <td>6:31~8:30</td>  
98 - <td>16:01~18:00</td> 98 + <td>早高峰</td>
  99 + <td>晚高峰</td>
99 <td>全日</td> 100 <td>全日</td>
100 - <td>6:31~8:30</td>  
101 - <td>16:01~18:00</td> 101 + <td>早高峰</td>
  102 + <td>晚高峰</td>
102 </tr> 103 </tr>
103 </thead> 104 </thead>
104 <tbody class="statisticsDaily"> 105 <tbody class="statisticsDaily">
@@ -163,47 +164,21 @@ @@ -163,47 +164,21 @@
163 format : 'YYYY-MM-DD', 164 format : 'YYYY-MM-DD',
164 locale : 'zh-cn' 165 locale : 'zh-cn'
165 }); 166 });
  167 + $.get('/basic/lineCode2Name',function(result){
  168 + var data=[];
  169 +
  170 + for(var code in result){
  171 + data.push({id: code, text: result[code]});
  172 + }
  173 + console.log(data);
  174 + initPinYinSelect2('#line',data,'');
  175 +
  176 + })
166 177
167 - $('#line').select2({  
168 - ajax: {  
169 - url: '/realSchedule/findLine',  
170 - dataType: 'json',  
171 - delay: 150,  
172 - data: function(params){  
173 - return{line: params.term};  
174 - },  
175 - processResults: function (data) {  
176 - return {  
177 - results: data  
178 - };  
179 - },  
180 - cache: true  
181 - },  
182 - templateResult: function(repo){  
183 - if (repo.loading) return repo.text;  
184 - var h = '<span>'+repo.text+'</span>';  
185 - return h;  
186 - },  
187 - escapeMarkup: function (markup) { return markup; },  
188 - minimumInputLength: 1,  
189 - templateSelection: function(repo){  
190 - return repo.text;  
191 - },  
192 - language: {  
193 - noResults: function(){  
194 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
195 - },  
196 - inputTooShort : function(e) {  
197 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
198 - },  
199 - searching : function() {  
200 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
201 - }  
202 - }  
203 - }); 178 +
204 $("#query").on("click",function(){ 179 $("#query").on("click",function(){
205 var line = $("#line").val(); 180 var line = $("#line").val();
206 - var xlName = $("#line").text(); 181 + var xlName = $("#select2-line-container").html();
207 var date = $("#date").val(); 182 var date = $("#date").val();
208 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){ 183 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){
209 // 把数据填充到模版中 184 // 把数据填充到模版中
src/main/resources/static/pages/forms/statement/vehicleloading.html
@@ -82,44 +82,19 @@ @@ -82,44 +82,19 @@
82 locale : 'zh-cn' 82 locale : 'zh-cn'
83 }); 83 });
84 84
85 - $('#line').select2({  
86 - ajax: {  
87 - url: '/realSchedule/findLine',  
88 - type: 'post',  
89 - dataType: 'json',  
90 - delay: 150,  
91 - data: function(params){  
92 - return{line: params.term};  
93 - },  
94 - processResults: function (data) {  
95 - return {  
96 - results: data  
97 - };  
98 - },  
99 - cache: true  
100 - },  
101 - templateResult: function(repo){  
102 - if (repo.loading) return repo.text;  
103 - var h = '<span>'+repo.text+'</span>';  
104 - return h;  
105 - },  
106 - escapeMarkup: function (markup) { return markup; },  
107 - minimumInputLength: 1,  
108 - templateSelection: function(repo){  
109 - return repo.text;  
110 - },  
111 - language: {  
112 - noResults: function(){  
113 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
114 - },  
115 - inputTooShort : function(e) {  
116 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
117 - },  
118 - searching : function() {  
119 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
120 - }  
121 - }  
122 - }); 85 +
  86 + $.get('/basic/lineCode2Name',function(result){
  87 + var data=[];
  88 +
  89 + for(var code in result){
  90 + data.push({id: code, text: result[code]});
  91 + }
  92 + console.log(data);
  93 + initPinYinSelect2('#line',data,'');
  94 +
  95 + })
  96 +
  97 +
123 $('#lpName').select2({ 98 $('#lpName').select2({
124 ajax: { 99 ajax: {
125 url: '/realSchedule/findLpName', 100 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/waybill.html
@@ -21,49 +21,49 @@ @@ -21,49 +21,49 @@
21 <h1>行车路单</h1> 21 <h1>行车路单</h1>
22 </div> 22 </div>
23 </div> 23 </div>
24 -  
25 -<div class="row">  
26 - <div class="col-md-12">  
27 - <div class="portlet light porttlet-fit bordered">  
28 - <div class="portlet-title">  
29 - <form class="form-inline" action="">  
30 - <div style="display: inline-block;"> 24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block;">
31 <span class="item-label" style="width: 80px;">线路: </span> 31 <span class="item-label" style="width: 80px;">线路: </span>
32 - <select class="form-control" name="line" id="line" style="width: 180px;"></select>  
33 - </div>  
34 - <div style="display: inline-block;margin-left: 15px;">  
35 - <span class="item-label" style="width: 80px;">时间: </span>  
36 - <input class="form-control" type="text" id="date" style="width: 180px;"/>  
37 - </div>  
38 - <div class="form-group" style="display: inline-block;margin-left: 15px;">  
39 - <input class="btn btn-default" type="button" id="query" value="查询"/>  
40 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
41 - <input class="btn btn-default" type="button" id="print" value="打印"/>  
42 - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>  
43 - </div>  
44 - </form>  
45 - </div>  
46 - <div class="portlet-body">  
47 - <div class="row">  
48 - <div class="col-md-3">  
49 - <div class="" style="margin-top: 10px;overflow:auto;height: 860px">  
50 - <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">  
51 - <thead>  
52 - <tr class="hidden">  
53 - <th>人员</th>  
54 - <th>自编号</th>  
55 - <th>路牌</th>  
56 - </tr>  
57 - </thead>  
58 - <tbody>  
59 -  
60 - </tbody>  
61 - </table>  
62 - </div>  
63 - </div>  
64 - <div class="col-md-9" id="printArea">  
65 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">  
66 - <table class="table table-bordered table-checkable" id="forms"> 32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div class="form-group" style="display: inline-block;margin-left: 15px;">
  39 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  40 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  41 + <input class="btn btn-default" type="button" id="print" value="打印"/>
  42 + <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
  43 + </div>
  44 + </form>
  45 + </div>
  46 + <div class="portlet-body">
  47 + <div class="row">
  48 + <div class="col-md-3">
  49 + <div class="" style="margin-top: 10px;overflow:auto;height: 860px">
  50 + <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">
  51 + <thead>
  52 + <tr class="hidden">
  53 + <th>人员</th>
  54 + <th>自编号</th>
  55 + <th>路牌</th>
  56 + </tr>
  57 + </thead>
  58 + <tbody>
  59 +
  60 + </tbody>
  61 + </table>
  62 + </div>
  63 + </div>
  64 + <div class="col-md-9" id="printArea">
  65 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  66 + <table class="table table-bordered table-checkable" id="forms">
67 <tbody class="ludan_1"> 67 <tbody class="ludan_1">
68 68
69 </tbody> 69 </tbody>
@@ -75,28 +75,39 @@ @@ -75,28 +75,39 @@
75 </tbody> 75 </tbody>
76 <tbody class="ludan_4"> 76 <tbody class="ludan_4">
77 77
78 - </tbody>  
79 - </table>  
80 - </div>  
81 - </div>  
82 - </div>  
83 - </div>  
84 - </div>  
85 - </div>  
86 -</div>  
87 -  
88 -<script>  
89 - $(function(){  
90 - // 关闭左侧栏  
91 - if (!$('body').hasClass('page-sidebar-closed')) 78 + </tbody>
  79 + </table>
  80 + </div>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 + </div>
  86 +</div>
  87 +
  88 +<script>
  89 + $(function(){
  90 + // 关闭左侧栏
  91 + if (!$('body').hasClass('page-sidebar-closed'))
92 $('.menu-toggler.sidebar-toggler').click(); 92 $('.menu-toggler.sidebar-toggler').click();
93 -  
94 - $("#date").datetimepicker({  
95 - format : 'YYYY-MM-DD',  
96 - locale : 'zh-cn' 93 +
  94 + $("#date").datetimepicker({
  95 + format : 'YYYY-MM-DD',
  96 + locale : 'zh-cn'
97 }); 97 });
98 98
99 - $('#line').select2({ 99 + $.get('/basic/lineCode2Name',function(result){
  100 + var data=[];
  101 +
  102 + for(var code in result){
  103 + data.push({id: code, text: result[code]});
  104 + }
  105 + console.log(data);
  106 + initPinYinSelect2('#line',data,'');
  107 +
  108 + })
  109 +
  110 + /* $('#line').select2({
100 ajax: { 111 ajax: {
101 url: '/realSchedule/findLine', 112 url: '/realSchedule/findLine',
102 type: 'post', 113 type: 'post',
@@ -134,29 +145,30 @@ @@ -134,29 +145,30 @@
134 } 145 }
135 } 146 }
136 }); 147 });
  148 + */
137 149
138 - var date = '';  
139 - $("#query").on("click",function(){  
140 - var line = $("#line").val(); 150 + var date = '';
  151 + $("#query").on("click",function(){
  152 + var line = $("#line").val();
141 date = $("#date").val(); 153 date = $("#date").val();
142 - $(".hidden").removeClass("hidden");  
143 - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){  
144 - // 把数据填充到模版中  
145 - var tbodyHtml = template('list_info',{list:result});  
146 - // 把渲染好的模版html文本追加到表格中  
147 - $('#info tbody').html(tbodyHtml);  
148 - }); 154 + $(".hidden").removeClass("hidden");
  155 + $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  156 + // 把数据填充到模版中
  157 + var tbodyHtml = template('list_info',{list:result});
  158 + // 把渲染好的模版html文本追加到表格中
  159 + $('#info tbody').html(tbodyHtml);
  160 + });
149 }); 161 });
150 162
151 var params = new Array(); 163 var params = new Array();
152 - var jName = ''; 164 + var jName = '';
153 $("#info tbody").on("click","tr",function(){ 165 $("#info tbody").on("click","tr",function(){
154 if($(this).children().size() < 2){ 166 if($(this).children().size() < 2){
155 return; 167 return;
156 - }  
157 -  
158 - $(this).children().each(function(index){  
159 - params[index] = $(this).text(); 168 + }
  169 +
  170 + $(this).children().each(function(index){
  171 + params[index] = $(this).text();
160 }); 172 });
161 console.log(params); 173 console.log(params);
162 jName = params[0].split("\\")[0]; 174 jName = params[0].split("\\")[0];
@@ -169,18 +181,18 @@ @@ -169,18 +181,18 @@
169 // 把渲染好的模版html文本追加到表格中 181 // 把渲染好的模版html文本追加到表格中
170 $('#forms .ludan_1').html(ludan_1); 182 $('#forms .ludan_1').html(ludan_1);
171 //$('#forms .ludan_4').html(ludan_4); 183 //$('#forms .ludan_4').html(ludan_4);
172 - }); 184 + });
173 $post('/realSchedule/queryListWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){ 185 $post('/realSchedule/queryListWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){
174 - getTime(result);  
175 - var ludan_2 = template('ludan_2',{list:result});  
176 - // 把渲染好的模版html文本追加到表格中  
177 - $('#forms .ludan_2').html(ludan_2); 186 + getTime(result);
  187 + var ludan_2 = template('ludan_2',{list:result});
  188 + // 把渲染好的模版html文本追加到表格中
  189 + $('#forms .ludan_2').html(ludan_2);
178 }); 190 });
179 $post('/realSchedule/findKMBC',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){ 191 $post('/realSchedule/findKMBC',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){
180 var ludan_3 = template('ludan_3',result); 192 var ludan_3 = template('ludan_3',result);
181 $('#forms .ludan_3').html(ludan_3); 193 $('#forms .ludan_3').html(ludan_3);
182 }); 194 });
183 - 195 +
184 }); 196 });
185 197
186 $("#export").on("click",function(){ 198 $("#export").on("click",function(){
@@ -216,22 +228,22 @@ @@ -216,22 +228,22 @@
216 } 228 }
217 } 229 }
218 }); 230 });
219 - }  
220 - });  
221 -</script>  
222 -<script type="text/html" id="list_info">  
223 - {{each list as obj i}}  
224 - <tr>  
225 - <td width="45%">{{obj[4]}}\{{obj[1]}}</td>  
226 - <td width="32%">{{obj[2]}}</td>  
227 - <td width="23%">{{obj[3]}}<input type="hidden" id="{{obj[2]}}" value="{{obj[0]}}"></td>  
228 - </tr>  
229 - {{/each}}  
230 - {{if list.length == 0}}  
231 - <tr>  
232 - <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>  
233 - </tr>  
234 - {{/if}} 231 + }
  232 + });
  233 +</script>
  234 +<script type="text/html" id="list_info">
  235 + {{each list as obj i}}
  236 + <tr>
  237 + <td width="45%">{{obj[4]}}\{{obj[1]}}</td>
  238 + <td width="32%">{{obj[2]}}</td>
  239 + <td width="23%">{{obj[3]}}<input type="hidden" id="{{obj[2]}}" value="{{obj[0]}}"></td>
  240 + </tr>
  241 + {{/each}}
  242 + {{if list.length == 0}}
  243 + <tr>
  244 + <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>
  245 + </tr>
  246 + {{/if}}
235 </script> 247 </script>
236 <script type="text/html" id="ludan_1"> 248 <script type="text/html" id="ludan_1">
237 <tr> 249 <tr>
@@ -292,31 +304,31 @@ @@ -292,31 +304,31 @@
292 <td colspan="1">快</td> 304 <td colspan="1">快</td>
293 <td colspan="1">慢</td> 305 <td colspan="1">慢</td>
294 </tr> 306 </tr>
295 -</script>  
296 -<script type="text/html" id="ludan_2">  
297 - {{each list as obj i}}  
298 - <tr>  
299 - <td>{{i+1}}</td>  
300 - <td>{{obj.jName}}</td>  
301 - <td>{{obj.sName}}</td>  
302 - <td>&nbsp;</td>  
303 - <td>{{obj.qdzName}}</td>  
304 - <td>{{obj.zdzName}}</td>  
305 - <td>{{obj.fcsj}}</td>  
306 - <td>{{obj.fcsjActual}}</td>  
307 - <td>{{obj.zdsj}}</td>  
308 - <td>{{obj.zdsjActual}}</td>  
309 - <td>{{obj.fast}}</td>  
310 - <td>{{obj.slow}}</td> 307 +</script>
  308 +<script type="text/html" id="ludan_2">
  309 + {{each list as obj i}}
  310 + <tr>
  311 + <td>{{i+1}}</td>
  312 + <td>{{obj.jName}}</td>
  313 + <td>{{obj.sName}}</td>
  314 + <td>&nbsp;</td>
  315 + <td>{{obj.qdzName}}</td>
  316 + <td>{{obj.zdzName}}</td>
  317 + <td>{{obj.fcsj}}</td>
  318 + <td>{{obj.fcsjActual}}</td>
  319 + <td>{{obj.zdsj}}</td>
  320 + <td>{{obj.zdsjActual}}</td>
  321 + <td>{{obj.fast}}</td>
  322 + <td>{{obj.slow}}</td>
311 <td>{{obj.jhlc}}</td> 323 <td>{{obj.jhlc}}</td>
312 - <td>{{obj.remarks}}</td>  
313 - </tr> 324 + <td>{{obj.remarks}}</td>
  325 + </tr>
314 {{/each}} 326 {{/each}}
315 {{if list.length == 0}} 327 {{if list.length == 0}}
316 <tr> 328 <tr>
317 <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td> 329 <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
318 </tr> 330 </tr>
319 - {{/if}} 331 + {{/if}}
320 </script> 332 </script>
321 <script type="text/html" id="ludan_3"> 333 <script type="text/html" id="ludan_3">
322 <tr> 334 <tr>
src/main/resources/static/pages/forms/statement/waybillday.html
@@ -79,45 +79,16 @@ @@ -79,45 +79,16 @@
79 locale : 'zh-cn' 79 locale : 'zh-cn'
80 }); 80 });
81 81
82 - $('#line').select2({  
83 - ajax: {  
84 - url: '/realSchedule/findLine',  
85 - type: 'post',  
86 - dataType: 'json',  
87 - delay: 150,  
88 - data: function(params){  
89 - return{line: params.term};  
90 - },  
91 - processResults: function (data) {  
92 - return {  
93 - results: data  
94 - };  
95 - },  
96 - cache: true  
97 - },  
98 - templateResult: function(repo){  
99 - if (repo.loading) return repo.text;  
100 - var h = '<span>'+repo.text+'</span>';  
101 - return h;  
102 - },  
103 - escapeMarkup: function (markup) { return markup; },  
104 - minimumInputLength: 1,  
105 - templateSelection: function(repo){  
106 - return repo.text;  
107 - },  
108 - language: {  
109 - noResults: function(){  
110 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
111 - },  
112 - inputTooShort : function(e) {  
113 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
114 - },  
115 - searching : function() {  
116 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
117 - }  
118 - }  
119 - });  
120 - 82 + $.get('/basic/lineCode2Name',function(result){
  83 + var data=[];
  84 +
  85 + for(var code in result){
  86 + data.push({id: code, text: result[code]});
  87 + }
  88 + console.log(data);
  89 + initPinYinSelect2('#line',data,'');
  90 +
  91 + })
121 var line; 92 var line;
122 var date; 93 var date;
123 $("#query").on("click",function(){ 94 $("#query").on("click",function(){
src/main/resources/static/pages/oil/list.html
@@ -294,8 +294,7 @@ $(function(){ @@ -294,8 +294,7 @@ $(function(){
294 } 294 }
295 }); 295 });
296 $get('/ylb/obtain', params, function(){ 296 $get('/ylb/obtain', params, function(){
297 - console.log("----------------------");  
298 - jsDoQuery(null,true); 297 + jsDoQuery(params,true);
299 }); 298 });
300 }else{ 299 }else{
301 layer.msg('请选择日期.'); 300 layer.msg('请选择日期.');
src/main/resources/static/pages/permission/role/companyAuthority.html 0 → 100644
  1 +<style>
  2 + .cmpy-auth-card {
  3 + width: 760px;
  4 + background: #fff;
  5 + margin: auto;
  6 + padding: 15px;
  7 + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  8 + }
  9 +
  10 + .cmpy-auth-card .yunyin-company-panel:last-child {
  11 + border-bottom: none;
  12 + padding-bottom: 0px;
  13 + }
  14 +
  15 + .yunyin-company-panel {
  16 + border-bottom: 1px solid #e9e5e5;
  17 + padding-bottom: 5px;
  18 +
  19 + user-select:none;
  20 + }
  21 +
  22 + .yunyin-company-panel .company {
  23 + font-size: 13px;
  24 + }
  25 +
  26 + .yunyin-company-panel .sub-company {
  27 + display: inline-block;
  28 + text-align: center;
  29 + padding: 5px 15px;
  30 + border-radius: 5px !important;
  31 + color: #5d5c5c;
  32 + font-size: 13px;
  33 + background: linear-gradient(to bottom, #fafafa, #eeeeee);
  34 + cursor: pointer;
  35 + border: 1px solid #eeeeee;
  36 + }
  37 +
  38 + .yunyin-company-panel .sub-company.active {
  39 + background: linear-gradient(to bottom, #2ab4c0, #229ea9);
  40 + color: #fdfdfd;
  41 + }
  42 +</style>
  43 +
  44 +<div id="roleCompanyAuthority">
  45 +
  46 + <div class="page-head">
  47 + <div class="page-title">
  48 + <h1>模块配置</h1>
  49 + </div>
  50 + </div>
  51 +
  52 + <ul class="page-breadcrumb breadcrumb">
  53 + <li><a href="/pages/home.html" data-pjax>首页</a> <i
  54 + class="fa fa-circle"></i></li>
  55 + <li><span class="active">权限管理</span> <i class="fa fa-circle"></i></li>
  56 + <li><a href="list.html" data-pjax>角色管理</a> <i class="fa fa-circle"></i></li>
  57 + <li><span class="active">分公司数据权限</span></li>
  58 + </ul>
  59 +
  60 + <div class="cmpy-auth-card">
  61 +
  62 + <h4>角色信息</h4>
  63 + <table class="table">
  64 + <tr>
  65 + <td>
  66 + 代码:<span id="roleCode"></span>
  67 + </td>
  68 + <td>
  69 + 名称:<span id="roleName"></span>
  70 + </td>
  71 + </tr>
  72 + </table>
  73 + </div>
  74 + <br><br>
  75 + <div class="cmpy-auth-card cmpy-list">
  76 + </div>
  77 +
  78 + <div class="cmpy-auth-card" style="text-align: right;">
  79 + <button type="button" class="btn btn-default">返回</button>&nbsp;
  80 + <button type="button" class="btn btn-primary saveBtn" ><i class="fa fa-check"></i>保存</button>
  81 + </div>
  82 +
  83 + <script id="role-company-authority-temp" type="text/html">
  84 + {{each list as obj i}}
  85 + <div class="yunyin-company-panel">
  86 + <h5 class="company">{{obj.name}}</h5>
  87 + {{each obj.childs as fgs i}}
  88 + <div class="sub-company" data-company="{{obj.name}}" data-id="{{fgs.upCode}}_{{fgs.businessCode}}">{{fgs.businessName}}</div>
  89 + {{/each}}
  90 + </div>
  91 + {{/each}}
  92 + </script>
  93 +
  94 +</div>
  95 +
  96 +<script>
  97 +$(function () {
  98 + var id = $.url().param('no')
  99 + ,roleObj;
  100 +
  101 + if(!id){
  102 + alert('缺少主键');
  103 + }
  104 + else{
  105 + $.get('/role/'+id , function(obj){
  106 + $('#roleCompanyAuthority #roleCode').text(obj.codeName);
  107 + $('#roleCompanyAuthority #roleName').text(obj.roleName);
  108 + });
  109 + }
  110 +
  111 +
  112 + $.get('/business/all', function (rs) {
  113 + var baseCode;
  114 + //找到跟节点
  115 + $.each(rs, function () {
  116 + if(this.upCode == 0){
  117 + baseCode=this.businessCode;
  118 + return false;
  119 + }
  120 + });
  121 + if(!baseCode){
  122 + alert('大爷找不到跟节点,数据有问题吧!!!');
  123 + return;
  124 + }
  125 + //提取二级节点
  126 + var secondMap={};
  127 + $.each(rs, function () {
  128 + if(this.upCode==baseCode){
  129 + secondMap[this.businessCode] = {
  130 + name: this.businessName,
  131 + childs: []
  132 + };
  133 + }
  134 + });
  135 + //分公司节点
  136 + $.each(rs, function () {
  137 + if(secondMap[this.upCode])
  138 + secondMap[this.upCode].childs.push(this);
  139 + });
  140 +
  141 + //排序
  142 + for(var sid in secondMap){
  143 + secondMap[sid].childs.sort(naturalSort);
  144 + }
  145 +
  146 + var htmlStr=template('role-company-authority-temp', {list: get_vals(secondMap)});
  147 + $('#roleCompanyAuthority .cmpy-list').html(htmlStr);
  148 +
  149 + //查询公司权限信息
  150 + $get('/companyAuthority/all', {roleId_eq: id}, function (rs) {
  151 + //console.log(rs);
  152 + var dataId;
  153 + $.each(rs, function () {
  154 + dataId=this.companyCode+'_'+this.subCompanyCode;
  155 + $('.cmpy-list div.sub-company[data-id='+dataId+']').addClass('active');
  156 + });
  157 + });
  158 + });
  159 +
  160 + $('#roleCompanyAuthority').on('click', '.cmpy-list .sub-company', function () {
  161 + if($(this).hasClass('active'))
  162 + $(this).removeClass('active');
  163 + else
  164 + $(this).addClass('active');
  165 + });
  166 +
  167 + var get_vals = function(json) {
  168 + var array = [];
  169 + for (var key in json) {
  170 + array.push(json[key]);
  171 + }
  172 +
  173 + return array;
  174 + }
  175 +
  176 + var naturalSort=function (a, b) {
  177 + return a.businessCode.localeCompare(b.businessCode);
  178 + }
  179 +
  180 + //保存
  181 + $('#roleCompanyAuthority .saveBtn').on('click', function () {
  182 + var ats=$('.cmpy-list div.sub-company.active', '#roleCompanyAuthority')
  183 + ,data=[];
  184 + var code;
  185 + $.each(ats, function () {
  186 + code = $(this).data('id').split('_');
  187 + data.push({
  188 + companyCode: code[0],
  189 + subCompanyCode: code[1],
  190 + companyName: $(this).data('company'),
  191 + subCompanyName: $(this).text()
  192 + });
  193 + });
  194 +
  195 + $post('/companyAuthority/save', {roleId: id, authJsonStr: JSON.stringify(data)}, function (rs) {
  196 + alert('保存成功!');
  197 + })
  198 + });
  199 +});
  200 +</script>
0 \ No newline at end of file 201 \ No newline at end of file
src/main/resources/static/pages/permission/role/list.html
@@ -66,9 +66,15 @@ @@ -66,9 +66,15 @@
66 <a href="settings.html?no={{role.id}}" data-pjax class=" font-blue " 66 <a href="settings.html?no={{role.id}}" data-pjax class=" font-blue "
67 style="display: inline-block; margin-right: 5px;"> <i 67 style="display: inline-block; margin-right: 5px;"> <i
68 class="fa fa-meh-o"> </i> 模块配置 68 class="fa fa-meh-o"> </i> 模块配置
69 - </a> <a href="javascript:;" class=" font-blue "  
70 - style="display: inline-block;" > <i class="fa fa-key">  
71 - </i> 分配资源 69 + </a>
  70 + <a href="javascript:;" class=" font-blue "
  71 + style="display: inline-block;color: #aaaaaa !important;" > <i class="fa fa-key">
  72 + </i> 系统资源权限
  73 + </a>
  74 +
  75 + <hr>
  76 + <a href="companyAuthority.html?no={{role.id}}" data-pjax class="font-blue"
  77 + style="display: inline-block; font-size: 12px;" > 分公司数据权限
72 </a> 78 </a>
73 </div> 79 </div>
74 </div> 80 </div>
src/main/resources/static/pages/report/inoutstation.html
@@ -169,44 +169,17 @@ @@ -169,44 +169,17 @@
169 locale : 'zh-cn' 169 locale : 'zh-cn'
170 }); 170 });
171 171
172 - $('#line').select2({  
173 - ajax: {  
174 - url: '/realSchedule/findLine',  
175 - type: 'post',  
176 - dataType: 'json',  
177 - delay: 150,  
178 - data: function(params){  
179 - return{line: params.term};  
180 - },  
181 - processResults: function (data) {  
182 - return {  
183 - results: data  
184 - };  
185 - },  
186 - cache: true  
187 - },  
188 - templateResult: function(repo){  
189 - if (repo.loading) return repo.text;  
190 - var h = '<span>'+repo.text+'</span>';  
191 - return h;  
192 - },  
193 - escapeMarkup: function (markup) { return markup; },  
194 - minimumInputLength: 1,  
195 - templateSelection: function(repo){  
196 - return repo.text;  
197 - },  
198 - language: {  
199 - noResults: function(){  
200 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
201 - },  
202 - inputTooShort : function(e) {  
203 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
204 - },  
205 - searching : function() {  
206 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
207 - } 172 +
  173 + $.get('/basic/lineCode2Name',function(result){
  174 + var data=[];
  175 +
  176 + for(var code in result){
  177 + data.push({id: code, text: result[code]});
208 } 178 }
209 - }); 179 + console.log(data);
  180 + initPinYinSelect2('#line',data,'');
  181 +
  182 + })
210 183
211 184
212 $("#query").on("click",function(){ 185 $("#query").on("click",function(){
src/main/resources/static/pages/report/message/message.html
@@ -112,44 +112,16 @@ @@ -112,44 +112,16 @@
112 $("#date").val(year + "-0" + month + "-" + day); 112 $("#date").val(year + "-0" + month + "-" + day);
113 } 113 }
114 114
115 - $('#line').select2({  
116 - ajax: {  
117 - url: '/realSchedule/findLine',  
118 - type: 'post',  
119 - dataType: 'json',  
120 - delay: 150,  
121 - data: function(params){  
122 - return{line: params.term};  
123 - },  
124 - processResults: function (data) {  
125 - return {  
126 - results: data  
127 - };  
128 - },  
129 - cache: true  
130 - },  
131 - templateResult: function(repo){  
132 - if (repo.loading) return repo.text;  
133 - var h = '<span>'+repo.text+'</span>';  
134 - return h;  
135 - },  
136 - escapeMarkup: function (markup) { return markup; },  
137 - minimumInputLength: 1,  
138 - templateSelection: function(repo){  
139 - return repo.text;  
140 - },  
141 - language: {  
142 - noResults: function(){  
143 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
144 - },  
145 - inputTooShort : function(e) {  
146 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
147 - },  
148 - searching : function() {  
149 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
150 - } 115 + $.get('/basic/lineCode2Name',function(result){
  116 + var data=[];
  117 +
  118 + for(var code in result){
  119 + data.push({id: code, text: result[code]});
151 } 120 }
152 - }); 121 + console.log(data);
  122 + initPinYinSelect2('#line',data,'');
  123 +
  124 + })
153 $('#code').select2({ 125 $('#code').select2({
154 ajax: { 126 ajax: {
155 url: '/realSchedule/sreachVehic', 127 url: '/realSchedule/sreachVehic',