Commit f66adf3d3ca4b9e4e254db64ff09d9c84e3dc003

Authored by 廖磊
2 parents c1dbad73 2237c740

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing 85 changed files with 1533 additions and 4377 deletions
src/main/java/com/bsth/controller/CarParkController.java
... ... @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
15 15 @RestController
16 16 @RequestMapping("carpark")
17 17 public class CarParkController extends BaseController<CarPark, Integer> {
18   -
19 18 @Autowired
20 19 CarParkService service;
21 20  
... ... @@ -26,16 +25,10 @@ public class CarParkController extends BaseController&lt;CarPark, Integer&gt; {
26 25 */
27 26 @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET)
28 27 public Map<String, Object> getStationCode() {
29   -
30 28 Map<String, Object> resultMap = new HashMap<String, Object>();
31   -
32   - resultMap.put("carParkCode", "FFFF" + GetUIDAndCode.getCarParkId());
33   -
  29 + resultMap.put("carParkCode", "FFFFFF" + GetUIDAndCode.getCarParkId());
34 30 return resultMap;
35   -
36 31 }
37   -
38   -
39 32 /**
40 33 * 新增停车场信息
41 34 *
... ... @@ -53,21 +46,14 @@ public class CarParkController extends BaseController&lt;CarPark, Integer&gt; {
53 46 */
54 47 @RequestMapping(value="carParkSave" , method = RequestMethod.POST)
55 48 public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) {
56   -
57 49 map.put("createBy", "");
58   -
59 50 map.put("updateBy", "");
60   -
61 51 return service.carParkSave(map);
62   -
63 52 }
64   -
65 53 @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET)
66 54 public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) {
67   -
68 55 return service.findCarParkInfoFormId(map);
69 56 }
70   -
71 57 /**
72 58 * 修改停车场信息
73 59 *
... ... @@ -85,11 +71,12 @@ public class CarParkController extends BaseController&lt;CarPark, Integer&gt; {
85 71 */
86 72 @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST)
87 73 public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) {
88   -
89 74 map.put("updateBy", "");
90   -
91 75 return service.carParkUpdate(map);
92   -
93 76 }
94 77  
  78 + @RequestMapping(value="isHaveParkCode",method=RequestMethod.GET)
  79 + public boolean isHaveParkCode(@RequestParam Map<String,Object> map) {
  80 + return service.selectTccInfoByCode(map);
  81 + }
95 82 }
... ...
src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
... ... @@ -15,7 +15,6 @@ import java.util.List;
15 15 import java.util.Map;
16 16  
17 17 /**
18   - * 相关数据异常检测
19 18 * Created by panzhao on 2017/4/14.
20 19 */
21 20 @RestController
... ...
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
... ... @@ -101,10 +101,10 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo {
101 101 ps.setString(1, sch.getScheduleDateStr());
102 102 ps.setString(2, sch.getXlBm());
103 103 ps.setString(3, sch.getXlName());
104   - ps.setString(4, sch.getLpName());
105   - ps.setInt(5, sch.getFcno());
106   - ps.setString(6, sch.getDfsj());
107   - ps.setString(7, sch.getClZbh());
  104 + ps.setString(4, /*sch.getLpName()*/"0");
  105 + ps.setInt(5, sch.getFcno()==null?-1:sch.getFcno());
  106 + ps.setString(6, sch.getDfsj().replace(":", ""));
  107 + ps.setString(7, sch.getClZbh().replace("-", ""));
108 108 ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh()));
109 109 ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType());
110 110 ps.setString(10, sch.getZdzName());
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
1 1 package com.bsth.data.gpsdata;
2 2  
3   -import com.bsth.Application;
4 3 import com.bsth.data.BasicData;
5 4 import com.bsth.data.forecast.ForecastRealServer;
6   -import com.bsth.data.gpsdata.client.ClientApp;
7 5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
8 6 import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
9 7 import com.bsth.data.schedule.DayOfSchedule;
... ... @@ -17,7 +15,8 @@ import org.springframework.boot.CommandLineRunner;
17 15 import org.springframework.stereotype.Component;
18 16  
19 17 import java.util.*;
20   -import java.util.concurrent.TimeUnit;
  18 +import java.util.concurrent.ConcurrentHashMap;
  19 +import java.util.concurrent.ConcurrentMap;
21 20  
22 21 /**
23 22 * @author PanZhao
... ... @@ -30,7 +29,7 @@ public class GpsRealData implements CommandLineRunner {
30 29  
31 30 static Logger logger = LoggerFactory.getLogger(GpsRealData.class);
32 31  
33   - private static Map<String, GpsEntity> gpsMap;
  32 + private static ConcurrentMap<String, GpsEntity> gpsMap;
34 33  
35 34 //按线路分组设备号
36 35 private static TreeMultimap<String, String> lineCode2Devices;
... ... @@ -51,22 +50,17 @@ public class GpsRealData implements CommandLineRunner {
51 50 * 构造函数
52 51 */
53 52 public GpsRealData() {
54   - gpsMap = new HashMap<>();
  53 + gpsMap = new ConcurrentHashMap<>();
55 54 lineCode2Devices = TreeMultimap.create();
56 55 }
57 56  
58   - @Autowired
59   - ClientApp clientApp;
60 57 @Override
61 58 public void run(String... arg0) throws Exception {
62 59 logger.info("gpsDataLoader,20,3");
63   - //定时从网关http形式获取GPS数据 --- 已弃用,现socket客户端接入数据
64   - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 3, TimeUnit.SECONDS);
  60 + //http形式获取GPS数据
  61 + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 2, TimeUnit.SECONDS);
65 62 //定时扫描掉离线
66   - Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
67   -
68   - //gps 客户端
69   - //clientApp.init();
  63 + //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
