Commit 3420201950b2003b844a8dc3dbf4976501ff521b

Authored by 潘钊
2 parents 085d4e1d 1752b835

Merge branch 'minhang' into qingpu

Showing 53 changed files with 1978 additions and 1304 deletions
src/main/java/com/bsth/common/Constants.java
@@ -32,4 +32,5 @@ public class Constants { @@ -32,4 +32,5 @@ public class Constants {
32 public static final String UPSTREAM_URL = "/control/upstream"; 32 public static final String UPSTREAM_URL = "/control/upstream";
33 33
34 public static final String SESSION_USERNAME = "sessionUserName"; 34 public static final String SESSION_USERNAME = "sessionUserName";
  35 + public static final String COMPANY_AUTHORITYS = "cmyAuths";
35 } 36 }
src/main/java/com/bsth/controller/forms/ExportController.java
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
13 import org.springframework.web.bind.annotation.RequestParam; 13 import org.springframework.web.bind.annotation.RequestParam;
14 import org.springframework.web.bind.annotation.RestController; 14 import org.springframework.web.bind.annotation.RestController;
15 15
  16 +import com.bsth.entity.mcy_forms.Changetochange;
16 import com.bsth.entity.mcy_forms.Linepasswengerflow; 17 import com.bsth.entity.mcy_forms.Linepasswengerflow;
17 import com.bsth.entity.mcy_forms.Operationservice; 18 import com.bsth.entity.mcy_forms.Operationservice;
18 import com.bsth.entity.mcy_forms.Shifday; 19 import com.bsth.entity.mcy_forms.Shifday;
@@ -274,7 +275,48 @@ public class ExportController { @@ -274,7 +275,48 @@ public class ExportController {
274 return resList; 275 return resList;
275 } 276 }
276 277
277 - 278 +
  279 + //换人换车情况日统计
  280 + @RequestMapping(value = "/changetochangeExport",method = RequestMethod.POST)
  281 + public List<Map<String, Object>> changetochangeExport(@RequestParam Map<String, Object> map){
  282 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  283 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  284 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  285 + ReportUtils ee = new ReportUtils();
  286 + List<Changetochange> changetochange = formsService.changetochange(map);
  287 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  288 + for(Changetochange l : changetochange){
  289 + Map<String, Object> m = new HashMap<String, Object>();
  290 + m.put("rq",l.getRq());
  291 + m.put("gs",l.getGs());
  292 + m.put("fgs",l.getFgs());
  293 + m.put("xl",l.getXl());
  294 + m.put("lp",l.getLp());
  295 + m.put("fssj",l.getFssj());
  296 + m.put("xgsj",l.getXgsj());
  297 + m.put("pcch",l.getPcch());
  298 + m.put("pcry",l.getPcry());
  299 + m.put("jhch",l.getJhch());
  300 + m.put("jhgh",l.getJhgh());
  301 + m.put("sjch",l.getSjch());
  302 + m.put("sjgh",l.getSjgh());
  303 + m.put("yy",l.getYy());
  304 + m.put("xgr",l.getXgr());
  305 + resList.add(m);
  306 + }
  307 +
  308 + try {
  309 + listI.add(resList.iterator());
  310 + String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
  311 + ee.excelReplace(listI, new Object[] { map }, path+"mould\\changetochange.xls",
  312 + path+"export\\换人换车情况日统计" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  313 + } catch (Exception e) {
  314 + e.printStackTrace();
  315 + }
  316 + return resList;
  317 + }
  318 +
  319 +
278 320
279 321
280 322
src/main/java/com/bsth/controller/oil/YlbController.java
@@ -49,8 +49,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{ @@ -49,8 +49,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
49 */ 49 */
50 @RequestMapping(value = "/obtain",method = RequestMethod.GET) 50 @RequestMapping(value = "/obtain",method = RequestMethod.GET)
51 public Map<String, Object> obtain(@RequestParam Map<String, Object> map){ 51 public Map<String, Object> obtain(@RequestParam Map<String, Object> map){
52 - String rq=map.get("rq").toString();  
53 - Map<String, Object> list=yblService.obtain(rq); 52 + Map<String, Object> list=yblService.obtain(map);
54 System.out.println(); 53 System.out.println();
55 return list; 54 return list;
56 } 55 }
src/main/java/com/bsth/controller/sys/CompanyAuthorityController.java 0 → 100644
  1 +package com.bsth.controller.sys;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.bsth.controller.BaseController;
  5 +import com.bsth.entity.sys.CompanyAuthority;
  6 +import com.bsth.service.sys.CompanyAuthorityService;
  7 +import org.apache.commons.lang3.StringEscapeUtils;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import java.util.List;
  14 +import java.util.Map;
  15 +
  16 +/**
  17 + * Created by panzhao on 2016/11/22.
  18 + */
  19 +@RestController
  20 +@RequestMapping("companyAuthority")
  21 +public class CompanyAuthorityController extends BaseController<CompanyAuthority, Integer>{
  22 +
  23 + @Autowired
  24 + CompanyAuthorityService companyAuthorityService;
  25 +
  26 + @RequestMapping(value = "save")
  27 + public Map<String, Object> save(@RequestParam Integer roleId, @RequestParam String authJsonStr){
  28 + authJsonStr = StringEscapeUtils.unescapeHtml4(authJsonStr);
  29 + System.out.println(authJsonStr);
  30 + List<CompanyAuthority> list = JSONArray.parseArray(authJsonStr, CompanyAuthority.class);
  31 + return companyAuthorityService.save(roleId, list);
  32 + }
  33 +}
src/main/java/com/bsth/controller/sys/UserController.java
1 package com.bsth.controller.sys; 1 package com.bsth.controller.sys;
2 2
3 -import java.util.HashMap;  
4 -import java.util.Map;  
5 -  
6 -import javax.servlet.http.HttpServletRequest;  
7 -import javax.servlet.http.HttpSession;  
8 - 3 +import com.bsth.common.Constants;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.controller.BaseController;
  6 +import com.bsth.controller.sys.dto.CompanyData;
  7 +import com.bsth.controller.sys.util.RSAUtils;
  8 +import com.bsth.entity.sys.CompanyAuthority;
  9 +import com.bsth.entity.sys.SysUser;
  10 +import com.bsth.security.util.SecurityUtils;
  11 +import com.bsth.service.sys.CompanyAuthorityService;
  12 +import com.bsth.service.sys.SysUserService;
  13 +import com.google.common.collect.ArrayListMultimap;
9 import org.apache.commons.lang3.StringUtils; 14 import org.apache.commons.lang3.StringUtils;
10 import org.slf4j.Logger; 15 import org.slf4j.Logger;
11 import org.slf4j.LoggerFactory; 16 import org.slf4j.LoggerFactory;
@@ -18,13 +23,9 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -18,13 +23,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
18 import org.springframework.web.bind.annotation.RequestParam; 23 import org.springframework.web.bind.annotation.RequestParam;
19 import org.springframework.web.bind.annotation.RestController; 24 import org.springframework.web.bind.annotation.RestController;
20 25
21 -import com.bsth.common.Constants;  
22 -import com.bsth.common.ResponseCode;  
23 -import com.bsth.controller.BaseController;  
24 -import com.bsth.controller.sys.util.RSAUtils;  
25 -import com.bsth.entity.sys.SysUser;  
26 -import com.bsth.security.util.SecurityUtils;  
27 -import com.bsth.service.sys.SysUserService; 26 +import javax.servlet.http.HttpServletRequest;
  27 +import javax.servlet.http.HttpSession;
  28 +import java.util.*;
28 29
29 @RestController 30 @RestController
30 @RequestMapping("user") 31 @RequestMapping("user")
@@ -34,6 +35,9 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -34,6 +35,9 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
34 35
35 @Autowired 36 @Autowired
36 SysUserService sysUserService; 37 SysUserService sysUserService;
  38 +
  39 + @Autowired
  40 + CompanyAuthorityService companyAuthorityService;
37 41
38 @RequestMapping(value = "/login/jCryptionKey") 42 @RequestMapping(value = "/login/jCryptionKey")
39 public Map<String, Object> jCryptionKey(HttpServletRequest request){ 43 public Map<String, Object> jCryptionKey(HttpServletRequest request){
@@ -97,7 +101,11 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -97,7 +101,11 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
97 SecurityUtils.login(user, request); 101 SecurityUtils.login(user, request);
98 //session里写入用户名,webSocket连接时标识身份用 102 //session里写入用户名,webSocket连接时标识身份用
99 session.setAttribute(Constants.SESSION_USERNAME, user.getUserName()); 103 session.setAttribute(Constants.SESSION_USERNAME, user.getUserName());
100 - 104 +
  105 + //获取公司权限数据
  106 + List<CompanyAuthority> cmyAuths=companyAuthorityService.findByUser(user);
  107 + session.setAttribute(Constants.COMPANY_AUTHORITYS, cmyAuths);
  108 +
101 captchaMap.remove(userName); 109 captchaMap.remove(userName);
102 rs.put("status", ResponseCode.SUCCESS); 110 rs.put("status", ResponseCode.SUCCESS);
103 } catch (Exception e) { 111 } catch (Exception e) {
@@ -106,6 +114,43 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -106,6 +114,43 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
106 } 114 }
107 return rs; 115 return rs;
108 } 116 }
  117 +
  118 + /**
  119 + * 返回当前用户的公司权限数据,用于构建页面级联下拉框
  120 + * @return
  121 + */
  122 + @RequestMapping("companyData")
  123 + public List<CompanyData> companyData(HttpServletRequest request){
  124 + List<CompanyData> rs = new ArrayList<>();
  125 + CompanyData companyData;
  126 +
  127 + ArrayListMultimap<String, CompanyAuthority> map = ArrayListMultimap.create();
  128 + List<CompanyAuthority> cmyAuths = (List<CompanyAuthority>) request.getSession().getAttribute(Constants.COMPANY_AUTHORITYS);
  129 +
  130 + for(CompanyAuthority cAuth : cmyAuths){
  131 + map.put(cAuth.getCompanyCode()+"_"+cAuth.getCompanyName(), cAuth);
  132 + }
  133 +
  134 + Set<String> keys = map.keySet();
  135 + String[] temps;
  136 + for(String k : keys){
  137 + temps = k.split("_");
  138 +
  139 + companyData = new CompanyData();
  140 + companyData.setCompanyCode(temps[0]);
  141 + companyData.setCompanyName(temps[1]);
  142 + companyData.setChildren(new ArrayList<CompanyData.ChildrenCompany>());
  143 +
  144 + cmyAuths = map.get(k);
  145 + for(CompanyAuthority c : cmyAuths){
  146 + companyData.getChildren().add(new CompanyData.ChildrenCompany(c.getSubCompanyCode(), c.getSubCompanyName()));
  147 + }
  148 +
  149 + rs.add(companyData);
  150 + }
  151 +
  152 + return rs;
  153 + }
109 154
110 @RequestMapping(value = "/login/captchaStatus") 155 @RequestMapping(value = "/login/captchaStatus")
111 public int captchaStatus(String userName){ 156 public int captchaStatus(String userName){
@@ -162,7 +207,7 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -162,7 +207,7 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
162 * @Description: TODO(修改密码) 207 * @Description: TODO(修改密码)
163 * @param oldPWD 208 * @param oldPWD
164 * 原始密码 209 * 原始密码
165 - * @param newwPWD 210 + * @param newPWD
166 * 新密码 211 * 新密码
167 * @param cnewPWD 212 * @param cnewPWD
168 * 确认新密码 213 * 确认新密码
src/main/java/com/bsth/controller/sys/dto/CompanyData.java 0 → 100644
  1 +package com.bsth.controller.sys.dto;
  2 +
  3 +import java.util.List;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/11/22.
  7 + */
  8 +public class CompanyData {
  9 +
  10 + private String companyCode;
  11 +
  12 + private String companyName;
  13 +
  14 + private List<ChildrenCompany> children;
  15 +
  16 + public String getCompanyCode() {
  17 + return companyCode;
  18 + }
  19 +
  20 + public void setCompanyCode(String companyCode) {
  21 + this.companyCode = companyCode;
  22 + }
  23 +
  24 + public String getCompanyName() {
  25 + return companyName;
  26 + }
  27 +
  28 + public void setCompanyName(String companyName) {
  29 + this.companyName = companyName;
  30 + }
  31 +
  32 + public List<ChildrenCompany> getChildren() {
  33 + return children;
  34 + }
  35 +
  36 + public void setChildren(List<ChildrenCompany> children) {
  37 + this.children = children;
  38 + }
  39 +
  40 + public static class ChildrenCompany {
  41 + private String code;
  42 +
  43 + private String name;
  44 +
  45 + public ChildrenCompany(String code, String name){
  46 + this.code = code;
  47 + this.name = name;
  48 + }
  49 +
  50 + public String getName() {
  51 + return name;
  52 + }
  53 +
  54 + public void setName(String name) {
  55 + this.name = name;
  56 + }
  57 +
  58 + public String getCode() {
  59 + return code;
  60 + }
  61 +
  62 + public void setCode(String code) {
  63 + this.code = code;
  64 + }
  65 + }
  66 +}
src/main/java/com/bsth/data/schedule/thread/SchedulePstThread.java
1 package com.bsth.data.schedule.thread; 1 package com.bsth.data.schedule.thread;
2 2
3 -import java.util.LinkedList;  
4 -  
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.stereotype.Component;  
7 -  
8 import com.bsth.data.schedule.DayOfSchedule; 3 import com.bsth.data.schedule.DayOfSchedule;
9 import com.bsth.entity.realcontrol.ScheduleRealInfo; 4 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 5 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.orm.jpa.JpaObjectRetrievalFailureException;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import javax.persistence.EntityNotFoundException;
  13 +import java.util.LinkedList;
11 14
12 /** 15 /**
13 - *  
14 - * @ClassName: SchedulePstThread  
15 - * @Description: TODO(班次异步持久化)  
16 - * @author PanZhao  
17 - * @date 2016年8月24日 上午1:47:05  
18 - * 16 + * @author PanZhao
  17 + * @ClassName: SchedulePstThread
  18 + * @Description: TODO(班次异步持久化)
  19 + * @date 2016年8月24日 上午1:47:05
19 */ 20 */
20 @Component 21 @Component
21 -public class SchedulePstThread extends Thread{  
22 -  
23 - @Autowired  
24 - ScheduleRealInfoRepository scheduleRepository;  
25 -  
26 - @Override  
27 - public void run() {  
28 - LinkedList<ScheduleRealInfo> list = DayOfSchedule.pstBuffer;  
29 -  
30 - ScheduleRealInfo schedule;  
31 - for (int i = 0; i < 1000; i++) {  
32 - schedule = list.poll();  
33 - if (null == schedule)  
34 - break;  
35 -  
36 - scheduleRepository.save(schedule);  
37 - }  
38 - } 22 +public class SchedulePstThread extends Thread {
  23 +
  24 + @Autowired
  25 + ScheduleRealInfoRepository scheduleRepository;
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Override
  30 + public void run() {
  31 +
  32 + LinkedList<ScheduleRealInfo> list = DayOfSchedule.pstBuffer;
  33 +
  34 + ScheduleRealInfo schedule;
  35 + for (int i = 0; i < 1000; i++) {
  36 + schedule = list.poll();
  37 + if (null == schedule)
  38 + break;
  39 +
  40 + try {
  41 + scheduleRepository.save(schedule);
  42 + }
  43 + catch (JpaObjectRetrievalFailureException e1){
  44 + logger.error("JpaObjectRetrievalFailureException error.... 可忽略");
  45 + }
  46 + catch(EntityNotFoundException e2){
  47 + logger.error("EntityNotFoundException error.... 可忽略");
  48 + }
  49 + catch (Exception e) {
  50 + logger.error("", e);
  51 + }
  52 + }
  53 + }
39 } 54 }
src/main/java/com/bsth/entity/mcy_forms/Changetochange.java
1 package com.bsth.entity.mcy_forms; 1 package com.bsth.entity.mcy_forms;
2 2
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_chtoch")
3 public class Changetochange { 12 public class Changetochange {
  13 + @Id
  14 + @GeneratedValue
  15 + private Integer id;
  16 +
  17 + private String rq;//日期
  18 +
  19 + private String gs;//公司
  20 +
  21 + private String fgs;//分公司
  22 +
  23 + private String xl;//线路
  24 +
  25 + private String lp;//路牌
  26 +
  27 + private String fssj;//发生时间
  28 +
  29 + private String xgsj;//修改时间
  30 +
  31 + private String pcch;//配车车号
  32 +
  33 + private String pcry;//配车人员
  34 +
  35 + private String jhch;//计划车号
  36 +
  37 + private String jhgh;//计划工号
  38 +
  39 + private String sjch;//实际车号
  40 +
  41 + private String sjgh;//实际工号
  42 +
  43 + private String yy;//原因
  44 +
  45 + private String xgr;//修改人
  46 +
  47 +
  48 + public Integer getId() {
  49 + return id;
  50 + }
  51 +
  52 + public void setId(Integer id) {
  53 + this.id = id;
  54 + }
  55 +
  56 + public String getRq() {
  57 + return rq;
  58 + }
  59 +
  60 + public void setRq(String rq) {
  61 + this.rq = rq;
  62 + }
  63 +
  64 + public String getGs() {
  65 + return gs;
  66 + }
  67 +
  68 + public void setGs(String gs) {
  69 + this.gs = gs;
  70 + }
  71 +
  72 + public String getFgs() {
  73 + return fgs;
  74 + }
  75 +
  76 + public void setFgs(String fgs) {
  77 + this.fgs = fgs;
  78 + }
  79 +
  80 + public String getXl() {
  81 + return xl;
  82 + }
  83 +
  84 + public void setXl(String xl) {
  85 + this.xl = xl;
  86 + }
  87 +
  88 + public String getLp() {
  89 + return lp;
  90 + }
  91 +
  92 + public void setLp(String lp) {
  93 + this.lp = lp;
  94 + }
  95 +
  96 + public String getFssj() {
  97 + return fssj;
  98 + }
  99 +
  100 + public void setFssj(String fssj) {
  101 + this.fssj = fssj;
  102 + }
  103 +
  104 + public String getXgsj() {
  105 + return xgsj;
  106 + }
  107 +
  108 + public void setXgsj(String xgsj) {
  109 + this.xgsj = xgsj;
  110 + }
  111 +
  112 + public String getPcch() {
  113 + return pcch;
  114 + }
  115 +
  116 + public void setPcch(String pcch) {
  117 + this.pcch = pcch;
  118 + }
  119 +
  120 + public String getPcry() {
  121 + return pcry;
  122 + }
  123 +
  124 + public void setPcry(String pcry) {
  125 + this.pcry = pcry;
  126 + }
  127 +
  128 +
  129 + public String getJhch() {
  130 + return jhch;
  131 + }
  132 +
  133 + public void setJhch(String jhch) {
  134 + this.jhch = jhch;
  135 + }
  136 +
  137 + public String getJhgh() {
  138 + return jhgh;
  139 + }
  140 +
  141 + public void setJhgh(String jhgh) {
  142 + this.jhgh = jhgh;
  143 + }
  144 +
  145 + public String getSjch() {
  146 + return sjch;
  147 + }
  148 +
  149 + public void setSjch(String sjch) {
  150 + this.sjch = sjch;
  151 + }
  152 +
  153 + public String getSjgh() {
  154 + return sjgh;
  155 + }
  156 +
  157 + public void setSjgh(String sjgh) {
  158 + this.sjgh = sjgh;
  159 + }
  160 +
  161 + public String getYy() {
  162 + return yy;
  163 + }
  164 +
  165 + public void setYy(String yy) {
  166 + this.yy = yy;
  167 + }
  168 +
  169 + public String getXgr() {
  170 + return xgr;
  171 + }
  172 +
  173 + public void setXgr(String xgr) {
  174 + this.xgr = xgr;
  175 + }
  176 +
4 177
5 178
6 } 179 }
src/main/java/com/bsth/entity/sys/CompanyAuthority.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/11/22.
  7 + */
  8 +@Entity
  9 +@Table(name = "bsth_c_sys_company_auth")
  10 +public class CompanyAuthority {
  11 +
  12 + @Id
  13 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  14 + private Integer id;
  15 +
  16 + /** 公司代码 */
  17 + private String companyCode;
  18 +
  19 + /** 公司名称 */
  20 + private String companyName;
  21 +
  22 + /** 分公司代码 */
  23 + private String subCompanyCode;
  24 +
  25 + /** 分公司代码 */
  26 + private String subCompanyName;
  27 +
  28 + private Integer roleId;
  29 +
  30 + public String getSubCompanyName() {
  31 + return subCompanyName;
  32 + }
  33 +
  34 + public void setSubCompanyName(String subCompanyName) {
  35 + this.subCompanyName = subCompanyName;
  36 + }
  37 +
  38 + public String getSubCompanyCode() {
  39 + return subCompanyCode;
  40 + }
  41 +
  42 + public void setSubCompanyCode(String subCompanyCode) {
  43 + this.subCompanyCode = subCompanyCode;
  44 + }
  45 +
  46 + public String getCompanyName() {
  47 + return companyName;
  48 + }
  49 +
  50 + public void setCompanyName(String companyName) {
  51 + this.companyName = companyName;
  52 + }
  53 +
  54 + public String getCompanyCode() {
  55 + return companyCode;
  56 + }
  57 +
  58 + public void setCompanyCode(String companyCode) {
  59 + this.companyCode = companyCode;
  60 + }
  61 +
  62 + public Integer getId() {
  63 + return id;
  64 + }
  65 +
  66 + public void setId(Integer id) {
  67 + this.id = id;
  68 + }
  69 +
  70 + public Integer getRoleId() {
  71 + return roleId;
  72 + }
  73 +
  74 + public void setRoleId(Integer roleId) {
  75 + this.roleId = roleId;
  76 + }
  77 +}
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -37,14 +37,14 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -37,14 +37,14 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
37 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp," 37 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,d.sender,d.timestamp,"
38 + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 " 38 + " d.txt_content FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 "
39 + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " 39 + "d ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND "
40 - + "r.schedule_date like %?2% and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true) 40 + + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% order by d.timestamp",nativeQuery=true)
41 List<Object[]> historyMessage(String line,String date,String code); 41 List<Object[]> historyMessage(String line,String date,String code);
42 42
43 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs " 43 @Query(value="SELECT r.xl_name,r.lp_name,r.cl_zbh,count(*) as cs "
44 + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d " 44 + " FROM bsth_c_s_sp_info_real r RIGHT JOIN bsth_v_directive_60 d "
45 + " ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND " 45 + " ON r.id = d.sch WHERE d.is_dispatch = 1 AND r.xl_bm like %?1% AND "
46 - + " r.schedule_date like %?2% and r.cl_zbh like %?3% group by "  
47 - + " lp_name,xl_name,cl_zbh order by d.timestamp",nativeQuery=true) 46 + + " DATE_FORMAT(r.schedule_date,'%Y-%m-%d') = ?2 and r.cl_zbh like %?3% group by "
  47 + + " lp_name,xl_name,cl_zbh",nativeQuery=true)
