Commit 893a4fd8d0d0d42768e9ef15a8d618f949579d43

Authored by 娄高锋
2 parents b7c4a18a 03f3aa94

Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong

Showing 38 changed files with 2926 additions and 1796 deletions
src/main/java/com/bsth/data/gpsdata_v2/DataHandleProcess.java
... ... @@ -75,36 +75,13 @@ public class DataHandleProcess {
75 75  
76 76 List<Future> fRs = new ArrayList<>(ks.size());
77 77 for (Integer index : ks) {
78   - fRs.add(threadPool.submit(new SignalHandleThread(dataListMap.get(index), count)));
  78 + threadPool.submit(new SignalHandleThread(dataListMap.get(index), count));
79 79 }
80 80  
81   - //按线路分组gps
82   - /*ArrayListMultimap multimap = ArrayListMultimap.create();
83   - for (GpsEntity gps : list) {
84   - multimap.put(gps.getLineId(), gps);
85   - }
86   -
87   - Set<String> ks = multimap.keySet();
88   -
89   - logger.info("analyse gps size: " + list.size() + ", ks: " + ks.size());
90   - count = new CountDownLatch(ks.size());
91   -
92   - for (String lineCode : ks) {
93   - threadPool.execute(new SignalHandleThread(multimap.get(lineCode), count));
94   - }*/
95 81  
96 82 //等待子线程结束
97 83 count.await();
98 84  
99   - for (Future f : fRs) {
100   - try {
101   - f.get();
102   - } catch (InterruptedException e) {
103   - } catch (ExecutionException e) {
104   - logger.error(e.getCause().getMessage());
105   - }
106   - }
107   -
108 85 //加入实时gps对照
109 86 for (GpsEntity gps : list)
110 87 gpsRealData.put(gps);
... ...
src/main/java/com/bsth/data/line_version/EnableRouteVersionHandler.java
1   -package com.bsth.data.line_version;
2   -
3   -import com.bsth.data.line_version.dto.EvSectionRoute;
4   -import com.bsth.data.line_version.dto.EvStationRoute;
5   -import org.slf4j.Logger;
6   -import org.slf4j.LoggerFactory;
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.jdbc.core.BeanPropertyRowMapper;
9   -import org.springframework.jdbc.core.JdbcTemplate;
10   -import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
11   -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
12   -import org.springframework.jdbc.datasource.DataSourceTransactionManager;
13   -import org.springframework.stereotype.Component;
14   -import org.springframework.transaction.TransactionDefinition;
15   -import org.springframework.transaction.TransactionStatus;
16   -import org.springframework.transaction.support.DefaultTransactionDefinition;
17   -
18   -import java.util.ArrayList;
19   -import java.util.List;
20   -
21   -/**
22   - * 启用线路路由版本
23   - * Created by panzhao on 2017/12/28.
24   - */
25   -@Component
26   -public class EnableRouteVersionHandler {
27   -
28   - @Autowired
29   - JdbcTemplate jdbcTemplate;
30   -
31   - @Autowired
32   - NamedParameterJdbcTemplate namedParameterJdbcTemplate;
33   -
34   - Logger logger = LoggerFactory.getLogger(this.getClass());
35   -
36   - public void enable(String lineCode, int version){
37   - //编程式事务
38   - DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource());
39   - DefaultTransactionDefinition def = new DefaultTransactionDefinition();
40   - def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
41   - TransactionStatus status = tran.getTransaction(def);
42   -
43   -
44   - try{
45   - enableStation(lineCode, version);
46   - enableRoad(lineCode, version);
47   -
48   - //将当前版本变为历史版本
49   - String sql = "update bsth_c_line_versions set status=0, end_date=SYSDATE(),update_date=SYSDATE() where line_code=" + lineCode + " and status=1";
50   - jdbcTemplate.update(sql);
51   - //将待更新版本变为启用版本
52   - sql = "update bsth_c_line_versions set status=1,update_date=SYSDATE() where line_code=" + lineCode + " and versions="+version;
53   - jdbcTemplate.update(sql);
54   -
55   - tran.commit(status);
56   - }catch (Exception e){
57   - tran.rollback(status);
58   - logger.error("", e);
59   - }
60   - }
61   -
62   - /**
63   - * 启用新版本站点
64   - * @param lineCode
65   - * @param version
66   - */
67   - public void enableStation(String lineCode, int version){
68   - //删除当前站点路由表数据
69   - String sql = "delete from bsth_c_stationroute where line_code=" + lineCode;
70   - jdbcTemplate.update(sql);
71   -
72   - //将新版本数据插入当前表
73   - sql = "select * from bsth_c_ls_stationroute where line_code=" + lineCode + " and versions=" + version;
74   - List<EvStationRoute> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(EvStationRoute.class));
75   -
76   - List<BeanPropertySqlParameterSource> sourceList = new ArrayList<>();
77   - for(EvStationRoute s : list){
78   - sourceList.add(new BeanPropertySqlParameterSource(s));
79   - }
80   -
81   - sql = "insert into bsth_c_stationroute(id,line,station,station_name,station_route_code,line_code,station_code,station_mark,out_station_nmber,directions,distances,to_time,first_time,end_time,descriptions,destroy,versions,create_date,update_date) " +
82   - " values(:id,:line,:station,:stationName,:stationRouteCode,:lineCode,:stationCode,:stationMark,:outStationNmber,:directions,:distances,:toTime,:firstTime,:endTime,:descriptions,:destroy,:versions,SYSDATE(),SYSDATE())";
83   - BeanPropertySqlParameterSource[] beanSources = sourceList.toArray(new BeanPropertySqlParameterSource[sourceList.size()]);
84   - namedParameterJdbcTemplate.batchUpdate(sql, beanSources);
85   - }
86   -
87   - /**
88   - * 启用新版本路段
89   - * @param lineCode
90   - * @param version
91   - */
92   - public void enableRoad(String lineCode, int version){
93   - //删除当前路段路由表数据
94   - String sql = "delete from bsth_c_sectionroute where line_code=" + lineCode;
95   - jdbcTemplate.update(sql);
96   -
97   - //将新版本数据插入当前表
98   - sql = "select * from bsth_c_ls_sectionroute where line_code=" + lineCode + " and versions=" + version;
99   - List<EvSectionRoute> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(EvSectionRoute.class));
100   -
101   - List<BeanPropertySqlParameterSource> sourceList = new ArrayList<>();
102   - for(EvSectionRoute s : list){
103   - sourceList.add(new BeanPropertySqlParameterSource(s));
104   - }
105   -
106   - sql = "insert into bsth_c_sectionroute(id,line_code,section_code,sectionroute_code,directions,line,section,descriptions,create_by,create_date,update_by,update_date,versions,destroy,is_roade_speed) " +
107   - " values(:id,:lineCode,:sectionCode,:sectionrouteCode,:directions,:line,:section,:descriptions,:createBy,SYSDATE(),:updateBy,SYSDATE(),:versions,:destroy,:isRoadeSpeed)";
108   - BeanPropertySqlParameterSource[] beanSources = sourceList.toArray(new BeanPropertySqlParameterSource[sourceList.size()]);
109   - namedParameterJdbcTemplate.batchUpdate(sql, beanSources);
110   - }
111   -}
  1 +package com.bsth.data.line_version;
  2 +
  3 +import com.bsth.data.line_version.dto.EvSectionRoute;
  4 +import com.bsth.data.line_version.dto.EvStationRoute;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  9 +import org.springframework.jdbc.core.JdbcTemplate;
  10 +import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
  11 +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
  12 +import org.springframework.jdbc.datasource.DataSourceTransactionManager;
  13 +import org.springframework.stereotype.Component;
  14 +import org.springframework.transaction.TransactionDefinition;
  15 +import org.springframework.transaction.TransactionStatus;
  16 +import org.springframework.transaction.support.DefaultTransactionDefinition;
  17 +
  18 +import java.util.ArrayList;
  19 +import java.util.List;
  20 +
  21 +/**
  22 + * 启用线路路由版本
  23 + * Created by panzhao on 2017/12/28.
  24 + */
  25 +@Component
  26 +public class EnableRouteVersionHandler {
  27 +
  28 + @Autowired
  29 + JdbcTemplate jdbcTemplate;
  30 +
  31 + @Autowired
  32 + NamedParameterJdbcTemplate namedParameterJdbcTemplate;
  33 +
  34 + Logger logger = LoggerFactory.getLogger(this.getClass());
  35 +
  36 + public void enable(String lineCode, int version){
  37 + //编程式事务
  38 + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource());
  39 + DefaultTransactionDefinition def = new DefaultTransactionDefinition();
  40 + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
  41 + TransactionStatus status = tran.getTransaction(def);
  42 +
  43 +
  44 + try{
  45 + enableStation(lineCode, version);
  46 + enableRoad(lineCode, version);
  47 +
  48 + //将当前版本变为历史版本
  49 + String sql = "update bsth_c_line_versions set status=0, end_date=SYSDATE(),update_date=SYSDATE() where line_code=" + lineCode + " and status=1";
  50 + jdbcTemplate.update(sql);
  51 + //将待更新版本变为启用版本
  52 + sql = "update bsth_c_line_versions set status=1,update_date=SYSDATE() where line_code=" + lineCode + " and versions="+version;
  53 + jdbcTemplate.update(sql);
  54 +
  55 + tran.commit(status);
  56 + }catch (Exception e){
  57 + tran.rollback(status);
  58 + logger.error("", e);
  59 + }
  60 + }
  61 +
  62 + /**
  63 + * 启用新版本站点
  64 + * @param lineCode
  65 + * @param version
  66 + */
  67 + public void enableStation(String lineCode, int version){
  68 + //删除当前站点路由表数据
  69 + String sql = "delete from bsth_c_stationroute where line_code=" + lineCode;
  70 + jdbcTemplate.update(sql);
  71 +
  72 + //将新版本数据插入当前表
  73 + sql = "select * from bsth_c_ls_stationroute where line_code=" + lineCode + " and versions=" + version;
  74 + List<EvStationRoute> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(EvStationRoute.class));
  75 +
  76 + List<BeanPropertySqlParameterSource> sourceList = new ArrayList<>();
  77 + for(EvStationRoute s : list){
  78 + sourceList.add(new BeanPropertySqlParameterSource(s));
  79 + }
  80 +
  81 + sql = "insert into bsth_c_stationroute(id,line,station,station_name,station_route_code,line_code,station_code,station_mark,out_station_nmber,directions,distances,to_time,first_time,end_time,descriptions,destroy,versions,create_date,update_date) " +
  82 + " values(:id,:line,:station,:stationName,:stationRouteCode,:lineCode,:stationCode,:stationMark,:outStationNmber,:directions,:distances,:toTime,:firstTime,:endTime,:descriptions,:destroy,:versions,SYSDATE(),SYSDATE())";
  83 + BeanPropertySqlParameterSource[] beanSources = sourceList.toArray(new BeanPropertySqlParameterSource[sourceList.size()]);
  84 + namedParameterJdbcTemplate.batchUpdate(sql, beanSources);
  85 + }
  86 +
  87 + /**
  88 + * 启用新版本路段
  89 + * @param lineCode
  90 + * @param version
  91 + */
  92 + public void enableRoad(String lineCode, int version){
  93 + //删除当前路段路由表数据
  94 + String sql = "delete from bsth_c_sectionroute where line_code=" + lineCode;
  95 + jdbcTemplate.update(sql);
  96 +
  97 + //将新版本数据插入当前表
  98 + sql = "select * from bsth_c_ls_sectionroute where line_code=" + lineCode + " and versions=" + version;
  99 + List<EvSectionRoute> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(EvSectionRoute.class));
  100 +
  101 + List<BeanPropertySqlParameterSource> sourceList = new ArrayList<>();
  102 + for(EvSectionRoute s : list){
  103 + sourceList.add(new BeanPropertySqlParameterSource(s));
  104 + }
  105 +
  106 + sql = "insert into bsth_c_sectionroute(id,line_code,section_code,sectionroute_code,directions,line,section,descriptions,create_by,create_date,update_by,update_date,versions,destroy,is_roade_speed) " +
  107 + " values(:id,:lineCode,:sectionCode,:sectionrouteCode,:directions,:line,:section,:descriptions,:createBy,SYSDATE(),:updateBy,SYSDATE(),:versions,:destroy,:isRoadeSpeed)";
  108 + BeanPropertySqlParameterSource[] beanSources = sourceList.toArray(new BeanPropertySqlParameterSource[sourceList.size()]);
  109 + namedParameterJdbcTemplate.batchUpdate(sql, beanSources);
  110 + }
  111 +}
... ...
src/main/java/com/bsth/data/line_version/dto/EvSectionRoute.java
1   -package com.bsth.data.line_version.dto;
2   -
3   -import java.util.Date;
4   -
5   -/**
6   - * Created by panzhao on 2017/12/28.
7   - */
8   -public class EvSectionRoute {
9   -
10   -
11   - private Integer id;
12   -
13   - // 路段路由序号
14   - private Integer sectionrouteCode;
15   -
16   - // 线路编号
17   - private String lineCode;
18   -
19   - // 路段编号
20   - private String sectionCode;
21   -
22   - // 路段路由方向
23   - private Integer directions;
24   -
25   - // 版本号
26   - private Integer versions;
27   -
28   - // 是否撤销
29   - private Integer destroy;
30   -
31   - /** 是否有路段限速数据 <0:分段;1:未分段>*/
32   - private Integer isRoadeSpeed;
33   -
34   - // 描述
35   - private String descriptions;
36   -
37   - // 创建人
38   - private Integer createBy;
39   -
40   - // 修改人
41   - private Integer updateBy;
42   -
43   - // 创建日期
44   - private Date createDate;
45   -
46   - // 修改日期
47   - private Date updateDate;
48   -
49   - // 路段信息
50   - private Integer section;
51   -
52   - // 线路信息
53   - private Integer line;
54   -
55   - public Integer getId() {
56   - return id;
57   - }
58   -
59   - public void setId(Integer id) {
60   - this.id = id;
61   - }
62   -
63   - public Integer getSectionrouteCode() {
64   - return sectionrouteCode;
65   - }
66   -
67   - public void setSectionrouteCode(Integer sectionrouteCode) {
68   - this.sectionrouteCode = sectionrouteCode;
69   - }
70   -
71   - public String getLineCode() {
72   - return lineCode;
73   - }
74   -
75   - public void setLineCode(String lineCode) {
76   - this.lineCode = lineCode;
77   - }
78   -
79   - public String getSectionCode() {
80   - return sectionCode;
81   - }
82   -
83   - public void setSectionCode(String sectionCode) {
84   - this.sectionCode = sectionCode;
85   - }
86   -
87   - public Integer getDirections() {
88   - return directions;
89   - }
90   -
91   - public void setDirections(Integer directions) {
92   - this.directions = directions;
93   - }
94   -
95   - public Integer getVersions() {
96   - return versions;
97   - }
98   -
99   - public void setVersions(Integer versions) {
100   - this.versions = versions;
101   - }
102   -
103   - public Integer getDestroy() {
104   - return destroy;
105   - }
106   -
107   - public void setDestroy(Integer destroy) {
108   - this.destroy = destroy;
109   - }
110   -
111   - public Integer getIsRoadeSpeed() {
112   - return isRoadeSpeed;
113   - }
114   -
115   - public void setIsRoadeSpeed(Integer isRoadeSpeed) {
116   - this.isRoadeSpeed = isRoadeSpeed;
117   - }
118   -
119   - public String getDescriptions() {
120   - return descriptions;
121   - }
122   -
123   - public void setDescriptions(String descriptions) {
124   - this.descriptions = descriptions;
125   - }
126   -
127   - public Integer getCreateBy() {
128   - return createBy;
129   - }
130   -
131   - public void setCreateBy(Integer createBy) {
132   - this.createBy = createBy;
133   - }
134   -
135   - public Integer getUpdateBy() {
136   - return updateBy;
137   - }
138   -
139   - public void setUpdateBy(Integer updateBy) {
140   - this.updateBy = updateBy;
141   - }
142   -
143   - public Date getCreateDate() {
144   - return createDate;
145   - }
146   -
147   - public void setCreateDate(Date createDate) {
148   - this.createDate = createDate;
149   - }
150   -
151   - public Date getUpdateDate() {
152   - return updateDate;
153   - }
154   -
155   - public void setUpdateDate(Date updateDate) {
156   - this.updateDate = updateDate;
157   - }
158   -
159   - public Integer getSection() {
160   - return section;
161   - }
162   -
163   - public void setSection(Integer section) {
164   - this.section = section;
165   - }
166   -
167   - public Integer getLine() {
168   - return line;
169   - }
170   -
171   - public void setLine(Integer line) {
172   - this.line = line;
173   - }
174   -}
  1 +package com.bsth.data.line_version.dto;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/12/28.
  7 + */
  8 +public class EvSectionRoute {
  9 +
  10 +
  11 + private Integer id;
  12 +
  13 + // 路段路由序号
  14 + private Integer sectionrouteCode;
  15 +
  16 + // 线路编号
  17 + private String lineCode;
  18 +
  19 + // 路段编号
  20 + private String sectionCode;
  21 +
  22 + // 路段路由方向
  23 + private Integer directions;
  24 +
  25 + // 版本号
  26 + private Integer versions;
  27 +
  28 + // 是否撤销
  29 + private Integer destroy;
  30 +
  31 + /** 是否有路段限速数据 <0:分段;1:未分段>*/
  32 + private Integer isRoadeSpeed;
  33 +
  34 + // 描述
  35 + private String descriptions;
  36 +
  37 + // 创建人
  38 + private Integer createBy;
  39 +
  40 + // 修改人
  41 + private Integer updateBy;
  42 +
  43 + // 创建日期
  44 + private Date createDate;
  45 +
  46 + // 修改日期
  47 + private Date updateDate;
  48 +
  49 + // 路段信息
  50 + private Integer section;
  51 +
  52 + // 线路信息
  53 + private Integer line;
  54 +
  55 + public Integer getId() {
  56 + return id;
  57 + }
  58 +
  59 + public void setId(Integer id) {
  60 + this.id = id;
  61 + }
  62 +
  63 + public Integer getSectionrouteCode() {
  64 + return sectionrouteCode;
  65 + }
  66 +
  67 + public void setSectionrouteCode(Integer sectionrouteCode) {
  68 + this.sectionrouteCode = sectionrouteCode;
  69 + }
  70 +
  71 + public String getLineCode() {
  72 + return lineCode;
  73 + }
  74 +
  75 + public void setLineCode(String lineCode) {
  76 + this.lineCode = lineCode;
  77 + }
  78 +
  79 + public String getSectionCode() {
  80 + return sectionCode;
  81 + }
  82 +
  83 + public void setSectionCode(String sectionCode) {
  84 + this.sectionCode = sectionCode;
  85 + }
  86 +
  87 + public Integer getDirections() {
  88 + return directions;
  89 + }
  90 +
  91 + public void setDirections(Integer directions) {
  92 + this.directions = directions;
  93 + }
  94 +
  95 + public Integer getVersions() {
  96 + return versions;
  97 + }
  98 +
  99 + public void setVersions(Integer versions) {
  100 + this.versions = versions;
  101 + }
  102 +
  103 + public Integer getDestroy() {
  104 + return destroy;
  105 + }
  106 +
  107 + public void setDestroy(Integer destroy) {
  108 + this.destroy = destroy;
  109 + }
  110 +
  111 + public Integer getIsRoadeSpeed() {
  112 + return isRoadeSpeed;
  113 + }
  114 +
  115 + public void setIsRoadeSpeed(Integer isRoadeSpeed) {
  116 + this.isRoadeSpeed = isRoadeSpeed;
  117 + }
  118 +
  119 + public String getDescriptions() {
  120 + return descriptions;
  121 + }
  122 +
  123 + public void setDescriptions(String descriptions) {
  124 + this.descriptions = descriptions;
  125 + }
  126 +
  127 + public Integer getCreateBy() {
  128 + return createBy;
  129 + }
  130 +
  131 + public void setCreateBy(Integer createBy) {
  132 + this.createBy = createBy;
  133 + }
  134 +
  135 + public Integer getUpdateBy() {
  136 + return updateBy;
  137 + }
  138 +
  139 + public void setUpdateBy(Integer updateBy) {
  140 + this.updateBy = updateBy;
  141 + }
  142 +
  143 + public Date getCreateDate() {
  144 + return createDate;
  145 + }
  146 +
  147 + public void setCreateDate(Date createDate) {
  148 + this.createDate = createDate;
  149 + }
  150 +
  151 + public Date getUpdateDate() {
  152 + return updateDate;
  153 + }
  154 +
  155 + public void setUpdateDate(Date updateDate) {
  156 + this.updateDate = updateDate;
  157 + }
  158 +
  159 + public Integer getSection() {
  160 + return section;
  161 + }
  162 +
  163 + public void setSection(Integer section) {
  164 + this.section = section;
  165 + }
  166 +
  167 + public Integer getLine() {
  168 + return line;
  169 + }
  170 +
  171 + public void setLine(Integer line) {
  172 + this.line = line;
  173 + }
  174 +}