70 64 }
71 65  
72 66  
... ...
src/main/java/com/bsth/data/gpsdata/SignalStateData.java
... ... @@ -23,9 +23,9 @@ public class SignalStateData {
23 23 private static ArrayListMultimap<String, SignalState> listMultimap = ArrayListMultimap.create();
24 24  
25 25 public void put(SignalState state){
26   - listMultimap.put(state.getLineCode(), state);
  26 + //listMultimap.put(state.getLineCode(), state);
27 27 //推送到客户端
28   - sendUtils.sendSignalState(state);
  28 + //sendUtils.sendSignalState(state);
29 29 }
30 30  
31 31 public List<SignalState> get(String idx){
... ...
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
... ... @@ -11,6 +11,8 @@ import org.slf4j.LoggerFactory;
11 11 import org.springframework.beans.factory.annotation.Autowired;
12 12 import org.springframework.stereotype.Component;
13 13  
  14 +import java.util.Collections;
  15 +import java.util.Comparator;
14 16 import java.util.List;
15 17 import java.util.Set;
16 18 import java.util.concurrent.CountDownLatch;
... ... @@ -42,25 +44,26 @@ public class GpsRealAnalyse {
42 44 @Autowired
43 45 GpsRealData gpsRealData;
44 46  
45   - //50个线程
46   - static ExecutorService threadPool = Executors.newFixedThreadPool(50);
  47 + static ExecutorService threadPool = Executors.newFixedThreadPool(100);
47 48  
48 49 public void analyse(List<GpsEntity> list) {
49 50 //如果正在恢复数据
50 51 if (GpsDataRecovery.run)
51 52 return;
  53 +
  54 + long t = System.currentTimeMillis();
52 55 logger.info("analyse gps size: " + list.size());
53   - //按车辆分组gps
  56 + //按线路分组gps
54 57 ArrayListMultimap multimap = ArrayListMultimap.create();
55 58 for(GpsEntity gps : list){
56   - multimap.put(gps.getNbbm(), gps);
  59 + multimap.put(gps.getLineId(), gps);
57 60 }
58 61  
59 62 Set<String> ks = multimap.keySet();
60 63 CountDownLatch count = new CountDownLatch(ks.size());
61 64  
62   - for(String nbbm : ks){
63   - threadPool.execute(new SignalHandleThread(multimap.get(nbbm), count));
  65 + for(String lineCode : ks){
  66 + threadPool.execute(new SignalHandleThread(multimap.get(lineCode), count));
64 67 }
65 68  
66 69 try {
... ... @@ -70,11 +73,15 @@ public class GpsRealAnalyse {
70 73 //加入实时gps对照
71 74 for(GpsEntity gps: list)
72 75 gpsRealData.put(gps);
  76 +
  77 + logger.info("time , " + (System.currentTimeMillis() - t));
73 78 } catch (InterruptedException e) {
74 79 logger.error("", e);
75 80 }
76 81 }
77 82  
  83 + static GpsComp comp = new GpsComp();
  84 +
78 85 public class SignalHandleThread implements Runnable {
79 86  
80 87 List<GpsEntity> list;
... ... @@ -89,6 +96,7 @@ public class GpsRealAnalyse {
89 96 public void run() {
90 97  
91 98 try {
  99 + Collections.sort(list, comp);
92 100 for(GpsEntity gps : list){
93 101 //是否有任务
94 102 boolean task;
... ... @@ -119,4 +127,12 @@ public class GpsRealAnalyse {
119 127 }
120 128 }
121 129 }
  130 +
  131 + public static class GpsComp implements Comparator<GpsEntity> {
  132 +
  133 + @Override
  134 + public int compare(GpsEntity g1, GpsEntity g2) {
  135 + return g1.getTimestamp().compareTo(g2.getTimestamp());
  136 + }
  137 + }
122 138 }
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java
... ... @@ -74,6 +74,8 @@ public class ReverseSignalHandle extends SignalHandle {
74 74  
75 75 if (prev.getInstation() == 1) {
76 76 sr = GeoCacheData.getRouteCode(prev);
  77 + if(sr == null)
  78 + return null;
77 79  
78 80 if (sr.getRouteSort() > curr.getRouteSort()) {
79 81 if(half){
... ...
src/main/java/com/bsth/data/gpsdata/client/ClientApp.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client;
2   -
3   -import com.bsth.data.gpsdata.client.pd.codec.PdMessageCodecFactory;
4   -import com.bsth.data.gpsdata.client.pd.handler.PdClientHandler;
5   -import com.bsth.data.gpsdata.client.pd.protocol.Pd_31_0;
6   -import com.bsth.data.gpsdata.client.pf.codec.PfMessageCodecFactory;
7   -import com.bsth.data.gpsdata.client.pf.handler.PfClientHandler;
8   -import com.bsth.util.ConfigUtil;
9   -import org.apache.mina.core.future.ConnectFuture;
10   -import org.apache.mina.core.future.WriteFuture;
11   -import org.apache.mina.core.session.IdleStatus;
12   -import org.apache.mina.core.session.IoSession;
13   -import org.apache.mina.core.session.IoSessionConfig;
14   -import org.apache.mina.filter.codec.ProtocolCodecFilter;
15   -import org.apache.mina.filter.logging.LogLevel;
16   -import org.apache.mina.filter.logging.LoggingFilter;
17   -import org.apache.mina.transport.socket.nio.NioSocketConnector;
18   -import org.slf4j.Logger;
19   -import org.slf4j.LoggerFactory;
20   -import org.springframework.beans.factory.annotation.Autowired;
21   -import org.springframework.stereotype.Component;
22   -
23   -import java.net.InetSocketAddress;
24   -
25   -/**
26   - * Created by panzhao on 2017/5/4.
27   - */
28   -@Component
29   -public class ClientApp {
30   -
31   - private static NioSocketConnector pdDataConnector;
32   - private static NioSocketConnector pfDataConnector;
33   -
34   - @Autowired
35   - private PdClientHandler pdClient;
36   - @Autowired
37   - private PfClientHandler pfClient;
38   - @Autowired
39   - GpsBeforeBuffer gpsBeforeBuffer;
40   -
41   - static Logger logger = LoggerFactory.getLogger(ClientApp.class);
42   -
43   - public static boolean dconnect(String device) {
44   - boolean flag = false;
45   - try {
46   - ConnectFuture con = pdDataConnector.connect(new InetSocketAddress(ConfigUtil.get("gps.server.pd"), Integer.parseInt(ConfigUtil.get("gps.port.pd"))));
47   - con.awaitUninterruptibly();
48   - IoSession session = con.getSession();
49   - session.setAttribute("deviceId", device);
50   - com.bsth.data.gpsdata.client.pd.protocol.PdMessage msg = new com.bsth.data.gpsdata.client.pd.protocol.PdMessage();
51   - Pd_31_0 body = new Pd_31_0();
52   - body.setFunCode((short)0x15);
53   - body.setLineId(0);
54   - body.setDeviceId(device);
55   - msg.setMessageBody(body);
56   - msg.setVersion((short)1);
57   - msg.setSerialNo((short)1);
58   - msg.setCommandType((short)0x31);
59   - byte[] bytes = msg.write();
60   - WriteFuture write = session.write(bytes);
61   - write.awaitUninterruptibly();
62   - flag = true;
63   -
64   - logger.info("dconnect...");
65   - //SessionManager.getInstance().register(device, session);
66   - } catch (Exception e) {
67   - e.printStackTrace();
68   - }
69   - return flag;
70   - }
71   -
72   - public static boolean fconnect(String device) {
73   - boolean flag = false;
74   - try {
75   - ConnectFuture con = pfDataConnector.connect(new InetSocketAddress(ConfigUtil.get("gps.server.pf"), Integer.parseInt(ConfigUtil.get("gps.port.pf"))));
76   - con.awaitUninterruptibly();
77   - IoSession session = con.getSession();
78   - session.setAttribute("deviceId", device);
79   - flag = true;
80   -
81   - logger.info("fconnect...");
82   - } catch (Exception e) {
83   - e.printStackTrace();
84   - }
85   - return flag;
86   - }
87   -
88   - public void init() {
89   - //exec = Executors.newFixedThreadPool(4);
90   - //sexec.scheduleAtFixedRate(new SessionChecker(), 1, 1, TimeUnit.MINUTES);
91   - /*******************************浦东********************************/
92   - pdDataConnector = new NioSocketConnector();
93   -
94   - LoggingFilter log = new LoggingFilter();
95   - log.setMessageReceivedLogLevel(LogLevel.DEBUG);
96   - pdDataConnector.getFilterChain().addLast("logger", log);
97   -
98   - pdDataConnector.getFilterChain().addLast("codec",
99   - new ProtocolCodecFilter(new PdMessageCodecFactory()));
100   -
101   - IoSessionConfig config = pdDataConnector.getSessionConfig();
102   -
103   - config.setReadBufferSize(4096);
104   - config.setWriteTimeout(10000);
105   - config.setWriterIdleTime(60000);
106   -
107   - config.setIdleTime(IdleStatus.BOTH_IDLE, 60);
108   -
109   - pdDataConnector.setHandler(pdClient);
110   -
111   - dconnect(ConfigUtil.get("forward.device.name"));
112   - /*******************************浦东转发********************************/
113   - pfDataConnector = new NioSocketConnector();
114   -
115   - LoggingFilter log1 = new LoggingFilter();
116   - log1.setMessageReceivedLogLevel(LogLevel.DEBUG);
117   - pfDataConnector.getFilterChain().addLast("logger", log1);
118   -
119   - pfDataConnector.getFilterChain().addLast("codec",
120   - new ProtocolCodecFilter(new PfMessageCodecFactory()));
121   -
122   - IoSessionConfig config1 = pfDataConnector.getSessionConfig();
123   -
124   - config1.setReadBufferSize(4096);
125   - config1.setWriteTimeout(10000);
126   - config1.setWriterIdleTime(60000);
127   -
128   - config1.setIdleTime(IdleStatus.BOTH_IDLE, 60);
129   -
130   - pfDataConnector.setHandler(pfClient);
131   - fconnect(ConfigUtil.get("forward.device.name"));
132   -
133   -
134   - gpsBeforeBuffer.init();
135   - }
136   -}
137 0 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/client/GpsBeforeBuffer.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client;
2   -
3   -import com.bsth.Application;
4   -import com.bsth.data.BasicData;
5   -import com.bsth.data.gpsdata.GpsEntity;
6   -import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
7   -import com.bsth.data.gpsdata.client.pd.protocol.BasicInfo;
8   -import org.apache.commons.lang3.StringUtils;
9   -import org.springframework.beans.factory.annotation.Autowired;
10   -import org.springframework.stereotype.Component;
11   -
12   -import java.util.ArrayList;
13   -import java.util.LinkedList;
14   -import java.util.List;
15   -import java.util.concurrent.TimeUnit;
16   -
17   -/**
18   - * 从 socket client 到 .. 的缓冲
19   - * Created by panzhao on 2017/5/4.
20   - */
21   -@Component
22   -public class GpsBeforeBuffer {
23   -
24   - static LinkedList<GpsEntity> linkedList = new LinkedList<>();
25   -
26   - @Autowired
27   - GpsHandleThread gpsHandleThread;
28   -
29   - public void put(BasicInfo basicInfo){
30   - //放弃补发数据
31   - byte cacheData = getCacheState(basicInfo.getServiceState());
32   - if(cacheData == 1)
33   - return;
34   - GpsEntity gps = new GpsEntity();
35   -
36   - gps.setDeviceId(basicInfo.getDeviceId());
37   - gps.setTimestamp(basicInfo.getTimestamp());
38   - gps.setLat(basicInfo.getLat());
39   - gps.setLon(basicInfo.getLon());
40   - gps.setDirection((float)basicInfo.getDirection() / 10);
41   - gps.setValid(basicInfo.getGpsValid());
42   - gps.setCompanyCode(basicInfo.getCompanyCode());
43   - gps.setStopNo(basicInfo.getStopNo());
44   - gps.setUpDown(basicInfo.getUpOrDown());
45   - gps.setSpeed((float)basicInfo.getSpeedGps() / 10);
46   - gps.setLineId(String.valueOf(basicInfo.getLineId()));
47   - gps.setState((int) getService(basicInfo.getServiceState()));
48   - //没有设备号
49   - if (StringUtils.isBlank(gps.getDeviceId()))
50   - return;
51   -
52   - String nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
53   - if (StringUtils.isBlank(nbbm))
54   - gps.setIncomplete(true);
55   - else
56   - gps.setNbbm(nbbm);
57   -
58   - linkedList.addLast(gps);
59   - }
60   -
61   - public byte getCacheState(long serviceState) {
62   - return (byte)(((serviceState & 0x00100000) == 0x00100000) ? 1 : 0);
63   - }
64   -
65   - public void init(){
66   - Application.mainServices.scheduleWithFixedDelay(gpsHandleThread, 20 * 1000, 1100, TimeUnit.MILLISECONDS);
67   - }
68   -
69   - @Component
70   - public static class GpsHandleThread extends Thread{
71   -
72   - List<GpsEntity> list;
73   -
74   - @Autowired
75   - GpsRealAnalyse gpsRealAnalyse;
76   -
77   - @Override
78   - public void run() {
79   - list = new ArrayList<>(100);
80   -
81   - GpsEntity gps;
82   - for(int i = 0; i < 2000; i ++){
83   - gps = linkedList.poll();
84   - if(gps == null)
85   - break;
86   - list.add(gps);
87   - }
88   -
89   - gpsRealAnalyse.analyse(list);
90   - }
91   - }
92   -
93   - /**
94   - * 获取运营状态
95   - *
96   - * @return -1无效 0运营 1未运营
97   - */
98   - public static byte getService(long serviceState) {
99   - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000)
100   - return -1;
101   - return (byte) (((serviceState & 0x02000000) == 0x02000000) ? 1 : 0);
102   - }
103   -}
104 0 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/client/common/ExceptionUtil.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.common;
2   -
3   -public class ExceptionUtil {
4   -
5   - public static String getTrace(Throwable e) {
6   - StringBuilder sb = new StringBuilder();
7   - sb.append(e.toString());
8   - for (StackTraceElement ste : e.getStackTrace()) {
9   - sb.append(ste).append("\r\n");
10   - }
11   - return sb.toString();
12   - }
13   -}
src/main/java/com/bsth/data/gpsdata/client/common/Protocol2BizUtil.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.common;
2   -
3   -//import com.bsth.data.gpsdata.socket_client_001.pd.protocol.BasicInfo;
4   -//import com.bsth.data.gpsdata.socket_client_001.pf.protocol.PfMessage;
5   -//import com.bsth.data.gpsdata.socket_client_001.pf.protocol.Pf_1_0;
6   -
7   -import com.bsth.data.gpsdata.client.pd.protocol.BasicInfo;
8   -import com.bsth.data.gpsdata.client.pf.protocol.PfMessage;
9   -import com.bsth.data.gpsdata.client.pf.protocol.Pf_1_0;
10   -import org.slf4j.Logger;
11   -import org.slf4j.LoggerFactory;
12   -
13   -public class Protocol2BizUtil {
14   -
15   - private final static Logger log = LoggerFactory.getLogger(Protocol2BizUtil.class);
16   -
17   - /**
18   - * 从协议数据中获得基本数据
19   - */
20   - public static BasicInfo getBasicInfoFromMsg(PfMessage msg) {
21   - if (msg == null) return null;
22   - BasicInfo info = null;
23   - if (msg.getCommandType() == 0x01) {
24   - Pf_1_0 pf_1_0 = (Pf_1_0)msg.getMessageBody();
25   - info = new BasicInfo();
26   - info.setLineId(pf_1_0.getXldm());
27   - info.setDeviceId(pf_1_0.getMtd());
28   - info.setDriverEmpNo(Integer.parseInt(pf_1_0.getDriver().trim()));
29   - info.setCarparkNo(pf_1_0.getTccbh());
30   - info.setStopNo(pf_1_0.getZdbh());
31   - double lon = pf_1_0.getLon()/1000000, lat = pf_1_0.getLat()/1000000;
32   - info.setCarLon(((long)lon) * 1000000 + (long)((lon - (long)lon) * 600000));
33   - info.setCarLat(((int)lat) * 1000000 + (int)((lat - (int)lat) * 600000));
34   - info.setTimestamp(pf_1_0.getFssj().getTime());
35   - info.setSpeedGps((short)pf_1_0.getSpeed());
36   - info.setSpeedSensor((short)(pf_1_0.getSpeed()));
37   - info.setDirection((short)(pf_1_0.getFx()));
38   - info.setServiceState(0);
39   - info.setService(pf_1_0.getYyzt() == 0 ? true : false);
40   - info.setUpOrDown(pf_1_0.getSxxzt() == 0 ? true : false);
41   -
42   - info.setLon(Float.parseFloat(String.valueOf(lon)));
43   - info.setLat(Float.parseFloat(String.valueOf(lat)));
44   - }
45   -
46   - return info;
47   - }
48   -}
src/main/java/com/bsth/data/gpsdata/client/common/ThreadLocalDateUtil.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.common;
2   -
3   -import java.text.DateFormat;
4   -import java.text.ParseException;
5   -import java.text.SimpleDateFormat;
6   -import java.util.Date;
7   -
8   -public class ThreadLocalDateUtil {
9   - private static final String date_format = "yyyyMMddHHmmss";
10   - private static ThreadLocal<DateFormat> threadLocal = new ThreadLocal<DateFormat>();
11   -
12   - public static DateFormat getDateFormat()
13   - {
14   - DateFormat df = threadLocal.get();
15   - if(df==null){
16   - df = new SimpleDateFormat(date_format);
17   - threadLocal.set(df);
18   - }
19   - return df;
20   - }
21   -
22   - public static String formatDate(Date date) throws ParseException {
23   - return getDateFormat().format(date);
24   - }
25   -
26   - public static Date parse(String strDate) throws ParseException {
27   - return getDateFormat().parse(strDate);
28   - }
29   -}
src/main/java/com/bsth/data/gpsdata/client/msg/IMessage.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.msg;
2   -
3   -public interface IMessage extends IMessageIO {
4   -
5   - public IMessageBody getMessageBody();
6   -}
src/main/java/com/bsth/data/gpsdata/client/msg/IMessageBody.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.msg;
2   -
3   -public interface IMessageBody extends IMessageIO {
4   -
5   - public String getDeviceId();
6   -
7   - public long getTimestamp();
8   -}
src/main/java/com/bsth/data/gpsdata/client/msg/IMessageIO.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.msg;
2   -
3   -public interface IMessageIO {
4   -
5   - public void read(byte[] bytes);
6   -
7   - public byte[] write();
8   -}
src/main/java/com/bsth/data/gpsdata/client/pd/codec/MessageDecoder.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.codec;
2   -
3   -import com.bsth.data.gpsdata.client.pd.protocol.PdMessage;
4   -import org.apache.mina.core.buffer.IoBuffer;
5   -import org.apache.mina.core.session.IoSession;
6   -import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
7   -import org.apache.mina.filter.codec.ProtocolDecoderOutput;
8   -
9   -
10   -public class MessageDecoder extends CumulativeProtocolDecoder {
11   -
12   - @Override
13   - protected boolean doDecode(IoSession session, IoBuffer in,
14   - ProtocolDecoderOutput out) throws Exception {
15   - // TODO Auto-generated method stub
16   - while (in.remaining() > 3) {
17   - in.mark();
18   - byte head1 = in.get(), head2 = in.get(), lenh = in.get(), lenl = in.get();
19   - int len = ((lenh & 0xff) << 8) + (lenl & 0xff);
20   - if ((head1 & 0xff) == 0xfa && (head2 & 0xff) == 0xf5) {
21   - if (in.remaining() > len) {
22   - byte[] bytes = new byte[len + 1];
23   - in.get(bytes);
24   - PdMessage msg = new PdMessage();
25   - msg.read(bytes);
26   - out.write(msg);
27   - /*if ("true".equals(ConfigUtil.getProperty("protocolup", "true"))) {
28   - UpProtocolDataService.getInstance().write(new byte[]{ head1, head2, lenh, lenl });
29   - UpProtocolDataService.getInstance().write(bytes);
30   - }*/
31   - } else {
32   - in.reset();
33   - return false;
34   - }
35   - }
36   - }
37   - return false;
38   - }
39   -
40   - /*private static String toHexString(byte[] bytes) {
41   - StringBuilder sb = new StringBuilder();
42   - for (byte b : bytes) {
43   - sb.append(Integer.toHexString(b & 0xff) + "|");
44   - }
45   - return sb.toString();
46   - }*/
47   -}
src/main/java/com/bsth/data/gpsdata/client/pd/codec/MessageEncoder.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.codec;
2   -
3   -import org.apache.mina.core.buffer.IoBuffer;
4   -import org.apache.mina.core.session.IoSession;
5   -import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
6   -import org.apache.mina.filter.codec.ProtocolEncoderOutput;
7   -
8   -
9   -public class MessageEncoder extends ProtocolEncoderAdapter {
10   -
11   - @Override
12   - public void encode(IoSession session, Object message,
13   - ProtocolEncoderOutput out) throws Exception {
14   - // TODO Auto-generated method stub
15   - IoBuffer buf = IoBuffer.allocate(1024).setAutoExpand(true);
16   - buf.put((byte[])message);
17   - buf.flip();
18   - out.write(buf);
19   - /*if ("true".equals(ConfigUtil.getProperty("protocoldown", "true"))) {
20   - DownProtocolDataService.getInstance().write((byte[])message);
21   - }*/
22   - }
23   -
24   -}
src/main/java/com/bsth/data/gpsdata/client/pd/codec/PdMessageCodecFactory.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.codec;
2   -
3   -import org.apache.mina.core.session.IoSession;
4   -import org.apache.mina.filter.codec.ProtocolCodecFactory;
5   -import org.apache.mina.filter.codec.ProtocolDecoder;
6   -import org.apache.mina.filter.codec.ProtocolEncoder;
7   -
8   -public class PdMessageCodecFactory implements ProtocolCodecFactory {
9   -
10   - private ProtocolEncoder encoder;
11   - private ProtocolDecoder decoder;
12   -
13   - public PdMessageCodecFactory() {
14   - encoder = new MessageEncoder();
15   - decoder = new MessageDecoder();
16   - }
17   -
18   - @Override
19   - public ProtocolEncoder getEncoder(IoSession session) throws Exception {
20   - // TODO Auto-generated method stub
21   - return encoder;
22   - }
23   -
24   - @Override
25   - public ProtocolDecoder getDecoder(IoSession session) throws Exception {
26   - // TODO Auto-generated method stub
27   - return decoder;
28   - }
29   -
30   -}
src/main/java/com/bsth/data/gpsdata/client/pd/common/ConvertUtil.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.common;
2   -
3   -import com.bsth.data.gpsdata.client.common.ThreadLocalDateUtil;
4   -import org.slf4j.Logger;
5   -import org.slf4j.LoggerFactory;
6   -
7   -import java.text.ParseException;
8   -import java.util.Arrays;
9   -import java.util.Calendar;
10   -import java.util.Date;
11   -
12   -
13   -public class ConvertUtil {
14   -
15   - private final static Logger log = LoggerFactory.getLogger(ConvertUtil.class);
16   -
17   - public static int bcd2int(byte[] bytes, int start, int len) {
18   - if (len > 4 || len == 0)
19   - throw new IllegalArgumentException("bcd2int 字节数不符合要求");
20   - String temp = "";
21   - for (int i = 0;i < len;i++) {
22   - int val = bytes[start + i] & 0xff;
23   - if (val < 10) temp += 0;
24   - temp += Integer.toHexString(val);
25   - }
26   - return Integer.parseInt(temp);
27   - }
28   -
29   - public static byte[] int2bcd(int val, int len) {
30   - if (len > 4 || len == 0)
31   - throw new IllegalArgumentException("int2bcd 字节数不符合要求");
32   - byte[] result = new byte[len];
33   - for (int i = len - 1;i > -1;i--) {
34   - result[i] = (byte)Integer.parseInt(val%100 + "", 16);
35   - val = val/100;
36   - }
37   - return result;
38   - }
39   -
40   - public static long bcd2long(byte[] bytes, int start, int len) {
41   - if (len > 8 || len == 0)
42   - throw new IllegalArgumentException("bcd2long 字节数不符合要求");
43   - String temp = "";
44   - for (int i = 0;i < len;i++) {
45   - int val = bytes[start + i] & 0xff;
46   - if (val < 10) temp += 0;
47   - temp += Integer.toHexString(val);
48   - }
49   - return Long.parseLong(temp);
50   - }
51   -
52   - public static byte[] long2bcd(long val, int len) {
53   - if (len > 8 || len == 0)
54   - throw new IllegalArgumentException("long2bcd 字节数不符合要求");
55   - byte[] result = new byte[len];
56   - for (int i = len - 1;i > -1;i--) {
57   - result[i] = (byte)Integer.parseInt(val%100 + "", 16);
58   - val = val/100;
59   - }
60   - return result;
61   - }
62   -
63   - public static String ascii2string(byte[] bytes, int start, int len) {
64   - return new String(Arrays.copyOfRange(bytes, start, start + len));
65   - }
66   -
67   - public static byte[] string2ascii(String val, int len) {
68   - byte[] result = new byte[len];
69   - byte[] bytes = val.getBytes();
70   - if (bytes.length > len && len != 0)
71   - throw new IllegalArgumentException("string2ascii 参数不符合要求");
72   - if (len != 0)
73   - for (int i = 0, l = bytes.length;i < l;i++) result[i] = bytes[i];
74   - else return bytes;
75   - return result;
76   - }
77   -
78   - public static long bcd2timestamp(byte[] bytes, int start) {
79   - String temp = "20";
80   - for (int i = 0;i < 6;i++) {
81   - int val = bytes[start + i] & 0xff;
82   - if (val < 10) temp += 0;
83   - temp += Integer.toHexString(val);
84   - }
85   - Date date = null;
86   - try {
87   - date = ThreadLocalDateUtil.parse(temp);
88   - } catch (ParseException e) {
89   - log.error("协议中时间数据异常:" + temp);
90   - }
91   - if (date != null) return date.getTime();
92   - return -1;
93   - }
94   -
95   - public static byte[] timestamp2bcd(long val) {
96   - byte[] result = new byte[6];
97   - Calendar c = Calendar.getInstance();
98   - c.setTime(new Date(val));
99   - result[0] = (byte)(Integer.parseInt(c.get(Calendar.YEAR)%100 + "", 16));
100   - result[1] = (byte)(Integer.parseInt(c.get(Calendar.MONTH) + 1 + "", 16));
101   - result[2] = (byte)Integer.parseInt(c.get(Calendar.DAY_OF_MONTH) + "", 16);
102   - result[3] = (byte)Integer.parseInt(c.get(Calendar.HOUR_OF_DAY) + "", 16);
103   - result[4] = (byte)Integer.parseInt(c.get(Calendar.MINUTE) + "", 16);
104   - result[5] = (byte)Integer.parseInt(c.get(Calendar.SECOND) + "", 16);
105   - return result;
106   - }
107   -
108   - public static byte[] int2hex(int val, int len) {
109   - if (len < 1)
110   - throw new IllegalArgumentException("int2hex len 参数不符合要求");
111   - byte[] result = new byte[len];
112   - for (int i = 0;i < len;i++) {
113   - result[len - 1 - i] = (byte)(val%100);
114   - val = val/100;
115   - }
116   -
117   - return result;
118   - }
119   -
120   - public static int bytes2int(byte[] bytes, int start, int len) {
121   - int val = 0;
122   - for (int i = 0; i < len; i++) {
123   - int shift = (len - 1 - i) * 8;
124   - val += (bytes[start + i] & 0x0000FF) << shift;
125   - }
126   -
127   - return val;
128   - }
129   -}
src/main/java/com/bsth/data/gpsdata/client/pd/handler/PdClientHandler.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.handler;
2   -
3   -import com.bsth.data.gpsdata.client.ClientApp;
4   -import com.bsth.data.gpsdata.client.GpsBeforeBuffer;
5   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
6   -import com.bsth.data.gpsdata.client.pd.protocol.PdMessage;
7   -import com.bsth.data.gpsdata.client.pd.protocol.Pd_41_0;
8   -import com.bsth.data.gpsdata.client.pd.protocol.Pd_42_0;
9   -import org.apache.mina.core.service.IoHandlerAdapter;
10   -import org.apache.mina.core.session.IdleStatus;
11   -import org.apache.mina.core.session.IoSession;
12   -import org.apache.mina.transport.socket.SocketSessionConfig;
13   -import org.slf4j.Logger;
14   -import org.slf4j.LoggerFactory;
15   -import org.springframework.beans.factory.annotation.Autowired;
16   -import org.springframework.stereotype.Service;
17   -
18   -import java.io.IOException;
19   -
20   -
21   -@Service
22   -public class PdClientHandler extends IoHandlerAdapter{
23   -
24   - private final static Logger log = LoggerFactory.getLogger(PdClientHandler.class);
25   -
26   - @Autowired
27   - GpsBeforeBuffer gpsBeforeBuffer;
28   -
29   - @Override
30   - public void sessionCreated(IoSession session) throws Exception {
31   - SocketSessionConfig cfg = (SocketSessionConfig) session.getConfig();
32   - cfg.setSoLinger(0);
33   - }
34   -
35   - @Override
36   - public void sessionOpened(IoSession session) throws Exception {
37   -
38   - }
39   -
40   - @Override
41   - public void sessionClosed(IoSession session) throws Exception {
42   - String deviceId = (String)session.getAttribute("deviceId");
43   - if (deviceId != null) {
44   - //SessionManager.getInstance().unregister(deviceId);
45   - log.info("连网关设备编号:" + deviceId + "断开连接");
46   - log.warn(deviceId + "网关设备注销");
47   -
48   - ClientApp.dconnect(deviceId);
49   - } else {
50   - log.info("连网关设备编号:" + deviceId + "断开连接");
51   - }
52   - }
53   -
54   - @Override
55   - public void sessionIdle(IoSession session, IdleStatus status) throws Exception {
56   - session.closeNow();
57   - }
58   -
59   - @Override
60   - public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
61   - if (cause instanceof IOException) session.closeNow();
62   - log.error("PdClientHandler异常:", cause);
63   - }
64   -
65   - @Override
66   - public void messageReceived(IoSession session, Object message) throws Exception {
67   - PdMessage msg = (PdMessage)message;
68   - IMessageBody body = msg.getMessageBody();
69   - if (body != null) {
70   - //String deviceId = body.getDeviceId();
71   - if (0x31 == msg.getCommandType()) {
72   - //IoSession regSession = SessionManager.getInstance().getSession(deviceId);
73   - //if (regSession != null) regSession.closeNow();
74   - //SessionManager.getInstance().register(deviceId, session);
75   - log.debug("设备编号:" + body.getDeviceId() + "建立连接");
76   - }
77   - else if(0x41 == msg.getCommandType()){
78   - Pd_41_0 pd41 = (Pd_41_0)msg.getMessageBody();
79   - gpsBeforeBuffer.put(pd41.getInfo());
80   - }
81   - else if(0x42 == msg.getCommandType()){
82   - Pd_42_0 pd42 = (Pd_42_0)msg.getMessageBody();
83   - gpsBeforeBuffer.put(pd42.getInfo());
84   - }
85   - }
86   - }
87   -
88   - @Override
89   - public void messageSent(IoSession session, Object message) throws Exception {
90   -
91   - }
92   -}
src/main/java/com/bsth/data/gpsdata/client/pd/protocol/BasicInfo.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.protocol;
2   -
3   -
4   -import com.bsth.data.gpsdata.client.pd.common.ConvertUtil;
5   -
6   -import java.nio.ByteBuffer;
7   -import java.util.Date;
8   -
9   -
10   -public class BasicInfo {
11   -
12   - private int cityCode;
13   - private short industryCode;
14   - private short companyCode;
15   - private String deviceId;
16   - private int lineId;
17   - private int driverEmpNo;
18   - private short carparkSerialNo;
19   - private String carparkNo;
20   - private short stopSerialNo;
21   - private String stopNo;
22   - // 经度 bcd 5 0121245333表示经度为121度24.5333分
23   - private long carLon;
24   - // 维度
25   - private int carLat;
26   - private long timestamp;
27   - // 速度(传感器)bcd 2 保留一位小数 km/h
28   - private short speedSensor;
29   - // 速度(gps)bcd 2 保留一位小数 km/h
30   - private short speedGps;
31   - // 方向 bcd 2 0-359.5 保留一位小数
32   - private short direction;
33   - // 车内温度 bcd 2 第一字节为符号 00为正 01为负 后一字节为温度
34   - private short inTemp;
35   - // 营运状态 hex 4高位在前
36   - // 第一字节位 7 GPS有/无效|6 场外/内|5 起终点站外/内|4 上/下行|3 已知/未知|2站外/站内|1 营运/非营运|0 在线路上/不在
37   - // 7=1时其它位无效|0=1时3,4,5无效 第二字节6,7无效|3=1时2,4无效 第二字节6,7无效
38   - // 第二字节位 7 非/标杆点|6 非/中途校时点|5 点/熄火|4 实时/缓存数据|3 门开/关|2 预留|1 非/包车|0预留
39   - // 1=1时 第一字节0-6无效 6,7无效
40   - // 后两个字节保留
41   - private long serviceState;
42   - // 调控状态
43   - private long controlState;
44   - // 累计里程 km 保留两位小数
45   - private int totalMiles;
46   - // 水温
47   - private byte waterTemp;
48   - // 油耗 (第一个字节 + 第二个字节/10)升/百公里
49   - private int oilConsumption;
50   - // 发动机转速 100转/秒
51   - private int engineSpeed;
52   - private float lon;
53   - private float lat;
54   -
55   - private boolean inOutStopFlag = false;
56   -
57   - public void read(byte[] bytes, int idx) {
58   - // TODO Auto-generated method stub
59   - ByteBuffer buf = ByteBuffer.wrap(bytes);
60   - cityCode = ConvertUtil.bcd2int(bytes, idx, 3); idx += 3;
61   - industryCode = (short)(bytes[idx] & 0xff); idx++;
62   - companyCode = (short)(bytes[idx] & 0xff); idx++;
63   - deviceId = ConvertUtil.ascii2string(bytes, idx, 8); idx += 8;
64   - lineId = ConvertUtil.bcd2int(bytes, idx, 3); idx += 3;
65   - driverEmpNo = ConvertUtil.bcd2int(bytes, idx, 4); idx +=4;
66   - carparkSerialNo = (short)(bytes[idx] & 0xff); idx++;
67   - carparkNo = ConvertUtil.ascii2string(bytes, idx, 8); idx += 8;
68   - stopSerialNo = (short)(bytes[idx] & 0xff); idx++;
69   - stopNo = ConvertUtil.ascii2string(bytes, idx, 8).trim(); idx += 8;
70   - carLon = ConvertUtil.bcd2long(bytes, idx, 5); lon = (int)(carLon/1000000) + carLon%1000000/600000f; idx += 5;
71   - carLat = ConvertUtil.bcd2int(bytes, idx, 4); lat = carLat/1000000 + carLat%1000000/600000f; idx += 4;
72   - timestamp = ConvertUtil.bcd2timestamp(bytes, idx); idx += 6;
73   - speedSensor = (short)ConvertUtil.bcd2int(bytes, idx, 2); idx += 2;
74   - speedGps = (short)ConvertUtil.bcd2int(bytes, idx, 2); idx += 2;
75   - direction = (short)(ConvertUtil.bcd2int(bytes, idx, 2)); idx += 2;
76   - inTemp = (short)ConvertUtil.bcd2int(bytes, idx, 2); idx += 2;
77   - serviceState = buf.getInt(idx) & 0xffffffff; idx += 4;
78   - controlState = buf.getInt(idx) & 0xffffffff; idx += 4;
79   - totalMiles = ConvertUtil.bcd2int(bytes, idx, 4); idx += 4;
80   - waterTemp = bytes[idx]; idx++;
81   - oilConsumption = ConvertUtil.bcd2int(bytes, idx, 4); idx += 4;
82   - engineSpeed = buf.getShort(idx) & 0xffff; idx += 2;
83   - }
84   -
85   - public byte[] write() {
86   - ByteBuffer buf = ByteBuffer.allocate(80);
87   - buf.put(ConvertUtil.int2bcd(cityCode, 3));
88   - buf.put((byte)industryCode);
89   - buf.put((byte)companyCode);
90   - buf.put(ConvertUtil.string2ascii(deviceId, 8));
91   - buf.put(ConvertUtil.int2bcd(lineId, 3));
92   - buf.put(ConvertUtil.int2bcd(driverEmpNo, 4));
93   - buf.put((byte)carparkSerialNo);
94   - buf.put(ConvertUtil.string2ascii(carparkNo, 8));
95   - buf.put((byte)stopSerialNo);
96   - buf.put(ConvertUtil.string2ascii(stopNo, 8));
97   - buf.put(ConvertUtil.long2bcd(carLon, 5));
98   - buf.put(ConvertUtil.long2bcd(carLat, 4));
99   - buf.put(ConvertUtil.timestamp2bcd(timestamp));
100   - buf.put(ConvertUtil.int2bcd(speedSensor, 2));
101   - buf.put(ConvertUtil.int2bcd(speedGps, 2));
102   - buf.put(ConvertUtil.int2bcd(direction, 2));
103   - buf.put(ConvertUtil.int2bcd(inTemp, 2));
104   - buf.putInt((int)serviceState);
105   - buf.putInt((int)controlState);
106   - buf.put(ConvertUtil.int2bcd(totalMiles, 4));
107   - buf.put(waterTemp);
108   - buf.put(ConvertUtil.int2bcd(oilConsumption, 2));
109   - buf.putShort((short)engineSpeed);
110   -
111   - return buf.array();
112   - }
113   -
114   - public String getDeviceId() {
115   - // TODO Auto-generated method stub
116   - return deviceId;
117   - }
118   -
119   - public int getCityCode() {
120   - return cityCode;
121   - }
122   -
123   - public short getIndustryCode() {
124   - return industryCode;
125   - }
126   -
127   - public short getCompanyCode() {
128   - return companyCode;
129   - }
130   -
131   - public int getLineId() {
132   - return lineId;
133   - }
134   -
135   - public int getDriverEmpNo() {
136   - return driverEmpNo;
137   - }
138   -
139   - public short getCarparkSerialNo() {
140   - return carparkSerialNo;
141   - }
142   -
143   - public String getCarparkNo() {
144   - return carparkNo;
145   - }
146   -
147   - public short getStopSerialNo() {
148   - return stopSerialNo;
149   - }
150   -
151   - public String getStopNo() {
152   - return stopNo;
153   - }
154   -
155   - public long getCarLon() {
156   - return carLon;
157   - }
158   -
159   - public int getCarLat() {
160   - return carLat;
161   - }
162   -
163   - public long getTimestamp() {
164   - return timestamp;
165   - }
166   -
167   - public short getSpeedSensor() {
168   - return speedSensor;
169   - }
170   -
171   - public short getSpeedGps() {
172   - return speedGps;
173   - }
174   -
175   - public short getDirection() {
176   - return direction;
177   - }
178   -
179   - public short getInTemp() {
180   - return inTemp;
181   - }
182   -
183   - public long getServiceState() {
184   - return serviceState;
185   - }
186   -
187   - public long getControlState() {
188   - return controlState;
189   - }
190   -
191   - public int getTotalMiles() {
192   - return totalMiles;
193   - }
194   -
195   - public byte getWaterTemp() {
196   - return waterTemp;
197   - }
198   -
199   - public int getOilConsumption() {
200   - return oilConsumption;
201   - }
202   -
203   - public int getEngineSpeed() {
204   - return engineSpeed;
205   - }
206   -
207   - public float getLon() {
208   - return lon;
209   - }
210   -
211   - public void setLon(float lon) {
212   - this.lon = lon;
213   - }
214   -
215   - public float getLat() {
216   - return lat;
217   - }
218   -
219   - public void setLat(float lat) {
220   - this.lat = lat;
221   - }
222   -
223   - public void setStopNo(String stopNo) {
224   - this.stopNo = stopNo;
225   - }
226   -
227   - public byte getGpsValid() {
228   - return (byte)(((serviceState & 0x80000000) == 0x80000000) ? 1 : 0);
229   - }
230   -
231   - /**
232   - * 获取车辆在场外/内
233   - * @return -1无效 0场外1场内
234   - */
235   - public byte getInOrOutCarpark() {
236   - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000
237   - || (serviceState & 0x01000000) == 0x01000000) return -1;
238   - return (byte)(((serviceState & 0x40000000) == 0x40000000) ? 1 : 0);
239   - }
240   -
241   - public void setInOrOutCarpark(boolean inOutFlag) {
242   - if (inOutFlag) serviceState |= 0x40000000;
243   - else serviceState &= 0xbfffffff;
244   - }
245   -
246   - /**
247   - * 获取车辆在起终点站外/内
248   - * @return -1无效 0起终点站外1起终点站内
249   - */
250   - public byte getInOrOutStartEnd() {
251   - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000
252   - || (serviceState & 0x01000000) == 0x01000000) return -1;
253   - return (byte)(((serviceState & 0x20000000) == 0x20000000) ? 1 : 0);
254   - }
255   -
256   - /**
257   - * 获取车辆线路上下行
258   - * @return -1无效 0上行 1下行
259   - */
260   - public byte getUpOrDown() {
261   - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000
262   - || (serviceState & 0x01000000) == 0x01000000
263   - || (serviceState & 0x08000000) == 0x08000000) return -1;
264   - return (byte)(((serviceState & 0x10000000) == 0x10000000) ? 1 : 0);
265   - }
266   -
267   - public void setUpOrDown(boolean upOrDown) {
268   - if (!upOrDown) serviceState |= 0x10000000;
269   - else serviceState &= 0xefffffff;
270   - }
271   -
272   - /**
273   - * 获取车辆在站外/内
274   - * @return -1无效 0站外 1站内
275   - */
276   - public byte getInOrOutStop() {
277   - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000
278   - || (serviceState & 0x01000000) == 0x01000000
279   - || (serviceState & 0x08000000) == 0x08000000) return -1;
280   - return (byte)(((serviceState & 0x04000000) == 0x04000000) ? 1 : 0);
281   - }
282   -
283   - public void setInOrOutStop(boolean isInOrOutStop) {
284   - inOutStopFlag = true;
285   - if (isInOrOutStop) serviceState |= 0x04000000;
286   - else serviceState &= 0xfbffffff;
287   - }
288   -
289   - /**
290   - * 获取运营状态
291   - * @return -1无效 0运营 1未运营
292   - */
293   - public byte getService() {
294   - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000) return -1;
295   - return (byte)(((serviceState & 0x02000000) == 0x02000000) ? 1 : 0);
296   - }
297   -
298   - public void setService(boolean service) {
299   - if (!service) serviceState |= 0x02000000;
300   - else serviceState &= 0xfdffffff;
301   - }
302   -
303   - /**
304   - * 获得车辆状态
305   - * @return 0点火 1熄火
306   - */
307   - public byte getVehicleState() {
308   - return (byte)(((serviceState & 0x00200000) == 0x00200000) ? 1 : 0);
309   - }
310   -
311   - public void setInOutStopFlag(boolean inOutStopFlag) {
312   - this.inOutStopFlag = inOutStopFlag;
313   - }
314   -
315   - public boolean getInOutStopFlag() {
316   - return inOutStopFlag;
317   - }
318   -
319   - public String toString() {
320   - Date d = new Date();d.setTime(timestamp);
321   - StringBuilder sb = new StringBuilder();
322   - sb.append("城市代码:").append(cityCode)
323   - .append("行业代码:").append(industryCode)
324   - .append("公司代码:").append(companyCode)
325   - .append("设备号:").append(deviceId)
326   - .append("线路编号:").append(lineId)
327   - .append("驾驶员工号:").append(driverEmpNo)
328   - .append("停车场序列号:").append(carparkSerialNo)
329   - .append("停车场编号:").append(carparkNo)
330   - .append("站点序列号").append(stopSerialNo)
331   - .append("站点编号:").append(stopNo)
332   - .append("经度:").append(carLon)
333   - .append("维度:").append(carLat)
334   - .append("时间戳:").append(d)
335   - .append("速度(传感器):").append(speedSensor)
336   - .append("速度(gps)").append(speedGps)
337   - .append("方向:").append(direction)
338   - .append("车内温度:").append(inTemp)
339   - .append("营运状态:").append(serviceState)
340   - .append("调控状态:").append(controlState)
341   - .append("总里程:").append(totalMiles)
342   - .append("水温:").append(waterTemp)
343   - .append("油耗:").append(oilConsumption)
344   - .append("发动机速度:").append(engineSpeed);
345   -
346   - return sb.toString();
347   - }
348   - /* ----------------------------------------------------- */
349   -
350   - public void setCityCode(int cityCode) {
351   - this.cityCode = cityCode;
352   - }
353   -
354   - public void setIndustryCode(short industryCode) {
355   - this.industryCode = industryCode;
356   - }
357   -
358   - public void setCompanyCode(short companyCode) {
359   - this.companyCode = companyCode;
360   - }
361   -
362   - public void setDeviceId(String deviceId) {
363   - this.deviceId = deviceId;
364   - }
365   -
366   - public void setLineId(int lineId) {
367   - this.lineId = lineId;
368   - }
369   -
370   - public void setDriverEmpNo(int driverEmpNo) {
371   - this.driverEmpNo = driverEmpNo;
372   - }
373   -
374   - public void setCarparkSerialNo(short carparkSerialNo) {
375   - this.carparkSerialNo = carparkSerialNo;
376   - }
377   -
378   - public void setCarparkNo(String carparkNo) {
379   - this.carparkNo = carparkNo;
380   - }
381   -
382   - public void setStopSerialNo(short stopSerialNo) {
383   - this.stopSerialNo = stopSerialNo;
384   - }
385   -
386   - public void setCarLon(long carLon) {
387   - this.carLon = carLon;
388   - }
389   -
390   - public void setCarLat(int carLat) {
391   - this.carLat = carLat;
392   - }
393   -
394   - public void setTimestamp(long timestamp) {
395   - this.timestamp = timestamp;
396   - }
397   -
398   - public void setSpeedSensor(short speedSensor) {
399   - this.speedSensor = speedSensor;
400   - }
401   -
402   - public void setSpeedGps(short speedGps) {
403   - this.speedGps = speedGps;
404   - }
405   -
406   - public void setDirection(short direction) {
407   - this.direction = direction;
408   - }
409   -
410   - public void setInTemp(short inTemp) {
411   - this.inTemp = inTemp;
412   - }
413   -
414   - public void setServiceState(long serviceState) {
415   - this.serviceState = serviceState;
416   - }
417   -
418   - public void setControlState(long controlState) {
419   - this.controlState = controlState;
420   - }
421   -
422   - public void setTotalMiles(int totalMiles) {
423   - this.totalMiles = totalMiles;
424   - }
425   -
426   - public void setWaterTemp(byte waterTemp) {
427   - this.waterTemp = waterTemp;
428   - }
429   -
430   - public void setOilConsumption(int oilConsumption) {
431   - this.oilConsumption = oilConsumption;
432   - }
433   -
434   - public void setEngineSpeed(int engineSpeed) {
435   - this.engineSpeed = engineSpeed;
436   - }
437   -}
src/main/java/com/bsth/data/gpsdata/client/pd/protocol/PdFactory.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.protocol;
2   -
3   -
4   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
5   -
6   -public class PdFactory {
7   -
8   - public static IMessageBody create(int commandType, byte[] data) {
9   - String pkgName = PdFactory.class.getPackage().getName();
10   - IMessageBody body = null;
11   - try {
12   - Class<?> cls = Class.forName(pkgName + ".Pd_" + Integer.toHexString(commandType).toUpperCase() + "_0");
13   - body = (IMessageBody)cls.newInstance();
14   - body.read(data);
15   - } catch (ClassNotFoundException e) {
16   - // TODO Auto-generated catch block
17   - //e.printStackTrace();
18   - } catch (InstantiationException e) {
19   - // TODO Auto-generated catch block
20   - e.printStackTrace();
21   - } catch (IllegalAccessException e) {
22   - // TODO Auto-generated catch block
23   - e.printStackTrace();
24   - }
25   - return body;
26   - }
27   -}
src/main/java/com/bsth/data/gpsdata/client/pd/protocol/PdMessage.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.protocol;
2   -
3   -
4   -import com.bsth.data.gpsdata.client.msg.IMessage;
5   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
6   -
7   -import java.nio.ByteBuffer;
8   -import java.util.Arrays;
9   -
10   -public class PdMessage implements IMessage {
11   -
12   - private short version;
13   - private short serialNo;
14   - private short commandType;
15   - private IMessageBody messageBody;
16   - private byte checkSum;
17   -
18   - public short getVersion() {
19   - return version;
20   - }
21   -
22   - public void setVersion(short version) {
23   - this.version = version;
24   - }
25   -
26   - public short getSerialNo() {
27   - return serialNo;
28   - }
29   -
30   - public void setSerialNo(short serialNo) {
31   - this.serialNo = serialNo;
32   - }
33   -
34   - public short getCommandType() {
35   - return commandType;
36   - }
37   -
38   - public void setCommandType(short commandType) {
39   - this.commandType = commandType;
40   - }
41   -
42   - public IMessageBody getMessageBody() {
43   - return messageBody;
44   - }
45   -
46   - public void setMessageBody(IMessageBody messageBody) {
47   - this.messageBody = messageBody;
48   - }
49   -
50   - public byte getCheckSum() {
51   - return checkSum;
52   - }
53   -
54   - public void setCheckSum(byte checkSum) {
55   - this.checkSum = checkSum;
56   - }
57   -
58   - public void read(byte[] data) {
59   - int idx = 0, len = data.length;
60   - version = (short)(data[idx] & 0xff); idx++;
61   - serialNo = (short)(data[idx] & 0xff); idx++;
62   - commandType = (short)(data[idx] & 0xff); idx++;
63   - byte[] temp = Arrays.copyOfRange(data, idx, len - 1);
64   - checkSum = data[len - 1];
65   - byte sum = 0;
66   - for (int i = 0;i < len - 1;i++) {
67   - sum += data[i];
68   - }
69   - if (sum == checkSum) {
70   - messageBody = PdFactory.create(commandType, temp);
71   - }
72   - }
73   -
74   - public byte[] write() {
75   - byte[] bytes = messageBody.write();
76   - ByteBuffer buf = ByteBuffer.allocate(bytes.length + 8);
77   - buf.put(new byte[] { (byte)0xfa, (byte)0xf5 });
78   - buf.putShort((short)(bytes.length + 3));
79   - buf.put((byte)version);
80   - buf.put((byte)serialNo);
81   - buf.put((byte)commandType);
82   - buf.put(bytes);
83   - checkSum = 0;
84   - checkSum += (byte)version;
85   - checkSum += (byte)serialNo;
86   - checkSum += (byte)commandType;
87   - for (byte b : bytes) {
88   - checkSum += b;
89   - }
90   - buf.put(checkSum);
91   - return buf.array();
92   - }
93   -
94   - public String toString() {
95   - StringBuilder sb = new StringBuilder();
96   - sb.append("报文版本号:").append(version)
97   - .append("报文序列号:").append(serialNo)
98   - .append("报文命令字:0x").append(Integer.toHexString(commandType))
99   - .append("报文主体:(").append(messageBody).append(")")
100   - .append("报文校验和:").append(checkSum);
101   -
102   - return sb.toString();
103   - }
104   -}
src/main/java/com/bsth/data/gpsdata/client/pd/protocol/Pd_31_0.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.protocol;
2   -
3   -
4   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
5   -import com.bsth.data.gpsdata.client.pd.common.ConvertUtil;
6   -
7   -import java.nio.ByteBuffer;
8   -import java.util.Date;
9   -
10   -
11   -public class Pd_31_0 implements IMessageBody {
12   -
13   - // bcd 1
14   - private short funCode;
15   - // bcd 3
16   - private int lineId;
17   - // ascii 8
18   - private String deviceId;
19   - // bcd 6 yyMMddhhmmss
20   - private long timestamp;
21   - // hex 8
22   - private String reserved;
23   -
24   - @Override
25   - public void read(byte[] bytes) {
26   - // TODO Auto-generated method stub
27   - int idx = 0;
28   - funCode = (short)(bytes[idx] & 0xff);idx++;
29   - lineId = ConvertUtil.bcd2int(bytes, idx, 3);idx += 3;
30   - deviceId = ConvertUtil.ascii2string(bytes, idx, 8);idx += 8;
31   - timestamp = ConvertUtil.bcd2timestamp(bytes, idx);idx += 6;
32   - reserved = ConvertUtil.ascii2string(bytes, idx, 8);idx += 8;
33   - }
34   -
35   - @Override
36   - public byte[] write() {
37   - // TODO Auto-generated method stub
38   - ByteBuffer buf = ByteBuffer.allocate(26);
39   - buf.put((byte)funCode);
40   - buf.put(ConvertUtil.int2bcd(lineId, 3));
41   - buf.put(deviceId.getBytes());
42   - buf.put(ConvertUtil.timestamp2bcd(timestamp));
43   - buf.put(new byte[]{0,0,0,0,0,0,0,0});
44   - return buf.array();
45   - }
46   -
47   - public short getFunCode() {
48   - return funCode;
49   - }
50   -
51   - public int getLineId() {
52   - return lineId;
53   - }
54   -
55   - public String getDeviceId() {
56   - return deviceId;
57   - }
58   -
59   - public long getTimestamp() {
60   - return timestamp;
61   - }
62   -
63   - public String getReserved() {
64   - return reserved;
65   - }
66   -
67   - public void setFunCode(short funCode) {
68   - this.funCode = funCode;
69   - }
70   -
71   - public void setLineId(int lineId) {
72   - this.lineId = lineId;
73   - }
74   -
75   - public void setDeviceId(String deviceId) {
76   - this.deviceId = deviceId;
77   - }
78   -
79   - public void setTimeStamp(long timestamp) {
80   - this.timestamp = timestamp;
81   - }
82   -
83   - public void setReserved(String reserved) {
84   - this.reserved = reserved;
85   - }
86   -
87   - public String toString() {
88   - Date d = new Date();
89   - d.setTime(timestamp);
90   - StringBuilder sb = new StringBuilder();
91   - sb.append("功能号:").append(Integer.toHexString(funCode))
92   - .append("线路编号:").append(lineId)
93   - .append("设备编号:").append(deviceId)
94   - .append("时间戳:").append(d);
95   - return sb.toString();
96   - }
97   -}
src/main/java/com/bsth/data/gpsdata/client/pd/protocol/Pd_41_0.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.protocol;
2   -
3   -
4   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
5   -import com.bsth.data.gpsdata.client.pd.common.ConvertUtil;
6   -
7   -import java.nio.ByteBuffer;
8   -
9   -
10   -public class Pd_41_0 implements IMessageBody {
11   -
12   - private BasicInfo info;
13   - private short leaveStopDis;
14   -
15   - public BasicInfo getInfo() {
16   - return info;
17   - }
18   -
19   - public void setInfo(BasicInfo info) {
20   - this.info = info;
21   - }
22   -
23   - public short getLeaveStopDis() {
24   - return leaveStopDis;
25   - }
26   -
27   - public void setLeaveStopDis(short leaveStopDis) {
28   - this.leaveStopDis = leaveStopDis;
29   - }
30   -
31   - @Override
32   - public void read(byte[] bytes) {
33   - // TODO Auto-generated method stub
34   - int idx = 0;
35   - info = new BasicInfo();
36   - info.read(bytes, idx); idx += 80;
37   - leaveStopDis = (short) ConvertUtil.bcd2int(bytes, idx, 2); idx += 2;
38   - }
39   -
40   - @Override
41   - public byte[] write() {
42   - // TODO Auto-generated method stub
43   - ByteBuffer buf = ByteBuffer.allocate(82);
44   - buf.put(info.write());
45   - buf.put(ConvertUtil.int2bcd(leaveStopDis, 2));
46   -
47   - return buf.array();
48   - }
49   -
50   - @Override
51   - public String getDeviceId() {
52   - // TODO Auto-generated method stub
53   - return info.getDeviceId();
54   - }
55   -
56   - public String toString() {
57   - StringBuilder sb = new StringBuilder();
58   - sb.append("基本数据:").append(info.toString())
59   - .append("离站距离:").append(leaveStopDis);
60   -
61   - return sb.toString();
62   - }
63   -
64   - @Override
65   - public long getTimestamp() {
66   - // TODO Auto-generated method stub
67   - return info.getTimestamp();
68   - }
69   -}
src/main/java/com/bsth/data/gpsdata/client/pd/protocol/Pd_42_0.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pd.protocol;
2   -
3   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
4   -import com.bsth.data.gpsdata.client.pd.common.ConvertUtil;
5   -
6   -import java.nio.ByteBuffer;
7   -
8   -public class Pd_42_0 implements IMessageBody {
9   -
10   - private BasicInfo info;
11   - // 站间里程 保留两位小数 km
12   - private short stopBetMiles;
13   - private short frontDoorUp;
14   - private short frontDoorDown;
15   - private short backDoorUp;
16   - private short backDoorDown;
17   - // 本站留车人数
18   - private int stay;
19   - // 本站刷卡次数
20   - private short cardCount;
21   - // 本站刷卡金额
22   - private int cardMoney;
23   - // 免费刷卡次数
24   - private short freeCardCount;
25   - // 免费刷卡金额
26   - private int freeCardMoney;
27   - // 总刷卡次数
28   - private int totalCardCount;
29   - // 总数卡金额
30   - private long totalCardMoney;
31   - // 总免费刷卡次数
32   - private int totalFreeCardCount;
33   - // 总免费刷卡金额
34   - private long totalFreeCardMoney;
35   - // 客流站号
36   - private short passengerStopNo;
37   -
38   - @Override
39   - public void read(byte[] bytes) {
40   - // TODO Auto-generated method stub
41   - ByteBuffer buf = ByteBuffer.wrap(bytes);
42   - int idx = 0;
43   - info = new BasicInfo();
44   - info.read(bytes, idx); idx += 80;
45   - stopBetMiles = (short) ConvertUtil.bcd2int(bytes, idx, 2); idx += 2;
46   - frontDoorUp = (short)(buf.get(idx) & 0xff); idx++;
47   - frontDoorDown = (short)(buf.get(idx) & 0xff); idx++;
48   - backDoorUp = (short)(buf.get(idx) & 0xff); idx++;
49   - backDoorDown = (short)(buf.get(idx) & 0xff); idx++;
50   - stay = buf.getShort(idx) & 0xffff; idx += 2;
51   - cardCount = (short)(buf.get(idx) & 0xff); idx++;
52   - cardMoney = buf.getShort(idx) & 0xffff; idx += 2;
53   - freeCardCount = (short)(buf.get(idx) & 0xff); idx++;
54   - freeCardMoney = buf.getShort(idx) & 0xffff; idx += 2;
55   - totalCardCount = buf.getShort(idx) & 0xffff; idx += 2;
56   - totalCardMoney = buf.getInt(idx) & 0xffffffffl; idx += 4;
57   - totalFreeCardCount = buf.getShort(idx) & 0xffff; idx += 2;
58   - totalFreeCardMoney = buf.getInt(idx) & 0xffffffffl; idx += 4;
59   - passengerStopNo = (short)(buf.get(idx) & 0xff); idx++;
60   - }
61   -
62   - @Override
63   - public byte[] write() {
64   - // TODO Auto-generated method stub
65   - ByteBuffer buf = ByteBuffer.allocate(107);
66   - buf.put(info.write());
67   - buf.put(ConvertUtil.int2bcd(stopBetMiles, 2));
68   - buf.put((byte)frontDoorUp);
69   - buf.put((byte)frontDoorDown);
70   - buf.put((byte)backDoorUp);
71   - buf.put((byte)backDoorDown);
72   - buf.putShort((short)stay);
73   - buf.put((byte)cardCount);
74   - buf.putShort((short)cardMoney);
75   - buf.put((byte)freeCardCount);
76   - buf.putShort((short)freeCardMoney);
77   - buf.putShort((short)totalCardCount);
78   - buf.putInt((int)totalCardMoney);
79   - buf.putShort((short)totalFreeCardCount);
80   - buf.putInt((int)totalFreeCardMoney);
81   - buf.put((byte)passengerStopNo);
82   -
83   - return buf.array();
84   - }
85   -
86   - @Override
87   - public String getDeviceId() {
88   - // TODO Auto-generated method stub
89   - return info.getDeviceId();
90   - }
91   -
92   - public BasicInfo getInfo() {
93   - return info;
94   - }
95   -
96   - public short getStopBetMiles() {
97   - return stopBetMiles;
98   - }
99   -
100   - public short getFrontDoorUp() {
101   - return frontDoorUp;
102   - }
103   -
104   - public short getFrontDoorDown() {
105   - return frontDoorDown;
106   - }
107   -
108   - public short getBackDoorUp() {
109   - return backDoorUp;
110   - }
111   -
112   - public short getBackDoorDown() {
113   - return backDoorDown;
114   - }
115   -
116   - public int getStay() {
117   - return stay;
118   - }
119   -
120   - public short getCardCount() {
121   - return cardCount;
122   - }
123   -
124   - public int getCardMoney() {
125   - return cardMoney;
126   - }
127   -
128   - public short getFreeCardCount() {
129   - return freeCardCount;
130   - }
131   -
132   - public int getFreeCardMoney() {
133   - return freeCardMoney;
134   - }
135   -
136   - public int getTotalCardCount() {
137   - return totalCardCount;
138   - }
139   -
140   - public long getTotalCardMoney() {
141   - return totalCardMoney;
142   - }
143   -
144   - public int getTotalFreeCardCount() {
145   - return totalFreeCardCount;
146   - }
147   -
148   - public long getTotalFreeCardMoney() {
149   - return totalFreeCardMoney;
150   - }
151   -
152   - public short getPassengerStopNo() {
153   - return passengerStopNo;
154   - }
155   -
156   - public String toString() {
157   - StringBuilder sb = new StringBuilder();
158   - sb.append("基本数据:").append(info.toString())
159   - .append("站间距离:").append(stopBetMiles)
160   - .append("前门上客:").append(frontDoorUp)
161   - .append("前门下客:").append(frontDoorDown)
162   - .append("后门上客:").append(backDoorUp)
163   - .append("后门下客:").append(backDoorDown)
164   - .append("本站留车人数:").append(stay)
165   - .append("本站刷卡次数:").append(cardCount)
166   - .append("本站刷卡金额:").append(cardMoney)
167   - .append("免费刷卡次数:").append(freeCardCount)
168   - .append("免费刷卡金额:").append(freeCardMoney)
169   - .append("总刷卡次数:").append(totalCardCount)
170   - .append("总数卡金额:").append(totalCardMoney)
171   - .append("总免费刷卡次数:").append(totalFreeCardCount)
172   - .append("总免费刷卡金额:").append(totalFreeCardMoney)
173   - .append("客流站号:").append(passengerStopNo);
174   -
175   - return sb.toString();
176   - }
177   -
178   - @Override
179   - public long getTimestamp() {
180   - // TODO Auto-generated method stub
181   - return info.getTimestamp();
182   - }
183   -}
src/main/java/com/bsth/data/gpsdata/client/pf/codec/MessageDecoder.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.codec;
2   -
3   -import com.bsth.data.gpsdata.client.pf.protocol.PfMessage;
4   -import org.apache.mina.core.buffer.IoBuffer;
5   -import org.apache.mina.core.session.IoSession;
6   -import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
7   -import org.apache.mina.filter.codec.ProtocolDecoderOutput;
8   -
9   -
10   -public class MessageDecoder extends CumulativeProtocolDecoder {
11   -
12   - @Override
13   - protected boolean doDecode(IoSession session, IoBuffer in,
14   - ProtocolDecoderOutput out) throws Exception {
15   - // TODO Auto-generated method stub
16   - while (in.remaining() > 3) {
17   - in.mark();
18   - byte head1 = in.get(), head2 = in.get(), lenh = in.get(), lenl = in.get();
19   - int len = ((lenh & 0xff) << 8) + (lenl & 0xff);
20   - if ((head1 & 0xff) == 0xfa && (head2 & 0xff) == 0xf5) {
21   - if (in.remaining() > len) {
22   - byte[] bytes = new byte[len + 1];
23   - in.get(bytes);
24   - PfMessage msg = new PfMessage();
25   - msg.read(bytes);
26   - out.write(msg);
27   - } else {
28   - in.reset();
29   - return false;
30   - }
31   - }
32   - }
33   - return false;
34   - }
35   -
36   - /*private static String toHexString(byte[] bytes) {
37   - StringBuilder sb = new StringBuilder();
38   - for (byte b : bytes) {
39   - sb.append(Integer.toHexString(b & 0xff) + "|");
40   - }
41   - return sb.toString();
42   - }*/
43   -}
src/main/java/com/bsth/data/gpsdata/client/pf/codec/MessageEncoder.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.codec;
2   -
3   -import org.apache.mina.core.buffer.IoBuffer;
4   -import org.apache.mina.core.session.IoSession;
5   -import org.apache.mina.filter.codec.ProtocolEncoderAdapter;
6   -import org.apache.mina.filter.codec.ProtocolEncoderOutput;
7   -
8   -public class MessageEncoder extends ProtocolEncoderAdapter {
9   -
10   - @Override
11   - public void encode(IoSession session, Object message,
12   - ProtocolEncoderOutput out) throws Exception {
13   - // TODO Auto-generated method stub
14   - IoBuffer buf = IoBuffer.allocate(1024).setAutoExpand(true);
15   - buf.put((byte[])message);
16   - buf.flip();
17   - out.write(buf);
18   - }
19   -
20   -}
src/main/java/com/bsth/data/gpsdata/client/pf/codec/PfMessageCodecFactory.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.codec;
2   -
3   -import org.apache.mina.core.session.IoSession;
4   -import org.apache.mina.filter.codec.ProtocolCodecFactory;
5   -import org.apache.mina.filter.codec.ProtocolDecoder;
6   -import org.apache.mina.filter.codec.ProtocolEncoder;
7   -
8   -public class PfMessageCodecFactory implements ProtocolCodecFactory {
9   -
10   - private ProtocolEncoder encoder;
11   - private ProtocolDecoder decoder;
12   -
13   - public PfMessageCodecFactory() {
14   - encoder = new MessageEncoder();
15   - decoder = new MessageDecoder();
16   - }
17   -
18   - @Override
19   - public ProtocolEncoder getEncoder(IoSession session) throws Exception {
20   - // TODO Auto-generated method stub
21   - return encoder;
22   - }
23   -
24   - @Override
25   - public ProtocolDecoder getDecoder(IoSession session) throws Exception {
26   - // TODO Auto-generated method stub
27   - return decoder;
28   - }
29   -
30   -}
src/main/java/com/bsth/data/gpsdata/client/pf/common/ConvertUtil.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.common;
2   -
3   -import com.bsth.data.gpsdata.client.common.ThreadLocalDateUtil;
4   -import org.slf4j.Logger;
5   -import org.slf4j.LoggerFactory;
6   -
7   -import java.text.ParseException;
8   -import java.util.Arrays;
9   -import java.util.Calendar;
10   -import java.util.Date;
11   -
12   -
13   -public class ConvertUtil {
14   -
15   - private final static Logger log = LoggerFactory.getLogger(ConvertUtil.class);
16   -
17   - public static int bcd2int(byte[] bytes, int start, int len) {
18   - if (len > 4 || len == 0)
19   - throw new IllegalArgumentException("bcd2int 字节数不符合要求");
20   - String temp = "";
21   - for (int i = 0;i < len;i++) {
22   - int val = bytes[start + i] & 0xff;
23   - if (val < 10) temp += 0;
24   - temp += Integer.toHexString(val);
25   - }
26   - return Integer.parseInt(temp);
27   - }
28   -
29   - public static byte[] int2bcd(int val, int len) {
30   - if (len > 4 || len == 0)
31   - throw new IllegalArgumentException("int2bcd 字节数不符合要求");
32   - byte[] result = new byte[len];
33   - for (int i = len - 1;i > -1;i--) {
34   - result[i] = (byte)Integer.parseInt(val%100 + "", 16);
35   - val = val/100;
36   - }
37   - return result;
38   - }
39   -
40   - public static long bcd2long(byte[] bytes, int start, int len) {
41   - if (len > 8 || len == 0)
42   - throw new IllegalArgumentException("bcd2long 字节数不符合要求");
43   - String temp = "";
44   - for (int i = 0;i < len;i++) {
45   - int val = bytes[start + i] & 0xff;
46   - if (val < 10) temp += 0;
47   - temp += Integer.toHexString(val);
48   - }
49   - return Long.parseLong(temp);
50   - }
51   -
52   - public static byte[] long2bcd(long val, int len) {
53   - if (len > 8 || len == 0)
54   - throw new IllegalArgumentException("long2bcd 字节数不符合要求");
55   - byte[] result = new byte[len];
56   - for (int i = len - 1;i > -1;i--) {
57   - result[i] = (byte)Integer.parseInt(val%100 + "", 16);
58   - val = val/100;
59   - }
60   - return result;
61   - }
62   -
63   - public static String ascii2string(byte[] bytes, int start, int len) {
64   - return new String(Arrays.copyOfRange(bytes, start, start + len));
65   - }
66   -
67   - public static byte[] string2ascii(String val, int len) {
68   - byte[] result = new byte[len];
69   - byte[] bytes = val.getBytes();
70   - if (bytes.length > len && len != 0)
71   - throw new IllegalArgumentException("string2ascii 参数不符合要求");
72   - if (len != 0)
73   - for (int i = 0, l = bytes.length;i < l;i++) result[i] = bytes[i];
74   - else return bytes;
75   - return result;
76   - }
77   -
78   - public static long bcd2timestamp(byte[] bytes, int start) {
79   - String temp = "20";
80   - for (int i = 0;i < 6;i++) {
81   - int val = bytes[start + i] & 0xff;
82   - if (val < 10) temp += 0;
83   - temp += Integer.toHexString(val);
84   - }
85   - Date date = null;
86   - try {
87   - date = ThreadLocalDateUtil.parse(temp);
88   - } catch (ParseException e) {
89   - log.error("协议中时间数据异常:" + temp);
90   - }
91   - if (date != null) return date.getTime();
92   - return -1;
93   - }
94   -
95   - public static byte[] timestamp2bcd(long val) {
96   - byte[] result = new byte[6];
97   - Calendar c = Calendar.getInstance();
98   - c.setTime(new Date(val));
99   - result[0] = (byte)(Integer.parseInt(c.get(Calendar.YEAR)%100 + "", 16));
100   - result[1] = (byte)(Integer.parseInt(c.get(Calendar.MONTH) + 1 + "", 16));
101   - result[2] = (byte)Integer.parseInt(c.get(Calendar.DAY_OF_MONTH) + "", 16);
102   - result[3] = (byte)Integer.parseInt(c.get(Calendar.HOUR_OF_DAY) + "", 16);
103   - result[4] = (byte)Integer.parseInt(c.get(Calendar.MINUTE) + "", 16);
104   - result[5] = (byte)Integer.parseInt(c.get(Calendar.SECOND) + "", 16);
105   - return result;
106   - }
107   -
108   - public static byte[] int2hex(int val, int len) {
109   - if (len < 1)
110   - throw new IllegalArgumentException("int2hex len 参数不符合要求");
111   - byte[] result = new byte[len];
112   - for (int i = 0;i < len;i++) {
113   - result[len - 1 - i] = (byte)(val%100);
114   - val = val/100;
115   - }
116   -
117   - return result;
118   - }
119   -}
src/main/java/com/bsth/data/gpsdata/client/pf/handler/PfClientHandler.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.handler;
2   -
3   -import com.bsth.data.gpsdata.client.ClientApp;
4   -import com.bsth.data.gpsdata.client.GpsBeforeBuffer;
5   -import com.bsth.data.gpsdata.client.common.Protocol2BizUtil;
6   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
7   -import com.bsth.data.gpsdata.client.pd.protocol.BasicInfo;
8   -import com.bsth.data.gpsdata.client.pf.protocol.PfMessage;
9   -import org.apache.mina.core.service.IoHandlerAdapter;
10   -import org.apache.mina.core.session.IdleStatus;
11   -import org.apache.mina.core.session.IoSession;
12   -import org.slf4j.Logger;
13   -import org.slf4j.LoggerFactory;
14   -import org.springframework.beans.factory.annotation.Autowired;
15   -import org.springframework.stereotype.Service;
16   -
17   -import java.io.IOException;
18   -
19   -@Service
20   -public class PfClientHandler extends IoHandlerAdapter{
21   -
22   - private final static Logger log = LoggerFactory.getLogger(PfClientHandler.class);
23   -
24   - //@Autowired
25   - //private MessageProcessor processor;
26   -
27   - @Autowired
28   - GpsBeforeBuffer gpsBeforeBuffer;
29   -
30   - @Override
31   - public void sessionCreated(IoSession session) throws Exception {
32   -
33   - }
34   -
35   - @Override
36   - public void sessionOpened(IoSession session) throws Exception {
37   -
38   - }
39   -
40   - @Override
41   - public void sessionClosed(IoSession session) throws Exception {
42   - String deviceId = (String)session.getAttribute("deviceId");
43   - if (deviceId != null) {
44   - //SessionManager.getInstance().unregister(deviceId);
45   - log.info("连老网关设备编号:" + deviceId + "断开连接");
46   - log.warn(deviceId + "老网关设备注销");
47   - ClientApp.fconnect(deviceId);
48   - }
49   - }
50   -
51   - @Override
52   - public void sessionIdle(IoSession session, IdleStatus status) throws Exception {
53   - session.closeNow();
54   - }
55   -
56   - @Override
57   - public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
58   - if (cause instanceof IOException) session.closeNow();
59   - log.error("PfClientHandler exceptionCaught", cause);
60   - }
61   -
62   - @Override
63   - public void messageReceived(IoSession session, Object message) throws Exception {
64   - PfMessage msg = (PfMessage)message;
65   - IMessageBody body = msg.getMessageBody();
66   - if (body != null) {
67   - String deviceId = body.getDeviceId();
68   - if (0x1 == msg.getCommandType()) {
69   - log.debug("设备编号:" + body.getDeviceId() + "建立连接");
70   - }
71   -
72   - BasicInfo info = Protocol2BizUtil.getBasicInfoFromMsg(msg);
73   - gpsBeforeBuffer.put(info);
74   - }
75   -
76   - }
77   -
78   - @Override
79   - public void messageSent(IoSession session, Object message) throws Exception {
80   -
81   - }
82   -}
src/main/java/com/bsth/data/gpsdata/client/pf/protocol/PfFactory.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.protocol;
2   -
3   -
4   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
5   -
6   -public class PfFactory {
7   -
8   - public static IMessageBody create(int commandType, byte[] data) {
9   - String pkgName = PfFactory.class.getPackage().getName();
10   - IMessageBody body = null;
11   - try {
12   - Class<?> cls = Class.forName(pkgName + ".Pf_" + Integer.toHexString(commandType).toUpperCase() + "_0");
13   - body = (IMessageBody)cls.newInstance();
14   - body.read(data);
15   - } catch (ClassNotFoundException e) {
16   - // TODO Auto-generated catch block
17   - //e.printStackTrace();
18   - } catch (InstantiationException e) {
19   - // TODO Auto-generated catch block
20   - e.printStackTrace();
21   - } catch (IllegalAccessException e) {
22   - // TODO Auto-generated catch block
23   - e.printStackTrace();
24   - }
25   - return body;
26   - }
27   -}
src/main/java/com/bsth/data/gpsdata/client/pf/protocol/PfMessage.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.protocol;
2   -
3   -import com.bsth.data.gpsdata.client.msg.IMessage;
4   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
5   -
6   -import java.util.Arrays;
7   -
8   -public class PfMessage implements IMessage {
9   -
10   - private short version;
11   - private short serialNo;
12   - private short commandType;
13   - private IMessageBody messageBody;
14   - private byte checkSum;
15   -
16   - public short getVersion() {
17   - return version;
18   - }
19   -
20   - public void setVersion(short version) {
21   - this.version = version;
22   - }
23   -
24   - public short getSerialNo() {
25   - return serialNo;
26   - }
27   -
28   - public void setSerialNo(short serialNo) {
29   - this.serialNo = serialNo;
30   - }
31   -
32   - public short getCommandType() {
33   - return commandType;
34   - }
35   -
36   - public void setCommandType(short commandType) {
37   - this.commandType = commandType;
38   - }
39   -
40   - public IMessageBody getMessageBody() {
41   - return messageBody;
42   - }
43   -
44   - public void setMessageBody(IMessageBody messageBody) {
45   - this.messageBody = messageBody;
46   - }
47   -
48   - public byte getCheckSum() {
49   - return checkSum;
50   - }
51   -
52   - public void setCheckSum(byte checkSum) {
53   - this.checkSum = checkSum;
54   - }
55   -
56   - public void read(byte[] data) {
57   - int idx = 0, len = data.length;
58   - //version = (short)(data[idx] & 0xff); idx++;
59   - //serialNo = (short)(data[idx] & 0xff); idx++;
60   - commandType = (short)(data[idx] & 0xff); idx++;
61   - byte[] temp = Arrays.copyOfRange(data, idx, len - 1);
62   - checkSum = data[len - 1];
63   - if (0xff == (checkSum & 0xff)) {
64   - try {
65   - messageBody = PfFactory.create(commandType, temp);
66   - } catch (Exception e) {
67   -
68   - }
69   - }
70   - }
71   -
72   - public byte[] write() {
73   - return null;
74   - }
75   -
76   - public String toString() {
77   - StringBuilder sb = new StringBuilder();
78   - //sb.append("报文版本号:").append(version)
79   - //.append("报文序列号:").append(serialNo)
80   - sb.append("报文命令字:0x").append(Integer.toHexString(commandType))
81   - .append("报文主体:(").append(messageBody).append(")")
82   - .append("报文校验和:").append(checkSum);
83   -
84   - return sb.toString();
85   - }
86   -}
src/main/java/com/bsth/data/gpsdata/client/pf/protocol/Pf_1_0.java deleted 100644 → 0
1   -package com.bsth.data.gpsdata.client.pf.protocol;
2   -
3   -import com.bsth.data.gpsdata.client.msg.IMessageBody;
4   -import com.bsth.data.gpsdata.client.pd.common.ConvertUtil;
5   -
6   -import java.nio.ByteBuffer;
7   -import java.util.Date;
8   -
9   -
10   -public class Pf_1_0 implements IMessageBody {
11   -
12   - /** 1、车载终端识别码-byte[8] */
13   - private String mtd;
14   - /** 2、司机工号-byte[8] */
15   - private String driver;
16   - /** 3、包车状态-byte[1] */
17   - private int bczt;
18   - /** 4、线路状态-byte[1] */
19   - private int xlzt;
20   - /** 5、线路代码-byte[6] */
21   - private int xldm;
22   - /** 6、营运状态-byte[1] */
23   - private int yyzt;
24   - /** 7、进出站状态-byte[1] */
25   - private int jczzt;
26   - /** 8、站点编号-byte[8] */
27   - private String zdbh;
28   - /** 9、进出停车场状态(0:厂内,1:厂外,2:未知)-byte[1] */
29   - private int jctcczt;
30   - /** 10、停车场编号-byte[8] */
31   - private String tccbh;
32   - /** 11、路段编码-byte[12] */
33   - private String ldbh;
34   - /** 12、上下行状态-byte[1] */
35   - private int sxxzt;
36   - /** 13、速度-byte[1] */
37   - private int speed;
38   - /** 14、初始异常状态-byte[1] */
39   - private int csyczt;
40   - /** 15、结束异常状态-byte[1] */
41   - private int jsyczt;
42   - /** 16、车辆位置经度(纠偏后)-byte[4] */
43   - private double lon;
44   - /** 17、车辆位置维度(纠偏后)-byte[4] */
45   - private double lat;
46   - /** 18、方向-byte[2] */
47   - private int fx;
48   - /** 19、发送时间-byte[4] */
49   - private Date fssj;
50   - /** 20、离下站距离-byte[2] */
51   - private int lxzjl;
52   - /** 21、本站留车人数-byte[2] */
53   - private int bzlcrs;
54   - /** 22、车辆位置经度(未纠偏)-byte[4] */
55   - private double lon_old;
56   - /** 23、车辆位置经度(未纠偏)-byte[4] */
57   - private double lat_old;
58   - /** 24、城建X坐标 */
59   - private double x;
60   - /** 25、城建Y坐标 */
61   - private double y;
62   -
63   - public String getMtd() {
64   - return mtd;
65   - }
66   -
67   - public void setMtd(String mtd) {
68   - this.mtd = mtd;
69   - }
70   -
71   - public String getDriver() {
72   - return driver;
73   - }
74   -
75   - public void setDriver(String driver) {
76   - this.driver = driver;
77   - }
78   -
79   - public int getBczt() {
80   - return bczt;
81   - }
82   -
83   - public void setBczt(int bczt) {
84   - this.bczt = bczt;
85   - }
86   -
87   - public int getXlzt() {
88   - return xlzt;
89   - }
90   -
91   - public void setXlzt(int xlzt) {
92   - this.xlzt = xlzt;
93   - }
94   -
95   - public int getXldm() {
96   - return xldm;
97   - }
98   -
99   - public void setXldm(int xldm) {
100   - this.xldm = xldm;
101   - }
102   -
103   - public int getYyzt() {
104   - return yyzt;
105   - }
106   -
107   - public void setYyzt(int yyzt) {
108   - this.yyzt = yyzt;
109   - }
110   -
111   - public int getJczzt() {
112   - return jczzt;
113   - }
114   -
115   - public void setJczzt(int jczzt) {
116   - this.jczzt = jczzt;
117   - }
118   -
119   - public String getZdbh() {
120   - return zdbh;
121   - }
122   -
123   - public void setZdbh(String zdbh) {
124   - this.zdbh = zdbh;
125   - }
126   -
127   - public int getJctcczt() {
128   - return jctcczt;
129   - }
130   -
131   - public void setJctcczt(int jctcczt) {
132   - this.jctcczt = jctcczt;
133   - }
134   -
135   - public String getTccbh() {
136   - return tccbh;
137   - }
138   -
139   - public void setTccbh(String tccbh) {
140   - this.tccbh = tccbh;
141   - }
142   -
143   - public String getLdbh() {
144   - return ldbh;
145   - }
146   -
147   - public void setLdbh(String ldbh) {
148   - this.ldbh = ldbh;
149   - }
150   -
151   - public int getSxxzt() {
152   - return sxxzt;
153   - }
154   -
155   - public void setSxxzt(int sxxzt) {
156   - this.sxxzt = sxxzt;
157   - }
158   -
159   - public int getSpeed() {
160   - return speed;
161   - }
162   -
163   - public void setSpeed(int speed) {
164   - this.speed = speed;
165   - }
166   -
167   - public int getCsyczt() {
168   - return csyczt;
169   - }
170   -
171   - public void setCsyczt(int csyczt) {
172   - this.csyczt = csyczt;
173   - }
174   -
175   - public int getJsyczt() {
176   - return jsyczt;
177   - }
178   -
179   - public void setJsyczt(int jsyczt) {
180   - this.jsyczt = jsyczt;
181   - }
182   -
183   - public double getLon() {
184   - return lon;
185   - }
186   -
187   - public void setLon(double lon) {
188   - this.lon = lon;
189   - }
190   -
191   - public double getLat() {
192   - return lat;
193   - }
194   -
195   - public void setLat(double lat) {
196   - this.lat = lat;
197   - }
198   -
199   - public int getFx() {
200   - return fx;
201   - }
202   -
203   - public void setFx(int fx) {
204   - this.fx = fx;
205   - }
206   -
207   - public Date getFssj() {
208   - return fssj;
209   - }
210   -
211   - public void setFssj(Date fssj) {
212   - this.fssj = fssj;
213   - }
214   -
215   - public int getLxzjl() {
216   - return lxzjl;
217   - }
218   -
219   - public void setLxzjl(int lxzjl) {
220   - this.lxzjl = lxzjl;
221   - }
222   -
223   - public int getBzlcrs() {
224   - return bzlcrs;
225   - }
226   -
227   - public void setBzlcrs(int bzlcrs) {
228   - this.bzlcrs = bzlcrs;
229   - }
230   -
231   - public double getLon_old() {
232   - return lon_old;
233   - }
234   -
235   - public void setLon_old(double lon_old) {
236   - this.lon_old = lon_old;
237   - }
238   -
239   - public double getLat_old() {
240   - return lat_old;
241   - }
242   -
243   - public void setLat_old(double lat_old) {
244   - this.lat_old = lat_old;
245   - }
246   -
247   - public double getX() {
248   - return x;
249   - }
250   -
251   - public void setX(double x) {
252   - this.x = x;
253   - }
254   -
255   - public double getY() {
256   - return y;
257   - }
258   -
259   - public void setY(double y) {
260   - this.y = y;
261   - }
262   -
263   - public byte[] write() {
264   - return null;
265   - }
266   -
267   - @Override
268   - public void read(byte[] bytes) {
269   - // TODO Auto-generated method stub
270   - int idx = 0;
271   - ByteBuffer buf = ByteBuffer.wrap(bytes);
272   - mtd = ConvertUtil.ascii2string(bytes, idx, 8); idx += 8;
273   - driver = ConvertUtil.ascii2string(bytes, idx, 8); idx += 8;
274   - bczt = buf.get(idx); idx++;
275   - xlzt = buf.get(idx); idx++;
276   - xldm = Integer.parseInt(ConvertUtil.ascii2string(bytes, idx, 6).trim()); idx += 6;
277   - yyzt = buf.get(idx); idx++;
278   - jczzt = buf.get(idx); idx++;
279   - zdbh = ConvertUtil.ascii2string(bytes, idx, 8).trim(); idx += 8;
280   - jctcczt = buf.get(idx); idx++;
281   - tccbh = ConvertUtil.ascii2string(bytes, idx, 8); idx += 8;
282   - ldbh = ConvertUtil.ascii2string(bytes, idx, 12).trim(); idx += 12;
283   - sxxzt = buf.get(idx); idx++;
284   - speed = buf.get(idx)*10; idx++;
285   - csyczt = buf.get(idx); idx++;
286   - jsyczt = buf.get(idx); idx++;
287   - byte flagx = buf.get(idx); idx++;
288   - if (flagx == 0) x = ConvertUtil.bytes2int(bytes, idx, 3)/100.0;
289   - else x = -ConvertUtil.bytes2int(bytes, idx, 3)/100.0;
290   - idx += 3;
291   - byte flagy = buf.get(idx); idx++;
292   - if (flagy == 0) y = ConvertUtil.bytes2int(bytes, idx, 3)/100.0;
293   - else y = -ConvertUtil.bytes2int(bytes, idx, 3)/100.0;
294   - idx += 3;
295   - fx = buf.getShort(idx)*(short)10; idx += 2;
296   - fssj = new Date(ConvertUtil.bytes2int(bytes, idx, 4) * 1000L); idx += 4;
297   - lxzjl = buf.getShort(idx); idx += 2;
298   - bzlcrs = buf.getShort(idx); idx += 2;
299   - lon = ConvertUtil.bytes2int(bytes, idx, 4); idx += 4;
300   - lat = ConvertUtil.bytes2int(bytes, idx, 4); idx += 4;
301   - }
302   -
303   - @Override
304   - public String getDeviceId() {
305   - // TODO Auto-generated method stub
306   - return mtd;
307   - }
308   -
309   - @Override
310   - public long getTimestamp() {
311   - // TODO Auto-generated method stub
312   - return 0;
313   - }
314   -}
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
... ... @@ -45,11 +45,11 @@ public class GpsDataRecovery implements ApplicationContextAware {
45 45 public void recovery() {
46 46 List<GpsEntity> list = loadData();
47 47  
48   - //按车辆分组数据
  48 + //按线路分组数据
49 49 ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create();
50 50 for (GpsEntity gps : list) {
51   - if (gps.getNbbm() != null)
52   - listMap.put(gps.getNbbm(), gps);
  51 + if (gps.getLineId() != null)
  52 + listMap.put(gps.getLineId(), gps);
53 53 }
54 54  
55 55  
... ... @@ -57,9 +57,9 @@ public class GpsDataRecovery implements ApplicationContextAware {
57 57  
58 58 CountDownLatch count = new CountDownLatch(keys.size());
59 59 GpsComp comp = new GpsComp();
60   - for (String nbbm : keys) {
61   - Collections.sort(listMap.get(nbbm), comp);
62   - threadPool.execute(new RecoveryThread(listMap.get(nbbm), count));
  60 + for (String lineId : keys) {
  61 + Collections.sort(listMap.get(lineId), comp);
  62 + threadPool.execute(new RecoveryThread(listMap.get(lineId), count));
63 63 /*if(nbbm.equals("W7C-001"))
64 64 new RecoveryThread(listMap.get(nbbm), count).run();*/
65 65 }
... ...
src/main/java/com/bsth/data/schedule/SchModifyLog.java 0 → 100644
  1 +package com.bsth.data.schedule;
  2 +
  3 +import com.bsth.controller.realcontrol.dto.ChangePersonCar;
  4 +import com.bsth.entity.mcy_forms.Changetochange;
  5 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  6 +import com.bsth.entity.sys.SysUser;
  7 +import com.bsth.repository.form.ChangetochangeRepository;
  8 +import com.bsth.security.util.SecurityUtils;
  9 +import org.apache.commons.lang3.StringUtils;
  10 +import org.joda.time.format.DateTimeFormat;
  11 +import org.joda.time.format.DateTimeFormatter;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.stereotype.Service;
  16 +
  17 +import java.util.Date;
  18 +
  19 +/**
  20 + * 线调实际排班修改日志记录
  21 + * Created by panzhao on 2017/5/7.
  22 + */
  23 +@Service
  24 +public class SchModifyLog {
  25 +
  26 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  27 +
  28 + Logger log = LoggerFactory.getLogger(this.getClass());
  29 +
  30 + @Autowired
  31 + ChangetochangeRepository changetochangeRepository;
  32 +
  33 + /**
  34 + * 换人换车情况表
  35 + */
  36 + public void saveChangetochange(ScheduleRealInfo sch, ChangePersonCar cpc){
  37 + try {
  38 + String newNbbm = cpc.getClZbh();
  39 + String newJsy = cpc.getJsy();
  40 + String oldJsy = sch.getjGh()+"/"+sch.getjName();
  41 +
  42 + if(newNbbm == null && newJsy == null)
  43 + return;
  44 +
  45 + if(newNbbm != null && newJsy != null
  46 + && newNbbm.equals(sch.getClZbh()) && newJsy.equals(oldJsy))
  47 + return;
  48 +
  49 + Date d = new Date();
  50 + SysUser user = SecurityUtils.getCurrentUser();
  51 + Changetochange cc = new Changetochange();
  52 + cc.setRq(sch.getScheduleDateStr());
  53 + cc.setGs(sch.getGsBm());
  54 + cc.setFgs(sch.getFgsBm());
  55 + cc.setXl(sch.getXlBm());
  56 + cc.setLp(sch.getLpName());
  57 + cc.setFssj(fmtHHmm.print(d.getTime()));
  58 + cc.setXgsj(fmtHHmm.print(d.getTime()));
  59 + if(user != null)
  60 + cc.setXgr(user.getUserName());
  61 +
  62 + cc.setPcch(sch.getClZbh());
  63 + cc.setPcry(oldJsy);
  64 + cc.setJhch(sch.getClZbh());
  65 + cc.setJhgh(sch.getjGh());
  66 +
  67 + if(StringUtils.isNotEmpty(newNbbm))
  68 + cc.setSjch(newNbbm);
  69 + if(StringUtils.isNotEmpty(newJsy))
  70 + cc.setSjgh(newJsy);
  71 +
  72 + changetochangeRepository.save(cc);
  73 + }catch (Exception e){
  74 + log.error("纪录换人换车情况表", e);
  75 + }
  76 + }
  77 +
  78 + public void saveChangetochange(ScheduleRealInfo sch, String nbbm, String jsy){
  79 + ChangePersonCar cpc = new ChangePersonCar();
  80 + cpc.setClZbh(nbbm);
  81 + cpc.setJsy(jsy);
  82 + saveChangetochange(sch, cpc);
  83 + }
  84 +}
... ...
src/main/java/com/bsth/entity/CarPark.java
... ... @@ -3,6 +3,9 @@ package com.bsth.entity;
3 3 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 4  
5 5 import javax.persistence.*;
  6 +
  7 +import org.hibernate.annotations.Formula;
  8 +
6 9 import java.util.Date;
7 10  
8 11  
... ... @@ -77,6 +80,10 @@ public class CarPark {
77 80 // 分公司
78 81 private String brancheCompany;
79 82  
  83 + /** 组合公司分公司编码 */
  84 + @Formula(" concat(company, '_', branche_company) ")
  85 + private String cgsbm;
  86 +
80 87 // 是否撤销
81 88 private Integer destroy;
82 89  
... ... @@ -99,6 +106,14 @@ public class CarPark {
99 106 // 修改日期
100 107 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
101 108 private Date updateDate;
  109 +
  110 + public String getCgsbm() {
  111 + return cgsbm;
  112 + }
  113 +
  114 + public void setCgsbm(String cgsbm) {
  115 + this.cgsbm = cgsbm;
  116 + }
102 117  
103 118 public Integer getId() {
104 119 return id;
... ...
src/main/java/com/bsth/entity/schedule/temp/SchedulePlanRuleResult.java
... ... @@ -27,6 +27,8 @@ public class SchedulePlanRuleResult {
27 27  
28 28 /** 排班规则id */
29 29 private String ruleId;
  30 + /** 启用日期 */
  31 + private Date qyrq;
30 32 /** 车辆配置id */
31 33 private String ccId;
32 34 /** 车辆自编号 */
... ... @@ -249,4 +251,12 @@ public class SchedulePlanRuleResult {
249 251 public void setCreateDate(Date createDate) {
250 252 this.createDate = createDate;
251 253 }
  254 +
  255 + public Date getQyrq() {
  256 + return qyrq;
  257 + }
  258 +
  259 + public void setQyrq(Date qyrq) {
  260 + this.qyrq = qyrq;
  261 + }
252 262 }
... ...
src/main/java/com/bsth/repository/CarParkRepository.java
... ... @@ -107,4 +107,7 @@ public interface CarParkRepository extends BaseRepository&lt;CarPark, Integer&gt;{
107 107  
108 108 @Query(value = "select st_astext(g_park_point), shapes_type, g_center_point, radius,park_code,park_name from bsth_c_car_park where park_code=?1", nativeQuery = true)
109 109 public Object[][] bufferAera(String parkCode);
  110 +
  111 + @Query(value ="SELECT p.park_name,p.park_code from bsth_c_car_park p where p.park_code = ?1", nativeQuery=true)
  112 + List<Object[]> selectTccInfoByCode(String parkCode);
110 113 }
... ...
src/main/java/com/bsth/repository/form/ChangetochangeRepository.java 0 → 100644
  1 +package com.bsth.repository.form;
  2 +
  3 +import com.bsth.entity.mcy_forms.Changetochange;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/5/7.
  9 + */
  10 +@Repository
  11 +public interface ChangetochangeRepository extends BaseRepository<Changetochange, Integer>{
  12 +}
... ...
src/main/java/com/bsth/service/CarParkService.java
... ... @@ -28,5 +28,6 @@ public interface CarParkService extends BaseService&lt;CarPark, Integer&gt; {
28 28 *
29 29 */
30 30 Map<String, Object> carParkUpdate(Map<String, Object> map);
31   -
  31 +
  32 + boolean selectTccInfoByCode(Map<String, Object> map);
32 33 }
... ...
src/main/java/com/bsth/service/impl/CarParkServiceImpl.java
... ... @@ -26,55 +26,30 @@ public class CarParkServiceImpl extends BaseServiceImpl&lt;CarPark, Integer&gt; implem
26 26  
27 27 @Override
28 28 public Map<String, Object> carParkSave(Map<String, Object> map) {
29   -
30 29 Map<String, Object> resultMap = new HashMap<String, Object>();
31   -
32 30 try {
33   -
34 31 // 停车场编码
35 32 String parkCode = map.get("parkCode").equals("") ? null : map.get("parkCode").toString();
36   -
37   - // 停车场id
38   - // Integer id = Integer.parseInt(parkCode);
39   -
40 33 // 停车场名称
41 34 String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString();
42   -
43 35 // 地理位置(百度坐标集合)
44 36 String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString();
45   -
46   - // 地理位置(WGS坐标集合)
47   - // String gParkPoint = map.get("gParkPoint").equals("") ? "" :map.get("gParkPoint").toString();
48   -
49 37 // 多边形WGS坐标点集合
50 38 String gParkPoint ="";
51   -
52 39 if(!bParkPoint.equals("")) {
53   -
54 40 String bPloygonGridArray[] = bParkPoint.split(",");
55   -
56 41 int bLen_ = bPloygonGridArray.length;
57   -
58 42 for(int b = 0 ;b<bLen_;b++) {
59   -
60 43 String tempArray[]= bPloygonGridArray[b].split(" ");
61   -
62 44 Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]);
63   -
64 45 if(b==0) {
65   -
66 46 gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat();
67   -
68 47 }else {
69   -
70 48 gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat();
71   -
72 49 }
73   -
74 50 }
75 51  
76 52 }
77   -
78 53 if(bParkPoint.equals(""))
79 54 bParkPoint = null;
80 55 else
... ... @@ -84,169 +59,92 @@ public class CarParkServiceImpl extends BaseServiceImpl&lt;CarPark, Integer&gt; implem
84 59 gParkPoint = null;
85 60 else
86 61 gParkPoint = "POLYGON((" + gParkPoint +"))";
87   -
88   - /*bParkPoint = "POLYGON((" + bParkPoint +"))";
89   -
90   - gParkPoint = "POLYGON((" + gParkPoint +"))";*/
91   -
92 62 // 地理位置中心点(百度坐标)
93 63 String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString();
94   -
95   - // 地理位置中心点(WGS坐标)
96   - // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString();
97   -
98 64 String bJwpointsArray[] =null;
99   -
100 65 if(bCenterPoint!=null) {
101   -
102 66 bJwpointsArray = bCenterPoint.split(" ");
103   -
104 67 }
105   -
106 68 String gCenterPoint = null;
107   -
108 69 if(bJwpointsArray.length>0) {
109   -
110 70 Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]);
111   -
112 71 gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat());
113   -
114 72 }
115   -
116 73 // 坐标类型
117 74 String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
118   -
119 75 // 图形类型
120 76 String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString();
121   -
122 77 // 半径
123 78 Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString());
124   -
125 79 // 面积
126 80 Double area = map.get("area").equals("") ? 0.0 : Double.parseDouble(map.get("area").toString());
127   -
128 81 // 公司
129 82 String company = map.get("company").equals("") ? "" : map.get("company").toString();
130   -
131 83 // 分公司
132   - /*String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString();*/
133   - String brancheCompany="";
134   -
  84 + String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString();
135 85 // 是否撤销
136 86 Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
137   -
138 87 // 版本号
139 88 Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
140   -
141 89 // 描述与说明
142 90 String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
143   -
144 91 SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
145   -
146 92 Date date = new Date();
147   -
148 93 // 创建日期
149 94 String createDate = formatter.format(date);
150   -
151 95 // 修改日期
152 96 String updateDate = formatter.format(date);
153   -
154 97 // 创建人
155 98 Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString());
156   -
157 99 // 修改人
158 100 Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString());
159   -
160   -
161   -
162   -
163 101 carParkRepository.carParkSave(area, company, parkCode, parkName,
164   -
165 102 brancheCompany, createBy, createDate, descriptions, destroy,
166   -
167 103 updateBy, updateDate, versions, bCenterPoint, bParkPoint,
168   -
169 104 dbType, gCenterPoint, gParkPoint, radius, shapesType);
170   -
171 105 resultMap.put("status", ResponseCode.SUCCESS);
172   -
173 106 } catch (Exception e) {
174   -
175 107 resultMap.put("status", ResponseCode.ERROR);
176   -
177 108 logger.error("save erro.", e);
178   -
179 109 }
180   -
181 110 return resultMap;
182 111 }
183 112  
184 113 @Override
185 114 public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) {
186   -
187 115 // 获取线路ID
188 116 Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString());
189   -
190 117 List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id);
191   -
192 118 List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
193   -
194 119 int len = objects.size();
195   -
196 120 if(objects.size()>0) {
197   -
198 121 for(int i = 0 ; i < len; i++) {
199   -
200 122 Map<String, Object> tempM = new HashMap<String,Object>();
201   -
202 123 tempM.put("carParkId", objects.get(i)[0]);
203   -
204 124 tempM.put("carParkArea", objects.get(i)[1]);
205   -
206 125 tempM.put("carParkCompany", objects.get(i)[2]);
207   -
208 126 tempM.put("carParkCode", objects.get(i)[3]);
209   -
210 127 tempM.put("carParkName", objects.get(i)[4]);
211   -
212 128 tempM.put("carParkBrancheCompany", objects.get(i)[5]);
213   -
214 129 tempM.put("carParkCreateBy", objects.get(i)[6]);
215   -
216 130 tempM.put("carParkCreateDate", objects.get(i)[7]);
217   -
218 131 tempM.put("carParkDescriptions", objects.get(i)[8]);
219   -
220 132 tempM.put("carParkDestroy", objects.get(i)[9]);
221   -
222 133 tempM.put("carParkUpdate", objects.get(i)[10]);
223   -
224 134 tempM.put("carParkUpdateDate", objects.get(i)[11]);
225   -
226 135 tempM.put("carParkVersions", objects.get(i)[12]);
227   -
228 136 tempM.put("carParkBcenterPoint", objects.get(i)[13]);
229   -
230 137 tempM.put("carParkBparkPoint", objects.get(i)[14]);
231   -
232 138 tempM.put("carParkGcenterPoint", objects.get(i)[15]);
233   -
234 139 tempM.put("carParkGparkPoint", objects.get(i)[16]);
235   -
236 140 tempM.put("carParkDBtype", objects.get(i)[17]);
237   -
238 141 tempM.put("carParkRadius", objects.get(i)[18]);
239   -
240 142 tempM.put("carParkShapesType", objects.get(i)[19]);
241   -
242 143 resultList.add(tempM);
243 144 }
244   -
245 145 }
246   -
247 146 return resultList;
248 147 }
249   -
250 148 /**
251 149 * 修改停车场信息
252 150 *
... ... @@ -265,90 +163,54 @@ public class CarParkServiceImpl extends BaseServiceImpl&lt;CarPark, Integer&gt; implem
265 163 @Override
266 164 public Map<String, Object> carParkUpdate(Map<String, Object> map) {
267 165 Map<String, Object> resultMap = new HashMap<String, Object>();
268   -
269 166 try {
270   -
271 167 // id
272 168 Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString());
273   -
274 169 if(id!=null) {
275   -
276 170 // 面积
277 171 Double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString());
278   -
279 172 // 中心点(百度坐标)
280 173 String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString();
281   -
282 174 // 图形坐标点集合(百度坐标)
283 175 String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString();
284   -
285 176 // 分公司
286   - /*String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString();*/
287   - String brancheCompany = "";
288   -
  177 + String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString();
  178 + //String brancheCompany = "";
