Commit 78833caa8144ca20987ca7358548ed58a36ff60d
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control into pudong
Showing
13 changed files
with
303 additions
and
91 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| 1 | package com.bsth.controller.realcontrol; | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | ||
| 3 | +import java.io.ByteArrayOutputStream; | ||
| 4 | +import java.io.IOException; | ||
| 5 | +import java.io.InputStream; | ||
| 6 | +import java.io.OutputStream; | ||
| 7 | +import java.net.HttpURLConnection; | ||
| 8 | +import java.net.URL; | ||
| 9 | +import java.util.ArrayList; | ||
| 10 | +import java.util.Collection; | ||
| 11 | +import java.util.HashMap; | ||
| 12 | +import java.util.List; | ||
| 13 | +import java.util.Map; | ||
| 14 | + | ||
| 15 | +import org.apache.commons.io.IOUtils; | ||
| 16 | +import org.apache.commons.lang3.StringEscapeUtils; | ||
| 17 | +import org.joda.time.format.DateTimeFormat; | ||
| 18 | +import org.joda.time.format.DateTimeFormatter; | ||
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | +import org.springframework.web.bind.annotation.PathVariable; | ||
| 21 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 22 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 23 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 24 | +import org.springframework.web.bind.annotation.RestController; | ||
| 25 | + | ||
| 3 | import com.alibaba.fastjson.JSONArray; | 26 | import com.alibaba.fastjson.JSONArray; |
| 4 | import com.bsth.common.ResponseCode; | 27 | import com.bsth.common.ResponseCode; |
| 5 | import com.bsth.controller.BaseController; | 28 | import com.bsth.controller.BaseController; |
| @@ -10,14 +33,11 @@ import com.bsth.data.schedule.DayOfSchedule; | @@ -10,14 +33,11 @@ import com.bsth.data.schedule.DayOfSchedule; | ||
| 10 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | 33 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; |
| 11 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 34 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 12 | import com.bsth.entity.schedule.SchedulePlanInfo; | 35 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 36 | +import com.bsth.entity.sys.SysUser; | ||
| 37 | +import com.bsth.security.util.SecurityUtils; | ||
| 13 | import com.bsth.service.realcontrol.ScheduleRealInfoService; | 38 | import com.bsth.service.realcontrol.ScheduleRealInfoService; |
| 14 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 15 | -import org.joda.time.format.DateTimeFormat; | ||
| 16 | -import org.joda.time.format.DateTimeFormatter; | ||
| 17 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 18 | -import org.springframework.web.bind.annotation.*; | ||
| 19 | - | ||
| 20 | -import java.util.*; | 39 | +import com.bsth.util.ConfigUtil; |
| 40 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 21 | 41 | ||
| 22 | @RestController | 42 | @RestController |
| 23 | @RequestMapping("/realSchedule") | 43 | @RequestMapping("/realSchedule") |
| @@ -691,4 +711,74 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -691,4 +711,74 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 691 | public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | 711 | public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ |
| 692 | return scheduleRealInfoService.deleteToHistory(id); | 712 | return scheduleRealInfoService.deleteToHistory(id); |
| 693 | } | 713 | } |
| 714 | + | ||
| 715 | + /** | ||
| 716 | + * 从历史库里删除临加班次 | ||
| 717 | + * @param sch | ||
| 718 | + * @return | ||
| 719 | + */ | ||
| 720 | + @RequestMapping(value = "wxsb", method = RequestMethod.POST) | ||
| 721 | + public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){ | ||
| 722 | + SysUser user = SecurityUtils.getCurrentUser(); | ||
| 723 | + String uname = user.getUserName(); | ||
| 724 | + StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url")); | ||
| 725 | + url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType")); | ||
| 726 | + // 分公司保存格式 分公司编码_公司编码 | ||
| 727 | + String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm")); | ||
| 728 | + String[] arr = val.split("_"); | ||
| 729 | + if (!"22".equals(arr[1])) { | ||
| 730 | + Map<String, Object> res = new HashMap<String, Object>(); | ||
| 731 | + res.put("status", ResponseCode.ERROR); | ||
| 732 | + res.put("msg", "除金高公司外暂未开通此功能"); | ||
| 733 | + | ||
| 734 | + return res; | ||
| 735 | + } | ||
| 736 | + url.append("&fgs=").append(arr[0]); | ||
| 737 | + | ||
| 738 | + return request(url.toString()); | ||
| 739 | + } | ||
| 740 | + | ||
| 741 | + @SuppressWarnings("unchecked") | ||
| 742 | + private static Map<String, Object> request(String url) { | ||
| 743 | + Map<String, Object> res = new HashMap<String, Object>(); | ||
| 744 | + res.put("status", ResponseCode.SUCCESS); | ||
| 745 | + InputStream in = null; | ||
| 746 | + HttpURLConnection con = null; | ||
| 747 | + try { | ||
| 748 | + con = (HttpURLConnection)new URL(url).openConnection(); | ||
| 749 | + con.setRequestMethod("POST"); | ||
| 750 | + con.setRequestProperty("keep-alive", "true"); | ||
| 751 | + con.setRequestProperty("accept", "application/json"); | ||
| 752 | + con.setRequestProperty("content-type", "application/json"); | ||
| 753 | + con.setDoInput(true); | ||
| 754 | + con.setReadTimeout(2500); | ||
| 755 | + con.setConnectTimeout(2500); | ||
| 756 | + | ||
| 757 | + con.connect(); | ||
| 758 | + if (con.getResponseCode() == 200) { | ||
| 759 | + in = con.getInputStream(); | ||
| 760 | + ByteArrayOutputStream bout = new ByteArrayOutputStream(); | ||
| 761 | + IOUtils.copy(in, bout); bout.close(); | ||
| 762 | + Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class); | ||
| 763 | + if (!"报修成功".equals(response.get("msg"))) { | ||
| 764 | + res.put("status", ResponseCode.ERROR); | ||
| 765 | + res.putAll(response); | ||
| 766 | + } | ||
| 767 | + } | ||
| 768 | + } catch (IOException e) { | ||
| 769 | + // TODO Auto-generated catch block | ||
| 770 | + res.put("status", ResponseCode.ERROR); | ||
| 771 | + res.put("msg", "调用上报接口异常"); | ||
| 772 | + } finally { | ||
| 773 | + try { | ||
| 774 | + if (in != null) in.close(); | ||
| 775 | + if (con != null) con.disconnect(); | ||
| 776 | + } catch (IOException e) { | ||
| 777 | + // TODO Auto-generated catch block | ||
| 778 | + e.printStackTrace(); | ||
| 779 | + } | ||
| 780 | + } | ||
| 781 | + | ||
| 782 | + return res; | ||
| 783 | + } | ||
| 694 | } | 784 | } |
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| @@ -121,7 +121,7 @@ public class InStationProcess { | @@ -121,7 +121,7 @@ public class InStationProcess { | ||
| 121 | private void inEndStation(ScheduleRealInfo sch, GpsEntity gps) { | 121 | private void inEndStation(ScheduleRealInfo sch, GpsEntity gps) { |
| 122 | String nbbm = sch.getClZbh(); | 122 | String nbbm = sch.getClZbh(); |
| 123 | //校验进站前置约束 | 123 | //校验进站前置约束 |
| 124 | - if (!validInPremise(gps)) | 124 | + if (!validInPremise(gps) && isNormalSch(sch)) |
| 125 | return; | 125 | return; |
| 126 | 126 | ||
| 127 | //实达时间不覆盖 | 127 | //实达时间不覆盖 |
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
| @@ -74,7 +74,7 @@ public class OutStationProcess { | @@ -74,7 +74,7 @@ public class OutStationProcess { | ||
| 74 | * @param gps | 74 | * @param gps |
| 75 | */ | 75 | */ |
| 76 | private void outStation(GpsEntity gps, GpsEntity prev) { | 76 | private void outStation(GpsEntity gps, GpsEntity prev) { |
| 77 | - logger.info("进站记录(到达时间:" + gps.getArrTime() + " 进出站状态:" + gps.getInstation() + " 站点编号:" + gps.getStopNo() + " deviceId:" + gps.getDeviceId() + " nbbm:" + gps.getNbbm() + ")"); | 77 | + logger.info("出站记录(到达时间:" + gps.getArrTime() + " 进出站状态:" + gps.getInstation() + " 站点编号:" + gps.getStopNo() + " deviceId:" + gps.getDeviceId() + " nbbm:" + gps.getNbbm() + ")"); |
| 78 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | 78 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); |
| 79 | 79 | ||
| 80 | //起点发车 | 80 | //起点发车 |
src/main/java/com/bsth/entity/mcy_forms/Shifday.java
| @@ -35,6 +35,8 @@ public class Shifday { | @@ -35,6 +35,8 @@ public class Shifday { | ||
| 35 | private String sjbc;//实际班次 | 35 | private String sjbc;//实际班次 |
| 36 | 36 | ||
| 37 | private String jgh; | 37 | private String jgh; |
| 38 | + | ||
| 39 | + private String sgh; | ||
| 38 | 40 | ||
| 39 | private String zbh; | 41 | private String zbh; |
| 40 | 42 | ||
| @@ -56,6 +58,14 @@ public class Shifday { | @@ -56,6 +58,14 @@ public class Shifday { | ||
| 56 | this.jgh = jgh; | 58 | this.jgh = jgh; |
| 57 | } | 59 | } |
| 58 | 60 | ||
| 61 | + public String getSgh() { | ||
| 62 | + return sgh; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void setSgh(String sgh) { | ||
| 66 | + this.sgh = sgh; | ||
| 67 | + } | ||
| 68 | + | ||
| 59 | public String getZbh() { | 69 | public String getZbh() { |
| 60 | return zbh; | 70 | return zbh; |
| 61 | } | 71 | } |
src/main/java/com/bsth/filter/AccessLogFilter.java
| @@ -58,9 +58,11 @@ public class AccessLogFilter extends BaseFilter { | @@ -58,9 +58,11 @@ public class AccessLogFilter extends BaseFilter { | ||
| 58 | s.append(getBlock(params)); | 58 | s.append(getBlock(params)); |
| 59 | s.append(getBlock(headers)); | 59 | s.append(getBlock(headers)); |
| 60 | s.append(getBlock(request.getHeader("Referer"))); | 60 | s.append(getBlock(request.getHeader("Referer"))); |
| 61 | - | ||
| 62 | - logger.info(s.toString()); | 61 | + |
| 62 | + long now = System.currentTimeMillis(); | ||
| 63 | chain.doFilter(request, response); | 63 | chain.doFilter(request, response); |
| 64 | + s.append("<cost time:").append(System.currentTimeMillis() - now).append(">"); | ||
| 65 | + logger.info(s.toString()); | ||
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | private static String getParams(HttpServletRequest request) { | 68 | private static String getParams(HttpServletRequest request) { |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -596,7 +596,7 @@ public class FormsServiceImpl implements FormsService { | @@ -596,7 +596,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 596 | @Override | 596 | @Override |
| 597 | public List<Shifday> shifday(Map<String, Object> map) { | 597 | public List<Shifday> shifday(Map<String, Object> map) { |
| 598 | 598 | ||
| 599 | - String line=""; | 599 | + String line=""; |
| 600 | String date=""; | 600 | String date=""; |
| 601 | String gsdmShif=""; | 601 | String gsdmShif=""; |
| 602 | String fgsdmShif=""; | 602 | String fgsdmShif=""; |
| @@ -624,18 +624,17 @@ public class FormsServiceImpl implements FormsService { | @@ -624,18 +624,17 @@ public class FormsServiceImpl implements FormsService { | ||
| 624 | if(!type.equals("") && !statue.equals("")){ | 624 | if(!type.equals("") && !statue.equals("")){ |
| 625 | sql_ +=" order by "+statue+" "+type; | 625 | sql_ +=" order by "+statue+" "+type; |
| 626 | } | 626 | } |
| 627 | - String sql ="select t.* from (select r.schedule_date,r.j_name," | ||
| 628 | - + "IFNULL(r.s_name,'')as s_name," | ||
| 629 | - + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " | ||
| 630 | - + "FROM bsth_c_s_sp_info_real r where 1=1 " | ||
| 631 | - + " and r.schedule_date_str='"+date + "' " | 627 | + String sql ="select t.* from (select r.schedule_date," |
| 628 | + + " IFNULL(r.s_gh,'')as s_gh,r.cl_zbh," | ||
| 629 | + + " r.xl_bm,r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name" | ||
| 630 | + + " FROM bsth_c_s_sp_info_real r where 1=1 " | ||
| 631 | + + " and r.schedule_date_str='"+date + "' " | ||
| 632 | + " and r.xl_bm = '"+line+"' " | 632 | + " and r.xl_bm = '"+line+"' " |
| 633 | + " and r.gs_bm like '%"+gsdmShif+"%' " | 633 | + " and r.gs_bm like '%"+gsdmShif+"%' " |
| 634 | - + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" | ||
| 635 | - + " GROUP BY t.schedule_date,t.j_name,t.s_name, " | ||
| 636 | - + "t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm,t.lp_name " | ||
| 637 | - + sql_; | ||
| 638 | - | 634 | + + " and r.fgs_bm like '%"+fgsdmShif+"%' "+sql_+") t" |
| 635 | + + " GROUP BY t.schedule_date,t.xl_bm,t.cl_zbh,t.lp_name," | ||
| 636 | + + " t.j_gh,t.s_gh,t.gs_bm,t.fgs_bm "; | ||
| 637 | + | ||
| 639 | 638 | ||
| 640 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { | 639 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { |
| 641 | 640 | ||
| @@ -643,15 +642,16 @@ public class FormsServiceImpl implements FormsService { | @@ -643,15 +642,16 @@ public class FormsServiceImpl implements FormsService { | ||
| 643 | public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { | 642 | public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 644 | Shifday shifday = new Shifday(); | 643 | Shifday shifday = new Shifday(); |
| 645 | shifday.setRq(arg0.getString("schedule_date")); | 644 | shifday.setRq(arg0.getString("schedule_date")); |
| 646 | - shifday.setjName(arg0.getString("j_name").toString()); | ||
| 647 | - shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); | 645 | +// shifday.setjName(arg0.getString("j_name").toString()); |
| 646 | +// shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); | ||
| 648 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); | 647 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); |
| 649 | shifday.setJgh(arg0.getString("j_gh")); | 648 | shifday.setJgh(arg0.getString("j_gh")); |
| 649 | + shifday.setSgh(arg0.getString("s_gh") == null ? "" : arg0.getString("s_gh").toString()); | ||
| 650 | shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString()); | 650 | shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString()); |
| 651 | return shifday; | 651 | return shifday; |
| 652 | } | 652 | } |
| 653 | - | ||
| 654 | }); | 653 | }); |
| 654 | + | ||
| 655 | List<ScheduleRealInfo> sList; | 655 | List<ScheduleRealInfo> sList; |
| 656 | List<ScheduleRealInfo> list_s; | 656 | List<ScheduleRealInfo> list_s; |
| 657 | List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); | 657 | List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); |
| @@ -661,8 +661,9 @@ public class FormsServiceImpl implements FormsService { | @@ -661,8 +661,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 661 | Shifday d=list.get(i); | 661 | Shifday d=list.get(i); |
| 662 | for (int j = 0; j < lists.size(); j++) { | 662 | for (int j = 0; j < lists.size(); j++) { |
| 663 | ScheduleRealInfo s=lists.get(j); | 663 | ScheduleRealInfo s=lists.get(j); |
| 664 | - if(d.getJgh().equals(s.getjGh()) && d.getCarPlate().equals(s.getClZbh()) | ||
| 665 | - &&d.getLpName().equals(s.getLpName())){ | 664 | + if(d.getJgh().equals(s.getjGh()) && d.getSgh().equals(s.getsGh()) |
| 665 | + && d.getCarPlate().equals(s.getClZbh()) | ||
| 666 | + && d.getLpName().equals(s.getLpName())){ | ||
| 666 | sList.add(s); | 667 | sList.add(s); |
| 667 | Set<ChildTaskPlan> cts = s.getcTasks(); | 668 | Set<ChildTaskPlan> cts = s.getcTasks(); |
| 668 | if(cts != null && cts.size() > 0){ | 669 | if(cts != null && cts.size() > 0){ |
| @@ -674,7 +675,10 @@ public class FormsServiceImpl implements FormsService { | @@ -674,7 +675,10 @@ public class FormsServiceImpl implements FormsService { | ||
| 674 | } | 675 | } |
| 675 | } | 676 | } |
| 676 | } | 677 | } |
| 677 | - | 678 | + if(sList.size()>0){ |
| 679 | + d.setjName(sList.get(0).getjName()); | ||
| 680 | + d.setsName(sList.get(0).getsName() == null ? "":sList.get(0).getsName()); | ||
| 681 | + } | ||
| 678 | double ksgl=culateMileageService.culateKsgl(list_s); | 682 | double ksgl=culateMileageService.culateKsgl(list_s); |
| 679 | double jccgl=culateMileageService.culateJccgl(list_s); | 683 | double jccgl=culateMileageService.culateJccgl(list_s); |
| 680 | double zksgl=Arith.add(ksgl, jccgl); | 684 | double zksgl=Arith.add(ksgl, jccgl); |
| @@ -893,7 +897,9 @@ public class FormsServiceImpl implements FormsService { | @@ -893,7 +897,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 893 | if(fgsdm.length() != 0){ | 897 | if(fgsdm.length() != 0){ |
| 894 | sql += " and r.fgs_bm ='"+fgsdm+"'"; | 898 | sql += " and r.fgs_bm ='"+fgsdm+"'"; |
| 895 | } | 899 | } |
| 896 | - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh"; | 900 | + sql += " group by r.fgs_bm,r.j_gh,r.xl_bm,r.cl_zbh,r.j_name " + |
| 901 | + "order by r.xl_bm,r.cl_zbh"; | ||
| 902 | + | ||
| 897 | 903 | ||
| 898 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 904 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 899 | @Override | 905 | @Override |
| @@ -924,7 +930,7 @@ public class FormsServiceImpl implements FormsService { | @@ -924,7 +930,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 924 | + " WHERE rq = '"+startDate+"'" | 930 | + " WHERE rq = '"+startDate+"'" |
| 925 | + linesql | 931 | + linesql |
| 926 | + " union" | 932 | + " union" |
| 927 | - + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" | 933 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" |
| 928 | + " WHERE rq = '"+startDate+"'" | 934 | + " WHERE rq = '"+startDate+"'" |
| 929 | + linesql; | 935 | + linesql; |
| 930 | List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | 936 | List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -400,7 +400,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -400,7 +400,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 400 | sql += " and cl.line_code = '"+line+"'"; | 400 | sql += " and cl.line_code = '"+line+"'"; |
| 401 | if(ttId.length() != 0) | 401 | if(ttId.length() != 0) |
| 402 | sql += " and td.ttinfo = '"+ttId+"'"; | 402 | sql += " and td.ttinfo = '"+ttId+"'"; |
| 403 | - sql += " group by td.lp"; | 403 | + sql += " group by td.lp, lp.lp_name"; |
| 404 | 404 | ||
| 405 | list = jdbcTemplate.query(sql, | 405 | list = jdbcTemplate.query(sql, |
| 406 | new RowMapper<Map<String, Object>>(){ | 406 | new RowMapper<Map<String, Object>>(){ |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -611,111 +611,119 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -611,111 +611,119 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 611 | * 临加班次 | 611 | * 临加班次 |
| 612 | */ | 612 | */ |
| 613 | @Override | 613 | @Override |
| 614 | - public Map<String, Object> save(ScheduleRealInfo t) { | 614 | + public Map<String, Object> save(ScheduleRealInfo sch) { |
| 615 | Map<String, Object> rs = new HashMap<>(); | 615 | Map<String, Object> rs = new HashMap<>(); |
| 616 | try { | 616 | try { |
| 617 | - if (!carExist(t.getGsBm(), t.getClZbh())) { | ||
| 618 | - rs.put("msg", "车辆 " + t.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | ||
| 619 | - rs.put("status", ResponseCode.ERROR); | ||
| 620 | - return rs; | 617 | + String clZbh = sch.getClZbh(); |
| 618 | + if (StringUtils.isNotEmpty(clZbh)) { | ||
| 619 | + //检测 | ||
| 620 | + if (!carExist(sch.getGsBm(), clZbh)) { | ||
| 621 | + rs.put("status", ResponseCode.ERROR); | ||
| 622 | + rs.put("msg", "车辆 " + clZbh + " 不存在!"); | ||
| 623 | + return rs; | ||
| 624 | + } else if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(clZbh))) { | ||
| 625 | + rs.put("status", ResponseCode.ERROR); | ||
| 626 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + clZbh + "】的车辆"); | ||
| 627 | + return rs; | ||
| 628 | + } | ||
| 621 | } | 629 | } |
| 622 | 630 | ||
| 623 | SysUser user = SecurityUtils.getCurrentUser(); | 631 | SysUser user = SecurityUtils.getCurrentUser(); |
| 624 | - String schDate = DayOfSchedule.currSchDateMap.get(t.getXlBm()); | 632 | + String schDate = DayOfSchedule.currSchDateMap.get(sch.getXlBm()); |
| 625 | 633 | ||
| 626 | SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"), sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm"); | 634 | SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"), sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm"); |
| 627 | 635 | ||
| 628 | - if (StringUtils.isEmpty(t.getjGh())) { | 636 | + if (StringUtils.isEmpty(sch.getjGh())) { |
| 629 | rs.put("status", ResponseCode.ERROR); | 637 | rs.put("status", ResponseCode.ERROR); |
| 630 | rs.put("msg", "驾驶员工号不能为空!"); | 638 | rs.put("msg", "驾驶员工号不能为空!"); |
| 631 | return rs; | 639 | return rs; |
| 632 | } | 640 | } |
| 633 | //截取驾驶员工号 | 641 | //截取驾驶员工号 |
| 634 | - if (t.getjGh().indexOf("-") != -1) { | ||
| 635 | - t.setjGh(t.getjGh().split("-")[1]); | 642 | + if (sch.getjGh().indexOf("-") != -1) { |
| 643 | + sch.setjGh(sch.getjGh().split("-")[1]); | ||
| 636 | } | 644 | } |
| 637 | //检查驾驶员工号 | 645 | //检查驾驶员工号 |
| 638 | - String jName = getPersonName(t.getGsBm(), t.getjGh()); | 646 | + String jName = getPersonName(sch.getGsBm(), sch.getjGh()); |
| 639 | if (StringUtils.isEmpty(jName)) { | 647 | if (StringUtils.isEmpty(jName)) { |
| 640 | - rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); | 648 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); |
| 641 | rs.put("status", ResponseCode.ERROR); | 649 | rs.put("status", ResponseCode.ERROR); |
| 642 | return rs; | 650 | return rs; |
| 643 | - } else if (StringUtils.isEmpty(t.getjName())) { | ||
| 644 | - t.setjName(jName);//补上驾驶员名称 | 651 | + } else if (StringUtils.isEmpty(sch.getjName())) { |
| 652 | + sch.setjName(jName);//补上驾驶员名称 | ||
| 645 | } | 653 | } |
| 646 | 654 | ||
| 647 | //有售票员 | 655 | //有售票员 |
| 648 | - if (StringUtils.isNotEmpty(t.getsGh())) { | ||
| 649 | - String sName = getPersonName(t.getGsBm(), t.getsGh()); | 656 | + if (StringUtils.isNotEmpty(sch.getsGh())) { |
| 657 | + String sName = getPersonName(sch.getGsBm(), sch.getsGh()); | ||
| 650 | if (StringUtils.isEmpty(sName)) { | 658 | if (StringUtils.isEmpty(sName)) { |
| 651 | - rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); | 659 | + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的售票员"); |
| 652 | rs.put("status", ResponseCode.ERROR); | 660 | rs.put("status", ResponseCode.ERROR); |
| 653 | return rs; | 661 | return rs; |
| 654 | - } else if (StringUtils.isEmpty(t.getsName())) { | ||
| 655 | - t.setsName(sName);//补上售票员名称 | 662 | + } else if (StringUtils.isEmpty(sch.getsName())) { |
| 663 | + sch.setsName(sName);//补上售票员名称 | ||
| 656 | } | 664 | } |
| 657 | } else { | 665 | } else { |
| 658 | - t.setsGh(""); | ||
| 659 | - t.setsName(""); | 666 | + sch.setsGh(""); |
| 667 | + sch.setsName(""); | ||
| 660 | } | 668 | } |
| 661 | 669 | ||
| 662 | //公司 和 分公司名称 | 670 | //公司 和 分公司名称 |
| 663 | - t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm())); | ||
| 664 | - t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getFgsBm() + "_" + t.getGsBm())); | ||
| 665 | - t.setCreateDate(new Date()); | ||
| 666 | - t.setScheduleDateStr(schDate); | ||
| 667 | - t.setScheduleDate(sdfyyyyMMdd.parse(schDate)); | ||
| 668 | - t.setRealExecDate(schDate); | ||
| 669 | - | ||
| 670 | - t.setCreateBy(user); | ||
| 671 | - t.setSflj(true); | ||
| 672 | - t.setLate(false); | ||
| 673 | - t.setDfsj(t.getFcsj()); | ||
| 674 | - t.setZdsjT(sdfyyyyMMddHHmm.parse(schDate + t.getZdsj()).getTime()); | ||
| 675 | - t.setJhlcOrig(t.getJhlc()); | ||
| 676 | - t.setCreateDate(new Date()); | ||
| 677 | - t.setUpdateDate(new Date()); | ||
| 678 | - t.setSpId(-1L); | 671 | + sch.setGsName(BasicData.businessCodeNameMap.get(sch.getGsBm())); |
| 672 | + sch.setFgsName(BasicData.businessFgsCodeNameMap.get(sch.getFgsBm() + "_" + sch.getGsBm())); | ||
| 673 | + sch.setCreateDate(new Date()); | ||
| 674 | + sch.setScheduleDateStr(schDate); | ||
| 675 | + sch.setScheduleDate(sdfyyyyMMdd.parse(schDate)); | ||
| 676 | + sch.setRealExecDate(schDate); | ||
| 677 | + | ||
| 678 | + sch.setCreateBy(user); | ||
| 679 | + sch.setSflj(true); | ||
| 680 | + sch.setLate(false); | ||
| 681 | + sch.setDfsj(sch.getFcsj()); | ||
| 682 | + sch.setZdsjT(sdfyyyyMMddHHmm.parse(schDate + sch.getZdsj()).getTime()); | ||
| 683 | + sch.setJhlcOrig(sch.getJhlc()); | ||
| 684 | + sch.setCreateDate(new Date()); | ||
| 685 | + sch.setUpdateDate(new Date()); | ||
| 686 | + sch.setSpId(-1L); | ||
| 679 | //起终点名称 | 687 | //起终点名称 |
| 680 | - String prefix = t.getXlBm() + "_" + t.getXlDir() + "_"; | ||
| 681 | - t.setQdzName(BasicData.getStationNameByCode(t.getQdzCode(), prefix)); | ||
| 682 | - t.setZdzName(BasicData.getStationNameByCode(t.getZdzCode(), prefix)); | 688 | + String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; |
| 689 | + sch.setQdzName(BasicData.getStationNameByCode(sch.getQdzCode(), prefix)); | ||
| 690 | + sch.setZdzName(BasicData.getStationNameByCode(sch.getZdzCode(), prefix)); | ||
| 683 | 691 | ||
| 684 | //计算班次实际执行时间 | 692 | //计算班次实际执行时间 |
| 685 | - schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t); | 693 | + schAttrCalculator.calcRealDate(sch).calcAllTimeByFcsj(sch); |
| 686 | 694 | ||
| 687 | //处理计达跨24点 | 695 | //处理计达跨24点 |
| 688 | - LineConfig conf = lineConfigData.get(t.getXlBm()); | ||
| 689 | - if (t.getZdsj().compareTo(conf.getStartOpt()) < 0) { | ||
| 690 | - t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24)); | 696 | + LineConfig conf = lineConfigData.get(sch.getXlBm()); |
| 697 | + if (sch.getZdsj().compareTo(conf.getStartOpt()) < 0) { | ||
| 698 | + sch.setZdsjT(sdfyyyyMMddHHmm.parse(sch.getScheduleDateStr() + sch.getZdsj()).getTime() + (1000 * 60 * 60 * 24)); | ||
| 691 | } | 699 | } |
| 692 | 700 | ||
| 693 | //班次历时 | 701 | //班次历时 |
| 694 | - t.setBcsj((int) ((t.getZdsjT() - t.getDfsjT()) / 1000 / 60)); | ||
| 695 | - if (t.getZdsjT() < t.getFcsjT()) { | 702 | + sch.setBcsj((int) ((sch.getZdsjT() - sch.getDfsjT()) / 1000 / 60)); |
| 703 | + if (sch.getZdsjT() < sch.getFcsjT()) { | ||
| 696 | rs.put("status", ResponseCode.ERROR); | 704 | rs.put("status", ResponseCode.ERROR); |
| 697 | rs.put("msg", "起终点时间异常!"); | 705 | rs.put("msg", "起终点时间异常!"); |
| 698 | return rs; | 706 | return rs; |
| 699 | } | 707 | } |
| 700 | 708 | ||
| 701 | - t.setId(dayOfSchedule.getId()); | 709 | + sch.setId(dayOfSchedule.getId()); |
| 702 | //实时入库 | 710 | //实时入库 |
| 703 | - super.save(t); | 711 | + super.save(sch); |
| 704 | 712 | ||
| 705 | // 加入缓存 | 713 | // 加入缓存 |
| 706 | - dayOfSchedule.put(t); | 714 | + dayOfSchedule.put(sch); |
| 707 | 715 | ||
| 708 | //更新起点应到时间 | 716 | //更新起点应到时间 |
| 709 | - List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(t); | 717 | + List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch); |
| 710 | 718 | ||
| 711 | //重新计算车辆当前执行班次 | 719 | //重新计算车辆当前执行班次 |
| 712 | - dayOfSchedule.reCalcExecPlan(t.getClZbh()); | 720 | + dayOfSchedule.reCalcExecPlan(sch.getClZbh()); |
| 713 | 721 | ||
| 714 | //记录站到场历时数据 | 722 | //记录站到场历时数据 |
| 715 | - Station2ParkBuffer.put(t); | 723 | + Station2ParkBuffer.put(sch); |
| 716 | 724 | ||
| 717 | rs.put("ts", ts); | 725 | rs.put("ts", ts); |
| 718 | - rs.put("t", t); | 726 | + rs.put("t", sch); |
| 719 | } catch (Exception e) { | 727 | } catch (Exception e) { |
| 720 | logger.error("", e); | 728 | logger.error("", e); |
| 721 | rs.put("status", ResponseCode.ERROR); | 729 | rs.put("status", ResponseCode.ERROR); |
src/main/resources/application-prod.properties
| @@ -17,15 +17,22 @@ spring.datasource.max-idle=8 | @@ -17,15 +17,22 @@ spring.datasource.max-idle=8 | ||
| 17 | spring.datasource.min-idle=8 | 17 | spring.datasource.min-idle=8 |
| 18 | spring.datasource.initial-size=5 | 18 | spring.datasource.initial-size=5 |
| 19 | 19 | ||
| 20 | +spring.datasource.max-wait=10000 | ||
| 21 | +spring.datasource.remove-abandoned=true | ||
| 22 | +spring.datasource.remove-abandoned-timeout=120 | ||
| 23 | + | ||
| 20 | spring.datasource.test-on-borrow=true | 24 | spring.datasource.test-on-borrow=true |
| 21 | spring.datasource.test-on-connect=true | 25 | spring.datasource.test-on-connect=true |
| 22 | spring.datasource.test-on-return=true | 26 | spring.datasource.test-on-return=true |
| 23 | spring.datasource.test-while-idle=true | 27 | spring.datasource.test-while-idle=true |
| 24 | spring.datasource.validation-query=select 1 | 28 | spring.datasource.validation-query=select 1 |
| 29 | +spring.datasource.time-between-eviction-runs-millis=1800000 | ||
| 25 | 30 | ||
| 26 | ## gps client data | 31 | ## gps client data |
| 27 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | 32 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all |
| 28 | ## gateway real data | 33 | ## gateway real data |
| 29 | http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | 34 | http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ |
| 30 | ## gateway send directive | 35 | ## gateway send directive |
| 31 | -http.send.directive = http://10.10.200.79:8080/transport_server/message/ | ||
| 32 | \ No newline at end of file | 36 | \ No newline at end of file |
| 37 | +http.send.directive = http://10.10.200.79:8080/transport_server/message/ | ||
| 38 | +## maintenance report | ||
| 39 | +http.report.url = http://116.247.73.122:9098/jgjwsystem_j2ee/ | ||
| 33 | \ No newline at end of file | 40 | \ No newline at end of file |
src/main/resources/application.properties
src/main/resources/static/pages/trafficManage/js/timeTempletUploadRecord.js
| @@ -201,7 +201,7 @@ | @@ -201,7 +201,7 @@ | ||
| 201 | // 绑定查询事件 | 201 | // 绑定查询事件 |
| 202 | $("#search").click(searchM); | 202 | $("#search").click(searchM); |
| 203 | // 查询方法 | 203 | // 查询方法 |
| 204 | - function searchM(p, pagination) { | 204 | + function searchM() { |
| 205 | var params = {}; | 205 | var params = {}; |
| 206 | // 取得输入框的值 | 206 | // 取得输入框的值 |
| 207 | var inputs = $(".breadcrumb input,select"); | 207 | var inputs = $(".breadcrumb input,select"); |
| @@ -209,6 +209,19 @@ | @@ -209,6 +209,19 @@ | ||
| 209 | $.each(inputs, function(i, element) { | 209 | $.each(inputs, function(i, element) { |
| 210 | params[$(element).attr("name")] = $(element).val(); | 210 | params[$(element).attr("name")] = $(element).val(); |
| 211 | }); | 211 | }); |
| 212 | + page = 0; | ||
| 213 | + loadTableDate(params,true); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + function loadTableDate(param,isPon) { | ||
| 217 | + // 搜索参数 | ||
| 218 | + var params = {}; | ||
| 219 | + if(param) | ||
| 220 | + params = param; | ||
| 221 | + // 排序(按更新时间) | ||
| 222 | + params['order'] = 'id'; | ||
| 223 | + // 记录当前页数 | ||
| 224 | + params['page'] = page; | ||
| 212 | var i = layer.load(2); | 225 | var i = layer.load(2); |
| 213 | $get('/skb_log', params, function(data) { | 226 | $get('/skb_log', params, function(data) { |
| 214 | var content = data.content; | 227 | var content = data.content; |
| @@ -217,7 +230,7 @@ | @@ -217,7 +230,7 @@ | ||
| 217 | list : content | 230 | list : content |
| 218 | }); | 231 | }); |
| 219 | $('#datatable_logger tbody').html(bodyHtm); | 232 | $('#datatable_logger tbody').html(bodyHtm); |
| 220 | - if(pagination && data.content.length > 0){ | 233 | + if(isPon && data.content.length > 0){ |
| 221 | //重新分页 | 234 | //重新分页 |
| 222 | initPagination = true; | 235 | initPagination = true; |
| 223 | showPagination(data); | 236 | showPagination(data); |
| @@ -250,10 +263,8 @@ | @@ -250,10 +263,8 @@ | ||
| 250 | initPagination = false; | 263 | initPagination = false; |
| 251 | return; | 264 | return; |
| 252 | } | 265 | } |
| 253 | - | ||
| 254 | - | ||
| 255 | page = num - 1; | 266 | page = num - 1; |
| 256 | - searchM(null, false); | 267 | + loadTableDate(null, false); |
| 257 | } | 268 | } |
| 258 | }); | 269 | }); |
| 259 | } | 270 | } |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/wxsb.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal ct_move_modal" id="schedule-wxsb-modal"> | ||
| 2 | + <div class="uk-modal-dialog"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>维修上报</h2></div> | ||
| 6 | + <form class="uk-form uk-form-horizontal"> | ||
| 7 | + </form> | ||
| 8 | + </div> | ||
| 9 | + | ||
| 10 | + <script id="schedule-wxsb-form-temp" type="text/html"> | ||
| 11 | + <input type="hidden" name="id" value="{{id}}"/> | ||
| 12 | + <div class="uk-grid"> | ||
| 13 | + <div class="uk-width-1-2"> | ||
| 14 | + <div class="uk-form-row"> | ||
| 15 | + <label class="uk-form-label" >车辆编码</label> | ||
| 16 | + <div class="uk-form-controls"> | ||
| 17 | + <input type="text" name="nbbm" value="{{clZbh}}" readonly> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="uk-width-1-2"> | ||
| 22 | + <div class="uk-form-row"> | ||
| 23 | + <label class="uk-form-label" >报修类型</label> | ||
| 24 | + <div class="uk-form-controls"> | ||
| 25 | + <select name="bxType"></select> | ||
| 26 | + </div> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | ||
| 31 | + <button type="button" class="uk-button uk-modal-close">取消</button> | ||
| 32 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | ||
| 33 | + </div> | ||
| 34 | + </script> | ||
| 35 | + | ||
| 36 | + <script> | ||
| 37 | + (function() { | ||
| 38 | + var modal = '#schedule-wxsb-modal' | ||
| 39 | + ,sch; | ||
| 40 | + | ||
| 41 | + $(modal).on('init', function(e, data) { | ||
| 42 | + e.stopPropagation(); | ||
| 43 | + sch=data.sch; | ||
| 44 | + var formHtml = template('schedule-wxsb-form-temp', sch); | ||
| 45 | + $('form', modal).html(formHtml); | ||
| 46 | + | ||
| 47 | + //班次类型字典 | ||
| 48 | + var bxtypes=[{code:"9101", des:"轨迹不连续"}, {code:"9102", des:"无轨迹"}, {code:"9103", des:"收不到调度指令"}, {code:"9104", des:"漂移"}, {code:"9109", des:"其它"}],opts=''; | ||
| 49 | + for(var i = 0;i < bxtypes.length;i++){ | ||
| 50 | + opts+='<option value="'+bxtypes[i].code+'">'+bxtypes[i].des+'</option>'; | ||
| 51 | + } | ||
| 52 | + $('[name=bxType]', modal).html(opts); | ||
| 53 | + | ||
| 54 | + //submit | ||
| 55 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | ||
| 56 | + f.on('success.form.fv', function(e) { | ||
| 57 | + e.preventDefault(); | ||
| 58 | + $('[type=submit]', f).attr('disabled', 'disabled'); | ||
| 59 | + var data = $(this).serializeJSON(); | ||
| 60 | + gb_common.$post('/realSchedule/wxsb', data, function(rs){ | ||
| 61 | + //更新班次信息 | ||
| 62 | + notify_succ('操作成功!'); | ||
| 63 | + UIkit.modal(modal).hide(); | ||
| 64 | + }); | ||
| 65 | + }); | ||
| 66 | + }); | ||
| 67 | + })(); | ||
| 68 | + </script> | ||
| 69 | +</div> |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| @@ -281,6 +281,11 @@ var gb_schedule_context_menu = (function () { | @@ -281,6 +281,11 @@ var gb_schedule_context_menu = (function () { | ||
| 281 | open_modal(folder + '/sub_task_v2/main.html', { | 281 | open_modal(folder + '/sub_task_v2/main.html', { |
| 282 | sch: sch | 282 | sch: sch |
| 283 | }, modal_opts); | 283 | }, modal_opts); |
| 284 | + }, | ||
| 285 | + wxsb: function (sch) { | ||
| 286 | + open_modal(folder + '/wxsb.html', { | ||
| 287 | + sch: sch | ||
| 288 | + }, modal_opts); | ||
| 284 | } | 289 | } |
| 285 | }; | 290 | }; |
| 286 | 291 | ||
| @@ -339,9 +344,13 @@ var gb_schedule_context_menu = (function () { | @@ -339,9 +344,13 @@ var gb_schedule_context_menu = (function () { | ||
| 339 | 'wdtz': { | 344 | 'wdtz': { |
| 340 | name: '误点调整' | 345 | name: '误点调整' |
| 341 | }, | 346 | }, |
| 342 | - 'sep4': '---------', | 347 | + 'sep5': '---------', |
| 343 | 'lp_change': { | 348 | 'lp_change': { |
| 344 | name: '路牌对调' | 349 | name: '路牌对调' |
| 350 | + }, | ||
| 351 | + 'sep6': '---------', | ||
| 352 | + 'wxsb': { | ||
| 353 | + name: '维修上报' | ||
| 345 | } | 354 | } |
| 346 | } | 355 | } |
| 347 | }); | 356 | }); |