... ...
src/main/java/com/bsth/data/line_version/dto/EvStationRoute.java
1   -package com.bsth.data.line_version.dto;
2   -
3   -import java.util.Date;
4   -
5   -/**
6   - * Created by panzhao on 2017/12/28.
7   - */
8   -public class EvStationRoute {
9   - private Integer id;
10   -
11   - // 站点路由序号
12   - private Integer stationRouteCode;
13   -
14   - // 站点编码
15   - private String stationCode;
16   -
17   - // 站点名称
18   - private String stationName;
19   -
20   - // 线路编码
21   - private String lineCode;
22   -
23   - /**
24   - * 站点类型
25   - *
26   - * ------ B:起点站
27   - *
28   - * ------ Z:中途站
29   - *
30   - * ------ E:终点站
31   - *
32   - * ------ T:停车场
33   - *
34   - */
35   - private String stationMark;
36   -
37   - // 站点路由出站序号
38   - private Integer outStationNmber;
39   -
40   - // 站点路由到站距离
41   - private Double distances;
42   -
43   - // 站点路由到站时间
44   - private Double toTime;
45   -
46   - // 首班时间
47   - private String firstTime;
48   -
49   - // 末班时间
50   - private String endTime;
51   -
52   - // 站点路由方向
53   - private Integer directions;
54   -
55   - // 版本号
56   - private Integer versions;
57   -
58   - // 是否撤销
59   - private Integer destroy;
60   -
61   - // 描述
62   - private String descriptions;
63   -
64   - // 创建人
65   - private Integer createBy;
66   -
67   - // 修改人
68   - private Integer updateBy;
69   -
70   - // 创建日期
71   - private Date createDate;
72   -
73   - // 修改日期
74   - private Date updateDate;
75   -
76   - // 站点信息
77   - private Integer station;
78   -
79   - // 线路信息
80   - private Integer line;
81   -
82   - public Integer getId() {
83   - return id;
84   - }
85   -
86   - public void setId(Integer id) {
87   - this.id = id;
88   - }
89   -
90   - public Integer getStationRouteCode() {
91   - return stationRouteCode;
92   - }
93   -
94   - public void setStationRouteCode(Integer stationRouteCode) {
95   - this.stationRouteCode = stationRouteCode;
96   - }
97   -
98   - public String getStationCode() {
99   - return stationCode;
100   - }
101   -
102   - public void setStationCode(String stationCode) {
103   - this.stationCode = stationCode;
104   - }
105   -
106   - public String getStationName() {
107   - return stationName;
108   - }
109   -
110   - public void setStationName(String stationName) {
111   - this.stationName = stationName;
112   - }
113   -
114   - public String getLineCode() {
115   - return lineCode;
116   - }
117   -
118   - public void setLineCode(String lineCode) {
119   - this.lineCode = lineCode;
120   - }
121   -
122   - public String getStationMark() {
123   - return stationMark;
124   - }
125   -
126   - public void setStationMark(String stationMark) {
127   - this.stationMark = stationMark;
128   - }
129   -
130   - public Integer getOutStationNmber() {
131   - return outStationNmber;
132   - }
133   -
134   - public void setOutStationNmber(Integer outStationNmber) {
135   - this.outStationNmber = outStationNmber;
136   - }
137   -
138   - public Double getDistances() {
139   - return distances;
140   - }
141   -
142   - public void setDistances(Double distances) {
143   - this.distances = distances;
144   - }
145   -
146   - public Double getToTime() {
147   - return toTime;
148   - }
149   -
150   - public void setToTime(Double toTime) {
151   - this.toTime = toTime;
152   - }
153   -
154   - public String getFirstTime() {
155   - return firstTime;
156   - }
157   -
158   - public void setFirstTime(String firstTime) {
159   - this.firstTime = firstTime;
160   - }
161   -
162   - public String getEndTime() {
163   - return endTime;
164   - }
165   -
166   - public void setEndTime(String endTime) {
167   - this.endTime = endTime;
168   - }
169   -
170   - public Integer getDirections() {
171   - return directions;
172   - }
173   -
174   - public void setDirections(Integer directions) {
175   - this.directions = directions;
176   - }
177   -
178   - public Integer getVersions() {
179   - return versions;
180   - }
181   -
182   - public void setVersions(Integer versions) {
183   - this.versions = versions;
184   - }
185   -
186   - public Integer getDestroy() {
187   - return destroy;
188   - }
189   -
190   - public void setDestroy(Integer destroy) {
191   - this.destroy = destroy;
192   - }
193   -
194   - public String getDescriptions() {
195   - return descriptions;
196   - }
197   -
198   - public void setDescriptions(String descriptions) {
199   - this.descriptions = descriptions;
200   - }
201   -
202   - public Integer getCreateBy() {
203   - return createBy;
204   - }
205   -
206   - public void setCreateBy(Integer createBy) {
207   - this.createBy = createBy;
208   - }
209   -
210   - public Integer getUpdateBy() {
211   - return updateBy;
212   - }
213   -
214   - public void setUpdateBy(Integer updateBy) {
215   - this.updateBy = updateBy;
216   - }
217   -
218   - public Date getCreateDate() {
219   - return createDate;
220   - }
221   -
222   - public void setCreateDate(Date createDate) {
223   - this.createDate = createDate;
224   - }
225   -
226   - public Date getUpdateDate() {
227   - return updateDate;
228   - }
229   -
230   - public void setUpdateDate(Date updateDate) {
231   - this.updateDate = updateDate;
232   - }
233   -
234   - public Integer getStation() {
235   - return station;
236   - }
237   -
238   - public void setStation(Integer station) {
239   - this.station = station;
240   - }
241   -
242   - public Integer getLine() {
243   - return line;
244   - }
245   -
246   - public void setLine(Integer line) {
247   - this.line = line;
248   - }
249   -}
  1 +package com.bsth.data.line_version.dto;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/12/28.
  7 + */
  8 +public class EvStationRoute {
  9 + private Integer id;
  10 +
  11 + // 站点路由序号
  12 + private Integer stationRouteCode;
  13 +
  14 + // 站点编码
  15 + private String stationCode;
  16 +
  17 + // 站点名称
  18 + private String stationName;
  19 +
  20 + // 线路编码
  21 + private String lineCode;
  22 +
  23 + /**
  24 + * 站点类型
  25 + *
  26 + * ------ B:起点站
  27 + *
  28 + * ------ Z:中途站
  29 + *
  30 + * ------ E:终点站
  31 + *
  32 + * ------ T:停车场
  33 + *
  34 + */
  35 + private String stationMark;
  36 +
  37 + // 站点路由出站序号
  38 + private Integer outStationNmber;
  39 +
  40 + // 站点路由到站距离
  41 + private Double distances;
  42 +
  43 + // 站点路由到站时间
  44 + private Double toTime;
  45 +
  46 + // 首班时间
  47 + private String firstTime;
  48 +
  49 + // 末班时间
  50 + private String endTime;
  51 +
  52 + // 站点路由方向
  53 + private Integer directions;
  54 +
  55 + // 版本号
  56 + private Integer versions;
  57 +
  58 + // 是否撤销
  59 + private Integer destroy;
  60 +
  61 + // 描述
  62 + private String descriptions;
  63 +
  64 + // 创建人
  65 + private Integer createBy;
  66 +
  67 + // 修改人
  68 + private Integer updateBy;
  69 +
  70 + // 创建日期
  71 + private Date createDate;
  72 +
  73 + // 修改日期
  74 + private Date updateDate;
  75 +
  76 + // 站点信息
  77 + private Integer station;
  78 +
  79 + // 线路信息
  80 + private Integer line;
  81 +
  82 + public Integer getId() {
  83 + return id;
  84 + }
  85 +
  86 + public void setId(Integer id) {
  87 + this.id = id;
  88 + }
  89 +
  90 + public Integer getStationRouteCode() {
  91 + return stationRouteCode;
  92 + }
  93 +
  94 + public void setStationRouteCode(Integer stationRouteCode) {
  95 + this.stationRouteCode = stationRouteCode;
  96 + }
  97 +
  98 + public String getStationCode() {
  99 + return stationCode;
  100 + }
  101 +
  102 + public void setStationCode(String stationCode) {
  103 + this.stationCode = stationCode;
  104 + }
  105 +
  106 + public String getStationName() {
  107 + return stationName;
  108 + }
  109 +
  110 + public void setStationName(String stationName) {
  111 + this.stationName = stationName;
  112 + }
  113 +
  114 + public String getLineCode() {
  115 + return lineCode;
  116 + }
  117 +
  118 + public void setLineCode(String lineCode) {
  119 + this.lineCode = lineCode;
  120 + }
  121 +
  122 + public String getStationMark() {
  123 + return stationMark;
  124 + }
  125 +
  126 + public void setStationMark(String stationMark) {
  127 + this.stationMark = stationMark;
  128 + }
  129 +
  130 + public Integer getOutStationNmber() {
  131 + return outStationNmber;
  132 + }
  133 +
  134 + public void setOutStationNmber(Integer outStationNmber) {
  135 + this.outStationNmber = outStationNmber;
  136 + }
  137 +
  138 + public Double getDistances() {
  139 + return distances;
  140 + }
  141 +
  142 + public void setDistances(Double distances) {
  143 + this.distances = distances;
  144 + }
  145 +
  146 + public Double getToTime() {
  147 + return toTime;
  148 + }
  149 +
  150 + public void setToTime(Double toTime) {
  151 + this.toTime = toTime;
  152 + }
  153 +
  154 + public String getFirstTime() {
  155 + return firstTime;
  156 + }
  157 +
  158 + public void setFirstTime(String firstTime) {
  159 + this.firstTime = firstTime;
  160 + }
  161 +
  162 + public String getEndTime() {
  163 + return endTime;
  164 + }
  165 +
  166 + public void setEndTime(String endTime) {
  167 + this.endTime = endTime;
  168 + }
  169 +
  170 + public Integer getDirections() {
  171 + return directions;
  172 + }
  173 +
  174 + public void setDirections(Integer directions) {
  175 + this.directions = directions;
  176 + }
  177 +
  178 + public Integer getVersions() {
  179 + return versions;
  180 + }
  181 +
  182 + public void setVersions(Integer versions) {
  183 + this.versions = versions;
  184 + }
  185 +
  186 + public Integer getDestroy() {
  187 + return destroy;
  188 + }
  189 +
  190 + public void setDestroy(Integer destroy) {
  191 + this.destroy = destroy;
  192 + }
  193 +
  194 + public String getDescriptions() {
  195 + return descriptions;
  196 + }
  197 +
  198 + public void setDescriptions(String descriptions) {
  199 + this.descriptions = descriptions;
  200 + }
  201 +
  202 + public Integer getCreateBy() {
  203 + return createBy;
  204 + }
  205 +
  206 + public void setCreateBy(Integer createBy) {
  207 + this.createBy = createBy;
  208 + }
  209 +
  210 + public Integer getUpdateBy() {
  211 + return updateBy;
  212 + }
  213 +
  214 + public void setUpdateBy(Integer updateBy) {
  215 + this.updateBy = updateBy;
  216 + }
  217 +
  218 + public Date getCreateDate() {
  219 + return createDate;
  220 + }
  221 +
  222 + public void setCreateDate(Date createDate) {
  223 + this.createDate = createDate;
  224 + }
  225 +
  226 + public Date getUpdateDate() {
  227 + return updateDate;
  228 + }
  229 +
  230 + public void setUpdateDate(Date updateDate) {
  231 + this.updateDate = updateDate;
  232 + }
  233 +
  234 + public Integer getStation() {
  235 + return station;
  236 + }
  237 +
  238 + public void setStation(Integer station) {
  239 + this.station = station;
  240 + }
  241 +
  242 + public Integer getLine() {
  243 + return line;
  244 + }
  245 +
  246 + public void setLine(Integer line) {
  247 + this.line = line;
  248 + }
  249 +}
... ...
src/main/java/com/bsth/data/line_version/thread/FixedEnableVerionsThread.java
1   -package com.bsth.data.line_version.thread;
2   -
3   -import com.bsth.data.line_version.EnableRouteVersionHandler;
4   -import org.slf4j.Logger;
5   -import org.slf4j.LoggerFactory;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.jdbc.core.JdbcTemplate;
8   -import org.springframework.stereotype.Component;
9   -
10   -import java.util.List;
11   -import java.util.Map;
12   -
13   -/**
14   - * Created by panzhao on 2017/12/28.
15   - */
16   -@Component
17   -public class FixedEnableVerionsThread extends Thread{
18   -
19   - @Autowired
20   - JdbcTemplate jdbcTemplate;
21   -
22   - Logger logger = LoggerFactory.getLogger(this.getClass());
23   -
24   - @Autowired
25   - EnableRouteVersionHandler enableRouteVersionHandler;
26   -
27   - @Override
28   - public void run() {
29   - try{
30   -
31   - String sql = "select * from bsth_c_line_versions where status=2 and start_date<=SYSDATE()";
32   -
33   - List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
34   - if(list.size() == 0)
35   - return;
36   -
37   - String lineCode;
38   - int version;
39   -
40   - for(Map<String, Object> map : list){
41   - lineCode = map.get("line_code").toString();
42   - version = Integer.parseInt(map.get("versions").toString());
43   -
44   - enableRouteVersionHandler.enable(lineCode, version);
45   - }
46   - }catch (Exception e){
47   - logger.error("", e);
48   - }
49   - }
50   -}
  1 +package com.bsth.data.line_version.thread;
  2 +
  3 +import com.bsth.data.line_version.EnableRouteVersionHandler;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.jdbc.core.JdbcTemplate;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by panzhao on 2017/12/28.
  15 + */
  16 +@Component
  17 +public class FixedEnableVerionsThread extends Thread{
  18 +
  19 + @Autowired
  20 + JdbcTemplate jdbcTemplate;
  21 +
  22 + Logger logger = LoggerFactory.getLogger(this.getClass());
  23 +
  24 + @Autowired
  25 + EnableRouteVersionHandler enableRouteVersionHandler;
  26 +
  27 + @Override
  28 + public void run() {
  29 + try{
  30 +
  31 + String sql = "select * from bsth_c_line_versions where status=2 and start_date<=SYSDATE()";
  32 +
  33 + List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
  34 + if(list.size() == 0)
  35 + return;
  36 +
  37 + String lineCode;
  38 + int version;
  39 +
  40 + for(Map<String, Object> map : list){
  41 + lineCode = map.get("line_code").toString();
  42 + version = Integer.parseInt(map.get("versions").toString());
  43 +
  44 + enableRouteVersionHandler.enable(lineCode, version);
  45 + }
  46 + }catch (Exception e){
  47 + logger.error("", e);
  48 + }
  49 + }
  50 +}
... ...
src/main/java/com/bsth/email/MailAuthenticator.java 0 → 100644
  1 +package com.bsth.email;
  2 +
  3 +import javax.mail.Authenticator;
  4 +import javax.mail.PasswordAuthentication;
  5 +
  6 +/**
  7 + * 服务器邮箱登录验证
  8 + */
  9 +public class MailAuthenticator extends Authenticator{
  10 + /**
  11 + * 用户名(登录邮箱)
  12 + */
  13 + private String username;
  14 + /**
  15 + * 密码
  16 + */
  17 + private String password;
  18 +
  19 + /**
  20 + * 初始化邮箱和密码
  21 + *
  22 + * @param username
  23 + * 邮箱
  24 + * @param password
  25 + * 密码
  26 + */
  27 + public MailAuthenticator(String username, String password) {
  28 + this.username = username;
  29 + this.password = password;
  30 + }
  31 +
  32 + String getPassword() {
  33 + return password;
  34 + }
  35 +
  36 + @Override
  37 + protected PasswordAuthentication getPasswordAuthentication() {
  38 + return new PasswordAuthentication(username, password);
  39 + }
  40 +
  41 + String getUsername() {
  42 + return username;
  43 + }
  44 +
  45 + public void setPassword(String password) {
  46 + this.password = password;
  47 + }
  48 +
  49 + public void setUsername(String username) {
  50 + this.username = username;
  51 + }
  52 +}
... ...
src/main/java/com/bsth/email/SendEmailController.java 0 → 100644
  1 +package com.bsth.email;
  2 +
  3 +import com.bsth.email.entity.EmailBean;
  4 +import com.bsth.util.Tools;
  5 +import org.springframework.stereotype.Component;
  6 +
  7 +import java.util.List;
  8 +
  9 +@Component
  10 +public class SendEmailController {
  11 +
  12 + /*
  13 + * recipients
  14 + * 收件人集合
  15 + * mail
  16 + * 邮件
  17 + */
  18 + public int sendMail(List<String> recipients,EmailBean mail){
  19 + Tools t = new Tools("mailbox.properties");
  20 + SimpleMailSender sms = new SimpleMailSender(t.getValue("username"),t.getValue("password"));
  21 + try {
  22 + for (String recipient : recipients) {
  23 + sms.send(recipient, mail.getSubject(),mail.getContent());
  24 + }
  25 + } catch (Exception e) {
  26 + e.printStackTrace();
  27 + return -1;
  28 + }
  29 + return 1;
  30 + }
  31 +
  32 + /*
  33 + * recipient
  34 + * 收件人
  35 + * mail
  36 + * 邮件
  37 + */
  38 + public int sendMail(String recipient,EmailBean mail){
  39 + Tools t = new Tools("mailbox.properties");
  40 + SimpleMailSender sms = new SimpleMailSender(t.getValue("username"),t.getValue("password"));
  41 + try {
  42 + sms.send(recipient, mail.getSubject(),mail.getContent());
  43 + } catch (Exception e) {
  44 + e.printStackTrace();
  45 + return -1;
  46 + }
  47 + return 1;
  48 + }
  49 +}
