Commit b2e023d339e0f9f8572bf94b5dfe80de39b8bd80
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
# Conflicts: # src/main/resources/fatso/handle_real_ctl.js
Showing
7 changed files
with
124 additions
and
87 deletions
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
| ... | ... | @@ -1408,14 +1408,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1408 | 1408 | double ljgl=culateService.culateLjgl(lists); |
| 1409 | 1409 | |
| 1410 | 1410 | map.put("jhlc", culateService.culateJhgl(list)); //计划里程 |
| 1411 | - map.put("remMileage", culateService.culateLbgl(lists)); //烂班公里 | |
| 1411 | + map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 | |
| 1412 | 1412 | map.put("addMileage", ljgl); //临加公里 |
| 1413 | 1413 | map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 |
| 1414 | 1414 | map.put("ksgl", ksgl);//空驶公里 |
| 1415 | 1415 | map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); |
| 1416 | 1416 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); |
| 1417 | 1417 | map.put("jhbc", culateService.culateJhbc(list,"")); |
| 1418 | - map.put("cjbc", culateService.culateLbbc(lists)); | |
| 1418 | + map.put("cjbc", culateService.culateLbbc(list)); | |
| 1419 | 1419 | map.put("ljbc", culateService.culateLjbc(lists,"")); |
| 1420 | 1420 | map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,"")); |
| 1421 | 1421 | map.put("jcclc", jccgl); | ... | ... |
src/main/resources/fatso/handle_real_ctl.js
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 | +} | ... | ... |