Commit ccb63a54c28a3dbeb4ed5fd1ad42b2bdce047df5

Authored by 娄高锋
2 parents 7ebfa758 5bf9656a

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

Showing 26 changed files with 1546 additions and 1160 deletions

Too many changes to show.

To preserve performance only 26 of 113 files are displayed.

src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
1 1 package com.bsth.controller.realcontrol;
2 2  
3   -import java.util.Map;
4   -
5   -import org.springframework.beans.factory.annotation.Autowired;
6   -import org.springframework.web.bind.annotation.PathVariable;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.RestController;
11   -
12 3 import com.bsth.controller.BaseController;
13 4 import com.bsth.entity.realcontrol.LineConfig;
14 5 import com.bsth.service.realcontrol.LineConfigService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.*;
  8 +
  9 +import java.util.Map;
15 10  
16 11 @RestController
17 12 @RequestMapping("/lineConfig")
... ... @@ -39,4 +34,9 @@ public class LineConfigController extends BaseController<LineConfig, Integer>{
39 34 public Map<String, Object> editOutTimeType(@RequestParam String lineCode, @RequestParam int type){
40 35 return lineConfigService.editOutTimeType(lineCode, type);
41 36 }
  37 +
  38 + @RequestMapping(value = "/getByLineCode")
  39 + public LineConfig getByLineCode(@RequestParam String lineCode){
  40 + return lineConfigService.getByLineCode(lineCode);
  41 + }
42 42 }
... ...
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
... ... @@ -26,4 +26,13 @@ public class RealMapController {
26 26 public Map<String, Object> stationSpatialData(@RequestParam String idx){
27 27 return realMapService.stationSpatialData(idx);
28 28 }
  29 +
  30 + /**
  31 + * 停车场
  32 + * @return
  33 + */
  34 + @RequestMapping(value = "/carParkSpatialData")
  35 + public Map<String, Object> carParkSpatialData(){
  36 + return realMapService.carParkSpatialData();
  37 + }
29 38 }
... ...
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
... ... @@ -3,25 +3,24 @@ package com.bsth.controller.schedule;
3 3 import com.bsth.service.TrafficManageService;
4 4  
5 5 import org.springframework.beans.factory.annotation.Autowired;
6   -import org.springframework.web.bind.annotation.PathVariable;
7 6 import org.springframework.web.bind.annotation.RequestMapping;
8 7 import org.springframework.web.bind.annotation.RequestMethod;
9 8 import org.springframework.web.bind.annotation.RequestParam;
10 9 import org.springframework.web.bind.annotation.RestController;
11 10  
12 11 /**
13   - *
  12 + *
14 13 * @author BSTH
15 14 *
16 15 */
17 16 @RestController
18 17 @RequestMapping("trmg")
19 18 public class TrafficManageController {
20   -
  19 +
21 20 @Autowired
22   - private TrafficManageService trManageService;
23   -
24   -
  21 + private TrafficManageService trManageService;
  22 +
  23 +
25 24 @RequestMapping(value = "/setXL", method = RequestMethod.GET)
26 25 public String setXL() throws Exception {
27 26 try {
... ... @@ -30,7 +29,7 @@ public class TrafficManageController {
30 29 throw new Exception(exp.getCause());
31 30 }
32 31 }
33   -
  32 +
34 33 @RequestMapping(value = "/setCL", method = RequestMethod.GET)
35 34 public String setCL() throws Exception {
36 35 try {
... ... @@ -39,7 +38,7 @@ public class TrafficManageController {
39 38 throw new Exception(exp.getCause());
40 39 }
41 40 }
42   -
  41 +
43 42 @RequestMapping(value = "/setSJ", method = RequestMethod.GET)
44 43 public String setSJ() throws Exception {
45 44 try {
... ... @@ -48,16 +47,43 @@ public class TrafficManageController {
48 47 throw new Exception(exp.getCause());
49 48 }
50 49 }
51   -
52   - @RequestMapping(value = "/setCS", method = RequestMethod.GET)
53   - public String setCS() throws Exception {
  50 +
  51 + @RequestMapping(value = "/setLD", method = RequestMethod.GET)
  52 + public String setLD() throws Exception {
54 53 try {
55   - return trManageService.setCS();
  54 + return trManageService.setLD();
  55 + } catch (Exception exp) {
  56 + throw new Exception(exp.getCause());
  57 + }
  58 + }
  59 +
  60 + @RequestMapping(value = "/setLCYH", method = RequestMethod.GET)
  61 + public String setLCYH() throws Exception {
  62 + try {
  63 + return trManageService.setLCYH();
  64 + } catch (Exception exp) {
  65 + throw new Exception(exp.getCause());
  66 + }
  67 + }
  68 +
  69 + @RequestMapping(value = "/setDDRB", method = RequestMethod.GET)
  70 + public String setDDRB() throws Exception {
  71 + try {
  72 + return trManageService.setDDRB();
56 73 } catch (Exception exp) {
57 74 throw new Exception(exp.getCause());
58 75 }
59 76 }
60   -
  77 +
  78 + @RequestMapping(value = "/setJHBC", method = RequestMethod.GET)
  79 + public String setJHBC() throws Exception {
  80 + try {
  81 + return trManageService.setJHBC();
  82 + } catch (Exception exp) {
  83 + throw new Exception(exp.getCause());
  84 + }
  85 + }
  86 +
61 87 @RequestMapping(value = "/setSKB", method = RequestMethod.GET)
62 88 public String setSKB(@RequestParam("ids") String ids) throws Exception {
63 89 try {
... ... @@ -66,7 +92,7 @@ public class TrafficManageController {
66 92 throw new Exception(exp.getCause());
67 93 }
68 94 }
69   -
  95 +
70 96 @RequestMapping(value = "/setXLPC", method = RequestMethod.GET)
71 97 public String setXLPC() throws Exception {
72 98 try {
... ... @@ -75,13 +101,23 @@ public class TrafficManageController {
75 101 throw new Exception(exp.getCause());
76 102 }
77 103 }
78   -
79   - @RequestMapping(value = "/setJHBC", method = RequestMethod.GET)
80   - public String setJHBC() throws Exception {
  104 +
  105 + @RequestMapping(value = "/setCS", method = RequestMethod.GET)
  106 + public String setCS() throws Exception {
81 107 try {
82   - return trManageService.setDDRB();
  108 + return trManageService.setCS();
83 109 } catch (Exception exp) {
84 110 throw new Exception(exp.getCause());
85 111 }
86 112 }
  113 +
  114 + @RequestMapping(value = "/getDownLoadAllDataFile", method = RequestMethod.GET)
  115 + public String getDownLoadAllDataFile() throws Exception {
  116 + try {
  117 + return trManageService.getDownLoadAllDataFile();
  118 + } catch (Exception exp) {
  119 + throw new Exception(exp.getCause());
  120 + }
  121 + }
  122 +
87 123 }
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -70,7 +70,7 @@ public class BasicData implements CommandLineRunner {
70 70 public static Map<String, String> allPerson;
71 71  
72 72 //站点名和运管处编号 对照
73   - public static Map<String, Map<String, Map>> stationName2YgcNumber;
  73 + public static Map<String,Integer> stationName2YgcNumber;
74 74  
75 75  
76 76 static Logger logger = LoggerFactory.getLogger(BasicData.class);
... ... @@ -233,13 +233,6 @@ public class BasicData implements CommandLineRunner {
233 233 * @Description: TODO(加载线路相关信息)
234 234 */
235 235 public void loadLineInfo(){
236   - List<StationRoute> stationsList = null;// 站点路由集
237   - StationRoute stationRoute = null;
238   - int size = 0;
239   - Map<String, Integer> station2Number ;
240   - Map<String, Map> dirs2Statioin ;
241   - int[] dirs = {0,1};// 运行方向 上下行
242   - int num = 1;
243 236 Iterator<Line> iterator = lineRepository.findAll().iterator();
244 237  
245 238 Line line;
... ... @@ -247,7 +240,7 @@ public class BasicData implements CommandLineRunner {
247 240 Map<String, String> code2name = new HashMap<>();
248 241 Map<Integer, String> id2SHcode = new HashMap<Integer, String>();
249 242 Map<String, String> code2SHcode = new HashMap<String, String>();
250   - Map<String, Map<String, Map>> tempStationName2YgcNumber = new HashMap<String, Map<String, Map>>();
  243 + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>();
251 244  
252 245 while(iterator.hasNext()){
253 246 line = iterator.next();
... ... @@ -259,27 +252,26 @@ public class BasicData implements CommandLineRunner {
259 252 /**
260 253 * 加载运管处的站点及序号
261 254 * 上行从1开始,下行顺序续编
262   -
263   - num = 1;
264   - dirs2Statioin = new HashMap<String, Map>();
265   - for (int i = 0; i < dirs.length; i++) {
266   - // 分别取得上下行的站点
267   - stationsList = stationRouteRepository.findByLine(line.getLineCode(), dirs[i]);
268   - size = stationsList == null ? 0 :stationsList.size();
269   - if(size > 0 ){
270   - station2Number = new HashMap<String, Integer>();
271   - for (int j = 0; j < size; j++) {
272   - stationRoute = stationsList.get(j);
273   - // map保存为(站点名称 -->序号)
274   - station2Number.put(stationRoute.getStationName(), num++);
  255 + */
  256 + List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc();
  257 + if(ygcLines != null && ygcLines.size() > 0){
  258 + int size = ygcLines.size();
  259 + Object[] tempArray ;
  260 + int num = 1;
  261 + String key;
  262 + String lineCode = "";
  263 + for (int i = 0; i < size; i ++){
  264 + tempArray = ygcLines.get(i);
  265 + if(lineCode.equals("")){
  266 + lineCode = tempArray[0]+"";
  267 + }else if(!lineCode.equals(tempArray[0]+"")){
  268 + num = 1;
  269 + lineCode = tempArray[0]+"";
275 270 }
276   - // 保存两个数据,(0 --> station2Number)(1 --> station2Number) 0上行 1 下行
277   - dirs2Statioin.put(dirs[i]+"", station2Number);
  271 + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2];
  272 + tempStationName2YgcNumber.put(key,num++);
278 273 }
279 274 }
280   - // 保存(站点编码 --> dirs2Statioin)
281   - tempStationName2YgcNumber.put(line.getLineCode(), dirs2Statioin);
282   - */
283 275 }
284 276  
285 277 lineId2CodeMap = biMap;
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -2,6 +2,7 @@ package com.bsth.data.gpsdata;
2 2  
3 3 import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.Application;
5 6 import com.bsth.data.BasicData;
6 7 import com.bsth.data.forecast.ForecastRealServer;
7 8 import com.bsth.data.schedule.DayOfSchedule;
... ... @@ -23,6 +24,7 @@ import org.springframework.stereotype.Component;
23 24 import java.io.BufferedReader;
24 25 import java.io.InputStreamReader;
25 26 import java.util.*;
  27 +import java.util.concurrent.TimeUnit;
26 28  
27 29 /**
28 30 *
... ... @@ -65,7 +67,7 @@ public class GpsRealData implements CommandLineRunner{
65 67 @Override
66 68 public void run(String... arg0) throws Exception {
67 69 logger.info("gpsDataLoader,20,6");
68   - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
  70 + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
69 71 }
70 72  
71 73 public GpsEntity add(GpsEntity gps) {
... ...
src/main/java/com/bsth/entity/Line.java
... ... @@ -144,6 +144,9 @@ public class Line implements Serializable {
144 144 /** 修改日期 timestamp */
145 145 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
146 146 private Date updateDate;
  147 +
  148 + /** 是否在使用 <1:是;0:否> bit length(50) */
  149 + private Integer inUse;
147 150  
148 151 public Integer getWarrantCar() {
149 152 return warrantCar;
... ... @@ -448,4 +451,8 @@ public class Line implements Serializable {
448 451 public void setUpdateDate(Date updateDate) {
449 452 this.updateDate = updateDate;
450 453 }
  454 +
  455 + public Integer getInUse() { return inUse; }
  456 +
  457 + public void setInUse(Integer inUse) { this.inUse = inUse; }
451 458 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -257,4 +257,15 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
257 257 @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)
258 258 @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1")
259 259 List<StationRoute> findByLineCode(String lineCode);
  260 +
  261 + @Query("SELECT " +
  262 + "lineCode,directions,stationName,stationRouteCode " +
  263 + "FROM " +
  264 + "StationRoute s " +
  265 + "WHERE " +
  266 + "s.destroy = 0 " +
  267 + "and s.lineCode in(select lineCode from Line where inUse = 1) " +
  268 + "ORDER BY " +
  269 + "lineCode,directions,stationRouteCode")
  270 + List<Object[]> findAllLineWithYgc();
260 271 }
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
1 1 package com.bsth.service.impl;
2 2  
3   -import java.io.BufferedOutputStream;
4   -import java.io.File;
5   -import java.io.FileOutputStream;
6   -import java.io.IOException;
7   -import java.sql.Connection;
8   -import java.sql.PreparedStatement;
9   -import java.sql.ResultSet;
10   -import java.text.DecimalFormat;
11   -import java.text.SimpleDateFormat;
12   -import java.util.Date;
13   -import java.util.HashMap;
14   -import java.util.Iterator;
15   -import java.util.List;
16   -import java.util.Map;
17   -import java.util.Set;
18   -
19   -import org.apache.commons.lang.time.DateUtils;
20   -import org.slf4j.Logger;
21   -import org.slf4j.LoggerFactory;
22   -import org.springframework.beans.factory.annotation.Autowired;
23   -import org.springframework.data.domain.Sort;
24   -import org.springframework.data.domain.Sort.Direction;
25   -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
26   -import org.springframework.stereotype.Service;
27   -
28 3 import com.bsth.data.BasicData;
29   -import com.bsth.entity.Cars;
30   -import com.bsth.entity.Line;
31   -import com.bsth.entity.LineInformation;
32   -import com.bsth.entity.Personnel;
33   -import com.bsth.entity.StationRoute;
  4 +import com.bsth.entity.*;
34 5 import com.bsth.entity.realcontrol.ChildTaskPlan;
35 6 import com.bsth.entity.realcontrol.ScheduleRealInfo;
36 7 import com.bsth.entity.schedule.SchedulePlanInfo;
37 8 import com.bsth.entity.schedule.TTInfo;
38 9 import com.bsth.entity.schedule.TTInfoDetail;
39 10 import com.bsth.entity.search.CustomerSpecs;
40   -import com.bsth.repository.CarsRepository;
41   -import com.bsth.repository.LineInformationRepository;
42   -import com.bsth.repository.LineRepository;
43   -import com.bsth.repository.PersonnelRepository;
44   -import com.bsth.repository.StationRouteRepository;
45   -import com.bsth.repository.schedule.CarConfigInfoRepository;
46   -import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
47   -import com.bsth.repository.schedule.SchedulePlanInfoRepository;
48   -import com.bsth.repository.schedule.TTInfoDetailRepository;
49   -import com.bsth.repository.schedule.TTInfoRepository;
  11 +import com.bsth.repository.*;
  12 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  13 +import com.bsth.repository.schedule.*;
50 14 import com.bsth.service.TrafficManageService;
51 15 import com.bsth.util.TimeUtils;
52 16 import com.bsth.util.db.DBUtils_MS;
... ... @@ -54,7 +18,25 @@ import com.bsth.webService.trafficManage.geotool.services.Internal;
54 18 import com.bsth.webService.trafficManage.geotool.services.InternalPortType;
55 19 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator;
56 20 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap;
57   -import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  21 +import org.apache.commons.lang.time.DateUtils;
  22 +import org.slf4j.Logger;
  23 +import org.slf4j.LoggerFactory;
  24 +import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.data.domain.Sort;
  26 +import org.springframework.data.domain.Sort.Direction;
  27 +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
  28 +import org.springframework.stereotype.Service;
  29 +
  30 +import java.io.BufferedOutputStream;
  31 +import java.io.File;
  32 +import java.io.FileOutputStream;
  33 +import java.io.IOException;
  34 +import java.sql.Connection;
  35 +import java.sql.PreparedStatement;
  36 +import java.sql.ResultSet;
  37 +import java.text.DecimalFormat;
  38 +import java.text.SimpleDateFormat;
  39 +import java.util.*;
58 40 /**
59 41 *
60 42 * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类)
... ... @@ -63,7 +45,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
63 45 *
64 46 * @Description: TODO(运管处接口service业务层)
65 47 *
66   - * @Author bsth@z
  48 + * @Author bsth@zq
67 49 *
68 50 * @Date 2016年10月28日 上午9:21:17
69 51 *
... ... @@ -158,8 +140,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
158 140 @Override
159 141 public String setXL() {
160 142 String result = "failure";
  143 + StringBuffer sBuffer = new StringBuffer();
161 144 try {
162   - StringBuffer sBuffer = new StringBuffer(); ;
163 145 Iterator<Line> lineIterator = lineRepository.findAll().iterator();
164 146 Line line = null;
165 147 List<StationRoute> stationsList = null;// 站点路由集
... ... @@ -168,7 +150,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
168 150 sBuffer.append("<XLs>");
169 151 while(lineIterator.hasNext()){
170 152 line = lineIterator.next();
171   - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){
  153 + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null
  154 + || line.getInUse() == 0){
172 155 continue;
173 156 }
174 157 sBuffer.append("<XL>");
... ... @@ -208,7 +191,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
208 191 sBuffer.append("</XLs>");
209 192 System.out.println(sBuffer.toString());
210 193 if(sBuffer.indexOf("<XL>") != -1){
211   - logger.info("setXL:"+sBuffer.toString());
212 194 String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString());
213 195 String portArray[] = portResult.split("\n");
214 196 if(portArray.length >= 4){
... ... @@ -224,8 +206,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
224 206 }
225 207 }
226 208 } catch (Exception e) {
  209 + logger.error("setXL:",e);
227 210 e.printStackTrace();
228 211 }finally{
  212 + logger.info("setXL:"+sBuffer.toString());
229 213 logger.info("setXL:"+result);
230 214 }
231 215 return result;
... ... @@ -237,8 +221,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
237 221 @Override
238 222 public String setCL() {
239 223 String result = "failure";
  224 + StringBuffer sBuffer =new StringBuffer();
240 225 try {
241   - StringBuffer sBuffer =new StringBuffer();
242 226 sBuffer.append("<CLs>");
243 227 Cars cars = null;
244 228 String company;
... ... @@ -258,13 +242,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
258 242 sBuffer.append("</CL>");
259 243 }
260 244 sBuffer.append("</CLs>");
261   - logger.info("setCL:"+sBuffer.toString());
262 245 if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
263 246 result = "success";
264 247 }
265 248 } catch (Exception e) {
  249 + logger.error("setCL:",e);
266 250 e.printStackTrace();
267 251 }finally{
  252 + logger.info("setCL:"+sBuffer.toString());
268 253 logger.info("setCL:"+result);
269 254 }
270 255 return result;
... ... @@ -276,8 +261,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
276 261 @Override
277 262 public String setSJ() {
278 263 String result = "failure";
  264 + StringBuffer sBuffer =new StringBuffer();
279 265 try {
280   - StringBuffer sBuffer =new StringBuffer();
281 266 sBuffer.append("<SJs>");
282 267 Personnel personnel = null;
283 268 String company;
... ... @@ -295,13 +280,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
295 280 sBuffer.append("</SJ>");
296 281 }
297 282 sBuffer.append("</SJs>");
298   - logger.info("setSJ:"+sBuffer.toString());
299 283 if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
300 284 result = "success";
301 285 };
302 286 } catch (Exception e) {
  287 + logger.error("setSJ:",e);
303 288 e.printStackTrace();
304 289 }finally{
  290 + logger.info("setSJ:"+sBuffer.toString());
305 291 logger.info("setSJ:"+result);
306 292 }
307 293 return result;
... ... @@ -309,15 +295,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
309 295  
310 296 /**
311 297 * 上传路单
312   - * @param date
313   - * @return xml格式的字符串
  298 + * @return 上传成功标识
314 299 */
315 300 public String setLD(){
316 301 String result = "failure";
317 302 // 取昨天 的日期
318 303 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
  304 + StringBuffer sf = new StringBuffer();
319 305 try {
320   - StringBuffer sf = new StringBuffer();
321 306 sf.append("<DLDS>");
322 307 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
323 308 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date);
... ... @@ -368,20 +353,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{
368 353 sf.append("</LD>");
369 354 }
370 355 }
371   -
372 356 sf.append("</LDList>");
373 357 sf.append("</DLD>");
374 358 }
375 359 }
376   -
377 360 sf.append("</DLDS>");
378   - logger.info("setLD:"+sf.toString());
379 361 if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){
380 362 result = "success";
381 363 }
382 364 } catch (Exception e) {
  365 + logger.error("setLD:",e);
383 366 e.printStackTrace();
384 367 }finally{
  368 + logger.info("setLD:"+sf.toString());
385 369 logger.info("setLD:"+result);
386 370 }
387 371 return result;
... ... @@ -389,15 +373,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
389 373  
390 374 /**
391 375 * 上传里程油耗
392   - * @param date
393   - * @return
  376 + * @return 上传成功标识
394 377 */
395 378 public String setLCYH(){
396 379 String result = "failure";
397 380 // 取昨天 的日期
398 381 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
  382 + StringBuffer sf = new StringBuffer();
399 383 try {
400   - StringBuffer sf = new StringBuffer();
401 384 sf.append("<LCYHS>");
402 385 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date);
403 386 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
... ... @@ -451,13 +434,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
451 434 }
452 435 }
453 436 sf.append("</LCYHS>");
454   - logger.info("setLCYH:"+sf.toString());
455 437 if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){
456 438 result = "success";
457 439 }
458 440 } catch (Exception e) {
  441 + logger.error("setLCYH:",e);
459 442 e.printStackTrace();
460 443 }finally{
  444 + logger.info("setLCYH:"+sf.toString());
461 445 logger.info("setLCYH:"+result);
462 446 }
463 447 return result;
... ... @@ -471,8 +455,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
471 455 String result = "failure";
472 456 // 取昨天 的日期
473 457 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
  458 + StringBuffer sf = new StringBuffer();
474 459 try {
475   - StringBuffer sf = new StringBuffer();
476 460 sf.append("<DDRBS>");
477 461 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date);
478 462 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
... ... @@ -554,13 +538,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
554 538 }
555 539 }
556 540 sf.append("</DDRBS>");
557   - logger.info("setDDRB:"+sf.toString());
558 541 if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){
559 542 result = "success";
560 543 }
561 544 } catch (Exception e) {
  545 + logger.error("setDDRB:",e);
562 546 e.printStackTrace();
563 547 }finally{
  548 + logger.info("setDDRB:"+sf.toString());
564 549 logger.info("setDDRB:"+result);
565 550 }
566 551 return result;
... ... @@ -572,8 +557,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
572 557 @Override
573 558 public String setJHBC() {
574 559 String result = "failure";
  560 + StringBuffer sBuffer =new StringBuffer();
575 561 try {
576   - StringBuffer sBuffer =new StringBuffer();
577 562 sBuffer.append("<JHBCs>");
578 563 // 声明变量
579 564 SchedulePlanInfo schedulePlanInfo = null;
... ... @@ -633,13 +618,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
633 618 }
634 619 }
635 620 sBuffer.append("</JHBCs>");
636   - logger.info("setJHBC:"+sBuffer.toString());
637 621 if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
638 622 result = "success";
639 623 }
640 624 } catch (Exception e) {
  625 + logger.error("setJHBC:",e);
641 626 e.printStackTrace();
642 627 }finally{
  628 + logger.info("setJHBC:"+sBuffer.toString());
643 629 logger.info("setJHBC:"+result);
644 630 }
645 631 return result;
... ... @@ -651,14 +637,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
651 637 @Override
652 638 public String setSKB(String ids) {
653 639 String result = "failure";
  640 + StringBuffer sBuffer = new StringBuffer();
654 641 try {
655 642 String[] idArray = ids.split(",");
656   - StringBuffer sBuffer = new StringBuffer();
  643 + StringBuffer sBufferA;
  644 + StringBuffer sBufferB;
657 645 TTInfo ttInfo;
658   - TTInfoDetail ttInfoDetail;
  646 + TTInfoDetail ttInfoDetail = null;
659 647 Iterator<TTInfoDetail> ttInfoDetailIterator;
660 648 HashMap<String,Object> param = new HashMap<String, Object>();
661   - String ttinfoJhlc = null;//计划总里程
662 649 String lineCode ;
663 650 sBuffer.append("<SKBs>");
664 651 for (int i = 0; i < idArray.length; i++) {
... ... @@ -668,57 +655,61 @@ public class TrafficManageServiceImpl implements TrafficManageService{
668 655 param.put("ttinfo.id_eq", ttInfo.getId());
669 656 ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param),
670 657 new Sort(Direction.ASC, "xlDir")).iterator();
671   - sBuffer.append("<SKB>");
672   - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId()))
673   - .append("</XLBM>");
674   - ttinfoJhlc = new String();
675   - sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>");
676   - sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>");
677   - sBuffer.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>");
678   - sBuffer.append("<JSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</JSRQ>");/////////
679   - sBuffer.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>");
680   - sBuffer.append("<TBYY>").append("").append("</TBYY>");
681   - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>");
682   - int num = 1;
683   - // 加上<BCList>
684 658 if(ttInfoDetailIterator.hasNext()){
685   - sBuffer.append("<BCList>");
686   - }
687   - while (ttInfoDetailIterator.hasNext()) {
688   - ttInfoDetail = ttInfoDetailIterator.next();
689   - if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){
690   - continue;
  659 + sBuffer.append("<SKB>");
  660 + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId()))
  661 + .append("</XLBM>");
  662 + sBufferB = new StringBuffer();
  663 + sBufferB.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>");
  664 + // 结束日期暂时不要,节假日的班次表才需要,如春节的班次表
  665 + sBufferB.append("<JSRQ>").append("").append("</JSRQ>");
  666 + sBufferB.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>");
  667 + sBufferB.append("<TBYY>").append("").append("</TBYY>");
  668 + sBufferB.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>");
  669 + sBufferB.append("<BCList>");
  670 + int num = 1;
  671 + while (ttInfoDetailIterator.hasNext()) {
  672 + ttInfoDetail = ttInfoDetailIterator.next();
  673 + if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){
  674 + continue;
  675 + }
  676 + if(num++ == 1){
  677 + sBufferA = new StringBuffer();
  678 + sBufferA.append("<JHZLC>").append(ttInfoDetail.getJhlc()).append("</JHZLC>");
  679 + sBufferA.append("<JHYYLC>").append(ttInfoDetail.getJhlc()).append("</JHYYLC>");
  680 + sBuffer.append(sBufferA).append(sBufferB);
  681 + }
  682 + lineCode = ttInfoDetail.getXl().getLineCode();
  683 + // 如果发车时间格式错误,忽略此条
  684 + if(changeTimeFormat(ttInfoDetail) == null){
  685 + continue;
  686 + }
  687 + sBuffer.append("<BC>");
  688 + sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");
  689 + sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>");
  690 + sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>");
  691 + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
  692 + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>");
  693 + sBuffer.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>");
  694 + sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>");
  695 + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
  696 + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</DDXH>");
  697 + sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");
  698 + sBuffer.append("</BC>");
