Commit 53ac7085ab079a22d686bf66da48deb2a8af95e2

Authored by 潘钊
2 parents 2393a013 b2e023d3

Merge branch 'minhang' into pudong

src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
1   -package com.bsth.controller.realcontrol;
2   -
3   -import com.bsth.data.schedule.DayOfSchedule;
4   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
5   -import org.slf4j.Logger;
6   -import org.slf4j.LoggerFactory;
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestMethod;
10   -import org.springframework.web.bind.annotation.RequestParam;
11   -import org.springframework.web.bind.annotation.RestController;
12   -
13   -import java.util.HashSet;
14   -import java.util.List;
15   -import java.util.Set;
16   -
17   -/**
18   - * 相关数据异常检测
19   - * Created by panzhao on 2017/4/14.
20   - */
21   -@RestController
22   -@RequestMapping("anomalyCheck")
23   -public class anomalyCheckController {
24   -
25   -
26   - Logger logger = LoggerFactory.getLogger(this.getClass());
27   -
28   - @Autowired
29   - DayOfSchedule dayOfSchedule;
30   - /**
31   - * 出现重复班次的车辆
32   - * @param nbbm
33   - */
34   - @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
35   - public void schRepeat(@RequestParam String nbbm){
36   - logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
37   - List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
38   -
39   - Set<ScheduleRealInfo> set = new HashSet<>();
40   - for(ScheduleRealInfo sch : list){
41   - if(!set.add(sch)){
42   - logger.info("出现一次重复班次,班次ID:" + sch.getId());
43   - }
44   - }
45   -
46   - if(set.size() > 0){
47   - dayOfSchedule.replaceByNbbm(nbbm, set);
48   - }
49   - }
50   -}
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.data.schedule.DayOfSchedule;
  4 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestMethod;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import java.util.HashSet;
  14 +import java.util.List;
  15 +import java.util.Set;
  16 +
  17 +/**
  18 + * 相关数据异常检测
  19 + * Created by panzhao on 2017/4/14.
  20 + */
  21 +@RestController
  22 +@RequestMapping("anomalyCheck")
  23 +public class anomalyCheckController {
  24 +
  25 +
  26 + Logger logger = LoggerFactory.getLogger(this.getClass());
  27 +
  28 + @Autowired
  29 + DayOfSchedule dayOfSchedule;
  30 + /**
  31 + * 出现重复班次的车辆
  32 + * @param nbbm
  33 + */
  34 + @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
  35 + public void schRepeat(@RequestParam String nbbm){
  36 + logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
  37 + List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
  38 +
  39 + Set<ScheduleRealInfo> set = new HashSet<>();
  40 + for(ScheduleRealInfo sch : list){
  41 + if(!set.add(sch)){
  42 + logger.info("出现一次重复班次,班次ID:" + sch.getId());
  43 + }
  44 + }
  45 +
  46 + if(set.size() > 0){
  47 + dayOfSchedule.replaceByNbbm(nbbm, set);
  48 + }
  49 + }
  50 +}