289 179 // 公司
290 180 String company = map.get("company").equals("") ? "" : map.get("company").toString();
291   -
292 181 // 坐标类型
293 182 String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
294   -
295 183 // 描述与说明
296 184 String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
297   -
298 185 // 是否撤销
299 186 Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
300   -
301 187 // 中心点(WGS坐标)
302 188 // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString();
303   -
304 189 String bJwpointsArray[] =null;
305   -
306 190 if(bCenterPoint!=null) {
307   -
308 191 bJwpointsArray = bCenterPoint.split(" ");
309   -
310 192 }
311   -
312 193 String gCenterPoint =null;
313   -
314 194 if(bJwpointsArray.length>0) {
315   -
316 195 Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]);
317   -
318 196 gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat());
319   -
320 197 }
321   -
322 198 // 图形坐标点集合(WGS坐标)
323 199 // String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString();
324   -
325 200 // 多边形WGS坐标点集合
326 201 String gParkPoint ="";
327   -
328 202 if(!bParkPoint.equals("")) {
329   -
330 203 String bPloygonGridArray[] = bParkPoint.split(",");
331   -
332 204 int bLen_ = bPloygonGridArray.length;
333   -
334 205 for(int b = 0 ;b<bLen_;b++) {
335   -
336 206 String tempArray[]= bPloygonGridArray[b].split(" ");
337   -
338 207 Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]);
339   -
340 208 if(b==0) {
341   -
342 209 gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat();
343   -
344 210 }else {
345   -
346 211 gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat();
347   -
348 212 }
349   -
350 213 }
351   -
352 214 }
353 215 if(bParkPoint.equals(""))
354 216 bParkPoint = null;
... ... @@ -362,69 +224,51 @@ public class CarParkServiceImpl extends BaseServiceImpl&lt;CarPark, Integer&gt; implem
362 224 /*bParkPoint = "POLYGON((" + bParkPoint +"))";
363 225  
364 226 gParkPoint = "POLYGON((" + gParkPoint +"))";*/
365   -
366 227 // 编码
367 228 String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString();
368   -
369 229 // 名称
370 230 String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString();
371   -
372 231 // 半径
373 232 Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString());
374   -
375 233 // 图形类型
376 234 String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString();
377   -
378 235 // 版本
379 236 Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
380   -
381 237 // 创建人
382 238 Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString());
383   -
384 239 // 创建日期
385 240 String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString();
386   -
387 241 Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString());
388   -
389 242 SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
390   -
391 243 Date date = new Date();
392   -
393 244 // 修改日期
394 245 String updateDate = formatter.format(date);
395   -
396 246 carParkRepository.carParkUpdate(area, company, parkCode, parkName, brancheCompany, createBy, createDate, descriptions, destroy, updateBy, updateDate, versions, bCenterPoint, gCenterPoint, bParkPoint, gParkPoint, dbType, radius, shapesType, id);
397   -
398 247 }
399   -
400 248 resultMap.put("status", ResponseCode.SUCCESS);
401   -
402 249 } catch (Exception e) {
403   -
404 250 resultMap.put("status", ResponseCode.ERROR);
405   -
406 251 logger.error("save erro.", e);
407   -
408 252 }
409   -
410 253 return resultMap;
411 254 }
412   -
413 255 /** 百度坐标转WGS坐标 */
414 256 public Location FromBDPointToWGSPoint(String bLonx,String bLatx) {
415   -
416 257 double lng = Double.parseDouble(bLonx);
417   -
418 258 double lat = Double.parseDouble(bLatx);
419   -
420 259 Location bdLoc = TransGPS.LocationMake(lng, lat);
421   -
422 260 Location location = TransGPS.bd_decrypt(bdLoc);
423   -
424 261 Location WGSPoint = TransGPS.transformFromGCJToWGS(location);
425   -
426 262 return WGSPoint;
427   -
428 263 }
429   -
  264 +
  265 + @Override
  266 + public boolean selectTccInfoByCode(Map<String, Object> map) {
  267 + List<Object[]> arrayObj = carParkRepository.selectTccInfoByCode(map.get("parkCode").equals("") ? "" : map.get("parkCode").toString());
  268 + boolean tag = true;
  269 + if(arrayObj.size()>0) {
  270 + tag= false;
  271 + }
  272 + return tag;
  273 + }
430 274 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealChartsServiceImpl.java
... ... @@ -259,7 +259,7 @@ public class RealChartsServiceImpl implements RealChartsService {
259 259 }
260 260 inStr = " (" + inStr.substring(1) + ")";
261 261  
262   - String sql = "SELECT ID,DFSJ,FCSJ_ACTUAL,ZDSJ,ZDSJ_ACTUAL,`STATUS`,XL_BM FROM bsth_c_s_sp_info_real WHERE schedule_date_str=:date AND concat_ws('', real_exec_date, dfsj)<:cdate and xl_bm in "+inStr+" ORDER BY dfsj";
  262 + String sql = "SELECT ID,DFSJ,FCSJ_ACTUAL,ZDSJ,ZDSJ_ACTUAL,`STATUS`,XL_BM FROM bsth_c_s_sp_info_real WHERE bc_type!='in' and bc_type!='out' and schedule_date_str=:date AND concat_ws('', real_exec_date, dfsj)<:cdate and xl_bm in "+inStr+" ORDER BY dfsj";
263 263  
264 264 MapSqlParameterSource parameters = new MapSqlParameterSource();
265 265 parameters.addValue("date", date);
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -12,6 +12,7 @@ import com.bsth.data.BasicData;
12 12 import com.bsth.data.LineConfigData;
13 13 import com.bsth.data.schedule.DayOfSchedule;
14 14 import com.bsth.data.schedule.SchAttrCalculator;
  15 +import com.bsth.data.schedule.SchModifyLog;