48 List<Object[]> historyMessageCount(String line,String date,String code); 48 List<Object[]> historyMessageCount(String line,String date,String code);
49 49
50 @Query(value = "select max(id) from ScheduleRealInfo") 50 @Query(value = "select max(id) from ScheduleRealInfo")
@@ -100,10 +100,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -100,10 +100,10 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
100 void deleteByLineCodeAndDate(String xlBm, String schDate); 100 void deleteByLineCodeAndDate(String xlBm, String schDate);
101 101
102 //去掉了 xlBm is not null 102 //去掉了 xlBm is not null
103 - @Query(value="select s from ScheduleRealInfo s where (s.xlBm = ?1 or s.xlBm is not null) and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2") 103 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2")
104 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date); 104 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date);
105 105
106 - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where (s.xlBm = ?1 or s.xlBm is not null) and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh") 106 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh")
107 List<Map<String,Object>> yesterdayDataList(String line,String date); 107 List<Map<String,Object>> yesterdayDataList(String line,String date);
108 108
109 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") 109 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
src/main/java/com/bsth/repository/sys/CompanyAuthorityRepository.java 0 → 100644
  1 +package com.bsth.repository.sys;
  2 +
  3 +import com.bsth.entity.sys.CompanyAuthority;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.data.jpa.repository.Modifying;
  6 +import org.springframework.data.jpa.repository.Query;
  7 +import org.springframework.stereotype.Repository;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * Created by panzhao on 2016/11/22.
  13 + */
  14 +@Repository
  15 +public interface CompanyAuthorityRepository extends BaseRepository<CompanyAuthority, Integer>{
  16 +
  17 + @Modifying
  18 + @Query(value="DELETE FROM CompanyAuthority WHERE roleId = ?1")
  19 + void deleteByRoleId(Integer roleId);
  20 +
  21 + @Query(value = "select ca from CompanyAuthority ca where ca.roleId in ?1")
  22 + List<CompanyAuthority> findByRoles(List<Integer> idx);
  23 +}
src/main/java/com/bsth/repository/sys/ModuleRepository.java
1 package com.bsth.repository.sys; 1 package com.bsth.repository.sys;
2 2
3 -import java.util.List;  
4 -import java.util.Set;  
5 - 3 +import com.bsth.entity.sys.Module;
  4 +import com.bsth.repository.BaseRepository;
6 import org.springframework.data.jpa.domain.Specification; 5 import org.springframework.data.jpa.domain.Specification;
7 -import org.springframework.data.jpa.repository.EntityGraph;  
8 import org.springframework.data.jpa.repository.Query; 6 import org.springframework.data.jpa.repository.Query;
9 import org.springframework.stereotype.Repository; 7 import org.springframework.stereotype.Repository;
10 8
11 -import com.bsth.entity.sys.Module;  
12 -import com.bsth.repository.BaseRepository; 9 +import java.util.List;
  10 +import java.util.Set;
13 11
14 @Repository 12 @Repository
15 -public interface ModuleRepository extends BaseRepository<Module, Integer>{  
16 -  
17 - @Query("select m from Module m where m.groupType in ?1")  
18 - List<Module> findByGroupType(String[] groupType);  
19 -  
20 - List<Module> findByPId(Integer pId);  
21 -  
22 - @Query("select m from Module m where m.id in ?1")  
23 - Set<Module> findByIds(List<Integer> ids);  
24 -  
25 - @Override  
26 - List<Module> findAll(Specification<Module> spec); 13 +public interface ModuleRepository extends BaseRepository<Module, Integer> {
  14 +
  15 + @Query("select m from Module m where m.groupType in ?1")
  16 + List<Module> findByGroupType(String[] groupType);
  17 +
  18 + List<Module> findByPId(Integer pId);
  19 +
  20 + @Query("select m from Module m where m.id in ?1")
  21 + Set<Module> findByIds(List<Integer> ids);
  22 +
  23 + @Override
  24 + List<Module> findAll(Specification<Module> spec);
  25 +
27 } 26 }
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -3,8 +3,10 @@ package com.bsth.service.forms.impl; @@ -3,8 +3,10 @@ package com.bsth.service.forms.impl;
3 import java.sql.ResultSet; 3 import java.sql.ResultSet;
4 import java.sql.SQLException; 4 import java.sql.SQLException;
5 import java.text.DecimalFormat; 5 import java.text.DecimalFormat;
  6 +import java.text.ParseException;
6 import java.text.SimpleDateFormat; 7 import java.text.SimpleDateFormat;
7 import java.util.ArrayList; 8 import java.util.ArrayList;
  9 +import java.util.Date;
8 import java.util.HashMap; 10 import java.util.HashMap;
9 import java.util.Iterator; 11 import java.util.Iterator;
10 import java.util.List; 12 import java.util.List;
@@ -226,11 +228,66 @@ public class FormsServiceImpl implements FormsService{ @@ -226,11 +228,66 @@ public class FormsServiceImpl implements FormsService{
226 } 228 }
227 229
228 //换人换车情况日统计 230 //换人换车情况日统计
229 - @Override  
230 - public List<Changetochange> changetochange(Map<String, Object> map) {  
231 -  
232 - return null;  
233 - } 231 + String rq;
  232 + @Override
  233 + public List<Changetochange> changetochange(Map<String, Object> map) {
  234 +
  235 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd") ;
  236 + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日") ;
  237 + Date d = null ;
  238 + Date d1 = null ;
  239 + try {
  240 + d = sdf.parse(map.get("startDate").toString());
  241 + d1 = sdf.parse(map.get("endDate").toString());
  242 + } catch (ParseException e) {
  243 +
  244 + e.printStackTrace();
  245 + }
  246 + String rq2=sdf1.format(d);
  247 + String rq3=sdf1.format(d1);
  248 +
  249 + rq=rq2+"-"+ rq3;
  250 +
  251 + String sql=" select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 ";
  252 + if(!map.get("startDate").toString().equals(" ")&&!map.get("endDate").toString().equals(" ")){
  253 + sql+= "and DATE_FORMAT( c.rq,'%Y-%m-%d') BETWEEN '"+map.get("startDate").toString()+"' and '"+map.get("endDate").toString()+"'";
  254 + }
  255 + if(!map.get("line").equals("")){
  256 + sql+="and line_code='"+map.get("line")+"'";
  257 + }
  258 + if(map.get("sel").equals("2")){
  259 + sql+=" and c.pcch!=c.pcry";
  260 + }else if(map.get("sel").equals("1")){
  261 + sql+=" and c.jhgh!=c.sjgh";
  262 + }
  263 +
  264 +
  265 + List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() {
  266 +
  267 + @Override
  268 + public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
  269 + Changetochange chan= new Changetochange();
  270 +
  271 + chan.setRq(rq);
  272 + chan.setGs(arg0.getString("gs").toString());
  273 + chan.setFgs(arg0.getString("fgs").toString());
  274 + chan.setXl(arg0.getString("xl").toString());
  275 + chan.setLp(arg0.getString("lp").toString());
  276 + chan.setFssj(arg0.getString("fssj").toString());
  277 + chan.setXgsj(arg0.getString("xgsj").toString());
  278 + chan.setPcch(arg0.getString("pcch").toString());
  279 + chan.setPcry(arg0.getString("pcry").toString());
  280 + chan.setJhch(arg0.getString("jhch").toString());
  281 + chan.setJhgh(arg0.getString("jhgh").toString());
  282 + chan.setSjch(arg0.getString("sjch").toString());
  283 + chan.setSjgh(arg0.getString("sjgh").toString());
  284 + chan.setYy(arg0.getString("yy").toString());
  285 + chan.setXgr(arg0.getString("xgr").toString());
  286 + return chan;
  287 + }
  288 + });
  289 + return list;
  290 + }