... ...
src/main/java/com/bsth/entity/mcy_forms/Shiftuehiclemanth.java
... ... @@ -22,6 +22,17 @@ public class Shiftuehiclemanth {
22 22  
23 23 private String jgh;
24 24 private String zbh;
  25 + public String getSgh() {
  26 + return sgh;
  27 + }
  28 +
  29 + public void setSgh(String sgh) {
  30 + this.sgh = sgh;
  31 + }
  32 +
  33 + private String sgh;
  34 +
  35 +
25 36 public String getJgh() {
26 37 return jgh;
27 38 }
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -156,7 +156,10 @@ public class FormsServiceImpl implements FormsService {
156 156 if(map.containsKey("fgsdmManth")){
157 157 fgsdmManth=map.get("fgsdmManth").toString();
158 158 }
159   - String sql = "select r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type,r.s_name,r.lp_name "
  159 + String sql = "select"
  160 + + " r.j_name, r.cl_zbh,r.j_gh,r.s_gh,r.s_name "
  161 +// + "r.gs_bm,r.gs_name,"
  162 +// + " r.fgs_bm,r.fgs_name,r.bc_type,r.lp_name "
160 163 + " from bsth_c_s_sp_info_real r "
161 164 + " where 1=1 ";
162 165 if(map.get("startDate")!=null&&!map.get("startDate").equals("")){
... ... @@ -169,19 +172,23 @@ public class FormsServiceImpl implements FormsService {
169 172 if(map.get("line")!=null&&!map.get("line").equals("")){
170 173 sql+=" and r.xl_bm='"+ map.get("line").toString() + "' ";
171 174 }
172   - sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')";
173   - if(map.get("gsdmManth")!=null&&!map.get("gsdmManth").equals("")){
174   - sql+=" and r.gs_bm='"+map.get("gsdmManth").toString()+"' ";
175   - }
  175 +// sql+= " AND r.gs_bm is not null and r.bc_type not in('in','out')";
  176 +// if(map.get("gsdmManth")!=null&&!map.get("gsdmManth").equals("")){
  177 + sql+=" and r.gs_bm like'%"+gsdmManth+"%' ";
  178 +// }
176 179 if(map.get("fgsdmManth")!=null&&!map.get("fgsdmManth").equals("")){
177   - sql+=" and r.fgs_bm='"+map.get("fgsdmManth").toString()+"' ";
  180 + sql+=" and r.fgs_bm like'%"+fgsdmManth+"%' ";
178 181 }
179 182 if(empnames.equals("售票员")){
180 183 sql+="and r.s_name is not null AND r.s_name !=''";
181 184 }
182   - sql += " GROUP BY r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type ";
  185 + sql += " GROUP BY "
  186 + + "r.j_name, r.cl_zbh,r.j_gh,r.s_gh,r.s_name ";
  187 +// + ",r.gs_bm,r.gs_name,"
  188 +// + "r.fgs_bm,r.fgs_name,r.bc_type ";
183 189  
184   -
  190 +// r.j_name,r.cl_zbh,r.j_gh,r.gs_bm,r.gs_name,"
  191 +// + " r.fgs_bm,r.fgs_name,r.bc_type,r.s_name,r.lp_name
185 192 List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() {
186 193  
187 194 @Override
... ... @@ -191,12 +198,13 @@ public class FormsServiceImpl implements FormsService {
191 198 shif.setjName(arg0.getString("j_name"));
192 199 }else if(empnames.equals("售票员")){
193 200 shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name"));
  201 + shif.setSgh(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh"));
194 202 }else if(empnames.equals("车辆自编号")){
195 203 shif.setjName(arg0.getString("cl_zbh"));
196 204 }
197   -
198 205 shif.setJgh(arg0.getString("j_gh"));
199 206 shif.setZbh(arg0.getString("cl_zbh"));
  207 +// shif.setjName(arg0.getString("s_gh")==null ? "":arg0.getString("s_gh"));
200 208 return shif;
201 209 }
202 210 });
... ... @@ -208,9 +216,26 @@ public class FormsServiceImpl implements FormsService {
208 216 Shiftuehiclemanth d=list.get(i);
209 217 for (int j = 0; j < lists.size(); j++) {
210 218 ScheduleRealInfo s=lists.get(j);
211   - if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
212   - sList.add(s);
  219 +// if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
  220 +// sList.add(s);
  221 +// }
  222 +
  223 + if(empnames.equals("驾驶员")){
  224 + if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
  225 + sList.add(s);
  226 + }
  227 + }else if(empnames.equals("售票员")){
  228 +// shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name"));
  229 + String sgh=s.getsGh()==null?"":s.getsGh();
  230 + if(d.getSgh().equals(sgh) && d.getZbh().equals(s.getClZbh())){
  231 + sList.add(s);
  232 + }
  233 + }else if(empnames.equals("车辆自编号")){
  234 + if(d.getZbh().equals(s.getClZbh())){
  235 + sList.add(s);
  236 + }
213 237 }
  238 +
214 239 }
215 240  
216 241 double ksgl=culateMileageService.culateKsgl(sList);
... ... @@ -258,13 +283,16 @@ public class FormsServiceImpl implements FormsService {
258 283 if(map.get("fgsdmShif")!=null&&!map.get("fgsdmShif").equals("")){
259 284 fgsdmShif =map.get("fgsdmShif").toString();
260 285 }
261   - String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name,"
262   - + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name FROM bsth_c_s_sp_info_real r where 1=1 "
  286 + String sql ="select t.* from (select r.schedule_date,r.j_name,"
  287 + + "IFNULL(r.s_name,'')as s_name,"
  288 + + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name "
  289 + + "FROM bsth_c_s_sp_info_real r where 1=1 "
263 290 + " and to_days(r.schedule_date)=to_days('"+date + "') "
264 291 + " and r.xl_bm like '%"+line+"%' "
265 292 + " and r.gs_bm like '%"+gsdmShif+"%' "
266 293 + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t"
267   - + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm ";
  294 + + " GROUP BY t.schedule_date,t.j_name,t.s_name, "
  295 + + "t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm,t.lp_name ";
268 296  
269 297  
270 298 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
... ... @@ -806,7 +834,7 @@ public class FormsServiceImpl implements FormsService {
806 834 + " and y.ssgsdm like '%"+gsbm+"%' "
807 835 + " and y.fgsdm like '%"+fgsbm+"%'"
808 836 + " ) x"
809   - + " on t.cl_zbh = x.nbbm ";
  837 + + " on t.cl_zbh = x.nbbm and t.j_gh=x.jsy";
810 838  
811 839 List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() {
812 840 @Override
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -400,25 +400,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
400 400 Map<String, Object> rs = new HashMap<>();
401 401 rs.put("status", ResponseCode.ERROR);
402 402  
403   - ScheduleRealInfo sch = dayOfSchedule.get(id);
404   - if (sch == null) {
405   - rs.put("msg", "无效的id号");
406   - return rs;
407   - }
  403 + try {
  404 + ScheduleRealInfo sch = dayOfSchedule.get(id);
  405 + if (sch == null) {
  406 + rs.put("msg", "无效的id号");
  407 + return rs;
  408 + }
408 409  
409   - if (!sch.isSflj()) {
410   - rs.put("msg", "你只能删除临加班次");
411   - return rs;
412   - }
  410 + if (!sch.isSflj()) {
  411 + rs.put("msg", "你只能删除临加班次");
  412 + return rs;
  413 + }
413 414  
414   - //数据库删除
415   - rs = super.delete(id);
416   - if(rs.get("status").equals(ResponseCode.SUCCESS)){
417   - dayOfSchedule.delete(sch);
418   - //更新起点应到时间
419   - List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch.getClZbh());
420   - rs.put("ts", ts);
421   - rs.put("delete", sch);
  415 + //解除和调度指令的外键约束
  416 + jdbcTemplate.update("update bsth_v_directive_60 set sch=NULL where sch=" + id);
  417 +
  418 + //数据库删除
  419 + rs = super.delete(id);
  420 + if(rs.get("status").equals(ResponseCode.SUCCESS)){
  421 + dayOfSchedule.delete(sch);
  422 + //更新起点应到时间
  423 + List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch.getClZbh());
  424 + rs.put("ts", ts);
  425 + rs.put("delete", sch);
  426 + }
  427 + }catch (Exception e){
  428 + logger.error("", e);
  429 + rs.put("msg", e.getMessage());
422 430 }
423 431  
424 432 return rs;
... ... @@ -1400,14 +1408,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1400 1408 double ljgl=culateService.culateLjgl(lists);
1401 1409  
1402 1410 map.put("jhlc", culateService.culateJhgl(list)); //计划里程
1403   - map.put("remMileage", culateService.culateLbgl(lists)); //烂班公里
  1411 + map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
1404 1412 map.put("addMileage", ljgl); //临加公里
1405 1413 map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里
1406 1414 map.put("ksgl", ksgl);//空驶公里
1407 1415 map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));
1408 1416 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage));
1409 1417 map.put("jhbc", culateService.culateJhbc(list,""));
1410   - map.put("cjbc", culateService.culateLbbc(lists));
  1418 + map.put("cjbc", culateService.culateLbbc(list));
1411 1419 map.put("ljbc", culateService.culateLjbc(lists,""));
1412 1420 map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));
1413 1421 map.put("jcclc", jccgl);
... ...
src/main/resources/fatso/handle_real_ctl.js
... ... @@ -2,35 +2,50 @@
2 2 * 处理线调文件
3 3 */
4 4 var fs = require('fs')
5   - ,cheerio = require('cheerio')
6   - ,minifier = require('./minifier')
7   - ,crypto = require("crypto")
8   - ,CleanCSS = require('clean-css')
9   - ,UglifyJS = require("uglify-js");;
  5 + , cheerio = require('cheerio')
  6 + , minifier = require('./minifier')
  7 + , crypto = require("crypto")
  8 + , CleanCSS = require('clean-css')
  9 + , UglifyJS = require("uglify-js");
  10 +;