15 16 import com.bsth.data.schedule.ScheduleComparator;
16 17 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
17 18 import com.bsth.entity.Cars;
... ... @@ -52,7 +53,6 @@ import com.google.common.base.Splitter;
52 53 import com.google.common.collect.Lists;
53 54 import org.apache.commons.lang3.StringEscapeUtils;
54 55 import org.apache.commons.lang3.StringUtils;
55   -import org.drools.compiler.lang.dsl.DSLMapParser.statement_return;
56 56 import org.joda.time.format.DateTimeFormat;
57 57 import org.joda.time.format.DateTimeFormatter;
58 58 import org.slf4j.Logger;
... ... @@ -132,6 +132,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
132 132 @Autowired
133 133 CulateMileageService culateService;
134 134  
  135 + @Autowired
  136 + SchModifyLog schModifyLog;
  137 +
135 138 Logger logger = LoggerFactory.getLogger(this.getClass());
136 139  
137 140 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
... ... @@ -1171,10 +1174,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1171 1174 return rs;
1172 1175 }
1173 1176  
  1177 + String clZbh = map.get("clZbh");
  1178 + String jsy = map.get("jsy");
  1179 + if(!clZbh.equals(sch.getClZbh())
  1180 + || !jsy.equals(sch.getjGh() + "/" + sch.getjName()))
  1181 + schModifyLog.saveChangetochange(sch, clZbh, jsy);//为换人换车情况表写入数据
1174 1182 /**
1175 1183 * 换车
1176 1184 */
1177   - String clZbh = map.get("clZbh");
1178 1185 if (StringUtils.isNotEmpty(clZbh)) {
1179 1186 //换车
1180 1187 if (!carExist(sch.getGsBm(), clZbh)) {
... ... @@ -1189,7 +1196,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1189 1196 /**
1190 1197 * 换驾驶员
1191 1198 */
1192   - String jsy = map.get("jsy");
1193 1199 if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) {
1194 1200 String jGh = jsy.split("/")[0];
1195 1201 String jName = getPersonName(sch.getGsBm(), jGh);
... ... @@ -2013,11 +2019,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2013 2019 int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0;
2014 2020 int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0;
2015 2021 Map<String, Object> map = null;
2016   -
  2022 +
2017 2023 double xgssgl=0,xgljgl=0,lj=0,cj=0;
2018 2024 for (int i = 0; i < list.size(); i++) {
2019 2025 ScheduleRealInfo scheduleRealInfo = list.get(i);
2020   -
  2026 +
2021 2027 if (scheduleRealInfo != null) {
2022 2028 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
2023 2029 //计算实际里程,少驶里程,计划里程=实际里程+少驶里程
... ... @@ -2028,7 +2034,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2028 2034 if (childTaskPlans.isEmpty()) {
2029 2035 tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc();
2030 2036 jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig();
2031   -
  2037 +
2032 2038 if(jhlcOrig-tempJhlc>0){
2033 2039 xgssgl +=jhlcOrig-tempJhlc;
2034 2040 cj += jhlcOrig-tempJhlc;
... ... @@ -2040,8 +2046,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2040 2046 if (scheduleRealInfo.isSflj()) {
2041 2047 ljgl += tempJhlc;
2042 2048 ljglZ += tempJhlc;
2043   - }
2044   -
  2049 + }
  2050 +
2045 2051 if (scheduleRealInfo.getStatus() == -1) {
2046 2052 ssgl += tempJhlc;
2047 2053 ssglZ += tempJhlc;
... ... @@ -2806,7 +2812,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2806 2812 for(ScheduleRealInfo info:listInfo){
2807 2813 for(ScheduleRealInfo total:listTotal){
2808 2814 if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){
2809   -
  2815 +
2810 2816 }
2811 2817 }
2812 2818 }*/
... ... @@ -2902,7 +2908,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2902 2908 for(ScheduleRealInfo info:listInfo){
2903 2909 for(ScheduleRealInfo total:listTotal){
2904 2910 if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){
2905   -
  2911 +
2906 2912 }
2907 2913 }
2908 2914 }*/
... ... @@ -2979,7 +2985,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2979 2985 fage = false;
2980 2986 }
2981 2987 listS.add(scheduleRealInfo);
2982   -
  2988 +
2983 2989 /* if (scheduleRealInfo != null) {
2984 2990 //计划里程(主任务过滤掉临加班次),
2985 2991 //烂班里程(主任务烂班),
... ... @@ -2995,7 +3001,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2995 3001 || scheduleRealInfo.getBcType().equals("out"))) {
2996 3002 jhlc =Arith.add(jhlc,tempJhlc);
2997 3003 }
2998   -
  3004 +
2999 3005 if (scheduleRealInfo.getStatus() == -1) {
3000 3006 remMileage =Arith.add(remMileage,tempJhlc);
3001 3007 }
... ... @@ -3081,7 +3087,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3081 3087 ScheduleRealInfo sch;
3082 3088 //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse();
3083 3089  
3084   - String jGh,jName,sGh,sName;
  3090 + String jGh = null,jName,sGh,sName;
3085 3091 for (ChangePersonCar cpc : cpcs) {
3086 3092  
3087 3093 sch = dayOfSchedule.get(cpc.getSchId());
... ... @@ -3102,6 +3108,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3102 3108 rs.put("status", ResponseCode.ERROR);
3103 3109 return rs;
3104 3110 }
  3111 + }
  3112 +
  3113 + //为换人换车情况表写入数据
  3114 + schModifyLog.saveChangetochange(sch, cpc);
  3115 +
  3116 + if (StringUtils.isNotEmpty(cpc.getJsy())) {
3105 3117 //换驾驶员
3106 3118 persoChange(sch, jGh);
3107 3119 set.add(sch);
... ...
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java
... ... @@ -112,6 +112,10 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService {
112 112 public SchedulePlanRuleResult mapRow(ResultSet rs, int i) throws SQLException {
113 113 SchedulePlanRuleResult obj = new SchedulePlanRuleResult();
114 114 obj.setRuleId(rs.getString("rule_id"));
  115 + obj.setCcZbh(rs.getString("cc_zbh"));
  116 + obj.setQyrq(rs.getDate("qyrq"));
  117 + obj.setGids(rs.getString("gids"));
  118 + obj.setEcids(rs.getString("ecids"));
115 119 obj.setScheduleDate(rs.getDate("schedule_date"));
116 120 obj.setGidindex(rs.getString("gidindex"));
117 121 obj.setEcindex(rs.getString("ecindex"));
... ...
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java
1 1 package com.bsth.service.schedule.rules.shiftloop;
2 2  
3 3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  4 +import com.bsth.service.schedule.utils.Md5Util;
4 5 import com.google.common.base.Splitter;
5 6 import org.apache.commons.lang3.StringUtils;
6 7 import org.joda.time.DateTime;
... ... @@ -17,6 +18,12 @@ public class ScheduleRule_input {
17 18  
18 19 /** 规则Id */
19 20 private String ruleId;
  21 + /**
  22 + * 规则md5值(不使用id判定,使用md5判定)
  23 + * 使用,启用日期,路牌范围,人员范围 结合生成md5编码
  24 + */
  25 + private String ruleMd5;
  26 +
20 27 /** 规则启用日期 */
21 28 private DateTime qyrq;
22 29  
... ... @@ -78,9 +85,20 @@ public class ScheduleRule_input {
78 85 }
79 86 }
80 87  
  88 + /** 生成规则md5编码 */
  89 + ruleMd5 = Md5Util.getMd5(
  90 + String.valueOf(qyrq.getMillis()) + "_" +
  91 + scheduleRule1Flat.getLpIds() + "_" +
  92 + scheduleRule1Flat.getRyConfigIds()
  93 + );
  94 +
  95 +// System.out.println("rule的md5:" + ruleMd5 + " 车辆:" + scheduleRule1Flat.getCarConfigInfo().getCl().getInsideCode());
  96 +
81 97 this.self = scheduleRule1Flat;
82 98 }
83 99  
  100 +
  101 +
84 102 public String getRuleId() {
85 103 return ruleId;
86 104 }
... ... @@ -160,4 +178,12 @@ public class ScheduleRule_input {
160 178 public void setSelf(ScheduleRule1Flat self) {
161 179 this.self = self;
162 180 }
  181 +
  182 + public String getRuleMd5() {
  183 + return ruleMd5;
  184 + }
  185 +
  186 + public void setRuleMd5(String ruleMd5) {
  187 + this.ruleMd5 = ruleMd5;
  188 + }
163 189 }
... ...
src/main/java/com/bsth/service/schedule/utils/Md5Util.java 0 → 100644
  1 +package com.bsth.service.schedule.utils;
  2 +
  3 +import java.security.MessageDigest;
  4 +
  5 +/**
  6 + * Md5工具。
  7 + */
  8 +public class Md5Util {
  9 + private static MessageDigest md5 = null;
  10 + static {
  11 + try {
  12 + md5 = MessageDigest.getInstance("MD5");
  13 + } catch (Exception exp) {
  14 + exp.printStackTrace();
  15 + }
  16 + }
  17 +
  18 + /**
  19 + * 用于获取一个String的md5值。
  20 + * @param str
  21 + * @return
  22 + */
  23 + public static String getMd5(String str) {
  24 + byte[] bs = md5.digest(str.getBytes());
  25 + StringBuilder s = new StringBuilder();
  26 + for (byte x : bs) {
  27 + if ((x & 0xff) >>4 == 0) {
  28 + s.append("0").append(Integer.toHexString(x & 0xff));
  29 + } else {
  30 + s.append(Integer.toHexString(x & 0xff));
  31 + }
  32 + }
  33 + return s.toString();
  34 + }
  35 +
  36 +}
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
... ... @@ -696,7 +696,7 @@
696 696 <optimizationLevel>9</optimizationLevel>
697 697 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
698 698 <jsScript_name>Script 1</jsScript_name>
699   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var jhlc&#x3b; &#x2f;&#x2f; &#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var bcsj&#x3b; &#x2f;&#x2f; &#x73ed;&#x6b21;&#x65f6;&#x95f4;&#xa;&#xa;&#x2f;&#x2f; &#x65f6;&#x95f4;&#x8303;&#x56f4;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#xa;var timeRex &#x3d; &#x2f;&#x5e;&#x28;&#x5b;01&#x5d;&#x3f;&#x5b;0-9&#x5d;&#x7c;2&#x5b;0-3&#x5d;&#x29;&#x3a;&#x5b;0-5&#x5d;&#x5b;0-9&#x5d;&#x24;&#x2f;&#x3b;&#xa;&#x2f;&#x2f; &#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x8f6c;&#x6362;&#x6210;&#x65e5;&#x671f;&#xa;var fcsj_hour &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_min &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_date &#x3d; new Date&#x28;2000,1,1,fcsj_hour,fcsj_min,0&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x65e9;&#x9ad8;&#x5cf0;&#xa;var isZgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;early_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;early_end_time&#x29; &#x26;&#x26; early_up_time &#x21;&#x3d; null &#x26;&#x26; early_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var early_s_hour &#x3d; str2num&#x28;early_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_min &#x3d; str2num&#x28;early_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_date &#x3d; new Date&#x28;2000,1,1,early_s_hour,early_s_min,0&#x29;&#x3b;&#xa;&#xa; var early_e_hour &#x3d; str2num&#x28;early_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_min &#x3d; str2num&#x28;early_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_date &#x3d; new Date&#x28;2000,1,1,early_e_hour,early_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; early_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; early_e_date&#x29; &#x7b;&#xa; isZgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;var isWgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;late_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;late_end_time&#x29; &#x26;&#x26; late_up_time &#x21;&#x3d; null &#x26;&#x26; late_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var late_s_hour &#x3d; str2num&#x28;late_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_min &#x3d; str2num&#x28;late_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_date &#x3d; new Date&#x28;2000,1,1,late_s_hour,late_s_min,0&#x29;&#x3b;&#xa;&#xa; var late_e_hour &#x3d; str2num&#x28;late_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_min &#x3d; str2num&#x28;late_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_date &#x3d; new Date&#x28;2000,1,1,late_e_hour,late_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; late_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; late_e_date&#x29; &#x7b;&#xa; isWgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; early_up_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; late_up_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; up_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; early_down_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; late_down_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; down_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;</jsScript_script>
  699 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var jhlc&#x3b; &#x2f;&#x2f; &#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var bcsj&#x3b; &#x2f;&#x2f; &#x73ed;&#x6b21;&#x65f6;&#x95f4;&#xa;&#xa;&#x2f;&#x2f; &#x65f6;&#x95f4;&#x8303;&#x56f4;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#xa;var timeRex &#x3d; &#x2f;&#x5e;&#x28;&#x5b;01&#x5d;&#x3f;&#x5b;0-9&#x5d;&#x7c;2&#x5b;0-3&#x5d;&#x29;&#x3a;&#x5b;0-5&#x5d;&#x5b;0-9&#x5d;&#x24;&#x2f;&#x3b;&#xa;&#x2f;&#x2f; &#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x8f6c;&#x6362;&#x6210;&#x65e5;&#x671f;&#xa;var fcsj_hour &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_min &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_date &#x3d; new Date&#x28;2000,1,1,fcsj_hour,fcsj_min,0&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x65e9;&#x9ad8;&#x5cf0;&#xa;var isZgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;early_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;early_end_time&#x29; &#x26;&#x26; early_up_time &#x21;&#x3d; null &#x26;&#x26; early_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var early_s_hour &#x3d; str2num&#x28;early_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_min &#x3d; str2num&#x28;early_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_date &#x3d; new Date&#x28;2000,1,1,early_s_hour,early_s_min,0&#x29;&#x3b;&#xa;&#xa; var early_e_hour &#x3d; str2num&#x28;early_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_min &#x3d; str2num&#x28;early_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_date &#x3d; new Date&#x28;2000,1,1,early_e_hour,early_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; early_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; early_e_date&#x29; &#x7b;&#xa; isZgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;var isWgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;late_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;late_end_time&#x29; &#x26;&#x26; late_up_time &#x21;&#x3d; null &#x26;&#x26; late_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var late_s_hour &#x3d; str2num&#x28;late_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_min &#x3d; str2num&#x28;late_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_date &#x3d; new Date&#x28;2000,1,1,late_s_hour,late_s_min,0&#x29;&#x3b;&#xa;&#xa; var late_e_hour &#x3d; str2num&#x28;late_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_min &#x3d; str2num&#x28;late_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_date &#x3d; new Date&#x28;2000,1,1,late_e_hour,late_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; late_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; late_e_date&#x29; &#x7b;&#xa; isWgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; early_up_time &#x3f; early_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; late_up_time &#x3f; late_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; up_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; early_down_time &#x3f; early_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; late_down_time &#x3f; late_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; down_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;</jsScript_script>
700 700 </jsScript> </jsScripts> <fields> <field> <name>jhlc</name>
701 701 <rename>jhlc</rename>
702 702 <type>String</type>
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput2.ktr
... ... @@ -696,7 +696,7 @@
696 696 <optimizationLevel>9</optimizationLevel>
697 697 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
698 698 <jsScript_name>Script 1</jsScript_name>
699   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var jhlc&#x3b; &#x2f;&#x2f; &#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var bcsj&#x3b; &#x2f;&#x2f; &#x73ed;&#x6b21;&#x65f6;&#x95f4;&#xa;&#xa;&#x2f;&#x2f; &#x65f6;&#x95f4;&#x8303;&#x56f4;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#xa;var timeRex &#x3d; &#x2f;&#x5e;&#x28;&#x5b;01&#x5d;&#x3f;&#x5b;0-9&#x5d;&#x7c;2&#x5b;0-3&#x5d;&#x29;&#x3a;&#x5b;0-5&#x5d;&#x5b;0-9&#x5d;&#x24;&#x2f;&#x3b;&#xa;&#x2f;&#x2f; &#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x8f6c;&#x6362;&#x6210;&#x65e5;&#x671f;&#xa;var fcsj_hour &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_min &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_date &#x3d; new Date&#x28;2000,1,1,fcsj_hour,fcsj_min,0&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x65e9;&#x9ad8;&#x5cf0;&#xa;var isZgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;early_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;early_end_time&#x29; &#x26;&#x26; early_up_time &#x21;&#x3d; null &#x26;&#x26; early_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var early_s_hour &#x3d; str2num&#x28;early_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_min &#x3d; str2num&#x28;early_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_date &#x3d; new Date&#x28;2000,1,1,early_s_hour,early_s_min,0&#x29;&#x3b;&#xa;&#xa; var early_e_hour &#x3d; str2num&#x28;early_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_min &#x3d; str2num&#x28;early_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_date &#x3d; new Date&#x28;2000,1,1,early_e_hour,early_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; early_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; early_e_date&#x29; &#x7b;&#xa; isZgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;var isWgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;late_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;late_end_time&#x29; &#x26;&#x26; late_up_time &#x21;&#x3d; null &#x26;&#x26; late_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var late_s_hour &#x3d; str2num&#x28;late_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_min &#x3d; str2num&#x28;late_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_date &#x3d; new Date&#x28;2000,1,1,late_s_hour,late_s_min,0&#x29;&#x3b;&#xa;&#xa; var late_e_hour &#x3d; str2num&#x28;late_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_min &#x3d; str2num&#x28;late_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_date &#x3d; new Date&#x28;2000,1,1,late_e_hour,late_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; late_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; late_e_date&#x29; &#x7b;&#xa; isWgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; early_up_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; late_up_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; up_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; early_down_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; late_down_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; down_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d;</jsScript_script>
  699 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var jhlc&#x3b; &#x2f;&#x2f; &#x8ba1;&#x5212;&#x91cc;&#x7a0b;&#xa;var bcsj&#x3b; &#x2f;&#x2f; &#x73ed;&#x6b21;&#x65f6;&#x95f4;&#xa;&#xa;&#x2f;&#x2f; &#x65f6;&#x95f4;&#x8303;&#x56f4;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#xa;var timeRex &#x3d; &#x2f;&#x5e;&#x28;&#x5b;01&#x5d;&#x3f;&#x5b;0-9&#x5d;&#x7c;2&#x5b;0-3&#x5d;&#x29;&#x3a;&#x5b;0-5&#x5d;&#x5b;0-9&#x5d;&#x24;&#x2f;&#x3b;&#xa;&#x2f;&#x2f; &#x53d1;&#x8f66;&#x65f6;&#x95f4;&#x8f6c;&#x6362;&#x6210;&#x65e5;&#x671f;&#xa;var fcsj_hour &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_min &#x3d; str2num&#x28;sendtime_calcu.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa;var fcsj_date &#x3d; new Date&#x28;2000,1,1,fcsj_hour,fcsj_min,0&#x29;&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x65e9;&#x9ad8;&#x5cf0;&#xa;var isZgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;early_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;early_end_time&#x29; &#x26;&#x26; early_up_time &#x21;&#x3d; null &#x26;&#x26; early_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var early_s_hour &#x3d; str2num&#x28;early_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_min &#x3d; str2num&#x28;early_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_s_date &#x3d; new Date&#x28;2000,1,1,early_s_hour,early_s_min,0&#x29;&#x3b;&#xa;&#xa; var early_e_hour &#x3d; str2num&#x28;early_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_min &#x3d; str2num&#x28;early_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var early_e_date &#x3d; new Date&#x28;2000,1,1,early_e_hour,early_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; early_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; early_e_date&#x29; &#x7b;&#xa; isZgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;var isWgf &#x3d; false&#x3b;&#xa;if &#x28;timeRex.test&#x28;late_start_time&#x29; &#x26;&#x26; timeRex.test&#x28;late_end_time&#x29; &#x26;&#x26; late_up_time &#x21;&#x3d; null &#x26;&#x26; late_down_time &#x21;&#x3d; null&#x29; &#x7b;&#xa; var late_s_hour &#x3d; str2num&#x28;late_start_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_min &#x3d; str2num&#x28;late_start_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_s_date &#x3d; new Date&#x28;2000,1,1,late_s_hour,late_s_min,0&#x29;&#x3b;&#xa;&#xa; var late_e_hour &#x3d; str2num&#x28;late_end_time.substr&#x28;0, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_min &#x3d; str2num&#x28;late_end_time.substr&#x28;3, 2&#x29;, &#x22;&#x23;&#x22;&#x29;&#x3b;&#xa; var late_e_date &#x3d; new Date&#x28;2000,1,1,late_e_hour,late_e_min,0&#x29;&#x3b;&#xa;&#xa; if &#x28;fcsj_date &#x3e;&#x3d; late_s_date &#x26;&#x26; fcsj_date &#x3c;&#x3d; late_e_date&#x29; &#x7b;&#xa; isWgf &#x3d; true&#x3b;&#xa; &#x7d;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5224;&#x5b9a;&#x662f;&#x5426;&#x665a;&#x9ad8;&#x5cf0;&#xa;&#xa;if &#x28;sxx &#x3d;&#x3d; 0&#x29; &#x7b; &#x2f;&#x2f; &#x4e0a;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; early_up_time &#x3f; early_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; late_up_time &#x3f; late_up_time &#x3a; up_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; up_mileage&#x3b;&#xa; bcsj &#x3d; up_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d; else &#x7b; &#x2f;&#x2f; sxx &#x3d;&#x3d; 1 &#x4e0b;&#x884c;&#xa; if &#x28;isZgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; early_down_time &#x3f; early_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else if &#x28;isWgf&#x29; &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; late_down_time &#x3f; late_down_time &#x3a; down_travel_time&#x3b;&#xa; &#x7d; else &#x7b;&#xa; jhlc &#x3d; down_mileage&#x3b;&#xa; bcsj &#x3d; down_travel_time&#x3b;&#xa; &#x7d;&#xa;&#x7d;</jsScript_script>
700 700 </jsScript> </jsScripts> <fields> <field> <name>jhlc</name>
701 701 <rename>jhlc</rename>
702 702 <type>String</type>
... ...
src/main/resources/logback.xml
... ... @@ -16,12 +16,12 @@
16 16  
17 17 <!-- 主日志文件 -->
18 18 <appender name="FILE"
19   - class="ch.qos.logback.core.rolling.RollingFileAppender">
  19 + class="ch.qos.logback.core.rolling.RollingFileAppender">
20 20 <file>${LOG_BASE}/main/main.log</file>
21 21 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
22 22 <fileNamePattern>${LOG_BASE}/main/main-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
23 23 <timeBasedFileNamingAndTriggeringPolicy
24   - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  24 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
25 25 <maxFileSize>100MB</maxFileSize>
26 26 </timeBasedFileNamingAndTriggeringPolicy>
27 27 </rollingPolicy>
... ... @@ -38,12 +38,12 @@
38 38  
39 39 <!-- 访问日志 -->
40 40 <appender name="ACCESS"
41   - class="ch.qos.logback.core.rolling.RollingFileAppender">
  41 + class="ch.qos.logback.core.rolling.RollingFileAppender">
42 42 <file>${LOG_BASE}/access/access.log</file>
43 43 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
44 44 <fileNamePattern>${LOG_BASE}/access/access-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
45 45 <timeBasedFileNamingAndTriggeringPolicy
46   - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  46 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
47 47 <maxFileSize>100MB</maxFileSize>
48 48 </timeBasedFileNamingAndTriggeringPolicy>
49 49 </rollingPolicy>
... ... @@ -55,18 +55,18 @@
55 55 </layout>
56 56 </appender>
57 57 <logger name="com.bsth.filter.AccessLogFilter" level="INFO"
58   - additivity="false">
  58 + additivity="false">
59 59 <appender-ref ref="ACCESS" />
60 60 </logger>
61 61  
62 62 <!-- 和网关通讯日志日志 -->
63 63 <appender name="GATEWAY"
64   - class="ch.qos.logback.core.rolling.RollingFileAppender">
  64 + class="ch.qos.logback.core.rolling.RollingFileAppender">
65 65 <file>${LOG_BASE}/gateway/gateway.log</file>
66 66 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
67 67 <fileNamePattern>${LOG_BASE}/gateway/gateway-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
68 68 <timeBasedFileNamingAndTriggeringPolicy
69   - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  69 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
70 70 <maxFileSize>100MB</maxFileSize>
71 71 </timeBasedFileNamingAndTriggeringPolicy>
72 72 </rollingPolicy>
... ... @@ -77,26 +77,26 @@
77 77 </layout>
78 78 </appender>
79 79 <logger name="com.bsth.service.directive.DirectiveServiceImpl"
80   - level="INFO" additivity="false">
  80 + level="INFO" additivity="false">
81 81 <appender-ref ref="GATEWAY" />
82 82 </logger>
83 83 <logger name="com.bsth.controller.directive.UpstreamEntrance"
84   - level="INFO" additivity="false">
  84 + level="INFO" additivity="false">
85 85 <appender-ref ref="GATEWAY" />
86 86 </logger>
87 87 <logger name="com.bsth.data.directive.GatewayHttpUtils" level="INFO"
88   - additivity="false">
  88 + additivity="false">
89 89 <appender-ref ref="GATEWAY" />
90 90 </logger>
91 91  
92 92 <!-- 运管处接口日志 -->
93 93 <appender name="TRAFFIC"
94   - class="ch.qos.logback.core.rolling.RollingFileAppender">
  94 + class="ch.qos.logback.core.rolling.RollingFileAppender">
95 95 <file>${LOG_BASE}/traffic/traffic.log</file>
96 96 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
97 97 <fileNamePattern>${LOG_BASE}/traffic/traffic-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
98 98 <timeBasedFileNamingAndTriggeringPolicy
99   - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  99 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
100 100 <maxFileSize>100MB</maxFileSize>
101 101 </timeBasedFileNamingAndTriggeringPolicy>
102 102 </rollingPolicy>
... ... @@ -107,18 +107,18 @@
107 107 </layout>
108 108 </appender>
109 109 <logger name="com.bsth.service.impl.TrafficManageServiceImpl"
110   - level="INFO" additivity="false">
  110 + level="INFO" additivity="false">
111 111 <appender-ref ref="TRAFFIC" />
112 112 </logger>
113 113  
114 114 <!-- schedule 数据工具操作日志 -->
115 115 <appender name="DATATOOLS"
116   - class="ch.qos.logback.core.rolling.RollingFileAppender">
  116 + class="ch.qos.logback.core.rolling.RollingFileAppender">
117 117 <file>${LOG_BASE}/schedule/datatools/datatools.log</file>
118 118 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
119 119 <fileNamePattern>${LOG_BASE}/schedule/datatools/datatools-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
120 120 <timeBasedFileNamingAndTriggeringPolicy
121   - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  121 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
122 122 <maxFileSize>100MB</maxFileSize>
123 123 </timeBasedFileNamingAndTriggeringPolicy>
124 124 </rollingPolicy>
... ... @@ -130,12 +130,12 @@
130 130 </appender>
131 131 <!-- schedule 时刻表操作日志 -->
132 132 <appender name="TIMETABLE"
133   - class="ch.qos.logback.core.rolling.RollingFileAppender">
  133 + class="ch.qos.logback.core.rolling.RollingFileAppender">
134 134 <file>${LOG_BASE}/schedule/timetable/timetable.log</file>
135 135 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
136 136 <fileNamePattern>${LOG_BASE}/schedule/timetable/timetable-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
137 137 <timeBasedFileNamingAndTriggeringPolicy
138   - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  138 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
139 139 <maxFileSize>100MB</maxFileSize>
140 140 </timeBasedFileNamingAndTriggeringPolicy>
141 141 </rollingPolicy>
... ... @@ -146,11 +146,11 @@
146 146 </layout>
147 147 </appender>
148 148 <logger name="com.bsth.service.schedule.impl.TTInfoDetailServiceImpl"
149   - level="INFO" additivity="false">
  149 + level="INFO" additivity="false">
150 150 <appender-ref ref="TIMETABLE" />
151 151 </logger>
152 152 <logger name="com.bsth.service.schedule.utils.DataToolsServiceImpl"
153   - level="INFO" additivity="false">
  153 + level="INFO" additivity="false">
154 154 <appender-ref ref="TIMETABLE" />
155 155 <appender-ref ref="DATATOOLS" />
156 156 </logger>
... ... @@ -181,35 +181,36 @@
181 181 level="INFO" additivity="false">
182 182 <appender-ref ref="GPS_COUNT" />
183 183 </logger>
184   - <!--<logger name="org.hibernate.SQL" level="TRACE">-->
185   - <!--<appender-ref ref="STDOUT" />-->
186   - <!--</logger>-->
187   -
188   - <!--JdbcTemplate的日志输出器 -->
189   - <logger name="org.springframework.jdbc.core.StatementCreatorUtils"
190   - additivity="false" level="TRACE">
191   - <appender-ref ref="STDOUT" />
192   - </logger>
193   - <logger name="org.springframework.jdbc.core" additivity="true">
194   - <level value="DEBUG" />
195   - <appender-ref ref="STDOUT" />
196   - </logger>
197   - <logger name="java.sql.Connection" additivity="true">
198   - <level value="DEBUG" />
199   - <appender-ref ref="STDOUT" />
200   - </logger>
201   - <logger name="java.sql.Statement" additivity="true">
202   - <level value="DEBUG" />
203   - <appender-ref ref="STDOUT" />
204   - </logger>
205   - <logger name="java.sql.PreparedStatement" additivity="true">
206   - <level value="DEBUG" />
207   - <appender-ref ref="STDOUT" />
208   - </logger>
209   - <logger name="java.sql.ResultSet" additivity="true">
210   - <level value="DEBUG" />
211   - <appender-ref ref="STDOUT" />
212   - </logger>
  184 +
  185 + <!--<logger name="org.hibernate.SQL" level="TRACE">-->
  186 + <!--<appender-ref ref="STDOUT" />-->
  187 + <!--</logger>-->
  188 +
  189 + <!--JdbcTemplate的日志输出器 -->
  190 + <logger name="org.springframework.jdbc.core.StatementCreatorUtils"
  191 + additivity="false" level="INFO">
  192 + <appender-ref ref="STDOUT" />
  193 + </logger>
  194 + <logger name="org.springframework.jdbc.core" additivity="true">
  195 + <level value="INFO" />
  196 + <appender-ref ref="STDOUT" />
  197 + </logger>
  198 + <logger name="java.sql.Connection" additivity="true">
  199 + <level value="INFO" />
  200 + <appender-ref ref="STDOUT" />
  201 + </logger>
  202 + <logger name="java.sql.Statement" additivity="true">
  203 + <level value="INFO" />
  204 + <appender-ref ref="STDOUT" />
  205 + </logger>
  206 + <logger name="java.sql.PreparedStatement" additivity="true">
  207 + <level value="INFO" />
  208 + <appender-ref ref="STDOUT" />
  209 + </logger>
  210 + <logger name="java.sql.ResultSet" additivity="true">
  211 + <level value="INFO" />
  212 + <appender-ref ref="STDOUT" />
  213 + </logger>
213 214  
214 215 <!-- 日志输出级别 -->
215 216 <root level="info">
... ...
src/main/resources/rules/shiftloop_fb_2.drl
... ... @@ -5,6 +5,8 @@ import java.util.*;
5 5  
6 6 import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output;
7 7  
  8 +import com.bsth.service.schedule.utils.Md5Util;
  9 +
8 10 import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;
9 11 import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;
10 12 import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;
... ... @@ -28,6 +30,7 @@ global ScheduleRuleService scheduleRuleService;
28 30  
29 31 declare Calcu_days_result_pre
30 32 ruleId: String // 规则Id
  33 + ruleMd5: String // 规则md5
31 34  
32 35 calcu_index_lp : Integer // 计算之后路牌的起始索引
33 36 calcu_index_ry : Integer // 计算之后人员的起始索引
... ... @@ -59,7 +62,7 @@ rule &quot;calcu_days_1_&quot;
59 62 $xlId: xlId
60 63 )
61 64 ScheduleRule_input(
62   - $ruleId : ruleId, $qyrq : qyrq,
  65 + $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5,
63 66 $lpindex : startGbdIndex, $ryindex: startEIndex)
64 67 eval($qyrq.isBefore($fromDate))
65 68 then
... ... @@ -68,6 +71,7 @@ rule &quot;calcu_days_1_&quot;
68 71 // 构造Calcu_days_result_pre,用于路牌
69 72 Calcu_days_result_pre cdrp = new Calcu_days_result_pre();
70 73 cdrp.setRuleId($ruleId);
  74 + cdrp.setRuleMd5($ruleMd5);
71 75 cdrp.setCalcu_index_lp($lpindex);
72 76 cdrp.setCalcu_index_ry($ryindex);
73 77 cdrp.setCalcu_start_date_1($qyrq);
... ... @@ -94,7 +98,7 @@ rule &quot;calcu_days_2_&quot;
94 98 $xlId: xlId
95 99 )
96 100 ScheduleRule_input(
97   - $ruleId : ruleId, $qyrq : qyrq,
  101 + $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5,
98 102 $lpindex : startGbdIndex, $ryindex: startEIndex)
99 103 eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate)))
100 104 then
... ... @@ -103,6 +107,7 @@ rule &quot;calcu_days_2_&quot;
103 107 // 构造Calcu_days_result_pre,用于路牌
104 108 Calcu_days_result_pre cdrp = new Calcu_days_result_pre();
105 109 cdrp.setRuleId($ruleId);
  110 + cdrp.setRuleMd5($ruleMd5);
106 111 cdrp.setCalcu_index_lp($lpindex);
107 112 cdrp.setCalcu_index_ry($ryindex);
108 113 cdrp.setCalcu_start_date_1($qyrq);
... ... @@ -124,6 +129,7 @@ end
124 129  
125 130 declare SchedulePlanRuleResult_wrap
126 131 ruleId: String // 规则Id
  132 + ruleMd5: String // 规则md5编码
127 133 scheduleDate: DateTime // 排班日期
128 134  
129 135 isUsed: Boolean = false // 是否被使用过
... ... @@ -142,7 +148,7 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
142 148 $self: schedulePlan
143 149 )
144 150 eval($self.getIsHistoryPlanFirst() == true) // 是否使用历史排班标识
145   - $sprr: SchedulePlanRuleResult() from scheduleRuleService.findLastByXl($xlId, $fromDate.toDate())
  151 + $sprr: SchedulePlanRuleResult($qyrq: qyrq) from scheduleRuleService.findLastByXl($xlId, $fromDate.toDate())
146 152  
147 153 then
148 154 // 创建班序历史结果数据
... ... @@ -151,6 +157,16 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
151 157 schedulePlanRuleResult_wrap.setScheduleDate(new DateTime($sprr.getScheduleDate()));
152 158 schedulePlanRuleResult_wrap.setSelf($sprr);
153 159  
  160 + // 规则Md5编码
  161 + String md5 = Md5Util.getMd5(
  162 + String.valueOf($qyrq.getTime()) + "_" +
  163 + $sprr.getGids() + "_" + $sprr.getEcids()
  164 + );
  165 +
  166 +// System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh());
  167 +
  168 + schedulePlanRuleResult_wrap.setRuleMd5(md5);
  169 +
