Commit f66adf3d3ca4b9e4e254db64ff09d9c84e3dc003
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
57 changed files
with
537 additions
and
2963 deletions
Too many changes to show.
To preserve performance only 57 of 85 files are displayed.
src/main/java/com/bsth/controller/CarParkController.java
| @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; | @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; | ||
| 15 | @RestController | 15 | @RestController |
| 16 | @RequestMapping("carpark") | 16 | @RequestMapping("carpark") |
| 17 | public class CarParkController extends BaseController<CarPark, Integer> { | 17 | public class CarParkController extends BaseController<CarPark, Integer> { |
| 18 | - | ||
| 19 | @Autowired | 18 | @Autowired |
| 20 | CarParkService service; | 19 | CarParkService service; |
| 21 | 20 | ||
| @@ -26,16 +25,10 @@ public class CarParkController extends BaseController<CarPark, Integer> { | @@ -26,16 +25,10 @@ public class CarParkController extends BaseController<CarPark, Integer> { | ||
| 26 | */ | 25 | */ |
| 27 | @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET) | 26 | @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET) |
| 28 | public Map<String, Object> getStationCode() { | 27 | public Map<String, Object> getStationCode() { |
| 29 | - | ||
| 30 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 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 | return resultMap; | 30 | return resultMap; |
| 35 | - | ||
| 36 | } | 31 | } |
| 37 | - | ||
| 38 | - | ||
| 39 | /** | 32 | /** |
| 40 | * 新增停车场信息 | 33 | * 新增停车场信息 |
| 41 | * | 34 | * |
| @@ -53,21 +46,14 @@ public class CarParkController extends BaseController<CarPark, Integer> { | @@ -53,21 +46,14 @@ public class CarParkController extends BaseController<CarPark, Integer> { | ||
| 53 | */ | 46 | */ |
| 54 | @RequestMapping(value="carParkSave" , method = RequestMethod.POST) | 47 | @RequestMapping(value="carParkSave" , method = RequestMethod.POST) |
| 55 | public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) { | 48 | public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) { |
| 56 | - | ||
| 57 | map.put("createBy", ""); | 49 | map.put("createBy", ""); |
| 58 | - | ||
| 59 | map.put("updateBy", ""); | 50 | map.put("updateBy", ""); |
| 60 | - | ||
| 61 | return service.carParkSave(map); | 51 | return service.carParkSave(map); |
| 62 | - | ||
| 63 | } | 52 | } |
| 64 | - | ||
| 65 | @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET) | 53 | @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET) |
| 66 | public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) { | 54 | public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) { |
| 67 | - | ||
| 68 | return service.findCarParkInfoFormId(map); | 55 | return service.findCarParkInfoFormId(map); |
| 69 | } | 56 | } |
| 70 | - | ||
| 71 | /** | 57 | /** |
| 72 | * 修改停车场信息 | 58 | * 修改停车场信息 |
| 73 | * | 59 | * |
| @@ -85,11 +71,12 @@ public class CarParkController extends BaseController<CarPark, Integer> { | @@ -85,11 +71,12 @@ public class CarParkController extends BaseController<CarPark, Integer> { | ||
| 85 | */ | 71 | */ |
| 86 | @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST) | 72 | @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST) |
| 87 | public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) { | 73 | public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) { |
| 88 | - | ||
| 89 | map.put("updateBy", ""); | 74 | map.put("updateBy", ""); |
| 90 | - | ||
| 91 | return service.carParkUpdate(map); | 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
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
| @@ -101,10 +101,10 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { | @@ -101,10 +101,10 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { | ||
| 101 | ps.setString(1, sch.getScheduleDateStr()); | 101 | ps.setString(1, sch.getScheduleDateStr()); |
| 102 | ps.setString(2, sch.getXlBm()); | 102 | ps.setString(2, sch.getXlBm()); |
| 103 | ps.setString(3, sch.getXlName()); | 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 | ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh())); | 108 | ps.setString(8, BasicData.nbbmCompanyPlateMap.get(sch.getClZbh())); |
| 109 | ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType()); | 109 | ps.setString(9, bcTypeMap.containsKey(sch.getBcType()) ? bcTypeMap.get(sch.getBcType()) : sch.getBcType()); |
| 110 | ps.setString(10, sch.getZdzName()); | 110 | ps.setString(10, sch.getZdzName()); |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| 1 | package com.bsth.data.gpsdata; | 1 | package com.bsth.data.gpsdata; |
| 2 | 2 | ||
| 3 | -import com.bsth.Application; | ||
| 4 | import com.bsth.data.BasicData; | 3 | import com.bsth.data.BasicData; |
| 5 | import com.bsth.data.forecast.ForecastRealServer; | 4 | import com.bsth.data.forecast.ForecastRealServer; |
| 6 | -import com.bsth.data.gpsdata.client.ClientApp; | ||
| 7 | import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; | 5 | import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; |
| 8 | import com.bsth.data.gpsdata.thread.OfflineMonitorThread; | 6 | import com.bsth.data.gpsdata.thread.OfflineMonitorThread; |
| 9 | import com.bsth.data.schedule.DayOfSchedule; | 7 | import com.bsth.data.schedule.DayOfSchedule; |
| @@ -17,7 +15,8 @@ import org.springframework.boot.CommandLineRunner; | @@ -17,7 +15,8 @@ import org.springframework.boot.CommandLineRunner; | ||
| 17 | import org.springframework.stereotype.Component; | 15 | import org.springframework.stereotype.Component; |
| 18 | 16 | ||
| 19 | import java.util.*; | 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 | * @author PanZhao | 22 | * @author PanZhao |
| @@ -30,7 +29,7 @@ public class GpsRealData implements CommandLineRunner { | @@ -30,7 +29,7 @@ public class GpsRealData implements CommandLineRunner { | ||
| 30 | 29 | ||
| 31 | static Logger logger = LoggerFactory.getLogger(GpsRealData.class); | 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 | private static TreeMultimap<String, String> lineCode2Devices; | 35 | private static TreeMultimap<String, String> lineCode2Devices; |
| @@ -51,22 +50,17 @@ public class GpsRealData implements CommandLineRunner { | @@ -51,22 +50,17 @@ public class GpsRealData implements CommandLineRunner { | ||
| 51 | * 构造函数 | 50 | * 构造函数 |
| 52 | */ | 51 | */ |
| 53 | public GpsRealData() { | 52 | public GpsRealData() { |
| 54 | - gpsMap = new HashMap<>(); | 53 | + gpsMap = new ConcurrentHashMap<>(); |
| 55 | lineCode2Devices = TreeMultimap.create(); | 54 | lineCode2Devices = TreeMultimap.create(); |
| 56 | } | 55 | } |
| 57 | 56 | ||
| 58 | - @Autowired | ||
| 59 | - ClientApp clientApp; | ||
| 60 | @Override | 57 | @Override |
| 61 | public void run(String... arg0) throws Exception { | 58 | public void run(String... arg0) throws Exception { |
| 62 | logger.info("gpsDataLoader,20,3"); | 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,9 +23,9 @@ public class SignalStateData { | ||
| 23 | private static ArrayListMultimap<String, SignalState> listMultimap = ArrayListMultimap.create(); | 23 | private static ArrayListMultimap<String, SignalState> listMultimap = ArrayListMultimap.create(); |
| 24 | 24 | ||
| 25 | public void put(SignalState state){ | 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 | public List<SignalState> get(String idx){ | 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,6 +11,8 @@ import org.slf4j.LoggerFactory; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | import org.springframework.stereotype.Component; | 12 | import org.springframework.stereotype.Component; |
| 13 | 13 | ||
| 14 | +import java.util.Collections; | ||
| 15 | +import java.util.Comparator; | ||
| 14 | import java.util.List; | 16 | import java.util.List; |
| 15 | import java.util.Set; | 17 | import java.util.Set; |
| 16 | import java.util.concurrent.CountDownLatch; | 18 | import java.util.concurrent.CountDownLatch; |
| @@ -42,25 +44,26 @@ public class GpsRealAnalyse { | @@ -42,25 +44,26 @@ public class GpsRealAnalyse { | ||
| 42 | @Autowired | 44 | @Autowired |
| 43 | GpsRealData gpsRealData; | 45 | GpsRealData gpsRealData; |
| 44 | 46 | ||
| 45 | - //50个线程 | ||
| 46 | - static ExecutorService threadPool = Executors.newFixedThreadPool(50); | 47 | + static ExecutorService threadPool = Executors.newFixedThreadPool(100); |
| 47 | 48 | ||
| 48 | public void analyse(List<GpsEntity> list) { | 49 | public void analyse(List<GpsEntity> list) { |
| 49 | //如果正在恢复数据 | 50 | //如果正在恢复数据 |
| 50 | if (GpsDataRecovery.run) | 51 | if (GpsDataRecovery.run) |
| 51 | return; | 52 | return; |
| 53 | + | ||
| 54 | + long t = System.currentTimeMillis(); | ||
| 52 | logger.info("analyse gps size: " + list.size()); | 55 | logger.info("analyse gps size: " + list.size()); |
| 53 | - //按车辆分组gps | 56 | + //按线路分组gps |
| 54 | ArrayListMultimap multimap = ArrayListMultimap.create(); | 57 | ArrayListMultimap multimap = ArrayListMultimap.create(); |
| 55 | for(GpsEntity gps : list){ | 58 | for(GpsEntity gps : list){ |
| 56 | - multimap.put(gps.getNbbm(), gps); | 59 | + multimap.put(gps.getLineId(), gps); |
| 57 | } | 60 | } |
| 58 | 61 | ||
| 59 | Set<String> ks = multimap.keySet(); | 62 | Set<String> ks = multimap.keySet(); |
| 60 | CountDownLatch count = new CountDownLatch(ks.size()); | 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 | try { | 69 | try { |
| @@ -70,11 +73,15 @@ public class GpsRealAnalyse { | @@ -70,11 +73,15 @@ public class GpsRealAnalyse { | ||
| 70 | //加入实时gps对照 | 73 | //加入实时gps对照 |
| 71 | for(GpsEntity gps: list) | 74 | for(GpsEntity gps: list) |
| 72 | gpsRealData.put(gps); | 75 | gpsRealData.put(gps); |
| 76 | + | ||
| 77 | + logger.info("time , " + (System.currentTimeMillis() - t)); | ||
| 73 | } catch (InterruptedException e) { | 78 | } catch (InterruptedException e) { |
| 74 | logger.error("", e); | 79 | logger.error("", e); |
| 75 | } | 80 | } |
| 76 | } | 81 | } |
| 77 | 82 | ||
| 83 | + static GpsComp comp = new GpsComp(); | ||
| 84 | + | ||
| 78 | public class SignalHandleThread implements Runnable { | 85 | public class SignalHandleThread implements Runnable { |
| 79 | 86 | ||
| 80 | List<GpsEntity> list; | 87 | List<GpsEntity> list; |
| @@ -89,6 +96,7 @@ public class GpsRealAnalyse { | @@ -89,6 +96,7 @@ public class GpsRealAnalyse { | ||
| 89 | public void run() { | 96 | public void run() { |
| 90 | 97 | ||
| 91 | try { | 98 | try { |
| 99 | + Collections.sort(list, comp); | ||
| 92 | for(GpsEntity gps : list){ | 100 | for(GpsEntity gps : list){ |
| 93 | //是否有任务 | 101 | //是否有任务 |
| 94 | boolean task; | 102 | boolean task; |
| @@ -119,4 +127,12 @@ public class GpsRealAnalyse { | @@ -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,6 +74,8 @@ public class ReverseSignalHandle extends SignalHandle { | ||
| 74 | 74 | ||
| 75 | if (prev.getInstation() == 1) { | 75 | if (prev.getInstation() == 1) { |
| 76 | sr = GeoCacheData.getRouteCode(prev); | 76 | sr = GeoCacheData.getRouteCode(prev); |
| 77 | + if(sr == null) | ||
| 78 | + return null; | ||
| 77 | 79 | ||
| 78 | if (sr.getRouteSort() > curr.getRouteSort()) { | 80 | if (sr.getRouteSort() > curr.getRouteSort()) { |
| 79 | if(half){ | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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
src/main/java/com/bsth/data/gpsdata/client/msg/IMessageBody.java deleted
100644 → 0
src/main/java/com/bsth/data/gpsdata/client/msg/IMessageIO.java deleted
100644 → 0
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,11 +45,11 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 45 | public void recovery() { | 45 | public void recovery() { |
| 46 | List<GpsEntity> list = loadData(); | 46 | List<GpsEntity> list = loadData(); |
| 47 | 47 | ||
| 48 | - //按车辆分组数据 | 48 | + //按线路分组数据 |
| 49 | ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create(); | 49 | ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create(); |
| 50 | for (GpsEntity gps : list) { | 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,9 +57,9 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 57 | 57 | ||
| 58 | CountDownLatch count = new CountDownLatch(keys.size()); | 58 | CountDownLatch count = new CountDownLatch(keys.size()); |
| 59 | GpsComp comp = new GpsComp(); | 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 | /*if(nbbm.equals("W7C-001")) | 63 | /*if(nbbm.equals("W7C-001")) |
| 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ | 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,6 +3,9 @@ package com.bsth.entity; | ||
| 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 4 | 4 | ||
| 5 | import javax.persistence.*; | 5 | import javax.persistence.*; |
| 6 | + | ||
| 7 | +import org.hibernate.annotations.Formula; | ||
| 8 | + | ||
| 6 | import java.util.Date; | 9 | import java.util.Date; |
| 7 | 10 | ||
| 8 | 11 | ||
| @@ -77,6 +80,10 @@ public class CarPark { | @@ -77,6 +80,10 @@ public class CarPark { | ||
| 77 | // 分公司 | 80 | // 分公司 |
| 78 | private String brancheCompany; | 81 | private String brancheCompany; |
| 79 | 82 | ||
| 83 | + /** 组合公司分公司编码 */ | ||
| 84 | + @Formula(" concat(company, '_', branche_company) ") | ||
| 85 | + private String cgsbm; | ||
| 86 | + | ||
| 80 | // 是否撤销 | 87 | // 是否撤销 |
| 81 | private Integer destroy; | 88 | private Integer destroy; |
| 82 | 89 | ||
| @@ -99,6 +106,14 @@ public class CarPark { | @@ -99,6 +106,14 @@ public class CarPark { | ||
| 99 | // 修改日期 | 106 | // 修改日期 |
| 100 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | 107 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 101 | private Date updateDate; | 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 | public Integer getId() { | 118 | public Integer getId() { |
| 104 | return id; | 119 | return id; |
src/main/java/com/bsth/entity/schedule/temp/SchedulePlanRuleResult.java
| @@ -27,6 +27,8 @@ public class SchedulePlanRuleResult { | @@ -27,6 +27,8 @@ public class SchedulePlanRuleResult { | ||
| 27 | 27 | ||
| 28 | /** 排班规则id */ | 28 | /** 排班规则id */ |
| 29 | private String ruleId; | 29 | private String ruleId; |
| 30 | + /** 启用日期 */ | ||
| 31 | + private Date qyrq; | ||
| 30 | /** 车辆配置id */ | 32 | /** 车辆配置id */ |
| 31 | private String ccId; | 33 | private String ccId; |
| 32 | /** 车辆自编号 */ | 34 | /** 车辆自编号 */ |
| @@ -249,4 +251,12 @@ public class SchedulePlanRuleResult { | @@ -249,4 +251,12 @@ public class SchedulePlanRuleResult { | ||
| 249 | public void setCreateDate(Date createDate) { | 251 | public void setCreateDate(Date createDate) { |
| 250 | this.createDate = createDate; | 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<CarPark, Integer>{ | @@ -107,4 +107,7 @@ public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ | ||
| 107 | 107 | ||
| 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) | 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 | public Object[][] bufferAera(String parkCode); | 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<CarPark, Integer> { | @@ -28,5 +28,6 @@ public interface CarParkService extends BaseService<CarPark, Integer> { | ||
| 28 | * | 28 | * |
| 29 | */ | 29 | */ |
| 30 | Map<String, Object> carParkUpdate(Map<String, Object> map); | 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<CarPark, Integer> implem | @@ -26,55 +26,30 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | public Map<String, Object> carParkSave(Map<String, Object> map) { | 28 | public Map<String, Object> carParkSave(Map<String, Object> map) { |
| 29 | - | ||
| 30 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 29 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 31 | - | ||
| 32 | try { | 30 | try { |
| 33 | - | ||
| 34 | // 停车场编码 | 31 | // 停车场编码 |
| 35 | String parkCode = map.get("parkCode").equals("") ? null : map.get("parkCode").toString(); | 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 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); | 34 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); |
| 42 | - | ||
| 43 | // 地理位置(百度坐标集合) | 35 | // 地理位置(百度坐标集合) |
| 44 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); | 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 | // 多边形WGS坐标点集合 | 37 | // 多边形WGS坐标点集合 |
| 50 | String gParkPoint =""; | 38 | String gParkPoint =""; |
| 51 | - | ||
| 52 | if(!bParkPoint.equals("")) { | 39 | if(!bParkPoint.equals("")) { |
| 53 | - | ||
| 54 | String bPloygonGridArray[] = bParkPoint.split(","); | 40 | String bPloygonGridArray[] = bParkPoint.split(","); |
| 55 | - | ||
| 56 | int bLen_ = bPloygonGridArray.length; | 41 | int bLen_ = bPloygonGridArray.length; |
| 57 | - | ||
| 58 | for(int b = 0 ;b<bLen_;b++) { | 42 | for(int b = 0 ;b<bLen_;b++) { |
| 59 | - | ||
| 60 | String tempArray[]= bPloygonGridArray[b].split(" "); | 43 | String tempArray[]= bPloygonGridArray[b].split(" "); |
| 61 | - | ||
| 62 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); | 44 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); |
| 63 | - | ||
| 64 | if(b==0) { | 45 | if(b==0) { |
| 65 | - | ||
| 66 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); | 46 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); |
| 67 | - | ||
| 68 | }else { | 47 | }else { |
| 69 | - | ||
| 70 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); | 48 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); |
| 71 | - | ||
| 72 | } | 49 | } |
| 73 | - | ||
| 74 | } | 50 | } |
| 75 | 51 | ||
| 76 | } | 52 | } |
| 77 | - | ||
| 78 | if(bParkPoint.equals("")) | 53 | if(bParkPoint.equals("")) |
| 79 | bParkPoint = null; | 54 | bParkPoint = null; |
| 80 | else | 55 | else |
| @@ -84,169 +59,92 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -84,169 +59,92 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 84 | gParkPoint = null; | 59 | gParkPoint = null; |
| 85 | else | 60 | else |
| 86 | gParkPoint = "POLYGON((" + gParkPoint +"))"; | 61 | gParkPoint = "POLYGON((" + gParkPoint +"))"; |
| 87 | - | ||
| 88 | - /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | ||
| 89 | - | ||
| 90 | - gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | ||
| 91 | - | ||
| 92 | // 地理位置中心点(百度坐标) | 62 | // 地理位置中心点(百度坐标) |
| 93 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); | 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 | String bJwpointsArray[] =null; | 64 | String bJwpointsArray[] =null; |
| 99 | - | ||
| 100 | if(bCenterPoint!=null) { | 65 | if(bCenterPoint!=null) { |
| 101 | - | ||
| 102 | bJwpointsArray = bCenterPoint.split(" "); | 66 | bJwpointsArray = bCenterPoint.split(" "); |
| 103 | - | ||
| 104 | } | 67 | } |
| 105 | - | ||
| 106 | String gCenterPoint = null; | 68 | String gCenterPoint = null; |
| 107 | - | ||
| 108 | if(bJwpointsArray.length>0) { | 69 | if(bJwpointsArray.length>0) { |
| 109 | - | ||
| 110 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); | 70 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); |
| 111 | - | ||
| 112 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); | 71 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); |
| 113 | - | ||
| 114 | } | 72 | } |
| 115 | - | ||
| 116 | // 坐标类型 | 73 | // 坐标类型 |
| 117 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | 74 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 118 | - | ||
| 119 | // 图形类型 | 75 | // 图形类型 |
| 120 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | 76 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); |
| 121 | - | ||
| 122 | // 半径 | 77 | // 半径 |
| 123 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | 78 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); |
| 124 | - | ||
| 125 | // 面积 | 79 | // 面积 |
| 126 | Double area = map.get("area").equals("") ? 0.0 : Double.parseDouble(map.get("area").toString()); | 80 | Double area = map.get("area").equals("") ? 0.0 : Double.parseDouble(map.get("area").toString()); |
| 127 | - | ||
| 128 | // 公司 | 81 | // 公司 |
| 129 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); | 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 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | 86 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 137 | - | ||
| 138 | // 版本号 | 87 | // 版本号 |
| 139 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | 88 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); |
| 140 | - | ||
| 141 | // 描述与说明 | 89 | // 描述与说明 |
| 142 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | 90 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); |
| 143 | - | ||
| 144 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | 91 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); |
| 145 | - | ||
| 146 | Date date = new Date(); | 92 | Date date = new Date(); |
| 147 | - | ||
| 148 | // 创建日期 | 93 | // 创建日期 |
| 149 | String createDate = formatter.format(date); | 94 | String createDate = formatter.format(date); |
| 150 | - | ||
| 151 | // 修改日期 | 95 | // 修改日期 |
| 152 | String updateDate = formatter.format(date); | 96 | String updateDate = formatter.format(date); |
| 153 | - | ||
| 154 | // 创建人 | 97 | // 创建人 |
| 155 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); | 98 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); |
| 156 | - | ||
| 157 | // 修改人 | 99 | // 修改人 |
| 158 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); | 100 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 159 | - | ||
| 160 | - | ||
| 161 | - | ||
| 162 | - | ||
| 163 | carParkRepository.carParkSave(area, company, parkCode, parkName, | 101 | carParkRepository.carParkSave(area, company, parkCode, parkName, |
| 164 | - | ||
| 165 | brancheCompany, createBy, createDate, descriptions, destroy, | 102 | brancheCompany, createBy, createDate, descriptions, destroy, |
| 166 | - | ||
| 167 | updateBy, updateDate, versions, bCenterPoint, bParkPoint, | 103 | updateBy, updateDate, versions, bCenterPoint, bParkPoint, |
| 168 | - | ||
| 169 | dbType, gCenterPoint, gParkPoint, radius, shapesType); | 104 | dbType, gCenterPoint, gParkPoint, radius, shapesType); |
| 170 | - | ||
| 171 | resultMap.put("status", ResponseCode.SUCCESS); | 105 | resultMap.put("status", ResponseCode.SUCCESS); |
| 172 | - | ||
| 173 | } catch (Exception e) { | 106 | } catch (Exception e) { |
| 174 | - | ||
| 175 | resultMap.put("status", ResponseCode.ERROR); | 107 | resultMap.put("status", ResponseCode.ERROR); |
| 176 | - | ||
| 177 | logger.error("save erro.", e); | 108 | logger.error("save erro.", e); |
| 178 | - | ||
| 179 | } | 109 | } |
| 180 | - | ||
| 181 | return resultMap; | 110 | return resultMap; |
| 182 | } | 111 | } |
| 183 | 112 | ||
| 184 | @Override | 113 | @Override |
| 185 | public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) { | 114 | public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) { |
| 186 | - | ||
| 187 | // 获取线路ID | 115 | // 获取线路ID |
| 188 | Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString()); | 116 | Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString()); |
| 189 | - | ||
| 190 | List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id); | 117 | List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id); |
| 191 | - | ||
| 192 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | 118 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 193 | - | ||
| 194 | int len = objects.size(); | 119 | int len = objects.size(); |
| 195 | - | ||
| 196 | if(objects.size()>0) { | 120 | if(objects.size()>0) { |
| 197 | - | ||
| 198 | for(int i = 0 ; i < len; i++) { | 121 | for(int i = 0 ; i < len; i++) { |
| 199 | - | ||
| 200 | Map<String, Object> tempM = new HashMap<String,Object>(); | 122 | Map<String, Object> tempM = new HashMap<String,Object>(); |
| 201 | - | ||
| 202 | tempM.put("carParkId", objects.get(i)[0]); | 123 | tempM.put("carParkId", objects.get(i)[0]); |
| 203 | - | ||
| 204 | tempM.put("carParkArea", objects.get(i)[1]); | 124 | tempM.put("carParkArea", objects.get(i)[1]); |
| 205 | - | ||
| 206 | tempM.put("carParkCompany", objects.get(i)[2]); | 125 | tempM.put("carParkCompany", objects.get(i)[2]); |
| 207 | - | ||
| 208 | tempM.put("carParkCode", objects.get(i)[3]); | 126 | tempM.put("carParkCode", objects.get(i)[3]); |
| 209 | - | ||
| 210 | tempM.put("carParkName", objects.get(i)[4]); | 127 | tempM.put("carParkName", objects.get(i)[4]); |
| 211 | - | ||
| 212 | tempM.put("carParkBrancheCompany", objects.get(i)[5]); | 128 | tempM.put("carParkBrancheCompany", objects.get(i)[5]); |
| 213 | - | ||
| 214 | tempM.put("carParkCreateBy", objects.get(i)[6]); | 129 | tempM.put("carParkCreateBy", objects.get(i)[6]); |
| 215 | - | ||
| 216 | tempM.put("carParkCreateDate", objects.get(i)[7]); | 130 | tempM.put("carParkCreateDate", objects.get(i)[7]); |
| 217 | - | ||
| 218 | tempM.put("carParkDescriptions", objects.get(i)[8]); | 131 | tempM.put("carParkDescriptions", objects.get(i)[8]); |
| 219 | - | ||
| 220 | tempM.put("carParkDestroy", objects.get(i)[9]); | 132 | tempM.put("carParkDestroy", objects.get(i)[9]); |
| 221 | - | ||
| 222 | tempM.put("carParkUpdate", objects.get(i)[10]); | 133 | tempM.put("carParkUpdate", objects.get(i)[10]); |
| 223 | - | ||
| 224 | tempM.put("carParkUpdateDate", objects.get(i)[11]); | 134 | tempM.put("carParkUpdateDate", objects.get(i)[11]); |
| 225 | - | ||
| 226 | tempM.put("carParkVersions", objects.get(i)[12]); | 135 | tempM.put("carParkVersions", objects.get(i)[12]); |
| 227 | - | ||
| 228 | tempM.put("carParkBcenterPoint", objects.get(i)[13]); | 136 | tempM.put("carParkBcenterPoint", objects.get(i)[13]); |
| 229 | - | ||
| 230 | tempM.put("carParkBparkPoint", objects.get(i)[14]); | 137 | tempM.put("carParkBparkPoint", objects.get(i)[14]); |
| 231 | - | ||
| 232 | tempM.put("carParkGcenterPoint", objects.get(i)[15]); | 138 | tempM.put("carParkGcenterPoint", objects.get(i)[15]); |
| 233 | - | ||
| 234 | tempM.put("carParkGparkPoint", objects.get(i)[16]); | 139 | tempM.put("carParkGparkPoint", objects.get(i)[16]); |
| 235 | - | ||
| 236 | tempM.put("carParkDBtype", objects.get(i)[17]); | 140 | tempM.put("carParkDBtype", objects.get(i)[17]); |
| 237 | - | ||
| 238 | tempM.put("carParkRadius", objects.get(i)[18]); | 141 | tempM.put("carParkRadius", objects.get(i)[18]); |
| 239 | - | ||
| 240 | tempM.put("carParkShapesType", objects.get(i)[19]); | 142 | tempM.put("carParkShapesType", objects.get(i)[19]); |
| 241 | - | ||
| 242 | resultList.add(tempM); | 143 | resultList.add(tempM); |
| 243 | } | 144 | } |
| 244 | - | ||
| 245 | } | 145 | } |
| 246 | - | ||
| 247 | return resultList; | 146 | return resultList; |
| 248 | } | 147 | } |
| 249 | - | ||
| 250 | /** | 148 | /** |
| 251 | * 修改停车场信息 | 149 | * 修改停车场信息 |
| 252 | * | 150 | * |
| @@ -265,90 +163,54 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -265,90 +163,54 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 265 | @Override | 163 | @Override |
| 266 | public Map<String, Object> carParkUpdate(Map<String, Object> map) { | 164 | public Map<String, Object> carParkUpdate(Map<String, Object> map) { |
| 267 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 165 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 268 | - | ||
| 269 | try { | 166 | try { |
| 270 | - | ||
| 271 | // id | 167 | // id |
| 272 | Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString()); | 168 | Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString()); |
| 273 | - | ||
| 274 | if(id!=null) { | 169 | if(id!=null) { |
| 275 | - | ||
| 276 | // 面积 | 170 | // 面积 |
| 277 | Double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); | 171 | Double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); |
| 278 | - | ||
| 279 | // 中心点(百度坐标) | 172 | // 中心点(百度坐标) |
| 280 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); | 173 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); |
| 281 | - | ||
| 282 | // 图形坐标点集合(百度坐标) | 174 | // 图形坐标点集合(百度坐标) |
| 283 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); | 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 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); | 180 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); |
| 291 | - | ||
| 292 | // 坐标类型 | 181 | // 坐标类型 |
| 293 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | 182 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 294 | - | ||
| 295 | // 描述与说明 | 183 | // 描述与说明 |
| 296 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | 184 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); |
| 297 | - | ||
| 298 | // 是否撤销 | 185 | // 是否撤销 |
| 299 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | 186 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 300 | - | ||
| 301 | // 中心点(WGS坐标) | 187 | // 中心点(WGS坐标) |
| 302 | // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); | 188 | // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); |
| 303 | - | ||
| 304 | String bJwpointsArray[] =null; | 189 | String bJwpointsArray[] =null; |
| 305 | - | ||
| 306 | if(bCenterPoint!=null) { | 190 | if(bCenterPoint!=null) { |
| 307 | - | ||
| 308 | bJwpointsArray = bCenterPoint.split(" "); | 191 | bJwpointsArray = bCenterPoint.split(" "); |
| 309 | - | ||
| 310 | } | 192 | } |
| 311 | - | ||
| 312 | String gCenterPoint =null; | 193 | String gCenterPoint =null; |
| 313 | - | ||
| 314 | if(bJwpointsArray.length>0) { | 194 | if(bJwpointsArray.length>0) { |
| 315 | - | ||
| 316 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); | 195 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); |
| 317 | - | ||
| 318 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); | 196 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); |
| 319 | - | ||
| 320 | } | 197 | } |
| 321 | - | ||
| 322 | // 图形坐标点集合(WGS坐标) | 198 | // 图形坐标点集合(WGS坐标) |
| 323 | // String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString(); | 199 | // String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString(); |
| 324 | - | ||
| 325 | // 多边形WGS坐标点集合 | 200 | // 多边形WGS坐标点集合 |
| 326 | String gParkPoint =""; | 201 | String gParkPoint =""; |
| 327 | - | ||
| 328 | if(!bParkPoint.equals("")) { | 202 | if(!bParkPoint.equals("")) { |
| 329 | - | ||
| 330 | String bPloygonGridArray[] = bParkPoint.split(","); | 203 | String bPloygonGridArray[] = bParkPoint.split(","); |
| 331 | - | ||
| 332 | int bLen_ = bPloygonGridArray.length; | 204 | int bLen_ = bPloygonGridArray.length; |
| 333 | - | ||
| 334 | for(int b = 0 ;b<bLen_;b++) { | 205 | for(int b = 0 ;b<bLen_;b++) { |
| 335 | - | ||
| 336 | String tempArray[]= bPloygonGridArray[b].split(" "); | 206 | String tempArray[]= bPloygonGridArray[b].split(" "); |
| 337 | - | ||
| 338 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); | 207 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); |
| 339 | - | ||
| 340 | if(b==0) { | 208 | if(b==0) { |
| 341 | - | ||
| 342 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); | 209 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); |
| 343 | - | ||
| 344 | }else { | 210 | }else { |
| 345 | - | ||
| 346 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); | 211 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); |
| 347 | - | ||
| 348 | } | 212 | } |
| 349 | - | ||
| 350 | } | 213 | } |
| 351 | - | ||
| 352 | } | 214 | } |
| 353 | if(bParkPoint.equals("")) | 215 | if(bParkPoint.equals("")) |
| 354 | bParkPoint = null; | 216 | bParkPoint = null; |
| @@ -362,69 +224,51 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | @@ -362,69 +224,51 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem | ||
| 362 | /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | 224 | /*bParkPoint = "POLYGON((" + bParkPoint +"))"; |
| 363 | 225 | ||
| 364 | gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | 226 | gParkPoint = "POLYGON((" + gParkPoint +"))";*/ |
| 365 | - | ||
| 366 | // 编码 | 227 | // 编码 |
| 367 | String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); | 228 | String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); |
| 368 | - | ||
| 369 | // 名称 | 229 | // 名称 |
| 370 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); | 230 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); |
| 371 | - | ||
| 372 | // 半径 | 231 | // 半径 |
| 373 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | 232 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); |
| 374 | - | ||
| 375 | // 图形类型 | 233 | // 图形类型 |
| 376 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | 234 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); |
| 377 | - | ||
| 378 | // 版本 | 235 | // 版本 |
| 379 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | 236 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); |
| 380 | - | ||
| 381 | // 创建人 | 237 | // 创建人 |
| 382 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); | 238 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); |
| 383 | - | ||
| 384 | // 创建日期 | 239 | // 创建日期 |
| 385 | String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString(); | 240 | String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString(); |
| 386 | - | ||
| 387 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); | 241 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 388 | - | ||
| 389 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | 242 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); |
| 390 | - | ||
| 391 | Date date = new Date(); | 243 | Date date = new Date(); |
| 392 | - | ||
| 393 | // 修改日期 | 244 | // 修改日期 |
| 394 | String updateDate = formatter.format(date); | 245 | String updateDate = formatter.format(date); |
| 395 | - | ||
| 396 | carParkRepository.carParkUpdate(area, company, parkCode, parkName, brancheCompany, createBy, createDate, descriptions, destroy, updateBy, updateDate, versions, bCenterPoint, gCenterPoint, bParkPoint, gParkPoint, dbType, radius, shapesType, id); | 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 | resultMap.put("status", ResponseCode.SUCCESS); | 248 | resultMap.put("status", ResponseCode.SUCCESS); |
| 401 | - | ||
| 402 | } catch (Exception e) { | 249 | } catch (Exception e) { |
| 403 | - | ||
| 404 | resultMap.put("status", ResponseCode.ERROR); | 250 | resultMap.put("status", ResponseCode.ERROR); |
| 405 | - | ||
| 406 | logger.error("save erro.", e); | 251 | logger.error("save erro.", e); |
| 407 | - | ||
| 408 | } | 252 | } |
| 409 | - | ||
| 410 | return resultMap; | 253 | return resultMap; |
| 411 | } | 254 | } |
| 412 | - | ||
| 413 | /** 百度坐标转WGS坐标 */ | 255 | /** 百度坐标转WGS坐标 */ |
| 414 | public Location FromBDPointToWGSPoint(String bLonx,String bLatx) { | 256 | public Location FromBDPointToWGSPoint(String bLonx,String bLatx) { |
| 415 | - | ||
| 416 | double lng = Double.parseDouble(bLonx); | 257 | double lng = Double.parseDouble(bLonx); |
| 417 | - | ||
| 418 | double lat = Double.parseDouble(bLatx); | 258 | double lat = Double.parseDouble(bLatx); |
| 419 | - | ||
| 420 | Location bdLoc = TransGPS.LocationMake(lng, lat); | 259 | Location bdLoc = TransGPS.LocationMake(lng, lat); |
| 421 | - | ||
| 422 | Location location = TransGPS.bd_decrypt(bdLoc); | 260 | Location location = TransGPS.bd_decrypt(bdLoc); |
| 423 | - | ||
| 424 | Location WGSPoint = TransGPS.transformFromGCJToWGS(location); | 261 | Location WGSPoint = TransGPS.transformFromGCJToWGS(location); |
| 425 | - | ||
| 426 | return WGSPoint; | 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,7 +259,7 @@ public class RealChartsServiceImpl implements RealChartsService { | ||
| 259 | } | 259 | } |
| 260 | inStr = " (" + inStr.substring(1) + ")"; | 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 | MapSqlParameterSource parameters = new MapSqlParameterSource(); | 264 | MapSqlParameterSource parameters = new MapSqlParameterSource(); |
| 265 | parameters.addValue("date", date); | 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,6 +12,7 @@ import com.bsth.data.BasicData; | ||
| 12 | import com.bsth.data.LineConfigData; | 12 | import com.bsth.data.LineConfigData; |
| 13 | import com.bsth.data.schedule.DayOfSchedule; | 13 | import com.bsth.data.schedule.DayOfSchedule; |
| 14 | import com.bsth.data.schedule.SchAttrCalculator; | 14 | import com.bsth.data.schedule.SchAttrCalculator; |
| 15 | +import com.bsth.data.schedule.SchModifyLog; | ||
| 15 | import com.bsth.data.schedule.ScheduleComparator; | 16 | import com.bsth.data.schedule.ScheduleComparator; |
| 16 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | 17 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; |
| 17 | import com.bsth.entity.Cars; | 18 | import com.bsth.entity.Cars; |
| @@ -52,7 +53,6 @@ import com.google.common.base.Splitter; | @@ -52,7 +53,6 @@ import com.google.common.base.Splitter; | ||
| 52 | import com.google.common.collect.Lists; | 53 | import com.google.common.collect.Lists; |
| 53 | import org.apache.commons.lang3.StringEscapeUtils; | 54 | import org.apache.commons.lang3.StringEscapeUtils; |
| 54 | import org.apache.commons.lang3.StringUtils; | 55 | import org.apache.commons.lang3.StringUtils; |
| 55 | -import org.drools.compiler.lang.dsl.DSLMapParser.statement_return; | ||
| 56 | import org.joda.time.format.DateTimeFormat; | 56 | import org.joda.time.format.DateTimeFormat; |
| 57 | import org.joda.time.format.DateTimeFormatter; | 57 | import org.joda.time.format.DateTimeFormatter; |
| 58 | import org.slf4j.Logger; | 58 | import org.slf4j.Logger; |
| @@ -132,6 +132,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -132,6 +132,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 132 | @Autowired | 132 | @Autowired |
| 133 | CulateMileageService culateService; | 133 | CulateMileageService culateService; |
| 134 | 134 | ||
| 135 | + @Autowired | ||
| 136 | + SchModifyLog schModifyLog; | ||
| 137 | + | ||
| 135 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 138 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 136 | 139 | ||
| 137 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 140 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| @@ -1171,10 +1174,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1171,10 +1174,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1171 | return rs; | 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 | if (StringUtils.isNotEmpty(clZbh)) { | 1185 | if (StringUtils.isNotEmpty(clZbh)) { |
| 1179 | //换车 | 1186 | //换车 |
| 1180 | if (!carExist(sch.getGsBm(), clZbh)) { | 1187 | if (!carExist(sch.getGsBm(), clZbh)) { |
| @@ -1189,7 +1196,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1189,7 +1196,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1189 | /** | 1196 | /** |
| 1190 | * 换驾驶员 | 1197 | * 换驾驶员 |
| 1191 | */ | 1198 | */ |
| 1192 | - String jsy = map.get("jsy"); | ||
| 1193 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { | 1199 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { |
| 1194 | String jGh = jsy.split("/")[0]; | 1200 | String jGh = jsy.split("/")[0]; |
| 1195 | String jName = getPersonName(sch.getGsBm(), jGh); | 1201 | String jName = getPersonName(sch.getGsBm(), jGh); |
| @@ -2013,11 +2019,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2013,11 +2019,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2013 | int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0; | 2019 | int dtbcZ = 0, dtbc_mZ = 0, dtbc_aZ = 0; |
| 2014 | int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0; | 2020 | int djgZ = 0, djg_mZ = 0, djg_aZ = 0, djg_timeZ = 0; |
| 2015 | Map<String, Object> map = null; | 2021 | Map<String, Object> map = null; |
| 2016 | - | 2022 | + |
| 2017 | double xgssgl=0,xgljgl=0,lj=0,cj=0; | 2023 | double xgssgl=0,xgljgl=0,lj=0,cj=0; |
| 2018 | for (int i = 0; i < list.size(); i++) { | 2024 | for (int i = 0; i < list.size(); i++) { |
| 2019 | ScheduleRealInfo scheduleRealInfo = list.get(i); | 2025 | ScheduleRealInfo scheduleRealInfo = list.get(i); |
| 2020 | - | 2026 | + |
| 2021 | if (scheduleRealInfo != null) { | 2027 | if (scheduleRealInfo != null) { |
| 2022 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | 2028 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 2023 | //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 | 2029 | //计算实际里程,少驶里程,计划里程=实际里程+少驶里程 |
| @@ -2028,7 +2034,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2028,7 +2034,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2028 | if (childTaskPlans.isEmpty()) { | 2034 | if (childTaskPlans.isEmpty()) { |
| 2029 | tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); | 2035 | tempJhlc = scheduleRealInfo.getJhlc() == null ? 0 : scheduleRealInfo.getJhlc(); |
| 2030 | jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig(); | 2036 | jhlcOrig = scheduleRealInfo.getJhlcOrig() == null ? 0 : scheduleRealInfo.getJhlcOrig(); |
| 2031 | - | 2037 | + |
| 2032 | if(jhlcOrig-tempJhlc>0){ | 2038 | if(jhlcOrig-tempJhlc>0){ |
| 2033 | xgssgl +=jhlcOrig-tempJhlc; | 2039 | xgssgl +=jhlcOrig-tempJhlc; |
| 2034 | cj += jhlcOrig-tempJhlc; | 2040 | cj += jhlcOrig-tempJhlc; |
| @@ -2040,8 +2046,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2040,8 +2046,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2040 | if (scheduleRealInfo.isSflj()) { | 2046 | if (scheduleRealInfo.isSflj()) { |
| 2041 | ljgl += tempJhlc; | 2047 | ljgl += tempJhlc; |
| 2042 | ljglZ += tempJhlc; | 2048 | ljglZ += tempJhlc; |
| 2043 | - } | ||
| 2044 | - | 2049 | + } |
| 2050 | + | ||
| 2045 | if (scheduleRealInfo.getStatus() == -1) { | 2051 | if (scheduleRealInfo.getStatus() == -1) { |
| 2046 | ssgl += tempJhlc; | 2052 | ssgl += tempJhlc; |
| 2047 | ssglZ += tempJhlc; | 2053 | ssglZ += tempJhlc; |
| @@ -2806,7 +2812,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2806,7 +2812,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2806 | for(ScheduleRealInfo info:listInfo){ | 2812 | for(ScheduleRealInfo info:listInfo){ |
| 2807 | for(ScheduleRealInfo total:listTotal){ | 2813 | for(ScheduleRealInfo total:listTotal){ |
| 2808 | if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){ | 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<ScheduleRealInf | @@ -2902,7 +2908,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2902 | for(ScheduleRealInfo info:listInfo){ | 2908 | for(ScheduleRealInfo info:listInfo){ |
| 2903 | for(ScheduleRealInfo total:listTotal){ | 2909 | for(ScheduleRealInfo total:listTotal){ |
| 2904 | if(info.getjGh().equals(total.getjGh()) && info.getLpName().equals(total.getLpName()) && info.getClZbh().equals(total.getClZbh())){ | 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<ScheduleRealInf | @@ -2979,7 +2985,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2979 | fage = false; | 2985 | fage = false; |
| 2980 | } | 2986 | } |
| 2981 | listS.add(scheduleRealInfo); | 2987 | listS.add(scheduleRealInfo); |
| 2982 | - | 2988 | + |
| 2983 | /* if (scheduleRealInfo != null) { | 2989 | /* if (scheduleRealInfo != null) { |
| 2984 | //计划里程(主任务过滤掉临加班次), | 2990 | //计划里程(主任务过滤掉临加班次), |
| 2985 | //烂班里程(主任务烂班), | 2991 | //烂班里程(主任务烂班), |
| @@ -2995,7 +3001,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2995,7 +3001,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2995 | || scheduleRealInfo.getBcType().equals("out"))) { | 3001 | || scheduleRealInfo.getBcType().equals("out"))) { |
| 2996 | jhlc =Arith.add(jhlc,tempJhlc); | 3002 | jhlc =Arith.add(jhlc,tempJhlc); |
| 2997 | } | 3003 | } |
| 2998 | - | 3004 | + |
| 2999 | if (scheduleRealInfo.getStatus() == -1) { | 3005 | if (scheduleRealInfo.getStatus() == -1) { |
| 3000 | remMileage =Arith.add(remMileage,tempJhlc); | 3006 | remMileage =Arith.add(remMileage,tempJhlc); |
| 3001 | } | 3007 | } |
| @@ -3081,7 +3087,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3081,7 +3087,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3081 | ScheduleRealInfo sch; | 3087 | ScheduleRealInfo sch; |
| 3082 | //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse(); | 3088 | //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse(); |
| 3083 | 3089 | ||
| 3084 | - String jGh,jName,sGh,sName; | 3090 | + String jGh = null,jName,sGh,sName; |
| 3085 | for (ChangePersonCar cpc : cpcs) { | 3091 | for (ChangePersonCar cpc : cpcs) { |
| 3086 | 3092 | ||
| 3087 | sch = dayOfSchedule.get(cpc.getSchId()); | 3093 | sch = dayOfSchedule.get(cpc.getSchId()); |
| @@ -3102,6 +3108,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3102,6 +3108,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3102 | rs.put("status", ResponseCode.ERROR); | 3108 | rs.put("status", ResponseCode.ERROR); |
| 3103 | return rs; | 3109 | return rs; |
| 3104 | } | 3110 | } |
| 3111 | + } | ||
| 3112 | + | ||
| 3113 | + //为换人换车情况表写入数据 | ||
| 3114 | + schModifyLog.saveChangetochange(sch, cpc); | ||
| 3115 | + | ||
| 3116 | + if (StringUtils.isNotEmpty(cpc.getJsy())) { | ||
| 3105 | //换驾驶员 | 3117 | //换驾驶员 |
| 3106 | persoChange(sch, jGh); | 3118 | persoChange(sch, jGh); |
| 3107 | set.add(sch); | 3119 | set.add(sch); |
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java
| @@ -112,6 +112,10 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService { | @@ -112,6 +112,10 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService { | ||
| 112 | public SchedulePlanRuleResult mapRow(ResultSet rs, int i) throws SQLException { | 112 | public SchedulePlanRuleResult mapRow(ResultSet rs, int i) throws SQLException { |
| 113 | SchedulePlanRuleResult obj = new SchedulePlanRuleResult(); | 113 | SchedulePlanRuleResult obj = new SchedulePlanRuleResult(); |
| 114 | obj.setRuleId(rs.getString("rule_id")); | 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 | obj.setScheduleDate(rs.getDate("schedule_date")); | 119 | obj.setScheduleDate(rs.getDate("schedule_date")); |
| 116 | obj.setGidindex(rs.getString("gidindex")); | 120 | obj.setGidindex(rs.getString("gidindex")); |
| 117 | obj.setEcindex(rs.getString("ecindex")); | 121 | obj.setEcindex(rs.getString("ecindex")); |
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java
| 1 | package com.bsth.service.schedule.rules.shiftloop; | 1 | package com.bsth.service.schedule.rules.shiftloop; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; | 3 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 4 | +import com.bsth.service.schedule.utils.Md5Util; | ||
| 4 | import com.google.common.base.Splitter; | 5 | import com.google.common.base.Splitter; |
| 5 | import org.apache.commons.lang3.StringUtils; | 6 | import org.apache.commons.lang3.StringUtils; |
| 6 | import org.joda.time.DateTime; | 7 | import org.joda.time.DateTime; |
| @@ -17,6 +18,12 @@ public class ScheduleRule_input { | @@ -17,6 +18,12 @@ public class ScheduleRule_input { | ||
| 17 | 18 | ||
| 18 | /** 规则Id */ | 19 | /** 规则Id */ |
| 19 | private String ruleId; | 20 | private String ruleId; |
| 21 | + /** | ||
| 22 | + * 规则md5值(不使用id判定,使用md5判定) | ||
| 23 | + * 使用,启用日期,路牌范围,人员范围 结合生成md5编码 | ||
| 24 | + */ | ||
| 25 | + private String ruleMd5; | ||
| 26 | + | ||
| 20 | /** 规则启用日期 */ | 27 | /** 规则启用日期 */ |
| 21 | private DateTime qyrq; | 28 | private DateTime qyrq; |
| 22 | 29 | ||
| @@ -78,9 +85,20 @@ public class ScheduleRule_input { | @@ -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 | this.self = scheduleRule1Flat; | 97 | this.self = scheduleRule1Flat; |
| 82 | } | 98 | } |
| 83 | 99 | ||
| 100 | + | ||
| 101 | + | ||
| 84 | public String getRuleId() { | 102 | public String getRuleId() { |
| 85 | return ruleId; | 103 | return ruleId; |
| 86 | } | 104 | } |
| @@ -160,4 +178,12 @@ public class ScheduleRule_input { | @@ -160,4 +178,12 @@ public class ScheduleRule_input { | ||
| 160 | public void setSelf(ScheduleRule1Flat self) { | 178 | public void setSelf(ScheduleRule1Flat self) { |
| 161 | this.self = self; | 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,7 +696,7 @@ | ||
| 696 | <optimizationLevel>9</optimizationLevel> | 696 | <optimizationLevel>9</optimizationLevel> |
| 697 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | 697 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> |
| 698 | <jsScript_name>Script 1</jsScript_name> | 698 | <jsScript_name>Script 1</jsScript_name> |
| 699 | - <jsScript_script>//Script here

var jhlc; // 计划里程
var bcsj; // 班次时间

// 时间范围正则表达式
var timeRex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
// 发车时间转换成日期
var fcsj_hour = str2num(sendtime_calcu.substr(0, 2), "#");
var fcsj_min = str2num(sendtime_calcu.substr(3, 2), "#");
var fcsj_date = new Date(2000,1,1,fcsj_hour,fcsj_min,0);

// 判定是否早高峰
var isZgf = false;
if (timeRex.test(early_start_time) && timeRex.test(early_end_time) && early_up_time != null && early_down_time != null) {
 var early_s_hour = str2num(early_start_time.substr(0, 2), "#");
 var early_s_min = str2num(early_start_time.substr(3, 2), "#");
 var early_s_date = new Date(2000,1,1,early_s_hour,early_s_min,0);

 var early_e_hour = str2num(early_end_time.substr(0, 2), "#");
 var early_e_min = str2num(early_end_time.substr(3, 2), "#");
 var early_e_date = new Date(2000,1,1,early_e_hour,early_e_min,0);

 if (fcsj_date >= early_s_date && fcsj_date <= early_e_date) {
 isZgf = true;
 }
}

// 判定是否晚高峰
var isWgf = false;
if (timeRex.test(late_start_time) && timeRex.test(late_end_time) && late_up_time != null && late_down_time != null) {
 var late_s_hour = str2num(late_start_time.substr(0, 2), "#");
 var late_s_min = str2num(late_start_time.substr(3, 2), "#");
 var late_s_date = new Date(2000,1,1,late_s_hour,late_s_min,0);

 var late_e_hour = str2num(late_end_time.substr(0, 2), "#");
 var late_e_min = str2num(late_end_time.substr(3, 2), "#");
 var late_e_date = new Date(2000,1,1,late_e_hour,late_e_min,0);

 if (fcsj_date >= late_s_date && fcsj_date <= late_e_date) {
 isWgf = true;
 }
}

// 判定是否晚高峰

if (sxx == 0) { // 上行
 if (isZgf) {
 jhlc = up_mileage;
 bcsj = early_up_time;
 } else if (isWgf) {
 jhlc = up_mileage;
 bcsj = late_up_time;
 } else {
 jhlc = up_mileage;
 bcsj = up_travel_time;
 }
} else { // sxx == 1 下行
 if (isZgf) {
 jhlc = down_mileage;
 bcsj = early_down_time;
 } else if (isWgf) {
 jhlc = down_mileage;
 bcsj = late_down_time;
 } else {
 jhlc = down_mileage;
 bcsj = down_travel_time;
 }
}

</jsScript_script> | 699 | + <jsScript_script>//Script here

var jhlc; // 计划里程
var bcsj; // 班次时间

// 时间范围正则表达式
var timeRex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
// 发车时间转换成日期
var fcsj_hour = str2num(sendtime_calcu.substr(0, 2), "#");
var fcsj_min = str2num(sendtime_calcu.substr(3, 2), "#");
var fcsj_date = new Date(2000,1,1,fcsj_hour,fcsj_min,0);

// 判定是否早高峰
var isZgf = false;
if (timeRex.test(early_start_time) && timeRex.test(early_end_time) && early_up_time != null && early_down_time != null) {
 var early_s_hour = str2num(early_start_time.substr(0, 2), "#");
 var early_s_min = str2num(early_start_time.substr(3, 2), "#");
 var early_s_date = new Date(2000,1,1,early_s_hour,early_s_min,0);

 var early_e_hour = str2num(early_end_time.substr(0, 2), "#");
 var early_e_min = str2num(early_end_time.substr(3, 2), "#");
 var early_e_date = new Date(2000,1,1,early_e_hour,early_e_min,0);

 if (fcsj_date >= early_s_date && fcsj_date <= early_e_date) {
 isZgf = true;
 }
}

// 判定是否晚高峰
var isWgf = false;
if (timeRex.test(late_start_time) && timeRex.test(late_end_time) && late_up_time != null && late_down_time != null) {
 var late_s_hour = str2num(late_start_time.substr(0, 2), "#");
 var late_s_min = str2num(late_start_time.substr(3, 2), "#");
 var late_s_date = new Date(2000,1,1,late_s_hour,late_s_min,0);

 var late_e_hour = str2num(late_end_time.substr(0, 2), "#");
 var late_e_min = str2num(late_end_time.substr(3, 2), "#");
 var late_e_date = new Date(2000,1,1,late_e_hour,late_e_min,0);

 if (fcsj_date >= late_s_date && fcsj_date <= late_e_date) {
 isWgf = true;
 }
}

// 判定是否晚高峰

if (sxx == 0) { // 上行
 if (isZgf) {
 jhlc = up_mileage;
 bcsj = early_up_time ? early_up_time : up_travel_time;
 } else if (isWgf) {
 jhlc = up_mileage;
 bcsj = late_up_time ? late_up_time : up_travel_time;
 } else {
 jhlc = up_mileage;
 bcsj = up_travel_time;
 }
} else { // sxx == 1 下行
 if (isZgf) {
 jhlc = down_mileage;
 bcsj = early_down_time ? early_down_time : down_travel_time;
 } else if (isWgf) {
 jhlc = down_mileage;
 bcsj = late_down_time ? late_down_time : down_travel_time;
 } else {
 jhlc = down_mileage;
 bcsj = down_travel_time;
 }
}

</jsScript_script> |
| 700 | </jsScript> </jsScripts> <fields> <field> <name>jhlc</name> | 700 | </jsScript> </jsScripts> <fields> <field> <name>jhlc</name> |
| 701 | <rename>jhlc</rename> | 701 | <rename>jhlc</rename> |
| 702 | <type>String</type> | 702 | <type>String</type> |
src/main/resources/datatools/ktrs/ttinfodetailDataInput2.ktr
| @@ -696,7 +696,7 @@ | @@ -696,7 +696,7 @@ | ||
| 696 | <optimizationLevel>9</optimizationLevel> | 696 | <optimizationLevel>9</optimizationLevel> |
| 697 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | 697 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> |
| 698 | <jsScript_name>Script 1</jsScript_name> | 698 | <jsScript_name>Script 1</jsScript_name> |
| 699 | - <jsScript_script>//Script here

var jhlc; // 计划里程
var bcsj; // 班次时间

// 时间范围正则表达式
var timeRex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
// 发车时间转换成日期
var fcsj_hour = str2num(sendtime_calcu.substr(0, 2), "#");
var fcsj_min = str2num(sendtime_calcu.substr(3, 2), "#");
var fcsj_date = new Date(2000,1,1,fcsj_hour,fcsj_min,0);

// 判定是否早高峰
var isZgf = false;
if (timeRex.test(early_start_time) && timeRex.test(early_end_time) && early_up_time != null && early_down_time != null) {
 var early_s_hour = str2num(early_start_time.substr(0, 2), "#");
 var early_s_min = str2num(early_start_time.substr(3, 2), "#");
 var early_s_date = new Date(2000,1,1,early_s_hour,early_s_min,0);

 var early_e_hour = str2num(early_end_time.substr(0, 2), "#");
 var early_e_min = str2num(early_end_time.substr(3, 2), "#");
 var early_e_date = new Date(2000,1,1,early_e_hour,early_e_min,0);

 if (fcsj_date >= early_s_date && fcsj_date <= early_e_date) {
 isZgf = true;
 }
}

// 判定是否晚高峰
var isWgf = false;
if (timeRex.test(late_start_time) && timeRex.test(late_end_time) && late_up_time != null && late_down_time != null) {
 var late_s_hour = str2num(late_start_time.substr(0, 2), "#");
 var late_s_min = str2num(late_start_time.substr(3, 2), "#");
 var late_s_date = new Date(2000,1,1,late_s_hour,late_s_min,0);

 var late_e_hour = str2num(late_end_time.substr(0, 2), "#");
 var late_e_min = str2num(late_end_time.substr(3, 2), "#");
 var late_e_date = new Date(2000,1,1,late_e_hour,late_e_min,0);

 if (fcsj_date >= late_s_date && fcsj_date <= late_e_date) {
 isWgf = true;
 }
}

// 判定是否晚高峰

if (sxx == 0) { // 上行
 if (isZgf) {
 jhlc = up_mileage;
 bcsj = early_up_time;
 } else if (isWgf) {
 jhlc = up_mileage;
 bcsj = late_up_time;
 } else {
 jhlc = up_mileage;
 bcsj = up_travel_time;
 }
} else { // sxx == 1 下行
 if (isZgf) {
 jhlc = down_mileage;
 bcsj = early_down_time;
 } else if (isWgf) {
 jhlc = down_mileage;
 bcsj = late_down_time;
 } else {
 jhlc = down_mileage;
 bcsj = down_travel_time;
 }
}</jsScript_script> | 699 | + <jsScript_script>//Script here

var jhlc; // 计划里程
var bcsj; // 班次时间

// 时间范围正则表达式
var timeRex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
// 发车时间转换成日期
var fcsj_hour = str2num(sendtime_calcu.substr(0, 2), "#");
var fcsj_min = str2num(sendtime_calcu.substr(3, 2), "#");
var fcsj_date = new Date(2000,1,1,fcsj_hour,fcsj_min,0);

// 判定是否早高峰
var isZgf = false;
if (timeRex.test(early_start_time) && timeRex.test(early_end_time) && early_up_time != null && early_down_time != null) {
 var early_s_hour = str2num(early_start_time.substr(0, 2), "#");
 var early_s_min = str2num(early_start_time.substr(3, 2), "#");
 var early_s_date = new Date(2000,1,1,early_s_hour,early_s_min,0);

 var early_e_hour = str2num(early_end_time.substr(0, 2), "#");
 var early_e_min = str2num(early_end_time.substr(3, 2), "#");
 var early_e_date = new Date(2000,1,1,early_e_hour,early_e_min,0);

 if (fcsj_date >= early_s_date && fcsj_date <= early_e_date) {
 isZgf = true;
 }
}

// 判定是否晚高峰
var isWgf = false;
if (timeRex.test(late_start_time) && timeRex.test(late_end_time) && late_up_time != null && late_down_time != null) {
 var late_s_hour = str2num(late_start_time.substr(0, 2), "#");
 var late_s_min = str2num(late_start_time.substr(3, 2), "#");
 var late_s_date = new Date(2000,1,1,late_s_hour,late_s_min,0);

 var late_e_hour = str2num(late_end_time.substr(0, 2), "#");
 var late_e_min = str2num(late_end_time.substr(3, 2), "#");
 var late_e_date = new Date(2000,1,1,late_e_hour,late_e_min,0);

 if (fcsj_date >= late_s_date && fcsj_date <= late_e_date) {
 isWgf = true;
 }
}

// 判定是否晚高峰

if (sxx == 0) { // 上行
 if (isZgf) {
 jhlc = up_mileage;
 bcsj = early_up_time ? early_up_time : up_travel_time;
 } else if (isWgf) {
 jhlc = up_mileage;
 bcsj = late_up_time ? late_up_time : up_travel_time;
 } else {
 jhlc = up_mileage;
 bcsj = up_travel_time;
 }
} else { // sxx == 1 下行
 if (isZgf) {
 jhlc = down_mileage;
 bcsj = early_down_time ? early_down_time : down_travel_time;
 } else if (isWgf) {
 jhlc = down_mileage;
 bcsj = late_down_time ? late_down_time : down_travel_time;
 } else {
 jhlc = down_mileage;
 bcsj = down_travel_time;
 }
}</jsScript_script> |
| 700 | </jsScript> </jsScripts> <fields> <field> <name>jhlc</name> | 700 | </jsScript> </jsScripts> <fields> <field> <name>jhlc</name> |
| 701 | <rename>jhlc</rename> | 701 | <rename>jhlc</rename> |
| 702 | <type>String</type> | 702 | <type>String</type> |
src/main/resources/logback.xml
| @@ -16,12 +16,12 @@ | @@ -16,12 +16,12 @@ | ||
| 16 | 16 | ||
| 17 | <!-- 主日志文件 --> | 17 | <!-- 主日志文件 --> |
| 18 | <appender name="FILE" | 18 | <appender name="FILE" |
| 19 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | 19 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 20 | <file>${LOG_BASE}/main/main.log</file> | 20 | <file>${LOG_BASE}/main/main.log</file> |
| 21 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 21 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 22 | <fileNamePattern>${LOG_BASE}/main/main-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 22 | <fileNamePattern>${LOG_BASE}/main/main-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 23 | <timeBasedFileNamingAndTriggeringPolicy | 23 | <timeBasedFileNamingAndTriggeringPolicy |
| 24 | - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 24 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 25 | <maxFileSize>100MB</maxFileSize> | 25 | <maxFileSize>100MB</maxFileSize> |
| 26 | </timeBasedFileNamingAndTriggeringPolicy> | 26 | </timeBasedFileNamingAndTriggeringPolicy> |
| 27 | </rollingPolicy> | 27 | </rollingPolicy> |
| @@ -38,12 +38,12 @@ | @@ -38,12 +38,12 @@ | ||
| 38 | 38 | ||
| 39 | <!-- 访问日志 --> | 39 | <!-- 访问日志 --> |
| 40 | <appender name="ACCESS" | 40 | <appender name="ACCESS" |
| 41 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | 41 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 42 | <file>${LOG_BASE}/access/access.log</file> | 42 | <file>${LOG_BASE}/access/access.log</file> |
| 43 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 43 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 44 | <fileNamePattern>${LOG_BASE}/access/access-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 44 | <fileNamePattern>${LOG_BASE}/access/access-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 45 | <timeBasedFileNamingAndTriggeringPolicy | 45 | <timeBasedFileNamingAndTriggeringPolicy |
| 46 | - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 46 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 47 | <maxFileSize>100MB</maxFileSize> | 47 | <maxFileSize>100MB</maxFileSize> |
| 48 | </timeBasedFileNamingAndTriggeringPolicy> | 48 | </timeBasedFileNamingAndTriggeringPolicy> |
| 49 | </rollingPolicy> | 49 | </rollingPolicy> |
| @@ -55,18 +55,18 @@ | @@ -55,18 +55,18 @@ | ||
| 55 | </layout> | 55 | </layout> |
| 56 | </appender> | 56 | </appender> |
| 57 | <logger name="com.bsth.filter.AccessLogFilter" level="INFO" | 57 | <logger name="com.bsth.filter.AccessLogFilter" level="INFO" |
| 58 | - additivity="false"> | 58 | + additivity="false"> |
| 59 | <appender-ref ref="ACCESS" /> | 59 | <appender-ref ref="ACCESS" /> |
| 60 | </logger> | 60 | </logger> |
| 61 | 61 | ||
| 62 | <!-- 和网关通讯日志日志 --> | 62 | <!-- 和网关通讯日志日志 --> |
| 63 | <appender name="GATEWAY" | 63 | <appender name="GATEWAY" |
| 64 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | 64 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 65 | <file>${LOG_BASE}/gateway/gateway.log</file> | 65 | <file>${LOG_BASE}/gateway/gateway.log</file> |
| 66 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 66 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 67 | <fileNamePattern>${LOG_BASE}/gateway/gateway-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 67 | <fileNamePattern>${LOG_BASE}/gateway/gateway-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 68 | <timeBasedFileNamingAndTriggeringPolicy | 68 | <timeBasedFileNamingAndTriggeringPolicy |
| 69 | - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 69 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 70 | <maxFileSize>100MB</maxFileSize> | 70 | <maxFileSize>100MB</maxFileSize> |
| 71 | </timeBasedFileNamingAndTriggeringPolicy> | 71 | </timeBasedFileNamingAndTriggeringPolicy> |
| 72 | </rollingPolicy> | 72 | </rollingPolicy> |
| @@ -77,26 +77,26 @@ | @@ -77,26 +77,26 @@ | ||
| 77 | </layout> | 77 | </layout> |
| 78 | </appender> | 78 | </appender> |
| 79 | <logger name="com.bsth.service.directive.DirectiveServiceImpl" | 79 | <logger name="com.bsth.service.directive.DirectiveServiceImpl" |
| 80 | - level="INFO" additivity="false"> | 80 | + level="INFO" additivity="false"> |
| 81 | <appender-ref ref="GATEWAY" /> | 81 | <appender-ref ref="GATEWAY" /> |
| 82 | </logger> | 82 | </logger> |
| 83 | <logger name="com.bsth.controller.directive.UpstreamEntrance" | 83 | <logger name="com.bsth.controller.directive.UpstreamEntrance" |
| 84 | - level="INFO" additivity="false"> | 84 | + level="INFO" additivity="false"> |
| 85 | <appender-ref ref="GATEWAY" /> | 85 | <appender-ref ref="GATEWAY" /> |
| 86 | </logger> | 86 | </logger> |
| 87 | <logger name="com.bsth.data.directive.GatewayHttpUtils" level="INFO" | 87 | <logger name="com.bsth.data.directive.GatewayHttpUtils" level="INFO" |
| 88 | - additivity="false"> | 88 | + additivity="false"> |
| 89 | <appender-ref ref="GATEWAY" /> | 89 | <appender-ref ref="GATEWAY" /> |
| 90 | </logger> | 90 | </logger> |
| 91 | 91 | ||
| 92 | <!-- 运管处接口日志 --> | 92 | <!-- 运管处接口日志 --> |
| 93 | <appender name="TRAFFIC" | 93 | <appender name="TRAFFIC" |
| 94 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | 94 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 95 | <file>${LOG_BASE}/traffic/traffic.log</file> | 95 | <file>${LOG_BASE}/traffic/traffic.log</file> |
| 96 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 96 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 97 | <fileNamePattern>${LOG_BASE}/traffic/traffic-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 97 | <fileNamePattern>${LOG_BASE}/traffic/traffic-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 98 | <timeBasedFileNamingAndTriggeringPolicy | 98 | <timeBasedFileNamingAndTriggeringPolicy |
| 99 | - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 99 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 100 | <maxFileSize>100MB</maxFileSize> | 100 | <maxFileSize>100MB</maxFileSize> |
| 101 | </timeBasedFileNamingAndTriggeringPolicy> | 101 | </timeBasedFileNamingAndTriggeringPolicy> |
| 102 | </rollingPolicy> | 102 | </rollingPolicy> |
| @@ -107,18 +107,18 @@ | @@ -107,18 +107,18 @@ | ||
| 107 | </layout> | 107 | </layout> |
| 108 | </appender> | 108 | </appender> |
| 109 | <logger name="com.bsth.service.impl.TrafficManageServiceImpl" | 109 | <logger name="com.bsth.service.impl.TrafficManageServiceImpl" |
| 110 | - level="INFO" additivity="false"> | 110 | + level="INFO" additivity="false"> |
| 111 | <appender-ref ref="TRAFFIC" /> | 111 | <appender-ref ref="TRAFFIC" /> |
| 112 | </logger> | 112 | </logger> |
| 113 | 113 | ||
| 114 | <!-- schedule 数据工具操作日志 --> | 114 | <!-- schedule 数据工具操作日志 --> |
| 115 | <appender name="DATATOOLS" | 115 | <appender name="DATATOOLS" |
| 116 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | 116 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 117 | <file>${LOG_BASE}/schedule/datatools/datatools.log</file> | 117 | <file>${LOG_BASE}/schedule/datatools/datatools.log</file> |
| 118 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 118 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 119 | <fileNamePattern>${LOG_BASE}/schedule/datatools/datatools-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 119 | <fileNamePattern>${LOG_BASE}/schedule/datatools/datatools-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 120 | <timeBasedFileNamingAndTriggeringPolicy | 120 | <timeBasedFileNamingAndTriggeringPolicy |
| 121 | - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 121 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 122 | <maxFileSize>100MB</maxFileSize> | 122 | <maxFileSize>100MB</maxFileSize> |
| 123 | </timeBasedFileNamingAndTriggeringPolicy> | 123 | </timeBasedFileNamingAndTriggeringPolicy> |
| 124 | </rollingPolicy> | 124 | </rollingPolicy> |
| @@ -130,12 +130,12 @@ | @@ -130,12 +130,12 @@ | ||
| 130 | </appender> | 130 | </appender> |
| 131 | <!-- schedule 时刻表操作日志 --> | 131 | <!-- schedule 时刻表操作日志 --> |
| 132 | <appender name="TIMETABLE" | 132 | <appender name="TIMETABLE" |
| 133 | - class="ch.qos.logback.core.rolling.RollingFileAppender"> | 133 | + class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 134 | <file>${LOG_BASE}/schedule/timetable/timetable.log</file> | 134 | <file>${LOG_BASE}/schedule/timetable/timetable.log</file> |
| 135 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 135 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 136 | <fileNamePattern>${LOG_BASE}/schedule/timetable/timetable-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 136 | <fileNamePattern>${LOG_BASE}/schedule/timetable/timetable-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 137 | <timeBasedFileNamingAndTriggeringPolicy | 137 | <timeBasedFileNamingAndTriggeringPolicy |
| 138 | - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 138 | + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 139 | <maxFileSize>100MB</maxFileSize> | 139 | <maxFileSize>100MB</maxFileSize> |
| 140 | </timeBasedFileNamingAndTriggeringPolicy> | 140 | </timeBasedFileNamingAndTriggeringPolicy> |
| 141 | </rollingPolicy> | 141 | </rollingPolicy> |
| @@ -146,11 +146,11 @@ | @@ -146,11 +146,11 @@ | ||
| 146 | </layout> | 146 | </layout> |
| 147 | </appender> | 147 | </appender> |
| 148 | <logger name="com.bsth.service.schedule.impl.TTInfoDetailServiceImpl" | 148 | <logger name="com.bsth.service.schedule.impl.TTInfoDetailServiceImpl" |
| 149 | - level="INFO" additivity="false"> | 149 | + level="INFO" additivity="false"> |
| 150 | <appender-ref ref="TIMETABLE" /> | 150 | <appender-ref ref="TIMETABLE" /> |
| 151 | </logger> | 151 | </logger> |
| 152 | <logger name="com.bsth.service.schedule.utils.DataToolsServiceImpl" | 152 | <logger name="com.bsth.service.schedule.utils.DataToolsServiceImpl" |
| 153 | - level="INFO" additivity="false"> | 153 | + level="INFO" additivity="false"> |
| 154 | <appender-ref ref="TIMETABLE" /> | 154 | <appender-ref ref="TIMETABLE" /> |
| 155 | <appender-ref ref="DATATOOLS" /> | 155 | <appender-ref ref="DATATOOLS" /> |
| 156 | </logger> | 156 | </logger> |
| @@ -181,35 +181,36 @@ | @@ -181,35 +181,36 @@ | ||
| 181 | level="INFO" additivity="false"> | 181 | level="INFO" additivity="false"> |
| 182 | <appender-ref ref="GPS_COUNT" /> | 182 | <appender-ref ref="GPS_COUNT" /> |
| 183 | </logger> | 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 | <root level="info"> | 216 | <root level="info"> |
src/main/resources/rules/shiftloop_fb_2.drl
| @@ -5,6 +5,8 @@ import java.util.*; | @@ -5,6 +5,8 @@ import java.util.*; | ||
| 5 | 5 | ||
| 6 | import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output; | 6 | import com.bsth.service.schedule.rules.ttinfo.LpInfoResult_output; |
| 7 | 7 | ||
| 8 | +import com.bsth.service.schedule.utils.Md5Util; | ||
| 9 | + | ||
| 8 | import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; | 10 | import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; |
| 9 | import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; | 11 | import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; |
| 10 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; | 12 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; |
| @@ -28,6 +30,7 @@ global ScheduleRuleService scheduleRuleService; | @@ -28,6 +30,7 @@ global ScheduleRuleService scheduleRuleService; | ||
| 28 | 30 | ||
| 29 | declare Calcu_days_result_pre | 31 | declare Calcu_days_result_pre |
| 30 | ruleId: String // 规则Id | 32 | ruleId: String // 规则Id |
| 33 | + ruleMd5: String // 规则md5 | ||
| 31 | 34 | ||
| 32 | calcu_index_lp : Integer // 计算之后路牌的起始索引 | 35 | calcu_index_lp : Integer // 计算之后路牌的起始索引 |
| 33 | calcu_index_ry : Integer // 计算之后人员的起始索引 | 36 | calcu_index_ry : Integer // 计算之后人员的起始索引 |
| @@ -59,7 +62,7 @@ rule "calcu_days_1_" | @@ -59,7 +62,7 @@ rule "calcu_days_1_" | ||
| 59 | $xlId: xlId | 62 | $xlId: xlId |
| 60 | ) | 63 | ) |
| 61 | ScheduleRule_input( | 64 | ScheduleRule_input( |
| 62 | - $ruleId : ruleId, $qyrq : qyrq, | 65 | + $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5, |
| 63 | $lpindex : startGbdIndex, $ryindex: startEIndex) | 66 | $lpindex : startGbdIndex, $ryindex: startEIndex) |
| 64 | eval($qyrq.isBefore($fromDate)) | 67 | eval($qyrq.isBefore($fromDate)) |
| 65 | then | 68 | then |
| @@ -68,6 +71,7 @@ rule "calcu_days_1_" | @@ -68,6 +71,7 @@ rule "calcu_days_1_" | ||
| 68 | // 构造Calcu_days_result_pre,用于路牌 | 71 | // 构造Calcu_days_result_pre,用于路牌 |
| 69 | Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); | 72 | Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); |
| 70 | cdrp.setRuleId($ruleId); | 73 | cdrp.setRuleId($ruleId); |
| 74 | + cdrp.setRuleMd5($ruleMd5); | ||
| 71 | cdrp.setCalcu_index_lp($lpindex); | 75 | cdrp.setCalcu_index_lp($lpindex); |
| 72 | cdrp.setCalcu_index_ry($ryindex); | 76 | cdrp.setCalcu_index_ry($ryindex); |
| 73 | cdrp.setCalcu_start_date_1($qyrq); | 77 | cdrp.setCalcu_start_date_1($qyrq); |
| @@ -94,7 +98,7 @@ rule "calcu_days_2_" | @@ -94,7 +98,7 @@ rule "calcu_days_2_" | ||
| 94 | $xlId: xlId | 98 | $xlId: xlId |
| 95 | ) | 99 | ) |
| 96 | ScheduleRule_input( | 100 | ScheduleRule_input( |
| 97 | - $ruleId : ruleId, $qyrq : qyrq, | 101 | + $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5, |
| 98 | $lpindex : startGbdIndex, $ryindex: startEIndex) | 102 | $lpindex : startGbdIndex, $ryindex: startEIndex) |
| 99 | eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate))) | 103 | eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate))) |
| 100 | then | 104 | then |
| @@ -103,6 +107,7 @@ rule "calcu_days_2_" | @@ -103,6 +107,7 @@ rule "calcu_days_2_" | ||
| 103 | // 构造Calcu_days_result_pre,用于路牌 | 107 | // 构造Calcu_days_result_pre,用于路牌 |
| 104 | Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); | 108 | Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); |
| 105 | cdrp.setRuleId($ruleId); | 109 | cdrp.setRuleId($ruleId); |
| 110 | + cdrp.setRuleMd5($ruleMd5); | ||
| 106 | cdrp.setCalcu_index_lp($lpindex); | 111 | cdrp.setCalcu_index_lp($lpindex); |
| 107 | cdrp.setCalcu_index_ry($ryindex); | 112 | cdrp.setCalcu_index_ry($ryindex); |
| 108 | cdrp.setCalcu_start_date_1($qyrq); | 113 | cdrp.setCalcu_start_date_1($qyrq); |
| @@ -124,6 +129,7 @@ end | @@ -124,6 +129,7 @@ end | ||
| 124 | 129 | ||
| 125 | declare SchedulePlanRuleResult_wrap | 130 | declare SchedulePlanRuleResult_wrap |
| 126 | ruleId: String // 规则Id | 131 | ruleId: String // 规则Id |
| 132 | + ruleMd5: String // 规则md5编码 | ||
| 127 | scheduleDate: DateTime // 排班日期 | 133 | scheduleDate: DateTime // 排班日期 |
| 128 | 134 | ||
| 129 | isUsed: Boolean = false // 是否被使用过 | 135 | isUsed: Boolean = false // 是否被使用过 |
| @@ -142,7 +148,7 @@ rule "Calcu_SchedulePlanRuleResult_wrap" | @@ -142,7 +148,7 @@ rule "Calcu_SchedulePlanRuleResult_wrap" | ||
| 142 | $self: schedulePlan | 148 | $self: schedulePlan |
| 143 | ) | 149 | ) |
| 144 | eval($self.getIsHistoryPlanFirst() == true) // 是否使用历史排班标识 | 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 | then | 153 | then |
| 148 | // 创建班序历史结果数据 | 154 | // 创建班序历史结果数据 |
| @@ -151,6 +157,16 @@ rule "Calcu_SchedulePlanRuleResult_wrap" | @@ -151,6 +157,16 @@ rule "Calcu_SchedulePlanRuleResult_wrap" | ||
| 151 | schedulePlanRuleResult_wrap.setScheduleDate(new DateTime($sprr.getScheduleDate())); | 157 | schedulePlanRuleResult_wrap.setScheduleDate(new DateTime($sprr.getScheduleDate())); |
| 152 | schedulePlanRuleResult_wrap.setSelf($sprr); | 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 | insert(schedulePlanRuleResult_wrap); | 170 | insert(schedulePlanRuleResult_wrap); |
| 155 | end | 171 | end |
| 156 | 172 | ||
| @@ -163,10 +179,12 @@ rule "calcu_days_1_with_result" | @@ -163,10 +179,12 @@ rule "calcu_days_1_with_result" | ||
| 163 | when | 179 | when |
| 164 | $cdrp: Calcu_days_result_pre( | 180 | $cdrp: Calcu_days_result_pre( |
| 165 | calcu_start_date_1.isBefore(calcu_start_date_2), | 181 | calcu_start_date_1.isBefore(calcu_start_date_2), |
| 166 | - $ruleId: ruleId | 182 | + $ruleId: ruleId, |
| 183 | + $ruleMd5: ruleMd5 | ||
| 167 | ) | 184 | ) |
| 168 | $srrr_wrap: SchedulePlanRuleResult_wrap( | 185 | $srrr_wrap: SchedulePlanRuleResult_wrap( |
| 169 | - ruleId == $ruleId, | 186 | +// ruleId == $ruleId, |
| 187 | + ruleMd5 == $ruleMd5, | ||
| 170 | scheduleDate.isAfter($cdrp.calcu_start_date_1), | 188 | scheduleDate.isAfter($cdrp.calcu_start_date_1), |
| 171 | scheduleDate.isBefore($cdrp.calcu_start_date_2), | 189 | scheduleDate.isBefore($cdrp.calcu_start_date_2), |
| 172 | isUsed == false, | 190 | isUsed == false, |
src/main/resources/static/pages/base/carpark/add.html
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | <i class="icon-equalizer font-red-sunglo"></i> | 18 | <i class="icon-equalizer font-red-sunglo"></i> |
| 19 | <span class="caption-subject font-red-sunglo bold uppercase">添加停车场 | 19 | <span class="caption-subject font-red-sunglo bold uppercase">添加停车场 |
| 20 | <span class="step-title"> 1 - 4 </span> | 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 | </span> | 22 | </span> |
| 22 | </div> | 23 | </div> |
| 23 | 24 | ||
| @@ -38,28 +39,28 @@ | @@ -38,28 +39,28 @@ | ||
| 38 | <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> | 39 | <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> |
| 39 | <span class="number"> 1 </span> | 40 | <span class="number"> 1 </span> |
| 40 | <span class="desc"> | 41 | <span class="desc"> |
| 41 | - <i class="fa fa-check"></i> 选择添加停车场方式 </span> | 42 | + <i class="fa fa-check"></i> 获取停车场位置方式 </span> |
| 42 | </a> | 43 | </a> |
| 43 | </li> | 44 | </li> |
| 44 | <li> | 45 | <li> |
| 45 | <a href="#tab2" data-toggle="tab" class="step"> | 46 | <a href="#tab2" data-toggle="tab" class="step"> |
| 46 | <span class="number"> 2 </span> | 47 | <span class="number"> 2 </span> |
| 47 | <span class="desc"> | 48 | <span class="desc"> |
| 48 | - <i class="fa fa-check"></i> 停车场位置 </span> | 49 | + <i class="fa fa-check"></i> 确定停车场位置 </span> |
| 49 | </a> | 50 | </a> |
| 50 | </li> | 51 | </li> |
| 51 | <li> | 52 | <li> |
| 52 | <a href="#tab3" data-toggle="tab" class="step active"> | 53 | <a href="#tab3" data-toggle="tab" class="step active"> |
| 53 | <span class="number"> 3 </span> | 54 | <span class="number"> 3 </span> |
| 54 | <span class="desc"> | 55 | <span class="desc"> |
| 55 | - <i class="fa fa-check"></i> 停车场信息 </span> | 56 | + <i class="fa fa-check"></i> 填写停车场信息 </span> |
| 56 | </a> | 57 | </a> |
| 57 | </li> | 58 | </li> |
| 58 | <li> | 59 | <li> |
| 59 | <a href="#tab4" data-toggle="tab" class="step"> | 60 | <a href="#tab4" data-toggle="tab" class="step"> |
| 60 | <span class="number"> 4 </span> | 61 | <span class="number"> 4 </span> |
| 61 | <span class="desc"> | 62 | <span class="desc"> |
| 62 | - <i class="fa fa-check"></i> 确认 </span> | 63 | + <i class="fa fa-check"></i> 确认并提交 </span> |
| 63 | </a> | 64 | </a> |
| 64 | </li> | 65 | </li> |
| 65 | </ul> | 66 | </ul> |
| @@ -81,47 +82,33 @@ | @@ -81,47 +82,33 @@ | ||
| 81 | 82 | ||
| 82 | <!-- 选择添加站点方式 --> | 83 | <!-- 选择添加站点方式 --> |
| 83 | <div class="tab-pane active" id="tab1"> | 84 | <div class="tab-pane active" id="tab1"> |
| 84 | - | ||
| 85 | - <h3 class="block"> 选择添加停车场方式 </h3> | ||
| 86 | - | ||
| 87 | - <!-- 站点名称 --> | 85 | + <h3 class="block"> 获取停车场位置方式 </h3> |
| 86 | + <!--停车场名称 --> | ||
| 88 | <div class="form-group" id="formRequ"> | 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>停车场名称 :</label> |
| 90 | <div class="col-md-9"> | 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 | </div> | 91 | </div> |
| 93 | </div> | 92 | </div> |
| 94 | - | ||
| 95 | <!-- 新增方式 --> | 93 | <!-- 新增方式 --> |
| 96 | <div class="form-group"> | 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 | <div class="col-md-9"> | 96 | <div class="col-md-9"> |
| 99 | <div class="icheck-list"> | 97 | <div class="icheck-list"> |
| 100 | <label> | 98 | <label> |
| 101 | <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成 | 99 | <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成 |
| 102 | </label> | 100 | </label> |
| 103 | <label > | 101 | <label > |
| 104 | - <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加 | 102 | + <input type="radio" class="icheck" name="baseRes" value=1 > 手动绘制 |
| 105 | </label> | 103 | </label> |
| 106 | </div> | 104 | </div> |
| 107 | </div> | 105 | </div> |
| 108 | </div> | 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 | </div> | 107 | </div> |
| 119 | - | ||
| 120 | - <!-- 站点位置 --> | 108 | + <!--停车场位置 --> |
| 121 | <div class="tab-pane" id="tab2"> | 109 | <div class="tab-pane" id="tab2"> |
| 122 | - <h3 class="block"> 站点位置 </h3> | 110 | + <h3 class="block"> 停车场位置 </h3> |
| 123 | <div id="addCarParkbmap_basic"></div> | 111 | <div id="addCarParkbmap_basic"></div> |
| 124 | - | ||
| 125 | <div class="leftUtils"> | 112 | <div class="leftUtils"> |
| 126 | <div class="btn-group" style="left: 100px;"> | 113 | <div class="btn-group" style="left: 100px;"> |
| 127 | <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | 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,243 +126,197 @@ | ||
| 139 | </div> | 126 | </div> |
| 140 | </div> | 127 | </div> |
| 141 | </div> | 128 | </div> |
| 142 | - | ||
| 143 | - <!-- 站点信息 --> | 129 | + <!--停车场信息 --> |
| 144 | <div class="tab-pane" id="tab3"> | 130 | <div class="tab-pane" id="tab3"> |
| 145 | - | ||
| 146 | <h3 class="block"> 停车场信息 </h3> | 131 | <h3 class="block"> 停车场信息 </h3> |
| 147 | - | ||
| 148 | <input type="hidden" name="bParkPoint" id="bParkPointInput" /> | 132 | <input type="hidden" name="bParkPoint" id="bParkPointInput" /> |
| 149 | - | ||
| 150 | <input type="hidden" name="gParkPoint" id="gParkPointInput" /> | 133 | <input type="hidden" name="gParkPoint" id="gParkPointInput" /> |
| 151 | - | ||
| 152 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | 134 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 153 | - | ||
| 154 | - | ||
| 155 | <!-- 停车场名称 --> | 135 | <!-- 停车场名称 --> |
| 156 | <div class="form-body"> | 136 | <div class="form-body"> |
| 157 | <div class="form-group"> | 137 | <div class="form-group"> |
| 158 | <label class="control-label col-md-3"> | 138 | <label class="control-label col-md-3"> |
| 159 | - <span class="required"> * </span> 停车场名称 : | 139 | + <span class="required"> * </span> 停车场名称 : |
| 160 | </label> | 140 | </label> |
| 161 | <div class="col-md-6"> | 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 | </div> | 143 | </div> |
| 164 | </div> | 144 | </div> |
| 165 | </div> | 145 | </div> |
| 166 | - | ||
| 167 | <!-- 停车场编码 --> | 146 | <!-- 停车场编码 --> |
| 168 | <div class="form-body"> | 147 | <div class="form-body"> |
| 169 | <div class="form-group"> | 148 | <div class="form-group"> |
| 170 | <label class="control-label col-md-3"> | 149 | <label class="control-label col-md-3"> |
| 171 | - <span class="required"> * </span>停车场编码: | 150 | + <span class="required"> * </span>停车场编码 : |
| 172 | </label> | 151 | </label> |
| 173 | <div class="col-md-6"> | 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 | </div> | 154 | </div> |
| 176 | </div> | 155 | </div> |
| 177 | </div> | 156 | </div> |
| 178 | - | ||
| 179 | - <!-- 中心位置坐标点 --> | 157 | + <!-- 经纬度坐标点 --> |
| 180 | <div class="form-body"> | 158 | <div class="form-body"> |
| 181 | <div class="form-group"> | 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 | <div class="col-md-6"> | 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 | </div> | 163 | </div> |
| 186 | </div> | 164 | </div> |
| 187 | </div> | 165 | </div> |
| 188 | 166 | ||
| 189 | - <!-- 范围图形类型 --> | 167 | + <!-- 几何图形类型 --> |
| 190 | <div class="form-body"> | 168 | <div class="form-body"> |
| 191 | <div class="form-group"> | 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 | <div class="col-md-6"> | 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 | </div> | 173 | </div> |
| 200 | </div> | 174 | </div> |
| 201 | </div> | 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> 圆形半径 :</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 | <div class="form-body"> | 186 | <div class="form-body"> |
| 205 | <div class="form-group"> | 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>是否撤销 :</label> |
| 207 | <div class="col-md-6"> | 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 | </div> | 195 | </div> |
| 210 | </div> | 196 | </div> |
| 211 | </div> | 197 | </div> |
| 212 | - | ||
| 213 | <!-- 面积 --> | 198 | <!-- 面积 --> |
| 214 | <div class="form-body"> | 199 | <div class="form-body"> |
| 215 | <div class="form-group"> | 200 | <div class="form-group"> |
| 216 | - <label class="col-md-3 control-label">面积:</label> | 201 | + <label class="col-md-3 control-label">面积 :</label> |
| 217 | <div class="col-md-6"> | 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 | </div> | 205 | </div> |
| 221 | </div> | 206 | </div> |
| 222 | </div> | 207 | </div> |
| 223 | - | ||
| 224 | <!-- 所属公司 --> | 208 | <!-- 所属公司 --> |
| 225 | <div class="form-body"> | 209 | <div class="form-body"> |
| 226 | <div class="form-group"> | 210 | <div class="form-group"> |
| 227 | - <label class="col-md-3 control-label">所属公司:</label> | 211 | + <label class="col-md-3 control-label">所属公司 :</label> |
| 228 | <div class="col-md-6"> | 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 | </div> | 214 | </div> |
| 233 | </div> | 215 | </div> |
| 234 | </div> | 216 | </div> |
| 235 | - | ||
| 236 | - | ||
| 237 | <!-- 所属分公司 --> | 217 | <!-- 所属分公司 --> |
| 238 | - <!-- <div class="form-body"> | 218 | + <div class="form-body"> |
| 239 | <div class="form-group"> | 219 | <div class="form-group"> |
| 240 | - <label class="col-md-3 control-label">所属分公司:</label> | 220 | + <label class="col-md-3 control-label">所属分公司 :</label> |
| 241 | <div class="col-md-6"> | 221 | <div class="col-md-6"> |
| 242 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> | 222 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> |
| 243 | </select> | 223 | </select> |
| 244 | </div> | 224 | </div> |
| 245 | </div> | 225 | </div> |
| 246 | - </div> --> | ||
| 247 | - | ||
| 248 | - | 226 | + </div> |
| 249 | <!-- 版本号 --> | 227 | <!-- 版本号 --> |
| 250 | <div class="form-body"> | 228 | <div class="form-body"> |
| 251 | <div class="form-group"> | 229 | <div class="form-group"> |
| 252 | - <label class="col-md-3 control-label">版本号:</label> | 230 | + <label class="col-md-3 control-label">版本号 :</label> |
| 253 | <div class="col-md-6"> | 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 | </div> | 233 | </div> |
| 256 | </div> | 234 | </div> |
| 257 | </div> | 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 | <div class="form-group"> | 237 | <div class="form-group"> |
| 275 | - <label class="control-label col-md-3"> 描述/说明: </label> | 238 | + <label class="control-label col-md-3"> 描述/说明 : </label> |
| 276 | <div class="col-md-6"> | 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 | </div> | 241 | </div> |
| 279 | </div> | 242 | </div> |
| 280 | 243 | ||
| 281 | </div> | 244 | </div> |
| 282 | - | ||
| 283 | <!-- 确定提交资料信息 --> | 245 | <!-- 确定提交资料信息 --> |
| 284 | <div class="tab-pane" id="tab4"> | 246 | <div class="tab-pane" id="tab4"> |
| 285 | <h3 class="block"> 确认您提交的停车场信息 </h3> | 247 | <h3 class="block"> 确认您提交的停车场信息 </h3> |
| 286 | - | ||
| 287 | <h4 class="form-section"> 地理位置 </h4> | 248 | <h4 class="form-section"> 地理位置 </h4> |
| 288 | - | ||
| 289 | <div class="form-group"> | 249 | <div class="form-group"> |
| 290 | - <label class="control-label col-md-3"> 范围图形类型: </label> | 250 | + <label class="control-label col-md-3"> 几何图形类型: </label> |
| 291 | <div class="col-md-4"> | 251 | <div class="col-md-4"> |
| 292 | <p class="form-control-static" data-display="shapesType"> </p> | 252 | <p class="form-control-static" data-display="shapesType"> </p> |
| 293 | </div> | 253 | </div> |
| 294 | </div> | 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"> 圆形半径 : </label> | ||
| 298 | <div class="col-md-4"> | 257 | <div class="col-md-4"> |
| 299 | <p class="form-control-static" data-display="radius"> </p> | 258 | <p class="form-control-static" data-display="radius"> </p> |
| 300 | </div> | 259 | </div> |
| 301 | </div> | 260 | </div> |
| 302 | 261 | ||
| 303 | <div class="form-group"> | 262 | <div class="form-group"> |
| 304 | - <label class="control-label col-md-3"> 中心位置经纬度坐标点: </label> | 263 | + <label class="control-label col-md-3"> 经纬度坐标点: </label> |
| 305 | <div class="col-md-4"> | 264 | <div class="col-md-4"> |
| 306 | <p class="form-control-static" data-display="bCenterPoint"> </p> | 265 | <p class="form-control-static" data-display="bCenterPoint"> </p> |
| 307 | </div> | 266 | </div> |
| 308 | </div> | 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 | <h4 class="form-section"> 停车场信息 </h4> | 268 | <h4 class="form-section"> 停车场信息 </h4> |
| 318 | - | ||
| 319 | <div class="form-group"> | 269 | <div class="form-group"> |
| 320 | - <label class="control-label col-md-3">停车场名称:</label> | 270 | + <label class="control-label col-md-3">停车场名称 :</label> |
| 321 | <div class="col-md-4"> | 271 | <div class="col-md-4"> |
| 322 | <p class="form-control-static" data-display="parkName"> </p> | 272 | <p class="form-control-static" data-display="parkName"> </p> |
| 323 | </div> | 273 | </div> |
| 324 | </div> | 274 | </div> |
| 325 | - | ||
| 326 | <div class="form-group"> | 275 | <div class="form-group"> |
| 327 | - <label class="control-label col-md-3">停车场编码:</label> | 276 | + <label class="control-label col-md-3">停车场编码 :</label> |
| 328 | <div class="col-md-4"> | 277 | <div class="col-md-4"> |
| 329 | <p class="form-control-static" data-display="parkCode"> </p> | 278 | <p class="form-control-static" data-display="parkCode"> </p> |
| 330 | </div> | 279 | </div> |
| 331 | </div> | 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">是否撤销 :</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">面积 :</label> | ||
| 335 | <div class="col-md-4"> | 289 | <div class="col-md-4"> |
| 336 | <p class="form-control-static" data-display="area"> </p> | 290 | <p class="form-control-static" data-display="area"> </p> |
| 337 | </div> | 291 | </div> |
| 338 | </div> | 292 | </div> |
| 339 | - | ||
| 340 | <div class="form-group"> | 293 | <div class="form-group"> |
| 341 | - <label class="control-label col-md-3">所属公司:</label> | 294 | + <label class="control-label col-md-3">所属公司 :</label> |
| 342 | <div class="col-md-4"> | 295 | <div class="col-md-4"> |
| 343 | <p class="form-control-static" data-display="company"> </p> | 296 | <p class="form-control-static" data-display="company"> </p> |
| 344 | </div> | 297 | </div> |
| 345 | </div> | 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 | <div class="form-group"> | 299 | <div class="form-group"> |
| 355 | - <label class="control-label col-md-3">版本号:</label> | 300 | + <label class="control-label col-md-3">分公司 :</label> |
| 356 | <div class="col-md-4"> | 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 | </div> | 303 | </div> |
| 359 | </div> | 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">版本号 :</label> | ||
| 363 | <div class="col-md-4"> | 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 | </div> | 309 | </div> |
| 366 | </div> | 310 | </div> |
| 367 | - | ||
| 368 | <div class="form-group"> | 311 | <div class="form-group"> |
| 369 | - <label class="control-label col-md-3">描述/说明:</label> | 312 | + <label class="control-label col-md-3">描述/说明 :</label> |
| 370 | <div class="col-md-4"> | 313 | <div class="col-md-4"> |
| 371 | <p class="form-control-static" data-display="descriptions"> </p> | 314 | <p class="form-control-static" data-display="descriptions"> </p> |
| 372 | </div> | 315 | </div> |
| 373 | </div> | 316 | </div> |
| 374 | - | ||
| 375 | </div> | 317 | </div> |
| 376 | </div> | 318 | </div> |
| 377 | </div> | 319 | </div> |
| 378 | - | ||
| 379 | <div class="form-actions"> | 320 | <div class="form-actions"> |
| 380 | <div class="row"> | 321 | <div class="row"> |
| 381 | <div class="col-md-offset-3 col-md-9"> | 322 | <div class="col-md-offset-3 col-md-9"> |
| @@ -390,26 +331,18 @@ | @@ -390,26 +331,18 @@ | ||
| 390 | </div> | 331 | </div> |
| 391 | </div> | 332 | </div> |
| 392 | </div> | 333 | </div> |
| 393 | - | ||
| 394 | </div> | 334 | </div> |
| 395 | </form> | 335 | </form> |
| 396 | - | ||
| 397 | <!-- END FORM--> | 336 | <!-- END FORM--> |
| 398 | - | ||
| 399 | </div> | 337 | </div> |
| 400 | </div> | 338 | </div> |
| 401 | - | ||
| 402 | <!-- 函数方法JS类库 --> | 339 | <!-- 函数方法JS类库 --> |
| 403 | <script src="/pages/base/carpark/js/add-input-function.js"></script> | 340 | <script src="/pages/base/carpark/js/add-input-function.js"></script> |
| 404 | - | ||
| 405 | <!-- 表单向导JS类库 --> | 341 | <!-- 表单向导JS类库 --> |
| 406 | <script src="/pages/base/carpark/js/add-form-wizard.js"></script> | 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 | <!-- 地图JS类库 --> | 345 | <!-- 地图JS类库 --> |
| 409 | <script src="/pages/base/carpark/js/add-vmap-world.js"></script> | 346 | <script src="/pages/base/carpark/js/add-vmap-world.js"></script> |
| 410 | - | ||
| 411 | <!-- 表单元素事件JS类库 --> | 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 | \ No newline at end of file | 348 | \ No newline at end of file |
| 349 | +<script src="/pages/base/carpark/js/add-form-events.js"></script> | ||
| 417 | \ No newline at end of file | 350 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/css/carpark-add.css
src/main/resources/static/pages/base/carpark/css/positions.css
| @@ -21,7 +21,7 @@ html,body{ | @@ -21,7 +21,7 @@ html,body{ | ||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | -.leftUtils{ | 24 | +.leftUtils, .drwmageUtils{ |
| 25 | position: absolute; | 25 | position: absolute; |
| 26 | padding-right: 100px; | 26 | padding-right: 100px; |
| 27 | width: 100%; | 27 | width: 100%; |
| @@ -29,6 +29,7 @@ html,body{ | @@ -29,6 +29,7 @@ html,body{ | ||
| 29 | z-index: 9999; | 29 | z-index: 9999; |
| 30 | padding-top: 7px; | 30 | padding-top: 7px; |
| 31 | top: 20px; | 31 | top: 20px; |
| 32 | + display: none; | ||
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | .BMap_pop div:nth-child(1) , | 35 | .BMap_pop div:nth-child(1) , |
src/main/resources/static/pages/base/carpark/edit.html
| 1 | <!-- 编辑停车场 --> | 1 | <!-- 编辑停车场 --> |
| 2 | <div class="modal fade" id="editPoitsions_carpark_mobal" tabindex="-1" role="basic" aria-hidden="true"> | 2 | <div class="modal fade" id="editPoitsions_carpark_mobal" tabindex="-1" role="basic" aria-hidden="true"> |
| 3 | - | ||
| 4 | <div class="modal-dialog"> | 3 | <div class="modal-dialog"> |
| 5 | - | ||
| 6 | <div class="modal-content"> | 4 | <div class="modal-content"> |
| 7 | - | ||
| 8 | <div class="modal-header"> | 5 | <div class="modal-header"> |
| 9 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | 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 | </div> | 8 | </div> |
| 12 | - | ||
| 13 | <div class="modal-body"> | 9 | <div class="modal-body"> |
| 14 | 10 | ||
| 15 | <form class="form-horizontal" role="form" id="edit_carPark_form" action="/module" method="post"> | 11 | <form class="form-horizontal" role="form" id="edit_carPark_form" action="/module" method="post"> |
| @@ -17,80 +13,81 @@ | @@ -17,80 +13,81 @@ | ||
| 17 | <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | 13 | <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> |
| 18 | 您的输入有误,请检查下面的输入项 | 14 | 您的输入有误,请检查下面的输入项 |
| 19 | </div> | 15 | </div> |
| 20 | - | ||
| 21 | <input type="hidden" name="id" id="idInput" /> | 16 | <input type="hidden" name="id" id="idInput" /> |
| 22 | - | ||
| 23 | <input type="hidden" name="bParkPoint" id="bParkPointInput" /> | 17 | <input type="hidden" name="bParkPoint" id="bParkPointInput" /> |
| 24 | - | ||
| 25 | <input type="hidden" name="gParkPoint" id="gParkPointInput" /> | 18 | <input type="hidden" name="gParkPoint" id="gParkPointInput" /> |
| 26 | - | ||
| 27 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | 19 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 28 | - | ||
| 29 | <!-- 停车场名称 --> | 20 | <!-- 停车场名称 --> |
| 30 | <div class="form-body"> | 21 | <div class="form-body"> |
| 31 | <div class="form-group"> | 22 | <div class="form-group"> |
| 32 | <label class="control-label col-md-3"> | 23 | <label class="control-label col-md-3"> |
| 33 | - <span class="required"> * </span> 停车场名称 : | 24 | + <span class="required"> * </span> 停车场名称 : |
| 34 | </label> | 25 | </label> |
| 35 | <div class="col-md-6"> | 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 | </div> | 28 | </div> |
| 38 | </div> | 29 | </div> |
| 39 | </div> | 30 | </div> |
| 40 | - | ||
| 41 | <!-- 停车场编码 --> | 31 | <!-- 停车场编码 --> |
| 42 | <div class="form-body"> | 32 | <div class="form-body"> |
| 43 | <div class="form-group"> | 33 | <div class="form-group"> |
| 44 | <label class="control-label col-md-3"> | 34 | <label class="control-label col-md-3"> |
| 45 | - <span class="required"> * </span>停车场编码: | 35 | + <span class="required"> * </span>停车场编码 : |
| 46 | </label> | 36 | </label> |
| 47 | <div class="col-md-6"> | 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 | </div> | 39 | </div> |
| 50 | </div> | 40 | </div> |
| 51 | </div> | 41 | </div> |
| 52 | - | ||
| 53 | - <!-- 中心位置坐标点 --> | 42 | + <!-- 经纬度坐标点 --> |
| 54 | <div class="form-body"> | 43 | <div class="form-body"> |
| 55 | <div class="form-group"> | 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 | <div class="col-md-6"> | 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 | </div> | 48 | </div> |
| 60 | </div> | 49 | </div> |
| 61 | </div> | 50 | </div> |
| 62 | 51 | ||
| 63 | - <!-- 范围图形类型 --> | 52 | + <!-- 几何图形类型 --> |
| 64 | <div class="form-body"> | 53 | <div class="form-body"> |
| 65 | <div class="form-group"> | 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 | <div class="col-md-6"> | 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 | </div> | 58 | </div> |
| 74 | </div> | 59 | </div> |
| 75 | </div> | 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>圆形半径 :</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 | <div class="form-body"> | 72 | <div class="form-body"> |
| 79 | <div class="form-group"> | 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>是否撤销 :</label> |
| 81 | <div class="col-md-6"> | 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 | </div> | 81 | </div> |
| 84 | </div> | 82 | </div> |
| 85 | </div> | 83 | </div> |
| 86 | - | ||
| 87 | <!-- 面积 --> | 84 | <!-- 面积 --> |
| 88 | <div class="form-body"> | 85 | <div class="form-body"> |
| 89 | <div class="form-group"> | 86 | <div class="form-group"> |
| 90 | - <label class="col-md-3 control-label">面积:</label> | 87 | + <label class="col-md-3 control-label">面积 :</label> |
| 91 | <div class="col-md-6"> | 88 | <div class="col-md-6"> |
| 92 | <input type="text" class="form-control" name="area" id="areaInput" > | 89 | <input type="text" class="form-control" name="area" id="areaInput" > |
| 93 | - <span class="help-block">单位:平方米</span> | 90 | + <span class="help-block">单位:平方米(㎡)</span> |
| 94 | </div> | 91 | </div> |
| 95 | </div> | 92 | </div> |
| 96 | </div> | 93 | </div> |
| @@ -98,7 +95,7 @@ | @@ -98,7 +95,7 @@ | ||
| 98 | <!-- 所属公司 --> | 95 | <!-- 所属公司 --> |
| 99 | <div class="form-body"> | 96 | <div class="form-body"> |
| 100 | <div class="form-group"> | 97 | <div class="form-group"> |
| 101 | - <label class="col-md-3 control-label">所属公司:</label> | 98 | + <label class="col-md-3 control-label">所属公司 :</label> |
| 102 | <div class="col-md-6"> | 99 | <div class="col-md-6"> |
| 103 | <select name="company" class="form-control" style="width:100%" id="companySelect"> | 100 | <select name="company" class="form-control" style="width:100%" id="companySelect"> |
| 104 | 101 | ||
| @@ -106,47 +103,33 @@ | @@ -106,47 +103,33 @@ | ||
| 106 | </div> | 103 | </div> |
| 107 | </div> | 104 | </div> |
| 108 | </div> | 105 | </div> |
| 109 | - | 106 | + |
| 110 | <!-- 所属分公司 --> | 107 | <!-- 所属分公司 --> |
| 111 | - <!-- <div class="form-body"> | 108 | + <div class="form-body"> |
| 112 | <div class="form-group"> | 109 | <div class="form-group"> |
| 113 | - <label class="col-md-3 control-label">所属分公司:</label> | 110 | + <label class="col-md-3 control-label">所属分公司 :</label> |
| 114 | <div class="col-md-6"> | 111 | <div class="col-md-6"> |
| 115 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> | 112 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> |
| 116 | </select> | 113 | </select> |
| 117 | </div> | 114 | </div> |
| 118 | </div> | 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 | </div> | 116 | </div> |
| 130 | 117 | ||
| 131 | - <!-- 范围图形类型 --> | 118 | + <!-- 版本号 --> |
| 132 | <div class="form-body"> | 119 | <div class="form-body"> |
| 133 | <div class="form-group"> | 120 | <div class="form-group"> |
| 134 | - <label class="col-md-3 control-label">是否撤销:</label> | 121 | + <label class="col-md-3 control-label">版本号 :</label> |
| 135 | <div class="col-md-6"> | 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 | </div> | 124 | </div> |
| 142 | </div> | 125 | </div> |
| 143 | </div> | 126 | </div> |
| 144 | 127 | ||
| 145 | <!-- 描述/说明 --> | 128 | <!-- 描述/说明 --> |
| 146 | <div class="form-group"> | 129 | <div class="form-group"> |
| 147 | - <label class="control-label col-md-3"> 描述/说明: </label> | 130 | + <label class="control-label col-md-3"> 描述/说明 : </label> |
| 148 | <div class="col-md-6"> | 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 | </div> | 133 | </div> |
| 151 | </div> | 134 | </div> |
| 152 | </form> | 135 | </form> |
| @@ -161,105 +144,67 @@ | @@ -161,105 +144,67 @@ | ||
| 161 | <script type="text/javascript"> | 144 | <script type="text/javascript"> |
| 162 | 145 | ||
| 163 | $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fun,carP,ajaxd){ | 146 | $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fun,carP,ajaxd){ |
| 164 | - | ||
| 165 | /** 获取停车场信息对象 */ | 147 | /** 获取停车场信息对象 */ |
| 166 | var CarParkObj = carP.getEitdCarPark(); | 148 | var CarParkObj = carP.getEitdCarPark(); |
| 167 | - | ||
| 168 | // 获取修改停车场对象ID | 149 | // 获取修改停车场对象ID |
| 169 | var carParkId = CarParkObj.carParkId; | 150 | var carParkId = CarParkObj.carParkId; |
| 170 | - | ||
| 171 | - /** 根据修改停车场对象属性值 设值表单元素 @paran:<CarParkObj:停车场对象>*/ | 151 | + /** 根据修改停车场对象属性值 设值表单元素 @paran:<CarParkObj:停车场对象>*/ |
| 172 | fun.setFormValue(CarParkObj); | 152 | fun.setFormValue(CarParkObj); |
| 173 | - | ||
| 174 | /** 填充公司下拉框 */ | 153 | /** 填充公司下拉框 */ |
| 175 | fun.selectTemp(function() { | 154 | fun.selectTemp(function() { |
| 176 | - | ||
| 177 | // 获取公司代码 | 155 | // 获取公司代码 |
| 178 | var businessCode = CarParkObj.carParkCompany; | 156 | var businessCode = CarParkObj.carParkCompany; |
| 179 | - | ||
| 180 | // 获取公司元素并设值 | 157 | // 获取公司元素并设值 |
| 181 | $('#companySelect').val(businessCode); | 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 | $('#brancheCompanySelect').val(CarParkObj.carParkBrancheCompany); | 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 | function companySelectChangeSetBrancheValue() { | 167 | function companySelectChangeSetBrancheValue() { |
| 197 | - | ||
| 198 | // 获取公司下拉框选择值 | 168 | // 获取公司下拉框选择值 |
| 199 | var businessCode = $('#companySelect').val(); | 169 | var businessCode = $('#companySelect').val(); |
| 200 | - | ||
| 201 | // 分公司下拉框options属性值 | 170 | // 分公司下拉框options属性值 |
| 202 | var options = '<option value="">-- 请选择分公司 --</option>'; | 171 | var options = '<option value="">-- 请选择分公司 --</option>'; |
| 203 | - | ||
| 204 | // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | 172 | // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 |
| 205 | if(businessCode == null || businessCode ==''){ | 173 | if(businessCode == null || businessCode ==''){ |
| 206 | - | ||
| 207 | // 填充分公司下拉框options | 174 | // 填充分公司下拉框options |
| 208 | $('#brancheCompanySelect').html(options); | 175 | $('#brancheCompanySelect').html(options); |
| 209 | - | ||
| 210 | } else { | 176 | } else { |
| 211 | - | ||
| 212 | // 查询出所属公司下的分公司名称和相应分公司代码 | 177 | // 查询出所属公司下的分公司名称和相应分公司代码 |
| 213 | $get('/business/all', {upCode_eq: businessCode}, function(array){ | 178 | $get('/business/all', {upCode_eq: businessCode}, function(array){ |
| 214 | - | ||
| 215 | // 遍历array | 179 | // 遍历array |
| 216 | $.each(array, function(i,d){ | 180 | $.each(array, function(i,d){ |
| 217 | - | ||
| 218 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | 181 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 219 | - | ||
| 220 | }); | 182 | }); |
| 221 | - | ||
| 222 | // 填充分公司下拉框options | 183 | // 填充分公司下拉框options |
| 223 | $('#brancheCompanySelect').html(options); | 184 | $('#brancheCompanySelect').html(options); |
| 224 | - | ||
| 225 | }); | 185 | }); |
| 226 | } | 186 | } |
| 227 | } | 187 | } |
| 228 | - | ||
| 229 | // 显示mobal | 188 | // 显示mobal |
| 230 | $('#editPoitsions_carpark_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 189 | $('#editPoitsions_carpark_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 231 | - | ||
| 232 | // 当调用 hide 实例方法时触发 | 190 | // 当调用 hide 实例方法时触发 |
| 233 | $('#editPoitsions_carpark_mobal').on('hide.bs.modal', function () { | 191 | $('#editPoitsions_carpark_mobal').on('hide.bs.modal', function () { |
| 234 | - | ||
| 235 | clearSechear(); | 192 | clearSechear(); |
| 236 | - | ||
| 237 | }); | 193 | }); |
| 238 | - | ||
| 239 | function clearSechear(){ | 194 | function clearSechear(){ |
| 240 | - | ||
| 241 | map.clearMarkAndOverlays(); | 195 | map.clearMarkAndOverlays(); |
| 242 | - | ||
| 243 | carP.setEitdCarPark({}); | 196 | carP.setEitdCarPark({}); |
| 244 | - | ||
| 245 | fun.initCarPark(carParkId); | 197 | fun.initCarPark(carParkId); |
| 246 | - | ||
| 247 | } | 198 | } |
| 248 | - | ||
| 249 | // 编辑表单元素 | 199 | // 编辑表单元素 |
| 250 | var form = $('#edit_carPark_form'); | 200 | var form = $('#edit_carPark_form'); |
| 251 | - | ||
| 252 | // 获取错误提示元素 | 201 | // 获取错误提示元素 |
| 253 | var error = $('.alert-danger', form); | 202 | var error = $('.alert-danger', form); |
| 254 | - | ||
| 255 | // 提交数据按钮事件 | 203 | // 提交数据按钮事件 |
| 256 | $('#editStationButton').on('click', function() { | 204 | $('#editStationButton').on('click', function() { |
| 257 | - | ||
| 258 | // 表单提交 | 205 | // 表单提交 |
| 259 | form.submit(); | 206 | form.submit(); |
| 260 | - | ||
| 261 | }); | 207 | }); |
| 262 | - | ||
| 263 | // 表单验证 | 208 | // 表单验证 |
| 264 | form.validate({ | 209 | form.validate({ |
| 265 | 210 | ||
| @@ -270,80 +215,52 @@ $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fu | @@ -270,80 +215,52 @@ $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fu | ||
| 270 | focusInvalid : false, | 215 | focusInvalid : false, |
| 271 | 216 | ||
| 272 | rules : { | 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 | invalidHandler : function(event, validator) { | 227 | invalidHandler : function(event, validator) { |
| 285 | - | ||
| 286 | error.show(); | 228 | error.show(); |
| 287 | - | ||
| 288 | App.scrollTo(error, -200); | 229 | App.scrollTo(error, -200); |
| 289 | - | ||
| 290 | }, | 230 | }, |
| 291 | - | ||
| 292 | highlight : function(element) { | 231 | highlight : function(element) { |
| 293 | - | ||
| 294 | $(element).closest('.form-group').addClass('has-error'); | 232 | $(element).closest('.form-group').addClass('has-error'); |
| 295 | - | ||
| 296 | }, | 233 | }, |
| 297 | - | ||
| 298 | unhighlight : function(element) { | 234 | unhighlight : function(element) { |
| 299 | - | ||
| 300 | $(element).closest('.form-group').removeClass('has-error'); | 235 | $(element).closest('.form-group').removeClass('has-error'); |
| 301 | - | ||
| 302 | }, | 236 | }, |
| 303 | - | ||
| 304 | success : function(label) { | 237 | success : function(label) { |
| 305 | - | ||
| 306 | label.closest('.form-group').removeClass('has-error'); | 238 | label.closest('.form-group').removeClass('has-error'); |
| 307 | - | ||
| 308 | }, | 239 | }, |
| 309 | - | ||
| 310 | submitHandler : function(f) { | 240 | submitHandler : function(f) { |
| 311 | - | ||
| 312 | var params = form.serializeJSON(); | 241 | var params = form.serializeJSON(); |
| 313 | - | ||
| 314 | params.createBy = CarParkObj.carParkCreateBy; | 242 | params.createBy = CarParkObj.carParkCreateBy; |
| 315 | - | ||
| 316 | // 定义日期格式 | 243 | // 定义日期格式 |
| 317 | var fs = 'YYYY-MM-DD HH:mm:ss' | 244 | var fs = 'YYYY-MM-DD HH:mm:ss' |
| 318 | - | ||
| 319 | // 设置日期 | 245 | // 设置日期 |
| 320 | params.createDate = moment(CarParkObj.carParkCreateDate).format(fs); | 246 | params.createDate = moment(CarParkObj.carParkCreateDate).format(fs); |
| 321 | - | ||
| 322 | error.hide(); | 247 | error.hide(); |
| 323 | - | 248 | + if(params.shapesType=='多边形') |
| 249 | + params.shapesType = 'd'; | ||
| 250 | + else if(params.shapesType=='圆形') | ||
| 251 | + params.shapesType=='r'; | ||
| 324 | ajaxd.carParkUpdate(params,function(resuntDate) { | 252 | ajaxd.carParkUpdate(params,function(resuntDate) { |
| 325 | - | ||
| 326 | if(resuntDate.status=='SUCCESS') { | 253 | if(resuntDate.status=='SUCCESS') { |
| 327 | - | ||
| 328 | // 弹出添加成功提示消息 | 254 | // 弹出添加成功提示消息 |
| 329 | layer.msg('修改成功...'); | 255 | layer.msg('修改成功...'); |
| 330 | - | ||
| 331 | - | ||
| 332 | }else { | 256 | }else { |
| 333 | - | ||
| 334 | // 弹出添加失败提示消息 | 257 | // 弹出添加失败提示消息 |
| 335 | layer.msg('修改失败...'); | 258 | layer.msg('修改失败...'); |
| 336 | - | ||
| 337 | } | 259 | } |
| 338 | - | ||
| 339 | clearSechear(); | 260 | clearSechear(); |
| 340 | - | ||
| 341 | $('#editPoitsions_carpark_mobal').modal('hide'); | 261 | $('#editPoitsions_carpark_mobal').modal('hide'); |
| 342 | - | ||
| 343 | }) | 262 | }) |
| 344 | - | ||
| 345 | } | 263 | } |
| 346 | }); | 264 | }); |
| 347 | - | ||
| 348 | }); | 265 | }); |
| 349 | </script> | 266 | </script> |
| 350 | \ No newline at end of file | 267 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/edit_select.html
| @@ -3,36 +3,33 @@ | @@ -3,36 +3,33 @@ | ||
| 3 | 3 | ||
| 4 | <div class="modal-dialog"> | 4 | <div class="modal-dialog"> |
| 5 | 5 | ||
| 6 | - <div class="modal-content"> | 6 | + <div class="modal-content" style="width:700px"> |
| 7 | 7 | ||
| 8 | <div class="modal-header"> | 8 | <div class="modal-header"> |
| 9 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | 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 | </div> | 13 | </div> |
| 12 | 14 | ||
| 13 | <div class="modal-body"> | 15 | <div class="modal-body"> |
| 14 | - | ||
| 15 | <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> | 16 | <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> |
| 16 | - | ||
| 17 | <div class="alert alert-danger display-hide" id="editSelectrequired"> | 17 | <div class="alert alert-danger display-hide" id="editSelectrequired"> |
| 18 | <button class="close" data-close="alert"></button> | 18 | <button class="close" data-close="alert"></button> |
| 19 | - 站点名称为必填项 | 19 | + 停车场名称为必填项 |
| 20 | </div> | 20 | </div> |
| 21 | - | ||
| 22 | <div class="alert alert-danger display-hide" id="serchrname"> | 21 | <div class="alert alert-danger display-hide" id="serchrname"> |
| 23 | <button class="close" data-close="alert"></button> | 22 | <button class="close" data-close="alert"></button> |
| 24 | 系统无法生成,请选择其他方式新增 | 23 | 系统无法生成,请选择其他方式新增 |
| 25 | </div> | 24 | </div> |
| 26 | - | ||
| 27 | <div class="form-group" id="formRequ"> | 25 | <div class="form-group" id="formRequ"> |
| 28 | <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label> | 26 | <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label> |
| 29 | <div class="col-md-9" id="errorInfo"> | 27 | <div class="col-md-9" id="errorInfo"> |
| 30 | <input type="text" class="form-control input-medium" id="carParkNameboxInput" name="carParkNamebox"> | 28 | <input type="text" class="form-control input-medium" id="carParkNameboxInput" name="carParkNamebox"> |
| 31 | </div> | 29 | </div> |
| 32 | </div> | 30 | </div> |
| 33 | - | ||
| 34 | <div class="form-group"> | 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>修改方式 :</label> |
| 36 | <div class="col-md-9"> | 33 | <div class="col-md-9"> |
| 37 | <div class="icheck-list"> | 34 | <div class="icheck-list"> |
| 38 | <label> | 35 | <label> |
| @@ -44,13 +41,6 @@ | @@ -44,13 +41,6 @@ | ||
| 44 | </div> | 41 | </div> |
| 45 | </div> | 42 | </div> |
| 46 | </div> | 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 | </form> | 44 | </form> |
| 55 | </div> | 45 | </div> |
| 56 | <div class="modal-footer"> | 46 | <div class="modal-footer"> |
| @@ -61,118 +51,108 @@ | @@ -61,118 +51,108 @@ | ||
| 61 | </div> | 51 | </div> |
| 62 | </div> | 52 | </div> |
| 63 | <script type="text/javascript"> | 53 | <script type="text/javascript"> |
| 64 | - | ||
| 65 | $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,fun,carParkE,ajaxd){ | 54 | $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,fun,carParkE,ajaxd){ |
| 66 | - | ||
| 67 | // 显示选择修改方式弹出层 | 55 | // 显示选择修改方式弹出层 |
| 68 | $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 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 | var carParkObj = carParkE.getEitdCarPark(); | 97 | var carParkObj = carParkE.getEitdCarPark(); |
| 71 | - | ||
| 72 | // 获取停车场名称元素并赋值 | 98 | // 获取停车场名称元素并赋值 |
| 73 | $('#carParkNameboxInput').val(carParkObj.carParkName); | 99 | $('#carParkNameboxInput').val(carParkObj.carParkName); |
| 74 | - | ||
| 75 | // 定义停车场图形类型 | 100 | // 定义停车场图形类型 |
| 76 | var stationShapesTypeV = carParkObj.carParkShapesType; | 101 | var stationShapesTypeV = carParkObj.carParkShapesType; |
| 77 | - | ||
| 78 | // 获取表单元素 | 102 | // 获取表单元素 |
| 79 | var form = $('#edit_select'); | 103 | var form = $('#edit_select'); |
| 80 | - | ||
| 81 | // 获取错误提示元素 | 104 | // 获取错误提示元素 |
| 82 | var editSelectrequired = $('#editSelectrequired', form); | 105 | var editSelectrequired = $('#editSelectrequired', form); |
| 83 | - | ||
| 84 | // 下一步操作事件 | 106 | // 下一步操作事件 |
| 85 | $('#editselectStationNextButton').on('click', function() { | 107 | $('#editselectStationNextButton').on('click', function() { |
| 86 | - | ||
| 87 | // 表单提交 | 108 | // 表单提交 |
| 88 | form.submit(); | 109 | form.submit(); |
| 89 | - | ||
| 90 | }); | 110 | }); |
| 91 | - | ||
| 92 | //form 表单验证 | 111 | //form 表单验证 |
| 93 | form.validate({ | 112 | form.validate({ |
| 94 | - | ||
| 95 | errorElement : 'span', | 113 | errorElement : 'span', |
| 96 | - | ||
| 97 | errorClass : 'help-block help-block-error', | 114 | errorClass : 'help-block help-block-error', |
| 98 | - | ||
| 99 | focusInvalid : false, | 115 | focusInvalid : false, |
| 100 | - | ||
| 101 | rules : { | 116 | rules : { |
| 102 | - | ||
| 103 | - 'carParkNamebox' : { | ||
| 104 | - | ||
| 105 | - required : true, | ||
| 106 | - | ||
| 107 | - } | ||
| 108 | - | 117 | + 'carParkNamebox' : {required : true,} |
| 109 | }, | 118 | }, |
| 110 | - | ||
| 111 | invalidHandler : function(event, validator) { | 119 | invalidHandler : function(event, validator) { |
| 112 | - | ||
| 113 | editSelectrequired.show(); | 120 | editSelectrequired.show(); |
| 114 | - | ||
| 115 | App.scrollTo(requiredname, -200); | 121 | App.scrollTo(requiredname, -200); |
| 116 | - | ||
| 117 | }, | 122 | }, |
| 118 | 123 | ||
| 119 | highlight : function(element) { | 124 | highlight : function(element) { |
| 120 | - | ||
| 121 | $(element).closest('.form-group').addClass('has-error'); | 125 | $(element).closest('.form-group').addClass('has-error'); |
| 122 | - | ||
| 123 | }, | 126 | }, |
| 124 | - | ||
| 125 | unhighlight : function(element) { | 127 | unhighlight : function(element) { |
| 126 | - | ||
| 127 | $(element).closest('.form-group').removeClass('has-error'); | 128 | $(element).closest('.form-group').removeClass('has-error'); |
| 128 | - | ||
| 129 | }, | 129 | }, |
| 130 | - | ||
| 131 | success : function(label) { | 130 | success : function(label) { |
| 132 | - | ||
| 133 | label.closest('.form-group').removeClass('has-error'); | 131 | label.closest('.form-group').removeClass('has-error'); |
| 134 | - | ||
| 135 | }, | 132 | }, |
| 136 | - | ||
| 137 | submitHandler : function(f) { | 133 | submitHandler : function(f) { |
| 138 | - | ||
| 139 | // 隐藏弹出层 | 134 | // 隐藏弹出层 |
| 140 | $('#editPositions_select_mobal').modal('hide'); | 135 | $('#editPositions_select_mobal').modal('hide'); |
| 141 | - | ||
| 142 | $('#eidt').attr("disabled",true); | 136 | $('#eidt').attr("disabled",true); |
| 143 | - | ||
| 144 | $('#eidt').addClass('btn disabled'); | 137 | $('#eidt').addClass('btn disabled'); |
| 145 | - | ||
| 146 | // 表单序列 | 138 | // 表单序列 |
| 147 | var params = form.serializeJSON(); | 139 | var params = form.serializeJSON(); |
| 148 | - | ||
| 149 | // 停车场名称 | 140 | // 停车场名称 |
| 150 | var editStationName = params.carParkNamebox; | 141 | var editStationName = params.carParkNamebox; |
| 151 | - | ||
| 152 | var eidtselect_ = params.editselect; | 142 | var eidtselect_ = params.editselect; |
| 153 | - | ||
| 154 | // 设置停车场名称 | 143 | // 设置停车场名称 |
| 155 | carParkE.setEitdCarParkName(editStationName); | 144 | carParkE.setEitdCarParkName(editStationName); |
| 156 | - | ||
| 157 | if(eidtselect_==0){ | 145 | if(eidtselect_==0){ |
| 158 | - | ||
| 159 | map.localSearchFromAdreesToPoint(editStationName); | 146 | map.localSearchFromAdreesToPoint(editStationName); |
| 160 | - | ||
| 161 | map.openDrawingManager(); | 147 | map.openDrawingManager(); |
| 162 | - | ||
| 163 | }else if(eidtselect_==1){ | 148 | }else if(eidtselect_==1){ |
| 164 | - | ||
| 165 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | 149 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| 166 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | 150 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', |
| 167 | shift: 0,time: 10000}); | 151 | shift: 0,time: 10000}); |
| 168 | - | ||
| 169 | // 编辑图形 | 152 | // 编辑图形 |
| 170 | map.editShapes(stationShapesTypeV,mindex); | 153 | map.editShapes(stationShapesTypeV,mindex); |
| 171 | - | ||
| 172 | } | 154 | } |
| 173 | - | ||
| 174 | } | 155 | } |
| 175 | }); | 156 | }); |
| 176 | - | ||
| 177 | }); | 157 | }); |
| 178 | </script> | 158 | </script> |
| 179 | \ No newline at end of file | 159 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/add-form-events.js
| 1 | $(function(){ | 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 | $('#oppenDrawingManager').on('click',function() { | 5 | $('#oppenDrawingManager').on('click',function() { |
| 14 | - | ||
| 15 | addCarParkVmapWorlds.drawingManagerOpen(); | 6 | addCarParkVmapWorlds.drawingManagerOpen(); |
| 16 | - | ||
| 17 | }); | 7 | }); |
| 18 | - | ||
| 19 | $('#closeDrawingManager').on('click',function() { | 8 | $('#closeDrawingManager').on('click',function() { |
| 20 | - | ||
| 21 | addCarParkVmapWorlds.drawingManagerClose(); | 9 | addCarParkVmapWorlds.drawingManagerClose(); |
| 22 | - | ||
| 23 | }); | 10 | }); |
| 24 | - | ||
| 25 | }); | 11 | }); |
| 26 | \ No newline at end of file | 12 | \ No newline at end of file |