10 11  
11 12 //不参与的目录
12 13 var pName = 'bsth_control'
13   - ,path = process.cwd()
  14 + , path = process.cwd()
14 15 //根目录
15   - ,root = path.substr(0, path.indexOf('\\src\\main'))
16   - ,workspace = root.substr(0, root.indexOf('\\' + pName))
  16 + , root = path.substr(0, path.indexOf('\\src\\main'))
  17 + , workspace = root.substr(0, root.indexOf('\\' + pName))
17 18 //临时目录
18   - ,dest = (workspace + '\\' + pName+'@fatso_copy').replace(/\//g,'\\')
19   - ,_static = '\\src\\main\\resources\\static';
  19 + , dest = (workspace + '\\' + pName + '@fatso_copy').replace(/\//g, '\\')
  20 + , _static = '\\src\\main\\resources\\static';
20 21  
21 22  
22 23 var mainFile = dest + _static + '\\real_control_v2\\main.html';
  24 +var mapFile = dest + _static + '\\real_control_v2\\mapmonitor\\real.html';
23 25 var realCtl = {
24 26 /**
25 27 * 处理线调首页
26 28 */
27   - handleMain: function(cb){
  29 + handleMain: function (cb) {
28 30 //读取文件
29 31 var data = fs.readFileSync(mainFile, 'utf-8')
30   - ,$ = cheerio.load(data);
  32 + , $ = cheerio.load(data);
31 33  
32 34 handleCss($, function () {
33   - handleJs($, cb);
  35 + handleJs($, mainFile, cb);
  36 + });
  37 + },
  38 + /**
  39 + * 处理地图模块
  40 + * @param cb
  41 + */
  42 + handleMap: function (cb) {
  43 + //读取文件
  44 + var data = fs.readFileSync(mapFile, 'utf-8')
  45 + , $ = cheerio.load(data);
  46 +
  47 + handleCss($, function () {
  48 + handleJs($, mapFile, cb);
34 49 });
35 50 }
36 51 };
... ... @@ -43,23 +58,23 @@ var handleCss = function ($, cb) {
43 58 var cssArray = $('link[rel=stylesheet][merge]');
44 59 //按 merge 值分组
45 60 var cssMap = {}, mergeName;
46   - for(var i = 0, c; c = cssArray[i++];){
  61 + for (var i = 0, c; c = cssArray[i++];) {
47 62 mergeName = $(c).attr('merge');
48   - if(!cssMap[mergeName])
  63 + if (!cssMap[mergeName])
49 64 cssMap[mergeName] = [];
50 65 cssMap[mergeName].push(dest + _static + $(c).attr('href'));
51 66 //remove
52 67 $(c).remove();
53 68 }
54 69 //按 merge 合并压缩css
55   - var ks = get_keys(cssMap), index=0;
  70 + var ks = get_keys(cssMap), index = 0;
56 71 (function () {
57   - if(index >= ks.length){
  72 + if (index >= ks.length) {
58 73 cb && cb();
59 74 return;
60 75 }
61 76 var k = ks[index];
62   - index ++;
  77 + index++;
63 78 var f = arguments.callee;
64 79 //合并css
65 80 new CleanCSS().minify(cssMap[k], function (error, out) {
... ... @@ -67,10 +82,16 @@ var handleCss = function ($, cb) {
67 82 var fName = (k + '_' + md5(data)) + '.css';
68 83 //写入 assets css 目录下
69 84 var descFile = dest + _static + '\\real_control_v2\\assets\\css\\' + fName;
70   - fs.open(descFile, 'a', function(err, fd){
  85 + fs.open(descFile, 'a', function (err, fd) {
71 86  
72   - fs.write(fd, data, function(){
73   - $('head').append('<link rel="stylesheet" href="/real_control_v2/assets/css/'+fName+'"/>');
  87 + fs.write(fd, data, function () {
  88 + var tag = '<link rel="stylesheet" href="/real_control_v2/assets/css/' + fName + '"/>';
  89 + if ($('head').length > 0)
  90 + $('head').append(tag);
  91 + else {
  92 + //没有head 就将css写在头部
  93 + $('div').first().before(tag);
  94 + }
74 95 console.log(k + ' css', '结束,下一个');
75 96 f();
76 97 });
... ... @@ -82,13 +103,13 @@ var handleCss = function ($, cb) {
82 103 /**
83 104 * 处理js
84 105 */
85   -var handleJs = function ($, cb) {
  106 +var handleJs = function ($, file, cb) {
86 107 var scriptArray = $('script[merge]');
87 108 //按 merge 值分组
88 109 var jsMap = {}, mergeName;
89   - for(var i = 0, s; s = scriptArray[i++];){
  110 + for (var i = 0, s; s = scriptArray[i++];) {
90 111 mergeName = $(s).attr('merge');
91   - if(!jsMap[mergeName])
  112 + if (!jsMap[mergeName])
92 113 jsMap[mergeName] = [];
93 114 jsMap[mergeName].push(dest + _static + $(s).attr('src'));
94 115 //remove
... ... @@ -96,16 +117,16 @@ var handleJs = function ($, cb) {
96 117 }
97 118  
98 119 //按 merge 合并压缩js
99   - var ks = get_keys(jsMap), index=0;
  120 + var ks = get_keys(jsMap), index = 0;
100 121 (function () {
101   - if(index >= ks.length){
102   - write(mainFile, $.html());
103   - console.log('线调处理结束'.green);
  122 + if (index >= ks.length) {
  123 + write(file, $.html());
  124 + console.log(file + ' 结束'.green);
104 125 cb && cb();
105 126 return;
106 127 }
107 128 var k = ks[index];
108   - index ++;
  129 + index++;
109 130 var f = arguments.callee;
110 131 //合并压缩js
111 132 var result = UglifyJS.minify(jsMap[k]);
... ... @@ -113,10 +134,16 @@ var handleJs = function ($, cb) {
113 134 var fName = (k + '_' + md5(data)) + '.js';
114 135 //写入 assets js 目录下
115 136 var descFile = dest + _static + '\\real_control_v2\\assets\\js\\' + fName;
116   - fs.open(descFile, 'a', function(err, fd){
  137 + fs.open(descFile, 'a', function (err, fd) {
117 138  
118   - fs.write(fd, data, function(){
119   - $('body').append('<script src="/real_control_v2/assets/js/'+fName+'"></script>');
  139 + fs.write(fd, data, function () {
  140 + var tag = '<script src="/real_control_v2/assets/js/' + fName + '"></script>';
  141 + if ($('body').length > 0)
  142 + $('body').append(tag);
  143 + else {
  144 + //没有body 就写在尾部
  145 + $('*').last().after(tag);
  146 + }
120 147 console.log(k + ' js', '结束,下一个');
121 148 f();
122 149 });
... ... @@ -132,13 +159,13 @@ var get_keys = function (json) {
132 159 return array;
133 160 };
134 161  
135   -function md5(text){
  162 +function md5(text) {
136 163 return crypto.createHash("md5").update(text).digest("hex");
137 164 }
138 165  
139   -function write(file, text){
  166 +function write(file, text) {
140 167 fs.writeFile(file, text, function (err) {
141   - if (err){
  168 + if (err) {
142 169 console.log(err.toString().red);
143 170 process.exit();
144 171 }
... ... @@ -146,5 +173,4 @@ function write(file, text){
146 173 });
147 174 }
148 175  
149   -
150 176 module.exports = realCtl;
151 177 \ No newline at end of file
... ...
src/main/resources/fatso/package.json
1   -{
2   - "name": "fatso",
3   - "version": "1.0.0",
4   - "description": "子页面js检查、合并、压缩等处理",
5   - "main": "start.js",
6   - "scripts": {
7   - "test": "echo \"Error: no test specified\" && exit 1"
8   - },
9   - "author": "panzhaov5",
10   - "license": "ISC",
11   - "dependencies": {
12   - "cheerio": "^0.20.0",
13   - "clean-css": "^4.0.12",
14   - "colors": "^1.1.2",
15   - "eventproxy": "^0.3.4",
16   - "uglify-js": "^2.6.2"
17   - }
18   -}
  1 +{
  2 + "name": "fatso",
  3 + "version": "1.0.0",
  4 + "description": "子页面js检查、合并、压缩等处理",
  5 + "main": "start.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1"
  8 + },
  9 + "author": "panzhaov5",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "cheerio": "^0.20.0",
  13 + "clean-css": "^4.0.12",
  14 + "colors": "^1.1.2",
  15 + "eventproxy": "^0.3.4",
  16 + "uglify-js": "^2.6.2"
  17 + }
  18 +}
... ...
src/main/resources/fatso/start.js
... ... @@ -83,9 +83,12 @@ ep.tail(&#39;minifier-js&#39;, function(){
83 83 ep.emit('handle-fragment', item);
84 84 },
85 85 function(){
86   - //处理线调
  86 + //处理线调首页
87 87 handle_real_ctl.handleMain(function () {
88   - ep.emit('package-jar');
  88 + //处理线调地图
  89 + handle_real_ctl.handleMap(function () {
  90 + ep.emit('package-jar');
  91 + });
89 92 });
90 93 });
91 94 });
... ...
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
... ... @@ -239,5 +239,4 @@
239 239 <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td>
240 240 </tr>
241 241 {{/if}}
242   -</script>
243 242 </script>
244 243 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -295,7 +295,7 @@
295 295 var sch = getActiveSch();
296 296 if (!sch || !sch.sflj)
297 297 return notify_err('只能删除临加班次!');
298   - var str = '<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3>';
  298 + var str = '<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3><h5 style="color: #6c6c6c;font-size: 12px;">如果删除失败,可能正处于调度指令下行上达瞬间,等几秒再删即可。班次删除后,调度指令会保留</h5>';
299 299 alt_confirm(str, function () {
300 300 gb_common.$del('/realSchedule/' + sch.id, function (rs) {
301 301 //前端数据更新
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/multi_tzrc.html
1   -<div class="uk-modal ct_move_modal" id="schedule-multi-tzrc-modal">
  1 +<div class="uk-modal" id="schedule-multi-tzrc-modal">
2 2 <div class="drag-container"></div>
3 3 <div class="uk-modal-dialog" style="width: 860px;">
4 4 <a href="" class="uk-modal-close uk-close"></a>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -16,18 +16,22 @@ var gb_schedule_table = (function () {
16 16 * @param list
17 17 */
18 18 var isRepeatData = function (list) {
19   - var map = {}, reps = [];
20   - for(var i = 0,sch;sch=list[i++];){
21   - if(map[sch.id]){
22   - reps.push(sch.clZbh);
  19 + try {
  20 + var map = {}, reps = [];
  21 + for(var i = 0,sch;sch=list[i++];){
  22 + if(map[sch.id]){
  23 + reps.push(sch.clZbh);
  24 + }
  25 + map[sch.id] = sch;
23 26 }
24   - map[sch.id] = sch;
25   - }
26 27  
27   - //通知服务端数据有异常
28   - $.each(reps, function () {
29   - $.post('/anomalyCheck/schRepeat', {nbbm: this});
30   - });
  28 + //通知服务端数据有异常
  29 + $.each(reps, function () {
  30 + $.post('/anomalyCheck/schRepeat', {nbbm: this});
  31 + });
  32 + }catch (e){
  33 + return list;
  34 + }
31 35  
32 36 return gb_common.get_vals(map);
33 37 };
... ... @@ -38,12 +42,12 @@ var gb_schedule_table = (function () {
38 42 lines: gb_data_basic.line_idx
39 43 }, function (rs) {
40 44 for (var lineCode in rs) {
41   - //排序
42   - rs[lineCode].sort(schedule_sort);
43 45 line2Schedule[lineCode] = {};
44 46 //------是否有重复班次 #临时代码,为服务端提供诊断信息已解决这个问题
45   - rs[lineCode] = isRepeatData(line2Schedule[lineCode]);
  47 + rs[lineCode] = isRepeatData(rs[lineCode]);
46 48  
  49 + //排序
  50 + rs[lineCode].sort(schedule_sort);
47 51 //calc shift
48 52 $.each(rs[lineCode], function () {
49 53 calc_sch_real_shift(this);
... ... @@ -178,26 +182,26 @@ var gb_schedule_table = (function () {
178 182 //重新渲染表格
179 183 reRenderTable(sch.xlBm);
180 184 /*//重新渲染表格
181   - var data = gb_common.get_vals(line2Schedule[sch.xlBm]).sort(schedule_sort),
182   - dirData = gb_common.groupBy(data, 'xlDir'),
183   - tabCont = $('li.line_schedule[data-id=' + sch.xlBm + ']');
184   -
185   - for (var upDown in dirData) {
186   - htmlStr = temps['line-schedule-table-temp']({
187   - dir: upDown,
188   - line: gb_data_basic.codeToLine[sch.xlBm],
189   - list: dirData[upDown]
190   - });
191   - $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr);
192   - }
193   - //图例相关
194   - gb_sch_legend.init(tabCont);
195   - //标记末班
196   - markerLastByLine(sch.xlBm);
197   - //计算应发未发
198   - calc_yfwf_num(sch.xlBm);
199   - //重新固定表头
200   - gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap'));*/
  185 + var data = gb_common.get_vals(line2Schedule[sch.xlBm]).sort(schedule_sort),
  186 + dirData = gb_common.groupBy(data, 'xlDir'),
  187 + tabCont = $('li.line_schedule[data-id=' + sch.xlBm + ']');
  188 +
  189 + for (var upDown in dirData) {
  190 + htmlStr = temps['line-schedule-table-temp']({
  191 + dir: upDown,
  192 + line: gb_data_basic.codeToLine[sch.xlBm],
  193 + list: dirData[upDown]
  194 + });
  195 + $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr);
  196 + }
  197 + //图例相关
  198 + gb_sch_legend.init(tabCont);
  199 + //标记末班
  200 + markerLastByLine(sch.xlBm);
  201 + //计算应发未发
  202 + calc_yfwf_num(sch.xlBm);
  203 + //重新固定表头
  204 + gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap'));*/
201 205 //定位到新添加的班次
202 206 scroToDl(sch);
203 207 };
... ... @@ -542,7 +546,7 @@ var gb_schedule_table = (function () {
542 546 }
543 547 }
544 548 };
545   -
  549 +
546 550 /** 添加备注信息 */
547 551 var addRemarks = function (list, remarks) {
548 552 //if(!list || list)
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -5,16 +5,16 @@
5 5 <meta charset="UTF-8">
6 6 <title>线路调度 v2.0</title>
7 7 <!-- uikit core style-->
8   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" merge="uikit"/>
9   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="uikit"/>
10   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="uikit"/>
  8 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" />
  9 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="plugins"/>
  10 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/>
11 11 <link rel="stylesheet"
12   - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="uikit"/>
13   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" merge="uikit"/>
14   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" merge="uikit"/>
  12 + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/>
  13 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" merge="plugins"/>
  14 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" merge="plugins"/>
15 15  
16 16 <!-- main style -->
17   - <link rel="stylesheet" href="/real_control_v2/css/main.css" merge="custom_style"/>
  17 + <link rel="stylesheet" href="/real_control_v2/css/main.css" />
18 18 <!-- north style -->
19 19 <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/>
20 20 <!-- home style -->
... ... @@ -25,14 +25,14 @@
25 25 <!-- custom table -->
26 26 <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/>
27 27 <!-- jquery contextMenu style -->
28   - <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" />
  28 + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/>
29 29 <!-- formvalidation style -->
30   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css"/>
  30 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/>
31 31 <!-- js tree -->
32   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.min.css"/>
  32 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.min.css" merge="plugins"/>
33 33 <!-- tooltip css-->
34   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css"/>
35   - <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="custom_style"/>
  34 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/>
  35 + <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/>
36 36  
37 37 <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/>
38 38 </head>
... ... @@ -93,8 +93,8 @@
93 93 <!-- 地图相关 -->
94 94 <script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
95 95 <script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script>
96   -<script src="/assets/js/baidu//MarkerClusterer.js"></script>
97   -<script src="/assets/js/TransGPS.js"></script>
  96 +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script>
  97 +<script src="/assets/js/TransGPS.js" merge="plugins"></script>
98 98 <!-- 高德 -->
99 99 <script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script>
100 100 <!-- jquery -->
... ... @@ -108,7 +108,7 @@
108 108 <!-- common js -->
109 109 <script src="/real_control_v2/js/common.js"></script>
110 110 <!-- art-template 模版引擎 -->
111   -<script src="/assets/plugins/template.js"></script>
  111 +<script src="/assets/plugins/template.js" merge="plugins"></script>
112 112 <!-- d3 -->
113 113 <script src="/assets/js/d3.min.js"></script>
114 114 <!-- EventProxy -->
... ... @@ -135,7 +135,7 @@
135 135 <!-- js tree -->
136 136 <script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script>
137 137 <!-- simple pinyin -->
138   -<script src="/assets/plugins/pinyin.js"></script>
  138 +<script src="/assets/plugins/pinyin.js" merge="plugins"></script>
139 139 <!-- qtip -->
140 140 <script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script>
141 141  
... ... @@ -175,9 +175,9 @@
175 175 <script src="/real_control_v2/js/utils/tts.js" merge="custom_js"></script>
176 176  
177 177 <!-- echart -->
178   -<script src="/real_control_v2/assets/echarts-3/echarts.js"></script>
  178 +<script src="/real_control_v2/assets/echarts-3/echarts.js" merge="plugins"></script>
179 179 <!-- Geolib -->
180   -<script src="/real_control_v2/geolib/geolib.js"></script>
  180 +<script src="/real_control_v2/geolib/geolib.js" merge="plugins"></script>
181 181  
182 182 <script src="/real_control_v2/js/signal_state/signal_state.js" merge="custom_js"></script>
183 183 <script src="/real_control_v2/js/utils/dispatch_pattern.js" merge="custom_js"></script>
... ...
src/main/resources/static/real_control_v2/mapmonitor/real.html
1   -<link href="/assets/css/TrafficControl.css" rel="stylesheet"/>
2   -<link rel="stylesheet" href="/real_control_v2/assets/plugins/jquery.ui/themes/base/all.css"/>
3   -<link rel="stylesheet" href="/real_control_v2/assets/plugins/spectrum/spectrum.css"/>
4   -<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css"/>
  1 +<link href="/assets/css/TrafficControl.css" rel="stylesheet" merge="map_plugins"/>
  2 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/jquery.ui/themes/base/all.css" merge="map_plugins"/>
  3 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/spectrum/spectrum.css" merge="map_plugins"/>
  4 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css" merge="map_plugins"/>
5 5 <link rel="stylesheet" href="/real_control_v2/mapmonitor/css/real.css"/>
6   -<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css">
  6 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css" merge="map_plugins">
7 7  
8 8 <div class="map-system-msg flex-left">
9 9 <a class="z-depth-2" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a>
... ... @@ -50,21 +50,21 @@
50 50 </div>
51 51 </div>
52 52  
53   -<script src="/real_control_v2/assets/js/GeoUtils_min.js"></script>
54   -<script src="/real_control_v2/mapmonitor/js/config.js" merge="custom_map_js"></script>
55   -<script src="/real_control_v2/mapmonitor/js/gps_tree.js" merge="custom_map_js"></script>
56   -<script src="/real_control_v2/mapmonitor/js/spatial_data.js" merge="custom_map_js"></script>
57   -<script src="/real_control_v2/mapmonitor/js/map_overlay_manager.js" merge="custom_map_js"></script>
58   -<script src="/real_control_v2/mapmonitor/js/real.js" merge="custom_map_js"></script>
59   -<script src="/real_control_v2/mapmonitor/js/map/iMap.js" merge="custom_map_js"></script>
60   -<script src="/real_control_v2/mapmonitor/js/map/platform/baidu.js" merge="custom_map_js"></script>
61   -<script src="/real_control_v2/mapmonitor/js/map/platform/gaode.js" merge="custom_map_js"></script>
  53 +<script src="/real_control_v2/assets/js/GeoUtils_min.js" merge="map_plugins"></script>
  54 +<script src="/real_control_v2/mapmonitor/js/config.js" merge="map_custom_js"></script>
  55 +<script src="/real_control_v2/mapmonitor/js/gps_tree.js" merge="map_custom_js"></script>
  56 +<script src="/real_control_v2/mapmonitor/js/spatial_data.js" merge="map_custom_js"></script>
  57 +<script src="/real_control_v2/mapmonitor/js/map_overlay_manager.js" merge="map_custom_js"></script>
  58 +<script src="/real_control_v2/mapmonitor/js/real.js" ></script>
  59 +<script src="/real_control_v2/mapmonitor/js/map/iMap.js" merge="map_custom_js"></script>
  60 +<script src="/real_control_v2/mapmonitor/js/map/platform/baidu.js" merge="map_custom_js"></script>
  61 +<script src="/real_control_v2/mapmonitor/js/map/platform/gaode.js" merge="map_custom_js"></script>
62 62 <!-- jquery ui -->
63   -<script src="/real_control_v2/assets/plugins/jquery.ui/core.js"></script>
64   -<script src="/real_control_v2/assets/plugins/jquery.ui/widget.js"></script>
65   -<script src="/real_control_v2/assets/plugins/jquery.ui/mouse.js"></script>
66   -<script src="/real_control_v2/assets/plugins/jquery.ui/resizable.js"></script>
  63 +<script src="/real_control_v2/assets/plugins/jquery.ui/core.js" merge="map_plugins"></script>
  64 +<script src="/real_control_v2/assets/plugins/jquery.ui/widget.js" merge="map_plugins"></script>
  65 +<script src="/real_control_v2/assets/plugins/jquery.ui/mouse.js" merge="map_plugins"></script>
  66 +<script src="/real_control_v2/assets/plugins/jquery.ui/resizable.js" merge="map_plugins"></script>
67 67 <!-- 颜色选择器 -->
68   -<script src="/real_control_v2/assets/plugins/spectrum/spectrum.js"></script>
  68 +<script src="/real_control_v2/assets/plugins/spectrum/spectrum.js" merge="map_plugins"></script>
69 69 <!-- play back -->
70   -<script src="/real_control_v2/mapmonitor/js/playback.js" merge="custom_map_js"></script>
71 70 \ No newline at end of file
  71 +<script src="/real_control_v2/mapmonitor/js/playback.js" merge="map_custom_js"></script>
72 72 \ No newline at end of file
... ...