... ...
src/main/java/com/bsth/email/SimpleMailSender.java 0 → 100644
  1 +package com.bsth.email;
  2 +
  3 +import com.bsth.email.entity.EmailBean;
  4 +
  5 +import java.util.List;
  6 +import java.util.Properties;
  7 +
  8 +import javax.activation.CommandMap;
  9 +import javax.activation.MailcapCommandMap;
  10 +import javax.mail.MessagingException;
  11 +import javax.mail.Session;
  12 +import javax.mail.Transport;
  13 +import javax.mail.internet.AddressException;
  14 +import javax.mail.internet.InternetAddress;
  15 +import javax.mail.internet.MimeMessage;
  16 +import javax.mail.internet.MimeMessage.RecipientType;
  17 +
  18 +
  19 +public class SimpleMailSender {
  20 + /**
  21 + * 发送邮件的props文件
  22 + */
  23 + private final transient Properties props = System.getProperties();
  24 + /**
  25 + * 邮件服务器登录验证
  26 + */
  27 + private transient MailAuthenticator authenticator;
  28 +
  29 + /**
  30 + * 邮箱session
  31 + */
  32 + private transient Session session;
  33 +
  34 + /**
  35 + * 初始化邮件发送器
  36 + *
  37 + * @param smtpHostName
  38 + * SMTP邮件服务器地址
  39 + * @param username
  40 + * 发送邮件的用户名(地址)
  41 + * @param password
  42 + * 发送邮件的密码
  43 + */
  44 + public SimpleMailSender(final String smtpHostName, final String username,
  45 + final String password) {
  46 + init(username, password, smtpHostName);
  47 + }
  48 +
  49 + /**
  50 + * 初始化邮件发送器
  51 + *
  52 + * @param username
  53 + * 发送邮件的用户名(地址),并以此解析SMTP服务器地址
  54 + * @param password
  55 + * 发送邮件的密码
  56 + */
  57 + public SimpleMailSender(final String username, final String password) {
  58 + //通过邮箱地址解析出smtp服务器,对大多数邮箱都管用
  59 + final String smtpHostName = "smtp." + username.split("@")[1];
  60 + init(username, password, smtpHostName);
  61 +
  62 + }
  63 +
  64 + /**
  65 + * 初始化
  66 + *
  67 + * @param username
  68 + * 发送邮件的用户名(地址)
  69 + * @param password
  70 + * 密码
  71 + * @param smtpHostName
  72 + * SMTP主机地址
  73 + */
  74 + private void init(String username, String password, String smtpHostName) {
  75 + // 初始化props
  76 + props.put("mail.smtp.auth", "true");
  77 + props.put("mail.smtp.host", smtpHostName);
  78 + // 验证
  79 + authenticator = new MailAuthenticator(username, password);
  80 + // 创建session
  81 + session = Session.getInstance(props, authenticator);
  82 + }
  83 +
  84 + /**
  85 + * 发送邮件
  86 + *
  87 + * @param recipient
  88 + * 收件人邮箱地址
  89 + * @param subject
  90 + * 邮件主题
  91 + * @param content
  92 + * 邮件内容
  93 + * @throws AddressException
  94 + * @throws MessagingException
  95 + */
  96 + public void send(String recipient, String subject, Object content)
  97 + throws AddressException, MessagingException {
  98 + // 创建mime类型邮件
  99 + final MimeMessage message = new MimeMessage(session);
  100 + // 设置发信人
  101 + message.setFrom(new InternetAddress(authenticator.getUsername()));
  102 + // 设置收件人
  103 + message.setRecipient(RecipientType.TO, new InternetAddress(recipient));
  104 + // 设置主题
  105 + message.setSubject(subject);
  106 + // 设置邮件内容
  107 + message.setContent(content.toString(), "text/html;charset=utf-8");
  108 +
  109 + MailcapCommandMap mc = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
  110 + mc.addMailcap("text/html;; x-java-content-handler=com.sun.mail.handlers.text_html");
  111 + mc.addMailcap("text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml");
  112 + mc.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain");
  113 + mc.addMailcap("multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
  114 + mc.addMailcap("message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822");
  115 + CommandMap.setDefaultCommandMap(mc);
  116 + // 发送
  117 + Transport.send(message);
  118 + }
  119 +
  120 + /**
  121 + * 群发邮件
  122 + *
  123 + * @param recipients
  124 + * 收件人们
  125 + * @param subject
  126 + * 主题
  127 + * @param content
  128 + * 内容
  129 + * @throws AddressException
  130 + * @throws MessagingException
  131 + */
  132 + public void send(List<String> recipients, String subject, Object content)
  133 + throws AddressException, MessagingException {
  134 + // 创建mime类型邮件
  135 + final MimeMessage message = new MimeMessage(session);
  136 + // 设置发信人
  137 + message.setFrom(new InternetAddress(authenticator.getUsername()));
  138 + // 设置收件人们
  139 + final int num = recipients.size();
  140 + InternetAddress[] addresses = new InternetAddress[num];
  141 + for (int i = 0; i < num; i++) {
  142 + addresses[i] = new InternetAddress(recipients.get(i));
  143 + }
  144 + message.setRecipients(RecipientType.TO, addresses);
  145 + // 设置主题
  146 + message.setSubject(subject);
  147 + // 设置邮件内容
  148 + message.setContent(content.toString(), "text/html;charset=utf-8");
  149 + // 发送
  150 + Transport.send(message);
  151 + }
  152 +
  153 + /**
  154 + * 发送邮件
  155 + *
  156 + * @param recipient
  157 + * 收件人邮箱地址
  158 + * @param mail
  159 + * 邮件对象
  160 + * @throws AddressException
  161 + * @throws MessagingException
  162 + */
  163 + public void send(String recipient, EmailBean mail)
  164 + throws AddressException, MessagingException {
  165 + send(recipient, mail.getSubject(), mail.getContent());
  166 + }
  167 +
  168 + /**
  169 + * 群发邮件
  170 + *
  171 + * @param recipients
  172 + * 收件人们
  173 + * @param mail
  174 + * 邮件对象
  175 + * @throws AddressException
  176 + * @throws MessagingException
  177 + */
  178 + public void send(List<String> recipients, EmailBean mail)
  179 + throws AddressException, MessagingException {
  180 + send(recipients, mail.getSubject(), mail.getContent());
  181 + }
  182 +}
... ...
src/main/java/com/bsth/email/entity/EmailBean.java 0 → 100644
  1 +package com.bsth.email.entity;
  2 +
  3 +/**
  4 + * Created by zlz on 2017-12-29.
  5 + */
  6 +public class EmailBean {
  7 + private String subject;// 邮件标题
  8 + private String content;//邮件内容
  9 + public String getSubject() {
  10 + return subject;
  11 + }
  12 + public void setSubject(String subject) {
  13 + this.subject = subject;
  14 + }
  15 + public String getContent() {
  16 + return content;
  17 + }
  18 + public void setContent(String content) {
  19 + this.content = content;
  20 + }
  21 +}
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -658,7 +658,7 @@ public class FormsServiceImpl implements FormsService {
658 658 List<Singledata> list_=new ArrayList<Singledata>();
659 659 if(tjtype.equals("jsy")){
660 660 //油统计
661   - String sql="select r.j_gh, r.xl_bm,r.cl_zbh"
  661 + String sql="select r.j_gh, r.xl_bm,r.cl_zbh,r.j_name"
662 662 + " from bsth_c_s_sp_info_real r where "
663 663 + " r.schedule_date_str = '"+startDate+"'";
664 664 if(xlbm.equals("")){
... ... @@ -667,13 +667,14 @@ public class FormsServiceImpl implements FormsService {
667 667 }else{
668 668 sql += " and r.xl_bm = '"+xlbm+"'";
669 669 }
670   - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh order by r.xl_bm,r.cl_zbh";
  670 + sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh";
671 671 list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
672 672 @Override
673 673 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
674 674 Singledata sin = new Singledata();
675 675 sin.setxL(arg0.getString("xl_bm"));
676 676 sin.setJsy(arg0.getString("j_gh"));
  677 + sin.setjName(arg0.getString("j_name"));
677 678 sin.setClzbh(arg0.getString("cl_zbh"));
678 679 return sin;
679 680 }
... ... @@ -794,7 +795,7 @@ public class FormsServiceImpl implements FormsService {
794 795 sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc)));
795 796 sin.setXlmc(BasicData.lineCode2NameMap.get(line));
796 797 sin.setrQ(startDate);
797   - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  798 +// sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
798 799 sin.setSgh("");
799 800 sin.setsName("");
800 801 sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ... @@ -1381,7 +1382,11 @@ public class FormsServiceImpl implements FormsService {
1381 1382 sin.setClzbh(clzbh);
1382 1383 sin.setJsy(jsy);
1383 1384 sin.setrQ(startDate);
1384   - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1385 + if(newList.size()>0){
  1386 + sin.setjName(newList.get(0).getjName());
  1387 + }else{
  1388 + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1389 + }
1385 1390 sin.setSgh("");
1386 1391 sin.setsName("");
1387 1392 sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ... @@ -1459,7 +1464,11 @@ public class FormsServiceImpl implements FormsService {
1459 1464 sin.setClzbh(clzbh);
1460 1465 sin.setJsy(jsy);
1461 1466 sin.setrQ(startDate);
1462   - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1467 + if(newList.size()>0){
  1468 + sin.setjName(newList.get(0).getjName());
  1469 + }else{
  1470 + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy));
  1471 + }
1463 1472 sin.setSgh("");
1464 1473 sin.setsName("");
1465 1474 sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ...
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
... ... @@ -722,7 +722,7 @@ public class GeoDataServiceImpl implements GeoDataService {
722 722 for (int i = 0, size = routes.size(); i < size; i++) {
723 723 routes.get(i).setStationMark("Z");
724 724 }
725   - if(routes.size() > 0)
  725 + if(routes.size() > 0 && prevRouteId!=-1)
726 726 routes.get(0).setStationMark("B");
727 727 if(routes.size() > 1)
728 728 routes.get(routes.size() - 1).setStationMark("E");
... ... @@ -808,15 +808,68 @@ public class GeoDataServiceImpl implements GeoDataService {
808 808 public Map<String, Object> destroyStation(GeoStation station) {
809 809 Map<String, Object> rs = new HashMap<>();
810 810  
  811 + //编程式事务
  812 + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource());
  813 + DefaultTransactionDefinition def = new DefaultTransactionDefinition();
  814 + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
  815 + TransactionStatus status = tran.getTransaction(def);
811 816 try {
812 817 String sql = "update bsth_c_ls_stationroute set destroy=1 where id=?";
813 818 jdbcTemplate.update(sql, station.getId());
814 819  
  820 + //重新排序路由,标记mark
  821 + sql = "select * from bsth_c_ls_stationroute where line_code='" + station.getLineCode() + "' and directions=" + station.getDirections() + " and destroy=0 and versions=" + station.getVersions();
  822 + List<SaveStationRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveStationRouteDTO.class));
  823 + Collections.sort(routes, new StationRouteComp());
  824 +
  825 + for (int i = 0, size = routes.size(); i < size; i++) {
  826 + routes.get(i).setStationMark("Z");
  827 + }
  828 + if(routes.size() > 0)
  829 + routes.get(0).setStationMark("B");
  830 + if(routes.size() > 1)
  831 + routes.get(routes.size() - 1).setStationMark("E");
  832 +
  833 + final List<SaveStationRouteDTO> saveList = routes;
  834 + // update 原路由
  835 + jdbcTemplate.batchUpdate("update bsth_c_ls_stationroute set line=?,station=?,station_name=?,station_route_code=?," +
  836 + "line_code=?,station_code=?,station_mark=?,distances=?,to_time=?,destroy=?,versions=?,create_date=?,update_date=?,directions=?" +
  837 + " where id=?"
  838 + , new BatchPreparedStatementSetter() {
  839 + @Override
  840 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  841 + SaveStationRouteDTO sr = saveList.get(i);
  842 + ps.setInt(1, sr.getLine());
  843 + ps.setLong(2, sr.getStation());
  844 + ps.setString(3, sr.getStationName());
  845 + ps.setInt(4, sr.getStationRouteCode());
  846 + ps.setString(5, sr.getLineCode());
  847 + ps.setString(6, sr.getStationCode());
  848 + ps.setString(7, sr.getStationMark());
  849 + ps.setDouble(8, sr.getDistances());
  850 + ps.setDouble(9, sr.getToTime());
  851 + ps.setInt(10, sr.getDestroy());
  852 + ps.setInt(11, sr.getVersions());
  853 + ps.setTimestamp(12, new java.sql.Timestamp(sr.getCreateDate().getTime()));
  854 + ps.setTimestamp(13, new java.sql.Timestamp(sr.getUpdateDate().getTime()));
  855 + ps.setInt(14, sr.getDirections());
  856 + ps.setInt(15, sr.getId());
  857 + }
  858 +
  859 + @Override
  860 + public int getBatchSize() {
  861 + return saveList.size();
  862 + }
  863 + });
  864 +
  865 + tran.commit(status);
  866 +
815 867 //返回更新之后的数据
816 868 List<GeoStation> list = findByUpdown(station.getLineCode(), station.getDirections(), station.getVersions());
817 869 rs.put("list", list);
818 870 rs.put("status", ResponseCode.SUCCESS);
819 871 } catch (Exception e) {
  872 + tran.rollback(status);
820 873 logger.error("", e);
821 874 rs.put("status", ResponseCode.ERROR);
822 875 rs.put("msg", "服务器出现异常");
... ...
src/main/java/com/bsth/service/geo_data/impl/dto/CascadeSaveRoad.java
1   -package com.bsth.service.geo_data.impl.dto;
2   -
3   -/**
4   - * 级联入库的路段 和 路段路由
5   - * Created by panzhao on 2017/12/25.
6   - */
7   -public class CascadeSaveRoad {
8   -
9   - private Integer routeId;
10   -
11   - private Integer line;
12   -
13   - private String lineCode;
14   -
15   - private int directions;
16   -
17   - private Integer section;
18   -
19   - private String sectionCode;
20   -
21   - private Integer sectionrouteCode;
22   -
23   - private int versions;
24   -
25   - private String sectionName;
26   -
27   - private String crosesRoad;
28   -
29   - private String gsectionVector;
30   -
31   - private String dbType;
32   -
33   - private Integer speedLimit;
34   -
35   - public Integer getRouteId() {
36   - return routeId;
37   - }
38   -
39   - public void setRouteId(Integer routeId) {
40   - this.routeId = routeId;
41   - }
42   -
43   - public Integer getLine() {
44   - return line;
45   - }
46   -
47   - public void setLine(Integer line) {
48   - this.line = line;
49   - }
50   -
51   - public String getLineCode() {
52   - return lineCode;
53   - }
54   -
55   - public void setLineCode(String lineCode) {
56   - this.lineCode = lineCode;
57   - }
58   -
59   - public Integer getSection() {
60   - return section;
61   - }
62   -
63   - public void setSection(Integer section) {
64   - this.section = section;
65   - }
66   -
67   - public String getSectionCode() {
68   - return sectionCode;
69   - }
70   -
71   - public void setSectionCode(String sectionCode) {
72   - this.sectionCode = sectionCode;
73   - }
74   -
75   - public Integer getSectionrouteCode() {
76   - return sectionrouteCode;
77   - }
78   -
79   - public void setSectionrouteCode(Integer sectionrouteCode) {
80   - this.sectionrouteCode = sectionrouteCode;
81   - }
82   -
83   - public int getVersions() {
84   - return versions;
85   - }
86   -
87   - public void setVersions(int versions) {
88   - this.versions = versions;
89   - }
90   -
91   - public String getSectionName() {
92   - return sectionName;
93   - }
94   -
95   - public void setSectionName(String sectionName) {
96   - this.sectionName = sectionName;
97   - }
98   -
99   - public String getCrosesRoad() {
100   - return crosesRoad;
101   - }
102   -
103   - public void setCrosesRoad(String crosesRoad) {
104   - this.crosesRoad = crosesRoad;
105   - }
106   -
107   - public String getGsectionVector() {
108   - return gsectionVector;
109   - }
110   -
111   - public void setGsectionVector(String gsectionVector) {
112   - this.gsectionVector = gsectionVector;
113   - }
114   -
115   - public String getDbType() {
116   - return dbType;
117   - }
118   -
119   - public void setDbType(String dbType) {
120   - this.dbType = dbType;
121   - }
122   -
123   - public Integer getSpeedLimit() {
124   - return speedLimit;
125   - }
126   -
127   - public void setSpeedLimit(Integer speedLimit) {
128   - this.speedLimit = speedLimit;
129   - }
130   -
131   - public int getDirections() {
132   - return directions;
133   - }
134   -
135   - public void setDirections(int directions) {
136   - this.directions = directions;
137   - }
138   -}
  1 +package com.bsth.service.geo_data.impl.dto;
  2 +
  3 +/**
  4 + * 级联入库的路段 和 路段路由
  5 + * Created by panzhao on 2017/12/25.
  6 + */
  7 +public class CascadeSaveRoad {
  8 +
  9 + private Integer routeId;
  10 +
  11 + private Integer line;
  12 +
  13 + private String lineCode;
  14 +
  15 + private int directions;
  16 +
  17 + private Integer section;
  18 +
  19 + private String sectionCode;
  20 +
  21 + private Integer sectionrouteCode;
  22 +
  23 + private int versions;
  24 +
  25 + private String sectionName;
  26 +
  27 + private String crosesRoad;
  28 +
  29 + private String gsectionVector;
  30 +
  31 + private String dbType;
  32 +
  33 + private Integer speedLimit;
  34 +
  35 + public Integer getRouteId() {
  36 + return routeId;
  37 + }
  38 +
  39 + public void setRouteId(Integer routeId) {
  40 + this.routeId = routeId;
  41 + }
  42 +
  43 + public Integer getLine() {
  44 + return line;
  45 + }
  46 +
  47 + public void setLine(Integer line) {
  48 + this.line = line;
  49 + }
  50 +
  51 + public String getLineCode() {
  52 + return lineCode;
  53 + }
  54 +
  55 + public void setLineCode(String lineCode) {
  56 + this.lineCode = lineCode;
  57 + }
  58 +
  59 + public Integer getSection() {
  60 + return section;
  61 + }
  62 +
  63 + public void setSection(Integer section) {
  64 + this.section = section;
  65 + }
  66 +
  67 + public String getSectionCode() {
  68 + return sectionCode;
  69 + }
  70 +
  71 + public void setSectionCode(String sectionCode) {
  72 + this.sectionCode = sectionCode;
  73 + }
  74 +
  75 + public Integer getSectionrouteCode() {
  76 + return sectionrouteCode;
  77 + }
  78 +
  79 + public void setSectionrouteCode(Integer sectionrouteCode) {
  80 + this.sectionrouteCode = sectionrouteCode;
  81 + }
  82 +
  83 + public int getVersions() {
  84 + return versions;
  85 + }
  86 +
  87 + public void setVersions(int versions) {
  88 + this.versions = versions;
  89 + }
  90 +
  91 + public String getSectionName() {
  92 + return sectionName;
  93 + }
  94 +
  95 + public void setSectionName(String sectionName) {
  96 + this.sectionName = sectionName;
  97 + }
  98 +
  99 + public String getCrosesRoad() {
  100 + return crosesRoad;
  101 + }
  102 +
  103 + public void setCrosesRoad(String crosesRoad) {
  104 + this.crosesRoad = crosesRoad;
  105 + }
  106 +
  107 + public String getGsectionVector() {
  108 + return gsectionVector;
  109 + }
  110 +
  111 + public void setGsectionVector(String gsectionVector) {
  112 + this.gsectionVector = gsectionVector;
  113 + }
  114 +
  115 + public String getDbType() {
  116 + return dbType;
  117 + }
  118 +
  119 + public void setDbType(String dbType) {
  120 + this.dbType = dbType;
  121 + }
  122 +
  123 + public Integer getSpeedLimit() {
  124 + return speedLimit;
  125 + }
  126 +
  127 + public void setSpeedLimit(Integer speedLimit) {
  128 + this.speedLimit = speedLimit;
  129 + }
  130 +
  131 + public int getDirections() {
  132 + return directions;
  133 + }
  134 +
  135 + public void setDirections(int directions) {
  136 + this.directions = directions;
  137 + }
  138 +}
... ...
src/main/java/com/bsth/service/geo_data/impl/dto/CascadeSaveStation.java
1   -package com.bsth.service.geo_data.impl.dto;
2   -
3   -/**
4   - * 站点和路由级联入库
5   - * Created by panzhao on 2017/12/21.
6   - */
7   -public class CascadeSaveStation {
8   -
9   - /**
10   - * 路由id
11   - */
12   - private Integer routeId;
13   -
14   - /**
15   - * 线路id
16   - */
17   - private Integer line;
18   -
19   - /**
20   - * 上下行
21   - */
22   - private int directions;
23   -
24   - /**
25   - * 站点id
26   - */
27   - private Integer station;
28   -
29   - /**
30   - * 站点名称
31   - */
32   - private String stationName;
33   -
34   - /**
35   - * 路由顺序
36   - */
37   - private Integer stationRouteCode;
38   -
39   - /**
40   - * 线路编码
41   - */
42   - private String lineCode;
43   -
44   - /**
45   - * 站点编码
46   - */
47   - private String stationCode;
48   -
49   - private String stationMark;
50   -
51   - private Double distances;
52   -
53   - private Double toTime;
54   -
55   - private Integer stationId;
56   -
57   - private String dbType;
58   -
59   - private String bJwpoints;
60   -
61   - private Float gLonx;
62   -
63   - private Float gLaty;
64   -
65   - private Integer radius;
66   -
67   - private String shapesType;
68   -
69   - private String gPolygonGrid;
70   -
71   -
72   -
73   - public Integer getLine() {
74   - return line;
75   - }
76   -
77   - public void setLine(Integer line) {
78   - this.line = line;
79   - }
80   -
81   - public Integer getStation() {
82   - return station;
83   - }
84   -
85   - public void setStation(Integer station) {
86   - this.station = station;
87   - }
88   -
89   - public String getStationName() {
90   - return stationName;
91   - }
92   -
93   - public void setStationName(String stationName) {
94   - this.stationName = stationName;
95   - }
96   -
97   - public Integer getStationRouteCode() {
98   - return stationRouteCode;
99   - }
100   -
101   - public void setStationRouteCode(Integer stationRouteCode) {
102   - this.stationRouteCode = stationRouteCode;
103   - }
104   -
105   - public String getLineCode() {
106   - return lineCode;
107   - }
108   -
109   - public void setLineCode(String lineCode) {
110   - this.lineCode = lineCode;
111   - }
112   -
113   - public String getStationCode() {
114   - return stationCode;
115   - }
116   -
117   - public void setStationCode(String stationCode) {
118   - this.stationCode = stationCode;
119   - }
120   -
121   - public String getStationMark() {
122   - return stationMark;
123   - }
124   -
125   - public void setStationMark(String stationMark) {
126   - this.stationMark = stationMark;
127   - }
128   -
129   - public Double getDistances() {
130   - return distances;
131   - }
132   -
133   - public void setDistances(Double distances) {
134   - this.distances = distances;
135   - }
136   -
137   - public Double getToTime() {
138   - return toTime;
139   - }
140   -
141   - public void setToTime(Double toTime) {
142   - this.toTime = toTime;
143   - }
144   -
145   - public Integer getStationId() {
146   - return stationId;
147   - }
148   -
149   - public void setStationId(Integer stationId) {
150   - this.stationId = stationId;
151   - }
152   -
153   - public String getDbType() {
154   - return dbType;
155   - }
156   -
157   - public void setDbType(String dbType) {
158   - this.dbType = dbType;
159   - }
160   -
161   - public String getbJwpoints() {
162   - return bJwpoints;
163   - }
164   -
165   - public void setbJwpoints(String bJwpoints) {
166   - this.bJwpoints = bJwpoints;
167   - }
168   -
169   - public Float getgLonx() {
170   - return gLonx;
171   - }
172   -
173   - public void setgLonx(Float gLonx) {
174   - this.gLonx = gLonx;
175   - }
176   -
177   - public Float getgLaty() {
178   - return gLaty;
179   - }
180   -
181   - public void setgLaty(Float gLaty) {
182   - this.gLaty = gLaty;
183   - }
184   -
185   - public Integer getRadius() {
186   - return radius;
187   - }
188   -
189   - public void setRadius(Integer radius) {
190   - this.radius = radius;
191   - }
192   -
193   - public String getShapesType() {
194   - return shapesType;
195   - }
196   -
197   - public void setShapesType(String shapesType) {
198   - this.shapesType = shapesType;
199   - }
200   -
201   - public String getgPolygonGrid() {
202   - return gPolygonGrid;
203   - }
204   -
205   - public void setgPolygonGrid(String gPolygonGrid) {
206   - this.gPolygonGrid = gPolygonGrid;
207   - }
208   -
209   - public int getDirections() {
210   - return directions;
211   - }
212   -
213   - public void setDirections(int directions) {
214   - this.directions = directions;
215   - }
216   -
217   - public Integer getRouteId() {
218   - return routeId;
219   - }
220   -
221   - public void setRouteId(Integer routeId) {
222   - this.routeId = routeId;
223   - }
224   -}
  1 +package com.bsth.service.geo_data.impl.dto;
  2 +
  3 +/**
  4 + * 站点和路由级联入库
  5 + * Created by panzhao on 2017/12/21.
  6 + */
  7 +public class CascadeSaveStation {
  8 +
  9 + /**
  10 + * 路由id
  11 + */
  12 + private Integer routeId;
  13 +
  14 + /**
  15 + * 线路id
  16 + */
  17 + private Integer line;
  18 +
  19 + /**
  20 + * 上下行
  21 + */
  22 + private int directions;
  23 +
  24 + /**
  25 + * 站点id
  26 + */
  27 + private Integer station;
  28 +
  29 + /**
  30 + * 站点名称
  31 + */
  32 + private String stationName;
  33 +
  34 + /**
  35 + * 路由顺序
  36 + */
  37 + private Integer stationRouteCode;
  38 +
  39 + /**
  40 + * 线路编码
  41 + */
  42 + private String lineCode;
  43 +
  44 + /**
  45 + * 站点编码
  46 + */
  47 + private String stationCode;
  48 +
  49 + private String stationMark;
  50 +
  51 + private Double distances;
  52 +
  53 + private Double toTime;
  54 +
  55 + private Integer stationId;
  56 +
  57 + private String dbType;
  58 +
  59 + private String bJwpoints;
  60 +
  61 + private Float gLonx;
  62 +
  63 + private Float gLaty;
  64 +
  65 + private Integer radius;
  66 +
  67 + private String shapesType;
  68 +
  69 + private String gPolygonGrid;
  70 +
  71 +
  72 +
  73 + public Integer getLine() {
  74 + return line;
  75 + }
  76 +
  77 + public void setLine(Integer line) {
  78 + this.line = line;
  79 + }
  80 +
  81 + public Integer getStation() {
  82 + return station;
  83 + }
  84 +
  85 + public void setStation(Integer station) {
  86 + this.station = station;
  87 + }
  88 +
  89 + public String getStationName() {
  90 + return stationName;
  91 + }
  92 +
  93 + public void setStationName(String stationName) {
  94 + this.stationName = stationName;
  95 + }
  96 +
  97 + public Integer getStationRouteCode() {
  98 + return stationRouteCode;
  99 + }
  100 +
  101 + public void setStationRouteCode(Integer stationRouteCode) {
  102 + this.stationRouteCode = stationRouteCode;
  103 + }
  104 +
  105 + public String getLineCode() {
  106 + return lineCode;
  107 + }
  108 +
  109 + public void setLineCode(String lineCode) {
  110 + this.lineCode = lineCode;
  111 + }
  112 +
  113 + public String getStationCode() {
  114 + return stationCode;
  115 + }
  116 +
  117 + public void setStationCode(String stationCode) {
  118 + this.stationCode = stationCode;
  119 + }
  120 +
  121 + public String getStationMark() {
  122 + return stationMark;
  123 + }
  124 +
  125 + public void setStationMark(String stationMark) {
  126 + this.stationMark = stationMark;
  127 + }
  128 +
  129 + public Double getDistances() {
  130 + return distances;
  131 + }
  132 +
  133 + public void setDistances(Double distances) {
  134 + this.distances = distances;
  135 + }
  136 +
  137 + public Double getToTime() {
  138 + return toTime;
  139 + }
  140 +
  141 + public void setToTime(Double toTime) {
  142 + this.toTime = toTime;
  143 + }
  144 +
  145 + public Integer getStationId() {
  146 + return stationId;
  147 + }
  148 +
  149 + public void setStationId(Integer stationId) {
  150 + this.stationId = stationId;
  151 + }
  152 +
  153 + public String getDbType() {
  154 + return dbType;
  155 + }
  156 +
  157 + public void setDbType(String dbType) {
  158 + this.dbType = dbType;
  159 + }
  160 +
  161 + public String getbJwpoints() {
  162 + return bJwpoints;
  163 + }
  164 +
  165 + public void setbJwpoints(String bJwpoints) {
  166 + this.bJwpoints = bJwpoints;
  167 + }
  168 +
  169 + public Float getgLonx() {
  170 + return gLonx;
  171 + }
  172 +
  173 + public void setgLonx(Float gLonx) {
  174 + this.gLonx = gLonx;
  175 + }
  176 +
  177 + public Float getgLaty() {
  178 + return gLaty;
  179 + }
  180 +
  181 + public void setgLaty(Float gLaty) {
  182 + this.gLaty = gLaty;
  183 + }
  184 +
  185 + public Integer getRadius() {
  186 + return radius;
  187 + }
  188 +
  189 + public void setRadius(Integer radius) {
  190 + this.radius = radius;
  191 + }
  192 +
  193 + public String getShapesType() {
  194 + return shapesType;
  195 + }
  196 +
  197 + public void setShapesType(String shapesType) {
  198 + this.shapesType = shapesType;
  199 + }
  200 +
  201 + public String getgPolygonGrid() {
  202 + return gPolygonGrid;
  203 + }
  204 +
  205 + public void setgPolygonGrid(String gPolygonGrid) {
  206 + this.gPolygonGrid = gPolygonGrid;
  207 + }
  208 +
  209 + public int getDirections() {
  210 + return directions;
  211 + }
  212 +
  213 + public void setDirections(int directions) {
  214 + this.directions = directions;
  215 + }
  216 +
  217 + public Integer getRouteId() {
  218 + return routeId;
  219 + }
  220 +
  221 + public void setRouteId(Integer routeId) {
  222 + this.routeId = routeId;
  223 + }
  224 +}
... ...
src/main/java/com/bsth/service/geo_data/impl/dto/SaveRoadRouteDTO.java
1   -package com.bsth.service.geo_data.impl.dto;
2   -
3   -import java.util.Date;
4   -
5   -/**
6   - * Created by panzhao on 2017/12/17.
7   - */
8   -public class SaveRoadRouteDTO {
9   -
10   - private Integer id;
11   -
12   - // 路段路由序号
13   - private Integer sectionrouteCode;
14   -
15   - // 线路编号
16   - private String lineCode;
17   -
18   - // 路段编号
19   - private String sectionCode;
20   -
21   - // 路段路由方向
22   - private Integer directions;
23   -
24   - // 版本号
25   - private Integer versions;
26   -
27   - // 是否撤销
28   - private Integer destroy;
29   -
30   - /** 是否有路段限速数据 <0:分段;1:未分段>*/
31   - private Integer isRoadeSpeed;
32   -
33   - // 描述
34   - private String descriptions;
35   -
36   - // 创建人
37   - private Integer createBy;
38   -
39   - // 修改人
40   - private Integer updateBy;
41   -
42   - // 创建日期
43   - private Date createDate;
44   -
45   - // 修改日期
46   - private Date updateDate;
47   -
48   - // 路段信息
49   - private long section;
50   -
51   - // 线路ID
52   - private int line;
53   -
54   - public Integer getId() {
55   - return id;
56   - }
57   -
58   - public void setId(Integer id) {
59   - this.id = id;
60   - }
61   -
62   - public Integer getSectionrouteCode() {
63   - return sectionrouteCode;
64   - }
65   -
66   - public void setSectionrouteCode(Integer sectionrouteCode) {
67   - this.sectionrouteCode = sectionrouteCode;
68   - }
69   -
70   - public String getLineCode() {
71   - return lineCode;
72   - }
73   -
74   - public void setLineCode(String lineCode) {
75   - this.lineCode = lineCode;
76   - }
77   -
78   - public String getSectionCode() {
79   - return sectionCode;
80   - }
81   -
82   - public void setSectionCode(String sectionCode) {
83   - this.sectionCode = sectionCode;
84   - }
85   -
86   - public Integer getDirections() {
87   - return directions;
88   - }
89   -
90   - public void setDirections(Integer directions) {
91   - this.directions = directions;
92   - }
93   -
94   - public Integer getVersions() {
95   - return versions;
96   - }
97   -
98   - public void setVersions(Integer versions) {
99   - this.versions = versions;
100   - }
101   -
102   - public Integer getDestroy() {
103   - return destroy;
104   - }
105   -
106   - public void setDestroy(Integer destroy) {
107   - this.destroy = destroy;
108   - }
109   -
110   - public Integer getIsRoadeSpeed() {
111   - return isRoadeSpeed;
112   - }
113   -
114   - public void setIsRoadeSpeed(Integer isRoadeSpeed) {
115   - this.isRoadeSpeed = isRoadeSpeed;
116   - }
117   -
118   - public String getDescriptions() {
119   - return descriptions;
120   - }
121   -
122   - public void setDescriptions(String descriptions) {
123   - this.descriptions = descriptions;
124   - }
125   -
126   - public Integer getCreateBy() {
127   - return createBy;
128   - }
129   -
130   - public void setCreateBy(Integer createBy) {
131   - this.createBy = createBy;
132   - }
133   -
134   - public Integer getUpdateBy() {
135   - return updateBy;
136   - }
137   -
138   - public void setUpdateBy(Integer updateBy) {
139   - this.updateBy = updateBy;
140   - }
141   -
142   - public Date getCreateDate() {
143   - return createDate;
144   - }
145   -
146   - public void setCreateDate(Date createDate) {
147   - this.createDate = createDate;
148   - }
149   -
150   - public Date getUpdateDate() {
151   - return updateDate;
152   - }
153   -
154   - public void setUpdateDate(Date updateDate) {
155   - this.updateDate = updateDate;
156   - }
157   -
158   - public long getSection() {
159   - return section;
160   - }
161   -
162   - public void setSection(long section) {
163   - this.section = section;
164   - }
165   -
166   - public int getLine() {
167   - return line;
168   - }
169   -
170   - public void setLine(int line) {
171   - this.line = line;
172   - }
173   -}
  1 +package com.bsth.service.geo_data.impl.dto;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/12/17.
  7 + */
  8 +public class SaveRoadRouteDTO {
  9 +
  10 + private Integer id;
  11 +
  12 + // 路段路由序号
  13 + private Integer sectionrouteCode;
  14 +
  15 + // 线路编号
  16 + private String lineCode;
  17 +
  18 + // 路段编号
  19 + private String sectionCode;
  20 +
  21 + // 路段路由方向
  22 + private Integer directions;
  23 +
  24 + // 版本号
  25 + private Integer versions;
  26 +
  27 + // 是否撤销
  28 + private Integer destroy;
  29 +
  30 + /** 是否有路段限速数据 <0:分段;1:未分段>*/
  31 + private Integer isRoadeSpeed;
  32 +
  33 + // 描述
  34 + private String descriptions;
  35 +
  36 + // 创建人
  37 + private Integer createBy;
  38 +
  39 + // 修改人
  40 + private Integer updateBy;
  41 +
  42 + // 创建日期
  43 + private Date createDate;
  44 +
  45 + // 修改日期
  46 + private Date updateDate;
  47 +
  48 + // 路段信息
  49 + private long section;
  50 +
  51 + // 线路ID
  52 + private int line;
  53 +
  54 + public Integer getId() {
  55 + return id;
  56 + }
  57 +
  58 + public void setId(Integer id) {
  59 + this.id = id;
  60 + }
  61 +
  62 + public Integer getSectionrouteCode() {
  63 + return sectionrouteCode;
  64 + }
  65 +
  66 + public void setSectionrouteCode(Integer sectionrouteCode) {
  67 + this.sectionrouteCode = sectionrouteCode;
  68 + }
  69 +
  70 + public String getLineCode() {
  71 + return lineCode;
  72 + }
  73 +
  74 + public void setLineCode(String lineCode) {
  75 + this.lineCode = lineCode;
  76 + }
  77 +
  78 + public String getSectionCode() {
  79 + return sectionCode;
  80 + }
  81 +
  82 + public void setSectionCode(String sectionCode) {
  83 + this.sectionCode = sectionCode;
  84 + }
  85 +
  86 + public Integer getDirections() {
  87 + return directions;
  88 + }
  89 +
  90 + public void setDirections(Integer directions) {
  91 + this.directions = directions;
  92 + }
  93 +
  94 + public Integer getVersions() {
  95 + return versions;
  96 + }
  97 +
  98 + public void setVersions(Integer versions) {
  99 + this.versions = versions;
  100 + }
  101 +
  102 + public Integer getDestroy() {
  103 + return destroy;
  104 + }
  105 +
  106 + public void setDestroy(Integer destroy) {
  107 + this.destroy = destroy;
  108 + }
  109 +
  110 + public Integer getIsRoadeSpeed() {
  111 + return isRoadeSpeed;
  112 + }
  113 +
  114 + public void setIsRoadeSpeed(Integer isRoadeSpeed) {
  115 + this.isRoadeSpeed = isRoadeSpeed;
  116 + }
  117 +
  118 + public String getDescriptions() {
  119 + return descriptions;
  120 + }
  121 +
  122 + public void setDescriptions(String descriptions) {
  123 + this.descriptions = descriptions;
  124 + }
  125 +
  126 + public Integer getCreateBy() {
  127 + return createBy;
  128 + }
  129 +
  130 + public void setCreateBy(Integer createBy) {
  131 + this.createBy = createBy;
  132 + }
  133 +
  134 + public Integer getUpdateBy() {
  135 + return updateBy;
  136 + }
  137 +
  138 + public void setUpdateBy(Integer updateBy) {
  139 + this.updateBy = updateBy;
  140 + }
  141 +
  142 + public Date getCreateDate() {
  143 + return createDate;
  144 + }
  145 +
  146 + public void setCreateDate(Date createDate) {
  147 + this.createDate = createDate;
  148 + }
  149 +
  150 + public Date getUpdateDate() {
  151 + return updateDate;
  152 + }
  153 +
  154 + public void setUpdateDate(Date updateDate) {
  155 + this.updateDate = updateDate;
  156 + }
  157 +
  158 + public long getSection() {
  159 + return section;
  160 + }
  161 +
  162 + public void setSection(long section) {
  163 + this.section = section;
  164 + }
  165 +
  166 + public int getLine() {
  167 + return line;
  168 + }
  169 +
  170 + public void setLine(int line) {
  171 + this.line = line;
  172 + }
  173 +}
... ...
src/main/java/com/bsth/service/geo_data/impl/dto/SaveStationRouteDTO.java
1   -package com.bsth.service.geo_data.impl.dto;
2   -
3   -import java.util.Date;
4   -
5   -/**
6   - * 站点路由 jdbc 入库数据
7   - * Created by panzhao on 2017/12/14.
8   - */
9   -public class SaveStationRouteDTO {
10   -
11   - //站点路由ID
12   - private Integer id;
13   -
14   - // 站点路由序号
15   - private Integer stationRouteCode;
16   -
17   - // 站点编码
18   - private String stationCode;
19   -
20   - // 站点名称
21   - private String stationName;
22   -
23   - // 线路编码
24   - private String lineCode;
25   -
26   - /**
27   - * 站点类型
28   - *
29   - * ------ B:起点站
30   - *
31   - * ------ Z:中途站
32   - *
33   - * ------ E:终点站
34   - *
35   - * ------ T:停车场
36   - *
37   - */
38   - private String stationMark;
39   -
40   - // 站点路由出站序号
41   - private Integer outStationNmber;
42   -
43   - // 站点路由到站距离
44   - private Double distances;
45   -
46   - // 站点路由到站时间
47   - private Double toTime;
48   -
49   - // 首班时间
50   - private String firstTime;
51   -
52   - // 末班时间
53   - private String endTime;
54   -
55   - // 站点路由方向
56   - private Integer directions;
57   -
58   - // 版本号
59   - private Integer versions;
60   -
61   - // 是否撤销
62   - private Integer destroy;
63   -
64   - // 描述
65   - private String descriptions;
66   -
67   - // 创建人
68   - private Integer createBy;
69   -
70   - // 修改人
71   - private Integer updateBy;
72   -
73   - // 创建日期
74   - private Date createDate;
75   -
76   - // 修改日期
77   - private Date updateDate;
78   -
79   - // 站点ID
80   - private long station;
81   -
82   - // 线路ID
83   - private int line;
84   -
85   - public Integer getId() {
86   - return id;
87   - }
88   -
89   - public void setId(Integer id) {
90   - this.id = id;
91   - }
92   -
93   - public Integer getStationRouteCode() {
94   - return stationRouteCode;
95   - }
96   -
97   - public void setStationRouteCode(Integer stationRouteCode) {
98   - this.stationRouteCode = stationRouteCode;
99   - }
100   -
101   - public String getStationCode() {
102   - return stationCode;
103   - }
104   -
105   - public void setStationCode(String stationCode) {
106   - this.stationCode = stationCode;
107   - }
108   -
109   - public String getStationName() {
110   - return stationName;
111   - }
112   -
113   - public void setStationName(String stationName) {
114   - this.stationName = stationName;
115   - }
116   -
117   - public String getLineCode() {
118   - return lineCode;
119   - }
120   -
121   - public void setLineCode(String lineCode) {
122   - this.lineCode = lineCode;
123   - }
124   -
125   - public String getStationMark() {
126   - return stationMark;
127   - }
128   -
129   - public void setStationMark(String stationMark) {
130   - this.stationMark = stationMark;
131   - }
132   -
133   - public Integer getOutStationNmber() {
134   - return outStationNmber;
135   - }
136   -
137   - public void setOutStationNmber(Integer outStationNmber) {
138   - this.outStationNmber = outStationNmber;
139   - }
140   -
141   - public Double getDistances() {
142   - return distances;
143   - }
144   -
145   - public void setDistances(Double distances) {
146   - this.distances = distances;
147   - }
148   -
149   - public Double getToTime() {
150   - return toTime;
151   - }
152   -
153   - public void setToTime(Double toTime) {
154   - this.toTime = toTime;
155   - }
156   -
157   - public String getFirstTime() {
158   - return firstTime;
159   - }
160   -
161   - public void setFirstTime(String firstTime) {
162   - this.firstTime = firstTime;
163   - }
164   -
165   - public String getEndTime() {
166   - return endTime;
167   - }
168   -
169   - public void setEndTime(String endTime) {
170   - this.endTime = endTime;
171   - }
172   -
173   - public Integer getDirections() {
174   - return directions;
175   - }
176   -
177   - public void setDirections(Integer directions) {
178   - this.directions = directions;
179   - }
180   -
181   - public Integer getVersions() {
182   - return versions;
183   - }
184   -
185   - public void setVersions(Integer versions) {
186   - this.versions = versions;
187   - }
188   -
189   - public Integer getDestroy() {
190   - return destroy;
191   - }
192   -
193   - public void setDestroy(Integer destroy) {
194   - this.destroy = destroy;
195   - }
196   -
197   - public String getDescriptions() {
198   - return descriptions;
199   - }
200   -
201   - public void setDescriptions(String descriptions) {
202   - this.descriptions = descriptions;
203   - }
204   -
205   - public Integer getCreateBy() {
206   - return createBy;
207   - }
208   -
209   - public void setCreateBy(Integer createBy) {
210   - this.createBy = createBy;
211   - }
212   -
213   - public Integer getUpdateBy() {
214   - return updateBy;
215   - }
216   -
217   - public void setUpdateBy(Integer updateBy) {
218   - this.updateBy = updateBy;
219   - }
220   -
221   - public Date getCreateDate() {
222   - return createDate;
223   - }
224   -
225   - public void setCreateDate(Date createDate) {
226   - this.createDate = createDate;
227   - }
228   -
229   - public Date getUpdateDate() {
230   - return updateDate;
231   - }
232   -
233   - public void setUpdateDate(Date updateDate) {
234   - this.updateDate = updateDate;
235   - }
236   -
237   - public long getStation() {
238   - return station;
239   - }
240   -
241   - public void setStation(long station) {
242   - this.station = station;
243   - }
244   -
245   - public int getLine() {
246   - return line;
247   - }
248   -
249   - public void setLine(int line) {
250   - this.line = line;
251   - }
252   -}
  1 +package com.bsth.service.geo_data.impl.dto;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * 站点路由 jdbc 入库数据
  7 + * Created by panzhao on 2017/12/14.
  8 + */
  9 +public class SaveStationRouteDTO {
  10 +
  11 + //站点路由ID
  12 + private Integer id;
  13 +
  14 + // 站点路由序号
  15 + private Integer stationRouteCode;
  16 +
  17 + // 站点编码
  18 + private String stationCode;
  19 +
  20 + // 站点名称
  21 + private String stationName;
  22 +
  23 + // 线路编码
  24 + private String lineCode;
  25 +
  26 + /**
  27 + * 站点类型
  28 + *
  29 + * ------ B:起点站
  30 + *
  31 + * ------ Z:中途站
  32 + *
  33 + * ------ E:终点站
  34 + *
  35 + * ------ T:停车场
  36 + *
  37 + */
  38 + private String stationMark;
  39 +
  40 + // 站点路由出站序号
  41 + private Integer outStationNmber;
  42 +
  43 + // 站点路由到站距离
  44 + private Double distances;
  45 +
  46 + // 站点路由到站时间
  47 + private Double toTime;
  48 +
  49 + // 首班时间
  50 + private String firstTime;
  51 +
  52 + // 末班时间
  53 + private String endTime;
  54 +
  55 + // 站点路由方向
  56 + private Integer directions;
  57 +
  58 + // 版本号
  59 + private Integer versions;
  60 +
  61 + // 是否撤销
  62 + private Integer destroy;
  63 +
  64 + // 描述
  65 + private String descriptions;
  66 +
  67 + // 创建人
  68 + private Integer createBy;
  69 +
  70 + // 修改人
  71 + private Integer updateBy;
  72 +
  73 + // 创建日期
  74 + private Date createDate;
  75 +
  76 + // 修改日期
  77 + private Date updateDate;
  78 +
  79 + // 站点ID
  80 + private long station;
  81 +
  82 + // 线路ID
  83 + private int line;
  84 +
  85 + public Integer getId() {
  86 + return id;
  87 + }
  88 +
  89 + public void setId(Integer id) {
  90 + this.id = id;
  91 + }
  92 +
  93 + public Integer getStationRouteCode() {
  94 + return stationRouteCode;
  95 + }
  96 +
  97 + public void setStationRouteCode(Integer stationRouteCode) {
  98 + this.stationRouteCode = stationRouteCode;
  99 + }
  100 +
  101 + public String getStationCode() {
  102 + return stationCode;
  103 + }
  104 +
  105 + public void setStationCode(String stationCode) {
  106 + this.stationCode = stationCode;
  107 + }
  108 +
  109 + public String getStationName() {
  110 + return stationName;
  111 + }
  112 +
  113 + public void setStationName(String stationName) {
  114 + this.stationName = stationName;
  115 + }
  116 +
  117 + public String getLineCode() {
  118 + return lineCode;
  119 + }
  120 +
  121 + public void setLineCode(String lineCode) {
  122 + this.lineCode = lineCode;
  123 + }
  124 +
  125 + public String getStationMark() {
  126 + return stationMark;
  127 + }
  128 +
  129 + public void setStationMark(String stationMark) {
  130 + this.stationMark = stationMark;
  131 + }
  132 +
  133 + public Integer getOutStationNmber() {
  134 + return outStationNmber;
  135 + }
  136 +
  137 + public void setOutStationNmber(Integer outStationNmber) {
  138 + this.outStationNmber = outStationNmber;
  139 + }
  140 +
  141 + public Double getDistances() {
  142 + return distances;
  143 + }
  144 +
  145 + public void setDistances(Double distances) {
  146 + this.distances = distances;
  147 + }
  148 +
  149 + public Double getToTime() {
  150 + return toTime;
  151 + }
  152 +
  153 + public void setToTime(Double toTime) {
  154 + this.toTime = toTime;
  155 + }
  156 +
  157 + public String getFirstTime() {
  158 + return firstTime;
  159 + }
  160 +
  161 + public void setFirstTime(String firstTime) {
  162 + this.firstTime = firstTime;
  163 + }
  164 +
  165 + public String getEndTime() {
  166 + return endTime;
  167 + }
  168 +
  169 + public void setEndTime(String endTime) {
  170 + this.endTime = endTime;
  171 + }
  172 +
  173 + public Integer getDirections() {
  174 + return directions;
  175 + }
  176 +
  177 + public void setDirections(Integer directions) {
  178 + this.directions = directions;
  179 + }
  180 +
  181 + public Integer getVersions() {
  182 + return versions;
  183 + }
  184 +
  185 + public void setVersions(Integer versions) {
  186 + this.versions = versions;
  187 + }
  188 +
  189 + public Integer getDestroy() {
  190 + return destroy;
  191 + }
  192 +
  193 + public void setDestroy(Integer destroy) {
  194 + this.destroy = destroy;
  195 + }
  196 +
  197 + public String getDescriptions() {
  198 + return descriptions;
  199 + }
  200 +
  201 + public void setDescriptions(String descriptions) {
  202 + this.descriptions = descriptions;
  203 + }
  204 +
  205 + public Integer getCreateBy() {
  206 + return createBy;
  207 + }
  208 +
  209 + public void setCreateBy(Integer createBy) {
  210 + this.createBy = createBy;
  211 + }
  212 +
  213 + public Integer getUpdateBy() {
  214 + return updateBy;
  215 + }
  216 +
  217 + public void setUpdateBy(Integer updateBy) {
  218 + this.updateBy = updateBy;
  219 + }
  220 +
  221 + public Date getCreateDate() {
  222 + return createDate;
  223 + }
  224 +
  225 + public void setCreateDate(Date createDate) {
  226 + this.createDate = createDate;
  227 + }
  228 +
  229 + public Date getUpdateDate() {
  230 + return updateDate;
  231 + }
  232 +
  233 + public void setUpdateDate(Date updateDate) {
  234 + this.updateDate = updateDate;
  235 + }
  236 +
  237 + public long getStation() {
  238 + return station;
  239 + }
  240 +
  241 + public void setStation(long station) {
  242 + this.station = station;
  243 + }
  244 +
  245 + public int getLine() {
  246 + return line;
  247 + }
  248 +
  249 + public void setLine(int line) {
  250 + this.line = line;
  251 + }
  252 +}
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
1 1 package com.bsth.service.impl;
2 2  
3 3 import com.bsth.data.BasicData;
  4 +import com.bsth.email.SendEmailController;
  5 +import com.bsth.email.entity.EmailBean;
4 6 import com.bsth.entity.*;
5 7 import com.bsth.entity.realcontrol.ChildTaskPlan;
6 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
... ... @@ -109,6 +111,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{
109 111 @Autowired
110 112 private YgcBasicDataService ygcBasicDataService;
111 113  
  114 + // 发送邮件
  115 + @Autowired
  116 + private SendEmailController sendEmailController;
112 117  
113 118 // 运管处上传接口
114 119 private com.bsth.webService.trafficManage.up.org.tempuri.WebServiceSoap webServiceSoapUp;
... ... @@ -138,6 +143,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
138 143 private final String userNameUp = "user";
139 144 // 密码
140 145 private final String passwordUp = "user";
  146 + // 接收邮件人
  147 + private final String emailSendToAddress = "175912183@qq.com";
  148 + // 记录路单上线的成功、失败线路数
  149 + private Integer countSuccess,countFailure;
141 150  
142 151 private synchronized com.bsth.webService.trafficManage.up.org.tempuri.WebServiceSoap getWebServiceSoapUp(){
143 152 try {
... ... @@ -396,20 +405,27 @@ public class TrafficManageServiceImpl implements TrafficManageService{
396 405 */
397 406 private String uploadLD(String theDate){
398 407 String result = "failure";
  408 + countSuccess = 0 ;countFailure = 0;
399 409 Line line;
400 410 // 取昨天 的日期
401 411 String date = theDate == null ?sdfnyr.format(DateUtils.addDays(new Date(), -1)) : theDate;
402 412 StringBuffer sf = new StringBuffer();
403   - String str;
  413 + StringBuffer logSuccess = new StringBuffer("成功:");
  414 + StringBuffer logFailure = new StringBuffer("失败:");
  415 + HashMap logXlbmSuccessMap = new HashMap();
  416 + HashMap logXlbmFailureMap = new HashMap();
  417 + HashMap logXlbmMap = new HashMap();
  418 + Results results = null;
  419 + String str = "",xlbm;
404 420 try {
405 421 int counter = 0; // 计数器
406 422 int per = 10; // 每几条线路上传一次路单
407 423  
408 424 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
409 425 List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date);
410   - Map<String,Object> map = new HashMap<String,Object>();
  426 + Map<String,Object> map = new HashMap();
411 427 HashMap<String,String> paramMap;
412   - HashMap<String,String> otherMap = new HashMap<String, String>();
  428 + HashMap<String,String> otherMap = new HashMap();
413 429 for(Map<String,Object> schRealInfo:listGroup){
414 430 if(schRealInfo != null){
415 431 //根据车辆自编号查询车牌号
... ... @@ -425,9 +441,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
425 441 sf.append("<DLDS>");
426 442 }
427 443 counter ++;
  444 + xlbm = BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"");
  445 + // 保存一次路单的线路编码,用于发送邮箱
  446 + if(logXlbmMap.get(xlbm) == null){
  447 + logXlbmMap.put(xlbm,xlbm);
  448 + }
428 449 sf.append("<DLD>");
429 450 sf.append("<RQ>"+date+"</RQ>");
430   - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"")+"</XLBM>");
  451 + sf.append("<XLBM>"+xlbm+"</XLBM>");
431 452 sf.append("<LPBH>"+schRealInfo.get("lpName")+"</LPBH>");
432 453 sf.append("<CPH>"+car.getCarPlate()+"</CPH>");
433 454 sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>");
... ... @@ -485,39 +506,85 @@ public class TrafficManageServiceImpl implements TrafficManageService{
485 506 counter = 0;
486 507 sf.append("</DLDS>");
487 508 str = sf.toString().replace("'","");// 去掉'号
488   - Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
489   - if(results.isSuccess()){
490   - result = "success";
491   - }else{
492   - result = "failure";
493   - }
494   - logger.info("setLD:"+str);
495   - logger.info("setLD:"+result);
  509 + results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
  510 + // 记录日志
  511 + result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str);
496 512 }
497 513 }
498 514 // 每per条线路上传后剩下的数据再上传
499 515 if(counter > 0){
500 516 sf.append("</DLDS>");
501 517 str = sf.toString().replace("'","");// 去掉'号
502   - Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
503   - if(results.isSuccess()){
504   - result = "success";
505   - }else{
506   - result = "failure";
507   - }
508   - logger.info("setLD:"+str);
509   - logger.info("setLD:"+result);
  518 + results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
510 519 }
  520 + // 记录日志
  521 + result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str);
511 522 } catch (Exception e) {
512 523 logger.error("setLD:",e);
  524 + logFailure.append(e).append("<br/>");
  525 + for (StackTraceElement traceElement : e.getStackTrace()){
  526 + logFailure.append("\r\t").append(traceElement);
  527 + }
513 528 e.printStackTrace();
514 529 }finally{
515   -
  530 + //发送邮件
  531 + EmailBean mail = new EmailBean();
  532 + mail.setSubject("路单日志数据"+date);
  533 + mail.setContent(logSuccess+"<br/>成功数:"+countSuccess+"<br/>" +logFailure+"<br/>失败数:"+countFailure);
  534 + sendEmailController.sendMail(emailSendToAddress, mail);
516 535 }
517 536 return result;
518 537 }
519 538  
520 539 /**
  540 + * 记录日志
  541 + * @param results
  542 + * @param logXlbmMap
  543 + * @param logXlbmSuccessMap
  544 + * @param logXlbmFailureMap
  545 + * @param logSuccess
  546 + * @param logFailure
  547 + * @param str
  548 + */
  549 + private String logRecord(Results results,HashMap logXlbmMap,HashMap logXlbmSuccessMap,HashMap logXlbmFailureMap,StringBuffer logSuccess,
  550 + StringBuffer logFailure,String str){
  551 + String result = "failure";
  552 + // 记录日志
  553 + if(results != null){
  554 + if(results.isSuccess()){// 上传成功
  555 + // 把上线成功的线路编码放入 logXlbmSuccessMap,并记录logSuccess
  556 + countSuccess += fillMailXlbmMap(logXlbmMap,logXlbmSuccessMap,logSuccess);
  557 + result = "success";
  558 + }else{// 上传失败
  559 + // 把上线失败的线路编码放入 logXlbmFailureMap,并记录logFailure
  560 + countFailure += fillMailXlbmMap(logXlbmMap,logXlbmFailureMap,logFailure);
  561 + result = "failure";
  562 + }
  563 + logger.info("setLD:"+str);
  564 + logger.info("setLD:"+result);
  565 + results = null;
  566 + logXlbmMap = new HashMap();
  567 + }
  568 + return result;
  569 + }
  570 + /**
  571 + * 填充线路编码到相应的map
  572 + * @param fromMap
  573 + * @param toMap
  574 + */
  575 + private int fillMailXlbmMap(HashMap fromMap,HashMap toMap,StringBuffer logStr){
  576 + int tmpCount = 0;
  577 + for (Object key : fromMap.keySet()) {
  578 + if(toMap.get(key) == null){
  579 + toMap.put(key,fromMap.get(key));
  580 + logStr.append(key).append(",");
  581 + tmpCount ++;
  582 + }
  583 + }
  584 + fromMap = new HashMap();
  585 + return tmpCount;
  586 + }
  587 + /**
521 588 * 上传路单 xml来自文件
522 589 * @return 上传成功标识
523 590 */
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -1452,20 +1452,17 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1452 1452 String type="1";
1453 1453 if(gsbm.equals("26")){
1454 1454 Date date=new Date();
1455   - Calendar aCalendar = Calendar.getInstance();
1456   - aCalendar.setTime(date);
1457   - int day1 = aCalendar.get(Calendar.DAY_OF_YEAR);
1458 1455 try {
1459   - aCalendar.setTime(sdf.parse(rq));
  1456 + long day2=date.getTime();
  1457 + long day1=sdf.parse(rq).getTime();
  1458 + long days = (day2 - day1) / (24*3600*1000);
  1459 + if(days>3){
  1460 + type="2";
  1461 + }
1460 1462 } catch (ParseException e) {
1461 1463 // TODO Auto-generated catch block
1462 1464 e.printStackTrace();
1463 1465 }
1464   - int day2 = aCalendar.get(Calendar.DAY_OF_YEAR);
1465   - int days=day1-day2;
1466   - if(days>3){
1467   - type="2";
1468   - }
1469 1466 }
1470 1467 return type;
1471 1468 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1862,6 +1862,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1862 1862 public List<Map<String, Object>> accountPx(String line, String date,
1863 1863 String code, String xlName, String px) {
1864 1864 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px);
  1865 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1865 1866 if(!code.trim().equals("")){
1866 1867 code=BasicData.deviceId2NbbmMap.inverse().get(code);
1867 1868 }
... ... @@ -1894,7 +1895,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1894 1895 map = new HashMap<String, Object>();
1895 1896 map.put("num", i++);
1896 1897 map.put("xlName", xlName);
1897   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])==null?"":BasicData.deviceId2NbbmMap.get(obj[2]));
  1898 + if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
  1899 + List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
  1900 + try {
  1901 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(date + " 00:00:00"));
  1902 + } catch (ParseException e) {
  1903 + // TODO Auto-generated catch block
  1904 + e.printStackTrace();
  1905 + }
  1906 + if(carDeviceList.size()>0){
  1907 + map.put("clZbh", carDeviceList.get(0).getClZbh());
  1908 +
  1909 + }else{
  1910 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1911 + }
  1912 + }else{
  1913 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1914 +
  1915 + }