234 291
235 292
236 //路单数据 293 //路单数据
src/main/java/com/bsth/service/oil/YlbService.java
@@ -7,7 +7,7 @@ import com.bsth.entity.oil.Ylb; @@ -7,7 +7,7 @@ import com.bsth.entity.oil.Ylb;
7 import com.bsth.service.BaseService; 7 import com.bsth.service.BaseService;
8 8
9 public interface YlbService extends BaseService<Ylb, Integer>{ 9 public interface YlbService extends BaseService<Ylb, Integer>{
10 - Map<String, Object> obtain(String rq); 10 + Map<String, Object> obtain(Map<String, Object> map);
11 String obtainDsq(); 11 String obtainDsq();
12 Map<String, Object> sort(Map<String, Object> map); 12 Map<String, Object> sort(Map<String, Object> map);
13 13
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -85,7 +85,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -85,7 +85,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
85 //前一天所有车辆最后进场班次信息 85 //前一天所有车辆最后进场班次信息
86 List<Ylb> ylListBe=repository.obtainYlbefore(rq); 86 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
87 //从排班表中计算出行驶的总里程 87 //从排班表中计算出行驶的总里程
88 - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("1024",rq); 88 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("",rq);
89 89
90 for(int x=0;x<listpb.size();x++){ 90 for(int x=0;x<listpb.size();x++){
91 91
@@ -151,7 +151,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -151,7 +151,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
151 */ 151 */
152 @Transactional 152 @Transactional
153 @Override 153 @Override
154 - public Map<String, Object> obtain(String rq) { 154 + public Map<String, Object> obtain(Map<String, Object> map2) {
  155 + String rq=map2.get("rq").toString();
  156 + String line="";
  157 + if(map2.get("xlbm_eq")!=null){
  158 + line=map2.get("xlbm_eq").toString();
  159 + }
  160 +
155 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); 161 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
156 //保留两位小数 162 //保留两位小数
157 DecimalFormat df = new DecimalFormat("#.00"); 163 DecimalFormat df = new DecimalFormat("#.00");
@@ -164,7 +170,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -164,7 +170,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
164 //前一天所有车辆最后进场班次信息 170 //前一天所有车辆最后进场班次信息
165 List<Ylb> ylListBe=repository.obtainYlbefore(rq); 171 List<Ylb> ylListBe=repository.obtainYlbefore(rq);
166 //从排班表中计算出行驶的总里程 172 //从排班表中计算出行驶的总里程
167 - List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList("1024",rq); 173 + List<Map<String,Object>> listpb=scheduleRealInfoService.yesterdayDataList(line,rq);
168 174
169 for(int x=0;x<listpb.size();x++){ 175 for(int x=0;x<listpb.size();x++){
170 176
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -1129,8 +1129,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1129,8 +1129,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1129 addMileage += tempJhlc; 1129 addMileage += tempJhlc;
1130 ljbc++; 1130 ljbc++;
1131 }else{ 1131 }else{
  1132 + if(scheduleRealInfo.getBcType().equals("normal")){
  1133 + jhbc++;
  1134 + }
1132 jhlc += tempJhlc; 1135 jhlc += tempJhlc;
1133 - jhbc++;  
1134 if(scheduleRealInfo.getStatus() == -1){ 1136 if(scheduleRealInfo.getStatus() == -1){
1135 remMileage += tempJhlc; 1137 remMileage += tempJhlc;
1136 cjbc++; 1138 cjbc++;
@@ -1279,6 +1281,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1279,6 +1281,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1279 if(scheduleRealInfo.isSflj()){ 1281 if(scheduleRealInfo.isSflj()){
1280 ljgl += tempJhlc; 1282 ljgl += tempJhlc;
1281 } 1283 }
  1284 + }else{
  1285 + ssgl += tempJhlc;
  1286 + ssgl_other += tempJhlc;
1282 } 1287 }
1283 }else{ 1288 }else{
1284 Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1289 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
@@ -1516,7 +1521,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1516,7 +1521,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1516 if(scheduleRealInfo.getXlBm().equals(yesterdayDataList.get(i).get("xlBm")) && scheduleRealInfo.getClZbh().equals(yesterdayDataList.get(i).get("clZbh")) 1521 if(scheduleRealInfo.getXlBm().equals(yesterdayDataList.get(i).get("xlBm")) && scheduleRealInfo.getClZbh().equals(yesterdayDataList.get(i).get("clZbh"))
1517 && scheduleRealInfo.getjGh().equals(yesterdayDataList.get(i).get("jGh"))){ 1522 && scheduleRealInfo.getjGh().equals(yesterdayDataList.get(i).get("jGh"))){
1518 //根据线路代码获取公司 1523 //根据线路代码获取公司
1519 - Line li = lineRepository.findByLineCode(line); 1524 + Line li = lineRepository.findByLineCode(scheduleRealInfo.getXlBm());
1520 yesterdayDataList.get(i).put("company", li.getCompany()); 1525 yesterdayDataList.get(i).put("company", li.getCompany());
1521 //计算总公里 1526 //计算总公里
1522 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 1527 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
src/main/java/com/bsth/service/sys/CompanyAuthorityService.java 0 → 100644
  1 +package com.bsth.service.sys;
  2 +
  3 +import com.bsth.entity.sys.CompanyAuthority;
  4 +import com.bsth.entity.sys.SysUser;
  5 +import com.bsth.service.BaseService;
  6 +
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +/**
  11 + * Created by panzhao on 2016/11/22.
  12 + */
  13 +public interface CompanyAuthorityService extends BaseService<CompanyAuthority, Integer> {
  14 + Map<String,Object> save(Integer roleId, List<CompanyAuthority> list);
  15 +
  16 + List<CompanyAuthority> findByUser(SysUser user);
  17 +}
src/main/java/com/bsth/service/sys/impl/CompanyAuthorityServiceImpl.java 0 → 100644
  1 +package com.bsth.service.sys.impl;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.sys.CompanyAuthority;
  5 +import com.bsth.entity.sys.Role;
  6 +import com.bsth.entity.sys.SysUser;
  7 +import com.bsth.repository.sys.CompanyAuthorityRepository;
  8 +import com.bsth.service.impl.BaseServiceImpl;
  9 +import com.bsth.service.sys.CompanyAuthorityService;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Service;
  14 +import org.springframework.transaction.annotation.Transactional;
  15 +
  16 +import java.util.*;
  17 +
  18 +/**
  19 + * Created by panzhao on 2016/11/22.
  20 + */
  21 +@Service
  22 +public class CompanyAuthorityServiceImpl extends BaseServiceImpl<CompanyAuthority, Integer> implements CompanyAuthorityService {
  23 +
  24 + @Autowired
  25 + CompanyAuthorityRepository companyAuthorityRepository;
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Transactional
  30 + @Override
  31 + public Map<String, Object> save(Integer roleId, List<CompanyAuthority> list) {
  32 + Map<String, Object> rs = new HashMap();
  33 +
  34 + try {
  35 + for(CompanyAuthority cauth : list){
  36 + cauth.setRoleId(roleId);
  37 + }
  38 +
  39 + //删除原数据
  40 + companyAuthorityRepository.deleteByRoleId(roleId);
  41 +
  42 + //重新写入数据
  43 + companyAuthorityRepository.save(list);
  44 +
  45 + rs.put("status", ResponseCode.SUCCESS);
  46 + } catch (Exception e) {
  47 + logger.error("", e);
  48 + rs.put("status", ResponseCode.ERROR);
  49 + }
  50 +
  51 + return rs;
  52 + }
  53 +
  54 + @Override
  55 + public List<CompanyAuthority> findByUser(SysUser user) {
  56 + Set<Role> roles = user.getRoles();
  57 + if(roles == null || roles.size() == 0)
  58 + return null;
  59 +
  60 + List<Integer> idx = new ArrayList<>();
  61 + for(Role r : roles)
  62 + idx.add(r.getId());
  63 +
  64 + List<CompanyAuthority> cAuths = companyAuthorityRepository.findByRoles(idx);
  65 + return cAuths;
  66 + }
  67 +}
src/main/java/com/bsth/service/sys/impl/ModuleServiceImpl.java
1 package com.bsth.service.sys.impl; 1 package com.bsth.service.sys.impl;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashMap;  
5 -import java.util.HashSet;  
6 -import java.util.List;  
7 -import java.util.Map;  
8 -import java.util.Set;  
9 -  
10 -import org.springframework.beans.factory.annotation.Autowired;  
11 -import org.springframework.data.domain.Sort;  
12 -import org.springframework.data.domain.Sort.Direction;  
13 -import org.springframework.stereotype.Service;  
14 -  
15 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
16 import com.bsth.entity.sys.Module; 4 import com.bsth.entity.sys.Module;
17 import com.bsth.entity.sys.Role; 5 import com.bsth.entity.sys.Role;
@@ -20,12 +8,23 @@ import com.bsth.repository.sys.ModuleRepository; @@ -20,12 +8,23 @@ import com.bsth.repository.sys.ModuleRepository;
20 import com.bsth.security.util.SecurityUtils; 8 import com.bsth.security.util.SecurityUtils;
21 import com.bsth.service.impl.BaseServiceImpl; 9 import com.bsth.service.impl.BaseServiceImpl;
22 import com.bsth.service.sys.ModuleService; 10 import com.bsth.service.sys.ModuleService;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.jdbc.core.JdbcTemplate;
  13 +import org.springframework.jdbc.core.RowMapper;
  14 +import org.springframework.stereotype.Service;
  15 +
  16 +import java.sql.ResultSet;
  17 +import java.sql.SQLException;
  18 +import java.util.*;
23 19
24 @Service 20 @Service
25 public class ModuleServiceImpl extends BaseServiceImpl<Module, Integer> implements ModuleService{ 21 public class ModuleServiceImpl extends BaseServiceImpl<Module, Integer> implements ModuleService{
26 22
27 @Autowired 23 @Autowired
28 ModuleRepository moduleRepository; 24 ModuleRepository moduleRepository;
  25 +
  26 + @Autowired
  27 + JdbcTemplate jdbcTemplate;
29 28
30 @Override 29 @Override
31 public List<Module> findByGroupType(String group) { 30 public List<Module> findByGroupType(String group) {
@@ -62,26 +61,38 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen @@ -62,26 +61,38 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen
62 SysUser user = SecurityUtils.getCurrentUser(); 61 SysUser user = SecurityUtils.getCurrentUser();
63 Set<Role> roles = user.getRoles(); 62 Set<Role> roles = user.getRoles();
64 63
65 - List<Module> all = (List<Module>) moduleRepository.findAll(new Sort(Direction.ASC, "id"))  
66 - ,results = new ArrayList<>();  
67 - 64 + String inCond = "";
  65 + for(Role r : roles)
  66 + inCond += ("," + r.getId());
  67 +
  68 + inCond = "(" + inCond.substring(1) + ")";
  69 +
  70 + String sql = "select ID,CREATE_DATE,`ENABLE`,GROUP_TYPE,ICON,MAPP_SYMBOL,NAME,P_ID,PATH,UPDATE_DATE,CONTAINER from bsth_c_sys_module m where id in (select modules from bsth_c_sys_role_modules where roles in "+inCond+") or group_type != 3";
  71 + List<Module> all = jdbcTemplate.query(sql, new ModuleRowMapper())
  72 + ,rs = new ArrayList<>();
  73 +
68 Map<Integer, Module> map = new HashMap<>(); 74 Map<Integer, Module> map = new HashMap<>();
69 for(Module m : all){ 75 for(Module m : all){
70 map.put(m.getId(), m); 76 map.put(m.getId(), m);
71 - for(Role r : roles){  
72 - if(m.getRoles().contains(r))  
73 - results.add(m);  
74 - } 77 + if(m.getGroupType().equals("3"))
  78 + rs.add(m);
75 } 79 }
76 80
77 //上层目录和组节点 81 //上层目录和组节点
78 Set<Module> pSet = new HashSet<>(); 82 Set<Module> pSet = new HashSet<>();
79 - for(Module m : results){ 83 + for(Module m : rs){
80 searchParentNode(m, map, pSet); 84 searchParentNode(m, map, pSet);
81 } 85 }
82 - results.addAll(pSet);  
83 -  
84 - return results; 86 + rs.addAll(pSet);
  87 +
  88 + //排序
  89 + Collections.sort(rs, new Comparator<Module>() {
  90 + @Override
  91 + public int compare(Module o1, Module o2) {
  92 + return o1.getId() - o2.getId();
  93 + }
  94 + });
  95 + return rs;
85 } 96 }
86 97
87 /** 98 /**
@@ -105,4 +116,24 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen @@ -105,4 +116,24 @@ public class ModuleServiceImpl extends BaseServiceImpl&lt;Module, Integer&gt; implemen
105 searchParentNode(pModule, idMap, pSet); 116 searchParentNode(pModule, idMap, pSet);
106 } 117 }
107 } 118 }
  119 +
  120 + public class ModuleRowMapper implements RowMapper<Module>{
  121 +
  122 + @Override
  123 + public Module mapRow(ResultSet rs, int rowNum) throws SQLException {
  124 + Module module = new Module();
  125 + module.setId(rs.getInt("ID"));
  126 + module.setCreateDate(rs.getDate("CREATE_DATE"));
  127 + module.setEnable(rs.getBoolean("ENABLE"));
  128 + module.setGroupType(rs.getString("GROUP_TYPE"));
  129 + module.setIcon(rs.getString("ICON"));
  130 + module.setMappSymbol(rs.getString("MAPP_SYMBOL"));
  131 + module.setName(rs.getString("NAME"));
  132 + module.setpId(rs.getInt("P_ID"));
  133 + module.setPath(rs.getString("PATH"));
  134 + module.setUpdateDate(rs.getDate("UPDATE_DATE"));
  135 + module.setContainer(rs.getString("CONTAINER"));
  136 + return module;
  137 + }
  138 + }
108 } 139 }
src/main/resources/static/pages/forms/mould/changetochange.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
@@ -80,44 +80,18 @@ @@ -80,44 +80,18 @@
80 locale : 'zh-cn' 80 locale : 'zh-cn'
81 }); 81 });
82 82
83 - $('#line').select2({  
84 - ajax: {  
85 - url: '/realSchedule/findLine',  
86 - type: 'post',  
87 - dataType: 'json',  
88 - delay: 150,  
89 - data: function(params){  
90 - return{line: params.term};  
91 - },  
92 - processResults: function (data) {  
93 - return {  
94 - results: data  
95 - };  
96 - },  
97 - cache: true  
98 - },  
99 - templateResult: function(repo){  
100 - if (repo.loading) return repo.text;  
101 - var h = '<span>'+repo.text+'</span>';  
102 - return h;  
103 - },  
104 - escapeMarkup: function (markup) { return markup; },  
105 - minimumInputLength: 1,  
106 - templateSelection: function(repo){  
107 - return repo.text;  
108 - },  
109 - language: {  
110 - noResults: function(){  
111 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
112 - },  
113 - inputTooShort : function(e) {  
114 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
115 - },  
116 - searching : function() {  
117 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
118 - }  
119 - }  
120 - }); 83 + $.get('/basic/lineCode2Name',function(result){
  84 + var data=[];
  85 +
  86 + for(var code in result){
  87 + data.push({id: code, text: result[code]});
  88 + }
  89 + console.log(data);
  90 + initPinYinSelect2('#line',data,'');
  91 +
  92 + })
  93 +
  94 +
121 $('#code').select2({ 95 $('#code').select2({
122 ajax: { 96 ajax: {
123 url: '/realSchedule/sreachVehic', 97 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/forms/statement/changetochange.html
@@ -10,63 +10,98 @@ @@ -10,63 +10,98 @@
10 border: 1px solid; } 10 border: 1px solid; }
11 .table-bordered > thead > tr > th, 11 .table-bordered > thead > tr > th,
12 .table-bordered > thead > tr > td { 12 .table-bordered > thead > tr > td {
13 - border-bottom-width: 2px; } 13 + border-bottom-width: 2px;
  14 + text-align: center;}
14 15
15 .table > tbody + tbody { 16 .table > tbody + tbody {
16 border-top: 1px solid; } 17 border-top: 1px solid; }
  18 + .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; }
  19 +.table-checkable tr > th:first-child, .table-checkable tr > td:first-child {
  20 + text-align: center;
  21 + max-width: initial;
  22 + min-width: 40px;
  23 + padding-left: 0;
  24 + padding-right: 0;
  25 +}
  26 +
17 </style> 27 </style>
18 28
19 <div class="page-head"> 29 <div class="page-head">
20 <div class="page-title"> 30 <div class="page-title">
21 - <h1>鎹汉鎹㈣溅鎯呭喌缁熻琛</h1> 31 + <h1>换人换车情况统计表</h1>
22 </div> 32 </div>
23 </div> 33 </div>
24 34
25 <div class="row"> 35 <div class="row">
26 <div class="col-md-12"> 36 <div class="col-md-12">
27 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
  38 + <div class="portlet-title">
  39 + <form class="form-inline" action="" method="post">
  40 + <div style="display: inline-block;">
  41 + <span class="item-label" style="width: 80px;">线路: </span>
  42 + <select class="form-control" name="line" id="line" style="width: 120px;"></select>
  43 + </div>
  44 + <div style="display: inline-block;margin-left: 15px;">
  45 + <span class="item-label" style="width: 80px;">开始时间: </span>
  46 + <input class="form-control" type="text" id="startDate" style="width: 120px;"/>
  47 + </div>
  48 + <div style="display: inline-block;margin-left: 15px;">
  49 + <span class="item-label" style="width: 80px;">结束时间: </span>
  50 + <input class="form-control" type="text" id="endDate" style="width: 120px;"/>
  51 + </div>
  52 + <div style="display: inline-block;">
  53 + <span class="item-label" style="width: 120px;">类型: </span>
  54 + <select class="form-control" id="sel">
  55 + <option value="">请选择</option>
  56 + <option value="1">换人</option>
  57 + <option value="2">换车</option>
  58 + </select>
  59 + </div>
  60 + <div class="form-group">
  61 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  62 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  63 + </div>
  64 + </form>
  65 + </div>
28 <div class="portlet-body"> 66 <div class="portlet-body">
29 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 67 + <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px">
30 <table class="table table-bordered table-hover table-checkable" id="forms"> 68 <table class="table table-bordered table-hover table-checkable" id="forms">
31 <thead> 69 <thead>
32 <tr> 70 <tr>
33 - <th colspan="13">鎹汉鎹㈣溅鎯呭喌缁熻琛</th> 71 + <th colspan="15">换人换车情况统计表</th>
34 </tr> 72 </tr>
35 - <!-- <tr>  
36 - <td colspan="12">杞﹂槦 绔 <span id="sDate"></span>鑷<span id="eDate"></span></td>  
37 - </tr> -->  
38 <tr> 73 <tr>
39 - <td rowspan="3">鏃ユ湡</td>  
40 - <td rowspan="3">鍏徃</td>  
41 - <td rowspan="3">鍒嗗叕鍙</td>  
42 - <td rowspan="3">绾胯矾</td>  
43 - <td rowspan="3">璺墝</td>  
44 - <td rowspan="3">鍙戠敓鏃堕棿</td>  
45 - <td rowspan="3">淇敼鏃堕棿</td>  
46 - <td colspan="3">閰嶈溅</td>  
47 - <td colspan="3">浜哄憳</td>  
48 - <td rowspan="3">鍘熷洜</td>  
49 - <td rowspan="3">淇敼浜</td> 74 + <td rowspan="3" style=" padding-top: 50px;">日期</td>
  75 + <td rowspan="3" style=" padding-top: 50px;">公司</td>
  76 + <td rowspan="3" style=" padding-top: 50px;">分公司</td>
  77 + <td rowspan="3" style=" padding-top: 50px;">线路</td>
  78 + <td rowspan="3" style=" padding-top: 50px;">路牌</td>
  79 + <td rowspan="3" style=" padding-top: 50px;">发生时间</td>
  80 + <td rowspan="3" style=" padding-top: 50px;">修改时间</td>
  81 + <td colspan="2">配车</td>
  82 + <td colspan="4">人员</td>
  83 + <td rowspan="3" style=" padding-top: 50px;">原因</td>
  84 + <td rowspan="3" style=" padding-top: 50px;">修改人</td>
50 </tr> 85 </tr>
51 <tr> 86 <tr>
52 - <td>璁″垝</td>  
53 - <td>瀹為檯</td>  
54 - <td>璁″垝</td>  
55 - <td>瀹為檯</td> 87 + <td>计划</td>
  88 + <td>实际</td>
  89 + <td colspan="2">计划</td>
  90 + <td colspan="2">实际</td>
  91 +
56 </tr> 92 </tr>
57 <tr> 93 <tr>
58 - <td>璁″垝</td>  
59 - <td>瀹為檯</td>  
60 - <td>璁″垝</td>  
61 - <td>瀹為檯</td> 94 + <td>车号</td>
  95 + <td>车号</td>
  96 + <td>工号</td>
  97 + <td>人员</td>
  98 + <td>工号</td>
  99 + <td>人员</td>
62 </tr> 100 </tr>
63 </thead> 101 </thead>
64 - <tbody class="list_correctForm"> 102 + <tbody>
65 103
66 </tbody> 104 </tbody>
67 - <tbody class="list_correctForm_statistics">  
68 -  
69 - </tbody>  
70 </table> 105 </table>
71 </div> 106 </div>
72 </div> 107 </div>
@@ -76,7 +111,7 @@ @@ -76,7 +111,7 @@
76 111
77 <script> 112 <script>
78 $(function(){ 113 $(function(){
79 - // 鍏抽棴宸︿晶鏍 114 + // 关闭左侧栏
80 if (!$('body').hasClass('page-sidebar-closed')) 115 if (!$('body').hasClass('page-sidebar-closed'))
81 $('.menu-toggler.sidebar-toggler').click(); 116 $('.menu-toggler.sidebar-toggler').click();
82 117
@@ -113,162 +148,81 @@ @@ -113,162 +148,81 @@
113 }, 148 },
114 language: { 149 language: {
115 noResults: function(){ 150 noResults: function(){
116 - return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒扮嚎璺紒</span>';  
117 - },  
118 - inputTooShort : function(e) {  
119 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆绾胯矾鎼滅储绾胯矾</span>';  
120 - },  
121 - searching : function() {  
122 - return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储绾胯矾...</span>';  
123 - }  
124 - }  
125 - });  
126 - $('#lpName').select2({  
127 - ajax: {  
128 - url: '/realSchedule/findLpName',  
129 - type: 'post',  
130 - dataType: 'json',  
131 - delay: 150,  
132 - data: function(params){  
133 - return{lpName: params.term};  
134 - },  
135 - processResults: function (data) {  
136 - return {  
137 - results: data  
138 - };  
139 - },  
140 - cache: true  
141 - },  
142 - templateResult: function(repo){  
143 - if (repo.loading) return repo.text;  
144 - var h = '<span>'+repo.text+'</span>';  
145 - return h;  
146 - },  
147 - escapeMarkup: function (markup) { return markup; },  
148 - minimumInputLength: 1,  
149 - templateSelection: function(repo){  
150 - return repo.text;  
151 - },  
152 - language: {  
153 - noResults: function(){  
154 - return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒拌矾鐗岋紒</span>'; 151 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
155 }, 152 },
156 inputTooShort : function(e) { 153 inputTooShort : function(e) {
157 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆璺墝鎼滅储璺墝</span>'; 154 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
158 }, 155 },
159 searching : function() { 156 searching : function() {
160 - return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储璺墝...</span>'; 157 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
161 } 158 }
162 } 159 }
163 }); 160 });
164 - $('#code').select2({  
165 - ajax: {  
166 - url: '/realSchedule/sreachVehic',  
167 - dataType: 'json',  
168 - delay: 150,  
169 - data: function(params){  
170 - return{nbbm: params.term};  
171 - },  
172 - processResults: function (data) {  
173 - return {  
174 - results: data  
175 - };  
176 - },  
177 - cache: true  
178 - },  
179 - templateResult: function(repo){  
180 - if (repo.loading) return repo.text;  
181 - var h = '<span>'+repo.text+'</span>';  
182 - h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');  
183 - return h;  
184 - },  
185 - escapeMarkup: function (markup) { return markup; },  
186 - minimumInputLength: 1,  
187 - templateSelection: function(repo){  
188 - return repo.text;  
189 - },  
190 - language: {  
191 - noResults: function(){  
192 - return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒拌溅杈嗭紒</span>';  
193 - },  
194 - inputTooShort : function(e) {  
195 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆鑷紪鍙锋悳绱㈣溅杈</span>';  
196 - },  
197 - searching : function() {  
198 - return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储杞﹁締...</span>';  
199 - }  
200 - }  
201 - });  
202 - 161 + var line;
  162 + var startDate;
  163 + var endDate;
203 $("#query").on("click",function(){ 164 $("#query").on("click",function(){
204 - var line = $("#line").val();  
205 - var startDate = $("#startDate").val();  
206 - var endDate = $("#endDate").val();  
207 - var lpName = $("#lpName").val();  
208 - var code = $("#code").val();  
209 - $post("/realSchedule/correctForm",{line:line,startDate:startDate,endDate:endDate,lpName:lpName,code:code},function(result){  
210 - $("#sDate").text(startDate);  
211 - $("#eDate").text(endDate);  
212 - var temp = {};  
213 - var today_account = 0;  
214 - temp["line"] = $("#line").text() ;  
215 - temp["totalAdjustment"] = result.length;  
216 -  
217 - $.each(result, function(i, obj) {  
218 - if(moment(obj.scheduleDate).format("YYYY-MM-DD") == moment(obj.updateDate).format("YYYY-MM-DD")){  
219 - today_account++;  
220 - }  
221 - obj.updateDate = moment(obj.updateDate).format("YYYY-MM-DD HH:mm:ss");  
222 - });  
223 -  
224 - temp["todayAdjustment"] = today_account;  
225 - temp["beforeAdjustment"] = result.length-today_account;  
226 - temp["historyAdjustment"] = 0;  
227 -  
228 - var list_correctForm = template('list_correctForm',{list:result});  
229 - // 鎶婃覆鏌撳ソ鐨勬ā鐗坔tml鏂囨湰杩藉姞鍒拌〃鏍间腑  
230 - $('#forms .list_correctForm').html(list_correctForm);  
231 -  
232 - var list_correctForm_statistics = template('list_correctForm_statistics',temp);  
233 - $('#forms .list_correctForm_statistics').html(list_correctForm_statistics);  
234 - }); 165 + line = $("#line").val();
  166 + sel = $("#sel").val();
  167 + var startDate1=$("#startDate").val();
  168 + var endDate1=$("#endDate").val();
  169 +
  170 + if(startDate1!=''&&endDate1!=''){
  171 + $post('/mcy_forms/changetochange',{sel:sel,line:line,startDate:$("#startDate").val(),endDate:$("#endDate").val(),type:'query'},function(result){
  172 + startDate = $("#startDate").val();
  173 + endDate = $("#endDate").val();
  174 + $("#sDate").text(startDate);
  175 + $("#eDate").text(endDate);
  176 + var temp = {};
  177 + var today_account = 0;
  178 + temp["line"] = $("#line").text();
  179 + $.each(result, function(i, obj) {
  180 + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){
  181 + today_account++;
  182 + }
  183 + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss");
  184 + });
  185 + // 把数据填充到模版中
  186 + var tbodyHtml = template('changetochange',{list:result});
  187 + // 把渲染好的模版html文本追加到表格中
  188 + $('#forms tbody').html(tbodyHtml);
  189 + })
  190 +
  191 + }else{
  192 + alert("请选择时间范围!");
  193 + }
  194 + });
  195 +
  196 + $("#export").on("click",function(){
  197 + $post('/mcy_export/changetochangeExport',{startDate:startDate,endDate:endDate,type:'export'},function(result){
  198 + window.open("/downloadFile/download?fileName=换人换车情况日统计"+moment(startDate).format("YYYYMMDD"));
235 }); 199 });
236 }); 200 });
  201 + });
237 </script> 202 </script>
238 -<script type="text/html" id="list_correctForm"> 203 +<script type="text/html" id="changetochange">
239 {{each list as obj i}} 204 {{each list as obj i}}
240 <tr> 205 <tr>
241 - <td>{{obj.xlName}}</td>  
242 - <td>{{obj.lpName}}</td>  
243 - <td>{{obj.clZbh}}</td>  
244 - <td>{{obj.jName}}</td>  
245 - <td>{{obj.sName}}</td>  
246 - <td>{{obj.fcsj}}</td>  
247 - <td>{{obj.fcsjActual}}</td>  
248 - <td>{{obj.zdsj}}</td>  
249 - <td>{{obj.zdsjActual}}</td>  
250 - <td>{{obj.updateBy}}</td>  
251 - <td>{{obj.updateDate}}</td>  
252 - <td>{{obj.remarks}}</td> 206 + <td>{{obj.rq}}</td>
  207 + <td>{{obj.gs}}</td>
  208 + <td>{{obj.fgs}}</td>
  209 + <td>{{obj.xl}}</td>
  210 + <td>{{obj.lp}}</td>
  211 + <td>{{obj.fssj}}</td>
  212 + <td>{{obj.xgsj}}</td>
  213 + <td>{{obj.pcch}}</td>
  214 + <td>{{obj.pcry}}</td>
  215 + <td>{{obj.jhgh}}</td>
  216 + <td>{{obj.jhch}}</td>
  217 + <td>{{obj.sjgh}}</td>
  218 + <td>{{obj.sjch}}</td>
  219 + <td>{{obj.yy}}</td>
  220 + <td>{{obj.xgr}}</td>
253 </tr> 221 </tr>
254 {{/each}} 222 {{/each}}
255 {{if list.length == 0}} 223 {{if list.length == 0}}
256 <tr> 224 <tr>
257 - <td colspan="12"><h6 class="muted">娌℃湁鎵惧埌鐩稿叧鏁版嵁</h6></td> 225 + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td>
258 </tr> 226 </tr>
259 {{/if}} 227 {{/if}}
260 </script> 228 </script>
261 -<script type="text/html" id="list_correctForm_statistics">  
262 - <tr>  
263 - <td colspan="2">绾胯矾:</td>  
264 - <td>{{line}}</td>  
265 - <td>璋冩暣鎬绘暟</td>  
266 - <td>{{totalAdjustment}}</td>  
267 - <td>浜嬪厛璋冩暣</td>  
268 - <td>{{beforeAdjustment}}</td>  
269 - <td>褰撴棩璋冩暣</td>  
270 - <td>{{todayAdjustment}}</td>  
271 - <td>鍘嗗彶璋冩暣</td>  
272 - <td colspan="2">{{historyAdjustment}}</td>  
273 - </tr>  
274 -</script>  
275 \ No newline at end of file 229 \ No newline at end of file
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -107,44 +107,19 @@ @@ -107,44 +107,19 @@
107 locale : 'zh-cn' 107 locale : 'zh-cn'
108 }); 108 });
109 109
110 - $('#line').select2({  
111 - ajax: {  
112 - url: '/realSchedule/findLine',  
113 - type: 'post',  
114 - dataType: 'json',  
115 - delay: 150,  
116 - data: function(params){  
117 - return{line: params.term};  
118 - },  
119 - processResults: function (data) {  
120 - return {  
121 - results: data  
122 - };  
123 - },  
124 - cache: true  
125 - },  
126 - templateResult: function(repo){  
127 - if (repo.loading) return repo.text;  
128 - var h = '<span>'+repo.text+'</span>';  
129 - return h;  
130 - },  
131 - escapeMarkup: function (markup) { return markup; },  
132 - minimumInputLength: 1,  
133 - templateSelection: function(repo){  
134 - return repo.text;  
135 - },  
136 - language: {  
137 - noResults: function(){  
138 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
139 - },  
140 - inputTooShort : function(e) {  
141 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
142 - },  
143 - searching : function() {  
144 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
145 - }  
146 - }  
147 - }); 110 +
  111 + $.get('/basic/lineCode2Name',function(result){
  112 + var data=[];
  113 +
  114 + for(var code in result){
  115 + data.push({id: code, text: result[code]});
  116 + }
  117 + console.log(data);
  118 + initPinYinSelect2('#line',data,'');
  119 +
  120 + })
  121 +
  122 +
148 $('#lpName').select2({ 123 $('#lpName').select2({
149 ajax: { 124 ajax: {
150 url: '/realSchedule/findLpName', 125 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/daily.html
@@ -92,45 +92,16 @@ @@ -92,45 +92,16 @@
92 locale : 'zh-cn' 92 locale : 'zh-cn'
93 }); 93 });
94 94
95 - $('#line').select2({  
96 - ajax: {  
97 - url: '/realSchedule/findLine',  
98 - type: 'post',  
99 - dataType: 'json',  
100 - delay: 150,  
101 - data: function(params){  
102 - return{line: params.term};  
103 - },  
104 - processResults: function (data) {  
105 - return {  
106 - results: data  
107 - };  
108 - },  
109 - cache: true  
110 - },  
111 - templateResult: function(repo){  
112 - if (repo.loading) return repo.text;  
113 - var h = '<span>'+repo.text+'</span>';  
114 - return h;  
115 - },  
116 - escapeMarkup: function (markup) { return markup; },  
117 - minimumInputLength: 1,  
118 - templateSelection: function(repo){  
119 - return repo.text;  
120 - },  
121 - language: {  
122 - noResults: function(){  
123 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
124 - },  
125 - inputTooShort : function(e) {  
126 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
127 - },  
128 - searching : function() {  
129 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
130 - }  
131 - }  
132 - });  
133 - 95 + $.get('/basic/lineCode2Name',function(result){
  96 + var data=[];
  97 +
  98 + for(var code in result){
  99 + data.push({id: code, text: result[code]});
  100 + }
  101 + console.log(data);
  102 + initPinYinSelect2('#line',data,'');
  103 +
  104 + })
134 var line; 105 var line;
135 var date; 106 var date;
136 $("#query").on("click",function(){ 107 $("#query").on("click",function(){
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -80,44 +80,16 @@ @@ -80,44 +80,16 @@
80 locale : 'zh-cn' 80 locale : 'zh-cn'
81 }); 81 });
82 82
83 - $('#line').select2({  
84 - ajax: {  
85 - url: '/realSchedule/findLine',  
86 - type: 'post',  
87 - dataType: 'json',  
88 - delay: 150,  
89 - data: function(params){  
90 - return{line: params.term};  
91 - },  
92 - processResults: function (data) {  
93 - return {  
94 - results: data  
95 - };  
96 - },  
97 - cache: true  
98 - },  
99 - templateResult: function(repo){  
100 - if (repo.loading) return repo.text;  
101 - var h = '<span>'+repo.text+'</span>';  
102 - return h;  
103 - },  
104 - escapeMarkup: function (markup) { return markup; },  
105 - minimumInputLength: 1,  
106 - templateSelection: function(repo){  
107 - return repo.text;  
108 - },  
109 - language: {  
110 - noResults: function(){  
111 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
112 - },  
113 - inputTooShort : function(e) {  
114 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
115 - },  
116 - searching : function() {  
117 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
118 - } 83 + $.get('/basic/lineCode2Name',function(result){
  84 + var data=[];
  85 +
  86 + for(var code in result){
  87 + data.push({id: code, text: result[code]});
119 } 88 }
120 - }); 89 + console.log(data);
  90 + initPinYinSelect2('#line',data,'');
  91 +
  92 + })
121 $('#code').select2({ 93 $('#code').select2({
122 ajax: { 94 ajax: {
123 url: '/realSchedule/sreachVehic', 95 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/forms/statement/jobSummary.html
@@ -194,43 +194,17 @@ @@ -194,43 +194,17 @@
194 locale : 'zh-cn' 194 locale : 'zh-cn'
195 }); 195 });
196 196
197 - $('#line').select2({  
198 - ajax: {  
199 - url: '/realSchedule/findLine',  
200 - dataType: 'json',  
201 - delay: 150,  
202 - data: function(params){  
203 - return{line: params.term};  
204 - },  
205 - processResults: function (data) {  
206 - return {  
207 - results: data  
208 - };  
209 - },  
210 - cache: true  
211 - },  
212 - templateResult: function(repo){  
213 - if (repo.loading) return repo.text;  
214 - var h = '<span>'+repo.text+'</span>';  
215 - return h;  
216 - },  
217 - escapeMarkup: function (markup) { return markup; },  
218 - minimumInputLength: 1,  
219 - templateSelection: function(repo){  
220 - return repo.text;  
221 - },  
222 - language: {  
223 - noResults: function(){  
224 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
225 - },  
226 - inputTooShort : function(e) {  
227 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
228 - },  
229 - searching : function() {  
230 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
231 - }  
232 - }  
233 - }); 197 + $.get('/basic/lineCode2Name',function(result){
  198 + var data=[];
  199 +
  200 + for(var code in result){
  201 + data.push({id: code, text: result[code]});
  202 + }
  203 + console.log(data);
  204 + initPinYinSelect2('#line',data,'');
  205 +
  206 + })
  207 +
234 }); 208 });
235 </script> 209 </script>
236 <script type="text/html" id="list_forms"> 210 <script type="text/html" id="list_forms">
src/main/resources/static/pages/forms/statement/linepassengerflow.html
@@ -21,12 +21,12 @@ @@ -21,12 +21,12 @@
21 <h1>线路客流量报表</h1> 21 <h1>线路客流量报表</h1>
22 </div> 22 </div>
23 </div> 23 </div>
24 -  
25 -<div class="row">  
26 - <div class="col-md-12">  
27 - <div class="portlet light porttlet-fit bordered">  
28 - <div class="portlet-title">  
29 - <form class="form-inline" action=""> 24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
30 <div style="display: inline-block;"> 30 <div style="display: inline-block;">
31 <span class="item-label" style="width: 80px;">线路: </span> 31 <span class="item-label" style="width: 80px;">线路: </span>
32 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 32 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
@@ -38,10 +38,10 @@ @@ -38,10 +38,10 @@
38 <div class="form-group"> 38 <div class="form-group">
39 <input class="btn btn-default" type="button" id="query" value="筛选"/> 39 <input class="btn btn-default" type="button" id="query" value="筛选"/>
40 <input class="btn btn-default" type="button" id="export" value="导出"/> 40 <input class="btn btn-default" type="button" id="export" value="导出"/>
41 - </div>  
42 - </form>  
43 - </div>  
44 - <div class="portlet-body"> 41 + </div>
  42 + </form>
  43 + </div>
  44 + <div class="portlet-body">
45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
46 <table class="table table-bordered table-hover table-checkable" id="forms"> 46 <table class="table table-bordered table-hover table-checkable" id="forms">
47 <thead> 47 <thead>
@@ -56,63 +56,34 @@ @@ -56,63 +56,34 @@
56 56
57 </tbody> 57 </tbody>
58 </table> 58 </table>
59 - </div>  
60 - </div>  
61 - </div>  
62 - </div>  
63 -</div>  
64 -  
65 -<script> 59 + </div>
  60 + </div>
  61 + </div>
  62 + </div>
  63 +</div>
  64 +
  65 +<script>
66 $(function(){ 66 $(function(){
67 - var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};  
68 - // 关闭左侧栏  
69 - if (!$('body').hasClass('page-sidebar-closed')) 67 + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
  68 + // 关闭左侧栏
  69 + if (!$('body').hasClass('page-sidebar-closed'))
70 $('.menu-toggler.sidebar-toggler').click(); 70 $('.menu-toggler.sidebar-toggler').click();
71 -  
72 - $("#date").datetimepicker({  
73 - format : 'YYYY-MM-DD',  
74 - locale : 'zh-cn' 71 +
  72 + $("#date").datetimepicker({
  73 + format : 'YYYY-MM-DD',
  74 + locale : 'zh-cn'
75 }); 75 });
76 76
77 - $('#line').select2({  
78 - ajax: {  
79 - url: '/realSchedule/findLine',  
80 - type: 'post',  
81 - dataType: 'json',  
82 - delay: 150,  
83 - data: function(params){  
84 - return{line: params.term};  
85 - },  
86 - processResults: function (data) {  
87 - return {  
88 - results: data  
89 - };  
90 - },  
91 - cache: true  
92 - },  
93 - templateResult: function(repo){  
94 - if (repo.loading) return repo.text;  
95 - var h = '<span>'+repo.text+'</span>';  
96 - return h;  
97 - },  
98 - escapeMarkup: function (markup) { return markup; },  
99 - minimumInputLength: 1,  
100 - templateSelection: function(repo){  
101 - return repo.text;  
102 - },  
103 - language: {  
104 - noResults: function(){  
105 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
106 - },  
107 - inputTooShort : function(e) {  
108 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
109 - },  
110 - searching : function() {  
111 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
112 - }  
113 - }  
114 - });  
115 - 77 + $.get('/basic/lineCode2Name',function(result){
  78 + var data=[];
  79 +
  80 + for(var code in result){
  81 + data.push({id: code, text: result[code]});
  82 + }
  83 + console.log(data);
  84 + initPinYinSelect2('#line',data,'');
  85 +
  86 + })
116 87
117 $("#query").on("click",function(){ 88 $("#query").on("click",function(){
118 var line = $("#line").val(); 89 var line = $("#line").val();
@@ -126,10 +97,10 @@ @@ -126,10 +97,10 @@
126 // 把渲染好的模版html文本追加到表格中 97 // 把渲染好的模版html文本追加到表格中
127 $('#forms tbody').html(tbodyHtml); 98 $('#forms tbody').html(tbodyHtml);
128 }); 99 });
129 - });  
130 - });  
131 -</script>  
132 -<script type="text/html" id="list_linepasswengerflow"> 100 + });
  101 + });
  102 +</script>
  103 +<script type="text/html" id="list_linepasswengerflow">
133 {{each list as obj i}} 104 {{each list as obj i}}
134 <tr> 105 <tr>
135 <td>{{i+1}}</td> 106 <td>{{i+1}}</td>
@@ -142,5 +113,5 @@ @@ -142,5 +113,5 @@
142 <tr> 113 <tr>
143 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 114 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
144 </tr> 115 </tr>
145 - {{/if}} 116 + {{/if}}
146 </script> 117 </script>
147 \ No newline at end of file 118 \ No newline at end of file
src/main/resources/static/pages/forms/statement/operationservice.html
@@ -102,44 +102,18 @@ @@ -102,44 +102,18 @@
102 locale : 'zh-cn' 102 locale : 'zh-cn'
103 }); 103 });
104 104
105 - $('#line').select2({  
106 - ajax: {  
107 - url: '/realSchedule/findLine',  
108 - type: 'post',  
109 - dataType: 'json',  
110 - delay: 150,  
111 - data: function(params){  
112 - return{line: params.term};  
113 - },  
114 - processResults: function (data) {  
115 - return {  
116 - results: data  
117 - };  
118 - },  
119 - cache: true  
120 - },  
121 - templateResult: function(repo){  
122 - if (repo.loading) return repo.text;  
123 - var h = '<span>'+repo.text+'</span>';  
124 - return h;  
125 - },  
126 - escapeMarkup: function (markup) { return markup; },  
127 - minimumInputLength: 1,  
128 - templateSelection: function(repo){  
129 - return repo.text;  
130 - },  
131 - language: {  
132 - noResults: function(){  
133 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
134 - },  
135 - inputTooShort : function(e) {  
136 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
137 - },  
138 - searching : function() {  
139 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
140 - }  
141 - }  
142 - }); 105 +
  106 + $.get('/basic/lineCode2Name',function(result){
  107 + var data=[];
  108 +
  109 + for(var code in result){
  110 + data.push({id: code, text: result[code]});
  111 + }
  112 + console.log(data);
  113 + initPinYinSelect2('#line',data,'');
  114 +
  115 + })
  116 +
143 $('#lpName').select2({ 117 $('#lpName').select2({
144 ajax: { 118 ajax: {
145 url: '/realSchedule/findLpName', 119 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
43 </div> 43 </div>
44 <div class="portlet-body"> 44 <div class="portlet-body">
45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
46 <table class="table table-bordered table-hover table-checkable" id="forms"> 47 <table class="table table-bordered table-hover table-checkable" id="forms">
47 <thead> 48 <thead>
48 <tr> 49 <tr>
@@ -82,23 +83,23 @@ @@ -82,23 +83,23 @@
82 <td>援外</td> 83 <td>援外</td>
83 <td>其他</td> 84 <td>其他</td>
84 <td>全日</td> 85 <td>全日</td>
85 - <td>6:31~<br>8:30</td>  
86 - <td>16:01~<br>18:00</td> 86 + <td>早高峰</td>
  87 + <td>晚高峰</td>
87 <td>全日</td> 88 <td>全日</td>
88 - <td>6:31~<br>8:30</td>  
89 - <td>16:01~<br>18:00</td> 89 + <td>早高峰</td>
  90 + <td>晚高峰</td>
90 <td>全日</td> 91 <td>全日</td>
91 - <td>6:31~<br>8:30</td>  
92 - <td>16:01~<br>18:00</td> 92 + <td>早高峰</td>
  93 + <td>晚高峰</td>
93 <td>全日</td> 94 <td>全日</td>
94 - <td>6:31~<br>8:30</td>  
95 - <td>16:01~<br>18:00</td> 95 + <td>早高峰</td>
  96 + <td>晚高峰</td>
96 <td>全日</td> 97 <td>全日</td>
97 - <td>6:31~<br>8:30</td>  
98 - <td>16:01~<br>18:00</td> 98 + <td>早高峰</td>
  99 + <td>晚高峰</td>
99 <td>全日</td> 100 <td>全日</td>
100 - <td>6:31~<br>8:30</td>  
101 - <td>16:01~<br>18:00</td> 101 + <td>早高峰</td>
  102 + <td>晚高峰</td>
102 </tr> 103 </tr>
103 </thead> 104 </thead>
104 105
@@ -260,44 +261,18 @@ @@ -260,44 +261,18 @@
260 locale : 'zh-cn' 261 locale : 'zh-cn'
261 }); 262 });
262 263
263 - $('#line').select2({  
264 - ajax: {  
265 - url: '/realSchedule/findLine',  
266 - dataType: 'json',  
267 - delay: 150,  
268 - data: function(params){  
269 - return{line: params.term};  
270 - },  
271 - processResults: function (data) {  
272 - return {  
273 - results: data  
274 - };  
275 - },  
276 - cache: true  
277 - },  
278 - templateResult: function(repo){  
279 - if (repo.loading) return repo.text;  
280 - var h = '<span>'+repo.text+'</span>';  
281 - return h;  
282 - },  
283 - escapeMarkup: function (markup) { return markup; },  
284 - minimumInputLength: 1,  
285 - templateSelection: function(repo){  
286 - return repo.text;  
287 - },  
288 - language: {  
289 - noResults: function(){  
290 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
291 - },  
292 - inputTooShort : function(e) {  
293 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
294 - },  
295 - searching : function() {  
296 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
297 - }  
298 - }  
299 - });  
300 - 264 +
  265 +
  266 + $.get('/basic/lineCode2Name',function(result){
  267 + var data=[];
  268 +
  269 + for(var code in result){
  270 + data.push({id: code, text: result[code]});
  271 + }
  272 + console.log(data);
  273 + initPinYinSelect2('#line',data,'');
  274 +
  275 + })
301 //查询 276 //查询
302 $("#query").on('click',function(){ 277 $("#query").on('click',function(){
303 var line = $("#line").val(); 278 var line = $("#line").val();
src/main/resources/static/pages/forms/statement/shifday.html
@@ -97,44 +97,17 @@ $(function(){ @@ -97,44 +97,17 @@ $(function(){
97 locale : 'zh-cn' 97 locale : 'zh-cn'
98 }); 98 });
99 99
100 - $('#line').select2({  
101 - ajax: {  
102 - url: '/realSchedule/findLine',  
103 - type: 'post',  
104 - dataType: 'json',  
105 - delay: 150,  
106 - data: function(params){  
107 - return{line: params.term};  
108 - },  
109 - processResults: function (data) {  
110 - return {  
111 - results: data  
112 - };  
113 - },  
114 - cache: true  
115 - },  
116 - templateResult: function(repo){  
117 - if (repo.loading) return repo.text;  
118 - var h = '<span>'+repo.text+'</span>';  
119 - return h;  
120 - },  
121 - escapeMarkup: function (markup) { return markup; },  
122 - minimumInputLength: 1,  
123 - templateSelection: function(repo){  
124 - return repo.text;  
125 - },  
126 - language: {  
127 - noResults: function(){  
128 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
129 - },  
130 - inputTooShort : function(e) {  
131 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
132 - },  
133 - searching : function() {  
134 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
135 - }  
136 - }  
137 - }); 100 +
  101 + $.get('/basic/lineCode2Name',function(result){
  102 + var data=[];
  103 +
  104 + for(var code in result){
  105 + data.push({id: code, text: result[code]});
  106 + }
  107 + console.log(data);
  108 + initPinYinSelect2('#line',data,'');
  109 +
  110 + })
138 111
139 $("#query").on("click",function(){ 112 $("#query").on("click",function(){
140 var line = $("#line").val(); 113 var line = $("#line").val();
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html
@@ -87,44 +87,17 @@ @@ -87,44 +87,17 @@
87 locale : 'zh-cn' 87 locale : 'zh-cn'
88 }); 88 });
89 89
90 - $('#line').select2({  
91 - ajax: {  
92 - url: '/realSchedule/findLine',  
93 - type: 'post',  
94 - dataType: 'json',  
95 - delay: 150,  
96 - data: function(params){  
97 - return{line: params.term};  
98 - },  
99 - processResults: function (data) {  
100 - return {  
101 - results: data  
102 - };  
103 - },  
104 - cache: true  
105 - },  
106 - templateResult: function(repo){  
107 - if (repo.loading) return repo.text;  
108 - var h = '<span>'+repo.text+'</span>';  
109 - return h;  
110 - },  
111 - escapeMarkup: function (markup) { return markup; },  
112 - minimumInputLength: 1,  
113 - templateSelection: function(repo){  
114 - return repo.text;  
115 - },  
116 - language: {  
117 - noResults: function(){  
118 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
119 - },  
120 - inputTooShort : function(e) {  
121 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
122 - },  
123 - searching : function() {  
124 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
125 - }  
126 - }  
127 - }); 90 +
  91 + $.get('/basic/lineCode2Name',function(result){
  92 + var data=[];
  93 +
  94 + for(var code in result){
  95 + data.push({id: code, text: result[code]});
  96 + }
  97 + console.log(data);
  98 + initPinYinSelect2('#line',data,'');
  99 +
  100 + })
128 $('#lpName').select2({ 101 $('#lpName').select2({
129 ajax: { 102 ajax: {
130 url: '/realSchedule/findLpName', 103 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/singledata.html
@@ -92,44 +92,18 @@ @@ -92,44 +92,18 @@
92 locale : 'zh-cn' 92 locale : 'zh-cn'
93 }); 93 });
94 94
95 - $('#line').select2({  
96 - ajax: {  
97 - url: '/realSchedule/findLine',  
98 - type: 'post',  
99 - dataType: 'json',  
100 - delay: 150,  
101 - data: function(params){  
102 - return{line: params.term};  
103 - },  
104 - processResults: function (data) {  
105 - return {  
106 - results: data  
107 - };  
108 - },  
109 - cache: true  
110 - },  
111 - templateResult: function(repo){  
112 - if (repo.loading) return repo.text;  
113 - var h = '<span>'+repo.text+'</span>';  
114 - return h;  
115 - },  
116 - escapeMarkup: function (markup) { return markup; },  
117 - minimumInputLength: 1,  
118 - templateSelection: function(repo){  
119 - return repo.text;  
120 - },  
121 - language: {  
122 - noResults: function(){  
123 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
124 - },  
125 - inputTooShort : function(e) {  
126 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
127 - },  
128 - searching : function() {  
129 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
130 - }  
131 - }  
132 - }); 95 +
  96 + $.get('/basic/lineCode2Name',function(result){
  97 + var data=[];
  98 +
  99 + for(var code in result){
  100 + data.push({id: code, text: result[code]});
  101 + }
  102 + console.log(data);
  103 + initPinYinSelect2('#line',data,'');
  104 +
  105 + })
  106 +
133 $('#lpName').select2({ 107 $('#lpName').select2({
134 ajax: { 108 ajax: {
135 url: '/realSchedule/findLpName', 109 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/statisticsDaily .html
@@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
43 </div> 43 </div>
44 <div class="portlet-body"> 44 <div class="portlet-body">
45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 45 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  46 + <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
46 <table class="table table-bordered table-hover table-checkable" id="forms"> 47 <table class="table table-bordered table-hover table-checkable" id="forms">
47 <thead> 48 <thead>
48 <tr> 49 <tr>
@@ -70,7 +71,7 @@ @@ -70,7 +71,7 @@
70 <td rowspan="2">原因</td> 71 <td rowspan="2">原因</td>
71 </tr> 72 </tr>
72 <tr> 73 <tr>
73 - <td>路阻</td> 74 + <td width="31px">路阻</td>
74 <td>吊慢</td> 75 <td>吊慢</td>
75 <td>故障</td> 76 <td>故障</td>
76 <td>纠纷</td> 77 <td>纠纷</td>
@@ -82,23 +83,23 @@ @@ -82,23 +83,23 @@
82 <td>援外</td> 83 <td>援外</td>
83 <td>其他</td> 84 <td>其他</td>
84 <td>全日</td> 85 <td>全日</td>
85 - <td>6:31~8:30</td>  
86 - <td>16:01~18:00</td> 86 + <td>早高峰</td>
  87 + <td>晚高峰</td>
87 <td>全日</td> 88 <td>全日</td>
88 - <td>6:31~8:30</td>  
89 - <td>16:01~18:00</td> 89 + <td>早高峰</td>
  90 + <td>晚高峰</td>
90 <td>全日</td> 91 <td>全日</td>
91 - <td>6:31~8:30</td>  
92 - <td>16:01~18:00</td> 92 + <td>早高峰</td>
  93 + <td>晚高峰</td>
93 <td>全日</td> 94 <td>全日</td>
94 - <td>6:31~8:30</td>  
95 - <td>16:01~18:00</td> 95 + <td>早高峰</td>
  96 + <td>晚高峰</td>
96 <td>全日</td> 97 <td>全日</td>
97 - <td>6:31~8:30</td>  
98 - <td>16:01~18:00</td> 98 + <td>早高峰</td>
  99 + <td>晚高峰</td>
99 <td>全日</td> 100 <td>全日</td>
100 - <td>6:31~8:30</td>  
101 - <td>16:01~18:00</td> 101 + <td>早高峰</td>
  102 + <td>晚高峰</td>
102 </tr> 103 </tr>
103 </thead> 104 </thead>
104 <tbody class="statisticsDaily"> 105 <tbody class="statisticsDaily">
@@ -163,47 +164,21 @@ @@ -163,47 +164,21 @@
163 format : 'YYYY-MM-DD', 164 format : 'YYYY-MM-DD',
164 locale : 'zh-cn' 165 locale : 'zh-cn'
165 }); 166 });
  167 + $.get('/basic/lineCode2Name',function(result){
  168 + var data=[];
  169 +
  170 + for(var code in result){
  171 + data.push({id: code, text: result[code]});
  172 + }
  173 + console.log(data);
  174 + initPinYinSelect2('#line',data,'');
  175 +
  176 + })
166 177
167 - $('#line').select2({  
168 - ajax: {  
169 - url: '/realSchedule/findLine',  
170 - dataType: 'json',  
171 - delay: 150,  
172 - data: function(params){  
173 - return{line: params.term};  
174 - },  
175 - processResults: function (data) {  
176 - return {  
177 - results: data  
178 - };  
179 - },  
180 - cache: true  
181 - },  
182 - templateResult: function(repo){  
183 - if (repo.loading) return repo.text;  
184 - var h = '<span>'+repo.text+'</span>';  
185 - return h;  
186 - },  
187 - escapeMarkup: function (markup) { return markup; },  
188 - minimumInputLength: 1,  
189 - templateSelection: function(repo){  
190 - return repo.text;  
191 - },  
192 - language: {  
193 - noResults: function(){  
194 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
195 - },  
196 - inputTooShort : function(e) {  
197 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
198 - },  
199 - searching : function() {  
200 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
201 - }  
202 - }  
203 - }); 178 +
204 $("#query").on("click",function(){ 179 $("#query").on("click",function(){
205 var line = $("#line").val(); 180 var line = $("#line").val();
206 - var xlName = $("#line").text(); 181 + var xlName = $("#select2-line-container").html();
207 var date = $("#date").val(); 182 var date = $("#date").val();
208 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){ 183 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){
209 // 把数据填充到模版中 184 // 把数据填充到模版中
src/main/resources/static/pages/forms/statement/vehicleloading.html
@@ -82,44 +82,19 @@ @@ -82,44 +82,19 @@
82 locale : 'zh-cn' 82 locale : 'zh-cn'
83 }); 83 });
84 84
85 - $('#line').select2({  
86 - ajax: {  
87 - url: '/realSchedule/findLine',  
88 - type: 'post',  
89 - dataType: 'json',  
90 - delay: 150,  
91 - data: function(params){  
92 - return{line: params.term};  
93 - },  
94 - processResults: function (data) {  
95 - return {  
96 - results: data  
97 - };  
98 - },  
99 - cache: true  
100 - },  
101 - templateResult: function(repo){  
102 - if (repo.loading) return repo.text;  
103 - var h = '<span>'+repo.text+'</span>';  
104 - return h;  
105 - },  
106 - escapeMarkup: function (markup) { return markup; },  
107 - minimumInputLength: 1,  
108 - templateSelection: function(repo){  
109 - return repo.text;  
110 - },  
111 - language: {  
112 - noResults: function(){  
113 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
114 - },  
115 - inputTooShort : function(e) {  
116 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
117 - },  
118 - searching : function() {  
119 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
120 - }  
121 - }  
122 - }); 85 +
  86 + $.get('/basic/lineCode2Name',function(result){
  87 + var data=[];
  88 +
  89 + for(var code in result){
  90 + data.push({id: code, text: result[code]});
  91 + }
  92 + console.log(data);
  93 + initPinYinSelect2('#line',data,'');
  94 +
  95 + })
  96 +
  97 +
123 $('#lpName').select2({ 98 $('#lpName').select2({
124 ajax: { 99 ajax: {
125 url: '/realSchedule/findLpName', 100 url: '/realSchedule/findLpName',
src/main/resources/static/pages/forms/statement/waybill.html
@@ -21,49 +21,49 @@ @@ -21,49 +21,49 @@
21 <h1>行车路单</h1> 21 <h1>行车路单</h1>
22 </div> 22 </div>
23 </div> 23 </div>
24 -  
25 -<div class="row">  
26 - <div class="col-md-12">  
27 - <div class="portlet light porttlet-fit bordered">  
28 - <div class="portlet-title">  
29 - <form class="form-inline" action="">  
30 - <div style="display: inline-block;"> 24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block;">
31 <span class="item-label" style="width: 80px;">线路: </span> 31 <span class="item-label" style="width: 80px;">线路: </span>
32 - <select class="form-control" name="line" id="line" style="width: 180px;"></select>  
33 - </div>  
34 - <div style="display: inline-block;margin-left: 15px;">  
35 - <span class="item-label" style="width: 80px;">时间: </span>  
36 - <input class="form-control" type="text" id="date" style="width: 180px;"/>  
37 - </div>  
38 - <div class="form-group" style="display: inline-block;margin-left: 15px;">  
39 - <input class="btn btn-default" type="button" id="query" value="查询"/>  
40 - <input class="btn btn-default" type="button" id="export" value="导出"/>  
41 - <input class="btn btn-default" type="button" id="print" value="打印"/>  
42 - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>  
43 - </div>  
44 - </form>  
45 - </div>  
46 - <div class="portlet-body">  
47 - <div class="row">  
48 - <div class="col-md-3">  
49 - <div class="" style="margin-top: 10px;overflow:auto;height: 860px">  
50 - <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">  
51 - <thead>  
52 - <tr class="hidden">  
53 - <th>人员</th>  
54 - <th>自编号</th>  
55 - <th>路牌</th>  
56 - </tr>  
57 - </thead>  
58 - <tbody>  
59 -  
60 - </tbody>  
61 - </table>  
62 - </div>  
63 - </div>  
64 - <div class="col-md-9" id="printArea">  
65 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">  
66 - <table class="table table-bordered table-checkable" id="forms"> 32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 15px;">
  35 + <span class="item-label" style="width: 80px;">时间: </span>
  36 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  37 + </div>
  38 + <div class="form-group" style="display: inline-block;margin-left: 15px;">
  39 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  40 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  41 + <input class="btn btn-default" type="button" id="print" value="打印"/>
  42 + <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/>
  43 + </div>
  44 + </form>
  45 + </div>
  46 + <div class="portlet-body">
  47 + <div class="row">
  48 + <div class="col-md-3">
  49 + <div class="" style="margin-top: 10px;overflow:auto;height: 860px">
  50 + <table class="table table-bordered table-hover table-checkable pre-scrollable" id="info">
  51 + <thead>
  52 + <tr class="hidden">
  53 + <th>人员</th>
  54 + <th>自编号</th>
  55 + <th>路牌</th>
  56 + </tr>
  57 + </thead>
  58 + <tbody>
  59 +
  60 + </tbody>
  61 + </table>
  62 + </div>
  63 + </div>
  64 + <div class="col-md-9" id="printArea">
  65 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  66 + <table class="table table-bordered table-checkable" id="forms">
67 <tbody class="ludan_1"> 67 <tbody class="ludan_1">
68 68
69 </tbody> 69 </tbody>
@@ -75,28 +75,39 @@ @@ -75,28 +75,39 @@
75 </tbody> 75 </tbody>
76 <tbody class="ludan_4"> 76 <tbody class="ludan_4">
77 77
78 - </tbody>  
79 - </table>  
80 - </div>  
81 - </div>  
82 - </div>  
83 - </div>  
84 - </div>  
85 - </div>  
86 -</div>  
87 -  
88 -<script>  
89 - $(function(){  
90 - // 关闭左侧栏  
91 - if (!$('body').hasClass('page-sidebar-closed')) 78 + </tbody>
  79 + </table>
  80 + </div>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 + </div>
  86 +</div>
  87 +
  88 +<script>
  89 + $(function(){
  90 + // 关闭左侧栏
  91 + if (!$('body').hasClass('page-sidebar-closed'))
92 $('.menu-toggler.sidebar-toggler').click(); 92 $('.menu-toggler.sidebar-toggler').click();
93 -  
94 - $("#date").datetimepicker({  
95 - format : 'YYYY-MM-DD',  
96 - locale : 'zh-cn' 93 +
  94 + $("#date").datetimepicker({
  95 + format : 'YYYY-MM-DD',
  96 + locale : 'zh-cn'
97 }); 97 });
98 98
99 - $('#line').select2({ 99 + $.get('/basic/lineCode2Name',function(result){
  100 + var data=[];
  101 +
  102 + for(var code in result){
  103 + data.push({id: code, text: result[code]});
  104 + }
  105 + console.log(data);
  106 + initPinYinSelect2('#line',data,'');
  107 +
  108 + })
  109 +
  110 + /* $('#line').select2({
100 ajax: { 111 ajax: {
101 url: '/realSchedule/findLine', 112 url: '/realSchedule/findLine',
102 type: 'post', 113 type: 'post',
@@ -134,29 +145,30 @@ @@ -134,29 +145,30 @@
134 } 145 }
135 } 146 }
136 }); 147 });
  148 + */
137 149
138 - var date = '';  
139 - $("#query").on("click",function(){  
140 - var line = $("#line").val(); 150 + var date = '';
  151 + $("#query").on("click",function(){
  152 + var line = $("#line").val();
141 date = $("#date").val(); 153 date = $("#date").val();
142 - $(".hidden").removeClass("hidden");  
143 - $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){  
144 - // 把数据填充到模版中  
145 - var tbodyHtml = template('list_info',{list:result});  
146 - // 把渲染好的模版html文本追加到表格中  
147 - $('#info tbody').html(tbodyHtml);  
148 - }); 154 + $(".hidden").removeClass("hidden");
  155 + $get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  156 + // 把数据填充到模版中
  157 + var tbodyHtml = template('list_info',{list:result});
  158 + // 把渲染好的模版html文本追加到表格中
  159 + $('#info tbody').html(tbodyHtml);
  160 + });
149 }); 161 });
150 162
151 var params = new Array(); 163 var params = new Array();
152 - var jName = ''; 164 + var jName = '';
153 $("#info tbody").on("click","tr",function(){ 165 $("#info tbody").on("click","tr",function(){
154 if($(this).children().size() < 2){ 166 if($(this).children().size() < 2){
155 return; 167 return;
156 - }  
157 -  
158 - $(this).children().each(function(index){  
159 - params[index] = $(this).text(); 168 + }
  169 +
  170 + $(this).children().each(function(index){
  171 + params[index] = $(this).text();
160 }); 172 });
161 console.log(params); 173 console.log(params);
162 jName = params[0].split("\\")[0]; 174 jName = params[0].split("\\")[0];
@@ -169,18 +181,18 @@ @@ -169,18 +181,18 @@
169 // 把渲染好的模版html文本追加到表格中 181 // 把渲染好的模版html文本追加到表格中
170 $('#forms .ludan_1').html(ludan_1); 182 $('#forms .ludan_1').html(ludan_1);
171 //$('#forms .ludan_4').html(ludan_4); 183 //$('#forms .ludan_4').html(ludan_4);
172 - }); 184 + });
173 $post('/realSchedule/queryListWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){ 185 $post('/realSchedule/queryListWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){
174 - getTime(result);  
175 - var ludan_2 = template('ludan_2',{list:result});  
176 - // 把渲染好的模版html文本追加到表格中  
177 - $('#forms .ludan_2').html(ludan_2); 186 + getTime(result);
  187 + var ludan_2 = template('ludan_2',{list:result});
  188 + // 把渲染好的模版html文本追加到表格中
  189 + $('#forms .ludan_2').html(ludan_2);
178 }); 190 });
179 $post('/realSchedule/findKMBC',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){ 191 $post('/realSchedule/findKMBC',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){
180 var ludan_3 = template('ludan_3',result); 192 var ludan_3 = template('ludan_3',result);
181 $('#forms .ludan_3').html(ludan_3); 193 $('#forms .ludan_3').html(ludan_3);
182 }); 194 });
183 - 195 +
184 }); 196 });
185 197
186 $("#export").on("click",function(){ 198 $("#export").on("click",function(){
@@ -216,22 +228,22 @@ @@ -216,22 +228,22 @@
216 } 228 }
217 } 229 }
218 }); 230 });
219 - }  
220 - });  
221 -</script>  
222 -<script type="text/html" id="list_info">  
223 - {{each list as obj i}}  
224 - <tr>  
225 - <td width="45%">{{obj[4]}}\{{obj[1]}}</td>  
226 - <td width="32%">{{obj[2]}}</td>  
227 - <td width="23%">{{obj[3]}}<input type="hidden" id="{{obj[2]}}" value="{{obj[0]}}"></td>  
228 - </tr>  
229 - {{/each}}  
230 - {{if list.length == 0}}  
231 - <tr>  
232 - <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>  
233 - </tr>  
234 - {{/if}} 231 + }
  232 + });
  233 +</script>
  234 +<script type="text/html" id="list_info">
  235 + {{each list as obj i}}
  236 + <tr>
  237 + <td width="45%">{{obj[4]}}\{{obj[1]}}</td>
  238 + <td width="32%">{{obj[2]}}</td>
  239 + <td width="23%">{{obj[3]}}<input type="hidden" id="{{obj[2]}}" value="{{obj[0]}}"></td>
  240 + </tr>
  241 + {{/each}}
  242 + {{if list.length == 0}}
  243 + <tr>
  244 + <td colspan="3"><h6 class="muted">没有找到相关数据</h6></td>
  245 + </tr>
  246 + {{/if}}