691 699 }
692   - ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程
693   - lineCode = ttInfoDetail.getXl().getLineCode();
694   - sBuffer.append("<BC>");
695   - sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");
696   - sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>");
697   - sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>");
698   - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
699   - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>");
700   - sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>");
701   - sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>");
702   - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
703   - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</ZDXH>");
704   - sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");
705   - sBuffer.append("</BC>");
706   -
707   - num++;
708   - }
709   - if(sBuffer.indexOf("<BCList>") != -1){
710 700 sBuffer.append("</BCList>");
  701 + sBuffer.append("</SKB>");
711 702 }
712   - sBuffer.append("</SKB>");
713 703 }
714 704 sBuffer.append("</SKBs>");
715   - logger.info("setSKB:"+sBuffer.toString());
716 705 if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
717 706 result = "success";
718 707 }
719 708 } catch (Exception e) {
  709 + logger.error("setSKB:", e);
720 710 e.printStackTrace();
721 711 }finally{
  712 + logger.info("setSKB:"+sBuffer.toString());
722 713 logger.info("setSKB:"+result);
723 714 }
724 715 return result;
... ... @@ -730,8 +721,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
730 721 @Override
731 722 public String setXLPC() {
732 723 String result = "failure";
  724 + StringBuffer sBuffer =new StringBuffer();
733 725 try {
734   - StringBuffer sBuffer =new StringBuffer();
735 726 sBuffer.append("<XLPCs>");
736 727 // 声明变量
737 728 Line line = null;
... ... @@ -773,13 +764,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
773 764 sBuffer.append("</XLPC>");
774 765 }
775 766 sBuffer.append("</XLPCs>");
776   - logger.info("setXLPC:"+sBuffer.toString());
777 767 if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
778 768 result = "success";
779 769 }
780 770 } catch (Exception e) {
  771 + logger.error("setXLPC:",e);
781 772 e.printStackTrace();
782 773 }finally{
  774 + logger.info("setXLPC:"+sBuffer.toString());
783 775 logger.info("setXLPC:"+result);
784 776 }
785 777 return result;
... ... @@ -832,13 +824,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
832 824 sBuffer.append("</CS>");
833 825 }
834 826 sBuffer.append("</CSs>");
835   - logger.info("setCS:"+sBuffer.toString());
836 827 if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
837 828 result = "success";
838 829 }
839 830 } catch (Exception e) {
  831 + logger.error("setCS:",e);
840 832 e.printStackTrace();
841 833 } finally {
  834 + logger.info("setCS:"+sBuffer.toString());
842 835 logger.info("setCS:"+result);
843 836 DBUtils_MS.close(rs, ps, conn);
844 837 }
... ... @@ -949,11 +942,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{
949 942 min = fullTime % 60;
950 943 sumHour = Integer.valueOf(fcsjArray[0])+hour;
951 944 if(sumHour >= 24){
952   - result = sumHour - 24+":";
  945 + result = String.format("%02d",sumHour - 24);
953 946 }else{
954   - result = sumHour +":";
  947 + result = String.format("%02d",sumHour);;
955 948 }
956   - result +=String.format("%02d", min);
  949 + result +=":"+String.format("%02d", min);
957 950 }else{
958 951 result = fcsj;
959 952 }
... ... @@ -961,6 +954,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{
961 954 }
962 955  
963 956 /**
  957 + * 改变时间格式
  958 + * @param ttInfoDetail 时刻表详细
  959 + * @return xx:yy
  960 + */
  961 + private String changeTimeFormat(TTInfoDetail ttInfoDetail){
  962 + String result = "00:00";
  963 + String fcsj = ttInfoDetail.getFcsj();
  964 + if(fcsj.indexOf(":") != -1){
  965 + // 时和分隔开
  966 + String[] fcsjArray = fcsj.split(":");
  967 + result = String.format("%02d", Integer.valueOf(fcsjArray[0]))+":";
  968 + result +=String.format("%02d", Integer.valueOf(fcsjArray[1]));
  969 + }else{
  970 + result = null;
  971 + logger.info("setSKB:发车时间错误:ttInfoDetail.id="+ttInfoDetail.getId());
  972 + }
  973 + return result;
  974 + }
  975 +
  976 + /**
964 977 * 拼装线路计划班次表的XML
965 978 * @param sBuffer
966 979 * @param schedulePlanInfo
... ... @@ -993,7 +1006,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
993 1006 flag = 0;
994 1007 }
995 1008 result += flag;
996   - if(i !=ruleDayArray.length ){
  1009 + if(i !=ruleDayArray.length -1){
997 1010 result +=",";
998 1011 }
999 1012 }
... ... @@ -1017,15 +1030,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1017 1030 }
1018 1031 }
1019 1032 /**
1020   - * @param stations 站点路由集
  1033 + * @param stationsList 站点路由集
1021 1034 * @param sBuffer sBuffer
1022   - * @param StartId 站点序号起始ID
  1035 + * @param startId 站点序号起始ID
1023 1036 *
1024 1037 * @return 站点序号累加后的ID
1025 1038 */
1026 1039 private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){
1027 1040 int size = stationsList.size();
1028   - StationRoute srRoute = null;
  1041 + StationRoute srRoute;
1029 1042 String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站
1030 1043 for (int i = 0; i < size; i++) {
1031 1044 srRoute = stationsList.get(i);
... ... @@ -1062,9 +1075,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1062 1075 */
1063 1076 private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){
1064 1077 Integer number = 0;
1065   - Map<String, Map> dirs2Statioin = BasicData.stationName2YgcNumber.get(lineCode);
1066   - Map<String, Integer> station2Number = dirs2Statioin.get(direction);
1067   - number = station2Number.get(stationName);
  1078 + number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationName);
1068 1079 return number;
1069 1080 }
1070 1081 }
... ...
src/main/java/com/bsth/service/realcontrol/LineConfigService.java
1 1 package com.bsth.service.realcontrol;
2 2  
3   -import java.util.Map;
4   -
5 3 import com.bsth.entity.realcontrol.LineConfig;
6 4 import com.bsth.service.BaseService;
7 5  
  6 +import java.util.Map;
  7 +
