Commit f66adf3d3ca4b9e4e254db64ff09d9c84e3dc003
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
85 changed files
with
1533 additions
and
4377 deletions
src/main/java/com/bsth/controller/CarParkController.java
| @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; | @@ -15,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 |
src/main/resources/static/pages/base/carpark/js/add-form-reload.js
| @@ -13,93 +13,66 @@ | @@ -13,93 +13,66 @@ | ||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | (function(){ | 15 | (function(){ |
| 16 | - | ||
| 17 | // 关闭左侧栏 | 16 | // 关闭左侧栏 |
| 18 | - if (!$('body').hasClass('page-sidebar-closed')) { | ||
| 19 | - | ||
| 20 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 21 | - | ||
| 22 | - } | ||
| 23 | - | 17 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} |
| 24 | setTimeout(function(){ | 18 | setTimeout(function(){ |
| 25 | - | 19 | + $('.tipso-animation').tipso({ |
| 20 | + speed : 100, | ||
| 21 | + background : '#0ed0e8', | ||
| 22 | + color : '#ffffff', | ||
| 23 | + position :'right', | ||
| 24 | + width : 410, | ||
| 25 | + delay : 400, | ||
| 26 | + animationIn : 'bounceIn', | ||
| 27 | + animationOut : 'bounceOut', | ||
| 28 | + offsetX : 12, | ||
| 29 | + offsetY : -70, | ||
| 30 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据停车场名称自动生成以100米为半径范围的圆.</span></br>'+ | ||
| 31 | + '<span style="display:block; float:left;font-size:x-small;">B)手动绘制:手动在地图上画出停车场范围,然后双击鼠标右键保存.</span>', | ||
| 32 | + | ||
| 33 | + }); | ||
| 34 | + $('.tipso-animation').tipso('show'); | ||
| 35 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 26 | FormWizard.init(); | 36 | FormWizard.init(); |
| 27 | - | ||
| 28 | - mapB = addCarParkVmapWorlds.init(); | ||
| 29 | - | ||
| 30 | PublicFunctions.getCarParkCode(function(d) { | 37 | PublicFunctions.getCarParkCode(function(d) { |
| 31 | - | ||
| 32 | $('#parkCodeInput').val(d.carParkCode); | 38 | $('#parkCodeInput').val(d.carParkCode); |
| 33 | - | ||
| 34 | }); | 39 | }); |
| 35 | - | ||
| 36 | $('#destroySelect').val('0'); | 40 | $('#destroySelect').val('0'); |
| 37 | - | ||
| 38 | PublicFunctions.getBusinessAllInfo(function(array) { | 41 | PublicFunctions.getBusinessAllInfo(function(array) { |
| 39 | - | ||
| 40 | var opGroup = '<option value="">请选择...</option><optgroup label="公司">'; | 42 | var opGroup = '<option value="">请选择...</option><optgroup label="公司">'; |
| 41 | - | ||
| 42 | var len_ = array.length; | 43 | var len_ = array.length; |
| 43 | - | ||
| 44 | if(len_>0) { | 44 | if(len_>0) { |
| 45 | - | ||
| 46 | $.each(array, function(i, g){ | 45 | $.each(array, function(i, g){ |
| 47 | - | ||
| 48 | opGroup += '<option value="'+g.businessCode+'">'+g.businessName+'</option>'; | 46 | opGroup += '<option value="'+g.businessCode+'">'+g.businessName+'</option>'; |
| 49 | - | ||
| 50 | }); | 47 | }); |
| 51 | - | ||
| 52 | } | 48 | } |
| 53 | - | ||
| 54 | opGroup += '</optgroup>'; | 49 | opGroup += '</optgroup>'; |
| 55 | - | ||
| 56 | $('#companySelect').html(opGroup).select2(); | 50 | $('#companySelect').html(opGroup).select2(); |
| 57 | - | ||
| 58 | }); | 51 | }); |
| 59 | - | ||
| 60 | - /*var htm = '<option value="">请选择...</option><optgroup label="公司">'; | ||
| 61 | - | 52 | + var htm = '<option value="">请选择...</option><optgroup label="分公司">'; |
| 62 | $('#brancheCompanySelect').html(htm).select2(); | 53 | $('#brancheCompanySelect').html(htm).select2(); |
| 63 | - | ||
| 64 | $('#companySelect').on("change", function (e) { | 54 | $('#companySelect').on("change", function (e) { |
| 65 | - | ||
| 66 | // 获取公司下拉框选择值 | 55 | // 获取公司下拉框选择值 |
| 67 | var businessCode = $('#companySelect').val(); | 56 | var businessCode = $('#companySelect').val(); |
| 68 | - | ||
| 69 | // 分公司下拉框options属性值 | 57 | // 分公司下拉框options属性值 |
| 70 | var options = '<option value="">请选择...</option><optgroup label="分公司">'; | 58 | var options = '<option value="">请选择...</option><optgroup label="分公司">'; |
| 71 | - | ||
| 72 | // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | 59 | // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 |
| 73 | if(businessCode == null || businessCode ==''){ | 60 | if(businessCode == null || businessCode ==''){ |
| 74 | - | ||
| 75 | options += '</optgroup>'; | 61 | options += '</optgroup>'; |
| 76 | - | ||
| 77 | // 填充分公司下拉框options | 62 | // 填充分公司下拉框options |
| 78 | $('#brancheCompanySelect').html(options).select2(); | 63 | $('#brancheCompanySelect').html(options).select2(); |
| 79 | - | ||
| 80 | } else { | 64 | } else { |
| 81 | - | ||
| 82 | // 查询出所属公司下的分公司名称和相应分公司代码 | 65 | // 查询出所属公司下的分公司名称和相应分公司代码 |
| 83 | $get('/business/all', {upCode_eq: businessCode}, function(array){ | 66 | $get('/business/all', {upCode_eq: businessCode}, function(array){ |
| 84 | - | ||
| 85 | // 遍历array | 67 | // 遍历array |
| 86 | $.each(array, function(i,d){ | 68 | $.each(array, function(i,d){ |
| 87 | - | ||
| 88 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | 69 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 89 | - | ||
| 90 | options += '</optgroup>'; | 70 | options += '</optgroup>'; |
| 91 | - | ||
| 92 | }); | 71 | }); |
| 93 | - | ||
| 94 | // 填充分公司下拉框options | 72 | // 填充分公司下拉框options |
| 95 | $('#brancheCompanySelect').html(options).select2(); | 73 | $('#brancheCompanySelect').html(options).select2(); |
| 96 | - | ||
| 97 | }); | 74 | }); |
| 98 | } | 75 | } |
| 99 | - | ||
| 100 | }); | 76 | }); |
| 101 | - */ | ||
| 102 | - | ||
| 103 | - }, 500); | ||
| 104 | - | 77 | + }, 300); |
| 105 | })(); | 78 | })(); |
| 106 | \ No newline at end of file | 79 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
| 1 | - | ||
| 2 | /** | 1 | /** |
| 3 | * 表单的导航向导、验证、提交 | 2 | * 表单的导航向导、验证、提交 |
| 4 | * | 3 | * |
| 5 | */ | 4 | */ |
| 6 | - | ||
| 7 | var FormWizard = function() { | 5 | var FormWizard = function() { |
| 8 | - | ||
| 9 | return { | 6 | return { |
| 10 | - | ||
| 11 | // 启动初始化向导导航 | 7 | // 启动初始化向导导航 |
| 12 | init : function() { | 8 | init : function() { |
| 13 | - | ||
| 14 | - if(!jQuery().bootstrapWizard) { | ||
| 15 | - | ||
| 16 | - return; | ||
| 17 | - | ||
| 18 | - } | ||
| 19 | - | 9 | + if(!jQuery().bootstrapWizard) {return;} |
| 20 | // 定义表单 | 10 | // 定义表单 |
| 21 | var form = $('#submit_carpark_form'); | 11 | var form = $('#submit_carpark_form'); |
| 22 | - | ||
| 23 | // 定义表单异常 | 12 | // 定义表单异常 |
| 24 | var error = $('.alert-danger',form); | 13 | var error = $('.alert-danger',form); |
| 25 | - | ||
| 26 | // 定义表单成功 | 14 | // 定义表单成功 |
| 27 | var success = $('.alert-success',form); | 15 | var success = $('.alert-success',form); |
| 28 | - | ||
| 29 | // 表单验证 | 16 | // 表单验证 |
| 30 | form.validate({ | 17 | form.validate({ |
| 31 | - | ||
| 32 | // 错误提示元素span对象 | 18 | // 错误提示元素span对象 |
| 33 | errorElement : 'span', | 19 | errorElement : 'span', |
| 34 | - | ||
| 35 | // 错误提示元素class名称 | 20 | // 错误提示元素class名称 |
| 36 | errorClass : 'help-block help-block-error', | 21 | errorClass : 'help-block help-block-error', |
| 37 | - | ||
| 38 | // 验证错误获取焦点 | 22 | // 验证错误获取焦点 |
| 39 | focusInvalid : true, | 23 | focusInvalid : true, |
| 40 | - | ||
| 41 | // 需要验证的表单元素 | 24 | // 需要验证的表单元素 |
| 42 | rules : { | 25 | rules : { |
| 43 | - | ||
| 44 | - // 停车场名称 | ||
| 45 | - 'parkNamebooxt' : { | ||
| 46 | - | ||
| 47 | - // 必填项 | ||
| 48 | - required : true, | ||
| 49 | - | ||
| 50 | - }, | ||
| 51 | - | ||
| 52 | - // 停车场名称 | ||
| 53 | - 'parkName' : { | ||
| 54 | - | ||
| 55 | - // 必填项 | ||
| 56 | - required : true, | ||
| 57 | - | ||
| 58 | - }, | ||
| 59 | - | ||
| 60 | - // 停车场编码 | ||
| 61 | - 'parkCode' : { | ||
| 62 | - | ||
| 63 | - // 必填项 | ||
| 64 | - required : true, | ||
| 65 | - }, | ||
| 66 | - | ||
| 67 | - // 中心点坐标 | ||
| 68 | - 'bCenterPoint' : { | ||
| 69 | - | ||
| 70 | - // 必填项 | ||
| 71 | - required : true, | ||
| 72 | - | ||
| 73 | - }, | ||
| 74 | - | ||
| 75 | - // 图形类型 | ||
| 76 | - 'shapesType' : { | ||
| 77 | - | ||
| 78 | - // 必填项 | ||
| 79 | - required : true, | ||
| 80 | - }, | ||
| 81 | - | ||
| 82 | - // 所属分公司 | ||
| 83 | - /*'brancheCompany' : { | ||
| 84 | - | ||
| 85 | - // 必填项 | ||
| 86 | - required : true, | ||
| 87 | - }*/ | ||
| 88 | - | ||
| 89 | - | 26 | + 'parkNamebooxt' : {required : true,},// 停车场名称 必填项 |
| 27 | + 'parkName' : {required : true,},// 停车场名称 必填项 | ||
| 28 | + 'parkCode' : {required : true,alnum:true, remote : { | ||
| 29 | + type : "get",// 异步发送请求到服务器,验证parkCode | ||
| 30 | + url : "/carpark/isHaveParkCode",//需要服务器controllor 中提供停车场编码检查的方法 | ||
| 31 | + cache:false, | ||
| 32 | + async:false, | ||
| 33 | + data : {'parkCode' : function() { return $("#parkCodeInput").val(); }}, | ||
| 34 | + }},// 停车场编码 必填项 | ||
| 35 | + 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项 | ||
| 36 | + 'shapesType' : {required : true,},// 几何图形类型 必填项 | ||
| 37 | + 'radius' : {required : true,digits:true},// 圆形半径 必填项 | ||
| 38 | + 'destroy' : {required : true,},// 是否撤销 必填项 | ||
| 39 | + 'area' : {number:true,},// 面积 数字 | ||
| 40 | + 'descriptions' : {maxlength: 200,},// 描述/说明 最大长度200 | ||
| 41 | + }, | ||
| 42 | + messages:{ | ||
| 43 | + 'parkCode':{remote:'停车场编码系统已存在,请您重新输入!',}, | ||
| 90 | }, | 44 | }, |
| 91 | - | ||
| 92 | /** | 45 | /** |
| 93 | * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | 46 | * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 |
| 94 | * | 47 | * |
| 95 | * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) | 48 | * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) |
| 96 | */ | 49 | */ |
| 97 | invalidHandler : function(event, validator) { | 50 | invalidHandler : function(event, validator) { |
| 98 | - | ||
| 99 | // 显示表单未通过提示信息 | 51 | // 显示表单未通过提示信息 |
| 100 | error.show(); | 52 | error.show(); |
| 101 | - | ||
| 102 | // 把提示信息放到指定的位置。 | 53 | // 把提示信息放到指定的位置。 |
| 103 | App.scrollTo(error, -200); | 54 | App.scrollTo(error, -200); |
| 104 | }, | 55 | }, |
| 105 | - | ||
| 106 | /** | 56 | /** |
| 107 | * 类型:Callback。 | 57 | * 类型:Callback。 |
| 108 | * | 58 | * |
| 109 | * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | 59 | * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 |
| 110 | */ | 60 | */ |
| 111 | highlight : function(element) { | 61 | highlight : function(element) { |
| 112 | - | ||
| 113 | // 添加errorClass("has-error")到表单元素 | 62 | // 添加errorClass("has-error")到表单元素 |
| 114 | $(element).closest('.form-group').addClass('has-error'); | 63 | $(element).closest('.form-group').addClass('has-error'); |
| 115 | }, | 64 | }, |
| 116 | - | ||
| 117 | /** | 65 | /** |
| 118 | * 类型:Callback。 | 66 | * 类型:Callback。 |
| 119 | * | 67 | * |
| 120 | * 默认:移除errorClass("has-error")。与highlight操作相反 | 68 | * 默认:移除errorClass("has-error")。与highlight操作相反 |
| 121 | */ | 69 | */ |
| 122 | unhighlight : function(element) { | 70 | unhighlight : function(element) { |
| 123 | - | ||
| 124 | // 移除errorClass("has-error") | 71 | // 移除errorClass("has-error") |
| 125 | $(element).closest('.form-group').removeClass('has-error'); | 72 | $(element).closest('.form-group').removeClass('has-error'); |
| 126 | }, | 73 | }, |
| 127 | - | ||
| 128 | /** | 74 | /** |
| 129 | * 类型:String,Callback。 | 75 | * 类型:String,Callback。 |
| 130 | * | 76 | * |
| @@ -135,176 +81,146 @@ var FormWizard = function() { | @@ -135,176 +81,146 @@ var FormWizard = function() { | ||
| 135 | * 如果是一个回调函数,则将标签作为其唯一的参数。 | 81 | * 如果是一个回调函数,则将标签作为其唯一的参数。 |
| 136 | */ | 82 | */ |
| 137 | success : function(label) { | 83 | success : function(label) { |
| 138 | - | ||
| 139 | // 当验证通过时,移除errorClass("has-error") | 84 | // 当验证通过时,移除errorClass("has-error") |
| 140 | label.closest('.form-group').removeClass('has-error'); | 85 | label.closest('.form-group').removeClass('has-error'); |
| 141 | }, | 86 | }, |
| 142 | - | ||
| 143 | /** | 87 | /** |
| 144 | * 类型:Callback。 | 88 | * 类型:Callback。 |
| 145 | * | 89 | * |
| 146 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form | 90 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form |
| 147 | */ | 91 | */ |
| 148 | submitHandler : function(f) { | 92 | submitHandler : function(f) { |
| 149 | - | ||
| 150 | // 表单序列化 | 93 | // 表单序列化 |
| 151 | var params = form.serializeJSON(); | 94 | var params = form.serializeJSON(); |
| 152 | - | 95 | + if(params.shapesType=='圆形') |
| 96 | + params.shapesType='r'; | ||
| 97 | + else if(params.shapesType=='多边形') | ||
| 98 | + params.shapesType='d'; | ||
| 153 | //保存站点 | 99 | //保存站点 |
| 154 | PublicFunctions.carParkSave(params,function(data) { | 100 | PublicFunctions.carParkSave(params,function(data) { |
| 155 | - | ||
| 156 | if(data.status=='SUCCESS') { | 101 | if(data.status=='SUCCESS') { |
| 157 | - | ||
| 158 | // 弹出添加成功提示消息 | 102 | // 弹出添加成功提示消息 |
| 159 | layer.msg('添加成功...'); | 103 | layer.msg('添加成功...'); |
| 160 | - | ||
| 161 | - | ||
| 162 | }else { | 104 | }else { |
| 163 | - | ||
| 164 | // 弹出添加失败提示消息 | 105 | // 弹出添加失败提示消息 |
| 165 | layer.msg('添加失败...'); | 106 | layer.msg('添加失败...'); |
| 166 | - | ||
| 167 | } | 107 | } |
| 168 | - | ||
| 169 | // 返回list.html页面 | 108 | // 返回list.html页面 |
| 170 | loadPage('/pages/base/carpark/list.html'); | 109 | loadPage('/pages/base/carpark/list.html'); |
| 171 | - | ||
| 172 | }); | 110 | }); |
| 173 | - | ||
| 174 | } | 111 | } |
| 175 | }); | 112 | }); |
| 113 | + $.validator.addMethod("alnum", function(value, element) { | ||
| 114 | + return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value); | ||
| 115 | + }, "停车场编码只能包括英文字母和数字,请您重新输入!"); | ||
| 116 | + | ||
| 117 | + /*$.validator.addMethod("isHave", function(value, element) { | ||
| 118 | + PublicFunctions.isHaveParkCode({'parkCode':value},function(d) { | ||
| 119 | + debugger; | ||
| 120 | + console.log(d); | ||
| 121 | + if(d.length>0) | ||
| 122 | + return false; | ||
| 123 | + else | ||
| 124 | + return true; | ||
| 125 | + }); | ||
| 126 | + }, "停车场编码系统已存在,请您重新输入!");*/ | ||
| 176 | 127 | ||
| 177 | // 确认提交信息 | 128 | // 确认提交信息 |
| 178 | var displayConfirm = function() { | 129 | var displayConfirm = function() { |
| 179 | - | ||
| 180 | // 遍历表单元素下的tab4的class名称为form-control-static | 130 | // 遍历表单元素下的tab4的class名称为form-control-static |
| 181 | $('#tab4 .form-control-static', form).each(function(){ | 131 | $('#tab4 .form-control-static', form).each(function(){ |
| 182 | - | ||
| 183 | // 定义input | 132 | // 定义input |
| 184 | var input = $('[name="'+$(this).attr("data-display")+'"]', form); | 133 | var input = $('[name="'+$(this).attr("data-display")+'"]', form); |
| 185 | - | ||
| 186 | if (input.is(":radio")) { | 134 | if (input.is(":radio")) { |
| 187 | - | ||
| 188 | input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); | 135 | input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); |
| 189 | - | ||
| 190 | } | 136 | } |
| 191 | if (input.is(":text") || input.is("textarea")) { | 137 | if (input.is(":text") || input.is("textarea")) { |
| 192 | - | ||
| 193 | $(this).html(input.val()); | 138 | $(this).html(input.val()); |
| 194 | - | ||
| 195 | } else if (input.is("select")) { | 139 | } else if (input.is("select")) { |
| 196 | - | ||
| 197 | $(this).html(input.find('option:selected').text()); | 140 | $(this).html(input.find('option:selected').text()); |
| 198 | - | ||
| 199 | } else if (input.is(":radio") && input.is(":checked")) { | 141 | } else if (input.is(":radio") && input.is(":checked")) { |
| 200 | - | ||
| 201 | $(this).html(input.attr("data-title")); | 142 | $(this).html(input.attr("data-title")); |
| 202 | - | ||
| 203 | } else if ($(this).attr("data-display") == 'payment[]') { | 143 | } else if ($(this).attr("data-display") == 'payment[]') { |
| 204 | - | ||
| 205 | var payment = []; | 144 | var payment = []; |
| 206 | - | ||
| 207 | $('[name="payment[]"]:checked', form).each(function(){ | 145 | $('[name="payment[]"]:checked', form).each(function(){ |
| 208 | - | ||
| 209 | payment.push($(this).attr('data-title')); | 146 | payment.push($(this).attr('data-title')); |
| 210 | - | ||
| 211 | }); | 147 | }); |
| 212 | - | ||
| 213 | $(this).html(payment.join("<br>")); | 148 | $(this).html(payment.join("<br>")); |
| 214 | } | 149 | } |
| 215 | }); | 150 | }); |
| 216 | } | 151 | } |
| 217 | - | ||
| 218 | /** 按钮点击时触发 */ | 152 | /** 按钮点击时触发 */ |
| 219 | var handleTitle = function(tab, navigation, index) { | 153 | var handleTitle = function(tab, navigation, index) { |
| 220 | - | ||
| 221 | // 定义导航条标签个数 | 154 | // 定义导航条标签个数 |
| 222 | var total = navigation.find('li').length; | 155 | var total = navigation.find('li').length; |
| 223 | - | ||
| 224 | // 当前标签页 | 156 | // 当前标签页 |
| 225 | var current = index + 1; | 157 | var current = index + 1; |
| 226 | - | ||
| 227 | // 设置向导标题 | 158 | // 设置向导标题 |
| 228 | $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); | 159 | $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); |
| 229 | - | ||
| 230 | // 删除"done"样式 | 160 | // 删除"done"样式 |
| 231 | jQuery('li', $('#form-wizard-info')).removeClass("done"); | 161 | jQuery('li', $('#form-wizard-info')).removeClass("done"); |
| 232 | - | ||
| 233 | // 获取导航标签元素集合 | 162 | // 获取导航标签元素集合 |
| 234 | var li_list = navigation.find('li'); | 163 | var li_list = navigation.find('li'); |
| 235 | - | ||
| 236 | // 遍历 | 164 | // 遍历 |
| 237 | for (var i = 0; i < index; i++) { | 165 | for (var i = 0; i < index; i++) { |
| 238 | - | ||
| 239 | // 追加done样式 | 166 | // 追加done样式 |
| 240 | jQuery(li_list[i]).addClass("done"); | 167 | jQuery(li_list[i]).addClass("done"); |
| 241 | - | ||
| 242 | } | 168 | } |
| 243 | - | ||
| 244 | - | ||
| 245 | /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ | 169 | /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ |
| 246 | if (current == 1) { | 170 | if (current == 1) { |
| 247 | - | ||
| 248 | // 隐藏返回按钮 | 171 | // 隐藏返回按钮 |
| 249 | $('#submit_carpark_form').find('.button-previous').hide(); | 172 | $('#submit_carpark_form').find('.button-previous').hide(); |
| 250 | - | ||
| 251 | } else { | 173 | } else { |
| 252 | - | ||
| 253 | // 显示返回按钮 | 174 | // 显示返回按钮 |
| 254 | $('#submit_carpark_form').find('.button-previous').show(); | 175 | $('#submit_carpark_form').find('.button-previous').show(); |
| 255 | - | ||
| 256 | } | 176 | } |
| 257 | - | ||
| 258 | if (current == 2) { | 177 | if (current == 2) { |
| 259 | - | ||
| 260 | - // 获取新增方式值 | ||
| 261 | - var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val(); | ||
| 262 | - | ||
| 263 | - // 获取停车场名称值 | ||
| 264 | - var stationNameV = $('#parkNamebooxtInput').val(); | ||
| 265 | - | ||
| 266 | - // 设置停车场名称 | ||
| 267 | - $('#parkNameInput').val(stationNameV); | ||
| 268 | - | ||
| 269 | - if(baseResValue == 0) { | ||
| 270 | - | ||
| 271 | - $('.leftUtils').hide(); | ||
| 272 | - | ||
| 273 | - addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) { | ||
| 274 | - | ||
| 275 | - if(p) { | ||
| 276 | - | ||
| 277 | - addCarParkVmapWorlds.pointsCircle(p); | ||
| 278 | - | ||
| 279 | - } | ||
| 280 | - | ||
| 281 | - }); | ||
| 282 | - | ||
| 283 | - }else if(baseResValue ==1) { | ||
| 284 | - | ||
| 285 | - addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {}); | ||
| 286 | - | ||
| 287 | - $('.leftUtils').show(); | ||
| 288 | - | ||
| 289 | - addCarParkVmapWorlds.drawingManagerOpen(); | ||
| 290 | - | ||
| 291 | - } | 178 | + layer.closeAll(); |
| 179 | + var container = $("#addCarParkbmap_basic"); | ||
| 180 | + container.children().remove(); | ||
| 181 | + container.show(); | ||
| 182 | + setTimeout(function(){ | ||
| 183 | + addCarParkVmapWorlds.init(); | ||
| 184 | + // 获取新增方式值 | ||
| 185 | + var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val(); | ||
| 186 | + // 获取停车场名称值 | ||
| 187 | + var stationNameV = $('#parkNamebooxtInput').val(); | ||
| 188 | + // 设置停车场名称 | ||
| 189 | + $('#parkNameInput').val(stationNameV); | ||
| 190 | + if(baseResValue == 0) { | ||
| 191 | + $('.leftUtils').hide(); | ||
| 192 | + addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) { | ||
| 193 | + if(p) { | ||
| 194 | + addCarParkVmapWorlds.pointsCircle(p); | ||
| 195 | + } | ||
| 196 | + }); | ||
| 197 | + }else if(baseResValue ==1) { | ||
| 198 | + addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {}); | ||
| 199 | + $('.leftUtils').show(); | ||
| 200 | + addCarParkVmapWorlds.drawingManagerOpen(); | ||
| 201 | + } | ||
| 202 | + $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | ||
| 203 | + },300) | ||
| 204 | + }else if(current==3) { | ||
| 205 | + setTimeout(function(){ | ||
| 206 | + $('html,body').animate({scrollTop: ($('#tab3').offset().top-70) + "px"}); | ||
| 207 | + layer.tips('停车场编码一旦确认提交就不能够轻易的去修改了哦:-O', '#parkCodeInput', {tips: [2, '#0ed0e8'],time: 4500,area: ['340px', '32px'],}); | ||
| 208 | + },300); | ||
| 209 | + }else if(current==4) { | ||
| 210 | + layer.closeAll(); | ||
| 211 | + setTimeout(function(){ | ||
| 212 | + $('html,body').animate({scrollTop: ($('#tab4').offset().top+40) + "px"}); | ||
| 213 | + },300); | ||
| 292 | } | 214 | } |
| 293 | - | ||
| 294 | /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ | 215 | /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ |
| 295 | if (current >= total) { | 216 | if (current >= total) { |
| 296 | - | ||
| 297 | // 隐藏下一步按钮 | 217 | // 隐藏下一步按钮 |
| 298 | $('#submit_carpark_form').find('.button-next').hide(); | 218 | $('#submit_carpark_form').find('.button-next').hide(); |
| 299 | - | ||
| 300 | // 显示提交按钮 | 219 | // 显示提交按钮 |
| 301 | $('#submit_carpark_form').find('.button-submit').show(); | 220 | $('#submit_carpark_form').find('.button-submit').show(); |
| 302 | - | ||
| 303 | // 确认提交信息 | 221 | // 确认提交信息 |
| 304 | displayConfirm(); | 222 | displayConfirm(); |
| 305 | - | ||
| 306 | } else { | 223 | } else { |
| 307 | - | ||
| 308 | // 显示下一步按钮 | 224 | // 显示下一步按钮 |
| 309 | $('#submit_carpark_form').find('.button-next').show(); | 225 | $('#submit_carpark_form').find('.button-next').show(); |
| 310 | 226 | ||
| @@ -312,106 +228,59 @@ var FormWizard = function() { | @@ -312,106 +228,59 @@ var FormWizard = function() { | ||
| 312 | $('#submit_carpark_form').find('.button-submit').hide(); | 228 | $('#submit_carpark_form').find('.button-submit').hide(); |
| 313 | 229 | ||
| 314 | } | 230 | } |
| 315 | - | ||
| 316 | // 移动到指定位置 | 231 | // 移动到指定位置 |
| 317 | App.scrollTo($('.page-title')); | 232 | App.scrollTo($('.page-title')); |
| 318 | - | ||
| 319 | } | 233 | } |
| 320 | - | ||
| 321 | // 表单导航向导插件 | 234 | // 表单导航向导插件 |
| 322 | $('#submit_carpark_form').bootstrapWizard({ | 235 | $('#submit_carpark_form').bootstrapWizard({ |
| 323 | - | ||
| 324 | // 下一步元素选择器 | 236 | // 下一步元素选择器 |
| 325 | 'nextSelector': '.button-next', | 237 | 'nextSelector': '.button-next', |
| 326 | - | ||
| 327 | // 返回元素选择器 | 238 | // 返回元素选择器 |
| 328 | 'previousSelector': '.button-previous', | 239 | 'previousSelector': '.button-previous', |
| 329 | - | ||
| 330 | /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ | 240 | /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ |
| 331 | onTabClick: function (tab, navigation, index, clickedIndex) { | 241 | onTabClick: function (tab, navigation, index, clickedIndex) { |
| 332 | - | ||
| 333 | return false; | 242 | return false; |
| 334 | - | ||
| 335 | success.hide(); | 243 | success.hide(); |
| 336 | - | ||
| 337 | error.hide(); | 244 | error.hide(); |
| 338 | - | ||
| 339 | if (form.valid() == false) { | 245 | if (form.valid() == false) { |
| 340 | - | ||
| 341 | return false; | 246 | return false; |
| 342 | - | ||
| 343 | } | 247 | } |
| 344 | - | ||
| 345 | handleTitle(tab, navigation, clickedIndex); | 248 | handleTitle(tab, navigation, clickedIndex); |
| 346 | - | ||
| 347 | }, | 249 | }, |
| 348 | - | ||
| 349 | /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ | 250 | /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ |
| 350 | onNext: function (tab, navigation, index) { | 251 | onNext: function (tab, navigation, index) { |
| 351 | - | ||
| 352 | success.hide(); | 252 | success.hide(); |
| 353 | - | ||
| 354 | error.hide(); | 253 | error.hide(); |
| 355 | - | ||
| 356 | if (form.valid() == false) { | 254 | if (form.valid() == false) { |
| 357 | - | ||
| 358 | return false; | 255 | return false; |
| 359 | - | ||
| 360 | } | 256 | } |
| 361 | - | ||
| 362 | if(index==2) { | 257 | if(index==2) { |
| 363 | - | ||
| 364 | addCarParkVmapWorlds.clearMarkAndOverlays(); | 258 | addCarParkVmapWorlds.clearMarkAndOverlays(); |
| 365 | - | ||
| 366 | addCarParkVmapWorlds.drawingManagerClose(); | 259 | addCarParkVmapWorlds.drawingManagerClose(); |
| 367 | - | ||
| 368 | } | 260 | } |
| 369 | - | 261 | + $('.tipso-animation').tipso('hide'); |
| 370 | handleTitle(tab, navigation, index); | 262 | handleTitle(tab, navigation, index); |
| 371 | - | ||
| 372 | }, | 263 | }, |
| 373 | - | ||
| 374 | /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ | 264 | /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ |
| 375 | onPrevious: function (tab, navigation, index) { | 265 | onPrevious: function (tab, navigation, index) { |
| 376 | - | ||
| 377 | success.hide(); | 266 | success.hide(); |
| 378 | - | ||
| 379 | error.hide(); | 267 | error.hide(); |
| 380 | - | ||
| 381 | if(index ==0) { | 268 | if(index ==0) { |
| 382 | - | ||
| 383 | addCarParkVmapWorlds.drawingManagerClose(); | 269 | addCarParkVmapWorlds.drawingManagerClose(); |
| 384 | - | ||
| 385 | } | 270 | } |
| 386 | - | ||
| 387 | addCarParkVmapWorlds.clearMarkAndOverlays(); | 271 | addCarParkVmapWorlds.clearMarkAndOverlays(); |
| 388 | - | ||
| 389 | handleTitle(tab, navigation, index); | 272 | handleTitle(tab, navigation, index); |
| 390 | - | ||
| 391 | }, | 273 | }, |
| 392 | - | ||
| 393 | /** 显示选项卡内容 */ | 274 | /** 显示选项卡内容 */ |
| 394 | onTabShow: function (tab, navigation, index) { | 275 | onTabShow: function (tab, navigation, index) { |
| 395 | - | ||
| 396 | var total = navigation.find('li').length; | 276 | var total = navigation.find('li').length; |
| 397 | - | ||
| 398 | var current = index + 1; | 277 | var current = index + 1; |
| 399 | - | ||
| 400 | var $percent = (current / total) * 100; | 278 | var $percent = (current / total) * 100; |
| 401 | - | ||
| 402 | - $('#submit_carpark_form').find('.progress-bar').css({ | ||
| 403 | - | ||
| 404 | - width: $percent + '%' | ||
| 405 | - | ||
| 406 | - }); | ||
| 407 | - | 279 | + $('#submit_carpark_form').find('.progress-bar').css({ width: $percent + '%'}); |
| 408 | } | 280 | } |
| 409 | - | ||
| 410 | }); | 281 | }); |
| 411 | - | ||
| 412 | // 初始化第一步隐藏返回按钮 | 282 | // 初始化第一步隐藏返回按钮 |
| 413 | $('#submit_carpark_form').find('.button-previous').hide(); | 283 | $('#submit_carpark_form').find('.button-previous').hide(); |
| 414 | - | ||
| 415 | } | 284 | } |
| 416 | }; | 285 | }; |
| 417 | -}(); | 286 | +}(); |
| 418 | \ No newline at end of file | 287 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/add-input-function.js
| @@ -2,64 +2,47 @@ | @@ -2,64 +2,47 @@ | ||
| 2 | * 函数 | 2 | * 函数 |
| 3 | * | 3 | * |
| 4 | */ | 4 | */ |
| 5 | - | ||
| 6 | var PublicFunctions = function () { | 5 | var PublicFunctions = function () { |
| 7 | - | ||
| 8 | var PubFun = { | 6 | var PubFun = { |
| 9 | - | ||
| 10 | /** @param points:中心点;bPolygonGridValue:百度坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */ | 7 | /** @param points:中心点;bPolygonGridValue:百度坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */ |
| 11 | setFormInputValue: function(points,bPolygonGridValue,shapesTypeValue,radiusValue) { | 8 | setFormInputValue: function(points,bPolygonGridValue,shapesTypeValue,radiusValue) { |
| 12 | - | ||
| 13 | // 百度地图经纬度坐标中心点 | 9 | // 百度地图经纬度坐标中心点 |
| 14 | $('#bCenterPointInput').val(points); | 10 | $('#bCenterPointInput').val(points); |
| 15 | - | ||
| 16 | // 百度坐标点图形集合 | 11 | // 百度坐标点图形集合 |
| 17 | $('#bParkPointInput').val(bPolygonGridValue); | 12 | $('#bParkPointInput').val(bPolygonGridValue); |
| 18 | - | ||
| 19 | // 图形类型 | 13 | // 图形类型 |
| 20 | - $('#shapesTypeSelect').val(shapesTypeValue); | ||
| 21 | - | ||
| 22 | - // 圆形半径 | 14 | + if(shapesTypeValue == 'r') { |
| 15 | + $('#shapesTypeSelect').val('圆形'); | ||
| 16 | + // 圆形半径 | ||
| 17 | + $('#radiusGroup').show(); | ||
| 18 | + }else if(shapesTypeValue=='d') { | ||
| 19 | + $('#shapesTypeSelect').val('多边形'); | ||
| 20 | + $('#radiusGroup').hide(); | ||
| 21 | + } | ||
| 23 | $('#radiusInput').val(radiusValue); | 22 | $('#radiusInput').val(radiusValue); |
| 24 | - | ||
| 25 | }, | 23 | }, |
| 26 | - | ||
| 27 | getBusinessAllInfo : function(cb) { | 24 | getBusinessAllInfo : function(cb) { |
| 28 | - | ||
| 29 | // 填充公司下拉框选择值 | 25 | // 填充公司下拉框选择值 |
| 30 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | ||
| 31 | - | 26 | + $get('/business/all', {upCode_eq: '88'}, function(array){ |
| 32 | cb && cb(array); | 27 | cb && cb(array); |
| 33 | - | ||
| 34 | }); | 28 | }); |
| 35 | - | ||
| 36 | }, | 29 | }, |
| 37 | - | ||
| 38 | getCarParkCode : function(callback) { | 30 | getCarParkCode : function(callback) { |
| 39 | - | ||
| 40 | $get('/carpark/getCarParkCode',null,function(d) { | 31 | $get('/carpark/getCarParkCode',null,function(d) { |
| 41 | - | ||
| 42 | callback && callback(d); | 32 | callback && callback(d); |
| 43 | - | ||
| 44 | }); | 33 | }); |
| 45 | - | ||
| 46 | }, | 34 | }, |
| 47 | - | ||
| 48 | - // 新增站点保存 | 35 | + isHaveParkCode : function(p,callback) { |
| 36 | + $get('/carpark/isHaveParkCode',p,function(d) { | ||
| 37 | + callback && callback(d); | ||
| 38 | + }); | ||
| 39 | + }, | ||
| 40 | + // 新增停车场保存 | ||
| 49 | carParkSave : function(carPark,callback) { | 41 | carParkSave : function(carPark,callback) { |
| 50 | - | ||
| 51 | - console.log(carPark); | ||
| 52 | - | ||
| 53 | $post('/carpark/carParkSave',carPark,function(data) { | 42 | $post('/carpark/carParkSave',carPark,function(data) { |
| 54 | - | ||
| 55 | callback && callback(data); | 43 | callback && callback(data); |
| 56 | - | ||
| 57 | }); | 44 | }); |
| 58 | - | ||
| 59 | } | 45 | } |
| 60 | - | ||
| 61 | } | 46 | } |
| 62 | - | ||
| 63 | return PubFun ; | 47 | return PubFun ; |
| 64 | - | ||
| 65 | }(); | 48 | }(); |
| 66 | \ No newline at end of file | 49 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/add-vmap-world.js
| 1 | var addCarParkVmapWorlds = function() { | 1 | var addCarParkVmapWorlds = function() { |
| 2 | - | ||
| 3 | var mapB = '', circle = '', drawingManager = '',circle='',marker=''; | 2 | var mapB = '', circle = '', drawingManager = '',circle='',marker=''; |
| 4 | - | ||
| 5 | var Bmap = { | 3 | var Bmap = { |
| 6 | - | ||
| 7 | init : function() { | 4 | init : function() { |
| 8 | - | ||
| 9 | // 设置中心点, | 5 | // 设置中心点, |
| 10 | var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | 6 | var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; |
| 11 | - | ||
| 12 | // 百度API Key | 7 | // 百度API Key |
| 13 | var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | 8 | var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; |
| 14 | - | ||
| 15 | // 初始化百度地图 | 9 | // 初始化百度地图 |
| 16 | mapB = new BMap.Map("addCarParkbmap_basic"); | 10 | mapB = new BMap.Map("addCarParkbmap_basic"); |
| 17 | - | ||
| 18 | //中心点和缩放级别 | 11 | //中心点和缩放级别 |
| 19 | mapB.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | 12 | mapB.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); |
| 20 | - | ||
| 21 | //启用地图拖拽事件,默认启用(可不写) | 13 | //启用地图拖拽事件,默认启用(可不写) |
| 22 | mapB.enableDragging(); | 14 | mapB.enableDragging(); |
| 23 | - | ||
| 24 | //启用地图滚轮放大缩小 | 15 | //启用地图滚轮放大缩小 |
| 25 | mapB.enableScrollWheelZoom(); | 16 | mapB.enableScrollWheelZoom(); |
| 26 | - | ||
| 27 | //禁用鼠标双击放大 | 17 | //禁用鼠标双击放大 |
| 28 | mapB.disableDoubleClickZoom(); | 18 | mapB.disableDoubleClickZoom(); |
| 29 | - | ||
| 30 | //启用键盘上下左右键移动地图 | 19 | //启用键盘上下左右键移动地图 |
| 31 | mapB.enableKeyboard(); | 20 | mapB.enableKeyboard(); |
| 32 | - | ||
| 33 | var styleOptions = { | 21 | var styleOptions = { |
| 34 | - | ||
| 35 | //边线颜色。 | 22 | //边线颜色。 |
| 36 | strokeColor : "blue", | 23 | strokeColor : "blue", |
| 37 | - | ||
| 38 | //填充颜色。当参数为空时,圆形将没有填充效果。 | 24 | //填充颜色。当参数为空时,圆形将没有填充效果。 |
| 39 | fillColor : "blue", | 25 | fillColor : "blue", |
| 40 | - | ||
| 41 | //边线的宽度,以像素为单位。 | 26 | //边线的宽度,以像素为单位。 |
| 42 | strokeWeight : 3, | 27 | strokeWeight : 3, |
| 43 | - | ||
| 44 | //边线透明度,取值范围0 - 1。 | 28 | //边线透明度,取值范围0 - 1。 |
| 45 | strokeOpacity : 0.8, | 29 | strokeOpacity : 0.8, |
| 46 | - | ||
| 47 | //填充的透明度,取值范围0 - 1。 | 30 | //填充的透明度,取值范围0 - 1。 |
| 48 | fillOpacity : 0.6, | 31 | fillOpacity : 0.6, |
| 49 | - | ||
| 50 | //边线的样式,solid或dashed。 | 32 | //边线的样式,solid或dashed。 |
| 51 | strokeStyle : 'solid' | 33 | strokeStyle : 'solid' |
| 52 | - | ||
| 53 | }; | 34 | }; |
| 54 | - | ||
| 55 | // 创建鼠标绘制管理类 | 35 | // 创建鼠标绘制管理类 |
| 56 | drawingManager = new BMapLib.DrawingManager(mapB, { | 36 | drawingManager = new BMapLib.DrawingManager(mapB, { |
| 57 | - | ||
| 58 | //是否开启绘制模式 | 37 | //是否开启绘制模式 |
| 59 | isOpen : false, | 38 | isOpen : false, |
| 60 | - | ||
| 61 | //是否显示工具栏 | 39 | //是否显示工具栏 |
| 62 | enableDrawingTool : false, | 40 | enableDrawingTool : false, |
| 63 | - | ||
| 64 | drawingToolOptions : { | 41 | drawingToolOptions : { |
| 65 | - | ||
| 66 | //位置 | 42 | //位置 |
| 67 | anchor : BMAP_ANCHOR_TOP_RIGHT, | 43 | anchor : BMAP_ANCHOR_TOP_RIGHT, |
| 68 | - | ||
| 69 | //偏离值 | 44 | //偏离值 |
| 70 | offset : new BMap.Size(5, 5), | 45 | offset : new BMap.Size(5, 5), |
| 71 | - | ||
| 72 | //工具栏缩放比例 | 46 | //工具栏缩放比例 |
| 73 | scale : 0.8 | 47 | scale : 0.8 |
| 74 | - | ||
| 75 | }, | 48 | }, |
| 76 | - | ||
| 77 | //线的样式 | 49 | //线的样式 |
| 78 | polygonOptions : styleOptions | 50 | polygonOptions : styleOptions |
| 79 | - | ||
| 80 | }); | 51 | }); |
| 81 | - | ||
| 82 | // 添加绘画完成事件 | 52 | // 添加绘画完成事件 |
| 83 | drawingManager.addEventListener('polygoncomplete', function(e) { | 53 | drawingManager.addEventListener('polygoncomplete', function(e) { |
| 84 | - | ||
| 85 | drawingManager.close(); | 54 | drawingManager.close(); |
| 86 | - | ||
| 87 | if (e.getPath().length <= 2) { | 55 | if (e.getPath().length <= 2) { |
| 88 | - | ||
| 89 | // 弹出提示消息 | 56 | // 弹出提示消息 |
| 90 | layer.msg('坐标点不能小于等于两个...'); | 57 | layer.msg('坐标点不能小于等于两个...'); |
| 91 | - | ||
| 92 | // 清除地图覆盖物 | 58 | // 清除地图覆盖物 |
| 93 | mapB.clearOverlays(); | 59 | mapB.clearOverlays(); |
| 94 | - | ||
| 95 | drawingManager.open(); | 60 | drawingManager.open(); |
| 96 | - | ||
| 97 | return false; | 61 | return false; |
| 98 | - | ||
| 99 | }else { | 62 | }else { |
| 100 | - | ||
| 101 | var pointE = e; | 63 | var pointE = e; |
| 102 | - | ||
| 103 | // 多变行质心点 | 64 | // 多变行质心点 |
| 104 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | 65 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; |
| 105 | - | ||
| 106 | var addPolyGonLen_ = pointE.getPath().length; | 66 | var addPolyGonLen_ = pointE.getPath().length; |
| 107 | - | ||
| 108 | for(var k =0;k<addPolyGonLen_;k++) { | 67 | for(var k =0;k<addPolyGonLen_;k++) { |
| 109 | - | ||
| 110 | if(k==0) { | 68 | if(k==0) { |
| 111 | - | ||
| 112 | bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; | 69 | bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 113 | - | ||
| 114 | }else { | 70 | }else { |
| 115 | - | ||
| 116 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; | 71 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 117 | - | ||
| 118 | } | 72 | } |
| 119 | - | ||
| 120 | } | 73 | } |
| 121 | - | ||
| 122 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; | 74 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; |
| 123 | - | ||
| 124 | PublicFunctions.setFormInputValue(addSttationPoints_,bPloygonGrid,'d',''); | 75 | PublicFunctions.setFormInputValue(addSttationPoints_,bPloygonGrid,'d',''); |
| 125 | } | 76 | } |
| 126 | - | ||
| 127 | }); | 77 | }); |
| 128 | - | ||
| 129 | return mapB; | 78 | return mapB; |
| 130 | }, | 79 | }, |
| 131 | - | ||
| 132 | // 根据地理名称获取百度经纬度坐标 | 80 | // 根据地理名称获取百度经纬度坐标 |
| 133 | localSearchFromAdreesToPoint: function(Address,cb) { | 81 | localSearchFromAdreesToPoint: function(Address,cb) { |
| 134 | - | ||
| 135 | // 创建一个搜索类实例 | 82 | // 创建一个搜索类实例 |
| 136 | var localSearch = new BMap.LocalSearch(mapB); | 83 | var localSearch = new BMap.LocalSearch(mapB); |
| 137 | - | ||
| 138 | // 检索完成后的回调函数。 | 84 | // 检索完成后的回调函数。 |
| 139 | localSearch.setSearchCompleteCallback(function (searchResult) { | 85 | localSearch.setSearchCompleteCallback(function (searchResult) { |
| 140 | - | ||
| 141 | var resultPoints = ''; | 86 | var resultPoints = ''; |
| 142 | - | ||
| 143 | if(searchResult) { | 87 | if(searchResult) { |
| 144 | - | ||
| 145 | // 返回索引指定的结果。索引0表示第1条结果 | 88 | // 返回索引指定的结果。索引0表示第1条结果 |
| 146 | var poi = searchResult.getPoi(0); | 89 | var poi = searchResult.getPoi(0); |
| 147 | - | ||
| 148 | if(poi) { | 90 | if(poi) { |
| 149 | - | ||
| 150 | //获取经度和纬度 | 91 | //获取经度和纬度 |
| 151 | var stationNameChangePoint = new BMap.Point( poi.point.lng, poi.point.lat); | 92 | var stationNameChangePoint = new BMap.Point( poi.point.lng, poi.point.lat); |
| 152 | - | ||
| 153 | marker = new BMap.Marker(stationNameChangePoint); | 93 | marker = new BMap.Marker(stationNameChangePoint); |
| 154 | - | ||
| 155 | var PanOptions ={noAnimation :true}; | 94 | var PanOptions ={noAnimation :true}; |
| 156 | - | ||
| 157 | mapB.panTo(stationNameChangePoint,PanOptions); | 95 | mapB.panTo(stationNameChangePoint,PanOptions); |
| 158 | - | ||
| 159 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | 96 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 160 | mapB.setZoom(18); | 97 | mapB.setZoom(18); |
| 161 | - | ||
| 162 | mapB.panBy(0,-80); | 98 | mapB.panBy(0,-80); |
| 163 | - | ||
| 164 | // 将标注添加到地图中 | 99 | // 将标注添加到地图中 |
| 165 | mapB.addOverlay(marker); | 100 | mapB.addOverlay(marker); |
| 166 | - | ||
| 167 | //跳动的动画 | 101 | //跳动的动画 |
| 168 | marker.setAnimation(BMAP_ANIMATION_BOUNCE); | 102 | marker.setAnimation(BMAP_ANIMATION_BOUNCE); |
| 169 | - | ||
| 170 | cb && cb(stationNameChangePoint); | 103 | cb && cb(stationNameChangePoint); |
| 171 | - | ||
| 172 | }else { | 104 | }else { |
| 173 | - | ||
| 174 | // 弹出添加成功提示消息 | 105 | // 弹出添加成功提示消息 |
| 175 | layer.msg('无法获取停车场【'+Address+'】地理位置!'); | 106 | layer.msg('无法获取停车场【'+Address+'】地理位置!'); |
| 176 | - | ||
| 177 | cb && cb(false); | 107 | cb && cb(false); |
| 178 | - | ||
| 179 | } | 108 | } |
| 180 | - | ||
| 181 | }else { | 109 | }else { |
| 182 | - | ||
| 183 | // 弹出添加成功提示消息 | 110 | // 弹出添加成功提示消息 |
| 184 | layer.msg('无法获取停车场【'+Address+'】地理位置!'); | 111 | layer.msg('无法获取停车场【'+Address+'】地理位置!'); |
| 185 | - | ||
| 186 | cb && cb(false); | 112 | cb && cb(false); |
| 187 | } | 113 | } |
| 188 | - | ||
| 189 | }); | 114 | }); |
| 190 | - | ||
| 191 | // 根据检索词发起检索。 | 115 | // 根据检索词发起检索。 |
| 192 | localSearch.search(Address); | 116 | localSearch.search(Address); |
| 193 | - | ||
| 194 | }, | 117 | }, |
| 195 | 118 | ||
| 196 | // 画圆 | 119 | // 画圆 |
| 197 | pointsCircle : function(stationNameChangePoint) { | 120 | pointsCircle : function(stationNameChangePoint) { |
| 198 | - | ||
| 199 | //创建圆 | 121 | //创建圆 |
| 200 | circle = new BMap.Circle(stationNameChangePoint,100,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | 122 | circle = new BMap.Circle(stationNameChangePoint,100,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); |
| 201 | - | ||
| 202 | // 百度地图添加覆盖物圆 | 123 | // 百度地图添加覆盖物圆 |
| 203 | mapB.addOverlay(circle); | 124 | mapB.addOverlay(circle); |
| 204 | - | ||
| 205 | // 开启编辑功能 | 125 | // 开启编辑功能 |
| 206 | circle.enableEditing(); | 126 | circle.enableEditing(); |
| 207 | - | ||
| 208 | // 编辑圆监听事件 | 127 | // 编辑圆监听事件 |
| 209 | circle.addEventListener('remove',function() { | 128 | circle.addEventListener('remove',function() { |
| 210 | - | ||
| 211 | // 清除marker | 129 | // 清除marker |
| 212 | mapB.removeOverlay(marker); | 130 | mapB.removeOverlay(marker); |
| 213 | - | ||
| 214 | - /*VmapWorlds.clearMarkAndOverlays();*/ | ||
| 215 | - | ||
| 216 | // 返回圆形的半径,单位为米。 | 131 | // 返回圆形的半径,单位为米。 |
| 217 | var newRadius = circle.getRadius(); | 132 | var newRadius = circle.getRadius(); |
| 218 | - | ||
| 219 | // 返回圆形的中心点坐标。 | 133 | // 返回圆形的中心点坐标。 |
| 220 | var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | 134 | var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; |
| 221 | - | ||
| 222 | var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | 135 | var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; |
| 223 | - | ||
| 224 | circle = ''; | 136 | circle = ''; |
| 225 | - | ||
| 226 | PublicFunctions.setFormInputValue(newCenter,'','r',Math.round(newRadius)); | 137 | PublicFunctions.setFormInputValue(newCenter,'','r',Math.round(newRadius)); |
| 227 | - | ||
| 228 | }); | 138 | }); |
| 229 | - | ||
| 230 | }, | 139 | }, |
| 231 | - | ||
| 232 | // 打开绘画工具 | 140 | // 打开绘画工具 |
| 233 | drawingManagerOpen : function() { | 141 | drawingManagerOpen : function() { |
| 234 | - | ||
| 235 | // 打开鼠标绘画工具 | 142 | // 打开鼠标绘画工具 |
| 236 | drawingManager.open(); | 143 | drawingManager.open(); |
| 237 | - | ||
| 238 | // 设置属性 | 144 | // 设置属性 |
| 239 | drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | 145 | drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); |
| 240 | - | ||
| 241 | }, | 146 | }, |
| 242 | - | ||
| 243 | drawingManagerClose : function() { | 147 | drawingManagerClose : function() { |
| 244 | - | ||
| 245 | drawingManager.close(); | 148 | drawingManager.close(); |
| 246 | - | ||
| 247 | }, | 149 | }, |
| 248 | - | ||
| 249 | clearMarkAndOverlays : function() { | 150 | clearMarkAndOverlays : function() { |
| 250 | - | ||
| 251 | // 清楚地图覆盖物 | 151 | // 清楚地图覆盖物 |
| 252 | mapB.clearOverlays(); | 152 | mapB.clearOverlays(); |
| 253 | - | ||
| 254 | } | 153 | } |
| 255 | - | ||
| 256 | } | 154 | } |
| 257 | - | ||
| 258 | return Bmap; | 155 | return Bmap; |
| 259 | - | ||
| 260 | }(); | 156 | }(); |
| 261 | \ No newline at end of file | 157 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
| @@ -13,89 +13,154 @@ | @@ -13,89 +13,154 @@ | ||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | (function(){ | 15 | (function(){ |
| 16 | + function getComp(cb) { | ||
| 17 | + $.get('/user/companyData',null,function(rs) { | ||
| 18 | + return cb && cb(rs); | ||
| 19 | + }); | ||
| 20 | + } | ||
| 21 | + function initCompanySelect2(cb) { | ||
| 22 | + // get请求获取公司 | ||
| 23 | + $get('/business/all', {upCode_eq: '88'}, function(gs_d){ | ||
| 24 | + return cb && cb(gs_d); | ||
| 25 | + }); | ||
| 26 | + } | ||
| 27 | + initCompanySelect2(function(array) { | ||
| 28 | + // 公司下拉options属性值 | ||
| 29 | + var options = '<option value="">请选择...</option>'; | ||
| 30 | + // 遍历array | ||
| 31 | + $.each(array, function(i,d){ | ||
| 32 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 33 | + }); | ||
| 34 | + // 初始化公司下拉框并监听值改变事件. | ||
| 35 | + $('#companySelect').html(options).on('change', setBrancheCompanySelectOptions); | ||
| 36 | + // 初始化分公司下拉框. | ||
| 37 | + setBrancheCompanySelectOptions(); | ||
| 38 | + initLineSelect2(array); | ||
| 39 | + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | ||
| 40 | + // loadTableDate({'destroy_eq':0,'name_like':splitxlName(storage.xlName_AgursData)},true); | ||
| 41 | + }); | ||
| 42 | + function initLineSelect2(compD) { | ||
| 43 | + getComp(function(rs) { | ||
| 44 | + var params = {}; | ||
| 45 | + if(rs.length>0) { | ||
| 46 | + var compA = new Array(); | ||
| 47 | + for(var c = 0 ; c<rs.length;c++) { | ||
| 48 | + var comC = rs[c].companyCode; | ||
| 49 | + var child = rs[c].children; | ||
| 50 | + if(child.length>0) { | ||
| 51 | + for(var d = 0 ;d< child.length;d++) { | ||
| 52 | + compA.push(comC + '_' + child[d].code); | ||
| 53 | + } | ||
| 54 | + }else { | ||
| 55 | + compA.push(comC); | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + params.cgsbm_in = compA.toString(); | ||
| 59 | + } | ||
| 60 | + // 填充线路拉框选择值 | ||
| 61 | + $get('/carpark/all', params, function(array){ | ||
| 62 | + var len_ = array.length,paramsD = new Array(); | ||
| 63 | + paramsD.push({'id':'请选择...' ,'text':'请选择...'}); | ||
| 64 | + if(len_>0) { | ||
| 65 | + $.each(array, function(i, g){ | ||
| 66 | + if(g.parkName!='' || g.parkName != null) { | ||
| 67 | + paramsD.push({'id':g.parkName + '_' + g.parkCode ,'text':g.parkName + gsdmTogsName(compD,g.company)}); | ||
| 68 | + } | ||
| 69 | + }); | ||
| 70 | + if($('span').hasClass('select2-selection')) | ||
| 71 | + $('span .select2-selection').remove(); | ||
| 72 | + initPinYinSelect2($('#parkNameSelect'),paramsD,function(selector) { | ||
| 73 | + }); | ||
| 74 | + } | ||
| 75 | + }); | ||
| 76 | + }); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + $('#parkNameSelect').on('change',function() { | ||
| 80 | + var value = $(this).val(); | ||
| 81 | + if(value!=null && value!='') { | ||
| 82 | + $('#parkCodeInput').val(value.split('_')[1]); | ||
| 83 | + } | ||
| 84 | + }); | ||
| 16 | 85 | ||
| 17 | - /** 填充公司下拉框选择值 */ | ||
| 18 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | ||
| 19 | - | ||
| 20 | - // 公司下拉options属性值 | 86 | + function gsdmTogsName(gsD,code) { |
| 87 | + var rsStr = ''; | ||
| 88 | + for(var s = 0 ; s < gsD.length; s++) { | ||
| 89 | + if(gsD[s].businessCode == code) { | ||
| 90 | + rsStr = rsStr + '(' + gsD[s].businessName.replace('公司','') + ')'; | ||
| 91 | + break; | ||
| 92 | + } | ||
| 93 | + } | ||
| 94 | + return rsStr; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + function setBrancheCompanySelectOptions(){ | ||
| 98 | + // 获取公司下拉框选择值 | ||
| 99 | + var businessCode = $('#companySelect').val(); | ||
| 100 | + // 分公司下拉框options属性值 | ||
| 21 | var options = '<option value="">请选择...</option>'; | 101 | var options = '<option value="">请选择...</option>'; |
| 22 | - | ||
| 23 | - // 遍历array | ||
| 24 | - $.each(array, function(i,d){ | ||
| 25 | - | ||
| 26 | - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 27 | - | ||
| 28 | - }); | ||
| 29 | - | ||
| 30 | - // 填充公司下拉框options,并添加公司下拉框值改变事件setbrancheCompanySelectOptions | ||
| 31 | - $('#companySelect').html(options) | ||
| 32 | - //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions); | ||
| 33 | - | ||
| 34 | - }); | 102 | + // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 |
| 103 | + if(businessCode == null || businessCode ==''){ | ||
| 104 | + // 填充分公司下拉框options | ||
| 105 | + $('#brancheCompanySelect').html(options); | ||
| 106 | + } else { | ||
| 107 | + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | ||
| 108 | + $get('/business/all', {upCode_eq: businessCode}, function(array){ | ||
| 109 | + // 遍历array | ||
| 110 | + $.each(array, function(i,d){ | ||
| 111 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 112 | + // 填充分公司下拉框options | ||
| 113 | + $('#brancheCompanySelect').html(options); | ||
| 114 | + }); | ||
| 115 | + }); | ||
| 116 | + } | ||
| 117 | + } | ||
| 35 | 118 | ||
| 36 | /** page : 当前页 initPag : */ | 119 | /** page : 当前页 initPag : */ |
| 37 | var page = 0,initPag; | 120 | var page = 0,initPag; |
| 38 | - | ||
| 39 | /** 表格数据分页加载 */ | 121 | /** 表格数据分页加载 */ |
| 40 | loadTableDate(null,true); | 122 | loadTableDate(null,true); |
| 41 | - | ||
| 42 | /** 重置按钮事件 */ | 123 | /** 重置按钮事件 */ |
| 43 | $('tr.filter .filter-cancel').on('click',function(){ | 124 | $('tr.filter .filter-cancel').on('click',function(){ |
| 44 | - | ||
| 45 | // 清空搜索框值 | 125 | // 清空搜索框值 |
| 46 | $('tr.filter input,select').val('').change(); | 126 | $('tr.filter input,select').val('').change(); |
| 47 | - | ||
| 48 | // 重新加载表格数据 | 127 | // 重新加载表格数据 |
| 49 | loadTableDate(null,true); | 128 | loadTableDate(null,true); |
| 50 | }); | 129 | }); |
| 51 | - | ||
| 52 | /** 搜索按钮事件 */ | 130 | /** 搜索按钮事件 */ |
| 53 | $('tr.filter .filter-submit').on('click',function(){ | 131 | $('tr.filter .filter-submit').on('click',function(){ |
| 54 | - | ||
| 55 | var params = getParams(); | 132 | var params = getParams(); |
| 56 | - | ||
| 57 | page = 0; | 133 | page = 0; |
| 58 | - | ||
| 59 | loadTableDate(params,true); | 134 | loadTableDate(params,true); |
| 60 | - | ||
| 61 | }); | 135 | }); |
| 62 | 136 | ||
| 63 | function getParams() { | 137 | function getParams() { |
| 64 | - | ||
| 65 | // cells 集合返回表格中所有(列)单元格的一个数组 | 138 | // cells 集合返回表格中所有(列)单元格的一个数组 |
| 66 | var cells = $('tr.filter')[0].cells; | 139 | var cells = $('tr.filter')[0].cells; |
| 67 | - | ||
| 68 | // 搜索参数集合 | 140 | // 搜索参数集合 |
| 69 | var params = {}; | 141 | var params = {}; |
| 70 | - | ||
| 71 | // 搜索字段名称 | 142 | // 搜索字段名称 |
| 72 | var name; | 143 | var name; |
| 73 | - | ||
| 74 | // 遍历cells数组 | 144 | // 遍历cells数组 |
| 75 | $.each(cells, function(i, cell){ | 145 | $.each(cells, function(i, cell){ |
| 76 | - | ||
| 77 | // 获取第i列的input或者select集合 | 146 | // 获取第i列的input或者select集合 |
| 78 | var items = $('input,select', cell); | 147 | var items = $('input,select', cell); |
| 79 | - | ||
| 80 | // 遍历items集合 | 148 | // 遍历items集合 |
| 81 | for(var j = 0, item; item = items[j++];){ | 149 | for(var j = 0, item; item = items[j++];){ |
| 82 | - | ||
| 83 | // 获取字段名称 | 150 | // 获取字段名称 |
| 84 | name = $(item).attr('name'); | 151 | name = $(item).attr('name'); |
| 85 | - | ||
| 86 | if(name){ | 152 | if(name){ |
| 87 | - | ||
| 88 | // 赋取相对应的值 | 153 | // 赋取相对应的值 |
| 89 | params[name] = $(item).val(); | 154 | params[name] = $(item).val(); |
| 90 | - | ||
| 91 | } | 155 | } |
| 92 | } | 156 | } |
| 93 | - | ||
| 94 | }); | 157 | }); |
| 158 | + if(params.parkName_like=='请选择...') | ||
| 159 | + params.parkName_like = ''; | ||
| 160 | + else | ||
| 161 | + params.parkName_like = params.parkName_like.split('_')[0]; | ||
| 95 | return params; | 162 | return params; |
| 96 | - | ||
| 97 | } | 163 | } |
| 98 | - | ||
| 99 | 164 | ||
| 100 | /** | 165 | /** |
| 101 | * 表格数据分页加载事件 | 166 | * 表格数据分页加载事件 |
| @@ -106,99 +171,77 @@ | @@ -106,99 +171,77 @@ | ||
| 106 | * | 171 | * |
| 107 | */ | 172 | */ |
| 108 | function loadTableDate(param,isPon){ | 173 | function loadTableDate(param,isPon){ |
| 109 | - | ||
| 110 | // 搜索参数 | 174 | // 搜索参数 |
| 111 | var params = {}; | 175 | var params = {}; |
| 112 | - | ||
| 113 | if(param) { | 176 | if(param) { |
| 114 | - | ||
| 115 | params = param; | 177 | params = param; |
| 116 | - | ||
| 117 | } | 178 | } |
| 118 | - | ||
| 119 | // 排序(按更新时间) | 179 | // 排序(按更新时间) |
| 120 | params['order'] = 'id'; | 180 | params['order'] = 'id'; |
| 121 | - | ||
| 122 | // 记录当前页数 | 181 | // 记录当前页数 |
| 123 | params['page'] = page; | 182 | params['page'] = page; |
| 124 | - | ||
| 125 | // 弹出正在加载层 | 183 | // 弹出正在加载层 |
| 126 | var i = layer.load(2); | 184 | var i = layer.load(2); |
| 127 | - | ||
| 128 | - // 异步请求获取表格数据 | ||
| 129 | - $.get('/carpark',params,function(result){ | ||
| 130 | - | ||
| 131 | - // 添加序号 | ||
| 132 | - result.content.page = page; | ||
| 133 | - | ||
| 134 | - // 把数据填充到模版中 | ||
| 135 | - var tbodyHtml = template('carpark_list_table_temp',{list:result.content}); | ||
| 136 | - | ||
| 137 | - | ||
| 138 | - $('#datatable_carpark tbody').html(tbodyHtml); | ||
| 139 | - | ||
| 140 | - // 是重新分页且返回数据长度大于0 | ||
| 141 | - if(isPon && result.content.length > 0){ | ||
| 142 | - | ||
| 143 | - // 重新分页 | ||
| 144 | - initPag = true; | ||
| 145 | - | ||
| 146 | - // 分页栏 | ||
| 147 | - showPagination(result); | ||
| 148 | - | 185 | + getComp(function(rs) { |
| 186 | + if(rs.length>0) { | ||
| 187 | + var compA = new Array(); | ||
| 188 | + for(var c = 0 ; c<rs.length;c++) { | ||
| 189 | + var comC = rs[c].companyCode; | ||
| 190 | + var child = rs[c].children; | ||
| 191 | + if(child.length>0) { | ||
| 192 | + for(var d = 0 ;d< child.length;d++) { | ||
| 193 | + compA.push(comC + '_' + child[d].code); | ||
| 194 | + } | ||
| 195 | + }else { | ||
| 196 | + compA.push(comC); | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + params.cgsbm_in = compA.toString(); | ||
| 149 | } | 200 | } |
| 150 | - | ||
| 151 | - // 关闭弹出加载层 | ||
| 152 | - layer.close(i); | ||
| 153 | - | 201 | + // 异步请求获取表格数据 |
| 202 | + $.get('/carpark',params,function(result){ | ||
| 203 | + // 添加序号 | ||
| 204 | + result.content.page = page; | ||
| 205 | + // 把数据填充到模版中 | ||
| 206 | + var tbodyHtml = template('carpark_list_table_temp',{list:result.content}); | ||
| 207 | + $('#datatable_carpark tbody').html(tbodyHtml); | ||
| 208 | + // 是重新分页且返回数据长度大于0 | ||
| 209 | + if(isPon && result.content.length > 0){ | ||
| 210 | + // 重新分页 | ||
| 211 | + initPag = true; | ||
| 212 | + // 分页栏 | ||
| 213 | + showPagination(result); | ||
| 214 | + } | ||
| 215 | + // 关闭弹出加载层 | ||
| 216 | + layer.close(i); | ||
| 217 | + }); | ||
| 154 | }); | 218 | }); |
| 155 | } | 219 | } |
| 156 | 220 | ||
| 157 | /** 分页栏组件 */ | 221 | /** 分页栏组件 */ |
| 158 | function showPagination(data){ | 222 | function showPagination(data){ |
| 159 | - | ||
| 160 | // 分页组件 | 223 | // 分页组件 |
| 161 | $('#pagination').jqPaginator({ | 224 | $('#pagination').jqPaginator({ |
| 162 | - | ||
| 163 | // 总页数 | 225 | // 总页数 |
| 164 | totalPages: data.totalPages, | 226 | totalPages: data.totalPages, |
| 165 | - | ||
| 166 | // 中间显示页数 | 227 | // 中间显示页数 |
| 167 | visiblePages: 6, | 228 | visiblePages: 6, |
| 168 | - | ||
| 169 | // 当前页 | 229 | // 当前页 |
| 170 | currentPage: page + 1, | 230 | currentPage: page + 1, |
| 171 | - | ||
| 172 | first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | 231 | first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', |
| 173 | - | ||
| 174 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | 232 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', |
| 175 | - | ||
| 176 | next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | 233 | next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', |
| 177 | - | ||
| 178 | last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | 234 | last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', |
| 179 | - | ||
| 180 | page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | 235 | page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', |
| 181 | - | ||
| 182 | onPageChange: function (num, type) { | 236 | onPageChange: function (num, type) { |
| 183 | - | ||
| 184 | if(initPag){ | 237 | if(initPag){ |
| 185 | - | ||
| 186 | initPag = false; | 238 | initPag = false; |
| 187 | - | ||
| 188 | return; | 239 | return; |
| 189 | - | ||
| 190 | } | 240 | } |
| 191 | - | ||
| 192 | var pData = getParams(); | 241 | var pData = getParams(); |
| 193 | - | ||
| 194 | page = num - 1; | 242 | page = num - 1; |
| 195 | - | ||
| 196 | loadTableDate(pData, false); | 243 | loadTableDate(pData, false); |
| 197 | - | ||
| 198 | } | 244 | } |
| 199 | - | ||
| 200 | }); | 245 | }); |
| 201 | - | ||
| 202 | } | 246 | } |
| 203 | - | ||
| 204 | })(); | 247 | })(); |
| 205 | \ No newline at end of file | 248 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/carpark-positions-ajax.js
| @@ -2,33 +2,19 @@ | @@ -2,33 +2,19 @@ | ||
| 2 | * GetAjaxData :ajax异步请求 | 2 | * GetAjaxData :ajax异步请求 |
| 3 | * | 3 | * |
| 4 | */ | 4 | */ |
| 5 | - | ||
| 6 | var GetAjaxData = function(){ | 5 | var GetAjaxData = function(){ |
| 7 | - | ||
| 8 | var ajaxData = { | 6 | var ajaxData = { |
| 9 | - | ||
| 10 | // 查询停车场信息 | 7 | // 查询停车场信息 |
| 11 | getCarParkInfo : function(carParkId,callback){ | 8 | getCarParkInfo : function(carParkId,callback){ |
| 12 | - | ||
| 13 | $get('/carpark/findCarParkInfoFormId',{id:carParkId},function(r) { | 9 | $get('/carpark/findCarParkInfoFormId',{id:carParkId},function(r) { |
| 14 | - | ||
| 15 | return callback && callback(r); | 10 | return callback && callback(r); |
| 16 | - | ||
| 17 | }); | 11 | }); |
| 18 | - | ||
| 19 | }, | 12 | }, |
| 20 | - | ||
| 21 | carParkUpdate : function(params,callback){ | 13 | carParkUpdate : function(params,callback){ |
| 22 | - | ||
| 23 | $post('/carpark/carParkUpdate',params,function(data) { | 14 | $post('/carpark/carParkUpdate',params,function(data) { |
| 24 | - | ||
| 25 | callback && callback(data); | 15 | callback && callback(data); |
| 26 | - | ||
| 27 | }); | 16 | }); |
| 28 | - | ||
| 29 | } | 17 | } |
| 30 | } | 18 | } |
| 31 | - | ||
| 32 | return ajaxData; | 19 | return ajaxData; |
| 33 | - | ||
| 34 | }(); | 20 | }(); |
| 35 | \ No newline at end of file | 21 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/carpark-positions-events.js
| 1 | $(function(){ | 1 | $(function(){ |
| 2 | - | ||
| 3 | $('#backUp').on('click',function() { | 2 | $('#backUp').on('click',function() { |
| 4 | - | ||
| 5 | - // 获取返回元素并修改url地址 | ||
| 6 | - /*$('#backUp').attr('href','list.html?');*/ | ||
| 7 | - | ||
| 8 | // 返回list.html页面 | 3 | // 返回list.html页面 |
| 9 | loadPage('/pages/base/carpark/list.html'); | 4 | loadPage('/pages/base/carpark/list.html'); |
| 10 | - | ||
| 11 | }); | 5 | }); |
| 12 | - | ||
| 13 | $('#edit').on('click',function() { | 6 | $('#edit').on('click',function() { |
| 14 | - | ||
| 15 | $.get('edit_select.html', function(m){ | 7 | $.get('edit_select.html', function(m){ |
| 16 | - | ||
| 17 | $(pjaxContainer).append(m); | 8 | $(pjaxContainer).append(m); |
| 18 | - | ||
| 19 | $('#editPositions_select_mobal').trigger('editSelectMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); | 9 | $('#editPositions_select_mobal').trigger('editSelectMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 20 | - | ||
| 21 | }); | 10 | }); |
| 22 | - | ||
| 23 | }); | 11 | }); |
| 24 | - | ||
| 25 | - | 12 | + // 监听打开鼠标绘制工具按钮事件. |
| 13 | + $('#oppenDrawingManager').on('click',function() { | ||
| 14 | + CarParkPWorldsBMap.openDrawingManager(); | ||
| 15 | + }); | ||
| 16 | + // 监听关闭鼠标绘制工具按钮事件. | ||
| 17 | + $('#closeDrawingManager').on('click',function() { | ||
| 18 | + CarParkPWorldsBMap.drawingManagerClose(); | ||
| 19 | + }); | ||
| 26 | }); | 20 | }); |
| 27 | \ No newline at end of file | 21 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
| @@ -4,178 +4,105 @@ | @@ -4,178 +4,105 @@ | ||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | var PublicFunctions = function () { | 6 | var PublicFunctions = function () { |
| 7 | - | ||
| 8 | var PubFun = { | 7 | var PubFun = { |
| 9 | - | ||
| 10 | /** 停车场信息初始化 @param:<id:停车场ID> */ | 8 | /** 停车场信息初始化 @param:<id:停车场ID> */ |
| 11 | initCarPark : function(id) { | 9 | initCarPark : function(id) { |
| 12 | - | ||
| 13 | /** 获取停车场信息 @param:<id:停车场Id> */ | 10 | /** 获取停车场信息 @param:<id:停车场Id> */ |
| 14 | GetAjaxData.getCarParkInfo(id,function(r) { | 11 | GetAjaxData.getCarParkInfo(id,function(r) { |
| 15 | - | ||
| 16 | // 获取返回数据长度 | 12 | // 获取返回数据长度 |
| 17 | var len = r.length; | 13 | var len = r.length; |
| 18 | - | ||
| 19 | // 如果大于零 | 14 | // 如果大于零 |
| 20 | if(len>0) { | 15 | if(len>0) { |
| 21 | - | ||
| 22 | // 获取停车场信息数据 | 16 | // 获取停车场信息数据 |
| 23 | var carParkObj = r[0]; | 17 | var carParkObj = r[0]; |
| 24 | - | ||
| 25 | /** 设置停车场对象值 @param:<carParkObj:停车场对象值> */ | 18 | /** 设置停车场对象值 @param:<carParkObj:停车场对象值> */ |
| 26 | EditCarParkObj.setEitdCarPark(carParkObj); | 19 | EditCarParkObj.setEitdCarPark(carParkObj); |
| 27 | - | ||
| 28 | // 定义图形类型 | 20 | // 定义图形类型 |
| 29 | var stationShapesType = r[0].carParkShapesType; | 21 | var stationShapesType = r[0].carParkShapesType; |
| 30 | - | ||
| 31 | // 如果为空,则添加 | 22 | // 如果为空,则添加 |
| 32 | - if(stationShapesType==null){ | ||
| 33 | - | 23 | + if(stationShapesType==null || stationShapesType=='' ){ |
| 34 | // 弹出选择框;确认则提交;取消则返回 | 24 | // 弹出选择框;确认则提交;取消则返回 |
| 35 | - layer.confirm('停车场位置缺失,自动延续为添加停车场位置', {btn : [ '确认提示并添加', '取消' ]}, function(index) { | ||
| 36 | - | 25 | + layer.confirm('停车场位置缺失,是否自动延续为添加停车场位置', {btn : [ '确认并添加', '取消并返回' ]}, function(index) { |
| 37 | /** 关闭弹出层 @param:<index:当前弹出框> */ | 26 | /** 关闭弹出层 @param:<index:当前弹出框> */ |
| 38 | layer.close(index); | 27 | layer.close(index); |
| 39 | - | 28 | + $('.drwmageUtils').show(); |
| 29 | + $('.leftUtils').hide(); | ||
| 40 | // 停车场名称 | 30 | // 停车场名称 |
| 41 | var nameV = r[0].carParkName; | 31 | var nameV = r[0].carParkName; |
| 42 | - | ||
| 43 | /** 根据名称定位 */ | 32 | /** 根据名称定位 */ |
| 44 | CarParkPWorldsBMap.localSearchFromAdreesToPoint(nameV); | 33 | CarParkPWorldsBMap.localSearchFromAdreesToPoint(nameV); |
| 45 | - | ||
| 46 | // 打开绘制工具 | 34 | // 打开绘制工具 |
| 47 | CarParkPWorldsBMap.openDrawingManager(); | 35 | CarParkPWorldsBMap.openDrawingManager(); |
| 48 | - | 36 | + },function() { |
| 37 | + loadPage('/pages/base/carpark/list.html'); | ||
| 49 | }); | 38 | }); |
| 50 | - | ||
| 51 | return ; | 39 | return ; |
| 52 | } | 40 | } |
| 53 | - | 41 | + $('.leftUtils').show(); |
| 42 | + $('.drwmageUtils').hide(); | ||
| 54 | // 获取中心坐标点字符串分割 | 43 | // 获取中心坐标点字符串分割 |
| 55 | var BJwpoints = r[0].carParkBcenterPoint.split(' '); | 44 | var BJwpoints = r[0].carParkBcenterPoint.split(' '); |
| 56 | - | ||
| 57 | // 中心坐标点 | 45 | // 中心坐标点 |
| 58 | var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | 46 | var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); |
| 59 | - | ||
| 60 | var shapesV = ''; | 47 | var shapesV = ''; |
| 61 | - | ||
| 62 | if(r[0].carParkShapesType=='d') { | 48 | if(r[0].carParkShapesType=='d') { |
| 63 | - | ||
| 64 | shapesV = '多边形'; | 49 | shapesV = '多边形'; |
| 65 | - | ||
| 66 | }else if(r[0].carParkShapesType=='r') { | 50 | }else if(r[0].carParkShapesType=='r') { |
| 67 | - | ||
| 68 | shapesV = '圆形'; | 51 | shapesV = '圆形'; |
| 69 | - | ||
| 70 | } | 52 | } |
| 71 | - | ||
| 72 | var companyV = ''; | 53 | var companyV = ''; |
| 73 | - | ||
| 74 | var branchecomV = ''; | 54 | var branchecomV = ''; |
| 75 | - | ||
| 76 | if( r[0].carParkCompany=='55'){ | 55 | if( r[0].carParkCompany=='55'){ |
| 77 | - | ||
| 78 | companyV = '上南公司'; | 56 | companyV = '上南公司'; |
| 79 | - | ||
| 80 | if(r[0].carParkBrancheCompany=='1'){ | 57 | if(r[0].carParkBrancheCompany=='1'){ |
| 81 | - | ||
| 82 | branchecomV = '上南二分公司'; | 58 | branchecomV = '上南二分公司'; |
| 83 | - | ||
| 84 | }else if(r[0].carParkBrancheCompany=='2'){ | 59 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 85 | - | ||
| 86 | branchecomV = '上南三分公司'; | 60 | branchecomV = '上南三分公司'; |
| 87 | - | ||
| 88 | }else if(r[0].carParkBrancheCompany=='3'){ | 61 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 89 | - | ||
| 90 | branchecomV = '上南六分公司'; | 62 | branchecomV = '上南六分公司'; |
| 91 | - | ||
| 92 | }else if(r[0].carParkBrancheCompany=='4'){ | 63 | }else if(r[0].carParkBrancheCompany=='4'){ |
| 93 | - | ||
| 94 | branchecomV = '上南一分公司'; | 64 | branchecomV = '上南一分公司'; |
| 95 | - | ||
| 96 | } | 65 | } |
| 97 | - | ||
| 98 | }else if( r[0].carParkCompany=='22'){ | 66 | }else if( r[0].carParkCompany=='22'){ |
| 99 | - | ||
| 100 | companyV = '金高公司'; | 67 | companyV = '金高公司'; |
| 101 | - | ||
| 102 | if(r[0].carParkBrancheCompany=='1'){ | 68 | if(r[0].carParkBrancheCompany=='1'){ |
| 103 | - | ||
| 104 | branchecomV = '四分公司'; | 69 | branchecomV = '四分公司'; |
| 105 | - | ||
| 106 | }else if(r[0].carParkBrancheCompany=='2'){ | 70 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 107 | - | ||
| 108 | branchecomV = '二分公司'; | 71 | branchecomV = '二分公司'; |
| 109 | - | ||
| 110 | }else if(r[0].carParkBrancheCompany=='3'){ | 72 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 111 | - | ||
| 112 | branchecomV = '三分公司'; | 73 | branchecomV = '三分公司'; |
| 113 | - | ||
| 114 | }else if(r[0].carParkBrancheCompany=='5'){ | 74 | }else if(r[0].carParkBrancheCompany=='5'){ |
| 115 | - | ||
| 116 | branchecomV = '一分公司'; | 75 | branchecomV = '一分公司'; |
| 117 | - | ||
| 118 | } | 76 | } |
| 119 | - | ||
| 120 | }else if( r[0].carParkCompany=='05'){ | 77 | }else if( r[0].carParkCompany=='05'){ |
| 121 | - | ||
| 122 | companyV = '杨高公司'; | 78 | companyV = '杨高公司'; |
| 123 | - | ||
| 124 | if(r[0].carParkBrancheCompany=='1'){ | 79 | if(r[0].carParkBrancheCompany=='1'){ |
| 125 | - | ||
| 126 | branchecomV = '川沙分公司'; | 80 | branchecomV = '川沙分公司'; |
| 127 | - | ||
| 128 | }else if(r[0].carParkBrancheCompany=='2'){ | 81 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 129 | - | ||
| 130 | branchecomV = '金桥分公司'; | 82 | branchecomV = '金桥分公司'; |
| 131 | - | ||
| 132 | }else if(r[0].carParkBrancheCompany=='3'){ | 83 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 133 | - | ||
| 134 | branchecomV = '芦潮港分公司'; | 84 | branchecomV = '芦潮港分公司'; |
| 135 | - | ||
| 136 | }else if(r[0].carParkBrancheCompany=='5'){ | 85 | }else if(r[0].carParkBrancheCompany=='5'){ |
| 137 | - | ||
| 138 | branchecomV = '杨高分公司'; | 86 | branchecomV = '杨高分公司'; |
| 139 | - | ||
| 140 | }else if(r[0].carParkBrancheCompany=='6'){ | 87 | }else if(r[0].carParkBrancheCompany=='6'){ |
| 141 | - | ||
| 142 | branchecomV = '周浦分公司'; | 88 | branchecomV = '周浦分公司'; |
| 143 | - | ||
| 144 | } | 89 | } |
| 145 | - | ||
| 146 | - | ||
| 147 | }else if( r[0].carParkCompany=='26'){ | 90 | }else if( r[0].carParkCompany=='26'){ |
| 148 | - | ||
| 149 | companyV = '南汇公司'; | 91 | companyV = '南汇公司'; |
| 150 | - | ||
| 151 | if(r[0].carParkBrancheCompany=='1'){ | 92 | if(r[0].carParkBrancheCompany=='1'){ |
| 152 | - | ||
| 153 | branchecomV = '南汇一分'; | 93 | branchecomV = '南汇一分'; |
| 154 | - | ||
| 155 | }else if(r[0].carParkBrancheCompany=='2'){ | 94 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 156 | - | ||
| 157 | branchecomV = '南汇二分'; | 95 | branchecomV = '南汇二分'; |
| 158 | - | ||
| 159 | }else if(r[0].carParkBrancheCompany=='3'){ | 96 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 160 | - | ||
| 161 | branchecomV = '南汇三分'; | 97 | branchecomV = '南汇三分'; |
| 162 | - | ||
| 163 | }else if(r[0].carParkBrancheCompany=='4'){ | 98 | }else if(r[0].carParkBrancheCompany=='4'){ |
| 164 | - | ||
| 165 | branchecomV = '南汇维修公司'; | 99 | branchecomV = '南汇维修公司'; |
| 166 | - | ||
| 167 | }else if(r[0].carParkBrancheCompany=='5'){ | 100 | }else if(r[0].carParkBrancheCompany=='5'){ |
| 168 | - | ||
| 169 | branchecomV = '南汇公司'; | 101 | branchecomV = '南汇公司'; |
| 170 | - | ||
| 171 | } | 102 | } |
| 172 | - | ||
| 173 | }else if( r[0].carParkCompany=='77'){ | 103 | }else if( r[0].carParkCompany=='77'){ |
| 174 | - | ||
| 175 | companyV ='闵行公司' | 104 | companyV ='闵行公司' |
| 176 | - | ||
| 177 | } | 105 | } |
| 178 | - | ||
| 179 | // 信息窗口类容 | 106 | // 信息窗口类容 |
| 180 | var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | 107 | var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ |
| 181 | '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + | 108 | '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + |
| @@ -185,134 +112,91 @@ var PublicFunctions = function () { | @@ -185,134 +112,91 @@ var PublicFunctions = function () { | ||
| 185 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' + | 112 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' + |
| 186 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' + | 113 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' + |
| 187 | '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' + | 114 | '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' + |
| 188 | - /*'<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' +*/ | 115 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' + |
| 189 | '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + | 116 | '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + |
| 190 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ; | 117 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ; |
| 191 | - | ||
| 192 | // 信息窗口参数属性 | 118 | // 信息窗口参数属性 |
| 193 | var opts = { | 119 | var opts = { |
| 194 | - | ||
| 195 | // 信息窗口宽度 | 120 | // 信息窗口宽度 |
| 196 | width : 200, | 121 | width : 200, |
| 197 | - | ||
| 198 | // 信息窗口高度 | 122 | // 信息窗口高度 |
| 199 | height : 450, | 123 | height : 450, |
| 200 | - | ||
| 201 | // 信息窗位置偏移值。 | 124 | // 信息窗位置偏移值。 |
| 202 | offset: new BMap.Size(500,80), | 125 | offset: new BMap.Size(500,80), |
| 203 | - | ||
| 204 | //标题 | 126 | //标题 |
| 205 | title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>', | 127 | title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>', |
| 206 | - | ||
| 207 | //设置不允许信窗发送短息 | 128 | //设置不允许信窗发送短息 |
| 208 | enableMessage : false, | 129 | enableMessage : false, |
| 209 | - | ||
| 210 | //是否开启点击地图关闭信息窗口 | 130 | //是否开启点击地图关闭信息窗口 |
| 211 | enableCloseOnClick : false, | 131 | enableCloseOnClick : false, |
| 212 | - | ||
| 213 | // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | 132 | // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) |
| 214 | enableAutoPan:true | 133 | enableAutoPan:true |
| 215 | }; | 134 | }; |
| 216 | - | ||
| 217 | if(stationShapesType == 'r') { | 135 | if(stationShapesType == 'r') { |
| 218 | - | ||
| 219 | /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | 136 | /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 220 | CarParkPWorldsBMap.pointsCircle(r,point,htm,opts); | 137 | CarParkPWorldsBMap.pointsCircle(r,point,htm,opts); |
| 221 | - | ||
| 222 | }else if(stationShapesType == 'd'){ | 138 | }else if(stationShapesType == 'd'){ |
| 223 | - | ||
| 224 | /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | 139 | /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 225 | CarParkPWorldsBMap.pointsPolygon(r,point,htm,opts); | 140 | CarParkPWorldsBMap.pointsPolygon(r,point,htm,opts); |
| 226 | - | ||
| 227 | } | 141 | } |
| 228 | } | 142 | } |
| 229 | - | ||
| 230 | }); | 143 | }); |
| 231 | - | ||
| 232 | }, | 144 | }, |
| 233 | 145 | ||
| 234 | setFormValue : function(carParkObj) { | 146 | setFormValue : function(carParkObj) { |
| 235 | - | ||
| 236 | $('#idInput').val(carParkObj.carParkId); | 147 | $('#idInput').val(carParkObj.carParkId); |
| 237 | - | ||
| 238 | $('#bParkPointInput').val(carParkObj.carParkBparkPoint); | 148 | $('#bParkPointInput').val(carParkObj.carParkBparkPoint); |
| 239 | - | ||
| 240 | $('#parkNameInput').val(carParkObj.carParkName); | 149 | $('#parkNameInput').val(carParkObj.carParkName); |
| 241 | - | ||
| 242 | $('#parkCodeInput').val(carParkObj.carParkCode); | 150 | $('#parkCodeInput').val(carParkObj.carParkCode); |
| 243 | - | ||
| 244 | $('#bCenterPointInput').val(carParkObj.carParkBcenterPoint); | 151 | $('#bCenterPointInput').val(carParkObj.carParkBcenterPoint); |
| 245 | - | ||
| 246 | - $('#shapesTypeSelect').val(carParkObj.carParkShapesType); | ||
| 247 | - | 152 | + if(carParkObj.carParkShapesType=='r') { |
| 153 | + $('#shapesTypeSelect').val('圆形'); | ||
| 154 | + $('#radiusGroup').show(); | ||
| 155 | + }else if(carParkObj.carParkShapesType=='d') { | ||
| 156 | + $('#shapesTypeSelect').val('多边形'); | ||
| 157 | + $('#radiusGroup').hide(); | ||
| 158 | + } | ||
| 248 | $('#radiusInput').val(carParkObj.carParkRadius); | 159 | $('#radiusInput').val(carParkObj.carParkRadius); |
| 249 | - | ||
| 250 | $('#areaInput').val(carParkObj.carParkArea); | 160 | $('#areaInput').val(carParkObj.carParkArea); |
| 251 | - | ||
| 252 | $('#destroySelect').val(carParkObj.carParkDestroy); | 161 | $('#destroySelect').val(carParkObj.carParkDestroy); |
| 253 | - | ||
| 254 | $('#descriptionsTextarea').val(carParkObj.carParkDescriptions); | 162 | $('#descriptionsTextarea').val(carParkObj.carParkDescriptions); |
| 255 | - | ||
| 256 | }, | 163 | }, |
| 257 | 164 | ||
| 258 | // 公司下拉框 | 165 | // 公司下拉框 |
| 259 | selectTemp : function(callback) { | 166 | selectTemp : function(callback) { |
| 260 | - | ||
| 261 | // 填充公司下拉框选择值 | 167 | // 填充公司下拉框选择值 |
| 262 | - $.get('/business/all', {upCode_eq: '77'}, function(array){ | ||
| 263 | - | 168 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ |
| 264 | // 公司下拉options属性值 | 169 | // 公司下拉options属性值 |
| 265 | var options = '<option value="">-- 请选择公司 --</option>'; | 170 | var options = '<option value="">-- 请选择公司 --</option>'; |
| 266 | - | ||
| 267 | // 遍历array | 171 | // 遍历array |
| 268 | $.each(array, function(i,d){ | 172 | $.each(array, function(i,d){ |
| 269 | - | ||
| 270 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | 173 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 271 | - | ||
| 272 | }); | 174 | }); |
| 273 | - | ||
| 274 | // 填充公司下拉框options | 175 | // 填充公司下拉框options |
| 275 | $('#companySelect').html(options); | 176 | $('#companySelect').html(options); |
| 276 | - | ||
| 277 | callback && callback(); | 177 | callback && callback(); |
| 278 | - | ||
| 279 | }); | 178 | }); |
| 280 | }, | 179 | }, |
| 281 | - | ||
| 282 | // 填充分公司下拉框选择值 | 180 | // 填充分公司下拉框选择值 |
| 283 | getbrancheCompanyValues : function(businessCode,cb){ | 181 | getbrancheCompanyValues : function(businessCode,cb){ |
| 284 | - | ||
| 285 | // 分公司下拉框options属性值 | 182 | // 分公司下拉框options属性值 |
| 286 | var options = '<option value="">-- 请选择分公司 --</option>'; | 183 | var options = '<option value="">-- 请选择分公司 --</option>'; |
| 287 | - | ||
| 288 | if(businessCode) { | 184 | if(businessCode) { |
| 289 | - | ||
| 290 | $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){ | 185 | $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){ |
| 291 | - | ||
| 292 | // 遍历brancheCompany | 186 | // 遍历brancheCompany |
| 293 | $.each(brancheCompany, function(i,d){ | 187 | $.each(brancheCompany, function(i,d){ |
| 294 | - | ||
| 295 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | 188 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 296 | - | ||
| 297 | }); | 189 | }); |
| 298 | - | ||
| 299 | // 填充分公司下拉框options | 190 | // 填充分公司下拉框options |
| 300 | $('#brancheCompanySelect').html(options); | 191 | $('#brancheCompanySelect').html(options); |
| 301 | - | ||
| 302 | cb && cb(); | 192 | cb && cb(); |
| 303 | - | ||
| 304 | }); | 193 | }); |
| 305 | - | ||
| 306 | } else { | 194 | } else { |
| 307 | - | ||
| 308 | // 填充分公司下拉框options | 195 | // 填充分公司下拉框options |
| 309 | $('#brancheCompanySelect').html(options); | 196 | $('#brancheCompanySelect').html(options); |
| 310 | - | ||
| 311 | cb && cb(); | 197 | cb && cb(); |
| 312 | } | 198 | } |
| 313 | - | ||
| 314 | }, | 199 | }, |
| 315 | - | ||
| 316 | } | 200 | } |
| 317 | 201 | ||
| 318 | return PubFun ; | 202 | return PubFun ; |
src/main/resources/static/pages/base/carpark/js/carpark-positions-map.js
| @@ -8,443 +8,280 @@ var CarParkPWorldsBMap = function () { | @@ -8,443 +8,280 @@ var CarParkPWorldsBMap = function () { | ||
| 8 | var mapValue='',drawingManager='',marker='',circle='',polygon=''; | 8 | var mapValue='',drawingManager='',marker='',circle='',polygon=''; |
| 9 | 9 | ||
| 10 | var Bmap = { | 10 | var Bmap = { |
| 11 | - | ||
| 12 | init : function() { | 11 | init : function() { |
| 13 | - | ||
| 14 | // 设置中心点, | 12 | // 设置中心点, |
| 15 | var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | 13 | var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; |
| 16 | - | ||
| 17 | // 百度API Key | 14 | // 百度API Key |
| 18 | var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | 15 | var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; |
| 19 | - | ||
| 20 | // 初始化百度地图 | 16 | // 初始化百度地图 |
| 21 | mapValue = new BMap.Map("carParkbmap_basic"); | 17 | mapValue = new BMap.Map("carParkbmap_basic"); |
| 22 | - | ||
| 23 | //中心点和缩放级别 | 18 | //中心点和缩放级别 |
| 24 | mapValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | 19 | mapValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); |
| 25 | - | ||
| 26 | //启用地图拖拽事件,默认启用(可不写) | 20 | //启用地图拖拽事件,默认启用(可不写) |
| 27 | mapValue.enableDragging(); | 21 | mapValue.enableDragging(); |
| 28 | - | ||
| 29 | //启用地图滚轮放大缩小 | 22 | //启用地图滚轮放大缩小 |
| 30 | mapValue.enableScrollWheelZoom(); | 23 | mapValue.enableScrollWheelZoom(); |
| 31 | - | ||
| 32 | //禁用鼠标双击放大 | 24 | //禁用鼠标双击放大 |
| 33 | mapValue.disableDoubleClickZoom(); | 25 | mapValue.disableDoubleClickZoom(); |
| 34 | - | ||
| 35 | //启用键盘上下左右键移动地图 | 26 | //启用键盘上下左右键移动地图 |
| 36 | mapValue.enableKeyboard(); | 27 | mapValue.enableKeyboard(); |
| 37 | - | ||
| 38 | var styleOptions = { | 28 | var styleOptions = { |
| 39 | - | ||
| 40 | //边线颜色。 | 29 | //边线颜色。 |
| 41 | strokeColor : "blue", | 30 | strokeColor : "blue", |
| 42 | - | ||
| 43 | //填充颜色。当参数为空时,圆形将没有填充效果。 | 31 | //填充颜色。当参数为空时,圆形将没有填充效果。 |
| 44 | fillColor : "blue", | 32 | fillColor : "blue", |
| 45 | - | ||
| 46 | //边线的宽度,以像素为单位。 | 33 | //边线的宽度,以像素为单位。 |
| 47 | strokeWeight : 3, | 34 | strokeWeight : 3, |
| 48 | - | ||
| 49 | //边线透明度,取值范围0 - 1。 | 35 | //边线透明度,取值范围0 - 1。 |
| 50 | strokeOpacity : 0.8, | 36 | strokeOpacity : 0.8, |
| 51 | - | ||
| 52 | //填充的透明度,取值范围0 - 1。 | 37 | //填充的透明度,取值范围0 - 1。 |
| 53 | fillOpacity : 0.6, | 38 | fillOpacity : 0.6, |
| 54 | - | ||
| 55 | //边线的样式,solid或dashed。 | 39 | //边线的样式,solid或dashed。 |
| 56 | strokeStyle : 'solid' | 40 | strokeStyle : 'solid' |
| 57 | - | ||
| 58 | }; | 41 | }; |
| 59 | - | ||
| 60 | // 创建鼠标绘制管理类 | 42 | // 创建鼠标绘制管理类 |
| 61 | drawingManager = new BMapLib.DrawingManager(mapValue, { | 43 | drawingManager = new BMapLib.DrawingManager(mapValue, { |
| 62 | - | ||
| 63 | //是否开启绘制模式 | 44 | //是否开启绘制模式 |
| 64 | isOpen : false, | 45 | isOpen : false, |
| 65 | - | ||
| 66 | //是否显示工具栏 | 46 | //是否显示工具栏 |
| 67 | enableDrawingTool : false, | 47 | enableDrawingTool : false, |
| 68 | - | ||
| 69 | drawingToolOptions : { | 48 | drawingToolOptions : { |
| 70 | - | ||
| 71 | //位置 | 49 | //位置 |
| 72 | anchor : BMAP_ANCHOR_TOP_RIGHT, | 50 | anchor : BMAP_ANCHOR_TOP_RIGHT, |
| 73 | - | ||
| 74 | //偏离值 | 51 | //偏离值 |
| 75 | offset : new BMap.Size(5, 5), | 52 | offset : new BMap.Size(5, 5), |
| 76 | - | ||
| 77 | //工具栏缩放比例 | 53 | //工具栏缩放比例 |
| 78 | scale : 0.8 | 54 | scale : 0.8 |
| 79 | - | ||
| 80 | }, | 55 | }, |
| 81 | - | ||
| 82 | //线的样式 | 56 | //线的样式 |
| 83 | polygonOptions : styleOptions | 57 | polygonOptions : styleOptions |
| 84 | - | ||
| 85 | }); | 58 | }); |
| 86 | - | ||
| 87 | // 添加绘画完成事件 | 59 | // 添加绘画完成事件 |
| 88 | drawingManager.addEventListener('polygoncomplete', function(e) { | 60 | drawingManager.addEventListener('polygoncomplete', function(e) { |
| 89 | - | ||
| 90 | - drawingManager.close(); | ||
| 91 | - | 61 | + drawingManager.close(); |
| 92 | if (e.getPath().length <= 2) { | 62 | if (e.getPath().length <= 2) { |
| 93 | - | ||
| 94 | // 弹出提示消息 | 63 | // 弹出提示消息 |
| 95 | layer.msg('坐标点不能小于等于两个...'); | 64 | layer.msg('坐标点不能小于等于两个...'); |
| 96 | - | ||
| 97 | // 清除地图覆盖物 | 65 | // 清除地图覆盖物 |
| 98 | - map.clearOverlays(); | ||
| 99 | - | ||
| 100 | - // 加载该线路下所有站点位置添加到地图上 | ||
| 101 | - return false; | ||
| 102 | - | 66 | + Bmap.clearMarkAndOverlays(); |
| 67 | + // 加载该线路下所有站点位置添加到地图上 | ||
| 68 | + return false; | ||
| 103 | }else { | 69 | }else { |
| 104 | - | ||
| 105 | var pointE = e; | 70 | var pointE = e; |
| 106 | - | ||
| 107 | // 多变行质心点 | 71 | // 多变行质心点 |
| 108 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | 72 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; |
| 109 | - | ||
| 110 | var addPolyGonLen_ = pointE.getPath().length; | 73 | var addPolyGonLen_ = pointE.getPath().length; |
| 111 | - | ||
| 112 | for(var k =0;k<addPolyGonLen_;k++) { | 74 | for(var k =0;k<addPolyGonLen_;k++) { |
| 113 | - | ||
| 114 | if(k==0) { | 75 | if(k==0) { |
| 115 | - | ||
| 116 | bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; | 76 | bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 117 | - | ||
| 118 | }else { | 77 | }else { |
| 119 | - | ||
| 120 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; | 78 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 121 | - | ||
| 122 | } | 79 | } |
| 123 | 80 | ||
| 124 | } | 81 | } |
| 125 | - | ||
| 126 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; | 82 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; |
| 127 | - | ||
| 128 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ | 83 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ |
| 129 | EditCarParkObj.setCarParkBcenterPoint(addSttationPoints_); | 84 | EditCarParkObj.setCarParkBcenterPoint(addSttationPoints_); |
| 130 | - | ||
| 131 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ | 85 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ |
| 132 | EditCarParkObj.setCarParkShapesType('d'); | 86 | EditCarParkObj.setCarParkShapesType('d'); |
| 133 | - | ||
| 134 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ | 87 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ |
| 135 | EditCarParkObj.setCarParkRadius(''); | 88 | EditCarParkObj.setCarParkRadius(''); |
| 136 | - | ||
| 137 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ | 89 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ |
| 138 | EditCarParkObj.setCarParkBparkPoint(bPloygonGrid); | 90 | EditCarParkObj.setCarParkBparkPoint(bPloygonGrid); |
| 139 | - | ||
| 140 | $.get('edit.html', function(m){ | 91 | $.get('edit.html', function(m){ |
| 141 | - | ||
| 142 | $(pjaxContainer).append(m); | 92 | $(pjaxContainer).append(m); |
| 143 | - | ||
| 144 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); | 93 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 145 | - | ||
| 146 | }); | 94 | }); |
| 147 | - | ||
| 148 | } | 95 | } |
| 149 | - | ||
| 150 | }); | 96 | }); |
| 151 | return mapValue; | 97 | return mapValue; |
| 152 | }, | 98 | }, |
| 153 | - | ||
| 154 | openDrawingManager : function() { | 99 | openDrawingManager : function() { |
| 155 | - | ||
| 156 | // 清楚地图覆盖物 | 100 | // 清楚地图覆盖物 |
| 157 | - mapValue.clearOverlays(); | ||
| 158 | - | 101 | + // mapValue.clearOverlays(); |
| 159 | // 打开鼠标绘画工具 | 102 | // 打开鼠标绘画工具 |
| 160 | drawingManager.open(); | 103 | drawingManager.open(); |
| 161 | - | ||
| 162 | // 设置属性 | 104 | // 设置属性 |
| 163 | drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | 105 | drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); |
| 164 | - | ||
| 165 | }, | 106 | }, |
| 166 | - | 107 | + drawingManagerClose : function() { |
| 108 | + drawingManager.close(); | ||
| 109 | + }, | ||
| 167 | localSearchFromAdreesToPoint: function(Address) { | 110 | localSearchFromAdreesToPoint: function(Address) { |
| 168 | - | ||
| 169 | // 创建一个搜索类实例 | 111 | // 创建一个搜索类实例 |
| 170 | var localSearch = new BMap.LocalSearch(mapValue); | 112 | var localSearch = new BMap.LocalSearch(mapValue); |
| 171 | - | ||
| 172 | // 检索完成后的回调函数。 | 113 | // 检索完成后的回调函数。 |
| 173 | localSearch.setSearchCompleteCallback(function (searchResult) { | 114 | localSearch.setSearchCompleteCallback(function (searchResult) { |
| 174 | - | ||
| 175 | var resultPoints = ''; | 115 | var resultPoints = ''; |
| 176 | - | ||
| 177 | if(searchResult) { | 116 | if(searchResult) { |
| 178 | - | ||
| 179 | // 返回索引指定的结果。索引0表示第1条结果 | 117 | // 返回索引指定的结果。索引0表示第1条结果 |
| 180 | var poi = searchResult.getPoi(0); | 118 | var poi = searchResult.getPoi(0); |
| 181 | - | ||
| 182 | if(poi) { | 119 | if(poi) { |
| 183 | - | ||
| 184 | //获取经度和纬度 | 120 | //获取经度和纬度 |
| 185 | var Points = poi.point.lng + ' ' + poi.point.lat; | 121 | var Points = poi.point.lng + ' ' + poi.point.lat; |
| 186 | - | ||
| 187 | var BJwpointsArray = Points.split(' '); | 122 | var BJwpointsArray = Points.split(' '); |
| 188 | - | ||
| 189 | var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | 123 | var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); |
| 190 | - | ||
| 191 | var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | 124 | var marker_stargt2 = new BMap.Marker(stationNameChangePoint); |
| 192 | - | ||
| 193 | var PanOptions ={noAnimation :true}; | 125 | var PanOptions ={noAnimation :true}; |
| 194 | - | ||
| 195 | mapValue.panTo(stationNameChangePoint,PanOptions); | 126 | mapValue.panTo(stationNameChangePoint,PanOptions); |
| 196 | - | ||
| 197 | mapValue.panBy(0,-200); | 127 | mapValue.panBy(0,-200); |
| 198 | - | ||
| 199 | // 将标注添加到地图中 | 128 | // 将标注添加到地图中 |
| 200 | mapValue.addOverlay(marker_stargt2); | 129 | mapValue.addOverlay(marker_stargt2); |
| 201 | - | ||
| 202 | //跳动的动画 | 130 | //跳动的动画 |
| 203 | marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | 131 | marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); |
| 204 | - | ||
| 205 | } | 132 | } |
| 206 | - | ||
| 207 | } | 133 | } |
| 208 | - | ||
| 209 | }); | 134 | }); |
| 210 | - | ||
| 211 | // 根据检索词发起检索。 | 135 | // 根据检索词发起检索。 |
| 212 | localSearch.search(Address); | 136 | localSearch.search(Address); |
| 213 | - | ||
| 214 | }, | 137 | }, |
| 215 | - | ||
| 216 | /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | 138 | /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 217 | pointsCircle : function(r,point,htm,opts) { | 139 | pointsCircle : function(r,point,htm,opts) { |
| 218 | - | ||
| 219 | //创建圆 | 140 | //创建圆 |
| 220 | circle = new BMap.Circle(point,r[0].carParkRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | 141 | circle = new BMap.Circle(point,r[0].carParkRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); |
| 221 | - | ||
| 222 | // 允许覆盖物在map.clearOverlays方法中被清除 | 142 | // 允许覆盖物在map.clearOverlays方法中被清除 |
| 223 | circle.enableMassClear(); | 143 | circle.enableMassClear(); |
| 224 | - | ||
| 225 | // 百度地图添加覆盖物圆 | 144 | // 百度地图添加覆盖物圆 |
| 226 | mapValue.addOverlay(circle); | 145 | mapValue.addOverlay(circle); |
| 227 | - | ||
| 228 | // 创建信息窗口 | 146 | // 创建信息窗口 |
| 229 | infoWindow = new BMap.InfoWindow(htm, opts); | 147 | infoWindow = new BMap.InfoWindow(htm, opts); |
| 230 | - | ||
| 231 | // 自定义标注物图片 | 148 | // 自定义标注物图片 |
| 232 | var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | 149 | var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); |
| 233 | - | ||
| 234 | // 创建点 | 150 | // 创建点 |
| 235 | marker = new BMap.Marker(point,{icon : icon_target}); | 151 | marker = new BMap.Marker(point,{icon : icon_target}); |
| 236 | - | ||
| 237 | // 把标注添物加到地图上 | 152 | // 把标注添物加到地图上 |
| 238 | mapValue.addOverlay(marker); | 153 | mapValue.addOverlay(marker); |
| 239 | - | ||
| 240 | setTimeout(function(){ | 154 | setTimeout(function(){ |
| 241 | //开启信息窗口 | 155 | //开启信息窗口 |
| 242 | marker.openInfoWindow(infoWindow,point); | 156 | marker.openInfoWindow(infoWindow,point); |
| 243 | - | ||
| 244 | },100); | 157 | },100); |
| 245 | - | ||
| 246 | // 是否在平移过程中禁止动画。(自1.2新增) | 158 | // 是否在平移过程中禁止动画。(自1.2新增) |
| 247 | var PanOptions_ ={noAnimation :true}; | 159 | var PanOptions_ ={noAnimation :true}; |
| 248 | - | ||
| 249 | // 将地图的中心点更改为给定的点。 | 160 | // 将地图的中心点更改为给定的点。 |
| 250 | mapValue.panTo(point,PanOptions_); | 161 | mapValue.panTo(point,PanOptions_); |
| 251 | - | ||
| 252 | // 添加标志物监听事件 | 162 | // 添加标志物监听事件 |
| 253 | marker.addEventListener("click",function() { | 163 | marker.addEventListener("click",function() { |
| 254 | - | ||
| 255 | //开启信息窗口 | 164 | //开启信息窗口 |
| 256 | marker.openInfoWindow(infoWindow,point); | 165 | marker.openInfoWindow(infoWindow,point); |
| 257 | - | ||
| 258 | }); | 166 | }); |
| 259 | }, | 167 | }, |
| 260 | 168 | ||
| 261 | /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | 169 | /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 262 | pointsPolygon : function(r,pointPolygon,htm,opts_polygon) { | 170 | pointsPolygon : function(r,pointPolygon,htm,opts_polygon) { |
| 263 | - | ||
| 264 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | 171 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 265 | mapValue.setZoom(17); | 172 | mapValue.setZoom(17); |
| 266 | - | ||
| 267 | // 获取多边形坐标字符串 | 173 | // 获取多边形坐标字符串 |
| 268 | var stationBPolygonGrid = r[0].carParkBparkPoint; | 174 | var stationBPolygonGrid = r[0].carParkBparkPoint; |
| 269 | - | ||
| 270 | // 截取多边形坐标字符串 | 175 | // 截取多边形坐标字符串 |
| 271 | var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | 176 | var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); |
| 272 | - | ||
| 273 | // 按逗号切割 | 177 | // 按逗号切割 |
| 274 | var pointPolygonArray = stationBPolygonGridStr.split(','); | 178 | var pointPolygonArray = stationBPolygonGridStr.split(','); |
| 275 | - | ||
| 276 | // 多边形坐标集合 | 179 | // 多边形坐标集合 |
| 277 | var polygonP = []; | 180 | var polygonP = []; |
| 278 | - | ||
| 279 | for(var v = 0;v<pointPolygonArray.length;v++) { | 181 | for(var v = 0;v<pointPolygonArray.length;v++) { |
| 280 | - | ||
| 281 | polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | 182 | polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); |
| 282 | - | ||
| 283 | } | 183 | } |
| 284 | - | ||
| 285 | // 画多边形 | 184 | // 画多边形 |
| 286 | polygon = new BMap.Polygon(polygonP, { | 185 | polygon = new BMap.Polygon(polygonP, { |
| 287 | - | ||
| 288 | // 线条显色 | 186 | // 线条显色 |
| 289 | strokeColor : "blue", | 187 | strokeColor : "blue", |
| 290 | - | ||
| 291 | // 边线的宽度,以像素为单位。 | 188 | // 边线的宽度,以像素为单位。 |
| 292 | strokeWeight : 2, | 189 | strokeWeight : 2, |
| 293 | - | ||
| 294 | // 边线透明度,取值范围0 - 1。 | 190 | // 边线透明度,取值范围0 - 1。 |
| 295 | strokeOpacity : 0.5 | 191 | strokeOpacity : 0.5 |
| 296 | }); | 192 | }); |
| 297 | - | ||
| 298 | // 增加地图覆盖物多边形 | 193 | // 增加地图覆盖物多边形 |
| 299 | mapValue.addOverlay(polygon); | 194 | mapValue.addOverlay(polygon); |
| 300 | - | ||
| 301 | // 创建信息窗口 | 195 | // 创建信息窗口 |
| 302 | infoWindow = new BMap.InfoWindow(htm, opts_polygon); | 196 | infoWindow = new BMap.InfoWindow(htm, opts_polygon); |
| 303 | - | ||
| 304 | // 自定义标注物图片 | 197 | // 自定义标注物图片 |
| 305 | var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | 198 | var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); |
| 306 | - | ||
| 307 | // 创建点 | 199 | // 创建点 |
| 308 | marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | 200 | marker = new BMap.Marker(pointPolygon,{icon : icon_target}); |
| 309 | - | ||
| 310 | // 把标注添物加到地图上 | 201 | // 把标注添物加到地图上 |
| 311 | mapValue.addOverlay(marker); | 202 | mapValue.addOverlay(marker); |
| 312 | - | ||
| 313 | // 是否在平移过程中禁止动画。(自1.2新增) | 203 | // 是否在平移过程中禁止动画。(自1.2新增) |
| 314 | var PanOptions_ ={noAnimation :true}; | 204 | var PanOptions_ ={noAnimation :true}; |
| 315 | - | ||
| 316 | // 将地图的中心点更改为给定的点。 | 205 | // 将地图的中心点更改为给定的点。 |
| 317 | mapValue.panTo(pointPolygon,PanOptions_); | 206 | mapValue.panTo(pointPolygon,PanOptions_); |
| 318 | - | ||
| 319 | // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | 207 | // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 |
| 320 | mapValue.panBy(10,-250,PanOptions_); | 208 | mapValue.panBy(10,-250,PanOptions_); |
| 321 | - | ||
| 322 | //开启信息窗口 | 209 | //开启信息窗口 |
| 323 | marker.openInfoWindow(infoWindow,pointPolygon); | 210 | marker.openInfoWindow(infoWindow,pointPolygon); |
| 324 | - | ||
| 325 | }, | 211 | }, |
| 326 | 212 | ||
| 327 | // 编辑图形 | 213 | // 编辑图形 |
| 328 | editShapes : function(stationShapesTypeV,mindex) { | 214 | editShapes : function(stationShapesTypeV,mindex) { |
| 329 | // 关闭信息窗口 | 215 | // 关闭信息窗口 |
| 330 | marker.closeInfoWindow(); | 216 | marker.closeInfoWindow(); |
| 331 | - | ||
| 332 | // 清除marker | 217 | // 清除marker |
| 333 | mapValue.removeOverlay(marker); | 218 | mapValue.removeOverlay(marker); |
| 334 | - | ||
| 335 | // 编辑圆 | 219 | // 编辑圆 |
| 336 | if(stationShapesTypeV =='r') { | 220 | if(stationShapesTypeV =='r') { |
| 337 | - | ||
| 338 | // 开启编辑功能 | 221 | // 开启编辑功能 |
| 339 | circle.enableEditing(); | 222 | circle.enableEditing(); |
| 340 | - | ||
| 341 | // 编辑圆监听事件 | 223 | // 编辑圆监听事件 |
| 342 | circle.addEventListener('dblclick',function() { | 224 | circle.addEventListener('dblclick',function() { |
| 343 | - | ||
| 344 | // 关闭提示弹出层 | 225 | // 关闭提示弹出层 |
| 345 | layer.close(mindex); | 226 | layer.close(mindex); |
| 346 | - | ||
| 347 | // 返回圆形的半径,单位为米。 | 227 | // 返回圆形的半径,单位为米。 |
| 348 | var newRadius = circle.getRadius(); | 228 | var newRadius = circle.getRadius(); |
| 349 | - | ||
| 350 | // 返回圆形的中心点坐标。 | 229 | // 返回圆形的中心点坐标。 |
| 351 | var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | 230 | var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; |
| 352 | - | ||
| 353 | var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | 231 | var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; |
| 354 | - | ||
| 355 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ | 232 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ |
| 356 | EditCarParkObj.setCarParkBcenterPoint(newCenter); | 233 | EditCarParkObj.setCarParkBcenterPoint(newCenter); |
| 357 | - | ||
| 358 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ | 234 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ |
| 359 | EditCarParkObj.setCarParkShapesType('r'); | 235 | EditCarParkObj.setCarParkShapesType('r'); |
| 360 | - | ||
| 361 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ | 236 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ |
| 362 | EditCarParkObj.setCarParkRadius(Math.round(newRadius)); | 237 | EditCarParkObj.setCarParkRadius(Math.round(newRadius)); |
| 363 | - | ||
| 364 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ | 238 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ |
| 365 | EditCarParkObj.setCarParkBparkPoint(''); | 239 | EditCarParkObj.setCarParkBparkPoint(''); |
| 366 | - | ||
| 367 | // 加载编辑页面 | 240 | // 加载编辑页面 |
| 368 | $.get('edit.html', function(m){ | 241 | $.get('edit.html', function(m){ |
| 369 | - | ||
| 370 | $(pjaxContainer).append(m); | 242 | $(pjaxContainer).append(m); |
| 371 | - | ||
| 372 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); | 243 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 373 | - | ||
| 374 | }); | 244 | }); |
| 375 | - | ||
| 376 | }); | 245 | }); |
| 377 | - | ||
| 378 | // 编辑多变行 | 246 | // 编辑多变行 |
| 379 | }else if(stationShapesTypeV =='d') { | 247 | }else if(stationShapesTypeV =='d') { |
| 380 | - | ||
| 381 | // 开启编辑功能(自 1.1 新增) | 248 | // 开启编辑功能(自 1.1 新增) |
| 382 | polygon.enableEditing(); | 249 | polygon.enableEditing(); |
| 383 | - | ||
| 384 | // 添加多变行编辑事件 | 250 | // 添加多变行编辑事件 |
| 385 | polygon.addEventListener('dblclick',function(e) { | 251 | polygon.addEventListener('dblclick',function(e) { |
| 386 | - | ||
| 387 | // 获取编辑的多边形对象 | 252 | // 获取编辑的多边形对象 |
| 388 | var edit_pointE = polygon; | 253 | var edit_pointE = polygon; |
| 389 | - | ||
| 390 | var edit_bPloygonGrid = ""; | 254 | var edit_bPloygonGrid = ""; |
| 391 | - | ||
| 392 | var editPolyGonLen_ = edit_pointE.getPath().length; | 255 | var editPolyGonLen_ = edit_pointE.getPath().length; |
| 393 | - | ||
| 394 | for(var k =0;k<editPolyGonLen_;k++) { | 256 | for(var k =0;k<editPolyGonLen_;k++) { |
| 395 | - | ||
| 396 | if(k==0) { | 257 | if(k==0) { |
| 397 | - | ||
| 398 | edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | 258 | edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; |
| 399 | - | ||
| 400 | }else { | 259 | }else { |
| 401 | - | ||
| 402 | edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | 260 | edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; |
| 403 | - | ||
| 404 | } | 261 | } |
| 405 | - | ||
| 406 | } | 262 | } |
| 407 | - | ||
| 408 | edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | 263 | edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; |
| 409 | - | ||
| 410 | // 多边形中心点 | 264 | // 多边形中心点 |
| 411 | var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | 265 | var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; |
| 412 | - | ||
| 413 | - | ||
| 414 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ | 266 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ |
| 415 | EditCarParkObj.setCarParkBcenterPoint(centre_points); | 267 | EditCarParkObj.setCarParkBcenterPoint(centre_points); |
| 416 | - | ||
| 417 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ | 268 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ |
| 418 | EditCarParkObj.setCarParkShapesType('d'); | 269 | EditCarParkObj.setCarParkShapesType('d'); |
| 419 | - | ||
| 420 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ | 270 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ |
| 421 | EditCarParkObj.setCarParkRadius(''); | 271 | EditCarParkObj.setCarParkRadius(''); |
| 422 | - | ||
| 423 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ | 272 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ |
| 424 | EditCarParkObj.setCarParkBparkPoint(edit_bPloygonGrid); | 273 | EditCarParkObj.setCarParkBparkPoint(edit_bPloygonGrid); |
| 425 | - | ||
| 426 | $.get('edit.html', function(m){ | 274 | $.get('edit.html', function(m){ |
| 427 | - | ||
| 428 | $(pjaxContainer).append(m); | 275 | $(pjaxContainer).append(m); |
| 429 | - | ||
| 430 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); | 276 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 431 | - | ||
| 432 | }); | 277 | }); |
| 433 | - | ||
| 434 | }); | 278 | }); |
| 435 | - | ||
| 436 | } | 279 | } |
| 437 | - | ||
| 438 | }, | 280 | }, |
| 439 | - | ||
| 440 | clearMarkAndOverlays : function() { | 281 | clearMarkAndOverlays : function() { |
| 441 | - | ||
| 442 | // 清楚地图覆盖物 | 282 | // 清楚地图覆盖物 |
| 443 | mapValue.clearOverlays(); | 283 | mapValue.clearOverlays(); |
| 444 | - | ||
| 445 | } | 284 | } |
| 446 | } | 285 | } |
| 447 | - | ||
| 448 | return Bmap; | 286 | return Bmap; |
| 449 | - | ||
| 450 | }(); | 287 | }(); |
| 451 | \ No newline at end of file | 288 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/js/carpark-positions-reload.js
| @@ -13,26 +13,15 @@ | @@ -13,26 +13,15 @@ | ||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | (function(){ | 15 | (function(){ |
| 16 | - | ||
| 17 | // 获取参数停车场ID | 16 | // 获取参数停车场ID |
| 18 | var id = $.url().param('no'); | 17 | var id = $.url().param('no'); |
| 19 | - | ||
| 20 | // 关闭左侧栏 | 18 | // 关闭左侧栏 |
| 21 | - if (!$('body').hasClass('page-sidebar-closed')) { | ||
| 22 | - | ||
| 23 | - $('.menu-toggler.sidebar-toggler').click(); | ||
| 24 | - | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - // 等候500毫秒执行 | 19 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} |
| 20 | + // 等候300毫秒执行 | ||
| 28 | setTimeout(function(){ | 21 | setTimeout(function(){ |
| 29 | - | ||
| 30 | // 地图初始化 | 22 | // 地图初始化 |
| 31 | mapB = CarParkPWorldsBMap.init(); | 23 | mapB = CarParkPWorldsBMap.init(); |
| 32 | - | ||
| 33 | /** 停车场信息初始化 @param:<id:停车场ID> */ | 24 | /** 停车场信息初始化 @param:<id:停车场ID> */ |
| 34 | PublicFunctions.initCarPark(id); | 25 | PublicFunctions.initCarPark(id); |
| 35 | - | ||
| 36 | - },200); | ||
| 37 | - | 26 | + },300); |
| 38 | })(); | 27 | })(); |
| 39 | \ No newline at end of file | 28 | \ No newline at end of file |
src/main/resources/static/pages/base/carpark/list.html
| @@ -30,23 +30,24 @@ | @@ -30,23 +30,24 @@ | ||
| 30 | <thead> | 30 | <thead> |
| 31 | <tr role="row" class="heading"> | 31 | <tr role="row" class="heading"> |
| 32 | <th width="3%">序号</th> | 32 | <th width="3%">序号</th> |
| 33 | - <th width="8%">停车场名称</th> | ||
| 34 | - <th width="8%">停车场编号</th> | 33 | + <th width="12%">停车场名称</th> |
| 34 | + <th width="8%">停车场编码</th> | ||
| 35 | <th width="8%">地理位置</th> | 35 | <th width="8%">地理位置</th> |
| 36 | - <th width="8%">面积</th> | ||
| 37 | - <!-- <th width="8%">分公司</th> --> | 36 | + <th width="6%">面积(㎡)</th> |
| 38 | <th width="8%">所属公司</th> | 37 | <th width="8%">所属公司</th> |
| 38 | + <th width="8%">所属分公司</th> | ||
| 39 | <th width="6%">版本号</th> | 39 | <th width="6%">版本号</th> |
| 40 | <th width="6%">是否撤销</th> | 40 | <th width="6%">是否撤销</th> |
| 41 | - <th width="14%">操作</th> | 41 | + <th width="10%">操作</th> |
| 42 | </tr> | 42 | </tr> |
| 43 | <tr role="row" class="filter"> | 43 | <tr role="row" class="filter"> |
| 44 | <td>#</td> | 44 | <td>#</td> |
| 45 | <td> | 45 | <td> |
| 46 | - <input type="text" class="form-control form-filter input-sm" name="parkName_like"> | 46 | + <!-- <input type="text" class="form-control form-filter input-sm" name="parkName_like" > --> |
| 47 | + <select name="parkName_like" class="form-control" style="width:100%" id="parkNameSelect"></select> | ||
| 47 | </td> | 48 | </td> |
| 48 | <td> | 49 | <td> |
| 49 | - <input type="text" class="form-control form-filter input-sm" name="parkCode_like"> | 50 | + <input type="text" class="form-control form-filter input-sm" name="parkCode_like" id="parkCodeInput"> |
| 50 | 51 | ||
| 51 | </td> | 52 | </td> |
| 52 | <td> | 53 | <td> |
| @@ -55,13 +56,14 @@ | @@ -55,13 +56,14 @@ | ||
| 55 | <td> | 56 | <td> |
| 56 | <input type="text" class="form-control form-filter input-sm" name="area_eq"> | 57 | <input type="text" class="form-control form-filter input-sm" name="area_eq"> |
| 57 | </td> | 58 | </td> |
| 58 | - <!-- <td> | ||
| 59 | - <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq"> | ||
| 60 | - </td> --> | ||
| 61 | <td> | 59 | <td> |
| 62 | <select name="company_eq" class="form-control" id="companySelect"></select> | 60 | <select name="company_eq" class="form-control" id="companySelect"></select> |
| 63 | </td> | 61 | </td> |
| 64 | <td> | 62 | <td> |
| 63 | + <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select> | ||
| 64 | + <!-- <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq" id="brancheCompanySelect"> --> | ||
| 65 | + </td> | ||
| 66 | + <td> | ||
| 65 | <input type="text" class="form-control form-filter input-sm" name="versions_eq"> | 67 | <input type="text" class="form-control form-filter input-sm" name="versions_eq"> |
| 66 | </td> | 68 | </td> |
| 67 | <td> | 69 | <td> |
| @@ -93,8 +95,38 @@ | @@ -93,8 +95,38 @@ | ||
| 93 | </div> | 95 | </div> |
| 94 | </div> | 96 | </div> |
| 95 | 97 | ||
| 96 | -<!-- | ||
| 97 | - | 98 | +<script type="text/html" id="carpark_list_table_temp"> |
| 99 | + {{each list as obj i }} | ||
| 100 | + <tr> | ||
| 101 | + <td style="vertical-align: middle;"> | ||
| 102 | + {{(list.page*10)+(i+1)}} | ||
| 103 | + </td> | ||
| 104 | + <td> | ||
| 105 | + {{obj.parkName}} | ||
| 106 | + </td> | ||
| 107 | + <td> | ||
| 108 | + {{obj.parkCode}} | ||
| 109 | + </td> | ||
| 110 | + <td> | ||
| 111 | + {{obj.bCenterPoint}} | ||
| 112 | + </td> | ||
| 113 | + <td> | ||
| 114 | + {{obj.area}} | ||
| 115 | + </td> | ||
| 116 | + <td> | ||
| 117 | + {{if obj.company == '55'}} | ||
| 118 | + 上南公司 | ||
| 119 | + {{else if obj.company == '22'}} | ||
| 120 | + 金高公司 | ||
| 121 | + {{else if obj.company == '05'}} | ||
| 122 | + 杨高公司 | ||
| 123 | + {{else if obj.company == '26'}} | ||
| 124 | + 南汇公司 | ||
| 125 | + {{else if obj.company == '77'}} | ||
| 126 | + 闵行公司 | ||
| 127 | + {{/if}} | ||
| 128 | + </td> | ||
| 129 | + <td> | ||
| 98 | {{if obj.company == '55'}} | 130 | {{if obj.company == '55'}} |
| 99 | 131 | ||
| 100 | {{if obj.brancheCompany == '1'}} | 132 | {{if obj.brancheCompany == '1'}} |
| @@ -148,38 +180,6 @@ | @@ -148,38 +180,6 @@ | ||
| 148 | {{/if}} | 180 | {{/if}} |
| 149 | 181 | ||
| 150 | {{/if}} | 182 | {{/if}} |
| 151 | - | ||
| 152 | - --> | ||
| 153 | -<script type="text/html" id="carpark_list_table_temp"> | ||
| 154 | - {{each list as obj i }} | ||
| 155 | - <tr> | ||
| 156 | - <td style="vertical-align: middle;"> | ||
| 157 | - {{(list.page*10)+(i+1)}} | ||
| 158 | - </td> | ||
| 159 | - <td> | ||
| 160 | - {{obj.parkName}} | ||
| 161 | - </td> | ||
| 162 | - <td> | ||
| 163 | - {{obj.parkCode}} | ||
| 164 | - </td> | ||
| 165 | - <td> | ||
| 166 | - {{obj.bCenterPoint}} | ||
| 167 | - </td> | ||
| 168 | - <td> | ||
| 169 | - {{obj.area}} | ||
| 170 | - </td> | ||
| 171 | - <td> | ||
| 172 | - {{if obj.company == '55'}} | ||
| 173 | - 上南公司 | ||
| 174 | - {{else if obj.company == '22'}} | ||
| 175 | - 金高公司 | ||
| 176 | - {{else if obj.company == '05'}} | ||
| 177 | - 杨高公司 | ||
| 178 | - {{else if obj.company == '26'}} | ||
| 179 | - 南汇公司 | ||
| 180 | - {{else if obj.company == '77'}} | ||
| 181 | - 闵行公司 | ||
| 182 | - {{/if}} | ||
| 183 | </td> | 183 | </td> |
| 184 | <td> | 184 | <td> |
| 185 | {{obj.versions}} | 185 | {{obj.versions}} |
src/main/resources/static/pages/base/carpark/positions.html
| 1 | <link href="/pages/base/carpark/css/positions.css" rel="stylesheet" type="text/css" /> | 1 | <link href="/pages/base/carpark/css/positions.css" rel="stylesheet" type="text/css" /> |
| 2 | - | ||
| 3 | <!-- 地图容器--> | 2 | <!-- 地图容器--> |
| 4 | <div id="carParkbmap_basic"></div> | 3 | <div id="carParkbmap_basic"></div> |
| 5 | - | ||
| 6 | <!-- 操作工具容器 --> | 4 | <!-- 操作工具容器 --> |
| 7 | -<div class="leftUtils"> | 5 | +<div class="leftUtils" style="display: none"> |
| 8 | <div class="btn-group" style="left: 100px;"> | 6 | <div class="btn-group" style="left: 100px;"> |
| 9 | <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 | 7 | <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 |
| 10 | <i class="fa fa-angle-down"></i> | 8 | <i class="fa fa-angle-down"></i> |
| @@ -20,21 +18,30 @@ | @@ -20,21 +18,30 @@ | ||
| 20 | </ul> | 18 | </ul> |
| 21 | </div> | 19 | </div> |
| 22 | </div> | 20 | </div> |
| 23 | - | 21 | +<div class="drwmageUtils" style="display: none"> |
| 22 | + <div class="btn-group" style="left: 100px;"> | ||
| 23 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | ||
| 24 | + <i class="fa fa-angle-down"></i> | ||
| 25 | + </a> | ||
| 26 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | ||
| 27 | + <li> | ||
| 28 | + <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | ||
| 29 | + </li> | ||
| 30 | + <li> | ||
| 31 | + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | ||
| 32 | + </li> | ||
| 33 | + </ul> | ||
| 34 | + </div> | ||
| 35 | +</div> | ||
| 24 | <!-- 编辑停车场对象类 --> | 36 | <!-- 编辑停车场对象类 --> |
| 25 | <script src="/pages/base/carpark/js/positioncarpark.js"></script> | 37 | <script src="/pages/base/carpark/js/positioncarpark.js"></script> |
| 26 | - | ||
| 27 | <!-- ajax异步请求类 --> | 38 | <!-- ajax异步请求类 --> |
| 28 | <script src="/pages/base/carpark/js/carpark-positions-ajax.js"></script> | 39 | <script src="/pages/base/carpark/js/carpark-positions-ajax.js"></script> |
| 29 | - | ||
| 30 | <!-- 函数方法JS类库 --> | 40 | <!-- 函数方法JS类库 --> |
| 31 | <script src="/pages/base/carpark/js/carpark-positions-function.js"></script> | 41 | <script src="/pages/base/carpark/js/carpark-positions-function.js"></script> |
| 32 | - | ||
| 33 | <!-- 地图JS类库 --> | 42 | <!-- 地图JS类库 --> |
| 34 | <script src="/pages/base/carpark/js/carpark-positions-map.js"></script> | 43 | <script src="/pages/base/carpark/js/carpark-positions-map.js"></script> |
| 35 | - | ||
| 36 | <!-- 事件(PublicFunctions)JS类库 --> | 44 | <!-- 事件(PublicFunctions)JS类库 --> |
| 37 | <script src="/pages/base/carpark/js/carpark-positions-events.js"></script> | 45 | <script src="/pages/base/carpark/js/carpark-positions-events.js"></script> |
| 38 | - | ||
| 39 | <!-- reloadJS类库 --> | 46 | <!-- reloadJS类库 --> |
| 40 | <script src="/pages/base/carpark/js/carpark-positions-reload.js"></script> | 47 | <script src="/pages/base/carpark/js/carpark-positions-reload.js"></script> |
| 41 | \ No newline at end of file | 48 | \ No newline at end of file |
src/main/resources/static/pages/base/line/edit.html
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | <span class="required"> * </span>线路编码 : | 52 | <span class="required"> * </span>线路编码 : |
| 53 | </label> | 53 | </label> |
| 54 | <div class="col-md-4"> | 54 | <div class="col-md-4"> |
| 55 | - <input type="text" class="form-control" name="lineCode" id="lineCodeInput" placeholder="线路编码"> | 55 | + <input type="text" class="form-control" name="lineCode" id="lineCodeInput" placeholder="线路编码" readonly="readonly"> |
| 56 | </div> | 56 | </div> |
| 57 | </div> | 57 | </div> |
| 58 | <!-- 线路编码 (* 必填项) END --> | 58 | <!-- 线路编码 (* 必填项) END --> |
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
| @@ -12,29 +12,51 @@ $(function(){ | @@ -12,29 +12,51 @@ $(function(){ | ||
| 12 | // 获取参数ID | 12 | // 获取参数ID |
| 13 | var lineId = $.url().param('no'); | 13 | var lineId = $.url().param('no'); |
| 14 | if(lineId) { | 14 | if(lineId) { |
| 15 | - $get('/carpark/all',null, function(array){ | ||
| 16 | - // 停车场下拉options属性值 | ||
| 17 | - var options = '<option value="">-- 请选择停车场 --</option>'; | ||
| 18 | - // 遍历array | ||
| 19 | - $.each(array, function(i,d){ | ||
| 20 | - options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; | ||
| 21 | - }); | ||
| 22 | - $('#carParkSelect').html(options) | ||
| 23 | - }); | ||
| 24 | // 填充线路下拉框选择值 | 15 | // 填充线路下拉框选择值 |
| 25 | $get('/line/all', null, function(array){ | 16 | $get('/line/all', null, function(array){ |
| 26 | - var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | 17 | + /*var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; |
| 27 | var len_ = array.length; | 18 | var len_ = array.length; |
| 28 | if(len_>0) { | 19 | if(len_>0) { |
| 29 | $.each(array, function(i, g){ | 20 | $.each(array, function(i, g){ |
| 30 | - /*opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>';*/ | ||
| 31 | opGroup += '<option value="'+ g.id +'">'+g.name+'</option>'; | 21 | opGroup += '<option value="'+ g.id +'">'+g.name+'</option>'; |
| 32 | }); | 22 | }); |
| 33 | } | 23 | } |
| 34 | opGroup += '</optgroup>'; | 24 | opGroup += '</optgroup>'; |
| 35 | $('#lineSelect').html(opGroup).select2(); | 25 | $('#lineSelect').html(opGroup).select2(); |
| 36 | - $("#lineSelect").select2("val", lineId); | 26 | + $("#lineSelect").select2("val", lineId);*/ |
| 27 | + var len_ = array.length,paramsD = new Array(); | ||
| 28 | + if(len_>0) { | ||
| 29 | + $.each(array, function(i, g){ | ||
| 30 | + if(g.name!='' || g.name != null) { | ||
| 31 | + /*paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)});*/ | ||
| 32 | + paramsD.push({'id': g.id ,'text':g.name}); | ||
| 33 | + } | ||
| 34 | + }); | ||
| 35 | + initPinYinSelect2($('#lineSelect'),paramsD,function(selector) { | ||
| 36 | + selector.select2("val", lineId); | ||
| 37 | + }); | ||
| 38 | + } | ||
| 37 | }); | 39 | }); |
| 40 | + $get('/carpark/all',null, function(array){ | ||
| 41 | + /* // 停车场下拉options属性值 | ||
| 42 | + var options = '<option value="">-- 请选择停车场 --</option>'; | ||
| 43 | + // 遍历array | ||
| 44 | + $.each(array, function(i,d){ | ||
| 45 | + options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; | ||
| 46 | + }); | ||
| 47 | + $('#carParkSelect').html(options)*/ | ||
| 48 | + var len_ = array.length,paramsD = new Array(); | ||
| 49 | + paramsD.push({'id':'' ,'text':'请选择...'}); | ||
| 50 | + if(len_>0) { | ||
| 51 | + $.each(array, function(i, g){ | ||
| 52 | + if(g.parkName!='' || g.parkName != null) { | ||
| 53 | + paramsD.push({'id':g.parkCode ,'text':g.parkName}); | ||
| 54 | + } | ||
| 55 | + }); | ||
| 56 | + initPinYinSelect2($('#carParkSelect'),paramsD,function(selector) { | ||
| 57 | + }); | ||
| 58 | + } | ||
| 59 | + }); | ||
| 38 | $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?no='+lineId); | 60 | $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?no='+lineId); |
| 39 | $('#lineIdInput').val(lineId); | 61 | $('#lineIdInput').val(lineId); |
| 40 | // 早高峰开始时间 | 62 | // 早高峰开始时间 |
src/main/resources/static/pages/base/lineinformation/js/lineinformation-edit-form.js
| @@ -30,24 +30,47 @@ $(function() { | @@ -30,24 +30,47 @@ $(function() { | ||
| 30 | // 如果不为空 | 30 | // 如果不为空 |
| 31 | if(result) { | 31 | if(result) { |
| 32 | $get('/carpark/all',null, function(array){ | 32 | $get('/carpark/all',null, function(array){ |
| 33 | - // 停车场下拉options属性值 | 33 | + /* // 停车场下拉options属性值 |
| 34 | var options = '<option value="">-- 请选择停车场 --</option>'; | 34 | var options = '<option value="">-- 请选择停车场 --</option>'; |
| 35 | // 遍历array | 35 | // 遍历array |
| 36 | $.each(array, function(i,d){ | 36 | $.each(array, function(i,d){ |
| 37 | options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; | 37 | options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; |
| 38 | }); | 38 | }); |
| 39 | 39 | ||
| 40 | - $('#carParkSelect').html(options) | 40 | + $('#carParkSelect').html(options)*/ |
| 41 | + var len_ = array.length,paramsD = new Array(); | ||
| 42 | + paramsD.push({'id':'' ,'text':'请选择...'}); | ||
| 43 | + if(len_>0) { | ||
| 44 | + $.each(array, function(i, g){ | ||
| 45 | + if(g.parkName!='' || g.parkName != null) { | ||
| 46 | + paramsD.push({'id':g.parkCode ,'text':g.parkName}); | ||
| 47 | + } | ||
| 48 | + }); | ||
| 49 | + initPinYinSelect2($('#carParkSelect'),paramsD,function(selector) { | ||
| 50 | + selector.select2("val", result.carPark); | ||
| 51 | + }); | ||
| 52 | + } | ||
| 41 | // 获取线路标准类型并设值 | 53 | // 获取线路标准类型并设值 |
| 42 | $('#typeInput').val(result.type); | 54 | $('#typeInput').val(result.type); |
| 43 | // 获取表单元素下的元素并设值 | 55 | // 获取表单元素下的元素并设值 |
| 44 | putFormData(result, '#lineinformation_edit_form'); | 56 | putFormData(result, '#lineinformation_edit_form'); |
| 45 | - $('#carParkSelect').val(result.carPark); | 57 | + // $('#carParkSelect').val(result.carPark); |
| 46 | // 获取线路ID元素并设值 | 58 | // 获取线路ID元素并设值 |
| 47 | $('#lineIdInput').val(lineId); | 59 | $('#lineIdInput').val(lineId); |
| 48 | // 填充线路下拉框选择值 | 60 | // 填充线路下拉框选择值 |
| 49 | - $get('/line/all', null, function(array){ | ||
| 50 | - var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | 61 | + $get('/line/all', null, function(linearray){ |
| 62 | + var linelen_ = linearray.length,lineparamsD = new Array(); | ||
| 63 | + if(linelen_>0) { | ||
| 64 | + $.each(linearray, function(i, g){ | ||
| 65 | + if(g.name!='' || g.name != null) { | ||
| 66 | + lineparamsD.push({'id': g.id ,'text':g.name}); | ||
| 67 | + } | ||
| 68 | + }); | ||
| 69 | + initPinYinSelect2($('#lineSelect'),lineparamsD,function(lineselector) { | ||
| 70 | + lineselector.select2("val", lineId); | ||
| 71 | + }); | ||
| 72 | + } | ||
| 73 | + /*var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | ||
| 51 | var len_ = array.length; | 74 | var len_ = array.length; |
| 52 | if(len_>0) { | 75 | if(len_>0) { |
| 53 | $.each(array, function(i, g){ | 76 | $.each(array, function(i, g){ |
| @@ -56,7 +79,7 @@ $(function() { | @@ -56,7 +79,7 @@ $(function() { | ||
| 56 | } | 79 | } |
| 57 | opGroup += '</optgroup>'; | 80 | opGroup += '</optgroup>'; |
| 58 | $('#lineSelect').html(opGroup).select2(); | 81 | $('#lineSelect').html(opGroup).select2(); |
| 59 | - $("#lineSelect").select2("val", lineId); | 82 | + $("#lineSelect").select2("val", lineId);*/ |
| 60 | }); | 83 | }); |
| 61 | }); | 84 | }); |
| 62 | } | 85 | } |
src/main/resources/static/pages/base/station/edit_select.html
| @@ -56,7 +56,7 @@ $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm, | @@ -56,7 +56,7 @@ $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm, | ||
| 56 | console.log(EditStation); | 56 | console.log(EditStation); |
| 57 | // 显示选择修改方式弹出层 | 57 | // 显示选择修改方式弹出层 |
| 58 | $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 58 | $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 59 | - $('.tipso-animation').tipso({ | 59 | + /* $('.tipso-animation').tipso({ |
| 60 | speed : 100, | 60 | speed : 100, |
| 61 | background : '#0ed0e8', | 61 | background : '#0ed0e8', |
| 62 | color : '#ffffff', | 62 | color : '#ffffff', |
| @@ -74,6 +74,27 @@ $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm, | @@ -74,6 +74,27 @@ $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm, | ||
| 74 | setTimeout(function(){ | 74 | setTimeout(function(){ |
| 75 | $('.tipso-animation').tipso('show'); | 75 | $('.tipso-animation').tipso('show'); |
| 76 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | 76 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); |
| 77 | + },500); */ | ||
| 78 | + setTimeout(function(){ | ||
| 79 | + var offsetY = $('.modal-dialog').offset().top-3 , | ||
| 80 | + offsetX = $('.modal-dialog').offset().left-10 ; | ||
| 81 | + $('.tipso-animation').tipso({ | ||
| 82 | + speed : 100, | ||
| 83 | + background : '#0ed0e8', | ||
| 84 | + color : '#ffffff', | ||
| 85 | + position :'right', | ||
| 86 | + width : 390, | ||
| 87 | + delay : 400, | ||
| 88 | + animationIn : 'bounceIn', | ||
| 89 | + animationOut : 'bounceOut', | ||
| 90 | + offsetX : -(offsetX), | ||
| 91 | + offsetY : -(offsetY), | ||
| 92 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:12px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+ | ||
| 93 | + '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>', | ||
| 94 | + | ||
| 95 | + }); | ||
| 96 | + $('.tipso-animation').tipso('show'); | ||
| 97 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 77 | },500); | 98 | },500); |
| 78 | // 获取站点名称元素并赋值 | 99 | // 获取站点名称元素并赋值 |
| 79 | $('#stationNamebootboxInput').val(EditStation.zdmc); | 100 | $('#stationNamebootboxInput').val(EditStation.zdmc); |
src/main/resources/static/pages/base/stationroute/add_select.html
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stationObj,lineObj,fun){ | 48 | $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stationObj,lineObj,fun){ |
| 49 | // 加载显示mobal | 49 | // 加载显示mobal |
| 50 | $('#add_select_mobal').modal({show : true,backdrop: 'static', keyboard: false}); | 50 | $('#add_select_mobal').modal({show : true,backdrop: 'static', keyboard: false}); |
| 51 | - $('.tipso-animation').tipso({ | 51 | + /* $('.tipso-animation').tipso({ |
| 52 | speed : 100, | 52 | speed : 100, |
| 53 | background : '#0ed0e8', | 53 | background : '#0ed0e8', |
| 54 | color : '#ffffff', | 54 | color : '#ffffff', |
| @@ -66,6 +66,27 @@ $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stat | @@ -66,6 +66,27 @@ $('#add_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,stat | ||
| 66 | setTimeout(function(){ | 66 | setTimeout(function(){ |
| 67 | $('.tipso-animation').tipso('show'); | 67 | $('.tipso-animation').tipso('show'); |
| 68 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | 68 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); |
| 69 | + },500); */ | ||
| 70 | + setTimeout(function(){ | ||
| 71 | + var offsetY = $('.modal-dialog').offset().top-3 , | ||
| 72 | + offsetX = $('.modal-dialog').offset().left-10 ; | ||
| 73 | + $('.tipso-animation').tipso({ | ||
| 74 | + speed : 100, | ||
| 75 | + background : '#0ed0e8', | ||
| 76 | + color : '#ffffff', | ||
| 77 | + position :'right', | ||
| 78 | + width : 390, | ||
| 79 | + delay : 400, | ||
| 80 | + animationIn : 'bounceIn', | ||
| 81 | + animationOut : 'bounceOut', | ||
| 82 | + offsetX : -(offsetX), | ||
| 83 | + offsetY : -(offsetY), | ||
| 84 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span></br>'+ | ||
| 85 | + '<span style="display:block; float:left;font-size:x-small">B)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span>', | ||
| 86 | + | ||
| 87 | + }); | ||
| 88 | + $('.tipso-animation').tipso('show'); | ||
| 89 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 69 | },500); | 90 | },500); |
| 70 | // 站点名称改变事件 | 91 | // 站点名称改变事件 |
| 71 | $('#stationNamebootboxInput').on('change',function() { | 92 | $('#stationNamebootboxInput').on('change',function() { |
src/main/resources/static/pages/base/stationroute/edit_select.html
| @@ -52,22 +52,24 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | @@ -52,22 +52,24 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | ||
| 52 | var Station = sel[0].original; | 52 | var Station = sel[0].original; |
| 53 | // 显示选择修改方式弹出层 | 53 | // 显示选择修改方式弹出层 |
| 54 | $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 54 | $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 55 | - $('.tipso-animation').tipso({ | ||
| 56 | - speed : 100, | ||
| 57 | - background : '#0ed0e8', | ||
| 58 | - color : '#ffffff', | ||
| 59 | - position :'right', | ||
| 60 | - width : 390, | ||
| 61 | - delay : 400, | ||
| 62 | - animationIn : 'bounceIn', | ||
| 63 | - animationOut : 'bounceOut', | ||
| 64 | - offsetX : -485, | ||
| 65 | - offsetY : -25, | ||
| 66 | - content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+ | ||
| 67 | - '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>', | ||
| 68 | - | ||
| 69 | - }); | ||
| 70 | setTimeout(function(){ | 55 | setTimeout(function(){ |
| 56 | + var offsetY = $('.modal-dialog').offset().top-3 , | ||
| 57 | + offsetX = $('.modal-dialog').offset().left-10 ; | ||
| 58 | + $('.tipso-animation').tipso({ | ||
| 59 | + speed : 100, | ||
| 60 | + background : '#0ed0e8', | ||
| 61 | + color : '#ffffff', | ||
| 62 | + position :'right', | ||
| 63 | + width : 390, | ||
| 64 | + delay : 400, | ||
| 65 | + animationIn : 'bounceIn', | ||
| 66 | + animationOut : 'bounceOut', | ||
| 67 | + offsetX : -(offsetX), | ||
| 68 | + offsetY : -(offsetY), | ||
| 69 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+ | ||
| 70 | + '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>', | ||
| 71 | + | ||
| 72 | + }); | ||
| 71 | $('.tipso-animation').tipso('show'); | 73 | $('.tipso-animation').tipso('show'); |
| 72 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | 74 | setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); |
| 73 | },500); | 75 | },500); |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html
| @@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
| 33 | </sa-Select5> | 33 | </sa-Select5> |
| 34 | </td> | 34 | </td> |
| 35 | <td> | 35 | <td> |
| 36 | - <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['clBm_like']" placeholder="输入内部编号..."/> | 36 | + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['clZbh_like']" placeholder="输入内部编号..."/> |
| 37 | </td> | 37 | </td> |
| 38 | <td></td> | 38 | <td></td> |
| 39 | <td></td> | 39 | <td></td> |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| @@ -4301,432 +4301,432 @@ angular.module('ScheduleApp').directive( | @@ -4301,432 +4301,432 @@ angular.module('ScheduleApp').directive( | ||
| 4301 | } | 4301 | } |
| 4302 | ] | 4302 | ] |
| 4303 | ); | 4303 | ); |
| 4304 | -/** | ||
| 4305 | - * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能 | ||
| 4306 | - * name(必须),控件的名字 | ||
| 4307 | - * ds,外部数据源 | ||
| 4308 | - * cl1,车辆1属性 | ||
| 4309 | - * cl2,车辆2属性 | ||
| 4310 | - * j1,驾驶员1属性 | ||
| 4311 | - * j2,驾驶员2属性 | ||
| 4312 | - * s1,售票员1属性 | ||
| 4313 | - * s2,售票员2属性 | ||
| 4314 | - */ | ||
| 4315 | -angular.module('ScheduleApp').directive( | ||
| 4316 | - 'saPlaninfoedit', | ||
| 4317 | - [ | ||
| 4318 | - function() { | ||
| 4319 | - return { | ||
| 4320 | - restrict: 'E', | ||
| 4321 | - templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html', | ||
| 4322 | - scope: { // 独立作用域 | ||
| 4323 | - ds: '=ngModel' | ||
| 4324 | - }, | ||
| 4325 | - controllerAs: '$saPlanInfoEditCtrl', | ||
| 4326 | - bindToController: true, | ||
| 4327 | - controller: function() { | ||
| 4328 | - //var self = this; | ||
| 4329 | - | ||
| 4330 | - }, | ||
| 4331 | - | ||
| 4332 | - compile: function(tElem, tAttrs) { | ||
| 4333 | - // 获取属性 | ||
| 4334 | - var $attr_name = tAttrs["name"]; // 控件的名字 | ||
| 4335 | - if (!$attr_name) { | ||
| 4336 | - throw {msg: "saPlaninfoedit指令name属性不能为空"}; | ||
| 4337 | - } | ||
| 4338 | - | ||
| 4339 | - // 内部controlAs名字 | ||
| 4340 | - var ctrlAs = '$saPlanInfoEditCtrl'; | ||
| 4341 | - | ||
| 4342 | - | ||
| 4343 | - // 内部变量,原始车辆,人员数据 | ||
| 4344 | - var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组 | ||
| 4345 | - var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组 | ||
| 4346 | - var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组 | ||
| 4347 | - var old_isfb = false; // 是否有分班 | ||
| 4348 | - var old_isfb_index = 0; // 分班开始索引 | ||
| 4349 | - var old_hasJCBC = false; // 是否有进场班次 | ||
| 4350 | - var old_max_fcno = 0; // 最大发车顺序号 | ||
| 4351 | - var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号 | ||
| 4352 | - var old_half_bcs = 0; // 一般的班次数量 | ||
| 4353 | - | ||
| 4354 | - // 内部变量,变更的车辆,变更的人员 | ||
| 4355 | - var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号) | ||
| 4356 | - var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号) | ||
| 4357 | - var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号) | ||
| 4358 | - var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号) | ||
| 4359 | - var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号) | ||
| 4360 | - var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号) | ||
| 4361 | - | ||
| 4362 | - return { | ||
| 4363 | - pre: function(scope, element, attr) { | ||
| 4364 | - | ||
| 4365 | - }, | ||
| 4366 | - post: function(scope, element, attr) { | ||
| 4367 | - | ||
| 4368 | - /** | ||
| 4369 | - * 刷新车辆数据。 | ||
| 4370 | - */ | ||
| 4371 | - scope[ctrlAs].$$internal_refresh_dsdata_cl = function() { | ||
| 4372 | - if (new_cl1) { | ||
| 4373 | - var new_cl1_id = new_cl1.split("_")[0]; | ||
| 4374 | - var new_cl1_zbh = new_cl1.split("_")[1]; | ||
| 4375 | - | ||
| 4376 | - if (new_cl2) { | ||
| 4377 | - var new_cl2_id = new_cl2.split("_")[0]; | ||
| 4378 | - var new_cl2_zbh = new_cl2.split("_")[1]; | ||
| 4379 | - | ||
| 4380 | - if (old_isfb) { // 使用分班判定 | ||
| 4381 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4382 | - if (index < old_isfb_index) { | ||
| 4383 | - obj.cl = new_cl1_id; | ||
| 4384 | - obj.clZbh = new_cl1_zbh; | ||
| 4385 | - } else { | ||
| 4386 | - obj.cl = new_cl2_id; | ||
| 4387 | - obj.clZbh = new_cl2_zbh; | ||
| 4388 | - } | ||
| 4389 | - }); | ||
| 4390 | - | ||
| 4391 | - } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定 | ||
| 4392 | - angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4393 | - if (obj.fcno <= old_firstJCBCFcno) { | ||
| 4394 | - obj.cl = new_cl1_id; | ||
| 4395 | - obj.clZbh = new_cl1_zbh; | ||
| 4396 | - } else { | ||
| 4397 | - obj.cl = new_cl2_id; | ||
| 4398 | - obj.clZbh = new_cl2_zbh; | ||
| 4399 | - } | ||
| 4400 | - }); | ||
| 4401 | - } else { // 使用一半一半班次判定 | ||
| 4402 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4403 | - if (index < old_half_bcs) { | ||
| 4404 | - obj.cl = new_cl1_id; | ||
| 4405 | - obj.clZbh = new_cl1_zbh; | ||
| 4406 | - } else { | ||
| 4407 | - obj.cl = new_cl2_id; | ||
| 4408 | - obj.clZbh = new_cl2_zbh; | ||
| 4409 | - } | ||
| 4410 | - }); | ||
| 4411 | - } | ||
| 4412 | - | ||
| 4413 | - } else { | ||
| 4414 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4415 | - obj.cl = new_cl1_id; | ||
| 4416 | - obj.clZbh = new_cl1_zbh; | ||
| 4417 | - }); | ||
| 4418 | - } | ||
| 4419 | - | ||
| 4420 | - } else { | ||
| 4421 | - // 使用旧的 | ||
| 4422 | - angular.forEach(old_cl, function(value, key) { | ||
| 4423 | - angular.forEach(value, function(i) { | ||
| 4424 | - scope[ctrlAs].ds[i].cl = key.split("_")[0]; | ||
| 4425 | - scope[ctrlAs].ds[i].clZbh = key.split("_")[1]; | ||
| 4426 | - }); | ||
| 4427 | - }); | ||
| 4428 | - } | ||
| 4429 | - }; | ||
| 4430 | - | ||
| 4431 | - /** | ||
| 4432 | - * 刷新驾驶员数据。 | ||
| 4433 | - */ | ||
| 4434 | - scope[ctrlAs].$$internal_refresh_dsdata_j = function() { | ||
| 4435 | - if (new_j1) { | ||
| 4436 | - var new_j1_id = new_j1.split("_")[0]; | ||
| 4437 | - var new_j1_name = new_j1.split("_")[1]; | ||
| 4438 | - var new_j1_gh = new_j1.split("_")[2]; | ||
| 4439 | - | ||
| 4440 | - if (new_j2) { | ||
| 4441 | - var new_j2_id = new_j2.split("_")[0]; | ||
| 4442 | - var new_j2_name = new_j2.split("_")[1]; | ||
| 4443 | - var new_j2_gh = new_j2.split("_")[2]; | ||
| 4444 | - | ||
| 4445 | - if (old_isfb) { // 使用分班判定 | ||
| 4446 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4447 | - if (index < old_isfb_index) { | ||
| 4448 | - obj.j = new_j1_id; | ||
| 4449 | - obj.jGh = new_j1_gh; | ||
| 4450 | - obj.jName = new_j1_name; | ||
| 4451 | - } else { | ||
| 4452 | - obj.j = new_j2_id; | ||
| 4453 | - obj.jGh = new_j2_gh; | ||
| 4454 | - obj.jName = new_j2_name; | ||
| 4455 | - } | ||
| 4456 | - }); | ||
| 4457 | - | ||
| 4458 | - } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定 | ||
| 4459 | - angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4460 | - if (obj.fcno <= old_firstJCBCFcno) { | ||
| 4461 | - obj.j = new_j1_id; | ||
| 4462 | - obj.jGh = new_j1_gh; | ||
| 4463 | - obj.jName = new_j1_name; | ||
| 4464 | - } else { | ||
| 4465 | - obj.j = new_j2_id; | ||
| 4466 | - obj.jGh = new_j2_gh; | ||
| 4467 | - obj.jName = new_j2_name; | ||
| 4468 | - } | ||
| 4469 | - }); | ||
| 4470 | - } else { // 使用一半一半班次判定 | ||
| 4471 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4472 | - if (index < old_half_bcs) { | ||
| 4473 | - obj.j = new_j1_id; | ||
| 4474 | - obj.jGh = new_j1_gh; | ||
| 4475 | - obj.jName = new_j1_name; | ||
| 4476 | - } else { | ||
| 4477 | - obj.j = new_j2_id; | ||
| 4478 | - obj.jGh = new_j2_gh; | ||
| 4479 | - obj.jName = new_j2_name; | ||
| 4480 | - } | ||
| 4481 | - }); | ||
| 4482 | - } | ||
| 4483 | - | ||
| 4484 | - } else { | ||
| 4485 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4486 | - obj.j = new_j1_id; | ||
| 4487 | - obj.jGh = new_j1_gh; | ||
| 4488 | - obj.jName = new_j1_name; | ||
| 4489 | - }); | ||
| 4490 | - } | ||
| 4491 | - | ||
| 4492 | - } else { | ||
| 4493 | - // 使用旧的 | ||
| 4494 | - angular.forEach(old_j, function(value, key) { | ||
| 4495 | - angular.forEach(value, function(i) { | ||
| 4496 | - scope[ctrlAs].ds[i].j = key.split("_")[0]; | ||
| 4497 | - scope[ctrlAs].ds[i].jName = key.split("_")[1]; | ||
| 4498 | - scope[ctrlAs].ds[i].jGh = key.split("_")[2]; | ||
| 4499 | - }); | ||
| 4500 | - }); | ||
| 4501 | - } | ||
| 4502 | - }; | ||
| 4503 | - /** | ||
| 4504 | - * 刷新售票员数据。 | ||
| 4505 | - */ | ||
| 4506 | - scope[ctrlAs].$$internal_refresh_dsdata_s = function() { | ||
| 4507 | - if (new_s1) { | ||
| 4508 | - var new_s1_id = new_s1.split("_")[0]; | ||
| 4509 | - var new_s1_name = new_s1.split("_")[1]; | ||
| 4510 | - var new_s1_gh = new_s1.split("_")[2]; | ||
| 4511 | - | ||
| 4512 | - if (new_s2) { | ||
| 4513 | - var new_s2_id = new_s2.split("_")[0]; | ||
| 4514 | - var new_s2_name = new_s2.split("_")[1]; | ||
| 4515 | - var new_s2_gh = new_s2.split("_")[2]; | ||
| 4516 | - | ||
| 4517 | - if (old_isfb) { // 使用分班判定 | ||
| 4518 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4519 | - if (index < old_isfb_index) { | ||
| 4520 | - obj.s = new_s1_id; | ||
| 4521 | - obj.sGh = new_s1_gh; | ||
| 4522 | - obj.sName = new_s1_name; | ||
| 4523 | - } else { | ||
| 4524 | - obj.s = new_s2_id; | ||
| 4525 | - obj.sGh = new_s2_gh; | ||
| 4526 | - obj.sName = new_s2_name; | ||
| 4527 | - } | ||
| 4528 | - }); | ||
| 4529 | - | ||
| 4530 | - } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定 | ||
| 4531 | - angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4532 | - if (obj.fcno <= old_firstJCBCFcno) { | ||
| 4533 | - obj.s = new_s1_id; | ||
| 4534 | - obj.sGh = new_s1_gh; | ||
| 4535 | - obj.sName = new_s1_name; | ||
| 4536 | - } else { | ||
| 4537 | - obj.s = new_s2_id; | ||
| 4538 | - obj.sGh = new_s2_gh; | ||
| 4539 | - obj.sName = new_s2_name; | ||
| 4540 | - } | ||
| 4541 | - }); | ||
| 4542 | - } else { // 使用一半一半班次判定 | ||
| 4543 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4544 | - if (index < old_half_bcs) { | ||
| 4545 | - obj.s = new_s1_id; | ||
| 4546 | - obj.sGh = new_s1_gh; | ||
| 4547 | - obj.sName = new_s1_name; | ||
| 4548 | - } else { | ||
| 4549 | - obj.s = new_s2_id; | ||
| 4550 | - obj.sGh = new_s2_gh; | ||
| 4551 | - obj.sName = new_s2_name; | ||
| 4552 | - } | ||
| 4553 | - }); | ||
| 4554 | - } | ||
| 4555 | - | ||
| 4556 | - } else { | ||
| 4557 | - angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4558 | - obj.s = new_s1_id; | ||
| 4559 | - obj.sGh = new_s1_gh; | ||
| 4560 | - obj.sName = new_s1_name; | ||
| 4561 | - }); | ||
| 4562 | - } | ||
| 4563 | - | ||
| 4564 | - } else { | ||
| 4565 | - // 先清空 | ||
| 4566 | - angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4567 | - obj.s = undefined; | ||
| 4568 | - obj.sGh = undefined; | ||
| 4569 | - obj.sName = undefined; | ||
| 4570 | - }); | ||
| 4571 | - | ||
| 4572 | - // 使用旧的 | ||
| 4573 | - angular.forEach(old_s, function(value, key) { | ||
| 4574 | - angular.forEach(value, function(i) { | ||
| 4575 | - scope[ctrlAs].ds[i].s = key.split("_")[0]; | ||
| 4576 | - scope[ctrlAs].ds[i].sName = key.split("_")[1]; | ||
| 4577 | - scope[ctrlAs].ds[i].sGh = key.split("_")[2]; | ||
| 4578 | - }); | ||
| 4579 | - }); | ||
| 4580 | - } | ||
| 4581 | - }; | ||
| 4582 | - | ||
| 4583 | - /** | ||
| 4584 | - * 刷新内部数据。 | ||
| 4585 | - */ | ||
| 4586 | - scope[ctrlAs].$$internal_refresh_dsdata = function() { | ||
| 4587 | - // 更新车辆 | ||
| 4588 | - scope[ctrlAs].$$internal_refresh_dsdata_cl(); | ||
| 4589 | - | ||
| 4590 | - // 更新驾驶员 | ||
| 4591 | - scope[ctrlAs].$$internal_refresh_dsdata_j(); | ||
| 4592 | - | ||
| 4593 | - // 更新售票员 | ||
| 4594 | - scope[ctrlAs].$$internal_refresh_dsdata_s(); | ||
| 4595 | - }; | ||
| 4596 | - | ||
| 4597 | - // -------------- 监控function ---------------// | ||
| 4598 | - attr.$observe('cl1', function(value) { | ||
| 4599 | - if (value && value != "") { | ||
| 4600 | - var obj = JSON.parse(value); | ||
| 4601 | - if (obj.id && obj.zbh) { | ||
| 4602 | - new_cl1 = obj.id + "_" + obj.zbh; | ||
| 4603 | - } else { | ||
| 4604 | - new_cl1 = undefined; | ||
| 4605 | - } | ||
| 4606 | - scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4607 | - } | ||
| 4608 | - }); | ||
| 4609 | - | ||
| 4610 | - attr.$observe('cl2', function(value) { | ||
| 4611 | - if (value && value != "") { | ||
| 4612 | - var obj = JSON.parse(value); | ||
| 4613 | - if (obj.id && obj.zbh) { | ||
| 4614 | - new_cl2 = obj.id + "_" + obj.zbh; | ||
| 4615 | - } else { | ||
| 4616 | - new_cl2 = undefined; | ||
| 4617 | - } | ||
| 4618 | - scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4619 | - } | ||
| 4620 | - }); | ||
| 4621 | - | ||
| 4622 | - attr.$observe('j1', function(value) { | ||
| 4623 | - if (value && value != "") { | ||
| 4624 | - var obj = JSON.parse(value); | ||
| 4625 | - if (obj.id && obj.name && obj.jobCode) { | ||
| 4626 | - new_j1 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4627 | - } else { | ||
| 4628 | - new_j1 = undefined; | ||
| 4629 | - } | ||
| 4630 | - scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4631 | - } | ||
| 4632 | - }); | ||
| 4633 | - | ||
| 4634 | - attr.$observe('j2', function(value) { | ||
| 4635 | - if (value && value != "") { | ||
| 4636 | - var obj = JSON.parse(value); | ||
| 4637 | - if (obj.id && obj.name && obj.jobCode) { | ||
| 4638 | - new_j2 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4639 | - } else { | ||
| 4640 | - new_j2 = undefined; | ||
| 4641 | - } | ||
| 4642 | - scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4643 | - } | ||
| 4644 | - }); | ||
| 4645 | - | ||
| 4646 | - attr.$observe('s1', function(value) { | ||
| 4647 | - if (value && value != "") { | ||
| 4648 | - var obj = JSON.parse(value); | ||
| 4649 | - if (obj.id && obj.name && obj.jobCode) { | ||
| 4650 | - new_s1 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4651 | - } else { | ||
| 4652 | - new_s1 = undefined; | ||
| 4653 | - } | ||
| 4654 | - scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4655 | - } | ||
| 4656 | - }); | ||
| 4657 | - | ||
| 4658 | - attr.$observe('s2', function(value) { | ||
| 4659 | - if (value && value != "") { | ||
| 4660 | - var obj = JSON.parse(value); | ||
| 4661 | - if (obj.id && obj.name && obj.jobCode) { | ||
| 4662 | - new_s2 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4663 | - } else { | ||
| 4664 | - new_s2 = undefined; | ||
| 4665 | - } | ||
| 4666 | - scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4667 | - } | ||
| 4668 | - }); | ||
| 4669 | - | ||
| 4670 | - scope.$watch( | ||
| 4671 | - function() { | ||
| 4672 | - return scope[ctrlAs].ds; | ||
| 4673 | - }, | ||
| 4674 | - function(newValue, oldValue) { | ||
| 4675 | - if (newValue && newValue.length > 0) { | ||
| 4676 | - | ||
| 4677 | - var j1 = newValue[0].j; | ||
| 4678 | - | ||
| 4679 | - angular.forEach(newValue, function(obj, index) { | ||
| 4680 | - var k1 = obj.cl + "_" + obj.clZbh; | ||
| 4681 | - var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh; | ||
| 4682 | - var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh; | ||
| 4683 | - | ||
| 4684 | - if (!old_cl[k1]) { | ||
| 4685 | - old_cl[k1] = []; | ||
| 4686 | - } | ||
| 4687 | - if (!old_j[k2] && k2) { | ||
| 4688 | - old_j[k2] = []; | ||
| 4689 | - } | ||
| 4690 | - if (!old_s[k3] && k3) { | ||
| 4691 | - old_s[k3] = []; | ||
| 4692 | - } | ||
| 4693 | - | ||
| 4694 | - // 闭包 | ||
| 4695 | - (function(i) { | ||
| 4696 | - old_cl[k1].push(i); | ||
| 4697 | - if (k2) { | ||
| 4698 | - old_j[k2].push(i); | ||
| 4699 | - } | ||
| 4700 | - if (k3) { | ||
| 4701 | - old_s[k3].push(i); | ||
| 4702 | - } | ||
| 4703 | - })(index); | ||
| 4704 | - | ||
| 4705 | - // 判断是否分班 | ||
| 4706 | - if (j1 != obj.j && !old_isfb) { | ||
| 4707 | - old_isfb = true; | ||
| 4708 | - old_isfb_index = index; | ||
| 4709 | - } | ||
| 4710 | - | ||
| 4711 | - // 判断进出场 | ||
| 4712 | - if (obj.bcType == 'in' && !old_hasJCBC) { | ||
| 4713 | - old_hasJCBC = true; | ||
| 4714 | - old_firstJCBCFcno = obj.fcno; | ||
| 4715 | - } | ||
| 4716 | - }); | ||
| 4717 | - | ||
| 4718 | - old_max_fcno = newValue[newValue.length - 1].fcno; | ||
| 4719 | - old_half_bcs = newValue.length / 2; | ||
| 4720 | - | ||
| 4721 | - // 可以用resource封装一下 | ||
| 4722 | - // TODO: | ||
| 4723 | - } | ||
| 4724 | - } | ||
| 4725 | - ); | ||
| 4726 | - } | ||
| 4727 | - } | ||
| 4728 | - } | ||
| 4729 | - }; | ||
| 4730 | - } | ||
| 4731 | - ] | 4304 | +/** |
| 4305 | + * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能 | ||
| 4306 | + * name(必须),控件的名字 | ||
| 4307 | + * ds,外部数据源 | ||
| 4308 | + * cl1,车辆1属性 | ||
| 4309 | + * cl2,车辆2属性 | ||
| 4310 | + * j1,驾驶员1属性 | ||
| 4311 | + * j2,驾驶员2属性 | ||
| 4312 | + * s1,售票员1属性 | ||
| 4313 | + * s2,售票员2属性 | ||
| 4314 | + */ | ||
| 4315 | +angular.module('ScheduleApp').directive( | ||
| 4316 | + 'saPlaninfoedit', | ||
| 4317 | + [ | ||
| 4318 | + function() { | ||
| 4319 | + return { | ||
| 4320 | + restrict: 'E', | ||
| 4321 | + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html', | ||
| 4322 | + scope: { // 独立作用域 | ||
| 4323 | + ds: '=ngModel' | ||
| 4324 | + }, | ||
| 4325 | + controllerAs: '$saPlanInfoEditCtrl', | ||
| 4326 | + bindToController: true, | ||
| 4327 | + controller: function() { | ||
| 4328 | + //var self = this; | ||
| 4329 | + | ||
| 4330 | + }, | ||
| 4331 | + | ||
| 4332 | + compile: function(tElem, tAttrs) { | ||
| 4333 | + // 获取属性 | ||
| 4334 | + var $attr_name = tAttrs["name"]; // 控件的名字 | ||
| 4335 | + if (!$attr_name) { | ||
| 4336 | + throw {msg: "saPlaninfoedit指令name属性不能为空"}; | ||
| 4337 | + } | ||
| 4338 | + | ||
| 4339 | + // 内部controlAs名字 | ||
| 4340 | + var ctrlAs = '$saPlanInfoEditCtrl'; | ||
| 4341 | + | ||
| 4342 | + | ||
| 4343 | + // 内部变量,原始车辆,人员数据 | ||
| 4344 | + var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组 | ||
| 4345 | + var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组 | ||
| 4346 | + var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组 | ||
| 4347 | + var old_isfb = false; // 是否有分班 | ||
| 4348 | + var old_isfb_index = 0; // 分班开始索引 | ||
| 4349 | + var old_hasJCBC = false; // 是否有进场班次 | ||
| 4350 | + var old_max_fcno = 0; // 最大发车顺序号 | ||
| 4351 | + var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号 | ||
| 4352 | + var old_half_bcs = 0; // 一般的班次数量 | ||
| 4353 | + | ||
| 4354 | + // 内部变量,变更的车辆,变更的人员 | ||
| 4355 | + var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号) | ||
| 4356 | + var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号) | ||
| 4357 | + var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号) | ||
| 4358 | + var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号) | ||
| 4359 | + var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号) | ||
| 4360 | + var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号) | ||
| 4361 | + | ||
| 4362 | + return { | ||
| 4363 | + pre: function(scope, element, attr) { | ||
| 4364 | + | ||
| 4365 | + }, | ||
| 4366 | + post: function(scope, element, attr) { | ||
| 4367 | + | ||
| 4368 | + /** | ||
| 4369 | + * 刷新车辆数据。 | ||
| 4370 | + */ | ||
| 4371 | + scope[ctrlAs].$$internal_refresh_dsdata_cl = function() { | ||
| 4372 | + if (new_cl1) { | ||
| 4373 | + var new_cl1_id = new_cl1.split("_")[0]; | ||
| 4374 | + var new_cl1_zbh = new_cl1.split("_")[1]; | ||
| 4375 | + | ||
| 4376 | + if (new_cl2) { | ||
| 4377 | + var new_cl2_id = new_cl2.split("_")[0]; | ||
| 4378 | + var new_cl2_zbh = new_cl2.split("_")[1]; | ||
| 4379 | + | ||
| 4380 | + if (old_isfb) { // 使用分班判定 | ||
| 4381 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4382 | + if (index < old_isfb_index) { | ||
| 4383 | + obj.cl = new_cl1_id; | ||
| 4384 | + obj.clZbh = new_cl1_zbh; | ||
| 4385 | + } else { | ||
| 4386 | + obj.cl = new_cl2_id; | ||
| 4387 | + obj.clZbh = new_cl2_zbh; | ||
| 4388 | + } | ||
| 4389 | + }); | ||
| 4390 | + | ||
| 4391 | + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定 | ||
| 4392 | + angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4393 | + if (obj.fcno <= old_firstJCBCFcno) { | ||
| 4394 | + obj.cl = new_cl1_id; | ||
| 4395 | + obj.clZbh = new_cl1_zbh; | ||
| 4396 | + } else { | ||
| 4397 | + obj.cl = new_cl2_id; | ||
| 4398 | + obj.clZbh = new_cl2_zbh; | ||
| 4399 | + } | ||
| 4400 | + }); | ||
| 4401 | + } else { // 使用一半一半班次判定 | ||
| 4402 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4403 | + if (index < old_half_bcs) { | ||
| 4404 | + obj.cl = new_cl1_id; | ||
| 4405 | + obj.clZbh = new_cl1_zbh; | ||
| 4406 | + } else { | ||
| 4407 | + obj.cl = new_cl2_id; | ||
| 4408 | + obj.clZbh = new_cl2_zbh; | ||
| 4409 | + } | ||
| 4410 | + }); | ||
| 4411 | + } | ||
| 4412 | + | ||
| 4413 | + } else { | ||
| 4414 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4415 | + obj.cl = new_cl1_id; | ||
| 4416 | + obj.clZbh = new_cl1_zbh; | ||
| 4417 | + }); | ||
| 4418 | + } | ||
| 4419 | + | ||
| 4420 | + } else { | ||
| 4421 | + // 使用旧的 | ||
| 4422 | + angular.forEach(old_cl, function(value, key) { | ||
| 4423 | + angular.forEach(value, function(i) { | ||
| 4424 | + scope[ctrlAs].ds[i].cl = key.split("_")[0]; | ||
| 4425 | + scope[ctrlAs].ds[i].clZbh = key.split("_")[1]; | ||
| 4426 | + }); | ||
| 4427 | + }); | ||
| 4428 | + } | ||
| 4429 | + }; | ||
| 4430 | + | ||
| 4431 | + /** | ||
| 4432 | + * 刷新驾驶员数据。 | ||
| 4433 | + */ | ||
| 4434 | + scope[ctrlAs].$$internal_refresh_dsdata_j = function() { | ||
| 4435 | + if (new_j1) { | ||
| 4436 | + var new_j1_id = new_j1.split("_")[0]; | ||
| 4437 | + var new_j1_name = new_j1.split("_")[1]; | ||
| 4438 | + var new_j1_gh = new_j1.split("_")[2]; | ||
| 4439 | + | ||
| 4440 | + if (new_j2) { | ||
| 4441 | + var new_j2_id = new_j2.split("_")[0]; | ||
| 4442 | + var new_j2_name = new_j2.split("_")[1]; | ||
| 4443 | + var new_j2_gh = new_j2.split("_")[2]; | ||
| 4444 | + | ||
| 4445 | + if (old_isfb) { // 使用分班判定 | ||
| 4446 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4447 | + if (index < old_isfb_index) { | ||
| 4448 | + obj.j = new_j1_id; | ||
| 4449 | + obj.jGh = new_j1_gh; | ||
| 4450 | + obj.jName = new_j1_name; | ||
| 4451 | + } else { | ||
| 4452 | + obj.j = new_j2_id; | ||
| 4453 | + obj.jGh = new_j2_gh; | ||
| 4454 | + obj.jName = new_j2_name; | ||
| 4455 | + } | ||
| 4456 | + }); | ||
| 4457 | + | ||
| 4458 | + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定 | ||
| 4459 | + angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4460 | + if (obj.fcno <= old_firstJCBCFcno) { | ||
| 4461 | + obj.j = new_j1_id; | ||
| 4462 | + obj.jGh = new_j1_gh; | ||
| 4463 | + obj.jName = new_j1_name; | ||
| 4464 | + } else { | ||
| 4465 | + obj.j = new_j2_id; | ||
| 4466 | + obj.jGh = new_j2_gh; | ||
| 4467 | + obj.jName = new_j2_name; | ||
| 4468 | + } | ||
| 4469 | + }); | ||
| 4470 | + } else { // 使用一半一半班次判定 | ||
| 4471 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4472 | + if (index < old_half_bcs) { | ||
| 4473 | + obj.j = new_j1_id; | ||
| 4474 | + obj.jGh = new_j1_gh; | ||
| 4475 | + obj.jName = new_j1_name; | ||
| 4476 | + } else { | ||
| 4477 | + obj.j = new_j2_id; | ||
| 4478 | + obj.jGh = new_j2_gh; | ||
| 4479 | + obj.jName = new_j2_name; | ||
| 4480 | + } | ||
| 4481 | + }); | ||
| 4482 | + } | ||
| 4483 | + | ||
| 4484 | + } else { | ||
| 4485 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4486 | + obj.j = new_j1_id; | ||
| 4487 | + obj.jGh = new_j1_gh; | ||
| 4488 | + obj.jName = new_j1_name; | ||
| 4489 | + }); | ||
| 4490 | + } | ||
| 4491 | + | ||
| 4492 | + } else { | ||
| 4493 | + // 使用旧的 | ||
| 4494 | + angular.forEach(old_j, function(value, key) { | ||
| 4495 | + angular.forEach(value, function(i) { | ||
| 4496 | + scope[ctrlAs].ds[i].j = key.split("_")[0]; | ||
| 4497 | + scope[ctrlAs].ds[i].jName = key.split("_")[1]; | ||
| 4498 | + scope[ctrlAs].ds[i].jGh = key.split("_")[2]; | ||
| 4499 | + }); | ||
| 4500 | + }); | ||
| 4501 | + } | ||
| 4502 | + }; | ||
| 4503 | + /** | ||
| 4504 | + * 刷新售票员数据。 | ||
| 4505 | + */ | ||
| 4506 | + scope[ctrlAs].$$internal_refresh_dsdata_s = function() { | ||
| 4507 | + if (new_s1) { | ||
| 4508 | + var new_s1_id = new_s1.split("_")[0]; | ||
| 4509 | + var new_s1_name = new_s1.split("_")[1]; | ||
| 4510 | + var new_s1_gh = new_s1.split("_")[2]; | ||
| 4511 | + | ||
| 4512 | + if (new_s2) { | ||
| 4513 | + var new_s2_id = new_s2.split("_")[0]; | ||
| 4514 | + var new_s2_name = new_s2.split("_")[1]; | ||
| 4515 | + var new_s2_gh = new_s2.split("_")[2]; | ||
| 4516 | + | ||
| 4517 | + if (old_isfb) { // 使用分班判定 | ||
| 4518 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4519 | + if (index < old_isfb_index) { | ||
| 4520 | + obj.s = new_s1_id; | ||
| 4521 | + obj.sGh = new_s1_gh; | ||
| 4522 | + obj.sName = new_s1_name; | ||
| 4523 | + } else { | ||
| 4524 | + obj.s = new_s2_id; | ||
| 4525 | + obj.sGh = new_s2_gh; | ||
| 4526 | + obj.sName = new_s2_name; | ||
| 4527 | + } | ||
| 4528 | + }); | ||
| 4529 | + | ||
| 4530 | + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定 | ||
| 4531 | + angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4532 | + if (obj.fcno <= old_firstJCBCFcno) { | ||
| 4533 | + obj.s = new_s1_id; | ||
| 4534 | + obj.sGh = new_s1_gh; | ||
| 4535 | + obj.sName = new_s1_name; | ||
| 4536 | + } else { | ||
| 4537 | + obj.s = new_s2_id; | ||
| 4538 | + obj.sGh = new_s2_gh; | ||
| 4539 | + obj.sName = new_s2_name; | ||
| 4540 | + } | ||
| 4541 | + }); | ||
| 4542 | + } else { // 使用一半一半班次判定 | ||
| 4543 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4544 | + if (index < old_half_bcs) { | ||
| 4545 | + obj.s = new_s1_id; | ||
| 4546 | + obj.sGh = new_s1_gh; | ||
| 4547 | + obj.sName = new_s1_name; | ||
| 4548 | + } else { | ||
| 4549 | + obj.s = new_s2_id; | ||
| 4550 | + obj.sGh = new_s2_gh; | ||
| 4551 | + obj.sName = new_s2_name; | ||
| 4552 | + } | ||
| 4553 | + }); | ||
| 4554 | + } | ||
| 4555 | + | ||
| 4556 | + } else { | ||
| 4557 | + angular.forEach(scope[ctrlAs].ds, function(obj, index) { | ||
| 4558 | + obj.s = new_s1_id; | ||
| 4559 | + obj.sGh = new_s1_gh; | ||
| 4560 | + obj.sName = new_s1_name; | ||
| 4561 | + }); | ||
| 4562 | + } | ||
| 4563 | + | ||
| 4564 | + } else { | ||
| 4565 | + // 先清空 | ||
| 4566 | + angular.forEach(scope[ctrlAs].ds, function(obj) { | ||
| 4567 | + obj.s = undefined; | ||
| 4568 | + obj.sGh = undefined; | ||
| 4569 | + obj.sName = undefined; | ||
| 4570 | + }); | ||
| 4571 | + | ||
| 4572 | + // 使用旧的 | ||
| 4573 | + angular.forEach(old_s, function(value, key) { | ||
| 4574 | + angular.forEach(value, function(i) { | ||
| 4575 | + scope[ctrlAs].ds[i].s = key.split("_")[0]; | ||
| 4576 | + scope[ctrlAs].ds[i].sName = key.split("_")[1]; | ||
| 4577 | + scope[ctrlAs].ds[i].sGh = key.split("_")[2]; | ||
| 4578 | + }); | ||
| 4579 | + }); | ||
| 4580 | + } | ||
| 4581 | + }; | ||
| 4582 | + | ||
| 4583 | + /** | ||
| 4584 | + * 刷新内部数据。 | ||
| 4585 | + */ | ||
| 4586 | + scope[ctrlAs].$$internal_refresh_dsdata = function() { | ||
| 4587 | + // 更新车辆 | ||
| 4588 | + scope[ctrlAs].$$internal_refresh_dsdata_cl(); | ||
| 4589 | + | ||
| 4590 | + // 更新驾驶员 | ||
| 4591 | + scope[ctrlAs].$$internal_refresh_dsdata_j(); | ||
| 4592 | + | ||
| 4593 | + // 更新售票员 | ||
| 4594 | + scope[ctrlAs].$$internal_refresh_dsdata_s(); | ||
| 4595 | + }; | ||
| 4596 | + | ||
| 4597 | + // -------------- 监控function ---------------// | ||
| 4598 | + attr.$observe('cl1', function(value) { | ||
| 4599 | + if (value && value != "") { | ||
| 4600 | + var obj = JSON.parse(value); | ||
| 4601 | + if (obj.id && obj.zbh) { | ||
| 4602 | + new_cl1 = obj.id + "_" + obj.zbh; | ||
| 4603 | + } else { | ||
| 4604 | + new_cl1 = undefined; | ||
| 4605 | + } | ||
| 4606 | + scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4607 | + } | ||
| 4608 | + }); | ||
| 4609 | + | ||
| 4610 | + attr.$observe('cl2', function(value) { | ||
| 4611 | + if (value && value != "") { | ||
| 4612 | + var obj = JSON.parse(value); | ||
| 4613 | + if (obj.id && obj.zbh) { | ||
| 4614 | + new_cl2 = obj.id + "_" + obj.zbh; | ||
| 4615 | + } else { | ||
| 4616 | + new_cl2 = undefined; | ||
| 4617 | + } | ||
| 4618 | + scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4619 | + } | ||
| 4620 | + }); | ||
| 4621 | + | ||
| 4622 | + attr.$observe('j1', function(value) { | ||
| 4623 | + if (value && value != "") { | ||
| 4624 | + var obj = JSON.parse(value); | ||
| 4625 | + if (obj.id && obj.name && obj.jobCode) { | ||
| 4626 | + new_j1 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4627 | + } else { | ||
| 4628 | + new_j1 = undefined; | ||
| 4629 | + } | ||
| 4630 | + scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4631 | + } | ||
| 4632 | + }); | ||
| 4633 | + | ||
| 4634 | + attr.$observe('j2', function(value) { | ||
| 4635 | + if (value && value != "") { | ||
| 4636 | + var obj = JSON.parse(value); | ||
| 4637 | + if (obj.id && obj.name && obj.jobCode) { | ||
| 4638 | + new_j2 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4639 | + } else { | ||
| 4640 | + new_j2 = undefined; | ||
| 4641 | + } | ||
| 4642 | + scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4643 | + } | ||
| 4644 | + }); | ||
| 4645 | + | ||
| 4646 | + attr.$observe('s1', function(value) { | ||
| 4647 | + if (value && value != "") { | ||
| 4648 | + var obj = JSON.parse(value); | ||
| 4649 | + if (obj.id && obj.name && obj.jobCode) { | ||
| 4650 | + new_s1 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4651 | + } else { | ||
| 4652 | + new_s1 = undefined; | ||
| 4653 | + } | ||
| 4654 | + scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4655 | + } | ||
| 4656 | + }); | ||
| 4657 | + | ||
| 4658 | + attr.$observe('s2', function(value) { | ||
| 4659 | + if (value && value != "") { | ||
| 4660 | + var obj = JSON.parse(value); | ||
| 4661 | + if (obj.id && obj.name && obj.jobCode) { | ||
| 4662 | + new_s2 = obj.id + "_" + obj.name + "_" + obj.jobCode; | ||
| 4663 | + } else { | ||
| 4664 | + new_s2 = undefined; | ||
| 4665 | + } | ||
| 4666 | + scope[ctrlAs].$$internal_refresh_dsdata(); | ||
| 4667 | + } | ||
| 4668 | + }); | ||
| 4669 | + | ||
| 4670 | + scope.$watch( | ||
| 4671 | + function() { | ||
| 4672 | + return scope[ctrlAs].ds; | ||
| 4673 | + }, | ||
| 4674 | + function(newValue, oldValue) { | ||
| 4675 | + if (newValue && newValue.length > 0) { | ||
| 4676 | + | ||
| 4677 | + var j1 = newValue[0].j; | ||
| 4678 | + | ||
| 4679 | + angular.forEach(newValue, function(obj, index) { | ||
| 4680 | + var k1 = obj.cl + "_" + obj.clZbh; | ||
| 4681 | + var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh; | ||
| 4682 | + var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh; | ||
| 4683 | + | ||
| 4684 | + if (!old_cl[k1]) { | ||
| 4685 | + old_cl[k1] = []; | ||
| 4686 | + } | ||
| 4687 | + if (!old_j[k2] && k2) { | ||
| 4688 | + old_j[k2] = []; | ||
| 4689 | + } | ||
| 4690 | + if (!old_s[k3] && k3) { | ||
| 4691 | + old_s[k3] = []; | ||
| 4692 | + } | ||
| 4693 | + | ||
| 4694 | + // 闭包 | ||
| 4695 | + (function(i) { | ||
| 4696 | + old_cl[k1].push(i); | ||
| 4697 | + if (k2) { | ||
| 4698 | + old_j[k2].push(i); | ||
| 4699 | + } | ||
| 4700 | + if (k3) { | ||
| 4701 | + old_s[k3].push(i); | ||
| 4702 | + } | ||
| 4703 | + })(index); | ||
| 4704 | + | ||
| 4705 | + // 判断是否分班 | ||
| 4706 | + if (j1 != obj.j && !old_isfb) { | ||
| 4707 | + old_isfb = true; | ||
| 4708 | + old_isfb_index = index; | ||
| 4709 | + } | ||
| 4710 | + | ||
| 4711 | + // 判断进出场 | ||
| 4712 | + if (obj.bcType == 'in' && !old_hasJCBC) { | ||
| 4713 | + old_hasJCBC = true; | ||
| 4714 | + old_firstJCBCFcno = obj.fcno; | ||
| 4715 | + } | ||
| 4716 | + }); | ||
| 4717 | + | ||
| 4718 | + old_max_fcno = newValue[newValue.length - 1].fcno; | ||
| 4719 | + old_half_bcs = newValue.length / 2; | ||
| 4720 | + | ||
| 4721 | + // 可以用resource封装一下 | ||
| 4722 | + // TODO: | ||
| 4723 | + } | ||
| 4724 | + } | ||
| 4725 | + ); | ||
| 4726 | + } | ||
| 4727 | + } | ||
| 4728 | + } | ||
| 4729 | + }; | ||
| 4730 | + } | ||
| 4731 | + ] | ||
| 4732 | ); | 4732 | ); |
| 4733 | \ No newline at end of file | 4733 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| @@ -558,7 +558,7 @@ angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource | @@ -558,7 +558,7 @@ angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource | ||
| 558 | return { | 558 | return { |
| 559 | rest: $resource( | 559 | rest: $resource( |
| 560 | '/sr1fc/:id', | 560 | '/sr1fc/:id', |
| 561 | - {order: 'xl.id,updateDate', direction: 'ASC,DESC', id: '@id'}, | 561 | + {order: 'xl.id,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'}, |
| 562 | { | 562 | { |
| 563 | list: { | 563 | list: { |
| 564 | method: 'GET', | 564 | method: 'GET', |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| @@ -859,63 +859,63 @@ ScheduleApp.config([ | @@ -859,63 +859,63 @@ ScheduleApp.config([ | ||
| 859 | 859 | ||
| 860 | } | 860 | } |
| 861 | ]); | 861 | ]); |
| 862 | -// ui route 配置 | ||
| 863 | - | ||
| 864 | -/** 排班调度值勤日报配置route */ | ||
| 865 | -ScheduleApp.config([ | ||
| 866 | - '$stateProvider', | ||
| 867 | - '$urlRouterProvider', | ||
| 868 | - function($stateProvider, $urlRouterProvider) { | ||
| 869 | - // 默认路由 | ||
| 870 | - //$urlRouterProvider.otherwise('/busConfig.html'); | ||
| 871 | - | ||
| 872 | - $stateProvider | ||
| 873 | - .state("schedulePlanReportExtManage", { | ||
| 874 | - url: '/schedulePlanReportExtManage', | ||
| 875 | - views: { | ||
| 876 | - "": { | ||
| 877 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/index.html' | ||
| 878 | - }, | ||
| 879 | - "schedulePlanReportExtManage_list@schedulePlanReportExtManage": { | ||
| 880 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html' | ||
| 881 | - } | ||
| 882 | - }, | ||
| 883 | - | ||
| 884 | - resolve: { | ||
| 885 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 886 | - return $ocLazyLoad.load({ | ||
| 887 | - name: 'schedulePlanManage_module', | ||
| 888 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 889 | - files: [ | ||
| 890 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 891 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 892 | - "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js" | ||
| 893 | - ] | ||
| 894 | - }); | ||
| 895 | - }] | ||
| 896 | - } | ||
| 897 | - }) | ||
| 898 | - .state("schedulePlanInfoExtFormManage_edit", { // 修改套跑form | ||
| 899 | - url: '/schedulePlanInfoExtFormManage_edit/:xlId/:xlName/:sd/:lpId/:lpName', | ||
| 900 | - views: { | ||
| 901 | - "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html'} | ||
| 902 | - }, | ||
| 903 | - resolve: { | ||
| 904 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 905 | - return $ocLazyLoad.load({ | ||
| 906 | - name: 'schedulePlanManage_module', | ||
| 907 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 908 | - files: [ | ||
| 909 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 910 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 911 | - "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js" | ||
| 912 | - ] | ||
| 913 | - }); | ||
| 914 | - }] | ||
| 915 | - } | ||
| 916 | - }); | ||
| 917 | - | ||
| 918 | - } | 862 | +// ui route 配置 |
| 863 | + | ||
| 864 | +/** 排班调度值勤日报配置route */ | ||
| 865 | +ScheduleApp.config([ | ||
| 866 | + '$stateProvider', | ||
| 867 | + '$urlRouterProvider', | ||
| 868 | + function($stateProvider, $urlRouterProvider) { | ||
| 869 | + // 默认路由 | ||
| 870 | + //$urlRouterProvider.otherwise('/busConfig.html'); | ||
| 871 | + | ||
| 872 | + $stateProvider | ||
| 873 | + .state("schedulePlanReportExtManage", { | ||
| 874 | + url: '/schedulePlanReportExtManage', | ||
| 875 | + views: { | ||
| 876 | + "": { | ||
| 877 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/index.html' | ||
| 878 | + }, | ||
| 879 | + "schedulePlanReportExtManage_list@schedulePlanReportExtManage": { | ||
| 880 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html' | ||
| 881 | + } | ||
| 882 | + }, | ||
| 883 | + | ||
| 884 | + resolve: { | ||
| 885 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 886 | + return $ocLazyLoad.load({ | ||
| 887 | + name: 'schedulePlanManage_module', | ||
| 888 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 889 | + files: [ | ||
| 890 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 891 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 892 | + "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js" | ||
| 893 | + ] | ||
| 894 | + }); | ||
| 895 | + }] | ||
| 896 | + } | ||
| 897 | + }) | ||
| 898 | + .state("schedulePlanInfoExtFormManage_edit", { // 修改套跑form | ||
| 899 | + url: '/schedulePlanInfoExtFormManage_edit/:xlId/:xlName/:sd/:lpId/:lpName', | ||
| 900 | + views: { | ||
| 901 | + "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html'} | ||
| 902 | + }, | ||
| 903 | + resolve: { | ||
| 904 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 905 | + return $ocLazyLoad.load({ | ||
| 906 | + name: 'schedulePlanManage_module', | ||
| 907 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 908 | + files: [ | ||
| 909 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 910 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 911 | + "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js" | ||
| 912 | + ] | ||
| 913 | + }); | ||
| 914 | + }] | ||
| 915 | + } | ||
| 916 | + }); | ||
| 917 | + | ||
| 918 | + } | ||
| 919 | ]); | 919 | ]); |
| 920 | // ui route 配置 | 920 | // ui route 配置 |
| 921 | 921 |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/list.html
| @@ -7,8 +7,8 @@ | @@ -7,8 +7,8 @@ | ||
| 7 | <th style="width: 50px;">序号</th> | 7 | <th style="width: 50px;">序号</th> |
| 8 | <th style="width: 150px;">线路</th> | 8 | <th style="width: 150px;">线路</th> |
| 9 | <th style="width: 150px;">内部编号</th> | 9 | <th style="width: 150px;">内部编号</th> |
| 10 | + <th style="width: 150px;">设备编号</th> | ||
| 10 | <th style="width: 150px;">启用日期</th> | 11 | <th style="width: 150px;">启用日期</th> |
| 11 | - <th style="width: 150px;">终止日期</th> | ||
| 12 | <th >停车点</th> | 12 | <th >停车点</th> |
| 13 | <th style="width: 80px;" >状态</th> | 13 | <th style="width: 80px;" >状态</th> |
| 14 | <th style="width: 21%">操作</th> | 14 | <th style="width: 21%">操作</th> |
| @@ -67,10 +67,10 @@ | @@ -67,10 +67,10 @@ | ||
| 67 | <span ng-bind="info.cl.insideCode"></span> | 67 | <span ng-bind="info.cl.insideCode"></span> |
| 68 | </td> | 68 | </td> |
| 69 | <td> | 69 | <td> |
| 70 | - <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> | 70 | + <span ng-bind="info.cl.equipmentCode"></span> |
| 71 | </td> | 71 | </td> |
| 72 | <td> | 72 | <td> |
| 73 | - <span ng-bind="info.zzrq | date: 'yyyy-MM-dd'"></span> | 73 | + <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> |
| 74 | </td> | 74 | </td> |
| 75 | <td> | 75 | <td> |
| 76 | <span ng-bind="info.tcd"></span> | 76 | <span ng-bind="info.tcd"></span> |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
| @@ -33,7 +33,11 @@ | @@ -33,7 +33,11 @@ | ||
| 33 | </td> | 33 | </td> |
| 34 | <td></td> | 34 | <td></td> |
| 35 | <td></td> | 35 | <td></td> |
| 36 | - <td></td> | 36 | + <td> |
| 37 | + <input type="text" class="form-control form-filter input-sm" | ||
| 38 | + ng-model="ctrl.searchCondition()['carConfigInfo.cl.insideCode_like']" | ||
| 39 | + placeholder="车辆自编号..."/> | ||
| 40 | + </td> | ||
| 37 | <td></td> | 41 | <td></td> |
| 38 | <td></td> | 42 | <td></td> |
| 39 | <td></td> | 43 | <td></td> |
| @@ -60,9 +64,18 @@ | @@ -60,9 +64,18 @@ | ||
| 60 | <span ng-bind="info.xl.name"></span> | 64 | <span ng-bind="info.xl.name"></span> |
| 61 | </td> | 65 | </td> |
| 62 | <td> | 66 | <td> |
| 63 | - <span ng-bind="info.updateBy.userName"></span> | ||
| 64 | - / | ||
| 65 | - <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span> | 67 | + <div> |
| 68 | + <a href="#"> | ||
| 69 | + <span ng-bind="info.updateBy.userName"></span> | ||
| 70 | + </a> | ||
| 71 | + </div> | ||
| 72 | + <div> | ||
| 73 | + <a href="#"> | ||
| 74 | + <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span> | ||
| 75 | + </a> | ||
| 76 | + </div> | ||
| 77 | + | ||
| 78 | + | ||
| 66 | </td> | 79 | </td> |
| 67 | <td> | 80 | <td> |
| 68 | <span ng-bind="info.qyrq | date: 'yyyy-MM-dd '"></span> | 81 | <span ng-bind="info.qyrq | date: 'yyyy-MM-dd '"></span> |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/service.js
| @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource | @@ -3,7 +3,7 @@ angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource | ||
| 3 | return { | 3 | return { |
| 4 | rest: $resource( | 4 | rest: $resource( |
| 5 | '/sr1fc/:id', | 5 | '/sr1fc/:id', |
| 6 | - {order: 'xl.id,updateDate', direction: 'ASC,DESC', id: '@id'}, | 6 | + {order: 'xl.id,updateDate,carConfigInfo.cl.insideCode', direction: 'ASC,DESC,ASC', id: '@id'}, |
| 7 | { | 7 | { |
| 8 | list: { | 8 | list: { |
| 9 | method: 'GET', | 9 | method: 'GET', |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| @@ -42,7 +42,7 @@ var gb_northToolbar = (function () { | @@ -42,7 +42,7 @@ var gb_northToolbar = (function () { | ||
| 42 | //exit | 42 | //exit |
| 43 | $('.north .north-toolbar .exit-system').on('click', function () { | 43 | $('.north .north-toolbar .exit-system').on('click', function () { |
| 44 | //关闭websocket 连接 | 44 | //关闭websocket 连接 |
| 45 | - gb_sch_websocket.sock().close(); | 45 | + gb_sch_websocket.sock().close(1000, '退出线调'); |
| 46 | window.location.href = '/pages/control/lineallot/allot.html'; | 46 | window.location.href = '/pages/control/lineallot/allot.html'; |
| 47 | }); | 47 | }); |
| 48 | 48 |
src/test/resources/testdata/problem.properties
src/test/resources/testdata/test6.txt
0 → 100644
| 1 | +select * from bsth_c_s_sp_rule_rst; | ||
| 2 | + | ||
| 3 | +select * from bsth_c_s_sp_rule_rst | ||
| 4 | +where qyrq is null; | ||
| 5 | + | ||
| 6 | +update bsth_c_s_sp_rule_rst a | ||
| 7 | +set a.qyrq = (select qyrq from bsth_c_s_sr1_flat where id = a.rule_id) | ||
| 8 | +where a.qyrq is null; | ||
| 9 | + | ||
| 10 | +970 | ||
| 11 | +789 | ||
| 12 | +604 | ||
| 13 | +985 | ||
| 14 | +北蔡2路 | ||
| 15 | +1048 | ||
| 16 | +1118 | ||
| 17 | +上南二分通勤 | ||
| 0 | \ No newline at end of file | 18 | \ No newline at end of file |