Commit 4ac7ebf238cc1ada53eab87fd0322dc5dde888fc
1 parent
59ae938e
update...
Showing
14 changed files
with
875 additions
and
315 deletions
src/main/java/com/bsth/controller/BaseController.java
| @@ -24,37 +24,34 @@ import java.util.List; | @@ -24,37 +24,34 @@ import java.util.List; | ||
| 24 | import java.util.Map; | 24 | import java.util.Map; |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | - * | ||
| 28 | - * @ClassName: BaseController | ||
| 29 | - * @Description: TODO(基础的Controller实现) | ||
| 30 | - * @author PanZhao | ||
| 31 | - * @date 2016年3月17日 下午12:44:06 | ||
| 32 | - * | ||
| 33 | * @param <T> | 27 | * @param <T> |
| 34 | * @param <ID> 主键类型 | 28 | * @param <ID> 主键类型 |
| 29 | + * @author PanZhao | ||
| 30 | + * @ClassName: BaseController | ||
| 31 | + * @Description: TODO(基础的Controller实现) | ||
| 32 | + * @date 2016年3月17日 下午12:44:06 | ||
| 35 | */ | 33 | */ |
| 36 | public class BaseController<T, ID extends Serializable> { | 34 | public class BaseController<T, ID extends Serializable> { |
| 37 | - | ||
| 38 | - @Autowired | ||
| 39 | - protected BaseService<T, ID> baseService; | 35 | + |
| 36 | + @Autowired | ||
| 37 | + protected BaseService<T, ID> baseService; | ||
| 40 | @Autowired | 38 | @Autowired |
| 41 | DataImportExportService dataImportExportService; | 39 | DataImportExportService dataImportExportService; |
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * | ||
| 45 | - * @Title: list | ||
| 46 | - * @Description: TODO(多条件分页查询) | ||
| 47 | - * @param @param map 查询条件 | ||
| 48 | - * @param @param page 页码 | ||
| 49 | - * @param @param size 每页显示数量 | ||
| 50 | - * @throws | ||
| 51 | - */ | ||
| 52 | - @RequestMapping(method = RequestMethod.GET) | ||
| 53 | - public Page<T> list(@RequestParam Map<String, Object> map, | ||
| 54 | - @RequestParam(defaultValue = "0") int page, | ||
| 55 | - @RequestParam(defaultValue = "10") int size, | ||
| 56 | - @RequestParam(defaultValue = "id") String order, | ||
| 57 | - @RequestParam(defaultValue = "DESC") String direction){ | 40 | + |
| 41 | + /** | ||
| 42 | + * @param @param map 查询条件 | ||
| 43 | + * @param @param page 页码 | ||
| 44 | + * @param @param size 每页显示数量 | ||
| 45 | + * @throws | ||
| 46 | + * @Title: list | ||
| 47 | + * @Description: TODO(多条件分页查询) | ||
| 48 | + */ | ||
| 49 | + @RequestMapping(method = RequestMethod.GET) | ||
| 50 | + public Page<T> list(@RequestParam Map<String, Object> map, | ||
| 51 | + @RequestParam(defaultValue = "0") int page, | ||
| 52 | + @RequestParam(defaultValue = "10") int size, | ||
| 53 | + @RequestParam(defaultValue = "id") String order, | ||
| 54 | + @RequestParam(defaultValue = "DESC") String direction) { | ||
| 58 | 55 | ||
| 59 | // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | 56 | // 允许多个字段排序,order可以写单个字段,也可以写多个字段 |
| 60 | // 多个字段格式:{col1},{col2},{col3},....,{coln} | 57 | // 多个字段格式:{col1},{col2},{col3},....,{coln} |
| @@ -81,60 +78,57 @@ public class BaseController<T, ID extends Serializable> { | @@ -81,60 +78,57 @@ public class BaseController<T, ID extends Serializable> { | ||
| 81 | } else { | 78 | } else { |
| 82 | throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); | 79 | throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); |
| 83 | } | 80 | } |
| 84 | - } | ||
| 85 | - | ||
| 86 | - /** | ||
| 87 | - * | ||
| 88 | - * @Title: list | ||
| 89 | - * @Description: TODO(多条件查询) | ||
| 90 | - * @param @param map | ||
| 91 | - * @throws | ||
| 92 | - */ | ||
| 93 | - @RequestMapping(value = "/all", method = RequestMethod.GET) | ||
| 94 | - public Iterable<T> list(@RequestParam Map<String, Object> map){ | ||
| 95 | - return baseService.list(map); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - /** | ||
| 99 | - * | ||
| 100 | - * @Title: save | ||
| 101 | - * @Description: TODO(持久化对象) | ||
| 102 | - * @param @param t | ||
| 103 | - * @param @return 设定文件 | ||
| 104 | - * @return Map<String,Object> {status: 1(成功),-1(失败)} | ||
| 105 | - * @throws | ||
| 106 | - */ | ||
| 107 | - @RequestMapping(method = RequestMethod.POST) | ||
| 108 | - public Map<String, Object> save(T t){ | ||
| 109 | - return baseService.save(t); | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - /** | ||
| 113 | - * | ||
| 114 | - * @Title: findById | ||
| 115 | - * @Description: TODO(根据主键获取单个对象) | ||
| 116 | - * @param @param id | ||
| 117 | - * @throws | ||
| 118 | - */ | ||
| 119 | - @RequestMapping(value="/{id}",method = RequestMethod.GET) | ||
| 120 | - public T findById(@PathVariable("id") ID id){ | ||
| 121 | - return baseService.findById(id); | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - /** | ||
| 125 | - * | ||
| 126 | - * @Title: delete | ||
| 127 | - * @Description: TODO(根据主键删除对象) | ||
| 128 | - * @param @param id | ||
| 129 | - * @throws | ||
| 130 | - */ | ||
| 131 | - @RequestMapping(value="/{id}",method = RequestMethod.DELETE) | ||
| 132 | - public Map<String, Object> delete(@PathVariable("id") ID id){ | ||
| 133 | - return baseService.delete(id); | ||
| 134 | - } | 81 | + } |
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * @param @param map | ||
| 85 | + * @throws | ||
| 86 | + * @Title: list | ||
| 87 | + * @Description: TODO(多条件查询) | ||
| 88 | + */ | ||
| 89 | + @RequestMapping(value = "/all", method = RequestMethod.GET) | ||
| 90 | + public Iterable<T> list(@RequestParam Map<String, Object> map) { | ||
| 91 | + return baseService.list(map); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + /** | ||
| 95 | + * @param @param t | ||
| 96 | + * @param @return 设定文件 | ||
| 97 | + * @return Map<String,Object> {status: 1(成功),-1(失败)} | ||
| 98 | + * @throws | ||
| 99 | + * @Title: save | ||
| 100 | + * @Description: TODO(持久化对象) | ||
| 101 | + */ | ||
| 102 | + @RequestMapping(method = RequestMethod.POST) | ||
| 103 | + public Map<String, Object> save(T t) { | ||
| 104 | + return baseService.save(t); | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + /** | ||
| 108 | + * @param @param id | ||
| 109 | + * @throws | ||
| 110 | + * @Title: findById | ||
| 111 | + * @Description: TODO(根据主键获取单个对象) | ||
| 112 | + */ | ||
| 113 | + @RequestMapping(value = "/{id}", method = RequestMethod.GET) | ||
| 114 | + public T findById(@PathVariable("id") ID id) { | ||
| 115 | + return baseService.findById(id); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + /** | ||
| 119 | + * @param @param id | ||
| 120 | + * @throws | ||
| 121 | + * @Title: delete | ||
| 122 | + * @Description: TODO(根据主键删除对象) | ||
| 123 | + */ | ||
| 124 | + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) | ||
| 125 | + public Map<String, Object> delete(@PathVariable("id") ID id) { | ||
| 126 | + return baseService.delete(id); | ||
| 127 | + } | ||
| 135 | 128 | ||
| 136 | /** | 129 | /** |
| 137 | * 上传数据文件,并使用ktr转换文件导入数据。 | 130 | * 上传数据文件,并使用ktr转换文件导入数据。 |
| 131 | + * | ||
| 138 | * @param file | 132 | * @param file |
| 139 | * @return | 133 | * @return |
| 140 | * @throws Exception | 134 | * @throws Exception |
| @@ -163,6 +157,7 @@ public class BaseController<T, ID extends Serializable> { | @@ -163,6 +157,7 @@ public class BaseController<T, ID extends Serializable> { | ||
| 163 | 157 | ||
| 164 | /** | 158 | /** |
| 165 | * 使用ktr导出数据。 | 159 | * 使用ktr导出数据。 |
| 160 | + * | ||
| 166 | * @param response | 161 | * @param response |
| 167 | * @throws Exception | 162 | * @throws Exception |
| 168 | */ | 163 | */ |
| @@ -241,5 +236,5 @@ public class BaseController<T, ID extends Serializable> { | @@ -241,5 +236,5 @@ public class BaseController<T, ID extends Serializable> { | ||
| 241 | // 默认返回异常,子类如果要使用导入功能,必须覆写此方法,指定ktr文件类路径 | 236 | // 默认返回异常,子类如果要使用导入功能,必须覆写此方法,指定ktr文件类路径 |
| 242 | throw new RuntimeException("必须override,并指定ktr classpath"); | 237 | throw new RuntimeException("必须override,并指定ktr classpath"); |
| 243 | } | 238 | } |
| 244 | - | 239 | + |
| 245 | } | 240 | } |
src/main/java/com/bsth/controller/gps/GpsController.java
| @@ -15,77 +15,85 @@ import java.util.Map; | @@ -15,77 +15,85 @@ import java.util.Map; | ||
| 15 | @RequestMapping("gps") | 15 | @RequestMapping("gps") |
| 16 | public class GpsController { | 16 | public class GpsController { |
| 17 | 17 | ||
| 18 | - @Autowired | ||
| 19 | - GpsRealData gpsRealData; | ||
| 20 | - | ||
| 21 | - @Autowired | ||
| 22 | - GpsService gpsService; | ||
| 23 | - | ||
| 24 | - @RequestMapping(value = "/real/all") | ||
| 25 | - public Map<String, Object> search(@RequestParam Map<String, Object> map, | ||
| 26 | - @RequestParam(defaultValue = "0") int page, | ||
| 27 | - @RequestParam(defaultValue = "15") int size, | ||
| 28 | - @RequestParam(defaultValue = "timestamp") String order, | ||
| 29 | - @RequestParam(defaultValue = "DESC") String direction){ | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - return gpsService.search(map, page, size, order, direction); | ||
| 33 | - } | ||
| 34 | - | ||
| 35 | - @RequestMapping(value = "/real/line/{lineCode}") | ||
| 36 | - public List<GpsEntity> findByLineCode(@PathVariable("lineCode") String lineCode) { | ||
| 37 | - return gpsRealData.getByLine(lineCode); | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - @RequestMapping(value = "/real/line") | ||
| 41 | - public List<GpsEntity> findByLineCodes(@RequestParam String lineCodes) { | ||
| 42 | - return gpsRealData.get(Splitter.on(",").splitToList(lineCodes)); | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - @RequestMapping(value = "/allDevices") | ||
| 46 | - public Iterable<String> allDevices(){ | ||
| 47 | - return gpsRealData.allDevices(); | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - @RequestMapping(value = "/removeRealGps", method = RequestMethod.POST) | ||
| 51 | - public Map<String, Object> removeRealGps(@RequestParam String device){ | ||
| 52 | - return gpsService.removeRealGps(device); | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * | ||
| 57 | - * @Title: history @Description: TODO(这个方法给测试页面用) @throws | ||
| 58 | - */ | ||
| 59 | - @RequestMapping(value = "/history/{device}") | ||
| 60 | - public List<Map<String, Object>> history(@PathVariable("device") String device, @RequestParam Long startTime, | ||
| 61 | - @RequestParam Long endTime, @RequestParam int directions) { | ||
| 62 | - | ||
| 63 | - return gpsService.history(device, startTime, endTime, directions); | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - @RequestMapping(value = "/gpsHistory/multiple") | ||
| 67 | - public List<Map<String, Object>> gpsHistory(@RequestParam String[] nbbmArray, @RequestParam Long st, | ||
| 68 | - @RequestParam Long et) { | ||
| 69 | - return gpsService.history(nbbmArray, st, et); | ||
| 70 | - } | 18 | + @Autowired |
| 19 | + GpsRealData gpsRealData; | ||
| 20 | + | ||
| 21 | + @Autowired | ||
| 22 | + GpsService gpsService; | ||
| 23 | + | ||
| 24 | + @RequestMapping(value = "/real/all") | ||
| 25 | + public Map<String, Object> search(@RequestParam Map<String, Object> map, | ||
| 26 | + @RequestParam(defaultValue = "0") int page, | ||
| 27 | + @RequestParam(defaultValue = "15") int size, | ||
| 28 | + @RequestParam(defaultValue = "timestamp") String order, | ||
| 29 | + @RequestParam(defaultValue = "DESC") String direction) { | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + return gpsService.search(map, page, size, order, direction); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + @RequestMapping(value = "/real/line/{lineCode}") | ||
| 36 | + public List<GpsEntity> findByLineCode(@PathVariable("lineCode") String lineCode) { | ||
| 37 | + return gpsRealData.getByLine(lineCode); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @RequestMapping(value = "/real/line") | ||
| 41 | + public List<GpsEntity> findByLineCodes(@RequestParam String lineCodes) { | ||
| 42 | + return gpsRealData.get(Splitter.on(",").splitToList(lineCodes)); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @RequestMapping(value = "/allDevices") | ||
| 46 | + public Iterable<String> allDevices() { | ||
| 47 | + return gpsRealData.allDevices(); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @RequestMapping(value = "/removeRealGps", method = RequestMethod.POST) | ||
| 51 | + public Map<String, Object> removeRealGps(@RequestParam String device) { | ||
| 52 | + return gpsService.removeRealGps(device); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * @Title: history @Description: TODO(这个方法给测试页面用) @throws | ||
| 57 | + */ | ||
| 58 | + @RequestMapping(value = "/history/{device}") | ||
| 59 | + public List<Map<String, Object>> history(@PathVariable("device") String device, @RequestParam Long startTime, | ||
| 60 | + @RequestParam Long endTime, @RequestParam int directions) { | ||
| 61 | + | ||
| 62 | + return gpsService.history(device, startTime, endTime, directions); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + @RequestMapping(value = "/gpsHistory/multiple") | ||
| 66 | + public List<Map<String, Object>> gpsHistory(@RequestParam String[] nbbmArray, @RequestParam Long st, | ||
| 67 | + @RequestParam Long et) { | ||
| 68 | + return gpsService.history(nbbmArray, st, et); | ||
| 69 | + } | ||
| 71 | 70 | ||
| 72 | /*@RequestMapping(value = "/analyse/ram") | 71 | /*@RequestMapping(value = "/analyse/ram") |
| 73 | - public List<ArrivalInfo> ramData(@RequestParam String nbbm) { | 72 | + public List<ArrivalInfo> ramData(@RequestParam String nbbm) { |
| 74 | return ArrivalDataBuffer.allMap.get(nbbm); | 73 | return ArrivalDataBuffer.allMap.get(nbbm); |
| 75 | }*/ | 74 | }*/ |
| 76 | 75 | ||
| 77 | - @RequestMapping(value = "/Car2DeviceId") | ||
| 78 | - public Map<String, String> findCarDeviceIdMap() { | ||
| 79 | - return BasicData.deviceId2NbbmMap.inverse(); | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - @RequestMapping(value = "/buffAera") | ||
| 83 | - public Map<String, Object> findBuffAeraByCode(@RequestParam String code,@RequestParam String type){ | ||
| 84 | - return gpsService.findBuffAeraByCode(code, type); | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - @RequestMapping(value = "/findRoadSpeed") | ||
| 88 | - public Map<String, Object> findRoadSpeed(@RequestParam String lineCode){ | ||
| 89 | - return gpsService.findRoadSpeed(lineCode); | ||
| 90 | - } | 76 | + @RequestMapping(value = "/Car2DeviceId") |
| 77 | + public Map<String, String> findCarDeviceIdMap() { | ||
| 78 | + return BasicData.deviceId2NbbmMap.inverse(); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + @RequestMapping(value = "/buffAera") | ||
| 82 | + public Map<String, Object> findBuffAeraByCode(@RequestParam String code, @RequestParam String type) { | ||
| 83 | + return gpsService.findBuffAeraByCode(code, type); | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + @RequestMapping(value = "/findRoadSpeed") | ||
| 87 | + public Map<String, Object> findRoadSpeed(@RequestParam String lineCode) { | ||
| 88 | + return gpsService.findRoadSpeed(lineCode); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + /** | ||
| 92 | + * gps补全 | ||
| 93 | + * @return | ||
| 94 | + */ | ||
| 95 | + @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST) | ||
| 96 | + public Map<String, Object> gpsCompletion(@RequestParam long schId) { | ||
| 97 | + return gpsService.gpsCompletion(schId); | ||
| 98 | + } | ||
| 91 | } | 99 | } |
src/main/java/com/bsth/controller/sys/UserController.java
| @@ -217,7 +217,7 @@ public class UserController extends BaseController<SysUser, Integer> { | @@ -217,7 +217,7 @@ public class UserController extends BaseController<SysUser, Integer> { | ||
| 217 | * 确认新密码 | 217 | * 确认新密码 |
| 218 | * @return | 218 | * @return |
| 219 | */ | 219 | */ |
| 220 | - @RequestMapping("/changePWD") | 220 | + @RequestMapping(value = "/changePWD", method = RequestMethod.POST) |
| 221 | public String changePWD(@RequestParam String oldPWD, @RequestParam String newPWD, @RequestParam String cnewPWD) { | 221 | public String changePWD(@RequestParam String oldPWD, @RequestParam String newPWD, @RequestParam String cnewPWD) { |
| 222 | SysUser sysUser = SecurityUtils.getCurrentUser(); | 222 | SysUser sysUser = SecurityUtils.getCurrentUser(); |
| 223 | String msg = ""; | 223 | String msg = ""; |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| 1 | package com.bsth.repository.realcontrol; | 1 | package com.bsth.repository.realcontrol; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 3 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 4 | +import com.bsth.entity.schedule.CarConfigInfo; | ||
| 4 | import com.bsth.repository.BaseRepository; | 5 | import com.bsth.repository.BaseRepository; |
| 6 | +import org.springframework.data.domain.Page; | ||
| 7 | +import org.springframework.data.domain.Pageable; | ||
| 8 | +import org.springframework.data.jpa.domain.Specification; | ||
| 5 | import org.springframework.data.jpa.repository.EntityGraph; | 9 | import org.springframework.data.jpa.repository.EntityGraph; |
| 6 | import org.springframework.data.jpa.repository.Modifying; | 10 | import org.springframework.data.jpa.repository.Modifying; |
| 7 | import org.springframework.data.jpa.repository.Query; | 11 | import org.springframework.data.jpa.repository.Query; |
| @@ -131,4 +135,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -131,4 +135,16 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 131 | @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") | 135 | @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") |
| 132 | List<Map<String,Object>> setDDRBGroup(String date); | 136 | List<Map<String,Object>> setDDRBGroup(String date); |
| 133 | 137 | ||
| 138 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 139 | + @Override | ||
| 140 | + Page<ScheduleRealInfo> findAll(Specification<ScheduleRealInfo> spec, Pageable pageable); | ||
| 141 | + | ||
| 142 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 143 | + @Override | ||
| 144 | + List<ScheduleRealInfo> findAll(Specification<ScheduleRealInfo> spec); | ||
| 145 | + | ||
| 146 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 147 | + @Override | ||
| 148 | + List<ScheduleRealInfo> findAll(); | ||
| 149 | + | ||
| 134 | } | 150 | } |
src/main/java/com/bsth/service/gps/GpsService.java
| @@ -16,4 +16,6 @@ public interface GpsService { | @@ -16,4 +16,6 @@ public interface GpsService { | ||
| 16 | Map<String,Object> removeRealGps(String device); | 16 | Map<String,Object> removeRealGps(String device); |
| 17 | 17 | ||
| 18 | Map<String,Object> findRoadSpeed(String lineCode); | 18 | Map<String,Object> findRoadSpeed(String lineCode); |
| 19 | + | ||
| 20 | + Map<String,Object> gpsCompletion(long schId); | ||
| 19 | } | 21 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -5,6 +5,8 @@ import com.bsth.data.BasicData; | @@ -5,6 +5,8 @@ import com.bsth.data.BasicData; | ||
| 5 | import com.bsth.data.arrival.ArrivalEntity; | 5 | import com.bsth.data.arrival.ArrivalEntity; |
| 6 | import com.bsth.data.gpsdata.GpsEntity; | 6 | import com.bsth.data.gpsdata.GpsEntity; |
| 7 | import com.bsth.data.gpsdata.GpsRealData; | 7 | import com.bsth.data.gpsdata.GpsRealData; |
| 8 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 9 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 8 | import com.bsth.repository.CarParkRepository; | 10 | import com.bsth.repository.CarParkRepository; |
| 9 | import com.bsth.repository.StationRepository; | 11 | import com.bsth.repository.StationRepository; |
| 10 | import com.bsth.util.DateUtils; | 12 | import com.bsth.util.DateUtils; |
| @@ -47,6 +49,9 @@ public class GpsServiceImpl implements GpsService { | @@ -47,6 +49,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 47 | @Autowired | 49 | @Autowired |
| 48 | JdbcTemplate jdbcTemplate; | 50 | JdbcTemplate jdbcTemplate; |
| 49 | 51 | ||
| 52 | + @Autowired | ||
| 53 | + DayOfSchedule dayOfSchedule; | ||
| 54 | + | ||
| 50 | // 历史gps查询 | 55 | // 历史gps查询 |
| 51 | @Override | 56 | @Override |
| 52 | public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { | 57 | public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { |
| @@ -203,7 +208,7 @@ public class GpsServiceImpl implements GpsService { | @@ -203,7 +208,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 203 | conn = DBUtils_MS.getConnection(); | 208 | conn = DBUtils_MS.getConnection(); |
| 204 | ps = conn.prepareStatement(sql); | 209 | ps = conn.prepareStatement(sql); |
| 205 | ps.setInt(1, dayOfYear); | 210 | ps.setInt(1, dayOfYear); |
| 206 | - /* ps.setArray(2, conn.createArrayOf("VARCHAR", devices)); */ | 211 | + /* ps.setArray(2, conn.createArrayOf("VARCHAR", devices)); */ |
| 207 | ps.setLong(2, st * 1000); | 212 | ps.setLong(2, st * 1000); |
| 208 | ps.setLong(3, et * 1000); | 213 | ps.setLong(3, et * 1000); |
| 209 | 214 | ||
| @@ -411,6 +416,69 @@ public class GpsServiceImpl implements GpsService { | @@ -411,6 +416,69 @@ public class GpsServiceImpl implements GpsService { | ||
| 411 | return rs; | 416 | return rs; |
| 412 | } | 417 | } |
| 413 | 418 | ||
| 419 | + /** | ||
| 420 | + * gps补全 | ||
| 421 | + * | ||
| 422 | + * @param schId | ||
| 423 | + * @return | ||
| 424 | + */ | ||
| 425 | + @Override | ||
| 426 | + public Map<String, Object> gpsCompletion(long schId) { | ||
| 427 | + Map<String, Object> rs = new HashMap<>(); | ||
| 428 | + | ||
| 429 | + try { | ||
| 430 | + ScheduleRealInfo sch = dayOfSchedule.get(schId); | ||
| 431 | + if (sch == null) { | ||
| 432 | + rs.put("status", ResponseCode.ERROR); | ||
| 433 | + rs.put("msg", "找不到对应班次!!!"); | ||
| 434 | + return rs; | ||
| 435 | + } | ||
| 436 | + | ||
| 437 | + String sql = "select * from bsth_gps_template where line_id='" + sch.getXlBm() + "' and updown=" + sch.getXlDir(); | ||
| 438 | + List<Map<String, Object>> list = jdbcTemplate.queryForList(sql); | ||
| 439 | + | ||
| 440 | + if(list.size() == 0){ | ||
| 441 | + rs.put("status", ResponseCode.ERROR); | ||
| 442 | + rs.put("msg", "缺少模板数据!!!"); | ||
| 443 | + return rs; | ||
| 444 | + } | ||
| 445 | + Map<String, Object> fs = list.get(0); | ||
| 446 | + String sqlBefore = "insert into bsth_c_template(" | ||
| 447 | + ,sqlValues = " values("; | ||
| 448 | + | ||
| 449 | + Set<String> ks = fs.keySet(); | ||
| 450 | + for(String k : ks){ | ||
| 451 | + sqlBefore += (k + ","); | ||
| 452 | + sqlValues += "?,"; | ||
| 453 | + } | ||
| 454 | + sqlBefore = sqlBefore.substring(0, sqlBefore.length() - 1) + ")"; | ||
| 455 | + sqlValues = sqlValues.substring(0, sqlValues.length() - 1) + ")"; | ||
| 456 | + sql = sqlBefore + " " + sqlValues; | ||
| 457 | + | ||
| 458 | + Connection conn = DBUtils_MS.getConnection(); | ||
| 459 | + conn.setAutoCommit(false); | ||
| 460 | + ps = conn.prepareStatement(sql); | ||
| 461 | + int fsize = ks.size(); | ||
| 462 | + List<Object> vs; | ||
| 463 | + for(Map<String, Object> map : list){ | ||
| 464 | + vs = new ArrayList<>(map.values()); | ||
| 465 | + for(int i = 0; i < fsize; i ++){ | ||
| 466 | + ps.setObject(i + 1, vs.get(i)); | ||
| 467 | + } | ||
| 468 | + ps.addBatch(); | ||
| 469 | + } | ||
| 470 | + ps.executeBatch(); | ||
| 471 | + conn.commit(); | ||
| 472 | + ps.clearBatch(); | ||
| 473 | + | ||
| 474 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 475 | + } catch (Exception e) { | ||
| 476 | + logger.error("", e); | ||
| 477 | + rs.put("status", ResponseCode.ERROR); | ||
| 478 | + } | ||
| 479 | + return rs; | ||
| 480 | + } | ||
| 481 | + | ||
| 414 | private void sortGpsList(final Field f, List<GpsEntity> rs) { | 482 | private void sortGpsList(final Field f, List<GpsEntity> rs) { |
| 415 | Collections.sort(rs, new Comparator<GpsEntity>() { | 483 | Collections.sort(rs, new Comparator<GpsEntity>() { |
| 416 | 484 |
src/main/resources/static/pages/control/lineallot/allot.html
| @@ -288,60 +288,67 @@ $(function(){ | @@ -288,60 +288,67 @@ $(function(){ | ||
| 288 | 288 | ||
| 289 | //确定 | 289 | //确定 |
| 290 | $('.gotoControl').on('click', function(){ | 290 | $('.gotoControl').on('click', function(){ |
| 291 | - var lines = $('.selected-body .line'); | ||
| 292 | - if(lines.length == 0){ | ||
| 293 | - layer.alert('你还没有选择线路!',{icon: 3}); | ||
| 294 | - return; | ||
| 295 | - } | ||
| 296 | - | ||
| 297 | - showLoad('更新缓存信息...'); | ||
| 298 | - //将选择的线路写入localstorage | ||
| 299 | - var lsData = []; | ||
| 300 | - $.each(lines, function(i, e){ | ||
| 301 | - lsData.push(lineIdMap[$(e).data('id')]); | ||
| 302 | - }); | ||
| 303 | - storage.setItem('lineControlItems', JSON.stringify(lsData)); | ||
| 304 | - | ||
| 305 | - var operationMode = $(this).data('status'); | ||
| 306 | - //监控模式还是主调模式 | ||
| 307 | - storage.setItem('operationMode', operationMode); | ||
| 308 | - | ||
| 309 | - var ep = new EventProxy(); | ||
| 310 | - //缓存车辆自编号和设备号对照 | ||
| 311 | - cacheCar2DeviceId(function(){ | ||
| 312 | - delayEmit(ep, 'cacheRoute'); | ||
| 313 | - }); | ||
| 314 | - | ||
| 315 | - //缓存线路路由 | ||
| 316 | - ep.tail('cacheRoute', function(){ | ||
| 317 | - cacheRoute(lsData, function(cacheData){ | ||
| 318 | - delayEmit(ep, 'checkLineConfig'); | ||
| 319 | - }); | ||
| 320 | - }); | ||
| 321 | - | ||
| 322 | - //检查线路配置信息 | ||
| 323 | - ep.tail('checkLineConfig', function(){ | ||
| 324 | - checkLineConfig(lsData, function(rs){ | ||
| 325 | - if(rs.status == 0) | ||
| 326 | - delayEmit(ep, 'gotoControl', rs); | ||
| 327 | - else if(rs.status == 1) | ||
| 328 | - delayEmit(ep, 'initLineConfig', rs); | ||
| 329 | - }); | ||
| 330 | - }); | ||
| 331 | - | ||
| 332 | - //初始化没有 线路配置信息 的线路 | ||
| 333 | - ep.tail('initLineConfig',function(rs){ | ||
| 334 | - initLineConfig(rs.not, function(){ | ||
| 335 | - delayEmit(ep, 'gotoControl', rs); | ||
| 336 | - }); | ||
| 337 | - }); | ||
| 338 | - | ||
| 339 | - //进入线调 | ||
| 340 | - ep.tail('gotoControl', function(){ | ||
| 341 | - //alert('进入线调'); | ||
| 342 | - layer.closeAll(); | ||
| 343 | - //loadPage('/pages/control/line/index.html'); | ||
| 344 | - window.location.href="/real_control_v2/main.html"; | 291 | + $.get('/user/currentUser', function (user) { |
| 292 | + //进入班次管理界面 | ||
| 293 | + if(user.userName == 'bcgly') | ||
| 294 | + window.location.href="/real_control_v2/sch_manage/sch_imitate.html"; | ||
| 295 | + else{ | ||
| 296 | + var lines = $('.selected-body .line'); | ||
| 297 | + if(lines.length == 0){ | ||
| 298 | + layer.alert('你还没有选择线路!',{icon: 3}); | ||
| 299 | + return; | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + showLoad('更新缓存信息...'); | ||
| 303 | + //将选择的线路写入localstorage | ||
| 304 | + var lsData = []; | ||
| 305 | + $.each(lines, function(i, e){ | ||
| 306 | + lsData.push(lineIdMap[$(e).data('id')]); | ||
| 307 | + }); | ||
| 308 | + storage.setItem('lineControlItems', JSON.stringify(lsData)); | ||
| 309 | + | ||
| 310 | + var operationMode = $(this).data('status'); | ||
| 311 | + //监控模式还是主调模式 | ||
| 312 | + storage.setItem('operationMode', operationMode); | ||
| 313 | + | ||
| 314 | + var ep = new EventProxy(); | ||
| 315 | + //缓存车辆自编号和设备号对照 | ||
| 316 | + cacheCar2DeviceId(function(){ | ||
| 317 | + delayEmit(ep, 'cacheRoute'); | ||
| 318 | + }); | ||
| 319 | + | ||
| 320 | + //缓存线路路由 | ||
| 321 | + ep.tail('cacheRoute', function(){ | ||
| 322 | + cacheRoute(lsData, function(cacheData){ | ||
| 323 | + delayEmit(ep, 'checkLineConfig'); | ||
| 324 | + }); | ||
| 325 | + }); | ||
| 326 | + | ||
| 327 | + //检查线路配置信息 | ||
| 328 | + ep.tail('checkLineConfig', function(){ | ||
| 329 | + checkLineConfig(lsData, function(rs){ | ||
| 330 | + if(rs.status == 0) | ||
| 331 | + delayEmit(ep, 'gotoControl', rs); | ||
| 332 | + else if(rs.status == 1) | ||
| 333 | + delayEmit(ep, 'initLineConfig', rs); | ||
| 334 | + }); | ||
| 335 | + }); | ||
| 336 | + | ||
| 337 | + //初始化没有 线路配置信息 的线路 | ||
| 338 | + ep.tail('initLineConfig',function(rs){ | ||
| 339 | + initLineConfig(rs.not, function(){ | ||
| 340 | + delayEmit(ep, 'gotoControl', rs); | ||
| 341 | + }); | ||
| 342 | + }); | ||
| 343 | + | ||
| 344 | + //进入线调 | ||
| 345 | + ep.tail('gotoControl', function(){ | ||
| 346 | + //alert('进入线调'); | ||
| 347 | + layer.closeAll(); | ||
| 348 | + //loadPage('/pages/control/line/index.html'); | ||
| 349 | + window.location.href="/real_control_v2/main.html"; | ||
| 350 | + }); | ||
| 351 | + } | ||
| 345 | }); | 352 | }); |
| 346 | }); | 353 | }); |
| 347 | 354 |
src/main/resources/static/pages/permission/user/changePWD.html
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <!-- BEGIN VALIDATION STATES--> | 3 | <!-- BEGIN VALIDATION STATES--> |
| 4 | <div class="portlet light portlet-fit portlet-form bordered"> | 4 | <div class="portlet light portlet-fit portlet-form bordered"> |
| 5 | <div class="portlet-body"> | 5 | <div class="portlet-body"> |
| 6 | - <form action="/user/changePWD" class="form-horizontal" id="changePWD"> | 6 | + <form class="form-horizontal" id="changePWDForm"> |
| 7 | <div class="form-group" style="margin-top: 60px"> | 7 | <div class="form-group" style="margin-top: 60px"> |
| 8 | <label class="control-label col-md-5">原始密码: | 8 | <label class="control-label col-md-5">原始密码: |
| 9 | </label> | 9 | </label> |
| @@ -48,7 +48,8 @@ | @@ -48,7 +48,8 @@ | ||
| 48 | <script> | 48 | <script> |
| 49 | $(function(){ | 49 | $(function(){ |
| 50 | $("#confirm").on("click",function(){ | 50 | $("#confirm").on("click",function(){ |
| 51 | - $.get('/user/changePWD',null,function(){ | 51 | + var data = $('#changePWDForm').serializeJSON(); |
| 52 | + $.post('/user/changePWD',data,function(){ | ||
| 52 | 53 | ||
| 53 | }); | 54 | }); |
| 54 | }); | 55 | }); |
src/main/resources/static/real_control_v2/css/main.css
| @@ -711,6 +711,7 @@ li.map-panel { | @@ -711,6 +711,7 @@ li.map-panel { | ||
| 711 | width: 33%; | 711 | width: 33%; |
| 712 | } | 712 | } |
| 713 | 713 | ||
| 714 | +/* | ||
| 714 | #schedule-lp_change-modal .sch-list { | 715 | #schedule-lp_change-modal .sch-list { |
| 715 | margin-top: 25px; | 716 | margin-top: 25px; |
| 716 | } | 717 | } |
| @@ -762,4 +763,52 @@ li.map-panel { | @@ -762,4 +763,52 @@ li.map-panel { | ||
| 762 | #schedule-lp_change-modal .sch-list .sch-item.reverse dl dd:nth-of-type(4) { | 763 | #schedule-lp_change-modal .sch-list .sch-item.reverse dl dd:nth-of-type(4) { |
| 763 | width: 33%; | 764 | width: 33%; |
| 764 | border-right:0; | 765 | border-right:0; |
| 765 | -} | ||
| 766 | \ No newline at end of file | 766 | \ No newline at end of file |
| 767 | +}*/ | ||
| 768 | + | ||
| 769 | + | ||
| 770 | +#schedule-lp_change-modal .sch-list dl dd { | ||
| 771 | + font-size: 14px; | ||
| 772 | +} | ||
| 773 | + | ||
| 774 | +#schedule-lp_change-modal .sch-list dl dt:nth-of-type(1), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(1) { | ||
| 775 | + width: 9%; | ||
| 776 | + border-left: 1px solid #dedede; | ||
| 777 | +} | ||
| 778 | + | ||
| 779 | +#schedule-lp_change-modal .sch-list dl dt:nth-of-type(2), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(2) { | ||
| 780 | + width: 30%; | ||
| 781 | +} | ||
| 782 | + | ||
| 783 | +#schedule-lp_change-modal .sch-list dl dt:nth-of-type(3), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(3) { | ||
| 784 | + width: 28%; | ||
| 785 | +} | ||
| 786 | + | ||
| 787 | +#schedule-lp_change-modal .sch-list dl dt:nth-of-type(4), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(4) { | ||
| 788 | + width: 17%; | ||
| 789 | +} | ||
| 790 | + | ||
| 791 | +#schedule-lp_change-modal .sch-list dl dt:nth-of-type(5), #schedule-lp_change-modal .sch-list dl dd:nth-of-type(5) { | ||
| 792 | + width: 15%; | ||
| 793 | +} | ||
| 794 | + | ||
| 795 | + | ||
| 796 | +#schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(1), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(1) { | ||
| 797 | + width: 9%; | ||
| 798 | + border-left: 1px solid #dedede; | ||
| 799 | +} | ||
| 800 | + | ||
| 801 | +#schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(2), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(2) { | ||
| 802 | + width: 15%; | ||
| 803 | +} | ||
| 804 | + | ||
| 805 | +#schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(3), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(3) { | ||
| 806 | + width: 17%; | ||
| 807 | +} | ||
| 808 | + | ||
| 809 | +#schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(4), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(4) { | ||
| 810 | + width: 28%; | ||
| 811 | +} | ||
| 812 | + | ||
| 813 | +#schedule-lp_change-modal .sch-list.reverse dl dt:nth-of-type(5), #schedule-lp_change-modal .sch-list.reverse dl dd:nth-of-type(5) { | ||
| 814 | + width: 30%; | ||
| 815 | +} |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
| @@ -6,139 +6,131 @@ | @@ -6,139 +6,131 @@ | ||
| 6 | 6 | ||
| 7 | <div class="uk-grid uk-grid-divider"> | 7 | <div class="uk-grid uk-grid-divider"> |
| 8 | <div class="uk-width-1-2"> | 8 | <div class="uk-width-1-2"> |
| 9 | - <form class="uk-form"> | 9 | + <form class="uk-form uk-form-horizontal"> |
| 10 | <fieldset> | 10 | <fieldset> |
| 11 | 线路 | 11 | 线路 |
| 12 | - <select name="lineSelect" style="width: 140px;"></select> | 12 | + <select name="lineSelect" data-order="0" style="width: 140px;"></select> |
| 13 |   | 13 |   |
| 14 | 路牌 | 14 | 路牌 |
| 15 | - <select name="lpName" style="width: 90px;"></select> | 15 | + <select name="lpName" data-order="0" style="width: 90px;"></select> |
| 16 | </fieldset> | 16 | </fieldset> |
| 17 | - </form> | ||
| 18 | - <div class="sch-list"> | ||
| 19 | - <div class="sch-item"> | ||
| 20 | - <dl> | ||
| 21 | - <dd>S0568/钱存哗</dd> | ||
| 22 | - <dd>S0J-046</dd> | ||
| 23 | - <dd>5</dd> | ||
| 24 | - <dd>07:58</dd> | ||
| 25 | - </dl> | ||
| 26 | - <dl> | ||
| 27 | - <dd>S0568/钱存哗</dd> | ||
| 28 | - <dd>S0J-046</dd> | ||
| 29 | - <dd>5</dd> | ||
| 30 | - <dd>07:58</dd> | ||
| 31 | - </dl> | ||
| 32 | - <dl> | ||
| 33 | - <dd>S0568/钱存哗</dd> | ||
| 34 | - <dd>S0J-046</dd> | ||
| 35 | - <dd>5</dd> | ||
| 36 | - <dd>07:58</dd> | ||
| 37 | - </dl> | ||
| 38 | - <dl> | ||
| 39 | - <dd>S0568/钱存哗</dd> | ||
| 40 | - <dd>S0J-046</dd> | ||
| 41 | - <dd>5</dd> | ||
| 42 | - <dd>07:58</dd> | ||
| 43 | - </dl> | ||
| 44 | - <dl> | ||
| 45 | - <dd>S0568/钱存哗</dd> | ||
| 46 | - <dd>S0J-046</dd> | ||
| 47 | - <dd>5</dd> | ||
| 48 | - <dd>07:58</dd> | ||
| 49 | - </dl> | ||
| 50 | - <dl> | ||
| 51 | - <dd>S0568/钱存哗</dd> | ||
| 52 | - <dd>S0J-046</dd> | ||
| 53 | - <dd>5</dd> | ||
| 54 | - <dd>07:58</dd> | ||
| 55 | - </dl> | ||
| 56 | - <dl> | ||
| 57 | - <dd>S0568/钱存哗</dd> | ||
| 58 | - <dd>S0J-046</dd> | ||
| 59 | - <dd>5</dd> | ||
| 60 | - <dd>07:58</dd> | ||
| 61 | - </dl> | 17 | + |
| 18 | + <div class="ct_table sch-list" style="margin-top: 14px;"> | ||
| 19 | + <div class="ct_table_head"> | ||
| 20 | + <dl> | ||
| 21 | + <dt><input type="checkbox"></dt> | ||
| 22 | + <dt>驾驶员</dt> | ||
| 23 | + <dt>车辆</dt> | ||
| 24 | + <dt>路牌</dt> | ||
| 25 | + <dt>时间</dt> | ||
| 26 | + </dl> | ||
| 27 | + </div> | ||
| 28 | + <div class="ct_table_body"> | ||
| 29 | + </div> | ||
| 62 | </div> | 30 | </div> |
| 63 | - </div> | 31 | + </form> |
| 64 | </div> | 32 | </div> |
| 65 | <div class="uk-width-1-2"> | 33 | <div class="uk-width-1-2"> |
| 66 | <form class="uk-form uk-form-horizontal"> | 34 | <form class="uk-form uk-form-horizontal"> |
| 67 | <fieldset> | 35 | <fieldset> |
| 68 | 线路 | 36 | 线路 |
| 69 | - <select name="lineSelect" style="width: 140px;"></select> | 37 | + <select name="lineSelect" data-order="1" style="width: 140px;"></select> |
| 70 |   | 38 |   |
| 71 | 路牌 | 39 | 路牌 |
| 72 | - <select name="lpName" style="width: 90px;"></select> | 40 | + <select name="lpName" data-order="1" style="width: 90px;"></select> |
| 73 | </fieldset> | 41 | </fieldset> |
| 74 | - </form> | ||
| 75 | - <div class="sch-list"> | ||
| 76 | - <div class="sch-item reverse"> | ||
| 77 | - <dl> | ||
| 78 | - <dd>07:58</dd> | ||
| 79 | - <dd>5</dd> | ||
| 80 | - <dd>S0J-046</dd> | ||
| 81 | - <dd>S0568/钱存哗</dd> | ||
| 82 | - </dl> | ||
| 83 | - <dl> | ||
| 84 | - <dd>07:58</dd> | ||
| 85 | - <dd>5</dd> | ||
| 86 | - <dd>S0J-046</dd> | ||
| 87 | - <dd>S0568/钱存哗</dd> | ||
| 88 | - </dl> | ||
| 89 | - <dl> | ||
| 90 | - <dd>07:58</dd> | ||
| 91 | - <dd>5</dd> | ||
| 92 | - <dd>S0J-046</dd> | ||
| 93 | - <dd>S0568/钱存哗</dd> | ||
| 94 | - </dl> | ||
| 95 | - <dl> | ||
| 96 | - <dd>07:58</dd> | ||
| 97 | - <dd>5</dd> | ||
| 98 | - <dd>S0J-046</dd> | ||
| 99 | - <dd>S0568/钱存哗</dd> | ||
| 100 | - </dl> | ||
| 101 | - <dl> | ||
| 102 | - <dd>07:58</dd> | ||
| 103 | - <dd>5</dd> | ||
| 104 | - <dd>S0J-046</dd> | ||
| 105 | - <dd>S0568/钱存哗</dd> | ||
| 106 | - </dl> | ||
| 107 | - <dl> | ||
| 108 | - <dd>07:58</dd> | ||
| 109 | - <dd>5</dd> | ||
| 110 | - <dd>S0J-046</dd> | ||
| 111 | - <dd>S0568/钱存哗</dd> | ||
| 112 | - </dl> | ||
| 113 | - <dl> | ||
| 114 | - <dd>07:58</dd> | ||
| 115 | - <dd>5</dd> | ||
| 116 | - <dd>S0J-046</dd> | ||
| 117 | - <dd>S0568/钱存哗</dd> | ||
| 118 | - </dl> | 42 | + |
| 43 | + <div class="ct_table sch-list reverse" style="margin-top: 14px;"> | ||
| 44 | + <div class="ct_table_head"> | ||
| 45 | + <dl> | ||
| 46 | + <dt><input type="checkbox"></dt> | ||
| 47 | + <dt>时间</dt> | ||
| 48 | + <dt>路牌</dt> | ||
| 49 | + <dt>车辆</dt> | ||
| 50 | + <dt>驾驶员</dt> | ||
| 51 | + </dl> | ||
| 52 | + </div> | ||
| 53 | + <div class="ct_table_body "> | ||
| 54 | + </div> | ||
| 119 | </div> | 55 | </div> |
| 120 | - </div> | 56 | + </form> |
| 121 | </div> | 57 | </div> |
| 122 | </div> | 58 | </div> |
| 123 | 59 | ||
| 124 | - <div class="uk-modal-footer uk-text-right" > | 60 | + <div class="uk-modal-footer uk-text-right"> |
| 61 | + <div style="float: left;font-size: 13px;"> | ||
| 62 | + <a> 清除未勾选班次</a> | ||
| 63 | + </div> | ||
| 125 | <button type="button" class="uk-button uk-modal-close">取消</button> | 64 | <button type="button" class="uk-button uk-modal-close">取消</button> |
| 126 | <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 提交</button> | 65 | <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 提交</button> |
| 127 | </div> | 66 | </div> |
| 128 | </div> | 67 | </div> |
| 129 | 68 | ||
| 130 | - <script id="schedule-lp_change-form-temp" type="text/html"> | ||
| 131 | - | 69 | + <script id="schedule-lp_change-list-temp" type="text/html"> |
| 70 | + {{if order == 0}} | ||
| 71 | + {{each array as sch i}} | ||
| 72 | + <dl> | ||
| 73 | + <dd><input type="checkbox"></dd> | ||
| 74 | + <dd>{{sch.jGh}}/{{sch.jName}}</dd> | ||
| 75 | + <dd>{{sch.clZbh}}</dd> | ||
| 76 | + <dd>{{sch.lpName}}</dd> | ||
| 77 | + <dd>{{sch.dfsj}}</dd> | ||
| 78 | + </dl> | ||
| 79 | + {{/each}} | ||
| 80 | + {{else if order == 1}} | ||
| 81 | + {{each array as sch i}} | ||
| 82 | + <dl> | ||
| 83 | + <dd><input type="checkbox"></dd> | ||
| 84 | + <dd>{{sch.dfsj}}</dd> | ||
| 85 | + <dd>{{sch.lpName}}</dd> | ||
| 86 | + <dd>{{sch.clZbh}}</dd> | ||
| 87 | + <dd>{{sch.jGh}}/{{sch.jName}}</dd> | ||
| 88 | + </dl> | ||
| 89 | + {{/each}} | ||
| 90 | + {{/if}} | ||
| 132 | </script> | 91 | </script> |
| 133 | 92 | ||
| 134 | <script> | 93 | <script> |
| 135 | (function () { | 94 | (function () { |
| 136 | var modal = '#schedule-lp_change-modal' | 95 | var modal = '#schedule-lp_change-modal' |
| 137 | - , sch; | 96 | + , sch, list = [{}, {}]; |
| 138 | $(modal).on('init', function (e, data) { | 97 | $(modal).on('init', function (e, data) { |
| 139 | e.stopPropagation(); | 98 | e.stopPropagation(); |
| 140 | sch = data.sch; | 99 | sch = data.sch; |
| 141 | 100 | ||
| 101 | + | ||
| 102 | + //线路切换事件 | ||
| 103 | + $('[name=lineSelect]', modal).on('change', function () { | ||
| 104 | + var order = $(this).data('order') | ||
| 105 | + ,lineCode = $(this).val(); | ||
| 106 | + | ||
| 107 | + var array = gb_common.get_vals(gb_schedule_table.findScheduleByLine(lineCode)); | ||
| 108 | + //按路牌分组 | ||
| 109 | + list[order] = gb_common.groupBy(array, 'lpName'); | ||
| 110 | + //设置路牌下拉框 | ||
| 111 | + var lpSelect = $(this).next('select'), ops=''; | ||
| 112 | + $.each(gb_common.get_keys(list[order]), function (i, lp) { | ||
| 113 | + ops += '<option value="'+lp+'">'+lp+'</option>'; | ||
| 114 | + }); | ||
| 115 | + lpSelect.html(ops); | ||
| 116 | + }); | ||
| 117 | + | ||
| 118 | + //路牌切换事件 | ||
| 119 | + $('[name=lpName]', modal).on('change', function () { | ||
| 120 | + var order = $(this).data('order') | ||
| 121 | + ,lp = $(this).val(); | ||
| 122 | + | ||
| 123 | + var htmlStr = template('schedule-lp_change-list-temp', {array: list[order][lp], order: order}); | ||
| 124 | + $('.sch-list .ct_table_body', modal).eq(order).html(htmlStr); | ||
| 125 | + }); | ||
| 126 | + | ||
| 127 | + | ||
| 128 | + //线路下拉框 | ||
| 129 | + var lineOps = ''; | ||
| 130 | + $.each(gb_data_basic.activeLines, function () { | ||
| 131 | + lineOps += '<option value="' + this.lineCode + '">' + this.name + '</option>'; | ||
| 132 | + }); | ||
| 133 | + $('[name=lineSelect]', modal).html(lineOps); | ||
| 142 | }); | 134 | }); |
| 143 | })(); | 135 | })(); |
| 144 | </script> | 136 | </script> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_range_turn.html
| @@ -345,7 +345,7 @@ | @@ -345,7 +345,7 @@ | ||
| 345 | * 为班次添加备注 | 345 | * 为班次添加备注 |
| 346 | */ | 346 | */ |
| 347 | var remarks = '调头' + $('[name=endDate]', csf).val() + ' 因 ' + $('#turnReason', modal).val() + '在' + $('[name=endStation] option:selected', csf).text() + '调头'; | 347 | var remarks = '调头' + $('[name=endDate]', csf).val() + ' 因 ' + $('#turnReason', modal).val() + '在' + $('[name=endStation] option:selected', csf).text() + '调头'; |
| 348 | - gb_schedule_table.addRemarks([sch, nextSch], remarks); | 348 | + gb_schedule_table.addRemarks([sch, nextSch], gb_common.trim(remarks, 'g')); |
| 349 | UIkit.modal(modal).hide(); | 349 | UIkit.modal(modal).hide(); |
| 350 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | 350 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); |
| 351 | return; | 351 | return; |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
| @@ -154,7 +154,7 @@ | @@ -154,7 +154,7 @@ | ||
| 154 | if (resetPagination) | 154 | if (resetPagination) |
| 155 | pagination(rs.totalPages + 1, rs.page); | 155 | pagination(rs.totalPages + 1, rs.page); |
| 156 | }) | 156 | }) |
| 157 | - } | 157 | + }; |
| 158 | 158 | ||
| 159 | var resetPagination = true; | 159 | var resetPagination = true; |
| 160 | var pagination = function(pages, currentPage) { | 160 | var pagination = function(pages, currentPage) { |
| @@ -172,7 +172,7 @@ | @@ -172,7 +172,7 @@ | ||
| 172 | }); | 172 | }); |
| 173 | 173 | ||
| 174 | resetPagination = false; | 174 | resetPagination = false; |
| 175 | - } | 175 | + }; |
| 176 | 176 | ||
| 177 | var callbackHandler={ | 177 | var callbackHandler={ |
| 178 | change_line: function(device){ | 178 | change_line: function(device){ |
src/main/resources/static/real_control_v2/js/common.js
| @@ -131,9 +131,9 @@ var gb_common = (function () { | @@ -131,9 +131,9 @@ var gb_common = (function () { | ||
| 131 | var data = groupBy(get_vals(allGps), 'lineId'); | 131 | var data = groupBy(get_vals(allGps), 'lineId'); |
| 132 | var name; | 132 | var name; |
| 133 | for (var code in data) { | 133 | for (var code in data) { |
| 134 | - try{ | 134 | + try { |
| 135 | name = gb_data_basic.codeToLine[code].name; | 135 | name = gb_data_basic.codeToLine[code].name; |
| 136 | - }catch(e) { | 136 | + } catch (e) { |
| 137 | continue; | 137 | continue; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| @@ -286,7 +286,7 @@ var gb_common = (function () { | @@ -286,7 +286,7 @@ var gb_common = (function () { | ||
| 286 | // } | 286 | // } |
| 287 | // } | 287 | // } |
| 288 | 288 | ||
| 289 | - var accAdd = function(a, b) { | 289 | + var accAdd = function (a, b) { |
| 290 | var c, d, e; | 290 | var c, d, e; |
| 291 | try { | 291 | try { |
| 292 | c = a.toString().split(".")[1].length; | 292 | c = a.toString().split(".")[1].length; |
| @@ -307,10 +307,12 @@ var gb_common = (function () { | @@ -307,10 +307,12 @@ var gb_common = (function () { | ||
| 307 | e = b.toString(); | 307 | e = b.toString(); |
| 308 | try { | 308 | try { |
| 309 | c += d.split(".")[1].length; | 309 | c += d.split(".")[1].length; |
| 310 | - } catch (f) {} | 310 | + } catch (f) { |
| 311 | + } | ||
| 311 | try { | 312 | try { |
| 312 | c += e.split(".")[1].length; | 313 | c += e.split(".")[1].length; |
| 313 | - } catch (f) {} | 314 | + } catch (f) { |
| 315 | + } | ||
| 314 | return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c); | 316 | return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c); |
| 315 | } | 317 | } |
| 316 | 318 | ||
| @@ -329,6 +331,15 @@ var gb_common = (function () { | @@ -329,6 +331,15 @@ var gb_common = (function () { | ||
| 329 | return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e; | 331 | return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e; |
| 330 | }; | 332 | }; |
| 331 | 333 | ||
| 334 | + var trim = function (str, is_global) { | ||
| 335 | + var result; | ||
| 336 | + result = str.replace(/(^\s+)|(\s+$)/g, ""); | ||
| 337 | + if (is_global.toLowerCase() == "g") { | ||
| 338 | + result = result.replace(/\s/g, ""); | ||
| 339 | + } | ||
| 340 | + return result; | ||
| 341 | + }; | ||
| 342 | + | ||
| 332 | return { | 343 | return { |
| 333 | reqCode80: reqCode80, | 344 | reqCode80: reqCode80, |
| 334 | groupBy: groupBy, | 345 | groupBy: groupBy, |
| @@ -344,8 +355,10 @@ var gb_common = (function () { | @@ -344,8 +355,10 @@ var gb_common = (function () { | ||
| 344 | personAutocomplete: personAutocomplete, | 355 | personAutocomplete: personAutocomplete, |
| 345 | carAutocomplete: carAutocomplete, | 356 | carAutocomplete: carAutocomplete, |
| 346 | init_autocomplete: init_autocomplete, | 357 | init_autocomplete: init_autocomplete, |
| 347 | - accAdd : accAdd, | ||
| 348 | - numSubtr: numSubtr | 358 | + init_autocom_pinyin: init_autocom_pinyin, |
| 359 | + accAdd: accAdd, | ||
| 360 | + numSubtr: numSubtr, | ||
| 361 | + trim: trim | ||
| 349 | 362 | ||
| 350 | //whichTransitionEvent:whichTransitionEvent | 363 | //whichTransitionEvent:whichTransitionEvent |
| 351 | }; | 364 | }; |
src/main/resources/static/real_control_v2/sch_manage/sch_imitate.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="zh-cn" style="height: 100%;"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <title>班次管理</title> | ||
| 7 | + <!-- uikit core style--> | ||
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/> | ||
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css"/> | ||
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css"/> | ||
| 11 | + <link rel="stylesheet" | ||
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css"/> | ||
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css"/> | ||
| 14 | + <!-- jquery contextMenu style --> | ||
| 15 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css"/> | ||
| 16 | + <!-- formvalidation style --> | ||
| 17 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css"/> | ||
| 18 | + | ||
| 19 | + <link rel="stylesheet" href="/real_control_v2/css/pace.css"/> | ||
| 20 | + | ||
| 21 | + <style> | ||
| 22 | + /** 图例 */ | ||
| 23 | + | ||
| 24 | + .tl-yzx { | ||
| 25 | + background: #c1ddf0; | ||
| 26 | + border-top: 1px solid #ebebeb !important; | ||
| 27 | + color: #444; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + .tl-xxfc { | ||
| 31 | + background: #ff7878; | ||
| 32 | + color: #f1f1f1; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + .tl-wd { | ||
| 36 | + background: rgb(255, 255, 0); | ||
| 37 | + color: #444; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + .tl-xxsd { | ||
| 41 | + background: #e2de94; | ||
| 42 | + color: #444; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + .tl-xxrd { | ||
| 46 | + background: #c1ddf0; | ||
| 47 | + border-top: 1px solid #ebebeb !important; | ||
| 48 | + color: #444; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + .tl-qrlb { | ||
| 52 | + background: #7B6B24; | ||
| 53 | + color: #EAEBEC; | ||
| 54 | + font-size: 13px; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + .tl-qrlb::before { | ||
| 58 | + content: '烂班'; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + .tl-zzzx { | ||
| 62 | + background: #96F396; | ||
| 63 | + color: #444; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + ::-webkit-scrollbar { | ||
| 67 | + width: 15px; | ||
| 68 | + height: 16px; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb { | ||
| 72 | + border-radius: 999px; | ||
| 73 | + border: 5px solid transparent; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + ::-webkit-scrollbar-track { | ||
| 77 | + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + ::-webkit-scrollbar-thumb { | ||
| 81 | + min-height: 20px; | ||
| 82 | + background-clip: content-box; | ||
| 83 | + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + ::-webkit-scrollbar-corner { | ||
| 87 | + background: transparent; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + .search-box { | ||
| 91 | + width: calc(100% - 70px); | ||
| 92 | + margin: auto; | ||
| 93 | + margin-top: 20px; | ||
| 94 | + border-radius: 5px; | ||
| 95 | + border: 1px solid lightgrey; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + .uk-panel-box { | ||
| 99 | + box-shadow: 0px 1px 4px 0 rgba(125, 122, 122, 0.2), 0px 1px 7px 0 rgba(96, 95, 95, 0.19); | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + .table-wrap.up { | ||
| 103 | + border: 1px solid #5E96D2; | ||
| 104 | + box-shadow: 3px 3px 12px 0 rgba(94, 150, 210, 0.28), 3px 3px 12px 0 rgba(94, 150, 210, 0.28); | ||
| 105 | + border-radius: 5px; | ||
| 106 | + height: 100%; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + .table-wrap.down { | ||
| 110 | + border: 1px solid #e33c3c; | ||
| 111 | + box-shadow: -3px 3px 11px 0 rgba(201, 33, 33, 0.22), -3px 3px 12px 0 rgba(201, 33, 33, 0.17); | ||
| 112 | + border-radius: 5px; | ||
| 113 | + height: 100%; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + table { | ||
| 117 | + table-layout: fixed; | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + table tr td { | ||
| 121 | + white-space: nowrap; | ||
| 122 | + overflow: hidden; | ||
| 123 | + text-overflow: ellipsis; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + .context-menu-active { | ||
| 127 | + background: #9afe9a !important; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + .shade-loading{ | ||
| 131 | + position: absolute; | ||
| 132 | + top: 0; | ||
| 133 | + left: 0; | ||
| 134 | + z-index: 999; | ||
| 135 | + width: 100%; | ||
| 136 | + height: 100%; | ||
| 137 | + background: rgb(255, 255, 255); | ||
| 138 | + opacity: .5; | ||
| 139 | + display: none; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + .shade-loading .center{ | ||
| 143 | + position: absolute; | ||
| 144 | + margin: auto; | ||
| 145 | + top: 50%; | ||
| 146 | + left: 50%; | ||
| 147 | + top: calc(50% - 50px); | ||
| 148 | + left: calc(50% - 50px); | ||
| 149 | + background: #2600ff; | ||
| 150 | + color: #fff; | ||
| 151 | + padding: 2px 5px; | ||
| 152 | + border-radius: 3px; | ||
| 153 | + } | ||
| 154 | + </style> | ||
| 155 | +</head> | ||
| 156 | + | ||
| 157 | +<body style="height: 100%;overflow: hidden;"> | ||
| 158 | +<div class="north uk-width-1-1 uk-panel-box" style="background: #000;"> | ||
| 159 | + <div class="uk-grid uk-grid-match"> | ||
| 160 | + <div class="uk-width-4-10"> | ||
| 161 | + <div class="uk-panel"> | ||
| 162 | + <h2 class="north-logo" style="color: #f1f1f1;"> | ||
| 163 | + <i class="uk-icon-life-ring"></i> 闵行公交线路调度班次管理 | ||
| 164 | + </h2> | ||
| 165 | + </div> | ||
| 166 | + </div> | ||
| 167 | + </div> | ||
| 168 | +</div> | ||
| 169 | + | ||
| 170 | +<div class="main-container" style="height: calc(100% - 62px);"> | ||
| 171 | + <div style="height: 90px"> | ||
| 172 | + <div class="uk-panel uk-panel-box search-box"> | ||
| 173 | + <form class="uk-form search-form"> | ||
| 174 | + <fieldset data-uk-margin> | ||
| 175 | + <span class="horizontal-field">日期</span> | ||
| 176 | + <input type="date" name="scheduleDateStr_eq" disabled> | ||
| 177 | +   | ||
| 178 | + <span class="horizontal-field">线路</span> | ||
| 179 | + <select name="xlBm_eq"></select> | ||
| 180 | +   | ||
| 181 | + <span class="horizontal-field">车辆</span> | ||
| 182 | + <div class="uk-autocomplete uk-form autocomplete-cars"> | ||
| 183 | + <input type="text" name="clZbh_eq" placeholder="车辆自编号"> | ||
| 184 | + </div> | ||
| 185 | +   | ||
| 186 | + <span class="horizontal-field">驾驶员工号</span> | ||
| 187 | + <div class="uk-autocomplete uk-form autocomplete-persion"> | ||
| 188 | + <input type="text" name="jGh_eq" placeholder="驾驶员工号"> | ||
| 189 | + </div> | ||
| 190 | +   | ||
| 191 | + <button class="uk-button" id="searchSchBtn">检索</button> | ||
| 192 | + </fieldset> | ||
| 193 | + </form> | ||
| 194 | + </div> | ||
| 195 | + </div> | ||
| 196 | + <div class="uk-grid uk-grid-small uk-grid-divider " style="height: calc(100% - 120px)"> | ||
| 197 | + <div class="uk-width-1-2" style="padding-left: 45px;height: 100%;"> | ||
| 198 | + <div class="uk-overflow-container table-wrap up"> | ||
| 199 | + <table class="uk-table uk-table-striped uk-table-hover"> | ||
| 200 | + <thead> | ||
| 201 | + <tr> | ||
| 202 | + <th width="10%">序号</th> | ||
| 203 | + <th width="10%">路牌</th> | ||
| 204 | + <th width="15%">车辆</th> | ||
| 205 | + <th width="10%">应到</th> | ||
| 206 | + <th width="10%">实到</th> | ||
| 207 | + <th width="15%">计发</th> | ||
| 208 | + <th width="10%">待发</th> | ||
| 209 | + <th width="10%">实发</th> | ||
| 210 | + <th width="10%">备注</th> | ||
| 211 | + </tr> | ||
| 212 | + </thead> | ||
| 213 | + <tbody></tbody> | ||
| 214 | + </table> | ||
| 215 | + </div> | ||
| 216 | + | ||
| 217 | + </div> | ||
| 218 | + <div class="uk-width-1-2 " style="padding-right: 45px;height: 100%;"> | ||
| 219 | + <div class="uk-overflow-container table-wrap down"> | ||
| 220 | + <table class="uk-table uk-table-striped uk-table-hover"> | ||
| 221 | + <thead> | ||
| 222 | + <tr> | ||
| 223 | + <th width="10%">序号</th> | ||
| 224 | + <th width="10%">路牌</th> | ||
| 225 | + <th width="15%">车辆</th> | ||
| 226 | + <th width="10%">应到</th> | ||
| 227 | + <th width="10%">实到</th> | ||
| 228 | + <th width="15%">计发</th> | ||
| 229 | + <th width="10%">待发</th> | ||
| 230 | + <th width="10%">实发</th> | ||
| 231 | + <th width="10%">备注</th> | ||
| 232 | + </tr> | ||
| 233 | + </thead> | ||
| 234 | + <tbody> | ||
| 235 | + </tbody> | ||
| 236 | + </table> | ||
| 237 | + </div> | ||
| 238 | + </div> | ||
| 239 | + </div> | ||
| 240 | +</div> | ||
| 241 | + | ||
| 242 | +<div class="shade-loading"> | ||
| 243 | + <div class="center"> | ||
| 244 | + <i class="uk-icon-spinner uk-icon-spin"></i> 请稍等... | ||
| 245 | + </div> | ||
| 246 | +</div> | ||
| 247 | + | ||
| 248 | +<script id="sch-imitate-list-temp" type="text/html"> | ||
| 249 | + {{each list as sch i}} | ||
| 250 | + <tr data-id="{{sch.id}}"> | ||
| 251 | + <td>{{i + 1}}</td> | ||
| 252 | + <td>{{sch.lpName}}</td> | ||
| 253 | + <td>{{sch.clZbh}}</td> | ||
| 254 | + <td>{{sch.qdzArrDateJH}}</td> | ||
| 255 | + <td>{{sch.qdzArrDateSJ}}</td> | ||
| 256 | + <td>{{sch.fcsj}} | ||
| 257 | + {{if sch.bcType == "out"}} | ||
| 258 | + <span class="uk-badge uk-badge-success">出场</span> | ||
| 259 | + {{else if sch.bcType == "in"}} | ||
| 260 | + <span class="uk-badge uk-badge-warning">进场</span> | ||
| 261 | + {{else if sch.bcType == "venting"}} | ||
| 262 | + <span class="uk-badge uk-badge-danger">直放</span> | ||
| 263 | + {{else if sch.bcType == "major"}} | ||
| 264 | + <span class="uk-badge uk-badge-danger">放站</span> | ||
| 265 | + {{/if}} | ||
| 266 | + {{if sch.sflj}} | ||
| 267 | + <span class="uk-badge uk-badge-danger">临加</span> | ||
| 268 | + {{/if}} | ||
| 269 | + {{if sch.cTasks.length > 0}} | ||
| 270 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | ||
| 271 | + {{/if}} | ||
| 272 | + </td> | ||
| 273 | + <td>{{sch.dfsj}}</td> | ||
| 274 | + <td class="{{if sch.status==-1}} | ||
| 275 | + tl-qrlb | ||
| 276 | + {{else if sch.status==2}} | ||
| 277 | + tl-yzx | ||
| 278 | + {{else if sch.status==1}} | ||
| 279 | + tl-zzzx | ||
| 280 | + {{/if}}"> | ||
| 281 | + {{sch.fcsjActual}} | ||
| 282 | + | ||
| 283 | + </td> | ||
| 284 | + <td>{{sch.remarks}}</td> | ||
| 285 | + </tr> | ||
| 286 | + {{/each}} | ||
| 287 | +</script> | ||
| 288 | + | ||
| 289 | +<!-- jquery --> | ||
| 290 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | ||
| 291 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 292 | +<script src="/assets/plugins/jquery.serializejson.js"></script> | ||
| 293 | +<!-- moment.js 日期处理类库 --> | ||
| 294 | +<script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 295 | +<!-- common js --> | ||
| 296 | +<script src="/real_control_v2/js/common.js"></script> | ||
| 297 | +<!-- art-template 模版引擎 --> | ||
| 298 | +<script src="/assets/plugins/template.js"></script> | ||
| 299 | +<!-- EventProxy --> | ||
| 300 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 301 | +<!-- uikit core --> | ||
| 302 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js"></script> | ||
| 303 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js"></script> | ||
| 304 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js"></script> | ||
| 305 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script> | ||
| 306 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script> | ||
| 307 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js"></script> | ||
| 308 | + | ||
| 309 | +<!-- jquery contextMenu --> | ||
| 310 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js"></script> | ||
| 311 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js"></script> | ||
| 312 | +<!-- simple pinyin --> | ||
| 313 | +<script src="/assets/plugins/pinyin.js"></script> | ||
| 314 | +<script> | ||
| 315 | + | ||
| 316 | + $(document).ajaxComplete(function (event, jqxhr, settings, thrownError) { | ||
| 317 | + try { | ||
| 318 | + if (JSON.parse(jqxhr.responseText).status == 407) { | ||
| 319 | + window.location.href = '/'; | ||
| 320 | + } | ||
| 321 | + } catch (e) { | ||
| 322 | + | ||
| 323 | + } | ||
| 324 | + }); | ||
| 325 | + | ||
| 326 | + (function () { | ||
| 327 | + var dateStr = moment().format('YYYY-MM-DD') | ||
| 328 | + , dateInput = $('[name=scheduleDateStr_eq]'); | ||
| 329 | + dateInput.val(dateStr); | ||
| 330 | + | ||
| 331 | + var codeToName, schArray = {}; | ||
| 332 | + //线路 autocomplete | ||
| 333 | + $.get('/basic/lineCode2Name', function (rs) { | ||
| 334 | + var opts = ''; | ||
| 335 | + for (var code in rs) { | ||
| 336 | + opts += '<option value="' + code + '">' + rs[code] + '</option>'; | ||
| 337 | + } | ||
| 338 | + $('[name=xlBm_eq]').html(opts); | ||
| 339 | + }); | ||
| 340 | + | ||
| 341 | + //检索 | ||
| 342 | + $('.search-form').on('submit', function () { | ||
| 343 | + var data = $(this).serializeJSON(); | ||
| 344 | + data['scheduleDateStr_eq'] = dateInput.val(); | ||
| 345 | + | ||
| 346 | + gb_common.$get('/realSchedule/all', data, function (list) { | ||
| 347 | + $.each(list, function () { | ||
| 348 | + schArray[this.id] = this; | ||
| 349 | + }); | ||
| 350 | + var geoupData = gb_common.groupBy(list.sort(function (a, b) { | ||
| 351 | + return a.dfsj.localeCompare(b.dfsj); | ||
| 352 | + }), 'xlDir'); | ||
| 353 | + //上行 | ||
| 354 | + var htmlStr = template('sch-imitate-list-temp', {list: geoupData[0]}); | ||
| 355 | + $('.table-wrap.up table tbody').html(htmlStr); | ||
| 356 | + //下行 | ||
| 357 | + var htmlStr = template('sch-imitate-list-temp', {list: geoupData[1]}); | ||
| 358 | + $('.table-wrap.down table tbody').html(htmlStr); | ||
| 359 | + }); | ||
| 360 | + return false; | ||
| 361 | + }); | ||
| 362 | + | ||
| 363 | + //模拟轨迹 | ||
| 364 | + var gps_imitate = function (schId) { | ||
| 365 | + var sch = schArray[schId]; | ||
| 366 | + alt_confirm('确定班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () { | ||
| 367 | + $('.shade-loading').show(); | ||
| 368 | + gb_common.$post('/gps/gpsCompletion', {schId: schId}, function (rs) { | ||
| 369 | + | ||
| 370 | + }); | ||
| 371 | + }, '我确定是这个班次'); | ||
| 372 | + }; | ||
| 373 | + | ||
| 374 | + var callbackHandler = { | ||
| 375 | + gps_imitate: gps_imitate | ||
| 376 | + } | ||
| 377 | + | ||
| 378 | + $.contextMenu({ | ||
| 379 | + selector: '.table-wrap table tbody tr', | ||
| 380 | + //className: 'schedule-ct-menu', | ||
| 381 | + callback: function (key, options) { | ||
| 382 | + var schId = $('.table-wrap tr.context-menu-active').data('id'); | ||
| 383 | + callbackHandler[key] && callbackHandler[key](schId); | ||
| 384 | + }, | ||
| 385 | + items: { | ||
| 386 | + 'gps_imitate': { | ||
| 387 | + name: '模拟轨迹' | ||
| 388 | + } | ||
| 389 | + } | ||
| 390 | + }); | ||
| 391 | + | ||
| 392 | + | ||
| 393 | + var alt_confirm = function (content, succ, okBtn) { | ||
| 394 | + var modalEl = UIkit.modal.confirm(content, function () { | ||
| 395 | + succ && succ(); | ||
| 396 | + modalEl.hide(); | ||
| 397 | + }, { | ||
| 398 | + labels: { | ||
| 399 | + Ok: okBtn, | ||
| 400 | + Cancel: '取消' | ||
| 401 | + } | ||
| 402 | + , center: true | ||
| 403 | + }); | ||
| 404 | + }; | ||
| 405 | + })(); | ||
| 406 | +</script> | ||
| 407 | +</body> | ||
| 408 | + | ||
| 409 | +</html> |