154 170 insert(schedulePlanRuleResult_wrap);
155 171 end
156 172  
... ... @@ -163,10 +179,12 @@ rule &quot;calcu_days_1_with_result&quot;
163 179 when
164 180 $cdrp: Calcu_days_result_pre(
165 181 calcu_start_date_1.isBefore(calcu_start_date_2),
166   - $ruleId: ruleId
  182 + $ruleId: ruleId,
  183 + $ruleMd5: ruleMd5
167 184 )
168 185 $srrr_wrap: SchedulePlanRuleResult_wrap(
169   - ruleId == $ruleId,
  186 +// ruleId == $ruleId,
  187 + ruleMd5 == $ruleMd5,
170 188 scheduleDate.isAfter($cdrp.calcu_start_date_1),
171 189 scheduleDate.isBefore($cdrp.calcu_start_date_2),
172 190 isUsed == false,
... ...
src/main/resources/static/pages/base/carpark/add.html
... ... @@ -18,6 +18,7 @@
18 18 <i class="icon-equalizer font-red-sunglo"></i>
19 19 <span class="caption-subject font-red-sunglo bold uppercase">添加停车场
20 20 <span class="step-title"> 1 - 4 </span>
  21 + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i>
21 22 </span>
22 23 </div>
23 24  
... ... @@ -38,28 +39,28 @@
38 39 <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true">
39 40 <span class="number"> 1 </span>
40 41 <span class="desc">
41   - <i class="fa fa-check"></i> 选择添加停车场方式 </span>
  42 + <i class="fa fa-check"></i> 获取停车场位置方式 </span>
42 43 </a>
43 44 </li>
44 45 <li>
45 46 <a href="#tab2" data-toggle="tab" class="step">
46 47 <span class="number"> 2 </span>
47 48 <span class="desc">
48   - <i class="fa fa-check"></i> 停车场位置 </span>
  49 + <i class="fa fa-check"></i> 确定停车场位置 </span>
49 50 </a>
50 51 </li>
51 52 <li>
52 53 <a href="#tab3" data-toggle="tab" class="step active">
53 54 <span class="number"> 3 </span>
54 55 <span class="desc">
55   - <i class="fa fa-check"></i> 停车场信息 </span>
  56 + <i class="fa fa-check"></i> 填写停车场信息 </span>
56 57 </a>
57 58 </li>
58 59 <li>
59 60 <a href="#tab4" data-toggle="tab" class="step">
60 61 <span class="number"> 4 </span>
61 62 <span class="desc">
62   - <i class="fa fa-check"></i> 确认 </span>
  63 + <i class="fa fa-check"></i> 确认并提交 </span>
63 64 </a>
64 65 </li>
65 66 </ul>
... ... @@ -81,47 +82,33 @@
81 82  
82 83 <!-- 选择添加站点方式 -->
83 84 <div class="tab-pane active" id="tab1">
84   -
85   - <h3 class="block"> 选择添加停车场方式 </h3>
86   -
87   - <!-- 站点名称 -->
  85 + <h3 class="block"> 获取停车场位置方式 </h3>
  86 + <!--停车场名称 -->
88 87 <div class="form-group" id="formRequ">
89   - <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称</label>
  88 + <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称&nbsp;&nbsp;&nbsp;:</label>
90 89 <div class="col-md-9">
91   - <input type="text" class="form-control input-medium" id="parkNamebooxtInput" name="parkNamebooxt">
  90 + <input type="text" class="form-control input-medium" id="parkNamebooxtInput" name="parkNamebooxt" placeholder="请输入停车场名称">
92 91 </div>
93 92 </div>
94   -
95 93 <!-- 新增方式 -->
96 94 <div class="form-group">
97   - <label class="col-md-3 control-label">新增方式:</label>
  95 + <label class="col-md-3 control-label"><span class="required"> * </span>选择获取方式:</label>
98 96 <div class="col-md-9">
99 97 <div class="icheck-list">
100 98 <label>
101 99 <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成
102 100 </label>
103 101 <label >
104   - <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加
  102 + <input type="radio" class="icheck" name="baseRes" value=1 > 手动绘制
105 103 </label>
106 104 </div>
107 105 </div>
108 106 </div>
109   -
110   - <div class="form-group">
111   - <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50">
112   - <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 新增方式说明: </span></h5>
113   - <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据站点名称自动生成以100米为半径范围的圆.</span> </p>
114   - <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p>
115   - </div>
116   - </div>
117   -
118 107 </div>
119   -
120   - <!-- 站点位置 -->
  108 + <!--停车场位置 -->
121 109 <div class="tab-pane" id="tab2">
122   - <h3 class="block"> 站点位置 </h3>
  110 + <h3 class="block"> 停车场位置 </h3>
123 111 <div id="addCarParkbmap_basic"></div>
124   -
125 112 <div class="leftUtils">
126 113 <div class="btn-group" style="left: 100px;">
127 114 <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具
... ... @@ -139,243 +126,197 @@
139 126 </div>
140 127 </div>
141 128 </div>
142   -
143   - <!-- 站点信息 -->
  129 + <!--停车场信息 -->
144 130 <div class="tab-pane" id="tab3">
145   -
146 131 <h3 class="block"> 停车场信息 </h3>
147   -
148 132 <input type="hidden" name="bParkPoint" id="bParkPointInput" />
149   -
150 133 <input type="hidden" name="gParkPoint" id="gParkPointInput" />
151   -
152 134 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
153   -
154   -
155 135 <!-- 停车场名称 -->
156 136 <div class="form-body">
157 137 <div class="form-group">
158 138 <label class="control-label col-md-3">
159   - <span class="required"> * </span> 停车场名称
  139 + <span class="required"> * </span> 停车场名称&nbsp;&nbsp;&nbsp; :
160 140 </label>
161 141 <div class="col-md-6">
162   - <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="站点名称">
  142 + <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="请输入站点名称" readonly="readonly">
163 143 </div>
164 144 </div>
165 145 </div>
166   -
167 146 <!-- 停车场编码 -->
168 147 <div class="form-body">
169 148 <div class="form-group">
170 149 <label class="control-label col-md-3">
171   - <span class="required"> * </span>停车场编码
  150 + <span class="required"> * </span>停车场编码&nbsp;&nbsp;&nbsp;:
172 151 </label>
173 152 <div class="col-md-6">
174   - <input type="text" class="form-control" name="parkCode" id="parkCodeInput">
  153 + <input type="text" class="form-control" name="parkCode" id="parkCodeInput" placeholder="请输入停车场编码">
175 154 </div>
176 155 </div>
177 156 </div>
178   -
179   - <!-- 中心位置坐标点 -->
  157 + <!-- 经纬度坐标点 -->
180 158 <div class="form-body">
181 159 <div class="form-group">
182   - <label class="col-md-3 control-label">经纬度坐标点:</label>
  160 + <label class="col-md-3 control-label"><span class="required"> * </span>经纬度坐标点:</label>
183 161 <div class="col-md-6">
184   - <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput">
  162 + <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput" readonly="readonly" placeholder="请输入经纬度坐标点">
185 163 </div>
186 164 </div>
187 165 </div>
188 166  
189   - <!-- 范围图形类型 -->
  167 + <!-- 几何图形类型 -->
190 168 <div class="form-body">
191 169 <div class="form-group">
192   - <label class="col-md-3 control-label">范围图形类型:</label>
  170 + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label>
193 171 <div class="col-md-6">
194   - <select name="shapesType" class="form-control" id="shapesTypeSelect">
195   - <option value="">-- 请选择站点类型 --</option>
196   - <option value="r">圆形</option>
197   - <option value="d">多变形</option>
198   - </select>
  172 + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" readonly="readonly" placeholder="请输入几何图形类型">
199 173 </div>
200 174 </div>
201 175 </div>
202   -
203 176 <!-- 圆形半径 -->
  177 + <div class="form-body" id="radiusGroup">
  178 + <div class="form-group">
  179 + <label class="col-md-3 control-label"><span class="required"> * </span> 圆形半径&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  180 + <div class="col-md-6">
  181 + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="请输入圆形半径">
  182 + </div>
  183 + </div>
  184 + </div>
  185 + <!-- 是否撤销 -->
204 186 <div class="form-body">
205 187 <div class="form-group">
206   - <label class="col-md-3 control-label">圆形半径:</label>
  188 + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
207 189 <div class="col-md-6">
208   - <input type="text" class="form-control" name="radius" id="radiusInput" >
  190 + <select name="destroy" class="form-control" id="destroySelect">
  191 + <option value="">-- 请选择撤销类型 --</option>
  192 + <option value="0">否</option>
  193 + <option value="1">是</option>
  194 + </select>
209 195 </div>
210 196 </div>
211 197 </div>
212   -
213 198 <!-- 面积 -->
214 199 <div class="form-body">
215 200 <div class="form-group">
216   - <label class="col-md-3 control-label">面积</label>
  201 + <label class="col-md-3 control-label">面积&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
217 202 <div class="col-md-6">
218   - <input type="text" class="form-control" name="area" id="areaInput" >
219   - <span class="help-block">单位:平方米</span>
  203 + <input type="text" class="form-control" name="area" id="areaInput" placeholder="请输入面积">
  204 + <span class="help-block">单位:平方米(㎡)</span>
220 205 </div>
221 206 </div>
222 207 </div>
223   -
224 208 <!-- 所属公司 -->
225 209 <div class="form-body">
226 210 <div class="form-group">
227   - <label class="col-md-3 control-label">所属公司</label>
  211 + <label class="col-md-3 control-label">所属公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
228 212 <div class="col-md-6">
229   - <select name="company" class="form-control" style="width:100%" id="companySelect">
230   -
231   - </select>
  213 + <select name="company" class="form-control" style="width:100%" id="companySelect"></select>
232 214 </div>
233 215 </div>
234 216 </div>
235   -
236   -
237 217 <!-- 所属分公司 -->
238   - <!-- <div class="form-body">
  218 + <div class="form-body">
239 219 <div class="form-group">
240   - <label class="col-md-3 control-label">所属分公司</label>
  220 + <label class="col-md-3 control-label">所属分公司&nbsp;&nbsp;&nbsp;:</label>
241 221 <div class="col-md-6">
242 222 <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect">
243 223 </select>
244 224 </div>
245 225 </div>
246   - </div> -->
247   -
248   -
  226 + </div>
249 227 <!-- 版本号 -->
250 228 <div class="form-body">
251 229 <div class="form-group">
252   - <label class="col-md-3 control-label">版本号</label>
  230 + <label class="col-md-3 control-label">版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
253 231 <div class="col-md-6">
254   - <input type="text" class="form-control" name="versions" value='1' Readonly>
  232 + <input type="text" class="form-control" name="versions" value='1' Readonly placeholder="请输入版本号">
255 233 </div>
256 234 </div>
257 235 </div>
258   -
259   - <!-- 范围图形类型 -->
260   - <div class="form-body">
261   - <div class="form-group">
262   - <label class="col-md-3 control-label">是否撤销:</label>
263   - <div class="col-md-6">
264   - <select name="destroy" class="form-control" id="destroySelect">
265   - <option value="">-- 请选择撤销类型 --</option>
266   - <option value="0">否</option>
267   - <option value="1">是</option>
268   - </select>
269   - </div>
270   - </div>
271   - </div>
272   -
273 236 <!-- 描述/说明 -->
274 237 <div class="form-group">
275   - <label class="control-label col-md-3"> 描述/说明 </label>
  238 + <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
276 239 <div class="col-md-6">
277   - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
  240 + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="请输入描述/说明"></textarea>
278 241 </div>
279 242 </div>
280 243  
281 244 </div>
282   -
283 245 <!-- 确定提交资料信息 -->
284 246 <div class="tab-pane" id="tab4">
285 247 <h3 class="block"> 确认您提交的停车场信息 </h3>
286   -
287 248 <h4 class="form-section"> 地理位置 </h4>
288   -
289 249 <div class="form-group">
290   - <label class="control-label col-md-3"> 范围图形类型: </label>
  250 + <label class="control-label col-md-3"> 几何图形类型: </label>
291 251 <div class="col-md-4">
292 252 <p class="form-control-static" data-display="shapesType"> </p>
293 253 </div>
294 254 </div>
295   -
296   - <div class="form-group">
297   - <label class="control-label col-md-3"> 圆形半径: </label>
  255 + <div class="form-group">
  256 + <label class="control-label col-md-3"> 圆形半径&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
298 257 <div class="col-md-4">
299 258 <p class="form-control-static" data-display="radius"> </p>
300 259 </div>
301 260 </div>
302 261  
303 262 <div class="form-group">
304   - <label class="control-label col-md-3"> 中心位置经纬度坐标点: </label>
  263 + <label class="control-label col-md-3"> 经纬度坐标点: </label>
305 264 <div class="col-md-4">
306 265 <p class="form-control-static" data-display="bCenterPoint"> </p>
307 266 </div>
308 267 </div>
309   -
310   - <!-- <div class="form-group">
311   - <label class="control-label col-md-3"> 中心位置WGS坐标点: </label>
312   - <div class="col-md-4">
313   - <p class="form-control-static" data-display="gCenterPoint"> </p>
314   - </div>
315   - </div> -->
316   -
317 268 <h4 class="form-section"> 停车场信息 </h4>
318   -
319 269 <div class="form-group">
320   - <label class="control-label col-md-3">停车场名称:</label>
  270 + <label class="control-label col-md-3">停车场名称&nbsp;&nbsp;&nbsp;:</label>
321 271 <div class="col-md-4">
322 272 <p class="form-control-static" data-display="parkName"> </p>
323 273 </div>
324 274 </div>
325   -
326 275 <div class="form-group">
327   - <label class="control-label col-md-3">停车场编码:</label>
  276 + <label class="control-label col-md-3">停车场编码&nbsp;&nbsp;&nbsp;:</label>
328 277 <div class="col-md-4">
329 278 <p class="form-control-static" data-display="parkCode"> </p>
330 279 </div>
331 280 </div>
332   -
333   - <div class="form-group">
334   - <label class="control-label col-md-3">面积:</label>
  281 + <div class="form-group">
  282 + <label class="control-label col-md-3">是否撤销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  283 + <div class="col-md-4">
  284 + <p class="form-control-static" data-display="destroy"> </p>
  285 + </div>
  286 + </div>
  287 + <div class="form-group">
  288 + <label class="control-label col-md-3">面积&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
335 289 <div class="col-md-4">
336 290 <p class="form-control-static" data-display="area"> </p>
337 291 </div>
338 292 </div>
339   -
340 293 <div class="form-group">
341   - <label class="control-label col-md-3">所属公司:</label>
  294 + <label class="control-label col-md-3">所属公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
342 295 <div class="col-md-4">
343 296 <p class="form-control-static" data-display="company"> </p>
344 297 </div>
345 298 </div>
346   -
347   - <!-- <div class="form-group">
348   - <label class="control-label col-md-3">分公司:</label>
349   - <div class="col-md-4">
350   - <p class="form-control-static" data-display="brancheCompany"> </p>
351   - </div>
352   - </div> -->
353   -
354 299 <div class="form-group">
355   - <label class="control-label col-md-3">版本号:</label>
  300 + <label class="control-label col-md-3">分公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
356 301 <div class="col-md-4">
357   - <p class="form-control-static" data-display="versions"> </p>
  302 + <p class="form-control-static" data-display="brancheCompany"> </p>
358 303 </div>
359 304 </div>
360   -
361   - <div class="form-group">
362   - <label class="control-label col-md-3">是否撤销:</label>
  305 + <div class="form-group">
  306 + <label class="control-label col-md-3">版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
363 307 <div class="col-md-4">
364   - <p class="form-control-static" data-display="destroy"> </p>
  308 + <p class="form-control-static" data-display="versions"> </p>
365 309 </div>
366 310 </div>
367   -
368 311 <div class="form-group">
369   - <label class="control-label col-md-3">描述/说明:</label>
  312 + <label class="control-label col-md-3">描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
370 313 <div class="col-md-4">
371 314 <p class="form-control-static" data-display="descriptions"> </p>
372 315 </div>
373 316 </div>
374   -
375 317 </div>
376 318 </div>
377 319 </div>
378   -
379 320 <div class="form-actions">
380 321 <div class="row">
381 322 <div class="col-md-offset-3 col-md-9">
... ... @@ -390,26 +331,18 @@
390 331 </div>
391 332 </div>
392 333 </div>
393   -
394 334 </div>
395 335 </form>
396   -
397 336 <!-- END FORM-->
398   -
399 337 </div>
400 338 </div>
401   -
402 339 <!-- 函数方法JS类库 -->
403 340 <script src="/pages/base/carpark/js/add-input-function.js"></script>
404   -
405 341 <!-- 表单向导JS类库 -->
406 342 <script src="/pages/base/carpark/js/add-form-wizard.js"></script>
407   -
  343 +<!-- reload事件 -->
  344 +<script src="/pages/base/carpark/js/add-form-reload.js"></script>
408 345 <!-- 地图JS类库 -->
409 346 <script src="/pages/base/carpark/js/add-vmap-world.js"></script>
410   -
411 347 <!-- 表单元素事件JS类库 -->
412   -<script src="/pages/base/carpark/js/add-form-events.js"></script>
413   -
414   -<!-- reload事件 -->
415   -<script src="/pages/base/carpark/js/add-form-reload.js"></script>
416 348 \ No newline at end of file
  349 +<script src="/pages/base/carpark/js/add-form-events.js"></script>
417 350 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/css/carpark-add.css
  1 +body {
  2 + overflow-x: hidden;
  3 +}
  4 +
1 5 .leftUtils{
2 6 position: absolute;
3 7 padding-right: 100px;
... ...
src/main/resources/static/pages/base/carpark/css/positions.css
... ... @@ -21,7 +21,7 @@ html,body{
21 21 }
22 22  
23 23  
24   -.leftUtils{
  24 +.leftUtils, .drwmageUtils{
25 25 position: absolute;
26 26 padding-right: 100px;
27 27 width: 100%;
... ... @@ -29,6 +29,7 @@ html,body{
29 29 z-index: 9999;
30 30 padding-top: 7px;
31 31 top: 20px;
  32 + display: none;
32 33 }
33 34  
34 35 .BMap_pop div:nth-child(1) ,
... ...
src/main/resources/static/pages/base/carpark/edit.html
1 1 <!-- 编辑停车场 -->
2 2 <div class="modal fade" id="editPoitsions_carpark_mobal" tabindex="-1" role="basic" aria-hidden="true">
3   -
4 3 <div class="modal-dialog">
5   -
6 4 <div class="modal-content">
7   -
8 5 <div class="modal-header">
9 6 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
10   - <h4 class="modal-title">编辑站点</h4>
  7 + <h4 class="modal-title">编辑停车场</h4>
11 8 </div>
12   -
13 9 <div class="modal-body">
14 10  
15 11 <form class="form-horizontal" role="form" id="edit_carPark_form" action="/module" method="post">
... ... @@ -17,80 +13,81 @@
17 13 <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button>
18 14 您的输入有误,请检查下面的输入项
19 15 </div>
20   -
21 16 <input type="hidden" name="id" id="idInput" />
22   -
23 17 <input type="hidden" name="bParkPoint" id="bParkPointInput" />
24   -
25 18 <input type="hidden" name="gParkPoint" id="gParkPointInput" />
26   -
27 19 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
28   -
29 20 <!-- 停车场名称 -->
30 21 <div class="form-body">
31 22 <div class="form-group">
32 23 <label class="control-label col-md-3">
33   - <span class="required"> * </span> 停车场名称
  24 + <span class="required"> * </span> 停车场名称&nbsp;&nbsp;&nbsp; :
34 25 </label>
35 26 <div class="col-md-6">
36   - <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="站点名称">
  27 + <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="请输入停车场名称">
37 28 </div>
38 29 </div>
39 30 </div>
40   -
41 31 <!-- 停车场编码 -->
42 32 <div class="form-body">
43 33 <div class="form-group">
44 34 <label class="control-label col-md-3">
45   - <span class="required"> * </span>停车场编码
  35 + <span class="required"> * </span>停车场编码&nbsp;&nbsp;&nbsp;:
46 36 </label>
47 37 <div class="col-md-6">
48   - <input type="text" class="form-control" name="parkCode" id="parkCodeInput">
  38 + <input type="text" class="form-control" name="parkCode" id="parkCodeInput" readonly="readonly" placeholder="请输入停车场编码">
49 39 </div>
50 40 </div>
51 41 </div>
52   -
53   - <!-- 中心位置坐标点 -->
  42 + <!-- 经纬度坐标点 -->
54 43 <div class="form-body">
55 44 <div class="form-group">
56   - <label class="col-md-3 control-label">经纬度坐标点:</label>
  45 + <label class="col-md-3 control-label"><span class="required"> * </span>经纬度坐标点:</label>
57 46 <div class="col-md-6">
58   - <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput">
  47 + <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput" readonly="readonly" placeholder="请输入经纬度坐标点">
59 48 </div>
60 49 </div>
61 50 </div>
62 51  
63   - <!-- 范围图形类型 -->
  52 + <!-- 几何图形类型 -->
64 53 <div class="form-body">
65 54 <div class="form-group">
66   - <label class="col-md-3 control-label">范围图形类型:</label>
  55 + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label>
67 56 <div class="col-md-6">
68   - <select name="shapesType" class="form-control" id="shapesTypeSelect">
69   - <option value="">-- 请选择站点类型 --</option>
70   - <option value="r">圆形</option>
71   - <option value="d">多变形</option>
72   - </select>
  57 + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" readonly="readonly" placeholder="请输入几何图形类型">
73 58 </div>
74 59 </div>
75 60 </div>
76 61  
77 62 <!-- 圆形半径 -->
  63 + <div class="form-body" id="radiusGroup">
  64 + <div class="form-group">
  65 + <label class="col-md-3 control-label"><span class="required"> * </span>圆形半径&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  66 + <div class="col-md-6">
  67 + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="请输入圆形半径">
  68 + </div>
  69 + </div>
  70 + </div>
  71 + <!-- 是否撤销 -->
78 72 <div class="form-body">
79 73 <div class="form-group">
80   - <label class="col-md-3 control-label">圆形半径:</label>
  74 + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
81 75 <div class="col-md-6">
82   - <input type="text" class="form-control" name="radius" id="radiusInput" >
  76 + <select name="destroy" class="form-control" id="destroySelect">
  77 + <option value="">-- 请选择撤销类型 --</option>
  78 + <option value="0">否</option>
  79 + <option value="1">是</option>
  80 + </select>
83 81 </div>
84 82 </div>
85 83 </div>
86   -
87 84 <!-- 面积 -->
88 85 <div class="form-body">
89 86 <div class="form-group">
90   - <label class="col-md-3 control-label">面积</label>
  87 + <label class="col-md-3 control-label">面积&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
91 88 <div class="col-md-6">
92 89 <input type="text" class="form-control" name="area" id="areaInput" >
93   - <span class="help-block">单位:平方米</span>
  90 + <span class="help-block">单位:平方米(㎡)</span>
94 91 </div>
95 92 </div>
96 93 </div>
... ... @@ -98,7 +95,7 @@
98 95 <!-- 所属公司 -->
99 96 <div class="form-body">
100 97 <div class="form-group">
101   - <label class="col-md-3 control-label">所属公司</label>
  98 + <label class="col-md-3 control-label">所属公司&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
102 99 <div class="col-md-6">
103 100 <select name="company" class="form-control" style="width:100%" id="companySelect">
104 101  
... ... @@ -106,47 +103,33 @@
106 103 </div>
107 104 </div>
108 105 </div>
109   -
  106 +
110 107 <!-- 所属分公司 -->
111   - <!-- <div class="form-body">
  108 + <div class="form-body">
112 109 <div class="form-group">
113   - <label class="col-md-3 control-label">所属分公司</label>
  110 + <label class="col-md-3 control-label">所属分公司&nbsp;&nbsp;&nbsp;:</label>
114 111 <div class="col-md-6">
115 112 <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect">
116 113 </select>
117 114 </div>
118 115 </div>
119   - </div> -->
120   -
121   - <!-- 版本号 -->
122   - <div class="form-body">
123   - <div class="form-group">
124   - <label class="col-md-3 control-label">版本号:</label>
125   - <div class="col-md-6">
126   - <input type="text" class="form-control" name="versions" value='1' Readonly>
127   - </div>
128   - </div>
129 116 </div>
130 117  
131   - <!-- 范围图形类型 -->
  118 + <!-- 版本号 -->
132 119 <div class="form-body">
133 120 <div class="form-group">
134   - <label class="col-md-3 control-label">是否撤销:</label>
  121 + <label class="col-md-3 control-label">版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
135 122 <div class="col-md-6">
136   - <select name="destroy" class="form-control" id="destroySelect">
137   - <option value="">-- 请选择撤销类型 --</option>
138   - <option value="0">否</option>
139   - <option value="1">是</option>
140   - </select>
  123 + <input type="text" class="form-control" name="versions" value='1' Readonly placeholder="请输入版本号">
141 124 </div>
142 125 </div>
143 126 </div>
144 127  
145 128 <!-- 描述/说明 -->
146 129 <div class="form-group">
147   - <label class="control-label col-md-3"> 描述/说明 </label>
  130 + <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
148 131 <div class="col-md-6">
149   - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
  132 + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="请输入描述/说明"></textarea>
150 133 </div>
151 134 </div>
152 135 </form>
... ... @@ -161,105 +144,67 @@
161 144 <script type="text/javascript">
162 145  
163 146 $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fun,carP,ajaxd){
164   -
165 147 /** 获取停车场信息对象 */
166 148 var CarParkObj = carP.getEitdCarPark();
167   -
168 149 // 获取修改停车场对象ID
169 150 var carParkId = CarParkObj.carParkId;
170   -
171   - /** 根据修改停车场对象属性值 设值表单元素 @paran:<CarParkObj:停车场对象>*/
  151 + /** 根据修改停车场对象属性值 设值表单元素 @paran:<CarParkObj:停车场对象>*/
172 152 fun.setFormValue(CarParkObj);
173   -
174 153 /** 填充公司下拉框 */
175 154 fun.selectTemp(function() {
176   -
177 155 // 获取公司代码
178 156 var businessCode = CarParkObj.carParkCompany;
179   -
180 157 // 获取公司元素并设值
181 158 $('#companySelect').val(businessCode);
182   -
183   - /** 填充分公司下拉框 @param:<businessCode:公司代码> */
184   - /* fun.getbrancheCompanyValues(businessCode,function() {
185   -
  159 + /** 填充分公司下拉框 @param:<businessCode:公司代码> */
  160 + fun.getbrancheCompanyValues(businessCode,function() {
186 161 // 获取分公司元素并设值
187 162 $('#brancheCompanySelect').val(CarParkObj.carParkBrancheCompany);
188   -
189   - }); */
190   -
  163 + });
191 164 });
192   -
193 165 // 公司值改变事件
194   - // $('#companySelect').on('change',companySelectChangeSetBrancheValue);
195   -
  166 + $('#companySelect').on('change',companySelectChangeSetBrancheValue);
196 167 function companySelectChangeSetBrancheValue() {
197   -
198 168 // 获取公司下拉框选择值
199 169 var businessCode = $('#companySelect').val();
200   -
201 170 // 分公司下拉框options属性值
202 171 var options = '<option value="">-- 请选择分公司 --</option>';
203   -
204 172 // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码
205 173 if(businessCode == null || businessCode ==''){
206   -
207 174 // 填充分公司下拉框options
208 175 $('#brancheCompanySelect').html(options);
209   -
210 176 } else {
211   -
212 177 // 查询出所属公司下的分公司名称和相应分公司代码
213 178 $get('/business/all', {upCode_eq: businessCode}, function(array){
214   -
215 179 // 遍历array
216 180 $.each(array, function(i,d){
217   -
218 181 options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
219   -
220 182 });
221   -
222 183 // 填充分公司下拉框options
223 184 $('#brancheCompanySelect').html(options);
224   -
225 185 });
226 186 }
227 187 }
228   -
229 188 // 显示mobal
230 189 $('#editPoitsions_carpark_mobal').modal({show : true,backdrop: 'static',keyboard: false});
231   -
232 190 // 当调用 hide 实例方法时触发
233 191 $('#editPoitsions_carpark_mobal').on('hide.bs.modal', function () {
234   -
235 192 clearSechear();
236   -
237 193 });
238   -
239 194 function clearSechear(){
240   -
241 195 map.clearMarkAndOverlays();
242   -
243 196 carP.setEitdCarPark({});
244   -
245 197 fun.initCarPark(carParkId);
246   -
247 198 }
248   -
249 199 // 编辑表单元素
250 200 var form = $('#edit_carPark_form');
251   -
252 201 // 获取错误提示元素
253 202 var error = $('.alert-danger', form);
254   -
255 203 // 提交数据按钮事件
256 204 $('#editStationButton').on('click', function() {
257   -
258 205 // 表单提交
259 206 form.submit();
260   -
261 207 });
262   -
263 208 // 表单验证
264 209 form.validate({
265 210  
... ... @@ -270,80 +215,52 @@ $(&#39;#editPoitsions_carpark_mobal&#39;).on(&#39;editCarParkMobal_show&#39;, function(e, map,fu
270 215 focusInvalid : false,
271 216  
272 217 rules : {
273   -
274   - // 停车场名称
275   - 'parkName' : {
276   -
277   - // 必填项
278   - required : true
279   -
280   - }
281   -
  218 + 'parkName' : {required : true,},// 停车场名称 必填项
  219 + 'parkCode' : {required : true},// 停车场编码 必填项
  220 + 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项
  221 + 'shapesType' : {required : true,},// 几何图形类型 必填项
  222 + 'radius' : {required : true,digits:true},// 圆形半径 必填项
  223 + 'destroy' : {required : true,},// 是否撤销 必填项
  224 + 'area' : {number:true,},// 面积 数字
  225 + 'descriptions' : {maxlength: 200,},// 描述/说明 最大长度200
282 226 },
283   -
284 227 invalidHandler : function(event, validator) {
285   -
286 228 error.show();
287   -
288 229 App.scrollTo(error, -200);
289   -
290 230 },
291   -
292 231 highlight : function(element) {
293   -
294 232 $(element).closest('.form-group').addClass('has-error');
295   -
296 233 },
297   -
298 234 unhighlight : function(element) {
299   -
300 235 $(element).closest('.form-group').removeClass('has-error');
301   -
302 236 },
303   -
304 237 success : function(label) {
305   -
306 238 label.closest('.form-group').removeClass('has-error');
307   -
308 239 },
309   -
310 240 submitHandler : function(f) {
311   -
312 241 var params = form.serializeJSON();
313   -
314 242 params.createBy = CarParkObj.carParkCreateBy;
315   -
316 243 // 定义日期格式
317 244 var fs = 'YYYY-MM-DD HH:mm:ss'
318   -
319 245 // 设置日期
320 246 params.createDate = moment(CarParkObj.carParkCreateDate).format(fs);
321   -
322 247 error.hide();
323   -
  248 + if(params.shapesType=='多边形')
  249 + params.shapesType = 'd';
  250 + else if(params.shapesType=='圆形')
  251 + params.shapesType=='r';
324 252 ajaxd.carParkUpdate(params,function(resuntDate) {
325   -
326 253 if(resuntDate.status=='SUCCESS') {
327   -
328 254 // 弹出添加成功提示消息
329 255 layer.msg('修改成功...');
330   -
331   -
332 256 }else {
333   -
334 257 // 弹出添加失败提示消息
335 258 layer.msg('修改失败...');
336   -
337 259 }
338   -
339 260 clearSechear();
340   -
341 261 $('#editPoitsions_carpark_mobal').modal('hide');
342   -
343 262 })
344   -
345 263 }
346 264 });
347   -
348 265 });
349 266 </script>
350 267 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/edit_select.html
... ... @@ -3,36 +3,33 @@
3 3  
4 4 <div class="modal-dialog">
5 5  
6   - <div class="modal-content">
  6 + <div class="modal-content" style="width:700px">
7 7  
8 8 <div class="modal-header">
9 9 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
10   - <h4 class="modal-title">选择修改停车场方式</h4>
  10 + <h4 class="modal-title">选择修改停车场方式
  11 + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i>
  12 + </h4>
11 13 </div>
12 14  
13 15 <div class="modal-body">
14   -
15 16 <form class="form-horizontal" action="/" method="post" id="edit_select" role="form">
16   -
17 17 <div class="alert alert-danger display-hide" id="editSelectrequired">
18 18 <button class="close" data-close="alert"></button>
19   - 站点名称为必填项
  19 + 停车场名称为必填项
20 20 </div>
21   -
22 21 <div class="alert alert-danger display-hide" id="serchrname">
23 22 <button class="close" data-close="alert"></button>
24 23 系统无法生成,请选择其他方式新增
25 24 </div>
26   -
27 25 <div class="form-group" id="formRequ">
28 26 <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label>
29 27 <div class="col-md-9" id="errorInfo">
30 28 <input type="text" class="form-control input-medium" id="carParkNameboxInput" name="carParkNamebox">
31 29 </div>
32 30 </div>
33   -
34 31 <div class="form-group">
35   - <label class="col-md-3 control-label">修改方式:</label>
  32 + <label class="col-md-3 control-label"><span class="required"> * </span>修改方式&nbsp;&nbsp;&nbsp;:</label>
36 33 <div class="col-md-9">
37 34 <div class="icheck-list">
38 35 <label>
... ... @@ -44,13 +41,6 @@
44 41 </div>
45 42 </div>
46 43 </div>
47   - <div class="form-group">
48   - <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50">
49   - <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 修改方式说明: </span></h5>
50   - <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span> </p>
51   - <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p>
52   - </div>
53   - </div>
54 44 </form>
55 45 </div>
56 46 <div class="modal-footer">
... ... @@ -61,118 +51,108 @@
61 51 </div>
62 52 </div>
63 53 <script type="text/javascript">
64   -
65 54 $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,fun,carParkE,ajaxd){
66   -
67 55 // 显示选择修改方式弹出层
68 56 $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false});
69   -
  57 + /* $('.tipso-animation').tipso({
  58 + speed : 100,
  59 + background : '#0ed0e8',
  60 + color : '#ffffff',
  61 + position :'right',
  62 + width : 390,
  63 + delay : 400,
  64 + animationIn : 'bounceIn',
  65 + animationOut : 'bounceOut',
  66 + offsetX : -485,
  67 + offsetY : -25,
  68 + content :'<span style="display:block; float:left;font-size:x-small;line-height:12px">A)手动规划:手动在地图上画出停车场范围,然后双击鼠标右键保存.</span></br>'+
  69 + '<span style="display:block; float:left;font-size:x-small">B)重新编辑:编辑原始位置与站点信息.</span>',
  70 +
  71 + });
  72 + setTimeout(function(){
  73 + $('.tipso-animation').tipso('show');
  74 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  75 + },500); */
  76 + setTimeout(function(){
  77 + var offsetY = $('.modal-dialog').offset().top-3 ,
  78 + offsetX = $('.modal-dialog').offset().left-10 ;
  79 + $('.tipso-animation').tipso({
  80 + speed : 100,
  81 + background : '#0ed0e8',
  82 + color : '#ffffff',
  83 + position :'right',
  84 + width : 390,
  85 + delay : 400,
  86 + animationIn : 'bounceIn',
  87 + animationOut : 'bounceOut',
  88 + offsetX : -(offsetX),
  89 + offsetY : -(offsetY),
  90 + content :'<span style="display:block; float:left;font-size:x-small;line-height:12px">A)手动规划:手动在地图上画出停车场范围,然后双击鼠标右键保存.</span></br>'+
  91 + '<span style="display:block; float:left;font-size:x-small">B)重新编辑:编辑原始位置与站点信息.</span>',
  92 +
  93 + });
  94 + $('.tipso-animation').tipso('show');
  95 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  96 + },500);
70 97 var carParkObj = carParkE.getEitdCarPark();
71   -
72 98 // 获取停车场名称元素并赋值
73 99 $('#carParkNameboxInput').val(carParkObj.carParkName);
74   -
75 100 // 定义停车场图形类型
76 101 var stationShapesTypeV = carParkObj.carParkShapesType;
77   -
78 102 // 获取表单元素
79 103 var form = $('#edit_select');
80   -
81 104 // 获取错误提示元素
82 105 var editSelectrequired = $('#editSelectrequired', form);
83   -
84 106 // 下一步操作事件
85 107 $('#editselectStationNextButton').on('click', function() {
86   -
87 108 // 表单提交
88 109 form.submit();
89   -
90 110 });
91   -
92 111 //form 表单验证
93 112 form.validate({
94   -
95 113 errorElement : 'span',
96   -
97 114 errorClass : 'help-block help-block-error',
98   -
99 115 focusInvalid : false,
100   -
101 116 rules : {
102   -
103   - 'carParkNamebox' : {
104   -
105   - required : true,
106   -
107   - }
108   -
  117 + 'carParkNamebox' : {required : true,}
109 118 },
110   -
111 119 invalidHandler : function(event, validator) {
112   -
113 120 editSelectrequired.show();
114   -
115 121 App.scrollTo(requiredname, -200);
116   -
117 122 },
118 123  
119 124 highlight : function(element) {
120   -
121 125 $(element).closest('.form-group').addClass('has-error');
122   -
123 126 },
124   -
125 127 unhighlight : function(element) {
126   -
127 128 $(element).closest('.form-group').removeClass('has-error');
128   -
129 129 },
130   -
131 130 success : function(label) {
132   -
133 131 label.closest('.form-group').removeClass('has-error');
134   -
135 132 },
136   -
137 133 submitHandler : function(f) {
138   -
139 134 // 隐藏弹出层
140 135 $('#editPositions_select_mobal').modal('hide');
141   -
142 136 $('#eidt').attr("disabled",true);
143   -  
144 137 $('#eidt').addClass('btn disabled');
145   -
146 138 // 表单序列
147 139 var params = form.serializeJSON();
148   -
149 140 // 停车场名称
150 141 var editStationName = params.carParkNamebox;
151   -
152 142 var eidtselect_ = params.editselect;
153   -
154 143 // 设置停车场名称
155 144 carParkE.setEitdCarParkName(editStationName);
156   -
157 145 if(eidtselect_==0){
158   -
159 146 map.localSearchFromAdreesToPoint(editStationName);
160   -
161 147 map.openDrawingManager();
162   -
163 148 }else if(eidtselect_==1){
164   -
165 149 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
166 150 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
167 151 shift: 0,time: 10000});
168   -
169 152 // 编辑图形
170 153 map.editShapes(stationShapesTypeV,mindex);
171   -
172 154 }
173   -
174 155 }
175 156 });
176   -
177 157 });
178 158 </script>
179 159 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/add-form-events.js
1 1 $(function(){
2   -
3   - // 提交
4   - $('.button-submit').on('click',function() {
5   -
6   - // 获取表单
7   - var formSubm = $('#submit_carpark_form');
8   -
9   - formSubm.submit();
10   -
11   - });
  2 + // 获取表单 提交
  3 + $('.button-submit').on('click',function() {$('#submit_carpark_form').submit();});
12 4  
13 5 $('#oppenDrawingManager').on('click',function() {
14   -
15 6 addCarParkVmapWorlds.drawingManagerOpen();
16   -
17 7 });
18   -
19 8 $('#closeDrawingManager').on('click',function() {
20   -
21 9 addCarParkVmapWorlds.drawingManagerClose();
22   -
23 10 });
24   -
25 11 });
26 12 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/add-form-reload.js
... ... @@ -13,93 +13,66 @@
13 13 */
14 14  
15 15 (function(){
16   -
17 16 // 关闭左侧栏
18   - if (!$('body').hasClass('page-sidebar-closed')) {
19   -
20   - $('.menu-toggler.sidebar-toggler').click();
21   -
22   - }
23   -
  17 + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
24 18 setTimeout(function(){
25   -
  19 + $('.tipso-animation').tipso({
  20 + speed : 100,
  21 + background : '#0ed0e8',
  22 + color : '#ffffff',
  23 + position :'right',
  24 + width : 410,
  25 + delay : 400,
  26 + animationIn : 'bounceIn',
  27 + animationOut : 'bounceOut',
  28 + offsetX : 12,
  29 + offsetY : -70,
  30 + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据停车场名称自动生成以100米为半径范围的圆.</span></br>'+
  31 + '<span style="display:block; float:left;font-size:x-small;">B)手动绘制:手动在地图上画出停车场范围,然后双击鼠标右键保存.</span>',
  32 +
  33 + });
  34 + $('.tipso-animation').tipso('show');
  35 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
26 36 FormWizard.init();
27   -
28   - mapB = addCarParkVmapWorlds.init();
29   -
30 37 PublicFunctions.getCarParkCode(function(d) {
31   -
32 38 $('#parkCodeInput').val(d.carParkCode);
33   -
34 39 });
35   -
36 40 $('#destroySelect').val('0');
37   -
38 41 PublicFunctions.getBusinessAllInfo(function(array) {
39   -
40 42 var opGroup = '<option value="">请选择...</option><optgroup label="公司">';
41   -
42 43 var len_ = array.length;
43   -
44 44 if(len_>0) {
45   -
46 45 $.each(array, function(i, g){
47   -
48 46 opGroup += '<option value="'+g.businessCode+'">'+g.businessName+'</option>';
49   -
50 47 });
51   -
52 48 }
53   -
54 49 opGroup += '</optgroup>';
55   -
56 50 $('#companySelect').html(opGroup).select2();
57   -
58 51 });
59   -
60   - /*var htm = '<option value="">请选择...</option><optgroup label="公司">';
61   -
  52 + var htm = '<option value="">请选择...</option><optgroup label="分公司">';
62 53 $('#brancheCompanySelect').html(htm).select2();
63   -
64 54 $('#companySelect').on("change", function (e) {
65   -
66 55 // 获取公司下拉框选择值
67 56 var businessCode = $('#companySelect').val();
68   -
69 57 // 分公司下拉框options属性值
70 58 var options = '<option value="">请选择...</option><optgroup label="分公司">';
71   -
72 59 // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码
73 60 if(businessCode == null || businessCode ==''){
74   -
75 61 options += '</optgroup>';
76   -
77 62 // 填充分公司下拉框options
78 63 $('#brancheCompanySelect').html(options).select2();
79   -
80 64 } else {
81   -
82 65 // 查询出所属公司下的分公司名称和相应分公司代码
83 66 $get('/business/all', {upCode_eq: businessCode}, function(array){
84   -
85 67 // 遍历array
86 68 $.each(array, function(i,d){
87   -
88 69 options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
89   -
90 70 options += '</optgroup>';
91   -
92 71 });
93   -
94 72 // 填充分公司下拉框options
95 73 $('#brancheCompanySelect').html(options).select2();
96   -
97 74 });
98 75 }
99   -
100 76 });
101   - */
102   -
103   - }, 500);
104   -
  77 + }, 300);