235 </script> 247 </script>
236 <script type="text/html" id="ludan_1"> 248 <script type="text/html" id="ludan_1">
237 <tr> 249 <tr>
@@ -292,31 +304,31 @@ @@ -292,31 +304,31 @@
292 <td colspan="1">快</td> 304 <td colspan="1">快</td>
293 <td colspan="1">慢</td> 305 <td colspan="1">慢</td>
294 </tr> 306 </tr>
295 -</script>  
296 -<script type="text/html" id="ludan_2">  
297 - {{each list as obj i}}  
298 - <tr>  
299 - <td>{{i+1}}</td>  
300 - <td>{{obj.jName}}</td>  
301 - <td>{{obj.sName}}</td>  
302 - <td>&nbsp;</td>  
303 - <td>{{obj.qdzName}}</td>  
304 - <td>{{obj.zdzName}}</td>  
305 - <td>{{obj.fcsj}}</td>  
306 - <td>{{obj.fcsjActual}}</td>  
307 - <td>{{obj.zdsj}}</td>  
308 - <td>{{obj.zdsjActual}}</td>  
309 - <td>{{obj.fast}}</td>  
310 - <td>{{obj.slow}}</td> 307 +</script>
  308 +<script type="text/html" id="ludan_2">
  309 + {{each list as obj i}}
  310 + <tr>
  311 + <td>{{i+1}}</td>
  312 + <td>{{obj.jName}}</td>
  313 + <td>{{obj.sName}}</td>
  314 + <td>&nbsp;</td>
  315 + <td>{{obj.qdzName}}</td>
  316 + <td>{{obj.zdzName}}</td>
  317 + <td>{{obj.fcsj}}</td>
  318 + <td>{{obj.fcsjActual}}</td>
  319 + <td>{{obj.zdsj}}</td>
  320 + <td>{{obj.zdsjActual}}</td>
  321 + <td>{{obj.fast}}</td>
  322 + <td>{{obj.slow}}</td>