8 8 public interface LineConfigService extends BaseService<LineConfig, Integer>{
9 9  
10 10 Map<String, Object> check(String[] codeArray);
... ... @@ -15,4 +15,5 @@ public interface LineConfigService extends BaseService&lt;LineConfig, Integer&gt;{
15 15  
16 16 Map<String, Object> editOutTimeType(String lineCode, int type);
17 17  
  18 + LineConfig getByLineCode(String lineCode);
18 19 }
... ...
src/main/java/com/bsth/service/realcontrol/RealMapService.java
... ... @@ -7,4 +7,6 @@ import java.util.Map;
7 7 */
8 8 public interface RealMapService {
9 9 Map<String, Object> stationSpatialData(String idx);
  10 +
  11 + Map<String,Object> carParkSpatialData();
10 12 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
1 1 package com.bsth.service.realcontrol.impl;
2 2  
3   -import java.util.ArrayList;
4   -import java.util.HashMap;
5   -import java.util.List;
6   -import java.util.Map;
7   -
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.stereotype.Service;
10   -
11 3 import com.bsth.common.ResponseCode;
12 4 import com.bsth.data.LineConfigData;
13 5 import com.bsth.entity.realcontrol.LineConfig;
14 6 import com.bsth.repository.realcontrol.LineConfigRepository;
15 7 import com.bsth.service.impl.BaseServiceImpl;
16 8 import com.bsth.service.realcontrol.LineConfigService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import java.util.ArrayList;
  13 +import java.util.HashMap;
  14 +import java.util.List;
  15 +import java.util.Map;
17 16  
18 17 @Service
19 18 public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> implements LineConfigService{
... ... @@ -78,4 +77,9 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
78 77 rs.put("type", type);
79 78 return rs;
80 79 }
  80 +
  81 + @Override
  82 + public LineConfig getByLineCode(String lineCode) {
  83 + return lineConfigData.get(lineCode);
  84 + }
81 85 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl;
2 2  
3 3 import com.bsth.common.ResponseCode;
4 4 import com.bsth.controller.realcontrol.dto.StationSpatialData;
  5 +import com.bsth.entity.CarPark;
5 6 import com.bsth.service.realcontrol.RealMapService;
6 7 import com.google.common.base.Splitter;
7 8 import org.slf4j.Logger;
... ... @@ -52,4 +53,22 @@ public class RealMapServiceImpl implements RealMapService {
52 53  
53 54 return rs;
54 55 }
  56 +
  57 + @Override
  58 + public Map<String, Object> carParkSpatialData() {
  59 + Map<String, Object> rs = new HashMap();
  60 +
  61 + try {
  62 + String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0";
  63 +
  64 + List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class));
  65 + rs.put("status", ResponseCode.SUCCESS);
  66 + rs.put("list", list);
  67 + } catch (Exception e) {
  68 + logger.error("", e);
  69 + rs.put("status", ResponseCode.ERROR);
  70 + rs.put("msg", "查询停车场空间数据出现异常!");
  71 + }
  72 + return rs;
  73 + }
55 74 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -276,8 +276,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
276 276 return rs;
277 277 }
278 278 //截取工号
279   - if(t.getsGh().indexOf("-") != -1){
280   - t.setsGh(t.getsGh().split("-")[1]);
  279 + if(t.getjGh().indexOf("-") != -1){
  280 + t.setjGh(t.getjGh().split("-")[1]);
281 281 }
282 282  
283 283 t.setScheduleDateStr(schDate);
... ... @@ -1631,7 +1631,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1631 1631 */
1632 1632 @Override
1633 1633 public Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs) {
1634   - Map<String, Object> rs = new HashMap<>();
  1634 + Map<String, Object> rs = new HashMap<>()
  1635 + ,tempMap = new HashMap<>();
1635 1636 List<ScheduleRealInfo> list = new ArrayList<>();
1636 1637  
1637 1638 ScheduleRealInfo sch,next;
... ... @@ -1639,20 +1640,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1639 1640 if(StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj()))
1640 1641 continue;
1641 1642  
1642   - sch = dayOfSchedule.get(dc.getSchId());
  1643 + /*sch = dayOfSchedule.get(dc.getSchId());
1643 1644 if(sch==null)
1644 1645 continue;
1645 1646  
1646 1647 sch.setDfsjAll(dc.getNew_dfsj());
1647 1648 //重新计算终点时间
1648 1649 sch.calcEndTime();
1649   - list.add(sch);
  1650 + list.add(sch);*/
  1651 + tempMap = outgoAdjust(dc.getSchId(),"", dc.getNew_dfsj());
1650 1652  
1651   - next=dayOfSchedule.next(sch);
1652   - if(next.getQdzName().equals(sch.getZdzName())){
  1653 + if(tempMap.get("status").equals(ResponseCode.SUCCESS)){
  1654 + list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts"));
  1655 + }
  1656 + //next=dayOfSchedule.next(sch);
  1657 + /*if(next.getQdzName().equals(sch.getZdzName())){
1653 1658 next.setQdzArrDateJH(sch.getZdsj());
1654 1659 list.add(next);
1655   - }
  1660 + }*/
1656 1661 }
1657 1662  
1658 1663 rs.put("status", ResponseCode.SUCCESS);
... ...
src/main/resources/application-dev.properties
... ... @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= false
10 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/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13 13 spring.datasource.password= 123456
14 14 #DATASOURCE
... ...
src/main/resources/ms-jdbc.properties
1   -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
3   -ms.mysql.username= root
4   -ms.mysql.password= 123456
5   -
6 1 #ms.mysql.driver= com.mysql.jdbc.Driver
7   -#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  2 +#ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false
8 3 #ms.mysql.username= root
9   -#ms.mysql.password= root2jsp
10 4 \ No newline at end of file
  5 +#ms.mysql.password= 123456
  6 +
  7 +ms.mysql.driver= com.mysql.jdbc.Driver
  8 +ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
  9 +ms.mysql.username= root
  10 +ms.mysql.password= root2jsp