105 78 })();
106 79 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
1   -
2 1 /**
3 2 * 表单的导航向导、验证、提交
4 3 *
5 4 */
6   -
7 5 var FormWizard = function() {
8   -
9 6 return {
10   -
11 7 // 启动初始化向导导航
12 8 init : function() {
13   -
14   - if(!jQuery().bootstrapWizard) {
15   -
16   - return;
17   -
18   - }
19   -
  9 + if(!jQuery().bootstrapWizard) {return;}
20 10 // 定义表单
21 11 var form = $('#submit_carpark_form');
22   -
23 12 // 定义表单异常
24 13 var error = $('.alert-danger',form);
25   -
26 14 // 定义表单成功
27 15 var success = $('.alert-success',form);
28   -
29 16 // 表单验证
30 17 form.validate({
31   -
32 18 // 错误提示元素span对象
33 19 errorElement : 'span',
34   -
35 20 // 错误提示元素class名称
36 21 errorClass : 'help-block help-block-error',
37   -
38 22 // 验证错误获取焦点
39 23 focusInvalid : true,
40   -
41 24 // 需要验证的表单元素
42 25 rules : {
43   -
44   - // 停车场名称
45   - 'parkNamebooxt' : {
46   -
47   - // 必填项
48   - required : true,
49   -
50   - },
51   -
52   - // 停车场名称
53   - 'parkName' : {
54   -
55   - // 必填项
56   - required : true,
57   -
58   - },
59   -
60   - // 停车场编码
61   - 'parkCode' : {
62   -
63   - // 必填项
64   - required : true,
65   - },
66   -
67   - // 中心点坐标
68   - 'bCenterPoint' : {
69   -
70   - // 必填项
71   - required : true,
72   -
73   - },
74   -
75   - // 图形类型
76   - 'shapesType' : {
77   -
78   - // 必填项
79   - required : true,
80   - },
81   -
82   - // 所属分公司
83   - /*'brancheCompany' : {
84   -
85   - // 必填项
86   - required : true,
87   - }*/
88   -
89   -
  26 + 'parkNamebooxt' : {required : true,},// 停车场名称 必填项
  27 + 'parkName' : {required : true,},// 停车场名称 必填项
  28 + 'parkCode' : {required : true,alnum:true, remote : {
  29 + type : "get",// 异步发送请求到服务器,验证parkCode
  30 + url : "/carpark/isHaveParkCode",//需要服务器controllor 中提供停车场编码检查的方法
  31 + cache:false,
  32 + async:false,
  33 + data : {'parkCode' : function() { return $("#parkCodeInput").val(); }},
  34 + }},// 停车场编码 必填项
  35 + 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项
  36 + 'shapesType' : {required : true,},// 几何图形类型 必填项
  37 + 'radius' : {required : true,digits:true},// 圆形半径 必填项
  38 + 'destroy' : {required : true,},// 是否撤销 必填项
  39 + 'area' : {number:true,},// 面积 数字
  40 + 'descriptions' : {maxlength: 200,},// 描述/说明 最大长度200
  41 + },
  42 + messages:{
  43 + 'parkCode':{remote:'停车场编码系统已存在,请您重新输入!',},
90 44 },
91   -
92 45 /**
93 46 * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。
94 47 *
95 48 * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator)
96 49 */
97 50 invalidHandler : function(event, validator) {
98   -
99 51 // 显示表单未通过提示信息
100 52 error.show();
101   -
102 53 // 把提示信息放到指定的位置。
103 54 App.scrollTo(error, -200);
104 55 },
105   -
106 56 /**
107 57 * 类型:Callback。
108 58 *
109 59 * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。
110 60 */
111 61 highlight : function(element) {
112   -
113 62 // 添加errorClass("has-error")到表单元素
114 63 $(element).closest('.form-group').addClass('has-error');
115 64 },
116   -
117 65 /**
118 66 * 类型:Callback。
119 67 *
120 68 * 默认:移除errorClass("has-error")。与highlight操作相反
121 69 */
122 70 unhighlight : function(element) {
123   -
124 71 // 移除errorClass("has-error")
125 72 $(element).closest('.form-group').removeClass('has-error');
126 73 },
127   -
128 74 /**
129 75 * 类型:String,Callback。
130 76 *
... ... @@ -135,176 +81,146 @@ var FormWizard = function() {
135 81 * 如果是一个回调函数,则将标签作为其唯一的参数。
136 82 */
137 83 success : function(label) {
138   -
139 84 // 当验证通过时,移除errorClass("has-error")
140 85 label.closest('.form-group').removeClass('has-error');
141 86 },
142   -
143 87 /**
144 88 * 类型:Callback。
145 89 *
146 90 * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form
147 91 */
148 92 submitHandler : function(f) {
149   -
150 93 // 表单序列化
151 94 var params = form.serializeJSON();
152   -
  95 + if(params.shapesType=='圆形')
  96 + params.shapesType='r';
  97 + else if(params.shapesType=='多边形')
  98 + params.shapesType='d';
153 99 //保存站点
154 100 PublicFunctions.carParkSave(params,function(data) {
155   -
156 101 if(data.status=='SUCCESS') {
157   -
158 102 // 弹出添加成功提示消息
159 103 layer.msg('添加成功...');
160   -
161   -
162 104 }else {
163   -
164 105 // 弹出添加失败提示消息
165 106 layer.msg('添加失败...');
166   -
167 107 }
168   -
169 108 // 返回list.html页面
170 109 loadPage('/pages/base/carpark/list.html');
171   -
172 110 });
173   -
174 111 }
175 112 });
  113 + $.validator.addMethod("alnum", function(value, element) {
  114 + return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value);
  115 + }, "停车场编码只能包括英文字母和数字,请您重新输入!");
  116 +
  117 + /*$.validator.addMethod("isHave", function(value, element) {
  118 + PublicFunctions.isHaveParkCode({'parkCode':value},function(d) {
  119 + debugger;
  120 + console.log(d);
  121 + if(d.length>0)
  122 + return false;
  123 + else
  124 + return true;
  125 + });
  126 + }, "停车场编码系统已存在,请您重新输入!");*/
176 127  
177 128 // 确认提交信息
178 129 var displayConfirm = function() {
179   -
180 130 // 遍历表单元素下的tab4的class名称为form-control-static
181 131 $('#tab4 .form-control-static', form).each(function(){
182   -
183 132 // 定义input
184 133 var input = $('[name="'+$(this).attr("data-display")+'"]', form);
185   -
186 134 if (input.is(":radio")) {
187   -
188 135 input = $('[name="'+$(this).attr("data-display")+'"]:checked', form);
189   -
190 136 }
191 137 if (input.is(":text") || input.is("textarea")) {
192   -
193 138 $(this).html(input.val());
194   -
195 139 } else if (input.is("select")) {
196   -
197 140 $(this).html(input.find('option:selected').text());
198   -
199 141 } else if (input.is(":radio") && input.is(":checked")) {
200   -
201 142 $(this).html(input.attr("data-title"));
202   -
203 143 } else if ($(this).attr("data-display") == 'payment[]') {
204   -
205 144 var payment = [];
206   -
207 145 $('[name="payment[]"]:checked', form).each(function(){
208   -
209 146 payment.push($(this).attr('data-title'));
210   -
211 147 });
212   -
213 148 $(this).html(payment.join("<br>"));
214 149 }
215 150 });
216 151 }
217   -
218 152 /** 按钮点击时触发 */
219 153 var handleTitle = function(tab, navigation, index) {
220   -
221 154 // 定义导航条标签个数
222 155 var total = navigation.find('li').length;
223   -
224 156 // 当前标签页
225 157 var current = index + 1;
226   -
227 158 // 设置向导标题
228 159 $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total);
229   -
230 160 // 删除"done"样式
231 161 jQuery('li', $('#form-wizard-info')).removeClass("done");
232   -
233 162 // 获取导航标签元素集合
234 163 var li_list = navigation.find('li');
235   -
236 164 // 遍历
237 165 for (var i = 0; i < index; i++) {
238   -
239 166 // 追加done样式
240 167 jQuery(li_list[i]).addClass("done");
241   -
242 168 }
243   -
244   -
245 169 /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */
246 170 if (current == 1) {
247   -
248 171 // 隐藏返回按钮
249 172 $('#submit_carpark_form').find('.button-previous').hide();
250   -
251 173 } else {
252   -
253 174 // 显示返回按钮
254 175 $('#submit_carpark_form').find('.button-previous').show();
255   -
256 176 }
257   -
258 177 if (current == 2) {
259   -
260   - // 获取新增方式值
261   - var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val();
262   -
263   - // 获取停车场名称值
264   - var stationNameV = $('#parkNamebooxtInput').val();
265   -
266   - // 设置停车场名称
267   - $('#parkNameInput').val(stationNameV);
268   -
269   - if(baseResValue == 0) {
270   -
271   - $('.leftUtils').hide();
272   -
273   - addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {
274   -
275   - if(p) {
276   -
277   - addCarParkVmapWorlds.pointsCircle(p);
278   -
279   - }
280   -
281   - });
282   -
283   - }else if(baseResValue ==1) {
284   -
285   - addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {});
286   -
287   - $('.leftUtils').show();
288   -
289   - addCarParkVmapWorlds.drawingManagerOpen();
290   -
291   - }
  178 + layer.closeAll();
  179 + var container = $("#addCarParkbmap_basic");
  180 + container.children().remove();
  181 + container.show();
  182 + setTimeout(function(){
  183 + addCarParkVmapWorlds.init();
  184 + // 获取新增方式值
  185 + var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val();
  186 + // 获取停车场名称值
  187 + var stationNameV = $('#parkNamebooxtInput').val();
  188 + // 设置停车场名称
  189 + $('#parkNameInput').val(stationNameV);
  190 + if(baseResValue == 0) {
  191 + $('.leftUtils').hide();
  192 + addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {
  193 + if(p) {
  194 + addCarParkVmapWorlds.pointsCircle(p);
  195 + }
  196 + });
  197 + }else if(baseResValue ==1) {
  198 + addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {});
  199 + $('.leftUtils').show();
  200 + addCarParkVmapWorlds.drawingManagerOpen();
  201 + }
  202 + $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500);
  203 + },300)
  204 + }else if(current==3) {
  205 + setTimeout(function(){
  206 + $('html,body').animate({scrollTop: ($('#tab3').offset().top-70) + "px"});
  207 + layer.tips('停车场编码一旦确认提交就不能够轻易的去修改了哦:-O', '#parkCodeInput', {tips: [2, '#0ed0e8'],time: 4500,area: ['340px', '32px'],});
  208 + },300);
  209 + }else if(current==4) {
  210 + layer.closeAll();
  211 + setTimeout(function(){
  212 + $('html,body').animate({scrollTop: ($('#tab4').offset().top+40) + "px"});
  213 + },300);
292 214 }
293   -
294 215 /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */
295 216 if (current >= total) {
296   -
297 217 // 隐藏下一步按钮
298 218 $('#submit_carpark_form').find('.button-next').hide();
299   -
300 219 // 显示提交按钮
301 220 $('#submit_carpark_form').find('.button-submit').show();
302   -
303 221 // 确认提交信息
304 222 displayConfirm();
305   -
306 223 } else {
307   -
308 224 // 显示下一步按钮
309 225 $('#submit_carpark_form').find('.button-next').show();
310 226  
... ... @@ -312,106 +228,59 @@ var FormWizard = function() {
312 228 $('#submit_carpark_form').find('.button-submit').hide();
313 229  
314 230 }
315   -
316 231 // 移动到指定位置
317 232 App.scrollTo($('.page-title'));
318   -
319 233 }
320   -
321 234 // 表单导航向导插件
322 235 $('#submit_carpark_form').bootstrapWizard({
323   -
324 236 // 下一步元素选择器
325 237 'nextSelector': '.button-next',
326   -
327 238 // 返回元素选择器
328 239 'previousSelector': '.button-previous',
329   -
330 240 /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */
331 241 onTabClick: function (tab, navigation, index, clickedIndex) {
332   -
333 242 return false;
334   -
335 243 success.hide();
336   -
337 244 error.hide();
338   -
339 245 if (form.valid() == false) {
340   -
341 246 return false;
342   -
343 247 }
344   -
345 248 handleTitle(tab, navigation, clickedIndex);
346   -
347 249 },
348   -
349 250 /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */
350 251 onNext: function (tab, navigation, index) {
351   -
352 252 success.hide();
353   -
354 253 error.hide();
355   -
356 254 if (form.valid() == false) {
357   -
358 255 return false;
359   -
360 256 }
361   -
362 257 if(index==2) {
363   -
364 258 addCarParkVmapWorlds.clearMarkAndOverlays();
365   -
366 259 addCarParkVmapWorlds.drawingManagerClose();
367   -
368 260 }
369   -
  261 + $('.tipso-animation').tipso('hide');
370 262 handleTitle(tab, navigation, index);
371   -
372 263 },
373   -
374 264 /** 上一步按钮被单击时触发,返回移动到前一个步骤 */
375 265 onPrevious: function (tab, navigation, index) {
376   -
377 266 success.hide();
378   -
379 267 error.hide();
380   -
381 268 if(index ==0) {
382   -
383 269 addCarParkVmapWorlds.drawingManagerClose();
384   -
385 270 }
386   -
387 271 addCarParkVmapWorlds.clearMarkAndOverlays();
388   -
389 272 handleTitle(tab, navigation, index);
390   -
391 273 },
392   -
393 274 /** 显示选项卡内容 */
394 275 onTabShow: function (tab, navigation, index) {
395   -
396 276 var total = navigation.find('li').length;
397   -
398 277 var current = index + 1;
399   -
400 278 var $percent = (current / total) * 100;
401   -
402   - $('#submit_carpark_form').find('.progress-bar').css({
403   -
404   - width: $percent + '%'
405   -
406   - });
407   -
  279 + $('#submit_carpark_form').find('.progress-bar').css({ width: $percent + '%'});
408 280 }
409   -
410 281 });
411   -
412 282 // 初始化第一步隐藏返回按钮
413 283 $('#submit_carpark_form').find('.button-previous').hide();
414   -
415 284 }
416 285 };
417   -}();
  286 +}();
418 287 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/add-input-function.js
... ... @@ -2,64 +2,47 @@
2 2 * 函数
3 3 *
4 4 */
5   -
6 5 var PublicFunctions = function () {
7   -
8 6 var PubFun = {
9   -
10 7 /** @param points:中心点;bPolygonGridValue:百度坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */
11 8 setFormInputValue: function(points,bPolygonGridValue,shapesTypeValue,radiusValue) {
12   -
13 9 // 百度地图经纬度坐标中心点
14 10 $('#bCenterPointInput').val(points);
15   -
16 11 // 百度坐标点图形集合
17 12 $('#bParkPointInput').val(bPolygonGridValue);
18   -
19 13 // 图形类型
20   - $('#shapesTypeSelect').val(shapesTypeValue);
21   -
22   - // 圆形半径
  14 + if(shapesTypeValue == 'r') {
  15 + $('#shapesTypeSelect').val('圆形');
  16 + // 圆形半径
  17 + $('#radiusGroup').show();
  18 + }else if(shapesTypeValue=='d') {
  19 + $('#shapesTypeSelect').val('多边形');
  20 + $('#radiusGroup').hide();
  21 + }
23 22 $('#radiusInput').val(radiusValue);
24   -
25 23 },
26   -
27 24 getBusinessAllInfo : function(cb) {
28   -
29 25 // 填充公司下拉框选择值
30   - $get('/business/all', {upCode_eq: '77'}, function(array){
31   -
  26 + $get('/business/all', {upCode_eq: '88'}, function(array){
32 27 cb && cb(array);
33   -
34 28 });
35   -
36 29 },
37   -
38 30 getCarParkCode : function(callback) {
39   -
40 31 $get('/carpark/getCarParkCode',null,function(d) {
41   -
42 32 callback && callback(d);
43   -
44 33 });
45   -
46 34 },
47   -
48   - // 新增站点保存
  35 + isHaveParkCode : function(p,callback) {
  36 + $get('/carpark/isHaveParkCode',p,function(d) {
  37 + callback && callback(d);
  38 + });
  39 + },
  40 + // 新增停车场保存
49 41 carParkSave : function(carPark,callback) {
50   -
51   - console.log(carPark);
52   -
53 42 $post('/carpark/carParkSave',carPark,function(data) {
54   -
55 43 callback && callback(data);
56   -
57 44 });
58   -
59 45 }
60   -
61 46 }
62   -
63 47 return PubFun ;
64   -
65 48 }();
66 49 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/add-vmap-world.js
1 1 var addCarParkVmapWorlds = function() {
2   -
3 2 var mapB = '', circle = '', drawingManager = '',circle='',marker='';
4   -
5 3 var Bmap = {
6   -
7 4 init : function() {
8   -
9 5 // 设置中心点,
10 6 var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
11   -
12 7 // 百度API Key
13 8 var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
14   -
15 9 // 初始化百度地图
16 10 mapB = new BMap.Map("addCarParkbmap_basic");
17   -
18 11 //中心点和缩放级别
19 12 mapB.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
20   -
21 13 //启用地图拖拽事件,默认启用(可不写)
22 14 mapB.enableDragging();
23   -
24 15 //启用地图滚轮放大缩小
25 16 mapB.enableScrollWheelZoom();
26   -
27 17 //禁用鼠标双击放大
28 18 mapB.disableDoubleClickZoom();
29   -
30 19 //启用键盘上下左右键移动地图
31 20 mapB.enableKeyboard();
32   -
33 21 var styleOptions = {
34   -
35 22 //边线颜色。
36 23 strokeColor : "blue",
37   -
38 24 //填充颜色。当参数为空时,圆形将没有填充效果。
39 25 fillColor : "blue",
40   -
41 26 //边线的宽度,以像素为单位。
42 27 strokeWeight : 3,
43   -
44 28 //边线透明度,取值范围0 - 1。
45 29 strokeOpacity : 0.8,
46   -
47 30 //填充的透明度,取值范围0 - 1。
48 31 fillOpacity : 0.6,
49   -
50 32 //边线的样式,solid或dashed。
51 33 strokeStyle : 'solid'
52   -
53 34 };
54   -
55 35 // 创建鼠标绘制管理类
56 36 drawingManager = new BMapLib.DrawingManager(mapB, {
57   -
58 37 //是否开启绘制模式
59 38 isOpen : false,
60   -
61 39 //是否显示工具栏
62 40 enableDrawingTool : false,
63   -
64 41 drawingToolOptions : {
65   -
66 42 //位置
67 43 anchor : BMAP_ANCHOR_TOP_RIGHT,
68   -
69 44 //偏离值
70 45 offset : new BMap.Size(5, 5),
71   -
72 46 //工具栏缩放比例
73 47 scale : 0.8
74   -
75 48 },
76   -
77 49 //线的样式
78 50 polygonOptions : styleOptions
79   -
80 51 });
81   -
82 52 // 添加绘画完成事件
83 53 drawingManager.addEventListener('polygoncomplete', function(e) {
84   -
85 54 drawingManager.close();
86   -
87 55 if (e.getPath().length <= 2) {
88   -
89 56 // 弹出提示消息
90 57 layer.msg('坐标点不能小于等于两个...');
91   -
92 58 // 清除地图覆盖物
93 59 mapB.clearOverlays();
94   -
95 60 drawingManager.open();
96   -
97 61 return false;
98   -
99 62 }else {
100   -
101 63 var pointE = e;
102   -
103 64 // 多变行质心点
104 65 var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat;
105   -
106 66 var addPolyGonLen_ = pointE.getPath().length;
107   -
108 67 for(var k =0;k<addPolyGonLen_;k++) {
109   -
110 68 if(k==0) {
111   -
112 69 bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
113   -
114 70 }else {
115   -
116 71 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
117   -
118 72 }
119   -
120 73 }
121   -
122 74 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat;
123   -
124 75 PublicFunctions.setFormInputValue(addSttationPoints_,bPloygonGrid,'d','');
125 76 }
126   -
127 77 });
128   -
129 78 return mapB;
130 79 },
131   -
132 80 // 根据地理名称获取百度经纬度坐标
133 81 localSearchFromAdreesToPoint: function(Address,cb) {
134   -
135 82 // 创建一个搜索类实例
136 83 var localSearch = new BMap.LocalSearch(mapB);
137   -
138 84 // 检索完成后的回调函数。
139 85 localSearch.setSearchCompleteCallback(function (searchResult) {
140   -
141 86 var resultPoints = '';
142   -
143 87 if(searchResult) {
144   -
145 88 // 返回索引指定的结果。索引0表示第1条结果
146 89 var poi = searchResult.getPoi(0);
147   -
148 90 if(poi) {
149   -
150 91 //获取经度和纬度
151 92 var stationNameChangePoint = new BMap.Point( poi.point.lng, poi.point.lat);
152   -
153 93 marker = new BMap.Marker(stationNameChangePoint);
154   -
155 94 var PanOptions ={noAnimation :true};
156   -
157 95 mapB.panTo(stationNameChangePoint,PanOptions);
158   -
159 96 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
160 97 mapB.setZoom(18);
161   -
162 98 mapB.panBy(0,-80);
163   -
164 99 // 将标注添加到地图中
165 100 mapB.addOverlay(marker);
166   -
167 101 //跳动的动画
168 102 marker.setAnimation(BMAP_ANIMATION_BOUNCE);
169   -
170 103 cb && cb(stationNameChangePoint);
171   -
172 104 }else {
173   -
174 105 // 弹出添加成功提示消息
175 106 layer.msg('无法获取停车场【'+Address+'】地理位置!');
176   -
177 107 cb && cb(false);
178   -
179 108 }
180   -
181 109 }else {
182   -
183 110 // 弹出添加成功提示消息
184 111 layer.msg('无法获取停车场【'+Address+'】地理位置!');
185   -
186 112 cb && cb(false);
187 113 }
188   -
189 114 });
190   -
191 115 // 根据检索词发起检索。
192 116 localSearch.search(Address);
193   -
194 117 },
195 118  
196 119 // 画圆
197 120 pointsCircle : function(stationNameChangePoint) {
198   -
199 121 //创建圆
200 122 circle = new BMap.Circle(stationNameChangePoint,100,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
201   -
202 123 // 百度地图添加覆盖物圆
203 124 mapB.addOverlay(circle);
204   -
205 125 // 开启编辑功能
206 126 circle.enableEditing();
207   -
208 127 // 编辑圆监听事件
209 128 circle.addEventListener('remove',function() {
210   -
211 129 // 清除marker
212 130 mapB.removeOverlay(marker);
213   -
214   - /*VmapWorlds.clearMarkAndOverlays();*/
215   -
216 131 // 返回圆形的半径,单位为米。
217 132 var newRadius = circle.getRadius();
218   -
219 133 // 返回圆形的中心点坐标。
220 134 var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
221   -
222 135 var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}];
223   -
224 136 circle = '';
225   -
226 137 PublicFunctions.setFormInputValue(newCenter,'','r',Math.round(newRadius));
227   -
228 138 });
229   -
230 139 },
231   -
232 140 // 打开绘画工具
233 141 drawingManagerOpen : function() {
234   -
235 142 // 打开鼠标绘画工具
236 143 drawingManager.open();
237   -
238 144 // 设置属性
239 145 drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON);
240   -
241 146 },
242   -
243 147 drawingManagerClose : function() {
244   -
245 148 drawingManager.close();
246   -
247 149 },
248   -
249 150 clearMarkAndOverlays : function() {
250   -
251 151 // 清楚地图覆盖物
252 152 mapB.clearOverlays();
253   -
254 153 }
255   -
256 154 }
257   -
258 155 return Bmap;
259   -
260 156 }();
261 157 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
... ... @@ -13,89 +13,154 @@
13 13 */
14 14  
15 15 (function(){
  16 + function getComp(cb) {
  17 + $.get('/user/companyData',null,function(rs) {
  18 + return cb && cb(rs);
  19 + });
  20 + }
  21 + function initCompanySelect2(cb) {
  22 + // get请求获取公司
  23 + $get('/business/all', {upCode_eq: '88'}, function(gs_d){
  24 + return cb && cb(gs_d);
  25 + });
  26 + }
  27 + initCompanySelect2(function(array) {
  28 + // 公司下拉options属性值
  29 + var options = '<option value="">请选择...</option>';
  30 + // 遍历array
  31 + $.each(array, function(i,d){
  32 + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
  33 + });
  34 + // 初始化公司下拉框并监听值改变事件.
  35 + $('#companySelect').html(options).on('change', setBrancheCompanySelectOptions);
  36 + // 初始化分公司下拉框.
  37 + setBrancheCompanySelectOptions();
  38 + initLineSelect2(array);
  39 + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */
  40 + // loadTableDate({'destroy_eq':0,'name_like':splitxlName(storage.xlName_AgursData)},true);
  41 + });
  42 + function initLineSelect2(compD) {
  43 + getComp(function(rs) {
  44 + var params = {};
  45 + if(rs.length>0) {
  46 + var compA = new Array();
  47 + for(var c = 0 ; c<rs.length;c++) {
  48 + var comC = rs[c].companyCode;
  49 + var child = rs[c].children;
  50 + if(child.length>0) {
  51 + for(var d = 0 ;d< child.length;d++) {
  52 + compA.push(comC + '_' + child[d].code);
  53 + }
  54 + }else {
  55 + compA.push(comC);
  56 + }
  57 + }
  58 + params.cgsbm_in = compA.toString();
  59 + }
  60 + // 填充线路拉框选择值
  61 + $get('/carpark/all', params, function(array){
  62 + var len_ = array.length,paramsD = new Array();
  63 + paramsD.push({'id':'请选择...' ,'text':'请选择...'});
  64 + if(len_>0) {
  65 + $.each(array, function(i, g){
  66 + if(g.parkName!='' || g.parkName != null) {
  67 + paramsD.push({'id':g.parkName + '_' + g.parkCode ,'text':g.parkName + gsdmTogsName(compD,g.company)});
  68 + }
  69 + });
  70 + if($('span').hasClass('select2-selection'))
  71 + $('span .select2-selection').remove();
  72 + initPinYinSelect2($('#parkNameSelect'),paramsD,function(selector) {
  73 + });
  74 + }
  75 + });
  76 + });
  77 + }
  78 +
  79 + $('#parkNameSelect').on('change',function() {
  80 + var value = $(this).val();
  81 + if(value!=null && value!='') {
  82 + $('#parkCodeInput').val(value.split('_')[1]);
  83 + }
  84 + });
16 85  
17   - /** 填充公司下拉框选择值 */
18   - $get('/business/all', {upCode_eq: '77'}, function(array){
19   -
20   - // 公司下拉options属性值
  86 + function gsdmTogsName(gsD,code) {
  87 + var rsStr = '';
  88 + for(var s = 0 ; s < gsD.length; s++) {
  89 + if(gsD[s].businessCode == code) {
  90 + rsStr = rsStr + '(' + gsD[s].businessName.replace('公司','') + ')';
  91 + break;
  92 + }
  93 + }
  94 + return rsStr;
  95 + }
  96 +
  97 + function setBrancheCompanySelectOptions(){
  98 + // 获取公司下拉框选择值
  99 + var businessCode = $('#companySelect').val();
  100 + // 分公司下拉框options属性值
21 101 var options = '<option value="">请选择...</option>';
22   -
23   - // 遍历array
24   - $.each(array, function(i,d){
25   -
26   - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
27   -
28   - });
29   -
30   - // 填充公司下拉框options,并添加公司下拉框值改变事件setbrancheCompanySelectOptions
31   - $('#companySelect').html(options)
32   - //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions);
33   -
34   - });
  102 + // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码
  103 + if(businessCode == null || businessCode ==''){
  104 + // 填充分公司下拉框options
  105 + $('#brancheCompanySelect').html(options);
  106 + } else {
  107 + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */
  108 + $get('/business/all', {upCode_eq: businessCode}, function(array){
  109 + // 遍历array
  110 + $.each(array, function(i,d){
  111 + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
  112 + // 填充分公司下拉框options
  113 + $('#brancheCompanySelect').html(options);
  114 + });
  115 + });
  116 + }
  117 + }
35 118  
36 119 /** page : 当前页 initPag : */
37 120 var page = 0,initPag;
38   -
39 121 /** 表格数据分页加载 */
40 122 loadTableDate(null,true);
41   -
42 123 /** 重置按钮事件 */
43 124 $('tr.filter .filter-cancel').on('click',function(){
44   -
45 125 // 清空搜索框值
46 126 $('tr.filter input,select').val('').change();
47   -
48 127 // 重新加载表格数据
49 128 loadTableDate(null,true);
50 129 });
51   -
52 130 /** 搜索按钮事件 */
53 131 $('tr.filter .filter-submit').on('click',function(){
54   -
55 132 var params = getParams();
56   -
57 133 page = 0;
58   -
59 134 loadTableDate(params,true);
60   -
61 135 });
62 136  
63 137 function getParams() {
64   -
65 138 // cells 集合返回表格中所有(列)单元格的一个数组
66 139 var cells = $('tr.filter')[0].cells;
67   -
68 140 // 搜索参数集合
69 141 var params = {};
70   -
71 142 // 搜索字段名称
72 143 var name;
73   -
74 144 // 遍历cells数组
75 145 $.each(cells, function(i, cell){
76   -
77 146 // 获取第i列的input或者select集合
78 147 var items = $('input,select', cell);
79   -
80 148 // 遍历items集合
81 149 for(var j = 0, item; item = items[j++];){
82   -
83 150 // 获取字段名称
84 151 name = $(item).attr('name');
85   -
86 152 if(name){
87   -
88 153 // 赋取相对应的值
89 154 params[name] = $(item).val();
90   -
91 155 }
92 156 }
93   -
94 157 });
  158 + if(params.parkName_like=='请选择...')
  159 + params.parkName_like = '';
  160 + else
  161 + params.parkName_like = params.parkName_like.split('_')[0];
95 162 return params;
96   -
97 163 }
98   -
99 164  
100 165 /**
101 166 * 表格数据分页加载事件
... ... @@ -106,99 +171,77 @@
106 171 *
107 172 */
108 173 function loadTableDate(param,isPon){
109   -
110 174 // 搜索参数
111 175 var params = {};
112   -
113 176 if(param) {
114   -
115 177 params = param;
116   -
117 178 }
118   -
119 179 // 排序(按更新时间)
120 180 params['order'] = 'id';
121   -
122 181 // 记录当前页数
123 182 params['page'] = page;
124   -
125 183 // 弹出正在加载层
126 184 var i = layer.load(2);
127   -
128   - // 异步请求获取表格数据
129   - $.get('/carpark',params,function(result){
130   -
131   - // 添加序号
132   - result.content.page = page;
133   -
134   - // 把数据填充到模版中
135   - var tbodyHtml = template('carpark_list_table_temp',{list:result.content});
136   -
137   -
138   - $('#datatable_carpark tbody').html(tbodyHtml);
139   -
140   - // 是重新分页且返回数据长度大于0
141   - if(isPon && result.content.length > 0){
142   -
143   - // 重新分页
144   - initPag = true;
145   -
146   - // 分页栏
147   - showPagination(result);
148   -
  185 + getComp(function(rs) {
  186 + if(rs.length>0) {
  187 + var compA = new Array();
  188 + for(var c = 0 ; c<rs.length;c++) {
  189 + var comC = rs[c].companyCode;
  190 + var child = rs[c].children;
  191 + if(child.length>0) {
  192 + for(var d = 0 ;d< child.length;d++) {
  193 + compA.push(comC + '_' + child[d].code);
  194 + }
  195 + }else {
  196 + compA.push(comC);
  197 + }
  198 + }
  199 + params.cgsbm_in = compA.toString();
149 200 }
150   -
151   - // 关闭弹出加载层
152   - layer.close(i);
153   -
  201 + // 异步请求获取表格数据
  202 + $.get('/carpark',params,function(result){
  203 + // 添加序号
  204 + result.content.page = page;
  205 + // 把数据填充到模版中
  206 + var tbodyHtml = template('carpark_list_table_temp',{list:result.content});
  207 + $('#datatable_carpark tbody').html(tbodyHtml);
  208 + // 是重新分页且返回数据长度大于0
  209 + if(isPon && result.content.length > 0){
  210 + // 重新分页
  211 + initPag = true;
  212 + // 分页栏
  213 + showPagination(result);
  214 + }
  215 + // 关闭弹出加载层
  216 + layer.close(i);
  217 + });
154 218 });
155 219 }
156 220  
157 221 /** 分页栏组件 */
158 222 function showPagination(data){
159   -
160 223 // 分页组件
161 224 $('#pagination').jqPaginator({
162   -
163 225 // 总页数
164 226 totalPages: data.totalPages,
165   -
166 227 // 中间显示页数
167 228 visiblePages: 6,
168   -
169 229 // 当前页
170 230 currentPage: page + 1,
171   -
172 231 first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
173   -
174 232 prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
175   -
176 233 next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
177   -
178 234 last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
179   -
180 235 page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
181   -
182 236 onPageChange: function (num, type) {
183   -
184 237 if(initPag){
185   -
186 238 initPag = false;
187   -
188 239 return;
189   -
190 240 }
191   -
192 241 var pData = getParams();
193   -
194 242 page = num - 1;
195   -
196 243 loadTableDate(pData, false);
197   -
198 244 }
199   -
200 245 });
201   -
202 246 }
203   -
204 247 })();
205 248 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/carpark-positions-ajax.js
... ... @@ -2,33 +2,19 @@
2 2 * GetAjaxData :ajax异步请求
3 3 *
4 4 */
5   -
6 5 var GetAjaxData = function(){
7   -
8 6 var ajaxData = {
9   -
10 7 // 查询停车场信息
11 8 getCarParkInfo : function(carParkId,callback){
12   -
13 9 $get('/carpark/findCarParkInfoFormId',{id:carParkId},function(r) {
14   -
15 10 return callback && callback(r);
16   -
17 11 });
18   -
19 12 },
20   -
21 13 carParkUpdate : function(params,callback){
22   -
23 14 $post('/carpark/carParkUpdate',params,function(data) {
24   -
25 15 callback && callback(data);
26   -
27 16 });
28   -
29 17 }
30 18 }
31   -
32 19 return ajaxData;
33   -
34 20 }();
35 21 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/carpark-positions-events.js
1 1 $(function(){
2   -
3 2 $('#backUp').on('click',function() {
4   -
5   - // 获取返回元素并修改url地址
6   - /*$('#backUp').attr('href','list.html?');*/
7   -
8 3 // 返回list.html页面
9 4 loadPage('/pages/base/carpark/list.html');
10   -
11 5 });
12   -
13 6 $('#edit').on('click',function() {
14   -
15 7 $.get('edit_select.html', function(m){
16   -
17 8 $(pjaxContainer).append(m);
18   -
19 9 $('#editPositions_select_mobal').trigger('editSelectMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]);
20   -
21 10 });
22   -
23 11 });
24   -
25   -
  12 + // 监听打开鼠标绘制工具按钮事件.
  13 + $('#oppenDrawingManager').on('click',function() {
  14 + CarParkPWorldsBMap.openDrawingManager();
  15 + });
  16 + // 监听关闭鼠标绘制工具按钮事件.
  17 + $('#closeDrawingManager').on('click',function() {
  18 + CarParkPWorldsBMap.drawingManagerClose();
  19 + });
26 20 });
27 21 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
... ... @@ -4,178 +4,105 @@
4 4 */
5 5  
6 6 var PublicFunctions = function () {
7   -
8 7 var PubFun = {
9   -
10 8 /** 停车场信息初始化 @param:<id:停车场ID> */
11 9 initCarPark : function(id) {
12   -
13 10 /** 获取停车场信息 @param:<id:停车场Id> */
14 11 GetAjaxData.getCarParkInfo(id,function(r) {
15   -
16 12 // 获取返回数据长度
17 13 var len = r.length;
18   -
19 14 // 如果大于零
20 15 if(len>0) {
21   -
22 16 // 获取停车场信息数据
23 17 var carParkObj = r[0];
24   -
25 18 /** 设置停车场对象值 @param:<carParkObj:停车场对象值> */
26 19 EditCarParkObj.setEitdCarPark(carParkObj);
27   -
28 20 // 定义图形类型
29 21 var stationShapesType = r[0].carParkShapesType;
30   -
31 22 // 如果为空,则添加
32   - if(stationShapesType==null){
33   -
  23 + if(stationShapesType==null || stationShapesType=='' ){
34 24 // 弹出选择框;确认则提交;取消则返回
35   - layer.confirm('停车场位置缺失,自动延续为添加停车场位置', {btn : [ '确认提示并添加', '取消' ]}, function(index) {
36   -
  25 + layer.confirm('停车场位置缺失,是否自动延续为添加停车场位置', {btn : [ '确认并添加', '取消并返回' ]}, function(index) {
37 26 /** 关闭弹出层 @param:<index:当前弹出框> */
38 27 layer.close(index);
39   -
  28 + $('.drwmageUtils').show();
  29 + $('.leftUtils').hide();
40 30 // 停车场名称
41 31 var nameV = r[0].carParkName;
42   -
43 32 /** 根据名称定位 */
44 33 CarParkPWorldsBMap.localSearchFromAdreesToPoint(nameV);
45   -
46 34 // 打开绘制工具
47 35 CarParkPWorldsBMap.openDrawingManager();
48   -
  36 + },function() {
  37 + loadPage('/pages/base/carpark/list.html');
49 38 });
50   -
51 39 return ;
52 40 }
53   -
  41 + $('.leftUtils').show();
  42 + $('.drwmageUtils').hide();
54 43 // 获取中心坐标点字符串分割
55 44 var BJwpoints = r[0].carParkBcenterPoint.split(' ');
56   -
57 45 // 中心坐标点
58 46 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
59   -
60 47 var shapesV = '';
61   -
62 48 if(r[0].carParkShapesType=='d') {
63   -
64 49 shapesV = '多边形';
65   -
66 50 }else if(r[0].carParkShapesType=='r') {
67   -
68 51 shapesV = '圆形';
69   -
70 52 }
71   -
72 53 var companyV = '';
73   -
74 54 var branchecomV = '';
75   -
76 55 if( r[0].carParkCompany=='55'){
77   -
78 56 companyV = '上南公司';
79   -
80 57 if(r[0].carParkBrancheCompany=='1'){
81   -
82 58 branchecomV = '上南二分公司';
83   -
84 59 }else if(r[0].carParkBrancheCompany=='2'){
85   -
86 60 branchecomV = '上南三分公司';
87   -
88 61 }else if(r[0].carParkBrancheCompany=='3'){
89   -
90 62 branchecomV = '上南六分公司';
91   -
92 63 }else if(r[0].carParkBrancheCompany=='4'){
93   -
94 64 branchecomV = '上南一分公司';
95   -
96 65 }
97   -
98 66 }else if( r[0].carParkCompany=='22'){
99   -
100 67 companyV = '金高公司';
101   -
102 68 if(r[0].carParkBrancheCompany=='1'){
103   -
104 69 branchecomV = '四分公司';
105   -
106 70 }else if(r[0].carParkBrancheCompany=='2'){
107   -
108 71 branchecomV = '二分公司';
109   -
110 72 }else if(r[0].carParkBrancheCompany=='3'){
111   -
112 73 branchecomV = '三分公司';
113   -
114 74 }else if(r[0].carParkBrancheCompany=='5'){
115   -
116 75 branchecomV = '一分公司';
117   -
118 76 }
119   -
120 77 }else if( r[0].carParkCompany=='05'){
121   -
122 78 companyV = '杨高公司';
123   -
124 79 if(r[0].carParkBrancheCompany=='1'){
125   -
126 80 branchecomV = '川沙分公司';
127   -
128 81 }else if(r[0].carParkBrancheCompany=='2'){
129   -
130 82 branchecomV = '金桥分公司';
131   -
132 83 }else if(r[0].carParkBrancheCompany=='3'){
133   -
134 84 branchecomV = '芦潮港分公司';
135   -
136 85 }else if(r[0].carParkBrancheCompany=='5'){
137   -
138 86 branchecomV = '杨高分公司';
139   -
140 87 }else if(r[0].carParkBrancheCompany=='6'){
141   -
142 88 branchecomV = '周浦分公司';
143   -
144 89 }
145   -
146   -
147 90 }else if( r[0].carParkCompany=='26'){
148   -
149 91 companyV = '南汇公司';
150   -
151 92 if(r[0].carParkBrancheCompany=='1'){
152   -
153 93 branchecomV = '南汇一分';
154   -
155 94 }else if(r[0].carParkBrancheCompany=='2'){
156   -
157 95 branchecomV = '南汇二分';
158   -
159 96 }else if(r[0].carParkBrancheCompany=='3'){
160   -
161 97 branchecomV = '南汇三分';
162   -
163 98 }else if(r[0].carParkBrancheCompany=='4'){
164   -
165 99 branchecomV = '南汇维修公司';
166   -
167 100 }else if(r[0].carParkBrancheCompany=='5'){
168   -
169 101 branchecomV = '南汇公司';
170   -
171 102 }
172   -
173 103 }else if( r[0].carParkCompany=='77'){
174   -
175 104 companyV ='闵行公司'
176   -
177 105 }
178   -
179 106 // 信息窗口类容
180 107 var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
181 108 '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' +
... ... @@ -185,134 +112,91 @@ var PublicFunctions = function () {
185 112 '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' +
186 113 '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' +
187 114 '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' +
188   - /*'<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' +*/
  115 + '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' +
189 116 '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' +
190 117 '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ;
191   -
192 118 // 信息窗口参数属性
193 119 var opts = {
194   -
195 120 // 信息窗口宽度
196 121 width : 200,
197   -
198 122 // 信息窗口高度
199 123 height : 450,
200   -
201 124 // 信息窗位置偏移值。
202 125 offset: new BMap.Size(500,80),
203   -
204 126 //标题
205 127 title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>',
206   -
207 128 //设置不允许信窗发送短息
208 129 enableMessage : false,
209   -
210 130 //是否开启点击地图关闭信息窗口
211 131 enableCloseOnClick : false,
212   -
213 132 // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
214 133 enableAutoPan:true
215 134 };
216   -
217 135 if(stationShapesType == 'r') {
218   -
219 136 /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */
220 137 CarParkPWorldsBMap.pointsCircle(r,point,htm,opts);
221   -
222 138 }else if(stationShapesType == 'd'){
223   -
224 139 /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */
225 140 CarParkPWorldsBMap.pointsPolygon(r,point,htm,opts);
226   -
227 141 }
228 142 }
229   -
230 143 });
231   -
232 144 },
233 145  
234 146 setFormValue : function(carParkObj) {
235   -
236 147 $('#idInput').val(carParkObj.carParkId);
237   -
238 148 $('#bParkPointInput').val(carParkObj.carParkBparkPoint);
239   -
240 149 $('#parkNameInput').val(carParkObj.carParkName);
241   -
242 150 $('#parkCodeInput').val(carParkObj.carParkCode);
243   -
244 151 $('#bCenterPointInput').val(carParkObj.carParkBcenterPoint);
245   -
246   - $('#shapesTypeSelect').val(carParkObj.carParkShapesType);
247   -
  152 + if(carParkObj.carParkShapesType=='r') {
  153 + $('#shapesTypeSelect').val('圆形');
  154 + $('#radiusGroup').show();
  155 + }else if(carParkObj.carParkShapesType=='d') {
  156 + $('#shapesTypeSelect').val('多边形');
  157 + $('#radiusGroup').hide();
  158 + }
248 159 $('#radiusInput').val(carParkObj.carParkRadius);
249   -
250 160 $('#areaInput').val(carParkObj.carParkArea);
251   -
252 161 $('#destroySelect').val(carParkObj.carParkDestroy);
253   -
254 162 $('#descriptionsTextarea').val(carParkObj.carParkDescriptions);
255   -
256 163 },
257 164  
258 165 // 公司下拉框
259 166 selectTemp : function(callback) {
260   -
261 167 // 填充公司下拉框选择值
262   - $.get('/business/all', {upCode_eq: '77'}, function(array){
263   -
  168 + $.get('/business/all', {upCode_eq: '88'}, function(array){
264 169 // 公司下拉options属性值
265 170 var options = '<option value="">-- 请选择公司 --</option>';
266   -
267 171 // 遍历array
268 172 $.each(array, function(i,d){
269   -
270 173 options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
271   -
272 174 });
273   -
274 175 // 填充公司下拉框options
275 176 $('#companySelect').html(options);
276   -
277 177 callback && callback();
278   -
279 178 });
280 179 },
281   -
282 180 // 填充分公司下拉框选择值
283 181 getbrancheCompanyValues : function(businessCode,cb){
284   -
285 182 // 分公司下拉框options属性值
286 183 var options = '<option value="">-- 请选择分公司 --</option>';
287   -
288 184 if(businessCode) {
289   -
290 185 $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){
291   -
292 186 // 遍历brancheCompany
293 187 $.each(brancheCompany, function(i,d){
294   -
295 188 options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
296   -
297 189 });
298   -
299 190 // 填充分公司下拉框options
300 191 $('#brancheCompanySelect').html(options);
301   -
302 192 cb && cb();
303   -
304 193 });
305   -
306 194 } else {
307   -
308 195 // 填充分公司下拉框options
309 196 $('#brancheCompanySelect').html(options);
310   -
311 197 cb && cb();
312 198 }
313   -
314 199 },
315   -
316 200 }
317 201  
318 202 return PubFun ;
... ...
src/main/resources/static/pages/base/carpark/js/carpark-positions-map.js
... ... @@ -8,443 +8,280 @@ var CarParkPWorldsBMap = function () {
8 8 var mapValue='',drawingManager='',marker='',circle='',polygon='';
9 9  
10 10 var Bmap = {
11   -
12 11 init : function() {
13   -
14 12 // 设置中心点,
15 13 var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
16   -
17 14 // 百度API Key
18 15 var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
19   -
20 16 // 初始化百度地图
21 17 mapValue = new BMap.Map("carParkbmap_basic");
22   -
23 18 //中心点和缩放级别
24 19 mapValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
25   -
26 20 //启用地图拖拽事件,默认启用(可不写)
27 21 mapValue.enableDragging();
28   -
29 22 //启用地图滚轮放大缩小
30 23 mapValue.enableScrollWheelZoom();
31   -
32 24 //禁用鼠标双击放大
33 25 mapValue.disableDoubleClickZoom();
34   -
35 26 //启用键盘上下左右键移动地图
36 27 mapValue.enableKeyboard();
37   -
38 28 var styleOptions = {
39   -
40 29 //边线颜色。
41 30 strokeColor : "blue",
42   -
43 31 //填充颜色。当参数为空时,圆形将没有填充效果。
44 32 fillColor : "blue",
45   -
46 33 //边线的宽度,以像素为单位。
47 34 strokeWeight : 3,
48   -
49 35 //边线透明度,取值范围0 - 1。
50 36 strokeOpacity : 0.8,
51   -
52 37 //填充的透明度,取值范围0 - 1。
53 38 fillOpacity : 0.6,
54   -
55 39 //边线的样式,solid或dashed。
56 40 strokeStyle : 'solid'
57   -
58 41 };
59   -
60 42 // 创建鼠标绘制管理类
61 43 drawingManager = new BMapLib.DrawingManager(mapValue, {
62   -
63 44 //是否开启绘制模式
64 45 isOpen : false,
65   -
66 46 //是否显示工具栏
67 47 enableDrawingTool : false,
68   -
69 48 drawingToolOptions : {
70   -
71 49 //位置
72 50 anchor : BMAP_ANCHOR_TOP_RIGHT,
73   -
74 51 //偏离值
75 52 offset : new BMap.Size(5, 5),
76   -
77 53 //工具栏缩放比例
78 54 scale : 0.8
79   -
80 55 },
81   -
82 56 //线的样式
83 57 polygonOptions : styleOptions
84   -
85 58 });
86   -
87 59 // 添加绘画完成事件
88 60 drawingManager.addEventListener('polygoncomplete', function(e) {
89   -
90   - drawingManager.close();
91   -
  61 + drawingManager.close();
92 62 if (e.getPath().length <= 2) {
93   -
94 63 // 弹出提示消息
95 64 layer.msg('坐标点不能小于等于两个...');
96   -
97 65 // 清除地图覆盖物
98   - map.clearOverlays();
99   -
100   - // 加载该线路下所有站点位置添加到地图上
101   - return false;
102   -
  66 + Bmap.clearMarkAndOverlays();
  67 + // 加载该线路下所有站点位置添加到地图上
  68 + return false;
103 69 }else {
104   -
105 70 var pointE = e;
106   -
107 71 // 多变行质心点
108 72 var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat;
109   -
110 73 var addPolyGonLen_ = pointE.getPath().length;
111   -
112 74 for(var k =0;k<addPolyGonLen_;k++) {
113   -
114 75 if(k==0) {
115   -
116 76 bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
117   -
118 77 }else {
119   -
120 78 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
121   -
122 79 }
123 80  
124 81 }
125   -
126 82 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat;
127   -
128 83 /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */
129 84 EditCarParkObj.setCarParkBcenterPoint(addSttationPoints_);
130   -
131 85 /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */
132 86 EditCarParkObj.setCarParkShapesType('d');
133   -
134 87 /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */
135 88 EditCarParkObj.setCarParkRadius('');
136   -
137 89 /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */
138 90 EditCarParkObj.setCarParkBparkPoint(bPloygonGrid);
139   -
140 91 $.get('edit.html', function(m){
141   -
142 92 $(pjaxContainer).append(m);
143   -
144 93 $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]);
145   -
146 94 });
147   -
148 95 }
149   -
150 96 });
151 97 return mapValue;
152 98 },
153   -
154 99 openDrawingManager : function() {
155   -
156 100 // 清楚地图覆盖物
157   - mapValue.clearOverlays();
158   -
  101 + // mapValue.clearOverlays();
159 102 // 打开鼠标绘画工具
160 103 drawingManager.open();
161   -
162 104 // 设置属性
163 105 drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON);
164   -
165 106 },
166   -
  107 + drawingManagerClose : function() {
  108 + drawingManager.close();
  109 + },
167 110 localSearchFromAdreesToPoint: function(Address) {
168   -
169 111 // 创建一个搜索类实例
170 112 var localSearch = new BMap.LocalSearch(mapValue);
171   -
172 113 // 检索完成后的回调函数。
173 114 localSearch.setSearchCompleteCallback(function (searchResult) {
174   -
175 115 var resultPoints = '';
176   -
177 116 if(searchResult) {
178   -
179 117 // 返回索引指定的结果。索引0表示第1条结果
180 118 var poi = searchResult.getPoi(0);
181   -
182 119 if(poi) {
183   -
184 120 //获取经度和纬度
185 121 var Points = poi.point.lng + ' ' + poi.point.lat;
186   -
187 122 var BJwpointsArray = Points.split(' ');
188   -
189 123 var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]);
190   -
191 124 var marker_stargt2 = new BMap.Marker(stationNameChangePoint);
192   -
193 125 var PanOptions ={noAnimation :true};
194   -
195 126 mapValue.panTo(stationNameChangePoint,PanOptions);
196   -
197 127 mapValue.panBy(0,-200);
198   -
199 128 // 将标注添加到地图中
200 129 mapValue.addOverlay(marker_stargt2);
201   -
202 130 //跳动的动画
203 131 marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE);
204   -
205 132 }
206   -
207 133 }
208   -
209 134 });
210   -
211 135 // 根据检索词发起检索。
212 136 localSearch.search(Address);
213   -
214 137 },
215   -
216 138 /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */
217 139 pointsCircle : function(r,point,htm,opts) {
218   -
219 140 //创建圆
220 141 circle = new BMap.Circle(point,r[0].carParkRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
221   -
222 142 // 允许覆盖物在map.clearOverlays方法中被清除
223 143 circle.enableMassClear();
224   -
225 144 // 百度地图添加覆盖物圆
226 145 mapValue.addOverlay(circle);
227   -
228 146 // 创建信息窗口
229 147 infoWindow = new BMap.InfoWindow(htm, opts);
230   -
231 148 // 自定义标注物图片
232 149 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
233   -
234 150 // 创建点
235 151 marker = new BMap.Marker(point,{icon : icon_target});
236   -
237 152 // 把标注添物加到地图上
238 153 mapValue.addOverlay(marker);
239   -
240 154 setTimeout(function(){
241 155 //开启信息窗口
242 156 marker.openInfoWindow(infoWindow,point);
243   -
244 157 },100);
245   -
246 158 // 是否在平移过程中禁止动画。(自1.2新增)
247 159 var PanOptions_ ={noAnimation :true};
248   -
249 160 // 将地图的中心点更改为给定的点。
250 161 mapValue.panTo(point,PanOptions_);
251   -
252 162 // 添加标志物监听事件
253 163 marker.addEventListener("click",function() {
254   -
255 164 //开启信息窗口
256 165 marker.openInfoWindow(infoWindow,point);
257   -
258 166 });
259 167 },
260 168  
261 169 /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */
262 170 pointsPolygon : function(r,pointPolygon,htm,opts_polygon) {
263   -
264 171 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
265 172 mapValue.setZoom(17);
266   -
267 173 // 获取多边形坐标字符串
268 174 var stationBPolygonGrid = r[0].carParkBparkPoint;
269   -
270 175 // 截取多边形坐标字符串
271 176 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
272   -
273 177 // 按逗号切割
274 178 var pointPolygonArray = stationBPolygonGridStr.split(',');
275   -
276 179 // 多边形坐标集合
277 180 var polygonP = [];
278   -
279 181 for(var v = 0;v<pointPolygonArray.length;v++) {
280   -
281 182 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
282   -
283 183 }
284   -
285 184 // 画多边形
286 185 polygon = new BMap.Polygon(polygonP, {
287   -
288 186 // 线条显色
289 187 strokeColor : "blue",
290   -
291 188 // 边线的宽度,以像素为单位。
292 189 strokeWeight : 2,
293   -
294 190 // 边线透明度,取值范围0 - 1。
295 191 strokeOpacity : 0.5
296 192 });
297   -
298 193 // 增加地图覆盖物多边形
299 194 mapValue.addOverlay(polygon);
300   -
301 195 // 创建信息窗口
302 196 infoWindow = new BMap.InfoWindow(htm, opts_polygon);
303   -
304 197 // 自定义标注物图片
305 198 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
306   -
307 199 // 创建点
308 200 marker = new BMap.Marker(pointPolygon,{icon : icon_target});
309   -
310 201 // 把标注添物加到地图上
311 202 mapValue.addOverlay(marker);
312   -
313 203 // 是否在平移过程中禁止动画。(自1.2新增)
314 204 var PanOptions_ ={noAnimation :true};
315   -
316 205 // 将地图的中心点更改为给定的点。
317 206 mapValue.panTo(pointPolygon,PanOptions_);
318   -
319 207 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
320 208 mapValue.panBy(10,-250,PanOptions_);
321   -
322 209 //开启信息窗口
323 210 marker.openInfoWindow(infoWindow,pointPolygon);
324   -
325 211 },
326 212  
327 213 // 编辑图形
328 214 editShapes : function(stationShapesTypeV,mindex) {
329 215 // 关闭信息窗口
330 216 marker.closeInfoWindow();
331   -
332 217 // 清除marker
333 218 mapValue.removeOverlay(marker);
334   -
335 219 // 编辑圆
336 220 if(stationShapesTypeV =='r') {
337   -
338 221 // 开启编辑功能
339 222 circle.enableEditing();
340   -
341 223 // 编辑圆监听事件
342 224 circle.addEventListener('dblclick',function() {
343   -
344 225 // 关闭提示弹出层
345 226 layer.close(mindex);
346   -
347 227 // 返回圆形的半径,单位为米。
348 228 var newRadius = circle.getRadius();
349   -
350 229 // 返回圆形的中心点坐标。
351 230 var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
352   -
353 231 var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}];
354   -
355 232 /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */
356 233 EditCarParkObj.setCarParkBcenterPoint(newCenter);
357   -
358 234 /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */
359 235 EditCarParkObj.setCarParkShapesType('r');
360   -
361 236 /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */
362 237 EditCarParkObj.setCarParkRadius(Math.round(newRadius));
363   -
364 238 /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */
365 239 EditCarParkObj.setCarParkBparkPoint('');
366   -
367 240 // 加载编辑页面
368 241 $.get('edit.html', function(m){
369   -
370 242 $(pjaxContainer).append(m);
371   -
372 243 $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]);
373   -
374 244 });
375   -
376 245 });
377   -
378 246 // 编辑多变行
379 247 }else if(stationShapesTypeV =='d') {
380   -
381 248 // 开启编辑功能(自 1.1 新增)
382 249 polygon.enableEditing();
383   -
384 250 // 添加多变行编辑事件
385 251 polygon.addEventListener('dblclick',function(e) {
386   -
387 252 // 获取编辑的多边形对象
388 253 var edit_pointE = polygon;
389   -
390 254 var edit_bPloygonGrid = "";
391   -
392 255 var editPolyGonLen_ = edit_pointE.getPath().length;
393   -
394 256 for(var k =0;k<editPolyGonLen_;k++) {
395   -
396 257 if(k==0) {
397   -
398 258 edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
399   -
400 259 }else {
401   -
402 260 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
403   -
404 261 }
405   -
406 262 }
407   -
408 263 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
409   -
410 264 // 多边形中心点
411 265 var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
412   -
413   -
414 266 /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */
415 267 EditCarParkObj.setCarParkBcenterPoint(centre_points);
416   -
417 268 /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */
418 269 EditCarParkObj.setCarParkShapesType('d');
419   -
420 270 /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */
421 271 EditCarParkObj.setCarParkRadius('');
422   -
423 272 /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */
424 273 EditCarParkObj.setCarParkBparkPoint(edit_bPloygonGrid);
425   -
426 274 $.get('edit.html', function(m){
427   -
428 275 $(pjaxContainer).append(m);
429   -
430 276 $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]);
431   -
432 277 });
433   -
434 278 });
435   -
436 279 }
437   -
438 280 },
439   -
440 281 clearMarkAndOverlays : function() {
441   -
442 282 // 清楚地图覆盖物
443 283 mapValue.clearOverlays();
444   -
445 284 }
446 285 }
447   -
448 286 return Bmap;
449   -
450 287 }();
451 288 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/js/carpark-positions-reload.js
... ... @@ -13,26 +13,15 @@
13 13 */
14 14  
15 15 (function(){
16   -
17 16 // 获取参数停车场ID
18 17 var id = $.url().param('no');
19   -
20 18 // 关闭左侧栏
21   - if (!$('body').hasClass('page-sidebar-closed')) {
22   -
23   - $('.menu-toggler.sidebar-toggler').click();
24   -
25   - }
26   -
27   - // 等候500毫秒执行
  19 + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
  20 + // 等候300毫秒执行
28 21 setTimeout(function(){
29   -
30 22 // 地图初始化
31 23 mapB = CarParkPWorldsBMap.init();
32   -
33 24 /** 停车场信息初始化 @param:<id:停车场ID> */
34 25 PublicFunctions.initCarPark(id);
35   -
36   - },200);
37   -
  26 + },300);