311 <td>{{obj.jhlc}}</td> 323 <td>{{obj.jhlc}}</td>
312 - <td>{{obj.remarks}}</td>  
313 - </tr> 324 + <td>{{obj.remarks}}</td>
  325 + </tr>
314 {{/each}} 326 {{/each}}
315 {{if list.length == 0}} 327 {{if list.length == 0}}
316 <tr> 328 <tr>
317 <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td> 329 <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
318 </tr> 330 </tr>
319 - {{/if}} 331 + {{/if}}
320 </script> 332 </script>
321 <script type="text/html" id="ludan_3"> 333 <script type="text/html" id="ludan_3">
322 <tr> 334 <tr>
src/main/resources/static/pages/forms/statement/waybillday.html
@@ -79,45 +79,16 @@ @@ -79,45 +79,16 @@
79 locale : 'zh-cn' 79 locale : 'zh-cn'
80 }); 80 });
81 81
82 - $('#line').select2({  
83 - ajax: {  
84 - url: '/realSchedule/findLine',  
85 - type: 'post',  
86 - dataType: 'json',  
87 - delay: 150,  
88 - data: function(params){  
89 - return{line: params.term};  
90 - },  
91 - processResults: function (data) {  
92 - return {  
93 - results: data  
94 - };  
95 - },  
96 - cache: true  
97 - },  
98 - templateResult: function(repo){  
99 - if (repo.loading) return repo.text;  
100 - var h = '<span>'+repo.text+'</span>';  
101 - return h;  
102 - },  
103 - escapeMarkup: function (markup) { return markup; },  
104 - minimumInputLength: 1,  
105 - templateSelection: function(repo){  
106 - return repo.text;  
107 - },  
108 - language: {  
109 - noResults: function(){  
110 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
111 - },  
112 - inputTooShort : function(e) {  
113 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
114 - },  
115 - searching : function() {  
116 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
117 - }  
118 - }  
119 - });  
120 - 82 + $.get('/basic/lineCode2Name',function(result){
  83 + var data=[];
  84 +
  85 + for(var code in result){
  86 + data.push({id: code, text: result[code]});
  87 + }
  88 + console.log(data);
  89 + initPinYinSelect2('#line',data,'');
  90 +
  91 + })
