Commit 4cd76de384455436a46e7de1fe8c89a7f7ea5599
Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into
minhang # Conflicts: # src/main/resources/application-dev.properties
Showing
99 changed files
with
32229 additions
and
3730 deletions
src/main/java/com/bsth/controller/BaseController2.java
| 1 | -package com.bsth.controller; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import com.bsth.common.ResponseCode; | ||
| 5 | -import com.bsth.service.BaseService; | ||
| 6 | -import com.bsth.service.schedule.utils.DataImportExportService; | ||
| 7 | -import com.google.common.base.Splitter; | ||
| 8 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | -import org.springframework.data.domain.Page; | ||
| 10 | -import org.springframework.data.domain.PageRequest; | ||
| 11 | -import org.springframework.data.domain.Sort; | ||
| 12 | -import org.springframework.web.bind.annotation.*; | ||
| 13 | -import org.springframework.web.multipart.MultipartFile; | ||
| 14 | - | ||
| 15 | -import javax.servlet.http.HttpServletResponse; | ||
| 16 | -import java.io.*; | ||
| 17 | -import java.util.ArrayList; | ||
| 18 | -import java.util.HashMap; | ||
| 19 | -import java.util.List; | ||
| 20 | -import java.util.Map; | ||
| 21 | - | ||
| 22 | -/** | ||
| 23 | - * Created by xu on 16/11/3. | ||
| 24 | - */ | ||
| 25 | -public class BaseController2<T, ID extends Serializable> { | ||
| 26 | - | ||
| 27 | - @Autowired | ||
| 28 | - protected BaseService<T, ID> baseService; | ||
| 29 | - @Autowired | ||
| 30 | - DataImportExportService dataImportExportService; | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * | ||
| 34 | - * @Title: list | ||
| 35 | - * @Description: TODO(多条件分页查询) | ||
| 36 | - * @param @param map 查询条件 | ||
| 37 | - * @param @param page 页码 | ||
| 38 | - * @param @param size 每页显示数量 | ||
| 39 | - * @throws | ||
| 40 | - */ | ||
| 41 | - @RequestMapping(method = RequestMethod.GET) | ||
| 42 | - public Page<T> list(@RequestParam Map<String, Object> map, | ||
| 43 | - @RequestParam(defaultValue = "0") int page, | ||
| 44 | - @RequestParam(defaultValue = "10") int size, | ||
| 45 | - @RequestParam(defaultValue = "id") String order, | ||
| 46 | - @RequestParam(defaultValue = "DESC") String direction){ | ||
| 47 | - | ||
| 48 | - // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | ||
| 49 | - // 多个字段格式:{col1},{col2},{col3},....,{coln} | ||
| 50 | - List<String> order_columns = Splitter.on(",").trimResults().splitToList(order); | ||
| 51 | - // 多字段排序:DESC,ASC... | ||
| 52 | - List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction); | ||
| 53 | - | ||
| 54 | - if (order_dirs.size() == 1) { // 所有字段采用一种排序 | ||
| 55 | - if (null != order_dirs.get(0) && order_dirs.get(0).equals("ASC")) { | ||
| 56 | - return baseService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns))); | ||
| 57 | - } else { | ||
| 58 | - return baseService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns))); | ||
| 59 | - } | ||
| 60 | - } else if (order_columns.size() == order_dirs.size()) { | ||
| 61 | - List<Sort.Order> orderList = new ArrayList<>(); | ||
| 62 | - for (int i = 0; i < order_columns.size(); i++) { | ||
| 63 | - if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) { | ||
| 64 | - orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i))); | ||
| 65 | - } else { | ||
| 66 | - orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i))); | ||
| 67 | - } | ||
| 68 | - } | ||
| 69 | - return baseService.list(map, new PageRequest(page, size, new Sort(orderList))); | ||
| 70 | - } else { | ||
| 71 | - throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); | ||
| 72 | - } | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - /** | ||
| 76 | - * | ||
| 77 | - * @Title: list | ||
| 78 | - * @Description: TODO(多条件查询) | ||
| 79 | - * @param @param map | ||
| 80 | - * @throws | ||
| 81 | - */ | ||
| 82 | - @RequestMapping(value = "/all", method = RequestMethod.GET) | ||
| 83 | - public Iterable<T> list(@RequestParam Map<String, Object> map){ | ||
| 84 | - return baseService.list(map); | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - /** | ||
| 88 | - * 这里保存直接返回保存后的对象,不自己定义Map返回了,和前端angularjs配合。 | ||
| 89 | - * form也可以提交,但是页面参数可能不全, | ||
| 90 | - * json的化比较灵活,但是貌似有多余属性也会报错,或者碰到lazy属性值,也有问题 | ||
| 91 | - * 不论form,还是json提交都能解决问题,就看哪个方便哪个来 | ||
| 92 | - * | ||
| 93 | - * @param t 参数需要使用@RequestBody转换json成对象 | ||
| 94 | - * @return | ||
| 95 | - */ | ||
| 96 | - @RequestMapping(method = RequestMethod.POST) | ||
| 97 | - public T save(@RequestBody T t) { | ||
| 98 | - baseService.save(t); | ||
| 99 | - return t; | ||
| 100 | - } | ||
| 101 | - | ||
| 102 | - @RequestMapping(value="/{id}", method = RequestMethod.POST) | ||
| 103 | - public T update(@RequestBody T t) { | ||
| 104 | - baseService.save(t); | ||
| 105 | - return t; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - /** | ||
| 109 | - * | ||
| 110 | - * @Title: findById | ||
| 111 | - * @Description: TODO(根据主键获取单个对象) | ||
| 112 | - * @param @param id | ||
| 113 | - * @throws | ||
| 114 | - */ | ||
| 115 | - @RequestMapping(value="/{id}",method = RequestMethod.GET) | ||
| 116 | - public T findById(@PathVariable("id") ID id){ | ||
| 117 | - return baseService.findById(id); | ||
| 118 | - } | ||
| 119 | - | ||
| 120 | - /** | ||
| 121 | - * | ||
| 122 | - * @Title: delete | ||
| 123 | - * @Description: TODO(根据主键删除对象) | ||
| 124 | - * @param @param id | ||
| 125 | - * @throws | ||
| 126 | - */ | ||
| 127 | - @RequestMapping(value="/{id}",method = RequestMethod.DELETE) | ||
| 128 | - public Map<String, Object> delete(@PathVariable("id") ID id){ | ||
| 129 | - return baseService.delete(id); | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - /** | ||
| 133 | - * 上传数据文件,并使用ktr转换文件导入数据。 | ||
| 134 | - * @param file | ||
| 135 | - * @return | ||
| 136 | - * @throws Exception | ||
| 137 | - */ | ||
| 138 | - @RequestMapping(value = "/dataImport", method = RequestMethod.POST) | ||
| 139 | - public Map<String, Object> uploadDataAndImport(MultipartFile file) throws Exception { | ||
| 140 | - Map<String, Object> resultMap = new HashMap<>(); | ||
| 141 | - | ||
| 142 | - try { | ||
| 143 | - // 获取ktr转换文件绝对路径 | ||
| 144 | - File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI()); | ||
| 145 | - System.out.println(ktrfile.getAbsolutePath()); | ||
| 146 | - // 导入数据 | ||
| 147 | - dataImportExportService.fileDataImport(file, ktrfile); | ||
| 148 | - | ||
| 149 | - resultMap.put("status", ResponseCode.SUCCESS); | ||
| 150 | - resultMap.put("msg", "导入成功"); | ||
| 151 | - } catch (Exception exp) { | ||
| 152 | - exp.printStackTrace(); | ||
| 153 | - resultMap.put("status", ResponseCode.ERROR); | ||
| 154 | - resultMap.put("msg", exp.getLocalizedMessage()); | ||
| 155 | - } | ||
| 156 | - | ||
| 157 | - return resultMap; | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - /** | ||
| 161 | - * 使用ktr导出数据。 | ||
| 162 | - * @param response | ||
| 163 | - * @throws Exception | ||
| 164 | - */ | ||
| 165 | - @RequestMapping(value = "/dataExport", method = RequestMethod.GET) | ||
| 166 | - public void dataExport(HttpServletResponse response) throws Exception { | ||
| 167 | - // 1、使用ktr转换获取输出文件 | ||
| 168 | - File ktrfile = new File(this.getClass().getResource(getDataExportKtrClasspath()).toURI()); | ||
| 169 | - File outputfile = dataImportExportService.fileDataOutput( | ||
| 170 | - getDataExportFilename(), | ||
| 171 | - ktrfile); | ||
| 172 | - | ||
| 173 | - System.out.println(outputfile.getName()); | ||
| 174 | - String filePath = outputfile.getAbsolutePath(); | ||
| 175 | - String fp[] = filePath.split(File.separator); | ||
| 176 | - String fileName = fp[fp.length - 1]; | ||
| 177 | - | ||
| 178 | - // TODO:使用ktr获取导出数据 | ||
| 179 | - | ||
| 180 | - response.setHeader("conent-type", "application/octet-stream"); | ||
| 181 | - response.setContentType("application/octet-stream"); | ||
| 182 | - response.setHeader("Content-Disposition", "attachment; filename=" + "东东"); | ||
| 183 | - | ||
| 184 | - OutputStream os = response.getOutputStream(); | ||
| 185 | - BufferedOutputStream bos = new BufferedOutputStream(os); | ||
| 186 | - | ||
| 187 | - InputStream is = null; | ||
| 188 | - | ||
| 189 | - is = new FileInputStream(filePath); | ||
| 190 | - BufferedInputStream bis = new BufferedInputStream(is); | ||
| 191 | - | ||
| 192 | - int length = 0; | ||
| 193 | - byte[] temp = new byte[1 * 1024 * 10]; | ||
| 194 | - | ||
| 195 | - while ((length = bis.read(temp)) != -1) { | ||
| 196 | - bos.write(temp, 0, length); | ||
| 197 | - } | ||
| 198 | - bos.flush(); | ||
| 199 | - bis.close(); | ||
| 200 | - bos.close(); | ||
| 201 | - is.close(); | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - /** | ||
| 205 | - * @return 数据导出的ktr转换文件类路径。 | ||
| 206 | - */ | ||
| 207 | - protected String getDataExportKtrClasspath() { | ||
| 208 | - // 默认返回异常,子类如果要使用导出功能,必须覆写此方法,指定ktr文件类路径 | ||
| 209 | - throw new RuntimeException("必须override,并指定ktr classpath"); | ||
| 210 | - } | ||
| 211 | - | ||
| 212 | - /** | ||
| 213 | - * @return 导出文件名。 | ||
| 214 | - */ | ||
| 215 | - protected String getDataExportFilename() { | ||
| 216 | - // 默认返回异常,子类如果要使用导出功能,必须覆写此方法,指定导出的文件路径名 | ||
| 217 | - throw new RuntimeException("必须override,并指定导出文件名"); | ||
| 218 | - } | ||
| 219 | - | ||
| 220 | - /** | ||
| 221 | - * @return 数据导入的ktr转换文件类路径。 | ||
| 222 | - */ | ||
| 223 | - protected String getDataImportKtrClasspath() { | ||
| 224 | - // 默认返回异常,子类如果要使用导入功能,必须覆写此方法,指定ktr文件类路径 | ||
| 225 | - throw new RuntimeException("必须override,并指定ktr classpath"); | ||
| 226 | - } | ||
| 227 | - | ||
| 228 | -} | 1 | +package com.bsth.controller; |
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.bsth.common.ResponseCode; | ||
| 5 | +import com.bsth.service.BaseService; | ||
| 6 | +import com.bsth.service.schedule.utils.DataImportExportService; | ||
| 7 | +import com.google.common.base.Splitter; | ||
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 9 | +import org.springframework.data.domain.Page; | ||
| 10 | +import org.springframework.data.domain.PageRequest; | ||
| 11 | +import org.springframework.data.domain.Sort; | ||
| 12 | +import org.springframework.web.bind.annotation.*; | ||
| 13 | +import org.springframework.web.multipart.MultipartFile; | ||
| 14 | + | ||
| 15 | +import javax.servlet.http.HttpServletResponse; | ||
| 16 | +import java.io.*; | ||
| 17 | +import java.util.ArrayList; | ||
| 18 | +import java.util.HashMap; | ||
| 19 | +import java.util.List; | ||
| 20 | +import java.util.Map; | ||
| 21 | + | ||
| 22 | +/** | ||
| 23 | + * Created by xu on 16/11/3. | ||
| 24 | + */ | ||
| 25 | +public class BaseController2<T, ID extends Serializable> { | ||
| 26 | + | ||
| 27 | + @Autowired | ||
| 28 | + protected BaseService<T, ID> baseService; | ||
| 29 | + @Autowired | ||
| 30 | + DataImportExportService dataImportExportService; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * | ||
| 34 | + * @Title: list | ||
| 35 | + * @Description: TODO(多条件分页查询) | ||
| 36 | + * @param @param map 查询条件 | ||
| 37 | + * @param @param page 页码 | ||
| 38 | + * @param @param size 每页显示数量 | ||
| 39 | + * @throws | ||
| 40 | + */ | ||
| 41 | + @RequestMapping(method = RequestMethod.GET) | ||
| 42 | + public Page<T> list(@RequestParam Map<String, Object> map, | ||
| 43 | + @RequestParam(defaultValue = "0") int page, | ||
| 44 | + @RequestParam(defaultValue = "10") int size, | ||
| 45 | + @RequestParam(defaultValue = "id") String order, | ||
| 46 | + @RequestParam(defaultValue = "DESC") String direction){ | ||
| 47 | + | ||
| 48 | + // 允许多个字段排序,order可以写单个字段,也可以写多个字段 | ||
| 49 | + // 多个字段格式:{col1},{col2},{col3},....,{coln} | ||
| 50 | + List<String> order_columns = Splitter.on(",").trimResults().splitToList(order); | ||
| 51 | + // 多字段排序:DESC,ASC... | ||
| 52 | + List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction); | ||
| 53 | + | ||
| 54 | + if (order_dirs.size() == 1) { // 所有字段采用一种排序 | ||
| 55 | + if (null != order_dirs.get(0) && order_dirs.get(0).equals("ASC")) { | ||
| 56 | + return baseService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns))); | ||
| 57 | + } else { | ||
| 58 | + return baseService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns))); | ||
| 59 | + } | ||
| 60 | + } else if (order_columns.size() == order_dirs.size()) { | ||
| 61 | + List<Sort.Order> orderList = new ArrayList<>(); | ||
| 62 | + for (int i = 0; i < order_columns.size(); i++) { | ||
| 63 | + if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) { | ||
| 64 | + orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i))); | ||
| 65 | + } else { | ||
| 66 | + orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i))); | ||
| 67 | + } | ||
| 68 | + } | ||
| 69 | + return baseService.list(map, new PageRequest(page, size, new Sort(orderList))); | ||
| 70 | + } else { | ||
| 71 | + throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致"); | ||
| 72 | + } | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * | ||
| 77 | + * @Title: list | ||
| 78 | + * @Description: TODO(多条件查询) | ||
| 79 | + * @param @param map | ||
| 80 | + * @throws | ||
| 81 | + */ | ||
| 82 | + @RequestMapping(value = "/all", method = RequestMethod.GET) | ||
| 83 | + public Iterable<T> list(@RequestParam Map<String, Object> map){ | ||
| 84 | + return baseService.list(map); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + /** | ||
| 88 | + * 这里保存直接返回保存后的对象,不自己定义Map返回了,和前端angularjs配合。 | ||
| 89 | + * form也可以提交,但是页面参数可能不全, | ||
| 90 | + * json的化比较灵活,但是貌似有多余属性也会报错,或者碰到lazy属性值,也有问题 | ||
| 91 | + * 不论form,还是json提交都能解决问题,就看哪个方便哪个来 | ||
| 92 | + * | ||
| 93 | + * @param t 参数需要使用@RequestBody转换json成对象 | ||
| 94 | + * @return | ||
| 95 | + */ | ||
| 96 | + @RequestMapping(method = RequestMethod.POST) | ||
| 97 | + public T save(@RequestBody T t) { | ||
| 98 | + baseService.save(t); | ||
| 99 | + return t; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + @RequestMapping(value="/{id}", method = RequestMethod.POST) | ||
| 103 | + public T update(@RequestBody T t) { | ||
| 104 | + baseService.save(t); | ||
| 105 | + return t; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * | ||
| 110 | + * @Title: findById | ||
| 111 | + * @Description: TODO(根据主键获取单个对象) | ||
| 112 | + * @param @param id | ||
| 113 | + * @throws | ||
| 114 | + */ | ||
| 115 | + @RequestMapping(value="/{id}",method = RequestMethod.GET) | ||
| 116 | + public T findById(@PathVariable("id") ID id){ | ||
| 117 | + return baseService.findById(id); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * | ||
| 122 | + * @Title: delete | ||
| 123 | + * @Description: TODO(根据主键删除对象) | ||
| 124 | + * @param @param id | ||
| 125 | + * @throws | ||
| 126 | + */ | ||
| 127 | + @RequestMapping(value="/{id}",method = RequestMethod.DELETE) | ||
| 128 | + public Map<String, Object> delete(@PathVariable("id") ID id){ | ||
| 129 | + return baseService.delete(id); | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + /** | ||
| 133 | + * 上传数据文件,并使用ktr转换文件导入数据。 | ||
| 134 | + * @param file | ||
| 135 | + * @return | ||
| 136 | + * @throws Exception | ||
| 137 | + */ | ||
| 138 | + @RequestMapping(value = "/dataImport", method = RequestMethod.POST) | ||
| 139 | + public Map<String, Object> uploadDataAndImport(MultipartFile file) throws Exception { | ||
| 140 | + Map<String, Object> resultMap = new HashMap<>(); | ||
| 141 | + | ||
| 142 | + try { | ||
| 143 | + // 获取ktr转换文件绝对路径 | ||
| 144 | + File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI()); | ||
| 145 | + System.out.println(ktrfile.getAbsolutePath()); | ||
| 146 | + // 导入数据 | ||
| 147 | + dataImportExportService.fileDataImport(file, ktrfile); | ||
| 148 | + | ||
| 149 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 150 | + resultMap.put("msg", "导入成功"); | ||
| 151 | + } catch (Exception exp) { | ||
| 152 | + exp.printStackTrace(); | ||
| 153 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 154 | + resultMap.put("msg", exp.getLocalizedMessage()); | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + return resultMap; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + /** | ||
| 161 | + * 使用ktr导出数据。 | ||
| 162 | + * @param response | ||
| 163 | + * @throws Exception | ||
| 164 | + */ | ||
| 165 | + @RequestMapping(value = "/dataExport", method = RequestMethod.GET) | ||
| 166 | + public void dataExport(HttpServletResponse response) throws Exception { | ||
| 167 | + // 1、使用ktr转换获取输出文件 | ||
| 168 | + File ktrfile = new File(this.getClass().getResource(getDataExportKtrClasspath()).toURI()); | ||
| 169 | + File outputfile = dataImportExportService.fileDataOutput( | ||
| 170 | + getDataExportFilename(), | ||
| 171 | + ktrfile); | ||
| 172 | + | ||
| 173 | + System.out.println(outputfile.getName()); | ||
| 174 | + String filePath = outputfile.getAbsolutePath(); | ||
| 175 | + String fp[] = filePath.split(File.separator); | ||
| 176 | + String fileName = fp[fp.length - 1]; | ||
| 177 | + | ||
| 178 | + // TODO:使用ktr获取导出数据 | ||
| 179 | + | ||
| 180 | + response.setHeader("conent-type", "application/octet-stream"); | ||
| 181 | + response.setContentType("application/octet-stream"); | ||
| 182 | + response.setHeader("Content-Disposition", "attachment; filename=" + "东东"); | ||
| 183 | + | ||
| 184 | + OutputStream os = response.getOutputStream(); | ||
| 185 | + BufferedOutputStream bos = new BufferedOutputStream(os); | ||
| 186 | + | ||
| 187 | + InputStream is = null; | ||
| 188 | + | ||
| 189 | + is = new FileInputStream(filePath); | ||
| 190 | + BufferedInputStream bis = new BufferedInputStream(is); | ||
| 191 | + | ||
| 192 | + int length = 0; | ||
| 193 | + byte[] temp = new byte[1 * 1024 * 10]; | ||
| 194 | + | ||
| 195 | + while ((length = bis.read(temp)) != -1) { | ||
| 196 | + bos.write(temp, 0, length); | ||
| 197 | + } | ||
| 198 | + bos.flush(); | ||
| 199 | + bis.close(); | ||
| 200 | + bos.close(); | ||
| 201 | + is.close(); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + /** | ||
| 205 | + * @return 数据导出的ktr转换文件类路径。 | ||
| 206 | + */ | ||
| 207 | + protected String getDataExportKtrClasspath() { | ||
| 208 | + // 默认返回异常,子类如果要使用导出功能,必须覆写此方法,指定ktr文件类路径 | ||
| 209 | + throw new RuntimeException("必须override,并指定ktr classpath"); | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + /** | ||
| 213 | + * @return 导出文件名。 | ||
| 214 | + */ | ||
| 215 | + protected String getDataExportFilename() { | ||
| 216 | + // 默认返回异常,子类如果要使用导出功能,必须覆写此方法,指定导出的文件路径名 | ||
| 217 | + throw new RuntimeException("必须override,并指定导出文件名"); | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + /** | ||
| 221 | + * @return 数据导入的ktr转换文件类路径。 | ||
| 222 | + */ | ||
| 223 | + protected String getDataImportKtrClasspath() { | ||
| 224 | + // 默认返回异常,子类如果要使用导入功能,必须覆写此方法,指定ktr文件类路径 | ||
| 225 | + throw new RuntimeException("必须override,并指定ktr classpath"); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | +} |
src/main/java/com/bsth/controller/DeviceGpsController.java
| 1 | package com.bsth.controller; | 1 | package com.bsth.controller; |
| 2 | 2 | ||
| 3 | +import java.io.BufferedOutputStream; | ||
| 3 | import java.io.BufferedReader; | 4 | import java.io.BufferedReader; |
| 4 | import java.io.File; | 5 | import java.io.File; |
| 5 | import java.io.FileInputStream; | 6 | import java.io.FileInputStream; |
| 6 | import java.io.IOException; | 7 | import java.io.IOException; |
| 7 | import java.io.InputStreamReader; | 8 | import java.io.InputStreamReader; |
| 9 | +import java.io.OutputStream; | ||
| 10 | +import java.text.SimpleDateFormat; | ||
| 8 | import java.util.ArrayList; | 11 | import java.util.ArrayList; |
| 12 | +import java.util.Date; | ||
| 9 | import java.util.HashMap; | 13 | import java.util.HashMap; |
| 10 | import java.util.List; | 14 | import java.util.List; |
| 11 | import java.util.Map; | 15 | import java.util.Map; |
| 12 | 16 | ||
| 13 | import javax.servlet.http.HttpServletRequest; | 17 | import javax.servlet.http.HttpServletRequest; |
| 18 | +import javax.servlet.http.HttpServletResponse; | ||
| 14 | 19 | ||
| 15 | import org.apache.commons.lang.StringEscapeUtils; | 20 | import org.apache.commons.lang.StringEscapeUtils; |
| 21 | +import org.apache.poi.hssf.usermodel.HSSFCell; | ||
| 22 | +import org.apache.poi.hssf.usermodel.HSSFRichTextString; | ||
| 23 | +import org.apache.poi.hssf.usermodel.HSSFRow; | ||
| 24 | +import org.apache.poi.hssf.usermodel.HSSFSheet; | ||
| 25 | +import org.apache.poi.hssf.usermodel.HSSFWorkbook; | ||
| 26 | +import org.springframework.beans.BeanUtils; | ||
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 27 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.util.StringUtils; | 28 | import org.springframework.util.StringUtils; |
| 18 | import org.springframework.web.bind.annotation.PathVariable; | 29 | import org.springframework.web.bind.annotation.PathVariable; |
| @@ -27,6 +38,7 @@ import com.bsth.data.gpsdata.GpsRealData; | @@ -27,6 +38,7 @@ import com.bsth.data.gpsdata.GpsRealData; | ||
| 27 | import com.fasterxml.jackson.core.JsonParseException; | 38 | import com.fasterxml.jackson.core.JsonParseException; |
| 28 | import com.fasterxml.jackson.databind.JsonMappingException; | 39 | import com.fasterxml.jackson.databind.JsonMappingException; |
| 29 | import com.fasterxml.jackson.databind.ObjectMapper; | 40 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 41 | +import com.fasterxml.jackson.databind.util.BeanUtil; | ||
| 30 | 42 | ||
| 31 | @RestController | 43 | @RestController |
| 32 | @RequestMapping("devicegps") | 44 | @RequestMapping("devicegps") |
| @@ -101,8 +113,8 @@ public class DeviceGpsController { | @@ -101,8 +113,8 @@ public class DeviceGpsController { | ||
| 101 | } | 113 | } |
| 102 | 114 | ||
| 103 | @SuppressWarnings("unchecked") | 115 | @SuppressWarnings("unchecked") |
| 104 | - @RequestMapping(value = "/open/filter", method = RequestMethod.POST) | ||
| 105 | - public Map<String, Object> filter(@RequestParam(value = "json")String json) { | 116 | + @RequestMapping(value = "/opened", method = RequestMethod.POST) |
| 117 | + public Map<String, Object> opened(@RequestParam(value = "json")String json) { | ||
| 106 | json = StringEscapeUtils.unescapeHtml(json); | 118 | json = StringEscapeUtils.unescapeHtml(json); |
| 107 | Map<String, Object> res = new HashMap<>(); | 119 | Map<String, Object> res = new HashMap<>(); |
| 108 | List<Map<String, Object>> data = null; | 120 | List<Map<String, Object>> data = null; |
| @@ -127,4 +139,122 @@ public class DeviceGpsController { | @@ -127,4 +139,122 @@ public class DeviceGpsController { | ||
| 127 | 139 | ||
| 128 | return res; | 140 | return res; |
| 129 | } | 141 | } |
| 142 | + | ||
| 143 | + @SuppressWarnings("unchecked") | ||
| 144 | + @RequestMapping(value = "/export", method = RequestMethod.POST) | ||
| 145 | + public void export(@RequestParam(value = "json")String json, HttpServletResponse response) { | ||
| 146 | + json = StringEscapeUtils.unescapeHtml(json); | ||
| 147 | + List<Map<String, Object>> data = null; | ||
| 148 | + OutputStream out = null; | ||
| 149 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 150 | + try { | ||
| 151 | + data = new ObjectMapper().readValue(json, List.class); | ||
| 152 | + for (Map<String, Object> info : data) { | ||
| 153 | + Map<String, Object> detail = (Map<String, Object>)info.get("detail"); | ||
| 154 | + if (detail != null) { | ||
| 155 | + info.put("lineId", detail.get("lineId")); | ||
| 156 | + info.put("valid", (int)detail.get("valid") == 0 ? "有效" : "无效"); | ||
| 157 | + info.put("timestamp", sdf.format(new Date((Long)detail.get("timestamp")))); | ||
| 158 | + info.put("version", detail.get("version")); | ||
| 159 | + } else { | ||
| 160 | + info.put("lineId", ""); | ||
| 161 | + info.put("valid", ""); | ||
| 162 | + info.put("timestamp", ""); | ||
| 163 | + info.put("version", ""); | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + List<Header> head = new ArrayList<>(); | ||
| 168 | + head.add(new Header("线路编码", "lineCode")); | ||
| 169 | + head.add(new Header("线路名称", "lineName")); | ||
| 170 | + head.add(new Header("内部编码", "inCode")); | ||
| 171 | + head.add(new Header("识别码", "deviceId")); | ||
| 172 | + head.add(new Header("线路ID", "lineId")); | ||
| 173 | + head.add(new Header("GPS", "valid")); | ||
| 174 | + head.add(new Header("report", "timestamp")); | ||
| 175 | + head.add(new Header("版本", "version")); | ||
| 176 | + | ||
| 177 | + // 清空response | ||
| 178 | + response.reset(); | ||
| 179 | + // 设置response的Header | ||
| 180 | + response.addHeader("Content-Disposition", "attachment;filename=" + System.currentTimeMillis() + ".xls"); | ||
| 181 | + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); | ||
| 182 | + out = new BufferedOutputStream(response.getOutputStream()); | ||
| 183 | + excel(head, data, out); | ||
| 184 | + out.flush(); | ||
| 185 | + } catch (JsonParseException e) { | ||
| 186 | + // TODO Auto-generated catch block | ||
| 187 | + e.printStackTrace(); | ||
| 188 | + } catch (JsonMappingException e) { | ||
| 189 | + // TODO Auto-generated catch block | ||
| 190 | + e.printStackTrace(); | ||
| 191 | + } catch (IOException e) { | ||
| 192 | + // TODO Auto-generated catch block | ||
| 193 | + e.printStackTrace(); | ||
| 194 | + } finally { | ||
| 195 | + try { | ||
| 196 | + if (out != null) out.close(); | ||
| 197 | + } catch (IOException e) { | ||
| 198 | + e.printStackTrace(); | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + private void excel(List<Header> head, List<Map<String, Object>> data, OutputStream out) throws IOException { | ||
| 204 | + // 声明一个工作薄 | ||
| 205 | + HSSFWorkbook wb = new HSSFWorkbook(); | ||
| 206 | + // 生成一个表格 | ||
| 207 | + HSSFSheet sheet = wb.createSheet("1"); | ||
| 208 | + // 产生表格标题行 | ||
| 209 | + HSSFRow row = sheet.createRow(0); | ||
| 210 | + for (int i = 0;i < head.size();i++) { | ||
| 211 | + HSSFCell cell = row.createCell(i); | ||
| 212 | + HSSFRichTextString text = new HSSFRichTextString(head.get(i).getDescribe()); | ||
| 213 | + cell.setCellValue(text); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + int rownum = 1; | ||
| 217 | + for (Map<String, Object> map : data) { | ||
| 218 | + HSSFRow r = sheet.createRow(rownum); | ||
| 219 | + for (int i = 0;i < head.size();i++) { | ||
| 220 | + HSSFCell cell = r.createCell(i); | ||
| 221 | + HSSFRichTextString text = new HSSFRichTextString(String.valueOf(map.get(head.get(i).getField()))); | ||
| 222 | + cell.setCellValue(text); | ||
| 223 | + } | ||
| 224 | + rownum++; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + wb.write(out); | ||
| 228 | + wb.close(); | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + final class Header { | ||
| 232 | + private String describe; | ||
| 233 | + private String field; | ||
| 234 | + | ||
| 235 | + Header(){ | ||
| 236 | + | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + Header(String describe, String field) { | ||
| 240 | + this.describe = describe; | ||
| 241 | + this.field = field; | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + public String getDescribe() { | ||
| 245 | + return describe; | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + public void setDescribe(String describe) { | ||
| 249 | + this.describe = describe; | ||
| 250 | + } | ||
| 251 | + | ||
| 252 | + public String getField() { | ||
| 253 | + return field; | ||
| 254 | + } | ||
| 255 | + | ||
| 256 | + public void setField(String field) { | ||
| 257 | + this.field = field; | ||
| 258 | + } | ||
| 259 | + } | ||
| 130 | } | 260 | } |
src/main/java/com/bsth/controller/directive/DirectiveController.java
| @@ -71,6 +71,30 @@ public class DirectiveController { | @@ -71,6 +71,30 @@ public class DirectiveController { | ||
| 71 | SysUser user = SecurityUtils.getCurrentUser(); | 71 | SysUser user = SecurityUtils.getCurrentUser(); |
| 72 | return directiveService.lineChange(nbbm, lineId, user.getUserName()); | 72 | return directiveService.lineChange(nbbm, lineId, user.getUserName()); |
| 73 | } | 73 | } |
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * | ||
| 77 | + * @Title: lineChangeByDevice | ||
| 78 | + * @Description: TODO(切换线路) | ||
| 79 | + * @param @param deviceId 设备编码 | ||
| 80 | + * @param @param lineId 新线路编码 | ||
| 81 | + * @throws | ||
| 82 | + */ | ||
| 83 | + @RequestMapping(value = "/lineChangeByDevice", method = RequestMethod.POST) | ||
| 84 | + public int lineChangeByDevice(@RequestParam String deviceId, @RequestParam String lineId){ | ||
| 85 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 86 | + return directiveService.lineChangeByDeviceId(deviceId, lineId, user.getUserName()); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + /** | ||
| 90 | + * 刷新线路文件 | ||
| 91 | + * @param deviceId 设备号 | ||
| 92 | + * @return | ||
| 93 | + */ | ||
| 94 | + @RequestMapping(value = "/refreshLineFile", method = RequestMethod.POST) | ||
| 95 | + public int refreshLineFile(@RequestParam String deviceId){ | ||
| 96 | + return directiveService.refreshLineFile(deviceId); | ||
| 97 | + } | ||
| 74 | 98 | ||
| 75 | /** | 99 | /** |
| 76 | * | 100 | * |
src/main/java/com/bsth/controller/gps/GpsController.java
| @@ -4,10 +4,7 @@ import java.util.List; | @@ -4,10 +4,7 @@ import java.util.List; | ||
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | 5 | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 8 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | -import org.springframework.web.bind.annotation.RestController; | 7 | +import org.springframework.web.bind.annotation.*; |
| 11 | 8 | ||
| 12 | import com.bsth.data.BasicData; | 9 | import com.bsth.data.BasicData; |
| 13 | import com.bsth.data.gpsdata.GpsEntity; | 10 | import com.bsth.data.gpsdata.GpsEntity; |
| @@ -46,6 +43,16 @@ public class GpsController { | @@ -46,6 +43,16 @@ public class GpsController { | ||
| 46 | return gpsRealData.get(Splitter.on(",").splitToList(lineCodes)); | 43 | return gpsRealData.get(Splitter.on(",").splitToList(lineCodes)); |
| 47 | } | 44 | } |
| 48 | 45 | ||
| 46 | + @RequestMapping(value = "/allDevices") | ||
| 47 | + public Iterable<String> allDevices(){ | ||
| 48 | + return gpsRealData.allDevices(); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + @RequestMapping(value = "/removeRealGps", method = RequestMethod.POST) | ||
| 52 | + public Map<String, Object> removeRealGps(@RequestParam String device){ | ||
| 53 | + return gpsService.removeRealGps(device); | ||
| 54 | + } | ||
| 55 | + | ||
| 49 | /** | 56 | /** |
| 50 | * | 57 | * |
| 51 | * @Title: history @Description: TODO(这个方法给测试页面用) @throws | 58 | * @Title: history @Description: TODO(这个方法给测试页面用) @throws |
src/main/java/com/bsth/controller/oil/YlbController.java
| @@ -125,4 +125,10 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -125,4 +125,10 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 125 | return baseService.list(map, new PageRequest(page, size, new Sort(d, list))); | 125 | return baseService.list(map, new PageRequest(page, size, new Sort(d, list))); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | + | ||
| 129 | + @RequestMapping(value="/oilListMonth") | ||
| 130 | + public List<Ylb> oilListMonth(@RequestParam String line,@RequestParam String date){ | ||
| 131 | + return yblService.oilListMonth(line, date); | ||
| 132 | + } | ||
| 133 | + | ||
| 128 | } | 134 | } |
src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
| @@ -21,13 +21,13 @@ public class LineConfigController extends BaseController<LineConfig, Integer>{ | @@ -21,13 +21,13 @@ public class LineConfigController extends BaseController<LineConfig, Integer>{ | ||
| 21 | LineConfigService lineConfigService; | 21 | LineConfigService lineConfigService; |
| 22 | 22 | ||
| 23 | @RequestMapping("/check") | 23 | @RequestMapping("/check") |
| 24 | - public Map<String, Object> check(@RequestParam Integer[] codeArray){ | 24 | + public Map<String, Object> check(@RequestParam String[] codeArray){ |
| 25 | return lineConfigService.check(codeArray); | 25 | return lineConfigService.check(codeArray); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | @RequestMapping("/init/{lineCode}") | 28 | @RequestMapping("/init/{lineCode}") |
| 29 | - public Integer init(@PathVariable("lineCode") Integer lineCode) throws Exception{ | ||
| 30 | - return lineConfigService.inti(lineCode); | 29 | + public Integer init(@PathVariable("lineCode") String lineCode) throws Exception{ |
| 30 | + return lineConfigService.init(lineCode); | ||
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | @RequestMapping(value = "/editTime", method = RequestMethod.POST) | 33 | @RequestMapping(value = "/editTime", method = RequestMethod.POST) |
src/main/java/com/bsth/controller/realcontrol/RealChartsController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol; | ||
| 2 | + | ||
| 3 | +import com.bsth.service.realcontrol.RealChartsService; | ||
| 4 | +import com.bsth.service.realcontrol.dto.CarOutRate; | ||
| 5 | +import com.bsth.service.realcontrol.dto.DeviceOnlineRate; | ||
| 6 | +import com.bsth.service.realcontrol.dto.StratEndPunctualityRate; | ||
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | +import org.springframework.web.bind.annotation.RestController; | ||
| 11 | + | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 线路调度统计图 | ||
| 16 | + * Created by panzhao on 2016/11/9. | ||
| 17 | + */ | ||
| 18 | +@RestController | ||
| 19 | +@RequestMapping("realCharts") | ||
| 20 | +public class RealChartsController { | ||
| 21 | + | ||
| 22 | + @Autowired | ||
| 23 | + RealChartsService realChartsService; | ||
| 24 | + | ||
| 25 | + @RequestMapping("deviceOnlineRate") | ||
| 26 | + public List<DeviceOnlineRate> deviceOnlineRate(@RequestParam String idx, @RequestParam String month){ | ||
| 27 | + return realChartsService.deviceOnlineRate(month, idx); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + @RequestMapping("carOutRate") | ||
| 31 | + public List<CarOutRate> carOutRate(@RequestParam String idx, @RequestParam String month){ | ||
| 32 | + return realChartsService.carOutRate(month, idx); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + @RequestMapping("stratEndPunctualityRate") | ||
| 36 | + public List<StratEndPunctualityRate> stratEndPunctualityRate(@RequestParam String idx, @RequestParam String month){ | ||
| 37 | + return realChartsService.stratEndPunctualityRate(month, idx); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @RequestMapping("sePunctualityRateLine") | ||
| 41 | + public List<StratEndPunctualityRate> sePunctualityRateLine(@RequestParam String idx, @RequestParam String month){ | ||
| 42 | + return realChartsService.sePunctualityRateLine(month, idx); | ||
| 43 | + } | ||
| 44 | +} |
src/main/java/com/bsth/controller/sys/util/RSAUtils.java
| @@ -10,10 +10,14 @@ import java.security.interfaces.RSAPublicKey; | @@ -10,10 +10,14 @@ import java.security.interfaces.RSAPublicKey; | ||
| 10 | import javax.crypto.Cipher; | 10 | import javax.crypto.Cipher; |
| 11 | 11 | ||
| 12 | import org.apache.commons.net.util.Base64; | 12 | import org.apache.commons.net.util.Base64; |
| 13 | +import org.slf4j.Logger; | ||
| 14 | +import org.slf4j.LoggerFactory; | ||
| 13 | 15 | ||
| 14 | public class RSAUtils { | 16 | public class RSAUtils { |
| 15 | private static final KeyPair keyPair = initKey(); | 17 | private static final KeyPair keyPair = initKey(); |
| 16 | - | 18 | + |
| 19 | + static Logger logger = LoggerFactory.getLogger(RSAUtils.class); | ||
| 20 | + | ||
| 17 | private static KeyPair initKey(){ | 21 | private static KeyPair initKey(){ |
| 18 | try { | 22 | try { |
| 19 | Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); | 23 | Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); |
| @@ -41,6 +45,7 @@ public class RSAUtils { | @@ -41,6 +45,7 @@ public class RSAUtils { | ||
| 41 | * @return | 45 | * @return |
| 42 | */ | 46 | */ |
| 43 | public static String decryptBase64(String string) { | 47 | public static String decryptBase64(String string) { |
| 48 | + logger.info("decryptBase64 -[" + string + "]"); | ||
| 44 | return new String(decrypt(Base64.decodeBase64(string))); | 49 | return new String(decrypt(Base64.decodeBase64(string))); |
| 45 | } | 50 | } |
| 46 | 51 |
src/main/java/com/bsth/data/LineConfigData.java
| @@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner { | @@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner { | ||
| 77 | * @Title: init | 77 | * @Title: init |
| 78 | * @Description: TODO(初始化配置信息) | 78 | * @Description: TODO(初始化配置信息) |
| 79 | */ | 79 | */ |
| 80 | - public void init(Integer lineCode) throws Exception{ | 80 | + public void init(String lineCode) throws Exception{ |
| 81 | LineConfig conf = new LineConfig(); | 81 | LineConfig conf = new LineConfig(); |
| 82 | //线路 | 82 | //线路 |
| 83 | Line line = lineService.findByLineCode(lineCode); | 83 | Line line = lineService.findByLineCode(lineCode); |
src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
| @@ -50,8 +50,8 @@ public class ArrivalData_GPS implements CommandLineRunner{ | @@ -50,8 +50,8 @@ public class ArrivalData_GPS implements CommandLineRunner{ | ||
| 50 | 50 | ||
| 51 | @Override | 51 | @Override |
| 52 | public void run(String... arg0) throws Exception { | 52 | public void run(String... arg0) throws Exception { |
| 53 | - logger.info("ArrivalData_GPS,30,10"); | ||
| 54 | - //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 40, 10, TimeUnit.SECONDS); | 53 | + logger.info("ArrivalData_GPS,100,10 @11-11"); |
| 54 | + //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 100, 10, TimeUnit.SECONDS); | ||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | @Component | 57 | @Component |
src/main/java/com/bsth/data/directive/DayOfDirectives.java
| @@ -91,9 +91,11 @@ public class DayOfDirectives { | @@ -91,9 +91,11 @@ public class DayOfDirectives { | ||
| 91 | break; | 91 | break; |
| 92 | case 1: | 92 | case 1: |
| 93 | d60.setReply46((short) 0);// 发送成功 | 93 | d60.setReply46((short) 0);// 发送成功 |
| 94 | + d60.setReply46Time(System.currentTimeMillis()); | ||
| 94 | break; | 95 | break; |
| 95 | case 2: | 96 | case 2: |
| 96 | d60.setReply47((short) 0);// 驾驶员阅读 | 97 | d60.setReply47((short) 0);// 驾驶员阅读 |
| 98 | + d60.setReply47Time(System.currentTimeMillis()); | ||
| 97 | break; | 99 | break; |
| 98 | } | 100 | } |
| 99 | // 入库 | 101 | // 入库 |
src/main/java/com/bsth/data/directive/DirectiveCreator.java
| @@ -122,30 +122,33 @@ public class DirectiveCreator { | @@ -122,30 +122,33 @@ public class DirectiveCreator { | ||
| 122 | 122 | ||
| 123 | /** | 123 | /** |
| 124 | * | 124 | * |
| 125 | - * @Title: createDirective64 | 125 | + * @Title: createD64 |
| 126 | * @Description: TODO(创建线路切换指令 64) | 126 | * @Description: TODO(创建线路切换指令 64) |
| 127 | * @param @param nbbm 车辆内部编码 | 127 | * @param @param nbbm 车辆内部编码 |
| 128 | * @param @param lineId 线路编码 | 128 | * @param @param lineId 线路编码 |
| 129 | * @param @param t 时间戳 | 129 | * @param @param t 时间戳 |
| 130 | * @throws | 130 | * @throws |
| 131 | - */ | 131 | + |
| 132 | public D64 createD64(String nbbm, String lineCode, long t){ | 132 | public D64 createD64(String nbbm, String lineCode, long t){ |
| 133 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); | 133 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); |
| 134 | + return create64(deviceId, lineCode, t); | ||
| 135 | + }*/ | ||
| 134 | 136 | ||
| 137 | + public D64 create64(String deviceId, String lineCode, long t){ | ||
| 135 | D64 change = new D64(); | 138 | D64 change = new D64(); |
| 136 | D64Data data = new D64Data(); | 139 | D64Data data = new D64Data(); |
| 137 | data.setCityCode(cityCode); | 140 | data.setCityCode(cityCode); |
| 138 | data.setDeviceId(deviceId); | 141 | data.setDeviceId(deviceId); |
| 139 | - | 142 | + |
| 140 | //线路编码补满6位数 | 143 | //线路编码补满6位数 |
| 141 | String lineCodeStr = padLeft(lineCode, 6, '0'); | 144 | String lineCodeStr = padLeft(lineCode, 6, '0'); |
| 142 | data.setLineId(lineCodeStr); | 145 | data.setLineId(lineCodeStr); |
| 143 | - | 146 | + |
| 144 | change.setDeviceId(deviceId); | 147 | change.setDeviceId(deviceId); |
| 145 | change.setOperCode((short) 0X64); | 148 | change.setOperCode((short) 0X64); |
| 146 | change.setTimestamp(t); | 149 | change.setTimestamp(t); |
| 147 | change.setData(data); | 150 | change.setData(data); |
| 148 | - | 151 | + |
| 149 | return change; | 152 | return change; |
| 150 | } | 153 | } |
| 151 | 154 |
src/main/java/com/bsth/data/forecast/ForecastRealServer.java
| @@ -61,7 +61,7 @@ public class ForecastRealServer implements CommandLineRunner { | @@ -61,7 +61,7 @@ public class ForecastRealServer implements CommandLineRunner { | ||
| 61 | @Override | 61 | @Override |
| 62 | public void run(String... arg0) throws Exception { | 62 | public void run(String... arg0) throws Exception { |
| 63 | //2小时更新一次站点间耗时数据 | 63 | //2小时更新一次站点间耗时数据 |
| 64 | - //Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); | 64 | + Application.mainServices.scheduleWithFixedDelay(dataLoader, 12, 120 * 60, TimeUnit.SECONDS); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | /** | 67 | /** |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| @@ -2,12 +2,7 @@ package com.bsth.data.gpsdata; | @@ -2,12 +2,7 @@ package com.bsth.data.gpsdata; | ||
| 2 | 2 | ||
| 3 | import java.io.BufferedReader; | 3 | import java.io.BufferedReader; |
| 4 | import java.io.InputStreamReader; | 4 | import java.io.InputStreamReader; |
| 5 | -import java.util.ArrayList; | ||
| 6 | -import java.util.Collection; | ||
| 7 | -import java.util.HashMap; | ||
| 8 | -import java.util.List; | ||
| 9 | -import java.util.Map; | ||
| 10 | -import java.util.NavigableSet; | 5 | +import java.util.*; |
| 11 | import java.util.concurrent.TimeUnit; | 6 | import java.util.concurrent.TimeUnit; |
| 12 | 7 | ||
| 13 | import org.apache.commons.lang3.StringUtils; | 8 | import org.apache.commons.lang3.StringUtils; |
| @@ -137,6 +132,10 @@ public class GpsRealData implements CommandLineRunner{ | @@ -137,6 +132,10 @@ public class GpsRealData implements CommandLineRunner{ | ||
| 137 | list.addAll(getByLine(code)); | 132 | list.addAll(getByLine(code)); |
| 138 | return list; | 133 | return list; |
| 139 | } | 134 | } |
| 135 | + | ||
| 136 | + public Set<String> allDevices(){ | ||
| 137 | + return gpsMap.keySet(); | ||
| 138 | + } | ||
| 140 | 139 | ||
| 141 | public GpsEntity findByDeviceId(String deviceId) { | 140 | public GpsEntity findByDeviceId(String deviceId) { |
| 142 | return gpsMap.get(deviceId); | 141 | return gpsMap.get(deviceId); |
| @@ -145,7 +144,10 @@ public class GpsRealData implements CommandLineRunner{ | @@ -145,7 +144,10 @@ public class GpsRealData implements CommandLineRunner{ | ||
| 145 | public Collection<GpsEntity> all(){ | 144 | public Collection<GpsEntity> all(){ |
| 146 | return gpsMap.values(); | 145 | return gpsMap.values(); |
| 147 | } | 146 | } |
| 148 | - | 147 | + |
| 148 | + public void remove(String device){ | ||
| 149 | + gpsMap.remove(device); | ||
| 150 | + } | ||
| 149 | @Component | 151 | @Component |
| 150 | public static class GpsDataLoader extends Thread{ | 152 | public static class GpsDataLoader extends Thread{ |
| 151 | 153 |
src/main/java/com/bsth/data/pilot80/PilotReport.java
| @@ -85,13 +85,13 @@ public class PilotReport { | @@ -85,13 +85,13 @@ public class PilotReport { | ||
| 85 | 85 | ||
| 86 | //下发调度指令 | 86 | //下发调度指令 |
| 87 | directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); | 87 | directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); |
| 88 | - d80.setRemarks("计划出场时间:" + outSch.getDfsj()); | 88 | +/* d80.setRemarks("计划出场时间:" + outSch.getDfsj()); |
| 89 | //当前GPS位置 | 89 | //当前GPS位置 |
| 90 | GpsEntity gps = gpsRealData.get(d80.getDeviceId()); | 90 | GpsEntity gps = gpsRealData.get(d80.getDeviceId()); |
| 91 | if(null != gps) | 91 | if(null != gps) |
| 92 | - d80.addRemarks("<br> 位置:" + coordHtmlStr(gps)); | 92 | + d80.addRemarks("<br> 位置:" + coordHtmlStr(gps));*/ |
| 93 | 93 | ||
| 94 | - sendUtils.refreshSch(outSch); | 94 | + //sendUtils.refreshSch(outSch); |
| 95 | }else | 95 | }else |
| 96 | d80.setRemarks("没有出场计划"); | 96 | d80.setRemarks("没有出场计划"); |
| 97 | 97 |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| 1 | package com.bsth.data.schedule; | 1 | package com.bsth.data.schedule; |
| 2 | 2 | ||
| 3 | +import java.text.ParseException; | ||
| 3 | import java.text.SimpleDateFormat; | 4 | import java.text.SimpleDateFormat; |
| 4 | import java.util.ArrayList; | 5 | import java.util.ArrayList; |
| 5 | import java.util.Collection; | 6 | import java.util.Collection; |
| @@ -13,6 +14,9 @@ import java.util.Map; | @@ -13,6 +14,9 @@ import java.util.Map; | ||
| 13 | import java.util.Set; | 14 | import java.util.Set; |
| 14 | import java.util.concurrent.TimeUnit; | 15 | import java.util.concurrent.TimeUnit; |
| 15 | 16 | ||
| 17 | +import com.bsth.data.schedule.thread.SubmitToTrafficManage; | ||
| 18 | +import org.apache.commons.lang3.StringUtils; | ||
| 19 | +import org.joda.time.DateTime; | ||
| 16 | import org.joda.time.format.DateTimeFormat; | 20 | import org.joda.time.format.DateTimeFormat; |
| 17 | import org.joda.time.format.DateTimeFormatter; | 21 | import org.joda.time.format.DateTimeFormatter; |
| 18 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| @@ -115,6 +119,9 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -115,6 +119,9 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 115 | @Autowired | 119 | @Autowired |
| 116 | ScheduleLateThread scheduleLateThread; | 120 | ScheduleLateThread scheduleLateThread; |
| 117 | 121 | ||
| 122 | + @Autowired | ||
| 123 | + SubmitToTrafficManage submitToTrafficManage; | ||
| 124 | + | ||
| 118 | private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd") | 125 | private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd") |
| 119 | ,fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | 126 | ,fmtHHmm = DateTimeFormat.forPattern("HH:mm"); |
| 120 | 127 | ||
| @@ -123,11 +130,19 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -123,11 +130,19 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 123 | //翻班线程 | 130 | //翻班线程 |
| 124 | Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | 131 | Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 125 | //入库 | 132 | //入库 |
| 126 | - Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | 133 | + //Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); |
| 127 | //首班出场指令补发器 | 134 | //首班出场指令补发器 |
| 128 | - Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); | 135 | + //Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); |
| 129 | //班次误点扫描 | 136 | //班次误点扫描 |
| 130 | //Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | 137 | //Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); |
| 138 | + | ||
| 139 | + //每天凌晨2点20提交数据到运管处 | ||
| 140 | + long diff = (DateUtils.getTimestamp() + 1000*60*140) - System.currentTimeMillis(); | ||
| 141 | + if(diff < 0) | ||
| 142 | + diff+=(1000*60*60*24); | ||
| 143 | + | ||
| 144 | + logger.info(diff/1000/60 + "分钟之后提交到运管处"); | ||
| 145 | + //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS); | ||
| 131 | } | 146 | } |
| 132 | 147 | ||
| 133 | public Map<String, String> getCurrSchDate() { | 148 | public Map<String, String> getCurrSchDate() { |
| @@ -307,9 +322,28 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -307,9 +322,28 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 307 | // 转换为实际排班 | 322 | // 转换为实际排班 |
| 308 | realList = JSONArray.parseArray(JSON.toJSONString(planItr), ScheduleRealInfo.class); | 323 | realList = JSONArray.parseArray(JSON.toJSONString(planItr), ScheduleRealInfo.class); |
| 309 | 324 | ||
| 325 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); | ||
| 326 | + String fcsj; | ||
| 310 | for (ScheduleRealInfo sch : realList) { | 327 | for (ScheduleRealInfo sch : realList) { |
| 311 | sch.setScheduleDateStr(fmtyyyyMMdd.print(sch.getScheduleDate().getTime())); | 328 | sch.setScheduleDateStr(fmtyyyyMMdd.print(sch.getScheduleDate().getTime())); |
| 312 | sch.setRealExecDate(sch.getScheduleDateStr()); | 329 | sch.setRealExecDate(sch.getScheduleDateStr()); |
| 330 | + | ||
| 331 | + if(StringUtils.isEmpty(sch.getFcsj())) | ||
| 332 | + sch.setFcsj("00:00"); | ||
| 333 | + | ||
| 334 | + fcsj=sch.getFcsj().trim(); | ||
| 335 | + //处理一下发车时间格式没有:号的问题 | ||
| 336 | + if(fcsj.indexOf(":") == -1 && fcsj.length() >= 4){ | ||
| 337 | + sch.setFcsj(fcsj.substring(0, 2) + ":" + fcsj.substring(2, 4)); | ||
| 338 | + } | ||
| 339 | + | ||
| 340 | + try { | ||
| 341 | + sdf.parse(sch.getFcsj()); | ||
| 342 | + } catch (ParseException e) { | ||
| 343 | + //发车时间仍然校验不过的,直接写成00:00 | ||
| 344 | + sch.setFcsj("00:00"); | ||
| 345 | + } | ||
| 346 | + | ||
| 313 | // 计划终点时间 | 347 | // 计划终点时间 |
| 314 | if (sch.getBcsj() != null) { | 348 | if (sch.getBcsj() != null) { |
| 315 | sch.setZdsj(fmtHHmm.print(fmtHHmm.parseMillis(sch.getFcsj()) + (sch.getBcsj() * 60 * 1000))); | 349 | sch.setZdsj(fmtHHmm.print(fmtHHmm.parseMillis(sch.getFcsj()) + (sch.getBcsj() * 60 * 1000))); |
src/main/java/com/bsth/data/schedule/thread/SubmitToTrafficManage.java
0 → 100644
| 1 | +package com.bsth.data.schedule.thread; | ||
| 2 | + | ||
| 3 | +import com.bsth.service.TrafficManageService; | ||
| 4 | +import org.slf4j.Logger; | ||
| 5 | +import org.slf4j.LoggerFactory; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.stereotype.Component; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 运营数据提交到运管处 | ||
| 11 | + * Created by panzhao on 2016/11/9. | ||
| 12 | + */ | ||
| 13 | +@Component | ||
| 14 | +public class SubmitToTrafficManage extends Thread{ | ||
| 15 | + | ||
| 16 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 17 | + | ||
| 18 | + @Autowired | ||
| 19 | + TrafficManageService trafficManageService; | ||
| 20 | + | ||
| 21 | + @Override | ||
| 22 | + public void run() { | ||
| 23 | + logger.info("开始提交数据到运管处..."); | ||
| 24 | + try { | ||
| 25 | + //路单 | ||
| 26 | + trafficManageService.setLD(); | ||
| 27 | + } catch (Exception e) { | ||
| 28 | + logger.error("提交路单到运管处失败", e); | ||
| 29 | + } | ||
| 30 | + try { | ||
| 31 | + //车辆里程、油耗 | ||
| 32 | + trafficManageService.setLCYH(); | ||
| 33 | + } catch (Exception e) { | ||
| 34 | + logger.error("提交车辆里程、油耗到运管处失败", e); | ||
| 35 | + } | ||
| 36 | + try { | ||
| 37 | + //线路调度日报 | ||
| 38 | + trafficManageService.setDDRB(); | ||
| 39 | + } catch (Exception e) { | ||
| 40 | + logger.error("提交线路调度日报到运管处失败", e); | ||
| 41 | + } | ||
| 42 | + try { | ||
| 43 | + //线路计划班次表 | ||
| 44 | + trafficManageService.setJHBC(); | ||
| 45 | + } catch (Exception e) { | ||
| 46 | + logger.error("提交线路计划班次表到运管处失败", e); | ||
| 47 | + } | ||
| 48 | + logger.info("提交数据到运管处结束!"); | ||
| 49 | + } | ||
| 50 | +} |
src/main/java/com/bsth/oplog/db/DBHelper.java
| @@ -43,6 +43,6 @@ public class DBHelper implements CommandLineRunner{ | @@ -43,6 +43,6 @@ public class DBHelper implements CommandLineRunner{ | ||
| 43 | 43 | ||
| 44 | @Override | 44 | @Override |
| 45 | public void run(String... arg0) throws Exception { | 45 | public void run(String... arg0) throws Exception { |
| 46 | - Application.mainServices.scheduleWithFixedDelay(fixedTimeThread, fixedMinute, fixedMinute, TimeUnit.MINUTES); | 46 | + //Application.mainServices.scheduleWithFixedDelay(fixedTimeThread, fixedMinute, fixedMinute, TimeUnit.MINUTES); |
| 47 | } | 47 | } |
| 48 | } | 48 | } |
src/main/java/com/bsth/service/LineService.java
| @@ -26,5 +26,5 @@ public interface LineService extends BaseService<Line, Integer> { | @@ -26,5 +26,5 @@ public interface LineService extends BaseService<Line, Integer> { | ||
| 26 | */ | 26 | */ |
| 27 | long selectMaxIdToLineCode(); | 27 | long selectMaxIdToLineCode(); |
| 28 | 28 | ||
| 29 | - Line findByLineCode(Integer lineCode); | 29 | + Line findByLineCode(String lineCode); |
| 30 | } | 30 | } |
src/main/java/com/bsth/service/directive/DirectiveService.java
| @@ -55,8 +55,10 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | @@ -55,8 +55,10 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | ||
| 55 | * @throws | 55 | * @throws |
| 56 | */ | 56 | */ |
| 57 | int lineChange(String nbbm, String lineId, String sender); | 57 | int lineChange(String nbbm, String lineId, String sender); |
| 58 | - | ||
| 59 | - /** | 58 | + |
| 59 | + int lineChangeByDeviceId(String deviceId, String lineCode, String sender); | ||
| 60 | + | ||
| 61 | + /** | ||
| 60 | * | 62 | * |
| 61 | * @Title: upDownChange | 63 | * @Title: upDownChange |
| 62 | * @Description: TODO(切换上下行) | 64 | * @Description: TODO(切换上下行) |
| @@ -89,4 +91,6 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | @@ -89,4 +91,6 @@ public interface DirectiveService extends BaseService<D60, Integer>{ | ||
| 89 | int sendC0A3(DC0_A3 c0a4); | 91 | int sendC0A3(DC0_A3 c0a4); |
| 90 | 92 | ||
| 91 | int sendC0A5(String json); | 93 | int sendC0A5(String json); |
| 94 | + | ||
| 95 | + int refreshLineFile(String deviceId); | ||
| 92 | } | 96 | } |
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
| @@ -222,18 +222,23 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -222,18 +222,23 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 222 | */ | 222 | */ |
| 223 | @Override | 223 | @Override |
| 224 | public int lineChange(String nbbm, String lineCode, String sender) { | 224 | public int lineChange(String nbbm, String lineCode, String sender) { |
| 225 | + return lineChangeByDeviceId(BasicData.deviceId2NbbmMap.inverse().get(nbbm), lineCode, sender); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + | ||
| 229 | + @Override | ||
| 230 | + public int lineChangeByDeviceId(String deviceId, String lineCode, String sender){ | ||
| 225 | DirectiveCreator crt = new DirectiveCreator(); | 231 | DirectiveCreator crt = new DirectiveCreator(); |
| 226 | - | ||
| 227 | Long t = System.currentTimeMillis(); | 232 | Long t = System.currentTimeMillis(); |
| 228 | //生成64数据包 | 233 | //生成64数据包 |
| 229 | - D64 d64 = crt.createD64(nbbm, lineCode, t); | ||
| 230 | - | 234 | + D64 d64 = crt.create64(deviceId, lineCode, t); |
| 235 | + | ||
| 231 | if(null != sender) | 236 | if(null != sender) |
| 232 | d64.setSender(sender); | 237 | d64.setSender(sender); |
| 233 | else | 238 | else |
| 234 | d64.setSender("系统"); | 239 | d64.setSender("系统"); |
| 235 | 240 | ||
| 236 | - String deviceId = d64.getDeviceId(); | 241 | + //String deviceId = d64.getDeviceId(); |
| 237 | int code = GatewayHttpUtils.postJson(JSON.toJSONString(d64)); | 242 | int code = GatewayHttpUtils.postJson(JSON.toJSONString(d64)); |
| 238 | // 入库 | 243 | // 入库 |
| 239 | d64.setHttpCode(code); | 244 | d64.setHttpCode(code); |
| @@ -332,6 +337,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -332,6 +337,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 332 | Map<String, Object> sockMap = new HashMap<>(); | 337 | Map<String, Object> sockMap = new HashMap<>(); |
| 333 | sockMap.put("fn", "d80Confirm"); | 338 | sockMap.put("fn", "d80Confirm"); |
| 334 | sockMap.put("id", d80.getId()); | 339 | sockMap.put("id", d80.getId()); |
| 340 | + sockMap.put("lineId", d80.getData().getLineId()); | ||
| 335 | socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), JSON.toJSONString(sockMap)); | 341 | socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), JSON.toJSONString(sockMap)); |
| 336 | } | 342 | } |
| 337 | 343 | ||
| @@ -463,7 +469,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -463,7 +469,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 463 | 469 | ||
| 464 | Map<String, Object> rsMap = new HashMap<>(); | 470 | Map<String, Object> rsMap = new HashMap<>(); |
| 465 | rsMap.put("list", rs); | 471 | rsMap.put("list", rs); |
| 466 | - rsMap.put("totalPages", count % size == 0 ? count / size : count / size + 1); | 472 | + rsMap.put("totalPages", count % size == 0 ? count / size -1 : count / size); |
| 467 | rsMap.put("page", page); | 473 | rsMap.put("page", page); |
| 468 | 474 | ||
| 469 | return rsMap; | 475 | return rsMap; |
| @@ -501,4 +507,13 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | @@ -501,4 +507,13 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen | ||
| 501 | public int sendC0A5(String json) { | 507 | public int sendC0A5(String json) { |
| 502 | return GatewayHttpUtils.postJson(json); | 508 | return GatewayHttpUtils.postJson(json); |
| 503 | } | 509 | } |
| 510 | + | ||
| 511 | + @Override | ||
| 512 | + public int refreshLineFile(String deviceId) { | ||
| 513 | + GpsEntity gps = gpsRealDataBuffer.get(deviceId); | ||
| 514 | + if(gps == null) | ||
| 515 | + return -1; | ||
| 516 | + | ||
| 517 | + return GatewayHttpUtils.postJson(new DirectiveCreator().createDeviceRefreshData(deviceId, gps.getLineId())); | ||
| 518 | + } | ||
| 504 | } | 519 | } |
src/main/java/com/bsth/service/gps/GpsService.java
| @@ -12,4 +12,6 @@ public interface GpsService { | @@ -12,4 +12,6 @@ public interface GpsService { | ||
| 12 | Map<String, Object> findBuffAeraByCode(String code, String type); | 12 | Map<String, Object> findBuffAeraByCode(String code, String type); |
| 13 | 13 | ||
| 14 | Map<String, Object> search(Map<String, Object> map, int page, int size, String order, String direction); | 14 | Map<String, Object> search(Map<String, Object> map, int page, int size, String order, String direction); |
| 15 | + | ||
| 16 | + Map<String,Object> removeRealGps(String device); | ||
| 15 | } | 17 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -14,6 +14,7 @@ import java.util.HashMap; | @@ -14,6 +14,7 @@ import java.util.HashMap; | ||
| 14 | import java.util.List; | 14 | import java.util.List; |
| 15 | import java.util.Map; | 15 | import java.util.Map; |
| 16 | 16 | ||
| 17 | +import org.apache.commons.lang3.StringUtils; | ||
| 17 | import org.slf4j.Logger; | 18 | import org.slf4j.Logger; |
| 18 | import org.slf4j.LoggerFactory; | 19 | import org.slf4j.LoggerFactory; |
| 19 | import org.springframework.beans.factory.annotation.Autowired; | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -32,372 +33,398 @@ import com.bsth.util.TransGPS.Location; | @@ -32,372 +33,398 @@ import com.bsth.util.TransGPS.Location; | ||
| 32 | import com.bsth.util.db.DBUtils_MS; | 33 | import com.bsth.util.db.DBUtils_MS; |
| 33 | 34 | ||
| 34 | @Service | 35 | @Service |
| 35 | -public class GpsServiceImpl implements GpsService{ | ||
| 36 | - /** 历史gps查询最大范围 24小时 */ | ||
| 37 | - final static Long GPS_RANGE = 60 * 60 * 24L; | ||
| 38 | - | ||
| 39 | - /** jdbc */ | ||
| 40 | - Connection conn = null; | ||
| 41 | - PreparedStatement ps = null; | ||
| 42 | - ResultSet rs = null; | ||
| 43 | - | ||
| 44 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 45 | - | ||
| 46 | - @Autowired | ||
| 47 | - GpsRealData gpsRealData; | ||
| 48 | - | ||
| 49 | - // 历史gps查询 | ||
| 50 | - @Override | ||
| 51 | - public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { | ||
| 52 | - Calendar sCal = Calendar.getInstance(); | ||
| 53 | - sCal.setTime(new Date(startTime)); | ||
| 54 | - | ||
| 55 | - Calendar eCal = Calendar.getInstance(); | ||
| 56 | - eCal.setTime(new Date(endTime)); | ||
| 57 | - | ||
| 58 | - int dayOfYear = sCal.get(Calendar.DAY_OF_YEAR); | ||
| 59 | - /* | 36 | +public class GpsServiceImpl implements GpsService { |
| 37 | + /** | ||
| 38 | + * 历史gps查询最大范围 24小时 | ||
| 39 | + */ | ||
| 40 | + final static Long GPS_RANGE = 60 * 60 * 24L; | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * jdbc | ||
| 44 | + */ | ||
| 45 | + Connection conn = null; | ||
| 46 | + PreparedStatement ps = null; | ||
| 47 | + ResultSet rs = null; | ||
| 48 | + | ||
| 49 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 50 | + | ||
| 51 | + @Autowired | ||
| 52 | + GpsRealData gpsRealData; | ||
| 53 | + | ||
| 54 | + // 历史gps查询 | ||
| 55 | + @Override | ||
| 56 | + public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { | ||
| 57 | + Calendar sCal = Calendar.getInstance(); | ||
| 58 | + sCal.setTime(new Date(startTime)); | ||
| 59 | + | ||
| 60 | + Calendar eCal = Calendar.getInstance(); | ||
| 61 | + eCal.setTime(new Date(endTime)); | ||
| 62 | + | ||
| 63 | + int dayOfYear = sCal.get(Calendar.DAY_OF_YEAR); | ||
| 64 | + /* | ||
| 60 | * if(dayOfYear != eCal.get(Calendar.DAY_OF_YEAR)){ | 65 | * if(dayOfYear != eCal.get(Calendar.DAY_OF_YEAR)){ |
| 61 | * System.out.println("暂时不支持跨天查询..."); return null; } | 66 | * System.out.println("暂时不支持跨天查询..."); return null; } |
| 62 | */ | 67 | */ |
| 63 | 68 | ||
| 64 | - String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO from bsth_c_gps_info where days_year=? and device_id=? and ts > ? and ts < ?"; | ||
| 65 | - Connection conn = null; | ||
| 66 | - PreparedStatement ps = null; | ||
| 67 | - ResultSet rs = null; | ||
| 68 | - List<Map<String, Object>> list = new ArrayList<>(); | ||
| 69 | - Map<String, Object> map = null; | ||
| 70 | - try { | ||
| 71 | - conn = DBUtils_MS.getConnection(); | ||
| 72 | - ps = conn.prepareStatement(sql); | ||
| 73 | - ps.setInt(1, dayOfYear); | ||
| 74 | - ps.setString(2, device); | ||
| 75 | - ps.setLong(3, startTime); | ||
| 76 | - ps.setLong(4, endTime); | ||
| 77 | - | ||
| 78 | - rs = ps.executeQuery(); | ||
| 79 | - Float lon, lat; | ||
| 80 | - Location location; | ||
| 81 | - int upDown; | ||
| 82 | - while (rs.next()) { | ||
| 83 | - upDown = getUpOrDown(rs.getLong("SERVICE_STATE")); | ||
| 84 | - if (upDown != directions) | ||
| 85 | - continue; | ||
| 86 | - | ||
| 87 | - // to 百度坐标 | ||
| 88 | - lon = rs.getFloat("LON"); | ||
| 89 | - lat = rs.getFloat("LAT"); | ||
| 90 | - location = TransGPS.LocationMake(lon, lat); | ||
| 91 | - location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); | ||
| 92 | - | ||
| 93 | - map = new HashMap<>(); | ||
| 94 | - map.put("device", rs.getString("DEVICE_ID")); | ||
| 95 | - map.put("lon", location.getLng()); | ||
| 96 | - map.put("lat", location.getLat()); | ||
| 97 | - map.put("ts", rs.getLong("TS")); | ||
| 98 | - map.put("stopNo", rs.getString("STOP_NO")); | ||
| 99 | - map.put("inout_stop", rs.getInt("INOUT_STOP")); | ||
| 100 | - // 上下行 | ||
| 101 | - map.put("upDown", upDown); | ||
| 102 | - list.add(map); | ||
| 103 | - } | ||
| 104 | - } catch (Exception e) { | ||
| 105 | - e.printStackTrace(); | ||
| 106 | - } finally { | ||
| 107 | - DBUtils_MS.close(rs, ps, conn); | ||
| 108 | - } | ||
| 109 | - return list; | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - /** | ||
| 113 | - * 王通 2016/6/29 9:23:24 获取车辆线路上下行 | ||
| 114 | - * | ||
| 115 | - * @return -1无效 0上行 1下行 | ||
| 116 | - */ | ||
| 117 | - public static byte getUpOrDown(long serviceState) { | ||
| 118 | - if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000 | ||
| 119 | - || (serviceState & 0x01000000) == 0x01000000 || (serviceState & 0x08000000) == 0x08000000) | ||
| 120 | - return -1; | ||
| 121 | - return (byte) (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0); | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - @Override | ||
| 125 | - public List<Map<String, Object>> history(String[] nbbmArray, Long st, Long et) { | ||
| 126 | - List<Map<String, Object>> list = new ArrayList<>(); | ||
| 127 | - // 超过最大查询范围,直接忽略 | ||
| 128 | - if (et - st > GPS_RANGE) | ||
| 129 | - return list; | ||
| 130 | - | ||
| 131 | - // 车辆编码转换成设备号 | ||
| 132 | - String[] devices = new String[nbbmArray.length]; | ||
| 133 | - for (int i = 0; i < nbbmArray.length; i++) { | ||
| 134 | - devices[i] = BasicData.deviceId2NbbmMap.inverse().get(nbbmArray[i]); | ||
| 135 | - } | ||
| 136 | - // day_of_year | ||
| 137 | - Calendar sCal = Calendar.getInstance(); | ||
| 138 | - sCal.setTime(new Date(st * 1000)); | ||
| 139 | - int sDayOfYear = sCal.get(Calendar.DAY_OF_YEAR)/* 200 */; | ||
| 140 | - | ||
| 141 | - Calendar eCal = Calendar.getInstance(); | ||
| 142 | - eCal.setTime(new Date(et * 1000)); | ||
| 143 | - int eDayOfYear = eCal.get(Calendar.DAY_OF_YEAR)/* 200 */; | ||
| 144 | - | ||
| 145 | - Calendar weekCal = Calendar.getInstance(); | ||
| 146 | - | ||
| 147 | - // 如果是同一天 | ||
| 148 | - if (sDayOfYear == eDayOfYear) { | ||
| 149 | - weekCal.setTimeInMillis(st * 1000); | ||
| 150 | - list = findByTs(weekCal.get(Calendar.WEEK_OF_YEAR), sDayOfYear, st, et, devices); | ||
| 151 | - } else { | ||
| 152 | - // 跨天 | ||
| 153 | - Long tempSt = 0L, tempEt = 0L; | ||
| 154 | - for (int i = sDayOfYear; i <= eDayOfYear; i++) { | ||
| 155 | - | ||
| 156 | - if (i == sDayOfYear) { | ||
| 157 | - tempSt = st; | ||
| 158 | - tempEt = DateUtils.getTimesnight(sCal); | ||
| 159 | - } else if (i == eDayOfYear) { | ||
| 160 | - tempSt = DateUtils.getTimesmorning(sCal); | ||
| 161 | - tempEt = et; | ||
| 162 | - } else { | ||
| 163 | - tempSt = DateUtils.getTimesmorning(sCal); | ||
| 164 | - tempEt = DateUtils.getTimesnight(sCal); | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | - weekCal.setTimeInMillis(tempSt * 1000); | ||
| 168 | - list.addAll(findByTs(weekCal.get(Calendar.WEEK_OF_YEAR), i, tempSt, tempEt, devices)); | ||
| 169 | - // 加一天 | ||
| 170 | - sCal.add(Calendar.DATE, 1); | ||
| 171 | - } | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - // 按时间排序 | ||
| 175 | - Collections.sort(list, new Comparator<Map<String, Object>>() { | ||
| 176 | - | ||
| 177 | - @Override | ||
| 178 | - public int compare(Map<String, Object> o1, Map<String, Object> o2) { | ||
| 179 | - return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); | ||
| 180 | - } | ||
| 181 | - }); | ||
| 182 | - ; | ||
| 183 | - return list; | ||
| 184 | - } | ||
| 185 | - | ||
| 186 | - public List<Map<String, Object>> findByTs(int weekOfYear, int dayOfYear, Long st, Long et, String[] devices) { | ||
| 187 | - List<Map<String, Object>> list = new ArrayList<>(); | ||
| 188 | - Map<String, Object> map = null; | ||
| 189 | - | ||
| 190 | - // setArray 不好用,直接拼 in 语句 | ||
| 191 | - String inv = ""; | ||
| 192 | - for (String device : devices) | ||
| 193 | - inv += ("'" + device + "',"); | ||
| 194 | - inv = inv.substring(0, inv.length() - 1); | ||
| 195 | - | ||
| 196 | - // 查询到离站数据 | ||
| 197 | - Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear/* 30 */, st, et, inv); | ||
| 198 | - | ||
| 199 | - String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO from bsth_c_gps_info where days_year=? and device_id in (" | ||
| 200 | - + inv + ") and ts > ? and ts < ?"; | ||
| 201 | - try { | ||
| 202 | - conn = DBUtils_MS.getConnection(); | ||
| 203 | - ps = conn.prepareStatement(sql); | ||
| 204 | - ps.setInt(1, dayOfYear); | 69 | + String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO from bsth_c_gps_info where days_year=? and device_id=? and ts > ? and ts < ?"; |
| 70 | + Connection conn = null; | ||
| 71 | + PreparedStatement ps = null; | ||
| 72 | + ResultSet rs = null; | ||
| 73 | + List<Map<String, Object>> list = new ArrayList<>(); | ||
| 74 | + Map<String, Object> map = null; | ||
| 75 | + try { | ||
| 76 | + conn = DBUtils_MS.getConnection(); | ||
| 77 | + ps = conn.prepareStatement(sql); | ||
| 78 | + ps.setInt(1, dayOfYear); | ||
| 79 | + ps.setString(2, device); | ||
| 80 | + ps.setLong(3, startTime); | ||
| 81 | + ps.setLong(4, endTime); | ||
| 82 | + | ||
| 83 | + rs = ps.executeQuery(); | ||
| 84 | + Float lon, lat; | ||
| 85 | + Location location; | ||
| 86 | + int upDown; | ||
| 87 | + while (rs.next()) { | ||
| 88 | + upDown = getUpOrDown(rs.getLong("SERVICE_STATE")); | ||
| 89 | + if (upDown != directions) | ||
| 90 | + continue; | ||
| 91 | + | ||
| 92 | + // to 百度坐标 | ||
| 93 | + lon = rs.getFloat("LON"); | ||
| 94 | + lat = rs.getFloat("LAT"); | ||
| 95 | + location = TransGPS.LocationMake(lon, lat); | ||
| 96 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location)); | ||
| 97 | + | ||
| 98 | + map = new HashMap<>(); | ||
| 99 | + map.put("device", rs.getString("DEVICE_ID")); | ||
| 100 | + map.put("lon", location.getLng()); | ||
| 101 | + map.put("lat", location.getLat()); | ||
| 102 | + map.put("ts", rs.getLong("TS")); | ||
| 103 | + map.put("stopNo", rs.getString("STOP_NO")); | ||
| 104 | + map.put("inout_stop", rs.getInt("INOUT_STOP")); | ||
| 105 | + // 上下行 | ||
| 106 | + map.put("upDown", upDown); | ||
| 107 | + list.add(map); | ||
| 108 | + } | ||
| 109 | + } catch (Exception e) { | ||
| 110 | + e.printStackTrace(); | ||
| 111 | + } finally { | ||
| 112 | + DBUtils_MS.close(rs, ps, conn); | ||
| 113 | + } | ||
| 114 | + return list; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + /** | ||
| 118 | + * 王通 2016/6/29 9:23:24 获取车辆线路上下行 | ||
| 119 | + * | ||
| 120 | + * @return -1无效 0上行 1下行 | ||
| 121 | + */ | ||
| 122 | + public static byte getUpOrDown(long serviceState) { | ||
| 123 | + if ((serviceState & 0x00020000) == 0x00020000 || (serviceState & 0x80000000) == 0x80000000 | ||
| 124 | + || (serviceState & 0x01000000) == 0x01000000 || (serviceState & 0x08000000) == 0x08000000) | ||
| 125 | + return -1; | ||
| 126 | + return (byte) (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + @Override | ||
| 130 | + public List<Map<String, Object>> history(String[] nbbmArray, Long st, Long et) { | ||
| 131 | + List<Map<String, Object>> list = new ArrayList<>(); | ||
| 132 | + // 超过最大查询范围,直接忽略 | ||
| 133 | + if (et - st > GPS_RANGE) | ||
| 134 | + return list; | ||
| 135 | + | ||
| 136 | + // 车辆编码转换成设备号 | ||
| 137 | + String[] devices = new String[nbbmArray.length]; | ||
| 138 | + for (int i = 0; i < nbbmArray.length; i++) { | ||
| 139 | + devices[i] = BasicData.deviceId2NbbmMap.inverse().get(nbbmArray[i]); | ||
| 140 | + } | ||
| 141 | + // day_of_year | ||
| 142 | + Calendar sCal = Calendar.getInstance(); | ||
| 143 | + sCal.setTime(new Date(st * 1000)); | ||
| 144 | + int sDayOfYear = sCal.get(Calendar.DAY_OF_YEAR)/* 200 */; | ||
| 145 | + | ||
| 146 | + Calendar eCal = Calendar.getInstance(); | ||
| 147 | + eCal.setTime(new Date(et * 1000)); | ||
| 148 | + int eDayOfYear = eCal.get(Calendar.DAY_OF_YEAR)/* 200 */; | ||
| 149 | + | ||
| 150 | + Calendar weekCal = Calendar.getInstance(); | ||
| 151 | + | ||
| 152 | + // 如果是同一天 | ||
| 153 | + if (sDayOfYear == eDayOfYear) { | ||
| 154 | + weekCal.setTimeInMillis(st * 1000); | ||
| 155 | + list = findByTs(weekCal.get(Calendar.WEEK_OF_YEAR), sDayOfYear, st, et, devices); | ||
| 156 | + } else { | ||
| 157 | + // 跨天 | ||
| 158 | + Long tempSt = 0L, tempEt = 0L; | ||
| 159 | + for (int i = sDayOfYear; i <= eDayOfYear; i++) { | ||
| 160 | + | ||
| 161 | + if (i == sDayOfYear) { | ||
| 162 | + tempSt = st; | ||
| 163 | + tempEt = DateUtils.getTimesnight(sCal); | ||
| 164 | + } else if (i == eDayOfYear) { | ||
| 165 | + tempSt = DateUtils.getTimesmorning(sCal); | ||
| 166 | + tempEt = et; | ||
| 167 | + } else { | ||
| 168 | + tempSt = DateUtils.getTimesmorning(sCal); | ||
| 169 | + tempEt = DateUtils.getTimesnight(sCal); | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + weekCal.setTimeInMillis(tempSt * 1000); | ||
| 173 | + list.addAll(findByTs(weekCal.get(Calendar.WEEK_OF_YEAR), i, tempSt, tempEt, devices)); | ||
| 174 | + // 加一天 | ||
| 175 | + sCal.add(Calendar.DATE, 1); | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + // 按时间排序 | ||
| 180 | + Collections.sort(list, new Comparator<Map<String, Object>>() { | ||
| 181 | + | ||
| 182 | + @Override | ||
| 183 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | ||
| 184 | + return (int) (Long.parseLong(o1.get("ts").toString()) - Long.parseLong(o2.get("ts").toString())); | ||
| 185 | + } | ||
| 186 | + }); | ||
| 187 | + ; | ||
| 188 | + return list; | ||
| 189 | + } | ||
| 190 | + | ||
| 191 | + public List<Map<String, Object>> findByTs(int weekOfYear, int dayOfYear, Long st, Long et, String[] devices) { | ||
| 192 | + List<Map<String, Object>> list = new ArrayList<>(); | ||
| 193 | + Map<String, Object> map = null; | ||
| 194 | + | ||
| 195 | + // 直接拼 in 语句 | ||
| 196 | + String inv = ""; | ||
| 197 | + for (String device : devices) | ||
| 198 | + inv += ("'" + device + "',"); | ||
| 199 | + inv = inv.substring(0, inv.length() - 1); | ||
| 200 | + | ||
| 201 | + // 查询到离站数据 | ||
| 202 | + Map<String, ArrivalEntity> arrivalMap = findArrivalByTs(weekOfYear/* 30 */, st, et, inv); | ||
| 203 | + | ||
| 204 | + String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO from bsth_c_gps_info where days_year=? and device_id in (" | ||
| 205 | + + inv + ") and ts > ? and ts < ?"; | ||
| 206 | + try { | ||
| 207 | + conn = DBUtils_MS.getConnection(); | ||
| 208 | + ps = conn.prepareStatement(sql); | ||
| 209 | + ps.setInt(1, dayOfYear); | ||
| 205 | /* ps.setArray(2, conn.createArrayOf("VARCHAR", devices)); */ | 210 | /* ps.setArray(2, conn.createArrayOf("VARCHAR", devices)); */ |
| 206 | - ps.setLong(2, st * 1000); | ||
| 207 | - ps.setLong(3, et * 1000); | ||
| 208 | - | ||
| 209 | - rs = ps.executeQuery(); | ||
| 210 | - Float lon, lat; | ||
| 211 | - Location bdLoc, gdLoc; | ||
| 212 | - int upDown, inOutStop; | ||
| 213 | - ArrivalEntity arrival; | ||
| 214 | - while (rs.next()) { | ||
| 215 | - upDown = getUpOrDown(rs.getLong("SERVICE_STATE")); | ||
| 216 | - map = new HashMap<>(); | ||
| 217 | - | ||
| 218 | - lon = rs.getFloat("LON"); | ||
| 219 | - lat = rs.getFloat("LAT"); | ||
| 220 | - // 高德坐标 | ||
| 221 | - gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat)); | ||
| 222 | - map.put("gcj_lon", gdLoc.getLng()); | ||
| 223 | - map.put("gcj_lat", gdLoc.getLat()); | ||
| 224 | - // 百度坐标 | ||
| 225 | - bdLoc = TransGPS.bd_encrypt(gdLoc); | ||
| 226 | - map.put("bd_lon", bdLoc.getLng()); | ||
| 227 | - map.put("bd_lat", bdLoc.getLat()); | ||
| 228 | - | ||
| 229 | - map.put("deviceId", rs.getString("DEVICE_ID")); | ||
| 230 | - map.put("ts", rs.getLong("TS")); | ||
| 231 | - map.put("timestamp", rs.getLong("TS")); | ||
| 232 | - map.put("stopNo", rs.getString("STOP_NO")); | ||
| 233 | - | ||
| 234 | - inOutStop = rs.getInt("INOUT_STOP"); | ||
| 235 | - map.put("inout_stop", inOutStop); | ||
| 236 | - | ||
| 237 | - arrival = arrivalMap.get(rs.getString("DEVICE_ID") + "_" + rs.getLong("TS")); | ||
| 238 | - if (arrival != null) { | ||
| 239 | - map.put("inout_stop_info",arrival); | ||
| 240 | - map.put("inout_stop", arrival.getInOut()); | ||
| 241 | - } | ||
| 242 | - map.put("nbbm", BasicData.deviceId2NbbmMap.get(rs.getString("DEVICE_ID"))); | ||
| 243 | - map.put("state", 0); | ||
| 244 | - // 上下行 | ||
| 245 | - map.put("upDown", upDown); | ||
| 246 | - list.add(map); | ||
| 247 | - } | ||
| 248 | - } catch (Exception e) { | ||
| 249 | - logger.error("", e); | ||
| 250 | - } finally { | ||
| 251 | - DBUtils_MS.close(rs, ps, conn); | ||
| 252 | - } | ||
| 253 | - return list; | ||
| 254 | - } | ||
| 255 | - | ||
| 256 | - public Map<String, ArrivalEntity> findArrivalByTs(int weekOfYear, Long st, Long et, String devicesInSql) { | ||
| 257 | - Map<String, ArrivalEntity> map = new HashMap<>(); | ||
| 258 | - | ||
| 259 | - String sql = "SELECT DEVICE_ID,LINE_ID,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM bsth_c_arrival_info where weeks_year=? and device_id in (" | ||
| 260 | - + devicesInSql + ") and ts > ? and ts < ?"; | ||
| 261 | - try { | ||
| 262 | - conn = DBUtils_MS.getConnection(); | ||
| 263 | - ps = conn.prepareStatement(sql); | ||
| 264 | - ps.setInt(1, weekOfYear); | ||
| 265 | - ps.setLong(2, st * 1000); | ||
| 266 | - ps.setLong(3, et * 1000); | ||
| 267 | - | ||
| 268 | - rs = ps.executeQuery(); | ||
| 269 | - ArrivalEntity arr; | ||
| 270 | - int inOut; | ||
| 271 | - while (rs.next()) { | ||
| 272 | - arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), rs.getString("LINE_ID"), | ||
| 273 | - rs.getInt("UP_DOWN"), rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"), | ||
| 274 | - rs.getInt("WEEKS_YEAR"), BasicData.stationCode2NameMap.get(rs.getString("STOP_NO"))); | ||
| 275 | - | ||
| 276 | - // 设备号_时间戳_进出状态 为key | ||
| 277 | - // 反转进出状态 | ||
| 278 | - inOut = arr.getInOut() == 0 ? 1 : 0; | ||
| 279 | - map.put(arr.getDeviceId() + "_" + arr.getTs(), arr); | ||
| 280 | - } | ||
| 281 | - } catch (Exception e) { | ||
| 282 | - logger.error("", e); | ||
| 283 | - } finally { | ||
| 284 | - DBUtils_MS.close(rs, ps, conn); | ||
| 285 | - } | ||
| 286 | - return map; | ||
| 287 | - } | ||
| 288 | - | ||
| 289 | - | ||
| 290 | - @Autowired | ||
| 291 | - StationRepository stationRepository; | ||
| 292 | - | ||
| 293 | - @Autowired | ||
| 294 | - CarParkRepository carParkRepository; | ||
| 295 | - | ||
| 296 | - @Override | ||
| 297 | - public Map<String, Object> findBuffAeraByCode(String code, String type) { | ||
| 298 | - Object[][] obj = null; | ||
| 299 | - if(type.equals("station")) | ||
| 300 | - obj = stationRepository.bufferAera(code); | ||
| 301 | - else if(type.equals("park")) | ||
| 302 | - obj = carParkRepository.bufferAera(code); | ||
| 303 | - | ||
| 304 | - Map<String, Object> rs = new HashMap<>(); | ||
| 305 | - | ||
| 306 | - Object[] subObj = obj[0]; | ||
| 307 | - if(subObj != null && subObj.length == 6){ | ||
| 308 | - rs.put("polygon", subObj[0]); | ||
| 309 | - rs.put("type", subObj[1]); | ||
| 310 | - rs.put("cPoint", subObj[2]); | ||
| 311 | - rs.put("radius", subObj[3]); | ||
| 312 | - rs.put("code", subObj[4]); | ||
| 313 | - rs.put("text", subObj[5]); | ||
| 314 | - } | ||
| 315 | - | ||
| 316 | - return rs; | ||
| 317 | - } | ||
| 318 | - | ||
| 319 | - @Override | ||
| 320 | - public Map<String, Object> search(Map<String, Object> map, int page, int size, String order, String direction) { | ||
| 321 | - Map<String, Object> rsMap = new HashMap<>(); | ||
| 322 | - try{ | ||
| 323 | - //全量 | ||
| 324 | - Collection<GpsEntity> list = gpsRealData.all(); | ||
| 325 | - //过滤后的 | ||
| 326 | - List<GpsEntity> rs = new ArrayList<>(); | ||
| 327 | - Field[] fields = GpsEntity.class.getDeclaredFields(); | ||
| 328 | - //排序字段 | ||
| 329 | - Field orderField = null; | ||
| 330 | - //参与过滤的字段 | ||
| 331 | - List<Field> fs = new ArrayList<>(); | ||
| 332 | - for(Field f : fields){ | ||
| 333 | - f.setAccessible(true); | ||
| 334 | - if(map.containsKey(f.getName())) | ||
| 335 | - fs.add(f); | ||
| 336 | - | ||
| 337 | - if(f.getName().equals(order)) | ||
| 338 | - orderField = f; | ||
| 339 | - } | ||
| 340 | - //过滤数据 | ||
| 341 | - for(GpsEntity gps : list){ | ||
| 342 | - if(fieldEquals(fs, gps, map)) | ||
| 343 | - rs.add(gps); | ||
| 344 | - } | ||
| 345 | - | ||
| 346 | - //排序 | ||
| 347 | - if(null != orderField) | ||
| 348 | - sortGpsList(orderField, rs); | ||
| 349 | - | ||
| 350 | - //分页 | ||
| 351 | - int count = rs.size() | ||
| 352 | - ,s = page * size, e = s + size; | ||
| 353 | - if (e > count) | ||
| 354 | - e = count; | ||
| 355 | - | ||
| 356 | - rsMap.put("list", rs.subList(s, e)); | ||
| 357 | - rsMap.put("totalPages", count % size == 0 ? count / size : count / size + 1); | ||
| 358 | - rsMap.put("page", page); | ||
| 359 | - rsMap.put("status", ResponseCode.SUCCESS); | ||
| 360 | - }catch(Exception e){ | ||
| 361 | - logger.error("", e); | ||
| 362 | - rsMap.put("status", ResponseCode.ERROR); | ||
| 363 | - } | ||
| 364 | - return rsMap; | ||
| 365 | - } | ||
| 366 | - | ||
| 367 | - private void sortGpsList(final Field f, List<GpsEntity> rs) { | ||
| 368 | - Collections.sort(rs, new Comparator<GpsEntity>() { | ||
| 369 | - | ||
| 370 | - @Override | ||
| 371 | - public int compare(GpsEntity o1, GpsEntity o2) { | ||
| 372 | - try { | ||
| 373 | - if(f.get(o1) == f.get(o2)) | ||
| 374 | - return 0; | ||
| 375 | - | ||
| 376 | - if(null == f.get(o1)) | ||
| 377 | - return 1; | ||
| 378 | - | ||
| 379 | - if(null == f.get(o2)) | ||
| 380 | - return -1; | ||
| 381 | - | ||
| 382 | - return f.get(o1).toString().compareTo(f.get(o2).toString()); | ||
| 383 | - } catch (Exception e) { | ||
| 384 | - logger.error("", e); | ||
| 385 | - return -1; | ||
| 386 | - } | ||
| 387 | - } | ||
| 388 | - }); | ||
| 389 | - } | ||
| 390 | - | ||
| 391 | - public boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map){ | ||
| 392 | - try{ | ||
| 393 | - for(Field f : fs){ | ||
| 394 | - if(f.get(obj).toString().indexOf(map.get(f.getName()).toString()) == -1) | ||
| 395 | - return false; | ||
| 396 | - } | ||
| 397 | - }catch(Exception e){ | ||
| 398 | - logger.error("", e); | ||
| 399 | - return false; | ||
| 400 | - } | ||
| 401 | - return true; | ||
| 402 | - } | 211 | + ps.setLong(2, st * 1000); |
| 212 | + ps.setLong(3, et * 1000); | ||
| 213 | + | ||
| 214 | + rs = ps.executeQuery(); | ||
| 215 | + Float lon, lat; | ||
| 216 | + Location bdLoc, gdLoc; | ||
| 217 | + int upDown, inOutStop; | ||
| 218 | + ArrivalEntity arrival; | ||
| 219 | + while (rs.next()) { | ||
| 220 | + upDown = getUpOrDown(rs.getLong("SERVICE_STATE")); | ||
| 221 | + map = new HashMap<>(); | ||
| 222 | + | ||
| 223 | + lon = rs.getFloat("LON"); | ||
| 224 | + lat = rs.getFloat("LAT"); | ||
| 225 | + // 高德坐标 | ||
| 226 | + gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat)); | ||
| 227 | + map.put("gcj_lon", gdLoc.getLng()); | ||
| 228 | + map.put("gcj_lat", gdLoc.getLat()); | ||
| 229 | + // 百度坐标 | ||
| 230 | + bdLoc = TransGPS.bd_encrypt(gdLoc); | ||
| 231 | + map.put("bd_lon", bdLoc.getLng()); | ||
| 232 | + map.put("bd_lat", bdLoc.getLat()); | ||
| 233 | + | ||
| 234 | + map.put("deviceId", rs.getString("DEVICE_ID")); | ||
| 235 | + map.put("ts", rs.getLong("TS")); | ||
| 236 | + map.put("timestamp", rs.getLong("TS")); | ||
| 237 | + map.put("stopNo", rs.getString("STOP_NO")); | ||
| 238 | + | ||
| 239 | + inOutStop = rs.getInt("INOUT_STOP"); | ||
| 240 | + map.put("inout_stop", inOutStop); | ||
| 241 | + | ||
| 242 | + arrival = arrivalMap.get(rs.getString("DEVICE_ID") + "_" + rs.getLong("TS")); | ||
| 243 | + if (arrival != null) { | ||
| 244 | + map.put("inout_stop_info", arrival); | ||
| 245 | + map.put("inout_stop", arrival.getInOut()); | ||
| 246 | + } | ||
| 247 | + map.put("nbbm", BasicData.deviceId2NbbmMap.get(rs.getString("DEVICE_ID"))); | ||
| 248 | + map.put("state", 0); | ||
| 249 | + // 上下行 | ||
| 250 | + map.put("upDown", upDown); | ||
| 251 | + list.add(map); | ||
| 252 | + } | ||
| 253 | + } catch (Exception e) { | ||
| 254 | + logger.error("", e); | ||
| 255 | + } finally { | ||
| 256 | + DBUtils_MS.close(rs, ps, conn); | ||
| 257 | + } | ||
| 258 | + return list; | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + public Map<String, ArrivalEntity> findArrivalByTs(int weekOfYear, Long st, Long et, String devicesInSql) { | ||
| 262 | + Map<String, ArrivalEntity> map = new HashMap<>(); | ||
| 263 | + | ||
| 264 | + String sql = "SELECT DEVICE_ID,LINE_ID,STOP_NO,TS,UP_DOWN,IN_OUT,WEEKS_YEAR,CREATE_DATE FROM bsth_c_arrival_info where weeks_year=? and device_id in (" | ||
| 265 | + + devicesInSql + ") and ts > ? and ts < ?"; | ||
| 266 | + try { | ||
| 267 | + conn = DBUtils_MS.getConnection(); | ||
| 268 | + ps = conn.prepareStatement(sql); | ||
| 269 | + ps.setInt(1, weekOfYear); | ||
| 270 | + ps.setLong(2, st * 1000); | ||
| 271 | + ps.setLong(3, et * 1000); | ||
| 272 | + | ||
| 273 | + rs = ps.executeQuery(); | ||
| 274 | + ArrivalEntity arr; | ||
| 275 | + int inOut; | ||
| 276 | + while (rs.next()) { | ||
| 277 | + arr = new ArrivalEntity(rs.getString("DEVICE_ID"), rs.getLong("TS"), rs.getString("LINE_ID"), | ||
| 278 | + rs.getInt("UP_DOWN"), rs.getString("STOP_NO"), rs.getInt("IN_OUT"), rs.getLong("CREATE_DATE"), | ||
| 279 | + rs.getInt("WEEKS_YEAR"), BasicData.stationCode2NameMap.get(rs.getString("STOP_NO"))); | ||
| 280 | + | ||
| 281 | + // 设备号_时间戳_进出状态 为key | ||
| 282 | + // 反转进出状态 | ||
| 283 | + inOut = arr.getInOut() == 0 ? 1 : 0; | ||
| 284 | + map.put(arr.getDeviceId() + "_" + arr.getTs(), arr); | ||
| 285 | + } | ||
| 286 | + } catch (Exception e) { | ||
| 287 | + logger.error("", e); | ||
| 288 | + } finally { | ||
| 289 | + DBUtils_MS.close(rs, ps, conn); | ||
| 290 | + } | ||
| 291 | + return map; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + | ||
| 295 | + @Autowired | ||
| 296 | + StationRepository stationRepository; | ||
| 297 | + | ||
| 298 | + @Autowired | ||
| 299 | + CarParkRepository carParkRepository; | ||
| 300 | + | ||
| 301 | + @Override | ||
| 302 | + public Map<String, Object> findBuffAeraByCode(String code, String type) { | ||
| 303 | + Object[][] obj = null; | ||
| 304 | + if (type.equals("station")) | ||
| 305 | + obj = stationRepository.bufferAera(code); | ||
| 306 | + else if (type.equals("park")) | ||
| 307 | + obj = carParkRepository.bufferAera(code); | ||
| 308 | + | ||
| 309 | + Map<String, Object> rs = new HashMap<>(); | ||
| 310 | + | ||
| 311 | + Object[] subObj = obj[0]; | ||
| 312 | + if (subObj != null && subObj.length == 6) { | ||
| 313 | + rs.put("polygon", subObj[0]); | ||
| 314 | + rs.put("type", subObj[1]); | ||
| 315 | + rs.put("cPoint", subObj[2]); | ||
| 316 | + rs.put("radius", subObj[3]); | ||
| 317 | + rs.put("code", subObj[4]); | ||
| 318 | + rs.put("text", subObj[5]); | ||
| 319 | + } | ||
| 320 | + | ||
| 321 | + return rs; | ||
| 322 | + } | ||
| 323 | + | ||
| 324 | + @Override | ||
| 325 | + public Map<String, Object> search(Map<String, Object> map, int page, int size, String order, String direction) { | ||
| 326 | + Map<String, Object> rsMap = new HashMap<>(); | ||
| 327 | + try { | ||
| 328 | + //全量 | ||
| 329 | + List<GpsEntity> list = new ArrayList<>(gpsRealData.all()); | ||
| 330 | + //过滤后的 | ||
| 331 | + List<GpsEntity> rs = new ArrayList<>(); | ||
| 332 | + Field[] fields = GpsEntity.class.getDeclaredFields(); | ||
| 333 | + //排序字段 | ||
| 334 | + Field orderField = null; | ||
| 335 | + //参与过滤的字段 | ||
| 336 | + List<Field> fs = new ArrayList<>(); | ||
| 337 | + for (Field f : fields) { | ||
| 338 | + f.setAccessible(true); | ||
| 339 | + if (map.containsKey(f.getName())) | ||
| 340 | + fs.add(f); | ||
| 341 | + | ||
| 342 | + if (f.getName().equals(order)) | ||
| 343 | + orderField = f; | ||
| 344 | + } | ||
| 345 | + //过滤数据 | ||
| 346 | + for (GpsEntity gps : list) { | ||
| 347 | + if (fieldEquals(fs, gps, map)) | ||
| 348 | + rs.add(gps); | ||
| 349 | + } | ||
| 350 | + | ||
| 351 | + //排序 | ||
| 352 | +/* if (null != orderField) | ||
| 353 | + sortGpsList(orderField, rs);*/ | ||
| 354 | + //时间戳排序 | ||
| 355 | + Collections.sort(rs, new Comparator<GpsEntity>() { | ||
| 356 | + @Override | ||
| 357 | + public int compare(GpsEntity o1, GpsEntity o2) { | ||
| 358 | + return o2.getTimestamp().intValue() - o1.getTimestamp().intValue(); | ||
| 359 | + } | ||
| 360 | + }); | ||
| 361 | + | ||
| 362 | + //分页 | ||
| 363 | + int count = rs.size(), s = page * size, e = s + size; | ||
| 364 | + if (e > count) | ||
| 365 | + e = count; | ||
| 366 | + | ||
| 367 | + rsMap.put("list", rs.subList(s, e)); | ||
| 368 | + rsMap.put("totalPages", count % size == 0 ? count / size - 1 : count / size); | ||
| 369 | + rsMap.put("page", page); | ||
| 370 | + rsMap.put("status", ResponseCode.SUCCESS); | ||
| 371 | + } catch (Exception e) { | ||
| 372 | + logger.error("", e); | ||
| 373 | + rsMap.put("status", ResponseCode.ERROR); | ||
| 374 | + } | ||
| 375 | + return rsMap; | ||
| 376 | + } | ||
| 377 | + | ||
| 378 | + @Override | ||
| 379 | + public Map<String, Object> removeRealGps(String device) { | ||
| 380 | + Map<String, Object> rs = new HashMap<>(); | ||
| 381 | + try { | ||
| 382 | + | ||
| 383 | + gpsRealData.remove(device); | ||
| 384 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 385 | + }catch (Exception e){ | ||
| 386 | + rs.put("status", ResponseCode.ERROR); | ||
| 387 | + } | ||
| 388 | + return rs; | ||
| 389 | + } | ||
| 390 | + | ||
| 391 | + private void sortGpsList(final Field f, List<GpsEntity> rs) { | ||
| 392 | + Collections.sort(rs, new Comparator<GpsEntity>() { | ||
| 393 | + | ||
| 394 | + @Override | ||
| 395 | + public int compare(GpsEntity o1, GpsEntity o2) { | ||
| 396 | + try { | ||
| 397 | + if (f.get(o1) == f.get(o2)) | ||
| 398 | + return 0; | ||
| 399 | + | ||
| 400 | + if (null == f.get(o1)) | ||
| 401 | + return 1; | ||
| 402 | + | ||
| 403 | + if (null == f.get(o2)) | ||
| 404 | + return -1; | ||
| 405 | + | ||
| 406 | + return f.get(o1).toString().compareTo(f.get(o2).toString()); | ||
| 407 | + } catch (Exception e) { | ||
| 408 | + logger.error("", e); | ||
| 409 | + return -1; | ||
| 410 | + } | ||
| 411 | + } | ||
| 412 | + }); | ||
| 413 | + } | ||
| 414 | + | ||
| 415 | + public boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map) { | ||
| 416 | + try { | ||
| 417 | + for (Field f : fs) { | ||
| 418 | + if (StringUtils.isEmpty(map.get(f.getName()).toString())) | ||
| 419 | + continue; | ||
| 420 | + | ||
| 421 | + if (f.get(obj) == null || f.get(obj).toString().indexOf(map.get(f.getName()).toString()) == -1) | ||
| 422 | + return false; | ||
| 423 | + } | ||
| 424 | + } catch (Exception e) { | ||
| 425 | + logger.error("", e); | ||
| 426 | + return false; | ||
| 427 | + } | ||
| 428 | + return true; | ||
| 429 | + } | ||
| 403 | } | 430 | } |
src/main/java/com/bsth/service/impl/LineServiceImpl.java
| @@ -40,8 +40,8 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L | @@ -40,8 +40,8 @@ public class LineServiceImpl extends BaseServiceImpl<Line, Integer> implements L | ||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | @Override | 42 | @Override |
| 43 | - public Line findByLineCode(Integer lineCode) { | ||
| 44 | - return repository.findByLineCode(lineCode + ""); | 43 | + public Line findByLineCode(String lineCode) { |
| 44 | + return repository.findByLineCode(lineCode); | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | } | 47 | } |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| 1 | package com.bsth.service.impl; | 1 | package com.bsth.service.impl; |
| 2 | 2 | ||
| 3 | +import java.io.BufferedOutputStream; | ||
| 4 | +import java.io.File; | ||
| 5 | +import java.io.FileOutputStream; | ||
| 6 | +import java.io.IOException; | ||
| 3 | import java.sql.Connection; | 7 | import java.sql.Connection; |
| 4 | import java.sql.PreparedStatement; | 8 | import java.sql.PreparedStatement; |
| 5 | import java.sql.ResultSet; | 9 | import java.sql.ResultSet; |
| 6 | import java.text.DecimalFormat; | 10 | import java.text.DecimalFormat; |
| 7 | import java.text.SimpleDateFormat; | 11 | import java.text.SimpleDateFormat; |
| 8 | -import java.util.ArrayList; | ||
| 9 | -import java.util.Calendar; | ||
| 10 | import java.util.Date; | 12 | import java.util.Date; |
| 11 | import java.util.HashMap; | 13 | import java.util.HashMap; |
| 12 | import java.util.Iterator; | 14 | import java.util.Iterator; |
| @@ -20,7 +22,6 @@ import org.slf4j.LoggerFactory; | @@ -20,7 +22,6 @@ import org.slf4j.LoggerFactory; | ||
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | import org.springframework.data.domain.Sort; | 23 | import org.springframework.data.domain.Sort; |
| 22 | import org.springframework.data.domain.Sort.Direction; | 24 | import org.springframework.data.domain.Sort.Direction; |
| 23 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 24 | import org.springframework.stereotype.Service; | 25 | import org.springframework.stereotype.Service; |
| 25 | 26 | ||
| 26 | import com.bsth.data.BasicData; | 27 | import com.bsth.data.BasicData; |
| @@ -54,70 +55,70 @@ import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; | @@ -54,70 +55,70 @@ import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; | ||
| 54 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; | 55 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 55 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 56 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 56 | /** | 57 | /** |
| 57 | - * | ||
| 58 | - * @ClassName: LineServiceImpl(线路service业务层实现类) | ||
| 59 | - * | 58 | + * |
| 59 | + * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | ||
| 60 | + * | ||
| 60 | * @Extends : BaseService | 61 | * @Extends : BaseService |
| 61 | - * | ||
| 62 | - * @Description: TODO(线路service业务层) | ||
| 63 | - * | ||
| 64 | - * @Author bsth@lq | ||
| 65 | - * | ||
| 66 | - * @Date 2016年4月28日 上午9:21:17 | 62 | + * |
| 63 | + * @Description: TODO(运管处接口service业务层) | ||
| 64 | + * | ||
| 65 | + * @Author bsth@z | ||
| 66 | + * | ||
| 67 | + * @Date 2016年10月28日 上午9:21:17 | ||
| 67 | * | 68 | * |
| 68 | * @Version 公交调度系统BS版 0.1 | 69 | * @Version 公交调度系统BS版 0.1 |
| 69 | - * | 70 | + * |
| 70 | */ | 71 | */ |
| 71 | 72 | ||
| 72 | @Service | 73 | @Service |
| 73 | public class TrafficManageServiceImpl implements TrafficManageService{ | 74 | public class TrafficManageServiceImpl implements TrafficManageService{ |
| 74 | - | 75 | + |
| 75 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 76 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 76 | - | 77 | + |
| 77 | // 线路repository | 78 | // 线路repository |
| 78 | @Autowired | 79 | @Autowired |
| 79 | private LineRepository lineRepository; | 80 | private LineRepository lineRepository; |
| 80 | - | 81 | + |
| 81 | // 站点路由repository | 82 | // 站点路由repository |
| 82 | @Autowired | 83 | @Autowired |
| 83 | private StationRouteRepository stationRouteRepository; | 84 | private StationRouteRepository stationRouteRepository; |
| 84 | - | 85 | + |
| 85 | // 线路标准信息repository | 86 | // 线路标准信息repository |
| 86 | @Autowired | 87 | @Autowired |
| 87 | private LineInformationRepository lineInformationRepository; | 88 | private LineInformationRepository lineInformationRepository; |
| 88 | - | 89 | + |
| 89 | // 车辆repository | 90 | // 车辆repository |
| 90 | @Autowired | 91 | @Autowired |
| 91 | private CarsRepository carsRepository; | 92 | private CarsRepository carsRepository; |
| 92 | - | 93 | + |
| 93 | // 人员repository | 94 | // 人员repository |
| 94 | @Autowired | 95 | @Autowired |
| 95 | private PersonnelRepository personnelRepository; | 96 | private PersonnelRepository personnelRepository; |
| 96 | - | 97 | + |
| 97 | // 时刻模板repository | 98 | // 时刻模板repository |
| 98 | @Autowired | 99 | @Autowired |
| 99 | private TTInfoRepository ttInfoRepository; | 100 | private TTInfoRepository ttInfoRepository; |
| 100 | - | 101 | + |
| 101 | // 时刻模板明细repository | 102 | // 时刻模板明细repository |
| 102 | @Autowired | 103 | @Autowired |
| 103 | private TTInfoDetailRepository ttInfoDetailRepository; | 104 | private TTInfoDetailRepository ttInfoDetailRepository; |
| 104 | - | 105 | + |
| 105 | // 车辆配置信息repository | 106 | // 车辆配置信息repository |
| 106 | @Autowired | 107 | @Autowired |
| 107 | private CarConfigInfoRepository carConfigInfoRepository; | 108 | private CarConfigInfoRepository carConfigInfoRepository; |
| 108 | - | 109 | + |
| 109 | // 人员配置信息repository | 110 | // 人员配置信息repository |
| 110 | @Autowired | 111 | @Autowired |
| 111 | private EmployeeConfigInfoRepository employeeConfigInfoRepository; | 112 | private EmployeeConfigInfoRepository employeeConfigInfoRepository; |
| 112 | - | 113 | + |
| 113 | // 排班计划明细repository | 114 | // 排班计划明细repository |
| 114 | @Autowired | 115 | @Autowired |
| 115 | private SchedulePlanInfoRepository schedulePlanInfoRepository; | 116 | private SchedulePlanInfoRepository schedulePlanInfoRepository; |
| 116 | - | 117 | + |
| 117 | // 实际排班计划明细repository | 118 | // 实际排班计划明细repository |
| 118 | @Autowired | 119 | @Autowired |
| 119 | private ScheduleRealInfoRepository scheduleRealInfoRepository; | 120 | private ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 120 | - | 121 | + |
| 121 | // 运管处接口 | 122 | // 运管处接口 |
| 122 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); | 123 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); |
| 123 | private WebServiceSoap ssop ; | 124 | private WebServiceSoap ssop ; |
| @@ -130,18 +131,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -130,18 +131,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 130 | } | 131 | } |
| 131 | // 格式化 年月日时分秒 nyrsfm是年月日时分秒的拼音首字母 | 132 | // 格式化 年月日时分秒 nyrsfm是年月日时分秒的拼音首字母 |
| 132 | private SimpleDateFormat sdfnyrsfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 133 | private SimpleDateFormat sdfnyrsfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 133 | - | 134 | + |
| 134 | // 格式化 年月日 | 135 | // 格式化 年月日 |
| 135 | private SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd"); | 136 | private SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd"); |
| 136 | - | 137 | + |
| 137 | // 数字格式化 | 138 | // 数字格式化 |
| 138 | DecimalFormat format = new DecimalFormat("0.00"); | 139 | DecimalFormat format = new DecimalFormat("0.00"); |
| 139 | - | 140 | + |
| 140 | // 用户名 | 141 | // 用户名 |
| 141 | private final String userNameXl = "pudong"; | 142 | private final String userNameXl = "pudong"; |
| 142 | // 密码 | 143 | // 密码 |
| 143 | private final String passwordXl = "pudong123"; | 144 | private final String passwordXl = "pudong123"; |
| 144 | - | 145 | + |
| 145 | // 用户名 | 146 | // 用户名 |
| 146 | private final String userNameOther = "user"; | 147 | private final String userNameOther = "user"; |
| 147 | // 密码 | 148 | // 密码 |
| @@ -151,7 +152,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -151,7 +152,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 151 | */ | 152 | */ |
| 152 | @Override | 153 | @Override |
| 153 | public String setXL() { | 154 | public String setXL() { |
| 154 | - String result = "success"; | 155 | + String result = "failure"; |
| 155 | try { | 156 | try { |
| 156 | StringBuffer sBuffer = new StringBuffer(); ; | 157 | StringBuffer sBuffer = new StringBuffer(); ; |
| 157 | Iterator<Line> lineIterator = lineRepository.findAll().iterator(); | 158 | Iterator<Line> lineIterator = lineRepository.findAll().iterator(); |
| @@ -162,6 +163,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -162,6 +163,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 162 | sBuffer.append("<XLs>"); | 163 | sBuffer.append("<XLs>"); |
| 163 | while(lineIterator.hasNext()){ | 164 | while(lineIterator.hasNext()){ |
| 164 | line = lineIterator.next(); | 165 | line = lineIterator.next(); |
| 166 | + if(line.getLinePlayType() == null){ | ||
| 167 | + continue; | ||
| 168 | + } | ||
| 165 | if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ | 169 | if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ |
| 166 | continue; | 170 | continue; |
| 167 | } | 171 | } |
| @@ -199,23 +203,37 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -199,23 +203,37 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 199 | sBuffer.append("</XL>"); | 203 | sBuffer.append("</XL>"); |
| 200 | } | 204 | } |
| 201 | sBuffer.append("</XLs>"); | 205 | sBuffer.append("</XLs>"); |
| 206 | + System.out.println(sBuffer.toString()); | ||
| 202 | if(sBuffer.indexOf("<XL>") != -1){ | 207 | if(sBuffer.indexOf("<XL>") != -1){ |
| 203 | logger.info("setXL:"+sBuffer.toString()); | 208 | logger.info("setXL:"+sBuffer.toString()); |
| 204 | - portType.setXL(userNameXl, passwordXl, sBuffer.toString()); | 209 | + String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString()); |
| 210 | + String portArray[] = portResult.split("\n"); | ||
| 211 | + if(portArray.length >= 4){ | ||
| 212 | + // 返回数据的编码 | ||
| 213 | + String returnCode = portArray[1].substring(portArray[1].indexOf(">")+1,portArray[1].indexOf("</")); | ||
| 214 | + // 返回的信息 | ||
| 215 | + String returnDescription = portArray[2].substring(portArray[2].indexOf(">")+1,portArray[2].indexOf("</")); | ||
| 216 | + if(returnCode.equals("1")){ | ||
| 217 | + result = "success"; | ||
| 218 | + }else{ | ||
| 219 | + result = returnDescription; | ||
| 220 | + } | ||
| 221 | + } | ||
| 205 | } | 222 | } |
| 206 | } catch (Exception e) { | 223 | } catch (Exception e) { |
| 207 | e.printStackTrace(); | 224 | e.printStackTrace(); |
| 225 | + }finally{ | ||
| 226 | + logger.info("setXL:"+result); | ||
| 208 | } | 227 | } |
| 209 | - | ||
| 210 | return result; | 228 | return result; |
| 211 | } | 229 | } |
| 212 | - | 230 | + |
| 213 | /** | 231 | /** |
| 214 | * 上传车辆信息 | 232 | * 上传车辆信息 |
| 215 | */ | 233 | */ |
| 216 | @Override | 234 | @Override |
| 217 | public String setCL() { | 235 | public String setCL() { |
| 218 | - String result = "success"; | 236 | + String result = "failure"; |
| 219 | try { | 237 | try { |
| 220 | StringBuffer sBuffer =new StringBuffer(); | 238 | StringBuffer sBuffer =new StringBuffer(); |
| 221 | sBuffer.append("<CLs>"); | 239 | sBuffer.append("<CLs>"); |
| @@ -238,19 +256,23 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -238,19 +256,23 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 238 | } | 256 | } |
| 239 | sBuffer.append("</CLs>"); | 257 | sBuffer.append("</CLs>"); |
| 240 | logger.info("setCL:"+sBuffer.toString()); | 258 | logger.info("setCL:"+sBuffer.toString()); |
| 241 | - ssop.setCL(userNameOther, passwordOther, sBuffer.toString()); | 259 | + if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 260 | + result = "success"; | ||
| 261 | + } | ||
| 242 | } catch (Exception e) { | 262 | } catch (Exception e) { |
| 243 | e.printStackTrace(); | 263 | e.printStackTrace(); |
| 264 | + }finally{ | ||
| 265 | + logger.info("setCL:"+result); | ||
| 244 | } | 266 | } |
| 245 | return result; | 267 | return result; |
| 246 | } | 268 | } |
| 247 | - | 269 | + |
| 248 | /** | 270 | /** |
| 249 | * 上传司机信息 | 271 | * 上传司机信息 |
| 250 | */ | 272 | */ |
| 251 | @Override | 273 | @Override |
| 252 | public String setSJ() { | 274 | public String setSJ() { |
| 253 | - String result = "success"; | 275 | + String result = "failure"; |
| 254 | try { | 276 | try { |
| 255 | StringBuffer sBuffer =new StringBuffer(); | 277 | StringBuffer sBuffer =new StringBuffer(); |
| 256 | sBuffer.append("<SJs>"); | 278 | sBuffer.append("<SJs>"); |
| @@ -271,191 +293,274 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -271,191 +293,274 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 271 | } | 293 | } |
| 272 | sBuffer.append("</SJs>"); | 294 | sBuffer.append("</SJs>"); |
| 273 | logger.info("setSJ:"+sBuffer.toString()); | 295 | logger.info("setSJ:"+sBuffer.toString()); |
| 274 | - ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()); | 296 | + if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 297 | + result = "success"; | ||
| 298 | + }; | ||
| 275 | } catch (Exception e) { | 299 | } catch (Exception e) { |
| 276 | e.printStackTrace(); | 300 | e.printStackTrace(); |
| 301 | + }finally{ | ||
| 302 | + logger.info("setSJ:"+result); | ||
| 277 | } | 303 | } |
| 278 | return result; | 304 | return result; |
| 279 | } | 305 | } |
| 280 | - | 306 | + |
| 281 | /** | 307 | /** |
| 282 | - * 上传超速数据 | 308 | + * 上传路单 |
| 309 | + * @param date | ||
| 310 | + * @return xml格式的字符串 | ||
| 283 | */ | 311 | */ |
| 284 | - @Override | ||
| 285 | - public String setCS() { | ||
| 286 | - String result = "success"; | ||
| 287 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 288 | - sBuffer.append("<CSs>"); | ||
| 289 | - String sql = "SELECT * FROM bsth_c_speeding where DATE_FORMAT(create_date,'%Y-%m-%d') = ? order by create_date "; | ||
| 290 | - Connection conn = null; | ||
| 291 | - PreparedStatement ps = null; | ||
| 292 | - ResultSet rs = null; | 312 | + public String setLD(){ |
| 313 | + String result = "failure"; | ||
| 293 | // 取昨天 的日期 | 314 | // 取昨天 的日期 |
| 294 | - String yesterday = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | 315 | + String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 295 | try { | 316 | try { |
| 296 | - conn = DBUtils_MS.getConnection(); | ||
| 297 | - ps = conn.prepareStatement(sql); | ||
| 298 | - ps.setString(1, yesterday); | ||
| 299 | - rs = ps.executeQuery(); | ||
| 300 | - Float lon, lat; | ||
| 301 | - String kssk; | ||
| 302 | - String speed; | ||
| 303 | - while (rs.next()) { | ||
| 304 | - kssk = sdfnyrsfm.format(rs.getLong("TIMESTAMP")); | ||
| 305 | - speed = rs.getString("SPEED"); | ||
| 306 | - // 经纬度 | ||
| 307 | - lon = rs.getFloat("LON"); | ||
| 308 | - lat = rs.getFloat("LAT"); | ||
| 309 | - sBuffer.append("<CS>"); | ||
| 310 | - sBuffer.append("<RQ>").append(sdfnyr.format(rs.getDate("CREATE_DATE"))).append("</RQ>"); | ||
| 311 | - sBuffer.append("<XLBM>").append(BasicData.lineCode2ShangHaiCodeMap.get(rs.getString("LINE"))).append("</XLBM>");//////// | ||
| 312 | - sBuffer.append("<CPH>").append(rs.getString("VEHICLE")).append("</CPH>"); | ||
| 313 | - sBuffer.append("<KSSK>").append(kssk).append("</KSSK>"); | ||
| 314 | - sBuffer.append("<KSDDJD>").append(lon).append("</KSDDJD>"); | ||
| 315 | - sBuffer.append("<KSDDWD>").append(lat).append("</KSDDWD>"); | ||
| 316 | - sBuffer.append("<KSLD>").append("").append("</KSLD>");//********************** | ||
| 317 | - sBuffer.append("<JSSK>").append(kssk).append("</JSSK>"); | ||
| 318 | - sBuffer.append("<JSDDJD>").append(lon).append("</JSDDJD>"); | ||
| 319 | - sBuffer.append("<JSDDWD>").append(lat).append("</JSDDWD>"); | ||
| 320 | - sBuffer.append("<JSLD>").append("").append("</JSLD>");//********************** | ||
| 321 | - sBuffer.append("<PJSD>").append(speed).append("</PJSD>"); | ||
| 322 | - sBuffer.append("<ZGSS>").append(speed).append("</ZGSS>"); | ||
| 323 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 324 | - sBuffer.append("</CS>"); | 317 | + StringBuffer sf = new StringBuffer(); |
| 318 | + sf.append("<DLDS>"); | ||
| 319 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | ||
| 320 | + List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); | ||
| 321 | + Map<String,Object> map = new HashMap<String,Object>(); | ||
| 322 | + for(ScheduleRealInfo schRealInfo:listGroup){ | ||
| 323 | + if(schRealInfo != null){ | ||
| 324 | + //根据车辆自编号查询车牌号 | ||
| 325 | + map.put("insideCode_eq", schRealInfo.getClZbh()); | ||
| 326 | + Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | ||
| 327 | + sf.append("<DLD>"); | ||
| 328 | + sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 329 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | ||
| 330 | + sf.append("<LPBH>"+schRealInfo.getLpName()+"</LPBH>"); | ||
| 331 | + sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | ||
| 332 | + sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | ||
| 333 | + sf.append("<LDList>"); | ||
| 334 | + | ||
| 335 | + int seqNumber = 0; | ||
| 336 | + for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 337 | + if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName().equals(scheduleRealInfo.getLpName()) | ||
| 338 | + && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | ||
| 339 | + scheduleRealInfo.getQdzCode(); | ||
| 340 | + sf.append("<LD>"); | ||
| 341 | + sf.append("<SJGH>"+scheduleRealInfo.getjGh()+"</SJGH>"); | ||
| 342 | + sf.append("<SXX>"+scheduleRealInfo.getXlDir()+"</SXX>"); | ||
| 343 | + sf.append("<FCZDMC>"+scheduleRealInfo.getQdzName()+"</FCZDMC>"); | ||
| 344 | + sf.append("<FCZDXH>" + ++seqNumber + "</FCZDXH>"); | ||
| 345 | + sf.append("<FCZDBM>"+scheduleRealInfo.getQdzCode()+"</FCZDBM>"); | ||
| 346 | + sf.append("<JHFCSJ>"+scheduleRealInfo.getFcsj()+"</JHFCSJ>"); | ||
| 347 | + sf.append("<DFSJ>"+scheduleRealInfo.getDfsj()+"</DFSJ>"); | ||
| 348 | + sf.append("<SJFCSJ>"+scheduleRealInfo.getFcsjActual()+"</SJFCSJ>"); | ||
| 349 | + sf.append("<FCZDLX>"+""+"</FCZDLX>"); | ||
| 350 | + sf.append("<DDZDMC>"+scheduleRealInfo.getZdzName()+"</DDZDMC>"); | ||
| 351 | + sf.append("<DDZDXH>"+ seqNumber +"</DDZDXH>"); | ||
| 352 | + sf.append("<DDZDBM>"+scheduleRealInfo.getZdzCode()+"</DDZDBM>"); | ||
| 353 | + sf.append("<JHDDSJ>"+scheduleRealInfo.getZdsj()+"</JHDDSJ>"); | ||
| 354 | + sf.append("<SJDDSJ>"+scheduleRealInfo.getZdsjActual()+"</SJDDSJ>"); | ||
| 355 | + sf.append("<DDZDLX>"+""+"</DDZDLX>"); | ||
| 356 | + sf.append("<LDSCBZ>"+0+"</LDSCBZ>"); | ||
| 357 | + sf.append("<DDBZ>"+scheduleRealInfo.getRemarks()+"</DDBZ>"); | ||
| 358 | + sf.append("</LD>"); | ||
| 359 | + } | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + sf.append("</LDList>"); | ||
| 363 | + sf.append("</DLD>"); | ||
| 364 | + } | ||
| 365 | + } | ||
| 366 | + | ||
| 367 | + sf.append("</DLDS>"); | ||
| 368 | + logger.info("setLD:"+sf.toString()); | ||
| 369 | + if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 370 | + result = "success"; | ||
| 325 | } | 371 | } |
| 326 | - sBuffer.append("</CSs>"); | ||
| 327 | - logger.info("setCS:"+sBuffer.toString()); | ||
| 328 | - ssop.setCS(userNameOther, passwordOther, sBuffer.toString()); | ||
| 329 | } catch (Exception e) { | 372 | } catch (Exception e) { |
| 330 | e.printStackTrace(); | 373 | e.printStackTrace(); |
| 331 | - } finally { | ||
| 332 | - DBUtils_MS.close(rs, ps, conn); | 374 | + }finally{ |
| 375 | + logger.info("setLD:"+result); | ||
| 333 | } | 376 | } |
| 334 | return result; | 377 | return result; |
| 335 | } | 378 | } |
| 336 | - | 379 | + |
| 337 | /** | 380 | /** |
| 338 | - * 上传线路班次时刻表数据 | 381 | + * 上传里程油耗 |
| 382 | + * @param date | ||
| 383 | + * @return | ||
| 339 | */ | 384 | */ |
| 340 | - @Override | ||
| 341 | - public String setSKB(String ids) { | ||
| 342 | - String result = "success"; | 385 | + public String setLCYH(){ |
| 386 | + String result = "failure"; | ||
| 387 | + // 取昨天 的日期 | ||
| 388 | + String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 343 | try { | 389 | try { |
| 344 | - String[] idArray = ids.split(","); | ||
| 345 | - StringBuffer sBuffer = new StringBuffer(); | ||
| 346 | - TTInfo ttInfo; | ||
| 347 | - TTInfoDetail ttInfoDetail; | ||
| 348 | - Iterator<TTInfoDetail> ttInfoDetailIterator; | ||
| 349 | - HashMap<String,Object> param = new HashMap<String, Object>(); | ||
| 350 | - String ttinfoJhlc = null;//计划总里程 | ||
| 351 | - sBuffer.append("<SKBs>"); | ||
| 352 | - for (int i = 0; i < idArray.length; i++) { | ||
| 353 | - ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i])); | ||
| 354 | - param.put("ttinfo.id_eq", ttInfo.getId()); | ||
| 355 | - ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), | ||
| 356 | - new Sort(Direction.ASC, "xlDir")).iterator(); | ||
| 357 | - sBuffer.append("<SKB>"); | ||
| 358 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl())).append("</XLBM>"); | ||
| 359 | - ttinfoJhlc = new String(); | ||
| 360 | - sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>"); | ||
| 361 | - sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>"); | ||
| 362 | - sBuffer.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | ||
| 363 | - sBuffer.append("<JSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</JSRQ>");///////// | ||
| 364 | - sBuffer.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>"); | ||
| 365 | - sBuffer.append("<TBYY>").append("").append("</TBYY>"); | ||
| 366 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 367 | - int num = 1; | ||
| 368 | - while (ttInfoDetailIterator.hasNext()) { | ||
| 369 | - ttInfoDetail = ttInfoDetailIterator.next(); | ||
| 370 | - ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程 | ||
| 371 | - sBuffer.append("<BCList>"); | ||
| 372 | - sBuffer.append("<BC>"); | ||
| 373 | - sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | ||
| 374 | - sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); | ||
| 375 | - sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz()).append("</FCZDMC>"); | ||
| 376 | - sBuffer.append("<ZDXH>").append(num).append("</ZDXH>"); | ||
| 377 | - sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>"); | ||
| 378 | - sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz()).append("</DDZDMC>"); | ||
| 379 | - sBuffer.append("<ZDXH>").append(num).append("</ZDXH>"); | ||
| 380 | - sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | ||
| 381 | - sBuffer.append("</BC>"); | ||
| 382 | - sBuffer.append("</BCList>"); | ||
| 383 | - num++; | 390 | + StringBuffer sf = new StringBuffer(); |
| 391 | + sf.append("<LCYHS>"); | ||
| 392 | + List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); | ||
| 393 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 394 | + Map<String,Object> map = new HashMap<String,Object>(); | ||
| 395 | + for(ScheduleRealInfo schRealInfo:listGroup){ | ||
| 396 | + if(schRealInfo != null){ | ||
| 397 | + //计算总公里和空驶公里,营运公里=总公里-空驶公里 | ||
| 398 | + double totalKilometers = 0,emptyKilometers =0; | ||
| 399 | + sf.append("<LCYH>"); | ||
| 400 | + map.put("insideCode_eq", schRealInfo.getClZbh()); | ||
| 401 | + Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | ||
| 402 | +// Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh()); | ||
| 403 | + sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 404 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | ||
| 405 | + sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | ||
| 406 | + for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 407 | + if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | ||
| 408 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 409 | + //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 410 | + if(childTaskPlans.isEmpty()){ | ||
| 411 | + if(scheduleRealInfo.getStatus() == 2){ | ||
| 412 | + totalKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 413 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 414 | + || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 415 | + emptyKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | ||
| 416 | + } | ||
| 417 | + } | ||
| 418 | + }else{ | ||
| 419 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 420 | + while(it.hasNext()){ | ||
| 421 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 422 | + if(!childTaskPlan.isDestroy()){ | ||
| 423 | + totalKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 424 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 425 | + emptyKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 426 | + } | ||
| 427 | + } | ||
| 428 | + } | ||
| 429 | + } | ||
| 430 | + } | ||
| 431 | + } | ||
| 432 | + sf.append("<ZLC>"+totalKilometers+"</ZLC>"); | ||
| 433 | + sf.append("<YYLC>"+emptyKilometers+"</YYLC>"); | ||
| 434 | + sf.append("<YH>"+""+"</YH>"); | ||
| 435 | + sf.append("<JZYL>"+""+"</JZYL>"); | ||
| 436 | + sf.append("<DH>"+""+"</DH>"); | ||
| 437 | + sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | ||
| 438 | + sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); | ||
| 439 | + sf.append("</LCYH>"); | ||
| 384 | } | 440 | } |
| 385 | - sBuffer.append("</SKB>"); | ||
| 386 | } | 441 | } |
| 387 | - sBuffer.append("</SKBs>"); | ||
| 388 | - logger.info("setSKB:"+sBuffer.toString()); | ||
| 389 | - ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()); | 442 | + sf.append("</LCYHS>"); |
| 443 | + logger.info("setLCYH:"+sf.toString()); | ||
| 444 | + if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 445 | + result = "success"; | ||
| 446 | + } | ||
| 390 | } catch (Exception e) { | 447 | } catch (Exception e) { |
| 391 | e.printStackTrace(); | 448 | e.printStackTrace(); |
| 449 | + }finally{ | ||
| 450 | + logger.info("setLCYH:"+result); | ||
| 392 | } | 451 | } |
| 393 | return result; | 452 | return result; |
| 394 | } | 453 | } |
| 395 | - | 454 | + |
| 396 | /** | 455 | /** |
| 397 | - * 上传线路人员车辆配置信息 | 456 | + * 上传线路调度日报 |
| 457 | + * @return | ||
| 398 | */ | 458 | */ |
| 399 | - @Override | ||
| 400 | - public String setXLPC() { | ||
| 401 | - String result = "success"; | 459 | + public String setDDRB(){ |
| 460 | + String result = "failure"; | ||
| 461 | + // 取昨天 的日期 | ||
| 462 | + String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 402 | try { | 463 | try { |
| 403 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 404 | - sBuffer.append("<XLPCs>"); | ||
| 405 | - // 声明变量 | ||
| 406 | - Line line = null; | ||
| 407 | - Cars cars = null; | ||
| 408 | - List<Personnel> personnelList = null; | ||
| 409 | - List<Cars> carsList = null; | ||
| 410 | - int totalPersonnel,totalCar ;// 人员数量。车辆数量 | ||
| 411 | - // 查询所有线路 | ||
| 412 | - Iterator<Line> lineIterator = lineRepository.findAll().iterator(); | ||
| 413 | - // 循环查找线路下的信息 | ||
| 414 | - while(lineIterator.hasNext()){ | ||
| 415 | - line = lineIterator.next(); | ||
| 416 | - sBuffer.append("<XLPC>"); | ||
| 417 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | ||
| 418 | - // 查询驾驶员数量 | ||
| 419 | - personnelList = personnelRepository.findJsysByLineId(line.getId()); | ||
| 420 | - totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 421 | - sBuffer.append("<SJRS>").append(totalPersonnel).append("</SJRS>"); | ||
| 422 | - // 查询售票员人员数量 | ||
| 423 | - personnelList = personnelRepository.findSpysByLineId(line.getId()); | ||
| 424 | - totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 425 | - sBuffer.append("<SPYRS>").append(totalPersonnel).append("</SPYRS>"); | ||
| 426 | - // 查询车辆 | ||
| 427 | - carsList = carsRepository.findCarsByLineId(line.getId()); | ||
| 428 | - totalCar = carsList != null ? carsList.size():0; | ||
| 429 | - sBuffer.append("<PCSL>").append(totalCar).append("</PCSL>"); | ||
| 430 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 431 | - int carsNum = 0; | ||
| 432 | - // 取车牌号 | ||
| 433 | - if(carsList != null){ | ||
| 434 | - carsNum = carsList.size(); | ||
| 435 | - sBuffer.append("<CPHList>"); | ||
| 436 | - for (int i = 0; i < carsNum; i++) { | ||
| 437 | - cars = carsList.get(i); | ||
| 438 | - sBuffer.append("<CPH>").append("沪").append(cars.getCarCode()).append("</CPH>"); | 464 | + StringBuffer sf = new StringBuffer(); |
| 465 | + sf.append("<DDRBS>"); | ||
| 466 | + List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); | ||
| 467 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 468 | + for(ScheduleRealInfo schRealInfo:listGroup){ | ||
| 469 | + if(schRealInfo != null){ | ||
| 470 | + double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; | ||
| 471 | + int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0; | ||
| 472 | + sf.append("<DDRB>"); | ||
| 473 | + sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 474 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); | ||
| 475 | + for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 476 | + if(scheduleRealInfo != null){ | ||
| 477 | + if(scheduleRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm())){ | ||
| 478 | + //计划 | ||
| 479 | + if(!scheduleRealInfo.isSflj()){ | ||
| 480 | + jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 481 | + //计划空驶 | ||
| 482 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")){ | ||
| 483 | + jhkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 484 | + } | ||
| 485 | + //计划早高峰,计划晚高峰 | ||
| 486 | + if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 487 | + jhzgfbc++; | ||
| 488 | + } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 489 | + jhwgfbc++; | ||
| 490 | + } | ||
| 491 | + } | ||
| 492 | + jhbc++; | ||
| 493 | + | ||
| 494 | + //实际 | ||
| 495 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 496 | + //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 497 | + if(childTaskPlans.isEmpty()){ | ||
| 498 | + if(scheduleRealInfo.getStatus() == 2){ | ||
| 499 | + sjbc++; | ||
| 500 | + zlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 501 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 502 | + || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 503 | + sjkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | ||
| 504 | + } | ||
| 505 | + } | ||
| 506 | + }else{ | ||
| 507 | + sjbc++; | ||
| 508 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 509 | + while(it.hasNext()){ | ||
| 510 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 511 | + if(!childTaskPlan.isDestroy()){ | ||
| 512 | + zlc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 513 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 514 | + sjkslc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 515 | + } | ||
| 516 | + } | ||
| 517 | + } | ||
| 518 | + } | ||
| 519 | + //实际早高峰,计划晚高峰 | ||
| 520 | + if(scheduleRealInfo.getFcsjActual() != null){ | ||
| 521 | + if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 522 | + sjzgfbc++; | ||
| 523 | + } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 524 | + sjwgfbc++; | ||
| 525 | + } | ||
| 526 | + } | ||
| 527 | + } | ||
| 528 | + } | ||
| 439 | } | 529 | } |
| 440 | - sBuffer.append("</CPHList>"); | 530 | + sf.append("<JHLC>"+format.format(jhlc)+"</JHLC>"); |
| 531 | + sf.append("<SSLC>"+format.format((zlc-sjkslc))+"</SSLC>"); | ||
| 532 | + sf.append("<JHKSLC>"+format.format(jhkslc)+"</JHKSLC>"); | ||
| 533 | + sf.append("<SJKSLC>"+format.format(sjkslc)+"</SJKSLC>"); | ||
| 534 | + sf.append("<JHBC>"+jhbc+"</JHBC>"); | ||
| 535 | + sf.append("<SJBC>"+sjbc+"</SJBC>"); | ||
| 536 | + sf.append("<JHZGFBC>"+jhzgfbc+"</JHZGFBC>"); | ||
| 537 | + sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); | ||
| 538 | + sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); | ||
| 539 | + sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); | ||
| 540 | + sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | ||
| 541 | + sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); | ||
| 542 | + sf.append("</DDRB>"); | ||
| 441 | } | 543 | } |
| 442 | - sBuffer.append("</XLPC>"); | ||
| 443 | } | 544 | } |
| 444 | - sBuffer.append("</XLPCs>"); | ||
| 445 | - logger.info("setXLPC:"+sBuffer.toString()); | ||
| 446 | - ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()); | 545 | + sf.append("</DDRBS>"); |
| 546 | + logger.info("setDDRB:"+sf.toString()); | ||
| 547 | + if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 548 | + result = "success"; | ||
| 549 | + } | ||
| 447 | } catch (Exception e) { | 550 | } catch (Exception e) { |
| 448 | e.printStackTrace(); | 551 | e.printStackTrace(); |
| 552 | + }finally{ | ||
| 553 | + logger.info("setDDRB:"+result); | ||
| 449 | } | 554 | } |
| 450 | return result; | 555 | return result; |
| 451 | } | 556 | } |
| 452 | - | 557 | + |
| 453 | /** | 558 | /** |
| 454 | * 上传线路计划班次表 | 559 | * 上传线路计划班次表 |
| 455 | */ | 560 | */ |
| 456 | @Override | 561 | @Override |
| 457 | public String setJHBC() { | 562 | public String setJHBC() { |
| 458 | - String result = "success"; | 563 | + String result = "failure"; |
| 459 | try { | 564 | try { |
| 460 | StringBuffer sBuffer =new StringBuffer(); | 565 | StringBuffer sBuffer =new StringBuffer(); |
| 461 | sBuffer.append("<JHBCs>"); | 566 | sBuffer.append("<JHBCs>"); |
| @@ -492,7 +597,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -492,7 +597,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 492 | sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>"); | 597 | sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>"); |
| 493 | sBuffer.append("<ZDXH>").append(++endSerialNum).append("</ZDXH>"); | 598 | sBuffer.append("<ZDXH>").append(++endSerialNum).append("</ZDXH>"); |
| 494 | sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj())) | 599 | sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj())) |
| 495 | - .append("</JHDDSJ>"); | 600 | + .append("</JHDDSJ>"); |
| 496 | sBuffer.append("</BC>"); | 601 | sBuffer.append("</BC>"); |
| 497 | if(i == size -1 ){ | 602 | if(i == size -1 ){ |
| 498 | sBuffer.append("</BCList>"); | 603 | sBuffer.append("</BCList>"); |
| @@ -513,249 +618,286 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -513,249 +618,286 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 513 | } | 618 | } |
| 514 | sBuffer.append("</JHBCs>"); | 619 | sBuffer.append("</JHBCs>"); |
| 515 | logger.info("setJHBC:"+sBuffer.toString()); | 620 | logger.info("setJHBC:"+sBuffer.toString()); |
| 516 | - ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()); | 621 | + if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 622 | + result = "success"; | ||
| 623 | + } | ||
| 517 | } catch (Exception e) { | 624 | } catch (Exception e) { |
| 518 | e.printStackTrace(); | 625 | e.printStackTrace(); |
| 626 | + }finally{ | ||
| 627 | + logger.info("setJHBC:"+result); | ||
| 519 | } | 628 | } |
| 520 | return result; | 629 | return result; |
| 521 | } | 630 | } |
| 522 | - | 631 | + |
| 523 | /** | 632 | /** |
| 524 | - * 上传路单 | ||
| 525 | - * @param date | ||
| 526 | - * @return xml格式的字符串 | 633 | + * 上传线路班次时刻表数据 |
| 527 | */ | 634 | */ |
| 528 | - public String setLD(){ | ||
| 529 | - // 取昨天 的日期 | ||
| 530 | - String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | 635 | + @Override |
| 636 | + public String setSKB(String ids) { | ||
| 637 | + String result = "failure"; | ||
| 531 | try { | 638 | try { |
| 532 | - StringBuffer sf = new StringBuffer(); | ||
| 533 | - sf.append("<DLDS>"); | ||
| 534 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | ||
| 535 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); | ||
| 536 | - Map<String,Object> map = new HashMap<String,Object>(); | ||
| 537 | - for(ScheduleRealInfo schRealInfo:listGroup){ | ||
| 538 | - if(schRealInfo != null){ | ||
| 539 | - //根据车辆自编号查询车牌号 | ||
| 540 | - map.put("insideCode_eq", schRealInfo.getClZbh()); | ||
| 541 | - Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | ||
| 542 | - sf.append("<DLD>"); | ||
| 543 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 544 | - sf.append("<XLBM>"+schRealInfo.getXlBm()+"</XLBM>"); | ||
| 545 | - sf.append("<LPBH>"+schRealInfo.getLpName()+"</LPBH>"); | ||
| 546 | - sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | ||
| 547 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | ||
| 548 | - sf.append("<LDList>"); | ||
| 549 | - | ||
| 550 | - int seqNumber = 0; | ||
| 551 | - for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 552 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName().equals(scheduleRealInfo.getLpName()) | ||
| 553 | - && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | ||
| 554 | - scheduleRealInfo.getQdzCode(); | ||
| 555 | - sf.append("<LD>"); | ||
| 556 | - sf.append("<SJGH>"+scheduleRealInfo.getjGh()+"</SJGH>"); | ||
| 557 | - sf.append("<SXX>"+scheduleRealInfo.getXlDir()+"</SXX>"); | ||
| 558 | - sf.append("<FCZDMC>"+scheduleRealInfo.getQdzName()+"</FCZDMC>"); | ||
| 559 | - sf.append("<FCZDXH>" + ++seqNumber + "</FCZDXH>"); | ||
| 560 | - sf.append("<FCZDBM>"+scheduleRealInfo.getQdzCode()+"</FCZDBM>"); | ||
| 561 | - sf.append("<JHFCSJ>"+scheduleRealInfo.getFcsj()+"</JHFCSJ>"); | ||
| 562 | - sf.append("<DFSJ>"+scheduleRealInfo.getDfsj()+"</DFSJ>"); | ||
| 563 | - sf.append("<SJFCSJ>"+scheduleRealInfo.getFcsjActual()+"</SJFCSJ>"); | ||
| 564 | - sf.append("<FCZDLX>"+""+"</FCZDLX>"); | ||
| 565 | - sf.append("<DDZDMC>"+scheduleRealInfo.getZdzName()+"</DDZDMC>"); | ||
| 566 | - sf.append("<DDZDXH>"+ seqNumber +"</DDZDXH>"); | ||
| 567 | - sf.append("<DDZDBM>"+scheduleRealInfo.getZdzCode()+"</DDZDBM>"); | ||
| 568 | - sf.append("<JHDDSJ>"+scheduleRealInfo.getZdsj()+"</JHDDSJ>"); | ||
| 569 | - sf.append("<SJDDSJ>"+scheduleRealInfo.getZdsjActual()+"</SJDDSJ>"); | ||
| 570 | - sf.append("<DDZDLX>"+""+"</DDZDLX>"); | ||
| 571 | - sf.append("<LDSCBZ>"+0+"</LDSCBZ>"); | ||
| 572 | - sf.append("<DDBZ>"+scheduleRealInfo.getRemarks()+"</DDBZ>"); | ||
| 573 | - sf.append("</LD>"); | ||
| 574 | - } | ||
| 575 | - } | ||
| 576 | - | ||
| 577 | - sf.append("</LDList>"); | ||
| 578 | - sf.append("</DLD>"); | 639 | + String[] idArray = ids.split(","); |
| 640 | + StringBuffer sBuffer = new StringBuffer(); | ||
| 641 | + TTInfo ttInfo; | ||
| 642 | + TTInfoDetail ttInfoDetail; | ||
| 643 | + Iterator<TTInfoDetail> ttInfoDetailIterator; | ||
| 644 | + HashMap<String,Object> param = new HashMap<String, Object>(); | ||
| 645 | + String ttinfoJhlc = null;//计划总里程 | ||
| 646 | + sBuffer.append("<SKBs>"); | ||
| 647 | + for (int i = 0; i < idArray.length; i++) { | ||
| 648 | + ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i])); | ||
| 649 | + if(ttInfo == null) | ||
| 650 | + continue; | ||
| 651 | + param.put("ttinfo.id_eq", ttInfo.getId()); | ||
| 652 | + ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), | ||
| 653 | + new Sort(Direction.ASC, "xlDir")).iterator(); | ||
| 654 | + sBuffer.append("<SKB>"); | ||
| 655 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl())).append("</XLBM>"); | ||
| 656 | + ttinfoJhlc = new String(); | ||
| 657 | + sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>"); | ||
| 658 | + sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>"); | ||
| 659 | + sBuffer.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | ||
| 660 | + sBuffer.append("<JSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</JSRQ>");///////// | ||
| 661 | + sBuffer.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>"); | ||
| 662 | + sBuffer.append("<TBYY>").append("").append("</TBYY>"); | ||
| 663 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 664 | + int num = 1; | ||
| 665 | + while (ttInfoDetailIterator.hasNext()) { | ||
| 666 | + ttInfoDetail = ttInfoDetailIterator.next(); | ||
| 667 | + ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程 | ||
| 668 | + sBuffer.append("<BCList>"); | ||
| 669 | + sBuffer.append("<BC>"); | ||
| 670 | + sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | ||
| 671 | + sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); | ||
| 672 | + sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz()).append("</FCZDMC>"); | ||
| 673 | + sBuffer.append("<ZDXH>").append(num).append("</ZDXH>"); | ||
| 674 | + sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>"); | ||
| 675 | + sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz()).append("</DDZDMC>"); | ||
| 676 | + sBuffer.append("<ZDXH>").append(num).append("</ZDXH>"); | ||
| 677 | + sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | ||
| 678 | + sBuffer.append("</BC>"); | ||
| 679 | + sBuffer.append("</BCList>"); | ||
| 680 | + num++; | ||
| 579 | } | 681 | } |
| 682 | + sBuffer.append("</SKB>"); | ||
| 683 | + } | ||
| 684 | + sBuffer.append("</SKBs>"); | ||
| 685 | + logger.info("setSKB:"+sBuffer.toString()); | ||
| 686 | + if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 687 | + result = "success"; | ||
| 580 | } | 688 | } |
| 581 | - | ||
| 582 | - sf.append("</DLDS>"); | ||
| 583 | - logger.info("setLD:"+sf.toString()); | ||
| 584 | - ssop.setLD(userNameOther, passwordOther, sf.toString()); | ||
| 585 | } catch (Exception e) { | 689 | } catch (Exception e) { |
| 586 | e.printStackTrace(); | 690 | e.printStackTrace(); |
| 691 | + }finally{ | ||
| 692 | + logger.info("setSKB:"+result); | ||
| 587 | } | 693 | } |
| 588 | - return ""; | 694 | + return result; |
| 589 | } | 695 | } |
| 590 | - | 696 | + |
| 591 | /** | 697 | /** |
| 592 | - * 上传里程油耗 | ||
| 593 | - * @param date | ||
| 594 | - * @return | 698 | + * 上传线路人员车辆配置信息 |
| 595 | */ | 699 | */ |
| 596 | - public String setLCYH(){ | ||
| 597 | - // 取昨天 的日期 | ||
| 598 | - String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | 700 | + @Override |
| 701 | + public String setXLPC() { | ||
| 702 | + String result = "failure"; | ||
| 599 | try { | 703 | try { |
| 600 | - StringBuffer sf = new StringBuffer(); | ||
| 601 | - sf.append("<LCYHS>"); | ||
| 602 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); | ||
| 603 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 604 | - Map<String,Object> map = new HashMap<String,Object>(); | ||
| 605 | - for(ScheduleRealInfo schRealInfo:listGroup){ | ||
| 606 | - if(schRealInfo != null){ | ||
| 607 | - //计算总公里和空驶公里,营运公里=总公里-空驶公里 | ||
| 608 | - double totalKilometers = 0,emptyKilometers =0; | ||
| 609 | - sf.append("<LCYH>"); | ||
| 610 | - map.put("insideCode_eq", schRealInfo.getClZbh()); | ||
| 611 | - Cars car = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | ||
| 612 | -// Cars car = carsRepository.findCarByClzbh(schRealInfo.getClZbh()); | ||
| 613 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 614 | - sf.append("<XLBM>"+schRealInfo.getXlBm()+"</XLBM>"); | ||
| 615 | - sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | ||
| 616 | - for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 617 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | ||
| 618 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 619 | - //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 620 | - if(childTaskPlans.isEmpty()){ | ||
| 621 | - if(scheduleRealInfo.getStatus() == 2){ | ||
| 622 | - totalKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 623 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 624 | - || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 625 | - emptyKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | ||
| 626 | - } | ||
| 627 | - } | ||
| 628 | - }else{ | ||
| 629 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 630 | - while(it.hasNext()){ | ||
| 631 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 632 | - if(!childTaskPlan.isDestroy()){ | ||
| 633 | - totalKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 634 | - if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 635 | - emptyKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 636 | - } | ||
| 637 | - } | ||
| 638 | - } | ||
| 639 | - } | ||
| 640 | - } | 704 | + StringBuffer sBuffer =new StringBuffer(); |
| 705 | + sBuffer.append("<XLPCs>"); | ||
| 706 | + // 声明变量 | ||
| 707 | + Line line = null; | ||
| 708 | + Cars cars = null; | ||
| 709 | + List<Personnel> personnelList = null; | ||
| 710 | + List<Cars> carsList = null; | ||
| 711 | + int totalPersonnel,totalCar ;// 人员数量。车辆数量 | ||
| 712 | + // 查询所有线路 | ||
| 713 | + Iterator<Line> lineIterator = lineRepository.findAll().iterator(); | ||
| 714 | + // 循环查找线路下的信息 | ||
| 715 | + while(lineIterator.hasNext()){ | ||
| 716 | + line = lineIterator.next(); | ||
| 717 | + sBuffer.append("<XLPC>"); | ||
| 718 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | ||
| 719 | + // 查询驾驶员数量 | ||
| 720 | + personnelList = personnelRepository.findJsysByLineId(line.getId()); | ||
| 721 | + totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 722 | + sBuffer.append("<SJRS>").append(totalPersonnel).append("</SJRS>"); | ||
| 723 | + // 查询售票员人员数量 | ||
| 724 | + personnelList = personnelRepository.findSpysByLineId(line.getId()); | ||
| 725 | + totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 726 | + sBuffer.append("<SPYRS>").append(totalPersonnel).append("</SPYRS>"); | ||
| 727 | + // 查询车辆 | ||
| 728 | + carsList = carsRepository.findCarsByLineId(line.getId()); | ||
| 729 | + totalCar = carsList != null ? carsList.size():0; | ||
| 730 | + sBuffer.append("<PCSL>").append(totalCar).append("</PCSL>"); | ||
| 731 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 732 | + int carsNum = 0; | ||
| 733 | + // 取车牌号 | ||
| 734 | + if(carsList != null){ | ||
| 735 | + carsNum = carsList.size(); | ||
| 736 | + sBuffer.append("<CPHList>"); | ||
| 737 | + for (int i = 0; i < carsNum; i++) { | ||
| 738 | + cars = carsList.get(i); | ||
| 739 | + sBuffer.append("<CPH>").append("沪").append(cars.getCarCode()).append("</CPH>"); | ||
| 641 | } | 740 | } |
| 642 | - sf.append("<ZLC>"+totalKilometers+"</ZLC>"); | ||
| 643 | - sf.append("<YYLC>"+emptyKilometers+"</YYLC>"); | ||
| 644 | - sf.append("<YH>"+""+"</YH>"); | ||
| 645 | - sf.append("<JZYL>"+""+"</JZYL>"); | ||
| 646 | - sf.append("<DH>"+""+"</DH>"); | ||
| 647 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | ||
| 648 | - sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); | ||
| 649 | - sf.append("</LCYH>"); | ||
| 650 | - } | 741 | + sBuffer.append("</CPHList>"); |
| 742 | + } | ||
| 743 | + sBuffer.append("</XLPC>"); | ||
| 744 | + } | ||
| 745 | + sBuffer.append("</XLPCs>"); | ||
| 746 | + logger.info("setXLPC:"+sBuffer.toString()); | ||
| 747 | + if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 748 | + result = "success"; | ||
| 651 | } | 749 | } |
| 652 | - sf.append("</LCYHS>"); | ||
| 653 | - logger.info("setLCYH:"+sf.toString()); | ||
| 654 | - ssop.setLCYH(userNameOther, passwordOther, sf.toString()); | ||
| 655 | } catch (Exception e) { | 750 | } catch (Exception e) { |
| 656 | e.printStackTrace(); | 751 | e.printStackTrace(); |
| 752 | + }finally{ | ||
| 753 | + logger.info("setXLPC:"+result); | ||
| 657 | } | 754 | } |
| 658 | - return date; | 755 | + return result; |
| 659 | } | 756 | } |
| 660 | - | 757 | + |
| 758 | + | ||
| 661 | /** | 759 | /** |
| 662 | - * 上传线路调度日报 | ||
| 663 | - * @return | 760 | + * 上传超速数据 |
| 664 | */ | 761 | */ |
| 665 | - public String setDDRB(){ | 762 | + @Override |
| 763 | + public String setCS() { | ||
| 764 | + String result = "failure"; | ||
| 765 | + StringBuffer sBuffer =new StringBuffer(); | ||
| 766 | + sBuffer.append("<CSs>"); | ||
| 767 | + String sql = "SELECT * FROM bsth_c_speeding where DATE_FORMAT(create_date,'%Y-%m-%d') = ? order by create_date "; | ||
| 768 | + Connection conn = null; | ||
| 769 | + PreparedStatement ps = null; | ||
| 770 | + ResultSet rs = null; | ||
| 666 | // 取昨天 的日期 | 771 | // 取昨天 的日期 |
| 667 | - String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | 772 | + String yesterday = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 668 | try { | 773 | try { |
| 669 | - StringBuffer sf = new StringBuffer(); | ||
| 670 | - sf.append("<DDRBS>"); | ||
| 671 | - List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); | ||
| 672 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 673 | - for(ScheduleRealInfo schRealInfo:listGroup){ | ||
| 674 | - if(schRealInfo != null){ | ||
| 675 | - double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; | ||
| 676 | - int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0; | ||
| 677 | - sf.append("<DDRB>"); | ||
| 678 | - sf.append("<RQ>"+schRealInfo.getScheduleDateStr()+"</RQ>"); | ||
| 679 | - sf.append("<XLBM>"+schRealInfo.getXlBm()+"</XLBM>"); | ||
| 680 | - for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 681 | - if(scheduleRealInfo != null){ | ||
| 682 | - if(scheduleRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm())){ | ||
| 683 | - //计划 | ||
| 684 | - if(!scheduleRealInfo.isSflj()){ | ||
| 685 | - jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 686 | - //计划空驶 | ||
| 687 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")){ | ||
| 688 | - jhkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 689 | - } | ||
| 690 | - //计划早高峰,计划晚高峰 | ||
| 691 | - if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 692 | - jhzgfbc++; | ||
| 693 | - } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 694 | - jhwgfbc++; | ||
| 695 | - } | ||
| 696 | - } | ||
| 697 | - jhbc++; | ||
| 698 | - | ||
| 699 | - //实际 | ||
| 700 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 701 | - //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 702 | - if(childTaskPlans.isEmpty()){ | ||
| 703 | - if(scheduleRealInfo.getStatus() == 2){ | ||
| 704 | - sjbc++; | ||
| 705 | - zlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 706 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 707 | - || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 708 | - sjkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | ||
| 709 | - } | ||
| 710 | - } | ||
| 711 | - }else{ | ||
| 712 | - sjbc++; | ||
| 713 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 714 | - while(it.hasNext()){ | ||
| 715 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 716 | - if(!childTaskPlan.isDestroy()){ | ||
| 717 | - zlc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 718 | - if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 719 | - sjkslc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 720 | - } | ||
| 721 | - } | ||
| 722 | - } | ||
| 723 | - } | ||
| 724 | - //实际早高峰,计划晚高峰 | ||
| 725 | - if(scheduleRealInfo.getFcsjActual() != null){ | ||
| 726 | - if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 727 | - sjzgfbc++; | ||
| 728 | - } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 729 | - sjwgfbc++; | ||
| 730 | - } | ||
| 731 | - } | ||
| 732 | - } | ||
| 733 | - } | 774 | + conn = DBUtils_MS.getConnection(); |
| 775 | + ps = conn.prepareStatement(sql); | ||
| 776 | + ps.setString(1, yesterday); | ||
| 777 | + rs = ps.executeQuery(); | ||
| 778 | + Float lon, lat; | ||
| 779 | + String kssk; | ||
| 780 | + String speed; | ||
| 781 | + while (rs.next()) { | ||
| 782 | + kssk = sdfnyrsfm.format(rs.getLong("TIMESTAMP")); | ||
| 783 | + speed = rs.getString("SPEED"); | ||
| 784 | + // 经纬度 | ||
| 785 | + lon = rs.getFloat("LON"); | ||
| 786 | + lat = rs.getFloat("LAT"); | ||
| 787 | + sBuffer.append("<CS>"); | ||
| 788 | + sBuffer.append("<RQ>").append(sdfnyr.format(rs.getDate("CREATE_DATE"))).append("</RQ>"); | ||
| 789 | + sBuffer.append("<XLBM>").append(BasicData.lineCode2ShangHaiCodeMap.get(rs.getString("LINE"))).append("</XLBM>");//////// | ||
| 790 | + sBuffer.append("<CPH>").append(rs.getString("VEHICLE")).append("</CPH>"); | ||
| 791 | + sBuffer.append("<KSSK>").append(kssk).append("</KSSK>"); | ||
| 792 | + sBuffer.append("<KSDDJD>").append(lon).append("</KSDDJD>"); | ||
| 793 | + sBuffer.append("<KSDDWD>").append(lat).append("</KSDDWD>"); | ||
| 794 | + sBuffer.append("<KSLD>").append("").append("</KSLD>");//********************** | ||
| 795 | + sBuffer.append("<JSSK>").append(kssk).append("</JSSK>"); | ||
| 796 | + sBuffer.append("<JSDDJD>").append(lon).append("</JSDDJD>"); | ||
| 797 | + sBuffer.append("<JSDDWD>").append(lat).append("</JSDDWD>"); | ||
| 798 | + sBuffer.append("<JSLD>").append("").append("</JSLD>");//********************** | ||
| 799 | + sBuffer.append("<PJSD>").append(speed).append("</PJSD>"); | ||
| 800 | + sBuffer.append("<ZGSS>").append(speed).append("</ZGSS>"); | ||
| 801 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 802 | + sBuffer.append("</CS>"); | ||
| 803 | + } | ||
| 804 | + sBuffer.append("</CSs>"); | ||
| 805 | + logger.info("setCS:"+sBuffer.toString()); | ||
| 806 | + if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 807 | + result = "success"; | ||
| 808 | + } | ||
| 809 | + } catch (Exception e) { | ||
| 810 | + e.printStackTrace(); | ||
| 811 | + } finally { | ||
| 812 | + logger.info("setCS:"+result); | ||
| 813 | + DBUtils_MS.close(rs, ps, conn); | ||
| 814 | + } | ||
| 815 | + return result; | ||
| 816 | + } | ||
| 817 | + | ||
| 818 | + | ||
| 819 | + /** | ||
| 820 | + * 下载全量的公交基础数据 | ||
| 821 | + */ | ||
| 822 | + public String getDownLoadAllDataFile() { | ||
| 823 | + String result = "success"; | ||
| 824 | + try { | ||
| 825 | + Runtime currRuntime = Runtime.getRuntime (); | ||
| 826 | + | ||
| 827 | + int nFreeMemory = ( int ) (currRuntime.freeMemory() / 1024 / 1024); | ||
| 828 | + | ||
| 829 | + int nTotalMemory = ( int ) (currRuntime.totalMemory() / 1024 / 1024); | ||
| 830 | + | ||
| 831 | + System.out.println("zzz:"+nFreeMemory + "M/" + nTotalMemory +"M(free/total)"); | ||
| 832 | + | ||
| 833 | + byte[] res = portType.downloadAllDataFile("down_pdgj", "down_pdgj123"); | ||
| 834 | + String filePath = "E:\\ygc"; | ||
| 835 | + BufferedOutputStream bos = null; | ||
| 836 | + FileOutputStream fos = null; | ||
| 837 | + File file = null; | ||
| 838 | + try { | ||
| 839 | + File dir = new File(filePath); | ||
| 840 | + if(!dir.exists()&&dir.isDirectory()){//判断文件目录是否存在 | ||
| 841 | + dir.mkdirs(); | ||
| 842 | + } | ||
| 843 | + file = new File(filePath+"\\abc.rar"); | ||
| 844 | + fos = new FileOutputStream(file); | ||
| 845 | + bos = new BufferedOutputStream(fos); | ||
| 846 | + bos.write(res); | ||
| 847 | + } catch (Exception e) { | ||
| 848 | + e.printStackTrace(); | ||
| 849 | + } finally { | ||
| 850 | + if (bos != null) { | ||
| 851 | + try { | ||
| 852 | + bos.close(); | ||
| 853 | + } catch (IOException e1) { | ||
| 854 | + e1.printStackTrace(); | ||
| 734 | } | 855 | } |
| 735 | - sf.append("<JHLC>"+format.format(jhlc)+"</JHLC>"); | ||
| 736 | - sf.append("<SSLC>"+format.format((zlc-sjkslc))+"</SSLC>"); | ||
| 737 | - sf.append("<JHKSLC>"+format.format(jhkslc)+"</JHKSLC>"); | ||
| 738 | - sf.append("<SJKSLC>"+format.format(sjkslc)+"</SJKSLC>"); | ||
| 739 | - sf.append("<JHBC>"+jhbc+"</JHBC>"); | ||
| 740 | - sf.append("<SJBC>"+sjbc+"</SJBC>"); | ||
| 741 | - sf.append("<JHZGFBC>"+jhzgfbc+"</JHZGFBC>"); | ||
| 742 | - sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); | ||
| 743 | - sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); | ||
| 744 | - sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); | ||
| 745 | - sf.append("<UPDT>"+sdfnyrsfm.format(schRealInfo.getUpdateDate())+"</UPDT>"); | ||
| 746 | - sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); | ||
| 747 | - sf.append("</DDRB>"); | ||
| 748 | - } | 856 | + } |
| 857 | + if (fos != null) { | ||
| 858 | + try { | ||
| 859 | + fos.close(); | ||
| 860 | + } catch (IOException e1) { | ||
| 861 | + e1.printStackTrace(); | ||
| 862 | + } | ||
| 863 | + } | ||
| 749 | } | 864 | } |
| 750 | - sf.append("</DDRBS>"); | ||
| 751 | - logger.info("setDDRB:"+sf.toString()); | ||
| 752 | - ssop.setDDRB(userNameOther, passwordOther, sf.toString()); | ||
| 753 | } catch (Exception e) { | 865 | } catch (Exception e) { |
| 754 | e.printStackTrace(); | 866 | e.printStackTrace(); |
| 755 | } | 867 | } |
| 756 | - return date; | 868 | + |
| 869 | + return result; | ||
| 870 | + } | ||
| 871 | + | ||
| 872 | + /** | ||
| 873 | + * 下载增量的公交基础数据 | ||
| 874 | + */ | ||
| 875 | + public String getDownLoadIncreaseDataFile() { | ||
| 876 | + String result = "success"; | ||
| 877 | + try { | ||
| 878 | + //System.out.println(portType.downloadIncreaseDataFile(args0, args1, args2)); | ||
| 879 | + } catch (Exception e) { | ||
| 880 | + e.printStackTrace(); | ||
| 881 | + } | ||
| 882 | + | ||
| 883 | + return result; | ||
| 884 | + } | ||
| 885 | + | ||
| 886 | + /** | ||
| 887 | + * 指定线路查询方式公交基础数据下载 | ||
| 888 | + */ | ||
| 889 | + public String getDownLoadWarrantsBusLineStation() { | ||
| 890 | + String result = "success"; | ||
| 891 | + try { | ||
| 892 | + | ||
| 893 | + //portType.setXL(userNameXl, passwordXl, sBuffer.toString()); | ||
| 894 | + } catch (Exception e) { | ||
| 895 | + e.printStackTrace(); | ||
| 896 | + } | ||
| 897 | + | ||
| 898 | + return result; | ||
| 757 | } | 899 | } |
| 758 | - | 900 | + |
| 759 | /** | 901 | /** |
| 760 | * 计算结束时间 | 902 | * 计算结束时间 |
| 761 | * @param fcsj 发车时间 | 903 | * @param fcsj 发车时间 |
| @@ -787,7 +929,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -787,7 +929,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 787 | } | 929 | } |
| 788 | return result; | 930 | return result; |
| 789 | } | 931 | } |
| 790 | - | 932 | + |
| 791 | /** | 933 | /** |
| 792 | * 拼装线路计划班次表的XML | 934 | * 拼装线路计划班次表的XML |
| 793 | * @param sBuffer | 935 | * @param sBuffer |
src/main/java/com/bsth/service/oil/YlbService.java
| 1 | package com.bsth.service.oil; | 1 | package com.bsth.service.oil; |
| 2 | 2 | ||
| 3 | +import java.util.List; | ||
| 3 | import java.util.Map; | 4 | import java.util.Map; |
| 4 | 5 | ||
| 5 | import com.bsth.entity.oil.Ylb; | 6 | import com.bsth.entity.oil.Ylb; |
| @@ -13,4 +14,6 @@ public interface YlbService extends BaseService<Ylb, Integer>{ | @@ -13,4 +14,6 @@ public interface YlbService extends BaseService<Ylb, Integer>{ | ||
| 13 | Map<String, Object> outAndIn(Map<String, Object> map); | 14 | Map<String, Object> outAndIn(Map<String, Object> map); |
| 14 | 15 | ||
| 15 | Map<String, Object> checkYl(Map<String, Object> map); | 16 | Map<String, Object> checkYl(Map<String, Object> map); |
| 17 | + | ||
| 18 | + List<Ylb> oilListMonth(String line,String date); | ||
| 16 | } | 19 | } |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -390,6 +390,13 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -390,6 +390,13 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 390 | 390 | ||
| 391 | return newMap; | 391 | return newMap; |
| 392 | } | 392 | } |
| 393 | + | ||
| 394 | + | ||
| 395 | + @Override | ||
| 396 | + public List<Ylb> oilListMonth(String line, String date) { | ||
| 397 | + // TODO Auto-generated method stub | ||
| 398 | + return null; | ||
| 399 | + } | ||
| 393 | 400 | ||
| 394 | 401 | ||
| 395 | } | 402 | } |
src/main/java/com/bsth/service/realcontrol/LineConfigService.java
| @@ -7,9 +7,9 @@ import com.bsth.service.BaseService; | @@ -7,9 +7,9 @@ import com.bsth.service.BaseService; | ||
| 7 | 7 | ||
| 8 | public interface LineConfigService extends BaseService<LineConfig, Integer>{ | 8 | public interface LineConfigService extends BaseService<LineConfig, Integer>{ |
| 9 | 9 | ||
| 10 | - Map<String, Object> check(Integer[] codeArray); | 10 | + Map<String, Object> check(String[] codeArray); |
| 11 | 11 | ||
| 12 | - Integer inti(Integer lineCode) throws Exception; | 12 | + Integer init(String lineCode) throws Exception; |
| 13 | 13 | ||
| 14 | Map<String, Object> editStartOptTime(String time, String lineCode); | 14 | Map<String, Object> editStartOptTime(String time, String lineCode); |
| 15 | 15 |
src/main/java/com/bsth/service/realcontrol/RealChartsService.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol; | ||
| 2 | + | ||
| 3 | +import com.bsth.service.realcontrol.dto.CarOutRate; | ||
| 4 | +import com.bsth.service.realcontrol.dto.DeviceOnlineRate; | ||
| 5 | +import com.bsth.service.realcontrol.dto.StratEndPunctualityRate; | ||
| 6 | + | ||
| 7 | +import java.util.List; | ||
| 8 | +import java.util.Map; | ||
| 9 | + | ||
| 10 | +/**线调图表 | ||
| 11 | + * Created by panzhao on 2016/11/9. | ||
| 12 | + */ | ||
| 13 | +public interface RealChartsService { | ||
| 14 | + List<DeviceOnlineRate> deviceOnlineRate(String month, String idx); | ||
| 15 | + | ||
| 16 | + List<CarOutRate> carOutRate(String month, String idx); | ||
| 17 | + | ||
| 18 | + List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx); | ||
| 19 | + | ||
| 20 | + List<StratEndPunctualityRate> sePunctualityRateLine(String month, String idx); | ||
| 21 | +} |
src/main/java/com/bsth/service/realcontrol/dto/CarOutRate.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.dto; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 出车率 | ||
| 5 | + * Created by panzhao on 2016/11/9. | ||
| 6 | + */ | ||
| 7 | +public class CarOutRate { | ||
| 8 | + | ||
| 9 | + private String dateStr; | ||
| 10 | + | ||
| 11 | + private String lineCode; | ||
| 12 | + | ||
| 13 | + private String nbbm; | ||
| 14 | + | ||
| 15 | + private String firstOut; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + public String getNbbm() { | ||
| 19 | + return nbbm; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + public void setNbbm(String nbbm) { | ||
| 23 | + this.nbbm = nbbm; | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + public String getLineCode() { | ||
| 27 | + return lineCode; | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + public void setLineCode(String lineCode) { | ||
| 31 | + this.lineCode = lineCode; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public String getDateStr() { | ||
| 35 | + return dateStr; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public void setDateStr(String dateStr) { | ||
| 39 | + this.dateStr = dateStr; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public String getFirstOut() { | ||
| 43 | + return firstOut; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public void setFirstOut(String firstOut) { | ||
| 47 | + this.firstOut = firstOut; | ||
| 48 | + } | ||
| 49 | +} |
src/main/java/com/bsth/service/realcontrol/dto/DeviceOnlineRate.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.dto; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 设备上线率dto | ||
| 5 | + * Created by panzhao on 2016/11/9. | ||
| 6 | + */ | ||
| 7 | +public class DeviceOnlineRate { | ||
| 8 | + | ||
| 9 | + private String lineCode; | ||
| 10 | + | ||
| 11 | + private String dateStr; | ||
| 12 | + | ||
| 13 | + private Integer dayOfYear; | ||
| 14 | + | ||
| 15 | + private String nbbm; | ||
| 16 | + | ||
| 17 | + private boolean online; | ||
| 18 | + | ||
| 19 | + public boolean isOnline() { | ||
| 20 | + return online; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + public void setOnline(boolean online) { | ||
| 24 | + this.online = online; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + public String getNbbm() { | ||
| 28 | + return nbbm; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + public void setNbbm(String nbbm) { | ||
| 32 | + this.nbbm = nbbm; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + public String getDateStr() { | ||
| 36 | + return dateStr; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public void setDateStr(String dateStr) { | ||
| 40 | + this.dateStr = dateStr; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public String getLineCode() { | ||
| 44 | + return lineCode; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public void setLineCode(String lineCode) { | ||
| 48 | + this.lineCode = lineCode; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public Integer getDayOfYear() { | ||
| 52 | + return dayOfYear; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void setDayOfYear(Integer dayOfYear) { | ||
| 56 | + this.dayOfYear = dayOfYear; | ||
| 57 | + } | ||
| 58 | +} |
src/main/java/com/bsth/service/realcontrol/dto/RealOnline.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.dto; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 实际上线设备 | ||
| 5 | + * Created by panzhao on 2016/11/9. | ||
| 6 | + */ | ||
| 7 | +public class RealOnline { | ||
| 8 | + | ||
| 9 | + private Integer dayOfYear; | ||
| 10 | + | ||
| 11 | + private String nbbm; | ||
| 12 | + | ||
| 13 | + private String device; | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + public Integer getDayOfYear() { | ||
| 17 | + return dayOfYear; | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + public void setDayOfYear(Integer dayOfYear) { | ||
| 21 | + this.dayOfYear = dayOfYear; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + public String getNbbm() { | ||
| 25 | + return nbbm; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + public void setNbbm(String nbbm) { | ||
| 29 | + this.nbbm = nbbm; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public String getDevice() { | ||
| 33 | + return device; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public void setDevice(String device) { | ||
| 37 | + this.device = device; | ||
| 38 | + } | ||
| 39 | +} |
src/main/java/com/bsth/service/realcontrol/dto/StratEndPunctualityRate.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.dto; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 首末班正点率 | ||
| 5 | + * Created by panzhao on 2016/11/10. | ||
| 6 | + */ | ||
| 7 | +public class StratEndPunctualityRate { | ||
| 8 | + | ||
| 9 | + private String dateStr; | ||
| 10 | + | ||
| 11 | + private String lineCode; | ||
| 12 | + | ||
| 13 | + private String nbbm; | ||
| 14 | + | ||
| 15 | + //首班时间 06:00/06:01 | ||
| 16 | + private String startTime; | ||
| 17 | + | ||
| 18 | + //末班时间 20:30/20:31 | ||
| 19 | + private String endTime; | ||
| 20 | + | ||
| 21 | + //末班真实执行日期 | ||
| 22 | + private String etRealExecDate; | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + public String getDateStr() { | ||
| 26 | + return dateStr; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + public void setDateStr(String dateStr) { | ||
| 30 | + this.dateStr = dateStr; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + public String getLineCode() { | ||
| 34 | + return lineCode; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public void setLineCode(String lineCode) { | ||
| 38 | + this.lineCode = lineCode; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + public String getNbbm() { | ||
| 42 | + return nbbm; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + public void setNbbm(String nbbm) { | ||
| 46 | + this.nbbm = nbbm; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + public String getStartTime() { | ||
| 50 | + return startTime; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public void setStartTime(String startTime) { | ||
| 54 | + this.startTime = startTime; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public String getEndTime() { | ||
| 58 | + return endTime; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + public void setEndTime(String endTime) { | ||
| 62 | + this.endTime = endTime; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public String getEtRealExecDate() { | ||
| 66 | + return etRealExecDate; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public void setEtRealExecDate(String etRealExecDate) { | ||
| 70 | + this.etRealExecDate = etRealExecDate; | ||
| 71 | + } | ||
| 72 | +} |
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
| @@ -25,11 +25,11 @@ public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> | @@ -25,11 +25,11 @@ public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> | ||
| 25 | LineConfigData lineConfigData; | 25 | LineConfigData lineConfigData; |
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | - public Map<String, Object> check(Integer[] codeArray) { | 28 | + public Map<String, Object> check(String[] codeArray) { |
| 29 | Map<String, Object> rs = new HashMap<>(); | 29 | Map<String, Object> rs = new HashMap<>(); |
| 30 | - List<Integer> notArr = new ArrayList<>(); | 30 | + List<String> notArr = new ArrayList<>(); |
| 31 | 31 | ||
| 32 | - for(Integer lineCode : codeArray){ | 32 | + for(String lineCode : codeArray){ |
| 33 | if(null == lineConfigData.get(lineCode + "")) | 33 | if(null == lineConfigData.get(lineCode + "")) |
| 34 | notArr.add(lineCode); | 34 | notArr.add(lineCode); |
| 35 | } | 35 | } |
| @@ -44,8 +44,8 @@ public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> | @@ -44,8 +44,8 @@ public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> | ||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | @Override | 46 | @Override |
| 47 | - public Integer inti(Integer lineCode) throws Exception{ | ||
| 48 | - LineConfig conf = lineConfigData.get(lineCode + ""); | 47 | + public Integer init(String lineCode) throws Exception{ |
| 48 | + LineConfig conf = lineConfigData.get(lineCode ); | ||
| 49 | 49 | ||
| 50 | if(conf == null) | 50 | if(conf == null) |
| 51 | lineConfigData.init(lineCode); | 51 | lineConfigData.init(lineCode); |
src/main/java/com/bsth/service/realcontrol/impl/RealChartsServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.bsth.data.LineConfigData; | ||
| 5 | +import com.bsth.entity.realcontrol.LineConfig; | ||
| 6 | +import com.bsth.service.realcontrol.RealChartsService; | ||
| 7 | +import com.bsth.service.realcontrol.dto.CarOutRate; | ||
| 8 | +import com.bsth.service.realcontrol.dto.DeviceOnlineRate; | ||
| 9 | +import com.bsth.service.realcontrol.dto.RealOnline; | ||
| 10 | +import com.bsth.service.realcontrol.dto.StratEndPunctualityRate; | ||
| 11 | +import com.bsth.util.db.DBUtils_MS; | ||
| 12 | +import com.google.common.base.Splitter; | ||
| 13 | +import org.apache.commons.lang3.StringUtils; | ||
| 14 | +import org.joda.time.format.DateTimeFormat; | ||
| 15 | +import org.joda.time.format.DateTimeFormatter; | ||
| 16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 18 | +import org.springframework.jdbc.core.RowMapper; | ||
| 19 | +import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; | ||
| 20 | +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | ||
| 21 | +import org.springframework.stereotype.Service; | ||
| 22 | + | ||
| 23 | +import java.sql.ResultSet; | ||
| 24 | +import java.sql.SQLException; | ||
| 25 | +import java.util.*; | ||
| 26 | + | ||
| 27 | +/** | ||
| 28 | + * Created by panzhao on 2016/11/9. | ||
| 29 | + */ | ||
| 30 | +@Service | ||
| 31 | +public class RealChartsServiceImpl implements RealChartsService { | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + NamedParameterJdbcTemplate jdbcTemplate; | ||
| 35 | + | ||
| 36 | + @Autowired | ||
| 37 | + LineConfigData lineConfigData; | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 41 | + | ||
| 42 | + private final static long DAY_TIME = 1000 * 60 * 60 * 24L; | ||
| 43 | + /** | ||
| 44 | + * 设备上线率 | ||
| 45 | + * | ||
| 46 | + * @param | ||
| 47 | + * @param idx 线路id字符串 | ||
| 48 | + * @return | ||
| 49 | + */ | ||
| 50 | + @Override | ||
| 51 | + public List<DeviceOnlineRate> deviceOnlineRate(String month, String idx) { | ||
| 52 | + List<String> idArray = Splitter.on(",").splitToList(idx); | ||
| 53 | + //拼接in语句 | ||
| 54 | + String inStr = ""; | ||
| 55 | + for (String code : idArray) { | ||
| 56 | + inStr += (",'" + code+"'"); | ||
| 57 | + } | ||
| 58 | + inStr = " (" + inStr.substring(1) + ")"; | ||
| 59 | + | ||
| 60 | + String sql = "select DISTINCT XL_BM,SCHEDULE_DATE_STR, CL_ZBH from bsth_c_s_sp_info_real s where s.schedule_date_str like :month and xl_bm in " + inStr; | ||
| 61 | + MapSqlParameterSource parameters = new MapSqlParameterSource(); | ||
| 62 | + parameters.addValue("month", month+"-%"); | ||
| 63 | + | ||
| 64 | + final DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 65 | + //应该上线的设备 | ||
| 66 | + List<DeviceOnlineRate> mustList = jdbcTemplate.query(sql, parameters, new RowMapper<DeviceOnlineRate>() { | ||
| 67 | + @Override | ||
| 68 | + public DeviceOnlineRate mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 69 | + DeviceOnlineRate obj = new DeviceOnlineRate(); | ||
| 70 | + obj.setLineCode(rs.getString("XL_BM")); | ||
| 71 | + obj.setDateStr(rs.getString("SCHEDULE_DATE_STR")); | ||
| 72 | + obj.setNbbm(rs.getString("CL_ZBH")); | ||
| 73 | + obj.setDayOfYear(fmtyyyyMMdd.parseDateTime(obj.getDateStr()).getDayOfYear()); | ||
| 74 | + return obj; | ||
| 75 | + } | ||
| 76 | + }); | ||
| 77 | + | ||
| 78 | + if(mustList.size() == 0) | ||
| 79 | + return mustList; | ||
| 80 | + | ||
| 81 | + //查询ms 库 gps信息 | ||
| 82 | + JdbcTemplate msJdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); | ||
| 83 | + //要in的 days_year ,gps表分区字段 | ||
| 84 | + Set<Integer> daysSet = new HashSet<>(); | ||
| 85 | + | ||
| 86 | + Map<String, DeviceOnlineRate> groupData = new HashMap<>(); | ||
| 87 | + for(DeviceOnlineRate obj : mustList){ | ||
| 88 | + daysSet.add(obj.getDayOfYear()); | ||
| 89 | + //分组数据 | ||
| 90 | + groupData.put(obj.getDayOfYear()+"_"+obj.getNbbm(), obj); | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + | ||
| 94 | + //拼接 days_year in 语句 | ||
| 95 | + inStr=""; | ||
| 96 | + for(Integer daysOfYear : daysSet){ | ||
| 97 | + inStr += (",'" + daysOfYear+"'"); | ||
| 98 | + } | ||
| 99 | + inStr = " (" + inStr.substring(1) + ")"; | ||
| 100 | + //查询gps表,获取实际上线设备 | ||
| 101 | + sql = "select DISTINCT DEVICE_ID, DAYS_YEAR from bsth_c_gps_info where days_year in " + inStr; | ||
| 102 | + List<RealOnline> realList = msJdbcTemplate.query(sql, new RowMapper<RealOnline>() { | ||
| 103 | + @Override | ||
| 104 | + public RealOnline mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 105 | + RealOnline obj = new RealOnline(); | ||
| 106 | + obj.setDayOfYear(rs.getInt("DAYS_YEAR")); | ||
| 107 | + obj.setDevice(rs.getString("DEVICE_ID")); | ||
| 108 | + obj.setNbbm(BasicData.deviceId2NbbmMap.get(obj.getDevice())); | ||
| 109 | + return obj; | ||
| 110 | + } | ||
| 111 | + }); | ||
| 112 | + DeviceOnlineRate donline; | ||
| 113 | + for(RealOnline obj : realList){ | ||
| 114 | + if(StringUtils.isEmpty(obj.getNbbm())) | ||
| 115 | + continue; | ||
| 116 | + | ||
| 117 | + donline = groupData.get(obj.getDayOfYear() + "_" + obj.getNbbm()); | ||
| 118 | + if(donline != null) | ||
| 119 | + donline.setOnline(true); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + return mustList; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + /** | ||
| 126 | + * 出车率 | ||
| 127 | + * @param month | ||
| 128 | + * @param idx | ||
| 129 | + * @return | ||
| 130 | + */ | ||
| 131 | + @Override | ||
| 132 | + public List<CarOutRate> carOutRate(String month, String idx) { | ||
| 133 | + List<String> idArray = Splitter.on(",").splitToList(idx); | ||
| 134 | + //拼接in语句 | ||
| 135 | + String inStr = ""; | ||
| 136 | + for (String code : idArray) { | ||
| 137 | + inStr += (",'" + code+"'"); | ||
| 138 | + } | ||
| 139 | + inStr = " (" + inStr.substring(1) + ")"; | ||
| 140 | + | ||
| 141 | + String sql = "SELECT DISTINCT XL_BM,SCHEDULE_DATE_STR,CL_ZBH,right(min(concat(REAL_EXEC_DATE,fcsj_actual)),5) as FIRST_OUT FROM bsth_c_s_sp_info_real s WHERE s.schedule_date_str LIKE :month AND xl_bm IN "+inStr+" group by XL_BM,SCHEDULE_DATE_STR,CL_ZBH"; | ||
| 142 | + | ||
| 143 | + MapSqlParameterSource parameters = new MapSqlParameterSource(); | ||
| 144 | + parameters.addValue("month", month+"-%"); | ||
| 145 | + | ||
| 146 | + List<CarOutRate> list = jdbcTemplate.query(sql, parameters, new RowMapper<CarOutRate>() { | ||
| 147 | + @Override | ||
| 148 | + public CarOutRate mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 149 | + CarOutRate obj = new CarOutRate(); | ||
| 150 | + obj.setDateStr(rs.getString("SCHEDULE_DATE_STR")); | ||
| 151 | + obj.setNbbm(rs.getString("CL_ZBH")); | ||
| 152 | + obj.setLineCode(rs.getString("XL_BM")); | ||
| 153 | + obj.setFirstOut(rs.getString("FIRST_OUT")); | ||
| 154 | + return obj; | ||
| 155 | + } | ||
| 156 | + }); | ||
| 157 | + | ||
| 158 | + return list; | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + /** | ||
| 162 | + * 首末班次准点率 | ||
| 163 | + * @param month | ||
| 164 | + * @param idx | ||
| 165 | + * @return | ||
| 166 | + */ | ||
| 167 | + @Override | ||
| 168 | + public List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx) { | ||
| 169 | + List<String> idArray = Splitter.on(",").splitToList(idx); | ||
| 170 | + //拼接in语句 | ||
| 171 | + String inStr = ""; | ||
| 172 | + for (String code : idArray) { | ||
| 173 | + inStr += (",'" + code+"'"); | ||
| 174 | + } | ||
| 175 | + inStr = " (" + inStr.substring(1) + ")"; | ||
| 176 | + | ||
| 177 | + String sql = "select SCHEDULE_DATE_STR,XL_BM,CL_ZBH, min(sj) as STARTDATE, max(sj) as ENDDATE " + | ||
| 178 | + "from (select SCHEDULE_DATE_STR,dfsj, concat_ws('/',dfsj, fcsj_actual) as sj,XL_BM,CL_ZBH from bsth_c_s_sp_info_real " + | ||
| 179 | + "where schedule_date_str like :month and bc_type='normal' and dfsj is not null and xl_bm in "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM,CL_ZBH"; | ||
| 180 | + | ||
| 181 | + | ||
| 182 | + MapSqlParameterSource parameters = new MapSqlParameterSource(); | ||
| 183 | + parameters.addValue("month", month+"-%"); | ||
| 184 | + | ||
| 185 | + List<StratEndPunctualityRate> list = jdbcTemplate.query(sql, parameters, new RowMapper<StratEndPunctualityRate>() { | ||
| 186 | + @Override | ||
| 187 | + public StratEndPunctualityRate mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 188 | + StratEndPunctualityRate obj = new StratEndPunctualityRate(); | ||
| 189 | + obj.setLineCode(rs.getString("XL_BM")); | ||
| 190 | + obj.setDateStr(rs.getString("SCHEDULE_DATE_STR")); | ||
| 191 | + obj.setNbbm(rs.getString("CL_ZBH")); | ||
| 192 | + obj.setStartTime(rs.getString("STARTDATE")); | ||
| 193 | + obj.setEndTime(rs.getString("ENDDATE")); | ||
| 194 | + obj.setEtRealExecDate(obj.getDateStr()); | ||
| 195 | + | ||
| 196 | + if(obj.getEndTime().length() == 11){ | ||
| 197 | + //末班真实执行日期 | ||
| 198 | + LineConfig conf =lineConfigData.get(obj.getLineCode()); | ||
| 199 | + String fcsjActual=obj.getEndTime().split("/")[1]; | ||
| 200 | + | ||
| 201 | + if(fcsjActual.compareTo(conf.getStartOpt()) < 0){ | ||
| 202 | + //加一天 | ||
| 203 | + obj.setEtRealExecDate(fmtyyyyMMdd.print(fmtyyyyMMdd.parseMillis(obj.getEtRealExecDate()) + DAY_TIME)); | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + return obj; | ||
| 208 | + } | ||
| 209 | + }); | ||
| 210 | + return list; | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + @Override | ||
| 214 | + public List<StratEndPunctualityRate> sePunctualityRateLine(String month, String idx) { | ||
| 215 | + List<String> idArray = Splitter.on(",").splitToList(idx); | ||
| 216 | + //拼接in语句 | ||
| 217 | + String inStr = ""; | ||
| 218 | + for (String code : idArray) { | ||
| 219 | + inStr += (",'" + code+"'"); | ||
| 220 | + } | ||
| 221 | + inStr = " (" + inStr.substring(1) + ")"; | ||
| 222 | + | ||
| 223 | + String sql = "select SCHEDULE_DATE_STR,XL_BM, min(sj) as STARTDATE, max(sj) as ENDDATE " + | ||
| 224 | + "from (select SCHEDULE_DATE_STR,dfsj, concat_ws('/',dfsj, fcsj_actual) as sj,XL_BM from bsth_c_s_sp_info_real " + | ||
| 225 | + "where schedule_date_str like :month and bc_type='normal' and dfsj is not null and xl_bm in "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM"; | ||
| 226 | + | ||
| 227 | + MapSqlParameterSource parameters = new MapSqlParameterSource(); | ||
| 228 | + parameters.addValue("month", month+"-%"); | ||
| 229 | + | ||
| 230 | + List<StratEndPunctualityRate> list = jdbcTemplate.query(sql, parameters, new RowMapper<StratEndPunctualityRate>() { | ||
| 231 | + @Override | ||
| 232 | + public StratEndPunctualityRate mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 233 | + StratEndPunctualityRate obj = new StratEndPunctualityRate(); | ||
| 234 | + obj.setLineCode(rs.getString("XL_BM")); | ||
| 235 | + obj.setDateStr(rs.getString("SCHEDULE_DATE_STR")); | ||
| 236 | + obj.setStartTime(rs.getString("STARTDATE")); | ||
| 237 | + obj.setEndTime(rs.getString("ENDDATE")); | ||
| 238 | + obj.setEtRealExecDate(obj.getDateStr()); | ||
| 239 | + | ||
| 240 | + if(obj.getEndTime().length() == 11){ | ||
| 241 | + //末班真实执行日期 | ||
| 242 | + LineConfig conf =lineConfigData.get(obj.getLineCode()); | ||
| 243 | + String fcsjActual=obj.getEndTime().split("/")[1]; | ||
| 244 | + | ||
| 245 | + if(fcsjActual.compareTo(conf.getStartOpt()) < 0){ | ||
| 246 | + //加一天 | ||
| 247 | + obj.setEtRealExecDate(fmtyyyyMMdd.print(fmtyyyyMMdd.parseMillis(obj.getEtRealExecDate()) + DAY_TIME)); | ||
| 248 | + } | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + return obj; | ||
| 252 | + } | ||
| 253 | + }); | ||
| 254 | + return list; | ||
| 255 | + } | ||
| 256 | +} |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1332,6 +1332,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1332,6 +1332,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1332 | map.put("ssgl_yw", ssgl_yw==0?0:format.format(ssgl_yw)); | 1332 | map.put("ssgl_yw", ssgl_yw==0?0:format.format(ssgl_yw)); |
| 1333 | map.put("ssgl_other", ssgl_other==0?0:format.format(ssgl_other)); | 1333 | map.put("ssgl_other", ssgl_other==0?0:format.format(ssgl_other)); |
| 1334 | map.put("ljgl", ljgl==0?0:format.format(ljgl)); | 1334 | map.put("ljgl", ljgl==0?0:format.format(ljgl)); |
| 1335 | + map.put("jhbc", jhbc); | ||
| 1335 | map.put("jhbc_m", jhbc_m); | 1336 | map.put("jhbc_m", jhbc_m); |
| 1336 | map.put("jhbc_a", jhbc_a); | 1337 | map.put("jhbc_a", jhbc_a); |
| 1337 | map.put("sjbc", sjbc); | 1338 | map.put("sjbc", sjbc); |
src/main/java/com/bsth/util/db/DBUtils_MS.java
src/main/resources/application-dev.properties
| @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= false | 9 | spring.jpa.show-sql= false |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.168.201:3306/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 11 | +spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | spring.datasource.username= root | 12 | spring.datasource.username= root |
| 13 | spring.datasource.password= 123456 | 13 | spring.datasource.password= 123456 |
| 14 | #DATASOURCE | 14 | #DATASOURCE |
| @@ -29,4 +29,4 @@ spring.datasource.validation-query=select 1 | @@ -29,4 +29,4 @@ spring.datasource.validation-query=select 1 | ||
| 29 | http.gps.real.url= http://192.168.168.201:9090/transport_server/rtgps/ | 29 | http.gps.real.url= http://192.168.168.201:9090/transport_server/rtgps/ |
| 30 | #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ | 30 | #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ |
| 31 | ##\u6D88\u606F\u4E0B\u53D1 | 31 | ##\u6D88\u606F\u4E0B\u53D1 |
| 32 | -http.send.directive = http://192.168.168.201:9090/transport_server/message/ | 32 | +http.send.directive = http://192.168.168.201:9090/transport_server/message/ |
| 33 | \ No newline at end of file | 33 | \ No newline at end of file |
src/main/resources/application-prod.properties
| @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= true | 9 | spring.jpa.show-sql= true |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.40.100:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 11 | +spring.datasource.url= jdbc:mysql://192.168.168.171:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | spring.datasource.username= root | 12 | spring.datasource.username= root |
| 13 | -spring.datasource.password= root@JSP2jsp | 13 | +spring.datasource.password= root2jsp |
| 14 | #DATASOURCE | 14 | #DATASOURCE |
| 15 | spring.datasource.max-active=100 | 15 | spring.datasource.max-active=100 |
| 16 | spring.datasource.max-idle=8 | 16 | spring.datasource.max-idle=8 |
| @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 | @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 | ||
| 26 | ## | 26 | ## |
| 27 | #222.66.0.204:5555 | 27 | #222.66.0.204:5555 |
| 28 | ##\u5B9E\u65F6gps | 28 | ##\u5B9E\u65F6gps |
| 29 | -http.gps.real.url= http://192.168.40.82:8080/transport_server/rtgps/ | 29 | +http.gps.real.url= http://192.168.168.171:8080/transport_server/rtgps/ |
| 30 | ##\u6D88\u606F\u4E0B\u53D1 | 30 | ##\u6D88\u606F\u4E0B\u53D1 |
| 31 | -http.send.directive = http://192.168.40.82:8080/transport_server/message/ | ||
| 32 | \ No newline at end of file | 31 | \ No newline at end of file |
| 32 | +http.send.directive = http://192.168.168.171:8080/transport_server/message/ | ||
| 33 | \ No newline at end of file | 33 | \ No newline at end of file |
src/main/resources/datatools/config-prod.properties
| @@ -3,14 +3,15 @@ | @@ -3,14 +3,15 @@ | ||
| 3 | # 1、kettle配置文件路径(类路径) | 3 | # 1、kettle配置文件路径(类路径) |
| 4 | datatools.kettle_properties=/datatools/kettle.properties | 4 | datatools.kettle_properties=/datatools/kettle.properties |
| 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) | 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) |
| 6 | + | ||
| 6 | #数据库ip地址 | 7 | #数据库ip地址 |
| 7 | -datatools.kvars_dbip=192.168.40.100 | 8 | +datatools.kvars_dbip=192.168.168.171 |
| 8 | #数据库用户名 | 9 | #数据库用户名 |
| 9 | datatools.kvars_dbuname=root | 10 | datatools.kvars_dbuname=root |
| 10 | #数据库密码 | 11 | #数据库密码 |
| 11 | -datatools.kvars_dbpwd=root@JSP2jsp | 12 | +datatools.kvars_dbpwd=root2jsp |
| 12 | #数据库库名 | 13 | #数据库库名 |
| 13 | -datatools.kvars_dbdname=qp_control | 14 | +datatools.kvars_dbdname=control |
| 14 | 15 | ||
| 15 | # 3、上传数据配置信息 | 16 | # 3、上传数据配置信息 |
| 16 | # 上传文件目录配置(根据不同的环境需要修正) | 17 | # 上传文件目录配置(根据不同的环境需要修正) |
src/main/resources/ms-jdbc.properties
| 1 | -#ms.mysql.driver= com.mysql.jdbc.Driver | ||
| 2 | -#ms.mysql.url= jdbc:mysql://192.168.40.82:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 3 | -#ms.mysql.username= root | ||
| 4 | -#ms.mysql.password= 123456 | ||
| 5 | - | ||
| 6 | ms.mysql.driver= com.mysql.jdbc.Driver | 1 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false | 2 | ms.mysql.url= jdbc:mysql://192.168.168.201:3306/ms?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 8 | ms.mysql.username= root | 3 | ms.mysql.username= root |
| 9 | ms.mysql.password= 123456 | 4 | ms.mysql.password= 123456 |
| 5 | + | ||
| 6 | +#ms.mysql.driver= com.mysql.jdbc.Driver | ||
| 7 | +#ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8 | ||
| 8 | +#ms.mysql.username= root | ||
| 9 | +#ms.mysql.password= root2jsp |
src/main/resources/static/index.html
| @@ -145,7 +145,7 @@ tr.row-active td { | @@ -145,7 +145,7 @@ tr.row-active td { | ||
| 145 | <div class="page-header-inner "> | 145 | <div class="page-header-inner "> |
| 146 | <!-- LOGO --> | 146 | <!-- LOGO --> |
| 147 | <div class="page-logo"> | 147 | <div class="page-logo"> |
| 148 | - <a href="index.html" class="logo-default logo-default-text" > 青浦公交调度系统 </a> | 148 | + <a href="index.html" class="logo-default logo-default-text" > 闵行公交调度系统 </a> |
| 149 | <div class="menu-toggler sidebar-toggler"> | 149 | <div class="menu-toggler sidebar-toggler"> |
| 150 | </div> | 150 | </div> |
| 151 | </div> | 151 | </div> |
| @@ -314,8 +314,8 @@ tr.row-active td { | @@ -314,8 +314,8 @@ tr.row-active td { | ||
| 314 | <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js" ></script> | 314 | <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js" ></script> |
| 315 | <!-- 表格控件 --> | 315 | <!-- 表格控件 --> |
| 316 | <!-- 统计图控件 --> | 316 | <!-- 统计图控件 --> |
| 317 | -<script src="/assets/global/getEchart.js"></script> | ||
| 318 | -<script src="/assets/global/echarts.js"></script> | 317 | +<!--<script src="/assets/global/getEchart.js"></script> |
| 318 | +<script src="/assets/global/echarts.js"></script> --> | ||
| 319 | <script src="/assets/js/common.js"></script> | 319 | <script src="/assets/js/common.js"></script> |
| 320 | <script src="/assets/js/dictionary.js"></script> | 320 | <script src="/assets/js/dictionary.js"></script> |
| 321 | 321 |
src/main/resources/static/login.html
| @@ -180,7 +180,7 @@ h3.logo-text{ | @@ -180,7 +180,7 @@ h3.logo-text{ | ||
| 180 | <div class="wrapper ng-scope"> | 180 | <div class="wrapper ng-scope"> |
| 181 | <div id="loginPanel" class="dialog dialog-shadow"> | 181 | <div id="loginPanel" class="dialog dialog-shadow"> |
| 182 | <br> | 182 | <br> |
| 183 | - <h3 class="logo-text">青浦公交调度系统 </h3> | 183 | + <h3 class="logo-text">闵行公交调度系统 </h3> |
| 184 | <hr> | 184 | <hr> |
| 185 | <form style="padding: 0px 35px;"> | 185 | <form style="padding: 0px 35px;"> |
| 186 | <div class="form-group" style="margin-bottom: 0"> | 186 | <div class="form-group" style="margin-bottom: 0"> |
| @@ -238,7 +238,7 @@ window.onload=function(){ | @@ -238,7 +238,7 @@ window.onload=function(){ | ||
| 238 | $('input', form).on('keyup', checkBtnStatus); | 238 | $('input', form).on('keyup', checkBtnStatus); |
| 239 | 239 | ||
| 240 | var keys; | 240 | var keys; |
| 241 | - $.get('/user/login/jCryptionKey', function(data){ | 241 | + $.get('/user/login/jCryptionKey?t='+Math.random(), function(data){ |
| 242 | keys = data.publickey; | 242 | keys = data.publickey; |
| 243 | }); | 243 | }); |
| 244 | 244 |
src/main/resources/static/pages/control/line/index.html
| @@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
| 18 | <div class="portlet-title banner" > | 18 | <div class="portlet-title banner" > |
| 19 | <div class="caption col_hide_1280" style="color: #FFF;"> | 19 | <div class="caption col_hide_1280" style="color: #FFF;"> |
| 20 | <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span | 20 | <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span |
| 21 | - class="caption-subject bold" style="font-size: 24px;">青浦公交线路调度系统</span> | 21 | + class="caption-subject bold" style="font-size: 24px;">闵行公交线路调度系统</span> |
| 22 | </div> | 22 | </div> |
| 23 | <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;"> | 23 | <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;"> |
| 24 | <span class="top_username"></span> <span class="operation_mode_text animated" ></span> | 24 | <span class="top_username"></span> <span class="operation_mode_text animated" ></span> |
src/main/resources/static/pages/device/connection_search.html
| @@ -71,6 +71,9 @@ | @@ -71,6 +71,9 @@ | ||
| 71 | </div> | 71 | </div> |
| 72 | </div> | 72 | </div> |
| 73 | </div> | 73 | </div> |
| 74 | + <form id="export_form" action="/devicegps/export" method="post" style="display:none;"> | ||
| 75 | + <input type="text" id="json" name="json"> | ||
| 76 | + </form> | ||
| 74 | <div class="tab-pane fade" id="tab2"> | 77 | <div class="tab-pane fade" id="tab2"> |
| 75 | <div class="row"> | 78 | <div class="row"> |
| 76 | <div class="col-md-12"> | 79 | <div class="col-md-12"> |
| @@ -98,6 +101,8 @@ | @@ -98,6 +101,8 @@ | ||
| 98 | <label class="checkbox-inline"> | 101 | <label class="checkbox-inline"> |
| 99 | <input type="radio" name="filterOption" value="5">版本不等于 | 102 | <input type="radio" name="filterOption" value="5">版本不等于 |
| 100 | <input type="text" id="version" name="version" size="5"> | 103 | <input type="text" id="version" name="version" size="5"> |
| 104 | + | ||
| 105 | + <a id="export_btn" class="btn btn-circle blue" href="#" data-pjax> 导出</a> | ||
| 101 | </label> | 106 | </label> |
| 102 | </div> | 107 | </div> |
| 103 | </div> | 108 | </div> |
| @@ -227,7 +232,7 @@ | @@ -227,7 +232,7 @@ | ||
| 227 | </script> | 232 | </script> |
| 228 | <script> | 233 | <script> |
| 229 | $(function(){ | 234 | $(function(){ |
| 230 | - var opened; | 235 | + var opened,filtered; |
| 231 | $('#myTab li:eq(0) a').tab('show'); | 236 | $('#myTab li:eq(0) a').tab('show'); |
| 232 | $('#fileinput').fileinput({ | 237 | $('#fileinput').fileinput({ |
| 233 | 'showPreview' : false, | 238 | 'showPreview' : false, |
| @@ -247,10 +252,11 @@ $(function(){ | @@ -247,10 +252,11 @@ $(function(){ | ||
| 247 | $(this).html(moment(parseInt($(this).html())).format('YYYY-M-D HH:mm:ss')); | 252 | $(this).html(moment(parseInt($(this).html())).format('YYYY-M-D HH:mm:ss')); |
| 248 | }); | 253 | }); |
| 249 | opened = new Array(); | 254 | opened = new Array(); |
| 255 | + filtered = new Array(); | ||
| 250 | for (var j = 0,len = r.data.length;j < len;j++) { | 256 | for (var j = 0,len = r.data.length;j < len;j++) { |
| 251 | var item = r.data[j]; | 257 | var item = r.data[j]; |
| 252 | - delete item.detail; | ||
| 253 | opened.push(item); | 258 | opened.push(item); |
| 259 | + filtered.push(item); | ||
| 254 | } | 260 | } |
| 255 | } | 261 | } |
| 256 | $(this).fileinput('clear').fileinput('enable'); | 262 | $(this).fileinput('clear').fileinput('enable'); |
| @@ -265,15 +271,19 @@ $(function(){ | @@ -265,15 +271,19 @@ $(function(){ | ||
| 265 | $('input[type=radio][name=filterOption]').change(function() { | 271 | $('input[type=radio][name=filterOption]').change(function() { |
| 266 | importDeviceSearch(); | 272 | importDeviceSearch(); |
| 267 | }); | 273 | }); |
| 274 | + | ||
| 275 | + $('#export_btn').on('click', function(e){ | ||
| 276 | + exportResult(); | ||
| 277 | + }); | ||
| 268 | 278 | ||
| 269 | function importDeviceSearch(){ | 279 | function importDeviceSearch(){ |
| 270 | if (!opened) return false; | 280 | if (!opened) return false; |
| 271 | var params = { json : JSON.stringify(opened) }; | 281 | var params = { json : JSON.stringify(opened) }; |
| 272 | - $post('/devicegps/open/filter', params, function(r){ | ||
| 273 | - debugger; | 282 | + $post('/devicegps/opened', params, function(r){ |
| 274 | if(r.errCode) layer.msg(r.msg); | 283 | if(r.errCode) layer.msg(r.msg); |
| 275 | else { | 284 | else { |
| 276 | - var filtered = new Array(), val = $('input[type=radio][name=filterOption]:checked').val(), version = $('#version').val(), i = 0,item = null; | 285 | + var val = $('input[type=radio][name=filterOption]:checked').val(), version = $('#version').val(), i = 0,item = null; |
| 286 | + filtered = new Array(); | ||
| 277 | switch(val) { | 287 | switch(val) { |
| 278 | case '1': | 288 | case '1': |
| 279 | filtered = r.data; | 289 | filtered = r.data; |
| @@ -313,6 +323,13 @@ $(function(){ | @@ -313,6 +323,13 @@ $(function(){ | ||
| 313 | } | 323 | } |
| 314 | }); | 324 | }); |
| 315 | } | 325 | } |
| 326 | + | ||
| 327 | + function exportResult() { | ||
| 328 | + if (!filtered) return false; | ||
| 329 | + $('#json').val(JSON.stringify(filtered)); | ||
| 330 | + var form = $('#export_form'); | ||
| 331 | + form.submit(); | ||
| 332 | + } | ||
| 316 | 333 | ||
| 317 | var page = 0, initPagination; | 334 | var page = 0, initPagination; |
| 318 | var icheckOptions = { | 335 | var icheckOptions = { |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| @@ -301,7 +301,7 @@ | @@ -301,7 +301,7 @@ | ||
| 301 | //查询 | 301 | //查询 |
| 302 | $("#query").on('click',function(){ | 302 | $("#query").on('click',function(){ |
| 303 | var line = $("#line").val(); | 303 | var line = $("#line").val(); |
| 304 | - var xlName = $("#line").text(); | 304 | + var xlName = $("#select2-line-container").html(); |
| 305 | var date = $("#date").val(); | 305 | var date = $("#date").val(); |
| 306 | $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){ | 306 | $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){ |
| 307 | var scheduleDaily_1 = template('scheduleDaily_1',{list:result}); | 307 | var scheduleDaily_1 = template('scheduleDaily_1',{list:result}); |
src/main/resources/static/pages/scheduleApp/module/common/dts1/upload/saFileuploadTemplate.html
| 1 | -<div class="input-group"> | ||
| 2 | - <input type="file" name="file" id="file"/> | ||
| 3 | - | ||
| 4 | - <input type="file" class="form-control" nv-file-select="" uploader="ctrl.uploader"/> | ||
| 5 | - <span class="input-group-btn"> | ||
| 6 | - <button type="button" ng-click="ctrl.clearInputFile()" class="btn btn-default"> | ||
| 7 | - <span class="glyphicon glyphicon-trash"></span> | ||
| 8 | - </button> | ||
| 9 | - <button type="button" class="btn btn-success"> | ||
| 10 | - <span class="glyphicon glyphicon-upload"></span> 上传 | ||
| 11 | - </button> | ||
| 12 | - </span> | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | 1 | +<div class="input-group"> |
| 2 | + <input type="file" name="file" id="file"/> | ||
| 3 | + | ||
| 4 | + <input type="file" class="form-control" nv-file-select="" uploader="ctrl.uploader"/> | ||
| 5 | + <span class="input-group-btn"> | ||
| 6 | + <button type="button" ng-click="ctrl.clearInputFile()" class="btn btn-default"> | ||
| 7 | + <span class="glyphicon glyphicon-trash"></span> | ||
| 8 | + </button> | ||
| 9 | + <button type="button" class="btn btn-success"> | ||
| 10 | + <span class="glyphicon glyphicon-upload"></span> 上传 | ||
| 11 | + </button> | ||
| 12 | + </span> | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + | ||
| 17 | </div> | 17 | </div> |
| 18 | \ No newline at end of file | 18 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidationt2.js
| 1 | -/** | ||
| 2 | - * remoteValidatiot2指令,远程数据验证验证,作为属性放在某个指令上,依赖与指令的ngModel(专门用于时刻表sheet验证)。 | ||
| 3 | - * 属性如下: | ||
| 4 | - * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl" | ||
| 5 | - * remotevparam(必须):后端判定查询参数,如rvparam={{ {'xl.id_eq': '123'} | json }} | ||
| 6 | - * | ||
| 7 | - */ | ||
| 8 | -angular.module('ScheduleApp').directive('remoteValidationt2', [ | ||
| 9 | - '$$SearchInfoService_g', | ||
| 10 | - function($$SearchInfoService_g) { | ||
| 11 | - return { | ||
| 12 | - restrict: "A", // 属性 | ||
| 13 | - require: "^ngModel", // 依赖所属指令的ngModel | ||
| 14 | - compile: function(tElem, tAttrs) { | ||
| 15 | - // 验证属性 | ||
| 16 | - if (!tAttrs["remotevtype"]) { // 验证类型 | ||
| 17 | - throw new Error("remotevtype属性必须填写"); | ||
| 18 | - } else if (!$$SearchInfoService_g.validate[tAttrs["remotevtype"]]) { | ||
| 19 | - throw new Error(!tAttrs["remotevtype"] + "验证类型不存在"); | ||
| 20 | - } | ||
| 21 | - if (!tAttrs["remotevparam"]) { // 查询参数 | ||
| 22 | - throw new Error("remotevparam属性必须填写"); | ||
| 23 | - } | ||
| 24 | - | ||
| 25 | - // 监听获取的数据 | ||
| 26 | - var $watch_rvtype = undefined; | ||
| 27 | - var $watch_rvparam_obj = undefined; | ||
| 28 | - | ||
| 29 | - // 验证数据 | ||
| 30 | - var $$internal_validate = function(ngModelCtrl, scope) { | ||
| 31 | - if ($watch_rvtype && $watch_rvparam_obj) { | ||
| 32 | - // 获取查询参数模版 | ||
| 33 | - var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template; | ||
| 34 | - if (!paramTemplate) { | ||
| 35 | - throw new Error($watch_rvtype + "查询模版不存在"); | ||
| 36 | - } | ||
| 37 | - // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 | ||
| 38 | - var isParamAll = true; | ||
| 39 | - for (var key in paramTemplate) { | ||
| 40 | - if (!$watch_rvparam_obj[key]) { | ||
| 41 | - isParamAll = false; | ||
| 42 | - break; | ||
| 43 | - } | ||
| 44 | - } | ||
| 45 | - if (!isParamAll) { | ||
| 46 | - ngModelCtrl.$setValidity('remote', true); | ||
| 47 | - } else { // 开始验证 | ||
| 48 | - $$SearchInfoService_g.validate[$watch_rvtype].remote.do( | ||
| 49 | - $watch_rvparam_obj, | ||
| 50 | - function(result) { | ||
| 51 | - if (result.status == "SUCCESS") { | ||
| 52 | - ngModelCtrl.$setValidity('remote', true); | ||
| 53 | - } else { | ||
| 54 | - ngModelCtrl.$setValidity('remote', false); | ||
| 55 | - scope.ctrl.ttInfoDetailManageForForm.sheetvaliddesc = result.msg; | ||
| 56 | - } | ||
| 57 | - }, | ||
| 58 | - function(result) { | ||
| 59 | - alert("出错拉"); | ||
| 60 | - ngModelCtrl.$setValidity('remote', true); | ||
| 61 | - } | ||
| 62 | - ); | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - }; | ||
| 66 | - | ||
| 67 | - return { | ||
| 68 | - pre: function(scope, element, attr) { | ||
| 69 | - | ||
| 70 | - }, | ||
| 71 | - | ||
| 72 | - post: function(scope, element, attr, ngModelCtrl) { | ||
| 73 | - /** | ||
| 74 | - * 监控验证类型属性变化。 | ||
| 75 | - */ | ||
| 76 | - attr.$observe("remotevtype", function(value) { | ||
| 77 | - if (value && value != "") { | ||
| 78 | - $watch_rvtype = value; | ||
| 79 | - $$internal_validate(ngModelCtrl, scope); | ||
| 80 | - } | ||
| 81 | - }); | ||
| 82 | - /** | ||
| 83 | - * 监控查询结果属性变化。 | ||
| 84 | - */ | ||
| 85 | - attr.$observe("remotevparam", function(value) { | ||
| 86 | - if (value && value != "") { | ||
| 87 | - //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证 | ||
| 88 | - // return; | ||
| 89 | - //} | ||
| 90 | - $watch_rvparam_obj = JSON.parse(value); | ||
| 91 | - $$internal_validate(ngModelCtrl, scope); | ||
| 92 | - } | ||
| 93 | - }); | ||
| 94 | - } | ||
| 95 | - }; | ||
| 96 | - } | ||
| 97 | - } | ||
| 98 | - } | ||
| 99 | -]); | 1 | +/** |
| 2 | + * remoteValidatiot2指令,远程数据验证验证,作为属性放在某个指令上,依赖与指令的ngModel(专门用于时刻表sheet验证)。 | ||
| 3 | + * 属性如下: | ||
| 4 | + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl" | ||
| 5 | + * remotevparam(必须):后端判定查询参数,如rvparam={{ {'xl.id_eq': '123'} | json }} | ||
| 6 | + * | ||
| 7 | + */ | ||
| 8 | +angular.module('ScheduleApp').directive('remoteValidationt2', [ | ||
| 9 | + '$$SearchInfoService_g', | ||
| 10 | + function($$SearchInfoService_g) { | ||
| 11 | + return { | ||
| 12 | + restrict: "A", // 属性 | ||
| 13 | + require: "^ngModel", // 依赖所属指令的ngModel | ||
| 14 | + compile: function(tElem, tAttrs) { | ||
| 15 | + // 验证属性 | ||
| 16 | + if (!tAttrs["remotevtype"]) { // 验证类型 | ||
| 17 | + throw new Error("remotevtype属性必须填写"); | ||
| 18 | + } else if (!$$SearchInfoService_g.validate[tAttrs["remotevtype"]]) { | ||
| 19 | + throw new Error(!tAttrs["remotevtype"] + "验证类型不存在"); | ||
| 20 | + } | ||
| 21 | + if (!tAttrs["remotevparam"]) { // 查询参数 | ||
| 22 | + throw new Error("remotevparam属性必须填写"); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + // 监听获取的数据 | ||
| 26 | + var $watch_rvtype = undefined; | ||
| 27 | + var $watch_rvparam_obj = undefined; | ||
| 28 | + | ||
| 29 | + // 验证数据 | ||
| 30 | + var $$internal_validate = function(ngModelCtrl, scope) { | ||
| 31 | + if ($watch_rvtype && $watch_rvparam_obj) { | ||
| 32 | + // 获取查询参数模版 | ||
| 33 | + var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template; | ||
| 34 | + if (!paramTemplate) { | ||
| 35 | + throw new Error($watch_rvtype + "查询模版不存在"); | ||
| 36 | + } | ||
| 37 | + // 判定如果参数对象不全,没有完全和模版参数里对应上,则不验证 | ||
| 38 | + var isParamAll = true; | ||
| 39 | + for (var key in paramTemplate) { | ||
| 40 | + if (!$watch_rvparam_obj[key]) { | ||
| 41 | + isParamAll = false; | ||
| 42 | + break; | ||
| 43 | + } | ||
| 44 | + } | ||
| 45 | + if (!isParamAll) { | ||
| 46 | + ngModelCtrl.$setValidity('remote', true); | ||
| 47 | + } else { // 开始验证 | ||
| 48 | + $$SearchInfoService_g.validate[$watch_rvtype].remote.do( | ||
| 49 | + $watch_rvparam_obj, | ||
| 50 | + function(result) { | ||
| 51 | + if (result.status == "SUCCESS") { | ||
| 52 | + ngModelCtrl.$setValidity('remote', true); | ||
| 53 | + } else { | ||
| 54 | + ngModelCtrl.$setValidity('remote', false); | ||
| 55 | + scope.ctrl.ttInfoDetailManageForForm.sheetvaliddesc = result.msg; | ||
| 56 | + } | ||
| 57 | + }, | ||
| 58 | + function(result) { | ||
| 59 | + alert("出错拉"); | ||
| 60 | + ngModelCtrl.$setValidity('remote', true); | ||
| 61 | + } | ||
| 62 | + ); | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + }; | ||
| 66 | + | ||
| 67 | + return { | ||
| 68 | + pre: function(scope, element, attr) { | ||
| 69 | + | ||
| 70 | + }, | ||
| 71 | + | ||
| 72 | + post: function(scope, element, attr, ngModelCtrl) { | ||
| 73 | + /** | ||
| 74 | + * 监控验证类型属性变化。 | ||
| 75 | + */ | ||
| 76 | + attr.$observe("remotevtype", function(value) { | ||
| 77 | + if (value && value != "") { | ||
| 78 | + $watch_rvtype = value; | ||
| 79 | + $$internal_validate(ngModelCtrl, scope); | ||
| 80 | + } | ||
| 81 | + }); | ||
| 82 | + /** | ||
| 83 | + * 监控查询结果属性变化。 | ||
| 84 | + */ | ||
| 85 | + attr.$observe("remotevparam", function(value) { | ||
| 86 | + if (value && value != "") { | ||
| 87 | + //if (!ngModelCtrl.$dirty) { // 没有修改过模型数据,不验证 | ||
| 88 | + // return; | ||
| 89 | + //} | ||
| 90 | + $watch_rvparam_obj = JSON.parse(value); | ||
| 91 | + $$internal_validate(ngModelCtrl, scope); | ||
| 92 | + } | ||
| 93 | + }); | ||
| 94 | + } | ||
| 95 | + }; | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | +]); |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| 1 | -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 | ||
| 2 | - | ||
| 3 | -// 文件下载服务 | ||
| 4 | -angular.module('ScheduleApp').factory('FileDownload_g', function() { | ||
| 5 | - return { | ||
| 6 | - downloadFile: function (data, mimeType, fileName) { | ||
| 7 | - var success = false; | ||
| 8 | - var blob = new Blob([data], { type: mimeType }); | ||
| 9 | - try { | ||
| 10 | - if (navigator.msSaveBlob) | ||
| 11 | - navigator.msSaveBlob(blob, fileName); | ||
| 12 | - else { | ||
| 13 | - // Try using other saveBlob implementations, if available | ||
| 14 | - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob; | ||
| 15 | - if (saveBlob === undefined) throw "Not supported"; | ||
| 16 | - saveBlob(blob, fileName); | ||
| 17 | - } | ||
| 18 | - success = true; | ||
| 19 | - } catch (ex) { | ||
| 20 | - console.log("saveBlob method failed with the following exception:"); | ||
| 21 | - console.log(ex); | ||
| 22 | - } | ||
| 23 | - | ||
| 24 | - if (!success) { | ||
| 25 | - // Get the blob url creator | ||
| 26 | - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; | ||
| 27 | - if (urlCreator) { | ||
| 28 | - // Try to use a download link | ||
| 29 | - var link = document.createElement('a'); | ||
| 30 | - if ('download' in link) { | ||
| 31 | - // Try to simulate a click | ||
| 32 | - try { | ||
| 33 | - // Prepare a blob URL | ||
| 34 | - var url = urlCreator.createObjectURL(blob); | ||
| 35 | - link.setAttribute('href', url); | ||
| 36 | - | ||
| 37 | - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+) | ||
| 38 | - link.setAttribute("download", fileName); | ||
| 39 | - | ||
| 40 | - // Simulate clicking the download link | ||
| 41 | - var event = document.createEvent('MouseEvents'); | ||
| 42 | - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | ||
| 43 | - link.dispatchEvent(event); | ||
| 44 | - success = true; | ||
| 45 | - | ||
| 46 | - } catch (ex) { | ||
| 47 | - console.log("Download link method with simulated click failed with the following exception:"); | ||
| 48 | - console.log(ex); | ||
| 49 | - } | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - if (!success) { | ||
| 53 | - // Fallback to window.location method | ||
| 54 | - try { | ||
| 55 | - // Prepare a blob URL | ||
| 56 | - // Use application/octet-stream when using window.location to force download | ||
| 57 | - var url = urlCreator.createObjectURL(blob); | ||
| 58 | - window.location = url; | ||
| 59 | - console.log("Download link method with window.location succeeded"); | ||
| 60 | - success = true; | ||
| 61 | - } catch (ex) { | ||
| 62 | - console.log("Download link method with window.location failed with the following exception:"); | ||
| 63 | - console.log(ex); | ||
| 64 | - } | ||
| 65 | - } | ||
| 66 | - } | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - if (!success) { | ||
| 70 | - // Fallback to window.open method | ||
| 71 | - console.log("No methods worked for saving the arraybuffer, using last resort window.open"); | ||
| 72 | - window.open("", '_blank', ''); | ||
| 73 | - } | ||
| 74 | - } | ||
| 75 | - }; | ||
| 76 | -}); | ||
| 77 | - | ||
| 78 | -// 车辆信息service | ||
| 79 | -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | ||
| 80 | - return { | ||
| 81 | - rest: $resource( | ||
| 82 | - '/cars/:id', | ||
| 83 | - {order: 'carCode', direction: 'ASC', id: '@id_route'}, | ||
| 84 | - { | ||
| 85 | - list: { | ||
| 86 | - method: 'GET', | ||
| 87 | - params: { | ||
| 88 | - page: 0 | ||
| 89 | - } | ||
| 90 | - }, | ||
| 91 | - get: { | ||
| 92 | - method: 'GET' | ||
| 93 | - }, | ||
| 94 | - save: { | ||
| 95 | - method: 'POST' | ||
| 96 | - } | ||
| 97 | - } | ||
| 98 | - ), | ||
| 99 | - validate: $resource( | ||
| 100 | - '/cars/validate/:type', | ||
| 101 | - {}, | ||
| 102 | - { | ||
| 103 | - insideCode: { | ||
| 104 | - method: 'GET' | ||
| 105 | - } | ||
| 106 | - } | ||
| 107 | - ), | ||
| 108 | - dataTools: $resource( | ||
| 109 | - '/cars/:type', | ||
| 110 | - {}, | ||
| 111 | - { | ||
| 112 | - dataExport: { | ||
| 113 | - method: 'GET', | ||
| 114 | - responseType: "arraybuffer", | ||
| 115 | - params: { | ||
| 116 | - type: "dataExport" | ||
| 117 | - }, | ||
| 118 | - transformResponse: function(data, headers){ | ||
| 119 | - return {data : data}; | ||
| 120 | - } | ||
| 121 | - } | ||
| 122 | - } | ||
| 123 | - ) | ||
| 124 | - }; | ||
| 125 | -}]); | ||
| 126 | -// 人员信息service | ||
| 127 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | ||
| 128 | - return { | ||
| 129 | - rest : $resource( | ||
| 130 | - '/personnel/:id', | ||
| 131 | - {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | ||
| 132 | - { | ||
| 133 | - list: { | ||
| 134 | - method: 'GET', | ||
| 135 | - params: { | ||
| 136 | - page: 0 | ||
| 137 | - } | ||
| 138 | - }, | ||
| 139 | - get: { | ||
| 140 | - method: 'GET' | ||
| 141 | - }, | ||
| 142 | - save: { | ||
| 143 | - method: 'POST' | ||
| 144 | - } | ||
| 145 | - } | ||
| 146 | - ), | ||
| 147 | - validate: $resource( | ||
| 148 | - '/personnel/validate/:type', | ||
| 149 | - {}, | ||
| 150 | - { | ||
| 151 | - jobCode: { | ||
| 152 | - method: 'GET' | ||
| 153 | - } | ||
| 154 | - } | ||
| 155 | - ), | ||
| 156 | - dataTools: $resource( | ||
| 157 | - '/personnel/:type', | ||
| 158 | - {}, | ||
| 159 | - { | ||
| 160 | - dataExport: { | ||
| 161 | - method: 'GET', | ||
| 162 | - responseType: "arraybuffer", | ||
| 163 | - params: { | ||
| 164 | - type: "dataExport" | ||
| 165 | - }, | ||
| 166 | - transformResponse: function(data, headers){ | ||
| 167 | - return {data : data}; | ||
| 168 | - } | ||
| 169 | - } | ||
| 170 | - } | ||
| 171 | - ) | ||
| 172 | - }; | ||
| 173 | -}]); | ||
| 174 | -// 车辆设备信息service | ||
| 175 | -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | ||
| 176 | - return $resource( | ||
| 177 | - '/cde/:id', | ||
| 178 | - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | ||
| 179 | - { | ||
| 180 | - list: { | ||
| 181 | - method: 'GET', | ||
| 182 | - params: { | ||
| 183 | - page: 0 | ||
| 184 | - } | ||
| 185 | - }, | ||
| 186 | - get: { | ||
| 187 | - method: 'GET' | ||
| 188 | - }, | ||
| 189 | - save: { | ||
| 190 | - method: 'POST' | ||
| 191 | - }, | ||
| 192 | - delete: { | ||
| 193 | - method: 'DELETE' | ||
| 194 | - } | ||
| 195 | - } | ||
| 196 | - ); | ||
| 197 | -}]); | ||
| 198 | - | ||
| 199 | -// 车辆配置service | ||
| 200 | -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { | ||
| 201 | - return { | ||
| 202 | - rest : $resource( | ||
| 203 | - '/cci/:id', | ||
| 204 | - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'}, | ||
| 205 | - { | ||
| 206 | - list: { | ||
| 207 | - method: 'GET', | ||
| 208 | - params: { | ||
| 209 | - page: 0 | ||
| 210 | - } | ||
| 211 | - }, | ||
| 212 | - get: { | ||
| 213 | - method: 'GET' | ||
| 214 | - }, | ||
| 215 | - save: { | ||
| 216 | - method: 'POST' | ||
| 217 | - } | ||
| 218 | - } | ||
| 219 | - ) | ||
| 220 | - }; | ||
| 221 | -}]); | ||
| 222 | - | ||
| 223 | -// 人员配置service | ||
| 224 | -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 225 | - return { | ||
| 226 | - rest : $resource( | ||
| 227 | - '/eci/:id', | ||
| 228 | - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | ||
| 229 | - { | ||
| 230 | - list: { | ||
| 231 | - method: 'GET', | ||
| 232 | - params: { | ||
| 233 | - page: 0 | ||
| 234 | - } | ||
| 235 | - }, | ||
| 236 | - get: { | ||
| 237 | - method: 'GET' | ||
| 238 | - }, | ||
| 239 | - save: { | ||
| 240 | - method: 'POST' | ||
| 241 | - }, | ||
| 242 | - delete: { | ||
| 243 | - method: 'DELETE' | ||
| 244 | - } | ||
| 245 | - } | ||
| 246 | - ), | ||
| 247 | - validate: $resource( // TODO: | ||
| 248 | - '/personnel/validate/:type', | ||
| 249 | - {}, | ||
| 250 | - { | ||
| 251 | - jobCode: { | ||
| 252 | - method: 'GET' | ||
| 253 | - } | ||
| 254 | - } | ||
| 255 | - ) | ||
| 256 | - }; | ||
| 257 | -}]); | ||
| 258 | - | ||
| 259 | -// 路牌管理service | ||
| 260 | -angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { | ||
| 261 | - return { | ||
| 262 | - rest: $resource( | ||
| 263 | - '/gic/:id', | ||
| 264 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 265 | - { | ||
| 266 | - list: { | ||
| 267 | - method: 'GET', | ||
| 268 | - params: { | ||
| 269 | - page: 0 | ||
| 270 | - } | ||
| 271 | - }, | ||
| 272 | - get: { | ||
| 273 | - method: 'GET' | ||
| 274 | - }, | ||
| 275 | - save: { | ||
| 276 | - method: 'POST' | ||
| 277 | - } | ||
| 278 | - } | ||
| 279 | - ) | ||
| 280 | - }; | ||
| 281 | -}]); | ||
| 282 | - | ||
| 283 | -// 排班管理service | ||
| 284 | -angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) { | ||
| 285 | - return { | ||
| 286 | - rest: $resource( | ||
| 287 | - '/sr1fc/:id', | ||
| 288 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 289 | - { | ||
| 290 | - list: { | ||
| 291 | - method: 'GET', | ||
| 292 | - params: { | ||
| 293 | - page: 0 | ||
| 294 | - } | ||
| 295 | - }, | ||
| 296 | - get: { | ||
| 297 | - method: 'GET' | ||
| 298 | - }, | ||
| 299 | - save: { | ||
| 300 | - method: 'POST' | ||
| 301 | - }, | ||
| 302 | - delete: { | ||
| 303 | - method: 'DELETE' | ||
| 304 | - } | ||
| 305 | - } | ||
| 306 | - ) | ||
| 307 | - }; | ||
| 308 | -}]); | ||
| 309 | - | ||
| 310 | -// 套跑管理service | ||
| 311 | -angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) { | ||
| 312 | - return { | ||
| 313 | - rest: $resource( | ||
| 314 | - 'rms/:id', | ||
| 315 | - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'}, | ||
| 316 | - { | ||
| 317 | - list: { | ||
| 318 | - method: 'GET', | ||
| 319 | - params: { | ||
| 320 | - page: 0 | ||
| 321 | - } | ||
| 322 | - }, | ||
| 323 | - get: { | ||
| 324 | - method: 'GET' | ||
| 325 | - }, | ||
| 326 | - save: { | ||
| 327 | - method: 'POST' | ||
| 328 | - }, | ||
| 329 | - delete: { | ||
| 330 | - method: 'DELETE' | ||
| 331 | - } | ||
| 332 | - } | ||
| 333 | - ) | ||
| 334 | - }; | ||
| 335 | -}]); | ||
| 336 | - | ||
| 337 | -// 时刻表管理service | ||
| 338 | -angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) { | ||
| 339 | - return { | ||
| 340 | - rest: $resource( | ||
| 341 | - '/tic/:id', | ||
| 342 | - {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'}, | ||
| 343 | - { | ||
| 344 | - list: { | ||
| 345 | - method: 'GET', | ||
| 346 | - params: { | ||
| 347 | - page: 0 | ||
| 348 | - } | ||
| 349 | - } | ||
| 350 | - } | ||
| 351 | - ) | ||
| 352 | - }; | ||
| 353 | -}]); | ||
| 354 | -// 时刻表明细管理service | ||
| 355 | -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) { | ||
| 356 | - return { | ||
| 357 | - rest: $resource( | ||
| 358 | - '/tidc/:id', | ||
| 359 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 360 | - { | ||
| 361 | - get: { | ||
| 362 | - method: 'GET' | ||
| 363 | - }, | ||
| 364 | - save: { | ||
| 365 | - method: 'POST' | ||
| 366 | - } | ||
| 367 | - } | ||
| 368 | - ), | ||
| 369 | - import: $resource( | ||
| 370 | - '/tidc/importfile', | ||
| 371 | - {}, | ||
| 372 | - { | ||
| 373 | - do: { | ||
| 374 | - method: 'POST', | ||
| 375 | - headers: { | ||
| 376 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 377 | - }, | ||
| 378 | - transformRequest: function(obj) { | ||
| 379 | - var str = []; | ||
| 380 | - for (var p in obj) { | ||
| 381 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 382 | - } | ||
| 383 | - return str.join("&"); | ||
| 384 | - } | ||
| 385 | - } | ||
| 386 | - } | ||
| 387 | - ), | ||
| 388 | - edit: $resource( | ||
| 389 | - '/tidc/edit/:xlid/:ttid', | ||
| 390 | - {}, | ||
| 391 | - { | ||
| 392 | - list: { | ||
| 393 | - method: 'GET' | ||
| 394 | - } | ||
| 395 | - } | ||
| 396 | - ), | ||
| 397 | - bcdetails: $resource( | ||
| 398 | - '/tidc/bcdetail', | ||
| 399 | - {}, | ||
| 400 | - { | ||
| 401 | - list: { | ||
| 402 | - method: 'GET', | ||
| 403 | - isArray: true | ||
| 404 | - } | ||
| 405 | - } | ||
| 406 | - ) | ||
| 407 | - | ||
| 408 | - // TODO:导入数据 | ||
| 409 | - }; | ||
| 410 | -}]); | ||
| 411 | - | ||
| 412 | - | ||
| 413 | - | ||
| 414 | -// 排班计划管理service | ||
| 415 | -angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) { | ||
| 416 | - return { | ||
| 417 | - rest : $resource( | ||
| 418 | - '/spc/:id', | ||
| 419 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 420 | - { | ||
| 421 | - list: { | ||
| 422 | - method: 'GET', | ||
| 423 | - params: { | ||
| 424 | - page: 0 | ||
| 425 | - } | ||
| 426 | - }, | ||
| 427 | - get: { | ||
| 428 | - method: 'GET' | ||
| 429 | - }, | ||
| 430 | - save: { | ||
| 431 | - method: 'POST' | ||
| 432 | - }, | ||
| 433 | - delete: { | ||
| 434 | - method: 'DELETE' | ||
| 435 | - } | ||
| 436 | - } | ||
| 437 | - ), | ||
| 438 | - tommorw: $resource( | ||
| 439 | - '/spc/tommorw', | ||
| 440 | - {}, | ||
| 441 | - { | ||
| 442 | - list: { | ||
| 443 | - method: 'GET' | ||
| 444 | - } | ||
| 445 | - } | ||
| 446 | - ) | ||
| 447 | - }; | ||
| 448 | -}]); | ||
| 449 | - | ||
| 450 | -// 排班计划明细管理service | ||
| 451 | -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) { | ||
| 452 | - return { | ||
| 453 | - rest : $resource( | ||
| 454 | - '/spic/:id', | ||
| 455 | - {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'}, | ||
| 456 | - { | ||
| 457 | - list: { | ||
| 458 | - method: 'GET', | ||
| 459 | - params: { | ||
| 460 | - page: 0 | ||
| 461 | - } | ||
| 462 | - }, | ||
| 463 | - get: { | ||
| 464 | - method: 'GET' | ||
| 465 | - }, | ||
| 466 | - save: { | ||
| 467 | - method: 'POST' | ||
| 468 | - } | ||
| 469 | - } | ||
| 470 | - ), | ||
| 471 | - groupinfo : $resource( | ||
| 472 | - '/spic/groupinfos/:xlid/:sdate', | ||
| 473 | - {}, | ||
| 474 | - { | ||
| 475 | - list: { | ||
| 476 | - method: 'GET', | ||
| 477 | - isArray: true | ||
| 478 | - } | ||
| 479 | - } | ||
| 480 | - ), | ||
| 481 | - updateGroupInfo : $resource( | ||
| 482 | - '/spic/groupinfos/update', | ||
| 483 | - {}, | ||
| 484 | - { | ||
| 485 | - update: { | ||
| 486 | - method: 'POST' | ||
| 487 | - } | ||
| 488 | - } | ||
| 489 | - ) | ||
| 490 | - }; | ||
| 491 | -}]); | ||
| 492 | - | ||
| 493 | -// 线路运营统计service | ||
| 494 | -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { | ||
| 495 | - return $resource( | ||
| 496 | - '/bic/:id', | ||
| 497 | - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 498 | - { | ||
| 499 | - list: { | ||
| 500 | - method: 'GET', | ||
| 501 | - params: { | ||
| 502 | - page: 0 | ||
| 503 | - } | ||
| 504 | - } | ||
| 505 | - } | ||
| 506 | - ); | ||
| 507 | -}]); | ||
| 508 | - | ||
| 509 | - | ||
| 510 | - | ||
| 511 | - | ||
| 512 | -/** | ||
| 513 | - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。 | ||
| 514 | - * 1、compile阶段使用的属性如下: | ||
| 515 | - * required:用于和表单验证连接,指定成required="true"才有效。 | ||
| 516 | - * 2、link阶段使用的属性如下 | ||
| 517 | - * model:关联的模型对象 | ||
| 518 | - * name:表单验证时需要的名字 | ||
| 519 | - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加 | ||
| 520 | - * modelcolname1:关联的模型字段名字1(一般应该是编码字段) | ||
| 521 | - * modelcolname2:关联的模型字段名字2(一般应该是名字字段) | ||
| 522 | - * datacolname1;内部数据对应的字段名字1(与模型字段1对应) | ||
| 523 | - * datacolname2:内部数据对应的字段名字2(与模型字段2对应) | ||
| 524 | - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用 | ||
| 525 | - * placeholder:select placeholder字符串描述 | ||
| 526 | - * | ||
| 527 | - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。 | ||
| 528 | - * $$SearchInfoService_g,内部使用的数据服务 | ||
| 529 | - */ | ||
| 530 | -// saSelect2指令使用的内部信service | ||
| 531 | -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) { | ||
| 532 | - return { | ||
| 533 | - xl: $resource( | ||
| 534 | - '/line/:type', | ||
| 535 | - {order: 'name', direction: 'ASC'}, | ||
| 536 | - { | ||
| 537 | - list: { | ||
| 538 | - method: 'GET', | ||
| 539 | - isArray: true | ||
| 540 | - } | ||
| 541 | - } | ||
| 542 | - ), | ||
| 543 | - xlinfo: $resource( | ||
| 544 | - '/lineInformation/:type', | ||
| 545 | - {order: 'line.name', direction: 'ASC'}, | ||
| 546 | - { | ||
| 547 | - list: { | ||
| 548 | - method: 'GET', | ||
| 549 | - isArray: true | ||
| 550 | - } | ||
| 551 | - } | ||
| 552 | - ), | ||
| 553 | - zd: $resource( | ||
| 554 | - '/stationroute/stations', | ||
| 555 | - {order: 'stationCode', direction: 'ASC'}, | ||
| 556 | - { | ||
| 557 | - list: { | ||
| 558 | - method: 'GET', | ||
| 559 | - isArray: true | ||
| 560 | - } | ||
| 561 | - } | ||
| 562 | - ), | ||
| 563 | - tcc: $resource( | ||
| 564 | - '/carpark/:type', | ||
| 565 | - {order: 'parkCode', direction: 'ASC'}, | ||
| 566 | - { | ||
| 567 | - list: { | ||
| 568 | - method: 'GET', | ||
| 569 | - isArray: true | ||
| 570 | - } | ||
| 571 | - } | ||
| 572 | - ), | ||
| 573 | - ry: $resource( | ||
| 574 | - '/personnel/:type', | ||
| 575 | - {order: 'personnelName', direction: 'ASC'}, | ||
| 576 | - { | ||
| 577 | - list: { | ||
| 578 | - method: 'GET', | ||
| 579 | - isArray: true | ||
| 580 | - } | ||
| 581 | - } | ||
| 582 | - ), | ||
| 583 | - cl: $resource( | ||
| 584 | - '/cars/:type', | ||
| 585 | - {order: "insideCode", direction: 'ASC'}, | ||
| 586 | - { | ||
| 587 | - list: { | ||
| 588 | - method: 'GET', | ||
| 589 | - isArray: true | ||
| 590 | - } | ||
| 591 | - } | ||
| 592 | - ), | ||
| 593 | - ttInfo: $resource( | ||
| 594 | - '/tic/:type', | ||
| 595 | - {order: "name", direction: 'ASC'}, | ||
| 596 | - { | ||
| 597 | - list: { | ||
| 598 | - method: 'GET', | ||
| 599 | - isArray: true | ||
| 600 | - } | ||
| 601 | - } | ||
| 602 | - ), | ||
| 603 | - lpInfo: $resource( | ||
| 604 | - '/gic/ttlpnames', | ||
| 605 | - {order: "lpName", direction: 'ASC'}, | ||
| 606 | - { | ||
| 607 | - list: { | ||
| 608 | - method: 'GET', | ||
| 609 | - isArray: true | ||
| 610 | - } | ||
| 611 | - } | ||
| 612 | - ), | ||
| 613 | - lpInfo2: $resource( | ||
| 614 | - '/gic/:type', | ||
| 615 | - {order: "lpName", direction: 'ASC'}, | ||
| 616 | - { | ||
| 617 | - list: { | ||
| 618 | - method: 'GET', | ||
| 619 | - isArray: true | ||
| 620 | - } | ||
| 621 | - } | ||
| 622 | - ), | ||
| 623 | - cci: $resource( | ||
| 624 | - '/cci/cars', | ||
| 625 | - {}, | ||
| 626 | - { | ||
| 627 | - list: { | ||
| 628 | - method: 'GET', | ||
| 629 | - isArray: true | ||
| 630 | - } | ||
| 631 | - } | ||
| 632 | - | ||
| 633 | - ), | ||
| 634 | - cci2: $resource( | ||
| 635 | - '/cci/:type', | ||
| 636 | - {}, | ||
| 637 | - { | ||
| 638 | - list: { | ||
| 639 | - method: 'GET', | ||
| 640 | - isArray: true | ||
| 641 | - } | ||
| 642 | - } | ||
| 643 | - ), | ||
| 644 | - cci3: $resource( | ||
| 645 | - '/cci/cars2', | ||
| 646 | - {}, | ||
| 647 | - { | ||
| 648 | - list: { | ||
| 649 | - method: 'GET', | ||
| 650 | - isArray: true | ||
| 651 | - } | ||
| 652 | - } | ||
| 653 | - | ||
| 654 | - ), | ||
| 655 | - eci: $resource( | ||
| 656 | - '/eci/jsy', | ||
| 657 | - {}, | ||
| 658 | - { | ||
| 659 | - list: { | ||
| 660 | - method: 'GET', | ||
| 661 | - isArray: true | ||
| 662 | - } | ||
| 663 | - } | ||
| 664 | - ), | ||
| 665 | - eci2: $resource( | ||
| 666 | - '/eci/spy', | ||
| 667 | - {}, | ||
| 668 | - { | ||
| 669 | - list: { | ||
| 670 | - method: 'GET', | ||
| 671 | - isArray: true | ||
| 672 | - } | ||
| 673 | - } | ||
| 674 | - ), | ||
| 675 | - eci3: $resource( | ||
| 676 | - '/eci/:type', | ||
| 677 | - {}, | ||
| 678 | - { | ||
| 679 | - list: { | ||
| 680 | - method: 'GET', | ||
| 681 | - isArray: true | ||
| 682 | - } | ||
| 683 | - } | ||
| 684 | - ), | ||
| 685 | - | ||
| 686 | - | ||
| 687 | - validate: { // remoteValidation指令用到的resource | ||
| 688 | - cl1: { // 车辆自编号不能重复验证 | ||
| 689 | - template: {'insideCode_eq': '-1'}, // 查询参数模版 | ||
| 690 | - remote: $resource( // $resource封装对象 | ||
| 691 | - '/cars/validate/equale', | ||
| 692 | - {}, | ||
| 693 | - { | ||
| 694 | - do: { | ||
| 695 | - method: 'GET' | ||
| 696 | - } | ||
| 697 | - } | ||
| 698 | - ) | ||
| 699 | - }, | ||
| 700 | - cde1: { // 车辆设备启用日期验证 | ||
| 701 | - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | ||
| 702 | - remote: $resource( // $resource封装对象 | ||
| 703 | - '/cde//validate/qyrq', | ||
| 704 | - {}, | ||
| 705 | - { | ||
| 706 | - do: { | ||
| 707 | - method: 'GET' | ||
| 708 | - } | ||
| 709 | - } | ||
| 710 | - ) | ||
| 711 | - }, | ||
| 712 | - ttc1: { // 时刻表名字验证 | ||
| 713 | - template: {'xl.id_eq': -1, 'name_eq': 'ddd'}, | ||
| 714 | - remote: $resource( // $resource封装对象 | ||
| 715 | - '/tic/validate/equale', | ||
| 716 | - {}, | ||
| 717 | - { | ||
| 718 | - do: { | ||
| 719 | - method: 'GET' | ||
| 720 | - } | ||
| 721 | - } | ||
| 722 | - ) | ||
| 723 | - }, | ||
| 724 | - sheet: { // 时刻表sheet工作区验证 | ||
| 725 | - template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''}, | ||
| 726 | - remote: $resource( // $resource封装对象 | ||
| 727 | - '/tidc/validate/sheet', | ||
| 728 | - {}, | ||
| 729 | - { | ||
| 730 | - do: { | ||
| 731 | - method: 'POST', | ||
| 732 | - headers: { | ||
| 733 | - 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 734 | - }, | ||
| 735 | - transformRequest: function(obj) { | ||
| 736 | - var str = []; | ||
| 737 | - for (var p in obj) { | ||
| 738 | - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 739 | - } | ||
| 740 | - return str.join("&"); | ||
| 741 | - } | ||
| 742 | - } | ||
| 743 | - } | ||
| 744 | - ) | ||
| 745 | - }, | ||
| 746 | - sheetli: { // 时刻表线路标准验证 | ||
| 747 | - template: {'lineinfoid': -1}, | ||
| 748 | - remote: $resource( // $resource封装对象 | ||
| 749 | - '/tidc/validate/lineinfo', | ||
| 750 | - {}, | ||
| 751 | - { | ||
| 752 | - do: { | ||
| 753 | - method: 'GET' | ||
| 754 | - } | ||
| 755 | - } | ||
| 756 | - ) | ||
| 757 | - } | ||
| 758 | - } | ||
| 759 | - | ||
| 760 | - //validate: $resource( | ||
| 761 | - // '/cars/validate/:type', | ||
| 762 | - // {}, | ||
| 763 | - // { | ||
| 764 | - // insideCode: { | ||
| 765 | - // method: 'GET' | ||
| 766 | - // } | ||
| 767 | - // } | ||
| 768 | - //) | ||
| 769 | - | ||
| 770 | - | ||
| 771 | - | ||
| 772 | - } | ||
| 773 | -}]); | ||
| 774 | - | ||
| 775 | - | ||
| 776 | - | 1 | +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用 |
| 2 | + | ||
| 3 | +// 文件下载服务 | ||
| 4 | +angular.module('ScheduleApp').factory('FileDownload_g', function() { | ||
| 5 | + return { | ||
| 6 | + downloadFile: function (data, mimeType, fileName) { | ||
| 7 | + var success = false; | ||
| 8 | + var blob = new Blob([data], { type: mimeType }); | ||
| 9 | + try { | ||
| 10 | + if (navigator.msSaveBlob) | ||
| 11 | + navigator.msSaveBlob(blob, fileName); | ||
| 12 | + else { | ||
| 13 | + // Try using other saveBlob implementations, if available | ||
| 14 | + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob; | ||
| 15 | + if (saveBlob === undefined) throw "Not supported"; | ||
| 16 | + saveBlob(blob, fileName); | ||
| 17 | + } | ||
| 18 | + success = true; | ||
| 19 | + } catch (ex) { | ||
| 20 | + console.log("saveBlob method failed with the following exception:"); | ||
| 21 | + console.log(ex); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + if (!success) { | ||
| 25 | + // Get the blob url creator | ||
| 26 | + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL; | ||
| 27 | + if (urlCreator) { | ||
| 28 | + // Try to use a download link | ||
| 29 | + var link = document.createElement('a'); | ||
| 30 | + if ('download' in link) { | ||
| 31 | + // Try to simulate a click | ||
| 32 | + try { | ||
| 33 | + // Prepare a blob URL | ||
| 34 | + var url = urlCreator.createObjectURL(blob); | ||
| 35 | + link.setAttribute('href', url); | ||
| 36 | + | ||
| 37 | + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+) | ||
| 38 | + link.setAttribute("download", fileName); | ||
| 39 | + | ||
| 40 | + // Simulate clicking the download link | ||
| 41 | + var event = document.createEvent('MouseEvents'); | ||
| 42 | + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); | ||
| 43 | + link.dispatchEvent(event); | ||
| 44 | + success = true; | ||
| 45 | + | ||
| 46 | + } catch (ex) { | ||
| 47 | + console.log("Download link method with simulated click failed with the following exception:"); | ||
| 48 | + console.log(ex); | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + if (!success) { | ||
| 53 | + // Fallback to window.location method | ||
| 54 | + try { | ||
| 55 | + // Prepare a blob URL | ||
| 56 | + // Use application/octet-stream when using window.location to force download | ||
| 57 | + var url = urlCreator.createObjectURL(blob); | ||
| 58 | + window.location = url; | ||
| 59 | + console.log("Download link method with window.location succeeded"); | ||
| 60 | + success = true; | ||
| 61 | + } catch (ex) { | ||
| 62 | + console.log("Download link method with window.location failed with the following exception:"); | ||
| 63 | + console.log(ex); | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + if (!success) { | ||
| 70 | + // Fallback to window.open method | ||
| 71 | + console.log("No methods worked for saving the arraybuffer, using last resort window.open"); | ||
| 72 | + window.open("", '_blank', ''); | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + }; | ||
| 76 | +}); | ||
| 77 | + | ||
| 78 | +// 车辆信息service | ||
| 79 | +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) { | ||
| 80 | + return { | ||
| 81 | + rest: $resource( | ||
| 82 | + '/cars/:id', | ||
| 83 | + {order: 'carCode', direction: 'ASC', id: '@id_route'}, | ||
| 84 | + { | ||
| 85 | + list: { | ||
| 86 | + method: 'GET', | ||
| 87 | + params: { | ||
| 88 | + page: 0 | ||
| 89 | + } | ||
| 90 | + }, | ||
| 91 | + get: { | ||
| 92 | + method: 'GET' | ||
| 93 | + }, | ||
| 94 | + save: { | ||
| 95 | + method: 'POST' | ||
| 96 | + } | ||
| 97 | + } | ||
| 98 | + ), | ||
| 99 | + validate: $resource( | ||
| 100 | + '/cars/validate/:type', | ||
| 101 | + {}, | ||
| 102 | + { | ||
| 103 | + insideCode: { | ||
| 104 | + method: 'GET' | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + ), | ||
| 108 | + dataTools: $resource( | ||
| 109 | + '/cars/:type', | ||
| 110 | + {}, | ||
| 111 | + { | ||
| 112 | + dataExport: { | ||
| 113 | + method: 'GET', | ||
| 114 | + responseType: "arraybuffer", | ||
| 115 | + params: { | ||
| 116 | + type: "dataExport" | ||
| 117 | + }, | ||
| 118 | + transformResponse: function(data, headers){ | ||
| 119 | + return {data : data}; | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + ) | ||
| 124 | + }; | ||
| 125 | +}]); | ||
| 126 | +// 人员信息service | ||
| 127 | +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) { | ||
| 128 | + return { | ||
| 129 | + rest : $resource( | ||
| 130 | + '/personnel/:id', | ||
| 131 | + {order: 'jobCode', direction: 'ASC', id: '@id_route'}, | ||
| 132 | + { | ||
| 133 | + list: { | ||
| 134 | + method: 'GET', | ||
| 135 | + params: { | ||
| 136 | + page: 0 | ||
| 137 | + } | ||
| 138 | + }, | ||
| 139 | + get: { | ||
| 140 | + method: 'GET' | ||
| 141 | + }, | ||
| 142 | + save: { | ||
| 143 | + method: 'POST' | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + ), | ||
| 147 | + validate: $resource( | ||
| 148 | + '/personnel/validate/:type', | ||
| 149 | + {}, | ||
| 150 | + { | ||
| 151 | + jobCode: { | ||
| 152 | + method: 'GET' | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + ), | ||
| 156 | + dataTools: $resource( | ||
| 157 | + '/personnel/:type', | ||
| 158 | + {}, | ||
| 159 | + { | ||
| 160 | + dataExport: { | ||
| 161 | + method: 'GET', | ||
| 162 | + responseType: "arraybuffer", | ||
| 163 | + params: { | ||
| 164 | + type: "dataExport" | ||
| 165 | + }, | ||
| 166 | + transformResponse: function(data, headers){ | ||
| 167 | + return {data : data}; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + ) | ||
| 172 | + }; | ||
| 173 | +}]); | ||
| 174 | +// 车辆设备信息service | ||
| 175 | +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) { | ||
| 176 | + return $resource( | ||
| 177 | + '/cde/:id', | ||
| 178 | + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'}, | ||
| 179 | + { | ||
| 180 | + list: { | ||
| 181 | + method: 'GET', | ||
| 182 | + params: { | ||
| 183 | + page: 0 | ||
| 184 | + } | ||
| 185 | + }, | ||
| 186 | + get: { | ||
| 187 | + method: 'GET' | ||
| 188 | + }, | ||
| 189 | + save: { | ||
| 190 | + method: 'POST' | ||
| 191 | + }, | ||
| 192 | + delete: { | ||
| 193 | + method: 'DELETE' | ||
| 194 | + } | ||
| 195 | + } | ||
| 196 | + ); | ||
| 197 | +}]); | ||
| 198 | + | ||
| 199 | +// 车辆配置service | ||
| 200 | +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) { | ||
| 201 | + return { | ||
| 202 | + rest : $resource( | ||
| 203 | + '/cci/:id', | ||
| 204 | + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'}, | ||
| 205 | + { | ||
| 206 | + list: { | ||
| 207 | + method: 'GET', | ||
| 208 | + params: { | ||
| 209 | + page: 0 | ||
| 210 | + } | ||
| 211 | + }, | ||
| 212 | + get: { | ||
| 213 | + method: 'GET' | ||
| 214 | + }, | ||
| 215 | + save: { | ||
| 216 | + method: 'POST' | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + ) | ||
| 220 | + }; | ||
| 221 | +}]); | ||
| 222 | + | ||
| 223 | +// 人员配置service | ||
| 224 | +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 225 | + return { | ||
| 226 | + rest : $resource( | ||
| 227 | + '/eci/:id', | ||
| 228 | + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'}, | ||
| 229 | + { | ||
| 230 | + list: { | ||
| 231 | + method: 'GET', | ||
| 232 | + params: { | ||
| 233 | + page: 0 | ||
| 234 | + } | ||
| 235 | + }, | ||
| 236 | + get: { | ||
| 237 | + method: 'GET' | ||
| 238 | + }, | ||
| 239 | + save: { | ||
| 240 | + method: 'POST' | ||
| 241 | + }, | ||
| 242 | + delete: { | ||
| 243 | + method: 'DELETE' | ||
| 244 | + } | ||
| 245 | + } | ||
| 246 | + ), | ||
| 247 | + validate: $resource( // TODO: | ||
| 248 | + '/personnel/validate/:type', | ||
| 249 | + {}, | ||
| 250 | + { | ||
| 251 | + jobCode: { | ||
| 252 | + method: 'GET' | ||
| 253 | + } | ||
| 254 | + } | ||
| 255 | + ) | ||
| 256 | + }; | ||
| 257 | +}]); | ||
| 258 | + | ||
| 259 | +// 路牌管理service | ||
| 260 | +angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) { | ||
| 261 | + return { | ||
| 262 | + rest: $resource( | ||
| 263 | + '/gic/:id', | ||
| 264 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 265 | + { | ||
| 266 | + list: { | ||
| 267 | + method: 'GET', | ||
| 268 | + params: { | ||
| 269 | + page: 0 | ||
| 270 | + } | ||
| 271 | + }, | ||
| 272 | + get: { | ||
| 273 | + method: 'GET' | ||
| 274 | + }, | ||
| 275 | + save: { | ||
| 276 | + method: 'POST' | ||
| 277 | + } | ||
| 278 | + } | ||
| 279 | + ) | ||
| 280 | + }; | ||
| 281 | +}]); | ||
| 282 | + | ||
| 283 | +// 排班管理service | ||
| 284 | +angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) { | ||
| 285 | + return { | ||
| 286 | + rest: $resource( | ||
| 287 | + '/sr1fc/:id', | ||
| 288 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 289 | + { | ||
| 290 | + list: { | ||
| 291 | + method: 'GET', | ||
| 292 | + params: { | ||
| 293 | + page: 0 | ||
| 294 | + } | ||
| 295 | + }, | ||
| 296 | + get: { | ||
| 297 | + method: 'GET' | ||
| 298 | + }, | ||
| 299 | + save: { | ||
| 300 | + method: 'POST' | ||
| 301 | + }, | ||
| 302 | + delete: { | ||
| 303 | + method: 'DELETE' | ||
| 304 | + } | ||
| 305 | + } | ||
| 306 | + ) | ||
| 307 | + }; | ||
| 308 | +}]); | ||
| 309 | + | ||
| 310 | +// 套跑管理service | ||
| 311 | +angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) { | ||
| 312 | + return { | ||
| 313 | + rest: $resource( | ||
| 314 | + 'rms/:id', | ||
| 315 | + {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'}, | ||
| 316 | + { | ||
| 317 | + list: { | ||
| 318 | + method: 'GET', | ||
| 319 | + params: { | ||
| 320 | + page: 0 | ||
| 321 | + } | ||
| 322 | + }, | ||
| 323 | + get: { | ||
| 324 | + method: 'GET' | ||
| 325 | + }, | ||
| 326 | + save: { | ||
| 327 | + method: 'POST' | ||
| 328 | + }, | ||
| 329 | + delete: { | ||
| 330 | + method: 'DELETE' | ||
| 331 | + } | ||
| 332 | + } | ||
| 333 | + ) | ||
| 334 | + }; | ||
| 335 | +}]); | ||
| 336 | + | ||
| 337 | +// 时刻表管理service | ||
| 338 | +angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) { | ||
| 339 | + return { | ||
| 340 | + rest: $resource( | ||
| 341 | + '/tic/:id', | ||
| 342 | + {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'}, | ||
| 343 | + { | ||
| 344 | + list: { | ||
| 345 | + method: 'GET', | ||
| 346 | + params: { | ||
| 347 | + page: 0 | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + } | ||
| 351 | + ) | ||
| 352 | + }; | ||
| 353 | +}]); | ||
| 354 | +// 时刻表明细管理service | ||
| 355 | +angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) { | ||
| 356 | + return { | ||
| 357 | + rest: $resource( | ||
| 358 | + '/tidc/:id', | ||
| 359 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 360 | + { | ||
| 361 | + get: { | ||
| 362 | + method: 'GET' | ||
| 363 | + }, | ||
| 364 | + save: { | ||
| 365 | + method: 'POST' | ||
| 366 | + } | ||
| 367 | + } | ||
| 368 | + ), | ||
| 369 | + import: $resource( | ||
| 370 | + '/tidc/importfile', | ||
| 371 | + {}, | ||
| 372 | + { | ||
| 373 | + do: { | ||
| 374 | + method: 'POST', | ||
| 375 | + headers: { | ||
| 376 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 377 | + }, | ||
| 378 | + transformRequest: function(obj) { | ||
| 379 | + var str = []; | ||
| 380 | + for (var p in obj) { | ||
| 381 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 382 | + } | ||
| 383 | + return str.join("&"); | ||
| 384 | + } | ||
| 385 | + } | ||
| 386 | + } | ||
| 387 | + ), | ||
| 388 | + edit: $resource( | ||
| 389 | + '/tidc/edit/:xlid/:ttid', | ||
| 390 | + {}, | ||
| 391 | + { | ||
| 392 | + list: { | ||
| 393 | + method: 'GET' | ||
| 394 | + } | ||
| 395 | + } | ||
| 396 | + ), | ||
| 397 | + bcdetails: $resource( | ||
| 398 | + '/tidc/bcdetail', | ||
| 399 | + {}, | ||
| 400 | + { | ||
| 401 | + list: { | ||
| 402 | + method: 'GET', | ||
| 403 | + isArray: true | ||
| 404 | + } | ||
| 405 | + } | ||
| 406 | + ) | ||
| 407 | + | ||
| 408 | + // TODO:导入数据 | ||
| 409 | + }; | ||
| 410 | +}]); | ||
| 411 | + | ||
| 412 | + | ||
| 413 | + | ||
| 414 | +// 排班计划管理service | ||
| 415 | +angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) { | ||
| 416 | + return { | ||
| 417 | + rest : $resource( | ||
| 418 | + '/spc/:id', | ||
| 419 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, | ||
| 420 | + { | ||
| 421 | + list: { | ||
| 422 | + method: 'GET', | ||
| 423 | + params: { | ||
| 424 | + page: 0 | ||
| 425 | + } | ||
| 426 | + }, | ||
| 427 | + get: { | ||
| 428 | + method: 'GET' | ||
| 429 | + }, | ||
| 430 | + save: { | ||
| 431 | + method: 'POST' | ||
| 432 | + }, | ||
| 433 | + delete: { | ||
| 434 | + method: 'DELETE' | ||
| 435 | + } | ||
| 436 | + } | ||
| 437 | + ), | ||
| 438 | + tommorw: $resource( | ||
| 439 | + '/spc/tommorw', | ||
| 440 | + {}, | ||
| 441 | + { | ||
| 442 | + list: { | ||
| 443 | + method: 'GET' | ||
| 444 | + } | ||
| 445 | + } | ||
| 446 | + ) | ||
| 447 | + }; | ||
| 448 | +}]); | ||
| 449 | + | ||
| 450 | +// 排班计划明细管理service | ||
| 451 | +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) { | ||
| 452 | + return { | ||
| 453 | + rest : $resource( | ||
| 454 | + '/spic/:id', | ||
| 455 | + {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'}, | ||
| 456 | + { | ||
| 457 | + list: { | ||
| 458 | + method: 'GET', | ||
| 459 | + params: { | ||
| 460 | + page: 0 | ||
| 461 | + } | ||
| 462 | + }, | ||
| 463 | + get: { | ||
| 464 | + method: 'GET' | ||
| 465 | + }, | ||
| 466 | + save: { | ||
| 467 | + method: 'POST' | ||
| 468 | + } | ||
| 469 | + } | ||
| 470 | + ), | ||
| 471 | + groupinfo : $resource( | ||
| 472 | + '/spic/groupinfos/:xlid/:sdate', | ||
| 473 | + {}, | ||
| 474 | + { | ||
| 475 | + list: { | ||
| 476 | + method: 'GET', | ||
| 477 | + isArray: true | ||
| 478 | + } | ||
| 479 | + } | ||
| 480 | + ), | ||
| 481 | + updateGroupInfo : $resource( | ||
| 482 | + '/spic/groupinfos/update', | ||
| 483 | + {}, | ||
| 484 | + { | ||
| 485 | + update: { | ||
| 486 | + method: 'POST' | ||
| 487 | + } | ||
| 488 | + } | ||
| 489 | + ) | ||
| 490 | + }; | ||
| 491 | +}]); | ||
| 492 | + | ||
| 493 | +// 线路运营统计service | ||
| 494 | +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) { | ||
| 495 | + return $resource( | ||
| 496 | + '/bic/:id', | ||
| 497 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 498 | + { | ||
| 499 | + list: { | ||
| 500 | + method: 'GET', | ||
| 501 | + params: { | ||
| 502 | + page: 0 | ||
| 503 | + } | ||
| 504 | + } | ||
| 505 | + } | ||
| 506 | + ); | ||
| 507 | +}]); | ||
| 508 | + | ||
| 509 | + | ||
| 510 | + | ||
| 511 | + | ||
| 512 | +/** | ||
| 513 | + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。 | ||
| 514 | + * 1、compile阶段使用的属性如下: | ||
| 515 | + * required:用于和表单验证连接,指定成required="true"才有效。 | ||
| 516 | + * 2、link阶段使用的属性如下 | ||
| 517 | + * model:关联的模型对象 | ||
| 518 | + * name:表单验证时需要的名字 | ||
| 519 | + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加 | ||
| 520 | + * modelcolname1:关联的模型字段名字1(一般应该是编码字段) | ||
| 521 | + * modelcolname2:关联的模型字段名字2(一般应该是名字字段) | ||
| 522 | + * datacolname1;内部数据对应的字段名字1(与模型字段1对应) | ||
| 523 | + * datacolname2:内部数据对应的字段名字2(与模型字段2对应) | ||
| 524 | + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用 | ||
| 525 | + * placeholder:select placeholder字符串描述 | ||
| 526 | + * | ||
| 527 | + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。 | ||
| 528 | + * $$SearchInfoService_g,内部使用的数据服务 | ||
| 529 | + */ | ||
| 530 | +// saSelect2指令使用的内部信service | ||
| 531 | +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) { | ||
| 532 | + return { | ||
| 533 | + xl: $resource( | ||
| 534 | + '/line/:type', | ||
| 535 | + {order: 'name', direction: 'ASC'}, | ||
| 536 | + { | ||
| 537 | + list: { | ||
| 538 | + method: 'GET', | ||
| 539 | + isArray: true | ||
| 540 | + } | ||
| 541 | + } | ||
| 542 | + ), | ||
| 543 | + xlinfo: $resource( | ||
| 544 | + '/lineInformation/:type', | ||
| 545 | + {order: 'line.name', direction: 'ASC'}, | ||
| 546 | + { | ||
| 547 | + list: { | ||
| 548 | + method: 'GET', | ||
| 549 | + isArray: true | ||
| 550 | + } | ||
| 551 | + } | ||
| 552 | + ), | ||
| 553 | + zd: $resource( | ||
| 554 | + '/stationroute/stations', | ||
| 555 | + {order: 'stationCode', direction: 'ASC'}, | ||
| 556 | + { | ||
| 557 | + list: { | ||
| 558 | + method: 'GET', | ||
| 559 | + isArray: true | ||
| 560 | + } | ||
| 561 | + } | ||
| 562 | + ), | ||
| 563 | + tcc: $resource( | ||
| 564 | + '/carpark/:type', | ||
| 565 | + {order: 'parkCode', direction: 'ASC'}, | ||
| 566 | + { | ||
| 567 | + list: { | ||
| 568 | + method: 'GET', | ||
| 569 | + isArray: true | ||
| 570 | + } | ||
| 571 | + } | ||
| 572 | + ), | ||
| 573 | + ry: $resource( | ||
| 574 | + '/personnel/:type', | ||
| 575 | + {order: 'personnelName', direction: 'ASC'}, | ||
| 576 | + { | ||
| 577 | + list: { | ||
| 578 | + method: 'GET', | ||
| 579 | + isArray: true | ||
| 580 | + } | ||
| 581 | + } | ||
| 582 | + ), | ||
| 583 | + cl: $resource( | ||
| 584 | + '/cars/:type', | ||
| 585 | + {order: "insideCode", direction: 'ASC'}, | ||
| 586 | + { | ||
| 587 | + list: { | ||
| 588 | + method: 'GET', | ||
| 589 | + isArray: true | ||
| 590 | + } | ||
| 591 | + } | ||
| 592 | + ), | ||
| 593 | + ttInfo: $resource( | ||
| 594 | + '/tic/:type', | ||
| 595 | + {order: "name", direction: 'ASC'}, | ||
| 596 | + { | ||
| 597 | + list: { | ||
| 598 | + method: 'GET', | ||
| 599 | + isArray: true | ||
| 600 | + } | ||
| 601 | + } | ||
| 602 | + ), | ||
| 603 | + lpInfo: $resource( | ||
| 604 | + '/gic/ttlpnames', | ||
| 605 | + {order: "lpName", direction: 'ASC'}, | ||
| 606 | + { | ||
| 607 | + list: { | ||
| 608 | + method: 'GET', | ||
| 609 | + isArray: true | ||
| 610 | + } | ||
| 611 | + } | ||
| 612 | + ), | ||
| 613 | + lpInfo2: $resource( | ||
| 614 | + '/gic/:type', | ||
| 615 | + {order: "lpName", direction: 'ASC'}, | ||
| 616 | + { | ||
| 617 | + list: { | ||
| 618 | + method: 'GET', | ||
| 619 | + isArray: true | ||
| 620 | + } | ||
| 621 | + } | ||
| 622 | + ), | ||
| 623 | + cci: $resource( | ||
| 624 | + '/cci/cars', | ||
| 625 | + {}, | ||
| 626 | + { | ||
| 627 | + list: { | ||
| 628 | + method: 'GET', | ||
| 629 | + isArray: true | ||
| 630 | + } | ||
| 631 | + } | ||
| 632 | + | ||
| 633 | + ), | ||
| 634 | + cci2: $resource( | ||
| 635 | + '/cci/:type', | ||
| 636 | + {}, | ||
| 637 | + { | ||
| 638 | + list: { | ||
| 639 | + method: 'GET', | ||
| 640 | + isArray: true | ||
| 641 | + } | ||
| 642 | + } | ||
| 643 | + ), | ||
| 644 | + cci3: $resource( | ||
| 645 | + '/cci/cars2', | ||
| 646 | + {}, | ||
| 647 | + { | ||
| 648 | + list: { | ||
| 649 | + method: 'GET', | ||
| 650 | + isArray: true | ||
| 651 | + } | ||
| 652 | + } | ||
| 653 | + | ||
| 654 | + ), | ||
| 655 | + eci: $resource( | ||
| 656 | + '/eci/jsy', | ||
| 657 | + {}, | ||
| 658 | + { | ||
| 659 | + list: { | ||
| 660 | + method: 'GET', | ||
| 661 | + isArray: true | ||
| 662 | + } | ||
| 663 | + } | ||
| 664 | + ), | ||
| 665 | + eci2: $resource( | ||
| 666 | + '/eci/spy', | ||
| 667 | + {}, | ||
| 668 | + { | ||
| 669 | + list: { | ||
| 670 | + method: 'GET', | ||
| 671 | + isArray: true | ||
| 672 | + } | ||
| 673 | + } | ||
| 674 | + ), | ||
| 675 | + eci3: $resource( | ||
| 676 | + '/eci/:type', | ||
| 677 | + {}, | ||
| 678 | + { | ||
| 679 | + list: { | ||
| 680 | + method: 'GET', | ||
| 681 | + isArray: true | ||
| 682 | + } | ||
| 683 | + } | ||
| 684 | + ), | ||
| 685 | + | ||
| 686 | + | ||
| 687 | + validate: { // remoteValidation指令用到的resource | ||
| 688 | + cl1: { // 车辆自编号不能重复验证 | ||
| 689 | + template: {'insideCode_eq': '-1'}, // 查询参数模版 | ||
| 690 | + remote: $resource( // $resource封装对象 | ||
| 691 | + '/cars/validate/equale', | ||
| 692 | + {}, | ||
| 693 | + { | ||
| 694 | + do: { | ||
| 695 | + method: 'GET' | ||
| 696 | + } | ||
| 697 | + } | ||
| 698 | + ) | ||
| 699 | + }, | ||
| 700 | + cde1: { // 车辆设备启用日期验证 | ||
| 701 | + template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒 | ||
| 702 | + remote: $resource( // $resource封装对象 | ||
| 703 | + '/cde//validate/qyrq', | ||
| 704 | + {}, | ||
| 705 | + { | ||
| 706 | + do: { | ||
| 707 | + method: 'GET' | ||
| 708 | + } | ||
| 709 | + } | ||
| 710 | + ) | ||
| 711 | + }, | ||
| 712 | + ttc1: { // 时刻表名字验证 | ||
| 713 | + template: {'xl.id_eq': -1, 'name_eq': 'ddd'}, | ||
| 714 | + remote: $resource( // $resource封装对象 | ||
| 715 | + '/tic/validate/equale', | ||
| 716 | + {}, | ||
| 717 | + { | ||
| 718 | + do: { | ||
| 719 | + method: 'GET' | ||
| 720 | + } | ||
| 721 | + } | ||
| 722 | + ) | ||
| 723 | + }, | ||
| 724 | + sheet: { // 时刻表sheet工作区验证 | ||
| 725 | + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''}, | ||
| 726 | + remote: $resource( // $resource封装对象 | ||
| 727 | + '/tidc/validate/sheet', | ||
| 728 | + {}, | ||
| 729 | + { | ||
| 730 | + do: { | ||
| 731 | + method: 'POST', | ||
| 732 | + headers: { | ||
| 733 | + 'Content-Type': 'application/x-www-form-urlencoded' | ||
| 734 | + }, | ||
| 735 | + transformRequest: function(obj) { | ||
| 736 | + var str = []; | ||
| 737 | + for (var p in obj) { | ||
| 738 | + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | ||
| 739 | + } | ||
| 740 | + return str.join("&"); | ||
| 741 | + } | ||
| 742 | + } | ||
| 743 | + } | ||
| 744 | + ) | ||
| 745 | + }, | ||
| 746 | + sheetli: { // 时刻表线路标准验证 | ||
| 747 | + template: {'lineinfoid': -1}, | ||
| 748 | + remote: $resource( // $resource封装对象 | ||
| 749 | + '/tidc/validate/lineinfo', | ||
| 750 | + {}, | ||
| 751 | + { | ||
| 752 | + do: { | ||
| 753 | + method: 'GET' | ||
| 754 | + } | ||
| 755 | + } | ||
| 756 | + ) | ||
| 757 | + } | ||
| 758 | + } | ||
| 759 | + | ||
| 760 | + //validate: $resource( | ||
| 761 | + // '/cars/validate/:type', | ||
| 762 | + // {}, | ||
| 763 | + // { | ||
| 764 | + // insideCode: { | ||
| 765 | + // method: 'GET' | ||
| 766 | + // } | ||
| 767 | + // } | ||
| 768 | + //) | ||
| 769 | + | ||
| 770 | + | ||
| 771 | + | ||
| 772 | + } | ||
| 773 | +}]); | ||
| 774 | + | ||
| 775 | + | ||
| 776 | + |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/edit-detail.html
| 1 | -<div ng-controller="TimeTableDetailManageFormCtrl_old as ctrl"> | ||
| 2 | - <div class="page-head"> | ||
| 3 | - <div class="page-title"> | ||
| 4 | - <h1>修改班次信息2</h1> | ||
| 5 | - </div> | ||
| 6 | - </div> | ||
| 7 | - | ||
| 8 | - <ul class="page-breadcrumb breadcrumb"> | ||
| 9 | - <li> | ||
| 10 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 11 | - <i class="fa fa-circle"></i> | ||
| 12 | - </li> | ||
| 13 | - <li> | ||
| 14 | - <span class="active">运营计划管理</span> | ||
| 15 | - <i class="fa fa-circle"></i> | ||
| 16 | - </li> | ||
| 17 | - <li> | ||
| 18 | - <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 19 | - <i class="fa fa-circle"></i> | ||
| 20 | - </li> | ||
| 21 | - <li> | ||
| 22 | - <a ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | ||
| 23 | - <i class="fa fa-circle"></i> | ||
| 24 | - </li> | ||
| 25 | - <li> | ||
| 26 | - <span class="active">修改班次信息</span> | ||
| 27 | - </li> | ||
| 28 | - </ul> | ||
| 29 | - | ||
| 30 | - <div class="portlet light bordered"> | ||
| 31 | - <div class="portlet-title"> | ||
| 32 | - <div class="caption"> | ||
| 33 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 34 | - class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title2"></span> | ||
| 35 | - </div> | ||
| 36 | - </div> | ||
| 37 | - | ||
| 38 | - <div class="portlet-body form"> | ||
| 39 | - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 40 | - <div class="form-body"> | ||
| 41 | - <div class="form-group has-success has-feedback"> | ||
| 42 | - <label class="col-md-3 control-label">线路*:</label> | ||
| 43 | - <div class="col-md-7"> | ||
| 44 | - <input type="text" class="form-control" | ||
| 45 | - ng-value="ctrl.TimeTableDetailForSave.xl.name" | ||
| 46 | - readonly/> | ||
| 47 | - </div> | ||
| 48 | - | ||
| 49 | - </div> | ||
| 50 | - <div class="form-group has-success has-feedback"> | ||
| 51 | - <label class="col-md-3 control-label">时刻表名称*:</label> | ||
| 52 | - <div class="col-md-7"> | ||
| 53 | - <input type="text" class="form-control" | ||
| 54 | - ng-value="ctrl.TimeTableDetailForSave.ttinfo.name" | ||
| 55 | - readonly/> | ||
| 56 | - </div> | ||
| 57 | - </div> | ||
| 58 | - <div class="form-group has-success has-feedback"> | ||
| 59 | - <label class="col-md-3 control-label">路牌*:</label> | ||
| 60 | - <div class="col-md-7"> | ||
| 61 | - <input type="text" class="form-control" | ||
| 62 | - ng-value="ctrl.TimeTableDetailForSave.lp.lpName" | ||
| 63 | - readonly/> | ||
| 64 | - </div> | ||
| 65 | - | ||
| 66 | - </div> | ||
| 67 | - <div class="form-group has-success has-feedback"> | ||
| 68 | - <label class="col-md-3 control-label">发车顺序号*:</label> | ||
| 69 | - <div class="col-md-7"> | ||
| 70 | - <input type="text" class="form-control" | ||
| 71 | - ng-value="ctrl.TimeTableDetailForSave.fcno" | ||
| 72 | - readonly/> | ||
| 73 | - </div> | ||
| 74 | - | ||
| 75 | - </div> | ||
| 76 | - <div class="form-group has-success has-feedback"> | ||
| 77 | - <label class="col-md-3 control-label">方向*:</label> | ||
| 78 | - <div class="col-md-7"> | ||
| 79 | - <sa-Radiogroup model="ctrl.TimeTableDetailForSave.xlDir" dicgroup="LineTrend" name="xlDir" required></sa-Radiogroup> | ||
| 80 | - </div> | ||
| 81 | - <!-- 隐藏块,显示验证信息 --> | ||
| 82 | - <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required"> | ||
| 83 | - 请选择线路上下行 | ||
| 84 | - </div> | ||
| 85 | - | ||
| 86 | - </div> | ||
| 87 | - <div class="form-group"> | ||
| 88 | - <label class="col-md-3 control-label">起点站:</label> | ||
| 89 | - <div class="col-md-7"> | ||
| 90 | - <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 91 | - name="qdz" | ||
| 92 | - placeholder="请输拼音..." | ||
| 93 | - dcvalue="{{ctrl.TimeTableDetailForSave.qdz.id}}" | ||
| 94 | - dcname="qdz.id" | ||
| 95 | - icname="stationid" | ||
| 96 | - icnames="stationname" | ||
| 97 | - datatype="zd" | ||
| 98 | - dataassociate="true" | ||
| 99 | - dataparam="{{ {'xlid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}" | ||
| 100 | - mlp="true" | ||
| 101 | - > | ||
| 102 | - </sa-Select3> | ||
| 103 | - </div> | ||
| 104 | - </div> | ||
| 105 | - <div class="form-group"> | ||
| 106 | - <label class="col-md-3 control-label">终点站:</label> | ||
| 107 | - <div class="col-md-7"> | ||
| 108 | - <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 109 | - name="zdz" | ||
| 110 | - placeholder="请输拼音..." | ||
| 111 | - dcvalue="{{ctrl.TimeTableDetailForSave.zdz.id}}" | ||
| 112 | - dcname="zdz.id" | ||
| 113 | - icname="stationid" | ||
| 114 | - icnames="stationname" | ||
| 115 | - datatype="zd" | ||
| 116 | - dataassociate="true" | ||
| 117 | - dataparam="{{ {'xlid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}" | ||
| 118 | - mlp="true" | ||
| 119 | - > | ||
| 120 | - </sa-Select3> | ||
| 121 | - </div> | ||
| 122 | - </div> | ||
| 123 | - <div class="form-group"> | ||
| 124 | - <label class="col-md-3 control-label">停车场:</label> | ||
| 125 | - <div class="col-md-7"> | ||
| 126 | - <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 127 | - name="tcc" | ||
| 128 | - placeholder="请输拼音..." | ||
| 129 | - dcvalue="{{ctrl.TimeTableDetailForSave.tcc.id}}" | ||
| 130 | - dcname="tcc.id" | ||
| 131 | - icname="id" | ||
| 132 | - icnames="parkName" | ||
| 133 | - datatype="tcc" | ||
| 134 | - mlp="true" | ||
| 135 | - > | ||
| 136 | - </sa-Select3> | ||
| 137 | - </div> | ||
| 138 | - </div> | ||
| 139 | - | ||
| 140 | - <div class="form-group has-success has-feedback"> | ||
| 141 | - <label class="col-md-3 control-label">发车时间*:</label> | ||
| 142 | - <div class="col-md-7"> | ||
| 143 | - <input type="text" class="form-control" | ||
| 144 | - ng-model="ctrl.TimeTableDetailForSave.fcsj" | ||
| 145 | - /> | ||
| 146 | - </div> | ||
| 147 | - | ||
| 148 | - </div> | ||
| 149 | - <div class="form-group"> | ||
| 150 | - <label class="col-md-3 control-label">对应班次数:</label> | ||
| 151 | - <div class="col-md-7"> | ||
| 152 | - <input type="text" class="form-control" | ||
| 153 | - ng-value="ctrl.TimeTableDetailForSave.bcs" | ||
| 154 | - readonly/> | ||
| 155 | - </div> | ||
| 156 | - | ||
| 157 | - </div> | ||
| 158 | - <div class="form-group"> | ||
| 159 | - <label class="col-md-3 control-label">计划里程:</label> | ||
| 160 | - <div class="col-md-7"> | ||
| 161 | - <input type="text" class="form-control" | ||
| 162 | - ng-model="ctrl.TimeTableDetailForSave.jhlc" | ||
| 163 | - /> | ||
| 164 | - </div> | ||
| 165 | - | ||
| 166 | - </div> | ||
| 167 | - <div class="form-group"> | ||
| 168 | - <label class="col-md-3 control-label">班次历时:</label> | ||
| 169 | - <div class="col-md-7"> | ||
| 170 | - <input type="text" class="form-control" | ||
| 171 | - ng-model="ctrl.TimeTableDetailForSave.bcsj" | ||
| 172 | - /> | ||
| 173 | - </div> | ||
| 174 | - | ||
| 175 | - </div> | ||
| 176 | - <div class="form-group has-success has-feedback"> | ||
| 177 | - <label class="col-md-3 control-label">班次类型*:</label> | ||
| 178 | - <div class="col-md-7"> | ||
| 179 | - <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 180 | - name="bcType" | ||
| 181 | - placeholder="请选择班次类型..." | ||
| 182 | - dcvalue="{{ctrl.TimeTableDetailForSave.bcType}}" | ||
| 183 | - dcname="bcType" | ||
| 184 | - icname="code" | ||
| 185 | - icnames="name" | ||
| 186 | - datatype="ScheduleType" | ||
| 187 | - required > | ||
| 188 | - </sa-Select3> | ||
| 189 | - </div> | ||
| 190 | - | ||
| 191 | - </div> | ||
| 192 | - <div class="form-group"> | ||
| 193 | - <label class="col-md-3 control-label">备注:</label> | ||
| 194 | - <div class="col-md-7"> | ||
| 195 | - <textarea class="form-control" | ||
| 196 | - ng-model="ctrl.TimeTableDetailForSave.remark" | ||
| 197 | - /> | ||
| 198 | - </div> | ||
| 199 | - | ||
| 200 | - </div> | ||
| 201 | - | ||
| 202 | - </div> | ||
| 203 | - | ||
| 204 | - <div class="form-actions"> | ||
| 205 | - <div class="row"> | ||
| 206 | - <div class="col-md-offset-3 col-md-4"> | ||
| 207 | - <button type="submit" class="btn green" | ||
| 208 | - ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 209 | - <a type="button" class="btn default" | ||
| 210 | - ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a> | ||
| 211 | - </div> | ||
| 212 | - </div> | ||
| 213 | - </div> | ||
| 214 | - </form> | ||
| 215 | - | ||
| 216 | - </div> | ||
| 217 | - </div> | ||
| 218 | - | ||
| 219 | - | ||
| 220 | - | ||
| 221 | - | ||
| 222 | -</div> | 1 | +<div ng-controller="TimeTableDetailManageFormCtrl_old as ctrl"> |
| 2 | + <div class="page-head"> | ||
| 3 | + <div class="page-title"> | ||
| 4 | + <h1>修改班次信息2</h1> | ||
| 5 | + </div> | ||
| 6 | + </div> | ||
| 7 | + | ||
| 8 | + <ul class="page-breadcrumb breadcrumb"> | ||
| 9 | + <li> | ||
| 10 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 11 | + <i class="fa fa-circle"></i> | ||
| 12 | + </li> | ||
| 13 | + <li> | ||
| 14 | + <span class="active">运营计划管理</span> | ||
| 15 | + <i class="fa fa-circle"></i> | ||
| 16 | + </li> | ||
| 17 | + <li> | ||
| 18 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 19 | + <i class="fa fa-circle"></i> | ||
| 20 | + </li> | ||
| 21 | + <li> | ||
| 22 | + <a ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})"><span ng-bind="ctrl.title1"></span></a> | ||
| 23 | + <i class="fa fa-circle"></i> | ||
| 24 | + </li> | ||
| 25 | + <li> | ||
| 26 | + <span class="active">修改班次信息</span> | ||
| 27 | + </li> | ||
| 28 | + </ul> | ||
| 29 | + | ||
| 30 | + <div class="portlet light bordered"> | ||
| 31 | + <div class="portlet-title"> | ||
| 32 | + <div class="caption"> | ||
| 33 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 34 | + class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title2"></span> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + | ||
| 38 | + <div class="portlet-body form"> | ||
| 39 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 40 | + <div class="form-body"> | ||
| 41 | + <div class="form-group has-success has-feedback"> | ||
| 42 | + <label class="col-md-3 control-label">线路*:</label> | ||
| 43 | + <div class="col-md-7"> | ||
| 44 | + <input type="text" class="form-control" | ||
| 45 | + ng-value="ctrl.TimeTableDetailForSave.xl.name" | ||
| 46 | + readonly/> | ||
| 47 | + </div> | ||
| 48 | + | ||
| 49 | + </div> | ||
| 50 | + <div class="form-group has-success has-feedback"> | ||
| 51 | + <label class="col-md-3 control-label">时刻表名称*:</label> | ||
| 52 | + <div class="col-md-7"> | ||
| 53 | + <input type="text" class="form-control" | ||
| 54 | + ng-value="ctrl.TimeTableDetailForSave.ttinfo.name" | ||
| 55 | + readonly/> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + <div class="form-group has-success has-feedback"> | ||
| 59 | + <label class="col-md-3 control-label">路牌*:</label> | ||
| 60 | + <div class="col-md-7"> | ||
| 61 | + <input type="text" class="form-control" | ||
| 62 | + ng-value="ctrl.TimeTableDetailForSave.lp.lpName" | ||
| 63 | + readonly/> | ||
| 64 | + </div> | ||
| 65 | + | ||
| 66 | + </div> | ||
| 67 | + <div class="form-group has-success has-feedback"> | ||
| 68 | + <label class="col-md-3 control-label">发车顺序号*:</label> | ||
| 69 | + <div class="col-md-7"> | ||
| 70 | + <input type="text" class="form-control" | ||
| 71 | + ng-value="ctrl.TimeTableDetailForSave.fcno" | ||
| 72 | + readonly/> | ||
| 73 | + </div> | ||
| 74 | + | ||
| 75 | + </div> | ||
| 76 | + <div class="form-group has-success has-feedback"> | ||
| 77 | + <label class="col-md-3 control-label">方向*:</label> | ||
| 78 | + <div class="col-md-7"> | ||
| 79 | + <sa-Radiogroup model="ctrl.TimeTableDetailForSave.xlDir" dicgroup="LineTrend" name="xlDir" required></sa-Radiogroup> | ||
| 80 | + </div> | ||
| 81 | + <!-- 隐藏块,显示验证信息 --> | ||
| 82 | + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required"> | ||
| 83 | + 请选择线路上下行 | ||
| 84 | + </div> | ||
| 85 | + | ||
| 86 | + </div> | ||
| 87 | + <div class="form-group"> | ||
| 88 | + <label class="col-md-3 control-label">起点站:</label> | ||
| 89 | + <div class="col-md-7"> | ||
| 90 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 91 | + name="qdz" | ||
| 92 | + placeholder="请输拼音..." | ||
| 93 | + dcvalue="{{ctrl.TimeTableDetailForSave.qdz.id}}" | ||
| 94 | + dcname="qdz.id" | ||
| 95 | + icname="stationid" | ||
| 96 | + icnames="stationname" | ||
| 97 | + datatype="zd" | ||
| 98 | + dataassociate="true" | ||
| 99 | + dataparam="{{ {'xlid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}" | ||
| 100 | + mlp="true" | ||
| 101 | + > | ||
| 102 | + </sa-Select3> | ||
| 103 | + </div> | ||
| 104 | + </div> | ||
| 105 | + <div class="form-group"> | ||
| 106 | + <label class="col-md-3 control-label">终点站:</label> | ||
| 107 | + <div class="col-md-7"> | ||
| 108 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 109 | + name="zdz" | ||
| 110 | + placeholder="请输拼音..." | ||
| 111 | + dcvalue="{{ctrl.TimeTableDetailForSave.zdz.id}}" | ||
| 112 | + dcname="zdz.id" | ||
| 113 | + icname="stationid" | ||
| 114 | + icnames="stationname" | ||
| 115 | + datatype="zd" | ||
| 116 | + dataassociate="true" | ||
| 117 | + dataparam="{{ {'xlid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir} | json }}" | ||
| 118 | + mlp="true" | ||
| 119 | + > | ||
| 120 | + </sa-Select3> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + <div class="form-group"> | ||
| 124 | + <label class="col-md-3 control-label">停车场:</label> | ||
| 125 | + <div class="col-md-7"> | ||
| 126 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 127 | + name="tcc" | ||
| 128 | + placeholder="请输拼音..." | ||
| 129 | + dcvalue="{{ctrl.TimeTableDetailForSave.tcc.id}}" | ||
| 130 | + dcname="tcc.id" | ||
| 131 | + icname="id" | ||
| 132 | + icnames="parkName" | ||
| 133 | + datatype="tcc" | ||
| 134 | + mlp="true" | ||
| 135 | + > | ||
| 136 | + </sa-Select3> | ||
| 137 | + </div> | ||
| 138 | + </div> | ||
| 139 | + | ||
| 140 | + <div class="form-group has-success has-feedback"> | ||
| 141 | + <label class="col-md-3 control-label">发车时间*:</label> | ||
| 142 | + <div class="col-md-7"> | ||
| 143 | + <input type="text" class="form-control" | ||
| 144 | + ng-model="ctrl.TimeTableDetailForSave.fcsj" | ||
| 145 | + /> | ||
| 146 | + </div> | ||
| 147 | + | ||
| 148 | + </div> | ||
| 149 | + <div class="form-group"> | ||
| 150 | + <label class="col-md-3 control-label">对应班次数:</label> | ||
| 151 | + <div class="col-md-7"> | ||
| 152 | + <input type="text" class="form-control" | ||
| 153 | + ng-value="ctrl.TimeTableDetailForSave.bcs" | ||
| 154 | + readonly/> | ||
| 155 | + </div> | ||
| 156 | + | ||
| 157 | + </div> | ||
| 158 | + <div class="form-group"> | ||
| 159 | + <label class="col-md-3 control-label">计划里程:</label> | ||
| 160 | + <div class="col-md-7"> | ||
| 161 | + <input type="text" class="form-control" | ||
| 162 | + ng-model="ctrl.TimeTableDetailForSave.jhlc" | ||
| 163 | + /> | ||
| 164 | + </div> | ||
| 165 | + | ||
| 166 | + </div> | ||
| 167 | + <div class="form-group"> | ||
| 168 | + <label class="col-md-3 control-label">班次历时:</label> | ||
| 169 | + <div class="col-md-7"> | ||
| 170 | + <input type="text" class="form-control" | ||
| 171 | + ng-model="ctrl.TimeTableDetailForSave.bcsj" | ||
| 172 | + /> | ||
| 173 | + </div> | ||
| 174 | + | ||
| 175 | + </div> | ||
| 176 | + <div class="form-group has-success has-feedback"> | ||
| 177 | + <label class="col-md-3 control-label">班次类型*:</label> | ||
| 178 | + <div class="col-md-7"> | ||
| 179 | + <sa-Select3 model="ctrl.TimeTableDetailForSave" | ||
| 180 | + name="bcType" | ||
| 181 | + placeholder="请选择班次类型..." | ||
| 182 | + dcvalue="{{ctrl.TimeTableDetailForSave.bcType}}" | ||
| 183 | + dcname="bcType" | ||
| 184 | + icname="code" | ||
| 185 | + icnames="name" | ||
| 186 | + datatype="ScheduleType" | ||
| 187 | + required > | ||
| 188 | + </sa-Select3> | ||
| 189 | + </div> | ||
| 190 | + | ||
| 191 | + </div> | ||
| 192 | + <div class="form-group"> | ||
| 193 | + <label class="col-md-3 control-label">备注:</label> | ||
| 194 | + <div class="col-md-7"> | ||
| 195 | + <textarea class="form-control" | ||
| 196 | + ng-model="ctrl.TimeTableDetailForSave.remark" | ||
| 197 | + /> | ||
| 198 | + </div> | ||
| 199 | + | ||
| 200 | + </div> | ||
| 201 | + | ||
| 202 | + </div> | ||
| 203 | + | ||
| 204 | + <div class="form-actions"> | ||
| 205 | + <div class="row"> | ||
| 206 | + <div class="col-md-offset-3 col-md-4"> | ||
| 207 | + <button type="submit" class="btn green" | ||
| 208 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 209 | + <a type="button" class="btn default" | ||
| 210 | + ui-sref="ttInfoDetailManage_edit({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a> | ||
| 211 | + </div> | ||
| 212 | + </div> | ||
| 213 | + </div> | ||
| 214 | + </form> | ||
| 215 | + | ||
| 216 | + </div> | ||
| 217 | + </div> | ||
| 218 | + | ||
| 219 | + | ||
| 220 | + | ||
| 221 | + | ||
| 222 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/edit.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>时刻表管理2</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">运营计划管理</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">编辑时刻表明细信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<!--<!– loading widget –>--> | ||
| 26 | -<!--<div id="loadingWidget" class="flyover mask" loading-widget>--> | ||
| 27 | -<!--<div class="alert alert-info">--> | ||
| 28 | -<!--<strong>载入中......</strong>--> | ||
| 29 | -<!--</div>--> | ||
| 30 | -<!--</div>--> | ||
| 31 | - | ||
| 32 | -<div class="row" id="timeTableDetail" ng-controller="TimeTableDetailManageCtrl_old as ctrl"> | ||
| 33 | - <div class="col-md-12"> | ||
| 34 | - <div class="portlet light bordered"> | ||
| 35 | - <div class="portlet-title"> | ||
| 36 | - <div class="caption font-dark"> | ||
| 37 | - <i class="fa fa-database font-dark"></i> | ||
| 38 | - <span class="caption-subject bold uppercase" ng-bind="ctrl.title"></span> | ||
| 39 | - </div> | ||
| 40 | - <div class="actions"> | ||
| 41 | - <i class="fa fa-arrow-up" aria-hidden="true"></i> | ||
| 42 | - <span style="padding-right: 10px;">上行班次</span> | ||
| 43 | - <i class="fa fa-arrow-down" aria-hidden="true"></i> | ||
| 44 | - <span style="padding-right: 10px;">下行班次</span> | ||
| 45 | - <i class="fa fa-circle-o-notch" aria-hidden="true"></i> | ||
| 46 | - <span style="padding-right: 10px;">区间班次</span> | ||
| 47 | - <i class="fa fa-adjust" aria-hidden="true"></i> | ||
| 48 | - <span style="padding-right: 10px;">分班班次</span> | ||
| 49 | - | ||
| 50 | - <div class="btn-group"> | ||
| 51 | - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> | ||
| 52 | - <i class="fa fa-share"></i> | ||
| 53 | - <span>数据工具</span> | ||
| 54 | - <i class="fa fa-angle-down"></i> | ||
| 55 | - </a> | ||
| 56 | - <ul class="dropdown-menu pull-right"> | ||
| 57 | - <li> | ||
| 58 | - <a href="javascript:" class="tool-action"> | ||
| 59 | - <i class="fa fa-file-excel-o"></i> | ||
| 60 | - 导出excel | ||
| 61 | - </a> | ||
| 62 | - </li> | ||
| 63 | - <li class="divider"></li> | ||
| 64 | - <li> | ||
| 65 | - <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()"> | ||
| 66 | - <i class="fa fa-refresh"></i> | ||
| 67 | - 刷行数据 | ||
| 68 | - </a> | ||
| 69 | - </li> | ||
| 70 | - </ul> | ||
| 71 | - </div> | ||
| 72 | - | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - | ||
| 76 | - <div class="portlet-body"> | ||
| 77 | - <!--<div ng-view></div>--> | ||
| 78 | - <div class="fixDiv"> | ||
| 79 | - <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 80 | - <thead> | ||
| 81 | - <tr> | ||
| 82 | - <th ng-repeat="head in ctrl.detailHeads track by $index"> | ||
| 83 | - <span ng-bind="head"></span> | ||
| 84 | - </th> | ||
| 85 | - | ||
| 86 | - </tr> | ||
| 87 | - </thead> | ||
| 88 | - <tbody> | ||
| 89 | - <tr ng-repeat="info in ctrl.detailInfos"> | ||
| 90 | - <td ng-repeat="cell in info track by $index"> | ||
| 91 | - | ||
| 92 | - <!--<span ng-bind="cell.fcsj"></span>--> | ||
| 93 | - <span ng-if="!cell.ttdid" ng-bind="cell.fcsj"></span> | ||
| 94 | - | ||
| 95 | - <div ng-if="cell.ttdid" class="btn-group"> | ||
| 96 | - <a href="javascript:" class="btn blue btn-outline btn-circle" data-toggle="dropdown"> | ||
| 97 | - <!-- 上下行图标 --> | ||
| 98 | - <i ng-if="cell.xldir == '0'" class="fa fa-arrow-up" aria-hidden="true"></i> | ||
| 99 | - <i ng-if="cell.xldir == '1'" class="fa fa-arrow-down" aria-hidden="true"></i> | ||
| 100 | - <!-- 班次类型图标(区间班次) --> | ||
| 101 | - <i ng-if="cell.bc_type == 'region'" class="fa fa-circle-o-notch" aria-hidden="true"></i> | ||
| 102 | - <!-- 分班班次 --> | ||
| 103 | - <i ng-if="cell.isfb == true" class="fa fa-adjust" aria-hidden="true"></i> | ||
| 104 | - | ||
| 105 | - <span ng-bind="cell.fcsj"></span> | ||
| 106 | - <i class="fa fa-angle-down"></i> | ||
| 107 | - </a> | ||
| 108 | - <ul class="dropdown-menu pull-left"> | ||
| 109 | - <li> | ||
| 110 | - <a href="javascript:" class="tool-action" ui-sref="ttInfoDetailManage_detail_edit({id: cell.ttdid, xlid: ctrl.xlid, ttid: ctrl.ttid, xlname: ctrl.xlname, ttname: ctrl.ttname})"> | ||
| 111 | - <i class="fa fa-file-excel-o"></i> | ||
| 112 | - 修改 | ||
| 113 | - </a> | ||
| 114 | - </li> | ||
| 115 | - <li> | ||
| 116 | - <a href="javascript:" class="tool-action"> | ||
| 117 | - <i class="fa fa-refresh"></i> | ||
| 118 | - 删除 | ||
| 119 | - </a> | ||
| 120 | - </li> | ||
| 121 | - <li class="divider"></li> | ||
| 122 | - <li> | ||
| 123 | - <a href="javascript:" class="tool-action" ng-click="ctrl.changeDirect(cell, 0)"> | ||
| 124 | - <i class="fa fa-file-excel-o"></i> | ||
| 125 | - 设为上行 | ||
| 126 | - <i class="fa fa-arrow-up" aria-hidden="true"></i> | ||
| 127 | - </a> | ||
| 128 | - </li> | ||
| 129 | - <li> | ||
| 130 | - <a href="javascript:" class="tool-action" ng-click="ctrl.changeDirect(cell, 1)"> | ||
| 131 | - <i class="fa fa-file-excel-o"></i> | ||
| 132 | - 设为下行 | ||
| 133 | - <i class="fa fa-arrow-down" aria-hidden="true"></i> | ||
| 134 | - </a> | ||
| 135 | - </li> | ||
| 136 | - <li> | ||
| 137 | - <a href="javascript:" class="tool-action" ng-click="ctrl.changeFB(cell, true)"> | ||
| 138 | - <i class="fa fa-file-excel-o"></i> | ||
| 139 | - 设置分班 | ||
| 140 | - <i class="fa fa-adjust" aria-hidden="true"></i> | ||
| 141 | - </a> | ||
| 142 | - </li> | ||
| 143 | - <li> | ||
| 144 | - <a href="javascript:" class="tool-action" ng-click="ctrl.changeFB(cell, false)"> | ||
| 145 | - <i class="fa fa-file-excel-o"></i> | ||
| 146 | - 取消分班 | ||
| 147 | - <i class="fa fa-adjust" aria-hidden="true"></i> | ||
| 148 | - </a> | ||
| 149 | - </li> | ||
| 150 | - <li> | ||
| 151 | - <a href="javascript:" class="tool-action" ng-click="ctrl.changeBCType(cell, 'region')"> | ||
| 152 | - <i class="fa fa-file-excel-o"></i> | ||
| 153 | - 设为区间 | ||
| 154 | - <i class="fa fa-circle-o-notch" aria-hidden="true"></i> | ||
| 155 | - </a> | ||
| 156 | - </li> | ||
| 157 | - | ||
| 158 | - | ||
| 159 | - </ul> | ||
| 160 | - </div> | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | - </td> | ||
| 165 | - </tr> | ||
| 166 | - | ||
| 167 | - </tbody> | ||
| 168 | - </table> | ||
| 169 | - </div> | ||
| 170 | - | ||
| 171 | - | ||
| 172 | - </div> | ||
| 173 | - </div> | ||
| 174 | - </div> | ||
| 175 | -</div> | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>时刻表管理2</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">编辑时刻表明细信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<!--<!– loading widget –>--> | ||
| 26 | +<!--<div id="loadingWidget" class="flyover mask" loading-widget>--> | ||
| 27 | +<!--<div class="alert alert-info">--> | ||
| 28 | +<!--<strong>载入中......</strong>--> | ||
| 29 | +<!--</div>--> | ||
| 30 | +<!--</div>--> | ||
| 31 | + | ||
| 32 | +<div class="row" id="timeTableDetail" ng-controller="TimeTableDetailManageCtrl_old as ctrl"> | ||
| 33 | + <div class="col-md-12"> | ||
| 34 | + <div class="portlet light bordered"> | ||
| 35 | + <div class="portlet-title"> | ||
| 36 | + <div class="caption font-dark"> | ||
| 37 | + <i class="fa fa-database font-dark"></i> | ||
| 38 | + <span class="caption-subject bold uppercase" ng-bind="ctrl.title"></span> | ||
| 39 | + </div> | ||
| 40 | + <div class="actions"> | ||
| 41 | + <i class="fa fa-arrow-up" aria-hidden="true"></i> | ||
| 42 | + <span style="padding-right: 10px;">上行班次</span> | ||
| 43 | + <i class="fa fa-arrow-down" aria-hidden="true"></i> | ||
| 44 | + <span style="padding-right: 10px;">下行班次</span> | ||
| 45 | + <i class="fa fa-circle-o-notch" aria-hidden="true"></i> | ||
| 46 | + <span style="padding-right: 10px;">区间班次</span> | ||
| 47 | + <i class="fa fa-adjust" aria-hidden="true"></i> | ||
| 48 | + <span style="padding-right: 10px;">分班班次</span> | ||
| 49 | + | ||
| 50 | + <div class="btn-group"> | ||
| 51 | + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> | ||
| 52 | + <i class="fa fa-share"></i> | ||
| 53 | + <span>数据工具</span> | ||
| 54 | + <i class="fa fa-angle-down"></i> | ||
| 55 | + </a> | ||
| 56 | + <ul class="dropdown-menu pull-right"> | ||
| 57 | + <li> | ||
| 58 | + <a href="javascript:" class="tool-action"> | ||
| 59 | + <i class="fa fa-file-excel-o"></i> | ||
| 60 | + 导出excel | ||
| 61 | + </a> | ||
| 62 | + </li> | ||
| 63 | + <li class="divider"></li> | ||
| 64 | + <li> | ||
| 65 | + <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()"> | ||
| 66 | + <i class="fa fa-refresh"></i> | ||
| 67 | + 刷行数据 | ||
| 68 | + </a> | ||
| 69 | + </li> | ||
| 70 | + </ul> | ||
| 71 | + </div> | ||
| 72 | + | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + | ||
| 76 | + <div class="portlet-body"> | ||
| 77 | + <!--<div ng-view></div>--> | ||
| 78 | + <div class="fixDiv"> | ||
| 79 | + <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 80 | + <thead> | ||
| 81 | + <tr> | ||
| 82 | + <th ng-repeat="head in ctrl.detailHeads track by $index"> | ||
| 83 | + <span ng-bind="head"></span> | ||
| 84 | + </th> | ||
| 85 | + | ||
| 86 | + </tr> | ||
| 87 | + </thead> | ||
| 88 | + <tbody> | ||
| 89 | + <tr ng-repeat="info in ctrl.detailInfos"> | ||
| 90 | + <td ng-repeat="cell in info track by $index"> | ||
| 91 | + | ||
| 92 | + <!--<span ng-bind="cell.fcsj"></span>--> | ||
| 93 | + <span ng-if="!cell.ttdid" ng-bind="cell.fcsj"></span> | ||
| 94 | + | ||
| 95 | + <div ng-if="cell.ttdid" class="btn-group"> | ||
| 96 | + <a href="javascript:" class="btn blue btn-outline btn-circle" data-toggle="dropdown"> | ||
| 97 | + <!-- 上下行图标 --> | ||
| 98 | + <i ng-if="cell.xldir == '0'" class="fa fa-arrow-up" aria-hidden="true"></i> | ||
| 99 | + <i ng-if="cell.xldir == '1'" class="fa fa-arrow-down" aria-hidden="true"></i> | ||
| 100 | + <!-- 班次类型图标(区间班次) --> | ||
| 101 | + <i ng-if="cell.bc_type == 'region'" class="fa fa-circle-o-notch" aria-hidden="true"></i> | ||
| 102 | + <!-- 分班班次 --> | ||
| 103 | + <i ng-if="cell.isfb == true" class="fa fa-adjust" aria-hidden="true"></i> | ||
| 104 | + | ||
| 105 | + <span ng-bind="cell.fcsj"></span> | ||
| 106 | + <i class="fa fa-angle-down"></i> | ||
| 107 | + </a> | ||
| 108 | + <ul class="dropdown-menu pull-left"> | ||
| 109 | + <li> | ||
| 110 | + <a href="javascript:" class="tool-action" ui-sref="ttInfoDetailManage_detail_edit({id: cell.ttdid, xlid: ctrl.xlid, ttid: ctrl.ttid, xlname: ctrl.xlname, ttname: ctrl.ttname})"> | ||
| 111 | + <i class="fa fa-file-excel-o"></i> | ||
| 112 | + 修改 | ||
| 113 | + </a> | ||
| 114 | + </li> | ||
| 115 | + <li> | ||
| 116 | + <a href="javascript:" class="tool-action"> | ||
| 117 | + <i class="fa fa-refresh"></i> | ||
| 118 | + 删除 | ||
| 119 | + </a> | ||
| 120 | + </li> | ||
| 121 | + <li class="divider"></li> | ||
| 122 | + <li> | ||
| 123 | + <a href="javascript:" class="tool-action" ng-click="ctrl.changeDirect(cell, 0)"> | ||
| 124 | + <i class="fa fa-file-excel-o"></i> | ||
| 125 | + 设为上行 | ||
| 126 | + <i class="fa fa-arrow-up" aria-hidden="true"></i> | ||
| 127 | + </a> | ||
| 128 | + </li> | ||
| 129 | + <li> | ||
| 130 | + <a href="javascript:" class="tool-action" ng-click="ctrl.changeDirect(cell, 1)"> | ||
| 131 | + <i class="fa fa-file-excel-o"></i> | ||
| 132 | + 设为下行 | ||
| 133 | + <i class="fa fa-arrow-down" aria-hidden="true"></i> | ||
| 134 | + </a> | ||
| 135 | + </li> | ||
| 136 | + <li> | ||
| 137 | + <a href="javascript:" class="tool-action" ng-click="ctrl.changeFB(cell, true)"> | ||
| 138 | + <i class="fa fa-file-excel-o"></i> | ||
| 139 | + 设置分班 | ||
| 140 | + <i class="fa fa-adjust" aria-hidden="true"></i> | ||
| 141 | + </a> | ||
| 142 | + </li> | ||
| 143 | + <li> | ||
| 144 | + <a href="javascript:" class="tool-action" ng-click="ctrl.changeFB(cell, false)"> | ||
| 145 | + <i class="fa fa-file-excel-o"></i> | ||
| 146 | + 取消分班 | ||
| 147 | + <i class="fa fa-adjust" aria-hidden="true"></i> | ||
| 148 | + </a> | ||
| 149 | + </li> | ||
| 150 | + <li> | ||
| 151 | + <a href="javascript:" class="tool-action" ng-click="ctrl.changeBCType(cell, 'region')"> | ||
| 152 | + <i class="fa fa-file-excel-o"></i> | ||
| 153 | + 设为区间 | ||
| 154 | + <i class="fa fa-circle-o-notch" aria-hidden="true"></i> | ||
| 155 | + </a> | ||
| 156 | + </li> | ||
| 157 | + | ||
| 158 | + | ||
| 159 | + </ul> | ||
| 160 | + </div> | ||
| 161 | + | ||
| 162 | + | ||
| 163 | + | ||
| 164 | + </td> | ||
| 165 | + </tr> | ||
| 166 | + | ||
| 167 | + </tbody> | ||
| 168 | + </table> | ||
| 169 | + </div> | ||
| 170 | + | ||
| 171 | + | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + </div> | ||
| 175 | +</div> |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/form.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>时刻表管理2</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">运营计划管理</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">时刻表明细</span> | ||
| 22 | - </li> | ||
| 23 | - <li> | ||
| 24 | - <span class="active">导入时刻表 </span> | ||
| 25 | - </li> | ||
| 26 | -</ul> | ||
| 27 | - | ||
| 28 | -<div class="portlet light bordered" ng-controller="TtInfoDetailManageFormCtrl as ctrl"> | ||
| 29 | - <div class="portlet-title"> | ||
| 30 | - <div class="caption"> | ||
| 31 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 32 | - class="caption-subject font-red-sunglo bold uppercase" | ||
| 33 | - ng-bind="ctrl.title"> | ||
| 34 | - </span> | ||
| 35 | - </div> | ||
| 36 | - </div> | ||
| 37 | - | ||
| 38 | - | ||
| 39 | - <div class="col-md-6"> | ||
| 40 | - <div class="input-group"> | ||
| 41 | - <input type="file" class="form-control" nv-file-select="" uploader="ctrl.uploader"/> | ||
| 42 | - <span class="input-group-btn"> | ||
| 43 | - <button type="button" ng-click="ctrl.clearInputFile()" class="btn btn-default"> | ||
| 44 | - <span class="glyphicon glyphicon-trash"></span> | ||
| 45 | - </button> | ||
| 46 | - </span> | ||
| 47 | - </div> | ||
| 48 | - </div> | ||
| 49 | - <div class="table-scrollable table-scrollable-borderless"> | ||
| 50 | - <table class="table table-hover table-light"> | ||
| 51 | - <thead> | ||
| 52 | - <tr class="uppercase"> | ||
| 53 | - <th width="50%">文件名</th> | ||
| 54 | - <th ng-show="ctrl.uploader.isHTML5">大小(M)</th> | ||
| 55 | - <th ng-show="ctrl.uploader.isHTML5">进度</th> | ||
| 56 | - <th>状态</th> | ||
| 57 | - <th>操作</th> | ||
| 58 | - </tr> | ||
| 59 | - </thead> | ||
| 60 | - <tbody> | ||
| 61 | - <tr ng-repeat="item in ctrl.uploader.queue"> | ||
| 62 | - <td> | ||
| 63 | - <strong>{{ item.file.name }}</strong> | ||
| 64 | - </td> | ||
| 65 | - <td ng-show="ctrl.uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td> | ||
| 66 | - <td ng-show="ctrl.uploader.isHTML5"> | ||
| 67 | - <div class="progress progress-sm" style="margin-bottom: 0;"> | ||
| 68 | - <div class="progress-bar progress-bar-info" role="progressbar" | ||
| 69 | - ng-style="{ 'width': item.progress + '%' }"></div> | ||
| 70 | - </div> | ||
| 71 | - </td> | ||
| 72 | - <td class="text-center"> | ||
| 73 | - <span ng-show="item.isSuccess" class="text-success"> | ||
| 74 | - <i class="glyphicon glyphicon-ok"></i> | ||
| 75 | - </span> | ||
| 76 | - <span ng-show="item.isCancel" class="text-info"> | ||
| 77 | - <i class="glyphicon glyphicon-ban-circle"></i> | ||
| 78 | - </span> | ||
| 79 | - <span ng-show="item.isError" class="text-danger"> | ||
| 80 | - <i class="glyphicon glyphicon-remove"></i> | ||
| 81 | - </span> | ||
| 82 | - </td> | ||
| 83 | - <td nowrap> | ||
| 84 | - <button type="button" class="btn btn-success btn-xs" ng-click="item.upload()" | ||
| 85 | - ng-disabled="item.isReady || item.isUploading || item.isSuccess"> | ||
| 86 | - <span class="glyphicon glyphicon-upload"></span> 上传 | ||
| 87 | - </button> | ||
| 88 | - <button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" | ||
| 89 | - ng-disabled="!item.isUploading"> | ||
| 90 | - <span class="glyphicon glyphicon-ban-circle"></span> 取消 | ||
| 91 | - </button> | ||
| 92 | - <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()"> | ||
| 93 | - <span class="glyphicon glyphicon-trash"></span> 删除 | ||
| 94 | - </button> | ||
| 95 | - </td> | ||
| 96 | - </tr> | ||
| 97 | - </tbody> | ||
| 98 | - </table> | ||
| 99 | - </div> | ||
| 100 | - | ||
| 101 | - | ||
| 102 | - <div class="portlet-body form"> | ||
| 103 | - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 104 | - <div class="form-body"> | ||
| 105 | - <div class="form-group has-success has-feedback"> | ||
| 106 | - <label class="col-md-2 control-label">excel工作区*:</label> | ||
| 107 | - <div class="col-md-3"> | ||
| 108 | - <sa-Select5 name="sheetname" | ||
| 109 | - model="ctrl.ttInfoDetailManageForForm" | ||
| 110 | - cmaps="{'sheetname' : 'name'}" | ||
| 111 | - dcname="sheetname" | ||
| 112 | - icname="name" | ||
| 113 | - dsparams="{{ {type: 'local', ldata: ctrl.sheetnames} | json }}" | ||
| 114 | - iterobjname="item" | ||
| 115 | - iterobjexp="item.name" | ||
| 116 | - searchph="请选择..." | ||
| 117 | - searchexp="this.name" | ||
| 118 | - required > | ||
| 119 | - </sa-Select5> | ||
| 120 | - <input type="hidden" name="sheetname_h" ng-model="ctrl.ttInfoDetailManageForForm.sheetvaliddesc" | ||
| 121 | - remote-Validationt2 | ||
| 122 | - remotevtype="sheet" | ||
| 123 | - remotevparam="{{ { | ||
| 124 | - 'filename': ctrl.ttInfoDetailManageForForm.filename, | ||
| 125 | - 'sheetname': ctrl.ttInfoDetailManageForForm.sheetname, | ||
| 126 | - 'lineid' : ctrl.ttInfoDetailManageForForm.xlid, | ||
| 127 | - 'linename' : ctrl.ttInfoDetailManageForForm.xlname | ||
| 128 | - } | json}}"/> | ||
| 129 | - </div> | ||
| 130 | - <!-- 隐藏块,显示验证信息 --> | ||
| 131 | - <div class="alert alert-danger well-sm" ng-show="myForm.sheetname.$error.required"> | ||
| 132 | - 工作区必须选择 | ||
| 133 | - </div> | ||
| 134 | - <div class="alert alert-danger well-sm" ng-show="myForm.sheetname_h.$error.remote"> | ||
| 135 | - {{ctrl.ttInfoDetailManageForForm.sheetvaliddesc}} | ||
| 136 | - </div> | ||
| 137 | - </div> | ||
| 138 | - | ||
| 139 | - <div class="form-group has-success has-feedback"> | ||
| 140 | - <label class="col-md-2 control-label">线路标准*:</label> | ||
| 141 | - <div class="col-md-3"> | ||
| 142 | - <sa-Select5 name="lineinfo" | ||
| 143 | - model="ctrl.ttInfoDetailManageForForm" | ||
| 144 | - cmaps="{'lineinfo' : 'id'}" | ||
| 145 | - dcname="lineinfo" | ||
| 146 | - icname="id" | ||
| 147 | - dsparams="{{ {type: 'ajax', param:{'type': 'all', 'line.id_eq': ctrl.ttInfoDetailManageForForm.xlid}, atype:'xlinfo' } | json }}" | ||
| 148 | - iterobjname="item" | ||
| 149 | - iterobjexp="item.line.name + '-' + (item.descriptions ? item.descriptions : '')" | ||
| 150 | - searchph="请输拼音..." | ||
| 151 | - searchexp="this.line.name + '-' + (this.descriptions ? this.descriptions : '')" | ||
| 152 | - required > | ||
| 153 | - </sa-Select5> | ||
| 154 | - <input type="hidden" name="lineinfo_h" ng-model="ctrl.ttInfoDetailManageForForm.lineinfo" | ||
| 155 | - remote-Validationt2 | ||
| 156 | - remotevtype="sheetli" | ||
| 157 | - remotevparam="{{ {'lineinfoid': ctrl.ttInfoDetailManageForForm.lineinfo} | json}}"/> | ||
| 158 | - </div> | ||
| 159 | - <!-- 隐藏块,显示验证信息 --> | ||
| 160 | - <div class="alert alert-danger well-sm" ng-show="myForm.lineinfo.$error.required"> | ||
| 161 | - 线路标准必须选择 | ||
| 162 | - </div> | ||
| 163 | - <div class="alert alert-danger well-sm" ng-show="myForm.lineinfo_h.$error.remote"> | ||
| 164 | - {{ctrl.ttInfoDetailManageForForm.lineinfovaliddesc}} | ||
| 165 | - | ||
| 166 | - 上下行出场进场里程时间必须填写,上下行班次里程时间必须填写,停车场必须填写 | ||
| 167 | - </div> | ||
| 168 | - </div> | ||
| 169 | - | ||
| 170 | - | ||
| 171 | - </div> | ||
| 172 | - | ||
| 173 | - <div class="form-actions"> | ||
| 174 | - <div class="row"> | ||
| 175 | - <div class="col-md-offset-3 col-md-4"> | ||
| 176 | - <button type="submit" class="btn green" | ||
| 177 | - ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 178 | - <a type="button" class="btn default" ui-sref="ttInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 179 | - </div> | ||
| 180 | - </div> | ||
| 181 | - </div> | ||
| 182 | - | ||
| 183 | - </form> | ||
| 184 | - | ||
| 185 | - </div> | ||
| 186 | - | ||
| 187 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>时刻表管理2</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">时刻表明细</span> | ||
| 22 | + </li> | ||
| 23 | + <li> | ||
| 24 | + <span class="active">导入时刻表 </span> | ||
| 25 | + </li> | ||
| 26 | +</ul> | ||
| 27 | + | ||
| 28 | +<div class="portlet light bordered" ng-controller="TtInfoDetailManageFormCtrl as ctrl"> | ||
| 29 | + <div class="portlet-title"> | ||
| 30 | + <div class="caption"> | ||
| 31 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 32 | + class="caption-subject font-red-sunglo bold uppercase" | ||
| 33 | + ng-bind="ctrl.title"> | ||
| 34 | + </span> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + <div class="col-md-6"> | ||
| 40 | + <div class="input-group"> | ||
| 41 | + <input type="file" class="form-control" nv-file-select="" uploader="ctrl.uploader"/> | ||
| 42 | + <span class="input-group-btn"> | ||
| 43 | + <button type="button" ng-click="ctrl.clearInputFile()" class="btn btn-default"> | ||
| 44 | + <span class="glyphicon glyphicon-trash"></span> | ||
| 45 | + </button> | ||
| 46 | + </span> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + <div class="table-scrollable table-scrollable-borderless"> | ||
| 50 | + <table class="table table-hover table-light"> | ||
| 51 | + <thead> | ||
| 52 | + <tr class="uppercase"> | ||
| 53 | + <th width="50%">文件名</th> | ||
| 54 | + <th ng-show="ctrl.uploader.isHTML5">大小(M)</th> | ||
| 55 | + <th ng-show="ctrl.uploader.isHTML5">进度</th> | ||
| 56 | + <th>状态</th> | ||
| 57 | + <th>操作</th> | ||
| 58 | + </tr> | ||
| 59 | + </thead> | ||
| 60 | + <tbody> | ||
| 61 | + <tr ng-repeat="item in ctrl.uploader.queue"> | ||
| 62 | + <td> | ||
| 63 | + <strong>{{ item.file.name }}</strong> | ||
| 64 | + </td> | ||
| 65 | + <td ng-show="ctrl.uploader.isHTML5" nowrap>{{ item.file.size/1024/1024|number:2 }} MB</td> | ||
| 66 | + <td ng-show="ctrl.uploader.isHTML5"> | ||
| 67 | + <div class="progress progress-sm" style="margin-bottom: 0;"> | ||
| 68 | + <div class="progress-bar progress-bar-info" role="progressbar" | ||
| 69 | + ng-style="{ 'width': item.progress + '%' }"></div> | ||
| 70 | + </div> | ||
| 71 | + </td> | ||
| 72 | + <td class="text-center"> | ||
| 73 | + <span ng-show="item.isSuccess" class="text-success"> | ||
| 74 | + <i class="glyphicon glyphicon-ok"></i> | ||
| 75 | + </span> | ||
| 76 | + <span ng-show="item.isCancel" class="text-info"> | ||
| 77 | + <i class="glyphicon glyphicon-ban-circle"></i> | ||
| 78 | + </span> | ||
| 79 | + <span ng-show="item.isError" class="text-danger"> | ||
| 80 | + <i class="glyphicon glyphicon-remove"></i> | ||
| 81 | + </span> | ||
| 82 | + </td> | ||
| 83 | + <td nowrap> | ||
| 84 | + <button type="button" class="btn btn-success btn-xs" ng-click="item.upload()" | ||
| 85 | + ng-disabled="item.isReady || item.isUploading || item.isSuccess"> | ||
| 86 | + <span class="glyphicon glyphicon-upload"></span> 上传 | ||
| 87 | + </button> | ||
| 88 | + <button type="button" class="btn btn-warning btn-xs" ng-click="item.cancel()" | ||
| 89 | + ng-disabled="!item.isUploading"> | ||
| 90 | + <span class="glyphicon glyphicon-ban-circle"></span> 取消 | ||
| 91 | + </button> | ||
| 92 | + <button type="button" class="btn btn-danger btn-xs" ng-click="item.remove()"> | ||
| 93 | + <span class="glyphicon glyphicon-trash"></span> 删除 | ||
| 94 | + </button> | ||
| 95 | + </td> | ||
| 96 | + </tr> | ||
| 97 | + </tbody> | ||
| 98 | + </table> | ||
| 99 | + </div> | ||
| 100 | + | ||
| 101 | + | ||
| 102 | + <div class="portlet-body form"> | ||
| 103 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 104 | + <div class="form-body"> | ||
| 105 | + <div class="form-group has-success has-feedback"> | ||
| 106 | + <label class="col-md-2 control-label">excel工作区*:</label> | ||
| 107 | + <div class="col-md-3"> | ||
| 108 | + <sa-Select5 name="sheetname" | ||
| 109 | + model="ctrl.ttInfoDetailManageForForm" | ||
| 110 | + cmaps="{'sheetname' : 'name'}" | ||
| 111 | + dcname="sheetname" | ||
| 112 | + icname="name" | ||
| 113 | + dsparams="{{ {type: 'local', ldata: ctrl.sheetnames} | json }}" | ||
| 114 | + iterobjname="item" | ||
| 115 | + iterobjexp="item.name" | ||
| 116 | + searchph="请选择..." | ||
| 117 | + searchexp="this.name" | ||
| 118 | + required > | ||
| 119 | + </sa-Select5> | ||
| 120 | + <input type="hidden" name="sheetname_h" ng-model="ctrl.ttInfoDetailManageForForm.sheetvaliddesc" | ||
| 121 | + remote-Validationt2 | ||
| 122 | + remotevtype="sheet" | ||
| 123 | + remotevparam="{{ { | ||
| 124 | + 'filename': ctrl.ttInfoDetailManageForForm.filename, | ||
| 125 | + 'sheetname': ctrl.ttInfoDetailManageForForm.sheetname, | ||
| 126 | + 'lineid' : ctrl.ttInfoDetailManageForForm.xlid, | ||
| 127 | + 'linename' : ctrl.ttInfoDetailManageForForm.xlname | ||
| 128 | + } | json}}"/> | ||
| 129 | + </div> | ||
| 130 | + <!-- 隐藏块,显示验证信息 --> | ||
| 131 | + <div class="alert alert-danger well-sm" ng-show="myForm.sheetname.$error.required"> | ||
| 132 | + 工作区必须选择 | ||
| 133 | + </div> | ||
| 134 | + <div class="alert alert-danger well-sm" ng-show="myForm.sheetname_h.$error.remote"> | ||
| 135 | + {{ctrl.ttInfoDetailManageForForm.sheetvaliddesc}} | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | + | ||
| 139 | + <div class="form-group has-success has-feedback"> | ||
| 140 | + <label class="col-md-2 control-label">线路标准*:</label> | ||
| 141 | + <div class="col-md-3"> | ||
| 142 | + <sa-Select5 name="lineinfo" | ||
| 143 | + model="ctrl.ttInfoDetailManageForForm" | ||
| 144 | + cmaps="{'lineinfo' : 'id'}" | ||
| 145 | + dcname="lineinfo" | ||
| 146 | + icname="id" | ||
| 147 | + dsparams="{{ {type: 'ajax', param:{'type': 'all', 'line.id_eq': ctrl.ttInfoDetailManageForForm.xlid}, atype:'xlinfo' } | json }}" | ||
| 148 | + iterobjname="item" | ||
| 149 | + iterobjexp="item.line.name + '-' + (item.descriptions ? item.descriptions : '')" | ||
| 150 | + searchph="请输拼音..." | ||
| 151 | + searchexp="this.line.name + '-' + (this.descriptions ? this.descriptions : '')" | ||
| 152 | + required > | ||
| 153 | + </sa-Select5> | ||
| 154 | + <input type="hidden" name="lineinfo_h" ng-model="ctrl.ttInfoDetailManageForForm.lineinfo" | ||
| 155 | + remote-Validationt2 | ||
| 156 | + remotevtype="sheetli" | ||
| 157 | + remotevparam="{{ {'lineinfoid': ctrl.ttInfoDetailManageForForm.lineinfo} | json}}"/> | ||
| 158 | + </div> | ||
| 159 | + <!-- 隐藏块,显示验证信息 --> | ||
| 160 | + <div class="alert alert-danger well-sm" ng-show="myForm.lineinfo.$error.required"> | ||
| 161 | + 线路标准必须选择 | ||
| 162 | + </div> | ||
| 163 | + <div class="alert alert-danger well-sm" ng-show="myForm.lineinfo_h.$error.remote"> | ||
| 164 | + {{ctrl.ttInfoDetailManageForForm.lineinfovaliddesc}} | ||
| 165 | + | ||
| 166 | + 上下行出场进场里程时间必须填写,上下行班次里程时间必须填写,停车场必须填写 | ||
| 167 | + </div> | ||
| 168 | + </div> | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + </div> | ||
| 172 | + | ||
| 173 | + <div class="form-actions"> | ||
| 174 | + <div class="row"> | ||
| 175 | + <div class="col-md-offset-3 col-md-4"> | ||
| 176 | + <button type="submit" class="btn green" | ||
| 177 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 178 | + <a type="button" class="btn default" ui-sref="ttInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 179 | + </div> | ||
| 180 | + </div> | ||
| 181 | + </div> | ||
| 182 | + | ||
| 183 | + </form> | ||
| 184 | + | ||
| 185 | + </div> | ||
| 186 | + | ||
| 187 | + | ||
| 188 | </div> | 188 | </div> |
| 189 | \ No newline at end of file | 189 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/main.js
| 1 | -// 时刻表明晰管理service,包装外部定义的globalservice,并保存一定的操作状态 | ||
| 2 | -angular.module('ScheduleApp').factory( | ||
| 3 | - 'TtInfoDetailManageService', | ||
| 4 | - [ | ||
| 5 | - 'TimeTableDetailManageService_g', | ||
| 6 | - function(service) { | ||
| 7 | - // TODO: | ||
| 8 | - | ||
| 9 | - return { | ||
| 10 | - importDetail: function(param) { | ||
| 11 | - return service.import.do(param).$promise; | ||
| 12 | - }, | ||
| 13 | - /** | ||
| 14 | - * 获取编辑用的时刻表明细数据。 | ||
| 15 | - * @param ttid 时刻表id | ||
| 16 | - */ | ||
| 17 | - getEditInfo: function(xlid, ttid) { | ||
| 18 | - var params = {xlid : xlid, ttid : ttid}; | ||
| 19 | - return service.edit.list(params).$promise; | ||
| 20 | - } | ||
| 21 | - }; | ||
| 22 | - } | ||
| 23 | - ] | ||
| 24 | -); | ||
| 25 | - | ||
| 26 | -// form.html控制器 | ||
| 27 | -angular.module('ScheduleApp').controller( | ||
| 28 | - 'TtInfoDetailManageFormCtrl', | ||
| 29 | - [ | ||
| 30 | - 'TtInfoDetailManageService', | ||
| 31 | - 'FileUploader', | ||
| 32 | - '$stateParams', | ||
| 33 | - '$state', | ||
| 34 | - function(service, FileUploader, $stateParams, $state) { | ||
| 35 | - var self = this; | ||
| 36 | - var xlid = $stateParams.xlid; | ||
| 37 | - var ttid = $stateParams.ttid; | ||
| 38 | - var xlname = $stateParams.xlname; | ||
| 39 | - var ttname = $stateParams.ttname; | ||
| 40 | - | ||
| 41 | - self.title = xlname + '(' + ttname + ')' + '时刻表明细信息excel数据导入'; | ||
| 42 | - | ||
| 43 | - // 欲保存的表单信息,双向绑定 | ||
| 44 | - self.ttInfoDetailManageForForm = { | ||
| 45 | - xlid: xlid, // 线路id | ||
| 46 | - ttid: ttid, // 时刻表id | ||
| 47 | - xlname: xlname, // 线路名称 | ||
| 48 | - ttname: ttname, // 时刻表名称 | ||
| 49 | - filename: undefined, // 上传后的文件名 | ||
| 50 | - sheetname: undefined, // sheet名字 | ||
| 51 | - sheetvaliddesc: undefined, // sheet验证描述返回 | ||
| 52 | - lineinfo: undefined, // 线路标准id | ||
| 53 | - lineinfovaliddesc: undefined // 线路标准验证描述返回 | ||
| 54 | - }; | ||
| 55 | - self.sheetnames = [ | ||
| 56 | - //{name: '工作表1'}, {name: '工作表2'} // sheet名字列表 | ||
| 57 | - ]; | ||
| 58 | - | ||
| 59 | - //--------------- 上传文件功能 ---------------// | ||
| 60 | - | ||
| 61 | - self.clearInputFile = function() { | ||
| 62 | - angular.element("input[type='file']").val(null); | ||
| 63 | - }; | ||
| 64 | - | ||
| 65 | - // 上传文件组件 | ||
| 66 | - self.uploader = new FileUploader({ | ||
| 67 | - url: "/tidc/uploadFile", | ||
| 68 | - filters: [], // 用于过滤文件,比如只允许导入excel, | ||
| 69 | - formData: [ | ||
| 70 | - { | ||
| 71 | - xlmc: self.xlmc, | ||
| 72 | - ttinfoname: self.ttinfoname | ||
| 73 | - } | ||
| 74 | - ] | ||
| 75 | - }); | ||
| 76 | - self.uploader.onAfterAddingFile = function(fileItem) | ||
| 77 | - { | ||
| 78 | - console.info('onAfterAddingFile', fileItem); | ||
| 79 | - console.log(self.uploader.queue.length); | ||
| 80 | - if (self.uploader.queue.length > 1) | ||
| 81 | - self.uploader.removeFromQueue(0); | ||
| 82 | - }; | ||
| 83 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | ||
| 84 | - { | ||
| 85 | - self.sheetnames = response.sheetnames; | ||
| 86 | - self.ttInfoDetailManageForForm.filename = response.fileName; | ||
| 87 | - console.info('onSuccessItem', fileItem, response, status, headers); | ||
| 88 | - }; | ||
| 89 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | ||
| 90 | - { | ||
| 91 | - alert("error"); | ||
| 92 | - self.sheetnames = []; | ||
| 93 | - console.info('onErrorItem', fileItem, response, status, headers); | ||
| 94 | - }; | ||
| 95 | - | ||
| 96 | - | ||
| 97 | - // form提交方法 | ||
| 98 | - self.submit = function() { | ||
| 99 | - service.importDetail(self.ttInfoDetailManageForForm).then( | ||
| 100 | - function(result) { | ||
| 101 | - $state.go("ttInfoManage"); | ||
| 102 | - }, | ||
| 103 | - function(result) { | ||
| 104 | - alert("出错啦!"); | ||
| 105 | - } | ||
| 106 | - ); | ||
| 107 | - }; | ||
| 108 | - | ||
| 109 | - | ||
| 110 | - // TODO:edit操作暂时使用旧版本的js文件 | ||
| 111 | - | ||
| 112 | - // {"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} | ||
| 113 | - } | ||
| 114 | - ] | 1 | +// 时刻表明晰管理service,包装外部定义的globalservice,并保存一定的操作状态 |
| 2 | +angular.module('ScheduleApp').factory( | ||
| 3 | + 'TtInfoDetailManageService', | ||
| 4 | + [ | ||
| 5 | + 'TimeTableDetailManageService_g', | ||
| 6 | + function(service) { | ||
| 7 | + // TODO: | ||
| 8 | + | ||
| 9 | + return { | ||
| 10 | + importDetail: function(param) { | ||
| 11 | + return service.import.do(param).$promise; | ||
| 12 | + }, | ||
| 13 | + /** | ||
| 14 | + * 获取编辑用的时刻表明细数据。 | ||
| 15 | + * @param ttid 时刻表id | ||
| 16 | + */ | ||
| 17 | + getEditInfo: function(xlid, ttid) { | ||
| 18 | + var params = {xlid : xlid, ttid : ttid}; | ||
| 19 | + return service.edit.list(params).$promise; | ||
| 20 | + } | ||
| 21 | + }; | ||
| 22 | + } | ||
| 23 | + ] | ||
| 24 | +); | ||
| 25 | + | ||
| 26 | +// form.html控制器 | ||
| 27 | +angular.module('ScheduleApp').controller( | ||
| 28 | + 'TtInfoDetailManageFormCtrl', | ||
| 29 | + [ | ||
| 30 | + 'TtInfoDetailManageService', | ||
| 31 | + 'FileUploader', | ||
| 32 | + '$stateParams', | ||
| 33 | + '$state', | ||
| 34 | + function(service, FileUploader, $stateParams, $state) { | ||
| 35 | + var self = this; | ||
| 36 | + var xlid = $stateParams.xlid; | ||
| 37 | + var ttid = $stateParams.ttid; | ||
| 38 | + var xlname = $stateParams.xlname; | ||
| 39 | + var ttname = $stateParams.ttname; | ||
| 40 | + | ||
| 41 | + self.title = xlname + '(' + ttname + ')' + '时刻表明细信息excel数据导入'; | ||
| 42 | + | ||
| 43 | + // 欲保存的表单信息,双向绑定 | ||
| 44 | + self.ttInfoDetailManageForForm = { | ||
| 45 | + xlid: xlid, // 线路id | ||
| 46 | + ttid: ttid, // 时刻表id | ||
| 47 | + xlname: xlname, // 线路名称 | ||
| 48 | + ttname: ttname, // 时刻表名称 | ||
| 49 | + filename: undefined, // 上传后的文件名 | ||
| 50 | + sheetname: undefined, // sheet名字 | ||
| 51 | + sheetvaliddesc: undefined, // sheet验证描述返回 | ||
| 52 | + lineinfo: undefined, // 线路标准id | ||
| 53 | + lineinfovaliddesc: undefined // 线路标准验证描述返回 | ||
| 54 | + }; | ||
| 55 | + self.sheetnames = [ | ||
| 56 | + //{name: '工作表1'}, {name: '工作表2'} // sheet名字列表 | ||
| 57 | + ]; | ||
| 58 | + | ||
| 59 | + //--------------- 上传文件功能 ---------------// | ||
| 60 | + | ||
| 61 | + self.clearInputFile = function() { | ||
| 62 | + angular.element("input[type='file']").val(null); | ||
| 63 | + }; | ||
| 64 | + | ||
| 65 | + // 上传文件组件 | ||
| 66 | + self.uploader = new FileUploader({ | ||
| 67 | + url: "/tidc/uploadFile", | ||
| 68 | + filters: [], // 用于过滤文件,比如只允许导入excel, | ||
| 69 | + formData: [ | ||
| 70 | + { | ||
| 71 | + xlmc: self.xlmc, | ||
| 72 | + ttinfoname: self.ttinfoname | ||
| 73 | + } | ||
| 74 | + ] | ||
| 75 | + }); | ||
| 76 | + self.uploader.onAfterAddingFile = function(fileItem) | ||
| 77 | + { | ||
| 78 | + console.info('onAfterAddingFile', fileItem); | ||
| 79 | + console.log(self.uploader.queue.length); | ||
| 80 | + if (self.uploader.queue.length > 1) | ||
| 81 | + self.uploader.removeFromQueue(0); | ||
| 82 | + }; | ||
| 83 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | ||
| 84 | + { | ||
| 85 | + self.sheetnames = response.sheetnames; | ||
| 86 | + self.ttInfoDetailManageForForm.filename = response.fileName; | ||
| 87 | + console.info('onSuccessItem', fileItem, response, status, headers); | ||
| 88 | + }; | ||
| 89 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | ||
| 90 | + { | ||
| 91 | + alert("error"); | ||
| 92 | + self.sheetnames = []; | ||
| 93 | + console.info('onErrorItem', fileItem, response, status, headers); | ||
| 94 | + }; | ||
| 95 | + | ||
| 96 | + | ||
| 97 | + // form提交方法 | ||
| 98 | + self.submit = function() { | ||
| 99 | + service.importDetail(self.ttInfoDetailManageForForm).then( | ||
| 100 | + function(result) { | ||
| 101 | + $state.go("ttInfoManage"); | ||
| 102 | + }, | ||
| 103 | + function(result) { | ||
| 104 | + alert("出错啦!"); | ||
| 105 | + } | ||
| 106 | + ); | ||
| 107 | + }; | ||
| 108 | + | ||
| 109 | + | ||
| 110 | + // TODO:edit操作暂时使用旧版本的js文件 | ||
| 111 | + | ||
| 112 | + // {"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} | ||
| 113 | + } | ||
| 114 | + ] | ||
| 115 | ); | 115 | ); |
| 116 | \ No newline at end of file | 116 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detail.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>时刻表管理2</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">运营计划管理</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">时刻表基础信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<div class="portlet light bordered" ng-controller="TtInfoManageDetailCtrl as ctrl"> | ||
| 26 | - <div class="portlet-title"> | ||
| 27 | - <div class="caption"> | ||
| 28 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | - class="caption-subject font-red-sunglo bold uppercase" | ||
| 30 | - ng-bind="ctrl.title"></span> | ||
| 31 | - </div> | ||
| 32 | - </div> | ||
| 33 | - | ||
| 34 | - <div class="portlet-body form"> | ||
| 35 | - <form class="form-horizontal" novalidate name="myForm"> | ||
| 36 | - <!--<div class="alert alert-danger display-hide">--> | ||
| 37 | - <!--<button class="close" data-close="alert"></button>--> | ||
| 38 | - <!--您的输入有误,请检查下面的输入项--> | ||
| 39 | - <!--</div>--> | ||
| 40 | - | ||
| 41 | - | ||
| 42 | - <!-- 其他信息放置在这里 --> | ||
| 43 | - <div class="form-body"> | ||
| 44 | - <div class="form-group has-success has-feedback"> | ||
| 45 | - <label class="col-md-2 control-label">线路*:</label> | ||
| 46 | - <div class="col-md-4"> | ||
| 47 | - <input type="text" class="form-control" | ||
| 48 | - name="xl" ng-model="ctrl.ttInfoManageForDetail.xl.name" readonly/> | ||
| 49 | - </div> | ||
| 50 | - </div> | ||
| 51 | - | ||
| 52 | - <div class="form-group has-success has-feedback"> | ||
| 53 | - <label class="col-md-2 control-label">线路走向*:</label> | ||
| 54 | - <div class="col-md-4"> | ||
| 55 | - <sa-Radiogroup model="ctrl.ttInfoManageForDetail.xlDir" dicgroup="LineTrend2" name="xlDir" disabled="true"></sa-Radiogroup> | ||
| 56 | - </div> | ||
| 57 | - </div> | ||
| 58 | - | ||
| 59 | - <div class="form-group has-success has-feedback"> | ||
| 60 | - <label class="col-md-2 control-label">时刻表名字*:</label> | ||
| 61 | - <div class="col-md-4"> | ||
| 62 | - <input type="text" class="form-control" | ||
| 63 | - name="name" ng-model="ctrl.ttInfoManageForDetail.name" readonly/> | ||
| 64 | - </div> | ||
| 65 | - </div> | ||
| 66 | - | ||
| 67 | - <div class="form-group has-success has-feedback"> | ||
| 68 | - <label class="col-md-2 control-label">启用日期*:</label> | ||
| 69 | - <div class="col-md-4"> | ||
| 70 | - <input type="text" class="form-control" | ||
| 71 | - name="qyrq" uib-datepicker-popup="yyyy年MM月dd日" | ||
| 72 | - ng-model="ctrl.ttInfoManageForDetail.qyrq" readonly/> | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - | ||
| 76 | - <div class="form-group has-success has-feedback"> | ||
| 77 | - <label class="col-md-2 control-label">是否启用*:</label> | ||
| 78 | - <div class="col-md-4"> | ||
| 79 | - <sa-Radiogroup model="ctrl.ttInfoManageForDetail.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" disabled="true"></sa-Radiogroup> | ||
| 80 | - </div> | ||
| 81 | - | ||
| 82 | - </div> | ||
| 83 | - | ||
| 84 | - <div class="form-group"> | ||
| 85 | - <label class="col-md-2 control-label">路牌数量:</label> | ||
| 86 | - <div class="col-md-4"> | ||
| 87 | - <input type="number" class="form-control" ng-value="ctrl.ttInfoManageForDetail.lpCount" | ||
| 88 | - name="lpCount" placeholder="请输入路牌数" min="1" readonly/> | ||
| 89 | - </div> | ||
| 90 | - </div> | ||
| 91 | - | ||
| 92 | - <div class="form-group"> | ||
| 93 | - <label class="col-md-2 control-label">营运圈数:</label> | ||
| 94 | - <div class="col-md-4"> | ||
| 95 | - <input type="number" class="form-control" ng-value="ctrl.ttInfoManageForDetail.loopCount" | ||
| 96 | - name="loopCount" placeholder="请输入圈数" min="1" readonly/> | ||
| 97 | - </div> | ||
| 98 | - </div> | ||
| 99 | - | ||
| 100 | - <div class="form-group"> | ||
| 101 | - <label class="col-md-2 control-label">停车场:</label> | ||
| 102 | - <div class="col-md-4"> | ||
| 103 | - <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.xl.carParkCode | dict:'CarPark':'未知' " | ||
| 104 | - name="carParkCode" readonly/> | ||
| 105 | - </div> | ||
| 106 | - </div> | ||
| 107 | - | ||
| 108 | - <div class="form-group"> | ||
| 109 | - <label class="col-md-2 control-label">常规有效日:</label> | ||
| 110 | - <div class="col-md-6"> | ||
| 111 | - <sa-Checkboxgroup model="ctrl.timeTableManageForForm" | ||
| 112 | - name="rule_days" | ||
| 113 | - dcvalue="{{ctrl.ttInfoManageForDetail.rule_days}}" | ||
| 114 | - disabled > | ||
| 115 | - </sa-Checkboxgroup> | ||
| 116 | - </div> | ||
| 117 | - </div> | ||
| 118 | - | ||
| 119 | - <div class="form-group"> | ||
| 120 | - <label class="col-md-2 control-label">特殊有效日:</label> | ||
| 121 | - <div class="col-md-6"> | ||
| 122 | - <sa-Dategroup model="ctrl.ttInfoManageForDetail" | ||
| 123 | - name="special_days" | ||
| 124 | - dcvalue="{{ctrl.timeTableManageForDetail.special_days}}" | ||
| 125 | - disabled | ||
| 126 | - > | ||
| 127 | - </sa-Dategroup> | ||
| 128 | - </div> | ||
| 129 | - </div> | ||
| 130 | - | ||
| 131 | - <!--<div class="form-group">--> | ||
| 132 | - <!--<label class="col-md-2 control-label">备注:</label>--> | ||
| 133 | - <!--</div>--> | ||
| 134 | - | ||
| 135 | - <div class="form-group"> | ||
| 136 | - <label class="col-md-2 control-label">创建人:</label> | ||
| 137 | - <div class="col-md-4"> | ||
| 138 | - <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.createBy.name" | ||
| 139 | - name="createBy" readonly/> | ||
| 140 | - </div> | ||
| 141 | - </div> | ||
| 142 | - | ||
| 143 | - <div class="form-group"> | ||
| 144 | - <label class="col-md-2 control-label">创建时间:</label> | ||
| 145 | - <div class="col-md-4"> | ||
| 146 | - <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForDetail.createDate" | ||
| 147 | - name="createDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss" | ||
| 148 | - readonly/> | ||
| 149 | - </div> | ||
| 150 | - </div> | ||
| 151 | - | ||
| 152 | - <div class="form-group"> | ||
| 153 | - <label class="col-md-2 control-label">更新人:</label> | ||
| 154 | - <div class="col-md-4"> | ||
| 155 | - <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.updateBy.name" | ||
| 156 | - name="updateBy" readonly/> | ||
| 157 | - </div> | ||
| 158 | - </div> | ||
| 159 | - | ||
| 160 | - <div class="form-group"> | ||
| 161 | - <label class="col-md-2 control-label">更新时间:</label> | ||
| 162 | - <div class="col-md-4"> | ||
| 163 | - <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForDetail.updateDate" | ||
| 164 | - name="updateDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss" | ||
| 165 | - readonly/> | ||
| 166 | - </div> | ||
| 167 | - </div> | ||
| 168 | - | ||
| 169 | - <!-- 其他form-group --> | ||
| 170 | - | ||
| 171 | - </div> | ||
| 172 | - | ||
| 173 | - </form> | ||
| 174 | - | ||
| 175 | - </div> | ||
| 176 | - | ||
| 177 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>时刻表管理2</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">时刻表基础信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="TtInfoManageDetailCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase" | ||
| 30 | + ng-bind="ctrl.title"></span> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | + | ||
| 34 | + <div class="portlet-body form"> | ||
| 35 | + <form class="form-horizontal" novalidate name="myForm"> | ||
| 36 | + <!--<div class="alert alert-danger display-hide">--> | ||
| 37 | + <!--<button class="close" data-close="alert"></button>--> | ||
| 38 | + <!--您的输入有误,请检查下面的输入项--> | ||
| 39 | + <!--</div>--> | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + <!-- 其他信息放置在这里 --> | ||
| 43 | + <div class="form-body"> | ||
| 44 | + <div class="form-group has-success has-feedback"> | ||
| 45 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 46 | + <div class="col-md-4"> | ||
| 47 | + <input type="text" class="form-control" | ||
| 48 | + name="xl" ng-model="ctrl.ttInfoManageForDetail.xl.name" readonly/> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + | ||
| 52 | + <div class="form-group has-success has-feedback"> | ||
| 53 | + <label class="col-md-2 control-label">线路走向*:</label> | ||
| 54 | + <div class="col-md-4"> | ||
| 55 | + <sa-Radiogroup model="ctrl.ttInfoManageForDetail.xlDir" dicgroup="LineTrend2" name="xlDir" disabled="true"></sa-Radiogroup> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + | ||
| 59 | + <div class="form-group has-success has-feedback"> | ||
| 60 | + <label class="col-md-2 control-label">时刻表名字*:</label> | ||
| 61 | + <div class="col-md-4"> | ||
| 62 | + <input type="text" class="form-control" | ||
| 63 | + name="name" ng-model="ctrl.ttInfoManageForDetail.name" readonly/> | ||
| 64 | + </div> | ||
| 65 | + </div> | ||
| 66 | + | ||
| 67 | + <div class="form-group has-success has-feedback"> | ||
| 68 | + <label class="col-md-2 control-label">启用日期*:</label> | ||
| 69 | + <div class="col-md-4"> | ||
| 70 | + <input type="text" class="form-control" | ||
| 71 | + name="qyrq" uib-datepicker-popup="yyyy年MM月dd日" | ||
| 72 | + ng-model="ctrl.ttInfoManageForDetail.qyrq" readonly/> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + | ||
| 76 | + <div class="form-group has-success has-feedback"> | ||
| 77 | + <label class="col-md-2 control-label">是否启用*:</label> | ||
| 78 | + <div class="col-md-4"> | ||
| 79 | + <sa-Radiogroup model="ctrl.ttInfoManageForDetail.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" disabled="true"></sa-Radiogroup> | ||
| 80 | + </div> | ||
| 81 | + | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div class="form-group"> | ||
| 85 | + <label class="col-md-2 control-label">路牌数量:</label> | ||
| 86 | + <div class="col-md-4"> | ||
| 87 | + <input type="number" class="form-control" ng-value="ctrl.ttInfoManageForDetail.lpCount" | ||
| 88 | + name="lpCount" placeholder="请输入路牌数" min="1" readonly/> | ||
| 89 | + </div> | ||
| 90 | + </div> | ||
| 91 | + | ||
| 92 | + <div class="form-group"> | ||
| 93 | + <label class="col-md-2 control-label">营运圈数:</label> | ||
| 94 | + <div class="col-md-4"> | ||
| 95 | + <input type="number" class="form-control" ng-value="ctrl.ttInfoManageForDetail.loopCount" | ||
| 96 | + name="loopCount" placeholder="请输入圈数" min="1" readonly/> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + | ||
| 100 | + <div class="form-group"> | ||
| 101 | + <label class="col-md-2 control-label">停车场:</label> | ||
| 102 | + <div class="col-md-4"> | ||
| 103 | + <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.xl.carParkCode | dict:'CarPark':'未知' " | ||
| 104 | + name="carParkCode" readonly/> | ||
| 105 | + </div> | ||
| 106 | + </div> | ||
| 107 | + | ||
| 108 | + <div class="form-group"> | ||
| 109 | + <label class="col-md-2 control-label">常规有效日:</label> | ||
| 110 | + <div class="col-md-6"> | ||
| 111 | + <sa-Checkboxgroup model="ctrl.timeTableManageForForm" | ||
| 112 | + name="rule_days" | ||
| 113 | + dcvalue="{{ctrl.ttInfoManageForDetail.rule_days}}" | ||
| 114 | + disabled > | ||
| 115 | + </sa-Checkboxgroup> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + | ||
| 119 | + <div class="form-group"> | ||
| 120 | + <label class="col-md-2 control-label">特殊有效日:</label> | ||
| 121 | + <div class="col-md-6"> | ||
| 122 | + <sa-Dategroup model="ctrl.ttInfoManageForDetail" | ||
| 123 | + name="special_days" | ||
| 124 | + dcvalue="{{ctrl.timeTableManageForDetail.special_days}}" | ||
| 125 | + disabled | ||
| 126 | + > | ||
| 127 | + </sa-Dategroup> | ||
| 128 | + </div> | ||
| 129 | + </div> | ||
| 130 | + | ||
| 131 | + <!--<div class="form-group">--> | ||
| 132 | + <!--<label class="col-md-2 control-label">备注:</label>--> | ||
| 133 | + <!--</div>--> | ||
| 134 | + | ||
| 135 | + <div class="form-group"> | ||
| 136 | + <label class="col-md-2 control-label">创建人:</label> | ||
| 137 | + <div class="col-md-4"> | ||
| 138 | + <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.createBy.name" | ||
| 139 | + name="createBy" readonly/> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + | ||
| 143 | + <div class="form-group"> | ||
| 144 | + <label class="col-md-2 control-label">创建时间:</label> | ||
| 145 | + <div class="col-md-4"> | ||
| 146 | + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForDetail.createDate" | ||
| 147 | + name="createDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss" | ||
| 148 | + readonly/> | ||
| 149 | + </div> | ||
| 150 | + </div> | ||
| 151 | + | ||
| 152 | + <div class="form-group"> | ||
| 153 | + <label class="col-md-2 control-label">更新人:</label> | ||
| 154 | + <div class="col-md-4"> | ||
| 155 | + <input type="text" class="form-control" ng-value="ctrl.ttInfoManageForDetail.updateBy.name" | ||
| 156 | + name="updateBy" readonly/> | ||
| 157 | + </div> | ||
| 158 | + </div> | ||
| 159 | + | ||
| 160 | + <div class="form-group"> | ||
| 161 | + <label class="col-md-2 control-label">更新时间:</label> | ||
| 162 | + <div class="col-md-4"> | ||
| 163 | + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForDetail.updateDate" | ||
| 164 | + name="updateDate" uib-datepicker-popup="yyyy年MM月dd日 hh:mm:ss" | ||
| 165 | + readonly/> | ||
| 166 | + </div> | ||
| 167 | + </div> | ||
| 168 | + | ||
| 169 | + <!-- 其他form-group --> | ||
| 170 | + | ||
| 171 | + </div> | ||
| 172 | + | ||
| 173 | + </form> | ||
| 174 | + | ||
| 175 | + </div> | ||
| 176 | + | ||
| 177 | + | ||
| 178 | </div> | 178 | </div> |
| 179 | \ No newline at end of file | 179 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/edit.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>时刻表管理2</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">运营计划管理</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">修改时刻表基础信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<div class="portlet light bordered" ng-controller="TtInfoManageFormCtrl as ctrl"> | ||
| 26 | - <div class="portlet-title"> | ||
| 27 | - <div class="caption"> | ||
| 28 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | - class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | - </div> | ||
| 31 | - </div> | ||
| 32 | - | ||
| 33 | - <div class="portlet-body form"> | ||
| 34 | - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | - <!--<div class="alert alert-danger display-hide">--> | ||
| 36 | - <!--<button class="close" data-close="alert"></button>--> | ||
| 37 | - <!--您的输入有误,请检查下面的输入项--> | ||
| 38 | - <!--</div>--> | ||
| 39 | - | ||
| 40 | - | ||
| 41 | - <!-- 其他信息放置在这里 --> | ||
| 42 | - <div class="form-body"> | ||
| 43 | - <div class="form-group has-success has-feedback"> | ||
| 44 | - <label class="col-md-2 control-label">线路*:</label> | ||
| 45 | - <div class="col-md-3"> | ||
| 46 | - <sa-Select5 name="xl" | ||
| 47 | - model="ctrl.ttInfoManageForForm" | ||
| 48 | - cmaps="{'xl.id' : 'id'}" | ||
| 49 | - dcname="xl.id" | ||
| 50 | - icname="id" | ||
| 51 | - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'xl' } | json }}" | ||
| 52 | - iterobjname="item" | ||
| 53 | - iterobjexp="item.name" | ||
| 54 | - searchph="请输拼音..." | ||
| 55 | - searchexp="this.name" | ||
| 56 | - required > | ||
| 57 | - </sa-Select5> | ||
| 58 | - </div> | ||
| 59 | - <!-- 隐藏块,显示验证信息 --> | ||
| 60 | - <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required"> | ||
| 61 | - 线路必须选择 | ||
| 62 | - </div> | ||
| 63 | - </div> | ||
| 64 | - | ||
| 65 | - <div class="form-group has-success has-feedback"> | ||
| 66 | - <label class="col-md-2 control-label">线路走向*:</label> | ||
| 67 | - <div class="col-md-3"> | ||
| 68 | - <sa-Radiogroup model="ctrl.ttInfoManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup> | ||
| 69 | - </div> | ||
| 70 | - <!-- 隐藏块,显示验证信息 --> | ||
| 71 | - <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required"> | ||
| 72 | - 线路走向必须填写 | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - | ||
| 76 | - <div class="form-group has-success has-feedback"> | ||
| 77 | - <label class="col-md-2 control-label">时刻表名字*:</label> | ||
| 78 | - <div class="col-md-3"> | ||
| 79 | - <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForForm.name" | ||
| 80 | - name="name" placeholder="请输入时刻表名字..." required | ||
| 81 | - remote-Validation | ||
| 82 | - remotevtype="ttc1" | ||
| 83 | - remotevparam="{{ {'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'name_eq': ctrl.ttInfoManageForForm.name} | json}}" | ||
| 84 | - /> | ||
| 85 | - </div> | ||
| 86 | - | ||
| 87 | - <!-- 隐藏块,显示验证信息 --> | ||
| 88 | - <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required"> | ||
| 89 | - 时刻表名字必须填写 | ||
| 90 | - </div> | ||
| 91 | - <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote"> | ||
| 92 | - 相同线路下的时刻表不能同名 | ||
| 93 | - </div> | ||
| 94 | - </div> | ||
| 95 | - | ||
| 96 | - <div class="form-group has-success has-feedback"> | ||
| 97 | - <label class="col-md-2 control-label">启用日期*:</label> | ||
| 98 | - <div class="col-md-3"> | ||
| 99 | - <div class="input-group"> | ||
| 100 | - <input type="text" class="form-control" | ||
| 101 | - name="qyrq" placeholder="请选择启用日期..." | ||
| 102 | - uib-datepicker-popup="yyyy年MM月dd日" | ||
| 103 | - is-open="ctrl.qyrqOpen" | ||
| 104 | - ng-model="ctrl.ttInfoManageForForm.qyrq" readonly required/> | ||
| 105 | - <span class="input-group-btn"> | ||
| 106 | - <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | ||
| 107 | - <i class="glyphicon glyphicon-calendar"></i> | ||
| 108 | - </button> | ||
| 109 | - </span> | ||
| 110 | - </div> | ||
| 111 | - </div> | ||
| 112 | - | ||
| 113 | - <!-- 隐藏块,显示验证信息 --> | ||
| 114 | - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required"> | ||
| 115 | - 启用日期必须填写 | ||
| 116 | - </div> | ||
| 117 | - </div> | ||
| 118 | - | ||
| 119 | - <div class="form-group has-success has-feedback"> | ||
| 120 | - <label class="col-md-2 control-label">是否启用*:</label> | ||
| 121 | - <div class="col-md-3"> | ||
| 122 | - <sa-Radiogroup model="ctrl.ttInfoManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup> | ||
| 123 | - </div> | ||
| 124 | - | ||
| 125 | - <!-- 隐藏块,显示验证信息 --> | ||
| 126 | - <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required"> | ||
| 127 | - 是否启用必须选择 | ||
| 128 | - </div> | ||
| 129 | - | ||
| 130 | - </div> | ||
| 131 | - | ||
| 132 | - <div class="form-group"> | ||
| 133 | - <label class="col-md-2 control-label">路牌数量:</label> | ||
| 134 | - <div class="col-md-3"> | ||
| 135 | - <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.lpCount" | ||
| 136 | - name="lpCount" placeholder="请输入路牌数..." min="1"/> | ||
| 137 | - </div> | ||
| 138 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number"> | ||
| 139 | - 必须输入数字 | ||
| 140 | - </div> | ||
| 141 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min"> | ||
| 142 | - 路爬数量必须大于1 | ||
| 143 | - </div> | ||
| 144 | - </div> | ||
| 145 | - | ||
| 146 | - <div class="form-group"> | ||
| 147 | - <label class="col-md-2 control-label">营运圈数:</label> | ||
| 148 | - <div class="col-md-3"> | ||
| 149 | - <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.loopCount" | ||
| 150 | - name="loopCount" placeholder="请输入圈数..." min="1"/> | ||
| 151 | - </div> | ||
| 152 | - <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number"> | ||
| 153 | - 必须输入数字 | ||
| 154 | - </div> | ||
| 155 | - <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min"> | ||
| 156 | - 营运圈数必须大于1 | ||
| 157 | - </div> | ||
| 158 | - </div> | ||
| 159 | - | ||
| 160 | - <div class="form-group"> | ||
| 161 | - <label class="col-md-2 control-label">常规有效日:</label> | ||
| 162 | - <div class="col-md-6"> | ||
| 163 | - <sa-Checkboxgroup model="ctrl.ttInfoManageForForm" | ||
| 164 | - name="rule_days" | ||
| 165 | - dcvalue="{{ctrl.ttInfoManageForForm.rule_days}}" | ||
| 166 | - dcname="rule_days" | ||
| 167 | - required > | ||
| 168 | - </sa-Checkboxgroup> | ||
| 169 | - </div> | ||
| 170 | - <div class="alert alert-danger well-sm" ng-show="myForm.rule_days.$error.required"> | ||
| 171 | - 请操作一下1 | ||
| 172 | - </div> | ||
| 173 | - </div> | ||
| 174 | - | ||
| 175 | - <div class="form-group"> | ||
| 176 | - <label class="col-md-2 control-label">特殊有效日:</label> | ||
| 177 | - <div class="col-md-6"> | ||
| 178 | - <sa-Dategroup model="ctrl.ttInfoManageForForm" | ||
| 179 | - name="special_days" | ||
| 180 | - dcvalue="{{ctrl.ttInfoManageForForm.special_days}}" | ||
| 181 | - dcname="special_days" | ||
| 182 | - > | ||
| 183 | - </sa-Dategroup> | ||
| 184 | - </div> | ||
| 185 | - <div class="alert alert-danger well-sm" ng-show="myForm.special_days.$error.required"> | ||
| 186 | - 请操作一下2 | ||
| 187 | - </div> | ||
| 188 | - </div> | ||
| 189 | - | ||
| 190 | - <!--<div class="form-group">--> | ||
| 191 | - <!--<label class="col-md-2 control-label">备注:</label>--> | ||
| 192 | - <!--</div>--> | ||
| 193 | - | ||
| 194 | - <!-- 其他form-group --> | ||
| 195 | - | ||
| 196 | - </div> | ||
| 197 | - | ||
| 198 | - <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 --> | ||
| 199 | - <div class="form-actions"> | ||
| 200 | - <div class="row"> | ||
| 201 | - <div class="col-md-offset-3 col-md-4"> | ||
| 202 | - <button type="submit" class="btn green" | ||
| 203 | - ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 204 | - <a type="button" class="btn default" ui-sref="ttInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 205 | - </div> | ||
| 206 | - </div> | ||
| 207 | - </div> | ||
| 208 | - | ||
| 209 | - </form> | ||
| 210 | - | ||
| 211 | - </div> | ||
| 212 | - | ||
| 213 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>时刻表管理2</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">修改时刻表基础信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="TtInfoManageFormCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <div class="portlet-body form"> | ||
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | + <!--<div class="alert alert-danger display-hide">--> | ||
| 36 | + <!--<button class="close" data-close="alert"></button>--> | ||
| 37 | + <!--您的输入有误,请检查下面的输入项--> | ||
| 38 | + <!--</div>--> | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + <!-- 其他信息放置在这里 --> | ||
| 42 | + <div class="form-body"> | ||
| 43 | + <div class="form-group has-success has-feedback"> | ||
| 44 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 45 | + <div class="col-md-3"> | ||
| 46 | + <sa-Select5 name="xl" | ||
| 47 | + model="ctrl.ttInfoManageForForm" | ||
| 48 | + cmaps="{'xl.id' : 'id'}" | ||
| 49 | + dcname="xl.id" | ||
| 50 | + icname="id" | ||
| 51 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'xl' } | json }}" | ||
| 52 | + iterobjname="item" | ||
| 53 | + iterobjexp="item.name" | ||
| 54 | + searchph="请输拼音..." | ||
| 55 | + searchexp="this.name" | ||
| 56 | + required > | ||
| 57 | + </sa-Select5> | ||
| 58 | + </div> | ||
| 59 | + <!-- 隐藏块,显示验证信息 --> | ||
| 60 | + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required"> | ||
| 61 | + 线路必须选择 | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + | ||
| 65 | + <div class="form-group has-success has-feedback"> | ||
| 66 | + <label class="col-md-2 control-label">线路走向*:</label> | ||
| 67 | + <div class="col-md-3"> | ||
| 68 | + <sa-Radiogroup model="ctrl.ttInfoManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup> | ||
| 69 | + </div> | ||
| 70 | + <!-- 隐藏块,显示验证信息 --> | ||
| 71 | + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required"> | ||
| 72 | + 线路走向必须填写 | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + | ||
| 76 | + <div class="form-group has-success has-feedback"> | ||
| 77 | + <label class="col-md-2 control-label">时刻表名字*:</label> | ||
| 78 | + <div class="col-md-3"> | ||
| 79 | + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForForm.name" | ||
| 80 | + name="name" placeholder="请输入时刻表名字..." required | ||
| 81 | + remote-Validation | ||
| 82 | + remotevtype="ttc1" | ||
| 83 | + remotevparam="{{ {'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'name_eq': ctrl.ttInfoManageForForm.name} | json}}" | ||
| 84 | + /> | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + <!-- 隐藏块,显示验证信息 --> | ||
| 88 | + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required"> | ||
| 89 | + 时刻表名字必须填写 | ||
| 90 | + </div> | ||
| 91 | + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote"> | ||
| 92 | + 相同线路下的时刻表不能同名 | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + | ||
| 96 | + <div class="form-group has-success has-feedback"> | ||
| 97 | + <label class="col-md-2 control-label">启用日期*:</label> | ||
| 98 | + <div class="col-md-3"> | ||
| 99 | + <div class="input-group"> | ||
| 100 | + <input type="text" class="form-control" | ||
| 101 | + name="qyrq" placeholder="请选择启用日期..." | ||
| 102 | + uib-datepicker-popup="yyyy年MM月dd日" | ||
| 103 | + is-open="ctrl.qyrqOpen" | ||
| 104 | + ng-model="ctrl.ttInfoManageForForm.qyrq" readonly required/> | ||
| 105 | + <span class="input-group-btn"> | ||
| 106 | + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | ||
| 107 | + <i class="glyphicon glyphicon-calendar"></i> | ||
| 108 | + </button> | ||
| 109 | + </span> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + | ||
| 113 | + <!-- 隐藏块,显示验证信息 --> | ||
| 114 | + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required"> | ||
| 115 | + 启用日期必须填写 | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + | ||
| 119 | + <div class="form-group has-success has-feedback"> | ||
| 120 | + <label class="col-md-2 control-label">是否启用*:</label> | ||
| 121 | + <div class="col-md-3"> | ||
| 122 | + <sa-Radiogroup model="ctrl.ttInfoManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup> | ||
| 123 | + </div> | ||
| 124 | + | ||
| 125 | + <!-- 隐藏块,显示验证信息 --> | ||
| 126 | + <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required"> | ||
| 127 | + 是否启用必须选择 | ||
| 128 | + </div> | ||
| 129 | + | ||
| 130 | + </div> | ||
| 131 | + | ||
| 132 | + <div class="form-group"> | ||
| 133 | + <label class="col-md-2 control-label">路牌数量:</label> | ||
| 134 | + <div class="col-md-3"> | ||
| 135 | + <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.lpCount" | ||
| 136 | + name="lpCount" placeholder="请输入路牌数..." min="1"/> | ||
| 137 | + </div> | ||
| 138 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number"> | ||
| 139 | + 必须输入数字 | ||
| 140 | + </div> | ||
| 141 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min"> | ||
| 142 | + 路爬数量必须大于1 | ||
| 143 | + </div> | ||
| 144 | + </div> | ||
| 145 | + | ||
| 146 | + <div class="form-group"> | ||
| 147 | + <label class="col-md-2 control-label">营运圈数:</label> | ||
| 148 | + <div class="col-md-3"> | ||
| 149 | + <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.loopCount" | ||
| 150 | + name="loopCount" placeholder="请输入圈数..." min="1"/> | ||
| 151 | + </div> | ||
| 152 | + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number"> | ||
| 153 | + 必须输入数字 | ||
| 154 | + </div> | ||
| 155 | + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min"> | ||
| 156 | + 营运圈数必须大于1 | ||
| 157 | + </div> | ||
| 158 | + </div> | ||
| 159 | + | ||
| 160 | + <div class="form-group"> | ||
| 161 | + <label class="col-md-2 control-label">常规有效日:</label> | ||
| 162 | + <div class="col-md-6"> | ||
| 163 | + <sa-Checkboxgroup model="ctrl.ttInfoManageForForm" | ||
| 164 | + name="rule_days" | ||
| 165 | + dcvalue="{{ctrl.ttInfoManageForForm.rule_days}}" | ||
| 166 | + dcname="rule_days" | ||
| 167 | + required > | ||
| 168 | + </sa-Checkboxgroup> | ||
| 169 | + </div> | ||
| 170 | + <div class="alert alert-danger well-sm" ng-show="myForm.rule_days.$error.required"> | ||
| 171 | + 请操作一下1 | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + | ||
| 175 | + <div class="form-group"> | ||
| 176 | + <label class="col-md-2 control-label">特殊有效日:</label> | ||
| 177 | + <div class="col-md-6"> | ||
| 178 | + <sa-Dategroup model="ctrl.ttInfoManageForForm" | ||
| 179 | + name="special_days" | ||
| 180 | + dcvalue="{{ctrl.ttInfoManageForForm.special_days}}" | ||
| 181 | + dcname="special_days" | ||
| 182 | + > | ||
| 183 | + </sa-Dategroup> | ||
| 184 | + </div> | ||
| 185 | + <div class="alert alert-danger well-sm" ng-show="myForm.special_days.$error.required"> | ||
| 186 | + 请操作一下2 | ||
| 187 | + </div> | ||
| 188 | + </div> | ||
| 189 | + | ||
| 190 | + <!--<div class="form-group">--> | ||
| 191 | + <!--<label class="col-md-2 control-label">备注:</label>--> | ||
| 192 | + <!--</div>--> | ||
| 193 | + | ||
| 194 | + <!-- 其他form-group --> | ||
| 195 | + | ||
| 196 | + </div> | ||
| 197 | + | ||
| 198 | + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 --> | ||
| 199 | + <div class="form-actions"> | ||
| 200 | + <div class="row"> | ||
| 201 | + <div class="col-md-offset-3 col-md-4"> | ||
| 202 | + <button type="submit" class="btn green" | ||
| 203 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 204 | + <a type="button" class="btn default" ui-sref="ttInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 205 | + </div> | ||
| 206 | + </div> | ||
| 207 | + </div> | ||
| 208 | + | ||
| 209 | + </form> | ||
| 210 | + | ||
| 211 | + </div> | ||
| 212 | + | ||
| 213 | + | ||
| 214 | </div> | 214 | </div> |
| 215 | \ No newline at end of file | 215 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/form.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>时刻表管理2</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">运营计划管理</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">添加时刻表基础信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<div class="portlet light bordered" ng-controller="TtInfoManageFormCtrl as ctrl"> | ||
| 26 | - <div class="portlet-title"> | ||
| 27 | - <div class="caption"> | ||
| 28 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | - class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | - </div> | ||
| 31 | - </div> | ||
| 32 | - | ||
| 33 | - <div class="portlet-body form"> | ||
| 34 | - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | - <!--<div class="alert alert-danger display-hide">--> | ||
| 36 | - <!--<button class="close" data-close="alert"></button>--> | ||
| 37 | - <!--您的输入有误,请检查下面的输入项--> | ||
| 38 | - <!--</div>--> | ||
| 39 | - | ||
| 40 | - | ||
| 41 | - <!-- 其他信息放置在这里 --> | ||
| 42 | - <div class="form-body"> | ||
| 43 | - <div class="form-group has-success has-feedback"> | ||
| 44 | - <label class="col-md-2 control-label">线路*:</label> | ||
| 45 | - <div class="col-md-3"> | ||
| 46 | - <sa-Select5 name="xl" | ||
| 47 | - model="ctrl.ttInfoManageForForm" | ||
| 48 | - cmaps="{'xl.id' : 'id'}" | ||
| 49 | - dcname="xl.id" | ||
| 50 | - icname="id" | ||
| 51 | - dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'xl' } | json }}" | ||
| 52 | - iterobjname="item" | ||
| 53 | - iterobjexp="item.name" | ||
| 54 | - searchph="请输拼音..." | ||
| 55 | - searchexp="this.name" | ||
| 56 | - required > | ||
| 57 | - </sa-Select5> | ||
| 58 | - </div> | ||
| 59 | - <!-- 隐藏块,显示验证信息 --> | ||
| 60 | - <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required"> | ||
| 61 | - 线路必须选择 | ||
| 62 | - </div> | ||
| 63 | - </div> | ||
| 64 | - | ||
| 65 | - <div class="form-group has-success has-feedback"> | ||
| 66 | - <label class="col-md-2 control-label">线路走向*:</label> | ||
| 67 | - <div class="col-md-3"> | ||
| 68 | - <sa-Radiogroup model="ctrl.ttInfoManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup> | ||
| 69 | - </div> | ||
| 70 | - <!-- 隐藏块,显示验证信息 --> | ||
| 71 | - <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required"> | ||
| 72 | - 线路走向必须填写 | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - | ||
| 76 | - <div class="form-group has-success has-feedback"> | ||
| 77 | - <label class="col-md-2 control-label">时刻表名字*:</label> | ||
| 78 | - <div class="col-md-3"> | ||
| 79 | - <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForForm.name" | ||
| 80 | - name="name" placeholder="请输入时刻表名字..." required | ||
| 81 | - remote-Validation | ||
| 82 | - remotevtype="ttc1" | ||
| 83 | - remotevparam="{{ {'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'name_eq': ctrl.ttInfoManageForForm.name} | json}}" | ||
| 84 | - /> | ||
| 85 | - </div> | ||
| 86 | - | ||
| 87 | - <!-- 隐藏块,显示验证信息 --> | ||
| 88 | - <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required"> | ||
| 89 | - 时刻表名字必须填写 | ||
| 90 | - </div> | ||
| 91 | - <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote"> | ||
| 92 | - 相同线路下的时刻表不能同名 | ||
| 93 | - </div> | ||
| 94 | - </div> | ||
| 95 | - | ||
| 96 | - <div class="form-group has-success has-feedback"> | ||
| 97 | - <label class="col-md-2 control-label">启用日期*:</label> | ||
| 98 | - <div class="col-md-3"> | ||
| 99 | - <div class="input-group"> | ||
| 100 | - <input type="text" class="form-control" | ||
| 101 | - name="qyrq" placeholder="请选择启用日期..." | ||
| 102 | - uib-datepicker-popup="yyyy年MM月dd日" | ||
| 103 | - is-open="ctrl.qyrqOpen" | ||
| 104 | - ng-model="ctrl.ttInfoManageForForm.qyrq" readonly required/> | ||
| 105 | - <span class="input-group-btn"> | ||
| 106 | - <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | ||
| 107 | - <i class="glyphicon glyphicon-calendar"></i> | ||
| 108 | - </button> | ||
| 109 | - </span> | ||
| 110 | - </div> | ||
| 111 | - </div> | ||
| 112 | - | ||
| 113 | - <!-- 隐藏块,显示验证信息 --> | ||
| 114 | - <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required"> | ||
| 115 | - 启用日期必须填写 | ||
| 116 | - </div> | ||
| 117 | - </div> | ||
| 118 | - | ||
| 119 | - <div class="form-group has-success has-feedback"> | ||
| 120 | - <label class="col-md-2 control-label">是否启用*:</label> | ||
| 121 | - <div class="col-md-3"> | ||
| 122 | - <sa-Radiogroup model="ctrl.ttInfoManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup> | ||
| 123 | - </div> | ||
| 124 | - | ||
| 125 | - <!-- 隐藏块,显示验证信息 --> | ||
| 126 | - <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required"> | ||
| 127 | - 是否启用必须选择 | ||
| 128 | - </div> | ||
| 129 | - | ||
| 130 | - </div> | ||
| 131 | - | ||
| 132 | - <div class="form-group"> | ||
| 133 | - <label class="col-md-2 control-label">路牌数量:</label> | ||
| 134 | - <div class="col-md-3"> | ||
| 135 | - <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.lpCount" | ||
| 136 | - name="lpCount" placeholder="请输入路牌数..." min="1"/> | ||
| 137 | - </div> | ||
| 138 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number"> | ||
| 139 | - 必须输入数字 | ||
| 140 | - </div> | ||
| 141 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min"> | ||
| 142 | - 路爬数量必须大于1 | ||
| 143 | - </div> | ||
| 144 | - </div> | ||
| 145 | - | ||
| 146 | - <div class="form-group"> | ||
| 147 | - <label class="col-md-2 control-label">营运圈数:</label> | ||
| 148 | - <div class="col-md-3"> | ||
| 149 | - <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.loopCount" | ||
| 150 | - name="loopCount" placeholder="请输入圈数..." min="1"/> | ||
| 151 | - </div> | ||
| 152 | - <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number"> | ||
| 153 | - 必须输入数字 | ||
| 154 | - </div> | ||
| 155 | - <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min"> | ||
| 156 | - 营运圈数必须大于1 | ||
| 157 | - </div> | ||
| 158 | - </div> | ||
| 159 | - | ||
| 160 | - <div class="form-group"> | ||
| 161 | - <label class="col-md-2 control-label">常规有效日:</label> | ||
| 162 | - <div class="col-md-6"> | ||
| 163 | - <sa-Checkboxgroup model="ctrl.ttInfoManageForForm" | ||
| 164 | - name="rule_days" | ||
| 165 | - dcvalue="{{ctrl.ttInfoManageForForm.rule_days}}" | ||
| 166 | - dcname="rule_days" | ||
| 167 | - required > | ||
| 168 | - </sa-Checkboxgroup> | ||
| 169 | - </div> | ||
| 170 | - <div class="alert alert-danger well-sm" ng-show="myForm.rule_days.$error.required"> | ||
| 171 | - 请操作一下1 | ||
| 172 | - </div> | ||
| 173 | - </div> | ||
| 174 | - | ||
| 175 | - <div class="form-group"> | ||
| 176 | - <label class="col-md-2 control-label">特殊有效日:</label> | ||
| 177 | - <div class="col-md-6"> | ||
| 178 | - <sa-Dategroup model="ctrl.ttInfoManageForForm" | ||
| 179 | - name="special_days" | ||
| 180 | - dcvalue="{{ctrl.ttInfoManageForForm.special_days}}" | ||
| 181 | - dcname="special_days" | ||
| 182 | - > | ||
| 183 | - </sa-Dategroup> | ||
| 184 | - </div> | ||
| 185 | - <div class="alert alert-danger well-sm" ng-show="myForm.special_days.$error.required"> | ||
| 186 | - 请操作一下2 | ||
| 187 | - </div> | ||
| 188 | - </div> | ||
| 189 | - | ||
| 190 | - <!--<div class="form-group">--> | ||
| 191 | - <!--<label class="col-md-2 control-label">备注:</label>--> | ||
| 192 | - <!--</div>--> | ||
| 193 | - | ||
| 194 | - <!-- 其他form-group --> | ||
| 195 | - | ||
| 196 | - </div> | ||
| 197 | - | ||
| 198 | - <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 --> | ||
| 199 | - <div class="form-actions"> | ||
| 200 | - <div class="row"> | ||
| 201 | - <div class="col-md-offset-3 col-md-4"> | ||
| 202 | - <button type="submit" class="btn green" | ||
| 203 | - ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 204 | - <a type="button" class="btn default" ui-sref="ttInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 205 | - </div> | ||
| 206 | - </div> | ||
| 207 | - </div> | ||
| 208 | - | ||
| 209 | - </form> | ||
| 210 | - | ||
| 211 | - </div> | ||
| 212 | - | ||
| 213 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>时刻表管理2</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="ttInfoManage">时刻表管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">添加时刻表基础信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="TtInfoManageFormCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <div class="portlet-body form"> | ||
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | + <!--<div class="alert alert-danger display-hide">--> | ||
| 36 | + <!--<button class="close" data-close="alert"></button>--> | ||
| 37 | + <!--您的输入有误,请检查下面的输入项--> | ||
| 38 | + <!--</div>--> | ||
| 39 | + | ||
| 40 | + | ||
| 41 | + <!-- 其他信息放置在这里 --> | ||
| 42 | + <div class="form-body"> | ||
| 43 | + <div class="form-group has-success has-feedback"> | ||
| 44 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 45 | + <div class="col-md-3"> | ||
| 46 | + <sa-Select5 name="xl" | ||
| 47 | + model="ctrl.ttInfoManageForForm" | ||
| 48 | + cmaps="{'xl.id' : 'id'}" | ||
| 49 | + dcname="xl.id" | ||
| 50 | + icname="id" | ||
| 51 | + dsparams="{{ {type: 'ajax', param:{type: 'all'}, atype:'xl' } | json }}" | ||
| 52 | + iterobjname="item" | ||
| 53 | + iterobjexp="item.name" | ||
| 54 | + searchph="请输拼音..." | ||
| 55 | + searchexp="this.name" | ||
| 56 | + required > | ||
| 57 | + </sa-Select5> | ||
| 58 | + </div> | ||
| 59 | + <!-- 隐藏块,显示验证信息 --> | ||
| 60 | + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required"> | ||
| 61 | + 线路必须选择 | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + | ||
| 65 | + <div class="form-group has-success has-feedback"> | ||
| 66 | + <label class="col-md-2 control-label">线路走向*:</label> | ||
| 67 | + <div class="col-md-3"> | ||
| 68 | + <sa-Radiogroup model="ctrl.ttInfoManageForForm.xlDir" dicgroup="LineTrend2" name="xlDir" required></sa-Radiogroup> | ||
| 69 | + </div> | ||
| 70 | + <!-- 隐藏块,显示验证信息 --> | ||
| 71 | + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required"> | ||
| 72 | + 线路走向必须填写 | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + | ||
| 76 | + <div class="form-group has-success has-feedback"> | ||
| 77 | + <label class="col-md-2 control-label">时刻表名字*:</label> | ||
| 78 | + <div class="col-md-3"> | ||
| 79 | + <input type="text" class="form-control" ng-model="ctrl.ttInfoManageForForm.name" | ||
| 80 | + name="name" placeholder="请输入时刻表名字..." required | ||
| 81 | + remote-Validation | ||
| 82 | + remotevtype="ttc1" | ||
| 83 | + remotevparam="{{ {'xl.id_eq': ctrl.ttInfoManageForForm.xl.id, 'name_eq': ctrl.ttInfoManageForForm.name} | json}}" | ||
| 84 | + /> | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + <!-- 隐藏块,显示验证信息 --> | ||
| 88 | + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.required"> | ||
| 89 | + 时刻表名字必须填写 | ||
| 90 | + </div> | ||
| 91 | + <div class="alert alert-danger well-sm" ng-show="myForm.name.$error.remote"> | ||
| 92 | + 相同线路下的时刻表不能同名 | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + | ||
| 96 | + <div class="form-group has-success has-feedback"> | ||
| 97 | + <label class="col-md-2 control-label">启用日期*:</label> | ||
| 98 | + <div class="col-md-3"> | ||
| 99 | + <div class="input-group"> | ||
| 100 | + <input type="text" class="form-control" | ||
| 101 | + name="qyrq" placeholder="请选择启用日期..." | ||
| 102 | + uib-datepicker-popup="yyyy年MM月dd日" | ||
| 103 | + is-open="ctrl.qyrqOpen" | ||
| 104 | + ng-model="ctrl.ttInfoManageForForm.qyrq" readonly required/> | ||
| 105 | + <span class="input-group-btn"> | ||
| 106 | + <button type="button" class="btn btn-default" ng-click="ctrl.qyrq_open()"> | ||
| 107 | + <i class="glyphicon glyphicon-calendar"></i> | ||
| 108 | + </button> | ||
| 109 | + </span> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + | ||
| 113 | + <!-- 隐藏块,显示验证信息 --> | ||
| 114 | + <div class="alert alert-danger well-sm" ng-show="myForm.qyrq.$error.required"> | ||
| 115 | + 启用日期必须填写 | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + | ||
| 119 | + <div class="form-group has-success has-feedback"> | ||
| 120 | + <label class="col-md-2 control-label">是否启用*:</label> | ||
| 121 | + <div class="col-md-3"> | ||
| 122 | + <sa-Radiogroup model="ctrl.ttInfoManageForForm.isEnableDisTemplate" dicgroup="truefalseType" name="isEnableDisTemplate" required></sa-Radiogroup> | ||
| 123 | + </div> | ||
| 124 | + | ||
| 125 | + <!-- 隐藏块,显示验证信息 --> | ||
| 126 | + <div class="alert alert-danger well-sm" ng-show="myForm.isEnableDisTemplate.$error.required"> | ||
| 127 | + 是否启用必须选择 | ||
| 128 | + </div> | ||
| 129 | + | ||
| 130 | + </div> | ||
| 131 | + | ||
| 132 | + <div class="form-group"> | ||
| 133 | + <label class="col-md-2 control-label">路牌数量:</label> | ||
| 134 | + <div class="col-md-3"> | ||
| 135 | + <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.lpCount" | ||
| 136 | + name="lpCount" placeholder="请输入路牌数..." min="1"/> | ||
| 137 | + </div> | ||
| 138 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.number"> | ||
| 139 | + 必须输入数字 | ||
| 140 | + </div> | ||
| 141 | + <div class="alert alert-danger well-sm" ng-show="myForm.lpCount.$error.min"> | ||
| 142 | + 路爬数量必须大于1 | ||
| 143 | + </div> | ||
| 144 | + </div> | ||
| 145 | + | ||
| 146 | + <div class="form-group"> | ||
| 147 | + <label class="col-md-2 control-label">营运圈数:</label> | ||
| 148 | + <div class="col-md-3"> | ||
| 149 | + <input type="number" class="form-control" ng-model="ctrl.ttInfoManageForForm.loopCount" | ||
| 150 | + name="loopCount" placeholder="请输入圈数..." min="1"/> | ||
| 151 | + </div> | ||
| 152 | + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.number"> | ||
| 153 | + 必须输入数字 | ||
| 154 | + </div> | ||
| 155 | + <div class="alert alert-danger well-sm" ng-show="myForm.loopCount.$error.min"> | ||
| 156 | + 营运圈数必须大于1 | ||
| 157 | + </div> | ||
| 158 | + </div> | ||
| 159 | + | ||
| 160 | + <div class="form-group"> | ||
| 161 | + <label class="col-md-2 control-label">常规有效日:</label> | ||
| 162 | + <div class="col-md-6"> | ||
| 163 | + <sa-Checkboxgroup model="ctrl.ttInfoManageForForm" | ||
| 164 | + name="rule_days" | ||
| 165 | + dcvalue="{{ctrl.ttInfoManageForForm.rule_days}}" | ||
| 166 | + dcname="rule_days" | ||
| 167 | + required > | ||
| 168 | + </sa-Checkboxgroup> | ||
| 169 | + </div> | ||
| 170 | + <div class="alert alert-danger well-sm" ng-show="myForm.rule_days.$error.required"> | ||
| 171 | + 请操作一下1 | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + | ||
| 175 | + <div class="form-group"> | ||
| 176 | + <label class="col-md-2 control-label">特殊有效日:</label> | ||
| 177 | + <div class="col-md-6"> | ||
| 178 | + <sa-Dategroup model="ctrl.ttInfoManageForForm" | ||
| 179 | + name="special_days" | ||
| 180 | + dcvalue="{{ctrl.ttInfoManageForForm.special_days}}" | ||
| 181 | + dcname="special_days" | ||
| 182 | + > | ||
| 183 | + </sa-Dategroup> | ||
| 184 | + </div> | ||
| 185 | + <div class="alert alert-danger well-sm" ng-show="myForm.special_days.$error.required"> | ||
| 186 | + 请操作一下2 | ||
| 187 | + </div> | ||
| 188 | + </div> | ||
| 189 | + | ||
| 190 | + <!--<div class="form-group">--> | ||
| 191 | + <!--<label class="col-md-2 control-label">备注:</label>--> | ||
| 192 | + <!--</div>--> | ||
| 193 | + | ||
| 194 | + <!-- 其他form-group --> | ||
| 195 | + | ||
| 196 | + </div> | ||
| 197 | + | ||
| 198 | + <!-- TODO:!myForm.$valid 在这里有点问题,改用以下方法验证 --> | ||
| 199 | + <div class="form-actions"> | ||
| 200 | + <div class="row"> | ||
| 201 | + <div class="col-md-offset-3 col-md-4"> | ||
| 202 | + <button type="submit" class="btn green" | ||
| 203 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 204 | + <a type="button" class="btn default" ui-sref="ttInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 205 | + </div> | ||
| 206 | + </div> | ||
| 207 | + </div> | ||
| 208 | + | ||
| 209 | + </form> | ||
| 210 | + | ||
| 211 | + </div> | ||
| 212 | + | ||
| 213 | + | ||
| 214 | </div> | 214 | </div> |
| 215 | \ No newline at end of file | 215 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/index.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>时刻表管理2</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">运营计划管理</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <span class="active">时刻表管理</span> | ||
| 18 | - </li> | ||
| 19 | -</ul> | ||
| 20 | - | ||
| 21 | -<div class="row"> | ||
| 22 | - <div class="col-md-12" ng-controller="TtInfoManageIndexCtrl as ctrl"> | ||
| 23 | - <div class="portlet light bordered"> | ||
| 24 | - <div class="portlet-title"> | ||
| 25 | - <div class="caption font-dark"> | ||
| 26 | - <i class="fa fa-database font-dark"></i> | ||
| 27 | - <span class="caption-subject bold uppercase">时刻表</span> | ||
| 28 | - </div> | ||
| 29 | - <div class="actions"> | ||
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> | ||
| 31 | - <i class="fa fa-plus"></i> | ||
| 32 | - 添加时刻表 | ||
| 33 | - </a> | ||
| 34 | - | ||
| 35 | - </div> | ||
| 36 | - </div> | ||
| 37 | - | ||
| 38 | - <div class="portlet-body"> | ||
| 39 | - <div ui-view="ttInfoManage_list"></div> | ||
| 40 | - </div> | ||
| 41 | - </div> | ||
| 42 | - </div> | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>时刻表管理2</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">运营计划管理</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <span class="active">时刻表管理</span> | ||
| 18 | + </li> | ||
| 19 | +</ul> | ||
| 20 | + | ||
| 21 | +<div class="row"> | ||
| 22 | + <div class="col-md-12" ng-controller="TtInfoManageIndexCtrl as ctrl"> | ||
| 23 | + <div class="portlet light bordered"> | ||
| 24 | + <div class="portlet-title"> | ||
| 25 | + <div class="caption font-dark"> | ||
| 26 | + <i class="fa fa-database font-dark"></i> | ||
| 27 | + <span class="caption-subject bold uppercase">时刻表</span> | ||
| 28 | + </div> | ||
| 29 | + <div class="actions"> | ||
| 30 | + <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> | ||
| 31 | + <i class="fa fa-plus"></i> | ||
| 32 | + 添加时刻表 | ||
| 33 | + </a> | ||
| 34 | + | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + | ||
| 38 | + <div class="portlet-body"> | ||
| 39 | + <div ui-view="ttInfoManage_list"></div> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | </div> | 43 | </div> |
| 44 | \ No newline at end of file | 44 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
| 1 | -<!-- ui-route employeeInfoManage.list --> | ||
| 2 | -<div ng-controller="TtInfoManageListCtrl as ctrl"> | ||
| 3 | - <div class="fixDiv"> | ||
| 4 | - <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 5 | - <thead> | ||
| 6 | - <tr role="row" class="heading"> | ||
| 7 | - <th style="width: 50px;">序号</th> | ||
| 8 | - <th style="width: 150px;">线路</th> | ||
| 9 | - <th style="width: 180px;">时刻表名称</th> | ||
| 10 | - <th style="width: 100px">路牌数/圈数</th> | ||
| 11 | - <th style="width: 80px">上下行</th> | ||
| 12 | - <th style="width: 50px;">启用</th> | ||
| 13 | - <th style="width: 120px">启用日期</th> | ||
| 14 | - <th style="width: 50%">时刻表明细</th> | ||
| 15 | - <th style="width: 50%">操作</th> | ||
| 16 | - </tr> | ||
| 17 | - <tr role="row" class="filter"> | ||
| 18 | - <td></td> | ||
| 19 | - <td> | ||
| 20 | - <sa-Select3 model="ctrl.searchCondition()" | ||
| 21 | - name="xl" | ||
| 22 | - placeholder="请输拼音..." | ||
| 23 | - dcvalue="{{ctrl.searchCondition()['xl.id_eq']}}" | ||
| 24 | - dcname="xl.id_eq" | ||
| 25 | - icname="id" | ||
| 26 | - icnames="name" | ||
| 27 | - datatype="xl"> | ||
| 28 | - </sa-Select3> | ||
| 29 | - </td> | ||
| 30 | - <td> | ||
| 31 | - <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().name_like" placeholder="输入时刻表名称..."/> | ||
| 32 | - </td> | ||
| 33 | - <td></td> | ||
| 34 | - <td></td> | ||
| 35 | - <td></td> | ||
| 36 | - <td></td> | ||
| 37 | - <td></td> | ||
| 38 | - <td> | ||
| 39 | - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 40 | - ng-click="ctrl.doPage()"> | ||
| 41 | - <i class="fa fa-search"></i> 搜索</button> | ||
| 42 | - | ||
| 43 | - <button class="btn btn-sm red btn-outline filter-cancel" | ||
| 44 | - ng-click="ctrl.reset()"> | ||
| 45 | - <i class="fa fa-times"></i> 重置</button> | ||
| 46 | - </td> | ||
| 47 | - </tr> | ||
| 48 | - | ||
| 49 | - </thead> | ||
| 50 | - <tbody> | ||
| 51 | - <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> | ||
| 52 | - <td> | ||
| 53 | - <span ng-bind="$index + 1"></span> | ||
| 54 | - </td> | ||
| 55 | - <td> | ||
| 56 | - <span ng-bind="info.xl.name"></span> | ||
| 57 | - </td> | ||
| 58 | - <td> | ||
| 59 | - <span ng-bind="info.name" title="{{info.name}}"></span> | ||
| 60 | - </td> | ||
| 61 | - <td> | ||
| 62 | - <span ng-bind="info.lpCount"></span> | ||
| 63 | - / | ||
| 64 | - <span ng-bind="info.loopCount"></span> | ||
| 65 | - </td> | ||
| 66 | - <td> | ||
| 67 | - <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span> | ||
| 68 | - </td> | ||
| 69 | - <td> | ||
| 70 | - <span ng-bind="info.isEnableDisTemplate | dict:'truefalseType':'未知' "></span> | ||
| 71 | - </td> | ||
| 72 | - <td> | ||
| 73 | - <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> | ||
| 74 | - </td> | ||
| 75 | - <td> | ||
| 76 | - <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | ||
| 77 | - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> | ||
| 78 | - <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | ||
| 79 | - class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 导入 </a> | ||
| 80 | - <a href="javascript:" class="btn btn-info btn-sm"> 导出 </a> | ||
| 81 | - </td> | ||
| 82 | - <td> | ||
| 83 | - <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | ||
| 84 | - <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | ||
| 85 | - <a ui-sref="ttInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> | ||
| 86 | - <a ui-sref="ttInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> | ||
| 87 | - <a ng-click="ctrl.toggleTtinfo(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> | ||
| 88 | - <a ng-click="ctrl.toggleTtinfo(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | ||
| 89 | - </td> | ||
| 90 | - </tr> | ||
| 91 | - </tbody> | ||
| 92 | - </table> | ||
| 93 | - </div> | ||
| 94 | - | ||
| 95 | - <div style="text-align: right;"> | ||
| 96 | - <uib-pagination total-items="ctrl.page()['totalElements']" | ||
| 97 | - ng-model="ctrl.page()['uiNumber']" | ||
| 98 | - ng-change="ctrl.doPage()" | ||
| 99 | - rotate="false" | ||
| 100 | - max-size="10" | ||
| 101 | - boundary-links="true" | ||
| 102 | - first-text="首页" | ||
| 103 | - previous-text="上一页" | ||
| 104 | - next-text="下一页" | ||
| 105 | - last-text="尾页"> | ||
| 106 | - </uib-pagination> | ||
| 107 | - </div> | 1 | +<!-- ui-route employeeInfoManage.list --> |
| 2 | +<div ng-controller="TtInfoManageListCtrl as ctrl"> | ||
| 3 | + <div class="fixDiv"> | ||
| 4 | + <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 5 | + <thead> | ||
| 6 | + <tr role="row" class="heading"> | ||
| 7 | + <th style="width: 50px;">序号</th> | ||
| 8 | + <th style="width: 150px;">线路</th> | ||
| 9 | + <th style="width: 180px;">时刻表名称</th> | ||
| 10 | + <th style="width: 100px">路牌数/圈数</th> | ||
| 11 | + <th style="width: 80px">上下行</th> | ||
| 12 | + <th style="width: 50px;">启用</th> | ||
| 13 | + <th style="width: 120px">启用日期</th> | ||
| 14 | + <th style="width: 50%">时刻表明细</th> | ||
| 15 | + <th style="width: 50%">操作</th> | ||
| 16 | + </tr> | ||
| 17 | + <tr role="row" class="filter"> | ||
| 18 | + <td></td> | ||
| 19 | + <td> | ||
| 20 | + <sa-Select3 model="ctrl.searchCondition()" | ||
| 21 | + name="xl" | ||
| 22 | + placeholder="请输拼音..." | ||
| 23 | + dcvalue="{{ctrl.searchCondition()['xl.id_eq']}}" | ||
| 24 | + dcname="xl.id_eq" | ||
| 25 | + icname="id" | ||
| 26 | + icnames="name" | ||
| 27 | + datatype="xl"> | ||
| 28 | + </sa-Select3> | ||
| 29 | + </td> | ||
| 30 | + <td> | ||
| 31 | + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().name_like" placeholder="输入时刻表名称..."/> | ||
| 32 | + </td> | ||
| 33 | + <td></td> | ||
| 34 | + <td></td> | ||
| 35 | + <td></td> | ||
| 36 | + <td></td> | ||
| 37 | + <td></td> | ||
| 38 | + <td> | ||
| 39 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 40 | + ng-click="ctrl.doPage()"> | ||
| 41 | + <i class="fa fa-search"></i> 搜索</button> | ||
| 42 | + | ||
| 43 | + <button class="btn btn-sm red btn-outline filter-cancel" | ||
| 44 | + ng-click="ctrl.reset()"> | ||
| 45 | + <i class="fa fa-times"></i> 重置</button> | ||
| 46 | + </td> | ||
| 47 | + </tr> | ||
| 48 | + | ||
| 49 | + </thead> | ||
| 50 | + <tbody> | ||
| 51 | + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> | ||
| 52 | + <td> | ||
| 53 | + <span ng-bind="$index + 1"></span> | ||
| 54 | + </td> | ||
| 55 | + <td> | ||
| 56 | + <span ng-bind="info.xl.name"></span> | ||
| 57 | + </td> | ||
| 58 | + <td> | ||
| 59 | + <span ng-bind="info.name" title="{{info.name}}"></span> | ||
| 60 | + </td> | ||
| 61 | + <td> | ||
| 62 | + <span ng-bind="info.lpCount"></span> | ||
| 63 | + / | ||
| 64 | + <span ng-bind="info.loopCount"></span> | ||
| 65 | + </td> | ||
| 66 | + <td> | ||
| 67 | + <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span> | ||
| 68 | + </td> | ||
| 69 | + <td> | ||
| 70 | + <span ng-bind="info.isEnableDisTemplate | dict:'truefalseType':'未知' "></span> | ||
| 71 | + </td> | ||
| 72 | + <td> | ||
| 73 | + <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> | ||
| 74 | + </td> | ||
| 75 | + <td> | ||
| 76 | + <a ui-sref="ttInfoDetailManage_edit({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | ||
| 77 | + class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> | ||
| 78 | + <a ui-sref="ttInfoDetailManage_form({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" | ||
| 79 | + class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 导入 </a> | ||
| 80 | + <a href="javascript:" class="btn btn-info btn-sm"> 导出 </a> | ||
| 81 | + </td> | ||
| 82 | + <td> | ||
| 83 | + <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> | ||
| 84 | + <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | ||
| 85 | + <a ui-sref="ttInfoManage_detail({id: info.id})" class="btn btn-info btn-sm"> 详细 </a> | ||
| 86 | + <a ui-sref="ttInfoManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a> | ||
| 87 | + <a ng-click="ctrl.toggleTtinfo(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a> | ||
| 88 | + <a ng-click="ctrl.toggleTtinfo(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a> | ||
| 89 | + </td> | ||
| 90 | + </tr> | ||
| 91 | + </tbody> | ||
| 92 | + </table> | ||
| 93 | + </div> | ||
| 94 | + | ||
| 95 | + <div style="text-align: right;"> | ||
| 96 | + <uib-pagination total-items="ctrl.page()['totalElements']" | ||
| 97 | + ng-model="ctrl.page()['uiNumber']" | ||
| 98 | + ng-change="ctrl.doPage()" | ||
| 99 | + rotate="false" | ||
| 100 | + max-size="10" | ||
| 101 | + boundary-links="true" | ||
| 102 | + first-text="首页" | ||
| 103 | + previous-text="上一页" | ||
| 104 | + next-text="下一页" | ||
| 105 | + last-text="尾页"> | ||
| 106 | + </uib-pagination> | ||
| 107 | + </div> | ||
| 108 | </div> | 108 | </div> |
| 109 | \ No newline at end of file | 109 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/main.js
| 1 | -// 时刻表管理service,包装外部定义的globalservice,并保存一定的操作状态 | ||
| 2 | -angular.module('ScheduleApp').factory( | ||
| 3 | - 'TtInfoManageService', | ||
| 4 | - [ | ||
| 5 | - 'TimeTableManageService_g', | ||
| 6 | - function(service) { | ||
| 7 | - // 当前查询的内容条件搜索对象 | ||
| 8 | - var currentSearchCondition = {page: 0}; | ||
| 9 | - // 当前查询返回的信息 | ||
| 10 | - var currentPage = { // 后台spring data返回的格式 | ||
| 11 | - totalElements: 0, | ||
| 12 | - number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 13 | - content: [], | ||
| 14 | - | ||
| 15 | - uiNumber: 1 // 页面绑定的页码 | ||
| 16 | - }; | ||
| 17 | - | ||
| 18 | - // 查询对象类 | ||
| 19 | - var queryClass = service.rest; | ||
| 20 | - | ||
| 21 | - return { | ||
| 22 | - getTtInfoQueryClass: function() { | ||
| 23 | - return queryClass; | ||
| 24 | - }, | ||
| 25 | - getSearchCondition: function() { | ||
| 26 | - currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 27 | - return currentSearchCondition; | ||
| 28 | - }, | ||
| 29 | - getPage: function(page) { | ||
| 30 | - if (page) { | ||
| 31 | - currentPage.totalElements = page.totalElements; | ||
| 32 | - currentPage.number = page.number; | ||
| 33 | - currentPage.content = page.content; | ||
| 34 | - } | ||
| 35 | - return currentPage; | ||
| 36 | - }, | ||
| 37 | - resetStatus: function() { | ||
| 38 | - currentSearchCondition = {page: 0}; | ||
| 39 | - currentPage = { | ||
| 40 | - totalElements: 0, | ||
| 41 | - number: 0, | ||
| 42 | - content: [], | ||
| 43 | - uiNumber: 1 | ||
| 44 | - }; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 49 | - // TODO: | ||
| 50 | - } | ||
| 51 | - } | ||
| 52 | - ] | ||
| 53 | -); | ||
| 54 | - | ||
| 55 | -// index.html控制器 | ||
| 56 | -angular.module('ScheduleApp').controller( | ||
| 57 | - 'TtInfoManageIndexCtrl', | ||
| 58 | - [ | ||
| 59 | - '$state', | ||
| 60 | - function($state) { | ||
| 61 | - var self = this; | ||
| 62 | - | ||
| 63 | - // 切换到时刻表form界面 | ||
| 64 | - self.toTtInfoManageForm = function() { | ||
| 65 | - $state.go('ttInfoManage_form'); | ||
| 66 | - } | ||
| 67 | - } | ||
| 68 | - ] | ||
| 69 | -); | ||
| 70 | - | ||
| 71 | -// list.html控制器 | ||
| 72 | -angular.module('ScheduleApp').controller( | ||
| 73 | - 'TtInfoManageListCtrl', | ||
| 74 | - [ | ||
| 75 | - 'TtInfoManageService', | ||
| 76 | - function(service) { | ||
| 77 | - var self = this; | ||
| 78 | - var TtInfo = service.getTtInfoQueryClass(); | ||
| 79 | - | ||
| 80 | - self.page = function() { | ||
| 81 | - return service.getPage(); | ||
| 82 | - }; | ||
| 83 | - | ||
| 84 | - self.searchCondition = function() { | ||
| 85 | - return service.getSearchCondition(); | ||
| 86 | - }; | ||
| 87 | - | ||
| 88 | - self.doPage = function() { | ||
| 89 | - var page = TtInfo.list(self.searchCondition(), function() { | ||
| 90 | - service.getPage(page); | ||
| 91 | - }); | ||
| 92 | - }; | ||
| 93 | - self.reset = function() { | ||
| 94 | - service.resetStatus(); | ||
| 95 | - var page = TtInfo.list(self.searchCondition(), function() { | ||
| 96 | - service.getPage(page); | ||
| 97 | - }); | ||
| 98 | - }; | ||
| 99 | - self.toggleTtinfo = function(id) { | ||
| 100 | - TtInfo.delete({id: id}, function(result) { | ||
| 101 | - if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 102 | - alert("失败:" + result.message); | ||
| 103 | - } else { | ||
| 104 | - self.doPage(); | ||
| 105 | - } | ||
| 106 | - }); | ||
| 107 | - }; | ||
| 108 | - | ||
| 109 | - self.doPage(); | ||
| 110 | - | ||
| 111 | - // TODO: | ||
| 112 | - } | ||
| 113 | - ] | ||
| 114 | -); | ||
| 115 | - | ||
| 116 | -// form.html控制器 | ||
| 117 | -angular.module('ScheduleApp').controller( | ||
| 118 | - 'TtInfoManageFormCtrl', | ||
| 119 | - [ | ||
| 120 | - 'TtInfoManageService', | ||
| 121 | - '$stateParams', | ||
| 122 | - '$state', | ||
| 123 | - function(service, $stateParams, $state) { | ||
| 124 | - var self = this; | ||
| 125 | - var TtInfo = service.getTtInfoQueryClass(); | ||
| 126 | - | ||
| 127 | - // 启用日期 日期控件开关 | ||
| 128 | - self.qyrqOpen = false; | ||
| 129 | - self.qyrq_open = function() { | ||
| 130 | - self.qyrqOpen = true; | ||
| 131 | - }; | ||
| 132 | - | ||
| 133 | - // 欲保存的表单信息,双向绑定 | ||
| 134 | - self.ttInfoManageForForm = new TtInfo; | ||
| 135 | - self.ttInfoManageForForm.xl = {}; | ||
| 136 | - | ||
| 137 | - // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值 | ||
| 138 | - var id = $stateParams.id; | ||
| 139 | - if (id) { | ||
| 140 | - TtInfo.get({id: id}, function(value) { | ||
| 141 | - self.ttInfoManageForForm = value; | ||
| 142 | - }); | ||
| 143 | - } | ||
| 144 | - // form提交方法 | ||
| 145 | - self.submit = function() { | ||
| 146 | - self.ttInfoManageForForm.$save(function() { | ||
| 147 | - $state.go("ttInfoManage"); | ||
| 148 | - }); | ||
| 149 | - }; | ||
| 150 | - } | ||
| 151 | - ] | ||
| 152 | -); | ||
| 153 | - | ||
| 154 | -// detail.html控制器 | ||
| 155 | -angular.module('ScheduleApp').controller( | ||
| 156 | - 'TtInfoManageDetailCtrl', | ||
| 157 | - [ | ||
| 158 | - 'TtInfoManageService', | ||
| 159 | - '$stateParams', | ||
| 160 | - function(service, $stateParams) { | ||
| 161 | - var self = this; | ||
| 162 | - var TtInfo = service.getTtInfoQueryClass(); | ||
| 163 | - var id = $stateParams.id; | ||
| 164 | - | ||
| 165 | - self.title = ""; | ||
| 166 | - self.ttInfoManageForDetail = {}; | ||
| 167 | - | ||
| 168 | - TtInfo.get({id: id}, function(value) { | ||
| 169 | - self.ttInfoManageForDetail = value; | ||
| 170 | - self.title = self.ttInfoManageForDetail.xl.name + | ||
| 171 | - "(" + | ||
| 172 | - self.ttInfoManageForDetail.name + | ||
| 173 | - ")" + | ||
| 174 | - "时刻表基础信息"; | ||
| 175 | - }); | ||
| 176 | - } | ||
| 177 | - ] | 1 | +// 时刻表管理service,包装外部定义的globalservice,并保存一定的操作状态 |
| 2 | +angular.module('ScheduleApp').factory( | ||
| 3 | + 'TtInfoManageService', | ||
| 4 | + [ | ||
| 5 | + 'TimeTableManageService_g', | ||
| 6 | + function(service) { | ||
| 7 | + // 当前查询的内容条件搜索对象 | ||
| 8 | + var currentSearchCondition = {page: 0}; | ||
| 9 | + // 当前查询返回的信息 | ||
| 10 | + var currentPage = { // 后台spring data返回的格式 | ||
| 11 | + totalElements: 0, | ||
| 12 | + number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 13 | + content: [], | ||
| 14 | + | ||
| 15 | + uiNumber: 1 // 页面绑定的页码 | ||
| 16 | + }; | ||
| 17 | + | ||
| 18 | + // 查询对象类 | ||
| 19 | + var queryClass = service.rest; | ||
| 20 | + | ||
| 21 | + return { | ||
| 22 | + getTtInfoQueryClass: function() { | ||
| 23 | + return queryClass; | ||
| 24 | + }, | ||
| 25 | + getSearchCondition: function() { | ||
| 26 | + currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 27 | + return currentSearchCondition; | ||
| 28 | + }, | ||
| 29 | + getPage: function(page) { | ||
| 30 | + if (page) { | ||
| 31 | + currentPage.totalElements = page.totalElements; | ||
| 32 | + currentPage.number = page.number; | ||
| 33 | + currentPage.content = page.content; | ||
| 34 | + } | ||
| 35 | + return currentPage; | ||
| 36 | + }, | ||
| 37 | + resetStatus: function() { | ||
| 38 | + currentSearchCondition = {page: 0}; | ||
| 39 | + currentPage = { | ||
| 40 | + totalElements: 0, | ||
| 41 | + number: 0, | ||
| 42 | + content: [], | ||
| 43 | + uiNumber: 1 | ||
| 44 | + }; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 49 | + // TODO: | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + ] | ||
| 53 | +); | ||
| 54 | + | ||
| 55 | +// index.html控制器 | ||
| 56 | +angular.module('ScheduleApp').controller( | ||
| 57 | + 'TtInfoManageIndexCtrl', | ||
| 58 | + [ | ||
| 59 | + '$state', | ||
| 60 | + function($state) { | ||
| 61 | + var self = this; | ||
| 62 | + | ||
| 63 | + // 切换到时刻表form界面 | ||
| 64 | + self.toTtInfoManageForm = function() { | ||
| 65 | + $state.go('ttInfoManage_form'); | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | + ] | ||
| 69 | +); | ||
| 70 | + | ||
| 71 | +// list.html控制器 | ||
| 72 | +angular.module('ScheduleApp').controller( | ||
| 73 | + 'TtInfoManageListCtrl', | ||
| 74 | + [ | ||
| 75 | + 'TtInfoManageService', | ||
| 76 | + function(service) { | ||
| 77 | + var self = this; | ||
| 78 | + var TtInfo = service.getTtInfoQueryClass(); | ||
| 79 | + | ||
| 80 | + self.page = function() { | ||
| 81 | + return service.getPage(); | ||
| 82 | + }; | ||
| 83 | + | ||
| 84 | + self.searchCondition = function() { | ||
| 85 | + return service.getSearchCondition(); | ||
| 86 | + }; | ||
| 87 | + | ||
| 88 | + self.doPage = function() { | ||
| 89 | + var page = TtInfo.list(self.searchCondition(), function() { | ||
| 90 | + service.getPage(page); | ||
| 91 | + }); | ||
| 92 | + }; | ||
| 93 | + self.reset = function() { | ||
| 94 | + service.resetStatus(); | ||
| 95 | + var page = TtInfo.list(self.searchCondition(), function() { | ||
| 96 | + service.getPage(page); | ||
| 97 | + }); | ||
| 98 | + }; | ||
| 99 | + self.toggleTtinfo = function(id) { | ||
| 100 | + TtInfo.delete({id: id}, function(result) { | ||
| 101 | + if (result.message) { // 暂时这样做,之后全局拦截 | ||
| 102 | + alert("失败:" + result.message); | ||
| 103 | + } else { | ||
| 104 | + self.doPage(); | ||
| 105 | + } | ||
| 106 | + }); | ||
| 107 | + }; | ||
| 108 | + | ||
| 109 | + self.doPage(); | ||
| 110 | + | ||
| 111 | + // TODO: | ||
| 112 | + } | ||
| 113 | + ] | ||
| 114 | +); | ||
| 115 | + | ||
| 116 | +// form.html控制器 | ||
| 117 | +angular.module('ScheduleApp').controller( | ||
| 118 | + 'TtInfoManageFormCtrl', | ||
| 119 | + [ | ||
| 120 | + 'TtInfoManageService', | ||
| 121 | + '$stateParams', | ||
| 122 | + '$state', | ||
| 123 | + function(service, $stateParams, $state) { | ||
| 124 | + var self = this; | ||
| 125 | + var TtInfo = service.getTtInfoQueryClass(); | ||
| 126 | + | ||
| 127 | + // 启用日期 日期控件开关 | ||
| 128 | + self.qyrqOpen = false; | ||
| 129 | + self.qyrq_open = function() { | ||
| 130 | + self.qyrqOpen = true; | ||
| 131 | + }; | ||
| 132 | + | ||
| 133 | + // 欲保存的表单信息,双向绑定 | ||
| 134 | + self.ttInfoManageForForm = new TtInfo; | ||
| 135 | + self.ttInfoManageForForm.xl = {}; | ||
| 136 | + | ||
| 137 | + // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值 | ||
| 138 | + var id = $stateParams.id; | ||
| 139 | + if (id) { | ||
| 140 | + TtInfo.get({id: id}, function(value) { | ||
| 141 | + self.ttInfoManageForForm = value; | ||
| 142 | + }); | ||
| 143 | + } | ||
| 144 | + // form提交方法 | ||
| 145 | + self.submit = function() { | ||
| 146 | + self.ttInfoManageForForm.$save(function() { | ||
| 147 | + $state.go("ttInfoManage"); | ||
| 148 | + }); | ||
| 149 | + }; | ||
| 150 | + } | ||
| 151 | + ] | ||
| 152 | +); | ||
| 153 | + | ||
| 154 | +// detail.html控制器 | ||
| 155 | +angular.module('ScheduleApp').controller( | ||
| 156 | + 'TtInfoManageDetailCtrl', | ||
| 157 | + [ | ||
| 158 | + 'TtInfoManageService', | ||
| 159 | + '$stateParams', | ||
| 160 | + function(service, $stateParams) { | ||
| 161 | + var self = this; | ||
| 162 | + var TtInfo = service.getTtInfoQueryClass(); | ||
| 163 | + var id = $stateParams.id; | ||
| 164 | + | ||
| 165 | + self.title = ""; | ||
| 166 | + self.ttInfoManageForDetail = {}; | ||
| 167 | + | ||
| 168 | + TtInfo.get({id: id}, function(value) { | ||
| 169 | + self.ttInfoManageForDetail = value; | ||
| 170 | + self.title = self.ttInfoManageForDetail.xl.name + | ||
| 171 | + "(" + | ||
| 172 | + self.ttInfoManageForDetail.name + | ||
| 173 | + ")" + | ||
| 174 | + "时刻表基础信息"; | ||
| 175 | + }); | ||
| 176 | + } | ||
| 177 | + ] | ||
| 178 | ); | 178 | ); |
| 179 | \ No newline at end of file | 179 | \ No newline at end of file |
src/main/resources/static/real_control_v2/assets/echarts-3/echarts.js
0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/css/ct_table.css
| @@ -30,6 +30,7 @@ | @@ -30,6 +30,7 @@ | ||
| 30 | 30 | ||
| 31 | .ct_table>.ct_table_body { | 31 | .ct_table>.ct_table_body { |
| 32 | width: 100%; | 32 | width: 100%; |
| 33 | + border-bottom: 1px solid #dedede; | ||
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | .ct_table dl { | 36 | .ct_table dl { |
| @@ -79,7 +80,8 @@ | @@ -79,7 +80,8 @@ | ||
| 79 | .ct_table dl dd, .ct_table dl dt { | 80 | .ct_table dl dd, .ct_table dl dt { |
| 80 | border-right-color: #dedede; | 81 | border-right-color: #dedede; |
| 81 | font-size: 13px; | 82 | font-size: 13px; |
| 82 | - border-bottom: 1px solid #dedede; | 83 | + /*border-bottom: 1px solid #dedede;*/ |
| 84 | + border-top: 1px solid #dedede; | ||
| 83 | } | 85 | } |
| 84 | 86 | ||
| 85 | dl.ct_row_active, .ct_table>.ct_table_body dl.ct_row_active:hover { | 87 | dl.ct_row_active, .ct_table>.ct_table_body dl.ct_row_active:hover { |
src/main/resources/static/real_control_v2/css/line_schedule.css
| @@ -55,6 +55,12 @@ | @@ -55,6 +55,12 @@ | ||
| 55 | padding: 0; | 55 | padding: 0; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | +.line_schedule .schedule-wrap i.uk-icon-question-circle{ | ||
| 59 | + cursor: pointer; | ||
| 60 | + font-size: 14px; | ||
| 61 | + color: #cccaca; | ||
| 62 | +} | ||
| 63 | + | ||
| 58 | .line_schedule .schedule-wrap h3 { | 64 | .line_schedule .schedule-wrap h3 { |
| 59 | margin: 7px 0 5px; | 65 | margin: 7px 0 5px; |
| 60 | text-indent: 5px; | 66 | text-indent: 5px; |
| @@ -236,23 +242,40 @@ span.fcsj-diff { | @@ -236,23 +242,40 @@ span.fcsj-diff { | ||
| 236 | 242 | ||
| 237 | /** 图例 */ | 243 | /** 图例 */ |
| 238 | 244 | ||
| 239 | -dd.tl-yzx { | 245 | +.tl-yzx { |
| 240 | background: #c1ddf0; | 246 | background: #c1ddf0; |
| 241 | - border-bottom: 0 !important; | ||
| 242 | - border-top: 1px solid #f5f5f5; | 247 | + border-top: 1px solid #ebebeb !important; |
| 248 | +} | ||
| 249 | + | ||
| 250 | +.tl-xxfc{ | ||
| 251 | + background: #ff7878; | ||
| 252 | + color: #f1f1f1; | ||
| 253 | +} | ||
| 254 | + | ||
| 255 | +.tl-wd{ | ||
| 256 | + background: #e2e2a0; | ||
| 243 | } | 257 | } |
| 244 | 258 | ||
| 245 | -dd.tl-qrlb { | 259 | +.tl-xxsd{ |
| 260 | + background: #e2de94; | ||
| 261 | +} | ||
| 262 | + | ||
| 263 | +.tl-xxrd{ | ||
| 264 | + background: #c1ddf0; | ||
| 265 | + border-top: 1px solid #ebebeb !important; | ||
| 266 | +} | ||
| 267 | + | ||
| 268 | +.tl-qrlb { | ||
| 246 | background: #7B6B24; | 269 | background: #7B6B24; |
| 247 | color: #EAEBEC; | 270 | color: #EAEBEC; |
| 248 | font-size: 13px; | 271 | font-size: 13px; |
| 249 | } | 272 | } |
| 250 | 273 | ||
| 251 | -dd.tl-qrlb::before { | 274 | +.tl-qrlb::before { |
| 252 | content: '烂班'; | 275 | content: '烂班'; |
| 253 | } | 276 | } |
| 254 | 277 | ||
| 255 | -dd.tl-zzzx { | 278 | +.tl-zzzx { |
| 256 | background: #96F396; | 279 | background: #96F396; |
| 257 | } | 280 | } |
| 258 | 281 | ||
| @@ -760,3 +783,37 @@ input.i-cbox[type=checkbox]{ | @@ -760,3 +783,37 @@ input.i-cbox[type=checkbox]{ | ||
| 760 | font-size: 12px; | 783 | font-size: 12px; |
| 761 | color: #cecece; | 784 | color: #cecece; |
| 762 | } | 785 | } |
| 786 | +.device_event_str{ | ||
| 787 | + font-size: 10px; | ||
| 788 | + color: #bdbdbd; | ||
| 789 | + margin-left: 3px; | ||
| 790 | +} | ||
| 791 | + | ||
| 792 | + | ||
| 793 | +.tl-tip-panel{ | ||
| 794 | + padding: 3px; | ||
| 795 | +} | ||
| 796 | + | ||
| 797 | +.tl-tip-panel .ct_title{ | ||
| 798 | + display: inline-block; | ||
| 799 | + width: 42px; | ||
| 800 | + vertical-align: top; | ||
| 801 | + margin-top: 5px; | ||
| 802 | + color: grey; | ||
| 803 | + font-family: 微软雅黑; | ||
| 804 | + margin: 5px 0 0 3px; | ||
| 805 | +} | ||
| 806 | +.tl-tip-panel span{ | ||
| 807 | + display: inline-block; | ||
| 808 | + font-size: 11px; | ||
| 809 | + width: 60px; | ||
| 810 | + height: 21px; | ||
| 811 | + line-height: 21px; | ||
| 812 | + text-align: center; | ||
| 813 | + margin: 3px 1px; | ||
| 814 | + border-radius: 3px; | ||
| 815 | +} | ||
| 816 | + | ||
| 817 | +.qtip.sch-tl-tip{ | ||
| 818 | + max-width: 335px; | ||
| 819 | +} | ||
| 763 | \ No newline at end of file | 820 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/main.css
| @@ -70,6 +70,10 @@ table.ct-fixed-table { | @@ -70,6 +70,10 @@ table.ct-fixed-table { | ||
| 70 | table-layout: fixed; | 70 | table-layout: fixed; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | +table.ct-fixed-table tr.context-menu-active{ | ||
| 74 | + background: #f0f0f0; | ||
| 75 | +} | ||
| 76 | + | ||
| 73 | table.ct-fixed-table.uk-table tr td { | 77 | table.ct-fixed-table.uk-table tr td { |
| 74 | white-space: nowrap; | 78 | white-space: nowrap; |
| 75 | overflow: hidden; | 79 | overflow: hidden; |
src/main/resources/static/real_control_v2/css/north.css
| @@ -70,3 +70,27 @@ | @@ -70,3 +70,27 @@ | ||
| 70 | #north_toolbar_panel li.disabled a{ | 70 | #north_toolbar_panel li.disabled a{ |
| 71 | cursor: no-drop !important; | 71 | cursor: no-drop !important; |
| 72 | } | 72 | } |
| 73 | + | ||
| 74 | +.load-panel{ | ||
| 75 | + position: absolute; | ||
| 76 | + top: 50%; | ||
| 77 | + left: 50%; | ||
| 78 | + margin-top: -20px; | ||
| 79 | + margin-left: -76px; | ||
| 80 | + font-size: 18px; | ||
| 81 | + display: none; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.uk-dropdown.dropdown-column-2{ | ||
| 85 | + width: 336px; | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +#north_toolbar_panel li.event a i{ | ||
| 89 | + margin-right: 4px; | ||
| 90 | + color: #b4b2b2; | ||
| 91 | + font-size: 12px; | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | +#north_toolbar_panel li.event a:hover i{ | ||
| 95 | + color: #e9e4e4; | ||
| 96 | +} | ||
| 73 | \ No newline at end of file | 97 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/home/layout.html
src/main/resources/static/real_control_v2/fragments/home/line_panel.html
| @@ -25,15 +25,15 @@ | @@ -25,15 +25,15 @@ | ||
| 25 | </script> | 25 | </script> |
| 26 | 26 | ||
| 27 | <script id="home-gps-tbody-temp" type="text/html"> | 27 | <script id="home-gps-tbody-temp" type="text/html"> |
| 28 | - <dl id="home_gps_{{deviceId}}" data-device-id="{{deviceId}}"> | ||
| 29 | - <dd title="{{nbbm}}"><a>{{nbbm}}</a></dd> | ||
| 30 | - <dd>{{speed}}</dd> | ||
| 31 | - <dd>{{expectStopTime}}</dd> | ||
| 32 | - <dd title="{{stationName}}">{{stationName}}</dd> | ||
| 33 | - <dd>东川路地铁站</dd> | ||
| 34 | - <dd>14:25</dd> | ||
| 35 | - <dd>张三</dd> | ||
| 36 | - <dd></dd> | ||
| 37 | - </dl> | ||
| 38 | - </script> | 28 | + <dl id="home_gps_{{deviceId}}" data-device-id="{{deviceId}}"> |
| 29 | + <dd title="{{nbbm}}"><a>{{nbbm}}</a></dd> | ||
| 30 | + <dd>{{speed}}</dd> | ||
| 31 | + <dd>{{expectStopTime}}</dd> | ||
| 32 | + <dd title="{{stationName}}">{{stationName}}</dd> | ||
| 33 | + <dd></dd> | ||
| 34 | + <dd></dd> | ||
| 35 | + <dd></dd> | ||
| 36 | + <dd></dd> | ||
| 37 | + </dl> | ||
| 38 | +</script> | ||
| 39 | </div> | 39 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
| @@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ | ||
| 90 | <div class="uk-grid"> | 90 | <div class="uk-grid"> |
| 91 | <div class="uk-width-1-2"> | 91 | <div class="uk-width-1-2"> |
| 92 | <div class="uk-form-row"> | 92 | <div class="uk-form-row"> |
| 93 | - <label class="uk-form-label">驾驶员 <i class="uk-icon-question-circle" data-uk-tooltip title="如果有驾驶员未提示,请至后台“基础信息 -人员信息”里纠正该员工的“工种”类别 "></i></label> | 93 | + <label class="uk-form-label">驾驶员 <!--<i class="uk-icon-question-circle" data-uk-tooltip title="如果有驾驶员未提示,请至后台“基础信息 -人员信息”里纠正该员工的“工种”类别 "></i>--></label> |
| 94 | <div class="uk-form-controls"> | 94 | <div class="uk-form-controls"> |
| 95 | <div class="uk-autocomplete uk-form jsy-autocom"> | 95 | <div class="uk-autocomplete uk-form jsy-autocom"> |
| 96 | <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | 96 | <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
| @@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
| 61 | <div class="uk-width-1-1"> | 61 | <div class="uk-width-1-1"> |
| 62 | <div class="uk-form-row ct-stacked"> | 62 | <div class="uk-form-row ct-stacked"> |
| 63 | <div class="uk-form-controls" style="margin-top: 5px;"> | 63 | <div class="uk-form-controls" style="margin-top: 5px;"> |
| 64 | - <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="烂班说明,不超过20个字符"></textarea> | 64 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="烂班说明,不超过20个字符。非必填"></textarea> |
| 65 | </div> | 65 | </div> |
| 66 | </div> | 66 | </div> |
| 67 | </div> | 67 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | <div class="uk-form-row ct-stacked"> | 54 | <div class="uk-form-row ct-stacked"> |
| 55 | <label class="uk-form-label" for="form-s-t">调整说明<small class="font-danger">(不超过20个字符)</small></label> | 55 | <label class="uk-form-label" for="form-s-t">调整说明<small class="font-danger">(不超过20个字符)</small></label> |
| 56 | <div class="uk-form-controls"> | 56 | <div class="uk-form-controls"> |
| 57 | - <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="20"></textarea> | 57 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="不超过20个字符。非必填"></textarea> |
| 58 | </div> | 58 | </div> |
| 59 | </div> | 59 | </div> |
| 60 | </div> | 60 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
| @@ -2,26 +2,43 @@ | @@ -2,26 +2,43 @@ | ||
| 2 | <!-- line schedule tab body layout template --> | 2 | <!-- line schedule tab body layout template --> |
| 3 | <script id="cont-line-layout-temp" type="text/html"> | 3 | <script id="cont-line-layout-temp" type="text/html"> |
| 4 | <div class="uk-grid top-container"> | 4 | <div class="uk-grid top-container"> |
| 5 | - <div class="uk-width-5-6 uk-grid schedule-wrap" > | 5 | + <div class="uk-width-5-6 uk-grid schedule-wrap"> |
| 6 | <div class="uk-width-1-2"> | 6 | <div class="uk-width-1-2"> |
| 7 | <div class="card-panel"></div> | 7 | <div class="card-panel"></div> |
| 8 | - </div> | ||
| 9 | - | ||
| 10 | - <div class="uk-width-1-2"> | ||
| 11 | - <div class="card-panel"></div> | ||
| 12 | - </div> | ||
| 13 | </div> | 8 | </div> |
| 14 | - <div class="uk-width-1-6" style="height: calc(100% - 1px);"> | ||
| 15 | - <div class="card-panel sys-mailbox" style="overflow: auto;"> | ||
| 16 | 9 | ||
| 17 | - </div> | 10 | + <div class="uk-width-1-2"> |
| 11 | + <div class="card-panel"></div> | ||
| 18 | </div> | 12 | </div> |
| 19 | </div> | 13 | </div> |
| 14 | + <div class="uk-width-1-6" style="height: calc(100% - 1px);"> | ||
| 15 | + <div class="card-panel sys-mailbox" style="overflow: auto;"> | ||
| 20 | 16 | ||
| 21 | - <div class="footer-chart"> | ||
| 22 | - <div class="card-panel"> | ||
| 23 | - <div class="svg-wrap"></div> | ||
| 24 | </div> | 17 | </div> |
| 25 | </div> | 18 | </div> |
| 19 | + </div> | ||
| 20 | + | ||
| 21 | + <div class="footer-chart"> | ||
| 22 | + <div class="card-panel"> | ||
| 23 | + <div class="svg-wrap"></div> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + </script> | ||
| 27 | + | ||
| 28 | + <script id="sch-table-top-help-temp" type="text/html"> | ||
| 29 | + <div class="tl-tip-panel"> | ||
| 30 | + <div class="ct_title"> | ||
| 31 | + 图例 | ||
| 32 | + </div> | ||
| 33 | + <div style="display: inline-block;width: calc(100% - 50px)"> | ||
| 34 | + <span class="tl-wd">误点</span> | ||
| 35 | + <span class="tl-zzzx">正在执行</span> | ||
| 36 | + <span class="tl-qrlb"></span> | ||
| 37 | + <span class="tl-yzx">已执行</span> | ||
| 38 | + <span class="tl-xxfc">消息发出</span> | ||
| 39 | + <span class="tl-xxsd">消息收到</span> | ||
| 40 | + <span class="tl-xxrd">消息阅读</span> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 26 | </script> | 43 | </script> |
| 27 | - </div> | 44 | +</div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | {{else}} | 7 | {{else}} |
| 8 | 下行/{{line.endStationName}} | 8 | 下行/{{line.endStationName}} |
| 9 | {{/if}} | 9 | {{/if}} |
| 10 | + <i class="uk-icon-question-circle" ></i> | ||
| 10 | <div class="search_sch_panel"> | 11 | <div class="search_sch_panel"> |
| 11 | <form class="uk-form" onsubmit="javascript:return false;"> | 12 | <form class="uk-form" onsubmit="javascript:return false;"> |
| 12 | <div class="uk-autocomplete sch-search-autocom"> | 13 | <div class="uk-autocomplete sch-search-autocom"> |
| @@ -40,7 +41,10 @@ | @@ -40,7 +41,10 @@ | ||
| 40 | <dl data-id="{{sch.id}}" > | 41 | <dl data-id="{{sch.id}}" > |
| 41 | <dd class="seq_no">{{i + 1}}</dd> | 42 | <dd class="seq_no">{{i + 1}}</dd> |
| 42 | <dd class="lpName"><a>{{sch.lpName}}</a></dd> | 43 | <dd class="lpName"><a>{{sch.lpName}}</a></dd> |
| 43 | - <dd data-nbbm="{{sch.clZbh}}">{{sch.clZbh}}</dd> | 44 | + <dd data-nbbm="{{sch.clZbh}}" |
| 45 | + class="{{if sch.directiveState == 60}}tl-xxfc{{else if sch.directiveState == 100}}tl-xxsd{{else if sch.directiveState == 200}}tl-xxrd{{/if}}"> | ||
| 46 | + {{sch.clZbh}} | ||
| 47 | + </dd> | ||
| 44 | <dd>{{sch.qdzArrDateJH}}</dd> | 48 | <dd>{{sch.qdzArrDateJH}}</dd> |
| 45 | <dd>{{sch.qdzArrDateSJ}}</dd> | 49 | <dd>{{sch.qdzArrDateSJ}}</dd> |
| 46 | <dd data-sort-val={{sch.fcsjT}}> | 50 | <dd data-sort-val={{sch.fcsjT}}> |
| @@ -65,6 +69,8 @@ | @@ -65,6 +69,8 @@ | ||
| 65 | tl-yzx | 69 | tl-yzx |
| 66 | {{else if sch.status==1}} | 70 | {{else if sch.status==1}} |
| 67 | tl-zzzx | 71 | tl-zzzx |
| 72 | + {{else if sch.status == 0 && sch.late}} | ||
| 73 | + tl-wd | ||
| 68 | {{/if}}"> | 74 | {{/if}}"> |
| 69 | {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | 75 | {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> |
| 70 | </dd> | 76 | </dd> |
| @@ -99,14 +105,23 @@ | @@ -99,14 +105,23 @@ | ||
| 99 | 105 | ||
| 100 | <script id="line-schedule-sfsj-temp" type="text/html"> | 106 | <script id="line-schedule-sfsj-temp" type="text/html"> |
| 101 | <dd class=" | 107 | <dd class=" |
| 102 | - {{if status==-1}} | ||
| 103 | - tl-qrlb | ||
| 104 | - {{else if status==2}} | ||
| 105 | - tl-yzx | ||
| 106 | - {{else if status==1}} | ||
| 107 | - tl-zzzx | ||
| 108 | - {{/if}}"> | 108 | +{{if sch.status==-1}} |
| 109 | + tl-qrlb | ||
| 110 | +{{else if sch.status==2}} | ||
| 111 | + tl-yzx | ||
| 112 | +{{else if sch.status==1}} | ||
| 113 | + tl-zzzx | ||
| 114 | +{{else if sch.status == 0 && sch.late}} | ||
| 115 | + tl-wd | ||
| 116 | +{{/if}}"> | ||
| 109 | {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | 117 | {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> |
| 110 | </dd> | 118 | </dd> |
| 111 | </script> | 119 | </script> |
| 120 | + | ||
| 121 | + <script id="line-schedule-nbbm-temp" type="text/html"> | ||
| 122 | + <dd data-nbbm="{{clZbh}}" | ||
| 123 | + class="{{if directiveState == 60}}tl-xxfc{{else if directiveState == 100}}tl-xxsd{{else if directiveState == 200}}tl-xxrd{{/if}}"> | ||
| 124 | + {{clZbh}} | ||
| 125 | + </dd> | ||
| 126 | + </script> | ||
| 112 | </div> | 127 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/sys_mailbox.html
| 1 | <div> | 1 | <div> |
| 2 | <script id="sys-note-80-temp" type="text/html"> | 2 | <script id="sys-note-80-temp" type="text/html"> |
| 3 | - <div class="uk-width-medium-1-1 sys-note-80" data-id={{id}}> | 3 | + <div class="uk-width-medium-1-1 sys-note-80 sys-mail-item" data-id={{id}}> |
| 4 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> | 4 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> |
| 5 | <h4 class="uk-panel-title">{{data.nbbm}} {{text}}</h4> | 5 | <h4 class="uk-panel-title">{{data.nbbm}} {{text}}</h4> |
| 6 | <code>{{dateStr}}</code> | 6 | <code>{{dateStr}}</code> |
| 7 | <div class="uk-button-group"> | 7 | <div class="uk-button-group"> |
| 8 | <a class="uk-button uk-button-mini uk-button-primary">同意</a> | 8 | <a class="uk-button uk-button-mini uk-button-primary">同意</a> |
| 9 | - <a class="uk-button uk-button-mini">不同意</a> | 9 | + <a class="uk-button uk-button-mini reject">不同意</a> |
| 10 | </div> | 10 | </div> |
| 11 | </div> | 11 | </div> |
| 12 | </div> | 12 | </div> |
| 13 | </script> | 13 | </script> |
| 14 | 14 | ||
| 15 | <script id="sys-note-42-temp" type="text/html"> | 15 | <script id="sys-note-42-temp" type="text/html"> |
| 16 | - <div class="uk-width-medium-1-1 sys-note-42" id="{{domId}}"> | 16 | + <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}" > |
| 17 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | 17 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> |
| 18 | <h5 class="title"> | 18 | <h5 class="title"> |
| 19 | {{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出,执行班次 {{t.dfsj}} | 19 | {{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出,执行班次 {{t.dfsj}} |
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | </script> | 26 | </script> |
| 27 | 27 | ||
| 28 | <script id="sys-note-42_1-temp" type="text/html"> | 28 | <script id="sys-note-42_1-temp" type="text/html"> |
| 29 | - <div class="uk-width-medium-1-1 sys-note-42" id="{{domId}}"> | 29 | + <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}"> |
| 30 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | 30 | <div class="uk-panel uk-panel-box uk-panel-box-secondary"> |
| 31 | <h5 class="title"> | 31 | <h5 class="title"> |
| 32 | {{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次; | 32 | {{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次; |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
0 → 100644
| 1 | +<div class="uk-modal" id="all-devices-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1100px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>所有接入平台的设备</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <legend> | ||
| 11 | + 数据检索 | ||
| 12 | + <!-- <div class="legend-tools"> | ||
| 13 | + <a class="uk-icon-small uk-icon-hover uk-icon-file-excel-o" data-uk-tooltip title="导出excel"></a> | ||
| 14 | + </div> --> | ||
| 15 | + </legend> | ||
| 16 | + <span class="horizontal-field">线路</span> | ||
| 17 | + <div class="uk-autocomplete uk-form autocomplete-line" > | ||
| 18 | + <input type="text" name="lineId" placeholder="线路"> | ||
| 19 | + </div> | ||
| 20 | + <span class="horizontal-field">车辆</span> | ||
| 21 | + <div class="uk-autocomplete uk-form autocomplete-cars" > | ||
| 22 | + <input type="text" name="nbbm" placeholder="车辆自编号"> | ||
| 23 | + </div> | ||
| 24 | + <span class="horizontal-field">设备号</span> | ||
| 25 | + <div class="uk-autocomplete uk-form autocomplete-device" > | ||
| 26 | + <input type="text" name="deviceId" placeholder="设备号"> | ||
| 27 | + </div> | ||
| 28 | + <button class="uk-button">检索</button> | ||
| 29 | + </fieldset> | ||
| 30 | + </form> | ||
| 31 | + </div> | ||
| 32 | + <div style="height: 495px;margin:5px 0 -18px;"> | ||
| 33 | + <table class="ct-fixed-table uk-table uk-table-hover"> | ||
| 34 | + <thead> | ||
| 35 | + <tr> | ||
| 36 | + <th style="width: 14%;">线路</th> | ||
| 37 | + <th style="width: 14%;">站点</th> | ||
| 38 | + <th style="width: 13%;">车辆</th> | ||
| 39 | + <th style="width: 13%;">设备号</th> | ||
| 40 | + <th style="width: 10%;">速度</th> | ||
| 41 | + <th style="width: 10%;">上下行</th> | ||
| 42 | + <th style="width: 10%;">程序版本</th> | ||
| 43 | + <th>最后GPS时间</th> | ||
| 44 | + </tr> | ||
| 45 | + </thead> | ||
| 46 | + <tbody> | ||
| 47 | + </tbody> | ||
| 48 | + </table> | ||
| 49 | + </div> | ||
| 50 | + <div class="uk-modal-footer uk-text-right pagination-wrap"> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + | ||
| 54 | + <script id="all-devices-table-temp" type="text/html"> | ||
| 55 | + {{each list as gps i}} | ||
| 56 | + <tr data-device="{{gps.deviceId}}"> | ||
| 57 | + <td>{{gps.lineId}}/{{gps.lineName}}</td> | ||
| 58 | + <td>{{gps.stationName}}</td> | ||
| 59 | + <td>{{gps.nbbm}}</td> | ||
| 60 | + <td>{{gps.deviceId}}</td> | ||
| 61 | + <td>{{gps.speed}}</td> | ||
| 62 | + <td>{{gps.upDown}}</td> | ||
| 63 | + <td>{{gps.version}}</td> | ||
| 64 | + <td>{{gps.timeStr}}</td> | ||
| 65 | + </tr> | ||
| 66 | + {{/each}} | ||
| 67 | + </script> | ||
| 68 | + | ||
| 69 | + <script id="device-line-change-modal-temp" type="text/html"> | ||
| 70 | + <div class="uk-modal" id="device-line-change-modal"> | ||
| 71 | + <div class="uk-modal-dialog"> | ||
| 72 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 73 | + | ||
| 74 | + <form class="uk-form fv-form"> | ||
| 75 | + <input type="hidden" name="deviceId" value="{{device}}" /> | ||
| 76 | + <fieldset data-uk-margin> | ||
| 77 | + <strong style="color: red;font-size: 16px;">{{device}}</strong> 切换至线路 | ||
| 78 | + | ||
| 79 | + <div class="uk-autocomplete uk-form" id="uk-autocomplete-line"> | ||
| 80 | + <input type="text" placeholder="搜索线路" name="line" /> | ||
| 81 | + </div> | ||
| 82 | + | ||
| 83 | + <label style="margin-left: 15px;font-size: 12px;color: grey;"> | ||
| 84 | + <input type="checkbox" style="vertical-align: middle" checked disabled> 强制刷新线路文件! | ||
| 85 | + </label> | ||
| 86 | + </fieldset> | ||
| 87 | + | ||
| 88 | + <div class="uk-modal-footer uk-text-right"> | ||
| 89 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 90 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 发送</button> | ||
| 91 | + </div> | ||
| 92 | + </form> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + </script> | ||
| 96 | + <script> | ||
| 97 | + (function() { | ||
| 98 | + var modal = '#all-devices-modal'; | ||
| 99 | + var form = $('.search-form', modal); | ||
| 100 | + var page = 0; | ||
| 101 | + var pageSize = 12; | ||
| 102 | + | ||
| 103 | + $(modal).on('init', function(e, data) { | ||
| 104 | + //车辆 autocomplete | ||
| 105 | + $.get('/basic/cars', function(rs) { | ||
| 106 | + gb_common.carAutocomplete($('.autocomplete-cars', modal), rs); | ||
| 107 | + }); | ||
| 108 | + //线路 autocomplete | ||
| 109 | + gb_common.lineAutocomplete($('.autocomplete-line', modal)); | ||
| 110 | + //设备号autocomplete | ||
| 111 | + $.get('/gps/allDevices', function(rs){ | ||
| 112 | + var data=[]; | ||
| 113 | + $.each(rs, function(){ | ||
| 114 | + data.push({value: this}); | ||
| 115 | + }); | ||
| 116 | + gb_common.init_autocomplete($('.autocomplete-device', modal), data); | ||
| 117 | + }); | ||
| 118 | + query(); | ||
| 119 | + }); | ||
| 120 | + | ||
| 121 | + //sumit event | ||
| 122 | + form.on('submit', function(e) { | ||
| 123 | + e.preventDefault(); | ||
| 124 | + resetPagination = true; | ||
| 125 | + page=0; | ||
| 126 | + query(); | ||
| 127 | + }); | ||
| 128 | + | ||
| 129 | + var query = function() { | ||
| 130 | + var data = form.serializeJSON(); | ||
| 131 | + data.page = page; | ||
| 132 | + data.size = pageSize; | ||
| 133 | + //线路转换成编码 | ||
| 134 | + if(data.lineId){ | ||
| 135 | + var lineCode = gb_data_basic.findCodeByLinename(data.lineId); | ||
| 136 | + if(lineCode) | ||
| 137 | + data.lineId=lineCode; | ||
| 138 | + } | ||
| 139 | + $.get('/gps/real/all', data, function(rs) { | ||
| 140 | + //数据转换 | ||
| 141 | + var code2Name=gb_data_basic.lineCode2NameAll(); | ||
| 142 | + $.each(rs.list, function(){ | ||
| 143 | + this.lineName=code2Name[this.lineId]; | ||
| 144 | + this.timeStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | ||
| 145 | + }); | ||
| 146 | + var bodyHtml = template('all-devices-table-temp', { | ||
| 147 | + list: rs.list | ||
| 148 | + }); | ||
| 149 | + $('table tbody', modal).html(bodyHtml); | ||
| 150 | + | ||
| 151 | + //pagination | ||
| 152 | + if (resetPagination) | ||
| 153 | + pagination(rs.totalPages + 1, rs.page); | ||
| 154 | + }) | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + var resetPagination = true; | ||
| 158 | + var pagination = function(pages, currentPage) { | ||
| 159 | + var wrap = $('.pagination-wrap', modal).empty() | ||
| 160 | + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); | ||
| 161 | + | ||
| 162 | + var pagination = UIkit.pagination(e, { | ||
| 163 | + pages: pages, | ||
| 164 | + currentPage: currentPage | ||
| 165 | + }); | ||
| 166 | + | ||
| 167 | + e.on('select.uk.pagination', function(e, pageIndex){ | ||
| 168 | + page = pageIndex; | ||
| 169 | + query(); | ||
| 170 | + }); | ||
| 171 | + | ||
| 172 | + resetPagination = false; | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + var callbackHandler={ | ||
| 176 | + change_line: function(device){ | ||
| 177 | + var htmlStr=template('device-line-change-modal-temp', {device: device}) | ||
| 178 | + ,lcModal='#device-line-change-modal'; | ||
| 179 | + $(document.body).append(htmlStr); | ||
| 180 | + var elem = UIkit.modal(lcModal, {bgclose: false,modal:false}).show(); | ||
| 181 | + | ||
| 182 | + //line autocomplete | ||
| 183 | + gb_common.lineAutocomplete(lcModal + ' #uk-autocomplete-line'); | ||
| 184 | + | ||
| 185 | + $('form', lcModal).on('submit', function(e) { | ||
| 186 | + e.preventDefault(); | ||
| 187 | + var data = $(this).serializeJSON(); | ||
| 188 | + data.line = $.trim(data.line); | ||
| 189 | + | ||
| 190 | + var lineCode = gb_data_basic.findCodeByLinename(data.line); | ||
| 191 | + if (data.line == '' || !lineCode) | ||
| 192 | + notify_err('无效的线路输入!'); | ||
| 193 | + else { | ||
| 194 | + data.lineId = lineCode; | ||
| 195 | + $.post('/directive/lineChangeByDevice', data, function(rs){ | ||
| 196 | + if(rs == 0) | ||
| 197 | + notify_succ('指令已发出!'); | ||
| 198 | + else | ||
| 199 | + notify_err('指令发送失败!'); | ||
| 200 | + | ||
| 201 | + elem.hide(); | ||
| 202 | + }); | ||
| 203 | + } | ||
| 204 | + }); | ||
| 205 | + }, | ||
| 206 | + refresh_line_file: function(device){ | ||
| 207 | + $.post('/directive/refreshLineFile',{deviceId: device}, function(rs){ | ||
| 208 | + if(rs == 0) | ||
| 209 | + notify_succ('线路文件刷新指令已发出!'); | ||
| 210 | + else | ||
| 211 | + notify_err('线路文件刷新指令发送失败!'); | ||
| 212 | + }); | ||
| 213 | + }, | ||
| 214 | + delete: function(device){ | ||
| 215 | + alt_confirm('从清册删除【<strong style="color: red;">'+device+'</strong>】?如果该设备继续向平台发送数据,仍会被收录。', function(){ | ||
| 216 | + gb_common.$post('/gps/removeRealGps', {device: device}, function(){ | ||
| 217 | + notify_succ('操作成功!'); | ||
| 218 | + query(); | ||
| 219 | + }); | ||
| 220 | + }, '确定从清册中移除'); | ||
| 221 | + } | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + $.contextMenu({ | ||
| 225 | + selector: '#all-devices-modal table>tbody>tr', | ||
| 226 | + className: 'schedule-ct-menu', | ||
| 227 | + callback: function(key, options) { | ||
| 228 | + var device = $('.context-menu-active', modal).data('device'); | ||
| 229 | + callbackHandler[key] && callbackHandler[key](device); | ||
| 230 | + }, | ||
| 231 | + items: { | ||
| 232 | + 'change_line': { | ||
| 233 | + name: '切换线路' | ||
| 234 | + }, | ||
| 235 | + 'refresh_line_file':{ | ||
| 236 | + name: '刷新线路文件' | ||
| 237 | + }, | ||
| 238 | + 'delete': { | ||
| 239 | + name: '删除' | ||
| 240 | + } | ||
| 241 | + } | ||
| 242 | + }); | ||
| 243 | + | ||
| 244 | + })(); | ||
| 245 | + </script> | ||
| 246 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/car_out_rate.html
0 → 100644
| 1 | +<div class="uk-modal" id="car-out-rate-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1200px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>出车率</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="margin-bottom: 10px;"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <div class="uk-form-icon"> | ||
| 11 | + <i class="uk-icon-calendar"></i> | ||
| 12 | + <input type="month" id="monthInput"> | ||
| 13 | + </div> | ||
| 14 | + <button class="uk-button" id="countBtn" >统计</button> | ||
| 15 | + </fieldset> | ||
| 16 | + </form> | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <div class="chart-wrap" style="height: 570px;"> | ||
| 20 | + | ||
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + <div class="load-panel"> | ||
| 24 | + <i class="uk-icon-spinner uk-icon-spin"></i> | ||
| 25 | + 正在汇总数据 | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + | ||
| 29 | + <script> | ||
| 30 | + (function () { | ||
| 31 | + | ||
| 32 | + var modal = '#car-out-rate-modal'; | ||
| 33 | + var chartObj; | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + var gb_option = { | ||
| 37 | + timeline: { | ||
| 38 | + axisType: 'category', | ||
| 39 | + label: { | ||
| 40 | + formatter: function (s, a) { | ||
| 41 | + return s.slice(8).length==1?'0'+s.slice(8):s.slice(8); | ||
| 42 | + } | ||
| 43 | + }, | ||
| 44 | + x: 20, | ||
| 45 | + x2: 5 | ||
| 46 | + } | ||
| 47 | + }; | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + $(modal).on('init', function (e, data) { | ||
| 51 | + //默认当前月 | ||
| 52 | + var m = moment().format('YYYY-MM'); | ||
| 53 | + $('#monthInput', modal).val(m); | ||
| 54 | + | ||
| 55 | + chartObj = echarts.init($('.chart-wrap', modal)[0]); | ||
| 56 | + chartObj.on('click', chartObjClickHandler); | ||
| 57 | + renderChart(); | ||
| 58 | + | ||
| 59 | + }); | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + //计算上线率 | ||
| 63 | + function calcOutRate(data){ | ||
| 64 | + var line2Reate={}, eff; | ||
| 65 | + for(var lineCode in data){ | ||
| 66 | + eff=0; | ||
| 67 | + $.each(data[lineCode], function(){ | ||
| 68 | + if(this.firstOut) | ||
| 69 | + eff++; | ||
| 70 | + }); | ||
| 71 | + | ||
| 72 | + line2Reate[lineCode]=(eff/data[lineCode].length*100).toFixed(2); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + return line2Reate; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + $('#countBtn', modal).on('click', renderChart); | ||
| 79 | + | ||
| 80 | + var renderData; | ||
| 81 | + function renderChart(){ | ||
| 82 | + //时间轴数据 | ||
| 83 | + var lastdate = moment().format('DD') | ||
| 84 | + ,month = $('#monthInput', modal).val(); | ||
| 85 | + if(month!=moment().format('YYYY-MM')){ | ||
| 86 | + //不是当前月 | ||
| 87 | + lastdate = new Date(month.split('-')[0],month.split('-')[1],0).getDate(); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + var timeData = []; | ||
| 91 | + for (var i = 0; i < lastdate; i++) | ||
| 92 | + timeData.push(month + '-' + (i + 1)); | ||
| 93 | + //时间轴 | ||
| 94 | + gb_option.timeline.data = timeData; | ||
| 95 | + gb_option.timeline.currentIndex=timeData.length-1; | ||
| 96 | + | ||
| 97 | + //xAxis | ||
| 98 | + var xAxisData=[],lineCodeArr=[]; | ||
| 99 | + $.each(gb_data_basic.activeLines, function(){ | ||
| 100 | + xAxisData.push(this.name); | ||
| 101 | + lineCodeArr.push(this.lineCode); | ||
| 102 | + }); | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + $('.load-panel', modal).show(); | ||
| 106 | + $('#countBtn', modal).attr('disabled', 'disabled'); | ||
| 107 | + //统计数据 | ||
| 108 | + gb_common.$get('/realCharts/carOutRate', {idx: gb_data_basic.line_idx, month: $('#monthInput', modal).val()}, function (rs) { | ||
| 109 | + if(!rs || rs.length==0){ | ||
| 110 | + notify_err("缺少" + month + "的数据"); | ||
| 111 | + $('.load-panel', modal).hide(); | ||
| 112 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 113 | + return; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + //日期分组数据 | ||
| 117 | + var groupList=gb_common.groupBy(rs, 'dateStr') | ||
| 118 | + ,data=[], opt={}; | ||
| 119 | + | ||
| 120 | + renderData=groupList; | ||
| 121 | + var subData; | ||
| 122 | + for(var date in groupList){ | ||
| 123 | + //lineCode再次分组,计算发车率 | ||
| 124 | + var line2Reate=calcOutRate(gb_common.groupBy(groupList[date],'lineCode')); | ||
| 125 | + | ||
| 126 | + subData=[]; | ||
| 127 | + $.each(lineCodeArr, function(i, code){ | ||
| 128 | + subData.push({ | ||
| 129 | + value: line2Reate[code]==null?0:line2Reate[code], | ||
| 130 | + date:date, | ||
| 131 | + lineCode: code | ||
| 132 | + }); | ||
| 133 | + }); | ||
| 134 | + | ||
| 135 | + data.push({ | ||
| 136 | + grid: {x: 30, x2: 5, height: 390, y: 94, y2: 50}, | ||
| 137 | + tooltip: {'trigger': 'axis'}, | ||
| 138 | + toolbox: {'show': false}, | ||
| 139 | + calculable: true, | ||
| 140 | + xAxis: [{ | ||
| 141 | + 'type': 'category', | ||
| 142 | + 'data': xAxisData | ||
| 143 | + }], | ||
| 144 | + yAxis: { | ||
| 145 | + 'type': 'value', | ||
| 146 | + 'name': '发车率', | ||
| 147 | + 'min': 0, | ||
| 148 | + 'max': 100 | ||
| 149 | + }, | ||
| 150 | + title: { | ||
| 151 | + text: date + '发车率', | ||
| 152 | + subtext: '实际排班车辆的实发数据' | ||
| 153 | + }, | ||
| 154 | + text: date + '发车率', | ||
| 155 | + series: [{ | ||
| 156 | + type: 'bar', | ||
| 157 | + data: subData | ||
| 158 | + }] | ||
| 159 | + }); | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + $('.load-panel', modal).hide(); | ||
| 163 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 164 | + gb_option.options=data; | ||
| 165 | + console.log(gb_option); | ||
| 166 | + chartObj.setOption(gb_option); | ||
| 167 | + }); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + function chartObjClickHandler(obj) { | ||
| 171 | + if(obj.componentType!='series' || obj.componentSubType!='bar') | ||
| 172 | + return; | ||
| 173 | + | ||
| 174 | + var lineGroupData=gb_common.groupBy(renderData[obj.data.date],'lineCode'); | ||
| 175 | + var list=lineGroupData[obj.data.lineCode]; | ||
| 176 | + //console.log('show list', list); | ||
| 177 | + | ||
| 178 | + $.get('/real_control_v2/fragments/north/nav/charts/car_out_rate_detail.html', function(htmlStr){ | ||
| 179 | + $(document.body).append(htmlStr); | ||
| 180 | + var detailModal='#car-out-rate-detail-modal'; | ||
| 181 | + var elem = UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 182 | + $(detailModal).trigger('init', {list: list}); | ||
| 183 | + }) | ||
| 184 | + } | ||
| 185 | + })(); | ||
| 186 | + </script> | ||
| 187 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/car_out_rate_detail.html
0 → 100644
| 1 | +<div class="uk-modal" id="car-out-rate-detail-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 450px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div style="margin:5px 0 -18px;"> | ||
| 5 | + <table class="ct-fixed-table uk-table uk-table-hover"> | ||
| 6 | + <thead> | ||
| 7 | + <tr> | ||
| 8 | + <th style="width: 25%;">日期</th> | ||
| 9 | + <th style="width: 25%;">线路</th> | ||
| 10 | + <th style="width: 25%;">车辆</th> | ||
| 11 | + <th style="width: 25%;">首个实际发车</th> | ||
| 12 | + </tr> | ||
| 13 | + </thead> | ||
| 14 | + <tbody> | ||
| 15 | + </tbody> | ||
| 16 | + </table> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <script id="car-out-rate-detail-table-temp" type="text/html"> | ||
| 21 | + {{each list as obj i}} | ||
| 22 | + <tr> | ||
| 23 | + <td>{{obj.dateStr}}</td> | ||
| 24 | + <td>{{obj.lineName}}</td> | ||
| 25 | + <td>{{obj.nbbm}}</td> | ||
| 26 | + <td> | ||
| 27 | + {{if obj.firstOut!=null}} | ||
| 28 | + {{obj.firstOut}} | ||
| 29 | + {{else}} | ||
| 30 | + <div class="uk-badge uk-badge-danger">未出车</div> | ||
| 31 | + {{/if}} | ||
| 32 | + </td> | ||
| 33 | + </tr> | ||
| 34 | + {{/each}} | ||
| 35 | + </script> | ||
| 36 | + | ||
| 37 | + <script> | ||
| 38 | + (function() { | ||
| 39 | + var modal = '#car-out-rate-detail-modal'; | ||
| 40 | + | ||
| 41 | + $(modal).on('init', function(e, data) { | ||
| 42 | + //console.log(data.list); | ||
| 43 | + var code2Name = gb_data_basic.lineCode2NameAll(); | ||
| 44 | + $.each(data.list, function(){ | ||
| 45 | + this.lineName=code2Name[this.lineCode]; | ||
| 46 | + }); | ||
| 47 | + | ||
| 48 | + data.list.sort(function(a, b){ | ||
| 49 | + if(!a.firstOut) | ||
| 50 | + return -1; | ||
| 51 | + if(!b.firstOut) | ||
| 52 | + return 1; | ||
| 53 | + return a.firstOut.localeCompare(b.firstOut); | ||
| 54 | + }); | ||
| 55 | + | ||
| 56 | + var tbodys=template('car-out-rate-detail-table-temp', {list: data.list}); | ||
| 57 | + $('table tbody', modal).html(tbodys); | ||
| 58 | + }); | ||
| 59 | + })(); | ||
| 60 | + </script> | ||
| 61 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/device_online_rate.html
0 → 100644
| 1 | +<div class="uk-modal" id="device-online-rate-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1200px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>设备上线率</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="margin-bottom: 10px;"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <div class="uk-form-icon"> | ||
| 11 | + <i class="uk-icon-calendar"></i> | ||
| 12 | + <input type="month" id="monthInput"> | ||
| 13 | + </div> | ||
| 14 | + <button class="uk-button" id="countBtn" >统计</button> | ||
| 15 | + </fieldset> | ||
| 16 | + </form> | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <div class="chart-wrap" style="height: 570px;"> | ||
| 20 | + | ||
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + <div class="load-panel"> | ||
| 24 | + <i class="uk-icon-spinner uk-icon-spin"></i> | ||
| 25 | + 正在汇总数据 | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + | ||
| 29 | + <script> | ||
| 30 | + (function () { | ||
| 31 | + | ||
| 32 | + var modal = '#device-online-rate-modal'; | ||
| 33 | + var chartObj; | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + var gb_option = { | ||
| 37 | + timeline: { | ||
| 38 | + axisType: 'category', | ||
| 39 | + label: { | ||
| 40 | + formatter: function (s, a) { | ||
| 41 | + return s.slice(8).length==1?'0'+s.slice(8):s.slice(8); | ||
| 42 | + } | ||
| 43 | + }, | ||
| 44 | + x: 20, | ||
| 45 | + x2: 5 | ||
| 46 | + } | ||
| 47 | + }; | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + $(modal).on('init', function (e, data) { | ||
| 51 | + //默认当前月 | ||
| 52 | + var m = moment().format('YYYY-MM') | ||
| 53 | + $('#monthInput', modal).val(m); | ||
| 54 | + | ||
| 55 | + chartObj = echarts.init($('.chart-wrap', modal)[0]); | ||
| 56 | + chartObj.on('click', chartObjClickHandler); | ||
| 57 | + renderChart(); | ||
| 58 | + | ||
| 59 | + }); | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + //计算上线率 | ||
| 63 | + function calcOnlineRate(data){ | ||
| 64 | + var line2Reate={}, eff; | ||
| 65 | + for(var lineCode in data){ | ||
| 66 | + eff=0; | ||
| 67 | + $.each(data[lineCode], function(){ | ||
| 68 | + if(this.online) | ||
| 69 | + eff++; | ||
| 70 | + }); | ||
| 71 | + | ||
| 72 | + line2Reate[lineCode]=(eff/data[lineCode].length*100).toFixed(2); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + return line2Reate; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + $('#countBtn', modal).on('click', renderChart); | ||
| 79 | + | ||
| 80 | + var renderData; | ||
| 81 | + function renderChart(){ | ||
| 82 | + //时间轴数据 | ||
| 83 | + var lastdate = moment().format('DD') | ||
| 84 | + ,month = $('#monthInput', modal).val(); | ||
| 85 | + if(month!=moment().format('YYYY-MM')){ | ||
| 86 | + //不是当前月 | ||
| 87 | + lastdate = new Date(month.split('-')[0],month.split('-')[1],0).getDate(); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + var timeData = []; | ||
| 91 | + for (var i = 0; i < lastdate; i++) | ||
| 92 | + timeData.push(month + '-' + (i + 1)); | ||
| 93 | + //时间轴 | ||
| 94 | + gb_option.timeline.data = timeData; | ||
| 95 | + gb_option.timeline.currentIndex=timeData.length-1; | ||
| 96 | + | ||
| 97 | + //xAxis | ||
| 98 | + var xAxisData=[],lineCodeArr=[]; | ||
| 99 | + $.each(gb_data_basic.activeLines, function(){ | ||
| 100 | + xAxisData.push(this.name); | ||
| 101 | + lineCodeArr.push(this.lineCode); | ||
| 102 | + }); | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + $('.load-panel', modal).show(); | ||
| 106 | + $('#countBtn', modal).attr('disabled', 'disabled'); | ||
| 107 | + //统计数据 | ||
| 108 | + gb_common.$get('/realCharts/deviceOnlineRate', {idx: gb_data_basic.line_idx, month: $('#monthInput', modal).val()}, function (rs) { | ||
| 109 | + if(!rs || rs.length==0){ | ||
| 110 | + notify_err("缺少" + month + "的数据"); | ||
| 111 | + $('.load-panel', modal).hide(); | ||
| 112 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 113 | + return; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + //分组数据,统计上线率 | ||
| 117 | + var groupList=gb_common.groupBy(rs, 'dateStr') | ||
| 118 | + ,data=[], opt={}; | ||
| 119 | + | ||
| 120 | + renderData=groupList; | ||
| 121 | + var subData; | ||
| 122 | + for(var date in groupList){ | ||
| 123 | + //lineCode再次分组,计算上线率 | ||
| 124 | + var line2Reate=calcOnlineRate(gb_common.groupBy(groupList[date],'lineCode')); | ||
| 125 | + | ||
| 126 | + subData=[]; | ||
| 127 | + $.each(lineCodeArr, function(i, str){ | ||
| 128 | + subData.push({ | ||
| 129 | + value: line2Reate[str]==null?0:line2Reate[str], | ||
| 130 | + date:date, | ||
| 131 | + lineCode: str | ||
| 132 | + }); | ||
| 133 | + }); | ||
| 134 | + | ||
| 135 | + data.push({ | ||
| 136 | + grid: {x: 30, x2: 5, height: 390, y: 94, y2: 50}, | ||
| 137 | + tooltip: {'trigger': 'axis'}, | ||
| 138 | + toolbox: {'show': false}, | ||
| 139 | + calculable: true, | ||
| 140 | + xAxis: [{ | ||
| 141 | + 'type': 'category', | ||
| 142 | + 'data': xAxisData | ||
| 143 | + }], | ||
| 144 | + yAxis: { | ||
| 145 | + 'type': 'value', | ||
| 146 | + 'name': '上线率', | ||
| 147 | + 'min': 0, | ||
| 148 | + 'max': 100 | ||
| 149 | + }, | ||
| 150 | + title: { | ||
| 151 | + text: date + '设备上线率', | ||
| 152 | + subtext: '实际排班结合GPS历史信号源' | ||
| 153 | + }, | ||
| 154 | + text: date + '设备上线率', | ||
| 155 | + series: [{ | ||
| 156 | + type: 'bar', | ||
| 157 | + data: subData | ||
| 158 | + }] | ||
| 159 | + }); | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + $('.load-panel', modal).hide(); | ||
| 163 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 164 | + gb_option.options=data; | ||
| 165 | + | ||
| 166 | + chartObj.setOption(gb_option); | ||
| 167 | + }); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + function chartObjClickHandler(obj) { | ||
| 171 | + if(obj.componentType!='series' || obj.componentSubType!='bar') | ||
| 172 | + return; | ||
| 173 | + | ||
| 174 | + var lineGroupData=gb_common.groupBy(renderData[obj.data.date],'lineCode'); | ||
| 175 | + var list=lineGroupData[obj.data.lineCode]; | ||
| 176 | + //console.log('show list', list); | ||
| 177 | + | ||
| 178 | + $.get('/real_control_v2/fragments/north/nav/charts/device_online_rate_detail.html', function(htmlStr){ | ||
| 179 | + $(document.body).append(htmlStr); | ||
| 180 | + var detailModal='#device-online-rate-detail-modal'; | ||
| 181 | + var elem = UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 182 | + $(detailModal).trigger('init', {list: list}); | ||
| 183 | + }) | ||
| 184 | + } | ||
| 185 | + })(); | ||
| 186 | + </script> | ||
| 187 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/device_online_rate_detail.html
0 → 100644
| 1 | +<div class="uk-modal" id="device-online-rate-detail-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 450px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div style="margin:5px 0 -18px;"> | ||
| 5 | + <table class="ct-fixed-table uk-table uk-table-hover"> | ||
| 6 | + <thead> | ||
| 7 | + <tr> | ||
| 8 | + <th style="width: 25%;">日期</th> | ||
| 9 | + <th style="width: 25%;">线路</th> | ||
| 10 | + <th style="width: 25%;">车辆</th> | ||
| 11 | + <th style="width: 25%;">是否上线</th> | ||
| 12 | + </tr> | ||
| 13 | + </thead> | ||
| 14 | + <tbody> | ||
| 15 | + </tbody> | ||
| 16 | + </table> | ||
| 17 | + </div> | ||
| 18 | + </div> | ||
| 19 | + | ||
| 20 | + <script id="device-online-rate-detail-table-temp" type="text/html"> | ||
| 21 | + {{each list as obj i}} | ||
| 22 | + <tr> | ||
| 23 | + <td>{{obj.dateStr}}</td> | ||
| 24 | + <td>{{obj.lineName}}</td> | ||
| 25 | + <td>{{obj.nbbm}}</td> | ||
| 26 | + <td> | ||
| 27 | + {{if obj.online}} | ||
| 28 | + <div class="uk-badge">上线</div> | ||
| 29 | + {{else}} | ||
| 30 | + <div class="uk-badge uk-badge-danger">未上线</div> | ||
| 31 | + {{/if}} | ||
| 32 | + </td> | ||
| 33 | + </tr> | ||
| 34 | + {{/each}} | ||
| 35 | + </script> | ||
| 36 | + | ||
| 37 | + <script> | ||
| 38 | + (function() { | ||
| 39 | + var modal = '#device-online-rate-detail-modal'; | ||
| 40 | + | ||
| 41 | + $(modal).on('init', function(e, data) { | ||
| 42 | + //console.log(data.list); | ||
| 43 | + var code2Name = gb_data_basic.lineCode2NameAll(); | ||
| 44 | + $.each(data.list, function(){ | ||
| 45 | + this.lineName=code2Name[this.lineCode]; | ||
| 46 | + }); | ||
| 47 | + | ||
| 48 | + var tbodys=template('device-online-rate-detail-table-temp', {list: data.list}); | ||
| 49 | + $('table tbody', modal).html(tbodys); | ||
| 50 | + }); | ||
| 51 | + })(); | ||
| 52 | + </script> | ||
| 53 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html
0 → 100644
| 1 | +<div class="uk-modal" id="s-e-punctuality-rate-line-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1200px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>线路首末班次准点率</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="margin-bottom: 10px;"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <div class="uk-form-icon"> | ||
| 11 | + <i class="uk-icon-calendar"></i> | ||
| 12 | + <input type="month" id="monthInput"> | ||
| 13 | + </div> | ||
| 14 | + <button class="uk-button" id="countBtn" >统计</button> | ||
| 15 | + </fieldset> | ||
| 16 | + </form> | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <div class="chart-wrap" style="height: 570px;"> | ||
| 20 | + | ||
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + <div class="load-panel"> | ||
| 24 | + <i class="uk-icon-spinner uk-icon-spin"></i> | ||
| 25 | + 正在汇总数据 | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + | ||
| 29 | + <script> | ||
| 30 | + (function () { | ||
| 31 | + | ||
| 32 | + var modal = '#s-e-punctuality-rate-line-modal'; | ||
| 33 | + var chartObj; | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + var gb_option = { | ||
| 37 | + timeline: { | ||
| 38 | + axisType: 'category', | ||
| 39 | + label: { | ||
| 40 | + formatter: function (s, a) { | ||
| 41 | + return s.slice(8).length==1?'0'+s.slice(8):s.slice(8); | ||
| 42 | + } | ||
| 43 | + }, | ||
| 44 | + x: 20, | ||
| 45 | + x2: 5 | ||
| 46 | + } | ||
| 47 | + }; | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + $(modal).on('init', function (e, data) { | ||
| 51 | + //默认当前月 | ||
| 52 | + var m = moment().format('YYYY-MM'); | ||
| 53 | + $('#monthInput', modal).val(m); | ||
| 54 | + | ||
| 55 | + chartObj = echarts.init($('.chart-wrap', modal)[0]); | ||
| 56 | + chartObj.on('click', chartObjClickHandler); | ||
| 57 | + renderChart(); | ||
| 58 | + | ||
| 59 | + }); | ||
| 60 | + | ||
| 61 | + //实发准点率 -dfsj 待发时间戳(秒),sfsj 实发时间戳(秒) | ||
| 62 | + function calcPunctuality(dfsj, sfsj){ | ||
| 63 | + var diff=(dfsj-sfsj)/60; | ||
| 64 | + var rs=0; | ||
| 65 | + if(diff > 0){ | ||
| 66 | + if(diff <= 1) | ||
| 67 | + rs=1; | ||
| 68 | + else | ||
| 69 | + rs=(10 - (diff - 1)) / 10; | ||
| 70 | + } | ||
| 71 | + else{ | ||
| 72 | + if(Math.abs(diff) < 3) | ||
| 73 | + rs=1; | ||
| 74 | + else | ||
| 75 | + rs=(10 - (Math.abs(diff) - 3)) / 10; | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + return rs<0?0:rs; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + //计算准点率 | ||
| 82 | + function calcPunctualityRate(data){ | ||
| 83 | + var line2Reate={}, seff, eeff, fs="YYYY-MM-DDHH:mm"; | ||
| 84 | + for(var lineCode in data){ | ||
| 85 | + seff=0; | ||
| 86 | + eeff=0; | ||
| 87 | + $.each(data[lineCode], function(){ | ||
| 88 | + //首班时间 | ||
| 89 | + if(this.startTime.length == 11){ | ||
| 90 | + var arr=this.startTime.split('/'); | ||
| 91 | + var sDfsj=moment(this.etRealExecDate+arr[0], fs).format('X'), | ||
| 92 | + sSfsj=moment(this.etRealExecDate+arr[1], fs).format('X'); | ||
| 93 | + | ||
| 94 | + seff=calcPunctuality(sDfsj, sSfsj); | ||
| 95 | + } | ||
| 96 | + else | ||
| 97 | + this.s_isPunctuality=-1; | ||
| 98 | + //末班时间 | ||
| 99 | + if(this.endTime.length == 11){ | ||
| 100 | + var arr=this.endTime.split('/'); | ||
| 101 | + var eDfsj=moment(this.etRealExecDate+arr[0], fs).format('X'), | ||
| 102 | + eSfsj=moment(this.etRealExecDate+arr[1], fs).format('X'); | ||
| 103 | + | ||
| 104 | + eeff=calcPunctuality(eDfsj, eSfsj); | ||
| 105 | + } | ||
| 106 | + else | ||
| 107 | + this.e_isPunctuality=-1; | ||
| 108 | + }); | ||
| 109 | + | ||
| 110 | + line2Reate[lineCode]={ | ||
| 111 | + seff: (seff*100).toFixed(2), | ||
| 112 | + eeff: (eeff*100).toFixed(2) | ||
| 113 | + }; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + return line2Reate; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + $('#countBtn', modal).on('click', renderChart); | ||
| 120 | + | ||
| 121 | + var renderData; | ||
| 122 | + function renderChart(){ | ||
| 123 | + //时间轴数据 | ||
| 124 | + var lastdate = moment().format('DD') | ||
| 125 | + ,month = $('#monthInput', modal).val(); | ||
| 126 | + if(month!=moment().format('YYYY-MM')){ | ||
| 127 | + //不是当前月 | ||
| 128 | + lastdate = new Date(month.split('-')[0],month.split('-')[1],0).getDate(); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + var timeData = []; | ||
| 132 | + for (var i = 0; i < lastdate; i++) | ||
| 133 | + timeData.push(month + '-' + (i + 1)); | ||
| 134 | + //时间轴 | ||
| 135 | + gb_option.timeline.data = timeData; | ||
| 136 | + gb_option.timeline.currentIndex=timeData.length-1; | ||
| 137 | + | ||
| 138 | + //xAxis | ||
| 139 | + var xAxisData=[],lineCodeArr=[]; | ||
| 140 | + $.each(gb_data_basic.activeLines, function(){ | ||
| 141 | + xAxisData.push(this.name); | ||
| 142 | + lineCodeArr.push(this.lineCode); | ||
| 143 | + }); | ||
| 144 | + | ||
| 145 | + | ||
| 146 | + $('.load-panel', modal).show(); | ||
| 147 | + $('#countBtn', modal).attr('disabled', 'disabled'); | ||
| 148 | + //统计数据 | ||
| 149 | + gb_common.$get('/realCharts/sePunctualityRateLine', {idx: gb_data_basic.line_idx, month: $('#monthInput', modal).val()}, function (rs) { | ||
| 150 | + | ||
| 151 | + if(!rs || rs.length==0){ | ||
| 152 | + notify_err("缺少" + month + "的数据"); | ||
| 153 | + $('.load-panel', modal).hide(); | ||
| 154 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 155 | + return; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + //日期分组数据 | ||
| 159 | + var groupList=gb_common.groupBy(rs, 'dateStr') | ||
| 160 | + ,data=[], opt={}; | ||
| 161 | + | ||
| 162 | + renderData=groupList; | ||
| 163 | + var subData,eData; | ||
| 164 | + for(var date in groupList){ | ||
| 165 | + //lineCode再次分组,计算准点率 | ||
| 166 | + var line2Reate=calcPunctualityRate(gb_common.groupBy(groupList[date],'lineCode')); | ||
| 167 | + | ||
| 168 | + sData=[], eData=[]; | ||
| 169 | + //subData=[]; | ||
| 170 | + $.each(lineCodeArr, function(i, code){ | ||
| 171 | + sData.push({ | ||
| 172 | + value: line2Reate[code]?line2Reate[code].seff:0, | ||
| 173 | + date:date, | ||
| 174 | + lineCode: code | ||
| 175 | + }); | ||
| 176 | + | ||
| 177 | + eData.push({ | ||
| 178 | + value: line2Reate[code]?line2Reate[code].eeff:0, | ||
| 179 | + date:date, | ||
| 180 | + lineCode: code | ||
| 181 | + }); | ||
| 182 | + }); | ||
| 183 | + | ||
| 184 | + data.push({ | ||
| 185 | + legend: { | ||
| 186 | + data: ['首班', '末班'] | ||
| 187 | + }, | ||
| 188 | + grid: {x: 30, x2: 5, height: 390, y: 94, y2: 50}, | ||
| 189 | + tooltip: { | ||
| 190 | + 'trigger': 'axis', | ||
| 191 | + axisPointer: { | ||
| 192 | + type: 'shadow' | ||
| 193 | + } | ||
| 194 | + }, | ||
| 195 | + toolbox: {'show': false}, | ||
| 196 | + calculable: true, | ||
| 197 | + xAxis: [{ | ||
| 198 | + 'type': 'category', | ||
| 199 | + 'data': xAxisData | ||
| 200 | + }], | ||
| 201 | + yAxis: { | ||
| 202 | + 'type': 'value', | ||
| 203 | + 'name': '准点率', | ||
| 204 | + 'min': 0, | ||
| 205 | + 'max': 100 | ||
| 206 | + }, | ||
| 207 | + title: { | ||
| 208 | + text: date + '首末班次准点率', | ||
| 209 | + subtext: '线路首末班发车数据(快1慢3准点,差值每分钟降10点)' | ||
| 210 | + }, | ||
| 211 | + text: date + '发车率', | ||
| 212 | + series: [{ | ||
| 213 | + name: '首班', | ||
| 214 | + type: 'bar', | ||
| 215 | + data: sData | ||
| 216 | + }, | ||
| 217 | + { | ||
| 218 | + name: '末班', | ||
| 219 | + type: 'bar', | ||
| 220 | + data: eData | ||
| 221 | + }] | ||
| 222 | + }); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + $('.load-panel', modal).hide(); | ||
| 226 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 227 | + gb_option.options=data; | ||
| 228 | + chartObj.setOption(gb_option); | ||
| 229 | + }); | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + function chartObjClickHandler(obj) { | ||
| 233 | + if(obj.componentType!='series' || obj.componentSubType!='bar') | ||
| 234 | + return; | ||
| 235 | + | ||
| 236 | + var lineGroupData=gb_common.groupBy(renderData[obj.data.date],'lineCode'); | ||
| 237 | + var list=lineGroupData[obj.data.lineCode]; | ||
| 238 | + //console.log('show list', list); | ||
| 239 | + | ||
| 240 | + $.get('/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate_dateil.html', function(htmlStr){ | ||
| 241 | + $(document.body).append(htmlStr); | ||
| 242 | + var detailModal='#s-e-punctuality-rate-dateil-modal'; | ||
| 243 | + var elem = UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 244 | + $(detailModal).trigger('init', {list: list}); | ||
| 245 | + }) | ||
| 246 | + } | ||
| 247 | + })(); | ||
| 248 | + </script> | ||
| 249 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate.html
0 → 100644
| 1 | +<div class="uk-modal" id="strat-end-punctuality-rate-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 1200px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>首末班次准点率</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="margin-bottom: 10px;"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <div class="uk-form-icon"> | ||
| 11 | + <i class="uk-icon-calendar"></i> | ||
| 12 | + <input type="month" id="monthInput"> | ||
| 13 | + </div> | ||
| 14 | + <button class="uk-button" id="countBtn" >统计</button> | ||
| 15 | + </fieldset> | ||
| 16 | + </form> | ||
| 17 | + </div> | ||
| 18 | + | ||
| 19 | + <div class="chart-wrap" style="height: 570px;"> | ||
| 20 | + | ||
| 21 | + </div> | ||
| 22 | + | ||
| 23 | + <div class="load-panel"> | ||
| 24 | + <i class="uk-icon-spinner uk-icon-spin"></i> | ||
| 25 | + 正在汇总数据 | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + | ||
| 29 | + <script> | ||
| 30 | + (function () { | ||
| 31 | + | ||
| 32 | + var modal = '#strat-end-punctuality-rate-modal'; | ||
| 33 | + var chartObj; | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + var gb_option = { | ||
| 37 | + timeline: { | ||
| 38 | + axisType: 'category', | ||
| 39 | + label: { | ||
| 40 | + formatter: function (s, a) { | ||
| 41 | + return s.slice(8).length==1?'0'+s.slice(8):s.slice(8); | ||
| 42 | + } | ||
| 43 | + }, | ||
| 44 | + x: 20, | ||
| 45 | + x2: 5 | ||
| 46 | + } | ||
| 47 | + }; | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + $(modal).on('init', function (e, data) { | ||
| 51 | + //默认当前月 | ||
| 52 | + var m = moment().format('YYYY-MM'); | ||
| 53 | + $('#monthInput', modal).val(m); | ||
| 54 | + | ||
| 55 | + chartObj = echarts.init($('.chart-wrap', modal)[0]); | ||
| 56 | + chartObj.on('click', chartObjClickHandler); | ||
| 57 | + renderChart(); | ||
| 58 | + | ||
| 59 | + }); | ||
| 60 | + | ||
| 61 | + //实发准点 -dfsj 待发时间戳(秒),sfsj 实发时间戳(秒) | ||
| 62 | + function isPunctuality(dfsj, sfsj){ | ||
| 63 | + if(dfsj == sfsj) | ||
| 64 | + return true; | ||
| 65 | + //快1 | ||
| 66 | + if(sfsj < dfsj && dfsj - sfsj <= 60*4) | ||
| 67 | + return true; | ||
| 68 | + //慢3 | ||
| 69 | + if(dfsj < sfsj && sfsj - dfsj <= 60*6) | ||
| 70 | + return true; | ||
| 71 | + | ||
| 72 | + return false; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + //计算准点率 | ||
| 76 | + function calcPunctualityRate(data){ | ||
| 77 | + var line2Reate={}, seff, eeff, fs="YYYY-MM-DDHH:mm"; | ||
| 78 | + for(var lineCode in data){ | ||
| 79 | + seff=0; | ||
| 80 | + eeff=0; | ||
| 81 | + $.each(data[lineCode], function(){ | ||
| 82 | + //首班时间 | ||
| 83 | + if(this.startTime.length == 11){ | ||
| 84 | + var arr=this.startTime.split('/'); | ||
| 85 | + var sDfsj=moment(this.etRealExecDate+arr[0], fs).format('X'), | ||
| 86 | + sSfsj=moment(this.etRealExecDate+arr[1], fs).format('X'); | ||
| 87 | + | ||
| 88 | + if(isPunctuality(sDfsj, sSfsj)){ | ||
| 89 | + this.s_isPunctuality=1; | ||
| 90 | + seff++; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + else | ||
| 94 | + this.s_isPunctuality=-1; | ||
| 95 | + //末班时间 | ||
| 96 | + if(this.endTime.length == 11){ | ||
| 97 | + var arr=this.endTime.split('/'); | ||
| 98 | + var eDfsj=moment(this.etRealExecDate+arr[0], fs).format('X'), | ||
| 99 | + eSfsj=moment(this.etRealExecDate+arr[1], fs).format('X'); | ||
| 100 | + | ||
| 101 | + if(isPunctuality(eDfsj, eSfsj)){ | ||
| 102 | + this.e_isPunctuality=1; | ||
| 103 | + eeff++; | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + else | ||
| 107 | + this.e_isPunctuality=-1; | ||
| 108 | + }); | ||
| 109 | + | ||
| 110 | + line2Reate[lineCode]={ | ||
| 111 | + seff: (seff/data[lineCode].length*100).toFixed(2), | ||
| 112 | + eeff: (eeff/data[lineCode].length*100).toFixed(2) | ||
| 113 | + }; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + return line2Reate; | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + $('#countBtn', modal).on('click', renderChart); | ||
| 120 | + | ||
| 121 | + var renderData; | ||
| 122 | + function renderChart(){ | ||
| 123 | + //时间轴数据 | ||
| 124 | + var lastdate = moment().format('DD') | ||
| 125 | + ,month = $('#monthInput', modal).val(); | ||
| 126 | + if(month!=moment().format('YYYY-MM')){ | ||
| 127 | + //不是当前月 | ||
| 128 | + lastdate = new Date(month.split('-')[0],month.split('-')[1],0).getDate(); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + var timeData = []; | ||
| 132 | + for (var i = 0; i < lastdate; i++) | ||
| 133 | + timeData.push(month + '-' + (i + 1)); | ||
| 134 | + //时间轴 | ||
| 135 | + gb_option.timeline.data = timeData; | ||
| 136 | + gb_option.timeline.currentIndex=timeData.length-1; | ||
| 137 | + | ||
| 138 | + //xAxis | ||
| 139 | + var xAxisData=[],lineCodeArr=[]; | ||
| 140 | + $.each(gb_data_basic.activeLines, function(){ | ||
| 141 | + xAxisData.push(this.name); | ||
| 142 | + lineCodeArr.push(this.lineCode); | ||
| 143 | + }); | ||
| 144 | + | ||
| 145 | + | ||
| 146 | + $('.load-panel', modal).show(); | ||
| 147 | + $('#countBtn', modal).attr('disabled', 'disabled'); | ||
| 148 | + //统计数据 | ||
| 149 | + gb_common.$get('/realCharts/stratEndPunctualityRate', {idx: gb_data_basic.line_idx, month: $('#monthInput', modal).val()}, function (rs) { | ||
| 150 | + | ||
| 151 | + if(!rs || rs.length==0){ | ||
| 152 | + notify_err("缺少" + month + "的数据"); | ||
| 153 | + $('.load-panel', modal).hide(); | ||
| 154 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 155 | + return; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + //日期分组数据 | ||
| 159 | + var groupList=gb_common.groupBy(rs, 'dateStr') | ||
| 160 | + ,data=[], opt={}; | ||
| 161 | + | ||
| 162 | + renderData=groupList; | ||
| 163 | + var subData,eData; | ||
| 164 | + for(var date in groupList){ | ||
| 165 | + //lineCode再次分组,计算准点率 | ||
| 166 | + var line2Reate=calcPunctualityRate(gb_common.groupBy(groupList[date],'lineCode')); | ||
| 167 | + | ||
| 168 | + sData=[], eData=[]; | ||
| 169 | + //subData=[]; | ||
| 170 | + $.each(lineCodeArr, function(i, code){ | ||
| 171 | + sData.push({ | ||
| 172 | + value: line2Reate[code]?line2Reate[code].seff:0, | ||
| 173 | + date:date, | ||
| 174 | + lineCode: code | ||
| 175 | + }); | ||
| 176 | + | ||
| 177 | + eData.push({ | ||
| 178 | + value: line2Reate[code]?line2Reate[code].eeff:0, | ||
| 179 | + date:date, | ||
| 180 | + lineCode: code | ||
| 181 | + }); | ||
| 182 | + }); | ||
| 183 | + | ||
| 184 | + data.push({ | ||
| 185 | + legend: { | ||
| 186 | + data: ['首班', '末班'] | ||
| 187 | + }, | ||
| 188 | + grid: {x: 30, x2: 5, height: 390, y: 94, y2: 50}, | ||
| 189 | + tooltip: { | ||
| 190 | + 'trigger': 'axis', | ||
| 191 | + axisPointer: { | ||
| 192 | + type: 'shadow' | ||
| 193 | + } | ||
| 194 | + }, | ||
| 195 | + toolbox: {'show': false}, | ||
| 196 | + calculable: true, | ||
| 197 | + xAxis: [{ | ||
| 198 | + 'type': 'category', | ||
| 199 | + 'data': xAxisData | ||
| 200 | + }], | ||
| 201 | + yAxis: { | ||
| 202 | + 'type': 'value', | ||
| 203 | + 'name': '准点率', | ||
| 204 | + 'min': 0, | ||
| 205 | + 'max': 100 | ||
| 206 | + }, | ||
| 207 | + title: { | ||
| 208 | + text: date + '首末班次准点率', | ||
| 209 | + subtext: '每辆车的首末班发车数据(只统计正常班次)' | ||
| 210 | + }, | ||
| 211 | + text: date + '发车率', | ||
| 212 | + series: [{ | ||
| 213 | + name: '首班', | ||
| 214 | + type: 'bar', | ||
| 215 | + data: sData | ||
| 216 | + }, | ||
| 217 | + { | ||
| 218 | + name: '末班', | ||
| 219 | + type: 'bar', | ||
| 220 | + data: eData | ||
| 221 | + }] | ||
| 222 | + }); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + $('.load-panel', modal).hide(); | ||
| 226 | + $('#countBtn', modal).removeAttr('disabled'); | ||
| 227 | + gb_option.options=data; | ||
| 228 | + chartObj.setOption(gb_option); | ||
| 229 | + }); | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + function chartObjClickHandler(obj) { | ||
| 233 | + if(obj.componentType!='series' || obj.componentSubType!='bar') | ||
| 234 | + return; | ||
| 235 | + | ||
| 236 | + var lineGroupData=gb_common.groupBy(renderData[obj.data.date],'lineCode'); | ||
| 237 | + var list=lineGroupData[obj.data.lineCode]; | ||
| 238 | + //console.log('show list', list); | ||
| 239 | + | ||
| 240 | + $.get('/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate_dateil.html', function(htmlStr){ | ||
| 241 | + $(document.body).append(htmlStr); | ||
| 242 | + var detailModal='#s-e-punctuality-rate-dateil-modal'; | ||
| 243 | + var elem = UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | ||
| 244 | + $(detailModal).trigger('init', {list: list}); | ||
| 245 | + }) | ||
| 246 | + } | ||
| 247 | + })(); | ||
| 248 | + </script> | ||
| 249 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate_dateil.html
0 → 100644
| 1 | +<div class="uk-modal" id="s-e-punctuality-rate-dateil-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 650px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div style="margin:5px 0 -18px;"> | ||
| 5 | + <table class="ct-fixed-table uk-table uk-table-hover"> | ||
| 6 | + <thead> | ||
| 7 | + <tr> | ||
| 8 | + <th style="width: 14%;">日期</th> | ||
| 9 | + <th style="width: 14%;">线路</th> | ||
| 10 | + <th style="width: 14%;">车辆</th> | ||
| 11 | + <th style="width: 23%;">首班</th> | ||
| 12 | + <th style="width: 23%;">末班</th> | ||
| 13 | + </tr> | ||
| 14 | + </thead> | ||
| 15 | + <tbody> | ||
| 16 | + </tbody> | ||
| 17 | + </table> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + | ||
| 21 | + <script id="s-e-punctuality-rate-dateil-table-temp" type="text/html"> | ||
| 22 | + {{each list as obj i}} | ||
| 23 | + <tr> | ||
| 24 | + <td>{{obj.dateStr}}</td> | ||
| 25 | + <td>{{obj.lineName}}</td> | ||
| 26 | + <td>{{obj.nbbm}}</td> | ||
| 27 | + <td> | ||
| 28 | + {{obj.startTime}} | ||
| 29 | + </td> | ||
| 30 | + | ||
| 31 | + <td> | ||
| 32 | + {{obj.endTime}} | ||
| 33 | + </td> | ||
| 34 | + </tr> | ||
| 35 | + {{/each}} | ||
| 36 | + </script> | ||
| 37 | + | ||
| 38 | + <script> | ||
| 39 | + (function() { | ||
| 40 | + var modal = '#s-e-punctuality-rate-dateil-modal'; | ||
| 41 | + | ||
| 42 | + $(modal).on('init', function(e, data) { | ||
| 43 | + //console.log(data.list); | ||
| 44 | + var code2Name = gb_data_basic.lineCode2NameAll(); | ||
| 45 | + $.each(data.list, function(){ | ||
| 46 | + this.lineName=code2Name[this.lineCode]; | ||
| 47 | + }); | ||
| 48 | + | ||
| 49 | + /*data.list.sort(function(a, b){ | ||
| 50 | + if(!a.firstOut) | ||
| 51 | + return -1; | ||
| 52 | + if(!b.firstOut) | ||
| 53 | + return 1; | ||
| 54 | + return a.firstOut.localeCompare(b.firstOut); | ||
| 55 | + });*/ | ||
| 56 | + | ||
| 57 | + var tbodys=template('s-e-punctuality-rate-dateil-table-temp', {list: data.list}); | ||
| 58 | + $('table tbody', modal).html(tbodys); | ||
| 59 | + }); | ||
| 60 | + | ||
| 61 | + })(); | ||
| 62 | + </script> | ||
| 63 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
| 1 | <div class="uk-modal" id="directive-history-modal"> | 1 | <div class="uk-modal" id="directive-history-modal"> |
| 2 | - <div class="uk-modal-dialog" style="width: 940px;"> | 2 | + <div class="uk-modal-dialog" style="width: 1040px;"> |
| 3 | <a href="" class="uk-modal-close uk-close"></a> | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | <div class="uk-modal-header"> | 4 | <div class="uk-modal-header"> |
| 5 | <h2>指令下发记录</h2></div> | 5 | <h2>指令下发记录</h2></div> |
| @@ -34,9 +34,9 @@ | @@ -34,9 +34,9 @@ | ||
| 34 | <table class="ct-fixed-table uk-table uk-table-hover"> | 34 | <table class="ct-fixed-table uk-table uk-table-hover"> |
| 35 | <thead> | 35 | <thead> |
| 36 | <tr> | 36 | <tr> |
| 37 | - <th style="width: 7%;">时间</th> | ||
| 38 | - <th style="width: 10%;">车辆</th> | ||
| 39 | - <th style="width: 39%;">指令内容</th> | 37 | + <th style="width: 6%;">时间</th> |
| 38 | + <th style="width: 8%;">车辆</th> | ||
| 39 | + <th style="width: 44%;">指令内容</th> | ||
| 40 | <th style="width: 7%;">发送人</th> | 40 | <th style="width: 7%;">发送人</th> |
| 41 | <th style="width: 15%;">状态</th> | 41 | <th style="width: 15%;">状态</th> |
| 42 | </tr> | 42 | </tr> |
| @@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
| 57 | <td> | 57 | <td> |
| 58 | <span title="{{obj.data.txtContent}}">{{obj.data.txtContent}}</span> | 58 | <span title="{{obj.data.txtContent}}">{{obj.data.txtContent}}</span> |
| 59 | </td> | 59 | </td> |
| 60 | - <td>{{obj.sender}}</td> | 60 | + <td>{{obj.sender}}{{if obj.event != null}}<span class="device_event_str">{{obj.event}}</span>{{/if}}</td> |
| 61 | <td> | 61 | <td> |
| 62 | {{if obj.errorText != null}} | 62 | {{if obj.errorText != null}} |
| 63 | <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div> | 63 | <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div> |
| @@ -124,6 +124,7 @@ | @@ -124,6 +124,7 @@ | ||
| 124 | form.on('submit', function(e) { | 124 | form.on('submit', function(e) { |
| 125 | e.preventDefault(); | 125 | e.preventDefault(); |
| 126 | resetPagination = true; | 126 | resetPagination = true; |
| 127 | + page=0; | ||
| 127 | query(); | 128 | query(); |
| 128 | }); | 129 | }); |
| 129 | 130 | ||
| @@ -133,6 +134,13 @@ | @@ -133,6 +134,13 @@ | ||
| 133 | data.size = pageSize; | 134 | data.size = pageSize; |
| 134 | 135 | ||
| 135 | $.get('/directive/list', data, function(rs) { | 136 | $.get('/directive/list', data, function(rs) { |
| 137 | + $.each(rs.list, function(i, e){ | ||
| 138 | + if(e.sender && e.sender.indexOf('@') != -1){ | ||
| 139 | + var ss = e.sender.split('@'); | ||
| 140 | + e.sender = ss[1]; | ||
| 141 | + e.event = ss[0]; | ||
| 142 | + } | ||
| 143 | + }); | ||
| 136 | var bodyHtml = template('directive-history-table-temp', { | 144 | var bodyHtml = template('directive-history-table-temp', { |
| 137 | list: rs.list | 145 | list: rs.list |
| 138 | }); | 146 | }); |
src/main/resources/static/real_control_v2/fragments/north/nav/report_80.html
0 → 100644
| 1 | +<div class="uk-modal" id="report-80-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 960px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>设备消息上报记录</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | ||
| 8 | + <form class="uk-form search-form"> | ||
| 9 | + <fieldset data-uk-margin> | ||
| 10 | + <legend> | ||
| 11 | + 数据检索 | ||
| 12 | + </legend> | ||
| 13 | + <span class="horizontal-field">请求代码</span> | ||
| 14 | + <select name="requestCode"> | ||
| 15 | + <option value="-1">全部</option> | ||
| 16 | + </select> | ||
| 17 | + <span class="horizontal-field">车辆</span> | ||
| 18 | + <div class="uk-autocomplete uk-form autocomplete-cars" > | ||
| 19 | + <input type="text" name="nbbm" placeholder="车辆自编号"> | ||
| 20 | + </div> | ||
| 21 | + | ||
| 22 | + <button class="uk-button">检索</button> | ||
| 23 | + </fieldset> | ||
| 24 | + </form> | ||
| 25 | + </div> | ||
| 26 | + <div style="height: 495px;margin:5px 0 -18px;"> | ||
| 27 | + <table class="ct-fixed-table uk-table uk-table-hover"> | ||
| 28 | + <thead> | ||
| 29 | + <tr> | ||
| 30 | + <th style="width: 15%;">线路</th> | ||
| 31 | + <th style="width: 15%;">车辆</th> | ||
| 32 | + <th style="width: 12%;">时间</th> | ||
| 33 | + <th style="width: 24%;">请求代码</th> | ||
| 34 | + <th style="width: 12%;">处理人</th> | ||
| 35 | + <th style="width: 12%;">处理时间</th> | ||
| 36 | + <th style="width: 10%;">处理结果</th> | ||
| 37 | + </tr> | ||
| 38 | + </thead> | ||
| 39 | + <tbody> | ||
| 40 | + </tbody> | ||
| 41 | + </table> | ||
| 42 | + </div> | ||
| 43 | + <div class="uk-modal-footer uk-text-right pagination-wrap"> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + | ||
| 47 | + <script id="report-80-modal-table-temp" type="text/html"> | ||
| 48 | + {{each list as obj i}} | ||
| 49 | + <tr> | ||
| 50 | + <td>{{obj.lineName}}</td> | ||
| 51 | + <td>{{obj.data.nbbm}}</td> | ||
| 52 | + <td>{{obj.timeStr}}</td> | ||
| 53 | + <td>{{obj.text}}</td> | ||
| 54 | + <td>{{obj.handleUser}}</td> | ||
| 55 | + {{if obj.c0 != null && obj.c0.data != null}} | ||
| 56 | + <td>{{obj.handleTimeStr}}</td> | ||
| 57 | + <td> | ||
| 58 | + {{if obj.c0.data.requestAck==6 }} | ||
| 59 | + <span class="label label-sm label-success"> 同意</span> | ||
| 60 | + {{else if obj.c0.data.requestAck==21 }} | ||
| 61 | + <span class="label label-sm label-danger"> 不同意</span> | ||
| 62 | + {{/if}} | ||
| 63 | + </td> | ||
| 64 | + {{else}} | ||
| 65 | + <td></td> | ||
| 66 | + <td><span class="label label-sm label-warning"> 未处理</span></td> | ||
| 67 | + {{/if}} | ||
| 68 | + </tr> | ||
| 69 | + {{/each}} | ||
| 70 | + </script> | ||
| 71 | + | ||
| 72 | + <script> | ||
| 73 | + (function() { | ||
| 74 | + var modal = '#report-80-modal'; | ||
| 75 | + var form = $('.search-form', modal); | ||
| 76 | + var page = 0; | ||
| 77 | + var pageSize = 12; | ||
| 78 | + | ||
| 79 | + $(modal).on('init', function(e, data) { | ||
| 80 | + var opt=''; | ||
| 81 | + for(var code in gb_common.reqCode80){ | ||
| 82 | + opt+='<option value="'+code+'">'+gb_common.reqCode80[code]+'</option>'; | ||
| 83 | + } | ||
| 84 | + $('[name=requestCode]', modal).append(opt); | ||
| 85 | + //车辆 autocomplete | ||
| 86 | + $.get('/basic/cars', function(rs) { | ||
| 87 | + gb_common.carAutocomplete($('.autocomplete-cars', modal), rs); | ||
| 88 | + }); | ||
| 89 | + query(); | ||
| 90 | + }); | ||
| 91 | + | ||
| 92 | + //sumit event | ||
| 93 | + form.on('submit', function(e) { | ||
| 94 | + e.preventDefault(); | ||
| 95 | + resetPagination = true; | ||
| 96 | + page=0; | ||
| 97 | + query(); | ||
| 98 | + }); | ||
| 99 | + | ||
| 100 | + var query = function() { | ||
| 101 | + var data = form.serializeJSON(); | ||
| 102 | + data.page = page; | ||
| 103 | + data.size = pageSize; | ||
| 104 | + $.get('/directive/findAll80', data, function(rs) { | ||
| 105 | + $.each(rs.list, function(){ | ||
| 106 | + //命令字转中文 | ||
| 107 | + this.text = gb_common.reqCode80[this.data.requestCode]; | ||
| 108 | + if(!this.text) | ||
| 109 | + this.text='未知的请求码('+this.data.requestCode+')'; | ||
| 110 | + if(this.handleTime) | ||
| 111 | + this.handleTimeStr = moment(this.handleTime).format('HH:mm'); | ||
| 112 | + //线路名转换 | ||
| 113 | + this.lineName = this.data.lineId+'/'+gb_data_basic.lineCode2NameAll()[this.data.lineId]; | ||
| 114 | + }); | ||
| 115 | + var bodyHtml = template('report-80-modal-table-temp', { | ||
| 116 | + list: rs.list | ||
| 117 | + }); | ||
| 118 | + $('table tbody', modal).html(bodyHtml); | ||
| 119 | + | ||
| 120 | + //pagination | ||
| 121 | + if (resetPagination) | ||
| 122 | + pagination(rs.totalPages + 1, rs.page); | ||
| 123 | + }) | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + var resetPagination = true; | ||
| 127 | + var pagination = function(pages, currentPage) { | ||
| 128 | + var wrap = $('.pagination-wrap', modal).empty() | ||
| 129 | + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); | ||
| 130 | + | ||
| 131 | + var pagination = UIkit.pagination(e, { | ||
| 132 | + pages: pages, | ||
| 133 | + currentPage: currentPage | ||
| 134 | + }); | ||
| 135 | + | ||
| 136 | + e.on('select.uk.pagination', function(e, pageIndex){ | ||
| 137 | + page = pageIndex; | ||
| 138 | + query(); | ||
| 139 | + }); | ||
| 140 | + | ||
| 141 | + resetPagination = false; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + })(); | ||
| 145 | + </script> | ||
| 146 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/tabs.html
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | <li class="uk-active" ><a>主页</a></li> | 4 | <li class="uk-active" ><a>主页</a></li> |
| 5 | <li class=""><a>地图</a></li> | 5 | <li class=""><a>地图</a></li> |
| 6 | {{each list as line i}} | 6 | {{each list as line i}} |
| 7 | - <li class="tab-line"><a>{{line.name}}(0, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>)</a></li> | 7 | + <li class="tab-line"><a>{{line.name}}(<span id="badge_untreated_num_{{line.lineCode}}">0</span>, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>)</a></li> |
| 8 | {{/each}} | 8 | {{/each}} |
| 9 | </ul> | 9 | </ul> |
| 10 | </script> | 10 | </script> |
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
| @@ -7,8 +7,9 @@ | @@ -7,8 +7,9 @@ | ||
| 7 | </a> | 7 | </a> |
| 8 | <ul class="uk-navbar-nav"> | 8 | <ul class="uk-navbar-nav"> |
| 9 | {{each list as obj i}} | 9 | {{each list as obj i}} |
| 10 | - <li class="uk-parent {{obj.disabled}}" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false"> | 10 | + <li class="uk-parent " data-uk-dropdown="{{if obj.columns}}{pos:'top-right'}{{/if}}" aria-haspopup="true" aria-expanded="false"> |
| 11 | <a>{{obj.text}} <i class="uk-icon-caret-down"></i></a> | 11 | <a>{{obj.text}} <i class="uk-icon-caret-down"></i></a> |
| 12 | + {{if obj.children != null}} | ||
| 12 | <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;"> | 13 | <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;"> |
| 13 | <ul class="uk-nav uk-nav-navbar"> | 14 | <ul class="uk-nav uk-nav-navbar"> |
| 14 | {{each obj.children as c j}} | 15 | {{each obj.children as c j}} |
| @@ -18,11 +19,39 @@ | @@ -18,11 +19,39 @@ | ||
| 18 | {{else if c.divider}} | 19 | {{else if c.divider}} |
| 19 | <li class="uk-nav-divider"></li> | 20 | <li class="uk-nav-divider"></li> |
| 20 | {{else}} | 21 | {{else}} |
| 21 | - <li class="event {{obj.disabled}}"><a data-event="{{c.event}}">{{c.text}}</a></li> | 22 | + <li class="event"><a data-event="{{c.event}}">{{c.text}}</a></li> |
| 22 | {{/if}} | 23 | {{/if}} |
| 23 | {{/each}} | 24 | {{/each}} |
| 24 | </ul> | 25 | </ul> |
| 25 | </div> | 26 | </div> |
| 27 | + {{else if obj.columns}} | ||
| 28 | + <div class="uk-dropdown {{obj.clazz}}"> | ||
| 29 | + <div class="uk-grid uk-dropdown-grid"> | ||
| 30 | + {{each obj.grid as cls s}} | ||
| 31 | + <div class="{{obj.cls_class}}"> | ||
| 32 | + <ul class="uk-nav uk-nav-dropdown uk-panel"> | ||
| 33 | + {{each cls as c z}} | ||
| 34 | + {{if c.header}} | ||
| 35 | + <li class="uk-nav-header">{{c.text}}</li> | ||
| 36 | + | ||
| 37 | + {{else if c.divider}} | ||
| 38 | + <li class="uk-nav-divider"></li> | ||
| 39 | + {{else}} | ||
| 40 | + <li class="event"> | ||
| 41 | + <a data-event="{{c.event}}"> | ||
| 42 | + {{if c.icon != null}} | ||
| 43 | + <i class="{{c.icon}}"></i> | ||
| 44 | + {{/if}} | ||
| 45 | + {{c.text}}</a> | ||
| 46 | + </li> | ||
| 47 | + {{/if}} | ||
| 48 | + {{/each}} | ||
| 49 | + </ul> | ||
| 50 | + </div> | ||
| 51 | + {{/each}} | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + {{/if}} | ||
| 26 | </li> | 55 | </li> |
| 27 | {{/each}} | 56 | {{/each}} |
| 28 | </ul> | 57 | </ul> |
src/main/resources/static/real_control_v2/js/common.js
| @@ -178,16 +178,6 @@ var gb_common = (function() { | @@ -178,16 +178,6 @@ var gb_common = (function() { | ||
| 178 | 178 | ||
| 179 | var personAutocomplete = function(element, personMaps) { | 179 | var personAutocomplete = function(element, personMaps) { |
| 180 | var data = [],name; | 180 | var data = [],name; |
| 181 | - // $.each(personList, function(){ | ||
| 182 | - // name=this.personnelName; | ||
| 183 | - // data.push({ | ||
| 184 | - // value: this.jobCode+'/'+name, | ||
| 185 | - // fullChars: pinyin.getFullChars(name).toUpperCase(), | ||
| 186 | - // camelChars: pinyin.getCamelChars(name), | ||
| 187 | - // brancheCompany: this.brancheCompany | ||
| 188 | - // }); | ||
| 189 | - // }); | ||
| 190 | - // console.log('data', data); | ||
| 191 | for(var jobCode in personMaps){ | 181 | for(var jobCode in personMaps){ |
| 192 | name=personMaps[jobCode]; | 182 | name=personMaps[jobCode]; |
| 193 | data.push({ | 183 | data.push({ |
| @@ -284,7 +274,8 @@ var gb_common = (function() { | @@ -284,7 +274,8 @@ var gb_common = (function() { | ||
| 284 | get_device_tree_data: get_device_tree_data, | 274 | get_device_tree_data: get_device_tree_data, |
| 285 | lineAutocomplete: lineAutocomplete, | 275 | lineAutocomplete: lineAutocomplete, |
| 286 | personAutocomplete: personAutocomplete, | 276 | personAutocomplete: personAutocomplete, |
| 287 | - carAutocomplete: carAutocomplete | 277 | + carAutocomplete: carAutocomplete, |
| 278 | + init_autocomplete: init_autocomplete | ||
| 288 | 279 | ||
| 289 | //whichTransitionEvent:whichTransitionEvent | 280 | //whichTransitionEvent:whichTransitionEvent |
| 290 | }; | 281 | }; |
src/main/resources/static/real_control_v2/js/data/json/back
| 1 | -[{ | ||
| 2 | - "id": 1, | ||
| 3 | - "text": "基础数据", | ||
| 4 | - "children": [{ | ||
| 5 | - "id": 1.1, | ||
| 6 | - "text": "线路", | ||
| 7 | - "event": "" | ||
| 8 | - }, { | ||
| 9 | - "id": 1.2, | ||
| 10 | - "text": "人员", | ||
| 11 | - "event": "" | ||
| 12 | - }, { | ||
| 13 | - "id": 1.3, | ||
| 14 | - "text": "车辆", | ||
| 15 | - "event": "" | ||
| 16 | - }, { | ||
| 17 | - "id": 1.4, | ||
| 18 | - "text": "线路配置", | ||
| 19 | - "header": true | ||
| 20 | - }, { | ||
| 21 | - "id": 1.5, | ||
| 22 | - "text": "人员配置", | ||
| 23 | - "event": "" | ||
| 24 | - }, { | ||
| 25 | - "id": 1.6, | ||
| 26 | - "text": "车辆配置", | ||
| 27 | - "event": "" | ||
| 28 | - }, { | ||
| 29 | - "id": 1.7, | ||
| 30 | - "divider": true | ||
| 31 | - }, { | ||
| 32 | - "id": 1.8, | ||
| 33 | - "text": "计划排班", | ||
| 34 | - "event": "" | ||
| 35 | - }] | ||
| 36 | -}, { | 1 | +[ { |
| 2 | + "id": 1, | ||
| 3 | + "text": "数据&统计", | ||
| 4 | + "clazz": "dropdown-column-2", | ||
| 5 | + "columns": true, | ||
| 6 | + "cls_class": "uk-width-1-2", | ||
| 7 | + "grid": [ | ||
| 8 | + [ | ||
| 9 | + { | ||
| 10 | + "id": 1.12, | ||
| 11 | + "text": "数据管理", | ||
| 12 | + "header": 1 | ||
| 13 | + }, | ||
| 14 | + { | ||
| 15 | + "id": 1.52, | ||
| 16 | + "text": "历史班次维护", | ||
| 17 | + "event": "history_sch_maintain" | ||
| 18 | + } | ||
| 19 | + ], | ||
| 20 | + [ | ||
| 21 | + { | ||
| 22 | + "id": 1.1, | ||
| 23 | + "text": "统计分析", | ||
| 24 | + "header": 1 | ||
| 25 | + }, | ||
| 26 | + { | ||
| 27 | + "id": 1.2, | ||
| 28 | + "text": "出车率", | ||
| 29 | + "event": "turnout_rate", | ||
| 30 | + "icon": "uk-icon-pie-chart" | ||
| 31 | + }, | ||
| 32 | + { | ||
| 33 | + "id": 1.3, | ||
| 34 | + "text": "设备上线率", | ||
| 35 | + "event": "device_online_rate", | ||
| 36 | + "icon": "uk-icon-pie-chart" | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + "id": 1.4, | ||
| 40 | + "divider": true | ||
| 41 | + }, | ||
| 42 | + { | ||
| 43 | + "id": 1.5, | ||
| 44 | + "text": "班次执行率", | ||
| 45 | + "event": "sch_exec_rate", | ||
| 46 | + "icon": "uk-icon-pie-chart" | ||
| 47 | + }, | ||
| 48 | + { | ||
| 49 | + "id": 1.6, | ||
| 50 | + "text": "线路首末班准点率", | ||
| 51 | + "event": "s_e_punctuality_rate_line", | ||
| 52 | + "icon": "uk-icon-pie-chart" | ||
| 53 | + }, | ||
| 54 | + { | ||
| 55 | + "id": 1.7, | ||
| 56 | + "text": "车辆首末班准点率", | ||
| 57 | + "event": "s_e_punctuality_rate", | ||
| 58 | + "icon": "uk-icon-pie-chart" | ||
| 59 | + } | ||
| 60 | + ] | ||
| 61 | + ] | ||
| 62 | + }, { | ||
| 37 | "id": 2, | 63 | "id": 2, |
| 38 | "text": "车载设备", | 64 | "text": "车载设备", |
| 39 | "children": [{ | 65 | "children": [{ |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
| 1 | -[{ | 1 | +[ |
| 2 | + { | ||
| 2 | "id": 1, | 3 | "id": 1, |
| 3 | - "text": "基础数据" | ||
| 4 | -}, { | 4 | + "text": "数据&统计", |
| 5 | + "clazz": "dropdown-column-2", | ||
| 6 | + "columns": true, | ||
| 7 | + "cls_class": "uk-width-1-2", | ||
| 8 | + "grid": [ | ||
| 9 | + [ | ||
| 10 | + { | ||
| 11 | + "id": 1.12, | ||
| 12 | + "text": "数据管理", | ||
| 13 | + "header": 1 | ||
| 14 | + }, | ||
| 15 | + { | ||
| 16 | + "id": 1.52, | ||
| 17 | + "text": "...", | ||
| 18 | + "event": "history_sch_maintain" | ||
| 19 | + } | ||
| 20 | + ], | ||
| 21 | + [ | ||
| 22 | + { | ||
| 23 | + "id": 1.1, | ||
| 24 | + "text": "统计分析", | ||
| 25 | + "header": 1 | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + "id": 1.2, | ||
| 29 | + "text": "出车率", | ||
| 30 | + "event": "turnout_rate", | ||
| 31 | + "icon": "uk-icon-pie-chart" | ||
| 32 | + }, | ||
| 33 | + { | ||
| 34 | + "id": 1.3, | ||
| 35 | + "text": "设备上线率", | ||
| 36 | + "event": "device_online_rate", | ||
| 37 | + "icon": "uk-icon-pie-chart" | ||
| 38 | + }, | ||
| 39 | + { | ||
| 40 | + "id": 1.4, | ||
| 41 | + "divider": true | ||
| 42 | + }, | ||
| 43 | + { | ||
| 44 | + "id": 1.6, | ||
| 45 | + "text": "线路首末班准点率", | ||
| 46 | + "event": "s_e_punctuality_rate_line", | ||
| 47 | + "icon": "uk-icon-pie-chart" | ||
| 48 | + }, | ||
| 49 | + { | ||
| 50 | + "id": 1.7, | ||
| 51 | + "text": "车辆首末班准点率", | ||
| 52 | + "event": "s_e_punctuality_rate", | ||
| 53 | + "icon": "uk-icon-pie-chart" | ||
| 54 | + } | ||
| 55 | + ] | ||
| 56 | + ] | ||
| 57 | + }, | ||
| 58 | + { | ||
| 5 | "id": 2, | 59 | "id": 2, |
| 6 | "text": "车载设备", | 60 | "text": "车载设备", |
| 7 | "children": [ | 61 | "children": [ |
| 8 | { | 62 | { |
| 63 | + "id": 2.1, | ||
| 64 | + "text": "设备管理", | ||
| 65 | + "event": "all_devices" | ||
| 66 | + }, | ||
| 67 | + { | ||
| 9 | "id": 2.3, | 68 | "id": 2.3, |
| 10 | "text": "指令下发记录", | 69 | "text": "指令下发记录", |
| 11 | "event": "directive_history" | 70 | "event": "directive_history" |
| 12 | - }] | ||
| 13 | -}, { | 71 | + }, |
| 72 | + { | ||
| 73 | + "id": 2.2, | ||
| 74 | + "text": "设备上报记录", | ||
| 75 | + "event": "device_report" | ||
| 76 | + } | ||
| 77 | + ] | ||
| 78 | + }, | ||
| 79 | + { | ||
| 14 | "id": 3, | 80 | "id": 3, |
| 15 | "text": "系统设置", | 81 | "text": "系统设置", |
| 16 | - "children": [{ | 82 | + "children": [ |
| 83 | + { | ||
| 17 | "id": 3.1, | 84 | "id": 3.1, |
| 18 | "text": "TTS", | 85 | "text": "TTS", |
| 19 | "event": "tts_config" | 86 | "event": "tts_config" |
| 20 | - }] | ||
| 21 | -}] | 87 | + } |
| 88 | + ] | ||
| 89 | + } | ||
| 90 | +] |
src/main/resources/static/real_control_v2/js/home/context_menu.js
| @@ -144,7 +144,7 @@ var gb_home_context_menu = (function() { | @@ -144,7 +144,7 @@ var gb_home_context_menu = (function() { | ||
| 144 | 144 | ||
| 145 | var state_down_0 = function() { | 145 | var state_down_0 = function() { |
| 146 | changeUpDown(active_car, 1); | 146 | changeUpDown(active_car, 1); |
| 147 | - } | 147 | + }; |
| 148 | 148 | ||
| 149 | var line_change = function() { | 149 | var line_change = function() { |
| 150 | var dom = temps['line-change-modal-temp']({ | 150 | var dom = temps['line-change-modal-temp']({ |
| @@ -169,15 +169,16 @@ var gb_home_context_menu = (function() { | @@ -169,15 +169,16 @@ var gb_home_context_menu = (function() { | ||
| 169 | data.lineId = lineCode; | 169 | data.lineId = lineCode; |
| 170 | $.post('/directive/lineChnage', data, function(rs){ | 170 | $.post('/directive/lineChnage', data, function(rs){ |
| 171 | if(rs == 0) | 171 | if(rs == 0) |
| 172 | - notify_succ('指令已发出!'); | 172 | + notify_succ('指令已发出!'); |
| 173 | else | 173 | else |
| 174 | - notify_err('指令发送失败!'); | 174 | + notify_err('指令发送失败!'); |
| 175 | 175 | ||
| 176 | elem.hide(); | 176 | elem.hide(); |
| 177 | }); | 177 | }); |
| 178 | } | 178 | } |
| 179 | - }) | ||
| 180 | - } | 179 | + }); |
| 180 | + }; | ||
| 181 | + | ||
| 181 | 182 | ||
| 182 | var C0_A3 = function(){ | 183 | var C0_A3 = function(){ |
| 183 | open_modal('/real_control_v2/fragments/home/c0_a3.html', {}, {center: false, bgclose: false}); | 184 | open_modal('/real_control_v2/fragments/home/c0_a3.html', {}, {center: false, bgclose: false}); |
| @@ -231,4 +232,6 @@ var gb_home_context_menu = (function() { | @@ -231,4 +232,6 @@ var gb_home_context_menu = (function() { | ||
| 231 | } | 232 | } |
| 232 | } | 233 | } |
| 233 | }); | 234 | }); |
| 235 | + | ||
| 236 | + return {line_change: line_change} | ||
| 234 | })(); | 237 | })(); |
src/main/resources/static/real_control_v2/js/home/line_panel.js
| @@ -83,7 +83,20 @@ var gb_home_line_panel = (function() { | @@ -83,7 +83,20 @@ var gb_home_line_panel = (function() { | ||
| 83 | $(cells[1]).text(t.speed); | 83 | $(cells[1]).text(t.speed); |
| 84 | $(cells[2]).html(t.expectStopTime == null ? '' : t.expectStopTime); | 84 | $(cells[2]).html(t.expectStopTime == null ? '' : t.expectStopTime); |
| 85 | $(cells[3]).text(t.stationName).attr('title', t.stationName); | 85 | $(cells[3]).text(t.stationName).attr('title', t.stationName); |
| 86 | - } | 86 | + |
| 87 | + //班次信息 | ||
| 88 | + if(t.schId){ | ||
| 89 | + var sch=gb_schedule_table.findScheduleByLine(t.lineId)[t.schId]; | ||
| 90 | + if(!sch) | ||
| 91 | + return; | ||
| 92 | + | ||
| 93 | + $(cells[4]).text(sch.zdzName); | ||
| 94 | + $(cells[5]).text(sch.zdsj); | ||
| 95 | + $(cells[6]).text(sch.jName); | ||
| 96 | + if(sch.sName) | ||
| 97 | + $(cells[7]).text(sch.sName); | ||
| 98 | + } | ||
| 99 | + }; | ||
| 87 | 100 | ||
| 88 | var sortRows = function($tbody) { | 101 | var sortRows = function($tbody) { |
| 89 | var rows = $tbody.find('dl'); | 102 | var rows = $tbody.find('dl'); |
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
| @@ -21,7 +21,37 @@ var gb_line_layout = (function() { | @@ -21,7 +21,37 @@ var gb_line_layout = (function() { | ||
| 21 | 21 | ||
| 22 | cb && cb(); | 22 | cb && cb(); |
| 23 | }); | 23 | }); |
| 24 | - } | 24 | + }; |
| 25 | + | ||
| 26 | + $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { | ||
| 27 | + $(this).qtip({ | ||
| 28 | + show: { | ||
| 29 | + ready: true, | ||
| 30 | + delay: 300 | ||
| 31 | + }, | ||
| 32 | + content: { | ||
| 33 | + text: function() { | ||
| 34 | + return temps['sch-table-top-help-temp']({}); | ||
| 35 | + } | ||
| 36 | + }, | ||
| 37 | + position: { | ||
| 38 | + viewport: $(window) | ||
| 39 | + }, | ||
| 40 | + style: { | ||
| 41 | + classes: 'qtip-light qtip-rounded qtip-shadow sch-tl-tip' | ||
| 42 | + }, | ||
| 43 | + hide: { | ||
| 44 | + fixed: true, | ||
| 45 | + delay: 300 | ||
| 46 | + }, | ||
| 47 | + events: { | ||
| 48 | + hidden: function(event, api) { | ||
| 49 | + //destroy dom | ||
| 50 | + $(this).qtip('destroy', true); | ||
| 51 | + } | ||
| 52 | + }// max-width: 335px; | ||
| 53 | + }); | ||
| 54 | + }); | ||
| 25 | 55 | ||
| 26 | return { | 56 | return { |
| 27 | layout: layout | 57 | layout: layout |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -121,6 +121,8 @@ var gb_schedule_table = (function() { | @@ -121,6 +121,8 @@ var gb_schedule_table = (function() { | ||
| 121 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | 121 | $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); |
| 122 | } | 122 | } |
| 123 | calc_yfwf_num(sch.xlBm); | 123 | calc_yfwf_num(sch.xlBm); |
| 124 | + //重新固定表头 | ||
| 125 | + gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); | ||
| 124 | //定位到新添加的班次 | 126 | //定位到新添加的班次 |
| 125 | scroToDl(sch); | 127 | scroToDl(sch); |
| 126 | } | 128 | } |
| @@ -155,7 +157,9 @@ var gb_schedule_table = (function() { | @@ -155,7 +157,9 @@ var gb_schedule_table = (function() { | ||
| 155 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | 157 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); |
| 156 | var dds = $('dd', dl); | 158 | var dds = $('dd', dl); |
| 157 | $(dds[1]).find('a').text(sch.lpName); | 159 | $(dds[1]).find('a').text(sch.lpName); |
| 158 | - $(dds[2]).data('nbbm', sch.clZbh).text(sch.clZbh); | 160 | + |
| 161 | + //车辆自编号 | ||
| 162 | + $(dds[2]).replaceWith(temps['line-schedule-nbbm-temp'](sch)); | ||
| 159 | if (sch.qdzArrDateJH) | 163 | if (sch.qdzArrDateJH) |
| 160 | $(dds[3]).text(sch.qdzArrDateJH); | 164 | $(dds[3]).text(sch.qdzArrDateJH); |
| 161 | 165 |
src/main/resources/static/real_control_v2/js/main.js
| 1 | /* main js */ | 1 | /* main js */ |
| 2 | - | ||
| 3 | var gb_main_ep = new EventProxy(), | 2 | var gb_main_ep = new EventProxy(), |
| 4 | res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function() { | 3 | res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function() { |
| 5 | var eq = gb_main_ep; | 4 | var eq = gb_main_ep; |
| @@ -105,8 +104,8 @@ var alt_confirm = function(content, succ, okBtn) { | @@ -105,8 +104,8 @@ var alt_confirm = function(content, succ, okBtn) { | ||
| 105 | labels: { | 104 | labels: { |
| 106 | Ok: okBtn, | 105 | Ok: okBtn, |
| 107 | Cancel: '取消' | 106 | Cancel: '取消' |
| 108 | - }, | ||
| 109 | - center: true | 107 | + } |
| 108 | + ,center: true | ||
| 110 | }); | 109 | }); |
| 111 | } | 110 | } |
| 112 | 111 |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| @@ -40,15 +40,28 @@ var gb_northToolbar = (function() { | @@ -40,15 +40,28 @@ var gb_northToolbar = (function() { | ||
| 40 | var handler = { | 40 | var handler = { |
| 41 | // device report list | 41 | // device report list |
| 42 | device_report: function(){ | 42 | device_report: function(){ |
| 43 | - $.get('/directive/findAll80', {requestCode: -1}, function(rs){ | ||
| 44 | - console.log(rs); | ||
| 45 | - }); | 43 | + open_modal('/real_control_v2/fragments/north/nav/report_80.html', {}, modal_opts); |
| 46 | }, | 44 | }, |
| 47 | directive_history: function(){ | 45 | directive_history: function(){ |
| 48 | open_modal('/real_control_v2/fragments/north/nav/directive_history.html', {}, modal_opts); | 46 | open_modal('/real_control_v2/fragments/north/nav/directive_history.html', {}, modal_opts); |
| 49 | }, | 47 | }, |
| 50 | tts_config: function(){ | 48 | tts_config: function(){ |
| 51 | open_modal('/real_control_v2/fragments/north/nav/tts_config.html', {}, modal_opts); | 49 | open_modal('/real_control_v2/fragments/north/nav/tts_config.html', {}, modal_opts); |
| 50 | + }, | ||
| 51 | + all_devices: function(){ | ||
| 52 | + open_modal('/real_control_v2/fragments/north/nav/all_devices.html', {}, modal_opts); | ||
| 53 | + }, | ||
| 54 | + device_online_rate: function(){ | ||
| 55 | + open_modal('/real_control_v2/fragments/north/nav/charts/device_online_rate.html', {}, modal_opts); | ||
| 56 | + }, | ||
| 57 | + turnout_rate: function () { | ||
| 58 | + open_modal('/real_control_v2/fragments/north/nav/charts/car_out_rate.html', {}, modal_opts); | ||
| 59 | + }, | ||
| 60 | + s_e_punctuality_rate: function () { | ||
| 61 | + open_modal('/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate.html', {}, modal_opts); | ||
| 62 | + }, | ||
| 63 | + s_e_punctuality_rate_line: function () { | ||
| 64 | + open_modal('/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html', {}, modal_opts); | ||
| 52 | } | 65 | } |
| 53 | } | 66 | } |
| 54 | })(); | 67 | })(); |
src/main/resources/static/real_control_v2/js/utils/ct_table.js
| 1 | var gb_ct_table = (function() { | 1 | var gb_ct_table = (function() { |
| 2 | function fixedHead($wrap) { | 2 | function fixedHead($wrap) { |
| 3 | + | ||
| 3 | $wrap.off('scroll').on('scroll', function() { | 4 | $wrap.off('scroll').on('scroll', function() { |
| 4 | var top = $(this).scrollTop(); | 5 | var top = $(this).scrollTop(); |
| 5 | //fixed head | 6 | //fixed head |
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
| @@ -115,6 +115,9 @@ var gb_svg_tooltip = (function() { | @@ -115,6 +115,9 @@ var gb_svg_tooltip = (function() { | ||
| 115 | var carIcon = '/assets/img/bus1.png'; | 115 | var carIcon = '/assets/img/bus1.png'; |
| 116 | //,normalIcon = '/assets/img/Marker_32px_583000_easyicon.net.png'; | 116 | //,normalIcon = '/assets/img/Marker_32px_583000_easyicon.net.png'; |
| 117 | var show_baidu_map = function(elem, list) { | 117 | var show_baidu_map = function(elem, list) { |
| 118 | + if(!window.BMap) | ||
| 119 | + return; | ||
| 120 | + | ||
| 118 | if(!isArray(list)) | 121 | if(!isArray(list)) |
| 119 | list=[list]; | 122 | list=[list]; |
| 120 | //init map | 123 | //init map |
src/main/resources/static/real_control_v2/js/utils/tts.js
| @@ -32,7 +32,13 @@ var gb_tts = (function() { | @@ -32,7 +32,13 @@ var gb_tts = (function() { | ||
| 32 | if (defaultConfig.queueModel == 1) | 32 | if (defaultConfig.queueModel == 1) |
| 33 | synth.cancel(); | 33 | synth.cancel(); |
| 34 | 34 | ||
| 35 | - t = gb_data_basic.codeToLine[lineCode].name + t; | 35 | + var lineName=gb_data_basic.codeToLine[lineCode].name; |
| 36 | + try { | ||
| 37 | + if (lineName) | ||
| 38 | + lineName.replace('行', '航'); | ||
| 39 | + } catch (e) {} | ||
| 40 | + | ||
| 41 | + t = lineName + t; | ||
| 36 | //延迟100毫秒,防止中断旧语音时 将新的语音也中断 | 42 | //延迟100毫秒,防止中断旧语音时 将新的语音也中断 |
| 37 | setTimeout(function() { | 43 | setTimeout(function() { |
| 38 | var msg = new SpeechSynthesisUtterance(t); | 44 | var msg = new SpeechSynthesisUtterance(t); |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
| 1 | -var gb_sch_websocket = (function() { | 1 | +var gb_sch_websocket = (function () { |
| 2 | 2 | ||
| 3 | var temps; | 3 | var temps; |
| 4 | - $.get('/real_control_v2/fragments/line_schedule/sys_mailbox.html', function(dom) { | 4 | + $.get('/real_control_v2/fragments/line_schedule/sys_mailbox.html', function (dom) { |
| 5 | temps = gb_common.compileTempByDom(dom); | 5 | temps = gb_common.compileTempByDom(dom); |
| 6 | }); | 6 | }); |
| 7 | 7 | ||
| 8 | var schSock = new SockJS('/sockjs/realcontrol'); | 8 | var schSock = new SockJS('/sockjs/realcontrol'); |
| 9 | 9 | ||
| 10 | - schSock.onopen = function(e) { | 10 | + schSock.onopen = function (e) { |
| 11 | console.log('webSocket[realcontrol] onopen'); | 11 | console.log('webSocket[realcontrol] onopen'); |
| 12 | setTimeout(regListen, 500); | 12 | setTimeout(regListen, 500); |
| 13 | }; | 13 | }; |
| 14 | //接收消息 | 14 | //接收消息 |
| 15 | - schSock.onmessage = function(e) { | 15 | + schSock.onmessage = function (e) { |
| 16 | try { | 16 | try { |
| 17 | var jsonMsg = $.parseJSON(e.data); | 17 | var jsonMsg = $.parseJSON(e.data); |
| 18 | msgHandle[jsonMsg.fn](jsonMsg); | 18 | msgHandle[jsonMsg.fn](jsonMsg); |
| @@ -21,8 +21,8 @@ var gb_sch_websocket = (function() { | @@ -21,8 +21,8 @@ var gb_sch_websocket = (function() { | ||
| 21 | } | 21 | } |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | - function regListen (){ | ||
| 25 | - //注册线路监听 | 24 | + function regListen() { |
| 25 | + //注册线路监听 | ||
| 26 | var data = { | 26 | var data = { |
| 27 | operCode: 'register_line', | 27 | operCode: 'register_line', |
| 28 | idx: gb_data_basic.line_idx | 28 | idx: gb_data_basic.line_idx |
| @@ -32,32 +32,52 @@ var gb_sch_websocket = (function() { | @@ -32,32 +32,52 @@ var gb_sch_websocket = (function() { | ||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | //断开 | 34 | //断开 |
| 35 | - schSock.onclose = function(e) { | 35 | + schSock.onclose = function (e) { |
| 36 | alert('和服务器连接断开....'); | 36 | alert('和服务器连接断开....'); |
| 37 | console.log('和服务器连接断开....'); | 37 | console.log('和服务器连接断开....'); |
| 38 | regListen(); | 38 | regListen(); |
| 39 | 39 | ||
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | + | ||
| 43 | + /** | ||
| 44 | + * 计算未处理消息 | ||
| 45 | + */ | ||
| 46 | + var calcUntreated = function (lineCode) { | ||
| 47 | + var size = $('li.line_schedule[data-id=' + lineCode + '] .sys-mailbox .sys-mail-item').length; | ||
| 48 | + $('#badge_untreated_num_' + lineCode).text(size); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + var calcUntreatedAll = function () { | ||
| 52 | + $('#main-tab-content li.line_schedule').each(function () { | ||
| 53 | + calcUntreated($(this).data('id')); | ||
| 54 | + }); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + | ||
| 42 | //80协议上报 | 58 | //80协议上报 |
| 43 | - var report80 = function(msg) { | ||
| 44 | - msg.dateStr = moment(msg.timestamp).format('HH:mm'); | ||
| 45 | - msg.text = gb_common.reqCode80[msg.data.requestCode]; | ||
| 46 | - | ||
| 47 | - var $item=$(temps['sys-note-80-temp'](msg)); | ||
| 48 | - findMailBox(msg.data.lineId).prepend($item); | ||
| 49 | - //tts | ||
| 50 | - var ttsMsg=$item.find('.uk-panel-title').text(); | ||
| 51 | - gb_tts.speak(ttsMsg, msg.data.lineId); | 59 | + var report80 = function (msg) { |
| 60 | + msg.dateStr = moment(msg.timestamp).format('HH:mm'); | ||
| 61 | + msg.text = gb_common.reqCode80[msg.data.requestCode]; | ||
| 62 | + if(!msg.text) | ||
| 63 | + msg.text='(未知的请求码 '+msg.data.requestCode+')'; | ||
| 64 | + | ||
| 65 | + var $item = $(temps['sys-note-80-temp'](msg)); | ||
| 66 | + findMailBox(msg.data.lineId).prepend($item); | ||
| 67 | + //tts | ||
| 68 | + var ttsMsg = $item.find('.uk-panel-title').text(); | ||
| 69 | + gb_tts.speak(ttsMsg, msg.data.lineId); | ||
| 70 | + | ||
| 71 | + calcUntreated(msg.data.lineId); | ||
| 52 | } | 72 | } |
| 53 | 73 | ||
| 54 | var waitRemoves = []; | 74 | var waitRemoves = []; |
| 55 | //车辆发出 | 75 | //车辆发出 |
| 56 | - var faChe = function(msg) { | 76 | + var faChe = function (msg) { |
| 57 | gb_schedule_table.updateSchedule(msg.t); | 77 | gb_schedule_table.updateSchedule(msg.t); |
| 58 | msg.domId = 'fache_' + msg.t.id + '_' + parseInt(Math.random() * 10000); | 78 | msg.domId = 'fache_' + msg.t.id + '_' + parseInt(Math.random() * 10000); |
| 59 | 79 | ||
| 60 | - var $item=$(temps['sys-note-42-temp'](msg)); | 80 | + var $item = $(temps['sys-note-42-temp'](msg)); |
| 61 | findMailBox(msg.t.xlBm).prepend($item); | 81 | findMailBox(msg.t.xlBm).prepend($item); |
| 62 | waitRemoves.push({ | 82 | waitRemoves.push({ |
| 63 | t: currentSecond(), | 83 | t: currentSecond(), |
| @@ -65,37 +85,65 @@ var gb_sch_websocket = (function() { | @@ -65,37 +85,65 @@ var gb_sch_websocket = (function() { | ||
| 65 | }); | 85 | }); |
| 66 | 86 | ||
| 67 | //tts | 87 | //tts |
| 68 | - var ttsMsg=$item.find('.title').text(); | 88 | + var ttsMsg = $item.find('.title').text(); |
| 69 | gb_tts.speak(ttsMsg, msg.t.xlBm); | 89 | gb_tts.speak(ttsMsg, msg.t.xlBm); |
| 70 | gb_schedule_table.calc_yfwf_num(msg.t.xlBm); | 90 | gb_schedule_table.calc_yfwf_num(msg.t.xlBm); |
| 91 | + | ||
| 92 | + calcUntreated(msg.t.xlBm); | ||
| 71 | } | 93 | } |
| 72 | 94 | ||
| 73 | //到达终点 | 95 | //到达终点 |
| 74 | - var zhongDian = function(msg) { | 96 | + var zhongDian = function (msg) { |
| 75 | gb_schedule_table.updateSchedule(msg.t); | 97 | gb_schedule_table.updateSchedule(msg.t); |
| 76 | msg.domId = 'zhongDian_' + msg.t.id + '_' + parseInt(Math.random() * 10000); | 98 | msg.domId = 'zhongDian_' + msg.t.id + '_' + parseInt(Math.random() * 10000); |
| 77 | 99 | ||
| 78 | - var $item=$(temps['sys-note-42_1-temp'](msg)); | 100 | + var $item = $(temps['sys-note-42_1-temp'](msg)); |
| 79 | findMailBox(msg.t.xlBm).prepend($item); | 101 | findMailBox(msg.t.xlBm).prepend($item); |
| 80 | waitRemoves.push({ | 102 | waitRemoves.push({ |
| 81 | t: currentSecond(), | 103 | t: currentSecond(), |
| 82 | dom: msg.domId | 104 | dom: msg.domId |
| 83 | }); | 105 | }); |
| 84 | //tts | 106 | //tts |
| 85 | - var ttsMsg=$item.find('.title').text(); | 107 | + var ttsMsg = $item.find('.title').text(); |
| 86 | gb_tts.speak(ttsMsg, msg.t.xlBm); | 108 | gb_tts.speak(ttsMsg, msg.t.xlBm); |
| 109 | + | ||
| 110 | + calcUntreated(msg.t.xlBm); | ||
| 87 | } | 111 | } |
| 88 | 112 | ||
| 89 | //服务器通知刷新班次 | 113 | //服务器通知刷新班次 |
| 90 | - var refreshSch = function(msg) { | 114 | + var refreshSch = function (msg) { |
| 91 | gb_schedule_table.updateSchedule(msg.ts); | 115 | gb_schedule_table.updateSchedule(msg.ts); |
| 116 | + /*//重新计算应发未发 | ||
| 117 | + var idx={}; | ||
| 118 | + $.each(msg.ts, function(i, t){ | ||
| 119 | + if(idx[t.xlBm]) | ||
| 120 | + return true; | ||
| 121 | + gb_schedule_table.calc_yfwf_num(t.xlBm); | ||
| 122 | + idx[t.xlBm]=1; | ||
| 123 | + });*/ | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + //80消息确认 | ||
| 127 | + var d80Confirm = function (msg) { | ||
| 128 | + $('.sys-mailbox .sys-note-80[data-id=' + msg.id + ']').remove(); | ||
| 129 | + //重新计算未读消息 | ||
| 130 | + calcUntreated(msg.lineId); | ||
| 131 | + //重新计算应发未发 | ||
| 132 | + gb_schedule_table.calc_yfwf_num(msg.lineId); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + //指令状态改变 | ||
| 136 | + var directiveStatus = function(msg){ | ||
| 137 | + gb_schedule_table.updateSchedule(msg.t); | ||
| 92 | } | 138 | } |
| 93 | 139 | ||
| 94 | var msgHandle = { | 140 | var msgHandle = { |
| 95 | report80: report80, | 141 | report80: report80, |
| 96 | faChe: faChe, | 142 | faChe: faChe, |
| 97 | zhongDian: zhongDian, | 143 | zhongDian: zhongDian, |
| 98 | - refreshSch: refreshSch | 144 | + refreshSch: refreshSch, |
| 145 | + d80Confirm: d80Confirm, | ||
| 146 | + directive: directiveStatus | ||
| 99 | } | 147 | } |
| 100 | 148 | ||
| 101 | function currentSecond() { | 149 | function currentSecond() { |
| @@ -113,11 +161,47 @@ var gb_sch_websocket = (function() { | @@ -113,11 +161,47 @@ var gb_sch_websocket = (function() { | ||
| 113 | return mbox; | 161 | return mbox; |
| 114 | } | 162 | } |
| 115 | 163 | ||
| 164 | + | ||
| 165 | + //42确定 | ||
| 166 | + $(document).on('click', '.sys-mailbox .sys-note-42 .uk-button-primary', function () { | ||
| 167 | + $(this).parents('.sys-note-42').remove(); | ||
| 168 | + | ||
| 169 | + var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length | ||
| 170 | + ,lineCode = $(this).parents('li.line_schedule').data('id'); | ||
| 171 | + | ||
| 172 | + $('#badge_untreated_num_' + lineCode).text(size); | ||
| 173 | + }); | ||
| 174 | + | ||
| 175 | + //80同意 | ||
| 176 | + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function () { | ||
| 177 | + var panel = $(this).parents('.sys-note-80') | ||
| 178 | + , id = panel.data('id'); | ||
| 179 | + | ||
| 180 | + reply80({id: id, reply: 0}); | ||
| 181 | + }); | ||
| 182 | + | ||
| 183 | + //80不同意 | ||
| 184 | + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button.reject', function () { | ||
| 185 | + var panel = $(this).parents('.sys-note-80') | ||
| 186 | + , id = panel.data('id'); | ||
| 187 | + | ||
| 188 | + reply80({id: id, reply: -1}); | ||
| 189 | + }); | ||
| 190 | + | ||
| 191 | + var reply80 = function (data, cb) { | ||
| 192 | + gb_common.$post('/directive/reply80', data, function (rs) { | ||
| 193 | + if (rs.msg) | ||
| 194 | + notify_succ(rs.msg); | ||
| 195 | + cb && cb(); | ||
| 196 | + }); | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + | ||
| 116 | //定时到离站信使清理掉 | 200 | //定时到离站信使清理掉 |
| 117 | - ! function() { | 201 | + !function () { |
| 118 | var f = arguments.callee, | 202 | var f = arguments.callee, |
| 119 | ct = Date.parse(new Date()) / 1000, | 203 | ct = Date.parse(new Date()) / 1000, |
| 120 | - item; | 204 | + item, elem; |
| 121 | try { | 205 | try { |
| 122 | for (var i = 0; i < 1000; i++) { | 206 | for (var i = 0; i < 1000; i++) { |
| 123 | if (waitRemoves.length == 0) | 207 | if (waitRemoves.length == 0) |
| @@ -125,12 +209,17 @@ var gb_sch_websocket = (function() { | @@ -125,12 +209,17 @@ var gb_sch_websocket = (function() { | ||
| 125 | item = waitRemoves[0]; | 209 | item = waitRemoves[0]; |
| 126 | if (ct - item.t >= 30) { | 210 | if (ct - item.t >= 30) { |
| 127 | waitRemoves.shift(); | 211 | waitRemoves.shift(); |
| 128 | - $('#' + item.dom).remove(); | 212 | + elem = $('#' + item.dom); |
| 213 | + if (elem) | ||
| 214 | + elem.remove(); | ||
| 129 | } | 215 | } |
| 130 | } | 216 | } |
| 131 | } catch (e) { | 217 | } catch (e) { |
| 132 | console.log(e); | 218 | console.log(e); |
| 133 | } | 219 | } |
| 220 | + | ||
| 221 | + //计算未读消息 | ||
| 222 | + calcUntreatedAll(); | ||
| 134 | setTimeout(f, 5000); | 223 | setTimeout(f, 5000); |
| 135 | }(); | 224 | }(); |
| 136 | 225 |
src/main/resources/static/real_control_v2/main.html
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | <div class="uk-width-4-10"> | 38 | <div class="uk-width-4-10"> |
| 39 | <div class="uk-panel"> | 39 | <div class="uk-panel"> |
| 40 | <h2 class="north-logo"> | 40 | <h2 class="north-logo"> |
| 41 | - <i class="uk-icon-life-ring"></i> 青浦公交线路调度 | 41 | + <i class="uk-icon-life-ring"></i> 闵行公交线路调度 |
| 42 | </h2> | 42 | </h2> |
| 43 | </div> | 43 | </div> |
| 44 | </div> | 44 | </div> |
| @@ -128,6 +128,9 @@ | @@ -128,6 +128,9 @@ | ||
| 128 | <script src="/real_control_v2/js/websocket/sch_websocket.js"></script> | 128 | <script src="/real_control_v2/js/websocket/sch_websocket.js"></script> |
| 129 | <!-- tts --> | 129 | <!-- tts --> |
| 130 | <script src="/real_control_v2/js/utils/tts.js"></script> | 130 | <script src="/real_control_v2/js/utils/tts.js"></script> |
| 131 | + | ||
| 132 | + <!-- echart --> | ||
| 133 | + <script src="/real_control_v2/assets/echarts-3/echarts.js"></script> | ||
| 131 | </body> | 134 | </body> |
| 132 | 135 | ||
| 133 | </html> | 136 | </html> |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/map/platform/baidu.js
| @@ -14,6 +14,10 @@ var gb_map_baidu = (function(){ | @@ -14,6 +14,10 @@ var gb_map_baidu = (function(){ | ||
| 14 | var baiduInstance = { | 14 | var baiduInstance = { |
| 15 | //初始化 | 15 | //初始化 |
| 16 | init: function(){ | 16 | init: function(){ |
| 17 | + if(!window.BMap){ | ||
| 18 | + alert('地图没有加载成功,请确认是否能正常连接外网!!'); | ||
| 19 | + return; | ||
| 20 | + } | ||
| 17 | map = new BMap.Map($(gb_map_consts.mapContainer)[0]); | 21 | map = new BMap.Map($(gb_map_consts.mapContainer)[0]); |
| 18 | //中心点和缩放级别 | 22 | //中心点和缩放级别 |
| 19 | map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 15); | 23 | map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 15); |