38 27 })();
39 28 \ No newline at end of file
... ...
src/main/resources/static/pages/base/carpark/list.html
... ... @@ -30,23 +30,24 @@
30 30 <thead>
31 31 <tr role="row" class="heading">
32 32 <th width="3%">序号</th>
33   - <th width="8%">停车场名称</th>
34   - <th width="8%">停车场编号</th>
  33 + <th width="12%">停车场名称</th>
  34 + <th width="8%">停车场编码</th>
35 35 <th width="8%">地理位置</th>
36   - <th width="8%">面积</th>
37   - <!-- <th width="8%">分公司</th> -->
  36 + <th width="6%">面积(㎡)</th>
38 37 <th width="8%">所属公司</th>
  38 + <th width="8%">所属分公司</th>
39 39 <th width="6%">版本号</th>
40 40 <th width="6%">是否撤销</th>
41   - <th width="14%">操作</th>
  41 + <th width="10%">操作</th>
42 42 </tr>
43 43 <tr role="row" class="filter">
44 44 <td>#</td>
45 45 <td>
46   - <input type="text" class="form-control form-filter input-sm" name="parkName_like">
  46 + <!-- <input type="text" class="form-control form-filter input-sm" name="parkName_like" > -->
  47 + <select name="parkName_like" class="form-control" style="width:100%" id="parkNameSelect"></select>
47 48 </td>
48 49 <td>
49   - <input type="text" class="form-control form-filter input-sm" name="parkCode_like">
  50 + <input type="text" class="form-control form-filter input-sm" name="parkCode_like" id="parkCodeInput">
50 51  
51 52 </td>
52 53 <td>
... ... @@ -55,13 +56,14 @@
55 56 <td>
56 57 <input type="text" class="form-control form-filter input-sm" name="area_eq">
57 58 </td>
58   - <!-- <td>
59   - <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq">
60   - </td> -->
61 59 <td>
62 60 <select name="company_eq" class="form-control" id="companySelect"></select>
63 61 </td>
64 62 <td>
  63 + <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select>
  64 + <!-- <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq" id="brancheCompanySelect"> -->
  65 + </td>
  66 + <td>
65 67 <input type="text" class="form-control form-filter input-sm" name="versions_eq">
66 68 </td>
67 69 <td>
... ... @@ -93,8 +95,38 @@
93 95 </div>
94 96 </div>
95 97  
96   -<!--
97   -
  98 +<script type="text/html" id="carpark_list_table_temp">
  99 + {{each list as obj i }}
  100 + <tr>
  101 + <td style="vertical-align: middle;">
  102 + {{(list.page*10)+(i+1)}}
  103 + </td>
  104 + <td>
  105 + {{obj.parkName}}
  106 + </td>
  107 + <td>
  108 + {{obj.parkCode}}
  109 + </td>
  110 + <td>
  111 + {{obj.bCenterPoint}}
  112 + </td>
  113 + <td>
  114 + {{obj.area}}
  115 + </td>
  116 + <td>
  117 + {{if obj.company == '55'}}
  118 + 上南公司
  119 + {{else if obj.company == '22'}}
  120 + 金高公司
  121 + {{else if obj.company == '05'}}
  122 + 杨高公司
  123 + {{else if obj.company == '26'}}
  124 + 南汇公司
  125 + {{else if obj.company == '77'}}
  126 + 闵行公司
  127 + {{/if}}
  128 + </td>
  129 + <td>
98 130 {{if obj.company == '55'}}
99 131  
100 132 {{if obj.brancheCompany == '1'}}
... ... @@ -148,38 +180,6 @@
148 180 {{/if}}
149 181  
150 182 {{/if}}
151   -
152   - -->
153   -<script type="text/html" id="carpark_list_table_temp">
154   - {{each list as obj i }}
155   - <tr>
156   - <td style="vertical-align: middle;">
157   - {{(list.page*10)+(i+1)}}
158   - </td>
159   - <td>
160   - {{obj.parkName}}
161   - </td>
162   - <td>
163   - {{obj.parkCode}}
164   - </td>
165   - <td>
166   - {{obj.bCenterPoint}}
167   - </td>
168   - <td>
169   - {{obj.area}}
170   - </td>
171   - <td>
172   - {{if obj.company == '55'}}
173   - 上南公司
174   - {{else if obj.company == '22'}}
175   - 金高公司
176   - {{else if obj.company == '05'}}
177   - 杨高公司
178   - {{else if obj.company == '26'}}
179   - 南汇公司
180   - {{else if obj.company == '77'}}
181   - 闵行公司
182   - {{/if}}
183 183 </td>
184 184 <td>
185 185 {{obj.versions}}
... ...
src/main/resources/static/pages/base/carpark/positions.html
1 1 <link href="/pages/base/carpark/css/positions.css" rel="stylesheet" type="text/css" />
2   -
3 2 <!-- 地图容器-->
4 3 <div id="carParkbmap_basic"></div>
5   -
6 4 <!-- 操作工具容器 -->
7   -<div class="leftUtils">
  5 +<div class="leftUtils" style="display: none">
8 6 <div class="btn-group" style="left: 100px;">
9 7 <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具
10 8 <i class="fa fa-angle-down"></i>
... ... @@ -20,21 +18,30 @@
20 18 </ul>
21 19 </div>
22 20 </div>
23   -
  21 +<div class="drwmageUtils" style="display: none">
  22 + <div class="btn-group" style="left: 100px;">
  23 + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具
  24 + <i class="fa fa-angle-down"></i>
  25 + </a>
  26 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  27 + <li>
  28 + <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a>
  29 + </li>
  30 + <li>
  31 + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a>
  32 + </li>
  33 + </ul>
  34 + </div>
  35 +</div>
24 36 <!-- 编辑停车场对象类 -->
25 37 <script src="/pages/base/carpark/js/positioncarpark.js"></script>
26   -
27 38 <!-- ajax异步请求类 -->
28 39 <script src="/pages/base/carpark/js/carpark-positions-ajax.js"></script>
29   -
30 40 <!-- 函数方法JS类库 -->
31 41 <script src="/pages/base/carpark/js/carpark-positions-function.js"></script>
32   -
33 42 <!-- 地图JS类库 -->
34 43 <script src="/pages/base/carpark/js/carpark-positions-map.js"></script>
35   -
36 44 <!-- 事件(PublicFunctions)JS类库 -->
37 45 <script src="/pages/base/carpark/js/carpark-positions-events.js"></script>
38   -
39 46 <!-- reloadJS类库 -->
40 47 <script src="/pages/base/carpark/js/carpark-positions-reload.js"></script>
41 48 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/edit.html
... ... @@ -52,7 +52,7 @@
52 52 <span class="required"> * </span>线路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
53 53 </label>
54 54 <div class="col-md-4">
55   - <input type="text" class="form-control" name="lineCode" id="lineCodeInput" placeholder="线路编码">
  55 + <input type="text" class="form-control" name="lineCode" id="lineCodeInput" placeholder="线路编码" readonly="readonly">
56 56 </div>
57 57 </div>
58 58 <!-- 线路编码 (* 必填项) END -->
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
... ... @@ -12,29 +12,51 @@ $(function(){
12 12 // 获取参数ID
13 13 var lineId = $.url().param('no');
14 14 if(lineId) {
15   - $get('/carpark/all',null, function(array){
16   - // 停车场下拉options属性值
17   - var options = '<option value="">-- 请选择停车场 --</option>';
18   - // 遍历array
19   - $.each(array, function(i,d){
20   - options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>';
21   - });
22   - $('#carParkSelect').html(options)
23   - });
24 15 // 填充线路下拉框选择值
25 16 $get('/line/all', null, function(array){
26   - var opGroup = '<option value="">请选择...</option><optgroup label="线路">';
  17 + /*var opGroup = '<option value="">请选择...</option><optgroup label="线路">';
27 18 var len_ = array.length;
28 19 if(len_>0) {
29 20 $.each(array, function(i, g){
30   - /*opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>';*/
31 21 opGroup += '<option value="'+ g.id +'">'+g.name+'</option>';
32 22 });
33 23 }
34 24 opGroup += '</optgroup>';
35 25 $('#lineSelect').html(opGroup).select2();
36   - $("#lineSelect").select2("val", lineId);
  26 + $("#lineSelect").select2("val", lineId);*/
  27 + var len_ = array.length,paramsD = new Array();
  28 + if(len_>0) {
  29 + $.each(array, function(i, g){
  30 + if(g.name!='' || g.name != null) {
  31 + /*paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)});*/
  32 + paramsD.push({'id': g.id ,'text':g.name});
  33 + }
  34 + });
  35 + initPinYinSelect2($('#lineSelect'),paramsD,function(selector) {
  36 + selector.select2("val", lineId);
  37 + });
  38 + }
37 39 });
  40 + $get('/carpark/all',null, function(array){
  41 + /* // 停车场下拉options属性值
  42 + var options = '<option value="">-- 请选择停车场 --</option>';
  43 + // 遍历array
  44 + $.each(array, function(i,d){
  45 + options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>';
  46 + });
  47 + $('#carParkSelect').html(options)*/
  48 + var len_ = array.length,paramsD = new Array();
  49 + paramsD.push({'id':'' ,'text':'请选择...'});
  50 + if(len_>0) {
  51 + $.each(array, function(i, g){
  52 + if(g.parkName!='' || g.parkName != null) {
  53 + paramsD.push({'id':g.parkCode ,'text':g.parkName});
  54 + }
  55 + });
  56 + initPinYinSelect2($('#carParkSelect'),paramsD,function(selector) {
  57 + });
  58 + }
  59 + });