1898 1916 map.put("company",fgs);
1899 1917 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
1900 1918 map.put("requestTime", obj[1]);
... ... @@ -1922,6 +1940,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1922 1940 Line l=lineList.get(0);
1923 1941 fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
1924 1942 }
  1943 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1925 1944 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
1926 1945 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1927 1946 Map<String, Object> map;
... ... @@ -1931,7 +1950,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1931 1950 map = new HashMap<String, Object>();
1932 1951 map.put("num", i++);
1933 1952 map.put("xlName", xlName);
1934   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1953 + if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
  1954 + List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
  1955 + try {
  1956 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(date + " 00:00:00"));
  1957 + } catch (ParseException e) {
  1958 + // TODO Auto-generated catch block
  1959 + e.printStackTrace();
  1960 + }
  1961 + if(carDeviceList.size()>0){
  1962 + map.put("clZbh", carDeviceList.get(0).getClZbh());
  1963 +
  1964 + }else{
  1965 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1966 + }
  1967 + }else{
  1968 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1969 +
  1970 + }
1935 1971 map.put("company",fgs);
1936 1972 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
1937 1973 map.put("requestTime", obj[1]);
... ... @@ -3090,7 +3126,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3090 3126 if(cts != null && cts.size() > 0){
3091 3127 listS.add(scheduleRealInfo);
3092 3128 }else{
3093   - if(scheduleRealInfo.getZdsjActual()!=null){
  3129 + if(scheduleRealInfo.getZdsjActual()!=null && scheduleRealInfo.getFcsjActual()!=null){
3094 3130 listS.add(scheduleRealInfo);
3095 3131 }
3096 3132 }
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -1248,6 +1248,21 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1248 1248 }
1249 1249 }
1250 1250 }
  1251 +
  1252 + if(!isInOut(t)){
  1253 + Set<ChildTaskPlan> childTaskPlans = t.getcTasks();
  1254 + if(!childTaskPlans.isEmpty()){
  1255 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1256 + while (it.hasNext()) {
  1257 + ChildTaskPlan childTaskPlan = it.next();
  1258 + if(childTaskPlan.getType2().equals("1")&&childTaskPlan.getMileageType().equals("empty")){
  1259 + if (!childTaskPlan.isDestroy()) {
  1260 + kfks=Arith.add(kfks,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
  1261 + }
  1262 + }
  1263 + }
  1264 + }
  1265 + }
1251 1266 }
1252 1267 }
1253 1268 return kfks;
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -2776,7 +2776,7 @@ public class ReportServiceImpl implements ReportService{
2776 2776 double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
2777 2777 double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
2778 2778 double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
2779   - double zrwjcclcqt=culateService.culateZrwJccLc(list, "其他");
  2779 + double zrwjcclcqt=Arith.add(culateService.culateZrwJccLc(list, "其他"),culateService.culateZrwJccLc(list, ""));
2780 2780 map.put("jhwjcclc_z", Arith.add(jhwjcclc,zrwjcclcqt));
2781 2781 map.put("zrwjcclc", zrwjcclc);
2782 2782 map.put("zrwjcclc1", zrwjcclc1);
... ... @@ -2868,7 +2868,7 @@ public class ReportServiceImpl implements ReportService{
2868 2868 List<Map<String, Object>> listGroupBy =null;
2869 2869 String sql="";
2870 2870 if(zt.equals("zbh")){
2871   - sql+="select r.xl_bm,r.schedule_date_str,r.cl_zbh"
  2871 + sql+="select r.xl_bm,r.cl_zbh"
2872 2872 + " from bsth_c_s_sp_info_real r where"
2873 2873 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
2874 2874 if(line.equals("")){
... ... @@ -2877,19 +2877,18 @@ public class ReportServiceImpl implements ReportService{
2877 2877 }else{
2878 2878 sql += " and r.xl_bm = '"+line+"'";
2879 2879 }
2880   - sql += " group by r.xl_bm,r.cl_zbh,r.schedule_date_str";
  2880 + sql += " group by r.xl_bm,r.cl_zbh";
2881 2881 listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() {
2882 2882 @Override
2883 2883 public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
2884 2884 Map<String, Object> map=new HashMap<String,Object>();
2885 2885 map.put("line",arg0.getString("xl_bm"));
2886   - map.put("date", arg0.getString("schedule_date_str"));
2887 2886 map.put("nbbm", arg0.getString("cl_zbh"));
2888 2887 return map;
2889 2888 }
2890 2889 });
2891 2890 }else{
2892   - sql+="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
  2891 + sql+="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
2893 2892 + " from bsth_c_s_sp_info_real r where"
2894 2893 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
2895 2894 if(line.equals("")){
... ... @@ -2898,13 +2897,12 @@ public class ReportServiceImpl implements ReportService{
2898 2897 }else{
2899 2898 sql += " and r.xl_bm = '"+line+"'";
2900 2899 }
2901   - sql += " group by r.xl_bm,r.cl_zbh,r.schedule_date_str,r.j_gh,r.s_gh";
  2900 + sql += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh";
2902 2901 listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() {
2903 2902 @Override
2904 2903 public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
2905 2904 Map<String, Object> map=new HashMap<String,Object>();
2906 2905 map.put("line",arg0.getString("xl_bm"));
2907   - map.put("date", arg0.getString("schedule_date_str"));
2908 2906 map.put("nbbm", arg0.getString("cl_zbh"));
2909 2907 map.put("jGh", arg0.getString("j_gh"));
2910 2908 map.put("sGh", arg0.getString("s_gh"));
... ... @@ -2919,7 +2917,6 @@ public class ReportServiceImpl implements ReportService{
2919 2917 for (int i = 0; i < listGroupBy.size(); i++) {
2920 2918 Map<String, Object> m=listGroupBy.get(i);
2921 2919 String xl_bm=m.get("line")==null?"":m.get("line").toString();
2922   - String dateStr=m.get("date")==null?"":m.get("date").toString();
2923 2920 String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
2924 2921 String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
2925 2922 String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
... ... @@ -2927,12 +2924,12 @@ public class ReportServiceImpl implements ReportService{
2927 2924 for (int j = 0; j < list.size(); j++) {
2928 2925 ScheduleRealInfo s=list.get(j);
2929 2926 if(zt.equals("zbh")){
2930   - if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())){
  2927 + if(xl_bm.equals(s.getXlBm())
  2928 + && nbbm.equals(s.getClZbh())){
2931 2929 lists.add(s);
2932 2930 }
2933 2931 }else{
2934 2932 if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())
2935   - && dateStr.equals(s.getScheduleDateStr())
2936 2933 && jGh.equals(s.getjGh()) && sGh.equals(s.getsGh())){
2937 2934 lists.add(s);
2938 2935 }
... ... @@ -2951,7 +2948,7 @@ public class ReportServiceImpl implements ReportService{
2951 2948 if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())){
2952 2949 yhl=Arith.add(yhl, y.getYh());
2953 2950 jzl=Arith.add(jzl, y.getJzl());
2954   - hyl=Arith.add(hyl, y.getYh());
  2951 + hyl=Arith.add(hyl, y.getSh());
2955 2952 }
2956 2953  
2957 2954 }
... ... @@ -2985,11 +2982,10 @@ public class ReportServiceImpl implements ReportService{
2985 2982 for (int j = 0; j < ylbList.size(); j++) {
2986 2983 Ylb y=ylbList.get(j);
2987 2984 if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())
2988   - &&dateStr.equals(sdf.format(y.getRq()))
2989   - &&jGh.equals(y.getName())){
  2985 + &&jGh.equals(y.getJsy())){
2990 2986 yhl=Arith.add(yhl, y.getYh());
2991 2987 jzl=Arith.add(jzl, y.getJzl());
2992   - hyl=Arith.add(hyl, y.getYh());
  2988 + hyl=Arith.add(hyl, y.getSh());
2993 2989 zlc=Arith.add(zlc, y.getZlc());
2994 2990 }
2995 2991  
... ... @@ -2998,8 +2994,7 @@ public class ReportServiceImpl implements ReportService{
2998 2994 for (int j = 0; j < dlbList.size(); j++) {
2999 2995 Dlb d=dlbList.get(j);
3000 2996 if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())
3001   - &&dateStr.equals(sdf.format(d.getRq()))
3002   - &&jGh.equals(d.getName())){
  2997 + &&jGh.equals(d.getJsy())){
3003 2998 dhl=Arith.add(dhl, d.getHd());
3004 2999 cdl=Arith.add(cdl, d.getCdl());
3005 3000 zlc=Arith.add(zlc, d.getZlc());
... ... @@ -3088,7 +3083,9 @@ public class ReportServiceImpl implements ReportService{
3088 3083 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
3089 3084 Ylb y = new Ylb();
3090 3085 y.setRq(arg0.getDate("rq"));
  3086 + y.setJsy(arg0.getString("jsy"));
3091 3087 y.setXlbm(arg0.getString("xlbm"));
  3088 + y.setZlc(arg0.getDouble("zlc"));
3092 3089 y.setNbbm(arg0.getString("nbbm"));
3093 3090 y.setJzl(arg0.getDouble("jzl"));
3094 3091 y.setYh(arg0.getDouble("yh"));
... ... @@ -3106,7 +3103,9 @@ public class ReportServiceImpl implements ReportService{
3106 3103 Dlb y = new Dlb();
3107 3104 y.setRq(arg0.getDate("rq"));
3108 3105 y.setXlbm(arg0.getString("xlbm"));
  3106 + y.setJsy(arg0.getString("jsy"));
3109 3107 y.setNbbm(arg0.getString("nbbm"));
  3108 + y.setZlc(arg0.getDouble("zlc"));
3110 3109 y.setCdl(arg0.getDouble("cdl"));
3111 3110 y.setHd(arg0.getDouble("hd"));
3112 3111 y.setSh(arg0.getDouble("sh"));
... ...
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
... ... @@ -200,7 +200,7 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
200 200 }
201 201 r.setFcsjT(fscjT);
202 202 Sheet sheet=new Sheet();
203   - if (s.getFcsjActual() != null) {
  203 + if (s.getFcsjActual() != null && !s.isDestroy()) {
204 204 Long fcsjAcual = 0L;
205 205 try {
206 206 fcsjAcual = sdf.parse(r.getRealExecDate() + " " + r.getFcsjActual()).getTime();
... ... @@ -558,7 +558,7 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
558 558 String endDate=map.get("endDate").toString();
559 559 String sql="select * from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'";
560 560 if(line.trim().equals("")){
561   - sql +=" and gs like '%"+gs+"%' and fgs like '%"+fgs+"%'";
  561 + sql +=" and gs = '"+gs+"' and fgs = '"+fgs+"'";
562 562 }else{
563 563 sql +=" and line ='"+line+"'";
564 564 }
... ... @@ -581,9 +581,9 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
581 581 }
582 582 });
583 583  
584   - String sqlByLine="select line from bsth_c_sheet where date='"+date+"'";
  584 + String sqlByLine="select line from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'";
585 585 if(line.trim().equals("")){
586   - sqlByLine +=" and gs like '%"+gs+"%' and fgs like '%"+fgs+"%'";
  586 + sqlByLine +=" and gs = '"+gs+"' and fgs like '"+fgs+"'";
587 587 }else{
588 588 sqlByLine +=" and line ='"+line+"'";
589 589 }
... ...
src/main/resources/mailbox.properties 0 → 100644
  1 +username=pdda_zhmm2014@163.COM
  2 +password=ZHMM2014_PDDA
  3 +address=116.236.208.198:9090
  4 +qq.com=http://mail.qq.com
  5 +gmail.com=http://mail.google.com
  6 +sina.com=http://mail.sina.com.cn
  7 +163.com=http://mail.163.com
  8 +126.com=http://mail.126.com
  9 +yeah.net=http://www.yeah.net/
  10 +sohu.com=http://mail.sohu.com/
  11 +tom.com=http://mail.tom.com/
  12 +sogou.com=http://mail.sogou.com/
  13 +139.com=http://mail.10086.cn/
  14 +hotmail.com=http://www.hotmail.com
  15 +live.com=http://login.live.com/
  16 +live.cn=http://login.live.cn/
  17 +live.com.cn=http://login.live.com.cn
  18 +189.com=http://webmail16.189.cn/webmail/
  19 +yahoo.com.cn=http://mail.cn.yahoo.com/
  20 +yahoo.cn=http://mail.cn.yahoo.com/
  21 +eyou.com=http://www.eyou.com/
  22 +21cn.com=http://mail.21cn.com/
  23 +188.com=http://www.188.com/
  24 +foxmail.coom=http\://www.foxmail.com
0 25 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/css/mian.css
... ... @@ -132,6 +132,7 @@ a.clock_enable_version:focus{
132 132 ._route_info_wrap{
133 133 height: calc(100% - 90px);
134 134 padding-top: 10px;
  135 + background: #fff;
135 136 }
136 137  
137 138 ._route_info_wrap .uk-tab>li>a{
... ... @@ -681,6 +682,7 @@ ul.context-menu-list.station-route-ct-menu.context-menu-root {
681 682  
682 683 .s_future_version_info ._route_info_wrap{
683 684 height: calc(100% - 105px);
  685 + background: #fff;
684 686 }
685 687  
686 688 a.b_l_s_link{
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/f_station_route.html
... ... @@ -63,7 +63,7 @@
63 63 半径:{{radius}}
64 64 {{/if}}
65 65 </li>
66   - <li>站序:{{index + 1}}</li>
  66 + <li>站序:{{index}}</li>
67 67 <li>路由序号:{{stationRouteCode}}</li>
68 68 </ul>
69 69 </script>
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/versions.html
... ... @@ -35,6 +35,8 @@
35 35 <div class="uk-form-controls">
36 36 <select class="uk-select" name="remark">
37 37 <option>线路改道</option>
  38 + <option>增加中途站</option>
  39 + <option>站名更变</option>
38 40 <option>其他</option>
39 41 </select>
40 42 </div>
... ...
src/main/resources/static/pages/base/geo_data_edit/js/ct_common.js
1   -var gb_common = (function () {
2   -
3   - var flatpickrDateTimeConfig = {
4   - enableTime: true,
5   - time_24hr: true,
6   - "locale": "zh",
7   - onOpen: function () {
8   - $(this.calendarContainer).addClass('showTimeInput');
9   - }
10   - };
11   -
12   - var groupBy = function (list, field) {
13   - var rs = {},
14   - key;
15   - $.each(list, function () {
16   - key = this[field];
17   - if (!rs[key])
18   - rs[key] = [];
19   -
20   - rs[key].push(this);
21   - });
22   -
23   - return rs;
24   - };
25   -
26   - var compileTempByDom = function (dom, opts) {
27   - var tps = {},
28   - id;
29   - $('script[type="text/html"]', dom).each(function () {
30   - id = $(this).attr('id');
31   - if (id)
32   - tps[id] = template.compile($(this).html(), opts);
33   - });
34   - return tps;
35   - };
36   -
37   - var $get = function (url, data, successFun) {
38   - $.ajax({
39   - url: url,
40   - data: data,
41   - complete: function (xhr, ts) {
42   - ajaxComplete(xhr, ts, successFun);
43   - }
44   - });
45   - };
46   -
47   - var $post = function (url, data, successFun) {
48   - $.ajax({
49   - url: url,
50   - method: 'POST',
51   - data: data,
52   - complete: function (xhr, ts) {
53   - ajaxComplete(xhr, ts, successFun);
54   - }
55   - });
56   - };
57   -
58   - var $post_arr = function (url, data, successFun) {
59   - $.ajax({
60   - url: url,
61   - method: 'POST',
62   - traditional: true,
63   - data: data,
64   - complete: function (xhr, ts) {
65   - ajaxComplete(xhr, ts, successFun);
66   - }
67   - });
68   - };
69   -
70   - var $del = function (url, successFun) {
71   - $post(url, {'_method': 'delete'}, function (rs) {
72   - successFun && successFun(rs);
73   - });
74   - };
75   -
76   - function hide_wait_modal() {
77   - $('.main_left_panel_m_layer').hide();
78   - $loadPanel.hide();
79   - //gb_ct_map.resetMapStatus();
80   - }
81   -
82   - var errorHead = '<span style="color:red;">异常:</span>';
83   -
84   - function successHandle(json, handle) {
85   - var status = json.status;
86   - if (status == 407) {
87   - location.href = '/login.html';
88   - return;
89   - }
90   -
91   - if (!status) {
92   - handle && handle(json);
93   - return;
94   - }
95   -
96   - if (status == 'ERROR'){
97   - UIkit.modal.alert(errorHead + (json.msg ? json.msg : '未知异常'), {labels: {Ok: '确定'}});
98   - //关闭wait窗口
99   - hide_wait_modal();
100   - }
101   - else
102   - handle && handle(json);
103   - }
104   -
105   - function ajaxComplete(xhr, ts, succ) {
106   - if (ts == 'success') {
107   - successHandle(JSON.parse(xhr.responseText), succ);
108   - } else if (ts == 'error') {
109   - UIkit.modal.alert(errorHead + xhr.responseText, {labels: {Ok: '确定'}});
110   - //关闭wait窗口
111   - hide_wait_modal();
112   - }
113   - }
114   -
115   - var get_vals = function (json) {
116   - var array = [];
117   - for (var key in json) {
118   - array.push(json[key]);
119   - }
120   -
121   - return array;
122   - };
123   -
124   - var get_keys = function (json) {
125   - var array = [];
126   - for (var key in json) {
127   - array.push(key);
128   - }
129   - return array;
130   - };
131   -
132   - var accAdd = function (a, b) {
133   - var c, d, e;
134   - try {
135   - c = a.toString().split(".")[1].length;
136   - } catch (f) {
137   - c = 0;
138   - }
139   - try {
140   - d = b.toString().split(".")[1].length;
141   - } catch (f) {
142   - d = 0;
143   - }
144   - return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e;
145   - };
146   -
147   - function accDiv(arg1,arg2){
148   - var t1=0,t2=0,r1,r2;
149   - try{t1=arg1.toString().split(".")[1].length}catch(e){}
150   - try{t2=arg2.toString().split(".")[1].length}catch(e){}
151   - with(Math){
152   - r1=Number(arg1.toString().replace(".",""))
153   - r2=Number(arg2.toString().replace(".",""))
154   - return (r1/r2)*pow(10,t2-t1);
155   - }
156   - }
157   -
158   - function mul(a, b) {
159   - var c = 0,
160   - d = a.toString(),
161   - e = b.toString();
162   - try {
163   - c += d.split(".")[1].length;
164   - } catch (f) {
165   - }
166   - try {
167   - c += e.split(".")[1].length;
168   - } catch (f) {
169   - }
170   - return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
171   - }
172   -
173   - var numSubtr = function (a, b) {
174   - var c, d, e;
175   - try {
176   - c = a.toString().split(".")[1].length;
177   - } catch (f) {
178   - c = 0;
179   - }
180   - try {
181   - d = b.toString().split(".")[1].length;
182   - } catch (f) {
183   - d = 0;
184   - }
185   - return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e;
186   - };
187   -
188   - var trim = function (str, is_global) {
189   - var result;
190   - result = str.replace(/(^\s+)|(\s+$)/g, "");
191   - if (is_global.toLowerCase() == "g") {
192   - result = result.replace(/\s/g, "");
193   - }
194   - return result;
195   - };
196   -
197   - var inverse = function (map) {
198   - var rs = {};
199   - for(var k in map){
200   - rs[map[k]] = k;
201   - }
202   -
203   - return rs;
204   - };
205   -
206   - var next_elem = function (clazz, e) {
207   - var ne = e.next();
208   - if(ne.length==0)
209   - return [];
210   - else if(ne.hasClass(clazz))
211   - return ne;
212   - else
213   - return next_elem(clazz, ne);
214   - };
215   -
216   - var getDisabledVal = function (f) {
217   - var rs = {};
218   - $('input,select', f).each(function () {
219   - if($(this).attr('disabled')){
220   - rs[$(this).attr('name')]=$(this).val();
221   - }
222   - });
223   - return rs;
224   - };
225   -
226   - return {
227   - groupBy: groupBy,
228   - compileTempByDom: compileTempByDom,
229   - $get: $get,
230   - $post: $post,
231   - $post_arr: $post_arr,
232   - $del: $del,
233   - get_vals: get_vals,
234   - get_keys: get_keys,
235   - accAdd: accAdd,
236   - numSubtr: numSubtr,
237   - trim: trim,
238   - flatpickrDateTimeConfig: flatpickrDateTimeConfig,
239   - inverse: inverse,
240   - accDiv: accDiv,
241   - mul: mul,
242   - next_elem: next_elem,
243   - getDisabledVal: getDisabledVal,
244   - };
245   -})();
  1 +var gb_common = (function () {
  2 +
  3 + var flatpickrDateTimeConfig = {
  4 + enableTime: true,
  5 + time_24hr: true,
  6 + "locale": "zh",
  7 + onOpen: function () {
  8 + $(this.calendarContainer).addClass('showTimeInput');
  9 + }
  10 + };
  11 +
  12 + var groupBy = function (list, field) {
  13 + var rs = {},
  14 + key;
  15 + $.each(list, function () {
  16 + key = this[field];
  17 + if (!rs[key])
  18 + rs[key] = [];
  19 +
  20 + rs[key].push(this);
  21 + });
  22 +
  23 + return rs;
  24 + };
  25 +
  26 + var compileTempByDom = function (dom, opts) {
  27 + var tps = {},
  28 + id;
  29 + $('script[type="text/html"]', dom).each(function () {
  30 + id = $(this).attr('id');
  31 + if (id)
  32 + tps[id] = template.compile($(this).html(), opts);
  33 + });
  34 + return tps;
  35 + };
  36 +
  37 + var $get = function (url, data, successFun) {
  38 + $.ajax({
  39 + url: url,
  40 + data: data,
  41 + complete: function (xhr, ts) {
  42 + ajaxComplete(xhr, ts, successFun);
  43 + }
  44 + });
  45 + };
  46 +
  47 + var $post = function (url, data, successFun) {
  48 + $.ajax({
  49 + url: url,
  50 + method: 'POST',
  51 + data: data,
  52 + complete: function (xhr, ts) {
  53 + ajaxComplete(xhr, ts, successFun);
  54 + }
  55 + });
  56 + };
  57 +
  58 + var $post_arr = function (url, data, successFun) {
  59 + $.ajax({
  60 + url: url,
  61 + method: 'POST',
  62 + traditional: true,
  63 + data: data,
  64 + complete: function (xhr, ts) {
  65 + ajaxComplete(xhr, ts, successFun);
  66 + }
  67 + });
  68 + };
  69 +
  70 + var $del = function (url, successFun) {
  71 + $post(url, {'_method': 'delete'}, function (rs) {
  72 + successFun && successFun(rs);
  73 + });
  74 + };
  75 +
  76 + function hide_wait_modal() {
  77 + $('.main_left_panel_m_layer').hide();
  78 + $loadPanel.hide();
  79 + //gb_ct_map.resetMapStatus();
  80 + }
  81 +
  82 + var errorHead = '<span style="color:red;">异常:</span>';
  83 +
  84 + function successHandle(json, handle) {
  85 + var status = json.status;
  86 + if (status == 407) {
  87 + location.href = '/login.html';
  88 + return;
  89 + }
  90 +
  91 + if (!status) {
  92 + handle && handle(json);
  93 + return;
  94 + }
  95 +
  96 + if (status == 'ERROR'){
  97 + UIkit.modal.alert(errorHead + (json.msg ? json.msg : '未知异常'), {labels: {Ok: '确定'}});
  98 + //关闭wait窗口
  99 + hide_wait_modal();
  100 + }
  101 + else
  102 + handle && handle(json);
  103 + }
  104 +
  105 + function ajaxComplete(xhr, ts, succ) {
  106 + if (ts == 'success') {
  107 + successHandle(JSON.parse(xhr.responseText), succ);
  108 + } else if (ts == 'error') {
  109 + UIkit.modal.alert(errorHead + xhr.responseText, {labels: {Ok: '确定'}});
  110 + //关闭wait窗口
  111 + hide_wait_modal();
  112 + }
  113 + }
  114 +
  115 + var get_vals = function (json) {
  116 + var array = [];
  117 + for (var key in json) {
  118 + array.push(json[key]);
  119 + }
  120 +
  121 + return array;
  122 + };
  123 +
  124 + var get_keys = function (json) {
  125 + var array = [];
  126 + for (var key in json) {
  127 + array.push(key);
  128 + }
  129 + return array;
  130 + };
  131 +
  132 + var accAdd = function (a, b) {
  133 + var c, d, e;
  134 + try {
  135 + c = a.toString().split(".")[1].length;
  136 + } catch (f) {
  137 + c = 0;
  138 + }
  139 + try {
  140 + d = b.toString().split(".")[1].length;
  141 + } catch (f) {
  142 + d = 0;
  143 + }
  144 + return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e;
  145 + };
  146 +
  147 + function accDiv(arg1,arg2){
  148 + var t1=0,t2=0,r1,r2;
  149 + try{t1=arg1.toString().split(".")[1].length}catch(e){}
  150 + try{t2=arg2.toString().split(".")[1].length}catch(e){}
  151 + with(Math){
  152 + r1=Number(arg1.toString().replace(".",""))
  153 + r2=Number(arg2.toString().replace(".",""))
  154 + return (r1/r2)*pow(10,t2-t1);
  155 + }
  156 + }
  157 +
  158 + function mul(a, b) {
  159 + var c = 0,
  160 + d = a.toString(),
  161 + e = b.toString();
  162 + try {
  163 + c += d.split(".")[1].length;
  164 + } catch (f) {
  165 + }
  166 + try {
  167 + c += e.split(".")[1].length;
  168 + } catch (f) {
  169 + }
  170 + return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
  171 + }
  172 +
  173 + var numSubtr = function (a, b) {
  174 + var c, d, e;
  175 + try {
  176 + c = a.toString().split(".")[1].length;
  177 + } catch (f) {
  178 + c = 0;
  179 + }
  180 + try {
  181 + d = b.toString().split(".")[1].length;
  182 + } catch (f) {
  183 + d = 0;
  184 + }
  185 + return e = Math.pow(10, Math.max(c, d)), (a * e - b * e) / e;
  186 + };
  187 +
  188 + var trim = function (str, is_global) {
  189 + var result;
  190 + result = str.replace(/(^\s+)|(\s+$)/g, "");
  191 + if (is_global.toLowerCase() == "g") {
  192 + result = result.replace(/\s/g, "");
  193 + }
  194 + return result;
  195 + };
  196 +
  197 + var inverse = function (map) {
  198 + var rs = {};
  199 + for(var k in map){
  200 + rs[map[k]] = k;
  201 + }
  202 +
  203 + return rs;
  204 + };
  205 +
  206 + var next_elem = function (clazz, e) {
  207 + var ne = e.next();
  208 + if(ne.length==0)
  209 + return [];
  210 + else if(ne.hasClass(clazz))
  211 + return ne;
  212 + else
  213 + return next_elem(clazz, ne);
  214 + };
  215 +
  216 + var getDisabledVal = function (f) {
  217 + var rs = {};
  218 + $('input,select', f).each(function () {
  219 + if($(this).attr('disabled')){
  220 + rs[$(this).attr('name')]=$(this).val();
  221 + }
  222 + });
  223 + return rs;
  224 + };
  225 +
  226 + return {
  227 + groupBy: groupBy,
  228 + compileTempByDom: compileTempByDom,
  229 + $get: $get,
  230 + $post: $post,
  231 + $post_arr: $post_arr,
  232 + $del: $del,
  233 + get_vals: get_vals,
  234 + get_keys: get_keys,
  235 + accAdd: accAdd,
  236 + numSubtr: numSubtr,
  237 + trim: trim,
  238 + flatpickrDateTimeConfig: flatpickrDateTimeConfig,
  239 + inverse: inverse,
  240 + accDiv: accDiv,
  241 + mul: mul,
  242 + next_elem: next_elem,
  243 + getDisabledVal: getDisabledVal,
  244 + };
  245 +})();
... ...
src/main/resources/static/pages/base/geo_data_edit/js/map.js
... ... @@ -290,6 +290,8 @@ var gb_ct_map = function () {
290 290 if (marker) {
291 291 openStationInfoWin(marker);
292 292 }
  293 + //居中
  294 + map.setCenter(marker.point);
293 295 };
294 296  
295 297 var getStationMarker = function (code, updown) {
... ...
src/main/resources/static/pages/base/geo_data_edit/js/server_timer.js
1   -/**
2   - * 服务器时间
3   - * @type {{}}
4   - */
5   -var gb_second_timer = (function () {
6   -
7   - var now;
8   - //var _this;
9   - var secondTimer;
10   - //var contextFlag;
11   -
12   - var setVersionEnableTimeFun;
13   -
14   - var init = function () {
15   - //_this = $('.clock_enable_version .t_t_str')[0];
16   - getServerTime(function (time) {
17   - now = time;
18   - /*$('div.north').bind("contextmenu", function () {
19   - contextFlag = true;
20   - });*/
21   - //setTime();
22   -
23   - secondTimer = window.setInterval(function () {
24   - if (0 == now.getSeconds()) {
25   - minuteTimer();
26   - //contextFlag = false;
27   - }
28   -
29   - now = new Date(now.getTime() + 1e3);
30   - //setTime();
31   - setVersionEnableTimeFun && setVersionEnableTimeFun(now);
32   - }, 1e3);
33   - });
34   - };
35   -
36   - var getServerTime = function (callback) {
37   - function oncallback(jqXHR) {
38   - var time = jqXHR && jqXHR.getResponseHeader("Date");
39   - if (time)
40   - callback(new Date(time))
41   - }
42   -
43   - if ("function" == typeof callback)
44   - $.ajax({
45   - url: "/real_control_v2/assets/imgs/time.gif",
46   - type: "HEAD"
47   - }).done(function (data, textStatus, jqXHR) {
48   - oncallback(jqXHR)
49   - }).fail(function (jqXHR, textStatus, errorThrown) {
50   - oncallback(jqXHR)
51   - })
52   - };
53   -
54   -/* var timeFormat = function (str) {
55   - return ("0" + str).slice(-2)
56   - };*/
57   -
58   - /* var setTime = function () {
59   - _this.innerHTML = timeFormat(now.getHours()) + ':' + timeFormat(now.getMinutes()) + '.' + timeFormat(now.getSeconds());
60   - };*/
61   -
62   - var minuteTimer = function () {
63   - getServerTime(function (time) {
64   - now = time;
65   - //setTime()
66   - })
67   - };
68   -
69   - window.setTimeout(init, 1000);
70   -
71   - return {
72   - now: function () {
73   - return now;
74   - },
75   - initSetVersionEnableTimeFun: function (fun) {
76   - setVersionEnableTimeFun = fun;
77   - },
78   - removeVersionEnableTimeFun: function () {
79   - setVersionEnableTimeFun = null;
80   - }
81   - }
  1 +/**
  2 + * 服务器时间
  3 + * @type {{}}
  4 + */
  5 +var gb_second_timer = (function () {
  6 +
  7 + var now;
  8 + //var _this;
  9 + var secondTimer;
  10 + //var contextFlag;
  11 +
  12 + var setVersionEnableTimeFun;
  13 +
  14 + var init = function () {
  15 + //_this = $('.clock_enable_version .t_t_str')[0];
  16 + getServerTime(function (time) {
  17 + now = time;
  18 + /*$('div.north').bind("contextmenu", function () {
  19 + contextFlag = true;
  20 + });*/
  21 + //setTime();
  22 +
  23 + secondTimer = window.setInterval(function () {
  24 + if (0 == now.getSeconds()) {
  25 + minuteTimer();
  26 + //contextFlag = false;
  27 + }
  28 +
  29 + now = new Date(now.getTime() + 1e3);
  30 + //setTime();
  31 + setVersionEnableTimeFun && setVersionEnableTimeFun(now);
  32 + }, 1e3);
  33 + });
  34 + };
  35 +
  36 + var getServerTime = function (callback) {
  37 + function oncallback(jqXHR) {
  38 + var time = jqXHR && jqXHR.getResponseHeader("Date");
  39 + if (time)
  40 + callback(new Date(time))
  41 + }
  42 +
  43 + if ("function" == typeof callback)
  44 + $.ajax({
  45 + url: "/real_control_v2/assets/imgs/time.gif",
  46 + type: "HEAD"
  47 + }).done(function (data, textStatus, jqXHR) {
  48 + oncallback(jqXHR)
  49 + }).fail(function (jqXHR, textStatus, errorThrown) {
  50 + oncallback(jqXHR)
  51 + })
  52 + };
  53 +
  54 +/* var timeFormat = function (str) {
  55 + return ("0" + str).slice(-2)
  56 + };*/
  57 +
  58 + /* var setTime = function () {
  59 + _this.innerHTML = timeFormat(now.getHours()) + ':' + timeFormat(now.getMinutes()) + '.' + timeFormat(now.getSeconds());
  60 + };*/
  61 +
  62 + var minuteTimer = function () {
  63 + getServerTime(function (time) {
  64 + now = time;
  65 + //setTime()
  66 + })
  67 + };
  68 +
  69 + window.setTimeout(init, 1000);
  70 +
  71 + return {
  72 + now: function () {
  73 + return now;
  74 + },
  75 + initSetVersionEnableTimeFun: function (fun) {
  76 + setVersionEnableTimeFun = fun;
  77 + },
  78 + removeVersionEnableTimeFun: function () {
  79 + setVersionEnableTimeFun = null;
  80 + }
  81 + }
82 82 })();
83 83 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/js/station_route.js
... ... @@ -37,13 +37,24 @@ var gb_station_route = function () {
37 37 //当前编辑的线路版本
38 38 storage.setItem("geo_data_edit_line_version" , rs['editVersion']);
39 39  
40   - //序号
41   - for(var i=0,len=rs.list.length;i<len;i++){
42   - rs.list[i].index = i + 1;
43   - }
44 40 var data = {0:[],1:[]};
45 41 if(rs.list.length > 0)
46 42 data = gb_common.groupBy(rs.list, 'directions');
  43 +
  44 + //序号
  45 + if(data[0]){
  46 + for(var i=0,len=data[0].length;i<len;i++){
  47 + data[0][i].index = i + 1;
  48 + }
  49 + }
  50 + if(data[1]){
  51 + for(var i=0,len=data[1].length;i<len;i++){
  52 + data[1][i].index = i + 1;
  53 + }
  54 + }
  55 + /*for(var i=0,len=rs.list.length;i<len;i++){
  56 + rs.list[i].index = i + 1;
  57 + }*/
47 58 ep.emit('data', data);
48 59 });
49 60  
... ...
src/main/resources/static/pages/base/geo_data_edit/js/submit.js
... ... @@ -190,6 +190,8 @@ var gb_data_submit = function () {
190 190 */
191 191 var destroyStation = function (station) {
192 192  
  193 + station.bdCoords=null;
  194 + delete station.bdCoords;
193 195 UIkit.modal.confirm('确定撤销站点【'+station.stationName+'】?').then(function() {
194 196 show_run_text('正在撤销...');
195 197  
... ...
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -247,15 +247,15 @@
247 247 var total_yh = 0,total_bc = 0;
248 248  
249 249 $.each(result, function(i, obj) {
250   - total_zgl +=Number(obj.zlc);
251   - total_ks +=Number(obj.jzl1);
252   - total_yh += Number(obj.yh);
  250 + total_zgl +=Number(obj.zlc*10000);
  251 + total_ks +=Number(obj.jzl1*10000);
  252 + total_yh += Number(obj.yh*10000);
253 253 total_bc += Number(obj.bc);
254 254  
255 255 });
256   - $("#total_zgl").text(total_zgl.toFixed(2));
257   - $("#total_ks").text(total_ks.toFixed(2));
258   - $("#total_yh").text(total_yh.toFixed(2));
  256 + $("#total_zgl").text((total_zgl/10000).toFixed(3));
  257 + $("#total_ks").text((total_ks/10000).toFixed(3));
  258 + $("#total_yh").text((total_yh/10000).toFixed(2));
259 259 $("#total_bc").text(total_bc.toFixed(0));
260 260  
261 261 var temp = {};
... ...
src/main/resources/static/pages/mforms/singledatas/singledata2.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px;
  14 + text-align: center; }
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 +</style>
  19 +
  20 +<div class="page-head">
  21 + <div class="page-title">
  22 + <h1>路单数据</h1>
  23 + </div>
  24 +</div>
  25 +
  26 +<div class="row">
  27 + <div class="col-md-12">
  28 + <div class="portlet light porttlet-fit bordered">
  29 + <div class="portlet-title">
  30 + <form class="form-inline" action="">
  31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
  38 + </div>
  39 + <div style="display: inline-block;">
  40 + <span class="item-label" style="width: 80px;">&nbsp;线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
  42 + </div>
  43 + <div style="display: inline-block;margin-left: 15px;">
  44 + <span class="item-label" style="width: 140px;">时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  46 + </div>
  47 +
  48 + <div style="display: inline-block;margin-left: 15px">
  49 + <span class="item-label" style="width: 150px;">统计: </span>
  50 + <select class="form-control" name="tjtype" id="tjtype" style="width: 140px;">
  51 + <option value="jsy">驾驶员</option>
  52 + <option value="spy">售票员</option>
  53 + </select>
  54 +
  55 + </div>
  56 + <div class="form-group">
  57 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  58 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  59 + </div>
  60 + </form>
  61 + </div>
  62 + <div class="portlet-body">
  63 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  64 + <table class="table table-bordered table-hover table-checkable" id="forms">
  65 + <thead>
  66 + <tr>
  67 + <th>序号</th>
  68 + <th>日期</th>
  69 + <th>所属公司</th>
  70 + <th>线路</th>
  71 + <th>车号</th>
  72 + <th>司机职号</th>
  73 + <th>司机姓名</th>
  74 + <th>售票员职号</th>
  75 + <th>售票员姓名</th>
  76 + <th>行驶里程(包括空放)</th>
  77 + <th>空驶里程</th>
  78 + <th>耗油量</th>
  79 + <th>加注量</th>
  80 + <th>非营业用油</th>
  81 + <th>计划公里</th>
  82 + </tr>
  83 + </thead>
  84 + <tbody id="sinTboday">
  85 +
  86 + </tbody>
  87 + <tr>
  88 + <td colspan="9">小计</td>
  89 + <td><span id="total_zgl">&nbsp;</span></td>
  90 + <td><span id="total_ks">&nbsp;</span></td>
  91 + <td><span id="total_yh">&nbsp;</span></td>
  92 + <td><span id="total_jzl">&nbsp;</span></td>
  93 + <td><span id="total_fyy">&nbsp;</span></td>
  94 + <td><span id="total_jh">&nbsp;</span></td>
  95 + </tr>
  96 + </table>
  97 + </div>
  98 + </div>
  99 + </div>
  100 + </div>
  101 +</div>
  102 +
  103 +<script>
  104 + $(function(){
  105 + // 关闭左侧栏
  106 + if (!$('body').hasClass('page-sidebar-closed'))
  107 + $('.menu-toggler.sidebar-toggler').click();
  108 +
  109 + $("#startDate,#endDate").datetimepicker({
  110 + format : 'YYYY-MM-DD',
  111 + locale : 'zh-cn'
  112 + });
  113 +
  114 + var fage=false;
  115 + var xlList;
  116 + var obj = [];
  117 +
  118 + $.get('/report/lineList',function(result){
  119 + xlList=result;
  120 + $.get('/user/companyData', function(result){
  121 + obj = result;
  122 + var options = '';
  123 + for(var i = 0; i < obj.length; i++){
  124 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  125 + }
  126 +
  127 + if(obj.length ==0){
  128 + $("#gsdmDiv_sing").css('display','none');
  129 + }else if(obj.length ==1){
  130 + $("#gsdmDiv_sing").css('display','none');
  131 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  132 + $('#fgsdmDiv_sing').css('display','none');
  133 + }
  134 + $('#gsdmSing').html(options);
  135 + updateCompany();
  136 + });
  137 + })
  138 + $("#gsdmSing").on("change",updateCompany);
  139 + function updateCompany(){
  140 + var company = $('#gsdmSing').val();
  141 + var options = '';
  142 + for(var i = 0; i < obj.length; i++){
  143 + if(obj[i].companyCode == company){
  144 + var children = obj[i].children;
  145 + for(var j = 0; j < children.length; j++){
  146 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  147 + }
  148 + }
  149 + }
  150 + $('#fgsdmSing').html(options);
  151 + }
  152 +
  153 + var tempData = {};
  154 + $.get('/report/lineList',function(xlList){
  155 + var data = [];
  156 + data.push({id: " ", text: "全部线路"});
  157 + $.get('/user/companyData', function(result){
  158 + for(var i = 0; i < result.length; i++){
  159 + var companyCode = result[i].companyCode;
  160 + var children = result[i].children;
  161 + for(var j = 0; j < children.length; j++){
  162 + var code = children[j].code;
  163 + for(var k=0;k < xlList.length;k++ ){
  164 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  165 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  166 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  167 + }
  168 + }
  169 + }
  170 + }
  171 + initPinYinSelect2('#line',data,'');
  172 +
  173 + });
  174 + });
  175 +
  176 + $("#line").on("change", function(){
  177 + if($("#line").val() == " "){
  178 + $("#gsdmSing").attr("disabled", false);
  179 + $("#fgsdmSing").attr("disabled", false);
  180 + } else {
  181 + var temp = tempData[$("#line").val()].split(":");
  182 + $("#gsdmSing").val(temp[0]);
  183 + updateCompany();
  184 + $("#fgsdmSing").val(temp[1]);
  185 + $("#gsdmSing").attr("disabled", true);
  186 + $("#fgsdmSing").attr("disabled", true);
  187 + }
  188 + });
  189 +
  190 +
  191 + $("#query").on("click",function(){
  192 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  193 + layer.msg("请选择时间!");
  194 + return;
  195 + }
  196 + var line = $("#line").val();
  197 + var startDate = $("#startDate").val();
  198 + var lpName = $("#lpName").val();
  199 + var gsdmSing = $("#gsdmSing").val();
  200 + var fgsdmSing = $("#fgsdmSing").val();
  201 + var tjtype=$("#tjtype").val();
  202 + var params = {};
  203 + var i = layer.load(2);
  204 +// if(tjtype=='jsy'){
  205 + $get("/mcy_forms/singledatatj",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName,tjtype:tjtype},function(result){
  206 + layer.close(i);
  207 + var singledata = template('singledata',{list:result});
  208 + // 把渲染好的模版html文本追加到表格中
  209 + $('#sinTboday').html(singledata);
  210 + var total_zgl = 0,total_ks = 0,total_jh = 0;
  211 + var total_yh = 0,total_jzl=0,total_fyy=0;
  212 +
  213 + $.each(result, function(i, obj) {
  214 + total_zgl +=Number(obj.jhlc*10000);
  215 + total_ks +=Number(obj.emptMileage*10000);
  216 + total_yh += Number(obj.hyl*10000);
  217 + total_jzl +=Number(obj.jzl*10000)
  218 + total_fyy +=Number(obj.unyyyl*10000)
  219 + total_jh += Number(obj.jhjl*10000);
  220 +
  221 + });
  222 + $("#total_zgl").text((total_zgl/10000).toFixed(3));
  223 + $("#total_ks").text((total_ks/10000).toFixed(3));
  224 + $("#total_yh").text((total_yh/10000).toFixed(2));
  225 + $("#total_jzl").text((total_jzl/10000).toFixed(2));
  226 + $("#total_fyy").text((total_fyy/10000).toFixed(2));
  227 + $("#total_jh").text((total_jh/10000).toFixed(3));
  228 +
  229 + });
  230 +// }else{
  231 +// $get("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName,tjtype:tjtype},function(result){
  232 +// layer.close(i);
  233 +// var date=new Array(); //存放文本框数组
  234 +// $.each(result, function (i, obj) {
  235 +// if(obj.sgh !='' && obj.sgh!=null){
  236 +// date.push(obj);
  237 +// }
  238 +// });
  239 +// var singledata = template('singledata2',{result});
  240 +// // 把渲染好的模版html文本追加到表格中
  241 +// $('#forms tbody').html(singledata);
  242 +
  243 +// });
  244 +// }
  245 +
  246 + });
  247 +
  248 + $("#export").on("click",function(){
  249 + var line = $("#line").val();
  250 + var startDate = $("#startDate").val();
  251 + var endDate = $("#endDate").val();
  252 + var lpName = $("#lpName").val();
  253 + var gsdmSing = $("#gsdmSing").val();
  254 + var fgsdmSing = $("#fgsdmSing").val();
  255 + var tjtype=$("#tjtype").val();
  256 +// if(tjtype=='jsy'){
  257 + $get('/mcy_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export'},function(result){
  258 + window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
  259 + });
  260 +// }else{
  261 +// $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export'},function(result){
  262 +// window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
  263 +// });
  264 +// }
  265 +
  266 + });
  267 + });
  268 +</script>
  269 +<script type="text/html" id="singledata">
  270 + {{each list as obj i}}
  271 + <tr>
  272 + <td>{{i+1}}</td>
  273 + <td>{{obj.rQ}}</td>
  274 + <td>{{obj.gS}}</td>
  275 + <td>{{obj.xlmc}}</td>
  276 + <td>{{obj.clzbh}}</td>
  277 + <td>{{obj.jsy}}</td>
  278 + <td>{{obj.jName}}</td>
  279 + <td>{{obj.sgh}}</td>
  280 + <td>{{obj.sName}}</td>
  281 + <td>{{obj.jhlc}}</td>
  282 + <td>{{obj.emptMileage}}</td>
  283 + <td>{{obj.hyl}}</td>
  284 + <td>{{obj.jzl}}</td>
  285 + <td>{{obj.unyyyl}}</td>
  286 + <td>{{obj.jhjl}}</td>
  287 + </tr>
  288 + {{/each}}
  289 + {{if list.length == 0}}
  290 + <tr>
  291 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  292 + </tr>
  293 + {{/if}}
  294 +</script>
  295 +<script type="text/html" id="singledata2">
  296 + {{each list as obj i}}
  297 + <tr>
  298 + <td>{{i+1}}</td>
  299 + <td>{{obj.rQ}}</td>
  300 + <td>{{obj.gS}}</td>
  301 + <td>{{obj.xlmc}}</td>
  302 + <td>{{obj.clzbh}}</td>
  303 + <td></td>
  304 + <td></td>
  305 + <td>{{obj.sgh}}</td>
  306 + <td>{{obj.sName}}</td>
  307 + <td>{{obj.jhlc}}</td>
  308 + <td>{{obj.emptMileage}}</td>
  309 + <td></td>
  310 + <td></td>
  311 + <td></td>
  312 + <td>{{obj.jhjl}}</td>
  313 + </tr>
  314 + {{/each}}
  315 + {{if list.length == 0}}
  316 + <tr>
  317 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  318 + </tr>
  319 + {{/if}}
  320 +</script>
... ...
src/main/resources/static/pages/mforms/singledatas/singledatas.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px;
  14 + text-align: center; }
  15 +
  16 + .table > tbody + tbody {
  17 + border-top: 1px solid; }
  18 +</style>
  19 +
  20 +<div class="page-head">
  21 + <div class="page-title">
  22 + <h1>路单数据</h1>
  23 + </div>
  24 +</div>
  25 +
  26 +<div class="row">
  27 + <div class="col-md-12">
  28 + <div class="portlet light porttlet-fit bordered">
  29 + <div class="portlet-title">
  30 + <form class="form-inline" action="">
  31 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_sing">
  32 + <span class="item-label" style="width: 80px;">公司: </span>
  33 + <select class="form-control" name="company" id="gsdmSing" style="width: 140px;"></select>
  34 + </div>
  35 + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_sing">
  36 + <span class="item-label" style="width: 80px;">分公司: </span>
  37 + <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
  38 + </div>
  39 + <div style="display: inline-block;">
  40 + <span class="item-label" style="width: 80px;">&nbsp;线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
  42 + </div>
  43 + <div style="display: inline-block;margin-left: 15px;">
  44 + <span class="item-label" style="width: 140px;">时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  46 + </div>
  47 +
  48 + <div style="display: inline-block;margin-left: 15px">
  49 + <span class="item-label" style="width: 150px;">统计: </span>
  50 + <select class="form-control" name="tjtype" id="tjtype" style="width: 140px;">
  51 + <option value="jsy">驾驶员</option>
  52 + <option value="spy">售票员</option>
  53 +
  54 + </select>
  55 +
  56 + </div>
  57 + <div class="form-group">
  58 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  59 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  60 + </div>
  61 + </form>
  62 + </div>
  63 + <div class="portlet-body">
  64 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  65 + <table class="table table-bordered table-hover table-checkable" id="forms">
  66 + <thead>
  67 + <tr>
  68 + <th>序号</th>
  69 + <th>日期</th>
  70 + <th>所属公司</th>
  71 + <th>线路</th>
  72 + <th>车号</th>
  73 + <th>司机职号</th>
  74 + <th>司机姓名</th>
  75 + <th>售票员职号</th>
  76 + <th>售票员姓名</th>
  77 + <th>行驶里程(包括空放)</th>
  78 + <th>空驶里程</th>
  79 + <th>耗油量</th>
  80 + <th>加注量</th>
  81 + <th>非营业用油</th>
  82 + <th>计划公里</th>
  83 + </tr>
  84 + </thead>
  85 + <tbody>
  86 +
  87 + </tbody>
  88 + </table>
  89 + </div>
  90 + </div>
  91 + </div>
  92 + </div>
  93 +</div>
  94 +
  95 +<script type="text/javascript" src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  96 +
  97 +<script>
  98 + $(function(){
  99 + // 关闭左侧栏
  100 + if (!$('body').hasClass('page-sidebar-closed'))
  101 + $('.menu-toggler.sidebar-toggler').click();
  102 +
  103 + $("#startDate,#endDate").datetimepicker({
  104 + format : 'YYYY-MM-DD',
  105 + locale : 'zh-cn'
  106 + });
  107 +
  108 + var fage=false;
  109 + var xlList;
  110 + var obj = [];
  111 +
  112 + $.get('/report/lineList',function(result){
  113 + xlList=result;
  114 + $.get('/user/companyData', function(result){
  115 + obj = result;
  116 + var options = '';
  117 + for(var i = 0; i < obj.length; i++){
  118 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  119 + }
  120 +
  121 + if(obj.length ==0){
  122 + $("#gsdmDiv_sing").css('display','none');
  123 + }else if(obj.length ==1){
  124 + $("#gsdmDiv_sing").css('display','none');
  125 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  126 + $('#fgsdmDiv_sing').css('display','none');
  127 + }
  128 + $('#gsdmSing').html(options);
  129 + updateCompany();
  130 + });
  131 + })
  132 + $("#gsdmSing").on("change",updateCompany);
  133 + function updateCompany(){
  134 + var company = $('#gsdmSing').val();
  135 + var options = '';
  136 + for(var i = 0; i < obj.length; i++){
  137 + if(obj[i].companyCode == company){
  138 + var children = obj[i].children;
  139 + for(var j = 0; j < children.length; j++){
  140 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  141 + }
  142 + }
  143 + }
  144 + $('#fgsdmSing').html(options);
  145 + }
  146 +
  147 + var tempData = {};
  148 + $.get('/report/lineList',function(xlList){
  149 + var data = [];
  150 + data.push({id: " ", text: "全部线路"});
  151 + $.get('/user/companyData', function(result){
  152 + for(var i = 0; i < result.length; i++){
  153 + var companyCode = result[i].companyCode;
  154 + var children = result[i].children;
  155 + for(var j = 0; j < children.length; j++){
  156 + var code = children[j].code;
  157 + for(var k=0;k < xlList.length;k++ ){
  158 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  159 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  160 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  161 + }
  162 + }
  163 + }
  164 + }
  165 + initPinYinSelect2('#line',data,'');
  166 +
  167 + });
  168 + });
  169 +
  170 + $("#line").on("change", function(){
  171 + if($("#line").val() == " "){
  172 + $("#gsdmSing").attr("disabled", false);
  173 + $("#fgsdmSing").attr("disabled", false);
  174 + } else {
  175 + var temp = tempData[$("#line").val()].split(":");
  176 + $("#gsdmSing").val(temp[0]);
  177 + updateCompany();
  178 + $("#fgsdmSing").val(temp[1]);
  179 + $("#gsdmSing").attr("disabled", true);
  180 + $("#fgsdmSing").attr("disabled", true);
  181 + }
  182 + });
  183 +
  184 +
  185 + $("#query").on("click",function(){
  186 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  187 + layer.msg("请选择时间!");
  188 + return;
  189 + }
  190 + var line = $("#line").val();
  191 + var startDate = $("#startDate").val();
  192 + var lpName = $("#lpName").val();
  193 + var gsdmSing = $("#gsdmSing").val();
  194 + var fgsdmSing = $("#fgsdmSing").val();
  195 + var tjtype=$("#tjtype").val();
  196 + var params = {};
  197 + var i = layer.load(2);
  198 + if(tjtype=='jsy'){
  199 + $get("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName,tjtype:tjtype},function(result){
  200 + layer.close(i);
  201 + var singledata = template('singledata',{list:result});
  202 + // 把渲染好的模版html文本追加到表格中
  203 + $('#forms tbody').html(singledata);
  204 +
  205 + });
  206 + }else{
  207 + $get("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName,tjtype:tjtype},function(result){
  208 +
  209 + layer.close(i);
  210 +
  211 + var singledata = template('singledata2',{list:result});
  212 + // 把渲染好的模版html文本追加到表格中
  213 + $('#forms tbody').html(singledata);
  214 +
  215 + });
  216 + }
  217 +
  218 + });
  219 +
  220 + $("#export").on("click",function(){
  221 + var line = $("#line").val();
  222 + var startDate = $("#startDate").val();
  223 + var endDate = $("#endDate").val();
  224 + var lpName = $("#lpName").val();
  225 + var gsdmSing = $("#gsdmSing").val();
  226 + var fgsdmSing = $("#fgsdmSing").val();
  227 + var tjtype=$("#tjtype").val();
  228 + if(tjtype=='jsy'){
  229 + $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export'},function(result){
  230 + window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
  231 + });
  232 + }else{
  233 + $("#forms").table2excel({
  234 + // 不被导出的表格行的CSS class类
  235 + exclude: ".noExl",
  236 + // 导出的Excel文档的名称,(没看到作用)
  237 + name: "Excel Document Name.xlsx",
  238 + // Excel文件的名称
  239 + filename: "路单数据"+startDate
  240 + });
  241 + }
  242 +
  243 + });
  244 + });
  245 +</script>
  246 +<script type="text/html" id="singledata">
  247 + {{each list as obj i}}
  248 + <tr>
  249 + <td>{{i+1}}</td>
  250 + <td>{{obj.rQ}}</td>
  251 + <td>{{obj.gS}}</td>
  252 + <td>{{obj.xlmc}}</td>
  253 + <td>{{obj.clzbh}}</td>
  254 + <td>{{obj.jsy}}</td>
  255 + <td>{{obj.jName}}</td>
  256 + <td>{{obj.sgh}}</td>
  257 + <td>{{obj.sName}}</td>
  258 + <td>{{obj.jhlc}}</td>
  259 + <td>{{obj.emptMileage}}</td>
  260 + <td>{{obj.hyl}}</td>
  261 + <td>{{obj.jzl}}</td>
  262 + <td>{{obj.unyyyl}}</td>
  263 + <td>{{obj.jhjl}}</td>
  264 + </tr>
  265 + {{/each}}
  266 + {{if list.length == 0}}
  267 + <tr>
  268 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  269 + </tr>
  270 + {{/if}}
  271 +</script>
  272 +<script type="text/html" id="singledata2">
  273 + {{each list as obj i}}
  274 + <tr>
  275 + <td>{{i+1}}</td>
  276 + <td>{{obj.rQ}}</td>
  277 + <td>{{obj.gS}}</td>
  278 + <td>{{obj.xL}}</td>
  279 + <td>{{obj.clzbh}}</td>
  280 + <td></td>
  281 + <td></td>
  282 + <td>{{obj.sgh}}</td>
  283 + <td>{{obj.sName}}</td>
  284 + <td>{{obj.jhlc}}</td>
  285 + <td>{{obj.emptMileage}}</td>
  286 + <td></td>
  287 + <td></td>
  288 + <td></td>
  289 + <td>{{obj.jhjl}}</td>
  290 + </tr>
  291 + {{/each}}
  292 + {{if list.length == 0}}
  293 + <tr>
  294 + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td>
  295 + </tr>
  296 + {{/if}}
  297 +</script>
... ...
src/main/resources/static/pages/report/countMileage/countBus/company/countBusMileage.html
... ... @@ -333,8 +333,8 @@
333 333 <td>{{obj.dhl}}</td>
334 334 <td>{{obj.cdl}}</td>
335 335 <td>{{obj.yhl}}</td>
336   - <td>{{obj.hyl}}</td>
337 336 <td>{{obj.jzl}}</td>
  337 + <td>{{obj.hyl}}</td>
338 338 <td>{{obj.jhzlc}}</td>
339 339 </tr>
340 340 {{/each}}
... ...
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
... ... @@ -331,8 +331,8 @@
331 331 <td>{{obj.dhl}}</td>
332 332 <td>{{obj.cdl}}</td>
333 333 <td>{{obj.yhl}}</td>
334   - <td>{{obj.hyl}}</td>
335 334 <td>{{obj.jzl}}</td>
  335 + <td>{{obj.hyl}}</td>
336 336 <td>{{obj.jhzlc}}</td>
337 337 </tr>
338 338 {{/each}}
... ...
src/main/resources/static/pages/report/countMileage/countLine/company/countLineMileage.html
... ... @@ -306,7 +306,7 @@
306 306 <td>{{obj.jhzlc}}</td>
307 307 <td>{{obj.jhlc}}</td>
308 308 <td>{{obj.jcclc}}</td>
309   - <td>{{obj.zlc}}</td>
  309 + <td>{{obj.sjzgl}}</td>
310 310 <td>{{obj.jhnlc}}</td>
311 311 <td>{{obj.jhwlc}}</td>
312 312 <td>{{obj.jhnjcclc}}</td>
... ...
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
... ... @@ -305,7 +305,7 @@
305 305 <td>{{obj.jhzlc}}</td>
306 306 <td>{{obj.jhlc}}</td>
307 307 <td>{{obj.jcclc}}</td>
308   - <td>{{obj.zlc}}</td>
  308 + <td>{{obj.sjzgl}}</td>
309 309 <td>{{obj.jhnlc}}</td>
310 310 <td>{{obj.jhwlc}}</td>
311 311 <td>{{obj.jhnjcclc}}</td>
... ...
src/main/resources/static/pages/report/sheet/sheetList.html
... ... @@ -101,7 +101,7 @@
101 101 </div>
102 102 </div>
103 103 </div>
104   -
  104 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
105 105 <script>
106 106 $(function(){
107 107 // 关闭左侧栏
... ... @@ -256,6 +256,19 @@
256 256 });
257 257 });
258 258 }
  259 + $("#export").on("click",function(){
  260 + var date = $("#date").val();
  261 + var endDate = $("#endDate").val();
  262 + $("#forms").table2excel({
  263 + // 不被导出的表格行的CSS class类
  264 + exclude: ".noExl",
  265 + // 导出的Excel文档的名称,(没看到作用)
  266 + name: "Excel Document Name.xlsx",
  267 + // Excel文件的名称
  268 + filename: date+"-"+endDate+"班次准点率"
  269 + });
  270 + })
  271 +
259 272 });
260 273 </script>
261 274 <script type="text/html" id="sheetList">
... ...