11 11 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/Gruntfile.js
... ... @@ -11,6 +11,9 @@ module.exports = function (grunt) {
11 11 clean: {
12 12 concat_directive: { // 所有指令合并的js文件
13 13 src: ['module/common/prj-common-directive.js']
  14 + },
  15 + concat_route: { // 所有模块的route配置合并的js文件
  16 + src: ['module/common/prj-common-ui-route-state.js']
14 17 }
15 18  
16 19 //,
... ... @@ -79,6 +82,28 @@ module.exports = function (grunt) {
79 82 'module/common/dts2/bcGroup/saBcgroup.js' // 班次选择整合指令
80 83 ],
81 84 dest: 'module/common/prj-common-directive.js'
  85 + },
  86 + route: {
  87 + options: {
  88 + banner: '//所有模块ui route 配置'
  89 + },
  90 + src: [
  91 + 'module/basicInfo/busInfoManage/route.js', // 车辆基础信息管理模块
  92 + 'module/basicInfo/deviceInfoManage/route.js', // 设备管理模块
  93 + 'module/basicInfo/employeeInfoManage/route.js', // 人员基础信息管理模块
  94 + 'module/core/busConfig/route.js', // 车辆配置模块
  95 + 'module/core/busLineInfoStat/route.js', // 线路运营概览模块
  96 + 'module/core/employeeConfig/route.js', // 人员配置模块
  97 + 'module/core/guideboardManage/route.js', // 路牌管理模块
  98 + 'module/core/rerunManage/route.js', // 套跑管理模块
  99 + 'module/core/schedulePlanManage/route.js', // 排班计划管理模块
  100 + 'module/core/schedulePlanManage/info/route.js', // 排班计划明细管理模块
  101 + 'module/core/schedulePlanManage/report/route.js', // 排班计划明日运营模块
  102 + 'module/core/scheduleRuleManage/route.js', // 排班规则管理模块
  103 + 'module/core/ttInfoManage/route.js', // 时刻表管理模块
  104 + 'module/core/ttInfoManage/detailedit/route.js' // 时刻表明细管理模块
  105 + ],
  106 + dest: 'module/common/prj-common-ui-route-state.js'
82 107 }
83 108 },
84 109  
... ... @@ -401,6 +426,18 @@ module.exports = function (grunt) {
401 426 1、clean:concat_directive,清除合并生成的prj-common-directive.js文件
402 427 2、concat:directive,重新合并prj-common-directive.js文件
403 428 */
404   - grunt.registerTask('directive', ['clean:concat_directive', 'concat:directive']);
  429 + grunt.registerTask('directive', [
  430 + 'clean:concat_directive', 'concat:directive'
  431 + ]);
  432 +
  433 + /*
  434 + 定义了一个route的grunt任务
  435 + 任务组有顺序,如下说明:
  436 + 1、clean:concat_route,清除合并生成的prj-common-ui-route-state.js文件
  437 + 2、concat:route,重新合并prj-common-ui-route-state.js文件
  438 + */
  439 + grunt.registerTask('route', [
  440 + 'clean:concat_route', 'concat:route'
  441 + ]);
405 442  
406 443 };
407 444 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/dist/busInfoManage.dist.html deleted 100644 → 0
1   -<div class="page-head">
2   - <div class="page-title">
3   - <h1>车辆信息管理</h1>
4   - </div>
5   -</div>
6   -
7   -<ul class="page-breadcrumb breadcrumb">
8   - <li>
9   - <a href="/pages/home.html" data-pjax>首页</a>
10   - <i class="fa fa-circle"></i>
11   - </li>
12   - <li>
13   - <span class="active">基础信息</span>
14   - <i class="fa fa-circle"></i>
15   - </li>
16   - <li>
17   - <span class="active">车辆信息管理</span>
18   - </li>
19   -
20   -</ul>
21   -
22   -<div class="row">
23   - <div class="col-md-12">
24   - dfdfdfdfdf
25   - </div>
26   -</div>
27 0 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js renamed to src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
1   -// 车辆基础信息维护 service controller等写在一起
2   -
3   -angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) {
4   -
5   - /** 当前的查询条件信息 */
6   - var currentSearchCondition = {
7   - "carCode_like" : "",
8   - "insideCode_like" : "",
9   - "equipmentCode_like" : "",
10   - "carPlate_like" : ""
11   - };
12   -
13   - /** 当前第几页 */
14   - var currentPageNo = 1;
15   - return {
16   - /**
17   - * 获取查询条件信息,
18   - * 用于给controller用来和页面数据绑定。
19   - */
20   - getSearchCondition: function() {
21   - return currentSearchCondition;
22   - },
23   - /**
24   - * 重置查询条件信息。
25   - */
26   - resetSearchCondition: function() {
27   - var key;
28   - for (key in currentSearchCondition) {
29   - currentSearchCondition[key] = undefined;
30   - }
31   - currentPageNo = 1;
32   - },
33   - /**
34   - * 设置当前页码。
35   - * @param cpn 从1开始,后台是从0开始的
36   - */
37   - setCurrentPageNo: function(cpn) {
38   - currentPageNo = cpn;
39   - },
40   - /**
41   - * 组装查询参数,返回一个promise查询结果。
42   - * @param params 查询参数
43   - * @return 返回一个 promise
44   - */
45   - getPage: function() {
46   - var params = currentSearchCondition; // 查询条件
47   - params.page = currentPageNo - 1; // 服务端页码从0开始
48   - return service.rest.list(params).$promise;
49   - },
50   - /**
51   - * 获取明细信息。
52   - * @param id 车辆id
53   - * @return 返回一个 promise
54   - */
55   - getDetail: function(id) {
56   - var params = {id: id};
57   - return service.rest.get(params).$promise;
58   - },
59   - /**
60   - * 保存信息。
61   - * @param obj 车辆详细信息
62   - * @return 返回一个 promise
63   - */
64   - saveDetail: function(obj) {
65   - return service.rest.save(obj).$promise;
66   - },
67   - /**
68   - * 数据导出。
69   - * @returns {*|Function|promise|n}
70   - */
71   - dataExport: function() {
72   - return service.dataTools.dataExport().$promise;
73   - }
74   - };
75   -}]);
76   -
77   -angular.module('ScheduleApp').controller('BusInfoManageCtrl', [
78   - 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g',
79   - function(busInfoManageService, $state, $uibModal, fileDownload) {
80   - var self = this;
81   -
82   - // 切换到form状态
83   - self.goForm = function() {
84   - //alert("切换");
85   - $state.go("busInfoManage_form");
86   - };
87   -
88   - // 导入excel
89   - self.importData = function() {
90   - // large方式弹出模态对话框
91   - var modalInstance = $uibModal.open({
92   - templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',
93   - size: "lg",
94   - animation: true,
95   - backdrop: 'static',
96   - resolve: {
97   - // 可以传值给controller
98   - },
99   - windowClass: 'center-modal',
100   - controller: "BusInfoManageToolsCtrl",
101   - controllerAs: "ctrl",
102   - bindToController: true
103   - });
104   - modalInstance.result.then(
105   - function() {
106   - console.log("dataImport.html打开");
107   - },
108   - function() {
109   - console.log("dataImport.html消失");
110   - }
111   - );
112   - };
113   -
114   - // 导出excel
115   - self.exportData = function() {
116   - busInfoManageService.dataExport().then(
117   - function(result) {
118   - fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls");
119   - },
120   - function(result) {
121   - console.log("exportData failed:" + result);
122   - }
123   - );
124   - };
125   -}]);
126   -
127   -angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
128   - var self = this;
129   - self.data = "TODO";
130   -
131   - // 关闭窗口
132   - self.close = function() {
133   - $modalInstance.dismiss("cancel");
134   - };
135   -
136   - self.clearInputFile = function() {
137   - angular.element("input[type='file']").val(null);
138   - };
139   -
140   - // 上传文件组件
141   - self.uploader = new FileUploader({
142   - url: "/cars/dataImport",
143   - filters: [] // 用于过滤文件,比如只允许导入excel
144   - });
145   - self.uploader.onAfterAddingFile = function(fileItem)
146   - {
147   - console.info('onAfterAddingFile', fileItem);
148   - console.log(self.uploader.queue.length);
149   - if (self.uploader.queue.length > 1)
150   - self.uploader.removeFromQueue(0);
151   - };
152   - self.uploader.onSuccessItem = function(fileItem, response, status, headers)
153   - {
154   - console.info('onSuccessItem', fileItem, response, status, headers);
155   - };
156   - self.uploader.onErrorItem = function(fileItem, response, status, headers)
157   - {
158   - console.info('onErrorItem', fileItem, response, status, headers);
159   - };
160   -
161   -}]);
162   -
163   -
164   -angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) {
165   - var self = this;
166   - self.pageInfo = {
167   - totalItems : 0,
168   - currentPage : 1,
169   - infos: []
170   - };
171   -
172   - // 初始创建的时候,获取一次列表数据
173   - busInfoManageService.getPage().then(
174   - function(result) {
175   - self.pageInfo.totalItems = result.totalElements;
176   - self.pageInfo.currentPage = result.number + 1;
177   - self.pageInfo.infos = result.content;
178   - busInfoManageService.setCurrentPageNo(result.number + 1);
179   - },
180   - function(result) {
181   - alert("出错啦!");
182   - }
183   - );
184   -
185   - //$scope.$watch("ctrl.pageInfo.currentPage", function() {
186   - // alert("dfdfdf");
187   - //});
188   -
189   - // 翻页的时候调用
190   - self.pageChanaged = function() {
191   - busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
192   - busInfoManageService.getPage().then(
193   - function(result) {
194   - self.pageInfo.totalItems = result.totalElements;
195   - self.pageInfo.currentPage = result.number + 1;
196   - self.pageInfo.infos = result.content;
197   - busInfoManageService.setCurrentPageNo(result.number + 1);
198   - },
199   - function(result) {
200   - alert("出错啦!");
201   - }
202   - );
203   - };
204   - // 获取查询条件数据
205   - self.searchCondition = function() {
206   - return busInfoManageService.getSearchCondition();
207   - };
208   - // 重置查询条件
209   - self.resetSearchCondition = function() {
210   - busInfoManageService.resetSearchCondition();
211   - self.pageInfo.currentPage = 1;
212   - self.pageChanaged();
213   - };
214   -}]);
215   -
216   -angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) {
217   - var self = this;
218   -
219   - // 报废日期 日期控件开关
220   - self.scrapDateOpen = false;
221   - self.scrapDate_open = function() {
222   - self.scrapDateOpen = true;
223   - };
224   -
225   - // 启用日期 日期控件开关
226   - self.openDateOpen = false;
227   - self.openDate_open = function() {
228   - self.openDateOpen = true;
229   - };
230   - // 取消日期 日期控件开关
231   - self.closeDateOpen = false;
232   - self.closeDate_open = function() {
233   - self.closeDateOpen = true;
234   - };
235   -
236   - // 欲保存的busInfo信息,绑定
237   - self.busInfoForSave = {};
238   -
239   - // 获取传过来的id,有的话就是修改,获取一遍数据
240   - var id = $stateParams.id;
241   - if (id) {
242   - self.busInfoForSave.id = id;
243   - busInfoManageService.getDetail(id).then(
244   - function(result) {
245   - var key;
246   - for (key in result) {
247   - self.busInfoForSave[key] = result[key];
248   - }
249   - },
250   - function(result) {
251   - alert("出错啦!");
252   - }
253   - );
254   - }
255   -
256   - // 提交方法
257   - self.submit = function() {
258   - console.log(self.busInfoForSave);
259   - //if (self.busInfoForSave) {
260   - // delete $stateParams.id;
261   - //}
262   - busInfoManageService.saveDetail(self.busInfoForSave).then(
263   - function(result) {
264   - // TODO:弹出框方式以后改
265   - if (result.status == 'SUCCESS') {
266   - alert("保存成功!");
267   - $state.go("busInfoManage");
268   - } else {
269   - alert("保存异常!");
270   - }
271   - },
272   - function(result) {
273   - // TODO:弹出框方式以后改
274   - alert("出错啦!");
275   - }
276   - );
277   - };
278   -
279   -}]);
280   -
281   -angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) {
282   - var self = this;
283   - self.title = "";
284   - self.busInfoForDetail = {};
285   - self.busInfoForDetail.id = $stateParams.id;
286   -
287   - // 当转向到此页面时,就获取明细信息并绑定
288   - busInfoManageService.getDetail($stateParams.id).then(
289   - function(result) {
290   - var key;
291   - for (key in result) {
292   - self.busInfoForDetail[key] = result[key];
293   - }
294   -
295   - self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";
296   - },
297   - function(result) {
298   - // TODO:弹出框方式以后改
299   - alert("出错啦!");
300   - }
301   - );
  1 +// 车辆基础信息维护 service controller等写在一起
  2 +
  3 +angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) {
  4 +
  5 + /** 当前的查询条件信息 */
  6 + var currentSearchCondition = {
  7 + "carCode_like" : "",
  8 + "insideCode_like" : "",
  9 + "equipmentCode_like" : "",
  10 + "carPlate_like" : ""
  11 + };
  12 +
  13 + /** 当前第几页 */
  14 + var currentPageNo = 1;
  15 + return {
  16 + /**
  17 + * 获取查询条件信息,
  18 + * 用于给controller用来和页面数据绑定。
  19 + */
  20 + getSearchCondition: function() {
  21 + return currentSearchCondition;
  22 + },
  23 + /**
  24 + * 重置查询条件信息。
  25 + */
  26 + resetSearchCondition: function() {
  27 + var key;
  28 + for (key in currentSearchCondition) {
  29 + currentSearchCondition[key] = undefined;
  30 + }
  31 + currentPageNo = 1;
  32 + },
  33 + /**
  34 + * 设置当前页码。
  35 + * @param cpn 从1开始,后台是从0开始的
  36 + */
  37 + setCurrentPageNo: function(cpn) {
  38 + currentPageNo = cpn;
  39 + },
  40 + /**
  41 + * 组装查询参数,返回一个promise查询结果。
  42 + * @param params 查询参数
  43 + * @return 返回一个 promise
  44 + */
  45 + getPage: function() {
  46 + var params = currentSearchCondition; // 查询条件
  47 + params.page = currentPageNo - 1; // 服务端页码从0开始
  48 + return service.rest.list(params).$promise;
  49 + },
  50 + /**
  51 + * 获取明细信息。
  52 + * @param id 车辆id
  53 + * @return 返回一个 promise
  54 + */
  55 + getDetail: function(id) {
  56 + var params = {id: id};
  57 + return service.rest.get(params).$promise;
  58 + },
  59 + /**
  60 + * 保存信息。
  61 + * @param obj 车辆详细信息
  62 + * @return 返回一个 promise
  63 + */
  64 + saveDetail: function(obj) {
  65 + return service.rest.save(obj).$promise;
  66 + },
  67 + /**
  68 + * 数据导出。
  69 + * @returns {*|Function|promise|n}
  70 + */
  71 + dataExport: function() {
  72 + return service.dataTools.dataExport().$promise;
  73 + }
  74 + };
  75 +}]);
  76 +
  77 +angular.module('ScheduleApp').controller('BusInfoManageCtrl', [
  78 + 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g',
  79 + function(busInfoManageService, $state, $uibModal, fileDownload) {
  80 + var self = this;
  81 +
  82 + // 切换到form状态
  83 + self.goForm = function() {
  84 + //alert("切换");
  85 + $state.go("busInfoManage_form");
  86 + };
  87 +
  88 + // 导入excel
  89 + self.importData = function() {
  90 + // large方式弹出模态对话框
  91 + var modalInstance = $uibModal.open({
  92 + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',
  93 + size: "lg",
  94 + animation: true,
  95 + backdrop: 'static',
  96 + resolve: {
  97 + // 可以传值给controller
  98 + },
  99 + windowClass: 'center-modal',
  100 + controller: "BusInfoManageToolsCtrl",
  101 + controllerAs: "ctrl",
  102 + bindToController: true
  103 + });
  104 + modalInstance.result.then(
  105 + function() {
  106 + console.log("dataImport.html打开");
  107 + },
  108 + function() {
  109 + console.log("dataImport.html消失");
  110 + }
  111 + );
  112 + };
  113 +
  114 + // 导出excel
  115 + self.exportData = function() {
  116 + busInfoManageService.dataExport().then(
  117 + function(result) {
  118 + fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls");
  119 + },
  120 + function(result) {
  121 + console.log("exportData failed:" + result);
  122 + }
  123 + );
  124 + };
  125 + }]);
  126 +
  127 +angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
  128 + var self = this;
  129 + self.data = "TODO";
  130 +
  131 + // 关闭窗口
  132 + self.close = function() {
  133 + $modalInstance.dismiss("cancel");
  134 + };
  135 +
  136 + self.clearInputFile = function() {
  137 + angular.element("input[type='file']").val(null);
  138 + };
  139 +
  140 + // 上传文件组件
  141 + self.uploader = new FileUploader({
  142 + url: "/cars/dataImport",
  143 + filters: [] // 用于过滤文件,比如只允许导入excel
  144 + });
  145 + self.uploader.onAfterAddingFile = function(fileItem)
  146 + {
  147 + console.info('onAfterAddingFile', fileItem);
  148 + console.log(self.uploader.queue.length);
  149 + if (self.uploader.queue.length > 1)
  150 + self.uploader.removeFromQueue(0);
  151 + };
  152 + self.uploader.onSuccessItem = function(fileItem, response, status, headers)
  153 + {
  154 + console.info('onSuccessItem', fileItem, response, status, headers);
  155 + };
  156 + self.uploader.onErrorItem = function(fileItem, response, status, headers)
  157 + {
  158 + console.info('onErrorItem', fileItem, response, status, headers);
  159 + };
  160 +
  161 +}]);
  162 +
  163 +
  164 +angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) {
  165 + var self = this;
  166 + self.pageInfo = {
  167 + totalItems : 0,
  168 + currentPage : 1,
  169 + infos: []
  170 + };
  171 +
  172 + // 初始创建的时候,获取一次列表数据
  173 + busInfoManageService.getPage().then(
  174 + function(result) {
  175 + self.pageInfo.totalItems = result.totalElements;
  176 + self.pageInfo.currentPage = result.number + 1;
  177 + self.pageInfo.infos = result.content;
  178 + busInfoManageService.setCurrentPageNo(result.number + 1);
  179 + },
  180 + function(result) {
  181 + alert("出错啦!");
  182 + }
  183 + );
  184 +
  185 + //$scope.$watch("ctrl.pageInfo.currentPage", function() {
  186 + // alert("dfdfdf");
  187 + //});
  188 +
  189 + // 翻页的时候调用
  190 + self.pageChanaged = function() {
  191 + busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
  192 + busInfoManageService.getPage().then(
  193 + function(result) {
  194 + self.pageInfo.totalItems = result.totalElements;
  195 + self.pageInfo.currentPage = result.number + 1;
  196 + self.pageInfo.infos = result.content;
  197 + busInfoManageService.setCurrentPageNo(result.number + 1);
  198 + },
  199 + function(result) {
  200 + alert("出错啦!");
  201 + }
  202 + );
  203 + };
  204 + // 获取查询条件数据
  205 + self.searchCondition = function() {
  206 + return busInfoManageService.getSearchCondition();
  207 + };
  208 + // 重置查询条件
  209 + self.resetSearchCondition = function() {
  210 + busInfoManageService.resetSearchCondition();
  211 + self.pageInfo.currentPage = 1;
  212 + self.pageChanaged();
  213 + };
  214 +}]);
  215 +
  216 +angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) {
  217 + var self = this;
  218 +
  219 + // 报废日期 日期控件开关
  220 + self.scrapDateOpen = false;
  221 + self.scrapDate_open = function() {
  222 + self.scrapDateOpen = true;
  223 + };
  224 +
  225 + // 启用日期 日期控件开关
  226 + self.openDateOpen = false;
  227 + self.openDate_open = function() {
  228 + self.openDateOpen = true;
  229 + };
  230 + // 取消日期 日期控件开关
  231 + self.closeDateOpen = false;
  232 + self.closeDate_open = function() {
  233 + self.closeDateOpen = true;
  234 + };
  235 +
  236 + // 欲保存的busInfo信息,绑定
  237 + self.busInfoForSave = {};
  238 +
  239 + // 获取传过来的id,有的话就是修改,获取一遍数据
  240 + var id = $stateParams.id;
  241 + if (id) {
  242 + self.busInfoForSave.id = id;
  243 + busInfoManageService.getDetail(id).then(
  244 + function(result) {
  245 + var key;
  246 + for (key in result) {
  247 + self.busInfoForSave[key] = result[key];
  248 + }
  249 + },
  250 + function(result) {
  251 + alert("出错啦!");
  252 + }
  253 + );
  254 + }
  255 +
  256 + // 提交方法
  257 + self.submit = function() {
  258 + console.log(self.busInfoForSave);
  259 + //if (self.busInfoForSave) {
  260 + // delete $stateParams.id;
  261 + //}
  262 + busInfoManageService.saveDetail(self.busInfoForSave).then(
  263 + function(result) {
  264 + // TODO:弹出框方式以后改
  265 + if (result.status == 'SUCCESS') {
  266 + alert("保存成功!");
  267 + $state.go("busInfoManage");
  268 + } else {
  269 + alert("保存异常!");
  270 + }
  271 + },
  272 + function(result) {
  273 + // TODO:弹出框方式以后改
  274 + alert("出错啦!");
  275 + }
  276 + );
  277 + };
  278 +
  279 +}]);
  280 +
  281 +angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) {
  282 + var self = this;
  283 + self.title = "";
  284 + self.busInfoForDetail = {};
  285 + self.busInfoForDetail.id = $stateParams.id;
  286 +
  287 + // 当转向到此页面时,就获取明细信息并绑定
  288 + busInfoManageService.getDetail($stateParams.id).then(
  289 + function(result) {
  290 + var key;
  291 + for (key in result) {
  292 + self.busInfoForDetail[key] = result[key];
  293 + }
  294 +
  295 + self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";
  296 + },
  297 + function(result) {
  298 + // TODO:弹出框方式以后改
  299 + alert("出错啦!");
  300 + }
  301 + );
302 302 }]);
303 303 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/route.js 0 → 100644
  1 +// ui route 配置
  2 +
  3 +/** 车辆基础信息模块配置route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("busInfoManage", { // index页面
  13 + url: '/busInfoManage',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html'
  17 + },
  18 + "busInfoManage_list@busInfoManage": {
  19 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'busInfoManage_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  32 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  33 + ]
  34 + });
  35 + }]
  36 + }
  37 + })
  38 + .state("busInfoManage_form", { // 添加车辆form
  39 + url: '/busInfoManage_form',
  40 + views: {
  41 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'}
  42 + },
  43 + resolve: {
  44 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  45 + return $ocLazyLoad.load({
  46 + name: 'busInfoManage_form_module',
  47 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  48 + files: [
  49 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  50 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  51 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  52 + ]
  53 + });
  54 + }]
  55 + }
  56 + })
  57 + .state("busInfoManage_edit", { // 修改车辆form
  58 + url: '/busInfoManage_edit/:id',
  59 + views: {
  60 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'}
  61 + },
  62 + resolve: {
  63 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  64 + return $ocLazyLoad.load({
  65 + name: 'busInfoManage_edit_module',
  66 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  67 + files: [
  68 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  69 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  70 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  71 + ]
  72 + });
  73 + }]
  74 + }
  75 + })
  76 + .state("busInfoManage_detail", { // 车辆详细信息
  77 + url: '/busInfoManage_detail/:id',
  78 + views: {
  79 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'}
  80 + },
  81 + resolve: {
  82 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  83 + return $ocLazyLoad.load({
  84 + name: 'busInfoManage_detail_module',
  85 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  86 + files: [
  87 + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js"
  88 + ]
  89 + });
  90 + }]
  91 + }
  92 + })
  93 + }
  94 +]);
0 95 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/dist/deviceInfoManage.dist.html deleted 100644 → 0
1   -<div class="page-head">
2   - <div class="page-title">
3   - <h1>设备信息管理</h1>
4   - </div>
5   -</div>
6 0 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js renamed to src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
1   -// 设备信息维护 service controller 等写在一起
2   -
3   -angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) {
4   - /** 当前的查询条件信息 */
5   - var currentSearchCondition = {};
6   -
7   - /** 当前第几页 */
8   - var currentPageNo = 1;
9   -
10   - return {
11   - /**
12   - * 获取查询条件信息,
13   - * 用于给controller用来和页面数据绑定。
14   - */
15   - getSearchCondition: function() {
16   - return currentSearchCondition;
17   - },
18   - /**
19   - * 重置查询条件信息。
20   - */
21   - resetSearchCondition: function() {
22   - var key;
23   - for (key in currentSearchCondition) {
24   - currentSearchCondition[key] = "";
25   - }
26   - },
27   - /**
28   - * 设置当前页码。
29   - * @param cpn 从1开始,后台是从0开始的
30   - */
31   - setCurrentPageNo: function(cpn) {
32   - currentPageNo = cpn;
33   - },
34   - /**
35   - * 组装查询参数,返回一个promise查询结果。
36   - * @param params 查询参数
37   - * @return 返回一个 promise
38   - */
39   - getPage: function() {
40   - var params = currentSearchCondition; // 查询条件
41   - params.page = currentPageNo - 1; // 服务端页码从0开始
42   - return service.list(params).$promise;
43   - },
44   - /**
45   - * 获取明细信息。
46   - * @param id 车辆id
47   - * @return 返回一个 promise
48   - */
49   - getDetail: function(id) {
50   - var params = {id: id};
51   - return service.get(params).$promise;
52   - },
53   - /**
54   - * 保存信息。
55   - * @param obj 车辆详细信息
56   - * @return 返回一个 promise
57   - */
58   - saveDetail: function(obj) {
59   - return service.save(obj).$promise;
60   - },
61   - /**
62   - * 删除信息。
63   - * @param id 主键id
64   - * @returns {*|Function|promise|n}
65   - */
66   - deleteDetail: function(id) {
67   - return service.delete({id: id}).$promise;
68   - }
69   - };
70   -
71   -}]);
72   -
73   -angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) {
74   - var self = this;
75   -
76   - // 切换到form状态
77   - self.goForm = function() {
78   - //alert("切换");
79   - $state.go("deviceInfoManage_form");
80   - }
81   -
82   -
83   -}]);
84   -
85   -angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) {
86   - var self = this;
87   - self.pageInfo = {
88   - totalItems : 0,
89   - currentPage : 1,
90   - infos: []
91   - };
92   -
93   - // 初始创建的时候,获取一次列表数据
94   - deviceInfoManageService.getPage().then(
95   - function(result) {
96   - self.pageInfo.totalItems = result.totalElements;
97   - self.pageInfo.currentPage = result.number + 1;
98   - self.pageInfo.infos = result.content;
99   - deviceInfoManageService.setCurrentPageNo(result.number + 1);
100   - },
101   - function(result) {
102   - alert("出错啦!");
103   - }
104   - );
105   -
106   - // 翻页的时候调用
107   - self.pageChanaged = function() {
108   - deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
109   - deviceInfoManageService.getPage().then(
110   - function(result) {
111   - self.pageInfo.totalItems = result.totalElements;
112   - self.pageInfo.currentPage = result.number + 1;
113   - self.pageInfo.infos = result.content;
114   - deviceInfoManageService.setCurrentPageNo(result.number + 1);
115   - },
116   - function(result) {
117   - alert("出错啦!");
118   - }
119   - );
120   - };
121   - // 获取查询条件数据
122   - self.searchCondition = function() {
123   - return deviceInfoManageService.getSearchCondition();
124   - };
125   - // 重置查询条件
126   - self.resetSearchCondition = function() {
127   - deviceInfoManageService.resetSearchCondition();
128   - self.pageInfo.currentPage = 1;
129   - self.pageChanaged();
130   - };
131   -
132   - // 作废/撤销
133   - self.toggleCde = function(id) {
134   - // TODO:
135   - deviceInfoManageService.deleteDetail(id).then(
136   - function(result) {
137   - if (result.message) { // 暂时这样做,之后全局拦截
138   - alert("失败:" + result.message);
139   - } else {
140   - alert("成功!");
141   -
142   - deviceInfoManageService.getPage().then(
143   - function(result) {
144   - self.pageInfo.totalItems = result.totalElements;
145   - self.pageInfo.currentPage = result.number + 1;
146   - self.pageInfo.infos = result.content;
147   - deviceInfoManageService.setCurrentPageNo(result.number + 1);
148   - },
149   - function(result) {
150   - alert("出错啦!");
151   - }
152   - );
153   - }
154   -
155   - },
156   - function(result) {
157   - alert("出错啦!" + result);
158   - }
159   - );
160   - };
161   -
162   -}]);
163   -
164   -angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) {
165   - var self = this;
166   -
167   - // 启用日期 日期控件开关
168   - self.qyrqOpen = false;
169   - self.qyrq_open = function() {
170   - self.qyrqOpen = true;
171   - };
172   -
173   - // 欲保存的busInfo信息,绑定
174   - self.deviceInfoForSave = {};
175   -
176   - // 获取传过来的id,有的话就是修改,获取一遍数据
177   - var id = $stateParams.id;
178   - if (id) {
179   - self.deviceInfoForSave.id = id;
180   - deviceInfoManageService.getDetail(id).then(
181   - function(result) {
182   - var key;
183   - for (key in result) {
184   - self.deviceInfoForSave[key] = result[key];
185   - }
186   - // 填写所有的 select 控件选中框数据
187   - // 公司字典
188   - if (self.deviceInfoForSave.gsName) {
189   - angular.forEach(self.gses, function(data) {
190   - if (self.deviceInfoForSave.gsName == data.gsmc) {
191   - self.deviceInfoForSave.gs_selected = data;
192   - }
193   - });
194   - }
195   - },
196   - function(result) {
197   - alert("出错啦!");
198   - }
199   - );
200   - }
201   -
202   - // 提交方法
203   - self.submit = function() {
204   - console.log(self.deviceInfoForSave);
205   - deviceInfoManageService.saveDetail(self.deviceInfoForSave).then(
206   - function(result) {
207   - // TODO:弹出框方式以后改
208   - if (result.status == 'SUCCESS') {
209   - alert("保存成功!");
210   - $state.go("deviceInfoManage");
211   - } else {
212   - alert("保存异常!");
213   - }
214   - },
215   - function(result) {
216   - // TODO:弹出框方式以后改
217   - alert("出错啦!");
218   - }
219   - );
220   - };
221   -
222   -}]);
223   -
224   -angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) {
225   - var self = this;
226   - self.title = "";
227   - self.deviceInfoForDetail = {};
228   - self.deviceInfoForDetail.id = $stateParams.id;
229   -
230   - // 当转向到此页面时,就获取明细信息并绑定
231   - deviceInfoManageService.getDetail($stateParams.id).then(
232   - function(result) {
233   - var key;
234   - for (key in result) {
235   - self.deviceInfoForDetail[key] = result[key];
236   - }
237   -
238   - self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息";
239   - },
240   - function(result) {
241   - // TODO:弹出框方式以后改
242   - alert("出错啦!");
243   - }
244   - );
  1 +// 设备信息维护 service controller 等写在一起
  2 +
  3 +angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) {
  4 + /** 当前的查询条件信息 */
  5 + var currentSearchCondition = {};
  6 +
  7 + /** 当前第几页 */
  8 + var currentPageNo = 1;
  9 +
  10 + return {
  11 + /**
  12 + * 获取查询条件信息,
  13 + * 用于给controller用来和页面数据绑定。
  14 + */
  15 + getSearchCondition: function() {
  16 + return currentSearchCondition;
  17 + },
  18 + /**
  19 + * 重置查询条件信息。
  20 + */
  21 + resetSearchCondition: function() {
  22 + var key;
  23 + for (key in currentSearchCondition) {
  24 + currentSearchCondition[key] = "";
  25 + }
  26 + },
  27 + /**
  28 + * 设置当前页码。
  29 + * @param cpn 从1开始,后台是从0开始的
  30 + */
  31 + setCurrentPageNo: function(cpn) {
  32 + currentPageNo = cpn;
  33 + },
  34 + /**
  35 + * 组装查询参数,返回一个promise查询结果。
  36 + * @param params 查询参数
  37 + * @return 返回一个 promise
  38 + */
  39 + getPage: function() {
  40 + var params = currentSearchCondition; // 查询条件
  41 + params.page = currentPageNo - 1; // 服务端页码从0开始
  42 + return service.list(params).$promise;
  43 + },
  44 + /**
  45 + * 获取明细信息。
  46 + * @param id 车辆id
  47 + * @return 返回一个 promise
  48 + */
  49 + getDetail: function(id) {
  50 + var params = {id: id};
  51 + return service.get(params).$promise;
  52 + },
  53 + /**
  54 + * 保存信息。
  55 + * @param obj 车辆详细信息
  56 + * @return 返回一个 promise
  57 + */
  58 + saveDetail: function(obj) {
  59 + return service.save(obj).$promise;
  60 + },
  61 + /**
  62 + * 删除信息。
  63 + * @param id 主键id
  64 + * @returns {*|Function|promise|n}
  65 + */
  66 + deleteDetail: function(id) {
  67 + return service.delete({id: id}).$promise;
  68 + }
  69 + };
  70 +
  71 +}]);
  72 +
  73 +angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) {
  74 + var self = this;
  75 +
  76 + // 切换到form状态
  77 + self.goForm = function() {
  78 + //alert("切换");
  79 + $state.go("deviceInfoManage_form");
  80 + }
  81 +
  82 +
  83 +}]);
  84 +
  85 +angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) {
  86 + var self = this;
  87 + self.pageInfo = {
  88 + totalItems : 0,
  89 + currentPage : 1,
  90 + infos: []
  91 + };
  92 +
  93 + // 初始创建的时候,获取一次列表数据
  94 + deviceInfoManageService.getPage().then(
  95 + function(result) {
  96 + self.pageInfo.totalItems = result.totalElements;
  97 + self.pageInfo.currentPage = result.number + 1;
  98 + self.pageInfo.infos = result.content;
  99 + deviceInfoManageService.setCurrentPageNo(result.number + 1);
  100 + },
  101 + function(result) {
  102 + alert("出错啦!");
  103 + }
  104 + );
  105 +
  106 + // 翻页的时候调用
  107 + self.pageChanaged = function() {
  108 + deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
  109 + deviceInfoManageService.getPage().then(
  110 + function(result) {
  111 + self.pageInfo.totalItems = result.totalElements;
  112 + self.pageInfo.currentPage = result.number + 1;
  113 + self.pageInfo.infos = result.content;
  114 + deviceInfoManageService.setCurrentPageNo(result.number + 1);
  115 + },
  116 + function(result) {
  117 + alert("出错啦!");
  118 + }
  119 + );
  120 + };
  121 + // 获取查询条件数据
  122 + self.searchCondition = function() {
  123 + return deviceInfoManageService.getSearchCondition();
  124 + };
  125 + // 重置查询条件
  126 + self.resetSearchCondition = function() {
  127 + deviceInfoManageService.resetSearchCondition();
  128 + self.pageInfo.currentPage = 1;
  129 + self.pageChanaged();
  130 + };
  131 +
  132 + // 作废/撤销
  133 + self.toggleCde = function(id) {
  134 + // TODO:
  135 + deviceInfoManageService.deleteDetail(id).then(
  136 + function(result) {
  137 + if (result.message) { // 暂时这样做,之后全局拦截
  138 + alert("失败:" + result.message);
  139 + } else {
  140 + alert("成功!");
  141 +
  142 + deviceInfoManageService.getPage().then(
  143 + function(result) {
  144 + self.pageInfo.totalItems = result.totalElements;
  145 + self.pageInfo.currentPage = result.number + 1;
  146 + self.pageInfo.infos = result.content;
  147 + deviceInfoManageService.setCurrentPageNo(result.number + 1);
  148 + },
  149 + function(result) {
  150 + alert("出错啦!");
  151 + }
  152 + );
  153 + }
  154 +
  155 + },
  156 + function(result) {
  157 + alert("出错啦!" + result);
  158 + }
  159 + );
  160 + };
  161 +
  162 +}]);
  163 +
  164 +angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) {
  165 + var self = this;
  166 +
  167 + // 启用日期 日期控件开关
  168 + self.qyrqOpen = false;
  169 + self.qyrq_open = function() {
  170 + self.qyrqOpen = true;
  171 + };
  172 +
  173 + // 欲保存的busInfo信息,绑定
  174 + self.deviceInfoForSave = {};
  175 +
  176 + // 获取传过来的id,有的话就是修改,获取一遍数据
  177 + var id = $stateParams.id;
  178 + if (id) {
  179 + self.deviceInfoForSave.id = id;
  180 + deviceInfoManageService.getDetail(id).then(
  181 + function(result) {
  182 + var key;
  183 + for (key in result) {
  184 + self.deviceInfoForSave[key] = result[key];
  185 + }
  186 + // 填写所有的 select 控件选中框数据
  187 + // 公司字典
  188 + if (self.deviceInfoForSave.gsName) {
  189 + angular.forEach(self.gses, function(data) {
  190 + if (self.deviceInfoForSave.gsName == data.gsmc) {
  191 + self.deviceInfoForSave.gs_selected = data;
  192 + }
  193 + });
  194 + }
  195 + },
  196 + function(result) {
  197 + alert("出错啦!");
  198 + }
  199 + );
  200 + }
  201 +
  202 + // 提交方法
  203 + self.submit = function() {
  204 + console.log(self.deviceInfoForSave);
  205 + deviceInfoManageService.saveDetail(self.deviceInfoForSave).then(
  206 + function(result) {
  207 + // TODO:弹出框方式以后改
  208 + if (result.status == 'SUCCESS') {
  209 + alert("保存成功!");
  210 + $state.go("deviceInfoManage");
  211 + } else {
  212 + alert("保存异常!");
  213 + }
  214 + },
  215 + function(result) {
  216 + // TODO:弹出框方式以后改
  217 + alert("出错啦!");
  218 + }
  219 + );
  220 + };
  221 +
  222 +}]);
  223 +
  224 +angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) {
  225 + var self = this;
  226 + self.title = "";
  227 + self.deviceInfoForDetail = {};
  228 + self.deviceInfoForDetail.id = $stateParams.id;
  229 +
  230 + // 当转向到此页面时,就获取明细信息并绑定
  231 + deviceInfoManageService.getDetail($stateParams.id).then(
  232 + function(result) {
  233 + var key;
  234 + for (key in result) {
  235 + self.deviceInfoForDetail[key] = result[key];
  236 + }
  237 +
  238 + self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息";
  239 + },
  240 + function(result) {
  241 + // TODO:弹出框方式以后改
  242 + alert("出错啦!");
  243 + }
  244 + );
245 245 }]);
246 246 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/route.js 0 → 100644
  1 +// ui route 配置
  2 +
  3 +/** 车辆设备信息模块配置route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("deviceInfoManage", { // index页面
  13 + url: '/deviceInfoManage',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html'
  17 + },
  18 + "deviceInfoManage_list@deviceInfoManage": {
  19 + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'deviceInfoManage_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js"
  32 + ]
  33 + });
  34 + }]
  35 + }
  36 + })
  37 + .state("deviceInfoManage_form", { // 添加设备信息form
  38 + url: '/deviceInfoManage_form',
  39 + views: {
  40 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'}
  41 + },
  42 + resolve: {
  43 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  44 + return $ocLazyLoad.load({
  45 + name: 'deviceInfoManage_form_module',
  46 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  47 + files: [
  48 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  49 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  50 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js"
  51 + ]
  52 + });
  53 + }]
  54 + }
  55 + })
  56 + .state("deviceInfoManage_edit", { // 修改设备信息form
  57 + url: '/deviceInfoManage_edit/:id',
  58 + views: {
  59 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'}
  60 + },
  61 + resolve: {
  62 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  63 + return $ocLazyLoad.load({
  64 + name: 'deviceInfoManage_edit_module',
  65 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  66 + files: [
  67 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  68 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  69 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js"
  70 + ]
  71 + });
  72 + }]
  73 + }
  74 + })
  75 + .state("deviceInfoManage_detail", { // 详细信息页面
  76 + url: '/deviceInfoManage_detail/:id',
  77 + views: {
  78 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'}
  79 + },
  80 + resolve: {
  81 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  82 + return $ocLazyLoad.load({
  83 + name: 'deviceInfoManage_detail_module',
  84 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  85 + files: [
  86 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js"
  87 + ]
  88 + });
  89 + }]
  90 + }
  91 + })
  92 +
  93 + }
  94 +]);
0 95 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/dist/employeeInfoManage.dist.html deleted 100644 → 0
1   -人员信息管理
2 0 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js renamed to src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
1   -// 人员信息管理 service controller等写在一起
2   -
3   -angular.module('ScheduleApp').factory('EmployeeInfoManageService', ['EmployeeInfoManageService_g', function(service) {
4   -
5   - /** 当前的查询条件信息 */
6   - var currentSearchCondition = {
7   - //"carCode_like" : "",
8   - //"insideCode_like" : "",
9   - //"equipmentCode_like" : "",
10   - //"carPlate_like" : ""
11   - };
12   -
13   - /** 当前第几页 */
14   - var currentPageNo = 1;
15   -
16   - return {
17   - /**
18   - * 获取查询条件信息,
19   - * 用于给controller用来和页面数据绑定。
20   - */
21   - getSearchCondition: function() {
22   - return currentSearchCondition;
23   - },
24   - /**
25   - * 重置查询条件信息。
26   - */
27   - resetSearchCondition: function() {
28   - var key;
29   - for (key in currentSearchCondition) {
30   - currentSearchCondition[key] = undefined;
31   - }
32   - currentPageNo = 1;
33   - },
34   - /**
35   - * 设置当前页码。
36   - * @param cpn 从1开始,后台是从0开始的
37   - */
38   - setCurrentPageNo: function(cpn) {
39   - currentPageNo = cpn;
40   - },
41   - /**
42   - * 组装查询参数,返回一个promise查询结果。
43   - * @param params 查询参数
44   - * @return 返回一个 promise
45   - */
46   - getPage: function() {
47   - var params = currentSearchCondition; // 查询条件
48   - params.page = currentPageNo - 1; // 服务端页码从0开始
49   - return service.rest.list(params).$promise;
50   - },
51   - /**
52   - * 获取明细信息。
53   - * @param id 车辆id
54   - * @return 返回一个 promise
55   - */
56   - getDetail: function(id) {
57   - var params = {id: id};
58   - return service.rest.get(params).$promise;
59   - },
60   - /**
61   - * 保存信息。
62   - * @param obj 车辆详细信息
63   - * @return 返回一个 promise
64   - */
65   - saveDetail: function(obj) {
66   - return service.rest.save(obj).$promise;
67   - },
68   - /**
69   - * 数据导出。
70   - * @returns {*|Function|promise|n}
71   - */
72   - dataExport: function() {
73   - return service.dataTools.dataExport().$promise;
74   - }
75   - }
76   -
77   -}]);
78   -
79   -angular.module('ScheduleApp').controller('EmployeeInfoManageCtrl', [
80   - 'EmployeeInfoManageService', '$state', '$uibModal', 'FileDownload_g',
81   - function(employeeInfoManageService, $state, $uibModal, fileDownload) {
82   - var self = this;
83   -
84   - // 切换到form状态
85   - self.goForm = function() {
86   - //alert("切换");
87   - $state.go("employeeInfoManage_form");
88   - }
89   -
90   - // 导入excel
91   - self.importData = function() {
92   - // large方式弹出模态对话框
93   - var modalInstance = $uibModal.open({
94   - templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html',
95   - size: "lg",
96   - animation: true,
97   - backdrop: 'static',
98   - resolve: {
99   - // 可以传值给controller
100   - },
101   - windowClass: 'center-modal',
102   - controller: "EmployInfoManageToolsCtrl",
103   - controllerAs: "ctrl",
104   - bindToController: true
105   - });
106   - modalInstance.result.then(
107   - function() {
108   - console.log("dataImport.html打开");
109   - },
110   - function() {
111   - console.log("dataImport.html消失");
112   - }
113   - );
114   - };
115   -
116   - // 导出excel
117   - self.exportData = function() {
118   - employeeInfoManageService.dataExport().then(
119   - function(result) {
120   - fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls");
121   - },
122   - function(result) {
123   - console.log("exportData failed:" + result);
124   - }
125   - );
126   - };
127   -}]);
128   -
129   -angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
130   - var self = this;
131   -
132   - // 关闭窗口
133   - self.close = function() {
134   - $modalInstance.dismiss("cancel");
135   - };
136   -
137   - self.clearInputFile = function() {
138   - angular.element("input[type='file']").val(null);
139   - };
140   -
141   - // 上传文件组件
142   - self.uploader = new FileUploader({
143   - url: "/personnel/dataImport",
144   - filters: [] // 用于过滤文件,比如只允许导入excel
145   - });
146   - self.uploader.onAfterAddingFile = function(fileItem)
147   - {
148   - console.info('onAfterAddingFile', fileItem);
149   - console.log(self.uploader.queue.length);
150   - if (self.uploader.queue.length > 1)
151   - self.uploader.removeFromQueue(0);
152   - };
153   - self.uploader.onSuccessItem = function(fileItem, response, status, headers)
154   - {
155   - console.info('onSuccessItem', fileItem, response, status, headers);
156   - };
157   - self.uploader.onErrorItem = function(fileItem, response, status, headers)
158   - {
159   - console.info('onErrorItem', fileItem, response, status, headers);
160   - };
161   -
162   -}]);
163   -
164   -angular.module('ScheduleApp').controller('EmployeeInfoManageListCtrl', ['EmployeeInfoManageService', function(employeeInfoManageService) {
165   - var self = this;
166   - self.pageInfo = {
167   - totalItems : 0,
168   - currentPage : 1,
169   - infos: []
170   - };
171   -
172   - // 初始创建的时候,获取一次列表数据
173   - employeeInfoManageService.getPage().then(
174   - function(result) {
175   - self.pageInfo.totalItems = result.totalElements;
176   - self.pageInfo.currentPage = result.number + 1;
177   - self.pageInfo.infos = result.content;
178   - employeeInfoManageService.setCurrentPageNo(result.number + 1);
179   - },
180   - function(result) {
181   - alert("出错啦!");
182   - }
183   - );
184   -
185   - //$scope.$watch("ctrl.pageInfo.currentPage", function() {
186   - // alert("dfdfdf");
187   - //});
188   -
189   - // 翻页的时候调用
190   - self.pageChanaged = function() {
191   - employeeInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
192   - employeeInfoManageService.getPage().then(
193   - function(result) {
194   - self.pageInfo.totalItems = result.totalElements;
195   - self.pageInfo.currentPage = result.number + 1;
196   - self.pageInfo.infos = result.content;
197   - employeeInfoManageService.setCurrentPageNo(result.number + 1);
198   - },
199   - function(result) {
200   - alert("出错啦!");
201   - }
202   - );
203   - };
204   - // 获取查询条件数据
205   - self.searchCondition = function() {
206   - return employeeInfoManageService.getSearchCondition();
207   - };
208   - // 重置查询条件
209   - self.resetSearchCondition = function() {
210   - employeeInfoManageService.resetSearchCondition();
211   - self.pageInfo.currentPage = 1;
212   - self.pageChanaged();
213   - };
214   -}]);
215   -
216   -angular.module('ScheduleApp').controller('EmployeeInfoManageFormCtrl', ['EmployeeInfoManageService', '$stateParams', '$state', function(employeeInfoManageService, $stateParams, $state) {
217   - var self = this;
218   -
219   - // 欲保存的busInfo信息,绑定
220   - self.employeeInfoForSave = {};
221   -
222   - // 获取传过来的id,有的话就是修改,获取一遍数据
223   - var id = $stateParams.id;
224   - if (id) {
225   - self.employeeInfoForSave.id = id;
226   - employeeInfoManageService.getDetail(id).then(
227   - function(result) {
228   - var key;
229   - for (key in result) {
230   - self.employeeInfoForSave[key] = result[key];
231   - }
232   - },
233   - function(result) {
234   - alert("出错啦!");
235   - }
236   - );
237   - }
238   -
239   - // 提交方法
240   - self.submit = function() {
241   - console.log(self.employeeInfoForSave);
242   - employeeInfoManageService.saveDetail(self.employeeInfoForSave).then(
243   - function(result) {
244   - // TODO:弹出框方式以后改
245   - if (result.status == 'SUCCESS') {
246   - alert("保存成功!");
247   - $state.go("employeeInfoManage");
248   - } else {
249   - alert("保存异常!");
250   - }
251   - },
252   - function(result) {
253   - // TODO:弹出框方式以后改
254   - alert("出错啦!");
255   - }
256   - );
257   - };
258   -
259   -
260   -}]);
261   -
262   -angular.module('ScheduleApp').controller('EmployeeInfoManageDetailCtrl', ['EmployeeInfoManageService', '$stateParams', function(employeeInfoManageService, $stateParams) {
263   - var self = this;
264   - self.title = "";
265   - self.employeeInfoForDetail = {};
266   - self.employeeInfoForDetail.id = $stateParams.id;
267   -
268   - // 当转向到此页面时,就获取明细信息并绑定
269   - employeeInfoManageService.getDetail($stateParams.id).then(
270   - function(result) {
271   - var key;
272   - for (key in result) {
273   - self.employeeInfoForDetail[key] = result[key];
274   - }
275   -
276   - self.title = "员工 " + self.employeeInfoForDetail.personnelName + " 详细信息";
277   - },
278   - function(result) {
279   - // TODO:弹出框方式以后改
280   - alert("出错啦!");
281   - }
282   - );
283   -}]);
284   -
  1 +// 人员信息管理 service controller等写在一起
  2 +
  3 +angular.module('ScheduleApp').factory('EmployeeInfoManageService', ['EmployeeInfoManageService_g', function(service) {
  4 +
  5 + /** 当前的查询条件信息 */
  6 + var currentSearchCondition = {
  7 + //"carCode_like" : "",
  8 + //"insideCode_like" : "",
  9 + //"equipmentCode_like" : "",
  10 + //"carPlate_like" : ""
  11 + };
  12 +
  13 + /** 当前第几页 */
  14 + var currentPageNo = 1;
  15 +
  16 + return {
  17 + /**
  18 + * 获取查询条件信息,
  19 + * 用于给controller用来和页面数据绑定。
  20 + */
  21 + getSearchCondition: function() {
  22 + return currentSearchCondition;
  23 + },
  24 + /**
  25 + * 重置查询条件信息。
  26 + */
  27 + resetSearchCondition: function() {
  28 + var key;
  29 + for (key in currentSearchCondition) {
  30 + currentSearchCondition[key] = undefined;
  31 + }
  32 + currentPageNo = 1;
  33 + },
  34 + /**
  35 + * 设置当前页码。
  36 + * @param cpn 从1开始,后台是从0开始的
  37 + */
  38 + setCurrentPageNo: function(cpn) {
  39 + currentPageNo = cpn;
  40 + },
  41 + /**
  42 + * 组装查询参数,返回一个promise查询结果。
  43 + * @param params 查询参数
  44 + * @return 返回一个 promise
  45 + */
  46 + getPage: function() {
  47 + var params = currentSearchCondition; // 查询条件
  48 + params.page = currentPageNo - 1; // 服务端页码从0开始
  49 + return service.rest.list(params).$promise;
  50 + },
  51 + /**
  52 + * 获取明细信息。
  53 + * @param id 车辆id
  54 + * @return 返回一个 promise
  55 + */
  56 + getDetail: function(id) {
  57 + var params = {id: id};
  58 + return service.rest.get(params).$promise;
  59 + },
  60 + /**
  61 + * 保存信息。
  62 + * @param obj 车辆详细信息
  63 + * @return 返回一个 promise
  64 + */
  65 + saveDetail: function(obj) {
  66 + return service.rest.save(obj).$promise;
  67 + },
  68 + /**
  69 + * 数据导出。
  70 + * @returns {*|Function|promise|n}
  71 + */
  72 + dataExport: function() {
  73 + return service.dataTools.dataExport().$promise;
  74 + }
  75 + }
  76 +
  77 +}]);
  78 +
  79 +angular.module('ScheduleApp').controller('EmployeeInfoManageCtrl', [
  80 + 'EmployeeInfoManageService', '$state', '$uibModal', 'FileDownload_g',
  81 + function(employeeInfoManageService, $state, $uibModal, fileDownload) {
  82 + var self = this;
  83 +
  84 + // 切换到form状态
  85 + self.goForm = function() {
  86 + //alert("切换");
  87 + $state.go("employeeInfoManage_form");
  88 + }
  89 +
  90 + // 导入excel
  91 + self.importData = function() {
  92 + // large方式弹出模态对话框
  93 + var modalInstance = $uibModal.open({
  94 + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html',
  95 + size: "lg",
  96 + animation: true,
  97 + backdrop: 'static',
  98 + resolve: {
  99 + // 可以传值给controller
  100 + },
  101 + windowClass: 'center-modal',
  102 + controller: "EmployInfoManageToolsCtrl",
  103 + controllerAs: "ctrl",
  104 + bindToController: true
  105 + });
  106 + modalInstance.result.then(
  107 + function() {
  108 + console.log("dataImport.html打开");
  109 + },
  110 + function() {
  111 + console.log("dataImport.html消失");
  112 + }
  113 + );
  114 + };
  115 +
  116 + // 导出excel
  117 + self.exportData = function() {
  118 + employeeInfoManageService.dataExport().then(
  119 + function(result) {
  120 + fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls");
  121 + },
  122 + function(result) {
  123 + console.log("exportData failed:" + result);
  124 + }
  125 + );
  126 + };
  127 + }]);
  128 +
  129 +angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
  130 + var self = this;
  131 +
  132 + // 关闭窗口
  133 + self.close = function() {
  134 + $modalInstance.dismiss("cancel");
  135 + };
  136 +
  137 + self.clearInputFile = function() {
  138 + angular.element("input[type='file']").val(null);
  139 + };
  140 +
  141 + // 上传文件组件
  142 + self.uploader = new FileUploader({
  143 + url: "/personnel/dataImport",
  144 + filters: [] // 用于过滤文件,比如只允许导入excel
  145 + });
  146 + self.uploader.onAfterAddingFile = function(fileItem)
  147 + {
  148 + console.info('onAfterAddingFile', fileItem);
  149 + console.log(self.uploader.queue.length);
  150 + if (self.uploader.queue.length > 1)
  151 + self.uploader.removeFromQueue(0);
  152 + };
  153 + self.uploader.onSuccessItem = function(fileItem, response, status, headers)
  154 + {
  155 + console.info('onSuccessItem', fileItem, response, status, headers);
  156 + };
  157 + self.uploader.onErrorItem = function(fileItem, response, status, headers)
  158 + {
  159 + console.info('onErrorItem', fileItem, response, status, headers);
  160 + };
  161 +
  162 +}]);
  163 +
  164 +angular.module('ScheduleApp').controller('EmployeeInfoManageListCtrl', ['EmployeeInfoManageService', function(employeeInfoManageService) {
  165 + var self = this;
  166 + self.pageInfo = {
  167 + totalItems : 0,
  168 + currentPage : 1,
  169 + infos: []
  170 + };
  171 +
  172 + // 初始创建的时候,获取一次列表数据
  173 + employeeInfoManageService.getPage().then(
  174 + function(result) {
  175 + self.pageInfo.totalItems = result.totalElements;
  176 + self.pageInfo.currentPage = result.number + 1;
  177 + self.pageInfo.infos = result.content;
  178 + employeeInfoManageService.setCurrentPageNo(result.number + 1);
  179 + },
  180 + function(result) {
  181 + alert("出错啦!");
  182 + }
  183 + );
  184 +
  185 + //$scope.$watch("ctrl.pageInfo.currentPage", function() {
  186 + // alert("dfdfdf");
  187 + //});
  188 +
  189 + // 翻页的时候调用
  190 + self.pageChanaged = function() {
  191 + employeeInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);
  192 + employeeInfoManageService.getPage().then(
  193 + function(result) {
  194 + self.pageInfo.totalItems = result.totalElements;
  195 + self.pageInfo.currentPage = result.number + 1;
  196 + self.pageInfo.infos = result.content;
  197 + employeeInfoManageService.setCurrentPageNo(result.number + 1);
  198 + },
  199 + function(result) {
  200 + alert("出错啦!");
  201 + }
  202 + );
  203 + };
  204 + // 获取查询条件数据
  205 + self.searchCondition = function() {
  206 + return employeeInfoManageService.getSearchCondition();
  207 + };
  208 + // 重置查询条件
  209 + self.resetSearchCondition = function() {
  210 + employeeInfoManageService.resetSearchCondition();
  211 + self.pageInfo.currentPage = 1;
  212 + self.pageChanaged();
  213 + };
  214 +}]);
  215 +
  216 +angular.module('ScheduleApp').controller('EmployeeInfoManageFormCtrl', ['EmployeeInfoManageService', '$stateParams', '$state', function(employeeInfoManageService, $stateParams, $state) {
  217 + var self = this;
  218 +
  219 + // 欲保存的busInfo信息,绑定
  220 + self.employeeInfoForSave = {};
  221 +
  222 + // 获取传过来的id,有的话就是修改,获取一遍数据
  223 + var id = $stateParams.id;
  224 + if (id) {
  225 + self.employeeInfoForSave.id = id;
  226 + employeeInfoManageService.getDetail(id).then(
  227 + function(result) {
  228 + var key;
  229 + for (key in result) {
  230 + self.employeeInfoForSave[key] = result[key];
  231 + }
  232 + },
  233 + function(result) {
  234 + alert("出错啦!");
  235 + }
  236 + );
  237 + }
  238 +
  239 + // 提交方法
  240 + self.submit = function() {
  241 + console.log(self.employeeInfoForSave);
  242 + employeeInfoManageService.saveDetail(self.employeeInfoForSave).then(
  243 + function(result) {
  244 + // TODO:弹出框方式以后改
  245 + if (result.status == 'SUCCESS') {
  246 + alert("保存成功!");
  247 + $state.go("employeeInfoManage");
  248 + } else {
  249 + alert("保存异常!");
  250 + }
  251 + },
  252 + function(result) {
  253 + // TODO:弹出框方式以后改
  254 + alert("出错啦!");
  255 + }
  256 + );
  257 + };
  258 +
  259 +
  260 +}]);
  261 +
  262 +angular.module('ScheduleApp').controller('EmployeeInfoManageDetailCtrl', ['EmployeeInfoManageService', '$stateParams', function(employeeInfoManageService, $stateParams) {
  263 + var self = this;
  264 + self.title = "";
  265 + self.employeeInfoForDetail = {};
  266 + self.employeeInfoForDetail.id = $stateParams.id;
  267 +
  268 + // 当转向到此页面时,就获取明细信息并绑定
  269 + employeeInfoManageService.getDetail($stateParams.id).then(
  270 + function(result) {
  271 + var key;
  272 + for (key in result) {
  273 + self.employeeInfoForDetail[key] = result[key];
  274 + }
  275 +
  276 + self.title = "员工 " + self.employeeInfoForDetail.personnelName + " 详细信息";
  277 + },
  278 + function(result) {
  279 + // TODO:弹出框方式以后改
  280 + alert("出错啦!");
  281 + }
  282 + );
  283 +}]);
  284 +
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/route.js 0 → 100644
  1 +// ui route 配置
  2 +
  3 +/** 人员基础信息模块配置route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("employeeInfoManage", { // index页面
  13 + url: '/employeeInfoManage',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html'
  17 + },
  18 + "employeeInfoManage_list@employeeInfoManage": {
  19 + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'employeeInfoManage_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  32 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js"
  33 + ]
  34 + });
  35 + }]
  36 + }
  37 + })
  38 + .state("employeeInfoManage_form", { // 添加人员信息form
  39 + url: '/employeeInfoManage_form',
  40 + views: {
  41 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'}
  42 + },
  43 + resolve: {
  44 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  45 + return $ocLazyLoad.load({
  46 + name: 'employeeInfoManage_form_module',
  47 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  48 + files: [
  49 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  50 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  51 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js"
  52 + ]
  53 + });
  54 + }]
  55 + }
  56 + })
  57 + .state("employeeInfoManage_edit", { // 修改人员信息form
  58 + url: '/employeeInfoManage_edit/:id',
  59 + views: {
  60 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'}
  61 + },
  62 + resolve: {
  63 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  64 + return $ocLazyLoad.load({
  65 + name: 'employeeInfoManage_edit_module',
  66 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  67 + files: [
  68 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  69 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  70 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js"
  71 + ]
  72 + });
  73 + }]
  74 + }
  75 + })
  76 + .state("employeeInfoManage_detail", { // 详细信息页面
  77 + url: '/employeeInfoManage_detail/:id',
  78 + views: {
  79 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'}
  80 + },
  81 + resolve: {
  82 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  83 + return $ocLazyLoad.load({
  84 + name: 'employeeInfoManage_detail_module',
  85 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  86 + files: [
  87 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js"
  88 + ]
  89 + });
  90 + }]
  91 + }
  92 + })
  93 +
  94 +}]);
0 95 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -118,105 +118,105 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
118 118 }
119 119 ]);
120 120  
121   -/**
122   - * remoteValidatiot2指令,远程数据验证验证,作为属性放在某个指令上,依赖与指令的ngModel(专门用于时刻表sheet验证)。
123   - * 属性如下:
124   - * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
125   - * remotevparam(必须):后端判定查询参数,如rvparam={{ {'xl.id_eq': '123'} | json }}
126   - *
127   - */
128   -angular.module('ScheduleApp').directive('remoteValidationt2', [
129   - '$$SearchInfoService_g',
130   - function($$SearchInfoService_g) {
131   - return {
132   - restrict: "A", // 属性
133   - require: "^ngModel", // 依赖所属指令的ngModel
134   - compile: function(tElem, tAttrs) {
135   - // 验证属性
136   - if (!tAttrs["remotevtype"]) { // 验证类型
137   - throw new Error("remotevtype属性必须填写");
138   - } else if (!$$SearchInfoService_g.validate[tAttrs["remotevtype"]]) {
139   - throw new Error(!tAttrs["remotevtype"] + "验证类型不存在");
140   - }
141   - if (!tAttrs["remotevparam"]) { // 查询参数
142   - throw new Error("remotevparam属性必须填写");
143   - }
144   -
145   - // 监听获取的数据
146   - var $watch_rvtype = undefined;
147   - var $watch_rvparam_obj = undefined;
148   -
149   - // 验证数据
150   - var $$internal_validate = function(ngModelCtrl, scope) {
151   - if ($watch_rvtype && $watch_rvparam_obj) {
152   - // 获取查询参数模版
153   - var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template;
154   - if (!paramTemplate) {
155   - throw new Error($watch_rvtype + "查询模版不存在");
156   - }
157   - // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证
158   - var isParamAll = true;
159   - for (var key in paramTemplate) {
160   - if (!$watch_rvparam_obj[key]) {
161   - isParamAll = false;
162   - break;
163   - }
164   - }
165   - if (!isParamAll) {
166   - ngModelCtrl.$setValidity('remote', true);
167   - } else { // 开始验证
168   - $$SearchInfoService_g.validate[$watch_rvtype].remote.do(
169   - $watch_rvparam_obj,
170   - function(result) {
171   - if (result.status == "SUCCESS") {
172   - ngModelCtrl.$setValidity('remote', true);
173   - } else {
174   - ngModelCtrl.$setValidity('remote', false);
175   - scope.ctrl.ttInfoDetailManageForForm.sheetvaliddesc = result.msg;
176   - }
177   - },
178   - function(result) {
179   - alert("出错拉");
180   - ngModelCtrl.$setValidity('remote', true);
181   - }
182   - );
183   - }
184   - }
185   - };
186   -
187   - return {
188   - pre: function(scope, element, attr) {
189   -
190   - },
191   -
192   - post: function(scope, element, attr, ngModelCtrl) {
193   - /**
194   - * 监控验证类型属性变化。
195   - */
196   - attr.$observe("remotevtype", function(value) {
197   - if (value && value != "") {
198   - $watch_rvtype = value;
199   - $$internal_validate(ngModelCtrl, scope);
200   - }
201   - });
202   - /**
203   - * 监控查询结果属性变化。
204   - */
205   - attr.$observe("remotevparam", function(value) {
206   - if (value && value != "") {
207   - //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
208   - // return;
209   - //}
210   - $watch_rvparam_obj = JSON.parse(value);
211   - $$internal_validate(ngModelCtrl, scope);
212   - }
213   - });
214   - }
215   - };
216   - }
217   - }
218   - }
219   -]);
  121 +/**
  122 + * remoteValidatiot2指令,远程数据验证验证,作为属性放在某个指令上,依赖与指令的ngModel(专门用于时刻表sheet验证)。
  123 + * 属性如下:
  124 + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
  125 + * remotevparam(必须):后端判定查询参数,如rvparam={{ {'xl.id_eq': '123'} | json }}
  126 + *
  127 + */
  128 +angular.module('ScheduleApp').directive('remoteValidationt2', [
  129 + '$$SearchInfoService_g',
  130 + function($$SearchInfoService_g) {
  131 + return {
  132 + restrict: "A", // 属性
  133 + require: "^ngModel", // 依赖所属指令的ngModel
  134 + compile: function(tElem, tAttrs) {
  135 + // 验证属性
  136 + if (!tAttrs["remotevtype"]) { // 验证类型
  137 + throw new Error("remotevtype属性必须填写");
  138 + } else if (!$$SearchInfoService_g.validate[tAttrs["remotevtype"]]) {
  139 + throw new Error(!tAttrs["remotevtype"] + "验证类型不存在");
  140 + }
  141 + if (!tAttrs["remotevparam"]) { // 查询参数
  142 + throw new Error("remotevparam属性必须填写");
  143 + }
  144 +
  145 + // 监听获取的数据
  146 + var $watch_rvtype = undefined;
  147 + var $watch_rvparam_obj = undefined;
  148 +
  149 + // 验证数据
  150 + var $$internal_validate = function(ngModelCtrl, scope) {
  151 + if ($watch_rvtype && $watch_rvparam_obj) {
  152 + // 获取查询参数模版
  153 + var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template;
  154 + if (!paramTemplate) {
  155 + throw new Error($watch_rvtype + "查询模版不存在");
  156 + }
  157 + // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证
  158 + var isParamAll = true;
  159 + for (var key in paramTemplate) {
  160 + if (!$watch_rvparam_obj[key]) {
  161 + isParamAll = false;
  162 + break;
  163 + }
  164 + }
  165 + if (!isParamAll) {
  166 + ngModelCtrl.$setValidity('remote', true);
  167 + } else { // 开始验证
  168 + $$SearchInfoService_g.validate[$watch_rvtype].remote.do(
  169 + $watch_rvparam_obj,
  170 + function(result) {
  171 + if (result.status == "SUCCESS") {
  172 + ngModelCtrl.$setValidity('remote', true);
  173 + } else {
  174 + ngModelCtrl.$setValidity('remote', false);
  175 + scope.ctrl.ttInfoDetailManageForForm.sheetvaliddesc = result.msg;
  176 + }
  177 + },
  178 + function(result) {
  179 + alert("出错拉");
  180 + ngModelCtrl.$setValidity('remote', true);
  181 + }
  182 + );
  183 + }
  184 + }
  185 + };
  186 +
  187 + return {
  188 + pre: function(scope, element, attr) {
  189 +
  190 + },
  191 +
  192 + post: function(scope, element, attr, ngModelCtrl) {
  193 + /**
  194 + * 监控验证类型属性变化。
  195 + */
  196 + attr.$observe("remotevtype", function(value) {
  197 + if (value && value != "") {
  198 + $watch_rvtype = value;
  199 + $$internal_validate(ngModelCtrl, scope);
  200 + }
  201 + });
  202 + /**
  203 + * 监控查询结果属性变化。
  204 + */
  205 + attr.$observe("remotevparam", function(value) {
  206 + if (value && value != "") {
  207 + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证
  208 + // return;
  209 + //}
  210 + $watch_rvparam_obj = JSON.parse(value);
  211 + $$internal_validate(ngModelCtrl, scope);
  212 + }
  213 + });
  214 + }
  215 + };
  216 + }
  217 + }
  218 + }
  219 +]);
220 220  
221 221  
222 222 angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {
... ...