38 60 $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?no='+lineId);
39 61 $('#lineIdInput').val(lineId);
40 62 // 早高峰开始时间
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-edit-form.js
... ... @@ -30,24 +30,47 @@ $(function() {
30 30 // 如果不为空
31 31 if(result) {
32 32 $get('/carpark/all',null, function(array){
33   - // 停车场下拉options属性值
  33 + /* // 停车场下拉options属性值
34 34 var options = '<option value="">-- 请选择停车场 --</option>';
35 35 // 遍历array
36 36 $.each(array, function(i,d){
37 37 options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>';
38 38 });
39 39  
40   - $('#carParkSelect').html(options)
  40 + $('#carParkSelect').html(options)*/
  41 + var len_ = array.length,paramsD = new Array();
  42 + paramsD.push({'id':'' ,'text':'请选择...'});
  43 + if(len_>0) {
  44 + $.each(array, function(i, g){
  45 + if(g.parkName!='' || g.parkName != null) {
  46 + paramsD.push({'id':g.parkCode ,'text':g.parkName});
  47 + }
  48 + });
  49 + initPinYinSelect2($('#carParkSelect'),paramsD,function(selector) {
  50 + selector.select2("val", result.carPark);
  51 + });
  52 + }
41 53 // 获取线路标准类型并设值
42 54 $('#typeInput').val(result.type);
43 55 // 获取表单元素下的元素并设值
44 56 putFormData(result, '#lineinformation_edit_form');
45   - $('#carParkSelect').val(result.carPark);
  57 + // $('#carParkSelect').val(result.carPark);
46 58 // 获取线路ID元素并设值
47 59 $('#lineIdInput').val(lineId);
48 60 // 填充线路下拉框选择值
49   - $get('/line/all', null, function(array){
50   - var opGroup = '<option value="">请选择...</option><optgroup label="线路">';
  61 + $get('/line/all', null, function(linearray){
  62 + var linelen_ = linearray.length,lineparamsD = new Array();
  63 + if(linelen_>0) {
  64 + $.each(linearray, function(i, g){
  65 + if(g.name!='' || g.name != null) {
  66 + lineparamsD.push({'id': g.id ,'text':g.name});
  67 + }
  68 + });
  69 + initPinYinSelect2($('#lineSelect'),lineparamsD,function(lineselector) {
  70 + lineselector.select2("val", lineId);
  71 + });
  72 + }
  73 + /*var opGroup = '<option value="">请选择...</option><optgroup label="线路">';
51 74 var len_ = array.length;
52 75 if(len_>0) {
53 76 $.each(array, function(i, g){
... ... @@ -56,7 +79,7 @@ $(function() {
56 79 }
57 80 opGroup += '</optgroup>';
58 81 $('#lineSelect').html(opGroup).select2();
59   - $("#lineSelect").select2("val", lineId);
  82 + $("#lineSelect").select2("val", lineId);*/
60 83 });
61 84 });
62 85 }
... ...
src/main/resources/static/pages/base/station/edit_select.html
... ... @@ -56,7 +56,7 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
56 56 console.log(EditStation);
57 57 // 显示选择修改方式弹出层
58 58 $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false});
59   - $('.tipso-animation').tipso({
  59 + /* $('.tipso-animation').tipso({
60 60 speed : 100,
61 61 background : '#0ed0e8',
62 62 color : '#ffffff',
... ... @@ -74,6 +74,27 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
74 74 setTimeout(function(){
75 75 $('.tipso-animation').tipso('show');
76 76 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  77 + },500); */
  78 + setTimeout(function(){
  79 + var offsetY = $('.modal-dialog').offset().top-3 ,
  80 + offsetX = $('.modal-dialog').offset().left-10 ;
  81 + $('.tipso-animation').tipso({
  82 + speed : 100,
  83 + background : '#0ed0e8',
  84 + color : '#ffffff',
  85 + position :'right',
  86 + width : 390,
  87 + delay : 400,
  88 + animationIn : 'bounceIn',
  89 + animationOut : 'bounceOut',
  90 + offsetX : -(offsetX),
  91 + offsetY : -(offsetY),
  92 + content :'<span style="display:block; float:left;font-size:x-small;line-height:12px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+
  93 + '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>',
  94 +
  95 + });
  96 + $('.tipso-animation').tipso('show');
  97 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
77 98 },500);
78 99 // 获取站点名称元素并赋值
79 100 $('#stationNamebootboxInput').val(EditStation.zdmc);
... ...
src/main/resources/static/pages/base/stationroute/add_select.html
... ... @@ -48,7 +48,7 @@
48 48 $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stationObj,lineObj,fun){
49 49 // 加载显示mobal
50 50 $('#add_select_mobal').modal({show : true,backdrop: 'static', keyboard: false});
51   - $('.tipso-animation').tipso({
  51 + /* $('.tipso-animation').tipso({
52 52 speed : 100,
53 53 background : '#0ed0e8',
54 54 color : '#ffffff',
... ... @@ -66,6 +66,27 @@ $(&#39;#add_select_mobal&#39;).on(&#39;AddSelectMobal.show&#39;, function(e,map_,drw,ajaxd_,stat
66 66 setTimeout(function(){
67 67 $('.tipso-animation').tipso('show');
68 68 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  69 + },500); */
  70 + setTimeout(function(){
  71 + var offsetY = $('.modal-dialog').offset().top-3 ,
  72 + offsetX = $('.modal-dialog').offset().left-10 ;
  73 + $('.tipso-animation').tipso({
  74 + speed : 100,
  75 + background : '#0ed0e8',
  76 + color : '#ffffff',
  77 + position :'right',
  78 + width : 390,
  79 + delay : 400,
  80 + animationIn : 'bounceIn',
  81 + animationOut : 'bounceOut',
  82 + offsetX : -(offsetX),
  83 + offsetY : -(offsetY),
  84 + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span></br>'+
  85 + '<span style="display:block; float:left;font-size:x-small">B)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span>',
  86 +
  87 + });
  88 + $('.tipso-animation').tipso('show');
  89 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
69 90 },500);
70 91 // 站点名称改变事件
71 92 $('#stationNamebootboxInput').on('change',function() {
... ...
src/main/resources/static/pages/base/stationroute/edit_select.html
... ... @@ -52,22 +52,24 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
52 52 var Station = sel[0].original;
53 53 // 显示选择修改方式弹出层
54 54 $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false});
55   - $('.tipso-animation').tipso({
56   - speed : 100,
57   - background : '#0ed0e8',
58   - color : '#ffffff',
59   - position :'right',
60   - width : 390,
61   - delay : 400,
62   - animationIn : 'bounceIn',
63   - animationOut : 'bounceOut',
64   - offsetX : -485,
65   - offsetY : -25,
66   - content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+
67   - '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>',
68   -
69   - });
70 55 setTimeout(function(){
  56 + var offsetY = $('.modal-dialog').offset().top-3 ,
  57 + offsetX = $('.modal-dialog').offset().left-10 ;
  58 + $('.tipso-animation').tipso({
  59 + speed : 100,
  60 + background : '#0ed0e8',
  61 + color : '#ffffff',
  62 + position :'right',
  63 + width : 390,
  64 + delay : 400,
  65 + animationIn : 'bounceIn',
  66 + animationOut : 'bounceOut',
  67 + offsetX : -(offsetX),
  68 + offsetY : -(offsetY),
  69 + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+
  70 + '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>',
  71 +
  72 + });
71 73 $('.tipso-animation').tipso('show');
72 74 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
73 75 },500);
... ...
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
... ... @@ -33,7 +33,7 @@
33 33 </sa-Select5>
34 34 </td>
35 35 <td>
36   - <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['clBm_like']" placeholder="输入内部编号..."/>
  36 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['clZbh_like']" placeholder="输入内部编号..."/>
37 37 </td>
38 38 <td></td>
39 39 <td></td>
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -4301,432 +4301,432 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4301 4301 }
4302 4302 ]
4303 4303 );
4304   -/**
4305   - * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能
4306   - * name(必须),控件的名字
4307   - * ds,外部数据源
4308   - * cl1,车辆1属性
4309   - * cl2,车辆2属性
4310   - * j1,驾驶员1属性
4311   - * j2,驾驶员2属性
4312   - * s1,售票员1属性
4313   - * s2,售票员2属性
4314   - */
4315   -angular.module('ScheduleApp').directive(
4316   - 'saPlaninfoedit',
4317   - [
4318   - function() {
4319   - return {
4320   - restrict: 'E',
4321   - templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html',
4322   - scope: { // 独立作用域
4323   - ds: '=ngModel'
4324   - },
4325   - controllerAs: '$saPlanInfoEditCtrl',
4326   - bindToController: true,
4327   - controller: function() {
4328   - //var self = this;
4329   -
4330   - },
4331   -
4332   - compile: function(tElem, tAttrs) {
4333   - // 获取属性
4334   - var $attr_name = tAttrs["name"]; // 控件的名字
4335   - if (!$attr_name) {
4336   - throw {msg: "saPlaninfoedit指令name属性不能为空"};
4337   - }
4338   -
4339   - // 内部controlAs名字
4340   - var ctrlAs = '$saPlanInfoEditCtrl';
4341   -
4342   -
4343   - // 内部变量,原始车辆,人员数据
4344   - var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组
4345   - var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组
4346   - var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组
4347   - var old_isfb = false; // 是否有分班
4348   - var old_isfb_index = 0; // 分班开始索引
4349   - var old_hasJCBC = false; // 是否有进场班次
4350   - var old_max_fcno = 0; // 最大发车顺序号
4351   - var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号
4352   - var old_half_bcs = 0; // 一般的班次数量
4353   -
4354   - // 内部变量,变更的车辆,变更的人员
4355   - var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号)
4356   - var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号)
4357   - var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号)
4358   - var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号)
4359   - var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号)
4360   - var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号)
4361   -
4362   - return {
4363   - pre: function(scope, element, attr) {
4364   -
4365   - },
4366   - post: function(scope, element, attr) {
4367   -
4368   - /**
4369   - * 刷新车辆数据。
4370   - */
4371   - scope[ctrlAs].$$internal_refresh_dsdata_cl = function() {
4372   - if (new_cl1) {
4373   - var new_cl1_id = new_cl1.split("_")[0];
4374   - var new_cl1_zbh = new_cl1.split("_")[1];
4375   -
4376   - if (new_cl2) {
4377   - var new_cl2_id = new_cl2.split("_")[0];
4378   - var new_cl2_zbh = new_cl2.split("_")[1];
4379   -
4380   - if (old_isfb) { // 使用分班判定
4381   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4382   - if (index < old_isfb_index) {
4383   - obj.cl = new_cl1_id;
4384   - obj.clZbh = new_cl1_zbh;
4385   - } else {
4386   - obj.cl = new_cl2_id;
4387   - obj.clZbh = new_cl2_zbh;
4388   - }
4389   - });
4390   -
4391   - } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
4392   - angular.forEach(scope[ctrlAs].ds, function(obj) {
4393   - if (obj.fcno <= old_firstJCBCFcno) {
4394   - obj.cl = new_cl1_id;
4395   - obj.clZbh = new_cl1_zbh;
4396   - } else {
4397   - obj.cl = new_cl2_id;
4398   - obj.clZbh = new_cl2_zbh;
4399   - }
4400   - });
4401   - } else { // 使用一半一半班次判定
4402   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4403   - if (index < old_half_bcs) {
4404   - obj.cl = new_cl1_id;
4405   - obj.clZbh = new_cl1_zbh;
4406   - } else {
4407   - obj.cl = new_cl2_id;
4408   - obj.clZbh = new_cl2_zbh;
4409   - }
4410   - });
4411   - }
4412   -
4413   - } else {
4414   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4415   - obj.cl = new_cl1_id;
4416   - obj.clZbh = new_cl1_zbh;
4417   - });
4418   - }
4419   -
4420   - } else {
4421   - // 使用旧的
4422   - angular.forEach(old_cl, function(value, key) {
4423   - angular.forEach(value, function(i) {
4424   - scope[ctrlAs].ds[i].cl = key.split("_")[0];
4425   - scope[ctrlAs].ds[i].clZbh = key.split("_")[1];
4426   - });
4427   - });
4428   - }
4429   - };
4430   -
4431   - /**
4432   - * 刷新驾驶员数据。
4433   - */
4434   - scope[ctrlAs].$$internal_refresh_dsdata_j = function() {
4435   - if (new_j1) {
4436   - var new_j1_id = new_j1.split("_")[0];
4437   - var new_j1_name = new_j1.split("_")[1];
4438   - var new_j1_gh = new_j1.split("_")[2];
4439   -
4440   - if (new_j2) {
4441   - var new_j2_id = new_j2.split("_")[0];
4442   - var new_j2_name = new_j2.split("_")[1];
4443   - var new_j2_gh = new_j2.split("_")[2];
4444   -
4445   - if (old_isfb) { // 使用分班判定
4446   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4447   - if (index < old_isfb_index) {
4448   - obj.j = new_j1_id;
4449   - obj.jGh = new_j1_gh;
4450   - obj.jName = new_j1_name;
4451   - } else {
4452   - obj.j = new_j2_id;
4453   - obj.jGh = new_j2_gh;
4454   - obj.jName = new_j2_name;
4455   - }
4456   - });
4457   -
4458   - } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
4459   - angular.forEach(scope[ctrlAs].ds, function(obj) {
4460   - if (obj.fcno <= old_firstJCBCFcno) {
4461   - obj.j = new_j1_id;
4462   - obj.jGh = new_j1_gh;
4463   - obj.jName = new_j1_name;
4464   - } else {
4465   - obj.j = new_j2_id;
4466   - obj.jGh = new_j2_gh;
4467   - obj.jName = new_j2_name;
4468   - }
4469   - });
4470   - } else { // 使用一半一半班次判定
4471   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4472   - if (index < old_half_bcs) {
4473   - obj.j = new_j1_id;
4474   - obj.jGh = new_j1_gh;
4475   - obj.jName = new_j1_name;
4476   - } else {
4477   - obj.j = new_j2_id;
4478   - obj.jGh = new_j2_gh;
4479   - obj.jName = new_j2_name;
4480   - }
4481   - });
4482   - }
4483   -
4484   - } else {
4485   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4486   - obj.j = new_j1_id;
4487   - obj.jGh = new_j1_gh;
4488   - obj.jName = new_j1_name;
4489   - });
4490   - }
4491   -
4492   - } else {
4493   - // 使用旧的
4494   - angular.forEach(old_j, function(value, key) {
4495   - angular.forEach(value, function(i) {
4496   - scope[ctrlAs].ds[i].j = key.split("_")[0];
4497   - scope[ctrlAs].ds[i].jName = key.split("_")[1];
4498   - scope[ctrlAs].ds[i].jGh = key.split("_")[2];
4499   - });
4500   - });
4501   - }
4502   - };
4503   - /**
4504   - * 刷新售票员数据。
4505   - */
4506   - scope[ctrlAs].$$internal_refresh_dsdata_s = function() {
4507   - if (new_s1) {
4508   - var new_s1_id = new_s1.split("_")[0];
4509   - var new_s1_name = new_s1.split("_")[1];
4510   - var new_s1_gh = new_s1.split("_")[2];
4511   -
4512   - if (new_s2) {
4513   - var new_s2_id = new_s2.split("_")[0];
4514   - var new_s2_name = new_s2.split("_")[1];
4515   - var new_s2_gh = new_s2.split("_")[2];
4516   -
4517   - if (old_isfb) { // 使用分班判定
4518   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4519   - if (index < old_isfb_index) {
4520   - obj.s = new_s1_id;
4521   - obj.sGh = new_s1_gh;
4522   - obj.sName = new_s1_name;
4523   - } else {
4524   - obj.s = new_s2_id;
4525   - obj.sGh = new_s2_gh;
4526   - obj.sName = new_s2_name;
4527   - }
4528   - });
4529   -
4530   - } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
4531   - angular.forEach(scope[ctrlAs].ds, function(obj) {
4532   - if (obj.fcno <= old_firstJCBCFcno) {
4533   - obj.s = new_s1_id;
4534   - obj.sGh = new_s1_gh;
4535   - obj.sName = new_s1_name;
4536   - } else {
4537   - obj.s = new_s2_id;
4538   - obj.sGh = new_s2_gh;
4539   - obj.sName = new_s2_name;
4540   - }
4541   - });
4542   - } else { // 使用一半一半班次判定
4543   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4544   - if (index < old_half_bcs) {
4545   - obj.s = new_s1_id;
4546   - obj.sGh = new_s1_gh;
4547   - obj.sName = new_s1_name;
4548   - } else {
4549   - obj.s = new_s2_id;
4550   - obj.sGh = new_s2_gh;
4551   - obj.sName = new_s2_name;
4552   - }
4553   - });
4554   - }
4555   -
4556   - } else {
4557   - angular.forEach(scope[ctrlAs].ds, function(obj, index) {
4558   - obj.s = new_s1_id;
4559   - obj.sGh = new_s1_gh;
4560   - obj.sName = new_s1_name;
4561   - });
4562   - }
4563   -
4564   - } else {
4565   - // 先清空
4566   - angular.forEach(scope[ctrlAs].ds, function(obj) {
4567   - obj.s = undefined;
4568   - obj.sGh = undefined;
4569   - obj.sName = undefined;
4570   - });
4571   -
4572   - // 使用旧的
4573   - angular.forEach(old_s, function(value, key) {
4574   - angular.forEach(value, function(i) {
4575   - scope[ctrlAs].ds[i].s = key.split("_")[0];
4576   - scope[ctrlAs].ds[i].sName = key.split("_")[1];
4577   - scope[ctrlAs].ds[i].sGh = key.split("_")[2];
4578   - });
4579   - });
4580   - }
4581   - };
4582   -
4583   - /**
4584   - * 刷新内部数据。
4585   - */
4586   - scope[ctrlAs].$$internal_refresh_dsdata = function() {
4587   - // 更新车辆
4588   - scope[ctrlAs].$$internal_refresh_dsdata_cl();
4589   -
4590   - // 更新驾驶员
4591   - scope[ctrlAs].$$internal_refresh_dsdata_j();
4592   -
4593   - // 更新售票员
4594   - scope[ctrlAs].$$internal_refresh_dsdata_s();
4595   - };
4596   -
4597   - // -------------- 监控function ---------------//
4598   - attr.$observe('cl1', function(value) {
4599   - if (value && value != "") {
4600   - var obj = JSON.parse(value);
4601   - if (obj.id && obj.zbh) {
4602   - new_cl1 = obj.id + "_" + obj.zbh;
4603   - } else {
4604   - new_cl1 = undefined;
4605   - }
4606   - scope[ctrlAs].$$internal_refresh_dsdata();
4607   - }
4608   - });
4609   -
4610   - attr.$observe('cl2', function(value) {
4611   - if (value && value != "") {
4612   - var obj = JSON.parse(value);
4613   - if (obj.id && obj.zbh) {
4614   - new_cl2 = obj.id + "_" + obj.zbh;
4615   - } else {
4616   - new_cl2 = undefined;
4617   - }
4618   - scope[ctrlAs].$$internal_refresh_dsdata();
4619   - }
4620   - });
4621   -
4622   - attr.$observe('j1', function(value) {
4623   - if (value && value != "") {
4624   - var obj = JSON.parse(value);
4625   - if (obj.id && obj.name && obj.jobCode) {
4626   - new_j1 = obj.id + "_" + obj.name + "_" + obj.jobCode;
4627   - } else {
4628   - new_j1 = undefined;
4629   - }
4630   - scope[ctrlAs].$$internal_refresh_dsdata();
4631   - }
4632   - });
4633   -
4634   - attr.$observe('j2', function(value) {
4635   - if (value && value != "") {
4636   - var obj = JSON.parse(value);
4637   - if (obj.id && obj.name && obj.jobCode) {
4638   - new_j2 = obj.id + "_" + obj.name + "_" + obj.jobCode;
4639   - } else {
4640   - new_j2 = undefined;
4641   - }
4642   - scope[ctrlAs].$$internal_refresh_dsdata();
4643   - }
4644   - });
4645   -
4646   - attr.$observe('s1', function(value) {
4647   - if (value && value != "") {
4648   - var obj = JSON.parse(value);
4649   - if (obj.id && obj.name && obj.jobCode) {
4650   - new_s1 = obj.id + "_" + obj.name + "_" + obj.jobCode;
4651   - } else {
4652   - new_s1 = undefined;
4653   - }
4654   - scope[ctrlAs].$$internal_refresh_dsdata();
4655   - }
4656   - });
4657   -
4658   - attr.$observe('s2', function(value) {
4659   - if (value && value != "") {
4660   - var obj = JSON.parse(value);
4661   - if (obj.id && obj.name && obj.jobCode) {
4662   - new_s2 = obj.id + "_" + obj.name + "_" + obj.jobCode;
4663   - } else {
4664   - new_s2 = undefined;
4665   - }
4666   - scope[ctrlAs].$$internal_refresh_dsdata();
4667   - }
4668   - });
4669   -
4670   - scope.$watch(
4671   - function() {
4672   - return scope[ctrlAs].ds;
4673   - },
4674   - function(newValue, oldValue) {
4675   - if (newValue && newValue.length > 0) {
4676   -
4677   - var j1 = newValue[0].j;
4678   -
4679   - angular.forEach(newValue, function(obj, index) {
4680   - var k1 = obj.cl + "_" + obj.clZbh;
4681   - var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh;
4682   - var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh;
4683   -
4684   - if (!old_cl[k1]) {
4685   - old_cl[k1] = [];
4686   - }
4687   - if (!old_j[k2] && k2) {
4688   - old_j[k2] = [];
4689   - }
4690   - if (!old_s[k3] && k3) {
4691   - old_s[k3] = [];
4692   - }
4693   -
4694   - // 闭包
4695   - (function(i) {
4696   - old_cl[k1].push(i);
4697   - if (k2) {
4698   - old_j[k2].push(i);
4699   - }
4700   - if (k3) {
4701   - old_s[k3].push(i);
4702   - }
4703   - })(index);
4704   -
4705   - // 判断是否分班
4706   - if (j1 != obj.j && !old_isfb) {
4707   - old_isfb = true;
4708   - old_isfb_index = index;
4709   - }
4710   -
4711   - // 判断进出场
4712   - if (obj.bcType == 'in' && !old_hasJCBC) {
4713   - old_hasJCBC = true;
4714   - old_firstJCBCFcno = obj.fcno;
4715   - }
4716   - });
4717   -
4718   - old_max_fcno = newValue[newValue.length - 1].fcno;
4719   - old_half_bcs = newValue.length / 2;
4720   -
4721   - // 可以用resource封装一下
4722   - // TODO:
4723   - }
4724   - }
4725   - );
4726   - }
4727   - }
4728   - }
4729   - };
4730   - }
4731   - ]
  4304 +/**
  4305 + * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能
  4306 + * name(必须),控件的名字
  4307 + * ds,外部数据源
  4308 + * cl1,车辆1属性
  4309 + * cl2,车辆2属性
  4310 + * j1,驾驶员1属性
  4311 + * j2,驾驶员2属性
  4312 + * s1,售票员1属性
  4313 + * s2,售票员2属性
  4314 + */
  4315 +angular.module('ScheduleApp').directive(
  4316 + 'saPlaninfoedit',
  4317 + [
  4318 + function() {
  4319 + return {
  4320 + restrict: 'E',
  4321 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html',
  4322 + scope: { // 独立作用域
  4323 + ds: '=ngModel'
  4324 + },
  4325 + controllerAs: '$saPlanInfoEditCtrl',
  4326 + bindToController: true,
  4327 + controller: function() {
  4328 + //var self = this;
  4329 +
  4330 + },
  4331 +
  4332 + compile: function(tElem, tAttrs) {
  4333 + // 获取属性
  4334 + var $attr_name = tAttrs["name"]; // 控件的名字
  4335 + if (!$attr_name) {
  4336 + throw {msg: "saPlaninfoedit指令name属性不能为空"};
  4337 + }
  4338 +
  4339 + // 内部controlAs名字
  4340 + var ctrlAs = '$saPlanInfoEditCtrl';
  4341 +
  4342 +
  4343 + // 内部变量,原始车辆,人员数据
  4344 + var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组
  4345 + var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组
  4346 + var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组
  4347 + var old_isfb = false; // 是否有分班
  4348 + var old_isfb_index = 0; // 分班开始索引
  4349 + var old_hasJCBC = false; // 是否有进场班次
  4350 + var old_max_fcno = 0; // 最大发车顺序号
  4351 + var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号
  4352 + var old_half_bcs = 0; // 一般的班次数量
  4353 +
  4354 + // 内部变量,变更的车辆,变更的人员
  4355 + var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号)
  4356 + var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号)
  4357 + var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号)
  4358 + var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号)
  4359 + var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号)
  4360 + var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号)
  4361 +
  4362 + return {
  4363 + pre: function(scope, element, attr) {
  4364 +
  4365 + },
  4366 + post: function(scope, element, attr) {
  4367 +
  4368 + /**
  4369 + * 刷新车辆数据。
  4370 + */
  4371 + scope[ctrlAs].$$internal_refresh_dsdata_cl = function() {
  4372 + if (new_cl1) {
  4373 + var new_cl1_id = new_cl1.split("_")[0];
  4374 + var new_cl1_zbh = new_cl1.split("_")[1];
  4375 +
  4376 + if (new_cl2) {
  4377 + var new_cl2_id = new_cl2.split("_")[0];
  4378 + var new_cl2_zbh = new_cl2.split("_")[1];
  4379 +
  4380 + if (old_isfb) { // 使用分班判定
  4381 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4382 + if (index < old_isfb_index) {
  4383 + obj.cl = new_cl1_id;
  4384 + obj.clZbh = new_cl1_zbh;
  4385 + } else {
  4386 + obj.cl = new_cl2_id;
  4387 + obj.clZbh = new_cl2_zbh;
  4388 + }
  4389 + });
  4390 +
  4391 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4392 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4393 + if (obj.fcno <= old_firstJCBCFcno) {
  4394 + obj.cl = new_cl1_id;
  4395 + obj.clZbh = new_cl1_zbh;
  4396 + } else {
  4397 + obj.cl = new_cl2_id;
  4398 + obj.clZbh = new_cl2_zbh;
  4399 + }
  4400 + });
  4401 + } else { // 使用一半一半班次判定
  4402 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4403 + if (index < old_half_bcs) {
  4404 + obj.cl = new_cl1_id;
  4405 + obj.clZbh = new_cl1_zbh;
  4406 + } else {
  4407 + obj.cl = new_cl2_id;
  4408 + obj.clZbh = new_cl2_zbh;
  4409 + }
  4410 + });
  4411 + }
  4412 +
  4413 + } else {
  4414 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4415 + obj.cl = new_cl1_id;
  4416 + obj.clZbh = new_cl1_zbh;
  4417 + });
  4418 + }
  4419 +
  4420 + } else {
  4421 + // 使用旧的
  4422 + angular.forEach(old_cl, function(value, key) {
  4423 + angular.forEach(value, function(i) {
  4424 + scope[ctrlAs].ds[i].cl = key.split("_")[0];
  4425 + scope[ctrlAs].ds[i].clZbh = key.split("_")[1];
  4426 + });
  4427 + });
  4428 + }
  4429 + };
  4430 +
  4431 + /**
  4432 + * 刷新驾驶员数据。
  4433 + */
  4434 + scope[ctrlAs].$$internal_refresh_dsdata_j = function() {
  4435 + if (new_j1) {
  4436 + var new_j1_id = new_j1.split("_")[0];
  4437 + var new_j1_name = new_j1.split("_")[1];
  4438 + var new_j1_gh = new_j1.split("_")[2];
  4439 +
  4440 + if (new_j2) {
  4441 + var new_j2_id = new_j2.split("_")[0];
  4442 + var new_j2_name = new_j2.split("_")[1];
  4443 + var new_j2_gh = new_j2.split("_")[2];
  4444 +
  4445 + if (old_isfb) { // 使用分班判定
  4446 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4447 + if (index < old_isfb_index) {
  4448 + obj.j = new_j1_id;
  4449 + obj.jGh = new_j1_gh;
  4450 + obj.jName = new_j1_name;
  4451 + } else {
  4452 + obj.j = new_j2_id;
  4453 + obj.jGh = new_j2_gh;
  4454 + obj.jName = new_j2_name;
  4455 + }
  4456 + });
  4457 +
  4458 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4459 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4460 + if (obj.fcno <= old_firstJCBCFcno) {
  4461 + obj.j = new_j1_id;
  4462 + obj.jGh = new_j1_gh;
  4463 + obj.jName = new_j1_name;
  4464 + } else {
  4465 + obj.j = new_j2_id;
  4466 + obj.jGh = new_j2_gh;
  4467 + obj.jName = new_j2_name;
  4468 + }
  4469 + });
  4470 + } else { // 使用一半一半班次判定
  4471 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4472 + if (index < old_half_bcs) {
  4473 + obj.j = new_j1_id;
  4474 + obj.jGh = new_j1_gh;
  4475 + obj.jName = new_j1_name;
  4476 + } else {
  4477 + obj.j = new_j2_id;
  4478 + obj.jGh = new_j2_gh;
  4479 + obj.jName = new_j2_name;
  4480 + }
  4481 + });
  4482 + }
  4483 +
  4484 + } else {
  4485 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4486 + obj.j = new_j1_id;
  4487 + obj.jGh = new_j1_gh;
  4488 + obj.jName = new_j1_name;
  4489 + });
  4490 + }
  4491 +
  4492 + } else {
  4493 + // 使用旧的
  4494 + angular.forEach(old_j, function(value, key) {
  4495 + angular.forEach(value, function(i) {
  4496 + scope[ctrlAs].ds[i].j = key.split("_")[0];
  4497 + scope[ctrlAs].ds[i].jName = key.split("_")[1];
  4498 + scope[ctrlAs].ds[i].jGh = key.split("_")[2];
  4499 + });
  4500 + });
  4501 + }
  4502 + };
  4503 + /**
  4504 + * 刷新售票员数据。
  4505 + */
  4506 + scope[ctrlAs].$$internal_refresh_dsdata_s = function() {
  4507 + if (new_s1) {
  4508 + var new_s1_id = new_s1.split("_")[0];
  4509 + var new_s1_name = new_s1.split("_")[1];
  4510 + var new_s1_gh = new_s1.split("_")[2];
  4511 +
  4512 + if (new_s2) {
  4513 + var new_s2_id = new_s2.split("_")[0];
  4514 + var new_s2_name = new_s2.split("_")[1];
  4515 + var new_s2_gh = new_s2.split("_")[2];
  4516 +
  4517 + if (old_isfb) { // 使用分班判定
  4518 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4519 + if (index < old_isfb_index) {
  4520 + obj.s = new_s1_id;
  4521 + obj.sGh = new_s1_gh;
  4522 + obj.sName = new_s1_name;
  4523 + } else {
  4524 + obj.s = new_s2_id;
  4525 + obj.sGh = new_s2_gh;
  4526 + obj.sName = new_s2_name;
  4527 + }
  4528 + });
  4529 +
  4530 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4531 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4532 + if (obj.fcno <= old_firstJCBCFcno) {
  4533 + obj.s = new_s1_id;
  4534 + obj.sGh = new_s1_gh;
  4535 + obj.sName = new_s1_name;
  4536 + } else {
  4537 + obj.s = new_s2_id;
  4538 + obj.sGh = new_s2_gh;
  4539 + obj.sName = new_s2_name;
  4540 + }
  4541 + });
  4542 + } else { // 使用一半一半班次判定
  4543 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4544 + if (index < old_half_bcs) {
  4545 + obj.s = new_s1_id;
  4546 + obj.sGh = new_s1_gh;
  4547 + obj.sName = new_s1_name;
  4548 + } else {
  4549 + obj.s = new_s2_id;
  4550 + obj.sGh = new_s2_gh;
  4551 + obj.sName = new_s2_name;
  4552 + }
  4553 + });
  4554 + }
  4555 +
  4556 + } else {
  4557 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4558 + obj.s = new_s1_id;
  4559 + obj.sGh = new_s1_gh;
  4560 + obj.sName = new_s1_name;
  4561 + });
  4562 + }
  4563 +
  4564 + } else {
  4565 + // 先清空
  4566 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4567 + obj.s = undefined;
  4568 + obj.sGh = undefined;
  4569 + obj.sName = undefined;
  4570 + });
  4571 +
  4572 + // 使用旧的
  4573 + angular.forEach(old_s, function(value, key) {
  4574 + angular.forEach(value, function(i) {
  4575 + scope[ctrlAs].ds[i].s = key.split("_")[0];
  4576 + scope[ctrlAs].ds[i].sName = key.split("_")[1];
  4577 + scope[ctrlAs].ds[i].sGh = key.split("_")[2];
  4578 + });
  4579 + });
  4580 + }
  4581 + };
  4582 +
  4583 + /**
  4584 + * 刷新内部数据。
  4585 + */
  4586 + scope[ctrlAs].$$internal_refresh_dsdata = function() {
  4587 + // 更新车辆
  4588 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  4589 +
  4590 + // 更新驾驶员
  4591 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  4592 +
  4593 + // 更新售票员
  4594 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  4595 + };
  4596 +
  4597 + // -------------- 监控function ---------------//
  4598 + attr.$observe('cl1', function(value) {
  4599 + if (value && value != "") {
  4600 + var obj = JSON.parse(value);
  4601 + if (obj.id && obj.zbh) {
  4602 + new_cl1 = obj.id + "_" + obj.zbh;
  4603 + } else {
  4604 + new_cl1 = undefined;
  4605 + }
  4606 + scope[ctrlAs].$$internal_refresh_dsdata();
  4607 + }
  4608 + });
  4609 +
  4610 + attr.$observe('cl2', function(value) {
  4611 + if (value && value != "") {
  4612 + var obj = JSON.parse(value);
  4613 + if (obj.id && obj.zbh) {
  4614 + new_cl2 = obj.id + "_" + obj.zbh;
  4615 + } else {
  4616 + new_cl2 = undefined;
  4617 + }
  4618 + scope[ctrlAs].$$internal_refresh_dsdata();
  4619 + }
  4620 + });
  4621 +
  4622 + attr.$observe('j1', function(value) {
  4623 + if (value && value != "") {
  4624 + var obj = JSON.parse(value);
  4625 + if (obj.id && obj.name && obj.jobCode) {
  4626 + new_j1 = obj.id + "_" + obj.name + "_" + obj.jobCode;
  4627 + } else {
  4628 + new_j1 = undefined;
  4629 + }
  4630 + scope[ctrlAs].$$internal_refresh_dsdata();
  4631 + }
  4632 + });
  4633 +
  4634 + attr.$observe('j2', function(value) {
  4635 + if (value && value != "") {
  4636 + var obj = JSON.parse(value);
  4637 + if (obj.id && obj.name && obj.jobCode) {
  4638 + new_j2 = obj.id + "_" + obj.name + "_" + obj.jobCode;
  4639 + } else {
  4640 + new_j2 = undefined;
  4641 + }
  4642 + scope[ctrlAs].$$internal_refresh_dsdata();
  4643 + }
  4644 + });
  4645 +
  4646 + attr.$observe('s1', function(value) {
  4647 + if (value && value != "") {
  4648 + var obj = JSON.parse(value);
  4649 + if (obj.id && obj.name && obj.jobCode) {
  4650 + new_s1 = obj.id + "_" + obj.name + "_" + obj.jobCode;
  4651 + } else {
  4652 + new_s1 = undefined;
  4653 + }
  4654 + scope[ctrlAs].$$internal_refresh_dsdata();
  4655 + }
  4656 + });
  4657 +
  4658 + attr.$observe('s2', function(value) {
  4659 + if (value && value != "") {
  4660 + var obj = JSON.parse(value);
  4661 + if (obj.id && obj.name && obj.jobCode) {
  4662 + new_s2 = obj.id + "_" + obj.name + "_" + obj.jobCode;
  4663 + } else {
  4664 + new_s2 = undefined;
  4665 + }
  4666 + scope[ctrlAs].$$internal_refresh_dsdata();
  4667 + }
  4668 + });
  4669 +
  4670 + scope.$watch(
  4671 + function() {
  4672 + return scope[ctrlAs].ds;
  4673 + },
  4674 + function(newValue, oldValue) {
  4675 + if (newValue && newValue.length > 0) {
  4676 +
  4677 + var j1 = newValue[0].j;
  4678 +
  4679 + angular.forEach(newValue, function(obj, index) {
  4680 + var k1 = obj.cl + "_" + obj.clZbh;
  4681 + var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh;
  4682 + var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh;
  4683 +
  4684 + if (!old_cl[k1]) {
  4685 + old_cl[k1] = [];
  4686 + }
  4687 + if (!old_j[k2] && k2) {
  4688 + old_j[k2] = [];
  4689 + }
  4690 + if (!old_s[k3] && k3) {
  4691 + old_s[k3] = [];
  4692 + }
  4693 +
  4694 + // 闭包
  4695 + (function(i) {
  4696 + old_cl[k1].push(i);
  4697 + if (k2) {
  4698 + old_j[k2].push(i);
  4699 + }
  4700 + if (k3) {
  4701 + old_s[k3].push(i);
  4702 + }
  4703 + })(index);
  4704 +
  4705 + // 判断是否分班
  4706 + if (j1 != obj.j && !old_isfb) {
  4707 + old_isfb = true;
  4708 + old_isfb_index = index;
  4709 + }
  4710 +
  4711 + // 判断进出场
  4712 + if (obj.bcType == 'in' && !old_hasJCBC) {
  4713 + old_hasJCBC = true;
  4714 + old_firstJCBCFcno = obj.fcno;
  4715 + }
  4716 + });
  4717 +
  4718 + old_max_fcno = newValue[newValue.length - 1].fcno;
  4719 + old_half_bcs = newValue.length / 2;
  4720 +
  4721 + // 可以用resource封装一下
  4722 + // TODO:
  4723 + }
  4724 + }
  4725 + );
  4726 + }
  4727 + }
  4728 + }
  4729 + };
  4730 + }
  4731 + ]
4732 4732 );
4733 4733 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -558,7 +558,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource
558 558 return {
559 559 rest: $resource(
560 560 '/sr1fc/:id',
561   - {order: 'xl.id,updateDate', direction: 'ASC,DESC', id: '@id'},
  561 + {order: 'xl.id,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'},
562 562 {
563 563 list: {
564 564 method: 'GET',
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
... ... @@ -859,63 +859,63 @@ ScheduleApp.config([
859 859  
860 860 }
861 861 ]);
862   -// ui route 配置
863   -
864   -/** 排班调度值勤日报配置route */
865   -ScheduleApp.config([
866   - '$stateProvider',
867   - '$urlRouterProvider',
868   - function($stateProvider, $urlRouterProvider) {
869   - // 默认路由
870   - //$urlRouterProvider.otherwise('/busConfig.html');
871   -
872   - $stateProvider
873   - .state("schedulePlanReportExtManage", {
874   - url: '/schedulePlanReportExtManage',
875   - views: {
876   - "": {
877   - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/index.html'
878   - },
879   - "schedulePlanReportExtManage_list@schedulePlanReportExtManage": {
880   - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html'
881   - }
882   - },
883   -
884   - resolve: {
885   - deps: ['$ocLazyLoad', function($ocLazyLoad) {
886   - return $ocLazyLoad.load({
887   - name: 'schedulePlanManage_module',
888   - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
889   - files: [
890   - "assets/bower_components/angular-ui-select/dist/select.min.css",
891   - "assets/bower_components/angular-ui-select/dist/select.min.js",
892   - "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js"
893   - ]
894   - });
895   - }]
896   - }
897   - })
898   - .state("schedulePlanInfoExtFormManage_edit", { // 修改套跑form
899   - url: '/schedulePlanInfoExtFormManage_edit/:xlId/:xlName/:sd/:lpId/:lpName',
900   - views: {
901   - "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html'}
902   - },
903   - resolve: {
904   - deps: ['$ocLazyLoad', function($ocLazyLoad) {
905   - return $ocLazyLoad.load({
906   - name: 'schedulePlanManage_module',
907   - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
908   - files: [
909   - "assets/bower_components/angular-ui-select/dist/select.min.css",
910   - "assets/bower_components/angular-ui-select/dist/select.min.js",
911   - "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js"
912   - ]
913   - });
914   - }]
915   - }
916   - });
917   -
918   - }
  862 +// ui route 配置
  863 +
  864 +/** 排班调度值勤日报配置route */
  865 +ScheduleApp.config([
  866 + '$stateProvider',
  867 + '$urlRouterProvider',
  868 + function($stateProvider, $urlRouterProvider) {
  869 + // 默认路由
  870 + //$urlRouterProvider.otherwise('/busConfig.html');
  871 +
  872 + $stateProvider
  873 + .state("schedulePlanReportExtManage", {
  874 + url: '/schedulePlanReportExtManage',
  875 + views: {
  876 + "": {
  877 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/index.html'
  878 + },
  879 + "schedulePlanReportExtManage_list@schedulePlanReportExtManage": {
  880 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html'
  881 + }
  882 + },
  883 +
  884 + resolve: {
  885 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  886 + return $ocLazyLoad.load({
  887 + name: 'schedulePlanManage_module',
  888 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  889 + files: [
  890 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  891 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  892 + "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js"
  893 + ]
  894 + });
  895 + }]
  896 + }
  897 + })
  898 + .state("schedulePlanInfoExtFormManage_edit", { // 修改套跑form
  899 + url: '/schedulePlanInfoExtFormManage_edit/:xlId/:xlName/:sd/:lpId/:lpName',
  900 + views: {
  901 + "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html'}
  902 + },
  903 + resolve: {
  904 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  905 + return $ocLazyLoad.load({
  906 + name: 'schedulePlanManage_module',
  907 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  908 + files: [
  909 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  910 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  911 + "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js"
  912 + ]
  913 + });
  914 + }]
  915 + }
  916 + });
  917 +
  918 + }
919 919 ]);
920 920 // ui route 配置
921 921  
... ...
src/main/resources/static/pages/scheduleApp/module/core/busConfig/list.html
... ... @@ -7,8 +7,8 @@
7 7 <th style="width: 50px;">序号</th>
8 8 <th style="width: 150px;">线路</th>
9 9 <th style="width: 150px;">内部编号</th>
  10 + <th style="width: 150px;">设备编号</th>
10 11 <th style="width: 150px;">启用日期</th>
11   - <th style="width: 150px;">终止日期</th>
12 12 <th >停车点</th>
13 13 <th style="width: 80px;" >状态</th>
14 14 <th style="width: 21%">操作</th>
... ... @@ -67,10 +67,10 @@
67 67 <span ng-bind="info.cl.insideCode"></span>
68 68 </td>
69 69 <td>
70   - <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span>
  70 + <span ng-bind="info.cl.equipmentCode"></span>
71 71 </td>
72 72 <td>
73   - <span ng-bind="info.zzrq | date: 'yyyy-MM-dd'"></span>
  73 + <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span>
74 74 </td>
75 75 <td>
76 76 <span ng-bind="info.tcd"></span>
... ...
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
... ... @@ -33,7 +33,11 @@
33 33 </td>
34 34 <td></td>
35 35 <td></td>
36   - <td></td>
  36 + <td>
  37 + <input type="text" class="form-control form-filter input-sm"
  38 + ng-model="ctrl.searchCondition()['carConfigInfo.cl.insideCode_like']"
  39 + placeholder="车辆自编号..."/>
  40 + </td>
37 41 <td></td>
38 42 <td></td>
39 43 <td></td>
... ... @@ -60,9 +64,18 @@
60 64 <span ng-bind="info.xl.name"></span>
61 65 </td>
62 66 <td>
63   - <span ng-bind="info.updateBy.userName"></span>
64   - /
65   - <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  67 + <div>
  68 + <a href="#">
  69 + <span ng-bind="info.updateBy.userName"></span>
  70 + </a>
  71 + </div>
  72 + <div>
  73 + <a href="#">
  74 + <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  75 + </a>
  76 + </div>
  77 +
  78 +
66 79 </td>
67 80 <td>
68 81 <span ng-bind="info.qyrq | date: 'yyyy-MM-dd '"></span>
... ...
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/service.js
... ... @@ -3,7 +3,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;ScheduleRuleManageService_g&#39;, [&#39;$resource
3 3 return {
4 4 rest: $resource(
5 5 '/sr1fc/:id',
6   - {order: 'xl.id,updateDate', direction: 'ASC,DESC', id: '@id'},
  6 + {order: 'xl.id,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'},
7 7 {
8 8 list: {
9 9 method: 'GET',
... ...
src/main/resources/static/real_control_v2/js/north/toolbar.js
... ... @@ -42,7 +42,7 @@ var gb_northToolbar = (function () {
42 42 //exit
43 43 $('.north .north-toolbar .exit-system').on('click', function () {
44 44 //关闭websocket 连接
45   - gb_sch_websocket.sock().close();
  45 + gb_sch_websocket.sock().close(1000, '退出线调');
46 46 window.location.href = '/pages/control/lineallot/allot.html';
47 47 });
48 48  
... ...
src/test/resources/testdata/problem.properties
... ... @@ -29,3 +29,5 @@
29 29 ##28=时刻表导出,元数据ktr转换站名匹配有问题
30 30 ##29=时刻编辑,超过70个班次,报错,改成150个班次
31 31 ##30=时刻表公里数 三位数
  32 +
  33 +31=规则修改,路牌范围,人员范围可以拖动
... ...
src/test/resources/testdata/test6.txt 0 → 100644
  1 +select * from bsth_c_s_sp_rule_rst;
  2 +
  3 +select * from bsth_c_s_sp_rule_rst
  4 +where qyrq is null;
  5 +
  6 +update bsth_c_s_sp_rule_rst a
  7 +set a.qyrq = (select qyrq from bsth_c_s_sr1_flat where id = a.rule_id)
  8 +where a.qyrq is null;
  9 +
  10 +970
  11 +789
  12 +604
  13 +985
  14 +北蔡2路
  15 +1048
  16 +1118
  17 +上南二分通勤
0 18 \ No newline at end of file
... ...