121 var line; 92 var line;
122 var date; 93 var date;
123 $("#query").on("click",function(){ 94 $("#query").on("click",function(){
src/main/resources/static/pages/oil/list.html
@@ -294,8 +294,7 @@ $(function(){ @@ -294,8 +294,7 @@ $(function(){
294 } 294 }
295 }); 295 });
296 $get('/ylb/obtain', params, function(){ 296 $get('/ylb/obtain', params, function(){
297 - console.log("----------------------");  
298 - jsDoQuery(null,true); 297 + jsDoQuery(params,true);
299 }); 298 });
300 }else{ 299 }else{
301 layer.msg('请选择日期.'); 300 layer.msg('请选择日期.');
src/main/resources/static/pages/permission/role/companyAuthority.html 0 → 100644
  1 +<style>
  2 + .cmpy-auth-card {
  3 + width: 760px;
  4 + background: #fff;
  5 + margin: auto;
  6 + padding: 15px;
  7 + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  8 + }
  9 +
  10 + .cmpy-auth-card .yunyin-company-panel:last-child {
  11 + border-bottom: none;
  12 + padding-bottom: 0px;
  13 + }
  14 +
  15 + .yunyin-company-panel {
  16 + border-bottom: 1px solid #e9e5e5;
  17 + padding-bottom: 5px;
  18 +
  19 + user-select:none;
  20 + }
  21 +
  22 + .yunyin-company-panel .company {
  23 + font-size: 13px;
  24 + }
  25 +
  26 + .yunyin-company-panel .sub-company {
  27 + display: inline-block;
  28 + text-align: center;
  29 + padding: 5px 15px;
  30 + border-radius: 5px !important;
  31 + color: #5d5c5c;
  32 + font-size: 13px;
  33 + background: linear-gradient(to bottom, #fafafa, #eeeeee);
  34 + cursor: pointer;
  35 + border: 1px solid #eeeeee;
  36 + }
  37 +
  38 + .yunyin-company-panel .sub-company.active {
  39 + background: linear-gradient(to bottom, #2ab4c0, #229ea9);
  40 + color: #fdfdfd;
  41 + }
  42 +</style>
  43 +
  44 +<div id="roleCompanyAuthority">
  45 +
  46 + <div class="page-head">
  47 + <div class="page-title">
  48 + <h1>模块配置</h1>
  49 + </div>
  50 + </div>
  51 +
  52 + <ul class="page-breadcrumb breadcrumb">
  53 + <li><a href="/pages/home.html" data-pjax>首页</a> <i
  54 + class="fa fa-circle"></i></li>
  55 + <li><span class="active">权限管理</span> <i class="fa fa-circle"></i></li>
  56 + <li><a href="list.html" data-pjax>角色管理</a> <i class="fa fa-circle"></i></li>
  57 + <li><span class="active">分公司数据权限</span></li>
  58 + </ul>
  59 +
  60 + <div class="cmpy-auth-card">
  61 +
  62 + <h4>角色信息</h4>
  63 + <table class="table">
  64 + <tr>
  65 + <td>
  66 + 代码:<span id="roleCode"></span>
  67 + </td>
  68 + <td>
  69 + 名称:<span id="roleName"></span>
  70 + </td>
  71 + </tr>
  72 + </table>
  73 + </div>
  74 + <br><br>
  75 + <div class="cmpy-auth-card cmpy-list">
  76 + </div>
  77 +
  78 + <div class="cmpy-auth-card" style="text-align: right;">
  79 + <button type="button" class="btn btn-default">返回</button>&nbsp;
  80 + <button type="button" class="btn btn-primary saveBtn" ><i class="fa fa-check"></i>保存</button>
  81 + </div>
  82 +
  83 + <script id="role-company-authority-temp" type="text/html">
  84 + {{each list as obj i}}
  85 + <div class="yunyin-company-panel">
  86 + <h5 class="company">{{obj.name}}</h5>
  87 + {{each obj.childs as fgs i}}
  88 + <div class="sub-company" data-company="{{obj.name}}" data-id="{{fgs.upCode}}_{{fgs.businessCode}}">{{fgs.businessName}}</div>
  89 + {{/each}}
  90 + </div>
  91 + {{/each}}
  92 + </script>
  93 +
  94 +</div>
  95 +
  96 +<script>
  97 +$(function () {
  98 + var id = $.url().param('no')
  99 + ,roleObj;
  100 +
  101 + if(!id){
  102 + alert('缺少主键');
  103 + }
  104 + else{
  105 + $.get('/role/'+id , function(obj){
  106 + $('#roleCompanyAuthority #roleCode').text(obj.codeName);
  107 + $('#roleCompanyAuthority #roleName').text(obj.roleName);
  108 + });
  109 + }
  110 +
  111 +
  112 + $.get('/business/all', function (rs) {
  113 + var baseCode;
  114 + //找到跟节点
  115 + $.each(rs, function () {
  116 + if(this.upCode == 0){
  117 + baseCode=this.businessCode;
  118 + return false;
  119 + }
  120 + });
  121 + if(!baseCode){
  122 + alert('大爷找不到跟节点,数据有问题吧!!!');
  123 + return;
  124 + }
  125 + //提取二级节点
  126 + var secondMap={};
  127 + $.each(rs, function () {
  128 + if(this.upCode==baseCode){
  129 + secondMap[this.businessCode] = {
  130 + name: this.businessName,
  131 + childs: []
  132 + };
  133 + }
  134 + });
  135 + //分公司节点
  136 + $.each(rs, function () {
  137 + if(secondMap[this.upCode])
  138 + secondMap[this.upCode].childs.push(this);
  139 + });
  140 +
  141 + //排序
  142 + for(var sid in secondMap){
  143 + secondMap[sid].childs.sort(naturalSort);
  144 + }
  145 +
  146 + var htmlStr=template('role-company-authority-temp', {list: get_vals(secondMap)});
  147 + $('#roleCompanyAuthority .cmpy-list').html(htmlStr);
  148 +
  149 + //查询公司权限信息
  150 + $get('/companyAuthority/all', {roleId_eq: id}, function (rs) {
  151 + //console.log(rs);
  152 + var dataId;
  153 + $.each(rs, function () {
  154 + dataId=this.companyCode+'_'+this.subCompanyCode;
  155 + $('.cmpy-list div.sub-company[data-id='+dataId+']').addClass('active');
  156 + });
  157 + });
  158 + });
  159 +
  160 + $('#roleCompanyAuthority').on('click', '.cmpy-list .sub-company', function () {
  161 + if($(this).hasClass('active'))
  162 + $(this).removeClass('active');
  163 + else
  164 + $(this).addClass('active');
  165 + });
  166 +
  167 + var get_vals = function(json) {
  168 + var array = [];
  169 + for (var key in json) {
  170 + array.push(json[key]);
  171 + }
  172 +
  173 + return array;
  174 + }
  175 +
  176 + var naturalSort=function (a, b) {
  177 + return a.businessCode.localeCompare(b.businessCode);
  178 + }
  179 +
  180 + //保存
  181 + $('#roleCompanyAuthority .saveBtn').on('click', function () {
  182 + var ats=$('.cmpy-list div.sub-company.active', '#roleCompanyAuthority')
  183 + ,data=[];
  184 + var code;
  185 + $.each(ats, function () {
  186 + code = $(this).data('id').split('_');
  187 + data.push({
  188 + companyCode: code[0],
  189 + subCompanyCode: code[1],
  190 + companyName: $(this).data('company'),
  191 + subCompanyName: $(this).text()
  192 + });
  193 + });
  194 +
  195 + $post('/companyAuthority/save', {roleId: id, authJsonStr: JSON.stringify(data)}, function (rs) {
  196 + alert('保存成功!');
  197 + })
  198 + });
  199 +});
  200 +</script>
0 \ No newline at end of file 201 \ No newline at end of file
src/main/resources/static/pages/permission/role/list.html
@@ -66,9 +66,15 @@ @@ -66,9 +66,15 @@
66 <a href="settings.html?no={{role.id}}" data-pjax class=" font-blue " 66 <a href="settings.html?no={{role.id}}" data-pjax class=" font-blue "
67 style="display: inline-block; margin-right: 5px;"> <i 67 style="display: inline-block; margin-right: 5px;"> <i
68 class="fa fa-meh-o"> </i> 模块配置 68 class="fa fa-meh-o"> </i> 模块配置
69 - </a> <a href="javascript:;" class=" font-blue "  
70 - style="display: inline-block;" > <i class="fa fa-key">  
71 - </i> 分配资源 69 + </a>
  70 + <a href="javascript:;" class=" font-blue "
  71 + style="display: inline-block;color: #aaaaaa !important;" > <i class="fa fa-key">
  72 + </i> 系统资源权限
  73 + </a>
  74 +
  75 + <hr>
  76 + <a href="companyAuthority.html?no={{role.id}}" data-pjax class="font-blue"
  77 + style="display: inline-block; font-size: 12px;" > 分公司数据权限
72 </a> 78 </a>
73 </div> 79 </div>
74 </div> 80 </div>
src/main/resources/static/pages/report/inoutstation.html
@@ -169,44 +169,17 @@ @@ -169,44 +169,17 @@
169 locale : 'zh-cn' 169 locale : 'zh-cn'
170 }); 170 });
171 171
172 - $('#line').select2({  
173 - ajax: {  
174 - url: '/realSchedule/findLine',  
175 - type: 'post',  
176 - dataType: 'json',  
177 - delay: 150,  
178 - data: function(params){  
179 - return{line: params.term};  
180 - },  
181 - processResults: function (data) {  
182 - return {  
183 - results: data  
184 - };  
185 - },  
186 - cache: true  
187 - },  
188 - templateResult: function(repo){  
189 - if (repo.loading) return repo.text;  
190 - var h = '<span>'+repo.text+'</span>';  
191 - return h;  
192 - },  
193 - escapeMarkup: function (markup) { return markup; },  
194 - minimumInputLength: 1,  
195 - templateSelection: function(repo){  
196 - return repo.text;  
197 - },  
198 - language: {  
199 - noResults: function(){  
200 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
201 - },  
202 - inputTooShort : function(e) {  
203 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
204 - },  
205 - searching : function() {  
206 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
207 - } 172 +
  173 + $.get('/basic/lineCode2Name',function(result){
  174 + var data=[];
  175 +
  176 + for(var code in result){
  177 + data.push({id: code, text: result[code]});
208 } 178 }
209 - }); 179 + console.log(data);
  180 + initPinYinSelect2('#line',data,'');
  181 +
  182 + })
210 183
211 184
212 $("#query").on("click",function(){ 185 $("#query").on("click",function(){
src/main/resources/static/pages/report/message/message.html
@@ -112,44 +112,16 @@ @@ -112,44 +112,16 @@
112 $("#date").val(year + "-0" + month + "-" + day); 112 $("#date").val(year + "-0" + month + "-" + day);
113 } 113 }
114 114
115 - $('#line').select2({  
116 - ajax: {  
117 - url: '/realSchedule/findLine',  
118 - type: 'post',  
119 - dataType: 'json',  
120 - delay: 150,  
121 - data: function(params){  
122 - return{line: params.term};  
123 - },  
124 - processResults: function (data) {  
125 - return {  
126 - results: data  
127 - };  
128 - },  
129 - cache: true  
130 - },  
131 - templateResult: function(repo){  
132 - if (repo.loading) return repo.text;  
133 - var h = '<span>'+repo.text+'</span>';  
134 - return h;  
135 - },  
136 - escapeMarkup: function (markup) { return markup; },  
137 - minimumInputLength: 1,  
138 - templateSelection: function(repo){  
139 - return repo.text;  
140 - },  
141 - language: {  
142 - noResults: function(){  
143 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
144 - },  
145 - inputTooShort : function(e) {  
146 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
147 - },  
148 - searching : function() {  
149 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
150 - } 115 + $.get('/basic/lineCode2Name',function(result){
  116 + var data=[];
  117 +
  118 + for(var code in result){
  119 + data.push({id: code, text: result[code]});
151 } 120 }
152 - }); 121 + console.log(data);
  122 + initPinYinSelect2('#line',data,'');
  123 +
  124 + })
153 $('#code').select2({ 125 $('#code').select2({
154 ajax: { 126 ajax: {
155 url: '/realSchedule/sreachVehic', 127 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/report/oil/oilListMonth.html
@@ -103,44 +103,16 @@ @@ -103,44 +103,16 @@
103 $("#date").val(year + "-0" + month + "-" + day); 103 $("#date").val(year + "-0" + month + "-" + day);
104 } 104 }
105 105
106 - $('#line').select2({  
107 - ajax: {  
108 - url: '/realSchedule/findLine',  
109 - dataType: 'json',  
110 - delay: 150,  
111 - data: function(params){  
112 - return{line: params.term};  
113 - },  
114 - processResults: function (data) {  
115 - return {  
116 - results: data  
117 - };  
118 - },  
119 - cache: true  
120 - },  
121 - templateResult: function(repo){  
122 - if (repo.loading) return repo.text;  
123 - var h = '<span>'+repo.text+'</span>';  
124 - return h;  
125 - },  
126 - escapeMarkup: function (markup) { return markup; },  
127 - minimumInputLength: 1,  
128 - templateSelection: function(repo){  
129 - return repo.text;  
130 - },  
131 - language: {  
132 - noResults: function(){  
133 - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';  
134 - },  
135 - inputTooShort : function(e) {  
136 - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';  
137 - },  
138 - searching : function() {  
139 - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';  
140 - }  
141 - }  
142 - });  
143 - 106 + $.get('/basic/lineCode2Name',function(result){
  107 + var data=[];
  108 +
  109 + for(var code in result){
  110 + data.push({id: code, text: result[code]});
  111 + }
  112 + console.log(data);
  113 + initPinYinSelect2('#line',data,'');
  114 +
  115 + })
144 //查询 116 //查询
145 $("#query").on('click',function(){ 117 $("#query").on('click',function(){
146 var line = $("#line").val(); 118 var line = $("#line").val();
src/main/resources/static/real_control_v2/js/data/data_gps.js
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 var gb_data_gps = (function() { 3 var gb_data_gps = (function() {
4 4
5 //fixed time refresh delay 5 //fixed time refresh delay
6 - var delay = 1000 * 8; 6 + var delay = 1000 * 80;
7 //deviceId ——> gps 7 //deviceId ——> gps
8 var realData = {}; 8 var realData = {};
9 //refresh after callback 9 //refresh after callback
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 /**/ 42 /**/
43 .real_bottom_panel{ 43 .real_bottom_panel{
44 position: absolute !important; 44 position: absolute !important;
45 - height: 18px; 45 + height: 180px;
46 width: 100%; 46 width: 100%;
47 width: calc(100% - 342px); 47 width: calc(100% - 342px);
48 bottom: 2px !important; 48 bottom: 2px !important;
@@ -111,7 +111,8 @@ @@ -111,7 +111,8 @@
111 height: calc(100% - 7px); 111 height: calc(100% - 7px);
112 overflow: auto; 112 overflow: auto;
113 padding-top: 7px; 113 padding-top: 7px;
114 - font-size: 13px 114 + font-size: 13px;
  115 + position: relative;
115 } 116 }
116 117
117 .real_br_cont .uk-form .uk-form-row{ 118 .real_br_cont .uk-form .uk-form-row{
@@ -163,4 +164,149 @@ @@ -163,4 +164,149 @@
163 background-color: #fff; 164 background-color: #fff;
164 border-radius: 4px; 165 border-radius: 4px;
165 box-shadow: 0 2px 5px rgba(0,0,0,0.1); 166 box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  167 +}
  168 +
  169 +.gps_info_win p{
  170 + margin: 9px 0;
  171 + font-size: 13px;
  172 +}
  173 +
  174 +.gps_info_win h4,.gps_info_win h5{
  175 + color: #0E6AF9;
  176 + margin: 10px 0;
  177 +}
  178 +
  179 +.gps_info_win .date-str{
  180 + color: gray;font-size: 12px;
  181 +}
  182 +
  183 +.gps_info_win a{
  184 + color:#878887;font-size:12px;
  185 +}
  186 +
  187 +
  188 +.spinner {
  189 + margin: 50px auto;
  190 + width: 50px;
  191 + height: 40px;
  192 + text-align: center;
  193 + font-size: 10px;
  194 +}
  195 +
  196 +.spinner > div {
  197 + background-color: #69D7E1;
  198 + height: 100%;
  199 + width: 6px;
  200 + display: inline-block;
  201 +
  202 + -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
  203 + animation: sk-stretchdelay 1.2s infinite ease-in-out;
  204 +}
  205 +
  206 +.spinner .rect2 {
  207 + -webkit-animation-delay: -1.1s;
  208 + animation-delay: -1.1s;
  209 +}
  210 +
  211 +.spinner .rect3 {
  212 + -webkit-animation-delay: -1.0s;
  213 + animation-delay: -1.0s;
  214 +}
  215 +
  216 +.spinner .rect4 {
  217 + -webkit-animation-delay: -0.9s;
  218 + animation-delay: -0.9s;
  219 +}
  220 +
  221 +.spinner .rect5 {
  222 + -webkit-animation-delay: -0.8s;
  223 + animation-delay: -0.8s;
  224 +}
  225 +
  226 +@-webkit-keyframes sk-stretchdelay {
  227 + 0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
  228 + 20% { -webkit-transform: scaleY(1.0) }
  229 +}
  230 +
  231 +@keyframes sk-stretchdelay {
  232 + 0%, 40%, 100% {
  233 + transform: scaleY(0.4);
  234 + -webkit-transform: scaleY(0.4);
  235 + } 20% {
  236 + transform: scaleY(1.0);
  237 + -webkit-transform: scaleY(1.0);
  238 + }
  239 +}
  240 +
  241 +.sk-cube-grid {
  242 + width: 40px;
  243 + height: 40px;
  244 + margin: 100px auto;
  245 +}
  246 +
  247 +.sk-cube-grid .sk-cube {
  248 + width: 33%;
  249 + height: 33%;
  250 + background-color: #69D7E1;
  251 + float: left;
  252 + -webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
  253 + animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
  254 +}
  255 +.sk-cube-grid .sk-cube1 {
  256 + -webkit-animation-delay: 0.2s;
  257 + animation-delay: 0.2s; }
  258 +.sk-cube-grid .sk-cube2 {
  259 + -webkit-animation-delay: 0.3s;
  260 + animation-delay: 0.3s; }
  261 +.sk-cube-grid .sk-cube3 {
  262 + -webkit-animation-delay: 0.4s;
  263 + animation-delay: 0.4s; }
  264 +.sk-cube-grid .sk-cube4 {
  265 + -webkit-animation-delay: 0.1s;
  266 + animation-delay: 0.1s; }
  267 +.sk-cube-grid .sk-cube5 {
  268 + -webkit-animation-delay: 0.2s;
  269 + animation-delay: 0.2s; }
  270 +.sk-cube-grid .sk-cube6 {
  271 + -webkit-animation-delay: 0.3s;
  272 + animation-delay: 0.3s; }
  273 +.sk-cube-grid .sk-cube7 {
  274 + -webkit-animation-delay: 0s;
  275 + animation-delay: 0s; }
  276 +.sk-cube-grid .sk-cube8 {
  277 + -webkit-animation-delay: 0.1s;
  278 + animation-delay: 0.1s; }
  279 +.sk-cube-grid .sk-cube9 {
  280 + -webkit-animation-delay: 0.2s;
  281 + animation-delay: 0.2s; }
  282 +
  283 +@-webkit-keyframes sk-cubeGridScaleDelay {
  284 + 0%, 70%, 100% {
  285 + -webkit-transform: scale3D(1, 1, 1);
  286 + transform: scale3D(1, 1, 1);
  287 + } 35% {
  288 + -webkit-transform: scale3D(0, 0, 1);
  289 + transform: scale3D(0, 0, 1);
  290 + }
  291 +}
  292 +
  293 +@keyframes sk-cubeGridScaleDelay {
  294 + 0%, 70%, 100% {
  295 + -webkit-transform: scale3D(1, 1, 1);
  296 + transform: scale3D(1, 1, 1);
  297 + } 35% {
  298 + -webkit-transform: scale3D(0, 0, 1);
  299 + transform: scale3D(0, 0, 1);
  300 + }
  301 +}
  302 +.sk-cube-grid._center{
  303 + position: absolute;
  304 + top: 30%;
  305 + left: 50%;
  306 + transform: translate(-50%, -50%);
  307 + -webkit-transform: translate(-50%, -50%);
  308 +}
  309 +
  310 +#tcWrap.maplibTc{
  311 + display: none;
166 } 312 }
167 \ No newline at end of file 313 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_config.html
@@ -4,9 +4,9 @@ @@ -4,9 +4,9 @@
4 <div class="uk-form-row"> 4 <div class="uk-form-row">
5 <span class="uk-form-label">图层</span> 5 <span class="uk-form-label">图层</span>
6 <div class="uk-form-controls"> 6 <div class="uk-form-controls">
7 - <label><input type="radio" name="map_type" {{if map_type=='baidu'}}checked{{/if}}> 百度</label>  
8 - <label><input type="radio" name="map_type" {{if map_type=='gaode'}}checked{{/if}}> 高德</label>  
9 - <label><input type="checkbox" name="map_type" {{if traffic}}checked{{/if}}> 实时路况</label> 7 + <label><input type="radio" value="baidu" name="map_type" {{if map_type=='baidu'}}checked{{/if}}> 百度</label>
  8 + <label><input type="radio" value="gaode" name="map_type" {{if map_type=='gaode'}}checked{{/if}}> 高德</label>
  9 + <label><input type="checkbox" name="traffic" {{if traffic}}checked{{/if}}> 实时路况</label>
10 </div> 10 </div>
11 </div> 11 </div>
12 12
@@ -42,21 +42,21 @@ @@ -42,21 +42,21 @@
42 <div class="color_block"> 42 <div class="color_block">
43 上行 43 上行
44 <div class="sp-placeholder"> 44 <div class="sp-placeholder">
45 - <div class="sp-placeholder-color" style="background: {{carIcon.color.up}}"></div> 45 + <div class="sp-placeholder-color" data-name="carIcon.color.up" style="background: {{carIcon.color.up}}"></div>
46 </div> 46 </div>
47 </div> 47 </div>
48 48
49 <div class="color_block"> 49 <div class="color_block">
50 下行 50 下行
51 <div class="sp-placeholder"> 51 <div class="sp-placeholder">
52 - <div class="sp-placeholder-color" style="background: {{carIcon.color.down}}"></div> 52 + <div class="sp-placeholder-color" data-name="carIcon.color.down" style="background: {{carIcon.color.down}}"></div>
53 </div> 53 </div>
54 </div> 54 </div>
55 55
56 <div class="color_block"> 56 <div class="color_block">
57 非营运 57 非营运
58 <div class="sp-placeholder"> 58 <div class="sp-placeholder">
59 - <div class="sp-placeholder-color" style="background: {{carIcon.color.nonOperation}}"></div> 59 + <div class="sp-placeholder-color" data-name="carIcon.color.nonOperation" style="background: {{carIcon.color.nonOperation}}"></div>
60 </div> 60 </div>
61 </div> 61 </div>
62 </div> 62 </div>
@@ -68,14 +68,14 @@ @@ -68,14 +68,14 @@
68 <div class="color_block"> 68 <div class="color_block">
69 上行 69 上行
70 <div class="sp-placeholder"> 70 <div class="sp-placeholder">
71 - <div class="sp-placeholder-color" style="background: {{section.color.up}}"></div> 71 + <div class="sp-placeholder-color" data-name="section.color.up" style="background: {{section.color.up}}"></div>
72 </div> 72 </div>
73 </div> 73 </div>
74 74
75 <div class="color_block"> 75 <div class="color_block">
76 下行 76 下行
77 <div class="sp-placeholder"> 77 <div class="sp-placeholder">
78 - <div class="sp-placeholder-color" style="background: {{section.color.down}}"></div> 78 + <div class="sp-placeholder-color" data-name="section.color.down" style="background: {{section.color.down}}"></div>
79 </div> 79 </div>
80 </div> 80 </div>
81 </div> 81 </div>
@@ -85,3 +85,4 @@ @@ -85,3 +85,4 @@
85 </form> 85 </form>
86 </script> 86 </script>
87 </div> 87 </div>
  88 +<!-- 1111 -->
88 \ No newline at end of file 89 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
1 <div> 1 <div>
2 <script id="map-win-gps-detail-temp" type="text/html"> 2 <script id="map-win-gps-detail-temp" type="text/html">
3 - <div class="gps_info_win">  
4 - <h5 style="color:#0E6AF9;">  
5 - {{if stationName!=null}} 3 + <div class="gps_info_win" >
  4 + <h4>{{nbbm}}</h4>
  5 + <h5>
  6 + {{lineName}}
  7 + ({{if stationName!=null}}
6 {{stationName}} 8 {{stationName}}
7 {{else}} 9 {{else}}
8 未知站点 10 未知站点
9 - {{/if}} 11 + {{/if}})
10 </h5> 12 </h5>
11 - <h4 style="margin: 5px 0 5px 0;">  
12 - <span style="color: #0E6AF9;">{{nbbm}}</span>  
13 - </h4>  
14 - <p>  
15 - 营运状态:{{if state==0}}营运{{else}}非营运{{/if}}  
16 - </p>  
17 - <p>  
18 - 走向:{{if upDown==0}}上行{{else if upDown==1}}下行{{else}}未知走向{{/if}}  
19 - </p>  
20 <p>速度:{{speed}}</p> 13 <p>速度:{{speed}}</p>
  14 + <p>角度:{{direction}}</p>
21 <p>经度:{{lon}}</p> 15 <p>经度:{{lon}}</p>
22 <p>纬度:{{lat}}</p> 16 <p>纬度:{{lat}}</p>
23 17
24 - <!--<p style="color: gray;">{{fromNow}} 更新</p>--> 18 + <p class="date-str">{{dateStr}}</p>
25 <hr> 19 <hr>
26 - <p>  
27 - {{if currSch!=null}}  
28 - 路牌:{{currSch.lpName}}  
29 - {{/if}}  
30 - </p>  
31 - <p class="banci-info">  
32 - {{if currSch!=null}}开往 {{currSch.zdzName}}{{/if}}  
33 - </p>  
34 - <p class="banci-info">  
35 - {{if nextSch!=null}}  
36 - 下一班{{nextSch.qdzName}} {{nextSch.fcsj}} 发车  
37 - {{/if}}  
38 - </p>  
39 - <a href="javascript:lineGroup.toPlayBack('{{nbbm}}', '{{lineId}}')" class="link_to_pback"  
40 - style="color:#006600;font-size:12px;">轨迹回放</a> 20 + {{if expectStopTime!=null}}
  21 + <a href="javascript:;" style="color: #07D;margin-right: 7px;">预计 {{expectStopTime}} 分钟到达终点</a>
  22 + {{/if}}
  23 + <a href="javascript:;" style="float: right;">轨迹回放</a>
41 </div> 24 </div>
42 </script> 25 </script>
43 </div> 26 </div>
  27 +<!-- 2222 -->
44 \ No newline at end of file 28 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/js/config.js
@@ -46,9 +46,8 @@ var gb_map_config=(function () { @@ -46,9 +46,8 @@ var gb_map_config=(function () {
46 $('.map_config_wrap').html(formHtml); 46 $('.map_config_wrap').html(formHtml);
47 47
48 //颜色选择器 48 //颜色选择器
49 - $('.map_config_wrap .color_block').each(function () {  
50 - var c=$('.sp-placeholder-color',this).css('background-color');  
51 - var that=this; 49 + $('.map_config_wrap .color_block .sp-placeholder .sp-placeholder-color').each(function () {
  50 + var c=$(this).css('background-color');
52 $(this).spectrum({ 51 $(this).spectrum({
53 color: c, 52 color: c,
54 showInput: true, 53 showInput: true,
@@ -57,15 +56,95 @@ var gb_map_config=(function () { @@ -57,15 +56,95 @@ var gb_map_config=(function () {
57 preferredFormat: "rgb", 56 preferredFormat: "rgb",
58 showAlpha: true, 57 showAlpha: true,
59 change: function (color) { 58 change: function (color) {
60 - $('.sp-placeholder-color',that).css('background-color', color); 59 + $(this).css('background-color', color);
  60 + //set attr
  61 + recursion_set_attr(defaultConfig, $(this).data('name'), color.toString());
  62 + //重新渲染地图覆盖物
  63 + gb_map_overlay_mge.reDraw();
61 } 64 }
62 }); 65 });
63 }); 66 });
64 67
  68 + $('.map_config_wrap form input').on('change', configChangeHandler);
65 69
66 }); 70 });
67 } 71 }
68 72
  73 + var configChangeHandler = function () {
  74 + //console.log('configChangeHandler..',this);
  75 + var name = $(this).attr('name')
  76 + ,val = $(this).attr('value');
  77 +
  78 + if(!name)
  79 + return;
  80 +
  81 + handler[name] && handler[name].call(this, val);
  82 + };
  83 +
  84 + var handler={
  85 + map_type: changeMapType,
  86 + traffic: trafficSwitch
  87 + };
  88 +
  89 + //切换地图类型
  90 + function changeMapType(val) {
  91 + //修改配置项
  92 + set('map_type', val);
  93 +
  94 + gb_map_imap.changeMap(val, function () {
  95 + //重绘覆盖物
  96 + gb_map_overlay_mge.reDraw();
  97 + setTimeout(function () {
  98 + //实时路况为打开状态
  99 + if(defaultConfig.traffic)
  100 + gb_map_imap.call('traffic', true);
  101 + }, 1000);
  102 + });
  103 + }
  104 +
  105 + //实时路况
  106 + function trafficSwitch(val) {
  107 + //修改配置项
  108 + set('traffic', this.checked);
  109 + gb_map_imap.call('traffic', this.checked);
  110 + }
  111 +
  112 + function recursion_get_attr(data, attr){
  113 + var ats = attr.split('.'),
  114 + val = data;
  115 +
  116 + $.each(ats, function (i, a) {
  117 + val=val[a];
  118 +
  119 + if(!val)
  120 + return false;
  121 + });
  122 +
  123 + return val;
  124 + }
  125 +
  126 + function recursion_set_attr(data, attr, value) {
  127 + var ats = attr.split('.'),
  128 + tempVal = data
  129 + ,len = ats.length;
  130 +
  131 + $.each(ats, function (i, a) {
  132 + if(i == len -1){
  133 + tempVal[a] = value;
  134 + return false;
  135 + }
  136 + else
  137 + tempVal=tempVal[a];
  138 +
  139 + if(!tempVal)
  140 + return false;
  141 + });
  142 + }
  143 +
  144 + function set(name, val){
  145 + defaultConfig[name]=val;
  146 + }
  147 +
69 return { 148 return {
70 getConfig: function () { 149 getConfig: function () {
71 return defaultConfig; 150 return defaultConfig;
src/main/resources/static/real_control_v2/mapmonitor/js/gps_tree.js
1 -var gb_map_gps_tree = (function () {  
2 -  
3 -  
4 - var treeObj;  
5 -  
6 - var jstreeChanged = function (e, node, event) {  
7 - gb_map_overlay_mge.refresh();  
8 - };  
9 -  
10 - var init = function (cb) {  
11 - //设备树  
12 - var treeData = gb_common.get_device_tree_data();  
13 - treeObj = $('.real_right_gps_panel .gps_tree_list')  
14 - //节点初始化完成  
15 - .on('ready.jstree', function () {  
16 - treeObj.jstree(true).open_all();  
17 - //删掉tree node a标签的 href值(避免鼠标悬停浏览器出现状态条)  
18 - $('.gps_tree_list .jstree-container-ul a.jstree-anchor').removeAttr('href');  
19 - })  
20 - //state插件 状态恢复完成  
21 - .on('state_ready.jstree', function () {  
22 - //绑定checkbox状态切换事件  
23 - treeObj.on('check_node.jstree uncheck_node.jstree', jstreeChanged);  
24 - cb && cb();  
25 - })  
26 - .on('activate_node.jstree', function (e, n) {  
27 - var node = n.node;  
28 - if(node.a_attr && node.a_attr.type=='device'){  
29 - var device = node.a_attr.device;  
30 - gb_map_overlay_mge._focus(device);  
31 - }  
32 - })  
33 - .jstree({  
34 - 'core': {  
35 - 'data': treeData  
36 - },  
37 - 'checkbox': {  
38 - 'keep_selected_style': false,  
39 - 'whole_node': false,  
40 - 'tie_selection': false  
41 - },  
42 - 'contextmenu': {  
43 - 'items': {  
44 - '轨迹回放': {  
45 - 'label': '轨迹回放',  
46 - 'action': function (data) {  
47 - console.log('action', data);  
48 - }  
49 - },  
50 - '发送指令': {  
51 - 'label': '发送指令',  
52 - 'action': function (data) {  
53 - console.log('action', data);  
54 - }  
55 - }  
56 - }  
57 - },  
58 - 'plugins': ['checkbox', 'contextmenu', 'state']  
59 - });  
60 - };  
61 -  
62 - return {  
63 - init: init,  
64 - getChecked: function () {  
65 - return treeObj.jstree(true).get_checked(true);  
66 - }  
67 - }; 1 +var gb_map_gps_tree = (function () {
  2 +
  3 +
  4 + var treeObj;
  5 +
  6 + var jstreeChanged = function (e, node, event) {
  7 + gb_map_overlay_mge.refresh();
  8 + };
  9 +
  10 + var init = function (cb) {
  11 + //设备树
  12 + var treeData = gb_common.get_device_tree_data();
  13 + treeObj = $('.real_right_gps_panel .gps_tree_list')
  14 + //节点初始化完成
  15 + .on('ready.jstree', function () {
  16 + treeObj.jstree(true).open_all();
  17 + //删掉tree node a标签的 href值(避免鼠标悬停浏览器出现状态条)
  18 + $('.gps_tree_list .jstree-container-ul a.jstree-anchor').removeAttr('href');
  19 + })
  20 + //state插件 状态恢复完成
  21 + .on('state_ready.jstree', function () {
  22 + //绑定checkbox状态切换事件
  23 + treeObj.on('check_node.jstree uncheck_node.jstree', jstreeChanged);
  24 + cb && cb();
  25 + })
  26 + .on('activate_node.jstree', function (e, n) {
  27 + var node = n.node;
  28 + if(node.a_attr && node.a_attr.type=='device'){
  29 + var device = node.a_attr.device;
  30 + gb_map_overlay_mge._focus(device);
  31 + }
  32 + })
  33 + .jstree({
  34 + 'core': {
  35 + 'data': treeData
  36 + },
  37 + 'checkbox': {
  38 + 'keep_selected_style': false,
  39 + 'whole_node': false,
  40 + 'tie_selection': false
  41 + },
  42 + 'contextmenu': {
  43 + 'items': {
  44 + '轨迹回放': {
  45 + 'label': '轨迹回放',
  46 + 'action': function (data) {
  47 + console.log('action', data);
  48 + }
  49 + },
  50 + '发送指令': {
  51 + 'label': '发送指令',
  52 + 'action': function (data) {
  53 + console.log('action', data);
  54 + }
  55 + }
  56 + }
  57 + },
  58 + 'plugins': ['checkbox', 'contextmenu', 'state']
  59 + });
  60 + };
  61 +
  62 + return {
  63 + init: init,
  64 + getChecked: function () {
  65 + return treeObj.jstree(true).get_checked(true);
  66 + }
  67 + };
68 })(); 68 })();
69 \ No newline at end of file 69 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/js/map/iMap.js
@@ -16,35 +16,25 @@ var gb_map_imap = (function () { @@ -16,35 +16,25 @@ var gb_map_imap = (function () {
16 currentMap = name; 16 currentMap = name;
17 return mapProxy; 17 return mapProxy;
18 }, 18 },
19 - changeDefault: function (mapName) { 19 + changeMap: function (mapName, cb) {
20 if (mapName == currentMap) 20 if (mapName == currentMap)
21 return; 21 return;
22 if (maps[mapName]) { 22 if (maps[mapName]) {
23 //原地图 destroy 23 //原地图 destroy
24 var oldMap = maps[currentMap].instance; 24 var oldMap = maps[currentMap].instance;
25 oldMap.destroy && oldMap.destroy(); 25 oldMap.destroy && oldMap.destroy();
26 - $(gb_map_consts.mapContainer).html('');  
27 - //解除实时路况按钮点击事件  
28 - $(gb_map_consts.trafficBtn).unbind('click');  
29 -  
30 //新地图 INIT 26 //新地图 INIT
31 - var text = maps[mapName].text; 27 + //var text = maps[mapName].text;
32 //layer.msg('正在切换到' + text + '...', {icon : 16,shade : [ 0.6, '#393D49' ],time : 0}); 28 //layer.msg('正在切换到' + text + '...', {icon : 16,shade : [ 0.6, '#393D49' ],time : 0});
33 var newMap = maps[mapName].instance; 29 var newMap = maps[mapName].instance;
34 - newMap.init();  
35 - setText(text);  
36 30
37 currentMap = mapName; 31 currentMap = mapName;
38 - //收拢线路  
39 - $('.mapRightWrap .collapse.in').collapse('hide'); 32 + newMap.init(cb);
40 } else 33 } else
41 alertErr('不存在的地图实例' + mapName); 34 alertErr('不存在的地图实例' + mapName);
42 }, 35 },
43 createCarIcon: createCarIcon, 36 createCarIcon: createCarIcon,
44 call: function (f, opts) { 37 call: function (f, opts) {
45 - if (f == 'init')  
46 - setText(maps[currentMap].text);  
47 -  
48 var instance = maps[currentMap].instance; 38 var instance = maps[currentMap].instance;
49 if (instance[f]) 39 if (instance[f])
50 instance[f](opts); 40 instance[f](opts);
@@ -87,24 +77,19 @@ var gb_map_imap = (function () { @@ -87,24 +77,19 @@ var gb_map_imap = (function () {
87 case 0: 77 case 0:
88 if (g.upDown == 0) { 78 if (g.upDown == 0) {
89 //营运上行 79 //营运上行
90 - colours['bgColor'] = 'rgba(94, 150, 210, 1)'; 80 + colours['bgColor'] = gb_map_config.getConfig().carIcon.color.up;
91 colours['shadow'] = 'rgba(94, 150, 210, 0.3)'; 81 colours['shadow'] = 'rgba(94, 150, 210, 0.3)';
92 } 82 }
93 else if (g.upDown == 1) { 83 else if (g.upDown == 1) {
94 //营运下行 84 //营运下行
95 - colours['bgColor'] = 'rgba(201, 33, 33, 1)'; 85 + colours['bgColor'] = gb_map_config.getConfig().carIcon.color.down;
96 colours['shadow'] = 'rgba(201, 33, 33, 0.3)'; 86 colours['shadow'] = 'rgba(201, 33, 33, 0.3)';
97 } 87 }
98 - else {  
99 - //未知走向  
100 - colours['bgColor'] = 'rgba(0, 0, 0, 1)';  
101 - colours['shadow'] = 'rgba(0, 0, 0, 0.3)';  
102 - }  
103 break; 88 break;
104 89
105 default: 90 default:
106 //非营运 91 //非营运
107 - colours['bgColor'] = 'rgba(136, 133, 133, 1)'; 92 + colours['bgColor'] = gb_map_config.getConfig().carIcon.color.nonOperation;
108 colours['shadow'] = 'rgba(136, 133, 133, 0.3)'; 93 colours['shadow'] = 'rgba(136, 133, 133, 0.3)';
109 break; 94 break;
110 } 95 }
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/baidu.js
@@ -11,25 +11,28 @@ var gb_map_baidu = (function(){ @@ -11,25 +11,28 @@ var gb_map_baidu = (function(){
11 11
12 var polylines={}; 12 var polylines={};
13 var buffAreas = {}; 13 var buffAreas = {};
  14 +
  15 + var ctrl;
14 var baiduInstance = { 16 var baiduInstance = {
15 //初始化 17 //初始化
16 - init: function(){ 18 + init: function(cb){
17 if(!window.BMap){ 19 if(!window.BMap){
18 alert('地图没有加载成功,请确认是否能正常连接外网!!'); 20 alert('地图没有加载成功,请确认是否能正常连接外网!!');
19 return; 21 return;
20 } 22 }
21 map = new BMap.Map($(gb_map_consts.mapContainer)[0]); 23 map = new BMap.Map($(gb_map_consts.mapContainer)[0]);
22 //中心点和缩放级别 24 //中心点和缩放级别
23 - map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 12); 25 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 13);
24 map.enableScrollWheelZoom(); 26 map.enableScrollWheelZoom();
25 27
26 - window.localStorage.setItem('real_map', 'baidu'); 28 + cb && cb();
  29 + //window.localStorage.setItem('real_map', 'baidu');
27 30
28 // 路况控件 31 // 路况控件
29 -/* var ctrl = new BMapLib.TrafficControl(); 32 + ctrl = new BMapLib.TrafficControl();
30 map.addControl(ctrl); 33 map.addControl(ctrl);
31 34
32 - $(gb_map_consts.trafficBtn).on('click', function() { 35 + /*$(gb_map_consts.trafficBtn).on('click', function() {
33 if (traffVisible) { 36 if (traffVisible) {
34 ctrl.hide(); 37 ctrl.hide();
35 traffVisible = false; 38 traffVisible = false;
@@ -52,11 +55,11 @@ var gb_map_baidu = (function(){ @@ -52,11 +55,11 @@ var gb_map_baidu = (function(){
52 destroy: function(){ 55 destroy: function(){
53 realMarkers = {}; 56 realMarkers = {};
54 linePolyline = []; 57 linePolyline = [];
55 - }, 58 + }/*,
56 clear: function(){ 59 clear: function(){
57 realMarkers = {}; 60 realMarkers = {};
58 map.clearOverlays(); 61 map.clearOverlays();
59 - }, 62 + }*/,
60 //画线路图层 63 //画线路图层
61 drawLine: function(opt){ 64 drawLine: function(opt){
62 if(polylines[opt.id]) 65 if(polylines[opt.id])
@@ -76,8 +79,16 @@ var gb_map_baidu = (function(){ @@ -76,8 +79,16 @@ var gb_map_baidu = (function(){
76 if(opt.hide) 79 if(opt.hide)
77 polyline.hide(); 80 polyline.hide();
78 map.addOverlay(polyline); 81 map.addOverlay(polyline);
79 - //居中  
80 - //centerToPolyline(polyline); 82 +
  83 + //延迟居中,避免多次调用时抖动
  84 + delayToCenter(pos[parseInt(pos.length / 2)]);
  85 + //map.panTo(pos[parseInt(pos.length / 2)]);
  86 + },
  87 + traffic: function (enable) {
  88 + if(enable)
  89 + ctrl.show();
  90 + else
  91 + ctrl.hide();
81 }, 92 },
82 //根据id 显示polyline 93 //根据id 显示polyline
83 refreshPolyline: function (opt) { 94 refreshPolyline: function (opt) {
@@ -128,6 +139,13 @@ var gb_map_baidu = (function(){ @@ -128,6 +139,13 @@ var gb_map_baidu = (function(){
128 } 139 }
129 }); 140 });
130 }, 141 },
  142 + clearAll: function () {
  143 + //清除所有覆盖物
  144 + realMarkers = {};
  145 + polylines={};
  146 + map.clearOverlays();
  147 +
  148 + },
131 showGpsMarker:function (opt) { 149 showGpsMarker:function (opt) {
132 var chs = opt.chs; 150 var chs = opt.chs;
133 for(var device in realMarkers){ 151 for(var device in realMarkers){
@@ -203,9 +221,9 @@ var gb_map_baidu = (function(){ @@ -203,9 +221,9 @@ var gb_map_baidu = (function(){
203 } 221 }
204 222
205 var bd_gps_info_win_opts = { 223 var bd_gps_info_win_opts = {
206 - width : 190, 224 + width : 0,
207 height: 255, 225 height: 255,
208 - enableMessage:true 226 + enableMessage:false
209 }; 227 };
210 function createBDMarkerByGps(gpsData){ 228 function createBDMarkerByGps(gpsData){
211 229
@@ -219,9 +237,9 @@ var gb_map_baidu = (function(){ @@ -219,9 +237,9 @@ var gb_map_baidu = (function(){
219 marker.infoWindow = new BMap.InfoWindow(bd_gps_info_win_opts); 237 marker.infoWindow = new BMap.InfoWindow(bd_gps_info_win_opts);
220 marker.gpsData = gpsData; 238 marker.gpsData = gpsData;
221 //click 239 //click
222 - /*marker.addEventListener('click', function(){ 240 + marker.addEventListener('click', function(){
223 bdOpenWindow(this); 241 bdOpenWindow(this);
224 - });*/ 242 + });
225 //mouseover 243 //mouseover
226 marker.addEventListener('mouseover', function(){ 244 marker.addEventListener('mouseover', function(){
227 setTop(this); 245 setTop(this);
@@ -230,7 +248,7 @@ var gb_map_baidu = (function(){ @@ -230,7 +248,7 @@ var gb_map_baidu = (function(){
230 } 248 }
231 249
232 //隐藏线路线条 250 //隐藏线路线条
233 - function hideLinePolyline(){ 251 +/* function hideLinePolyline(){
234 if(!linePolyline || linePolyline.length == 0) 252 if(!linePolyline || linePolyline.length == 0)
235 return; 253 return;
236 254
@@ -249,7 +267,7 @@ var gb_map_baidu = (function(){ @@ -249,7 +267,7 @@ var gb_map_baidu = (function(){
249 $.each(linePolyline, function(){ 267 $.each(linePolyline, function(){
250 this.setStrokeOpacity(0.5); 268 this.setStrokeOpacity(0.5);
251 }); 269 });
252 - } 270 + }*/
253 271
254 function moveMarker(m, gps){ 272 function moveMarker(m, gps){
255 m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat)); 273 m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
@@ -273,9 +291,13 @@ var gb_map_baidu = (function(){ @@ -273,9 +291,13 @@ var gb_map_baidu = (function(){
273 } 291 }
274 292
275 function bdOpenWindow(marker){ 293 function bdOpenWindow(marker){
276 - marker.gpsData.fromNow = moment(marker.gpsData.timestamp).fromNow(); 294 + var gps = marker.gpsData;
  295 + //线路名
  296 + gps.lineName = gb_data_basic.lineCode2NameAll()[gps.lineId];
  297 + //时间
  298 + gps.dateStr = moment(gps.timestamp).format('YYYY-MM-DD HH:mm:ss');
277 299
278 - marker.infoWindow.setContent(gb_map_overlay_mge.map_gps_win_temp(marker.gpsData)); 300 + marker.infoWindow.setContent(gb_map_overlay_mge.map_gps_win_temp(gps));
279 map.openInfoWindow(marker.infoWindow, marker.point); 301 map.openInfoWindow(marker.infoWindow, marker.point);
280 } 302 }
281 303
@@ -284,6 +306,15 @@ var gb_map_baidu = (function(){ @@ -284,6 +306,15 @@ var gb_map_baidu = (function(){
284 map.panTo(pos[parseInt(pos.length / 2)]); 306 map.panTo(pos[parseInt(pos.length / 2)]);
285 }*/ 307 }*/
286 308
  309 +
  310 + var c_delay = 300, c_point;
  311 + function delayToCenter(point) {
  312 + c_point = point;
  313 + setTimeout(function () {
  314 + map.panTo(c_point);
  315 + }, c_delay);
  316 + }
  317 +
287 //文件载入完毕 318 //文件载入完毕
288 mapmonitor_load_ep.emitLater('load_baidu'); 319 mapmonitor_load_ep.emitLater('load_baidu');
289 320
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/gaode.js
@@ -16,11 +16,12 @@ var gb_map_gaode = (function() { @@ -16,11 +16,12 @@ var gb_map_gaode = (function() {
16 var topMarkr; 16 var topMarkr;
17 var realMarkers = {}; 17 var realMarkers = {};
18 //线路路由线条 18 //线路路由线条
19 - var linePolyline; 19 + var polylines={};
20 //实时路况是否显示 20 //实时路况是否显示
21 var traffVisible; 21 var traffVisible;
  22 + var trafficLayer;
22 var gaodeInstance = { 23 var gaodeInstance = {
23 - init : function() { 24 + init : function(cb) {
24 var $mapCon = $(gb_map_consts.mapContainer); 25 var $mapCon = $(gb_map_consts.mapContainer);
25 $mapCon.html(mapLoadAnim); 26 $mapCon.html(mapLoadAnim);
26 //设置样式 27 //设置样式
@@ -28,21 +29,21 @@ var gb_map_gaode = (function() { @@ -28,21 +29,21 @@ var gb_map_gaode = (function() {
28 29
29 map = new AMap.Map($mapCon[0]); 30 map = new AMap.Map($mapCon[0]);
30 // 地图中心和缩放级别 31 // 地图中心和缩放级别
31 - map.setZoomAndCenter(14, [ gb_map_consts.center_point.lng, gb_map_consts.center_point.lat ]); 32 + map.setZoomAndCenter(13, [ gb_map_consts.center_point.lng, gb_map_consts.center_point.lat ]);
32 // 加载完成 33 // 加载完成
33 AMap.event.addListener(map, 'complete', function() { 34 AMap.event.addListener(map, 'complete', function() {
34 - layer.closeAll();  
35 - window.localStorage.setItem('real_map', 'gaode'); 35 + //window.localStorage.setItem('real_map', 'gaode');
36 /*storage.setItem('real_map', REAL_GAODE_TEXT); 36 /*storage.setItem('real_map', REAL_GAODE_TEXT);
37 $('.sk-cube-grid._center').remove();*/ 37 $('.sk-cube-grid._center').remove();*/
  38 + cb && cb();
38 }); 39 });
39 40
40 // 实时路况图层 41 // 实时路况图层
41 - var trafficLayer = new AMap.TileLayer.Traffic(); 42 + trafficLayer = new AMap.TileLayer.Traffic();
42 trafficLayer.setMap(map); 43 trafficLayer.setMap(map);
43 trafficLayer.hide(); 44 trafficLayer.hide();
44 45
45 - $(gb_map_consts.trafficBtn).on('click', function() { 46 + /*$(gb_map_consts.trafficBtn).on('click', function() {
46 if (traffVisible) { 47 if (traffVisible) {
47 trafficLayer.hide(); 48 trafficLayer.hide();
48 traffVisible = false; 49 traffVisible = false;
@@ -54,7 +55,7 @@ var gb_map_gaode = (function() { @@ -54,7 +55,7 @@ var gb_map_gaode = (function() {
54 $(this).addClass('active'); 55 $(this).addClass('active');
55 hideLinePolyline(); 56 hideLinePolyline();
56 } 57 }
57 - }); 58 + });*/
58 }, 59 },
59 setStyle : function() { 60 setStyle : function() {
60 $('.mapRightWrap').addClass('gaode'); 61 $('.mapRightWrap').addClass('gaode');
@@ -67,50 +68,93 @@ var gb_map_gaode = (function() { @@ -67,50 +68,93 @@ var gb_map_gaode = (function() {
67 $('.mapTools').removeClass('gaode'); 68 $('.mapTools').removeClass('gaode');
68 $('.leftUtils').removeClass('gaode'); 69 $('.leftUtils').removeClass('gaode');
69 }, 70 },
70 - clear: function(){ 71 + traffic: function (enable) {
  72 + if(enable)
  73 + trafficLayer.show();
  74 + else
  75 + trafficLayer.hide();
  76 + },
  77 + clearAll: function () {
  78 + realMarkers = {};
  79 + polylines={};
  80 + map.clearMap();
  81 + }
  82 + /*clear: function(){
71 realMarkers = {}; 83 realMarkers = {};
72 map.clearMap(); 84 map.clearMap();
73 linePolyline = []; 85 linePolyline = [];
74 - },  
75 - drawLine: function(opts){  
76 - linePolyline = []; 86 + }*/,
  87 + drawLine: function(opt){
  88 + //linePolyline = [];
  89 + var pos = [], temps;
  90 + var route = opt.upDown==0?opt.route.up_gcj:opt.route.down_gcj;
77 91
78 - map.clearMap(); 92 + $.each(route.split(','), function(){
  93 + temps = this.split(' ');
  94 + pos.push([temps[0], temps[1]]);
  95 + });
79 96
80 - var upArr = [], downArr = [];  
81 - var upLineOps = {path: upArr, strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5}  
82 - ,downLineOps = {path: downArr, strokeColor:"red", strokeWeight:6, strokeOpacity:0.5};  
83 - var route = opts.route;  
84 - //上行  
85 - if(route.up){  
86 - $.each(route.up_gcj.split(','), function(){  
87 - tempArray = this.split(' ');  
88 - upArr.push([tempArray[0], tempArray[1]]);  
89 - });  
90 - var upLine = new AMap.Polyline(upLineOps);  
91 - //保存线条引用  
92 - linePolyline.push(upLine);  
93 - upLine.setMap(map);  
94 - map.setCenter(upArr[parseInt(upArr.length / 2)]); 97 + opt.style.path=pos;
  98 + var polyline = new AMap.Polyline(opt.style);
  99 + //根据ID保存映射
  100 + polylines[opt.id]=polyline;
  101 + if(opt.hide)
  102 + polyline.hide();
95 103
  104 + polyline.setMap(map);
  105 +
  106 + map.setCenter(pos[parseInt(pos.length / 2)]);
  107 +
  108 + },
  109 + //根据id 显示polyline
  110 + refreshPolyline: function (opt) {
  111 + var idx = opt.idx;
  112 + for(var id in polylines){
  113 + if(idx.indexOf(id) != -1)
  114 + polylines[id].show();
  115 + else
  116 + polylines[id].hide();
96 } 117 }
97 - //下行  
98 - if(route.down){  
99 - $.each(route.down_gcj.split(','), function(){  
100 - tempArray = this.split(' ');  
101 - downArr.push([tempArray[0], tempArray[1]]);  
102 - });  
103 - var downLine = new AMap.Polyline(downLineOps);  
104 - //保存线条引用  
105 - linePolyline.push(downLine);  
106 - downLine.setMap(map);  
107 - }  
108 - //实时路况下不显示  
109 - if(traffVisible)  
110 - hideLinePolyline();  
111 }, 118 },
112 drawRealGpsMarker: function(opts){ 119 drawRealGpsMarker: function(opts){
113 - var gpsArray = opts.gpsList; 120 + gpsArray = opts.gpsList;
  121 + var coord;
  122 + $.each(gpsArray, function(i, gps){
  123 +
  124 + marker = realMarkers[gps.deviceId];
  125 + if(marker && gps.timestamp == marker.gpsData.timestamp)
  126 + return;
  127 + else{
  128 + //转换坐标
  129 + transCoord(gps);
  130 +
  131 + if(marker)
  132 + moveMarker(marker, gps);//移动marker
  133 + else {
  134 + //创建marker
  135 + marker = createGDMarkerByGps(gps);
  136 + realMarkers[gps.deviceId] = marker
  137 + }
  138 + }
  139 +
  140 + /*coord = TransGPS.transformFromWGSToGCJ(gps.lat, gps.lon);
  141 + gps.gcj_lat = coord.lat;
  142 + gps.gcj_lon = coord.lng;
  143 +
  144 + marker = realMarkers[gps.deviceId];
  145 + if(marker){
  146 + if(gps.timestamp == marker.gpsData.timestamp)
  147 + return;
  148 + else
  149 + moveMarker(marker, gps);//移动marker
  150 + }
  151 + else{
  152 + var marker = createGDMarkerByGps(gps);
  153 + realMarkers[gps.deviceId] = marker
  154 + }*/
  155 + });
  156 +
  157 + /*var gpsArray = opts.gpsList;
114 var coord; 158 var coord;
115 $.each(gpsArray, function(i, gps){ 159 $.each(gpsArray, function(i, gps){
116 if(opts.coordTransform){ 160 if(opts.coordTransform){
@@ -130,7 +174,16 @@ var gb_map_gaode = (function() { @@ -130,7 +174,16 @@ var gb_map_gaode = (function() {
130 var marker = createGDMarkerByGps(gps); 174 var marker = createGDMarkerByGps(gps);
131 realMarkers[gps.deviceId] = marker 175 realMarkers[gps.deviceId] = marker
132 } 176 }
133 - }); 177 + });*/
  178 + },
  179 + showGpsMarker: function (opt) {
  180 + var chs = opt.chs;
  181 + for(var device in realMarkers){
  182 + if(chs[device])
  183 + realMarkers[device].show();
  184 + else
  185 + realMarkers[device].hide();
  186 + }
134 }, 187 },
135 goToMarker: function(opts){ 188 goToMarker: function(opts){
136 var deviceId = opts.deviceId 189 var deviceId = opts.deviceId
@@ -147,6 +200,12 @@ var gb_map_gaode = (function() { @@ -147,6 +200,12 @@ var gb_map_gaode = (function() {
147 } 200 }
148 }; 201 };
149 202
  203 + function transCoord(gps) {
  204 + var coord = TransGPS.transformFromWGSToGCJ(gps.lat, gps.lon);
  205 + gps.gcj_lat = coord.lat;
  206 + gps.gcj_lon = coord.lng;
  207 + }
  208 +
150 function createGDMarkerByGps(gps){ 209 function createGDMarkerByGps(gps){
151 //根据编码长度 计算marker 宽度 210 //根据编码长度 计算marker 宽度
152 var w = gps.nbbm.length * 10; 211 var w = gps.nbbm.length * 10;
@@ -156,7 +215,7 @@ var gb_map_gaode = (function() { @@ -156,7 +215,7 @@ var gb_map_gaode = (function() {
156 position: [gps.gcj_lon, gps.gcj_lat], 215 position: [gps.gcj_lon, gps.gcj_lat],
157 icon: new AMap.Icon({ 216 icon: new AMap.Icon({
158 size: new AMap.Size(w, 25), //图标大小 217 size: new AMap.Size(w, 25), //图标大小
159 - image: iMap.createCarIcon(gps, w) 218 + image: gb_map_imap.createCarIcon(gps, w)
160 }), 219 }),
161 offset: new AMap.Pixel(-35, -12) 220 offset: new AMap.Pixel(-35, -12)
162 }); 221 });
@@ -184,14 +243,14 @@ var gb_map_gaode = (function() { @@ -184,14 +243,14 @@ var gb_map_gaode = (function() {
184 var w = gps.nbbm.length * 10; 243 var w = gps.nbbm.length * 10;
185 m.setIcon(new AMap.Icon({ 244 m.setIcon(new AMap.Icon({
186 size: new AMap.Size(w, 25), 245 size: new AMap.Size(w, 25),
187 - image: iMap.createCarIcon(gps, w) 246 + image: gb_map_imap.createCarIcon(gps, w)
188 })); 247 }));
189 248
190 if(m.infoWindow.getIsOpen()) 249 if(m.infoWindow.getIsOpen())
191 openWindow(m); 250 openWindow(m);
192 } 251 }
193 252
194 - //隐藏线路线条 253 +/* //隐藏线路线条
195 function hideLinePolyline(){ 254 function hideLinePolyline(){
196 if(!linePolyline || linePolyline.length == 0) 255 if(!linePolyline || linePolyline.length == 0)
197 return; 256 return;
@@ -199,9 +258,9 @@ var gb_map_gaode = (function() { @@ -199,9 +258,9 @@ var gb_map_gaode = (function() {
199 $.each(linePolyline, function(){ 258 $.each(linePolyline, function(){
200 this.setOptions({strokeOpacity: 0}); 259 this.setOptions({strokeOpacity: 0});
201 }); 260 });
202 - } 261 + }*/
203 262
204 - //显示线路线条 263 +/* //显示线路线条
205 function showLinePolyline(){ 264 function showLinePolyline(){
206 if(!linePolyline || linePolyline.length == 0) 265 if(!linePolyline || linePolyline.length == 0)
207 return; 266 return;
@@ -210,14 +269,16 @@ var gb_map_gaode = (function() { @@ -210,14 +269,16 @@ var gb_map_gaode = (function() {
210 $.each(linePolyline, function(){ 269 $.each(linePolyline, function(){
211 this.setOptions({strokeOpacity: 0.5}); 270 this.setOptions({strokeOpacity: 0.5});
212 }); 271 });
213 - } 272 + }*/
214 273
215 function openWindow(marker){ 274 function openWindow(marker){
216 - marker.gpsData.fromNow = moment(marker.gpsData.timestamp).fromNow();  
217 - /*var infoWindow = new AMap.InfoWindow({  
218 - content: template('gps_info_win_temp', marker.gpsData)  
219 - });*/  
220 - marker.infoWindow.setContent(template('gps_info_win_temp', marker.gpsData)); 275 + var gps = marker.gpsData;
  276 + //线路名
  277 + gps.lineName = gb_data_basic.lineCode2NameAll()[gps.lineId];
  278 + //时间
  279 + gps.dateStr = moment(gps.timestamp).format('YYYY-MM-DD HH:mm:ss');
  280 +//{size: AMap.Size(290,255)}
  281 + marker.infoWindow.setContent(gb_map_overlay_mge.map_gps_win_temp(gps));
221 marker.infoWindow.open(map, marker.getPosition()); 282 marker.infoWindow.open(map, marker.getPosition());
222 } 283 }
223 284
src/main/resources/static/real_control_v2/mapmonitor/js/map_overlay_manager.js
@@ -8,6 +8,9 @@ var gb_map_overlay_mge = (function () { @@ -8,6 +8,9 @@ var gb_map_overlay_mge = (function () {
8 }); 8 });
9 9
10 var gpsRefresh = function (addArr, upArr, upDownChange) { 10 var gpsRefresh = function (addArr, upArr, upDownChange) {
  11 + //如果地图正在重绘,暂时不刷新GPS
  12 + if(reDrawing)
  13 + return;
11 var all = addArr.concat(upArr).concat(upDownChange); 14 var all = addArr.concat(upArr).concat(upDownChange);
12 gpsRefreshAll(all); 15 gpsRefreshAll(all);
13 16
@@ -32,7 +35,7 @@ var gb_map_overlay_mge = (function () { @@ -32,7 +35,7 @@ var gb_map_overlay_mge = (function () {
32 //上行 35 //上行
33 gb_map_imap.call('drawLine', { 36 gb_map_imap.call('drawLine', {
34 route: route, 37 route: route,
35 - style: {strokeWeight:6, strokeColor: 'blue'}, 38 + style: {strokeWeight:6, strokeColor: gb_map_config.getConfig().section.color.up},
36 id: lineCode+'_0', 39 id: lineCode+'_0',
37 upDown: 0, 40 upDown: 0,
38 hide: true 41 hide: true
@@ -40,7 +43,7 @@ var gb_map_overlay_mge = (function () { @@ -40,7 +43,7 @@ var gb_map_overlay_mge = (function () {
40 //下行 43 //下行
41 gb_map_imap.call('drawLine', { 44 gb_map_imap.call('drawLine', {
42 route: route, 45 route: route,
43 - style: {strokeWeight:6, strokeColor: 'red'}, 46 + style: {strokeWeight:6, strokeColor: gb_map_config.getConfig().section.color.down},
44 id: lineCode+'_1', 47 id: lineCode+'_1',
45 upDown: 1, 48 upDown: 1,
46 hide: true 49 hide: true
@@ -59,7 +62,13 @@ var gb_map_overlay_mge = (function () { @@ -59,7 +62,13 @@ var gb_map_overlay_mge = (function () {
59 gb_map_imap.call('refreshPolyline', {idx: gb_common.get_keys(idx)}); 62 gb_map_imap.call('refreshPolyline', {idx: gb_common.get_keys(idx)});
60 }; 63 };
61 64
62 - var init = function () { 65 +
  66 + //是否正在重绘
  67 + var reDrawing;
  68 + var reDraw = function () {
  69 + reDrawing = true;
  70 +
  71 + gb_map_imap.call('clearAll');
63 72
64 drawAllSection(); 73 drawAllSection();
65 //初始绘制 74 //初始绘制
@@ -68,6 +77,12 @@ var gb_map_overlay_mge = (function () { @@ -68,6 +77,12 @@ var gb_map_overlay_mge = (function () {
68 showOverlayByChecks(); 77 showOverlayByChecks();
69 //显示路段 78 //显示路段
70 showSection(gb_map_gps_tree.getChecked().filter(deviceFilter)); 79 showSection(gb_map_gps_tree.getChecked().filter(deviceFilter));
  80 +
  81 + reDrawing = false;
  82 + }
  83 +
  84 + var init = function () {
  85 + reDraw();
71 //注册GPS刷新事件 86 //注册GPS刷新事件
72 gb_data_gps.registerCallback(gpsRefresh); 87 gb_data_gps.registerCallback(gpsRefresh);
73 }; 88 };
@@ -97,6 +112,7 @@ var gb_map_overlay_mge = (function () { @@ -97,6 +112,7 @@ var gb_map_overlay_mge = (function () {
97 _focus: _focus, 112 _focus: _focus,
98 map_gps_win_temp: function (data) { 113 map_gps_win_temp: function (data) {
99 return temps['map-win-gps-detail-temp'](data); 114 return temps['map-win-gps-detail-temp'](data);
100 - } 115 + },
  116 + reDraw: reDraw
101 }; 117 };
102 })(); 118 })();
103 \ No newline at end of file 119 \ No newline at end of file
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/map/platform/baidu.js
@@ -184,7 +184,7 @@ var gb_map_baidu = (function(){ @@ -184,7 +184,7 @@ var gb_map_baidu = (function(){
184 }; 184 };
185 185
186 var bd_gps_info_win_opts = { 186 var bd_gps_info_win_opts = {
187 - width : 190, 187 + width : 150,
188 height: 255, 188 height: 255,
189 enableMessage:true 189 enableMessage:true
190 }; 190 };