Commit 463504e723f511bc936d3cd2a75f8e162bf8a59c
1 parent
9a8c231e
1.临港调度系统配置及相关修改
Showing
14 changed files
with
3293 additions
and
3731 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -19,7 +19,6 @@ import com.bsth.entity.sys.SysUser; | @@ -19,7 +19,6 @@ import com.bsth.entity.sys.SysUser; | ||
| 19 | import com.bsth.security.util.SecurityUtils; | 19 | import com.bsth.security.util.SecurityUtils; |
| 20 | import com.bsth.util.ReportUtils; | 20 | import com.bsth.util.ReportUtils; |
| 21 | import com.bsth.util.db.DBUtils_MS; | 21 | import com.bsth.util.db.DBUtils_MS; |
| 22 | -import com.bsth.util.db.DBUtils_control; | ||
| 23 | import com.fasterxml.jackson.databind.ObjectMapper; | 22 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 24 | import org.apache.commons.io.IOUtils; | 23 | import org.apache.commons.io.IOUtils; |
| 25 | import org.apache.commons.lang3.StringEscapeUtils; | 24 | import org.apache.commons.lang3.StringEscapeUtils; |
| @@ -863,243 +862,4 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -863,243 +862,4 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 863 | 862 | ||
| 864 | return res; | 863 | return res; |
| 865 | } | 864 | } |
| 866 | - | ||
| 867 | - @RequestMapping(value = "exportPlan", method = RequestMethod.GET) | ||
| 868 | - public Map<String, Object> exportPlan(@RequestParam String date){ | ||
| 869 | - Map<String, Object> res = new HashMap<>(); | ||
| 870 | - DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm"); | ||
| 871 | - Connection conn = null; | ||
| 872 | - PreparedStatement ps = null; | ||
| 873 | - ResultSet rs = null; | ||
| 874 | - | ||
| 875 | - List<Map<String, Object>> list = new ArrayList<>(); | ||
| 876 | - String sql = "select xl_name,xl_dir,schedule_date,fcsj,cl_zbh,j_name,bcsj from bsth_c_s_sp_info where schedule_date = ? and xl_bm in (22205, 202104, 202105, 202106, 202107, 210415) and bc_type = 'normal'"; | ||
| 877 | - try{ | ||
| 878 | - conn = DBUtils_control.getConnection(); | ||
| 879 | - ps = conn.prepareStatement(sql); | ||
| 880 | - ps.setString(1, date); | ||
| 881 | - rs = ps.executeQuery(); | ||
| 882 | - ObjectMapper mapper = new ObjectMapper(); | ||
| 883 | - | ||
| 884 | - while (rs.next()) { | ||
| 885 | - SchedulePlan schedulePlan = new SchedulePlan(); | ||
| 886 | - schedulePlan.setXlName(rs.getString("xl_name")); | ||
| 887 | - schedulePlan.setXlDir(rs.getInt("xl_dir")); | ||
| 888 | - Date scheduleDate = rs.getDate("schedule_date"); | ||
| 889 | - schedulePlan.setScheduleDate(new DateTime(scheduleDate.getTime()).toString("yyyy-MM-dd")); | ||
| 890 | - String fcsj = rs.getString("fcsj"); | ||
| 891 | - int bcsj = rs.getInt("bcsj"); | ||
| 892 | - DateTime fcsjDt = dateTimeFormatter.parseDateTime(schedulePlan.getScheduleDate() + " " + fcsj); | ||
| 893 | - schedulePlan.setFcsj(fcsjDt.toString("HH:mm:00")); | ||
| 894 | - DateTime ddsjDt = fcsjDt.plusMinutes(bcsj); | ||
| 895 | - schedulePlan.setDdsj(ddsjDt.toString("HH:mm:00")); | ||
| 896 | - schedulePlan.setSjdStart(fcsjDt.toString("HH:00:00")); | ||
| 897 | - DateTime endDt = fcsjDt.plusHours(1); | ||
| 898 | - schedulePlan.setSjdEnd(endDt.toString("HH:00:00")); | ||
| 899 | - schedulePlan.setClZbh(rs.getString("cl_zbh")); | ||
| 900 | - schedulePlan.setJsy(rs.getString("j_name")); | ||
| 901 | - schedulePlan.setBcsj(bcsj); | ||
| 902 | - | ||
| 903 | - list.add(mapper.readValue(mapper.writeValueAsString(schedulePlan), HashMap.class)); | ||
| 904 | - } | ||
| 905 | - List<Iterator<?>> iterators = new ArrayList<Iterator<?>>(); | ||
| 906 | - iterators.add(list.iterator()); | ||
| 907 | - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 908 | - String sourcePath = path + "mould/schedulePlan.xls"; | ||
| 909 | - | ||
| 910 | - new ReportUtils().excelReplace(iterators, new Object[]{}, sourcePath, path + "export/" + date + "-花博会专线班次.xls"); | ||
| 911 | - | ||
| 912 | - res.put("status", ResponseCode.SUCCESS); | ||
| 913 | - res.put("msg", "成功"); | ||
| 914 | - } catch (Exception e) { | ||
| 915 | - res.put("status", ResponseCode.ERROR); | ||
| 916 | - res.put("msg", e.getMessage()); | ||
| 917 | - } finally { | ||
| 918 | - DBUtils_control.close(rs, ps, conn); | ||
| 919 | - } | ||
| 920 | - | ||
| 921 | - return res; | ||
| 922 | - } | ||
| 923 | - | ||
| 924 | - public final static class SchedulePlan { | ||
| 925 | - private String company = "浦东公司[46]"; | ||
| 926 | - | ||
| 927 | - private String xlName = ""; | ||
| 928 | - | ||
| 929 | - private int xlDir; | ||
| 930 | - | ||
| 931 | - private String xlDirStr = ""; | ||
| 932 | - | ||
| 933 | - private String scheduleDate = ""; | ||
| 934 | - | ||
| 935 | - private String sjdStart = ""; | ||
| 936 | - | ||
| 937 | - private String sjdEnd = ""; | ||
| 938 | - | ||
| 939 | - private String fcsj = ""; | ||
| 940 | - | ||
| 941 | - private int bcsj; | ||
| 942 | - | ||
| 943 | - private String ddsj = ""; | ||
| 944 | - | ||
| 945 | - private int yys = 25; | ||
| 946 | - | ||
| 947 | - private String clZbh = ""; | ||
| 948 | - | ||
| 949 | - private String cph = ""; | ||
| 950 | - | ||
| 951 | - private String color = "绿牌"; | ||
| 952 | - | ||
| 953 | - private String jsy = ""; | ||
| 954 | - | ||
| 955 | - private String jsydh = ""; | ||
| 956 | - | ||
| 957 | - private int pj = 10; | ||
| 958 | - | ||
| 959 | - public String getCompany() { | ||
| 960 | - return company; | ||
| 961 | - } | ||
| 962 | - | ||
| 963 | - public void setCompany(String company) { | ||
| 964 | - this.company = company; | ||
| 965 | - } | ||
| 966 | - | ||
| 967 | - public String getXlName() { | ||
| 968 | - return xlName; | ||
| 969 | - } | ||
| 970 | - | ||
| 971 | - public void setXlName(String xlName) { | ||
| 972 | - this.xlName = xlName; | ||
| 973 | - } | ||
| 974 | - | ||
| 975 | - public int getXlDir() { | ||
| 976 | - return xlDir; | ||
| 977 | - } | ||
| 978 | - | ||
| 979 | - public void setXlDir(int xlDir) { | ||
| 980 | - this.xlDir = xlDir; | ||
| 981 | - } | ||
| 982 | - | ||
| 983 | - public String getXlDirStr() { | ||
| 984 | - xlDirStr = ""; | ||
| 985 | - if (xlDir == 0) { | ||
| 986 | - xlDirStr = "上行"; | ||
| 987 | - } else if (xlDir == 1) { | ||
| 988 | - xlDirStr = "下行"; | ||
| 989 | - } | ||
| 990 | - return xlDirStr; | ||
| 991 | - } | ||
| 992 | - | ||
| 993 | - public void setXlDirStr(String xlDirStr) { | ||
| 994 | - this.xlDirStr = xlDirStr; | ||
| 995 | - } | ||
| 996 | - | ||
| 997 | - public String getScheduleDate() { | ||
| 998 | - return scheduleDate; | ||
| 999 | - } | ||
| 1000 | - | ||
| 1001 | - public void setScheduleDate(String scheduleDate) { | ||
| 1002 | - this.scheduleDate = scheduleDate; | ||
| 1003 | - } | ||
| 1004 | - | ||
| 1005 | - public String getSjdStart() { | ||
| 1006 | - return sjdStart; | ||
| 1007 | - } | ||
| 1008 | - | ||
| 1009 | - public void setSjdStart(String sjdStart) { | ||
| 1010 | - this.sjdStart = sjdStart; | ||
| 1011 | - } | ||
| 1012 | - | ||
| 1013 | - public String getSjdEnd() { | ||
| 1014 | - return sjdEnd; | ||
| 1015 | - } | ||
| 1016 | - | ||
| 1017 | - public void setSjdEnd(String sjdEnd) { | ||
| 1018 | - this.sjdEnd = sjdEnd; | ||
| 1019 | - } | ||
| 1020 | - | ||
| 1021 | - public String getFcsj() { | ||
| 1022 | - return fcsj; | ||
| 1023 | - } | ||
| 1024 | - | ||
| 1025 | - public void setFcsj(String fcsj) { | ||
| 1026 | - this.fcsj = fcsj; | ||
| 1027 | - } | ||
| 1028 | - | ||
| 1029 | - public int getBcsj() { | ||
| 1030 | - return bcsj; | ||
| 1031 | - } | ||
| 1032 | - | ||
| 1033 | - public void setBcsj(int bcsj) { | ||
| 1034 | - this.bcsj = bcsj; | ||
| 1035 | - } | ||
| 1036 | - | ||
| 1037 | - public String getDdsj() { | ||
| 1038 | - return ddsj; | ||
| 1039 | - } | ||
| 1040 | - | ||
| 1041 | - public void setDdsj(String ddsj) { | ||
| 1042 | - this.ddsj = ddsj; | ||
| 1043 | - } | ||
| 1044 | - | ||
| 1045 | - public int getYys() { | ||
| 1046 | - return yys; | ||
| 1047 | - } | ||
| 1048 | - | ||
| 1049 | - public void setYys(int yys) { | ||
| 1050 | - this.yys = yys; | ||
| 1051 | - } | ||
| 1052 | - | ||
| 1053 | - public String getClZbh() { | ||
| 1054 | - return clZbh; | ||
| 1055 | - } | ||
| 1056 | - | ||
| 1057 | - public void setClZbh(String clZbh) { | ||
| 1058 | - this.clZbh = clZbh; | ||
| 1059 | - } | ||
| 1060 | - | ||
| 1061 | - public String getCph() { | ||
| 1062 | - cph = BasicData.nbbmCompanyPlateMap.get(clZbh); | ||
| 1063 | - if (cph == null) { | ||
| 1064 | - cph = ""; | ||
| 1065 | - } | ||
| 1066 | - return cph; | ||
| 1067 | - } | ||
| 1068 | - | ||
| 1069 | - public void setCph(String cph) { | ||
| 1070 | - this.cph = cph; | ||
| 1071 | - } | ||
| 1072 | - | ||
| 1073 | - public String getColor() { | ||
| 1074 | - return color; | ||
| 1075 | - } | ||
| 1076 | - | ||
| 1077 | - public void setColor(String color) { | ||
| 1078 | - this.color = color; | ||
| 1079 | - } | ||
| 1080 | - | ||
| 1081 | - public String getJsy() { | ||
| 1082 | - return jsy; | ||
| 1083 | - } | ||
| 1084 | - | ||
| 1085 | - public void setJsy(String jsy) { | ||
| 1086 | - this.jsy = jsy; | ||
| 1087 | - } | ||
| 1088 | - | ||
| 1089 | - public String getJsydh() { | ||
| 1090 | - return jsydh; | ||
| 1091 | - } | ||
| 1092 | - | ||
| 1093 | - public void setJsydh(String jsydh) { | ||
| 1094 | - this.jsydh = jsydh; | ||
| 1095 | - } | ||
| 1096 | - | ||
| 1097 | - public int getPj() { | ||
| 1098 | - return pj; | ||
| 1099 | - } | ||
| 1100 | - | ||
| 1101 | - public void setPj(int pj) { | ||
| 1102 | - this.pj = pj; | ||
| 1103 | - } | ||
| 1104 | - } | ||
| 1105 | } | 865 | } |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| 1 | -package com.bsth.service.impl; | ||
| 2 | - | ||
| 3 | -import com.bsth.data.BasicData; | ||
| 4 | -import com.bsth.email.SendEmailController; | ||
| 5 | -import com.bsth.email.entity.EmailBean; | ||
| 6 | -import com.bsth.entity.*; | ||
| 7 | -import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 8 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 9 | -import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 10 | -import com.bsth.entity.schedule.TTInfo; | ||
| 11 | -import com.bsth.entity.schedule.TTInfoDetail; | ||
| 12 | -import com.bsth.entity.search.CustomerSpecs; | ||
| 13 | -import com.bsth.entity.sys.SysUser; | ||
| 14 | -import com.bsth.entity.traffic.SKBUploadLogger; | ||
| 15 | -import com.bsth.repository.*; | ||
| 16 | -import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 17 | -import com.bsth.repository.schedule.*; | ||
| 18 | -import com.bsth.repository.traffic.SKBUploadLoggerRepository; | ||
| 19 | -import com.bsth.security.util.SecurityUtils; | ||
| 20 | -import com.bsth.service.TrafficManageService; | ||
| 21 | -import com.bsth.service.traffic.YgcBasicDataService; | ||
| 22 | -import com.bsth.util.TimeUtils; | ||
| 23 | -import com.bsth.util.db.DBUtils_MS; | ||
| 24 | -import com.bsth.webService.trafficManage.org.tempuri.Results; | ||
| 25 | -import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; | ||
| 26 | -import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; | ||
| 27 | -import org.apache.commons.lang.StringEscapeUtils; | ||
| 28 | -import org.apache.commons.lang.StringUtils; | ||
| 29 | -import org.apache.commons.lang.time.DateUtils; | ||
| 30 | -import org.joda.time.DateTime; | ||
| 31 | -import org.slf4j.Logger; | ||
| 32 | -import org.slf4j.LoggerFactory; | ||
| 33 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 34 | -import org.springframework.data.domain.Sort; | ||
| 35 | -import org.springframework.data.domain.Sort.Direction; | ||
| 36 | -import org.springframework.security.core.context.SecurityContextHolder; | ||
| 37 | -import org.springframework.stereotype.Service; | ||
| 38 | - | ||
| 39 | -import java.io.*; | ||
| 40 | -import java.net.InetAddress; | ||
| 41 | -import java.sql.Connection; | ||
| 42 | -import java.sql.PreparedStatement; | ||
| 43 | -import java.sql.ResultSet; | ||
| 44 | -import java.text.DecimalFormat; | ||
| 45 | -import java.text.SimpleDateFormat; | ||
| 46 | -import java.util.*; | ||
| 47 | -import java.util.regex.Matcher; | ||
| 48 | -import java.util.regex.Pattern; | ||
| 49 | - | ||
| 50 | -/** | ||
| 51 | - * | ||
| 52 | - * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | ||
| 53 | - * | ||
| 54 | - * @Extends : BaseService | ||
| 55 | - * | ||
| 56 | - * @Description: TODO(运管处接口service业务层) | ||
| 57 | - * | ||
| 58 | - * @Author bsth@zq | ||
| 59 | - * | ||
| 60 | - * @Date 2016年10月28日 上午9:21:17 | ||
| 61 | - * | ||
| 62 | - * @Version 公交调度系统BS版 0.1 | ||
| 63 | - * | ||
| 64 | - */ | ||
| 65 | - | ||
| 66 | -@Service | ||
| 67 | -public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 68 | - | ||
| 69 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 70 | - // 运管处上传日志类型 | ||
| 71 | - public static final String UPLOAD_TYPE_SKB = "1"; | ||
| 72 | - public static final String UPLOAD_TYPE_XL = "2"; | ||
| 73 | - public static final String UPLOAD_TYPE_LD = "3"; | ||
| 74 | - | ||
| 75 | - // 线路repository | ||
| 76 | - @Autowired | ||
| 77 | - private LineRepository lineRepository; | ||
| 78 | - | ||
| 79 | - @Autowired | ||
| 80 | - private LineInformationRepository lineInformationRepository; | ||
| 81 | - | ||
| 82 | - // 站点路由repository | ||
| 83 | - @Autowired | ||
| 84 | - private StationRouteRepository stationRouteRepository; | ||
| 85 | - | ||
| 86 | - // 历史站点路由repository | ||
| 87 | - @Autowired | ||
| 88 | - private LsStationRouteRepository lsStationRouteRepository; | ||
| 89 | - | ||
| 90 | - @Autowired | ||
| 91 | - private SectionRepository sectionRepository; | ||
| 92 | - | ||
| 93 | - // 车辆repository | ||
| 94 | - @Autowired | ||
| 95 | - private CarsRepository carsRepository; | ||
| 96 | - | ||
| 97 | - // 人员repository | ||
| 98 | - @Autowired | ||
| 99 | - private PersonnelRepository personnelRepository; | ||
| 100 | - | ||
| 101 | - // 时刻模板repository | ||
| 102 | - @Autowired | ||
| 103 | - private TTInfoRepository ttInfoRepository; | ||
| 104 | - | ||
| 105 | - // 时刻模板明细repository | ||
| 106 | - @Autowired | ||
| 107 | - private TTInfoDetailRepository ttInfoDetailRepository; | ||
| 108 | - | ||
| 109 | - // 排班计划明细repository | ||
| 110 | - @Autowired | ||
| 111 | - private SchedulePlanInfoRepository schedulePlanInfoRepository; | ||
| 112 | - | ||
| 113 | - // 实际排班计划明细repository | ||
| 114 | - @Autowired | ||
| 115 | - private ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 116 | - | ||
| 117 | - // 时刻表上传记录repository | ||
| 118 | - @Autowired | ||
| 119 | - private SKBUploadLoggerRepository skbUploadLoggerRepository; | ||
| 120 | - | ||
| 121 | - // 线路站点repository | ||
| 122 | - @Autowired | ||
| 123 | - private YgcBasicDataService ygcBasicDataService; | ||
| 124 | - | ||
| 125 | - // 发送邮件 | ||
| 126 | - @Autowired | ||
| 127 | - private SendEmailController sendEmailController; | ||
| 128 | - | ||
| 129 | - /** | ||
| 130 | - * 线路版本repository | ||
| 131 | - */ | ||
| 132 | - @Autowired | ||
| 133 | - private LineVersionsRepository lineVersionsRepository; | ||
| 134 | - | ||
| 135 | - // 运管处上传接口 | ||
| 136 | - private com.bsth.webService.trafficManage.up.org.tempuri.WebServiceSoap webServiceSoapUp; | ||
| 137 | - private WebServiceSoap ssop ; | ||
| 138 | - { | ||
| 139 | - try { | ||
| 140 | - ssop = new WebServiceLocator().getWebServiceSoap(); | ||
| 141 | - } catch (Exception e) { | ||
| 142 | - e.printStackTrace(); | ||
| 143 | - } | ||
| 144 | - } | ||
| 145 | - // 格式化 年月日时分秒 nyrsfm是年月日时分秒的拼音首字母 | ||
| 146 | - private SimpleDateFormat sdfnyrsfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 147 | - | ||
| 148 | - // 格式化 年月日 | ||
| 149 | - private SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 150 | - | ||
| 151 | - // 数字格式化 | ||
| 152 | - DecimalFormat format = new DecimalFormat("0.00"); | ||
| 153 | - | ||
| 154 | - // 用户名 | ||
| 155 | - private final String userNameOther = "user"; | ||
| 156 | - // 密码 | ||
| 157 | - private final String passwordOther = "user"; | ||
| 158 | - | ||
| 159 | - // 用户名 | ||
| 160 | - private final String userNameUp = "user"; | ||
| 161 | - // 密码 | ||
| 162 | - private final String passwordUp = "user"; | ||
| 163 | - // 接收邮件人 | ||
| 164 | - private final String emailSendToAddress = "113252620@qq.com"; | ||
| 165 | - // 记录路单上线的成功、失败线路数 | ||
| 166 | - private Integer countSuccess,countFailure; | ||
| 167 | - | ||
| 168 | - private synchronized com.bsth.webService.trafficManage.up.org.tempuri.WebServiceSoap getWebServiceSoapUp(){ | ||
| 169 | - try { | ||
| 170 | - if(webServiceSoapUp == null){ | ||
| 171 | - webServiceSoapUp = new com.bsth.webService.trafficManage.up.org.tempuri.WebServiceLocator().getWebServiceSoap(); | ||
| 172 | - } | ||
| 173 | - }catch (Exception e){ | ||
| 174 | - e.printStackTrace(); | ||
| 175 | - }finally { | ||
| 176 | - return webServiceSoapUp; | ||
| 177 | - } | ||
| 178 | - } | ||
| 179 | - /** | ||
| 180 | - * 上传线路信息 | ||
| 181 | - */ | ||
| 182 | - @Override | ||
| 183 | - public String setXL(String ids) { | ||
| 184 | - String result = "failure"; | ||
| 185 | - String xml ; | ||
| 186 | - String[] idArray = ids.split(","); | ||
| 187 | - try { | ||
| 188 | - for (String id : idArray) { | ||
| 189 | - if(id == null || id.trim().equals("")){ | ||
| 190 | - continue; | ||
| 191 | - } | ||
| 192 | - Map<String,Object> map = new HashMap<>(); | ||
| 193 | - map.put("lineCode_eq", id); | ||
| 194 | - Line line ; | ||
| 195 | - LineInformation lineInformation; | ||
| 196 | - Optional<Line> optionalLine = lineRepository.findOne(new CustomerSpecs<Line>(map)); | ||
| 197 | - line = optionalLine.isPresent() ? optionalLine.get() : null; | ||
| 198 | - if(line == null){ | ||
| 199 | - continue; | ||
| 200 | - } | ||
| 201 | - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ | ||
| 202 | - return result; | ||
| 203 | - } | ||
| 204 | - map = new HashMap<>(); | ||
| 205 | - map.put("line.id_eq",line.getId()); | ||
| 206 | - Optional<LineInformation> optionalLineInformation = lineInformationRepository.findOne(new CustomerSpecs<LineInformation>(map)); | ||
| 207 | - lineInformation = optionalLineInformation.isPresent() ? optionalLineInformation.get() : null; | ||
| 208 | - if(lineInformation == null){ | ||
| 209 | - continue; | ||
| 210 | - } | ||
| 211 | - // 取得封装好的xml | ||
| 212 | - xml = getSetXlXml(line,lineInformation); | ||
| 213 | - // 站点序号不能为0,如果为0,则返回错误 | ||
| 214 | - if(xml.indexOf("<ZDXH>0</ZDXH>") != -1){ | ||
| 215 | - return "0"; | ||
| 216 | - } | ||
| 217 | - String state;// 是否上传成功 | ||
| 218 | - // 调用上传方法 | ||
| 219 | - if(getWebServiceSoapUp().setXL(userNameUp,passwordUp,xml).isSuccess()){ | ||
| 220 | - result = "success"; | ||
| 221 | - state = "1"; | ||
| 222 | - }else{ | ||
| 223 | - result = "failure"; | ||
| 224 | - state = "0"; | ||
| 225 | - } | ||
| 226 | - logger.info("setXL:"+xml); | ||
| 227 | - logger.info("setXL:"+result); | ||
| 228 | - // 保存运管处上传记录 | ||
| 229 | - saveYgcUploadLog(line,xml,TrafficManageServiceImpl.UPLOAD_TYPE_XL,state); | ||
| 230 | - } | ||
| 231 | - } catch (Exception e) { | ||
| 232 | - logger.error("setXL:",e); | ||
| 233 | - e.printStackTrace(); | ||
| 234 | - } | ||
| 235 | - return result; | ||
| 236 | - } | ||
| 237 | - | ||
| 238 | - /** | ||
| 239 | - * 加载运管处的站点及序号 | ||
| 240 | - * 上行从1开始,下行顺序续编 | ||
| 241 | - */ | ||
| 242 | - private Map<String, Integer> getStationName2YgcNumberMap (String lineCode){ | ||
| 243 | - Map<String, Integer> resultMap = new HashMap<>(); | ||
| 244 | - List<Map<String, String>> ygcLines = stationRouteRepository.findLineWithYgcByLine(lineCode); | ||
| 245 | - if(ygcLines != null && ygcLines.size() > 0){ | ||
| 246 | - int size = ygcLines.size(); | ||
| 247 | - Map<String, String> tempMap ; | ||
| 248 | - int num = 1; | ||
| 249 | - String key; | ||
| 250 | - for (int i = 0; i < size; i ++){ | ||
| 251 | - tempMap = ygcLines.get(i); | ||
| 252 | - key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions")) | ||
| 253 | - + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark"); | ||
| 254 | - resultMap.put(key,num++); | ||
| 255 | - } | ||
| 256 | - } | ||
| 257 | - return resultMap; | ||
| 258 | - } | ||
| 259 | - | ||
| 260 | - /** | ||
| 261 | - * 上传线路信息(按in_use上传) | ||
| 262 | - */ | ||
| 263 | - @Override | ||
| 264 | - public String setXLByInUse(String inUse) { | ||
| 265 | - StringBuffer result = new StringBuffer(); | ||
| 266 | - try { | ||
| 267 | - Map<String,Object> map = new HashMap<>(); | ||
| 268 | - if(inUse != null && inUse.equals("1")){ | ||
| 269 | - map.put("inUse_eq", inUse); | ||
| 270 | - } | ||
| 271 | - List<Line> lines ; | ||
| 272 | - Line line; | ||
| 273 | - lines = lineRepository.findAll(new CustomerSpecs<Line>(map)); | ||
| 274 | - if(lines != null && lines.size() > 0){ | ||
| 275 | - for(int i = 0 ; i < lines.size() ; i ++){ | ||
| 276 | - line = lines.get(i); | ||
| 277 | - if(line != null && line.getId() != null){ | ||
| 278 | - result.append(line.getLineCode()).append(":").append(setXL(line.getLineCode())).append(";"); | ||
| 279 | - } | ||
| 280 | - } | ||
| 281 | - } | ||
| 282 | - } catch (Exception e) { | ||
| 283 | - result.append("failure"); | ||
| 284 | - logger.error("setXLByInUse:",e); | ||
| 285 | - e.printStackTrace(); | ||
| 286 | - } | ||
| 287 | - return result.toString(); | ||
| 288 | - } | ||
| 289 | - | ||
| 290 | - /** | ||
| 291 | - * 上传车辆信息 | ||
| 292 | - */ | ||
| 293 | - @Override | ||
| 294 | - public String setCL() { | ||
| 295 | - String result = "failure"; | ||
| 296 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 297 | - try { | ||
| 298 | - sBuffer.append("<CLs>"); | ||
| 299 | - Cars cars = null; | ||
| 300 | - String company; | ||
| 301 | - Iterator<Cars> carsIterator = carsRepository.findAll().iterator(); | ||
| 302 | - while(carsIterator.hasNext()){ | ||
| 303 | - cars = carsIterator.next(); | ||
| 304 | - sBuffer.append("<CL>"); | ||
| 305 | - company = cars.getCompany(); | ||
| 306 | - setCompanyName(company);// 统一公司名称 | ||
| 307 | - sBuffer.append("<GSJC>").append(company).append("</GSJC>"); | ||
| 308 | - sBuffer.append("<NBH>").append(cars.getInsideCode()).append("</NBH>"); | ||
| 309 | - sBuffer.append("<CPH>").append(cars.getCarPlate()).append("</CPH>"); | ||
| 310 | - sBuffer.append("<YYZBH>").append(cars.getServiceNo()).append("</YYZBH>"); | ||
| 311 | - sBuffer.append("<CZCPH>").append(cars.getCarPlate()).append("</CZCPH>");//******这个数据没有*********** | ||
| 312 | - sBuffer.append("<CZZDBH>").append(cars.getEquipmentCode()).append("</CZZDBH>"); | ||
| 313 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 314 | - sBuffer.append("</CL>"); | ||
| 315 | - } | ||
| 316 | - sBuffer.append("</CLs>"); | ||
| 317 | - if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 318 | - result = "success"; | ||
| 319 | - } | ||
| 320 | - } catch (Exception e) { | ||
| 321 | - logger.error("setCL:",e); | ||
| 322 | - e.printStackTrace(); | ||
| 323 | - }finally{ | ||
| 324 | - logger.info("setCL:"+sBuffer.toString()); | ||
| 325 | - logger.info("setCL:"+result); | ||
| 326 | - } | ||
| 327 | - return result; | ||
| 328 | - } | ||
| 329 | - | ||
| 330 | - /** | ||
| 331 | - * 上传司机信息 | ||
| 332 | - */ | ||
| 333 | - @Override | ||
| 334 | - public String setSJ() { | ||
| 335 | - String result = "failure"; | ||
| 336 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 337 | - try { | ||
| 338 | - sBuffer.append("<SJs>"); | ||
| 339 | - Personnel personnel = null; | ||
| 340 | - String company; | ||
| 341 | - Iterator<Personnel> personIterator = personnelRepository.findAll().iterator(); | ||
| 342 | - while(personIterator.hasNext()){ | ||
| 343 | - personnel = personIterator.next(); | ||
| 344 | - sBuffer.append("<SJ>"); | ||
| 345 | - company = personnel.getCompany(); | ||
| 346 | - setCompanyName(company);// 统一公司名称 | ||
| 347 | - sBuffer.append("<GSJC>").append(company).append("</GSJC>"); | ||
| 348 | - sBuffer.append("<SJGH>").append(personnel.getJobCode()).append("</SJGH>"); | ||
| 349 | - sBuffer.append("<CYZGZH>").append(personnel.getPapersCode()).append("</CYZGZH>");//*********** | ||
| 350 | - sBuffer.append("<XM>").append(personnel.getPersonnelName()).append("</XM>"); | ||
| 351 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 352 | - sBuffer.append("</SJ>"); | ||
| 353 | - } | ||
| 354 | - sBuffer.append("</SJs>"); | ||
| 355 | - if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 356 | - result = "success"; | ||
| 357 | - }; | ||
| 358 | - } catch (Exception e) { | ||
| 359 | - logger.error("setSJ:",e); | ||
| 360 | - e.printStackTrace(); | ||
| 361 | - }finally{ | ||
| 362 | - logger.info("setSJ:"+sBuffer.toString()); | ||
| 363 | - logger.info("setSJ:"+result); | ||
| 364 | - } | ||
| 365 | - return result; | ||
| 366 | - } | ||
| 367 | - | ||
| 368 | - /** | ||
| 369 | - * 上传路单 指定日期 yyyy-MM-dd | ||
| 370 | - * @param theDate | ||
| 371 | - * @return | ||
| 372 | - */ | ||
| 373 | - public String setLD(String theDate){ | ||
| 374 | - return uploadLD(theDate); | ||
| 375 | - } | ||
| 376 | - | ||
| 377 | - /** | ||
| 378 | - * 上传路单 上传前一天的路单 | ||
| 379 | - * @return | ||
| 380 | - */ | ||
| 381 | - public String setLD(){ | ||
| 382 | - return uploadLD(null); | ||
| 383 | - } | ||
| 384 | - /** | ||
| 385 | - * 上传路单 | ||
| 386 | - * @return 上传成功标识 | ||
| 387 | - */ | ||
| 388 | - private String uploadLD(String theDate){ | ||
| 389 | - // 取昨天 的日期 | ||
| 390 | - String date = theDate == null ?sdfnyr.format(DateUtils.addDays(new Date(), -1)) : theDate; | ||
| 391 | - StringBuffer sf = new StringBuffer(); | ||
| 392 | - Results results = null; | ||
| 393 | - String str = "", xlbm = null, oldXlbm = null; | ||
| 394 | - List<Map<String,Object>> listGroup = null; | ||
| 395 | - int scount = 0, ccount = 0; | ||
| 396 | - long start = System.currentTimeMillis(); | ||
| 397 | - try { | ||
| 398 | - // 计数器 | ||
| 399 | - int counter = 0; | ||
| 400 | - // 每几条线路上传一次路单 | ||
| 401 | - int per = 10; | ||
| 402 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | ||
| 403 | - listGroup = scheduleRealInfoRepository.setLDGroup(date); | ||
| 404 | - Map<String,Object> map = new HashMap(); | ||
| 405 | - HashMap<String,String> paramMap; | ||
| 406 | - HashMap<String,String> otherMap = new HashMap(); | ||
| 407 | - | ||
| 408 | - // 车辆内部编码和车牌做映射 | ||
| 409 | - Map<String, String> inside2plate = new HashMap<>(); | ||
| 410 | - Iterable<Cars> cars = carsRepository.findAll(); | ||
| 411 | - for (Cars car : cars) { | ||
| 412 | - inside2plate.put(car.getInsideCode(), car.getCarPlate()); | ||
| 413 | - } | ||
| 414 | - | ||
| 415 | - // 线路编码和线路信息映射 | ||
| 416 | - Map<String, Line> code2line = new HashMap<>(); | ||
| 417 | - Iterable<Line> lines = lineRepository.findAll(); | ||
| 418 | - for (Line line : lines) { | ||
| 419 | - code2line.put(line.getLineCode(), line); | ||
| 420 | - } | ||
| 421 | - | ||
| 422 | - // 线路编码和线路版本映射(电子路单日期) | ||
| 423 | - Map<String, Integer> code2version = new HashMap<>(); | ||
| 424 | - Iterable<LineVersions> versions = lineVersionsRepository.findLineVersionsByDate((int)(DateTime.parse(date).getMillis() / 1000)); | ||
| 425 | - for (LineVersions version : versions) { | ||
| 426 | - code2version.put(version.getLineCode(), version.getVersions()); | ||
| 427 | - } | ||
| 428 | - | ||
| 429 | - Map<String, Integer> stationNumMap = null; | ||
| 430 | - for(Map<String,Object> schRealInfo:listGroup){ | ||
| 431 | - if(schRealInfo != null){ | ||
| 432 | - // 获取线路是否使用标识,如果未使用,则不查该线路数据 | ||
| 433 | - String lineCode = schRealInfo.get("xlBm")+""; | ||
| 434 | - Line line = code2line.get(lineCode); | ||
| 435 | - if(line == null || line.getInUse() == null || line.getInUse() == 0){ | ||
| 436 | - ccount++; | ||
| 437 | - continue; | ||
| 438 | - } | ||
| 439 | - if(counter % per == 0){ | ||
| 440 | - sf = new StringBuffer(); | ||
| 441 | - sf.append("<DLDS>"); | ||
| 442 | - } | ||
| 443 | - counter ++; | ||
| 444 | - xlbm = BasicData.lineCode2ShangHaiCodeMap.get(lineCode); | ||
| 445 | - if (!xlbm.equals(oldXlbm)) { | ||
| 446 | - oldXlbm = xlbm; | ||
| 447 | - Integer ver = code2version.get(lineCode); | ||
| 448 | - if (ver != null) { | ||
| 449 | - stationNumMap = getLsStationRoute(lineCode, ver); | ||
| 450 | - } | ||
| 451 | - } | ||
| 452 | - | ||
| 453 | - sf.append("<DLD>"); | ||
| 454 | - sf.append("<RQ>").append(date).append("</RQ>"); | ||
| 455 | - sf.append("<XLBM>").append(xlbm).append("</XLBM>"); | ||
| 456 | - sf.append("<LPBH>").append(schRealInfo.get("lpName")).append("</LPBH>"); | ||
| 457 | - sf.append("<CPH>").append(inside2plate.get(schRealInfo.get("clZbh"))).append("</CPH>"); | ||
| 458 | - sf.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 459 | - sf.append("<LDList>"); | ||
| 460 | - for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 461 | - if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") | ||
| 462 | - .equals(scheduleRealInfo.getLpName()) | ||
| 463 | - && (schRealInfo.get("clZbh")+"").equals(scheduleRealInfo.getClZbh())){ | ||
| 464 | - | ||
| 465 | - if(scheduleRealInfo.isDestroy()){ | ||
| 466 | - if(scheduleRealInfo.isReissue()){ | ||
| 467 | - scheduleRealInfo.setFcsjActualAll(scheduleRealInfo.getDfsj()); | ||
| 468 | - scheduleRealInfo.setZdsjActualAll(scheduleRealInfo.getZdsj()); | ||
| 469 | - } | ||
| 470 | - else | ||
| 471 | - continue; | ||
| 472 | - } | ||
| 473 | - | ||
| 474 | - if(scheduleRealInfo.getBcType().equals("in") | ||
| 475 | - || scheduleRealInfo.getBcType().equals("out")){ | ||
| 476 | - continue; | ||
| 477 | - } | ||
| 478 | - | ||
| 479 | - sf.append("<LD>"); | ||
| 480 | - sf.append("<SJGH>").append(scheduleRealInfo.getjGh()).append("</SJGH>"); | ||
| 481 | - sf.append("<SXX>").append(scheduleRealInfo.getXlDir()).append("</SXX>"); | ||
| 482 | - sf.append("<FCZDMC>").append(scheduleRealInfo.getQdzName()).append("</FCZDMC>"); | ||
| 483 | - // 起点站的参数 | ||
| 484 | - otherMap.put("stationMark","B"); | ||
| 485 | - paramMap = packageYgcStationNumParam(scheduleRealInfo,otherMap); | ||
| 486 | - sf.append("<FCZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,stationNumMap)).append("</FCZDXH>"); | ||
| 487 | - sf.append("<FCZDBM>").append(scheduleRealInfo.getQdzCode()).append("</FCZDBM>"); | ||
| 488 | - sf.append("<JHFCSJ>").append(scheduleRealInfo.getFcsj()).append("</JHFCSJ>"); | ||
| 489 | - sf.append("<DFSJ>").append(scheduleRealInfo.getDfsj()).append("</DFSJ>"); | ||
| 490 | - sf.append("<SJFCSJ>").append(scheduleRealInfo.getFcsjActual()).append("</SJFCSJ>"); | ||
| 491 | - sf.append("<FCZDLX></FCZDLX>"); | ||
| 492 | - sf.append("<DDZDMC>").append(scheduleRealInfo.getZdzName()).append("</DDZDMC>"); | ||
| 493 | - // 终点站的参数 | ||
| 494 | - otherMap.put("stationMark","E"); | ||
| 495 | - paramMap = packageYgcStationNumParam(scheduleRealInfo,otherMap); | ||
| 496 | - sf.append("<DDZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,stationNumMap)).append("</DDZDXH>"); | ||
| 497 | - sf.append("<DDZDBM>").append(scheduleRealInfo.getZdzCode()).append("</DDZDBM>"); | ||
| 498 | - sf.append("<JHDDSJ>").append(scheduleRealInfo.getZdsj()).append("</JHDDSJ>"); | ||
| 499 | - sf.append("<SJDDSJ>").append(scheduleRealInfo.getZdsjActual()).append("</SJDDSJ>"); | ||
| 500 | - sf.append("<DDZDLX></DDZDLX>"); | ||
| 501 | - sf.append("<LDSCBZ>0</LDSCBZ>"); | ||
| 502 | - sf.append("<DDBZ>").append("").append("</DDBZ>"); | ||
| 503 | - sf.append("</LD>"); | ||
| 504 | - } | ||
| 505 | - } | ||
| 506 | - sf.append("</LDList>"); | ||
| 507 | - sf.append("</DLD>"); | ||
| 508 | - } | ||
| 509 | - if(counter % per == per - 1){ | ||
| 510 | - sf.append("</DLDS>"); | ||
| 511 | - // 去掉'号 | ||
| 512 | - str = sf.toString().replace("'",""); | ||
| 513 | - scount += invokeSetLD(str, counter); | ||
| 514 | - counter = 0; | ||
| 515 | - } | ||
| 516 | - } | ||
| 517 | - // 每per条线路上传后剩下的数据再上传 | ||
| 518 | - if(counter > 0){ | ||
| 519 | - sf.append("</DLDS>"); | ||
| 520 | - // 去掉'号 | ||
| 521 | - str = sf.toString().replace("'",""); | ||
| 522 | - scount += invokeSetLD(str, counter); | ||
| 523 | - } | ||
| 524 | - } catch (Exception e) { | ||
| 525 | - e.printStackTrace(); | ||
| 526 | - logger.error("setLD:", e); | ||
| 527 | - } finally { | ||
| 528 | - try { | ||
| 529 | - //发送邮件 | ||
| 530 | - EmailBean mail = new EmailBean(); | ||
| 531 | - mail.setSubject(InetAddress.getLocalHost().getHostAddress()+":路单日志数据"+date); | ||
| 532 | - mail.setContent("总数:" + (listGroup == null ? 0 : listGroup.size()) + "<br/>成功数:" + scount + "<br/>跳过数:" + ccount + "<br/>耗时:" + (System.currentTimeMillis() - start)); | ||
| 533 | - sendEmailController.sendMail(emailSendToAddress, mail); | ||
| 534 | - logger.info("setLD-sendMail:邮件发送成功!"); | ||
| 535 | - } catch (Exception e) { | ||
| 536 | - e.printStackTrace(); | ||
| 537 | - logger.error("setLD-sendMail:",e); | ||
| 538 | - } | ||
| 539 | - } | ||
| 540 | - return "success"; | ||
| 541 | - } | ||
| 542 | - | ||
| 543 | - /** | ||
| 544 | - * 调用运管处电子路单接口,如果上传失败或有网络问题,最多执行10次 | ||
| 545 | - * @param xml 拼接的xml字符串 | ||
| 546 | - * @param counter 分组数 | ||
| 547 | - * @return 成功返回counter 失败返回0 | ||
| 548 | - */ | ||
| 549 | - private int invokeSetLD(String xml, int counter) { | ||
| 550 | - for (int i = 0;i < 10;i++) { | ||
| 551 | - try { | ||
| 552 | - Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(xml)); | ||
| 553 | - if (results.isSuccess()) { | ||
| 554 | - logger.info("setLD: " + xml); | ||
| 555 | - logger.info("setLD: 成功"); | ||
| 556 | - return counter; | ||
| 557 | - } else if (i == 9) { | ||
| 558 | - logger.error("setLD: " + xml); | ||
| 559 | - logger.error("setLD: 失败," + results.getMessage()); | ||
| 560 | - } | ||
| 561 | - Thread.sleep(2000); | ||
| 562 | - } catch (Exception e) { | ||
| 563 | - logger.error("运管处接口调用异常", e); | ||
| 564 | - try { | ||
| 565 | - Thread.sleep(2000); | ||
| 566 | - } catch (InterruptedException ex) { | ||
| 567 | - ex.printStackTrace(); | ||
| 568 | - } | ||
| 569 | - } | ||
| 570 | - } | ||
| 571 | - | ||
| 572 | - return 0; | ||
| 573 | - } | ||
| 574 | - | ||
| 575 | - /** | ||
| 576 | - * 上传路单 xml来自文件 | ||
| 577 | - * @return 上传成功标识 | ||
| 578 | - */ | ||
| 579 | - public String setLDFile(){ | ||
| 580 | - String result = "failure"; | ||
| 581 | - try { | ||
| 582 | - String tmp = readXmlFromFile("E:/ld.txt"); | ||
| 583 | - Results rss = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(tmp)); | ||
| 584 | - if(rss.isSuccess()){ | ||
| 585 | - result = "success"; | ||
| 586 | - } | ||
| 587 | - } catch (Exception e) { | ||
| 588 | - logger.error("setLD:",e); | ||
| 589 | - e.printStackTrace(); | ||
| 590 | - }finally{ | ||
| 591 | - | ||
| 592 | - } | ||
| 593 | - return result; | ||
| 594 | - } | ||
| 595 | - | ||
| 596 | - /** | ||
| 597 | - * 从文件中读取xml | ||
| 598 | - * @param fileName 例:D:/test.txt | ||
| 599 | - * @return | ||
| 600 | - * @throws Exception | ||
| 601 | - */ | ||
| 602 | - private String readXmlFromFile(String fileName) throws Exception { | ||
| 603 | - StringBuffer sf = new StringBuffer(""); | ||
| 604 | - File file = new File(fileName); | ||
| 605 | - InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"GBK"); | ||
| 606 | - BufferedReader bufferedReader = new BufferedReader(reader); | ||
| 607 | - String lineTxt = ""; | ||
| 608 | - while((lineTxt = bufferedReader.readLine()) != null){ | ||
| 609 | - sf.append(lineTxt); | ||
| 610 | - } | ||
| 611 | - reader.close(); | ||
| 612 | - return sf.toString().replaceAll("\t",""); | ||
| 613 | - } | ||
| 614 | - /** | ||
| 615 | - * 上传里程油耗 | ||
| 616 | - * @return 上传成功标识 | ||
| 617 | - */ | ||
| 618 | - public String setLCYH(){ | ||
| 619 | - String result = "failure"; | ||
| 620 | - // 取昨天 的日期 | ||
| 621 | - String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 622 | - StringBuffer sf = new StringBuffer(); | ||
| 623 | - try { | ||
| 624 | - sf.append("<LCYHS>"); | ||
| 625 | - List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); | ||
| 626 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 627 | - Map<String,Object> map = new HashMap<String,Object>(); | ||
| 628 | - for(Map<String,Object> schRealInfo:listGroup){ | ||
| 629 | - if(schRealInfo != null){ | ||
| 630 | - map.put("insideCode_eq", schRealInfo.get("clZbh")+""); | ||
| 631 | - Optional<Cars> optionalCars = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | ||
| 632 | - Cars car = optionalCars.isPresent() ? optionalCars.get() : null; | ||
| 633 | - /** | ||
| 634 | - * 如果car==null,则说明该车辆是从线调中换车功能中加进去的, | ||
| 635 | - * 在cars基础信息中查不到车辆的信息,所以忽略该车辆 | ||
| 636 | - */ | ||
| 637 | - if(car == null){ | ||
| 638 | - continue; | ||
| 639 | - } | ||
| 640 | - //计算总公里和空驶公里,营运公里=总公里-空驶公里 | ||
| 641 | - double totalKilometers = 0,emptyKilometers =0; | ||
| 642 | - sf.append("<LCYH>"); | ||
| 643 | - sf.append("<RQ>"+date+"</RQ>"); | ||
| 644 | - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>"); | ||
| 645 | - sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | ||
| 646 | - if(list != null && list.size() > 0){ | ||
| 647 | - for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 648 | - if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("clZbh")+"") | ||
| 649 | - .equals(scheduleRealInfo.getClZbh())){ | ||
| 650 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 651 | - //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 652 | - if(childTaskPlans.isEmpty()){ | ||
| 653 | - if(scheduleRealInfo.getStatus() == 2){ | ||
| 654 | - totalKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 655 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 656 | - || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 657 | - emptyKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 658 | - } | ||
| 659 | - } | ||
| 660 | - }else{ | ||
| 661 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 662 | - while(it.hasNext()){ | ||
| 663 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 664 | - if(!childTaskPlan.isDestroy()){ | ||
| 665 | - totalKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 666 | - if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 667 | - emptyKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 668 | - } | ||
| 669 | - } | ||
| 670 | - } | ||
| 671 | - } | ||
| 672 | - } | ||
| 673 | - } | ||
| 674 | - } | ||
| 675 | - sf.append("<ZLC>"+totalKilometers+"</ZLC>"); | ||
| 676 | - sf.append("<YYLC>"+emptyKilometers+"</YYLC>"); | ||
| 677 | - sf.append("<YH>"+""+"</YH>"); | ||
| 678 | - sf.append("<JZYL>"+""+"</JZYL>"); | ||
| 679 | - sf.append("<DH>"+""+"</DH>"); | ||
| 680 | - sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); | ||
| 681 | - sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); | ||
| 682 | - sf.append("</LCYH>"); | ||
| 683 | - } | ||
| 684 | - } | ||
| 685 | - sf.append("</LCYHS>"); | ||
| 686 | - if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 687 | - result = "success"; | ||
| 688 | - } | ||
| 689 | - } catch (Exception e) { | ||
| 690 | - logger.error("setLCYH:",e); | ||
| 691 | - e.printStackTrace(); | ||
| 692 | - }finally{ | ||
| 693 | - logger.info("setLCYH:"+sf.toString()); | ||
| 694 | - logger.info("setLCYH:"+result); | ||
| 695 | - } | ||
| 696 | - return result; | ||
| 697 | - } | ||
| 698 | - | ||
| 699 | - /** | ||
| 700 | - * 上传线路调度日报 | ||
| 701 | - * @return | ||
| 702 | - */ | ||
| 703 | - public String setDDRB(){ | ||
| 704 | - String result = "failure"; | ||
| 705 | - // 取昨天 的日期 | ||
| 706 | - String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 707 | - StringBuffer sf = new StringBuffer(); | ||
| 708 | - try { | ||
| 709 | - sf.append("<DDRBS>"); | ||
| 710 | - List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); | ||
| 711 | - List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 712 | - for(Map<String,Object> schRealInfo:listGroup){ | ||
| 713 | - if(schRealInfo != null){ | ||
| 714 | - double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; | ||
| 715 | - int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0; | ||
| 716 | - sf.append("<DDRB>"); | ||
| 717 | - sf.append("<RQ>"+date+"</RQ>"); | ||
| 718 | - sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>"); | ||
| 719 | - for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 720 | - if(scheduleRealInfo != null){ | ||
| 721 | - if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm())){ | ||
| 722 | - //计划 | ||
| 723 | - if(!scheduleRealInfo.isSflj()){ | ||
| 724 | - jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 725 | - //计划空驶 | ||
| 726 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")){ | ||
| 727 | - jhkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 728 | - } | ||
| 729 | - //计划早高峰,计划晚高峰 | ||
| 730 | - if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 731 | - jhzgfbc++; | ||
| 732 | - } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 733 | - jhwgfbc++; | ||
| 734 | - } | ||
| 735 | - } | ||
| 736 | - jhbc++; | ||
| 737 | - | ||
| 738 | - //实际 | ||
| 739 | - Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 740 | - //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 741 | - if(childTaskPlans.isEmpty()){ | ||
| 742 | - if(scheduleRealInfo.getStatus() == 2){ | ||
| 743 | - sjbc++; | ||
| 744 | - zlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 745 | - if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 746 | - || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 747 | - sjkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | ||
| 748 | - } | ||
| 749 | - } | ||
| 750 | - }else{ | ||
| 751 | - sjbc++; | ||
| 752 | - Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 753 | - while(it.hasNext()){ | ||
| 754 | - ChildTaskPlan childTaskPlan = it.next(); | ||
| 755 | - if(!childTaskPlan.isDestroy()){ | ||
| 756 | - zlc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 757 | - if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 758 | - sjkslc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 759 | - } | ||
| 760 | - } | ||
| 761 | - } | ||
| 762 | - } | ||
| 763 | - //实际早高峰,计划晚高峰 | ||
| 764 | - if(scheduleRealInfo.getFcsjActual() != null){ | ||
| 765 | - if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 766 | - sjzgfbc++; | ||
| 767 | - } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 768 | - sjwgfbc++; | ||
| 769 | - } | ||
| 770 | - } | ||
| 771 | - } | ||
| 772 | - } | ||
| 773 | - } | ||
| 774 | - sf.append("<JHLC>"+format.format(jhlc)+"</JHLC>"); | ||
| 775 | - sf.append("<SSLC>"+format.format((zlc-sjkslc))+"</SSLC>"); | ||
| 776 | - sf.append("<JHKSLC>"+format.format(jhkslc)+"</JHKSLC>"); | ||
| 777 | - sf.append("<SJKSLC>"+format.format(sjkslc)+"</SJKSLC>"); | ||
| 778 | - sf.append("<JHBC>"+jhbc+"</JHBC>"); | ||
| 779 | - sf.append("<SJBC>"+sjbc+"</SJBC>"); | ||
| 780 | - sf.append("<JHZGFBC>"+jhzgfbc+"</JHZGFBC>"); | ||
| 781 | - sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); | ||
| 782 | - sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); | ||
| 783 | - sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); | ||
| 784 | - sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); | ||
| 785 | - sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); | ||
| 786 | - sf.append("</DDRB>"); | ||
| 787 | - } | ||
| 788 | - } | ||
| 789 | - sf.append("</DDRBS>"); | ||
| 790 | - if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 791 | - result = "success"; | ||
| 792 | - } | ||
| 793 | - } catch (Exception e) { | ||
| 794 | - logger.error("setDDRB:",e); | ||
| 795 | - e.printStackTrace(); | ||
| 796 | - }finally{ | ||
| 797 | - logger.info("setDDRB:"+sf.toString()); | ||
| 798 | - logger.info("setDDRB:"+result); | ||
| 799 | - } | ||
| 800 | - return result; | ||
| 801 | - } | ||
| 802 | - | ||
| 803 | - /** | ||
| 804 | - * 上传计划班次 指定日期 yyyy-MM-dd | ||
| 805 | - * @param theDate | ||
| 806 | - * @return | ||
| 807 | - */ | ||
| 808 | - public String setJHBC(String theDate){ | ||
| 809 | - return uploadJHBC(theDate); | ||
| 810 | - } | ||
| 811 | - | ||
| 812 | - /** | ||
| 813 | - * 上传计划班次 | ||
| 814 | - * @return | ||
| 815 | - */ | ||
| 816 | - public String setJHBC(){ | ||
| 817 | - return uploadJHBC(null); | ||
| 818 | - } | ||
| 819 | - /** | ||
| 820 | - * 上传线路计划班次表 | ||
| 821 | - */ | ||
| 822 | - | ||
| 823 | - private String uploadJHBC(String theDate) { | ||
| 824 | - String result = "failure"; | ||
| 825 | - Line line; | ||
| 826 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 827 | - try { | ||
| 828 | - sBuffer.append("<JHBCs>"); | ||
| 829 | - // 声明变量 | ||
| 830 | - SchedulePlanInfo schedulePlanInfo; | ||
| 831 | - String xlbm,zbh = ""; | ||
| 832 | - Long lp = 0L; | ||
| 833 | - // 取得计划班次时间 | ||
| 834 | - String tomorrow = theDate == null ? sdfnyr.format(DateUtils.addDays(new Date(), +1)) : theDate; | ||
| 835 | - // 查询所有班次 | ||
| 836 | - List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow); | ||
| 837 | - int j = 0; // 初始化标识 | ||
| 838 | - if(schedulePlanList != null ){ | ||
| 839 | - HashMap<String,String> paramMap; | ||
| 840 | - HashMap<String,String> otherMap = new HashMap<String, String>(); | ||
| 841 | - int size = schedulePlanList.size(); | ||
| 842 | - for (int i = 0; i < size; i++) { | ||
| 843 | - schedulePlanInfo = schedulePlanList.get(i); | ||
| 844 | - xlbm = schedulePlanInfo.getXlBm(); | ||
| 845 | - // 获取线路是否使用标识,如果未使用,则不查该线路数据 | ||
| 846 | - line = lineRepository.findByLineCode(xlbm); | ||
| 847 | - if(line.getInUse() == null || line.getInUse() == 0){ | ||
| 848 | - continue; | ||
| 849 | - } | ||
| 850 | - if(++j == 1){// 第一次,则初始化值 | ||
| 851 | - zbh = schedulePlanInfo.getClZbh(); | ||
| 852 | - lp = schedulePlanInfo.getLp(); | ||
| 853 | - // 拼装XML | ||
| 854 | - assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); | ||
| 855 | - } | ||
| 856 | - // 比较是否为同一条线路同一辆车 | ||
| 857 | - if(xlbm.equals(schedulePlanInfo.getXlBm()) | ||
| 858 | - && zbh.equals(schedulePlanInfo.getClZbh()) | ||
| 859 | - && lp == schedulePlanInfo.getLp()){ | ||
| 860 | - if(schedulePlanInfo.getBcType().equals("in") || schedulePlanInfo.getBcType().equals("out")){ | ||
| 861 | - continue; | ||
| 862 | - } | ||
| 863 | - sBuffer.append("<BC>"); | ||
| 864 | - sBuffer.append("<SJGH>").append(schedulePlanInfo.getjGh()).append("</SJGH>"); | ||
| 865 | - sBuffer.append("<SXX>").append(schedulePlanInfo.getXlDir()).append("</SXX>"); | ||
| 866 | - sBuffer.append("<FCZDMC>").append(schedulePlanInfo.getQdzName()).append("</FCZDMC>"); | ||
| 867 | - // 起点站的参数 | ||
| 868 | - otherMap.put("stationMark","B"); | ||
| 869 | - paramMap = packageYgcStationNumParam(schedulePlanInfo,otherMap); | ||
| 870 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</ZDXH>"); | ||
| 871 | - sBuffer.append("<JHFCSJ>").append(schedulePlanInfo.getFcsj()).append("</JHFCSJ>"); | ||
| 872 | - sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>"); | ||
| 873 | - // 起点站的参数 | ||
| 874 | - otherMap.put("stationMark","E"); | ||
| 875 | - paramMap = packageYgcStationNumParam(schedulePlanInfo,otherMap); | ||
| 876 | - sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</DDXH>"); | ||
| 877 | - sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj())) | ||
| 878 | - .append("</JHDDSJ>"); | ||
| 879 | - sBuffer.append("</BC>"); | ||
| 880 | - if(i == size -1 ){ | ||
| 881 | - sBuffer.append("</BCList>"); | ||
| 882 | - sBuffer.append("</JHBC>"); | ||
| 883 | - } | ||
| 884 | - }else{ | ||
| 885 | - zbh = schedulePlanInfo.getClZbh(); | ||
| 886 | - lp = schedulePlanInfo.getLp(); | ||
| 887 | - sBuffer.append("</BCList>"); | ||
| 888 | - sBuffer.append("</JHBC>"); | ||
| 889 | - // 拼装XML | ||
| 890 | - assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); | ||
| 891 | - } | ||
| 892 | - } | ||
| 893 | - } | ||
| 894 | - // 判断XML是否以</BCList>结尾,如果不是,则加上 | ||
| 895 | - String regex = "^*</JHBC>$"; | ||
| 896 | - Pattern p = Pattern.compile(regex); | ||
| 897 | - Matcher m = p.matcher(sBuffer); | ||
| 898 | - boolean isEndWithTrueFlag = false; | ||
| 899 | - while (m.find()) { | ||
| 900 | - isEndWithTrueFlag = true; | ||
| 901 | - } | ||
| 902 | - // 加上缺失的标签 | ||
| 903 | - if(!isEndWithTrueFlag){ | ||
| 904 | - sBuffer.append("</BCList>"); | ||
| 905 | - sBuffer.append("</JHBC>"); | ||
| 906 | - } | ||
| 907 | - sBuffer.append("</JHBCs>"); | ||
| 908 | - if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 909 | - result = "success"; | ||
| 910 | - } | ||
| 911 | - } catch (Exception e) { | ||
| 912 | - logger.error("setJHBC:",e); | ||
| 913 | - e.printStackTrace(); | ||
| 914 | - }finally{ | ||
| 915 | - logger.info("setJHBC:"+sBuffer.toString()); | ||
| 916 | - logger.info("setJHBC:"+result); | ||
| 917 | - } | ||
| 918 | - return result; | ||
| 919 | - } | ||
| 920 | - | ||
| 921 | - /** | ||
| 922 | - * 上传线路班次时刻表数据 | ||
| 923 | - */ | ||
| 924 | - @Override | ||
| 925 | - public String setSKB(String ids) { | ||
| 926 | - String result = "上传失败,"; | ||
| 927 | - StringBuffer sBuffer = new StringBuffer("<SKBs>"); | ||
| 928 | - DecimalFormat df = new DecimalFormat("######0.000"); | ||
| 929 | - Map<String,String> lsStationCode2NameMap = null; | ||
| 930 | - Map<String, Integer> lsStationName2YgcNumber = null; | ||
| 931 | - try { | ||
| 932 | - String[] idArray = ids.split(","); | ||
| 933 | - StringBuffer sBufferA ,sBufferB ,sBufferC ; | ||
| 934 | - double zlc,yylc,singleLc,emptyLc;// 总里程、营运里程、单程、空放里程 | ||
| 935 | - String bcType,sxx;// 班次类型、上下行 | ||
| 936 | - // 上传的时刻表集合 | ||
| 937 | - List<TTInfo> ttinfoList = new ArrayList<>(); | ||
| 938 | - TTInfo ttInfo; | ||
| 939 | - TTInfoDetail ttInfoDetail; | ||
| 940 | - LineInformation lineInformation; | ||
| 941 | - Iterator<TTInfoDetail> ttInfoDetailIterator; | ||
| 942 | - HashMap<String,Object> param ; | ||
| 943 | - HashMap<String,String> paramMap; | ||
| 944 | - HashMap<String,String> otherMap = new HashMap<>(); | ||
| 945 | - // 线路编码、周几执行、发车站点名称、发车站点序号、到达站点名称、到达站点序号 | ||
| 946 | - String xlbm,zjzx,fczdmc,zdxh,ddzdmc,ddxh; | ||
| 947 | - // 得到时刻表版本号 | ||
| 948 | - int lineVersion; | ||
| 949 | - long ttinfoId; | ||
| 950 | - // 是否输出站点信息 | ||
| 951 | - boolean isLogStation; | ||
| 952 | - for (int i = 0; i < idArray.length; i++) { | ||
| 953 | - ttinfoId = Long.valueOf(idArray[i]); | ||
| 954 | - Optional<TTInfo> optionalTTInfo = ttInfoRepository.findById(ttinfoId); | ||
| 955 | - ttInfo = optionalTTInfo.isPresent() ? optionalTTInfo.get() : null; | ||
| 956 | - if(ttInfo == null) | ||
| 957 | - continue; | ||
| 958 | - ttinfoList.add(ttInfo); // 保存时刻表 | ||
| 959 | - // 得到时刻表版本号 | ||
| 960 | - lineVersion = ttInfo.getLineVersion(); | ||
| 961 | - // 查询历史站点路由 | ||
| 962 | - lsStationCode2NameMap = getLsStationCode(ttInfo.getXl().getLineCode(),lineVersion); | ||
| 963 | - // 查询历史站点路由 | ||
| 964 | - lsStationName2YgcNumber = getLsStationRoute(ttInfo.getXl().getLineCode(),lineVersion); | ||
| 965 | - zlc = 0.0f; | ||
| 966 | - yylc = 0.0f; | ||
| 967 | - // 获得时刻表 | ||
| 968 | - param = new HashMap(); | ||
| 969 | - param.put("ttinfo.id_eq", ttInfo.getId()); | ||
| 970 | - ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), | ||
| 971 | - new Sort(Direction.ASC, "xlDir")).iterator(); | ||
| 972 | - // 获得lineInformation | ||
| 973 | - param = new HashMap(); | ||
| 974 | - param.put("line.id_eq", ttInfo.getXl().getId()); | ||
| 975 | - Optional<LineInformation> optionalLineInformation = lineInformationRepository.findOne(new CustomerSpecs<LineInformation>(param)); | ||
| 976 | - lineInformation = optionalLineInformation.isPresent() ? optionalLineInformation.get() : null; | ||
| 977 | - // 初始化 | ||
| 978 | - isLogStation = true; | ||
| 979 | - if(ttInfoDetailIterator.hasNext()){ | ||
| 980 | - // 得到线路信息 | ||
| 981 | - Optional<Line> optionalLine = lineRepository.findById(ttInfo.getXl().getId()); | ||
| 982 | - Line line = optionalLine.isPresent() ? optionalLine.get() : null; | ||
| 983 | - if(line == null){ | ||
| 984 | - result += "未找到相应的线路信息,请设置线路信息后再上传"; | ||
| 985 | - return result; | ||
| 986 | - } | ||
| 987 | - // 得到上海市线路编码 | ||
| 988 | - xlbm = line.getShanghaiLinecode(); | ||
| 989 | - if("".equals(xlbm) || "null".equals(xlbm)){ | ||
| 990 | - result += "线路编码为空,请设置线路编码后再上传"; | ||
| 991 | - return result; | ||
| 992 | - } | ||
| 993 | - // 拿到周几执行 | ||
| 994 | - zjzx = changeRuleDay(ttInfo.getRule_days()); | ||
| 995 | - if("".equals(zjzx) || "null".equals(zjzx)){ | ||
| 996 | - result += "时刻表执行时间为空,请设置执行时间后再上传"; | ||
| 997 | - return result; | ||
| 998 | - } | ||
| 999 | - sBuffer.append("<SKB>"); | ||
| 1000 | - sBuffer.append("<XLBM>").append(xlbm).append("</XLBM>"); | ||
| 1001 | - sBufferB = new StringBuffer(); | ||
| 1002 | - sBufferC = new StringBuffer(); | ||
| 1003 | - sBufferB.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | ||
| 1004 | - // 结束日期暂时不要,节假日的班次表才需要,如春节的班次表 | ||
| 1005 | - sBufferB.append("<JSRQ>").append("").append("</JSRQ>"); | ||
| 1006 | - sBufferB.append("<ZJZX>").append(zjzx).append("</ZJZX>"); | ||
| 1007 | - sBufferB.append("<TBYY>").append("").append("</TBYY>"); | ||
| 1008 | - sBufferB.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1009 | - sBufferB.append("<BCList>"); | ||
| 1010 | - while (ttInfoDetailIterator.hasNext()) { | ||
| 1011 | - ttInfoDetail = ttInfoDetailIterator.next(); | ||
| 1012 | - bcType = ttInfoDetail.getBcType(); | ||
| 1013 | - sxx = ttInfoDetail.getXlDir(); | ||
| 1014 | - // 进出场班次的里程,加入总里程 | ||
| 1015 | - if(bcType.equals("in") || bcType.equals("out")){ | ||
| 1016 | - // 进出班次的计划里程,算空驶里程 | ||
| 1017 | - emptyLc = ttInfoDetail.getJhlc(); | ||
| 1018 | - // 总里程需要加上空驶里程 | ||
| 1019 | - zlc += emptyLc; | ||
| 1020 | - continue; | ||
| 1021 | - } | ||
| 1022 | - // 不是正常班次,不传到运管处 | ||
| 1023 | - if(!bcType.equals("normal")){ | ||
| 1024 | - continue; | ||
| 1025 | - } | ||
| 1026 | - // 如果发车时间格式错误,忽略此条 | ||
| 1027 | - if(changeTimeFormat(ttInfoDetail) == null){ | ||
| 1028 | - continue; | ||
| 1029 | - } | ||
| 1030 | - // 发生站点名称 | ||
| 1031 | - fczdmc = lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()+"_"+ttInfoDetail.getQdzCode()); | ||
| 1032 | - if("".equals(fczdmc) || "null".equals(fczdmc)){ | ||
| 1033 | - result += "发车站点名称为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1034 | - return result; | ||
| 1035 | - } | ||
| 1036 | - sBufferC.append("<BC>"); | ||
| 1037 | - sBufferC.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | ||
| 1038 | - sBufferC.append("<SXX>").append(sxx).append("</SXX>"); | ||
| 1039 | - sBufferC.append("<FCZDMC>").append(fczdmc).append("</FCZDMC>"); | ||
| 1040 | - // 起点站的参数 | ||
| 1041 | - otherMap.put("stationMark","B"); | ||
| 1042 | - paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap); | ||
| 1043 | - if(isLogStation){// 输出起点站信息 | ||
| 1044 | - logger.info("setSKB:"+"起点站信息:"+paramMap); | ||
| 1045 | - } | ||
| 1046 | - // 发车站点序号 | ||
| 1047 | - zdxh = String.valueOf(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)); | ||
| 1048 | - if("".equals(zdxh) || "null".equals(zdxh) || "0".equals(zdxh)){ | ||
| 1049 | - result += "发车站点序号为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1050 | - return result; | ||
| 1051 | - } | ||
| 1052 | - // 到达站点名称 | ||
| 1053 | - ddzdmc = lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()+"_"+ttInfoDetail.getZdzCode()); | ||
| 1054 | - if("".equals(ddzdmc) || "null".equals(ddzdmc)){ | ||
| 1055 | - result += "到达站点名称为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1056 | - return result; | ||
| 1057 | - } | ||
| 1058 | - sBufferC.append("<ZDXH>").append(zdxh).append("</ZDXH>"); | ||
| 1059 | - sBufferC.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>"); | ||
| 1060 | - sBufferC.append("<DDZDMC>").append(ddzdmc).append("</DDZDMC>"); | ||
| 1061 | - // 终点站的参数 | ||
| 1062 | - otherMap.put("stationMark","E"); | ||
| 1063 | - paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap); | ||
| 1064 | - if(isLogStation){// 输出终点站信息 | ||
| 1065 | - logger.info("setSKB:"+"终点站信息:"+paramMap); | ||
| 1066 | - } | ||
| 1067 | - // 到达站点序号 | ||
| 1068 | - ddxh = String.valueOf(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)); | ||
| 1069 | - if("".equals(ddxh) || "null".equals(ddxh) || "0".equals(ddxh)){ | ||
| 1070 | - result += "到达站点序号为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1071 | - return result; | ||
| 1072 | - } | ||
| 1073 | - isLogStation = false; // 一条线路只输出一次,后面的不输出了 | ||
| 1074 | - sBufferC.append("<DDXH>").append(ddxh).append("</DDXH>"); | ||
| 1075 | - sBufferC.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | ||
| 1076 | - sBufferC.append("</BC>"); | ||
| 1077 | - // 0:上行;1:下行 | ||
| 1078 | - if("0".equals(sxx)){ | ||
| 1079 | - singleLc = lineInformation.getUpMileage(); | ||
| 1080 | - }else{ | ||
| 1081 | - singleLc = lineInformation.getDownMileage(); | ||
| 1082 | - } | ||
| 1083 | - zlc += singleLc ; | ||
| 1084 | - yylc += singleLc; | ||
| 1085 | - } | ||
| 1086 | - sBufferC.append("</BCList>"); | ||
| 1087 | - sBufferC.append("</SKB>"); | ||
| 1088 | - sBufferA = new StringBuffer(); | ||
| 1089 | - sBufferA.append("<JHZLC>").append(df.format(zlc)).append("</JHZLC>"); | ||
| 1090 | - sBufferA.append("<JHYYLC>").append(df.format(yylc)).append("</JHYYLC>"); | ||
| 1091 | - sBuffer.append(sBufferA).append(sBufferB).append(sBufferC); | ||
| 1092 | - } | ||
| 1093 | - logger.info("setSKB:"+"ttinfoId:"+ttinfoId+";当前站点版本号:"+lineVersion+";查询历史站点路由:"+lsStationCode2NameMap+";查询历史站点编号:"+lsStationName2YgcNumber); | ||
| 1094 | - } | ||
| 1095 | - sBuffer.append("</SKBs>"); | ||
| 1096 | - String state;// 是否上传成功 | ||
| 1097 | - if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 1098 | - result = "上传成功"; | ||
| 1099 | - state = "1"; | ||
| 1100 | - }else{// 上传失败 | ||
| 1101 | - result = "上传失败"; | ||
| 1102 | - state = "0"; | ||
| 1103 | - } | ||
| 1104 | - // 保存运管处上传记录 | ||
| 1105 | - saveYgcUploadLog(ttinfoList,sBuffer.toString(),TrafficManageServiceImpl.UPLOAD_TYPE_SKB,state); | ||
| 1106 | - } catch (Exception e) { | ||
| 1107 | - logger.error("setSKB:", e); | ||
| 1108 | - e.printStackTrace(); | ||
| 1109 | - }finally{ | ||
| 1110 | - logger.info("setSKB:"+sBuffer.toString()); | ||
| 1111 | - logger.info("setSKB:"+result); | ||
| 1112 | - } | ||
| 1113 | - return result; | ||
| 1114 | - } | ||
| 1115 | - | ||
| 1116 | - /** | ||
| 1117 | - * 保存上传运管处的日志 | ||
| 1118 | - * @param obj 参数 | ||
| 1119 | - * @param type 日志类型 | ||
| 1120 | - * @param xml 上传参数 | ||
| 1121 | - */ | ||
| 1122 | - private void saveYgcUploadLog(Object obj,String xml,String type,String state){ | ||
| 1123 | - SKBUploadLogger skbUploadLogger = new SKBUploadLogger(); | ||
| 1124 | - SysUser user; | ||
| 1125 | - // 如果不是人为上传,SysUser则为空,设置上传人员为管理员 | ||
| 1126 | - if(SecurityContextHolder.getContext() == null || SecurityContextHolder.getContext().getAuthentication() == null){ | ||
| 1127 | - user = new SysUser(); | ||
| 1128 | - user.setId(1); | ||
| 1129 | - }else{// 获取上传人员 | ||
| 1130 | - user = SecurityUtils.getCurrentUser(); | ||
| 1131 | - } | ||
| 1132 | - // 最大的字符长度 | ||
| 1133 | - int maxLength = 60000; | ||
| 1134 | - int cutLength = 50000;// 需要截取的字符长度 | ||
| 1135 | - String xml_sub = null; | ||
| 1136 | - skbUploadLogger.setType(type);// 设置类型 | ||
| 1137 | - // 判断xml是否超长,如果超长,则截取 | ||
| 1138 | - if(xml != null && xml.length() > maxLength){ | ||
| 1139 | - int xmlLength = xml.length(); | ||
| 1140 | - int cutCount = xmlLength / cutLength + (xmlLength % cutLength > 0 ? 1 : 0); | ||
| 1141 | - if(cutCount > 2){ | ||
| 1142 | - xml = "由于上传参数内容超长,请查看服务器的系统日志"; | ||
| 1143 | - }else if(cutCount == 2){ | ||
| 1144 | - xml_sub =xml.substring(cutLength); | ||
| 1145 | - xml = xml.substring(0,cutLength); | ||
| 1146 | - }else{ | ||
| 1147 | - // 不做处理 | ||
| 1148 | - } | ||
| 1149 | - } | ||
| 1150 | -// skbUploadLogger.setUploadXml(xml);// 上传的参数 | ||
| 1151 | -// skbUploadLogger.setUploadXmlSub(xml_sub); | ||
| 1152 | - skbUploadLogger.setState(state);// 状态:是否成功 | ||
| 1153 | - skbUploadLogger.setUser(user); | ||
| 1154 | - // 时刻表 | ||
| 1155 | - if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_SKB)){ | ||
| 1156 | - List<TTInfo> ttInfoList = (List<TTInfo>)obj; | ||
| 1157 | - String name = ""; | ||
| 1158 | - Line line = null; | ||
| 1159 | - for(TTInfo ttInfo : ttInfoList){ | ||
| 1160 | - name += ttInfo.getName() + " "; | ||
| 1161 | - line = ttInfo.getXl(); | ||
| 1162 | - } | ||
| 1163 | - skbUploadLogger.setLine(line); | ||
| 1164 | - skbUploadLogger.setUser(user); | ||
| 1165 | - skbUploadLogger.setName(name); | ||
| 1166 | - skbUploadLoggerRepository.save(skbUploadLogger); | ||
| 1167 | - }else{ | ||
| 1168 | - if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_XL)){ | ||
| 1169 | - Line line = (Line) obj; | ||
| 1170 | - String name = line.getName() + "线路停靠站上传"; | ||
| 1171 | - skbUploadLogger.setLine(line); | ||
| 1172 | - skbUploadLogger.setName(name); | ||
| 1173 | - skbUploadLoggerRepository.save(skbUploadLogger); | ||
| 1174 | - }else if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_LD)){ | ||
| 1175 | - Map<String ,Line> logLineMap = (Map<String ,Line> )obj; | ||
| 1176 | - for (String key : logLineMap.keySet()) { | ||
| 1177 | - Line line = logLineMap.get(key); | ||
| 1178 | - String name = line.getName() + "路单上传"; | ||
| 1179 | - skbUploadLogger = new SKBUploadLogger(); | ||
| 1180 | - skbUploadLogger.setType(type);// 设置类型 | ||
| 1181 | -// skbUploadLogger.setUploadXml(xml);// 上传的参数 | ||
| 1182 | -// skbUploadLogger.setUploadXmlSub(xml_sub); | ||
| 1183 | - skbUploadLogger.setState(state);// 状态:是否成功 | ||
| 1184 | - skbUploadLogger.setUser(user); | ||
| 1185 | - skbUploadLogger.setLine(line); | ||
| 1186 | - skbUploadLogger.setName(name); | ||
| 1187 | -// skbUploadLoggerRepository.save(skbUploadLogger); | ||
| 1188 | - } | ||
| 1189 | - } | ||
| 1190 | - } | ||
| 1191 | - } | ||
| 1192 | - /** | ||
| 1193 | - * 上传线路人员车辆配置信息 | ||
| 1194 | - */ | ||
| 1195 | - @Override | ||
| 1196 | - public String setXLPC() { | ||
| 1197 | - String result = "failure"; | ||
| 1198 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 1199 | - try { | ||
| 1200 | - sBuffer.append("<XLPCs>"); | ||
| 1201 | - // 声明变量 | ||
| 1202 | - Line line = null; | ||
| 1203 | - Cars cars = null; | ||
| 1204 | - List<Personnel> personnelList = null; | ||
| 1205 | - List<Cars> carsList = null; | ||
| 1206 | - int totalPersonnel,totalCar ;// 人员数量。车辆数量 | ||
| 1207 | - // 查询所有线路 | ||
| 1208 | - Iterator<Line> lineIterator = lineRepository.findAll().iterator(); | ||
| 1209 | - // 循环查找线路下的信息 | ||
| 1210 | - while(lineIterator.hasNext()){ | ||
| 1211 | - line = lineIterator.next(); | ||
| 1212 | - sBuffer.append("<XLPC>"); | ||
| 1213 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | ||
| 1214 | - // 查询驾驶员数量 | ||
| 1215 | - personnelList = personnelRepository.findJsysByLineId(line.getId()); | ||
| 1216 | - totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 1217 | - sBuffer.append("<SJRS>").append(totalPersonnel).append("</SJRS>"); | ||
| 1218 | - // 查询售票员人员数量 | ||
| 1219 | - personnelList = personnelRepository.findSpysByLineId(line.getId()); | ||
| 1220 | - totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 1221 | - sBuffer.append("<SPYRS>").append(totalPersonnel).append("</SPYRS>"); | ||
| 1222 | - // 查询车辆 | ||
| 1223 | - carsList = carsRepository.findCarsByLineId(line.getId()); | ||
| 1224 | - totalCar = carsList != null ? carsList.size():0; | ||
| 1225 | - sBuffer.append("<PCSL>").append(totalCar).append("</PCSL>"); | ||
| 1226 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1227 | - int carsNum = 0; | ||
| 1228 | - // 取车牌号 | ||
| 1229 | - if(carsList != null){ | ||
| 1230 | - carsNum = carsList.size(); | ||
| 1231 | - sBuffer.append("<CPHList>"); | ||
| 1232 | - for (int i = 0; i < carsNum; i++) { | ||
| 1233 | - cars = carsList.get(i); | ||
| 1234 | - sBuffer.append("<CPH>").append("沪").append(cars.getCarCode()).append("</CPH>"); | ||
| 1235 | - } | ||
| 1236 | - sBuffer.append("</CPHList>"); | ||
| 1237 | - } | ||
| 1238 | - sBuffer.append("</XLPC>"); | ||
| 1239 | - } | ||
| 1240 | - sBuffer.append("</XLPCs>"); | ||
| 1241 | - if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 1242 | - result = "success"; | ||
| 1243 | - } | ||
| 1244 | - } catch (Exception e) { | ||
| 1245 | - logger.error("setXLPC:",e); | ||
| 1246 | - e.printStackTrace(); | ||
| 1247 | - }finally{ | ||
| 1248 | - logger.info("setXLPC:"+sBuffer.toString()); | ||
| 1249 | - logger.info("setXLPC:"+result); | ||
| 1250 | - } | ||
| 1251 | - return result; | ||
| 1252 | - } | ||
| 1253 | - | ||
| 1254 | - | ||
| 1255 | - /** | ||
| 1256 | - * 上传超速数据 | ||
| 1257 | - */ | ||
| 1258 | - @Override | ||
| 1259 | - public String setCS() { | ||
| 1260 | - String result = "failure"; | ||
| 1261 | - StringBuffer sBuffer =new StringBuffer(); | ||
| 1262 | - sBuffer.append("<CSs>"); | ||
| 1263 | - String sql = "SELECT * FROM bsth_c_speeding where DATE_FORMAT(create_date,'%Y-%m-%d') = ? order by create_date "; | ||
| 1264 | - Connection conn = null; | ||
| 1265 | - PreparedStatement ps = null; | ||
| 1266 | - ResultSet rs = null; | ||
| 1267 | - // 取昨天 的日期 | ||
| 1268 | - String yesterday = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 1269 | - try { | ||
| 1270 | - conn = DBUtils_MS.getConnection(); | ||
| 1271 | - ps = conn.prepareStatement(sql); | ||
| 1272 | - ps.setString(1, yesterday); | ||
| 1273 | - rs = ps.executeQuery(); | ||
| 1274 | - Float lon, lat; | ||
| 1275 | - String kssk; | ||
| 1276 | - String speed; | ||
| 1277 | - while (rs.next()) { | ||
| 1278 | - kssk = sdfnyrsfm.format(rs.getLong("TIMESTAMP")); | ||
| 1279 | - speed = rs.getString("SPEED"); | ||
| 1280 | - // 经纬度 | ||
| 1281 | - lon = rs.getFloat("LON"); | ||
| 1282 | - lat = rs.getFloat("LAT"); | ||
| 1283 | - sBuffer.append("<CS>"); | ||
| 1284 | - sBuffer.append("<RQ>").append(sdfnyr.format(rs.getDate("CREATE_DATE"))).append("</RQ>"); | ||
| 1285 | - sBuffer.append("<XLBM>").append(BasicData.lineCode2ShangHaiCodeMap.get(rs.getString("LINE"))).append("</XLBM>");//////// | ||
| 1286 | - sBuffer.append("<CPH>").append(rs.getString("VEHICLE")).append("</CPH>"); | ||
| 1287 | - sBuffer.append("<KSSK>").append(kssk).append("</KSSK>"); | ||
| 1288 | - sBuffer.append("<KSDDJD>").append(lon).append("</KSDDJD>"); | ||
| 1289 | - sBuffer.append("<KSDDWD>").append(lat).append("</KSDDWD>"); | ||
| 1290 | - sBuffer.append("<KSLD>").append("").append("</KSLD>");//********************** | ||
| 1291 | - sBuffer.append("<JSSK>").append(kssk).append("</JSSK>"); | ||
| 1292 | - sBuffer.append("<JSDDJD>").append(lon).append("</JSDDJD>"); | ||
| 1293 | - sBuffer.append("<JSDDWD>").append(lat).append("</JSDDWD>"); | ||
| 1294 | - sBuffer.append("<JSLD>").append("").append("</JSLD>");//********************** | ||
| 1295 | - sBuffer.append("<PJSD>").append(speed).append("</PJSD>"); | ||
| 1296 | - sBuffer.append("<ZGSS>").append(speed).append("</ZGSS>"); | ||
| 1297 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1298 | - sBuffer.append("</CS>"); | ||
| 1299 | - } | ||
| 1300 | - sBuffer.append("</CSs>"); | ||
| 1301 | - if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 1302 | - result = "success"; | ||
| 1303 | - } | ||
| 1304 | - } catch (Exception e) { | ||
| 1305 | - logger.error("setCS:",e); | ||
| 1306 | - e.printStackTrace(); | ||
| 1307 | - } finally { | ||
| 1308 | - logger.info("setCS:"+sBuffer.toString()); | ||
| 1309 | - logger.info("setCS:"+result); | ||
| 1310 | - DBUtils_MS.close(rs, ps, conn); | ||
| 1311 | - } | ||
| 1312 | - return result; | ||
| 1313 | - } | ||
| 1314 | - | ||
| 1315 | - | ||
| 1316 | - /** | ||
| 1317 | - * 下载全量的公交基础数据 | ||
| 1318 | - */ | ||
| 1319 | - public String getDownLoadAllDataFile() { | ||
| 1320 | - String result = "failure"; | ||
| 1321 | - try { | ||
| 1322 | - try { | ||
| 1323 | - if(ygcBasicDataService.download("admin","000000","abc.zip")){ | ||
| 1324 | - result = "success"; | ||
| 1325 | - } | ||
| 1326 | - } catch (Exception e) { | ||
| 1327 | - e.printStackTrace(); | ||
| 1328 | - } | ||
| 1329 | - } catch (Exception e) { | ||
| 1330 | - e.printStackTrace(); | ||
| 1331 | - } | ||
| 1332 | - | ||
| 1333 | - return result; | ||
| 1334 | - } | ||
| 1335 | - | ||
| 1336 | - /** | ||
| 1337 | - * 下载增量的公交基础数据 | ||
| 1338 | - */ | ||
| 1339 | - public String getDownLoadIncreaseDataFile() { | ||
| 1340 | - String result = "success"; | ||
| 1341 | - try { | ||
| 1342 | - //System.out.println(portType.downloadIncreaseDataFile(args0, args1, args2)); | ||
| 1343 | - } catch (Exception e) { | ||
| 1344 | - e.printStackTrace(); | ||
| 1345 | - } | ||
| 1346 | - | ||
| 1347 | - return result; | ||
| 1348 | - } | ||
| 1349 | - | ||
| 1350 | - /** | ||
| 1351 | - * 指定线路查询方式公交基础数据下载 | ||
| 1352 | - */ | ||
| 1353 | - public String getDownLoadWarrantsBusLineStation() { | ||
| 1354 | - String result = "success"; | ||
| 1355 | - try { | ||
| 1356 | - | ||
| 1357 | - //portType.setXL(userNameXl, passwordXl, sBuffer.toString()); | ||
| 1358 | - } catch (Exception e) { | ||
| 1359 | - e.printStackTrace(); | ||
| 1360 | - } | ||
| 1361 | - | ||
| 1362 | - return result; | ||
| 1363 | - } | ||
| 1364 | - | ||
| 1365 | - /** | ||
| 1366 | - * 计算结束时间 | ||
| 1367 | - * @param fcsj 发车时间 | ||
| 1368 | - * @param bcsj 班次历时 | ||
| 1369 | - * @return | ||
| 1370 | - */ | ||
| 1371 | - private String calcDdsj(String fcsj,Integer bcsj){ | ||
| 1372 | - String result = ""; | ||
| 1373 | - if(fcsj.indexOf(":") != -1){ | ||
| 1374 | - if(bcsj == null){ | ||
| 1375 | - return fcsj; | ||
| 1376 | - } | ||
| 1377 | - // 时和分隔开 | ||
| 1378 | - String[] fcsjArray = fcsj.split(":"); | ||
| 1379 | - // 分和历时时间相加 | ||
| 1380 | - Integer fullTime = Integer.valueOf(fcsjArray[1])+ bcsj; | ||
| 1381 | - int hour,min,sumHour; | ||
| 1382 | - hour = fullTime / 60; | ||
| 1383 | - min = fullTime % 60; | ||
| 1384 | - sumHour = Integer.valueOf(fcsjArray[0])+hour; | ||
| 1385 | - if(sumHour >= 24){ | ||
| 1386 | - result = String.format("%02d",sumHour - 24); | ||
| 1387 | - }else{ | ||
| 1388 | - result = String.format("%02d",sumHour);; | ||
| 1389 | - } | ||
| 1390 | - result +=":"+String.format("%02d", min); | ||
| 1391 | - }else{ | ||
| 1392 | - result = fcsj; | ||
| 1393 | - } | ||
| 1394 | - return result; | ||
| 1395 | - } | ||
| 1396 | - | ||
| 1397 | - /** | ||
| 1398 | - * 改变时间格式 | ||
| 1399 | - * @param ttInfoDetail 时刻表详细 | ||
| 1400 | - * @return xx:yy | ||
| 1401 | - */ | ||
| 1402 | - private String changeTimeFormat(TTInfoDetail ttInfoDetail){ | ||
| 1403 | - String result = "00:00"; | ||
| 1404 | - String fcsj = ttInfoDetail.getFcsj(); | ||
| 1405 | - if(fcsj.indexOf(":") != -1){ | ||
| 1406 | - // 时和分隔开 | ||
| 1407 | - String[] fcsjArray = fcsj.split(":"); | ||
| 1408 | - result = String.format("%02d", Integer.valueOf(fcsjArray[0]))+":"; | ||
| 1409 | - result +=String.format("%02d", Integer.valueOf(fcsjArray[1])); | ||
| 1410 | - }else{ | ||
| 1411 | - result = null; | ||
| 1412 | - logger.info("setSKB:发车时间错误:ttInfoDetail.id="+ttInfoDetail.getId()); | ||
| 1413 | - } | ||
| 1414 | - return result; | ||
| 1415 | - } | ||
| 1416 | - | ||
| 1417 | - /** | ||
| 1418 | - * 拼装线路计划班次表的XML | ||
| 1419 | - * @param sBuffer | ||
| 1420 | - * @param schedulePlanInfo | ||
| 1421 | - * @param xlbm | ||
| 1422 | - * @param zbh | ||
| 1423 | - * @param lp | ||
| 1424 | - */ | ||
| 1425 | - private void assembleJHBC(StringBuffer sBuffer,SchedulePlanInfo schedulePlanInfo,String xlbm,String zbh,Long lp){ | ||
| 1426 | - sBuffer.append("<JHBC>"); | ||
| 1427 | - sBuffer.append("<RQ>").append(sdfnyr.format(schedulePlanInfo.getScheduleDate())).append("</RQ>"); | ||
| 1428 | - sBuffer.append("<XLBM>").append(BasicData.lineCode2ShangHaiCodeMap.get(xlbm)).append("</XLBM>"); | ||
| 1429 | - sBuffer.append("<CPH>").append("沪"+zbh).append("</CPH>"); | ||
| 1430 | - sBuffer.append("<LPBH>").append(lp).append("</LPBH>"); | ||
| 1431 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1432 | - sBuffer.append("<BCList>"); | ||
| 1433 | - } | ||
| 1434 | - /** | ||
| 1435 | - * 转换排班规则 | ||
| 1436 | - * @param ruleDay | ||
| 1437 | - * @return | ||
| 1438 | - */ | ||
| 1439 | - private String changeRuleDay(String ruleDay){ | ||
| 1440 | - String result = ""; | ||
| 1441 | - int flag ; | ||
| 1442 | - String[] ruleDayArray = ruleDay.split(","); | ||
| 1443 | - for (int i = 0; i < ruleDayArray.length; i++) { | ||
| 1444 | - if(ruleDayArray[i].equals("1")){ | ||
| 1445 | - flag = i+1; | ||
| 1446 | - }else{ | ||
| 1447 | - flag = 0; | ||
| 1448 | - } | ||
| 1449 | - if(flag > 0){ | ||
| 1450 | - result += flag + ","; | ||
| 1451 | - } | ||
| 1452 | - } | ||
| 1453 | - // 去掉最后一个字符 | ||
| 1454 | - if(StringUtils.endsWith(result,",")){ | ||
| 1455 | - result = StringUtils.removeEnd(result,","); | ||
| 1456 | - } | ||
| 1457 | - return result; | ||
| 1458 | - } | ||
| 1459 | - /** | ||
| 1460 | - * 设置统一的公司名称 | ||
| 1461 | - * @param company | ||
| 1462 | - */ | ||
| 1463 | - private void setCompanyName(String company){ | ||
| 1464 | - if(company.equals("闵行公司")){ | ||
| 1465 | - company = "浦东闵行公交公司"; | ||
| 1466 | - }else if(company.equals("杨高公司")){ | ||
| 1467 | - company = "浦东杨高公交公司"; | ||
| 1468 | - }else if(company.equals("上南公司")){ | ||
| 1469 | - company = "浦东上南公交公司"; | ||
| 1470 | - }else if(company.equals("金高公司")){ | ||
| 1471 | - company = "浦东金高公交公司"; | ||
| 1472 | - }else if(company.equals("南汇公司")){ | ||
| 1473 | - company = "浦东南汇公交公司"; | ||
| 1474 | - }else if(company.equals("青浦公交")){ | ||
| 1475 | - company = "浦东青浦公交公司"; | ||
| 1476 | - } | ||
| 1477 | - } | ||
| 1478 | - /** | ||
| 1479 | - * @param stationsList 站点路由集 | ||
| 1480 | - * @param sBuffer sBuffer | ||
| 1481 | - * @param startId 站点序号起始ID | ||
| 1482 | - * | ||
| 1483 | - * @return 站点序号累加后的ID | ||
| 1484 | - */ | ||
| 1485 | - private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId,Map<String, Integer> stationNumMap){ | ||
| 1486 | - int size = stationsList.size(); | ||
| 1487 | - StationRoute srRoute; | ||
| 1488 | - HashMap<String,String> paraMap; | ||
| 1489 | - String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站 | ||
| 1490 | - for (int i = 0; i < size; i++) { | ||
| 1491 | - srRoute = stationsList.get(i); | ||
| 1492 | - zdlx = srRoute.getStationMark(); | ||
| 1493 | - if(zdlx.equals("B")){ | ||
| 1494 | - zdlx = "0"; | ||
| 1495 | - }else if(zdlx.equals("E")){ | ||
| 1496 | - zdlx = "1"; | ||
| 1497 | - }else{ | ||
| 1498 | - zdlx = "2"; | ||
| 1499 | - } | ||
| 1500 | - paraMap = packageYgcStationNumParam(srRoute,null); | ||
| 1501 | - sBuffer.append("<Station>"); | ||
| 1502 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paraMap,stationNumMap)).append("</ZDXH>"); | ||
| 1503 | - sBuffer.append("<SXX>").append(srRoute.getDirections()).append("</SXX>"); | ||
| 1504 | - sBuffer.append("<ZDMC>").append(srRoute.getStationName()).append("</ZDMC>"); | ||
| 1505 | - sBuffer.append("<ZDBM>").append(srRoute.getStationCode()).append("</ZDBM>"); | ||
| 1506 | - sBuffer.append("<ZDJD>").append(srRoute.getStation().getgLonx()).append("</ZDJD>"); | ||
| 1507 | - sBuffer.append("<ZDWD>").append(srRoute.getStation().getgLaty()).append("</ZDWD>"); | ||
| 1508 | - sBuffer.append("<ZZ>").append(srRoute.getStation().getAddr() == null ? "" : srRoute.getStation().getAddr()).append("</ZZ>"); | ||
| 1509 | - sBuffer.append("<ZDLX>").append(zdlx).append("</ZDLX>"); | ||
| 1510 | - sBuffer.append("<ZJLC>").append(srRoute.getDistances()).append("</ZJLC>"); | ||
| 1511 | - sBuffer.append("</Station>"); | ||
| 1512 | - startId++; | ||
| 1513 | - } | ||
| 1514 | - return startId; | ||
| 1515 | - } | ||
| 1516 | - | ||
| 1517 | - /** | ||
| 1518 | - * @param pointList 站点点位集 | ||
| 1519 | - * @param sBuffer sBuffer | ||
| 1520 | - * @param startId 站点序号起始ID | ||
| 1521 | - * | ||
| 1522 | - * @return 站点序号累加后的ID | ||
| 1523 | - */ | ||
| 1524 | - private int packagStationPointXml(List<Object[]> pointList,StringBuffer sBuffer,int startId){ | ||
| 1525 | - int size = pointList.size(); | ||
| 1526 | - Object[] objs; | ||
| 1527 | - String bsection,dir,section; | ||
| 1528 | - String[] sections ; | ||
| 1529 | - for (int i = 0; i < size; i++) { | ||
| 1530 | - objs = pointList.get(i); | ||
| 1531 | - bsection = objs[0]+""; | ||
| 1532 | - dir = objs[1]+""; | ||
| 1533 | - // 取括号内的内容 | ||
| 1534 | - Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))"); | ||
| 1535 | - Matcher matcher = pattern.matcher(bsection); | ||
| 1536 | - if(matcher.find()){ | ||
| 1537 | - sections = matcher.group().split(","); | ||
| 1538 | - for (int j = 0 ; j < sections.length ; j ++){ | ||
| 1539 | - section = sections[j]; | ||
| 1540 | - sBuffer.append("<LinePoint>"); | ||
| 1541 | - sBuffer.append("<ZDXH>").append(startId).append("</ZDXH>"); | ||
| 1542 | - sBuffer.append("<SXX>").append(dir).append("</SXX>"); | ||
| 1543 | - sBuffer.append("<ZDJD>").append(section.split(" ")[0]).append("</ZDJD>"); | ||
| 1544 | - sBuffer.append("<ZDWD>").append(section.split(" ")[1]).append("</ZDWD>"); | ||
| 1545 | - sBuffer.append("</LinePoint>"); | ||
| 1546 | - startId++; | ||
| 1547 | - } | ||
| 1548 | - } | ||
| 1549 | - } | ||
| 1550 | - return startId; | ||
| 1551 | - } | ||
| 1552 | - | ||
| 1553 | - /** | ||
| 1554 | - * 获取运管处站点序号 | ||
| 1555 | - * @param map | ||
| 1556 | - * @return 运管处站点序号 | ||
| 1557 | - */ | ||
| 1558 | - private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(HashMap<String,String> map,Map<String, Integer> stationNumMap){ | ||
| 1559 | - // 线路编码 | ||
| 1560 | - String lineCode = map.get("lineCode"); | ||
| 1561 | - // 线路走向 0:上行 1:下行 | ||
| 1562 | - String direction = map.get("direction"); | ||
| 1563 | - // 站点编码 | ||
| 1564 | - String stationCode = map.get("stationCode"); | ||
| 1565 | - // 站点类型:B:起点站 Z:中途站 E:终点站 T:停车场 | ||
| 1566 | - String stationMark = map.get("stationMark"); | ||
| 1567 | - String[] marks = null; | ||
| 1568 | - // 起点站,先从起点找,找不到再从中途站找,最后从终点找 | ||
| 1569 | - if(stationMark.equals("B")){ | ||
| 1570 | - marks= new String[]{"B","Z","E"}; | ||
| 1571 | - }else if(stationMark.equals("E")){// 终点站相反 | ||
| 1572 | - marks= new String[]{"E","Z","B"}; | ||
| 1573 | - }else if(stationMark.equals("Z")){ | ||
| 1574 | - marks= new String[]{"Z"}; | ||
| 1575 | - } | ||
| 1576 | - // 默认从缓存BasicData.stationName2YgcNumber | ||
| 1577 | - Map<String, Integer> tempMap = BasicData.stationName2YgcNumber; | ||
| 1578 | - // 如果传入的stationNumMap不为空,则不是缓存取,而从stationNumMap取 | ||
| 1579 | - if(stationNumMap != null){ | ||
| 1580 | - tempMap = stationNumMap; | ||
| 1581 | - } | ||
| 1582 | - Integer number = null; | ||
| 1583 | - for (int i = 0 ;i < marks.length ; i ++){ | ||
| 1584 | - number = tempMap.get(lineCode+"_"+direction+"_"+stationCode+"_"+marks[i]); | ||
| 1585 | - if(number != null){ | ||
| 1586 | - break; | ||
| 1587 | - } | ||
| 1588 | - } | ||
| 1589 | - return number == null ? 0 : number; | ||
| 1590 | - } | ||
| 1591 | - | ||
| 1592 | - /** | ||
| 1593 | - * 封装查询站序条件 | ||
| 1594 | - * @param obj | ||
| 1595 | - * @return | ||
| 1596 | - */ | ||
| 1597 | - private HashMap packageYgcStationNumParam(Object obj,HashMap<String,String> otherParam){ | ||
| 1598 | - HashMap<String,String> map = new HashMap<String,String>(); | ||
| 1599 | - String lineCode = "",direction = "",stationCode = "",stationMark = ""; | ||
| 1600 | - // 站点路由 | ||
| 1601 | - if(obj instanceof StationRoute){ | ||
| 1602 | - StationRoute sr = (StationRoute)obj; | ||
| 1603 | - lineCode = sr.getLineCode(); | ||
| 1604 | - direction = String.valueOf(sr.getDirections()); | ||
| 1605 | - stationCode = sr.getStationCode(); | ||
| 1606 | - stationMark = sr.getStationMark(); | ||
| 1607 | - }else if(obj instanceof ScheduleRealInfo){ //实际排班计划明细。 | ||
| 1608 | - ScheduleRealInfo sri = (ScheduleRealInfo)obj; | ||
| 1609 | - lineCode = sri.getXlBm(); | ||
| 1610 | - direction = sri.getXlDir(); | ||
| 1611 | - if(otherParam != null && otherParam.get("stationMark") != null){ | ||
| 1612 | - stationMark = otherParam.get("stationMark"); | ||
| 1613 | - if(stationMark.equals("B")){ // 起点站 | ||
| 1614 | - stationCode = sri.getQdzCode(); | ||
| 1615 | - }else if(stationMark.equals("E")){ // 终点站 | ||
| 1616 | - stationCode = sri.getZdzCode(); | ||
| 1617 | - } | ||
| 1618 | - } | ||
| 1619 | - }else if(obj instanceof SchedulePlanInfo){ //排班计划明细 | ||
| 1620 | - SchedulePlanInfo spi = (SchedulePlanInfo)obj; | ||
| 1621 | - lineCode = spi.getXlBm(); | ||
| 1622 | - direction = spi.getXlDir(); | ||
| 1623 | - if(otherParam != null && otherParam.get("stationMark") != null){ | ||
| 1624 | - stationMark = otherParam.get("stationMark"); | ||
| 1625 | - if(stationMark.equals("B")){ // 起点站 | ||
| 1626 | - stationCode = spi.getQdzCode(); | ||
| 1627 | - }else if(stationMark.equals("E")){ // 终点站 | ||
| 1628 | - stationCode = spi.getZdzCode(); | ||
| 1629 | - } | ||
| 1630 | - } | ||
| 1631 | - }else if(obj instanceof TTInfoDetail){ //时刻表明细 | ||
| 1632 | - TTInfoDetail ttid = (TTInfoDetail)obj; | ||
| 1633 | - lineCode = ttid.getXl().getLineCode(); | ||
| 1634 | - direction = ttid.getXlDir(); | ||
| 1635 | - if(otherParam != null && otherParam.get("stationMark") != null){ | ||
| 1636 | - stationMark = otherParam.get("stationMark"); | ||
| 1637 | - if(stationMark.equals("B")){ // 起点站 | ||
| 1638 | - stationCode = ttid.getQdzCode(); | ||
| 1639 | - }else if(stationMark.equals("E")){ // 终点站 | ||
| 1640 | - stationCode = ttid.getZdzCode(); | ||
| 1641 | - } | ||
| 1642 | - } | ||
| 1643 | - } | ||
| 1644 | - map.put("lineCode",lineCode);// 站点编码 | ||
| 1645 | - map.put("direction",direction); // 上下行 | ||
| 1646 | - map.put("stationCode",stationCode); // 站点编号 | ||
| 1647 | - map.put("stationMark",stationMark); // 站点类型 | ||
| 1648 | - return map; | ||
| 1649 | - } | ||
| 1650 | - | ||
| 1651 | - /** | ||
| 1652 | - * 取得历史站点编码和站点名称的对应关系 | ||
| 1653 | - * @return | ||
| 1654 | - */ | ||
| 1655 | - private Map<String, String> getLsStationCode(String lineCode,int lineVersion){ | ||
| 1656 | - Map<String,Object> map = new HashMap<>(); | ||
| 1657 | - map.put("lineCode_eq", lineCode); | ||
| 1658 | - map.put("versions_eq",lineVersion); | ||
| 1659 | - LsStationRoute lsroute; | ||
| 1660 | - Iterator<LsStationRoute> iterator = lsStationRouteRepository.findAll(new CustomerSpecs<LsStationRoute>(map)).iterator(); | ||
| 1661 | - Map<String, String> stationCode2Name = new HashMap<>(); | ||
| 1662 | - while (iterator.hasNext()) { | ||
| 1663 | - lsroute = iterator.next(); | ||
| 1664 | - stationCode2Name.put(lsroute.getLineCode() + "_" + lsroute.getDirections() + "_" + lsroute.getStationCode(), lsroute.getStationName()); | ||
| 1665 | - } | ||
| 1666 | - return stationCode2Name; | ||
| 1667 | - } | ||
| 1668 | - | ||
| 1669 | - private Map<String, Integer> getLsStationRoute(String xlbm,int lineVersion){ | ||
| 1670 | - Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | ||
| 1671 | - /** | ||
| 1672 | - * 加载运管处的站点及序号 | ||
| 1673 | - * 上行从1开始,下行顺序续编 | ||
| 1674 | - */ | ||
| 1675 | - List<Map<String, String>> ygcLines = lsStationRouteRepository.findLineWithLineCode4Ygc(xlbm,lineVersion); | ||
| 1676 | - if(ygcLines != null && ygcLines.size() > 0){ | ||
| 1677 | - int size = ygcLines.size(); | ||
| 1678 | - Map<String, String> tempMap ; | ||
| 1679 | - int num = 1; | ||
| 1680 | - String key; | ||
| 1681 | - String lineCode = ""; | ||
| 1682 | - for (int i = 0; i < size; i ++){ | ||
| 1683 | - tempMap = ygcLines.get(i); | ||
| 1684 | - if(lineCode.equals("")){ | ||
| 1685 | - lineCode = tempMap.get("lineCode"); | ||
| 1686 | - }else if(!lineCode.equals(tempMap.get("lineCode"))){ | ||
| 1687 | - num = 1; | ||
| 1688 | - lineCode = tempMap.get("lineCode"); | ||
| 1689 | - } | ||
| 1690 | - key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions")) | ||
| 1691 | - + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark"); | ||
| 1692 | - tempStationName2YgcNumber.put(key,num++); | ||
| 1693 | - } | ||
| 1694 | - } | ||
| 1695 | - return tempStationName2YgcNumber; | ||
| 1696 | - } | ||
| 1697 | - | ||
| 1698 | - private String getSetXlXml(Line line,LineInformation lineInformation){ | ||
| 1699 | - StringBuffer sBuffer = new StringBuffer(); | ||
| 1700 | - List<StationRoute> upStationsList ;// 上行站点路由集 | ||
| 1701 | - List<StationRoute> downStationsList;// 下行站点路由集 | ||
| 1702 | - List<Object[]> downPointList;// 下行站点集 | ||
| 1703 | - List<Object[]> upPointList;// 上行站点集 | ||
| 1704 | - sBuffer.append("<XLs>"); | ||
| 1705 | - sBuffer.append("<XL>"); | ||
| 1706 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | ||
| 1707 | - sBuffer.append("<XLMC>").append(line.getName()).append("</XLMC>"); | ||
| 1708 | - sBuffer.append("<QDZ>").append(line.getStartStationName()).append("</QDZ>"); | ||
| 1709 | - sBuffer.append("<ZDZ>").append(line.getEndStationName()).append("</ZDZ>"); | ||
| 1710 | - sBuffer.append("<QZLC>").append(lineInformation.getUpMileage()).append("</QZLC>"); | ||
| 1711 | - sBuffer.append("<ZQLC>").append(lineInformation.getDownMileage()).append("</ZQLC>"); | ||
| 1712 | - sBuffer.append("<XLGH>").append(line.getLinePlayType()).append("</XLGH>"); | ||
| 1713 | - sBuffer.append("<UPDATE_DATE>").append(sdfnyr.format(new Date())).append("</UPDATE_DATE>"); | ||
| 1714 | - // 循环添加站点信息 | ||
| 1715 | - sBuffer.append("<StationList>"); | ||
| 1716 | - // 先查上行 | ||
| 1717 | - upStationsList = stationRouteRepository.findByLine(line.getLineCode(), 0); | ||
| 1718 | - Map<String, Integer> stationNumMap = getStationName2YgcNumberMap(line.getLineCode()); | ||
| 1719 | - int startId = 1; | ||
| 1720 | - startId = packagStationXml(upStationsList, sBuffer, startId,stationNumMap); | ||
| 1721 | - // 环线不查下行 | ||
| 1722 | - if(line.getLinePlayType() != 1){ | ||
| 1723 | - // 再查下行 | ||
| 1724 | - downStationsList = stationRouteRepository.findByLine(line.getLineCode(), 1); | ||
| 1725 | - packagStationXml(downStationsList, sBuffer, startId,stationNumMap); | ||
| 1726 | - } | ||
| 1727 | - sBuffer.append("</StationList>"); | ||
| 1728 | - // 循环添加站点点位信息 | ||
| 1729 | - sBuffer.append("<LinePointList>"); | ||
| 1730 | - upPointList = sectionRepository.getSectionDirByLineId(line.getId(),0); | ||
| 1731 | - startId = 1; | ||
| 1732 | - startId = packagStationPointXml(upPointList, sBuffer, startId); | ||
| 1733 | - // 环线不查下行 | ||
| 1734 | - if(line.getLinePlayType() != 1){ | ||
| 1735 | - downPointList = sectionRepository.getSectionDirByLineId(line.getId(),1); | ||
| 1736 | - packagStationPointXml(downPointList, sBuffer, startId); | ||
| 1737 | - } | ||
| 1738 | - sBuffer.append("</LinePointList>"); | ||
| 1739 | - sBuffer.append("</XL>"); | ||
| 1740 | - sBuffer.append("</XLs>"); | ||
| 1741 | - return sBuffer.toString(); | ||
| 1742 | - } | ||
| 1743 | -} | 1 | +package com.bsth.service.impl; |
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.bsth.email.SendEmailController; | ||
| 5 | +import com.bsth.email.entity.EmailBean; | ||
| 6 | +import com.bsth.entity.*; | ||
| 7 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 8 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 9 | +import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 10 | +import com.bsth.entity.schedule.TTInfo; | ||
| 11 | +import com.bsth.entity.schedule.TTInfoDetail; | ||
| 12 | +import com.bsth.entity.search.CustomerSpecs; | ||
| 13 | +import com.bsth.entity.sys.SysUser; | ||
| 14 | +import com.bsth.entity.traffic.SKBUploadLogger; | ||
| 15 | +import com.bsth.repository.*; | ||
| 16 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | ||
| 17 | +import com.bsth.repository.schedule.*; | ||
| 18 | +import com.bsth.repository.traffic.SKBUploadLoggerRepository; | ||
| 19 | +import com.bsth.security.util.SecurityUtils; | ||
| 20 | +import com.bsth.service.TrafficManageService; | ||
| 21 | +import com.bsth.service.traffic.YgcBasicDataService; | ||
| 22 | +import com.bsth.util.IpUtils; | ||
| 23 | +import com.bsth.util.TimeUtils; | ||
| 24 | +import com.bsth.util.db.DBUtils_MS; | ||
| 25 | +import com.bsth.webService.trafficManage.org.tempuri.Results; | ||
| 26 | +import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; | ||
| 27 | +import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; | ||
| 28 | +import org.apache.commons.lang.StringEscapeUtils; | ||
| 29 | +import org.apache.commons.lang.StringUtils; | ||
| 30 | +import org.apache.commons.lang.time.DateUtils; | ||
| 31 | +import org.joda.time.DateTime; | ||
| 32 | +import org.slf4j.Logger; | ||
| 33 | +import org.slf4j.LoggerFactory; | ||
| 34 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 35 | +import org.springframework.data.domain.Sort; | ||
| 36 | +import org.springframework.data.domain.Sort.Direction; | ||
| 37 | +import org.springframework.security.core.context.SecurityContextHolder; | ||
| 38 | +import org.springframework.stereotype.Service; | ||
| 39 | + | ||
| 40 | +import java.io.*; | ||
| 41 | +import java.net.InetAddress; | ||
| 42 | +import java.sql.Connection; | ||
| 43 | +import java.sql.PreparedStatement; | ||
| 44 | +import java.sql.ResultSet; | ||
| 45 | +import java.text.DecimalFormat; | ||
| 46 | +import java.text.SimpleDateFormat; | ||
| 47 | +import java.util.*; | ||
| 48 | +import java.util.regex.Matcher; | ||
| 49 | +import java.util.regex.Pattern; | ||
| 50 | + | ||
| 51 | +/** | ||
| 52 | + * | ||
| 53 | + * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | ||
| 54 | + * | ||
| 55 | + * @Extends : BaseService | ||
| 56 | + * | ||
| 57 | + * @Description: TODO(运管处接口service业务层) | ||
| 58 | + * | ||
| 59 | + * @Author bsth@zq | ||
| 60 | + * | ||
| 61 | + * @Date 2016年10月28日 上午9:21:17 | ||
| 62 | + * | ||
| 63 | + * @Version 公交调度系统BS版 0.1 | ||
| 64 | + * | ||
| 65 | + */ | ||
| 66 | + | ||
| 67 | +@Service | ||
| 68 | +public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 69 | + | ||
| 70 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 71 | + // 运管处上传日志类型 | ||
| 72 | + public static final String UPLOAD_TYPE_SKB = "1"; | ||
| 73 | + public static final String UPLOAD_TYPE_XL = "2"; | ||
| 74 | + public static final String UPLOAD_TYPE_LD = "3"; | ||
| 75 | + | ||
| 76 | + // 线路repository | ||
| 77 | + @Autowired | ||
| 78 | + private LineRepository lineRepository; | ||
| 79 | + | ||
| 80 | + @Autowired | ||
| 81 | + private LineInformationRepository lineInformationRepository; | ||
| 82 | + | ||
| 83 | + // 站点路由repository | ||
| 84 | + @Autowired | ||
| 85 | + private StationRouteRepository stationRouteRepository; | ||
| 86 | + | ||
| 87 | + // 历史站点路由repository | ||
| 88 | + @Autowired | ||
| 89 | + private LsStationRouteRepository lsStationRouteRepository; | ||
| 90 | + | ||
| 91 | + @Autowired | ||
| 92 | + private SectionRepository sectionRepository; | ||
| 93 | + | ||
| 94 | + // 车辆repository | ||
| 95 | + @Autowired | ||
| 96 | + private CarsRepository carsRepository; | ||
| 97 | + | ||
| 98 | + // 人员repository | ||
| 99 | + @Autowired | ||
| 100 | + private PersonnelRepository personnelRepository; | ||
| 101 | + | ||
| 102 | + // 时刻模板repository | ||
| 103 | + @Autowired | ||
| 104 | + private TTInfoRepository ttInfoRepository; | ||
| 105 | + | ||
| 106 | + // 时刻模板明细repository | ||
| 107 | + @Autowired | ||
| 108 | + private TTInfoDetailRepository ttInfoDetailRepository; | ||
| 109 | + | ||
| 110 | + // 排班计划明细repository | ||
| 111 | + @Autowired | ||
| 112 | + private SchedulePlanInfoRepository schedulePlanInfoRepository; | ||
| 113 | + | ||
| 114 | + // 实际排班计划明细repository | ||
| 115 | + @Autowired | ||
| 116 | + private ScheduleRealInfoRepository scheduleRealInfoRepository; | ||
| 117 | + | ||
| 118 | + // 时刻表上传记录repository | ||
| 119 | + @Autowired | ||
| 120 | + private SKBUploadLoggerRepository skbUploadLoggerRepository; | ||
| 121 | + | ||
| 122 | + // 线路站点repository | ||
| 123 | + @Autowired | ||
| 124 | + private YgcBasicDataService ygcBasicDataService; | ||
| 125 | + | ||
| 126 | + // 发送邮件 | ||
| 127 | + @Autowired | ||
| 128 | + private SendEmailController sendEmailController; | ||
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * 线路版本repository | ||
| 132 | + */ | ||
| 133 | + @Autowired | ||
| 134 | + private LineVersionsRepository lineVersionsRepository; | ||
| 135 | + | ||
| 136 | + // 运管处上传接口 | ||
| 137 | + private com.bsth.webService.trafficManage.up.org.tempuri.WebServiceSoap webServiceSoapUp; | ||
| 138 | + private WebServiceSoap ssop ; | ||
| 139 | + { | ||
| 140 | + try { | ||
| 141 | + ssop = new WebServiceLocator().getWebServiceSoap(); | ||
| 142 | + } catch (Exception e) { | ||
| 143 | + e.printStackTrace(); | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + // 格式化 年月日时分秒 nyrsfm是年月日时分秒的拼音首字母 | ||
| 147 | + private SimpleDateFormat sdfnyrsfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 148 | + | ||
| 149 | + // 格式化 年月日 | ||
| 150 | + private SimpleDateFormat sdfnyr = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 151 | + | ||
| 152 | + // 数字格式化 | ||
| 153 | + DecimalFormat format = new DecimalFormat("0.00"); | ||
| 154 | + | ||
| 155 | + // 用户名 | ||
| 156 | + private final String userNameOther = "user"; | ||
| 157 | + // 密码 | ||
| 158 | + private final String passwordOther = "user"; | ||
| 159 | + | ||
| 160 | + // 用户名 | ||
| 161 | + private final String userNameUp = "user"; | ||
| 162 | + // 密码 | ||
| 163 | + private final String passwordUp = "user"; | ||
| 164 | + // 接收邮件人 | ||
| 165 | + private final String emailSendToAddress = "113252620@qq.com"; | ||
| 166 | + // 记录路单上线的成功、失败线路数 | ||
| 167 | + private Integer countSuccess,countFailure; | ||
| 168 | + | ||
| 169 | + private synchronized com.bsth.webService.trafficManage.up.org.tempuri.WebServiceSoap getWebServiceSoapUp(){ | ||
| 170 | + try { | ||
| 171 | + if(webServiceSoapUp == null){ | ||
| 172 | + webServiceSoapUp = new com.bsth.webService.trafficManage.up.org.tempuri.WebServiceLocator().getWebServiceSoap(); | ||
| 173 | + } | ||
| 174 | + }catch (Exception e){ | ||
| 175 | + e.printStackTrace(); | ||
| 176 | + }finally { | ||
| 177 | + return webServiceSoapUp; | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + /** | ||
| 181 | + * 上传线路信息 | ||
| 182 | + */ | ||
| 183 | + @Override | ||
| 184 | + public String setXL(String ids) { | ||
| 185 | + String result = "failure"; | ||
| 186 | + String xml ; | ||
| 187 | + String[] idArray = ids.split(","); | ||
| 188 | + try { | ||
| 189 | + for (String id : idArray) { | ||
| 190 | + if(id == null || id.trim().equals("")){ | ||
| 191 | + continue; | ||
| 192 | + } | ||
| 193 | + Map<String,Object> map = new HashMap<>(); | ||
| 194 | + map.put("lineCode_eq", id); | ||
| 195 | + Line line ; | ||
| 196 | + LineInformation lineInformation; | ||
| 197 | + Optional<Line> optionalLine = lineRepository.findOne(new CustomerSpecs<Line>(map)); | ||
| 198 | + line = optionalLine.isPresent() ? optionalLine.get() : null; | ||
| 199 | + if(line == null){ | ||
| 200 | + continue; | ||
| 201 | + } | ||
| 202 | + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ | ||
| 203 | + return result; | ||
| 204 | + } | ||
| 205 | + map = new HashMap<>(); | ||
| 206 | + map.put("line.id_eq",line.getId()); | ||
| 207 | + Optional<LineInformation> optionalLineInformation = lineInformationRepository.findOne(new CustomerSpecs<LineInformation>(map)); | ||
| 208 | + lineInformation = optionalLineInformation.isPresent() ? optionalLineInformation.get() : null; | ||
| 209 | + if(lineInformation == null){ | ||
| 210 | + continue; | ||
| 211 | + } | ||
| 212 | + // 取得封装好的xml | ||
| 213 | + xml = getSetXlXml(line,lineInformation); | ||
| 214 | + // 站点序号不能为0,如果为0,则返回错误 | ||
| 215 | + if(xml.indexOf("<ZDXH>0</ZDXH>") != -1){ | ||
| 216 | + return "0"; | ||
| 217 | + } | ||
| 218 | + String state;// 是否上传成功 | ||
| 219 | + // 调用上传方法 | ||
| 220 | + if(getWebServiceSoapUp().setXL(userNameUp,passwordUp,xml).isSuccess()){ | ||
| 221 | + result = "success"; | ||
| 222 | + state = "1"; | ||
| 223 | + }else{ | ||
| 224 | + result = "failure"; | ||
| 225 | + state = "0"; | ||
| 226 | + } | ||
| 227 | + logger.info("setXL:"+xml); | ||
| 228 | + logger.info("setXL:"+result); | ||
| 229 | + // 保存运管处上传记录 | ||
| 230 | + saveYgcUploadLog(line,xml,TrafficManageServiceImpl.UPLOAD_TYPE_XL,state); | ||
| 231 | + } | ||
| 232 | + } catch (Exception e) { | ||
| 233 | + logger.error("setXL:",e); | ||
| 234 | + e.printStackTrace(); | ||
| 235 | + } | ||
| 236 | + return result; | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + /** | ||
| 240 | + * 加载运管处的站点及序号 | ||
| 241 | + * 上行从1开始,下行顺序续编 | ||
| 242 | + */ | ||
| 243 | + private Map<String, Integer> getStationName2YgcNumberMap (String lineCode){ | ||
| 244 | + Map<String, Integer> resultMap = new HashMap<>(); | ||
| 245 | + List<Map<String, String>> ygcLines = stationRouteRepository.findLineWithYgcByLine(lineCode); | ||
| 246 | + if(ygcLines != null && ygcLines.size() > 0){ | ||
| 247 | + int size = ygcLines.size(); | ||
| 248 | + Map<String, String> tempMap ; | ||
| 249 | + int num = 1; | ||
| 250 | + String key; | ||
| 251 | + for (int i = 0; i < size; i ++){ | ||
| 252 | + tempMap = ygcLines.get(i); | ||
| 253 | + key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions")) | ||
| 254 | + + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark"); | ||
| 255 | + resultMap.put(key,num++); | ||
| 256 | + } | ||
| 257 | + } | ||
| 258 | + return resultMap; | ||
| 259 | + } | ||
| 260 | + | ||
| 261 | + /** | ||
| 262 | + * 上传线路信息(按in_use上传) | ||
| 263 | + */ | ||
| 264 | + @Override | ||
| 265 | + public String setXLByInUse(String inUse) { | ||
| 266 | + StringBuffer result = new StringBuffer(); | ||
| 267 | + try { | ||
| 268 | + Map<String,Object> map = new HashMap<>(); | ||
| 269 | + if(inUse != null && inUse.equals("1")){ | ||
| 270 | + map.put("inUse_eq", inUse); | ||
| 271 | + } | ||
| 272 | + List<Line> lines ; | ||
| 273 | + Line line; | ||
| 274 | + lines = lineRepository.findAll(new CustomerSpecs<Line>(map)); | ||
| 275 | + if(lines != null && lines.size() > 0){ | ||
| 276 | + for(int i = 0 ; i < lines.size() ; i ++){ | ||
| 277 | + line = lines.get(i); | ||
| 278 | + if(line != null && line.getId() != null){ | ||
| 279 | + result.append(line.getLineCode()).append(":").append(setXL(line.getLineCode())).append(";"); | ||
| 280 | + } | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + } catch (Exception e) { | ||
| 284 | + result.append("failure"); | ||
| 285 | + logger.error("setXLByInUse:",e); | ||
| 286 | + e.printStackTrace(); | ||
| 287 | + } | ||
| 288 | + return result.toString(); | ||
| 289 | + } | ||
| 290 | + | ||
| 291 | + /** | ||
| 292 | + * 上传车辆信息 | ||
| 293 | + */ | ||
| 294 | + @Override | ||
| 295 | + public String setCL() { | ||
| 296 | + String result = "failure"; | ||
| 297 | + StringBuffer sBuffer =new StringBuffer(); | ||
| 298 | + try { | ||
| 299 | + sBuffer.append("<CLs>"); | ||
| 300 | + Cars cars = null; | ||
| 301 | + String company; | ||
| 302 | + Iterator<Cars> carsIterator = carsRepository.findAll().iterator(); | ||
| 303 | + while(carsIterator.hasNext()){ | ||
| 304 | + cars = carsIterator.next(); | ||
| 305 | + sBuffer.append("<CL>"); | ||
| 306 | + company = cars.getCompany(); | ||
| 307 | + setCompanyName(company);// 统一公司名称 | ||
| 308 | + sBuffer.append("<GSJC>").append(company).append("</GSJC>"); | ||
| 309 | + sBuffer.append("<NBH>").append(cars.getInsideCode()).append("</NBH>"); | ||
| 310 | + sBuffer.append("<CPH>").append(cars.getCarPlate()).append("</CPH>"); | ||
| 311 | + sBuffer.append("<YYZBH>").append(cars.getServiceNo()).append("</YYZBH>"); | ||
| 312 | + sBuffer.append("<CZCPH>").append(cars.getCarPlate()).append("</CZCPH>");//******这个数据没有*********** | ||
| 313 | + sBuffer.append("<CZZDBH>").append(cars.getEquipmentCode()).append("</CZZDBH>"); | ||
| 314 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 315 | + sBuffer.append("</CL>"); | ||
| 316 | + } | ||
| 317 | + sBuffer.append("</CLs>"); | ||
| 318 | + if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 319 | + result = "success"; | ||
| 320 | + } | ||
| 321 | + } catch (Exception e) { | ||
| 322 | + logger.error("setCL:",e); | ||
| 323 | + e.printStackTrace(); | ||
| 324 | + }finally{ | ||
| 325 | + logger.info("setCL:"+sBuffer.toString()); | ||
| 326 | + logger.info("setCL:"+result); | ||
| 327 | + } | ||
| 328 | + return result; | ||
| 329 | + } | ||
| 330 | + | ||
| 331 | + /** | ||
| 332 | + * 上传司机信息 | ||
| 333 | + */ | ||
| 334 | + @Override | ||
| 335 | + public String setSJ() { | ||
| 336 | + String result = "failure"; | ||
| 337 | + StringBuffer sBuffer =new StringBuffer(); | ||
| 338 | + try { | ||
| 339 | + sBuffer.append("<SJs>"); | ||
| 340 | + Personnel personnel = null; | ||
| 341 | + String company; | ||
| 342 | + Iterator<Personnel> personIterator = personnelRepository.findAll().iterator(); | ||
| 343 | + while(personIterator.hasNext()){ | ||
| 344 | + personnel = personIterator.next(); | ||
| 345 | + sBuffer.append("<SJ>"); | ||
| 346 | + company = personnel.getCompany(); | ||
| 347 | + setCompanyName(company);// 统一公司名称 | ||
| 348 | + sBuffer.append("<GSJC>").append(company).append("</GSJC>"); | ||
| 349 | + sBuffer.append("<SJGH>").append(personnel.getJobCode()).append("</SJGH>"); | ||
| 350 | + sBuffer.append("<CYZGZH>").append(personnel.getPapersCode()).append("</CYZGZH>");//*********** | ||
| 351 | + sBuffer.append("<XM>").append(personnel.getPersonnelName()).append("</XM>"); | ||
| 352 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 353 | + sBuffer.append("</SJ>"); | ||
| 354 | + } | ||
| 355 | + sBuffer.append("</SJs>"); | ||
| 356 | + if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 357 | + result = "success"; | ||
| 358 | + }; | ||
| 359 | + } catch (Exception e) { | ||
| 360 | + logger.error("setSJ:",e); | ||
| 361 | + e.printStackTrace(); | ||
| 362 | + }finally{ | ||
| 363 | + logger.info("setSJ:"+sBuffer.toString()); | ||
| 364 | + logger.info("setSJ:"+result); | ||
| 365 | + } | ||
| 366 | + return result; | ||
| 367 | + } | ||
| 368 | + | ||
| 369 | + /** | ||
| 370 | + * 上传路单 指定日期 yyyy-MM-dd | ||
| 371 | + * @param theDate | ||
| 372 | + * @return | ||
| 373 | + */ | ||
| 374 | + public String setLD(String theDate){ | ||
| 375 | + return uploadLD(theDate); | ||
| 376 | + } | ||
| 377 | + | ||
| 378 | + /** | ||
| 379 | + * 上传路单 上传前一天的路单 | ||
| 380 | + * @return | ||
| 381 | + */ | ||
| 382 | + public String setLD(){ | ||
| 383 | + return uploadLD(null); | ||
| 384 | + } | ||
| 385 | + /** | ||
| 386 | + * 上传路单 | ||
| 387 | + * @return 上传成功标识 | ||
| 388 | + */ | ||
| 389 | + private String uploadLD(String theDate){ | ||
| 390 | + // 取昨天 的日期 | ||
| 391 | + String date = theDate == null ?sdfnyr.format(DateUtils.addDays(new Date(), -1)) : theDate; | ||
| 392 | + StringBuffer sf = new StringBuffer(); | ||
| 393 | + Results results = null; | ||
| 394 | + String str = "", xlbm = null, oldXlbm = null; | ||
| 395 | + List<Map<String,Object>> listGroup = null; | ||
| 396 | + int scount = 0, ccount = 0; | ||
| 397 | + long start = System.currentTimeMillis(); | ||
| 398 | + try { | ||
| 399 | + // 计数器 | ||
| 400 | + int counter = 0; | ||
| 401 | + // 每几条线路上传一次路单 | ||
| 402 | + int per = 10; | ||
| 403 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); | ||
| 404 | + listGroup = scheduleRealInfoRepository.setLDGroup(date); | ||
| 405 | + Map<String,Object> map = new HashMap(); | ||
| 406 | + HashMap<String,String> paramMap; | ||
| 407 | + HashMap<String,String> otherMap = new HashMap(); | ||
| 408 | + | ||
| 409 | + // 车辆内部编码和车牌做映射 | ||
| 410 | + Map<String, String> inside2plate = new HashMap<>(); | ||
| 411 | + Iterable<Cars> cars = carsRepository.findAll(); | ||
| 412 | + for (Cars car : cars) { | ||
| 413 | + inside2plate.put(car.getInsideCode(), car.getCarPlate()); | ||
| 414 | + } | ||
| 415 | + | ||
| 416 | + // 线路编码和线路信息映射 | ||
| 417 | + Map<String, Line> code2line = new HashMap<>(); | ||
| 418 | + Iterable<Line> lines = lineRepository.findAll(); | ||
| 419 | + for (Line line : lines) { | ||
| 420 | + code2line.put(line.getLineCode(), line); | ||
| 421 | + } | ||
| 422 | + | ||
| 423 | + // 线路编码和线路版本映射(电子路单日期) | ||
| 424 | + Map<String, Integer> code2version = new HashMap<>(); | ||
| 425 | + Iterable<LineVersions> versions = lineVersionsRepository.findLineVersionsByDate((int)(DateTime.parse(date).getMillis() / 1000)); | ||
| 426 | + for (LineVersions version : versions) { | ||
| 427 | + code2version.put(version.getLineCode(), version.getVersions()); | ||
| 428 | + } | ||
| 429 | + | ||
| 430 | + Map<String, Integer> stationNumMap = null; | ||
| 431 | + for(Map<String,Object> schRealInfo:listGroup){ | ||
| 432 | + if(schRealInfo != null){ | ||
| 433 | + // 获取线路是否使用标识,如果未使用,则不查该线路数据 | ||
| 434 | + String lineCode = schRealInfo.get("xlBm")+""; | ||
| 435 | + Line line = code2line.get(lineCode); | ||
| 436 | + if(line == null || line.getInUse() == null || line.getInUse() == 0){ | ||
| 437 | + ccount++; | ||
| 438 | + continue; | ||
| 439 | + } | ||
| 440 | + if(counter % per == 0){ | ||
| 441 | + sf = new StringBuffer(); | ||
| 442 | + sf.append("<DLDS>"); | ||
| 443 | + } | ||
| 444 | + counter ++; | ||
| 445 | + xlbm = BasicData.lineCode2ShangHaiCodeMap.get(lineCode); | ||
| 446 | + if (!xlbm.equals(oldXlbm)) { | ||
| 447 | + oldXlbm = xlbm; | ||
| 448 | + Integer ver = code2version.get(lineCode); | ||
| 449 | + if (ver != null) { | ||
| 450 | + stationNumMap = getLsStationRoute(lineCode, ver); | ||
| 451 | + } | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + sf.append("<DLD>"); | ||
| 455 | + sf.append("<RQ>").append(date).append("</RQ>"); | ||
| 456 | + sf.append("<XLBM>").append(xlbm).append("</XLBM>"); | ||
| 457 | + sf.append("<LPBH>").append(schRealInfo.get("lpName")).append("</LPBH>"); | ||
| 458 | + sf.append("<CPH>").append(inside2plate.get(schRealInfo.get("clZbh"))).append("</CPH>"); | ||
| 459 | + sf.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 460 | + sf.append("<LDList>"); | ||
| 461 | + for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 462 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("lpName")+"") | ||
| 463 | + .equals(scheduleRealInfo.getLpName()) | ||
| 464 | + && (schRealInfo.get("clZbh")+"").equals(scheduleRealInfo.getClZbh())){ | ||
| 465 | + | ||
| 466 | + if(scheduleRealInfo.isDestroy()){ | ||
| 467 | + if(scheduleRealInfo.isReissue()){ | ||
| 468 | + scheduleRealInfo.setFcsjActualAll(scheduleRealInfo.getDfsj()); | ||
| 469 | + scheduleRealInfo.setZdsjActualAll(scheduleRealInfo.getZdsj()); | ||
| 470 | + } | ||
| 471 | + else | ||
| 472 | + continue; | ||
| 473 | + } | ||
| 474 | + | ||
| 475 | + if(scheduleRealInfo.getBcType().equals("in") | ||
| 476 | + || scheduleRealInfo.getBcType().equals("out")){ | ||
| 477 | + continue; | ||
| 478 | + } | ||
| 479 | + | ||
| 480 | + sf.append("<LD>"); | ||
| 481 | + sf.append("<SJGH>").append(scheduleRealInfo.getjGh()).append("</SJGH>"); | ||
| 482 | + sf.append("<SXX>").append(scheduleRealInfo.getXlDir()).append("</SXX>"); | ||
| 483 | + sf.append("<FCZDMC>").append(scheduleRealInfo.getQdzName()).append("</FCZDMC>"); | ||
| 484 | + // 起点站的参数 | ||
| 485 | + otherMap.put("stationMark","B"); | ||
| 486 | + paramMap = packageYgcStationNumParam(scheduleRealInfo,otherMap); | ||
| 487 | + sf.append("<FCZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,stationNumMap)).append("</FCZDXH>"); | ||
| 488 | + sf.append("<FCZDBM>").append(scheduleRealInfo.getQdzCode()).append("</FCZDBM>"); | ||
| 489 | + sf.append("<JHFCSJ>").append(scheduleRealInfo.getFcsj()).append("</JHFCSJ>"); | ||
| 490 | + sf.append("<DFSJ>").append(scheduleRealInfo.getDfsj()).append("</DFSJ>"); | ||
| 491 | + sf.append("<SJFCSJ>").append(scheduleRealInfo.getFcsjActual()).append("</SJFCSJ>"); | ||
| 492 | + sf.append("<FCZDLX></FCZDLX>"); | ||
| 493 | + sf.append("<DDZDMC>").append(scheduleRealInfo.getZdzName()).append("</DDZDMC>"); | ||
| 494 | + // 终点站的参数 | ||
| 495 | + otherMap.put("stationMark","E"); | ||
| 496 | + paramMap = packageYgcStationNumParam(scheduleRealInfo,otherMap); | ||
| 497 | + sf.append("<DDZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,stationNumMap)).append("</DDZDXH>"); | ||
| 498 | + sf.append("<DDZDBM>").append(scheduleRealInfo.getZdzCode()).append("</DDZDBM>"); | ||
| 499 | + sf.append("<JHDDSJ>").append(scheduleRealInfo.getZdsj()).append("</JHDDSJ>"); | ||
| 500 | + sf.append("<SJDDSJ>").append(scheduleRealInfo.getZdsjActual()).append("</SJDDSJ>"); | ||
| 501 | + sf.append("<DDZDLX></DDZDLX>"); | ||
| 502 | + sf.append("<LDSCBZ>0</LDSCBZ>"); | ||
| 503 | + sf.append("<DDBZ>").append("").append("</DDBZ>"); | ||
| 504 | + sf.append("</LD>"); | ||
| 505 | + } | ||
| 506 | + } | ||
| 507 | + sf.append("</LDList>"); | ||
| 508 | + sf.append("</DLD>"); | ||
| 509 | + } | ||
| 510 | + if(counter % per == per - 1){ | ||
| 511 | + sf.append("</DLDS>"); | ||
| 512 | + // 去掉'号 | ||
| 513 | + str = sf.toString().replace("'",""); | ||
| 514 | + scount += invokeSetLD(str, counter); | ||
| 515 | + counter = 0; | ||
| 516 | + } | ||
| 517 | + } | ||
| 518 | + // 每per条线路上传后剩下的数据再上传 | ||
| 519 | + if(counter > 0){ | ||
| 520 | + sf.append("</DLDS>"); | ||
| 521 | + // 去掉'号 | ||
| 522 | + str = sf.toString().replace("'",""); | ||
| 523 | + scount += invokeSetLD(str, counter); | ||
| 524 | + } | ||
| 525 | + } catch (Exception e) { | ||
| 526 | + e.printStackTrace(); | ||
| 527 | + logger.error("setLD:", e); | ||
| 528 | + } finally { | ||
| 529 | + try { | ||
| 530 | + //发送邮件 | ||
| 531 | + EmailBean mail = new EmailBean(); | ||
| 532 | + mail.setSubject(IpUtils.getLocalIpAddress() +":路单日志数据"+date); | ||
| 533 | + mail.setContent("总数:" + (listGroup == null ? 0 : listGroup.size()) + "<br/>成功数:" + scount + "<br/>跳过数:" + ccount + "<br/>耗时:" + (System.currentTimeMillis() - start)); | ||
| 534 | + sendEmailController.sendMail(emailSendToAddress, mail); | ||
| 535 | + logger.info("setLD-sendMail:邮件发送成功!"); | ||
| 536 | + } catch (Exception e) { | ||
| 537 | + e.printStackTrace(); | ||
| 538 | + logger.error("setLD-sendMail:",e); | ||
| 539 | + } | ||
| 540 | + } | ||
| 541 | + return "success"; | ||
| 542 | + } | ||
| 543 | + | ||
| 544 | + /** | ||
| 545 | + * 调用运管处电子路单接口,如果上传失败或有网络问题,最多执行10次 | ||
| 546 | + * @param xml 拼接的xml字符串 | ||
| 547 | + * @param counter 分组数 | ||
| 548 | + * @return 成功返回counter 失败返回0 | ||
| 549 | + */ | ||
| 550 | + private int invokeSetLD(String xml, int counter) { | ||
| 551 | + for (int i = 0;i < 10;i++) { | ||
| 552 | + try { | ||
| 553 | + Results results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(xml)); | ||
| 554 | + if (results.isSuccess()) { | ||
| 555 | + logger.info("setLD: " + xml); | ||
| 556 | + logger.info("setLD: 成功"); | ||
| 557 | + return counter; | ||
| 558 | + } else if (i == 9) { | ||
| 559 | + logger.error("setLD: " + xml); | ||
| 560 | + logger.error("setLD: 失败," + results.getMessage()); | ||
| 561 | + } | ||
| 562 | + Thread.sleep(2000); | ||
| 563 | + } catch (Exception e) { | ||
| 564 | + logger.error("运管处接口调用异常", e); | ||
| 565 | + try { | ||
| 566 | + Thread.sleep(2000); | ||
| 567 | + } catch (InterruptedException ex) { | ||
| 568 | + ex.printStackTrace(); | ||
| 569 | + } | ||
| 570 | + } | ||
| 571 | + } | ||
| 572 | + | ||
| 573 | + return 0; | ||
| 574 | + } | ||
| 575 | + | ||
| 576 | + /** | ||
| 577 | + * 上传路单 xml来自文件 | ||
| 578 | + * @return 上传成功标识 | ||
| 579 | + */ | ||
| 580 | + public String setLDFile(){ | ||
| 581 | + String result = "failure"; | ||
| 582 | + try { | ||
| 583 | + String tmp = readXmlFromFile("E:/ld.txt"); | ||
| 584 | + Results rss = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(tmp)); | ||
| 585 | + if(rss.isSuccess()){ | ||
| 586 | + result = "success"; | ||
| 587 | + } | ||
| 588 | + } catch (Exception e) { | ||
| 589 | + logger.error("setLD:",e); | ||
| 590 | + e.printStackTrace(); | ||
| 591 | + }finally{ | ||
| 592 | + | ||
| 593 | + } | ||
| 594 | + return result; | ||
| 595 | + } | ||
| 596 | + | ||
| 597 | + /** | ||
| 598 | + * 从文件中读取xml | ||
| 599 | + * @param fileName 例:D:/test.txt | ||
| 600 | + * @return | ||
| 601 | + * @throws Exception | ||
| 602 | + */ | ||
| 603 | + private String readXmlFromFile(String fileName) throws Exception { | ||
| 604 | + StringBuffer sf = new StringBuffer(""); | ||
| 605 | + File file = new File(fileName); | ||
| 606 | + InputStreamReader reader = new InputStreamReader(new FileInputStream(file),"GBK"); | ||
| 607 | + BufferedReader bufferedReader = new BufferedReader(reader); | ||
| 608 | + String lineTxt = ""; | ||
| 609 | + while((lineTxt = bufferedReader.readLine()) != null){ | ||
| 610 | + sf.append(lineTxt); | ||
| 611 | + } | ||
| 612 | + reader.close(); | ||
| 613 | + return sf.toString().replaceAll("\t",""); | ||
| 614 | + } | ||
| 615 | + /** | ||
| 616 | + * 上传里程油耗 | ||
| 617 | + * @return 上传成功标识 | ||
| 618 | + */ | ||
| 619 | + public String setLCYH(){ | ||
| 620 | + String result = "failure"; | ||
| 621 | + // 取昨天 的日期 | ||
| 622 | + String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 623 | + StringBuffer sf = new StringBuffer(); | ||
| 624 | + try { | ||
| 625 | + sf.append("<LCYHS>"); | ||
| 626 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); | ||
| 627 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 628 | + Map<String,Object> map = new HashMap<String,Object>(); | ||
| 629 | + for(Map<String,Object> schRealInfo:listGroup){ | ||
| 630 | + if(schRealInfo != null){ | ||
| 631 | + map.put("insideCode_eq", schRealInfo.get("clZbh")+""); | ||
| 632 | + Optional<Cars> optionalCars = carsRepository.findOne(new CustomerSpecs<Cars>(map)); | ||
| 633 | + Cars car = optionalCars.isPresent() ? optionalCars.get() : null; | ||
| 634 | + /** | ||
| 635 | + * 如果car==null,则说明该车辆是从线调中换车功能中加进去的, | ||
| 636 | + * 在cars基础信息中查不到车辆的信息,所以忽略该车辆 | ||
| 637 | + */ | ||
| 638 | + if(car == null){ | ||
| 639 | + continue; | ||
| 640 | + } | ||
| 641 | + //计算总公里和空驶公里,营运公里=总公里-空驶公里 | ||
| 642 | + double totalKilometers = 0,emptyKilometers =0; | ||
| 643 | + sf.append("<LCYH>"); | ||
| 644 | + sf.append("<RQ>"+date+"</RQ>"); | ||
| 645 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>"); | ||
| 646 | + sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); | ||
| 647 | + if(list != null && list.size() > 0){ | ||
| 648 | + for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 649 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm()) && (schRealInfo.get("clZbh")+"") | ||
| 650 | + .equals(scheduleRealInfo.getClZbh())){ | ||
| 651 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 652 | + //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 653 | + if(childTaskPlans.isEmpty()){ | ||
| 654 | + if(scheduleRealInfo.getStatus() == 2){ | ||
| 655 | + totalKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 656 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 657 | + || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 658 | + emptyKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 659 | + } | ||
| 660 | + } | ||
| 661 | + }else{ | ||
| 662 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 663 | + while(it.hasNext()){ | ||
| 664 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 665 | + if(!childTaskPlan.isDestroy()){ | ||
| 666 | + totalKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 667 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 668 | + emptyKilometers += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 669 | + } | ||
| 670 | + } | ||
| 671 | + } | ||
| 672 | + } | ||
| 673 | + } | ||
| 674 | + } | ||
| 675 | + } | ||
| 676 | + sf.append("<ZLC>"+totalKilometers+"</ZLC>"); | ||
| 677 | + sf.append("<YYLC>"+emptyKilometers+"</YYLC>"); | ||
| 678 | + sf.append("<YH>"+""+"</YH>"); | ||
| 679 | + sf.append("<JZYL>"+""+"</JZYL>"); | ||
| 680 | + sf.append("<DH>"+""+"</DH>"); | ||
| 681 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); | ||
| 682 | + sf.append("<BBSCBZ>"+0+"</BBSCBZ>"); | ||
| 683 | + sf.append("</LCYH>"); | ||
| 684 | + } | ||
| 685 | + } | ||
| 686 | + sf.append("</LCYHS>"); | ||
| 687 | + if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 688 | + result = "success"; | ||
| 689 | + } | ||
| 690 | + } catch (Exception e) { | ||
| 691 | + logger.error("setLCYH:",e); | ||
| 692 | + e.printStackTrace(); | ||
| 693 | + }finally{ | ||
| 694 | + logger.info("setLCYH:"+sf.toString()); | ||
| 695 | + logger.info("setLCYH:"+result); | ||
| 696 | + } | ||
| 697 | + return result; | ||
| 698 | + } | ||
| 699 | + | ||
| 700 | + /** | ||
| 701 | + * 上传线路调度日报 | ||
| 702 | + * @return | ||
| 703 | + */ | ||
| 704 | + public String setDDRB(){ | ||
| 705 | + String result = "failure"; | ||
| 706 | + // 取昨天 的日期 | ||
| 707 | + String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 708 | + StringBuffer sf = new StringBuffer(); | ||
| 709 | + try { | ||
| 710 | + sf.append("<DDRBS>"); | ||
| 711 | + List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); | ||
| 712 | + List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); | ||
| 713 | + for(Map<String,Object> schRealInfo:listGroup){ | ||
| 714 | + if(schRealInfo != null){ | ||
| 715 | + double jhlc = 0,zlc = 0,jhkslc = 0,sjkslc = 0; | ||
| 716 | + int jhbc = 0,sjbc = 0,jhzgfbc = 0,sjzgfbc = 0,jhwgfbc = 0,sjwgfbc = 0; | ||
| 717 | + sf.append("<DDRB>"); | ||
| 718 | + sf.append("<RQ>"+date+"</RQ>"); | ||
| 719 | + sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm"))+"</XLBM>"); | ||
| 720 | + for(ScheduleRealInfo scheduleRealInfo:list){ | ||
| 721 | + if(scheduleRealInfo != null){ | ||
| 722 | + if((schRealInfo.get("xlBm")+"").equals(scheduleRealInfo.getXlBm())){ | ||
| 723 | + //计划 | ||
| 724 | + if(!scheduleRealInfo.isSflj()){ | ||
| 725 | + jhlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 726 | + //计划空驶 | ||
| 727 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")){ | ||
| 728 | + jhkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 729 | + } | ||
| 730 | + //计划早高峰,计划晚高峰 | ||
| 731 | + if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 732 | + jhzgfbc++; | ||
| 733 | + } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 734 | + jhwgfbc++; | ||
| 735 | + } | ||
| 736 | + } | ||
| 737 | + jhbc++; | ||
| 738 | + | ||
| 739 | + //实际 | ||
| 740 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 741 | + //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 | ||
| 742 | + if(childTaskPlans.isEmpty()){ | ||
| 743 | + if(scheduleRealInfo.getStatus() == 2){ | ||
| 744 | + sjbc++; | ||
| 745 | + zlc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | ||
| 746 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | ||
| 747 | + || scheduleRealInfo.getBcType().equals("venting")){ | ||
| 748 | + sjkslc += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | ||
| 749 | + } | ||
| 750 | + } | ||
| 751 | + }else{ | ||
| 752 | + sjbc++; | ||
| 753 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 754 | + while(it.hasNext()){ | ||
| 755 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 756 | + if(!childTaskPlan.isDestroy()){ | ||
| 757 | + zlc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage(); | ||
| 758 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 759 | + sjkslc += childTaskPlan.getMileage()==null?0.0:childTaskPlan.getMileage();; | ||
| 760 | + } | ||
| 761 | + } | ||
| 762 | + } | ||
| 763 | + } | ||
| 764 | + //实际早高峰,计划晚高峰 | ||
| 765 | + if(scheduleRealInfo.getFcsjActual() != null){ | ||
| 766 | + if(TimeUtils.morningPeak(scheduleRealInfo.getFcsj())){ | ||
| 767 | + sjzgfbc++; | ||
| 768 | + } else if(TimeUtils.evenignPeak(scheduleRealInfo.getFcsj())){ | ||
| 769 | + sjwgfbc++; | ||
| 770 | + } | ||
| 771 | + } | ||
| 772 | + } | ||
| 773 | + } | ||
| 774 | + } | ||
| 775 | + sf.append("<JHLC>"+format.format(jhlc)+"</JHLC>"); | ||
| 776 | + sf.append("<SSLC>"+format.format((zlc-sjkslc))+"</SSLC>"); | ||
| 777 | + sf.append("<JHKSLC>"+format.format(jhkslc)+"</JHKSLC>"); | ||
| 778 | + sf.append("<SJKSLC>"+format.format(sjkslc)+"</SJKSLC>"); | ||
| 779 | + sf.append("<JHBC>"+jhbc+"</JHBC>"); | ||
| 780 | + sf.append("<SJBC>"+sjbc+"</SJBC>"); | ||
| 781 | + sf.append("<JHZGFBC>"+jhzgfbc+"</JHZGFBC>"); | ||
| 782 | + sf.append("<SJZGFBC>"+sjzgfbc+"</SJZGFBC>"); | ||
| 783 | + sf.append("<JHWGFBC>"+jhwgfbc+"</JHWGFBC>"); | ||
| 784 | + sf.append("<SJWGFBC>"+sjwgfbc+"</SJWGFBC>"); | ||
| 785 | + sf.append("<UPDT>"+sdfnyrsfm.format(new Date())+"</UPDT>"); | ||
| 786 | + sf.append("<RBSCBZ>"+0+"</RBSCBZ>"); | ||
| 787 | + sf.append("</DDRB>"); | ||
| 788 | + } | ||
| 789 | + } | ||
| 790 | + sf.append("</DDRBS>"); | ||
| 791 | + if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){ | ||
| 792 | + result = "success"; | ||
| 793 | + } | ||
| 794 | + } catch (Exception e) { | ||
| 795 | + logger.error("setDDRB:",e); | ||
| 796 | + e.printStackTrace(); | ||
| 797 | + }finally{ | ||
| 798 | + logger.info("setDDRB:"+sf.toString()); | ||
| 799 | + logger.info("setDDRB:"+result); | ||
| 800 | + } | ||
| 801 | + return result; | ||
| 802 | + } | ||
| 803 | + | ||
| 804 | + /** | ||
| 805 | + * 上传计划班次 指定日期 yyyy-MM-dd | ||
| 806 | + * @param theDate | ||
| 807 | + * @return | ||
| 808 | + */ | ||
| 809 | + public String setJHBC(String theDate){ | ||
| 810 | + return uploadJHBC(theDate); | ||
| 811 | + } | ||
| 812 | + | ||
| 813 | + /** | ||
| 814 | + * 上传计划班次 | ||
| 815 | + * @return | ||
| 816 | + */ | ||
| 817 | + public String setJHBC(){ | ||
| 818 | + return uploadJHBC(null); | ||
| 819 | + } | ||
| 820 | + /** | ||
| 821 | + * 上传线路计划班次表 | ||
| 822 | + */ | ||
| 823 | + | ||
| 824 | + private String uploadJHBC(String theDate) { | ||
| 825 | + String result = "failure"; | ||
| 826 | + Line line; | ||
| 827 | + StringBuffer sBuffer =new StringBuffer(); | ||
| 828 | + try { | ||
| 829 | + sBuffer.append("<JHBCs>"); | ||
| 830 | + // 声明变量 | ||
| 831 | + SchedulePlanInfo schedulePlanInfo; | ||
| 832 | + String xlbm,zbh = ""; | ||
| 833 | + Long lp = 0L; | ||
| 834 | + // 取得计划班次时间 | ||
| 835 | + String tomorrow = theDate == null ? sdfnyr.format(DateUtils.addDays(new Date(), +1)) : theDate; | ||
| 836 | + // 查询所有班次 | ||
| 837 | + List<SchedulePlanInfo> schedulePlanList = schedulePlanInfoRepository.findLineScheduleBc(tomorrow); | ||
| 838 | + int j = 0; // 初始化标识 | ||
| 839 | + if(schedulePlanList != null ){ | ||
| 840 | + HashMap<String,String> paramMap; | ||
| 841 | + HashMap<String,String> otherMap = new HashMap<String, String>(); | ||
| 842 | + int size = schedulePlanList.size(); | ||
| 843 | + for (int i = 0; i < size; i++) { | ||
| 844 | + schedulePlanInfo = schedulePlanList.get(i); | ||
| 845 | + xlbm = schedulePlanInfo.getXlBm(); | ||
| 846 | + // 获取线路是否使用标识,如果未使用,则不查该线路数据 | ||
| 847 | + line = lineRepository.findByLineCode(xlbm); | ||
| 848 | + if(line.getInUse() == null || line.getInUse() == 0){ | ||
| 849 | + continue; | ||
| 850 | + } | ||
| 851 | + if(++j == 1){// 第一次,则初始化值 | ||
| 852 | + zbh = schedulePlanInfo.getClZbh(); | ||
| 853 | + lp = schedulePlanInfo.getLp(); | ||
| 854 | + // 拼装XML | ||
| 855 | + assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); | ||
| 856 | + } | ||
| 857 | + // 比较是否为同一条线路同一辆车 | ||
| 858 | + if(xlbm.equals(schedulePlanInfo.getXlBm()) | ||
| 859 | + && zbh.equals(schedulePlanInfo.getClZbh()) | ||
| 860 | + && lp == schedulePlanInfo.getLp()){ | ||
| 861 | + if(schedulePlanInfo.getBcType().equals("in") || schedulePlanInfo.getBcType().equals("out")){ | ||
| 862 | + continue; | ||
| 863 | + } | ||
| 864 | + sBuffer.append("<BC>"); | ||
| 865 | + sBuffer.append("<SJGH>").append(schedulePlanInfo.getjGh()).append("</SJGH>"); | ||
| 866 | + sBuffer.append("<SXX>").append(schedulePlanInfo.getXlDir()).append("</SXX>"); | ||
| 867 | + sBuffer.append("<FCZDMC>").append(schedulePlanInfo.getQdzName()).append("</FCZDMC>"); | ||
| 868 | + // 起点站的参数 | ||
| 869 | + otherMap.put("stationMark","B"); | ||
| 870 | + paramMap = packageYgcStationNumParam(schedulePlanInfo,otherMap); | ||
| 871 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</ZDXH>"); | ||
| 872 | + sBuffer.append("<JHFCSJ>").append(schedulePlanInfo.getFcsj()).append("</JHFCSJ>"); | ||
| 873 | + sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>"); | ||
| 874 | + // 起点站的参数 | ||
| 875 | + otherMap.put("stationMark","E"); | ||
| 876 | + paramMap = packageYgcStationNumParam(schedulePlanInfo,otherMap); | ||
| 877 | + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,null)).append("</DDXH>"); | ||
| 878 | + sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj())) | ||
| 879 | + .append("</JHDDSJ>"); | ||
| 880 | + sBuffer.append("</BC>"); | ||
| 881 | + if(i == size -1 ){ | ||
| 882 | + sBuffer.append("</BCList>"); | ||
| 883 | + sBuffer.append("</JHBC>"); | ||
| 884 | + } | ||
| 885 | + }else{ | ||
| 886 | + zbh = schedulePlanInfo.getClZbh(); | ||
| 887 | + lp = schedulePlanInfo.getLp(); | ||
| 888 | + sBuffer.append("</BCList>"); | ||
| 889 | + sBuffer.append("</JHBC>"); | ||
| 890 | + // 拼装XML | ||
| 891 | + assembleJHBC(sBuffer, schedulePlanInfo, xlbm, zbh, lp); | ||
| 892 | + } | ||
| 893 | + } | ||
| 894 | + } | ||
| 895 | + // 判断XML是否以</BCList>结尾,如果不是,则加上 | ||
| 896 | + String regex = "^*</JHBC>$"; | ||
| 897 | + Pattern p = Pattern.compile(regex); | ||
| 898 | + Matcher m = p.matcher(sBuffer); | ||
| 899 | + boolean isEndWithTrueFlag = false; | ||
| 900 | + while (m.find()) { | ||
| 901 | + isEndWithTrueFlag = true; | ||
| 902 | + } | ||
| 903 | + // 加上缺失的标签 | ||
| 904 | + if(!isEndWithTrueFlag){ | ||
| 905 | + sBuffer.append("</BCList>"); | ||
| 906 | + sBuffer.append("</JHBC>"); | ||
| 907 | + } | ||
| 908 | + sBuffer.append("</JHBCs>"); | ||
| 909 | + if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 910 | + result = "success"; | ||
| 911 | + } | ||
| 912 | + } catch (Exception e) { | ||
| 913 | + logger.error("setJHBC:",e); | ||
| 914 | + e.printStackTrace(); | ||
| 915 | + }finally{ | ||
| 916 | + logger.info("setJHBC:"+sBuffer.toString()); | ||
| 917 | + logger.info("setJHBC:"+result); | ||
| 918 | + } | ||
| 919 | + return result; | ||
| 920 | + } | ||
| 921 | + | ||
| 922 | + /** | ||
| 923 | + * 上传线路班次时刻表数据 | ||
| 924 | + */ | ||
| 925 | + @Override | ||
| 926 | + public String setSKB(String ids) { | ||
| 927 | + String result = "上传失败,"; | ||
| 928 | + StringBuffer sBuffer = new StringBuffer("<SKBs>"); | ||
| 929 | + DecimalFormat df = new DecimalFormat("######0.000"); | ||
| 930 | + Map<String,String> lsStationCode2NameMap = null; | ||
| 931 | + Map<String, Integer> lsStationName2YgcNumber = null; | ||
| 932 | + try { | ||
| 933 | + String[] idArray = ids.split(","); | ||
| 934 | + StringBuffer sBufferA ,sBufferB ,sBufferC ; | ||
| 935 | + double zlc,yylc,singleLc,emptyLc;// 总里程、营运里程、单程、空放里程 | ||
| 936 | + String bcType,sxx;// 班次类型、上下行 | ||
| 937 | + // 上传的时刻表集合 | ||
| 938 | + List<TTInfo> ttinfoList = new ArrayList<>(); | ||
| 939 | + TTInfo ttInfo; | ||
| 940 | + TTInfoDetail ttInfoDetail; | ||
| 941 | + LineInformation lineInformation; | ||
| 942 | + Iterator<TTInfoDetail> ttInfoDetailIterator; | ||
| 943 | + HashMap<String,Object> param ; | ||
| 944 | + HashMap<String,String> paramMap; | ||
| 945 | + HashMap<String,String> otherMap = new HashMap<>(); | ||
| 946 | + // 线路编码、周几执行、发车站点名称、发车站点序号、到达站点名称、到达站点序号 | ||
| 947 | + String xlbm,zjzx,fczdmc,zdxh,ddzdmc,ddxh; | ||
| 948 | + // 得到时刻表版本号 | ||
| 949 | + int lineVersion; | ||
| 950 | + long ttinfoId; | ||
| 951 | + // 是否输出站点信息 | ||
| 952 | + boolean isLogStation; | ||
| 953 | + for (int i = 0; i < idArray.length; i++) { | ||
| 954 | + ttinfoId = Long.valueOf(idArray[i]); | ||
| 955 | + Optional<TTInfo> optionalTTInfo = ttInfoRepository.findById(ttinfoId); | ||
| 956 | + ttInfo = optionalTTInfo.isPresent() ? optionalTTInfo.get() : null; | ||
| 957 | + if(ttInfo == null) | ||
| 958 | + continue; | ||
| 959 | + ttinfoList.add(ttInfo); // 保存时刻表 | ||
| 960 | + // 得到时刻表版本号 | ||
| 961 | + lineVersion = ttInfo.getLineVersion(); | ||
| 962 | + // 查询历史站点路由 | ||
| 963 | + lsStationCode2NameMap = getLsStationCode(ttInfo.getXl().getLineCode(),lineVersion); | ||
| 964 | + // 查询历史站点路由 | ||
| 965 | + lsStationName2YgcNumber = getLsStationRoute(ttInfo.getXl().getLineCode(),lineVersion); | ||
| 966 | + zlc = 0.0f; | ||
| 967 | + yylc = 0.0f; | ||
| 968 | + // 获得时刻表 | ||
| 969 | + param = new HashMap(); | ||
| 970 | + param.put("ttinfo.id_eq", ttInfo.getId()); | ||
| 971 | + ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), | ||
| 972 | + new Sort(Direction.ASC, "xlDir")).iterator(); | ||
| 973 | + // 获得lineInformation | ||
| 974 | + param = new HashMap(); | ||
| 975 | + param.put("line.id_eq", ttInfo.getXl().getId()); | ||
| 976 | + Optional<LineInformation> optionalLineInformation = lineInformationRepository.findOne(new CustomerSpecs<LineInformation>(param)); | ||
| 977 | + lineInformation = optionalLineInformation.isPresent() ? optionalLineInformation.get() : null; | ||
| 978 | + // 初始化 | ||
| 979 | + isLogStation = true; | ||
| 980 | + if(ttInfoDetailIterator.hasNext()){ | ||
| 981 | + // 得到线路信息 | ||
| 982 | + Optional<Line> optionalLine = lineRepository.findById(ttInfo.getXl().getId()); | ||
| 983 | + Line line = optionalLine.isPresent() ? optionalLine.get() : null; | ||
| 984 | + if(line == null){ | ||
| 985 | + result += "未找到相应的线路信息,请设置线路信息后再上传"; | ||
| 986 | + return result; | ||
| 987 | + } | ||
| 988 | + // 得到上海市线路编码 | ||
| 989 | + xlbm = line.getShanghaiLinecode(); | ||
| 990 | + if("".equals(xlbm) || "null".equals(xlbm)){ | ||
| 991 | + result += "线路编码为空,请设置线路编码后再上传"; | ||
| 992 | + return result; | ||
| 993 | + } | ||
| 994 | + // 拿到周几执行 | ||
| 995 | + zjzx = changeRuleDay(ttInfo.getRule_days()); | ||
| 996 | + if("".equals(zjzx) || "null".equals(zjzx)){ | ||
| 997 | + result += "时刻表执行时间为空,请设置执行时间后再上传"; | ||
| 998 | + return result; | ||
| 999 | + } | ||
| 1000 | + sBuffer.append("<SKB>"); | ||
| 1001 | + sBuffer.append("<XLBM>").append(xlbm).append("</XLBM>"); | ||
| 1002 | + sBufferB = new StringBuffer(); | ||
| 1003 | + sBufferC = new StringBuffer(); | ||
| 1004 | + sBufferB.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | ||
| 1005 | + // 结束日期暂时不要,节假日的班次表才需要,如春节的班次表 | ||
| 1006 | + sBufferB.append("<JSRQ>").append("").append("</JSRQ>"); | ||
| 1007 | + sBufferB.append("<ZJZX>").append(zjzx).append("</ZJZX>"); | ||
| 1008 | + sBufferB.append("<TBYY>").append("").append("</TBYY>"); | ||
| 1009 | + sBufferB.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1010 | + sBufferB.append("<BCList>"); | ||
| 1011 | + while (ttInfoDetailIterator.hasNext()) { | ||
| 1012 | + ttInfoDetail = ttInfoDetailIterator.next(); | ||
| 1013 | + bcType = ttInfoDetail.getBcType(); | ||
| 1014 | + sxx = ttInfoDetail.getXlDir(); | ||
| 1015 | + // 进出场班次的里程,加入总里程 | ||
| 1016 | + if(bcType.equals("in") || bcType.equals("out")){ | ||
| 1017 | + // 进出班次的计划里程,算空驶里程 | ||
| 1018 | + emptyLc = ttInfoDetail.getJhlc(); | ||
| 1019 | + // 总里程需要加上空驶里程 | ||
| 1020 | + zlc += emptyLc; | ||
| 1021 | + continue; | ||
| 1022 | + } | ||
| 1023 | + // 不是正常班次,不传到运管处 | ||
| 1024 | + if(!bcType.equals("normal")){ | ||
| 1025 | + continue; | ||
| 1026 | + } | ||
| 1027 | + // 如果发车时间格式错误,忽略此条 | ||
| 1028 | + if(changeTimeFormat(ttInfoDetail) == null){ | ||
| 1029 | + continue; | ||
| 1030 | + } | ||
| 1031 | + // 发生站点名称 | ||
| 1032 | + fczdmc = lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()+"_"+ttInfoDetail.getQdzCode()); | ||
| 1033 | + if("".equals(fczdmc) || "null".equals(fczdmc)){ | ||
| 1034 | + result += "发车站点名称为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1035 | + return result; | ||
| 1036 | + } | ||
| 1037 | + sBufferC.append("<BC>"); | ||
| 1038 | + sBufferC.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | ||
| 1039 | + sBufferC.append("<SXX>").append(sxx).append("</SXX>"); | ||
| 1040 | + sBufferC.append("<FCZDMC>").append(fczdmc).append("</FCZDMC>"); | ||
| 1041 | + // 起点站的参数 | ||
| 1042 | + otherMap.put("stationMark","B"); | ||
| 1043 | + paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap); | ||
| 1044 | + if(isLogStation){// 输出起点站信息 | ||
| 1045 | + logger.info("setSKB:"+"起点站信息:"+paramMap); | ||
| 1046 | + } | ||
| 1047 | + // 发车站点序号 | ||
| 1048 | + zdxh = String.valueOf(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)); | ||
| 1049 | + if("".equals(zdxh) || "null".equals(zdxh) || "0".equals(zdxh)){ | ||
| 1050 | + result += "发车站点序号为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1051 | + return result; | ||
| 1052 | + } | ||
| 1053 | + // 到达站点名称 | ||
| 1054 | + ddzdmc = lsStationCode2NameMap.get(ttInfoDetail.getXl().getLineCode()+"_"+ttInfoDetail.getXlDir()+"_"+ttInfoDetail.getZdzCode()); | ||
| 1055 | + if("".equals(ddzdmc) || "null".equals(ddzdmc)){ | ||
| 1056 | + result += "到达站点名称为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1057 | + return result; | ||
| 1058 | + } | ||
| 1059 | + sBufferC.append("<ZDXH>").append(zdxh).append("</ZDXH>"); | ||
| 1060 | + sBufferC.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>"); | ||
| 1061 | + sBufferC.append("<DDZDMC>").append(ddzdmc).append("</DDZDMC>"); | ||
| 1062 | + // 终点站的参数 | ||
| 1063 | + otherMap.put("stationMark","E"); | ||
| 1064 | + paramMap = packageYgcStationNumParam(ttInfoDetail,otherMap); | ||
| 1065 | + if(isLogStation){// 输出终点站信息 | ||
| 1066 | + logger.info("setSKB:"+"终点站信息:"+paramMap); | ||
| 1067 | + } | ||
| 1068 | + // 到达站点序号 | ||
| 1069 | + ddxh = String.valueOf(getYgcStationNumByLineCodeAndDirectionAndStationName(paramMap,lsStationName2YgcNumber)); | ||
| 1070 | + if("".equals(ddxh) || "null".equals(ddxh) || "0".equals(ddxh)){ | ||
| 1071 | + result += "到达站点序号为空,请根据时刻表当前的版本号设置好历史站点路由再上传"; | ||
| 1072 | + return result; | ||
| 1073 | + } | ||
| 1074 | + isLogStation = false; // 一条线路只输出一次,后面的不输出了 | ||
| 1075 | + sBufferC.append("<DDXH>").append(ddxh).append("</DDXH>"); | ||
| 1076 | + sBufferC.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | ||
| 1077 | + sBufferC.append("</BC>"); | ||
| 1078 | + // 0:上行;1:下行 | ||
| 1079 | + if("0".equals(sxx)){ | ||
| 1080 | + singleLc = lineInformation.getUpMileage(); | ||
| 1081 | + }else{ | ||
| 1082 | + singleLc = lineInformation.getDownMileage(); | ||
| 1083 | + } | ||
| 1084 | + zlc += singleLc ; | ||
| 1085 | + yylc += singleLc; | ||
| 1086 | + } | ||
| 1087 | + sBufferC.append("</BCList>"); | ||
| 1088 | + sBufferC.append("</SKB>"); | ||
| 1089 | + sBufferA = new StringBuffer(); | ||
| 1090 | + sBufferA.append("<JHZLC>").append(df.format(zlc)).append("</JHZLC>"); | ||
| 1091 | + sBufferA.append("<JHYYLC>").append(df.format(yylc)).append("</JHYYLC>"); | ||
| 1092 | + sBuffer.append(sBufferA).append(sBufferB).append(sBufferC); | ||
| 1093 | + } | ||
| 1094 | + logger.info("setSKB:"+"ttinfoId:"+ttinfoId+";当前站点版本号:"+lineVersion+";查询历史站点路由:"+lsStationCode2NameMap+";查询历史站点编号:"+lsStationName2YgcNumber); | ||
| 1095 | + } | ||
| 1096 | + sBuffer.append("</SKBs>"); | ||
| 1097 | + String state;// 是否上传成功 | ||
| 1098 | + if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 1099 | + result = "上传成功"; | ||
| 1100 | + state = "1"; | ||
| 1101 | + }else{// 上传失败 | ||
| 1102 | + result = "上传失败"; | ||
| 1103 | + state = "0"; | ||
| 1104 | + } | ||
| 1105 | + // 保存运管处上传记录 | ||
| 1106 | + saveYgcUploadLog(ttinfoList,sBuffer.toString(),TrafficManageServiceImpl.UPLOAD_TYPE_SKB,state); | ||
| 1107 | + } catch (Exception e) { | ||
| 1108 | + logger.error("setSKB:", e); | ||
| 1109 | + e.printStackTrace(); | ||
| 1110 | + }finally{ | ||
| 1111 | + logger.info("setSKB:"+sBuffer.toString()); | ||
| 1112 | + logger.info("setSKB:"+result); | ||
| 1113 | + } | ||
| 1114 | + return result; | ||
| 1115 | + } | ||
| 1116 | + | ||
| 1117 | + /** | ||
| 1118 | + * 保存上传运管处的日志 | ||
| 1119 | + * @param obj 参数 | ||
| 1120 | + * @param type 日志类型 | ||
| 1121 | + * @param xml 上传参数 | ||
| 1122 | + */ | ||
| 1123 | + private void saveYgcUploadLog(Object obj,String xml,String type,String state){ | ||
| 1124 | + SKBUploadLogger skbUploadLogger = new SKBUploadLogger(); | ||
| 1125 | + SysUser user; | ||
| 1126 | + // 如果不是人为上传,SysUser则为空,设置上传人员为管理员 | ||
| 1127 | + if(SecurityContextHolder.getContext() == null || SecurityContextHolder.getContext().getAuthentication() == null){ | ||
| 1128 | + user = new SysUser(); | ||
| 1129 | + user.setId(1); | ||
| 1130 | + }else{// 获取上传人员 | ||
| 1131 | + user = SecurityUtils.getCurrentUser(); | ||
| 1132 | + } | ||
| 1133 | + // 最大的字符长度 | ||
| 1134 | + int maxLength = 60000; | ||
| 1135 | + int cutLength = 50000;// 需要截取的字符长度 | ||
| 1136 | + String xml_sub = null; | ||
| 1137 | + skbUploadLogger.setType(type);// 设置类型 | ||
| 1138 | + // 判断xml是否超长,如果超长,则截取 | ||
| 1139 | + if(xml != null && xml.length() > maxLength){ | ||
| 1140 | + int xmlLength = xml.length(); | ||
| 1141 | + int cutCount = xmlLength / cutLength + (xmlLength % cutLength > 0 ? 1 : 0); | ||
| 1142 | + if(cutCount > 2){ | ||
| 1143 | + xml = "由于上传参数内容超长,请查看服务器的系统日志"; | ||
| 1144 | + }else if(cutCount == 2){ | ||
| 1145 | + xml_sub =xml.substring(cutLength); | ||
| 1146 | + xml = xml.substring(0,cutLength); | ||
| 1147 | + }else{ | ||
| 1148 | + // 不做处理 | ||
| 1149 | + } | ||
| 1150 | + } | ||
| 1151 | +// skbUploadLogger.setUploadXml(xml);// 上传的参数 | ||
| 1152 | +// skbUploadLogger.setUploadXmlSub(xml_sub); | ||
| 1153 | + skbUploadLogger.setState(state);// 状态:是否成功 | ||
| 1154 | + skbUploadLogger.setUser(user); | ||
| 1155 | + // 时刻表 | ||
| 1156 | + if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_SKB)){ | ||
| 1157 | + List<TTInfo> ttInfoList = (List<TTInfo>)obj; | ||
| 1158 | + String name = ""; | ||
| 1159 | + Line line = null; | ||
| 1160 | + for(TTInfo ttInfo : ttInfoList){ | ||
| 1161 | + name += ttInfo.getName() + " "; | ||
| 1162 | + line = ttInfo.getXl(); | ||
| 1163 | + } | ||
| 1164 | + skbUploadLogger.setLine(line); | ||
| 1165 | + skbUploadLogger.setUser(user); | ||
| 1166 | + skbUploadLogger.setName(name); | ||
| 1167 | + skbUploadLoggerRepository.save(skbUploadLogger); | ||
| 1168 | + }else{ | ||
| 1169 | + if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_XL)){ | ||
| 1170 | + Line line = (Line) obj; | ||
| 1171 | + String name = line.getName() + "线路停靠站上传"; | ||
| 1172 | + skbUploadLogger.setLine(line); | ||
| 1173 | + skbUploadLogger.setName(name); | ||
| 1174 | + skbUploadLoggerRepository.save(skbUploadLogger); | ||
| 1175 | + }else if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_LD)){ | ||
| 1176 | + Map<String ,Line> logLineMap = (Map<String ,Line> )obj; | ||
| 1177 | + for (String key : logLineMap.keySet()) { | ||
| 1178 | + Line line = logLineMap.get(key); | ||
| 1179 | + String name = line.getName() + "路单上传"; | ||
| 1180 | + skbUploadLogger = new SKBUploadLogger(); | ||
| 1181 | + skbUploadLogger.setType(type);// 设置类型 | ||
| 1182 | +// skbUploadLogger.setUploadXml(xml);// 上传的参数 | ||
| 1183 | +// skbUploadLogger.setUploadXmlSub(xml_sub); | ||
| 1184 | + skbUploadLogger.setState(state);// 状态:是否成功 | ||
| 1185 | + skbUploadLogger.setUser(user); | ||
| 1186 | + skbUploadLogger.setLine(line); | ||
| 1187 | + skbUploadLogger.setName(name); | ||
| 1188 | +// skbUploadLoggerRepository.save(skbUploadLogger); | ||
| 1189 | + } | ||
| 1190 | + } | ||
| 1191 | + } | ||
| 1192 | + } | ||
| 1193 | + /** | ||
| 1194 | + * 上传线路人员车辆配置信息 | ||
| 1195 | + */ | ||
| 1196 | + @Override | ||
| 1197 | + public String setXLPC() { | ||
| 1198 | + String result = "failure"; | ||
| 1199 | + StringBuffer sBuffer =new StringBuffer(); | ||
| 1200 | + try { | ||
| 1201 | + sBuffer.append("<XLPCs>"); | ||
| 1202 | + // 声明变量 | ||
| 1203 | + Line line = null; | ||
| 1204 | + Cars cars = null; | ||
| 1205 | + List<Personnel> personnelList = null; | ||
| 1206 | + List<Cars> carsList = null; | ||
| 1207 | + int totalPersonnel,totalCar ;// 人员数量。车辆数量 | ||
| 1208 | + // 查询所有线路 | ||
| 1209 | + Iterator<Line> lineIterator = lineRepository.findAll().iterator(); | ||
| 1210 | + // 循环查找线路下的信息 | ||
| 1211 | + while(lineIterator.hasNext()){ | ||
| 1212 | + line = lineIterator.next(); | ||
| 1213 | + sBuffer.append("<XLPC>"); | ||
| 1214 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | ||
| 1215 | + // 查询驾驶员数量 | ||
| 1216 | + personnelList = personnelRepository.findJsysByLineId(line.getId()); | ||
| 1217 | + totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 1218 | + sBuffer.append("<SJRS>").append(totalPersonnel).append("</SJRS>"); | ||
| 1219 | + // 查询售票员人员数量 | ||
| 1220 | + personnelList = personnelRepository.findSpysByLineId(line.getId()); | ||
| 1221 | + totalPersonnel = personnelList != null ? personnelList.size():0; | ||
| 1222 | + sBuffer.append("<SPYRS>").append(totalPersonnel).append("</SPYRS>"); | ||
| 1223 | + // 查询车辆 | ||
| 1224 | + carsList = carsRepository.findCarsByLineId(line.getId()); | ||
| 1225 | + totalCar = carsList != null ? carsList.size():0; | ||
| 1226 | + sBuffer.append("<PCSL>").append(totalCar).append("</PCSL>"); | ||
| 1227 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1228 | + int carsNum = 0; | ||
| 1229 | + // 取车牌号 | ||
| 1230 | + if(carsList != null){ | ||
| 1231 | + carsNum = carsList.size(); | ||
| 1232 | + sBuffer.append("<CPHList>"); | ||
| 1233 | + for (int i = 0; i < carsNum; i++) { | ||
| 1234 | + cars = carsList.get(i); | ||
| 1235 | + sBuffer.append("<CPH>").append("沪").append(cars.getCarCode()).append("</CPH>"); | ||
| 1236 | + } | ||
| 1237 | + sBuffer.append("</CPHList>"); | ||
| 1238 | + } | ||
| 1239 | + sBuffer.append("</XLPC>"); | ||
| 1240 | + } | ||
| 1241 | + sBuffer.append("</XLPCs>"); | ||
| 1242 | + if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 1243 | + result = "success"; | ||
| 1244 | + } | ||
| 1245 | + } catch (Exception e) { | ||
| 1246 | + logger.error("setXLPC:",e); | ||
| 1247 | + e.printStackTrace(); | ||
| 1248 | + }finally{ | ||
| 1249 | + logger.info("setXLPC:"+sBuffer.toString()); | ||
| 1250 | + logger.info("setXLPC:"+result); | ||
| 1251 | + } | ||
| 1252 | + return result; | ||
| 1253 | + } | ||
| 1254 | + | ||
| 1255 | + | ||
| 1256 | + /** | ||
| 1257 | + * 上传超速数据 | ||
| 1258 | + */ | ||
| 1259 | + @Override | ||
| 1260 | + public String setCS() { | ||
| 1261 | + String result = "failure"; | ||
| 1262 | + StringBuffer sBuffer =new StringBuffer(); | ||
| 1263 | + sBuffer.append("<CSs>"); | ||
| 1264 | + String sql = "SELECT * FROM bsth_c_speeding where DATE_FORMAT(create_date,'%Y-%m-%d') = ? order by create_date "; | ||
| 1265 | + Connection conn = null; | ||
| 1266 | + PreparedStatement ps = null; | ||
| 1267 | + ResultSet rs = null; | ||
| 1268 | + // 取昨天 的日期 | ||
| 1269 | + String yesterday = sdfnyr.format(DateUtils.addDays(new Date(), -1)); | ||
| 1270 | + try { | ||
| 1271 | + conn = DBUtils_MS.getConnection(); | ||
| 1272 | + ps = conn.prepareStatement(sql); | ||
| 1273 | + ps.setString(1, yesterday); | ||
| 1274 | + rs = ps.executeQuery(); | ||
| 1275 | + Float lon, lat; | ||
| 1276 | + String kssk; | ||
| 1277 | + String speed; | ||
| 1278 | + while (rs.next()) { | ||
| 1279 | + kssk = sdfnyrsfm.format(rs.getLong("TIMESTAMP")); | ||
| 1280 | + speed = rs.getString("SPEED"); | ||
| 1281 | + // 经纬度 | ||
| 1282 | + lon = rs.getFloat("LON"); | ||
| 1283 | + lat = rs.getFloat("LAT"); | ||
| 1284 | + sBuffer.append("<CS>"); | ||
| 1285 | + sBuffer.append("<RQ>").append(sdfnyr.format(rs.getDate("CREATE_DATE"))).append("</RQ>"); | ||
| 1286 | + sBuffer.append("<XLBM>").append(BasicData.lineCode2ShangHaiCodeMap.get(rs.getString("LINE"))).append("</XLBM>");//////// | ||
| 1287 | + sBuffer.append("<CPH>").append(rs.getString("VEHICLE")).append("</CPH>"); | ||
| 1288 | + sBuffer.append("<KSSK>").append(kssk).append("</KSSK>"); | ||
| 1289 | + sBuffer.append("<KSDDJD>").append(lon).append("</KSDDJD>"); | ||
| 1290 | + sBuffer.append("<KSDDWD>").append(lat).append("</KSDDWD>"); | ||
| 1291 | + sBuffer.append("<KSLD>").append("").append("</KSLD>");//********************** | ||
| 1292 | + sBuffer.append("<JSSK>").append(kssk).append("</JSSK>"); | ||
| 1293 | + sBuffer.append("<JSDDJD>").append(lon).append("</JSDDJD>"); | ||
| 1294 | + sBuffer.append("<JSDDWD>").append(lat).append("</JSDDWD>"); | ||
| 1295 | + sBuffer.append("<JSLD>").append("").append("</JSLD>");//********************** | ||
| 1296 | + sBuffer.append("<PJSD>").append(speed).append("</PJSD>"); | ||
| 1297 | + sBuffer.append("<ZGSS>").append(speed).append("</ZGSS>"); | ||
| 1298 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1299 | + sBuffer.append("</CS>"); | ||
| 1300 | + } | ||
| 1301 | + sBuffer.append("</CSs>"); | ||
| 1302 | + if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ | ||
| 1303 | + result = "success"; | ||
| 1304 | + } | ||
| 1305 | + } catch (Exception e) { | ||
| 1306 | + logger.error("setCS:",e); | ||
| 1307 | + e.printStackTrace(); | ||
| 1308 | + } finally { | ||
| 1309 | + logger.info("setCS:"+sBuffer.toString()); | ||
| 1310 | + logger.info("setCS:"+result); | ||
| 1311 | + DBUtils_MS.close(rs, ps, conn); | ||
| 1312 | + } | ||
| 1313 | + return result; | ||
| 1314 | + } | ||
| 1315 | + | ||
| 1316 | + | ||
| 1317 | + /** | ||
| 1318 | + * 下载全量的公交基础数据 | ||
| 1319 | + */ | ||
| 1320 | + public String getDownLoadAllDataFile() { | ||
| 1321 | + String result = "failure"; | ||
| 1322 | + try { | ||
| 1323 | + try { | ||
| 1324 | + if(ygcBasicDataService.download("admin","000000","abc.zip")){ | ||
| 1325 | + result = "success"; | ||
| 1326 | + } | ||
| 1327 | + } catch (Exception e) { | ||
| 1328 | + e.printStackTrace(); | ||
| 1329 | + } | ||
| 1330 | + } catch (Exception e) { | ||
| 1331 | + e.printStackTrace(); | ||
| 1332 | + } | ||
| 1333 | + | ||
| 1334 | + return result; | ||
| 1335 | + } | ||
| 1336 | + | ||
| 1337 | + /** | ||
| 1338 | + * 下载增量的公交基础数据 | ||
| 1339 | + */ | ||
| 1340 | + public String getDownLoadIncreaseDataFile() { | ||
| 1341 | + String result = "success"; | ||
| 1342 | + try { | ||
| 1343 | + //System.out.println(portType.downloadIncreaseDataFile(args0, args1, args2)); | ||
| 1344 | + } catch (Exception e) { | ||
| 1345 | + e.printStackTrace(); | ||
| 1346 | + } | ||
| 1347 | + | ||
| 1348 | + return result; | ||
| 1349 | + } | ||
| 1350 | + | ||
| 1351 | + /** | ||
| 1352 | + * 指定线路查询方式公交基础数据下载 | ||
| 1353 | + */ | ||
| 1354 | + public String getDownLoadWarrantsBusLineStation() { | ||
| 1355 | + String result = "success"; | ||
| 1356 | + try { | ||
| 1357 | + | ||
| 1358 | + //portType.setXL(userNameXl, passwordXl, sBuffer.toString()); | ||
| 1359 | + } catch (Exception e) { | ||
| 1360 | + e.printStackTrace(); | ||
| 1361 | + } | ||
| 1362 | + | ||
| 1363 | + return result; | ||
| 1364 | + } | ||
| 1365 | + | ||
| 1366 | + /** | ||
| 1367 | + * 计算结束时间 | ||
| 1368 | + * @param fcsj 发车时间 | ||
| 1369 | + * @param bcsj 班次历时 | ||
| 1370 | + * @return | ||
| 1371 | + */ | ||
| 1372 | + private String calcDdsj(String fcsj,Integer bcsj){ | ||
| 1373 | + String result = ""; | ||
| 1374 | + if(fcsj.indexOf(":") != -1){ | ||
| 1375 | + if(bcsj == null){ | ||
| 1376 | + return fcsj; | ||
| 1377 | + } | ||
| 1378 | + // 时和分隔开 | ||
| 1379 | + String[] fcsjArray = fcsj.split(":"); | ||
| 1380 | + // 分和历时时间相加 | ||
| 1381 | + Integer fullTime = Integer.valueOf(fcsjArray[1])+ bcsj; | ||
| 1382 | + int hour,min,sumHour; | ||
| 1383 | + hour = fullTime / 60; | ||
| 1384 | + min = fullTime % 60; | ||
| 1385 | + sumHour = Integer.valueOf(fcsjArray[0])+hour; | ||
| 1386 | + if(sumHour >= 24){ | ||
| 1387 | + result = String.format("%02d",sumHour - 24); | ||
| 1388 | + }else{ | ||
| 1389 | + result = String.format("%02d",sumHour);; | ||
| 1390 | + } | ||
| 1391 | + result +=":"+String.format("%02d", min); | ||
| 1392 | + }else{ | ||
| 1393 | + result = fcsj; | ||
| 1394 | + } | ||
| 1395 | + return result; | ||
| 1396 | + } | ||
| 1397 | + | ||
| 1398 | + /** | ||
| 1399 | + * 改变时间格式 | ||
| 1400 | + * @param ttInfoDetail 时刻表详细 | ||
| 1401 | + * @return xx:yy | ||
| 1402 | + */ | ||
| 1403 | + private String changeTimeFormat(TTInfoDetail ttInfoDetail){ | ||
| 1404 | + String result = "00:00"; | ||
| 1405 | + String fcsj = ttInfoDetail.getFcsj(); | ||
| 1406 | + if(fcsj.indexOf(":") != -1){ | ||
| 1407 | + // 时和分隔开 | ||
| 1408 | + String[] fcsjArray = fcsj.split(":"); | ||
| 1409 | + result = String.format("%02d", Integer.valueOf(fcsjArray[0]))+":"; | ||
| 1410 | + result +=String.format("%02d", Integer.valueOf(fcsjArray[1])); | ||
| 1411 | + }else{ | ||
| 1412 | + result = null; | ||
| 1413 | + logger.info("setSKB:发车时间错误:ttInfoDetail.id="+ttInfoDetail.getId()); | ||
| 1414 | + } | ||
| 1415 | + return result; | ||
| 1416 | + } | ||
| 1417 | + | ||
| 1418 | + /** | ||
| 1419 | + * 拼装线路计划班次表的XML | ||
| 1420 | + * @param sBuffer | ||
| 1421 | + * @param schedulePlanInfo | ||
| 1422 | + * @param xlbm | ||
| 1423 | + * @param zbh | ||
| 1424 | + * @param lp | ||
| 1425 | + */ | ||
| 1426 | + private void assembleJHBC(StringBuffer sBuffer,SchedulePlanInfo schedulePlanInfo,String xlbm,String zbh,Long lp){ | ||
| 1427 | + sBuffer.append("<JHBC>"); | ||
| 1428 | + sBuffer.append("<RQ>").append(sdfnyr.format(schedulePlanInfo.getScheduleDate())).append("</RQ>"); | ||
| 1429 | + sBuffer.append("<XLBM>").append(BasicData.lineCode2ShangHaiCodeMap.get(xlbm)).append("</XLBM>"); | ||
| 1430 | + sBuffer.append("<CPH>").append("沪"+zbh).append("</CPH>"); | ||
| 1431 | + sBuffer.append("<LPBH>").append(lp).append("</LPBH>"); | ||
| 1432 | + sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | ||
| 1433 | + sBuffer.append("<BCList>"); | ||
| 1434 | + } | ||
| 1435 | + /** | ||
| 1436 | + * 转换排班规则 | ||
| 1437 | + * @param ruleDay | ||
| 1438 | + * @return | ||
| 1439 | + */ | ||
| 1440 | + private String changeRuleDay(String ruleDay){ | ||
| 1441 | + String result = ""; | ||
| 1442 | + int flag ; | ||
| 1443 | + String[] ruleDayArray = ruleDay.split(","); | ||
| 1444 | + for (int i = 0; i < ruleDayArray.length; i++) { | ||
| 1445 | + if(ruleDayArray[i].equals("1")){ | ||
| 1446 | + flag = i+1; | ||
| 1447 | + }else{ | ||
| 1448 | + flag = 0; | ||
| 1449 | + } | ||
| 1450 | + if(flag > 0){ | ||
| 1451 | + result += flag + ","; | ||
| 1452 | + } | ||
| 1453 | + } | ||
| 1454 | + // 去掉最后一个字符 | ||
| 1455 | + if(StringUtils.endsWith(result,",")){ | ||
| 1456 | + result = StringUtils.removeEnd(result,","); | ||
| 1457 | + } | ||
| 1458 | + return result; | ||
| 1459 | + } | ||
| 1460 | + /** | ||
| 1461 | + * 设置统一的公司名称 | ||
| 1462 | + * @param company | ||
| 1463 | + */ | ||
| 1464 | + private void setCompanyName(String company){ | ||
| 1465 | + if(company.equals("闵行公司")){ | ||
| 1466 | + company = "浦东闵行公交公司"; | ||
| 1467 | + }else if(company.equals("杨高公司")){ | ||
| 1468 | + company = "浦东杨高公交公司"; | ||
| 1469 | + }else if(company.equals("上南公司")){ | ||
| 1470 | + company = "浦东上南公交公司"; | ||
| 1471 | + }else if(company.equals("金高公司")){ | ||
| 1472 | + company = "浦东金高公交公司"; | ||
| 1473 | + }else if(company.equals("南汇公司")){ | ||
| 1474 | + company = "浦东南汇公交公司"; | ||
| 1475 | + }else if(company.equals("青浦公交")){ | ||
| 1476 | + company = "浦东青浦公交公司"; | ||
| 1477 | + }else if(company.equals("临港公交")){ | ||
| 1478 | + company = "临港公交公司"; | ||
| 1479 | + } | ||
| 1480 | + } | ||
| 1481 | + /** | ||
| 1482 | + * @param stationsList 站点路由集 | ||
| 1483 | + * @param sBuffer sBuffer | ||
| 1484 | + * @param startId 站点序号起始ID | ||
| 1485 | + * | ||
| 1486 | + * @return 站点序号累加后的ID | ||
| 1487 | + */ | ||
| 1488 | + private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId,Map<String, Integer> stationNumMap){ | ||
| 1489 | + int size = stationsList.size(); | ||
| 1490 | + StationRoute srRoute; | ||
| 1491 | + HashMap<String,String> paraMap; | ||
| 1492 | + String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站 | ||
| 1493 | + for (int i = 0; i < size; i++) { | ||
| 1494 | + srRoute = stationsList.get(i); | ||
| 1495 | + zdlx = srRoute.getStationMark(); | ||
| 1496 | + if(zdlx.equals("B")){ | ||
| 1497 | + zdlx = "0"; | ||
| 1498 | + }else if(zdlx.equals("E")){ | ||
| 1499 | + zdlx = "1"; | ||
| 1500 | + }else{ | ||
| 1501 | + zdlx = "2"; | ||
| 1502 | + } | ||
| 1503 | + paraMap = packageYgcStationNumParam(srRoute,null); | ||
| 1504 | + sBuffer.append("<Station>"); | ||
| 1505 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(paraMap,stationNumMap)).append("</ZDXH>"); | ||
| 1506 | + sBuffer.append("<SXX>").append(srRoute.getDirections()).append("</SXX>"); | ||
| 1507 | + sBuffer.append("<ZDMC>").append(srRoute.getStationName()).append("</ZDMC>"); | ||
| 1508 | + sBuffer.append("<ZDBM>").append(srRoute.getStationCode()).append("</ZDBM>"); | ||
| 1509 | + sBuffer.append("<ZDJD>").append(srRoute.getStation().getgLonx()).append("</ZDJD>"); | ||
| 1510 | + sBuffer.append("<ZDWD>").append(srRoute.getStation().getgLaty()).append("</ZDWD>"); | ||
| 1511 | + sBuffer.append("<ZZ>").append(srRoute.getStation().getAddr() == null ? "" : srRoute.getStation().getAddr()).append("</ZZ>"); | ||
| 1512 | + sBuffer.append("<ZDLX>").append(zdlx).append("</ZDLX>"); | ||
| 1513 | + sBuffer.append("<ZJLC>").append(srRoute.getDistances()).append("</ZJLC>"); | ||
| 1514 | + sBuffer.append("</Station>"); | ||
| 1515 | + startId++; | ||
| 1516 | + } | ||
| 1517 | + return startId; | ||
| 1518 | + } | ||
| 1519 | + | ||
| 1520 | + /** | ||
| 1521 | + * @param pointList 站点点位集 | ||
| 1522 | + * @param sBuffer sBuffer | ||
| 1523 | + * @param startId 站点序号起始ID | ||
| 1524 | + * | ||
| 1525 | + * @return 站点序号累加后的ID | ||
| 1526 | + */ | ||
| 1527 | + private int packagStationPointXml(List<Object[]> pointList,StringBuffer sBuffer,int startId){ | ||
| 1528 | + int size = pointList.size(); | ||
| 1529 | + Object[] objs; | ||
| 1530 | + String bsection,dir,section; | ||
| 1531 | + String[] sections ; | ||
| 1532 | + for (int i = 0; i < size; i++) { | ||
| 1533 | + objs = pointList.get(i); | ||
| 1534 | + bsection = objs[0]+""; | ||
| 1535 | + dir = objs[1]+""; | ||
| 1536 | + // 取括号内的内容 | ||
| 1537 | + Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))"); | ||
| 1538 | + Matcher matcher = pattern.matcher(bsection); | ||
| 1539 | + if(matcher.find()){ | ||
| 1540 | + sections = matcher.group().split(","); | ||
| 1541 | + for (int j = 0 ; j < sections.length ; j ++){ | ||
| 1542 | + section = sections[j]; | ||
| 1543 | + sBuffer.append("<LinePoint>"); | ||
| 1544 | + sBuffer.append("<ZDXH>").append(startId).append("</ZDXH>"); | ||
| 1545 | + sBuffer.append("<SXX>").append(dir).append("</SXX>"); | ||
| 1546 | + sBuffer.append("<ZDJD>").append(section.split(" ")[0]).append("</ZDJD>"); | ||
| 1547 | + sBuffer.append("<ZDWD>").append(section.split(" ")[1]).append("</ZDWD>"); | ||
| 1548 | + sBuffer.append("</LinePoint>"); | ||
| 1549 | + startId++; | ||
| 1550 | + } | ||
| 1551 | + } | ||
| 1552 | + } | ||
| 1553 | + return startId; | ||
| 1554 | + } | ||
| 1555 | + | ||
| 1556 | + /** | ||
| 1557 | + * 获取运管处站点序号 | ||
| 1558 | + * @param map | ||
| 1559 | + * @return 运管处站点序号 | ||
| 1560 | + */ | ||
| 1561 | + private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(HashMap<String,String> map,Map<String, Integer> stationNumMap){ | ||
| 1562 | + // 线路编码 | ||
| 1563 | + String lineCode = map.get("lineCode"); | ||
| 1564 | + // 线路走向 0:上行 1:下行 | ||
| 1565 | + String direction = map.get("direction"); | ||
| 1566 | + // 站点编码 | ||
| 1567 | + String stationCode = map.get("stationCode"); | ||
| 1568 | + // 站点类型:B:起点站 Z:中途站 E:终点站 T:停车场 | ||
| 1569 | + String stationMark = map.get("stationMark"); | ||
| 1570 | + String[] marks = null; | ||
| 1571 | + // 起点站,先从起点找,找不到再从中途站找,最后从终点找 | ||
| 1572 | + if(stationMark.equals("B")){ | ||
| 1573 | + marks= new String[]{"B","Z","E"}; | ||
| 1574 | + }else if(stationMark.equals("E")){// 终点站相反 | ||
| 1575 | + marks= new String[]{"E","Z","B"}; | ||
| 1576 | + }else if(stationMark.equals("Z")){ | ||
| 1577 | + marks= new String[]{"Z"}; | ||
| 1578 | + } | ||
| 1579 | + // 默认从缓存BasicData.stationName2YgcNumber | ||
| 1580 | + Map<String, Integer> tempMap = BasicData.stationName2YgcNumber; | ||
| 1581 | + // 如果传入的stationNumMap不为空,则不是缓存取,而从stationNumMap取 | ||
| 1582 | + if(stationNumMap != null){ | ||
| 1583 | + tempMap = stationNumMap; | ||
| 1584 | + } | ||
| 1585 | + Integer number = null; | ||
| 1586 | + for (int i = 0 ;i < marks.length ; i ++){ | ||
| 1587 | + number = tempMap.get(lineCode+"_"+direction+"_"+stationCode+"_"+marks[i]); | ||
| 1588 | + if(number != null){ | ||
| 1589 | + break; | ||
| 1590 | + } | ||
| 1591 | + } | ||
| 1592 | + return number == null ? 0 : number; | ||
| 1593 | + } | ||
| 1594 | + | ||
| 1595 | + /** | ||
| 1596 | + * 封装查询站序条件 | ||
| 1597 | + * @param obj | ||
| 1598 | + * @return | ||
| 1599 | + */ | ||
| 1600 | + private HashMap packageYgcStationNumParam(Object obj,HashMap<String,String> otherParam){ | ||
| 1601 | + HashMap<String,String> map = new HashMap<String,String>(); | ||
| 1602 | + String lineCode = "",direction = "",stationCode = "",stationMark = ""; | ||
| 1603 | + // 站点路由 | ||
| 1604 | + if(obj instanceof StationRoute){ | ||
| 1605 | + StationRoute sr = (StationRoute)obj; | ||
| 1606 | + lineCode = sr.getLineCode(); | ||
| 1607 | + direction = String.valueOf(sr.getDirections()); | ||
| 1608 | + stationCode = sr.getStationCode(); | ||
| 1609 | + stationMark = sr.getStationMark(); | ||
| 1610 | + }else if(obj instanceof ScheduleRealInfo){ //实际排班计划明细。 | ||
| 1611 | + ScheduleRealInfo sri = (ScheduleRealInfo)obj; | ||
| 1612 | + lineCode = sri.getXlBm(); | ||
| 1613 | + direction = sri.getXlDir(); | ||
| 1614 | + if(otherParam != null && otherParam.get("stationMark") != null){ | ||
| 1615 | + stationMark = otherParam.get("stationMark"); | ||
| 1616 | + if(stationMark.equals("B")){ // 起点站 | ||
| 1617 | + stationCode = sri.getQdzCode(); | ||
| 1618 | + }else if(stationMark.equals("E")){ // 终点站 | ||
| 1619 | + stationCode = sri.getZdzCode(); | ||
| 1620 | + } | ||
| 1621 | + } | ||
| 1622 | + }else if(obj instanceof SchedulePlanInfo){ //排班计划明细 | ||
| 1623 | + SchedulePlanInfo spi = (SchedulePlanInfo)obj; | ||
| 1624 | + lineCode = spi.getXlBm(); | ||
| 1625 | + direction = spi.getXlDir(); | ||
| 1626 | + if(otherParam != null && otherParam.get("stationMark") != null){ | ||
| 1627 | + stationMark = otherParam.get("stationMark"); | ||
| 1628 | + if(stationMark.equals("B")){ // 起点站 | ||
| 1629 | + stationCode = spi.getQdzCode(); | ||
| 1630 | + }else if(stationMark.equals("E")){ // 终点站 | ||
| 1631 | + stationCode = spi.getZdzCode(); | ||
| 1632 | + } | ||
| 1633 | + } | ||
| 1634 | + }else if(obj instanceof TTInfoDetail){ //时刻表明细 | ||
| 1635 | + TTInfoDetail ttid = (TTInfoDetail)obj; | ||
| 1636 | + lineCode = ttid.getXl().getLineCode(); | ||
| 1637 | + direction = ttid.getXlDir(); | ||
| 1638 | + if(otherParam != null && otherParam.get("stationMark") != null){ | ||
| 1639 | + stationMark = otherParam.get("stationMark"); | ||
| 1640 | + if(stationMark.equals("B")){ // 起点站 | ||
| 1641 | + stationCode = ttid.getQdzCode(); | ||
| 1642 | + }else if(stationMark.equals("E")){ // 终点站 | ||
| 1643 | + stationCode = ttid.getZdzCode(); | ||
| 1644 | + } | ||
| 1645 | + } | ||
| 1646 | + } | ||
| 1647 | + map.put("lineCode",lineCode);// 站点编码 | ||
| 1648 | + map.put("direction",direction); // 上下行 | ||
| 1649 | + map.put("stationCode",stationCode); // 站点编号 | ||
| 1650 | + map.put("stationMark",stationMark); // 站点类型 | ||
| 1651 | + return map; | ||
| 1652 | + } | ||
| 1653 | + | ||
| 1654 | + /** | ||
| 1655 | + * 取得历史站点编码和站点名称的对应关系 | ||
| 1656 | + * @return | ||
| 1657 | + */ | ||
| 1658 | + private Map<String, String> getLsStationCode(String lineCode,int lineVersion){ | ||
| 1659 | + Map<String,Object> map = new HashMap<>(); | ||
| 1660 | + map.put("lineCode_eq", lineCode); | ||
| 1661 | + map.put("versions_eq",lineVersion); | ||
| 1662 | + LsStationRoute lsroute; | ||
| 1663 | + Iterator<LsStationRoute> iterator = lsStationRouteRepository.findAll(new CustomerSpecs<LsStationRoute>(map)).iterator(); | ||
| 1664 | + Map<String, String> stationCode2Name = new HashMap<>(); | ||
| 1665 | + while (iterator.hasNext()) { | ||
| 1666 | + lsroute = iterator.next(); | ||
| 1667 | + stationCode2Name.put(lsroute.getLineCode() + "_" + lsroute.getDirections() + "_" + lsroute.getStationCode(), lsroute.getStationName()); | ||
| 1668 | + } | ||
| 1669 | + return stationCode2Name; | ||
| 1670 | + } | ||
| 1671 | + | ||
| 1672 | + private Map<String, Integer> getLsStationRoute(String xlbm,int lineVersion){ | ||
| 1673 | + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | ||
| 1674 | + /** | ||
| 1675 | + * 加载运管处的站点及序号 | ||
| 1676 | + * 上行从1开始,下行顺序续编 | ||
| 1677 | + */ | ||
| 1678 | + List<Map<String, String>> ygcLines = lsStationRouteRepository.findLineWithLineCode4Ygc(xlbm,lineVersion); | ||
| 1679 | + if(ygcLines != null && ygcLines.size() > 0){ | ||
| 1680 | + int size = ygcLines.size(); | ||
| 1681 | + Map<String, String> tempMap ; | ||
| 1682 | + int num = 1; | ||
| 1683 | + String key; | ||
| 1684 | + String lineCode = ""; | ||
| 1685 | + for (int i = 0; i < size; i ++){ | ||
| 1686 | + tempMap = ygcLines.get(i); | ||
| 1687 | + if(lineCode.equals("")){ | ||
| 1688 | + lineCode = tempMap.get("lineCode"); | ||
| 1689 | + }else if(!lineCode.equals(tempMap.get("lineCode"))){ | ||
| 1690 | + num = 1; | ||
| 1691 | + lineCode = tempMap.get("lineCode"); | ||
| 1692 | + } | ||
| 1693 | + key = tempMap.get("lineCode") + "_"+String.valueOf(tempMap.get("directions")) | ||
| 1694 | + + "_"+tempMap.get("stationCode")+ "_"+tempMap.get("stationMark"); | ||
| 1695 | + tempStationName2YgcNumber.put(key,num++); | ||
| 1696 | + } | ||
| 1697 | + } | ||
| 1698 | + return tempStationName2YgcNumber; | ||
| 1699 | + } | ||
| 1700 | + | ||
| 1701 | + private String getSetXlXml(Line line,LineInformation lineInformation){ | ||
| 1702 | + StringBuffer sBuffer = new StringBuffer(); | ||
| 1703 | + List<StationRoute> upStationsList ;// 上行站点路由集 | ||
| 1704 | + List<StationRoute> downStationsList;// 下行站点路由集 | ||
| 1705 | + List<Object[]> downPointList;// 下行站点集 | ||
| 1706 | + List<Object[]> upPointList;// 上行站点集 | ||
| 1707 | + sBuffer.append("<XLs>"); | ||
| 1708 | + sBuffer.append("<XL>"); | ||
| 1709 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>"); | ||
| 1710 | + sBuffer.append("<XLMC>").append(line.getName()).append("</XLMC>"); | ||
| 1711 | + sBuffer.append("<QDZ>").append(line.getStartStationName()).append("</QDZ>"); | ||
| 1712 | + sBuffer.append("<ZDZ>").append(line.getEndStationName()).append("</ZDZ>"); | ||
| 1713 | + sBuffer.append("<QZLC>").append(lineInformation.getUpMileage()).append("</QZLC>"); | ||
| 1714 | + sBuffer.append("<ZQLC>").append(lineInformation.getDownMileage()).append("</ZQLC>"); | ||
| 1715 | + sBuffer.append("<XLGH>").append(line.getLinePlayType()).append("</XLGH>"); | ||
| 1716 | + sBuffer.append("<UPDATE_DATE>").append(sdfnyr.format(new Date())).append("</UPDATE_DATE>"); | ||
| 1717 | + // 循环添加站点信息 | ||
| 1718 | + sBuffer.append("<StationList>"); | ||
| 1719 | + // 先查上行 | ||
| 1720 | + upStationsList = stationRouteRepository.findByLine(line.getLineCode(), 0); | ||
| 1721 | + Map<String, Integer> stationNumMap = getStationName2YgcNumberMap(line.getLineCode()); | ||
| 1722 | + int startId = 1; | ||
| 1723 | + startId = packagStationXml(upStationsList, sBuffer, startId,stationNumMap); | ||
| 1724 | + // 环线不查下行 | ||
| 1725 | + if(line.getLinePlayType() != 1){ | ||
| 1726 | + // 再查下行 | ||
| 1727 | + downStationsList = stationRouteRepository.findByLine(line.getLineCode(), 1); | ||
| 1728 | + packagStationXml(downStationsList, sBuffer, startId,stationNumMap); | ||
| 1729 | + } | ||
| 1730 | + sBuffer.append("</StationList>"); | ||
| 1731 | + // 循环添加站点点位信息 | ||
| 1732 | + sBuffer.append("<LinePointList>"); | ||
| 1733 | + upPointList = sectionRepository.getSectionDirByLineId(line.getId(),0); | ||
| 1734 | + startId = 1; | ||
| 1735 | + startId = packagStationPointXml(upPointList, sBuffer, startId); | ||
| 1736 | + // 环线不查下行 | ||
| 1737 | + if(line.getLinePlayType() != 1){ | ||
| 1738 | + downPointList = sectionRepository.getSectionDirByLineId(line.getId(),1); | ||
| 1739 | + packagStationPointXml(downPointList, sBuffer, startId); | ||
| 1740 | + } | ||
| 1741 | + sBuffer.append("</LinePointList>"); | ||
| 1742 | + sBuffer.append("</XL>"); | ||
| 1743 | + sBuffer.append("</XLs>"); | ||
| 1744 | + return sBuffer.toString(); | ||
| 1745 | + } | ||
| 1746 | +} |
src/main/java/com/bsth/util/db/DBUtils_control.java deleted
100644 → 0
| 1 | -package com.bsth.util.db; | ||
| 2 | - | ||
| 3 | -import com.mchange.v2.c3p0.DataSources; | ||
| 4 | -import org.apache.log4j.Logger; | ||
| 5 | - | ||
| 6 | -import javax.sql.DataSource; | ||
| 7 | -import java.io.FileNotFoundException; | ||
| 8 | -import java.io.IOException; | ||
| 9 | -import java.sql.*; | ||
| 10 | -import java.util.HashMap; | ||
| 11 | -import java.util.Map; | ||
| 12 | -import java.util.Properties; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * 站点行业编码库库连接池 | ||
| 16 | - * @author YouRuiFeng | ||
| 17 | - * | ||
| 18 | - */ | ||
| 19 | -//@Component | ||
| 20 | -public class DBUtils_control { | ||
| 21 | - | ||
| 22 | - private static String url = null; | ||
| 23 | - | ||
| 24 | - private static String username = null; | ||
| 25 | - | ||
| 26 | - private static String pwd = null; | ||
| 27 | - | ||
| 28 | - private static DataSource ds_pooled; | ||
| 29 | - | ||
| 30 | - static Logger logger = Logger.getLogger(DBUtils_control.class); | ||
| 31 | - | ||
| 32 | - static { | ||
| 33 | - Properties env = new Properties(); | ||
| 34 | - | ||
| 35 | - try { | ||
| 36 | - env.load(DBUtils_control.class.getClassLoader().getResourceAsStream("control-jdbc.properties")); | ||
| 37 | - // 1. 加载驱动类 | ||
| 38 | - Class.forName(env.getProperty("station.mysql.driver")); | ||
| 39 | - | ||
| 40 | - url = env.getProperty("station.mysql.url"); | ||
| 41 | - username = env.getProperty("station.mysql.username"); | ||
| 42 | - pwd = env.getProperty("station.mysql.password"); | ||
| 43 | - | ||
| 44 | - // 设置连接数据库的配置信息 | ||
| 45 | - DataSource ds_unpooled = DataSources.unpooledDataSource(url, | ||
| 46 | - username, pwd); | ||
| 47 | - | ||
| 48 | - Map<String, Object> pool_conf = new HashMap<String, Object>(); | ||
| 49 | - // 设置最大连接数 | ||
| 50 | - pool_conf.put("maxPoolSize", 10); | ||
| 51 | - | ||
| 52 | - pool_conf.put("testConnectionOnCheckout", false); | ||
| 53 | - //异步检测连接的有效性 | ||
| 54 | - pool_conf.put("testConnectionOnCheckin", true); | ||
| 55 | - //30秒检测一次 | ||
| 56 | - pool_conf.put("idleConnectionTestPeriod", 30); | ||
| 57 | - ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf); | ||
| 58 | - } catch (FileNotFoundException e) { | ||
| 59 | - logger.error(e.toString()); | ||
| 60 | - e.printStackTrace(); | ||
| 61 | - } catch (IOException e) { | ||
| 62 | - logger.error(e.toString()); | ||
| 63 | - e.printStackTrace(); | ||
| 64 | - } catch (ClassNotFoundException e) { | ||
| 65 | - logger.error(e.toString()); | ||
| 66 | - e.printStackTrace(); | ||
| 67 | - } catch (SQLException e) { | ||
| 68 | - logger.error(e.toString()); | ||
| 69 | - e.printStackTrace(); | ||
| 70 | - } | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - /** | ||
| 74 | - * 获取连接对象 | ||
| 75 | - */ | ||
| 76 | - public static Connection getConnection() throws SQLException { | ||
| 77 | - return ds_pooled.getConnection(); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - /** | ||
| 81 | - * 释放连接池资源 | ||
| 82 | - */ | ||
| 83 | - public static void clearup() { | ||
| 84 | - if (ds_pooled != null) { | ||
| 85 | - try { | ||
| 86 | - DataSources.destroy(ds_pooled); | ||
| 87 | - } catch (SQLException e) { | ||
| 88 | - logger.error(e.toString()); | ||
| 89 | - e.printStackTrace(); | ||
| 90 | - } | ||
| 91 | - } | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - /** | ||
| 95 | - * 资源关闭 | ||
| 96 | - * | ||
| 97 | - * @param rs | ||
| 98 | - * @param stmt | ||
| 99 | - * @param conn | ||
| 100 | - */ | ||
| 101 | - public static void close(ResultSet rs, Statement stmt, Connection conn) { | ||
| 102 | - if (rs != null) { | ||
| 103 | - try { | ||
| 104 | - rs.close(); | ||
| 105 | - } catch (SQLException e) { | ||
| 106 | - logger.error(e.toString()); | ||
| 107 | - e.printStackTrace(); | ||
| 108 | - } | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | - if (stmt != null) { | ||
| 112 | - try { | ||
| 113 | - stmt.close(); | ||
| 114 | - } catch (SQLException e) { | ||
| 115 | - logger.error(e.toString()); | ||
| 116 | - e.printStackTrace(); | ||
| 117 | - } | ||
| 118 | - } | ||
| 119 | - | ||
| 120 | - if (conn != null) { | ||
| 121 | - try { | ||
| 122 | - conn.close(); | ||
| 123 | - } catch (SQLException e) { | ||
| 124 | - logger.error(e.toString()); | ||
| 125 | - e.printStackTrace(); | ||
| 126 | - } | ||
| 127 | - } | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - public static DataSource getDataSource(){ | ||
| 131 | - return ds_pooled; | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - | ||
| 135 | - public static void main(String[] args) { | ||
| 136 | - Connection conn = null; | ||
| 137 | - PreparedStatement ps = null; | ||
| 138 | - ResultSet rs = null; | ||
| 139 | - | ||
| 140 | - /*List<StationMatchData> listMD = new ArrayList<>(); | ||
| 141 | - String sql = "select * from roadlinestop ORDER BY RoteLine,LineStandardCode,UpStream,LevelId"; | ||
| 142 | - try{ | ||
| 143 | - conn = DBUtils_station.getConnection(); | ||
| 144 | - ps = conn.prepareStatement(sql); | ||
| 145 | - rs = ps.executeQuery(); | ||
| 146 | - while(rs.next()){ | ||
| 147 | - StationMatchData arr = new StationMatchData(); | ||
| 148 | - arr.setRoadLine(rs.getString("RoadLine")); | ||
| 149 | - arr.setLineStandardCode(rs.getString("LineStandardCode")); | ||
| 150 | - arr.setStationName(rs.getString("StationName")); | ||
| 151 | - arr.setStationStandardCode(rs.getString("StationStandardCode")); | ||
| 152 | - arr.setUpStream(Integer.parseInt(rs.getString("UpStream"))); | ||
| 153 | - arr.setLevelId(rs.getString("LevelId")); | ||
| 154 | - arr.setStationType(rs.getString("StationType")); | ||
| 155 | - | ||
| 156 | - listMD.add(arr); | ||
| 157 | - } | ||
| 158 | - Map<String, Map<String, List<StationMatchData>>> mapsMD = new HashMap<>(); | ||
| 159 | - for (StationMatchData s:listMD) { | ||
| 160 | - String key = s.getRoadLine()+"_"+s.getLineStandardCode(); | ||
| 161 | - int dir = s.getUpStream(); | ||
| 162 | - if(mapsMD.containsKey(key)){ | ||
| 163 | - Map<String, List<StationMatchData>> map = mapsMD.get(key); | ||
| 164 | - if(mapsMD.containsKey(dir)){ | ||
| 165 | - List<StationMatchData> lists = map.get(dir); | ||
| 166 | - lists.add(s); | ||
| 167 | - } else { | ||
| 168 | - List<StationMatchData> lists = new ArrayList<>(); | ||
| 169 | - lists.add(s); | ||
| 170 | - map.put(dir+"",lists); | ||
| 171 | - } | ||
| 172 | - } else { | ||
| 173 | - Map<String, List<StationMatchData>> map = new HashMap<>(); | ||
| 174 | - List<StationMatchData> lists = new ArrayList<>(); | ||
| 175 | - lists.add(s); | ||
| 176 | - map.put(dir+"",lists); | ||
| 177 | - mapsMD.put(key,map); | ||
| 178 | - } | ||
| 179 | - } | ||
| 180 | - System.out.println(mapsMD); | ||
| 181 | - }catch(Exception e){ | ||
| 182 | - logger.error("", e); | ||
| 183 | - }finally { | ||
| 184 | - DBUtils_station.close(rs, ps, conn); | ||
| 185 | - }*/ | ||
| 186 | - } | ||
| 187 | -} |
src/main/resources/application-prod.properties
| @@ -13,9 +13,9 @@ spring.jpa.show-sql= true | @@ -13,9 +13,9 @@ spring.jpa.show-sql= true | ||
| 13 | 13 | ||
| 14 | #DATABASE | 14 | #DATABASE |
| 15 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 15 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 16 | -spring.datasource.url= jdbc:mysql://10.10.200.121:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai | 16 | +spring.datasource.url= jdbc:mysql://10.10.150.103:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai |
| 17 | spring.datasource.username= root | 17 | spring.datasource.username= root |
| 18 | -spring.datasource.password= root2jsp | 18 | +spring.datasource.password= Aa123456 |
| 19 | spring.datasource.type= com.zaxxer.hikari.HikariDataSource | 19 | spring.datasource.type= com.zaxxer.hikari.HikariDataSource |
| 20 | 20 | ||
| 21 | #DATASOURCE SETTING | 21 | #DATASOURCE SETTING |
| @@ -33,11 +33,11 @@ spring.datasource.hikari.register-mbeans=true | @@ -33,11 +33,11 @@ spring.datasource.hikari.register-mbeans=true | ||
| 33 | ## gps client data | 33 | ## gps client data |
| 34 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | 34 | http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all |
| 35 | ## gateway real data | 35 | ## gateway real data |
| 36 | -http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/ | 36 | +http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ |
| 37 | ## gateway send directive | 37 | ## gateway send directive |
| 38 | -http.send.directive= http://10.10.200.79:8080/transport_server/message/ | 38 | +http.send.directive= http://10.10.150.103:8080/transport_server/message/ |
| 39 | ## rfid data | 39 | ## rfid data |
| 40 | -http.rfid.url= http://10.10.200.82:9000/rfid | 40 | +http.rfid.url= http://114.80.178.12:29000/rfid |
| 41 | ## wxsb | 41 | ## wxsb |
| 42 | #http.report.url.05= http://192.168.168.154:8088/ygjwsystem_j2ee/clbx/clbx_dd.do | 42 | #http.report.url.05= http://192.168.168.154:8088/ygjwsystem_j2ee/clbx/clbx_dd.do |
| 43 | #http.report.url.22= http://192.168.168.154:8088/jgjwsystem_j2ee/clbx/clbx_dd.do | 43 | #http.report.url.22= http://192.168.168.154:8088/jgjwsystem_j2ee/clbx/clbx_dd.do |
src/main/resources/control-jdbc.properties deleted
100644 → 0
| 1 | -station.mysql.driver= com.mysql.jdbc.Driver | ||
| 2 | -station.mysql.url= jdbc:mysql://10.10.200.121:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | ||
| 3 | -station.mysql.username= root | ||
| 4 | -station.mysql.password= root2jsp | ||
| 5 | - | ||
| 6 | -#station.mysql.driver= com.mysql.jdbc.Driver | ||
| 7 | -#station.mysql.url= jdbc:mysql://10.10.200.121:3306/station?useUnicode=true&characterEncoding=utf-8 | ||
| 8 | -#station.mysql.username= station | ||
| 9 | -#station.mysql.password= station@jsp | ||
| 10 | - | ||
| 11 | -#station.mysql.driver= com.mysql.jdbc.Driver | ||
| 12 | -#station.mysql.url= jdbc:mysql://10.10.200.148:3306/station?useUnicode=true&characterEncoding=utf-8 | ||
| 13 | -#station.mysql.username= station | ||
| 14 | -#station.mysql.password= station@jsp |
src/main/resources/datatools/config-prod.properties
| @@ -5,11 +5,11 @@ datatools.kettle_properties=/datatools/kettle.properties | @@ -5,11 +5,11 @@ datatools.kettle_properties=/datatools/kettle.properties | ||
| 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) | 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) |
| 6 | 6 | ||
| 7 | #数据库ip地址 | 7 | #数据库ip地址 |
| 8 | -datatools.kvars_dbip=10.10.200.121 | 8 | +datatools.kvars_dbip=10.10.150.103 |
| 9 | #数据库用户名 | 9 | #数据库用户名 |
| 10 | datatools.kvars_dbuname=root | 10 | datatools.kvars_dbuname=root |
| 11 | #数据库密码 | 11 | #数据库密码 |
| 12 | -datatools.kvars_dbpwd=root2jsp | 12 | +datatools.kvars_dbpwd=Aa123456 |
| 13 | #数据库库名 | 13 | #数据库库名 |
| 14 | datatools.kvars_dbdname=control | 14 | datatools.kvars_dbdname=control |
| 15 | 15 |
src/main/resources/logback.xml
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <configuration> | 3 | <configuration> |
| 4 | 4 | ||
| 5 | <!-- <property resource="application.properties" /> --> | 5 | <!-- <property resource="application.properties" /> --> |
| 6 | - <property name="LOG_BASE" value="E:/bsth_control_logs" /> | 6 | + <property name="LOG_BASE" value="/home/control/bsth_control_logs" /> |
| 7 | <!-- 控制台输出 --> | 7 | <!-- 控制台输出 --> |
| 8 | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | 8 | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| 9 | 9 |
src/main/resources/ms-jdbc.properties
| @@ -4,6 +4,6 @@ | @@ -4,6 +4,6 @@ | ||
| 4 | #ms.mysql.password= 123456 | 4 | #ms.mysql.password= 123456 |
| 5 | 5 | ||
| 6 | ms.mysql.driver= com.mysql.jdbc.Driver | 6 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | -ms.mysql.url= jdbc:mysql://10.10.150.122:3306/ms?useUnicode=true&characterEncoding=utf-8 | 7 | +ms.mysql.url= jdbc:mysql://10.10.150.103/ms?useUnicode=true&characterEncoding=utf-8 |
| 8 | ms.mysql.username= root | 8 | ms.mysql.username= root |
| 9 | -ms.mysql.password= root2jsp | ||
| 10 | \ No newline at end of file | 9 | \ No newline at end of file |
| 10 | +ms.mysql.password= Aa123456 | ||
| 11 | \ No newline at end of file | 11 | \ No newline at end of file |
src/main/resources/static/index.html
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html lang="zh"> | ||
| 3 | -<head> | ||
| 4 | - <meta name="renderer" content="webkit" /> | ||
| 5 | - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | - <meta charset="UTF-8"> | ||
| 7 | - <title>调度系统</title> | ||
| 8 | - | ||
| 9 | - <meta http-equiv="Pragma" content="no-cache"> | ||
| 10 | - <meta http-equiv="Cache-control" content="no-cache"> | ||
| 11 | - <meta http-equiv="Cache" content="no-cache"> | ||
| 12 | - | ||
| 13 | - <!-- Font Awesome 图标字体 --> | ||
| 14 | - <link | ||
| 15 | - href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | ||
| 16 | - rel="stylesheet" type="text/css" /> | ||
| 17 | - <!-- Bootstrap style --> | ||
| 18 | - <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | ||
| 19 | - rel="stylesheet" type="text/css" /> | ||
| 20 | - <!-- jsTree 数插件 --> | ||
| 21 | - <link | ||
| 22 | - href="/metronic_v4.5.4/plugins/jstree/dist/themes/default/style.min.css" | ||
| 23 | - rel="stylesheet" type="text/css" /> | ||
| 24 | - <!-- MULTI-select 多选下拉框美化 --> | ||
| 25 | - <link | ||
| 26 | - href="/metronic_v4.5.4/plugins/jquery-multi-select/css/multi-select.css" | ||
| 27 | - rel="stylesheet" type="text/css" /> | ||
| 28 | - | ||
| 29 | - <!-- editable --> | ||
| 30 | - <link | ||
| 31 | - href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" | ||
| 32 | - rel="stylesheet" type="text/css" /> | ||
| 33 | - <!-- METRONIC style --> | ||
| 34 | - <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" | ||
| 35 | - rel="stylesheet" type="text/css" id="style_color" /> | ||
| 36 | - <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | ||
| 37 | - type="text/css" /> | ||
| 38 | - <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" | ||
| 39 | - type="text/css" /> | ||
| 40 | - <link href="/metronic_v4.5.4/layout4/css/layout.min.css" | ||
| 41 | - rel="stylesheet" type="text/css" /> | ||
| 42 | - <link href="/metronic_v4.5.4/layout4/css/custom.min.css" | ||
| 43 | - rel="stylesheet" type="text/css" /> | ||
| 44 | - <!-- select2 下拉框插件 --> | ||
| 45 | - <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | ||
| 46 | - rel="stylesheet" type="text/css" /> | ||
| 47 | - <link | ||
| 48 | - href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | ||
| 49 | - rel="stylesheet" type="text/css" /> | ||
| 50 | - <!-- layer 弹层 插件 --> | ||
| 51 | - <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | ||
| 52 | - rel="stylesheet" type="text/css" /> | ||
| 53 | - <!-- fileinput 上传 插件 --> | ||
| 54 | - <link href="/assets/plugins/fileinput/css/fileinput.min.css" | ||
| 55 | - rel="stylesheet" type="text/css" /> | ||
| 56 | - <!-- iCheck 单选框和复选框 --> | ||
| 57 | - <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" | ||
| 58 | - rel="stylesheet" type="text/css" /> | ||
| 59 | - <!-- 日期控件 --> | ||
| 60 | - <link | ||
| 61 | - href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | ||
| 62 | - rel="stylesheet" type="text/css" /> | ||
| 63 | - <!-- table 表格控件 --> | ||
| 64 | - <!--<link rel="stylesheet"--> | ||
| 65 | - <!--href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"--> | ||
| 66 | - <!--type="text/css" />--> | ||
| 67 | - <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> | ||
| 68 | - <!-- handsontable样式 --> | ||
| 69 | - <link rel="stylesheet" | ||
| 70 | - href="/assets/bower_components/handsontable/dist/handsontable.full.css" /> | ||
| 71 | - <!-- sweetalert样式 --> | ||
| 72 | - <link rel="stylesheet" | ||
| 73 | - href="/assets/bower_components/sweetalert/dist/sweetalert.css" /> | ||
| 74 | - <!-- schedule计划调度AngularJS模块主css --> | ||
| 75 | - <link rel="stylesheet" href="/pages/scheduleApp/module/common/main.css" | ||
| 76 | - type="text/css" /> | ||
| 77 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 78 | - | ||
| 79 | - <!-- CSS动画 --> | ||
| 80 | - <link | ||
| 81 | - href="/metronic_v4.5.4/plugins/tipso/css/animate.css" | ||
| 82 | - rel="stylesheet" type="text/css" /> | ||
| 83 | - | ||
| 84 | - <!-- 提示工具样式 --> | ||
| 85 | - <link | ||
| 86 | - href="/metronic_v4.5.4/plugins/tipso/css/tipso.css" | ||
| 87 | - rel="stylesheet" type="text/css" /> | ||
| 88 | - | ||
| 89 | - <style type="text/css"> | ||
| 90 | - .searchForm { | ||
| 91 | - | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - .searchForm .form-group .control-label { | ||
| 95 | - padding-right: 0px; | ||
| 96 | - text-align: right; | ||
| 97 | - margin-top: 7px; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - .searchForm .form-group>div { | ||
| 101 | - padding-left: 10px; | ||
| 102 | - padding-right: 0px; | ||
| 103 | - } | ||
| 104 | - | ||
| 105 | - .searchForm .row>div { | ||
| 106 | - padding-left: 0px; | ||
| 107 | - padding-right: 0px; | ||
| 108 | - padding: 5px 0 5px 0; | ||
| 109 | - width: 270px; | ||
| 110 | - display: inline-block; | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - .searchForm .form-actions { | ||
| 114 | - | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - tr.row-active td { | ||
| 118 | - border-bottom: 1px solid blue !important; | ||
| 119 | - color: blue; | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 123 | - { | ||
| 124 | - font-size: 14px; | ||
| 125 | - } | ||
| 126 | - | ||
| 127 | - .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 128 | - { | ||
| 129 | - padding: 6px 26px; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - .ms-container .ms-list { | ||
| 133 | - height: 306px; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - .ms-container .ms-selectable,.ms-container .ms-selection { | ||
| 137 | - width: 47%; | ||
| 138 | - } | ||
| 139 | - | ||
| 140 | - .ms-container { | ||
| 141 | - width: 470px; | ||
| 142 | - margin: auto; | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - .multi-custom-header-left { | ||
| 146 | - text-align: center; | ||
| 147 | - padding: 7px; | ||
| 148 | - color: #3B3F51; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - .multi-custom-header-right { | ||
| 152 | - text-align: center; | ||
| 153 | - padding: 7px; | ||
| 154 | - font-weight: bold; | ||
| 155 | - color: #36C6D3; | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | - .mt-element-list .list-simple.mt-list-container ul>.mt-list-item>.list-item-content | ||
| 159 | - { | ||
| 160 | - padding: 0 55px 0 0px; | ||
| 161 | - } | ||
| 162 | - | ||
| 163 | - .mt-element-list .list-simple.mt-list-container ul>.mt-list-item { | ||
| 164 | - padding: 3.3px 0; | ||
| 165 | - } | ||
| 166 | - | ||
| 167 | - #route-container { | ||
| 168 | - display: none; | ||
| 169 | - } | ||
| 170 | - | ||
| 171 | - .page-content.active { | ||
| 172 | - display: block !important; | ||
| 173 | - } | ||
| 174 | - | ||
| 175 | - .page-header.navbar .page-logo .logo-default { | ||
| 176 | - margin: 0; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle | ||
| 180 | - { | ||
| 181 | - background-color: #284a99; | ||
| 182 | - } | ||
| 183 | - | ||
| 184 | - .page-header.navbar .page-logo { | ||
| 185 | - padding-right: 10px; | ||
| 186 | - } | ||
| 187 | - | ||
| 188 | - .page-logo .logo-default.logo-default-text { | ||
| 189 | - font-weight: 600; | ||
| 190 | - color: white !important; | ||
| 191 | - margin-top: 19px !important; | ||
| 192 | - font-size: 24px; | ||
| 193 | - text-decoration: none; | ||
| 194 | - } | ||
| 195 | - | ||
| 196 | - .page-logo .logo-default.logo-default-text:HOVER { | ||
| 197 | - color: #dedede !important; | ||
| 198 | - } | ||
| 199 | - | ||
| 200 | - body,.page-content-wrapper,#pjax-container{ | ||
| 201 | - height: 100%; | ||
| 202 | - } | ||
| 203 | - html{ | ||
| 204 | - height: 90%; | ||
| 205 | - } | ||
| 206 | - .page-container{ | ||
| 207 | - height: 100%; | ||
| 208 | - } | ||
| 209 | - </style> | ||
| 210 | - | ||
| 211 | - <!-- ocLazyLoading载入文件的位置 --> | ||
| 212 | - <link id="ng_load_plugins_before" /> | ||
| 213 | - | ||
| 214 | -</head> | ||
| 215 | -<body | ||
| 216 | - class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed"> | ||
| 217 | -<div class="page-header navbar navbar-fixed-top" | ||
| 218 | - style="background: linear-gradient(to bottom, #124e78, #125688);"> | ||
| 219 | - <div class="page-header-inner "> | ||
| 220 | - <!-- LOGO --> | ||
| 221 | - <div class="page-logo"> | ||
| 222 | - <a href="index.html" class="logo-default logo-default-text"> | ||
| 223 | - 浦东公交调度系统 </a> | ||
| 224 | - <div class="menu-toggler sidebar-toggler"></div> | ||
| 225 | - </div> | ||
| 226 | - <!-- END LOGO --> | ||
| 227 | - <a href="javascript:;" class="menu-toggler responsive-toggler" | ||
| 228 | - data-toggle="collapse" data-target=".navbar-collapse"> </a> | ||
| 229 | - <div class="page-top"> | ||
| 230 | - <div class="top-menu"> | ||
| 231 | - <ul class="nav navbar-nav pull-right"> | ||
| 232 | - <!-- 信息通知区 --> | ||
| 233 | - <li | ||
| 234 | - class="dropdown dropdown-extended dropdown-notification dropdown-dark" | ||
| 235 | - id="header_notification_bar"><a href="javascript:;" | ||
| 236 | - class="dropdown-toggle" data-toggle="dropdown" | ||
| 237 | - data-hover="dropdown" data-close-others="true"> <i | ||
| 238 | - class="fa fa-bell"></i> <span class="badge badge-success"> | ||
| 239 | - 0 </span> | ||
| 240 | - </a> | ||
| 241 | - <ul class="dropdown-menu" style="max-width: 345px; width: 345px;"> | ||
| 242 | - <li class="external"> | ||
| 243 | - <h3> | ||
| 244 | - 今日 <span class="bold">0 条</span> 通知 | ||
| 245 | - </h3> <a href="javascript:;">查看全部</a> | ||
| 246 | - </li> | ||
| 247 | - <li> | ||
| 248 | - <ul class="dropdown-menu-list scroller" style="height: 250px;" | ||
| 249 | - data-handle-color="#637283"> | ||
| 250 | - </ul> | ||
| 251 | - </li> | ||
| 252 | - </ul></li> | ||
| 253 | - <li class="dropdown dropdown-user dropdown-dark"><a | ||
| 254 | - href="javascript:;" class="dropdown-toggle" | ||
| 255 | - data-toggle="dropdown" data-hover="dropdown" | ||
| 256 | - data-close-others="true"> <span id="indexTopUName" | ||
| 257 | - class="username username-hide-on-mobile" | ||
| 258 | - style="vertical-align: middle;"> <i class="fa fa-user"></i></span> | ||
| 259 | - </a> | ||
| 260 | - <ul class="dropdown-menu dropdown-menu-default"> | ||
| 261 | - <li><a href="javascript:;"> <i class="fa fa-user"></i> | ||
| 262 | - 我的信息 | ||
| 263 | - </a></li> | ||
| 264 | - <li><a href="javascript:;" id="changePWD"> <i | ||
| 265 | - class="fa fa-unlock-alt"></i> 修改密码 | ||
| 266 | - </a></li> | ||
| 267 | - <li class="divider"></li> | ||
| 268 | - <li><a href="javascript:;"> <i class="fa fa-lock"></i> | ||
| 269 | - 锁屏 | ||
| 270 | - </a></li> | ||
| 271 | - <li><a href="/logout"> <i class="fa fa-key"></i> 注销登陆 | ||
| 272 | - </a></li> | ||
| 273 | - </ul></li> | ||
| 274 | - </ul> | ||
| 275 | - </div> | ||
| 276 | - </div> | ||
| 277 | - </div> | ||
| 278 | -</div> | ||
| 279 | -<div class="page-container"> | ||
| 280 | - <div class="page-sidebar-wrapper"> | ||
| 281 | - <div class="page-sidebar navbar-collapse collapse"> | ||
| 282 | - <ul class="page-sidebar-menu page-sidebar-menu-fixed" | ||
| 283 | - data-keep-expanded="false" data-auto-scroll="true" | ||
| 284 | - data-slide-speed="200" id="leftMenuSidebar"> | ||
| 285 | - </ul> | ||
| 286 | - </div> | ||
| 287 | - </div> | ||
| 288 | - <div class="page-content-wrapper"> | ||
| 289 | - <div id="pjax-container" class="page-content"></div> | ||
| 290 | - | ||
| 291 | - <div id="route-container"> | ||
| 292 | - <div ng-app="ScheduleApp"> | ||
| 293 | - <div ng-controller="ScheduleAppController"> | ||
| 294 | - | ||
| 295 | - <!-- loading widget --> | ||
| 296 | - <div id="loadingWidget" class="flyover mask" loading-widget> | ||
| 297 | - <div class="alert alert-info"> | ||
| 298 | - <strong>载入中......</strong> | ||
| 299 | - </div> | ||
| 300 | - </div> | ||
| 301 | - | ||
| 302 | - <div ui-view class="uv"></div> | ||
| 303 | - </div> | ||
| 304 | - </div> | ||
| 305 | - </div> | ||
| 306 | - </div> | ||
| 307 | -</div> | ||
| 308 | - | ||
| 309 | -<script id="menu_list_temp" type="text/html"> | ||
| 310 | - {{each list as group i}} | ||
| 311 | - <li class="heading"> | ||
| 312 | - <h3 class="uppercase">{{group.name}}</h3> | ||
| 313 | - </li> | ||
| 314 | - {{each group.children as dir j}} | ||
| 315 | - <li class="nav-item"> | ||
| 316 | - <a href="javascript:;" class="nav-link nav-toggle "> | ||
| 317 | - <i class="{{dir.icon}}"></i> | ||
| 318 | - <span class="title">{{dir.name}}</span> | ||
| 319 | - <span class="arrow"></span> | ||
| 320 | - </a> | ||
| 321 | - <ul class="sub-menu"> | ||
| 322 | - {{each dir.children as module s}} | ||
| 323 | - <li class="nav-item "> | ||
| 324 | - {{if module.container=="pjax-container"}} | ||
| 325 | - <a href="/pages/{{module.path}}" class="nav-link " data-pjax> | ||
| 326 | - <span class="title">{{module.name}}</span> | ||
| 327 | - </a> | ||
| 328 | - {{else}} | ||
| 329 | - <a href="{{module.path}}" class="nav-link " data-angularjs> | ||
| 330 | - <span class="title">{{module.name}}</span> | ||
| 331 | - </a> | ||
| 332 | - {{/if}} | ||
| 333 | - </li> | ||
| 334 | - {{/each}} | ||
| 335 | - </ul> | ||
| 336 | - </li> | ||
| 337 | - {{/each}} | ||
| 338 | - {{/each}} | ||
| 339 | - | ||
| 340 | -</script> | ||
| 341 | -<script> | ||
| 342 | - delete window.require; | ||
| 343 | - delete window.exports; | ||
| 344 | - delete window.module; | ||
| 345 | -</script> | ||
| 346 | -<!-- jQuery --> | ||
| 347 | -<script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script> | ||
| 348 | -<!-- bootstrap --> | ||
| 349 | -<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" | ||
| 350 | - data-exclude=1></script> | ||
| 351 | -<script src="/pages/forms/statement/js/jquery.autocompleter.js"></script> | ||
| 352 | -<script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | ||
| 353 | -<!-- MTRONIC JS --> | ||
| 354 | -<script src="/metronic_v4.5.4/scripts/app.min.js" data-exclude=1></script> | ||
| 355 | -<script src="/metronic_v4.5.4/layout4/scripts/layout.min.js" | ||
| 356 | - data-exclude=1></script> | ||
| 357 | -<!-- 虚拟滚动条 --> | ||
| 358 | -<script | ||
| 359 | - src="/metronic_v4.5.4/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> | ||
| 360 | -<!-- jsTree 树插件 --> | ||
| 361 | -<script src="/metronic_v4.5.4/plugins/jstree/dist/jstree.min.js"></script> | ||
| 362 | -<!-- bootstrap-hover-dropDown --> | ||
| 363 | -<script | ||
| 364 | - src="/metronic_v4.5.4/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script> | ||
| 365 | -<!-- jquery.validate 表单验证 --> | ||
| 366 | -<script | ||
| 367 | - src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script> | ||
| 368 | -<script | ||
| 369 | - src="/metronic_v4.5.4/plugins/jquery-validation/js/localization/messages_zh.js"></script> | ||
| 370 | -<!-- 向导式插件 --> | ||
| 371 | -<script | ||
| 372 | - src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script> | ||
| 373 | -<!-- iCheck 单选框和复选框 --> | ||
| 374 | -<script src="/metronic_v4.5.4/plugins/icheck/icheck.min.js"></script> | ||
| 375 | -<!-- select2 下拉框 --> | ||
| 376 | -<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | ||
| 377 | -<!-- MULTI SELECT 多选下拉框 --> | ||
| 378 | -<script | ||
| 379 | - src="/metronic_v4.5.4/plugins/jquery-multi-select/js/jquery.multi-select.js"></script> | ||
| 380 | -<!-- editable.js --> | ||
| 381 | -<script | ||
| 382 | - src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> | ||
| 383 | -<!-- PJAX --> | ||
| 384 | -<script src="/assets/plugins/jquery.pjax.js"></script> | ||
| 385 | -<!-- layer 弹层 --> | ||
| 386 | -<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script> | ||
| 387 | -<!-- fileinput 上传 --> | ||
| 388 | -<script src="/assets/plugins/fileinput/canvas-to-blob.min.js"></script> | ||
| 389 | -<script src="/assets/plugins/fileinput/purify.min.js"></script> | ||
| 390 | -<script src="/assets/plugins/fileinput/sortable.min.js"></script> | ||
| 391 | -<script src="/assets/plugins/fileinput/fileinput.min.js"></script> | ||
| 392 | -<script src="/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | ||
| 393 | -<!-- jquery.purl URL解析 --> | ||
| 394 | -<script src="/assets/plugins/purl.js"></script> | ||
| 395 | -<!-- jquery.serializejson JSON序列化插件 --> | ||
| 396 | -<script src="/assets/plugins/jquery.serializejson.js"></script> | ||
| 397 | -<!-- art-template 模版引擎 --> | ||
| 398 | -<script src="/assets/plugins/template.js"></script> | ||
| 399 | -<!-- jquery.pageinator 分页 --> | ||
| 400 | -<script src="/assets/plugins/jqPaginator.min.js"></script> | ||
| 401 | -<!-- moment.js 日期处理类库 --> | ||
| 402 | -<script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 403 | - | ||
| 404 | -<script src="/assets/plugins/pinyin.js"></script> | ||
| 405 | -<!-- 日期控件 --> | ||
| 406 | -<script | ||
| 407 | - src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | ||
| 408 | -<!-- 表格控件 --> | ||
| 409 | -<script src="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script> | ||
| 410 | -<!-- 统计图控件 --> | ||
| 411 | -<!--<script src="/assets/global/getEchart.js"></script> | ||
| 412 | -<script src="/assets/global/echarts.js"></script> --> | ||
| 413 | -<script src="/assets/js/common.js"></script> | ||
| 414 | -<script src="/assets/js/dictionary.js"></script> | ||
| 415 | -<!-- tipso JS --> | ||
| 416 | -<script src="/metronic_v4.5.4/plugins/tipso/js/tipso.js"></script> | ||
| 417 | -<script data-exclude=1> | ||
| 418 | - //初始打开的片段地址 | ||
| 419 | - var initFragment = "^_^initFragment^_^"; | ||
| 420 | - //静态文件目录 | ||
| 421 | - var dir = '/pages/'; | ||
| 422 | - //片段容器 | ||
| 423 | - var pjaxContainer = '#pjax-container' | ||
| 424 | - , angJsContainer = '#route-container'; | ||
| 425 | - | ||
| 426 | - $(document).ajaxError(function (event, jqxhr, settings, thrownError) { | ||
| 427 | - if(jqxhr.status == 403){ | ||
| 428 | - layer.closeAll(); | ||
| 429 | - layer.alert(jqxhr.message?jqxhr.message:'访问被拒绝', {icon: 2, title: '操作失败'}); | ||
| 430 | - } | ||
| 431 | - }); | ||
| 432 | - | ||
| 433 | - $(function () { | ||
| 434 | - $.get('/user/currentUser', function (user) { | ||
| 435 | - $('#indexTopUName').text(user.userName); | ||
| 436 | - }); | ||
| 437 | - | ||
| 438 | - //带 data-pjax 的链接由pjax加载 | ||
| 439 | - $(document).pjax('a[data-pjax]', pjaxContainer); | ||
| 440 | - | ||
| 441 | - //pjax左菜单点击事件 | ||
| 442 | - $(document).on('click', '#leftMenuSidebar a[data-pjax]', function () { | ||
| 443 | - setTitle(this); | ||
| 444 | - | ||
| 445 | - $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 446 | - $(this).parent().addClass('active'); | ||
| 447 | - showPjax(); | ||
| 448 | - }); | ||
| 449 | - | ||
| 450 | - //angularjs左菜单点击事件 | ||
| 451 | - $(document).on('click', '#leftMenuSidebar a[data-angularjs]', function () { | ||
| 452 | - setTitle(this); | ||
| 453 | - | ||
| 454 | - $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 455 | - $(this).parent().addClass('active'); | ||
| 456 | - showAngJs(); | ||
| 457 | - }); | ||
| 458 | - | ||
| 459 | - //加载左菜单栏 | ||
| 460 | - $get('/module/findByCurrentUser', null, | ||
| 461 | - function (ms) { | ||
| 462 | - var treeArray = createTreeData(ms); | ||
| 463 | - treeArray.sort(function (a, b) { | ||
| 464 | - return a.createDate - b.createDate; | ||
| 465 | - }); | ||
| 466 | - var menuHtml = template('menu_list_temp', {list: treeArray}); | ||
| 467 | - $('#leftMenuSidebar').html(menuHtml); | ||
| 468 | - | ||
| 469 | - //----------- 检查URL ---------------- | ||
| 470 | - var h = location.hash; | ||
| 471 | - if (initFragment && initFragment != '') { | ||
| 472 | - showPjax(); | ||
| 473 | - //普通片段 | ||
| 474 | - loadPage(initFragment); | ||
| 475 | - //选中菜单 | ||
| 476 | - $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 477 | - if (urlPattern($(item).attr('href'), initFragment)) { | ||
| 478 | - activeLeftMenu(item); | ||
| 479 | - } | ||
| 480 | - }); | ||
| 481 | - } else if (h) { | ||
| 482 | - //angularjs片段 | ||
| 483 | - showAngJs(); | ||
| 484 | - //选中菜单 | ||
| 485 | - $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 486 | - if ($(item).attr('href') == h) { | ||
| 487 | - activeLeftMenu(item); | ||
| 488 | - } | ||
| 489 | - }); | ||
| 490 | - } | ||
| 491 | - else { | ||
| 492 | - //加载主页 | ||
| 493 | - loadPage('/pages/home.html'); | ||
| 494 | - } | ||
| 495 | - }); | ||
| 496 | - | ||
| 497 | - //修改密码 | ||
| 498 | - $('#changePWD').on('click', function () { | ||
| 499 | - $.get('/pages/permission/user/changePWD.html', function (content) { | ||
| 500 | - layer.open({ | ||
| 501 | - type: 1, | ||
| 502 | - area: ['600px', '360px'], | ||
| 503 | - content: content, | ||
| 504 | - title: '修改密码', | ||
| 505 | - shift: 5, | ||
| 506 | - scrollbar: false, | ||
| 507 | - success: function () { | ||
| 508 | - } | ||
| 509 | - }); | ||
| 510 | - }); | ||
| 511 | - }); | ||
| 512 | - }); | ||
| 513 | - | ||
| 514 | - //modal关闭时销毁dom | ||
| 515 | - $(document).on('hidden.bs.modal', '.modal', function () { | ||
| 516 | - $(this).remove(); | ||
| 517 | - }); | ||
| 518 | - | ||
| 519 | - //pjax加载完成事件 | ||
| 520 | - $(document).on('pjax:success', function () { | ||
| 521 | - var dicts = $(pjaxContainer).find('.nt-dictionary'); | ||
| 522 | - dictionaryUtils.transformDom(dicts); | ||
| 523 | - }); | ||
| 524 | - | ||
| 525 | - function loadPage(url) { | ||
| 526 | - $.pjax({url: url, container: pjaxContainer}) | ||
| 527 | - } | ||
| 528 | - | ||
| 529 | - function urlPattern(a, b) { | ||
| 530 | - var r; | ||
| 531 | - try { | ||
| 532 | - r = a.substring(0, a.lastIndexOf('/')) == b.substring(0, b.lastIndexOf('/')); | ||
| 533 | - } catch (e) { | ||
| 534 | - r = false; | ||
| 535 | - } | ||
| 536 | - return r; | ||
| 537 | - } | ||
| 538 | - | ||
| 539 | - function showPjax() { | ||
| 540 | - $(angJsContainer).removeClass('page-content active').hide(); | ||
| 541 | - $(pjaxContainer).addClass('page-content active'); | ||
| 542 | - } | ||
| 543 | - | ||
| 544 | - function showAngJs() { | ||
| 545 | - $(pjaxContainer).html('').removeClass('page-content active').hide(); | ||
| 546 | - $(angJsContainer).addClass('page-content active'); | ||
| 547 | - } | ||
| 548 | - | ||
| 549 | - function activeLeftMenu(item) { | ||
| 550 | - $(item).parent('.nav-item').addClass('active').parent('.sub-menu').show().parent().addClass('open'); | ||
| 551 | - setTitle(item); | ||
| 552 | - } | ||
| 553 | - | ||
| 554 | - function setTitle(menuItem){ | ||
| 555 | - document.title = $('span.title', menuItem).text(); | ||
| 556 | - } | ||
| 557 | - | ||
| 558 | -</script> | ||
| 559 | -<!-- d3 --> | ||
| 560 | -<script src="/assets/js/d3.min.js" data-exclude=1></script> | ||
| 561 | -<!-- webSocket JS --> | ||
| 562 | -<script src="/assets/js/sockjs.min.js"></script> | ||
| 563 | - | ||
| 564 | -<!-- TODO:angularJS相关库 --> | ||
| 565 | - | ||
| 566 | -<!-- angularJS相关库 --> | ||
| 567 | -<!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 --> | ||
| 568 | -<script src="/assets/js/angular.js" data-autocephaly=1></script> | ||
| 569 | -<script src="/assets/bower_components/angular-i18n/angular-locale_zh-cn.js" data-autocephaly=1></script> | ||
| 570 | -<script | ||
| 571 | - src="/assets/bower_components/angular-resource/angular-resource.min.js" | ||
| 572 | - data-exclude=1></script> | ||
| 573 | -<script | ||
| 574 | - src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" | ||
| 575 | - data-exclude=1></script> | ||
| 576 | -<script | ||
| 577 | - src="/assets/bower_components/angular-animate/angular-animate.min.js" | ||
| 578 | - data-exclude=1></script> | ||
| 579 | -<script | ||
| 580 | - src="/assets/bower_components/angular-touch/angular-touch.min.js" | ||
| 581 | - data-exclude=1></script> | ||
| 582 | -<script | ||
| 583 | - src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" | ||
| 584 | - data-exclude=1></script> | ||
| 585 | -<script | ||
| 586 | - src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" | ||
| 587 | - data-exclude=1></script> | ||
| 588 | -<script | ||
| 589 | - src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" | ||
| 590 | - data-exclude=1></script> | ||
| 591 | -<!-- handsontable相关js --> | ||
| 592 | -<script | ||
| 593 | - src="/assets/bower_components/handsontable/dist/handsontable.full.js"></script> | ||
| 594 | -<script | ||
| 595 | - src="/assets/bower_components/ngHandsontable/dist/ngHandsontable.js"></script> | ||
| 596 | -<!-- sweetalert相关js --> | ||
| 597 | -<script src="/assets/bower_components/sweetalert/dist/sweetalert.min.js"></script> | ||
| 598 | -<script src="/assets/bower_components/ng-sweet-alert/ng-sweet-alert.js"></script> | ||
| 599 | - | ||
| 600 | -<!-- schedule计划调度AngularJS模块主JS --> | ||
| 601 | -<script src="/pages/scheduleApp/module/common/main.js" data-exclude=1></script> | ||
| 602 | -<script | ||
| 603 | - src="/pages/scheduleApp/module/common/prj-common-globalservice.js" | ||
| 604 | - data-exclude=1></script> | ||
| 605 | -<script src="/pages/scheduleApp/module/common/prj-common-filter.js" | ||
| 606 | - data-exclude=1></script> | ||
| 607 | -<script src="/pages/scheduleApp/module/common/prj-common-directive.js" | ||
| 608 | - data-exclude=1></script> | ||
| 609 | -<script | ||
| 610 | - src="/pages/scheduleApp/module/common/prj-common-ui-route-state.js" | ||
| 611 | - data-exclude=1></script> | ||
| 612 | - | ||
| 613 | -<!-- 地图相关 --> | ||
| 614 | -<!-- 百度 --> | ||
| 615 | -<script | ||
| 616 | - src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" | ||
| 617 | - data-exclude=1></script> | ||
| 618 | -<script | ||
| 619 | - src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" | ||
| 620 | - data-exclude=1></script> | ||
| 621 | -<script type="text/javascript" | ||
| 622 | - src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js" | ||
| 623 | - data-exclude=1></script> | ||
| 624 | -<script type="text/javascript" | ||
| 625 | - src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js " | ||
| 626 | - data-exclude=1></script> | ||
| 627 | -<script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> | ||
| 628 | -<script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> | ||
| 629 | -<!-- 高德 --> | ||
| 630 | -<script | ||
| 631 | - src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" | ||
| 632 | - data-exclude=1></script> | ||
| 633 | -<!-- echarts4 --> | ||
| 634 | -<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> | ||
| 635 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 636 | -<!-- RSA加密 --> | ||
| 637 | -<script src="/assets/plugins/jsencrypt.min.js"></script> | ||
| 638 | - | ||
| 639 | -</body> | 1 | +<!DOCTYPE html> |
| 2 | +<html lang="zh"> | ||
| 3 | +<head> | ||
| 4 | + <meta name="renderer" content="webkit" /> | ||
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | + <meta charset="UTF-8"> | ||
| 7 | + <title>调度系统</title> | ||
| 8 | + | ||
| 9 | + <meta http-equiv="Pragma" content="no-cache"> | ||
| 10 | + <meta http-equiv="Cache-control" content="no-cache"> | ||
| 11 | + <meta http-equiv="Cache" content="no-cache"> | ||
| 12 | + | ||
| 13 | + <!-- Font Awesome 图标字体 --> | ||
| 14 | + <link | ||
| 15 | + href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | ||
| 16 | + rel="stylesheet" type="text/css" /> | ||
| 17 | + <!-- Bootstrap style --> | ||
| 18 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | ||
| 19 | + rel="stylesheet" type="text/css" /> | ||
| 20 | + <!-- jsTree 数插件 --> | ||
| 21 | + <link | ||
| 22 | + href="/metronic_v4.5.4/plugins/jstree/dist/themes/default/style.min.css" | ||
| 23 | + rel="stylesheet" type="text/css" /> | ||
| 24 | + <!-- MULTI-select 多选下拉框美化 --> | ||
| 25 | + <link | ||
| 26 | + href="/metronic_v4.5.4/plugins/jquery-multi-select/css/multi-select.css" | ||
| 27 | + rel="stylesheet" type="text/css" /> | ||
| 28 | + | ||
| 29 | + <!-- editable --> | ||
| 30 | + <link | ||
| 31 | + href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" | ||
| 32 | + rel="stylesheet" type="text/css" /> | ||
| 33 | + <!-- METRONIC style --> | ||
| 34 | + <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" | ||
| 35 | + rel="stylesheet" type="text/css" id="style_color" /> | ||
| 36 | + <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | ||
| 37 | + type="text/css" /> | ||
| 38 | + <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" | ||
| 39 | + type="text/css" /> | ||
| 40 | + <link href="/metronic_v4.5.4/layout4/css/layout.min.css" | ||
| 41 | + rel="stylesheet" type="text/css" /> | ||
| 42 | + <link href="/metronic_v4.5.4/layout4/css/custom.min.css" | ||
| 43 | + rel="stylesheet" type="text/css" /> | ||
| 44 | + <!-- select2 下拉框插件 --> | ||
| 45 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | ||
| 46 | + rel="stylesheet" type="text/css" /> | ||
| 47 | + <link | ||
| 48 | + href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | ||
| 49 | + rel="stylesheet" type="text/css" /> | ||
| 50 | + <!-- layer 弹层 插件 --> | ||
| 51 | + <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | ||
| 52 | + rel="stylesheet" type="text/css" /> | ||
| 53 | + <!-- fileinput 上传 插件 --> | ||
| 54 | + <link href="/assets/plugins/fileinput/css/fileinput.min.css" | ||
| 55 | + rel="stylesheet" type="text/css" /> | ||
| 56 | + <!-- iCheck 单选框和复选框 --> | ||
| 57 | + <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" | ||
| 58 | + rel="stylesheet" type="text/css" /> | ||
| 59 | + <!-- 日期控件 --> | ||
| 60 | + <link | ||
| 61 | + href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | ||
| 62 | + rel="stylesheet" type="text/css" /> | ||
| 63 | + <!-- table 表格控件 --> | ||
| 64 | + <!--<link rel="stylesheet"--> | ||
| 65 | + <!--href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"--> | ||
| 66 | + <!--type="text/css" />--> | ||
| 67 | + <link href="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/> | ||
| 68 | + <!-- handsontable样式 --> | ||
| 69 | + <link rel="stylesheet" | ||
| 70 | + href="/assets/bower_components/handsontable/dist/handsontable.full.css" /> | ||
| 71 | + <!-- sweetalert样式 --> | ||
| 72 | + <link rel="stylesheet" | ||
| 73 | + href="/assets/bower_components/sweetalert/dist/sweetalert.css" /> | ||
| 74 | + <!-- schedule计划调度AngularJS模块主css --> | ||
| 75 | + <link rel="stylesheet" href="/pages/scheduleApp/module/common/main.css" | ||
| 76 | + type="text/css" /> | ||
| 77 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 78 | + | ||
| 79 | + <!-- CSS动画 --> | ||
| 80 | + <link | ||
| 81 | + href="/metronic_v4.5.4/plugins/tipso/css/animate.css" | ||
| 82 | + rel="stylesheet" type="text/css" /> | ||
| 83 | + | ||
| 84 | + <!-- 提示工具样式 --> | ||
| 85 | + <link | ||
| 86 | + href="/metronic_v4.5.4/plugins/tipso/css/tipso.css" | ||
| 87 | + rel="stylesheet" type="text/css" /> | ||
| 88 | + | ||
| 89 | + <style type="text/css"> | ||
| 90 | + .searchForm { | ||
| 91 | + | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + .searchForm .form-group .control-label { | ||
| 95 | + padding-right: 0px; | ||
| 96 | + text-align: right; | ||
| 97 | + margin-top: 7px; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + .searchForm .form-group>div { | ||
| 101 | + padding-left: 10px; | ||
| 102 | + padding-right: 0px; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + .searchForm .row>div { | ||
| 106 | + padding-left: 0px; | ||
| 107 | + padding-right: 0px; | ||
| 108 | + padding: 5px 0 5px 0; | ||
| 109 | + width: 270px; | ||
| 110 | + display: inline-block; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + .searchForm .form-actions { | ||
| 114 | + | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + tr.row-active td { | ||
| 118 | + border-bottom: 1px solid blue !important; | ||
| 119 | + color: blue; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 123 | + { | ||
| 124 | + font-size: 14px; | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + .ms-container .ms-selectable li.ms-elem-selectable,.ms-container .ms-selection li.ms-elem-selection | ||
| 128 | + { | ||
| 129 | + padding: 6px 26px; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + .ms-container .ms-list { | ||
| 133 | + height: 306px; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + .ms-container .ms-selectable,.ms-container .ms-selection { | ||
| 137 | + width: 47%; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + .ms-container { | ||
| 141 | + width: 470px; | ||
| 142 | + margin: auto; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + .multi-custom-header-left { | ||
| 146 | + text-align: center; | ||
| 147 | + padding: 7px; | ||
| 148 | + color: #3B3F51; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + .multi-custom-header-right { | ||
| 152 | + text-align: center; | ||
| 153 | + padding: 7px; | ||
| 154 | + font-weight: bold; | ||
| 155 | + color: #36C6D3; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + .mt-element-list .list-simple.mt-list-container ul>.mt-list-item>.list-item-content | ||
| 159 | + { | ||
| 160 | + padding: 0 55px 0 0px; | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + .mt-element-list .list-simple.mt-list-container ul>.mt-list-item { | ||
| 164 | + padding: 3.3px 0; | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + #route-container { | ||
| 168 | + display: none; | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + .page-content.active { | ||
| 172 | + display: block !important; | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + .page-header.navbar .page-logo .logo-default { | ||
| 176 | + margin: 0; | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + .page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle | ||
| 180 | + { | ||
| 181 | + background-color: #284a99; | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + .page-header.navbar .page-logo { | ||
| 185 | + padding-right: 10px; | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + .page-logo .logo-default.logo-default-text { | ||
| 189 | + font-weight: 600; | ||
| 190 | + color: white !important; | ||
| 191 | + margin-top: 19px !important; | ||
| 192 | + font-size: 24px; | ||
| 193 | + text-decoration: none; | ||
| 194 | + } | ||
| 195 | + | ||
| 196 | + .page-logo .logo-default.logo-default-text:HOVER { | ||
| 197 | + color: #dedede !important; | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + body,.page-content-wrapper,#pjax-container{ | ||
| 201 | + height: 100%; | ||
| 202 | + } | ||
| 203 | + html{ | ||
| 204 | + height: 90%; | ||
| 205 | + } | ||
| 206 | + .page-container{ | ||
| 207 | + height: 100%; | ||
| 208 | + } | ||
| 209 | + </style> | ||
| 210 | + | ||
| 211 | + <!-- ocLazyLoading载入文件的位置 --> | ||
| 212 | + <link id="ng_load_plugins_before" /> | ||
| 213 | + | ||
| 214 | +</head> | ||
| 215 | +<body | ||
| 216 | + class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed"> | ||
| 217 | +<div class="page-header navbar navbar-fixed-top" | ||
| 218 | + style="background: linear-gradient(to bottom, #124e78, #125688);"> | ||
| 219 | + <div class="page-header-inner "> | ||
| 220 | + <!-- LOGO --> | ||
| 221 | + <div class="page-logo"> | ||
| 222 | + <a href="index.html" class="logo-default logo-default-text"> | ||
| 223 | + 临港公交调度系统 </a> | ||
| 224 | + <div class="menu-toggler sidebar-toggler"></div> | ||
| 225 | + </div> | ||
| 226 | + <!-- END LOGO --> | ||
| 227 | + <a href="javascript:;" class="menu-toggler responsive-toggler" | ||
| 228 | + data-toggle="collapse" data-target=".navbar-collapse"> </a> | ||
| 229 | + <div class="page-top"> | ||
| 230 | + <div class="top-menu"> | ||
| 231 | + <ul class="nav navbar-nav pull-right"> | ||
| 232 | + <!-- 信息通知区 --> | ||
| 233 | + <li | ||
| 234 | + class="dropdown dropdown-extended dropdown-notification dropdown-dark" | ||
| 235 | + id="header_notification_bar"><a href="javascript:;" | ||
| 236 | + class="dropdown-toggle" data-toggle="dropdown" | ||
| 237 | + data-hover="dropdown" data-close-others="true"> <i | ||
| 238 | + class="fa fa-bell"></i> <span class="badge badge-success"> | ||
| 239 | + 0 </span> | ||
| 240 | + </a> | ||
| 241 | + <ul class="dropdown-menu" style="max-width: 345px; width: 345px;"> | ||
| 242 | + <li class="external"> | ||
| 243 | + <h3> | ||
| 244 | + 今日 <span class="bold">0 条</span> 通知 | ||
| 245 | + </h3> <a href="javascript:;">查看全部</a> | ||
| 246 | + </li> | ||
| 247 | + <li> | ||
| 248 | + <ul class="dropdown-menu-list scroller" style="height: 250px;" | ||
| 249 | + data-handle-color="#637283"> | ||
| 250 | + </ul> | ||
| 251 | + </li> | ||
| 252 | + </ul></li> | ||
| 253 | + <li class="dropdown dropdown-user dropdown-dark"><a | ||
| 254 | + href="javascript:;" class="dropdown-toggle" | ||
| 255 | + data-toggle="dropdown" data-hover="dropdown" | ||
| 256 | + data-close-others="true"> <span id="indexTopUName" | ||
| 257 | + class="username username-hide-on-mobile" | ||
| 258 | + style="vertical-align: middle;"> <i class="fa fa-user"></i></span> | ||
| 259 | + </a> | ||
| 260 | + <ul class="dropdown-menu dropdown-menu-default"> | ||
| 261 | + <li><a href="javascript:;"> <i class="fa fa-user"></i> | ||
| 262 | + 我的信息 | ||
| 263 | + </a></li> | ||
| 264 | + <li><a href="javascript:;" id="changePWD"> <i | ||
| 265 | + class="fa fa-unlock-alt"></i> 修改密码 | ||
| 266 | + </a></li> | ||
| 267 | + <li class="divider"></li> | ||
| 268 | + <li><a href="javascript:;"> <i class="fa fa-lock"></i> | ||
| 269 | + 锁屏 | ||
| 270 | + </a></li> | ||
| 271 | + <li><a href="/logout"> <i class="fa fa-key"></i> 注销登陆 | ||
| 272 | + </a></li> | ||
| 273 | + </ul></li> | ||
| 274 | + </ul> | ||
| 275 | + </div> | ||
| 276 | + </div> | ||
| 277 | + </div> | ||
| 278 | +</div> | ||
| 279 | +<div class="page-container"> | ||
| 280 | + <div class="page-sidebar-wrapper"> | ||
| 281 | + <div class="page-sidebar navbar-collapse collapse"> | ||
| 282 | + <ul class="page-sidebar-menu page-sidebar-menu-fixed" | ||
| 283 | + data-keep-expanded="false" data-auto-scroll="true" | ||
| 284 | + data-slide-speed="200" id="leftMenuSidebar"> | ||
| 285 | + </ul> | ||
| 286 | + </div> | ||
| 287 | + </div> | ||
| 288 | + <div class="page-content-wrapper"> | ||
| 289 | + <div id="pjax-container" class="page-content"></div> | ||
| 290 | + | ||
| 291 | + <div id="route-container"> | ||
| 292 | + <div ng-app="ScheduleApp"> | ||
| 293 | + <div ng-controller="ScheduleAppController"> | ||
| 294 | + | ||
| 295 | + <!-- loading widget --> | ||
| 296 | + <div id="loadingWidget" class="flyover mask" loading-widget> | ||
| 297 | + <div class="alert alert-info"> | ||
| 298 | + <strong>载入中......</strong> | ||
| 299 | + </div> | ||
| 300 | + </div> | ||
| 301 | + | ||
| 302 | + <div ui-view class="uv"></div> | ||
| 303 | + </div> | ||
| 304 | + </div> | ||
| 305 | + </div> | ||
| 306 | + </div> | ||
| 307 | +</div> | ||
| 308 | + | ||
| 309 | +<script id="menu_list_temp" type="text/html"> | ||
| 310 | + {{each list as group i}} | ||
| 311 | + <li class="heading"> | ||
| 312 | + <h3 class="uppercase">{{group.name}}</h3> | ||
| 313 | + </li> | ||
| 314 | + {{each group.children as dir j}} | ||
| 315 | + <li class="nav-item"> | ||
| 316 | + <a href="javascript:;" class="nav-link nav-toggle "> | ||
| 317 | + <i class="{{dir.icon}}"></i> | ||
| 318 | + <span class="title">{{dir.name}}</span> | ||
| 319 | + <span class="arrow"></span> | ||
| 320 | + </a> | ||
| 321 | + <ul class="sub-menu"> | ||
| 322 | + {{each dir.children as module s}} | ||
| 323 | + <li class="nav-item "> | ||
| 324 | + {{if module.container=="pjax-container"}} | ||
| 325 | + <a href="/pages/{{module.path}}" class="nav-link " data-pjax> | ||
| 326 | + <span class="title">{{module.name}}</span> | ||
| 327 | + </a> | ||
| 328 | + {{else}} | ||
| 329 | + <a href="{{module.path}}" class="nav-link " data-angularjs> | ||
| 330 | + <span class="title">{{module.name}}</span> | ||
| 331 | + </a> | ||
| 332 | + {{/if}} | ||
| 333 | + </li> | ||
| 334 | + {{/each}} | ||
| 335 | + </ul> | ||
| 336 | + </li> | ||
| 337 | + {{/each}} | ||
| 338 | + {{/each}} | ||
| 339 | + | ||
| 340 | +</script> | ||
| 341 | +<script> | ||
| 342 | + delete window.require; | ||
| 343 | + delete window.exports; | ||
| 344 | + delete window.module; | ||
| 345 | +</script> | ||
| 346 | +<!-- jQuery --> | ||
| 347 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js" data-exclude=1></script> | ||
| 348 | +<!-- bootstrap --> | ||
| 349 | +<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" | ||
| 350 | + data-exclude=1></script> | ||
| 351 | +<script src="/pages/forms/statement/js/jquery.autocompleter.js"></script> | ||
| 352 | +<script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | ||
| 353 | +<!-- MTRONIC JS --> | ||
| 354 | +<script src="/metronic_v4.5.4/scripts/app.min.js" data-exclude=1></script> | ||
| 355 | +<script src="/metronic_v4.5.4/layout4/scripts/layout.min.js" | ||
| 356 | + data-exclude=1></script> | ||
| 357 | +<!-- 虚拟滚动条 --> | ||
| 358 | +<script | ||
| 359 | + src="/metronic_v4.5.4/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> | ||
| 360 | +<!-- jsTree 树插件 --> | ||
| 361 | +<script src="/metronic_v4.5.4/plugins/jstree/dist/jstree.min.js"></script> | ||
| 362 | +<!-- bootstrap-hover-dropDown --> | ||
| 363 | +<script | ||
| 364 | + src="/metronic_v4.5.4/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"></script> | ||
| 365 | +<!-- jquery.validate 表单验证 --> | ||
| 366 | +<script | ||
| 367 | + src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script> | ||
| 368 | +<script | ||
| 369 | + src="/metronic_v4.5.4/plugins/jquery-validation/js/localization/messages_zh.js"></script> | ||
| 370 | +<!-- 向导式插件 --> | ||
| 371 | +<script | ||
| 372 | + src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script> | ||
| 373 | +<!-- iCheck 单选框和复选框 --> | ||
| 374 | +<script src="/metronic_v4.5.4/plugins/icheck/icheck.min.js"></script> | ||
| 375 | +<!-- select2 下拉框 --> | ||
| 376 | +<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | ||
| 377 | +<!-- MULTI SELECT 多选下拉框 --> | ||
| 378 | +<script | ||
| 379 | + src="/metronic_v4.5.4/plugins/jquery-multi-select/js/jquery.multi-select.js"></script> | ||
| 380 | +<!-- editable.js --> | ||
| 381 | +<script | ||
| 382 | + src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script> | ||
| 383 | +<!-- PJAX --> | ||
| 384 | +<script src="/assets/plugins/jquery.pjax.js"></script> | ||
| 385 | +<!-- layer 弹层 --> | ||
| 386 | +<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script> | ||
| 387 | +<!-- fileinput 上传 --> | ||
| 388 | +<script src="/assets/plugins/fileinput/canvas-to-blob.min.js"></script> | ||
| 389 | +<script src="/assets/plugins/fileinput/purify.min.js"></script> | ||
| 390 | +<script src="/assets/plugins/fileinput/sortable.min.js"></script> | ||
| 391 | +<script src="/assets/plugins/fileinput/fileinput.min.js"></script> | ||
| 392 | +<script src="/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | ||
| 393 | +<!-- jquery.purl URL解析 --> | ||
| 394 | +<script src="/assets/plugins/purl.js"></script> | ||
| 395 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 396 | +<script src="/assets/plugins/jquery.serializejson.js"></script> | ||
| 397 | +<!-- art-template 模版引擎 --> | ||
| 398 | +<script src="/assets/plugins/template.js"></script> | ||
| 399 | +<!-- jquery.pageinator 分页 --> | ||
| 400 | +<script src="/assets/plugins/jqPaginator.min.js"></script> | ||
| 401 | +<!-- moment.js 日期处理类库 --> | ||
| 402 | +<script src="/assets/plugins/moment-with-locales.js"></script> | ||
| 403 | + | ||
| 404 | +<script src="/assets/plugins/pinyin.js"></script> | ||
| 405 | +<!-- 日期控件 --> | ||
| 406 | +<script | ||
| 407 | + src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | ||
| 408 | +<!-- 表格控件 --> | ||
| 409 | +<script src="/metronic_v4.5.4/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script> | ||
| 410 | +<!-- 统计图控件 --> | ||
| 411 | +<!--<script src="/assets/global/getEchart.js"></script> | ||
| 412 | +<script src="/assets/global/echarts.js"></script> --> | ||
| 413 | +<script src="/assets/js/common.js"></script> | ||
| 414 | +<script src="/assets/js/dictionary.js"></script> | ||
| 415 | +<!-- tipso JS --> | ||
| 416 | +<script src="/metronic_v4.5.4/plugins/tipso/js/tipso.js"></script> | ||
| 417 | +<script data-exclude=1> | ||
| 418 | + //初始打开的片段地址 | ||
| 419 | + var initFragment = "^_^initFragment^_^"; | ||
| 420 | + //静态文件目录 | ||
| 421 | + var dir = '/pages/'; | ||
| 422 | + //片段容器 | ||
| 423 | + var pjaxContainer = '#pjax-container' | ||
| 424 | + , angJsContainer = '#route-container'; | ||
| 425 | + | ||
| 426 | + $(document).ajaxError(function (event, jqxhr, settings, thrownError) { | ||
| 427 | + if(jqxhr.status == 403){ | ||
| 428 | + layer.closeAll(); | ||
| 429 | + layer.alert(jqxhr.message?jqxhr.message:'访问被拒绝', {icon: 2, title: '操作失败'}); | ||
| 430 | + } | ||
| 431 | + }); | ||
| 432 | + | ||
| 433 | + $(function () { | ||
| 434 | + $.get('/user/currentUser', function (user) { | ||
| 435 | + $('#indexTopUName').text(user.userName); | ||
| 436 | + }); | ||
| 437 | + | ||
| 438 | + //带 data-pjax 的链接由pjax加载 | ||
| 439 | + $(document).pjax('a[data-pjax]', pjaxContainer); | ||
| 440 | + | ||
| 441 | + //pjax左菜单点击事件 | ||
| 442 | + $(document).on('click', '#leftMenuSidebar a[data-pjax]', function () { | ||
| 443 | + setTitle(this); | ||
| 444 | + | ||
| 445 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 446 | + $(this).parent().addClass('active'); | ||
| 447 | + showPjax(); | ||
| 448 | + }); | ||
| 449 | + | ||
| 450 | + //angularjs左菜单点击事件 | ||
| 451 | + $(document).on('click', '#leftMenuSidebar a[data-angularjs]', function () { | ||
| 452 | + setTitle(this); | ||
| 453 | + | ||
| 454 | + $('#leftMenuSidebar li.nav-item.active').removeClass('active'); | ||
| 455 | + $(this).parent().addClass('active'); | ||
| 456 | + showAngJs(); | ||
| 457 | + }); | ||
| 458 | + | ||
| 459 | + //加载左菜单栏 | ||
| 460 | + $get('/module/findByCurrentUser', null, | ||
| 461 | + function (ms) { | ||
| 462 | + var treeArray = createTreeData(ms); | ||
| 463 | + treeArray.sort(function (a, b) { | ||
| 464 | + return a.createDate - b.createDate; | ||
| 465 | + }); | ||
| 466 | + var menuHtml = template('menu_list_temp', {list: treeArray}); | ||
| 467 | + $('#leftMenuSidebar').html(menuHtml); | ||
| 468 | + | ||
| 469 | + //----------- 检查URL ---------------- | ||
| 470 | + var h = location.hash; | ||
| 471 | + if (initFragment && initFragment != '') { | ||
| 472 | + showPjax(); | ||
| 473 | + //普通片段 | ||
| 474 | + loadPage(initFragment); | ||
| 475 | + //选中菜单 | ||
| 476 | + $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 477 | + if (urlPattern($(item).attr('href'), initFragment)) { | ||
| 478 | + activeLeftMenu(item); | ||
| 479 | + } | ||
| 480 | + }); | ||
| 481 | + } else if (h) { | ||
| 482 | + //angularjs片段 | ||
| 483 | + showAngJs(); | ||
| 484 | + //选中菜单 | ||
| 485 | + $.each($('#leftMenuSidebar a'), function (i, item) { | ||
| 486 | + if ($(item).attr('href') == h) { | ||
| 487 | + activeLeftMenu(item); | ||
| 488 | + } | ||
| 489 | + }); | ||
| 490 | + } | ||
| 491 | + else { | ||
| 492 | + //加载主页 | ||
| 493 | + loadPage('/pages/home.html'); | ||
| 494 | + } | ||
| 495 | + }); | ||
| 496 | + | ||
| 497 | + //修改密码 | ||
| 498 | + $('#changePWD').on('click', function () { | ||
| 499 | + $.get('/pages/permission/user/changePWD.html', function (content) { | ||
| 500 | + layer.open({ | ||
| 501 | + type: 1, | ||
| 502 | + area: ['600px', '360px'], | ||
| 503 | + content: content, | ||
| 504 | + title: '修改密码', | ||
| 505 | + shift: 5, | ||
| 506 | + scrollbar: false, | ||
| 507 | + success: function () { | ||
| 508 | + } | ||
| 509 | + }); | ||
| 510 | + }); | ||
| 511 | + }); | ||
| 512 | + }); | ||
| 513 | + | ||
| 514 | + //modal关闭时销毁dom | ||
| 515 | + $(document).on('hidden.bs.modal', '.modal', function () { | ||
| 516 | + $(this).remove(); | ||
| 517 | + }); | ||
| 518 | + | ||
| 519 | + //pjax加载完成事件 | ||
| 520 | + $(document).on('pjax:success', function () { | ||
| 521 | + var dicts = $(pjaxContainer).find('.nt-dictionary'); | ||
| 522 | + dictionaryUtils.transformDom(dicts); | ||
| 523 | + }); | ||
| 524 | + | ||
| 525 | + function loadPage(url) { | ||
| 526 | + $.pjax({url: url, container: pjaxContainer}) | ||
| 527 | + } | ||
| 528 | + | ||
| 529 | + function urlPattern(a, b) { | ||
| 530 | + var r; | ||
| 531 | + try { | ||
| 532 | + r = a.substring(0, a.lastIndexOf('/')) == b.substring(0, b.lastIndexOf('/')); | ||
| 533 | + } catch (e) { | ||
| 534 | + r = false; | ||
| 535 | + } | ||
| 536 | + return r; | ||
| 537 | + } | ||
| 538 | + | ||
| 539 | + function showPjax() { | ||
| 540 | + $(angJsContainer).removeClass('page-content active').hide(); | ||
| 541 | + $(pjaxContainer).addClass('page-content active'); | ||
| 542 | + } | ||
| 543 | + | ||
| 544 | + function showAngJs() { | ||
| 545 | + $(pjaxContainer).html('').removeClass('page-content active').hide(); | ||
| 546 | + $(angJsContainer).addClass('page-content active'); | ||
| 547 | + } | ||
| 548 | + | ||
| 549 | + function activeLeftMenu(item) { | ||
| 550 | + $(item).parent('.nav-item').addClass('active').parent('.sub-menu').show().parent().addClass('open'); | ||
| 551 | + setTitle(item); | ||
| 552 | + } | ||
| 553 | + | ||
| 554 | + function setTitle(menuItem){ | ||
| 555 | + document.title = $('span.title', menuItem).text(); | ||
| 556 | + } | ||
| 557 | + | ||
| 558 | +</script> | ||
| 559 | +<!-- d3 --> | ||
| 560 | +<script src="/assets/js/d3.min.js" data-exclude=1></script> | ||
| 561 | +<!-- webSocket JS --> | ||
| 562 | +<script src="/assets/js/sockjs.min.js"></script> | ||
| 563 | + | ||
| 564 | +<!-- TODO:angularJS相关库 --> | ||
| 565 | + | ||
| 566 | +<!-- angularJS相关库 --> | ||
| 567 | +<!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 --> | ||
| 568 | +<script src="/assets/js/angular.js" data-autocephaly=1></script> | ||
| 569 | +<script src="/assets/bower_components/angular-i18n/angular-locale_zh-cn.js" data-autocephaly=1></script> | ||
| 570 | +<script | ||
| 571 | + src="/assets/bower_components/angular-resource/angular-resource.min.js" | ||
| 572 | + data-exclude=1></script> | ||
| 573 | +<script | ||
| 574 | + src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" | ||
| 575 | + data-exclude=1></script> | ||
| 576 | +<script | ||
| 577 | + src="/assets/bower_components/angular-animate/angular-animate.min.js" | ||
| 578 | + data-exclude=1></script> | ||
| 579 | +<script | ||
| 580 | + src="/assets/bower_components/angular-touch/angular-touch.min.js" | ||
| 581 | + data-exclude=1></script> | ||
| 582 | +<script | ||
| 583 | + src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" | ||
| 584 | + data-exclude=1></script> | ||
| 585 | +<script | ||
| 586 | + src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" | ||
| 587 | + data-exclude=1></script> | ||
| 588 | +<script | ||
| 589 | + src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" | ||
| 590 | + data-exclude=1></script> | ||
| 591 | +<!-- handsontable相关js --> | ||
| 592 | +<script | ||
| 593 | + src="/assets/bower_components/handsontable/dist/handsontable.full.js"></script> | ||
| 594 | +<script | ||
| 595 | + src="/assets/bower_components/ngHandsontable/dist/ngHandsontable.js"></script> | ||
| 596 | +<!-- sweetalert相关js --> | ||
| 597 | +<script src="/assets/bower_components/sweetalert/dist/sweetalert.min.js"></script> | ||
| 598 | +<script src="/assets/bower_components/ng-sweet-alert/ng-sweet-alert.js"></script> | ||
| 599 | + | ||
| 600 | +<!-- schedule计划调度AngularJS模块主JS --> | ||
| 601 | +<script src="/pages/scheduleApp/module/common/main.js" data-exclude=1></script> | ||
| 602 | +<script | ||
| 603 | + src="/pages/scheduleApp/module/common/prj-common-globalservice.js" | ||
| 604 | + data-exclude=1></script> | ||
| 605 | +<script src="/pages/scheduleApp/module/common/prj-common-filter.js" | ||
| 606 | + data-exclude=1></script> | ||
| 607 | +<script src="/pages/scheduleApp/module/common/prj-common-directive.js" | ||
| 608 | + data-exclude=1></script> | ||
| 609 | +<script | ||
| 610 | + src="/pages/scheduleApp/module/common/prj-common-ui-route-state.js" | ||
| 611 | + data-exclude=1></script> | ||
| 612 | + | ||
| 613 | +<!-- 地图相关 --> | ||
| 614 | +<!-- 百度 --> | ||
| 615 | +<script | ||
| 616 | + src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" | ||
| 617 | + data-exclude=1></script> | ||
| 618 | +<script | ||
| 619 | + src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js" | ||
| 620 | + data-exclude=1></script> | ||
| 621 | +<script type="text/javascript" | ||
| 622 | + src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js" | ||
| 623 | + data-exclude=1></script> | ||
| 624 | +<script type="text/javascript" | ||
| 625 | + src="http://api.map.baidu.com/library/RichMarker/1.2/src/RichMarker_min.js " | ||
| 626 | + data-exclude=1></script> | ||
| 627 | +<script src="/assets/js/baidu/TextIconOverlay.js" data-exclude=1></script> | ||
| 628 | +<script src="/assets/js/baidu//MarkerClusterer.js" data-exclude=1></script> | ||
| 629 | +<!-- 高德 --> | ||
| 630 | +<script | ||
| 631 | + src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" | ||
| 632 | + data-exclude=1></script> | ||
| 633 | +<!-- echarts4 --> | ||
| 634 | +<script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script> | ||
| 635 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 636 | +<!-- RSA加密 --> | ||
| 637 | +<script src="/assets/plugins/jsencrypt.min.js"></script> | ||
| 638 | + | ||
| 639 | +</body> | ||
| 640 | </html> | 640 | </html> |
| 641 | \ No newline at end of file | 641 | \ No newline at end of file |
src/main/resources/static/login.html
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html lang="zh"> | ||
| 3 | -<head> | ||
| 4 | - <meta name="renderer" content="webkit" /> | ||
| 5 | - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | - <meta charset="utf-8" /> | ||
| 7 | - <title>登录</title> | ||
| 8 | - <link | ||
| 9 | - href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | ||
| 10 | - rel="stylesheet" type="text/css" /> | ||
| 11 | - <!-- Bootstrap style --> | ||
| 12 | - <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | ||
| 13 | - rel="stylesheet" type="text/css" /> | ||
| 14 | - | ||
| 15 | - <!-- METRONIC style --> | ||
| 16 | - <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | ||
| 17 | - type="text/css" /> | ||
| 18 | - | ||
| 19 | - <style type="text/css"> | ||
| 20 | - body>.wrapper { | ||
| 21 | - background-image: url(/assets/img/bg_9b9dcb65ff.png); | ||
| 22 | - background-size: 100px; | ||
| 23 | - background-repeat: repeat; | ||
| 24 | - min-height: 800px; | ||
| 25 | - min-width: 630px; | ||
| 26 | - position: absolute; | ||
| 27 | - top: 0; | ||
| 28 | - bottom: 0; | ||
| 29 | - left: 0; | ||
| 30 | - right: 0; | ||
| 31 | - } | ||
| 32 | - | ||
| 33 | - #loginPanel.dialog-shadow { | ||
| 34 | - width: 450px; | ||
| 35 | - /* height: 400px; */ | ||
| 36 | - border: 1px solid #dadada; | ||
| 37 | - border-radius: 10px !important; | ||
| 38 | - position: absolute; | ||
| 39 | - box-shadow: 0 9px 30px -6px rgba(0, 0, 0, .2), 0 18px 20px -10px | ||
| 40 | - rgba(0, 0, 0, .04), 0 18px 20px -10px rgba(0, 0, 0, .04), 0 10px 20px | ||
| 41 | - -10px rgba(0, 0, 0, .04); | ||
| 42 | - background: url(/assets/img/dialog-gray-bg_42c40b3eb6.png) #fff bottom | ||
| 43 | - repeat-x; | ||
| 44 | - top: 50%; | ||
| 45 | - left: 50%; | ||
| 46 | - margin-left: -225px; | ||
| 47 | - margin-top: -300px; | ||
| 48 | - text-align: center; | ||
| 49 | - color: #333; | ||
| 50 | - opacity: .5; | ||
| 51 | - | ||
| 52 | - padding-bottom: 56px; | ||
| 53 | - | ||
| 54 | - animation: to_center 1s forwards; | ||
| 55 | - animation-delay: .2s; | ||
| 56 | - | ||
| 57 | - transition: all .3s ease; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - @keyframes to_center | ||
| 61 | - { | ||
| 62 | - 0% {margin-top: -300px;opacity: .5;} | ||
| 63 | - 100% {margin-top: -270px;opacity: 1;} | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - | ||
| 67 | - h3 { | ||
| 68 | - font-size: 25px; | ||
| 69 | - font-weight: 600; | ||
| 70 | - color: #4a4a4a | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - .input-icon input { | ||
| 74 | - height: 48px; | ||
| 75 | - border-radius: 5px !important; | ||
| 76 | - transition: all .5s ease; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - .input-icon input:FOCUS { | ||
| 80 | - border-color: #c2cad8; | ||
| 81 | - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12) !important; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - .input-icon>i { | ||
| 85 | - margin-top: 16px; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - #loginPanel #loginBtn.btn{ | ||
| 89 | - border-radius: 6px !important; | ||
| 90 | - width: 378px; | ||
| 91 | - height: 48px; | ||
| 92 | - font-size: 20px; | ||
| 93 | - font-family: 微软雅黑; | ||
| 94 | - transition: all .3s ease; | ||
| 95 | - | ||
| 96 | - background: #5f7ed7; | ||
| 97 | - background: linear-gradient(#6f97e5,#527ed9); | ||
| 98 | - box-shadow: inset 0 1px 2px #7ea1e8 !important; | ||
| 99 | - color: #fff; | ||
| 100 | - text-shadow: #4f70b3 0 -1px 0; | ||
| 101 | - border: none; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - #loginPanel #loginBtn.btn:HOVER { | ||
| 105 | - box-shadow: inset 0 1px 1px #7696de,inset 0 0 2px #627dca,inset 0 -2px 3px #5a77c7,inset 0 0 100px rgba(48,77,147,.4) !important; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - | ||
| 109 | - #loginPanel.show_msg{ | ||
| 110 | - top: calc(50% - 10px); | ||
| 111 | - } | ||
| 112 | - | ||
| 113 | - #loginPanel .alert{ | ||
| 114 | - display: none; | ||
| 115 | - padding: 12px; | ||
| 116 | - margin-top: 21px; | ||
| 117 | - border-radius: 0 0 10px 10px !important; | ||
| 118 | - font-size: 13px; | ||
| 119 | - | ||
| 120 | - position: absolute; | ||
| 121 | - width: 100%; | ||
| 122 | - border-bottom: 1px solid #dadada; | ||
| 123 | - } | ||
| 124 | - | ||
| 125 | - #loginPanel .alert.login-success{ | ||
| 126 | - color: #27a4b0; | ||
| 127 | - background: #abe7ed; | ||
| 128 | - border-color: #abe7ed; | ||
| 129 | - } | ||
| 130 | - | ||
| 131 | - #loginPanel .alert i{ | ||
| 132 | - font-size: 16px; | ||
| 133 | - vertical-align: middle; | ||
| 134 | - margin: 0 5px 3px; | ||
| 135 | - } | ||
| 136 | - | ||
| 137 | - #loginPanel.show_msg .alert{ | ||
| 138 | - display: block; | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - #captchaWrap{ | ||
| 142 | - display: none; | ||
| 143 | - text-align: left; | ||
| 144 | - border-top: 1px solid #f3f2f2; | ||
| 145 | - } | ||
| 146 | - | ||
| 147 | - img.captcha-img{ | ||
| 148 | - cursor: pointer; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - .login-footer{ | ||
| 152 | - position: fixed; | ||
| 153 | - width: 100%; | ||
| 154 | - bottom: 35px; | ||
| 155 | - text-align: center; | ||
| 156 | - color: #a6a6a6; | ||
| 157 | - } | ||
| 158 | - | ||
| 159 | - h3.logo-text{ | ||
| 160 | - font-family: 华文楷体,华文细黑; | ||
| 161 | - font-size: 28px; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - .warn-note{ | ||
| 165 | - width: 100%; | ||
| 166 | - position: absolute; | ||
| 167 | - top: 0; | ||
| 168 | - z-index: 2; | ||
| 169 | - text-align: center; | ||
| 170 | - background: #ff4646; | ||
| 171 | - color: white; | ||
| 172 | - padding: 12px; | ||
| 173 | - display: none; | ||
| 174 | - } | ||
| 175 | - </style> | ||
| 176 | -</head> | ||
| 177 | - | ||
| 178 | -<body> | ||
| 179 | -<div class="warn-note">警告!系统目前仅在 WebKit 内核下完成兼容性测试,请使用 Google | ||
| 180 | - Chrome 浏览器进入系统。</div> | ||
| 181 | -<div class="wrapper ng-scope"> | ||
| 182 | - <div id="loginPanel" class="dialog dialog-shadow"> | ||
| 183 | - <br> | ||
| 184 | - <h3 class="logo-text">浦东公交调度系统</h3> | ||
| 185 | - <hr> | ||
| 186 | - <form style="padding: 0px 35px;"> | ||
| 187 | - <div class="form-group" style="margin-bottom: 0"> | ||
| 188 | - <label></label> | ||
| 189 | - <div class="input-icon"> | ||
| 190 | - <i class="fa fa-user font-gray"></i> <input type="text" | ||
| 191 | - name="userName" class="form-control" placeholder="输入用户名" | ||
| 192 | - autofocus="autofocus" autocomplete="off"> | ||
| 193 | - </div> | ||
| 194 | - </div> | ||
| 195 | - | ||
| 196 | - <div class="form-group"> | ||
| 197 | - <label></label> | ||
| 198 | - <div class="input-icon"> | ||
| 199 | - <i class="fa fa-key font-gray"></i> <input type="password" | ||
| 200 | - name="password" class="form-control" placeholder="输入密码"> | ||
| 201 | - </div> | ||
| 202 | - </div> | ||
| 203 | - | ||
| 204 | - <div class="form-group" id="captchaWrap"> | ||
| 205 | - <label></label> | ||
| 206 | - <div class="input-icon"> | ||
| 207 | - <input type="text" name="captcha" style="width: 153px !important;" | ||
| 208 | - class="form-control input-inline input-medium" | ||
| 209 | - placeholder="输入验证码"> <span class="help-inline"> <img | ||
| 210 | - alt="验证码" class="captcha-img" title="点击刷新验证码"> | ||
| 211 | - </span> | ||
| 212 | - </div> | ||
| 213 | - </div> | ||
| 214 | - </form> | ||
| 215 | - <br> | ||
| 216 | - <br> | ||
| 217 | - <div class="form-actions"> | ||
| 218 | - <button class="btn blue-steel" id="loginBtn" disabled="disabled">登录</button> | ||
| 219 | - </div> | ||
| 220 | - | ||
| 221 | - <div class="alert alert-danger"></div> | ||
| 222 | - </div> | ||
| 223 | - | ||
| 224 | - <div class="login-footer">© 2016 上海巴士拓华科技发展有限公司 Some Rights | ||
| 225 | - Reserved</div> | ||
| 226 | -</div> | ||
| 227 | - | ||
| 228 | -<script> | ||
| 229 | - delete window.require; | ||
| 230 | - delete window.exports; | ||
| 231 | - delete window.module; | ||
| 232 | -</script> | ||
| 233 | -<!-- jQuery --> | ||
| 234 | -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | ||
| 235 | -<script src="/assets/plugins/jsencrypt.min.js"></script> | ||
| 236 | -<script> | ||
| 237 | - window.onload=function(){ | ||
| 238 | - var body=document.getElementsByTagName("body")[0]; | ||
| 239 | - if(typeof body.style.WebkitAnimation=="undefined") | ||
| 240 | - $('.warn-note').fadeIn(); | ||
| 241 | - }; | ||
| 242 | - !function(){ | ||
| 243 | - var form = $('#loginPanel form') | ||
| 244 | - ,nameInput = $('input[name=userName]', form) | ||
| 245 | - ,pwdInput = $('input[name=password]', form) | ||
| 246 | - ,msgAlert = $('#loginPanel .alert-danger'); | ||
| 247 | - | ||
| 248 | - $('input', form).on('keyup', checkBtnStatus); | ||
| 249 | - | ||
| 250 | - var keys; | ||
| 251 | - $.get('/user/login/jCryptionKey?t='+Math.random(), function(data){ | ||
| 252 | - keys = data.publickey; | ||
| 253 | - }); | ||
| 254 | - | ||
| 255 | - | ||
| 256 | - | ||
| 257 | - function checkBtnStatus(){ | ||
| 258 | - var es = $('input:visible', form); | ||
| 259 | - for(var i = 0, e; e = es[i++];){ | ||
| 260 | - if($.trim($(e).val()) == ''){ | ||
| 261 | - $('#loginBtn').attr('disabled', 'disabled'); | ||
| 262 | - $('#loginPanel').removeClass('show_msg'); | ||
| 263 | - return; | ||
| 264 | - } | ||
| 265 | - } | ||
| 266 | - $('#loginBtn').removeAttr('disabled'); | ||
| 267 | - } | ||
| 268 | - | ||
| 269 | - nameInput.on('blur', checkStatus); | ||
| 270 | - //keyup 事件做延迟 | ||
| 271 | - var uNameKeyup; | ||
| 272 | - nameInput.on('keyup', function(){ | ||
| 273 | - if(uNameKeyup) | ||
| 274 | - return; | ||
| 275 | - uNameKeyup = true; | ||
| 276 | - setTimeout(function(){ | ||
| 277 | - checkStatus(); | ||
| 278 | - uNameKeyup = false; | ||
| 279 | - }, 200); | ||
| 280 | - }); | ||
| 281 | - | ||
| 282 | - //密码框回车事件 | ||
| 283 | - pwdInput.on('keyup', function(e){ | ||
| 284 | - if (e.keyCode == 13) | ||
| 285 | - $('#loginBtn').click(); | ||
| 286 | - }); | ||
| 287 | - //验证码框回车事件 | ||
| 288 | - $('input[name=captcha]').on('keyup', function(e){ | ||
| 289 | - if (e.keyCode == 13) | ||
| 290 | - $('#loginBtn').click(); | ||
| 291 | - }); | ||
| 292 | - | ||
| 293 | - $('#loginBtn').on('click', function(){ | ||
| 294 | - if(lock || $(this).attr('disabled')) return; | ||
| 295 | - var userName = nameInput.val() | ||
| 296 | - ,pwd = pwdInput.val(); | ||
| 297 | - | ||
| 298 | - //RSA加密 | ||
| 299 | - var encrypt = new JSEncrypt(); | ||
| 300 | - encrypt.setPublicKey(keys); | ||
| 301 | - userName = encrypt.encrypt(userName); | ||
| 302 | - pwd = encrypt.encrypt(pwd); | ||
| 303 | - //登录 | ||
| 304 | - login(userName, pwd); | ||
| 305 | - }); | ||
| 306 | - | ||
| 307 | - var lock; | ||
| 308 | - function login(userName, pwd){ | ||
| 309 | - lock = true; | ||
| 310 | - $('#loginBtn').attr('disabled', 'disabled'); | ||
| 311 | - | ||
| 312 | - var params = { | ||
| 313 | - userName: userName, | ||
| 314 | - password: pwd, | ||
| 315 | - captcha: $('input[name=captcha]').val() | ||
| 316 | - }; | ||
| 317 | - $.post('/user/login', params | ||
| 318 | - ,function(rs){ | ||
| 319 | - | ||
| 320 | - $('#loginPanel').addClass('show_msg'); | ||
| 321 | - if(error(rs)){ | ||
| 322 | - lock = false; | ||
| 323 | - $('#loginBtn').removeAttr('disabled'); | ||
| 324 | - | ||
| 325 | - msgAlert.html('<i class="fa fa-times-circle"> </i> 登录失败,' + rs.msg); | ||
| 326 | - | ||
| 327 | - _captcha.refresh(); | ||
| 328 | - checkStatus(); | ||
| 329 | - } | ||
| 330 | - else{ | ||
| 331 | - msgAlert.html('<i class="fa fa-check"> </i> 登录成功!'); | ||
| 332 | - msgAlert.addClass('login-success'); | ||
| 333 | - window.location.href = '/'; | ||
| 334 | - } | ||
| 335 | - }); | ||
| 336 | - } | ||
| 337 | - | ||
| 338 | - function checkStatus(){ | ||
| 339 | - var t = nameInput.val(); | ||
| 340 | - if(!t){ | ||
| 341 | - hide(); | ||
| 342 | - return; | ||
| 343 | - } | ||
| 344 | - | ||
| 345 | - $.get('/user/login/captchaStatus', {userName: t}, function(rs){ | ||
| 346 | - if(rs >= 3) | ||
| 347 | - _captcha.show(); | ||
| 348 | - else | ||
| 349 | - hide(); | ||
| 350 | - }); | ||
| 351 | - | ||
| 352 | - function hide(){ | ||
| 353 | - if(!$("#captchaWrap").is(":hidden")){ | ||
| 354 | - _captcha.hide(); | ||
| 355 | - //隐藏提示消息 | ||
| 356 | - msgAlert.html(''); | ||
| 357 | - $('#loginPanel').removeClass('show_msg'); | ||
| 358 | - } | ||
| 359 | - } | ||
| 360 | - } | ||
| 361 | - | ||
| 362 | - | ||
| 363 | - var _captcha = { | ||
| 364 | - show: function(){ | ||
| 365 | - if($("#captchaWrap").is(":hidden")){ | ||
| 366 | - $('#captchaWrap').fadeIn(500); | ||
| 367 | - _captcha.refresh(); | ||
| 368 | - checkBtnStatus(); | ||
| 369 | - } | ||
| 370 | - }, | ||
| 371 | - refresh: function(){ | ||
| 372 | - if($("#captchaWrap").is(":hidden")) | ||
| 373 | - return; | ||
| 374 | - $('#captchaWrap img.captcha-img').attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 375 | - }, | ||
| 376 | - hide: function(){ | ||
| 377 | - $('#captchaWrap').hide(); | ||
| 378 | - $('input[name=captcha]').val(''); | ||
| 379 | - } | ||
| 380 | - }; | ||
| 381 | - | ||
| 382 | - $('#captchaWrap img.captcha-img').on('click', function(){ | ||
| 383 | - $(this).attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 384 | - }); | ||
| 385 | - | ||
| 386 | - function error(rs){ | ||
| 387 | - return rs.status == 'ERROR' || rs.status == 500; | ||
| 388 | - } | ||
| 389 | - }(); | ||
| 390 | -</script> | ||
| 391 | -</body> | 1 | +<!DOCTYPE html> |
| 2 | +<html lang="zh"> | ||
| 3 | +<head> | ||
| 4 | + <meta name="renderer" content="webkit" /> | ||
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| 6 | + <meta charset="utf-8" /> | ||
| 7 | + <title>登录</title> | ||
| 8 | + <link | ||
| 9 | + href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css" | ||
| 10 | + rel="stylesheet" type="text/css" /> | ||
| 11 | + <!-- Bootstrap style --> | ||
| 12 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" | ||
| 13 | + rel="stylesheet" type="text/css" /> | ||
| 14 | + | ||
| 15 | + <!-- METRONIC style --> | ||
| 16 | + <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" | ||
| 17 | + type="text/css" /> | ||
| 18 | + | ||
| 19 | + <style type="text/css"> | ||
| 20 | + body>.wrapper { | ||
| 21 | + background-image: url(/assets/img/bg_9b9dcb65ff.png); | ||
| 22 | + background-size: 100px; | ||
| 23 | + background-repeat: repeat; | ||
| 24 | + min-height: 800px; | ||
| 25 | + min-width: 630px; | ||
| 26 | + position: absolute; | ||
| 27 | + top: 0; | ||
| 28 | + bottom: 0; | ||
| 29 | + left: 0; | ||
| 30 | + right: 0; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + #loginPanel.dialog-shadow { | ||
| 34 | + width: 450px; | ||
| 35 | + /* height: 400px; */ | ||
| 36 | + border: 1px solid #dadada; | ||
| 37 | + border-radius: 10px !important; | ||
| 38 | + position: absolute; | ||
| 39 | + box-shadow: 0 9px 30px -6px rgba(0, 0, 0, .2), 0 18px 20px -10px | ||
| 40 | + rgba(0, 0, 0, .04), 0 18px 20px -10px rgba(0, 0, 0, .04), 0 10px 20px | ||
| 41 | + -10px rgba(0, 0, 0, .04); | ||
| 42 | + background: url(/assets/img/dialog-gray-bg_42c40b3eb6.png) #fff bottom | ||
| 43 | + repeat-x; | ||
| 44 | + top: 50%; | ||
| 45 | + left: 50%; | ||
| 46 | + margin-left: -225px; | ||
| 47 | + margin-top: -300px; | ||
| 48 | + text-align: center; | ||
| 49 | + color: #333; | ||
| 50 | + opacity: .5; | ||
| 51 | + | ||
| 52 | + padding-bottom: 56px; | ||
| 53 | + | ||
| 54 | + animation: to_center 1s forwards; | ||
| 55 | + animation-delay: .2s; | ||
| 56 | + | ||
| 57 | + transition: all .3s ease; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @keyframes to_center | ||
| 61 | + { | ||
| 62 | + 0% {margin-top: -300px;opacity: .5;} | ||
| 63 | + 100% {margin-top: -270px;opacity: 1;} | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + | ||
| 67 | + h3 { | ||
| 68 | + font-size: 25px; | ||
| 69 | + font-weight: 600; | ||
| 70 | + color: #4a4a4a | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + .input-icon input { | ||
| 74 | + height: 48px; | ||
| 75 | + border-radius: 5px !important; | ||
| 76 | + transition: all .5s ease; | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + .input-icon input:FOCUS { | ||
| 80 | + border-color: #c2cad8; | ||
| 81 | + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12) !important; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + .input-icon>i { | ||
| 85 | + margin-top: 16px; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + #loginPanel #loginBtn.btn{ | ||
| 89 | + border-radius: 6px !important; | ||
| 90 | + width: 378px; | ||
| 91 | + height: 48px; | ||
| 92 | + font-size: 20px; | ||
| 93 | + font-family: 微软雅黑; | ||
| 94 | + transition: all .3s ease; | ||
| 95 | + | ||
| 96 | + background: #5f7ed7; | ||
| 97 | + background: linear-gradient(#6f97e5,#527ed9); | ||
| 98 | + box-shadow: inset 0 1px 2px #7ea1e8 !important; | ||
| 99 | + color: #fff; | ||
| 100 | + text-shadow: #4f70b3 0 -1px 0; | ||
| 101 | + border: none; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + #loginPanel #loginBtn.btn:HOVER { | ||
| 105 | + box-shadow: inset 0 1px 1px #7696de,inset 0 0 2px #627dca,inset 0 -2px 3px #5a77c7,inset 0 0 100px rgba(48,77,147,.4) !important; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + #loginPanel.show_msg{ | ||
| 110 | + top: calc(50% - 10px); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + #loginPanel .alert{ | ||
| 114 | + display: none; | ||
| 115 | + padding: 12px; | ||
| 116 | + margin-top: 21px; | ||
| 117 | + border-radius: 0 0 10px 10px !important; | ||
| 118 | + font-size: 13px; | ||
| 119 | + | ||
| 120 | + position: absolute; | ||
| 121 | + width: 100%; | ||
| 122 | + border-bottom: 1px solid #dadada; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + #loginPanel .alert.login-success{ | ||
| 126 | + color: #27a4b0; | ||
| 127 | + background: #abe7ed; | ||
| 128 | + border-color: #abe7ed; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + #loginPanel .alert i{ | ||
| 132 | + font-size: 16px; | ||
| 133 | + vertical-align: middle; | ||
| 134 | + margin: 0 5px 3px; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + #loginPanel.show_msg .alert{ | ||
| 138 | + display: block; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + #captchaWrap{ | ||
| 142 | + display: none; | ||
| 143 | + text-align: left; | ||
| 144 | + border-top: 1px solid #f3f2f2; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + img.captcha-img{ | ||
| 148 | + cursor: pointer; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + .login-footer{ | ||
| 152 | + position: fixed; | ||
| 153 | + width: 100%; | ||
| 154 | + bottom: 35px; | ||
| 155 | + text-align: center; | ||
| 156 | + color: #a6a6a6; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + h3.logo-text{ | ||
| 160 | + font-family: 华文楷体,华文细黑; | ||
| 161 | + font-size: 28px; | ||
| 162 | + } | ||
| 163 | + | ||
| 164 | + .warn-note{ | ||
| 165 | + width: 100%; | ||
| 166 | + position: absolute; | ||
| 167 | + top: 0; | ||
| 168 | + z-index: 2; | ||
| 169 | + text-align: center; | ||
| 170 | + background: #ff4646; | ||
| 171 | + color: white; | ||
| 172 | + padding: 12px; | ||
| 173 | + display: none; | ||
| 174 | + } | ||
| 175 | + </style> | ||
| 176 | +</head> | ||
| 177 | + | ||
| 178 | +<body> | ||
| 179 | +<div class="warn-note">警告!系统目前仅在 WebKit 内核下完成兼容性测试,请使用 Google | ||
| 180 | + Chrome 浏览器进入系统。</div> | ||
| 181 | +<div class="wrapper ng-scope"> | ||
| 182 | + <div id="loginPanel" class="dialog dialog-shadow"> | ||
| 183 | + <br> | ||
| 184 | + <h3 class="logo-text">临港公交调度系统</h3> | ||
| 185 | + <hr> | ||
| 186 | + <form style="padding: 0px 35px;"> | ||
| 187 | + <div class="form-group" style="margin-bottom: 0"> | ||
| 188 | + <label></label> | ||
| 189 | + <div class="input-icon"> | ||
| 190 | + <i class="fa fa-user font-gray"></i> <input type="text" | ||
| 191 | + name="userName" class="form-control" placeholder="输入用户名" | ||
| 192 | + autofocus="autofocus" autocomplete="off"> | ||
| 193 | + </div> | ||
| 194 | + </div> | ||
| 195 | + | ||
| 196 | + <div class="form-group"> | ||
| 197 | + <label></label> | ||
| 198 | + <div class="input-icon"> | ||
| 199 | + <i class="fa fa-key font-gray"></i> <input type="password" | ||
| 200 | + name="password" class="form-control" placeholder="输入密码"> | ||
| 201 | + </div> | ||
| 202 | + </div> | ||
| 203 | + | ||
| 204 | + <div class="form-group" id="captchaWrap"> | ||
| 205 | + <label></label> | ||
| 206 | + <div class="input-icon"> | ||
| 207 | + <input type="text" name="captcha" style="width: 153px !important;" | ||
| 208 | + class="form-control input-inline input-medium" | ||
| 209 | + placeholder="输入验证码"> <span class="help-inline"> <img | ||
| 210 | + alt="验证码" class="captcha-img" title="点击刷新验证码"> | ||
| 211 | + </span> | ||
| 212 | + </div> | ||
| 213 | + </div> | ||
| 214 | + </form> | ||
| 215 | + <br> | ||
| 216 | + <br> | ||
| 217 | + <div class="form-actions"> | ||
| 218 | + <button class="btn blue-steel" id="loginBtn" disabled="disabled">登录</button> | ||
| 219 | + </div> | ||
| 220 | + | ||
| 221 | + <div class="alert alert-danger"></div> | ||
| 222 | + </div> | ||
| 223 | + | ||
| 224 | + <div class="login-footer">© 2016 上海巴士拓华科技发展有限公司 Some Rights | ||
| 225 | + Reserved</div> | ||
| 226 | +</div> | ||
| 227 | + | ||
| 228 | +<script> | ||
| 229 | + delete window.require; | ||
| 230 | + delete window.exports; | ||
| 231 | + delete window.module; | ||
| 232 | +</script> | ||
| 233 | +<!-- jQuery --> | ||
| 234 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | ||
| 235 | +<script src="/assets/plugins/jsencrypt.min.js"></script> | ||
| 236 | +<script> | ||
| 237 | + window.onload=function(){ | ||
| 238 | + var body=document.getElementsByTagName("body")[0]; | ||
| 239 | + if(typeof body.style.WebkitAnimation=="undefined") | ||
| 240 | + $('.warn-note').fadeIn(); | ||
| 241 | + }; | ||
| 242 | + !function(){ | ||
| 243 | + var form = $('#loginPanel form') | ||
| 244 | + ,nameInput = $('input[name=userName]', form) | ||
| 245 | + ,pwdInput = $('input[name=password]', form) | ||
| 246 | + ,msgAlert = $('#loginPanel .alert-danger'); | ||
| 247 | + | ||
| 248 | + $('input', form).on('keyup', checkBtnStatus); | ||
| 249 | + | ||
| 250 | + var keys; | ||
| 251 | + $.get('/user/login/jCryptionKey?t='+Math.random(), function(data){ | ||
| 252 | + keys = data.publickey; | ||
| 253 | + }); | ||
| 254 | + | ||
| 255 | + | ||
| 256 | + | ||
| 257 | + function checkBtnStatus(){ | ||
| 258 | + var es = $('input:visible', form); | ||
| 259 | + for(var i = 0, e; e = es[i++];){ | ||
| 260 | + if($.trim($(e).val()) == ''){ | ||
| 261 | + $('#loginBtn').attr('disabled', 'disabled'); | ||
| 262 | + $('#loginPanel').removeClass('show_msg'); | ||
| 263 | + return; | ||
| 264 | + } | ||
| 265 | + } | ||
| 266 | + $('#loginBtn').removeAttr('disabled'); | ||
| 267 | + } | ||
| 268 | + | ||
| 269 | + nameInput.on('blur', checkStatus); | ||
| 270 | + //keyup 事件做延迟 | ||
| 271 | + var uNameKeyup; | ||
| 272 | + nameInput.on('keyup', function(){ | ||
| 273 | + if(uNameKeyup) | ||
| 274 | + return; | ||
| 275 | + uNameKeyup = true; | ||
| 276 | + setTimeout(function(){ | ||
| 277 | + checkStatus(); | ||
| 278 | + uNameKeyup = false; | ||
| 279 | + }, 200); | ||
| 280 | + }); | ||
| 281 | + | ||
| 282 | + //密码框回车事件 | ||
| 283 | + pwdInput.on('keyup', function(e){ | ||
| 284 | + if (e.keyCode == 13) | ||
| 285 | + $('#loginBtn').click(); | ||
| 286 | + }); | ||
| 287 | + //验证码框回车事件 | ||
| 288 | + $('input[name=captcha]').on('keyup', function(e){ | ||
| 289 | + if (e.keyCode == 13) | ||
| 290 | + $('#loginBtn').click(); | ||
| 291 | + }); | ||
| 292 | + | ||
| 293 | + $('#loginBtn').on('click', function(){ | ||
| 294 | + if(lock || $(this).attr('disabled')) return; | ||
| 295 | + var userName = nameInput.val() | ||
| 296 | + ,pwd = pwdInput.val(); | ||
| 297 | + | ||
| 298 | + //RSA加密 | ||
| 299 | + var encrypt = new JSEncrypt(); | ||
| 300 | + encrypt.setPublicKey(keys); | ||
| 301 | + userName = encrypt.encrypt(userName); | ||
| 302 | + pwd = encrypt.encrypt(pwd); | ||
| 303 | + //登录 | ||
| 304 | + login(userName, pwd); | ||
| 305 | + }); | ||
| 306 | + | ||
| 307 | + var lock; | ||
| 308 | + function login(userName, pwd){ | ||
| 309 | + lock = true; | ||
| 310 | + $('#loginBtn').attr('disabled', 'disabled'); | ||
| 311 | + | ||
| 312 | + var params = { | ||
| 313 | + userName: userName, | ||
| 314 | + password: pwd, | ||
| 315 | + captcha: $('input[name=captcha]').val() | ||
| 316 | + }; | ||
| 317 | + $.post('/user/login', params | ||
| 318 | + ,function(rs){ | ||
| 319 | + | ||
| 320 | + $('#loginPanel').addClass('show_msg'); | ||
| 321 | + if(error(rs)){ | ||
| 322 | + lock = false; | ||
| 323 | + $('#loginBtn').removeAttr('disabled'); | ||
| 324 | + | ||
| 325 | + msgAlert.html('<i class="fa fa-times-circle"> </i> 登录失败,' + rs.msg); | ||
| 326 | + | ||
| 327 | + _captcha.refresh(); | ||
| 328 | + checkStatus(); | ||
| 329 | + } | ||
| 330 | + else{ | ||
| 331 | + msgAlert.html('<i class="fa fa-check"> </i> 登录成功!'); | ||
| 332 | + msgAlert.addClass('login-success'); | ||
| 333 | + window.location.href = '/'; | ||
| 334 | + } | ||
| 335 | + }); | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + function checkStatus(){ | ||
| 339 | + var t = nameInput.val(); | ||
| 340 | + if(!t){ | ||
| 341 | + hide(); | ||
| 342 | + return; | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + $.get('/user/login/captchaStatus', {userName: t}, function(rs){ | ||
| 346 | + if(rs >= 3) | ||
| 347 | + _captcha.show(); | ||
| 348 | + else | ||
| 349 | + hide(); | ||
| 350 | + }); | ||
| 351 | + | ||
| 352 | + function hide(){ | ||
| 353 | + if(!$("#captchaWrap").is(":hidden")){ | ||
| 354 | + _captcha.hide(); | ||
| 355 | + //隐藏提示消息 | ||
| 356 | + msgAlert.html(''); | ||
| 357 | + $('#loginPanel').removeClass('show_msg'); | ||
| 358 | + } | ||
| 359 | + } | ||
| 360 | + } | ||
| 361 | + | ||
| 362 | + | ||
| 363 | + var _captcha = { | ||
| 364 | + show: function(){ | ||
| 365 | + if($("#captchaWrap").is(":hidden")){ | ||
| 366 | + $('#captchaWrap').fadeIn(500); | ||
| 367 | + _captcha.refresh(); | ||
| 368 | + checkBtnStatus(); | ||
| 369 | + } | ||
| 370 | + }, | ||
| 371 | + refresh: function(){ | ||
| 372 | + if($("#captchaWrap").is(":hidden")) | ||
| 373 | + return; | ||
| 374 | + $('#captchaWrap img.captcha-img').attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 375 | + }, | ||
| 376 | + hide: function(){ | ||
| 377 | + $('#captchaWrap').hide(); | ||
| 378 | + $('input[name=captcha]').val(''); | ||
| 379 | + } | ||
| 380 | + }; | ||
| 381 | + | ||
| 382 | + $('#captchaWrap img.captcha-img').on('click', function(){ | ||
| 383 | + $(this).attr('src', '/captcha.jpg?t=' + Math.random()); | ||
| 384 | + }); | ||
| 385 | + | ||
| 386 | + function error(rs){ | ||
| 387 | + return rs.status == 'ERROR' || rs.status == 500; | ||
| 388 | + } | ||
| 389 | + }(); | ||
| 390 | +</script> | ||
| 391 | +</body> | ||
| 392 | </html> | 392 | </html> |
| 393 | \ No newline at end of file | 393 | \ No newline at end of file |
src/main/resources/static/pages/control/line/index.html
| 1 | -<link href="/pages/control/line/css/lineControl.css" rel="stylesheet" type="text/css" /> | ||
| 2 | -<link href="/metronic_v4.5.4/css/animate.min.css" rel="stylesheet" type="text/css" /> | ||
| 3 | - | ||
| 4 | -<!-- 初始load界面 --> | ||
| 5 | -<div class="load-anim" > | ||
| 6 | - <div class="load-anim-list"> | ||
| 7 | - <div class="spinner"></div> | ||
| 8 | - <!-- <div class="item load_resource">加载资源文件...</div> --> | ||
| 9 | -<!-- <div class="item">校准客户端时间...</div> | ||
| 10 | - <div class="item">加载GPS模块...</div> | ||
| 11 | - <div class="item">加载班次信息...</div> | ||
| 12 | - <div class="item">webSocket 连接...</div> --> | ||
| 13 | - </div> | ||
| 14 | -</div> | ||
| 15 | - | ||
| 16 | -<div class="portlet light portlet-fullscreen" style="transition: all .5s ease;padding: 0;" oncontextmenu=self.event.returnValue=false> | ||
| 17 | - | ||
| 18 | - <div class="portlet-title banner" > | ||
| 19 | - <div class="caption col_hide_1280" style="color: #FFF;"> | ||
| 20 | - <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span | ||
| 21 | - class="caption-subject bold" style="font-size: 24px;">浦东公交线路调度系统</span> | ||
| 22 | - </div> | ||
| 23 | - <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;"> | ||
| 24 | - <span class="top_username"></span> <span class="operation_mode_text animated" ></span> | ||
| 25 | - </div> | ||
| 26 | - <div class="actions col_hide_1280" > | ||
| 27 | - <div class="btn-group"> | ||
| 28 | - | ||
| 29 | - <div class="btn-group"> | ||
| 30 | - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" > | ||
| 31 | - <i class="fa fa-database"></i> 基础数据 | ||
| 32 | - <i class="fa fa-angle-down"></i> | ||
| 33 | - </button> | ||
| 34 | - <ul class="dropdown-menu"> | ||
| 35 | - <li> | ||
| 36 | - <a href="javascript:;" id=""> 车辆配置 </a> | ||
| 37 | - </li> | ||
| 38 | - <li> | ||
| 39 | - <a href="javascript:;" id=""> 人员配置 </a> | ||
| 40 | - </li> | ||
| 41 | - </ul> | ||
| 42 | - </div> | ||
| 43 | - | ||
| 44 | - <div class="btn-group"> | ||
| 45 | - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" > | ||
| 46 | - <i class="fa fa-bus"></i> 车载设备 | ||
| 47 | - <i class="fa fa-angle-down"></i> | ||
| 48 | - </button> | ||
| 49 | - <ul class="dropdown-menu"> | ||
| 50 | - <li> | ||
| 51 | - <a href="javascript:;" id="deviceConfig"> 设备管理 </a> | ||
| 52 | - </li> | ||
| 53 | - <li> | ||
| 54 | - <a href="javascript:;" id="deviceReport"> 设备上报记录 </a> | ||
| 55 | - </li> | ||
| 56 | - <li> | ||
| 57 | - <a href="javascript:;" id="msgAndDirect"> 指令下发记录 </a> | ||
| 58 | - </li> | ||
| 59 | - </ul> | ||
| 60 | - </div> | ||
| 61 | - | ||
| 62 | - <div class="btn-group"> | ||
| 63 | - <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" > | ||
| 64 | - <i class="fa fa-gavel"></i> 系统设置 | ||
| 65 | - <i class="fa fa-angle-down"></i> | ||
| 66 | - </button> | ||
| 67 | - <ul class="dropdown-menu"> | ||
| 68 | - <li> | ||
| 69 | - <a href="javascript:;" id="ttsConfigure"> TTS 语音设置 </a> | ||
| 70 | - </li> | ||
| 71 | - <li> | ||
| 72 | - <a href="javascript:;" id="updateLogLink"> 更新日志 </a> | ||
| 73 | - </li> | ||
| 74 | - </ul> | ||
| 75 | - </div> | ||
| 76 | - | ||
| 77 | - <button id="exitBtn" type="button" class="btn btn-danger" style="margin-left: 8px;padding: 6.5px 9px !important;" > | ||
| 78 | - <!-- <i class="fa fa-close" ></i> -->退出线路调度</button> | ||
| 79 | - </div> | ||
| 80 | - </div> | ||
| 81 | - </div> | ||
| 82 | - <div class="portlet-body" id="top-tabs-wrap" > | ||
| 83 | - <ul class="nav nav-tabs top-nav" > | ||
| 84 | - <li class="active"> | ||
| 85 | - <a href="#tab_home" data-toggle="tab" aria-expanded="false" style="padding: 10px 15px;"> | ||
| 86 | - <i class="fa fa-home"></i> 主页 | ||
| 87 | - </a> | ||
| 88 | - </li> | ||
| 89 | - <li class=""><a href="#tab_map" data-toggle="tab" style="padding: 10px 15px;" | ||
| 90 | - aria-expanded="false"><i class="fa fa-map"></i> 地图 </a></li> | ||
| 91 | - </ul> | ||
| 92 | - | ||
| 93 | - <div class="tab-content" > | ||
| 94 | - <div class="tab-pane fade active in" id="tab_home" ></div> | ||
| 95 | - <div class="tab-pane fade" id="tab_map" style="position: relative;"></div> | ||
| 96 | - | ||
| 97 | - <!-- <div class="tab-pane fade tab_line active in" id="tab_line" > | ||
| 98 | - | ||
| 99 | - </div> --> | ||
| 100 | - </div> | ||
| 101 | - </div> | ||
| 102 | -<div id="tooltipShade" class="animated fadeIn"></div> | ||
| 103 | - | ||
| 104 | -<div id="menuWrap"></div> | ||
| 105 | -<!-- 线路调度右键菜单 --> | ||
| 106 | -<menu class="menu" id="rightMenu" style="display: none;"> | ||
| 107 | - <li class="menu-item submenu"> | ||
| 108 | - <button type="button" class="menu-btn" data-method="outgoAdjust"> | ||
| 109 | - <span class="menu-text">待发调整</span> | ||
| 110 | - </button> | ||
| 111 | - <menu class="menu"> | ||
| 112 | - <li class="menu-item"> | ||
| 113 | - <button type="button" class="menu-btn" data-method="outgoAdjust"> | ||
| 114 | - <span class="menu-text">基于班次</span> | ||
| 115 | - </button> | ||
| 116 | - </li> | ||
| 117 | - <li class="menu-item"> | ||
| 118 | - <button type="button" class="menu-btn" data-method="outgoAdjustAll"> | ||
| 119 | - <span class="menu-text">基于车辆</span> | ||
| 120 | - </button> | ||
| 121 | - </li> | ||
| 122 | - </menu> | ||
| 123 | - </li> | ||
| 124 | - | ||
| 125 | - | ||
| 126 | - <li class="menu-separator"></li> | ||
| 127 | - <li class="menu-item" > | ||
| 128 | - <button type="button" class="menu-btn" data-method="planDestroy"> | ||
| 129 | - <span class="menu-text">计划烂班</span> | ||
| 130 | - </button> | ||
| 131 | - </li> | ||
| 132 | - <li class="menu-item" > | ||
| 133 | - <button type="button" class="menu-btn" data-method="revokeDestroy"> | ||
| 134 | - <span class="menu-text">撤销烂班</span> | ||
| 135 | - </button> | ||
| 136 | - </li> | ||
| 137 | - <li class="menu-item" > | ||
| 138 | - <button type="button" class="menu-btn" data-method="realOutgoAdjust"> | ||
| 139 | - <span class="menu-text">实发调整</span> | ||
| 140 | - </button> | ||
| 141 | - </li> | ||
| 142 | - <li class="menu-item" > | ||
| 143 | - <button type="button" class="menu-btn" data-method="revokeRealOutgo"> | ||
| 144 | - <span class="menu-text">撤销实发</span> | ||
| 145 | - </button> | ||
| 146 | - </li> | ||
| 147 | - <li class="menu-separator"></li> | ||
| 148 | - <li class="menu-item" > | ||
| 149 | - <button type="button" class="menu-btn" data-multi=1 data-method="spaceAdjust"> | ||
| 150 | - <span class="menu-text">间隔调整</span> | ||
| 151 | - </button> | ||
| 152 | - </li> | ||
| 153 | - <!-- <li class="menu-item disabled" > | ||
| 154 | - <button type="button" class="menu-btn"> | ||
| 155 | - <span class="menu-text">误点调整</span> | ||
| 156 | - </button> | ||
| 157 | - </li> --> | ||
| 158 | - <li class="menu-item" > | ||
| 159 | - <button type="button" class="menu-btn" data-method="schInfoFineTune"> | ||
| 160 | - <span class="menu-text">发车信息微调</span> | ||
| 161 | - </button> | ||
| 162 | - </li> | ||
| 163 | - <li class="menu-separator"></li> | ||
| 164 | - <li class="menu-item" > | ||
| 165 | - <button type="button" class="menu-btn" data-method="childTask"> | ||
| 166 | - <i class="fa fa-plus"></i> | ||
| 167 | - <span class="menu-text">临加/子任务</span> | ||
| 168 | - </button> | ||
| 169 | - </li> | ||
| 170 | - <li class="menu-separator"></li> | ||
| 171 | - <li class="menu-item" > | ||
| 172 | - <button type="button" class="menu-btn" data-method="vehicAndPerAdjust"> | ||
| 173 | - <i class="fa fa-retweet"></i> | ||
| 174 | - <span class="menu-text">调整车/人</span> | ||
| 175 | - </button> | ||
| 176 | - </li> | ||
| 177 | - <li class="menu-separator"></li> | ||
| 178 | - <li class="menu-item" > | ||
| 179 | - <button type="button" class="menu-btn" data-method="directiveRepeat"> | ||
| 180 | - <i class="fa fa-bell-o"></i> | ||
| 181 | - <span class="menu-text">指令重发</span> | ||
| 182 | - </button> | ||
| 183 | - </li> | ||
| 184 | -</menu> | ||
| 185 | -<!-- 主页右键菜单 --> | ||
| 186 | -<menu class="menu" id="homeMenu" style="display: none;"> | ||
| 187 | - <li class="menu-item disabled" id="menu-linename"> | ||
| 188 | - <button type="button" class="menu-btn"> | ||
| 189 | - <span class="menu-text">--- <span class="menu-title-nbbm"></span> ---</span> | ||
| 190 | - </button> | ||
| 191 | - </li> | ||
| 192 | - <li class="menu-item" > | ||
| 193 | - <button type="button" class="menu-btn" data-method="sendPhrase"> | ||
| 194 | - <span class="menu-text">发送消息短语</span> | ||
| 195 | - </button> | ||
| 196 | - </li> | ||
| 197 | - <li class="menu-separator"></li> | ||
| 198 | - <li class="menu-item" > | ||
| 199 | - <button type="button" class="menu-btn" data-method="showState"> | ||
| 200 | - <span class="menu-text">车辆状态查看</span> | ||
| 201 | - </button> | ||
| 202 | - </li> | ||
| 203 | - <li class="menu-item submenu"> | ||
| 204 | - <button type="button" class="menu-btn"> | ||
| 205 | - <span class="menu-text">车辆状态切换</span> | ||
| 206 | - </button> | ||
| 207 | - <menu class="menu"> | ||
| 208 | - <li class="menu-item"> | ||
| 209 | - <button type="button" class="menu-btn" data-method="changeUp"> | ||
| 210 | - <span class="menu-text">上行营运</span> | ||
| 211 | - </button> | ||
| 212 | - </li> | ||
| 213 | - <li class="menu-item"> | ||
| 214 | - <button type="button" class="menu-btn" data-method="changeDown"> | ||
| 215 | - <span class="menu-text">下行营运</span> | ||
| 216 | - </button> | ||
| 217 | - </li> | ||
| 218 | - </menu> | ||
| 219 | - </li> | ||
| 220 | -</menu> | ||
| 221 | - | ||
| 222 | -<div class="ctm-note animated bounceInDown"> | ||
| 223 | - <div class="content"></div> | ||
| 224 | -</div> | ||
| 225 | -</div> | ||
| 226 | -<div id="temps"></div> | ||
| 227 | - | ||
| 228 | -<div id="tooltip" style="display: none;"> | ||
| 229 | -</div> | ||
| 230 | - | ||
| 231 | -<script> | ||
| 232 | -//JS文件加载计数,countDownLatch为0 时则加载完成 | ||
| 233 | -var countDownLatch = 13; | ||
| 234 | -function countDown(name){ | ||
| 235 | - countDownLatch --; | ||
| 236 | - if(!countDownLatch) | ||
| 237 | - _main.start(); | ||
| 238 | - | ||
| 239 | - console.log('countDown: ' + countDownLatch, 'file: ' + name); | ||
| 240 | -} | ||
| 241 | -</script> | ||
| 242 | -<script src="/assets/js/eventproxy.js"></script> | ||
| 243 | - | ||
| 244 | -<script src="/pages/control/line/js/main.js"></script> | ||
| 245 | -<script src="/pages/control/line/js/tooltip.js"></script> | ||
| 246 | -<script src="/pages/control/line/js/drawSvg.js"></script> | ||
| 247 | -<script src="/pages/control/line/js/data.js"></script> | ||
| 248 | -<script src="/pages/control/line/js/rightMenu.js"></script> | ||
| 249 | -<script src="/pages/control/line/js/homeMenu.js"></script> | ||
| 250 | -<script src="/pages/control/line/js/alone.js"></script> | ||
| 251 | -<script src="/pages/control/line/js/messenger.js"></script> | ||
| 252 | -<script src="/pages/control/line/js/keyboardListen.js"></script> | ||
| 253 | -<script src="/pages/control/line/js/toolbarEvent.js"></script> | ||
| 254 | -<script src="/pages/control/line/js/speech.js" data-exclude=1></script> | ||
| 255 | -<script src="/pages/control/line/js/home.js"></script> | ||
| 256 | - | ||
| 257 | -<script> | ||
| 258 | -var updateLog = { | ||
| 259 | - text: '<div class="updete_log"><p>1、过滤掉未加入调度配置的GPS信号。</p></div>' | ||
| 260 | - ,title: '2016年9月13号更新日志' | ||
| 261 | -} | ||
| 262 | - | ||
| 263 | -var lineCodes = '' //全部线路编码字符串,由data.js初始化 | ||
| 264 | - , lineMap = {} //编码和线路详细对照,由data.js初始化; | ||
| 265 | - ,animationend = 'webkitAnimationEnd animationend'; | ||
| 266 | -moment.locale('zh-cn'); | ||
| 267 | - | ||
| 268 | -var cUser | ||
| 269 | - , storage = window.localStorage | ||
| 270 | - , operationMode = storage.getItem('operationMode'); | ||
| 271 | - | ||
| 272 | -//当前用户 | ||
| 273 | -$.get('/user/currentUser', function(user){ | ||
| 274 | - cUser = user; | ||
| 275 | - $('.portlet-fullscreen .top_username').text(cUser.userName) | ||
| 276 | - var t = operationMode == 0?',<abbr title="系统将对当前的提交请求进行拦截">监控模式</abbr> 在线' | ||
| 277 | - :',主调模式 在线'; | ||
| 278 | - $('.portlet-fullscreen .operation_mode_text').html(t); | ||
| 279 | -}); | ||
| 280 | - | ||
| 281 | -//打个标记 | ||
| 282 | -storage.setItem('real_control_flag', 1); | ||
| 283 | - | ||
| 284 | -var reqCodeMap = {0xA1: '请求恢复运营', 0xA2: '申请调档', 0xA3: '出场请求', 0xA5: '进场请求', 0xA7: '加油请求', 0x50: '车辆故障', 0x70: '路阻报告', 0x60: '事故报告', 0x11: '扣证纠纷', 0x12 : '报警'}; | ||
| 285 | - | ||
| 286 | -function _fadeOut($that){ | ||
| 287 | - $that.fadeOut('normal', function(){ | ||
| 288 | - $that.remove(); | ||
| 289 | - }); | ||
| 290 | -} | ||
| 291 | -$(function() { | ||
| 292 | - //主调和监控模式横幅颜色 | ||
| 293 | - if(operationMode == 0) | ||
| 294 | - $('.portlet-fullscreen').addClass('monitor'); | ||
| 295 | - else | ||
| 296 | - $('.portlet-fullscreen').addClass('main'); | ||
| 297 | - | ||
| 298 | - //加载模板文件 | ||
| 299 | - getTemp('temps/home_tp.html'); | ||
| 300 | - getTemp('temps/tooltip_tp.html'); | ||
| 301 | - getTemp('temps/alone_tp.html'); | ||
| 302 | - getTemp('temps/child_task_case_tp.html'); | ||
| 303 | - getTemp('temps/messenger.html'); | ||
| 304 | - | ||
| 305 | - function getTemp(url){ | ||
| 306 | - $.get(url, function(template){ | ||
| 307 | - $('#temps').append(template); | ||
| 308 | - }); | ||
| 309 | - } | ||
| 310 | -}); | ||
| 311 | - | ||
| 312 | -//监控模式下拦截POST请求 | ||
| 313 | -function interceptPOST(e, xhr, t){ | ||
| 314 | - if(t && (t.method == 'POST' || t.type == 'POST')){ | ||
| 315 | - console.log(e, xhr, t); | ||
| 316 | - xhr.abort(); | ||
| 317 | - layer.msg('监控模式!',{offset: 'ct', shift : 6}); | ||
| 318 | - } | ||
| 319 | -} | ||
| 320 | - | ||
| 321 | -</script> | 1 | +<link href="/pages/control/line/css/lineControl.css" rel="stylesheet" type="text/css" /> |
| 2 | +<link href="/metronic_v4.5.4/css/animate.min.css" rel="stylesheet" type="text/css" /> | ||
| 3 | + | ||
| 4 | +<!-- 初始load界面 --> | ||
| 5 | +<div class="load-anim" > | ||
| 6 | + <div class="load-anim-list"> | ||
| 7 | + <div class="spinner"></div> | ||
| 8 | + <!-- <div class="item load_resource">加载资源文件...</div> --> | ||
| 9 | +<!-- <div class="item">校准客户端时间...</div> | ||
| 10 | + <div class="item">加载GPS模块...</div> | ||
| 11 | + <div class="item">加载班次信息...</div> | ||
| 12 | + <div class="item">webSocket 连接...</div> --> | ||
| 13 | + </div> | ||
| 14 | +</div> | ||
| 15 | + | ||
| 16 | +<div class="portlet light portlet-fullscreen" style="transition: all .5s ease;padding: 0;" oncontextmenu=self.event.returnValue=false> | ||
| 17 | + | ||
| 18 | + <div class="portlet-title banner" > | ||
| 19 | + <div class="caption col_hide_1280" style="color: #FFF;"> | ||
| 20 | + <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span | ||
| 21 | + class="caption-subject bold" style="font-size: 24px;">临港公交线路调度系统</span> | ||
| 22 | + </div> | ||
| 23 | + <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;"> | ||
| 24 | + <span class="top_username"></span> <span class="operation_mode_text animated" ></span> | ||
| 25 | + </div> | ||
| 26 | + <div class="actions col_hide_1280" > | ||
| 27 | + <div class="btn-group"> | ||
| 28 | + | ||
| 29 | + <div class="btn-group"> | ||
| 30 | + <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" > | ||
| 31 | + <i class="fa fa-database"></i> 基础数据 | ||
| 32 | + <i class="fa fa-angle-down"></i> | ||
| 33 | + </button> | ||
| 34 | + <ul class="dropdown-menu"> | ||
| 35 | + <li> | ||
| 36 | + <a href="javascript:;" id=""> 车辆配置 </a> | ||
| 37 | + </li> | ||
| 38 | + <li> | ||
| 39 | + <a href="javascript:;" id=""> 人员配置 </a> | ||
| 40 | + </li> | ||
| 41 | + </ul> | ||
| 42 | + </div> | ||
| 43 | + | ||
| 44 | + <div class="btn-group"> | ||
| 45 | + <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" > | ||
| 46 | + <i class="fa fa-bus"></i> 车载设备 | ||
| 47 | + <i class="fa fa-angle-down"></i> | ||
| 48 | + </button> | ||
| 49 | + <ul class="dropdown-menu"> | ||
| 50 | + <li> | ||
| 51 | + <a href="javascript:;" id="deviceConfig"> 设备管理 </a> | ||
| 52 | + </li> | ||
| 53 | + <li> | ||
| 54 | + <a href="javascript:;" id="deviceReport"> 设备上报记录 </a> | ||
| 55 | + </li> | ||
| 56 | + <li> | ||
| 57 | + <a href="javascript:;" id="msgAndDirect"> 指令下发记录 </a> | ||
| 58 | + </li> | ||
| 59 | + </ul> | ||
| 60 | + </div> | ||
| 61 | + | ||
| 62 | + <div class="btn-group"> | ||
| 63 | + <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" > | ||
| 64 | + <i class="fa fa-gavel"></i> 系统设置 | ||
| 65 | + <i class="fa fa-angle-down"></i> | ||
| 66 | + </button> | ||
| 67 | + <ul class="dropdown-menu"> | ||
| 68 | + <li> | ||
| 69 | + <a href="javascript:;" id="ttsConfigure"> TTS 语音设置 </a> | ||
| 70 | + </li> | ||
| 71 | + <li> | ||
| 72 | + <a href="javascript:;" id="updateLogLink"> 更新日志 </a> | ||
| 73 | + </li> | ||
| 74 | + </ul> | ||
| 75 | + </div> | ||
| 76 | + | ||
| 77 | + <button id="exitBtn" type="button" class="btn btn-danger" style="margin-left: 8px;padding: 6.5px 9px !important;" > | ||
| 78 | + <!-- <i class="fa fa-close" ></i> -->退出线路调度</button> | ||
| 79 | + </div> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + <div class="portlet-body" id="top-tabs-wrap" > | ||
| 83 | + <ul class="nav nav-tabs top-nav" > | ||
| 84 | + <li class="active"> | ||
| 85 | + <a href="#tab_home" data-toggle="tab" aria-expanded="false" style="padding: 10px 15px;"> | ||
| 86 | + <i class="fa fa-home"></i> 主页 | ||
| 87 | + </a> | ||
| 88 | + </li> | ||
| 89 | + <li class=""><a href="#tab_map" data-toggle="tab" style="padding: 10px 15px;" | ||
| 90 | + aria-expanded="false"><i class="fa fa-map"></i> 地图 </a></li> | ||
| 91 | + </ul> | ||
| 92 | + | ||
| 93 | + <div class="tab-content" > | ||
| 94 | + <div class="tab-pane fade active in" id="tab_home" ></div> | ||
| 95 | + <div class="tab-pane fade" id="tab_map" style="position: relative;"></div> | ||
| 96 | + | ||
| 97 | + <!-- <div class="tab-pane fade tab_line active in" id="tab_line" > | ||
| 98 | + | ||
| 99 | + </div> --> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | +<div id="tooltipShade" class="animated fadeIn"></div> | ||
| 103 | + | ||
| 104 | +<div id="menuWrap"></div> | ||
| 105 | +<!-- 线路调度右键菜单 --> | ||
| 106 | +<menu class="menu" id="rightMenu" style="display: none;"> | ||
| 107 | + <li class="menu-item submenu"> | ||
| 108 | + <button type="button" class="menu-btn" data-method="outgoAdjust"> | ||
| 109 | + <span class="menu-text">待发调整</span> | ||
| 110 | + </button> | ||
| 111 | + <menu class="menu"> | ||
| 112 | + <li class="menu-item"> | ||
| 113 | + <button type="button" class="menu-btn" data-method="outgoAdjust"> | ||
| 114 | + <span class="menu-text">基于班次</span> | ||
| 115 | + </button> | ||
| 116 | + </li> | ||
| 117 | + <li class="menu-item"> | ||
| 118 | + <button type="button" class="menu-btn" data-method="outgoAdjustAll"> | ||
| 119 | + <span class="menu-text">基于车辆</span> | ||
| 120 | + </button> | ||
| 121 | + </li> | ||
| 122 | + </menu> | ||
| 123 | + </li> | ||
| 124 | + | ||
| 125 | + | ||
| 126 | + <li class="menu-separator"></li> | ||
| 127 | + <li class="menu-item" > | ||
| 128 | + <button type="button" class="menu-btn" data-method="planDestroy"> | ||
| 129 | + <span class="menu-text">计划烂班</span> | ||
| 130 | + </button> | ||
| 131 | + </li> | ||
| 132 | + <li class="menu-item" > | ||
| 133 | + <button type="button" class="menu-btn" data-method="revokeDestroy"> | ||
| 134 | + <span class="menu-text">撤销烂班</span> | ||
| 135 | + </button> | ||
| 136 | + </li> | ||
| 137 | + <li class="menu-item" > | ||
| 138 | + <button type="button" class="menu-btn" data-method="realOutgoAdjust"> | ||
| 139 | + <span class="menu-text">实发调整</span> | ||
| 140 | + </button> | ||
| 141 | + </li> | ||
| 142 | + <li class="menu-item" > | ||
| 143 | + <button type="button" class="menu-btn" data-method="revokeRealOutgo"> | ||
| 144 | + <span class="menu-text">撤销实发</span> | ||
| 145 | + </button> | ||
| 146 | + </li> | ||
| 147 | + <li class="menu-separator"></li> | ||
| 148 | + <li class="menu-item" > | ||
| 149 | + <button type="button" class="menu-btn" data-multi=1 data-method="spaceAdjust"> | ||
| 150 | + <span class="menu-text">间隔调整</span> | ||
| 151 | + </button> | ||
| 152 | + </li> | ||
| 153 | + <!-- <li class="menu-item disabled" > | ||
| 154 | + <button type="button" class="menu-btn"> | ||
| 155 | + <span class="menu-text">误点调整</span> | ||
| 156 | + </button> | ||
| 157 | + </li> --> | ||
| 158 | + <li class="menu-item" > | ||
| 159 | + <button type="button" class="menu-btn" data-method="schInfoFineTune"> | ||
| 160 | + <span class="menu-text">发车信息微调</span> | ||
| 161 | + </button> | ||
| 162 | + </li> | ||
| 163 | + <li class="menu-separator"></li> | ||
| 164 | + <li class="menu-item" > | ||
| 165 | + <button type="button" class="menu-btn" data-method="childTask"> | ||
| 166 | + <i class="fa fa-plus"></i> | ||
| 167 | + <span class="menu-text">临加/子任务</span> | ||
| 168 | + </button> | ||
| 169 | + </li> | ||
| 170 | + <li class="menu-separator"></li> | ||
| 171 | + <li class="menu-item" > | ||
| 172 | + <button type="button" class="menu-btn" data-method="vehicAndPerAdjust"> | ||
| 173 | + <i class="fa fa-retweet"></i> | ||
| 174 | + <span class="menu-text">调整车/人</span> | ||
| 175 | + </button> | ||
| 176 | + </li> | ||
| 177 | + <li class="menu-separator"></li> | ||
| 178 | + <li class="menu-item" > | ||
| 179 | + <button type="button" class="menu-btn" data-method="directiveRepeat"> | ||
| 180 | + <i class="fa fa-bell-o"></i> | ||
| 181 | + <span class="menu-text">指令重发</span> | ||
| 182 | + </button> | ||
| 183 | + </li> | ||
| 184 | +</menu> | ||
| 185 | +<!-- 主页右键菜单 --> | ||
| 186 | +<menu class="menu" id="homeMenu" style="display: none;"> | ||
| 187 | + <li class="menu-item disabled" id="menu-linename"> | ||
| 188 | + <button type="button" class="menu-btn"> | ||
| 189 | + <span class="menu-text">--- <span class="menu-title-nbbm"></span> ---</span> | ||
| 190 | + </button> | ||
| 191 | + </li> | ||
| 192 | + <li class="menu-item" > | ||
| 193 | + <button type="button" class="menu-btn" data-method="sendPhrase"> | ||
| 194 | + <span class="menu-text">发送消息短语</span> | ||
| 195 | + </button> | ||
| 196 | + </li> | ||
| 197 | + <li class="menu-separator"></li> | ||
| 198 | + <li class="menu-item" > | ||
| 199 | + <button type="button" class="menu-btn" data-method="showState"> | ||
| 200 | + <span class="menu-text">车辆状态查看</span> | ||
| 201 | + </button> | ||
| 202 | + </li> | ||
| 203 | + <li class="menu-item submenu"> | ||
| 204 | + <button type="button" class="menu-btn"> | ||
| 205 | + <span class="menu-text">车辆状态切换</span> | ||
| 206 | + </button> | ||
| 207 | + <menu class="menu"> | ||
| 208 | + <li class="menu-item"> | ||
| 209 | + <button type="button" class="menu-btn" data-method="changeUp"> | ||
| 210 | + <span class="menu-text">上行营运</span> | ||
| 211 | + </button> | ||
| 212 | + </li> | ||
| 213 | + <li class="menu-item"> | ||
| 214 | + <button type="button" class="menu-btn" data-method="changeDown"> | ||
| 215 | + <span class="menu-text">下行营运</span> | ||
| 216 | + </button> | ||
| 217 | + </li> | ||
| 218 | + </menu> | ||
| 219 | + </li> | ||
| 220 | +</menu> | ||
| 221 | + | ||
| 222 | +<div class="ctm-note animated bounceInDown"> | ||
| 223 | + <div class="content"></div> | ||
| 224 | +</div> | ||
| 225 | +</div> | ||
| 226 | +<div id="temps"></div> | ||
| 227 | + | ||
| 228 | +<div id="tooltip" style="display: none;"> | ||
| 229 | +</div> | ||
| 230 | + | ||
| 231 | +<script> | ||
| 232 | +//JS文件加载计数,countDownLatch为0 时则加载完成 | ||
| 233 | +var countDownLatch = 13; | ||
| 234 | +function countDown(name){ | ||
| 235 | + countDownLatch --; | ||
| 236 | + if(!countDownLatch) | ||
| 237 | + _main.start(); | ||
| 238 | + | ||
| 239 | + console.log('countDown: ' + countDownLatch, 'file: ' + name); | ||
| 240 | +} | ||
| 241 | +</script> | ||
| 242 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 243 | + | ||
| 244 | +<script src="/pages/control/line/js/main.js"></script> | ||
| 245 | +<script src="/pages/control/line/js/tooltip.js"></script> | ||
| 246 | +<script src="/pages/control/line/js/drawSvg.js"></script> | ||
| 247 | +<script src="/pages/control/line/js/data.js"></script> | ||
| 248 | +<script src="/pages/control/line/js/rightMenu.js"></script> | ||
| 249 | +<script src="/pages/control/line/js/homeMenu.js"></script> | ||
| 250 | +<script src="/pages/control/line/js/alone.js"></script> | ||
| 251 | +<script src="/pages/control/line/js/messenger.js"></script> | ||
| 252 | +<script src="/pages/control/line/js/keyboardListen.js"></script> | ||
| 253 | +<script src="/pages/control/line/js/toolbarEvent.js"></script> | ||
| 254 | +<script src="/pages/control/line/js/speech.js" data-exclude=1></script> | ||
| 255 | +<script src="/pages/control/line/js/home.js"></script> | ||
| 256 | + | ||
| 257 | +<script> | ||
| 258 | +var updateLog = { | ||
| 259 | + text: '<div class="updete_log"><p>1、过滤掉未加入调度配置的GPS信号。</p></div>' | ||
| 260 | + ,title: '2016年9月13号更新日志' | ||
| 261 | +} | ||
| 262 | + | ||
| 263 | +var lineCodes = '' //全部线路编码字符串,由data.js初始化 | ||
| 264 | + , lineMap = {} //编码和线路详细对照,由data.js初始化; | ||
| 265 | + ,animationend = 'webkitAnimationEnd animationend'; | ||
| 266 | +moment.locale('zh-cn'); | ||
| 267 | + | ||
| 268 | +var cUser | ||
| 269 | + , storage = window.localStorage | ||
| 270 | + , operationMode = storage.getItem('operationMode'); | ||
| 271 | + | ||
| 272 | +//当前用户 | ||
| 273 | +$.get('/user/currentUser', function(user){ | ||
| 274 | + cUser = user; | ||
| 275 | + $('.portlet-fullscreen .top_username').text(cUser.userName) | ||
| 276 | + var t = operationMode == 0?',<abbr title="系统将对当前的提交请求进行拦截">监控模式</abbr> 在线' | ||
| 277 | + :',主调模式 在线'; | ||
| 278 | + $('.portlet-fullscreen .operation_mode_text').html(t); | ||
| 279 | +}); | ||
| 280 | + | ||
| 281 | +//打个标记 | ||
| 282 | +storage.setItem('real_control_flag', 1); | ||
| 283 | + | ||
| 284 | +var reqCodeMap = {0xA1: '请求恢复运营', 0xA2: '申请调档', 0xA3: '出场请求', 0xA5: '进场请求', 0xA7: '加油请求', 0x50: '车辆故障', 0x70: '路阻报告', 0x60: '事故报告', 0x11: '扣证纠纷', 0x12 : '报警'}; | ||
| 285 | + | ||
| 286 | +function _fadeOut($that){ | ||
| 287 | + $that.fadeOut('normal', function(){ | ||
| 288 | + $that.remove(); | ||
| 289 | + }); | ||
| 290 | +} | ||
| 291 | +$(function() { | ||
| 292 | + //主调和监控模式横幅颜色 | ||
| 293 | + if(operationMode == 0) | ||
| 294 | + $('.portlet-fullscreen').addClass('monitor'); | ||
| 295 | + else | ||
| 296 | + $('.portlet-fullscreen').addClass('main'); | ||
| 297 | + | ||
| 298 | + //加载模板文件 | ||
| 299 | + getTemp('temps/home_tp.html'); | ||
| 300 | + getTemp('temps/tooltip_tp.html'); | ||
| 301 | + getTemp('temps/alone_tp.html'); | ||
| 302 | + getTemp('temps/child_task_case_tp.html'); | ||
| 303 | + getTemp('temps/messenger.html'); | ||
| 304 | + | ||
| 305 | + function getTemp(url){ | ||
| 306 | + $.get(url, function(template){ | ||
| 307 | + $('#temps').append(template); | ||
| 308 | + }); | ||
| 309 | + } | ||
| 310 | +}); | ||
| 311 | + | ||
| 312 | +//监控模式下拦截POST请求 | ||
| 313 | +function interceptPOST(e, xhr, t){ | ||
| 314 | + if(t && (t.method == 'POST' || t.type == 'POST')){ | ||
| 315 | + console.log(e, xhr, t); | ||
| 316 | + xhr.abort(); | ||
| 317 | + layer.msg('监控模式!',{offset: 'ct', shift : 6}); | ||
| 318 | + } | ||
| 319 | +} | ||
| 320 | + | ||
| 321 | +</script> | ||
| 322 | <script src="/pages/control/line/js/webSocketHandle.js"></script> | 322 | <script src="/pages/control/line/js/webSocketHandle.js"></script> |
| 323 | \ No newline at end of file | 323 | \ No newline at end of file |
src/main/resources/static/pages/trafficManage/timeTempletUploadRecord.html
| 1 | -<link href="css/trafficManage.css" rel="stylesheet" type="text/css" /> | ||
| 2 | -<link href="css/autocompleter.css" rel="stylesheet" type="text/css" /> | ||
| 3 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 4 | - <li><a href="/pages/home.html" data-pjax>首页</a> <i | ||
| 5 | - class="fa fa-circle"></i></li> | ||
| 6 | - <li><span class="active">运维管理</span> <i class="fa fa-circle"></i></li> | ||
| 7 | - <li><span class="active">运管处上传日志</span></li> | ||
| 8 | -</ul> | ||
| 9 | -<div class="tab_line"> | ||
| 10 | - <div class="col-md-12"> | ||
| 11 | - <ul class="breadcrumb"> | ||
| 12 | - <li>筛选数据:</li> | ||
| 13 | - <li><select name="line.company_eq" class="form-control" id="companySelect"></select></li> | ||
| 14 | - <li><select name="line.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li> | ||
| 15 | - <li>日期:</li> | ||
| 16 | - <li><input type="text" class="inputCommon dateTime" name="createDate_dateEq" id="dateInput" placeholder="日期"> | ||
| 17 | - </li> | ||
| 18 | - <li>线路名称:</li> | ||
| 19 | - <li><input type="text" class="form-control form-filter input-sm" | ||
| 20 | - name="line.name_eq" id="line_name" maxlength="40" /></li> | ||
| 21 | - <li>上传用户:</li> | ||
| 22 | - <li><input type="text" class="inputCommon inputCarPlate" | ||
| 23 | - name="user.name_like" maxlength="40" /></li> | ||
| 24 | - <li>上传类型:</li> | ||
| 25 | - <li><select name="type_eq" class="form-control" id="uploadType"></select></li> | ||
| 26 | - <li><a class="btn btn-circle blue" id="search">筛选</a></li> | ||
| 27 | - </ul> | ||
| 28 | - </div> | ||
| 29 | - <div class="col-md-12 panel-wrap"> | ||
| 30 | - <div class="_panel"> | ||
| 31 | - <div class="table-container"> | ||
| 32 | - <table | ||
| 33 | - class="table table-striped table-bordered table-advance pb-table head" | ||
| 34 | - id="datatable_logger"> | ||
| 35 | - <thead> | ||
| 36 | - <tr> | ||
| 37 | - <th>序号</th> | ||
| 38 | - <th>公司</th> | ||
| 39 | - <th>分公司</th> | ||
| 40 | - <th>线路</th> | ||
| 41 | - <th>模板名称</th> | ||
| 42 | - <th>上传人员</th> | ||
| 43 | - <th>上传参数</th> | ||
| 44 | - <th>上传类型</th> | ||
| 45 | - <th>是否成功</th> | ||
| 46 | - <th>上传时间</th> | ||
| 47 | - </tr> | ||
| 48 | - </thead> | ||
| 49 | - <tbody> | ||
| 50 | - </tbody> | ||
| 51 | - </table> | ||
| 52 | - <div style="text-align: right;"> | ||
| 53 | - <ul id="pagination" class="pagination"></ul> | ||
| 54 | - </div> | ||
| 55 | - </div> | ||
| 56 | - </div> | ||
| 57 | - </div> | ||
| 58 | -</div> | ||
| 59 | -<script id="timeTempletUploadRecord_list_temp" type="text/html"> | ||
| 60 | -{{each list as obj i}} | ||
| 61 | -<tr> | ||
| 62 | - <td class="seq" style="vertical-align: middle;"> | ||
| 63 | - {{i+1}} | ||
| 64 | - </td> | ||
| 65 | - <td> | ||
| 66 | - {{if obj.line.company == '55'}} | ||
| 67 | - 上南公司 | ||
| 68 | - {{else if obj.line.company == '22'}} | ||
| 69 | - 金高公司 | ||
| 70 | - {{else if obj.line.company == '05'}} | ||
| 71 | - 杨高公司 | ||
| 72 | - {{else if obj.line.company == '26'}} | ||
| 73 | - 南汇公司 | ||
| 74 | - {{else if obj.line.company == '77'}} | ||
| 75 | - 闵行公司 | ||
| 76 | - {{/if}} | ||
| 77 | - </td> | ||
| 78 | - <td> | ||
| 79 | - {{if obj.line.company == '55'}} | ||
| 80 | - | ||
| 81 | - {{if obj.line.brancheCompany == '1'}} | ||
| 82 | - 上南二分公司 | ||
| 83 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 84 | - 上南三分公司 | ||
| 85 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 86 | - 上南六分公司 | ||
| 87 | - {{else if obj.line.brancheCompany == '4'}} | ||
| 88 | - 上南一分公司 | ||
| 89 | - {{/if}} | ||
| 90 | - | ||
| 91 | - {{else if obj.line.company == '22'}} | ||
| 92 | - | ||
| 93 | - {{if obj.line.brancheCompany == '1'}} | ||
| 94 | - 四分公司 | ||
| 95 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 96 | - 二分公司 | ||
| 97 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 98 | - 三分公司 | ||
| 99 | - {{else if obj.line.brancheCompany == '5'}} | ||
| 100 | - 一分公司 | ||
| 101 | - {{/if}} | ||
| 102 | - | ||
| 103 | - {{else if obj.line.company == '05'}} | ||
| 104 | - | ||
| 105 | - {{if obj.line.brancheCompany == '1'}} | ||
| 106 | - 川沙分公司 | ||
| 107 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 108 | - 金桥分公司 | ||
| 109 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 110 | - 芦潮港分公司 | ||
| 111 | - {{else if obj.line.brancheCompany == '5'}} | ||
| 112 | - 杨高分公司 | ||
| 113 | - {{else if obj.line.brancheCompany == '6'}} | ||
| 114 | - 周浦分公司 | ||
| 115 | - {{/if}} | ||
| 116 | - | ||
| 117 | - {{else if obj.line.company == '26'}} | ||
| 118 | - | ||
| 119 | - {{if obj.line.brancheCompany == '1'}} | ||
| 120 | - 南汇一分 | ||
| 121 | - {{else if obj.line.brancheCompany == '2'}} | ||
| 122 | - 南汇二分 | ||
| 123 | - {{else if obj.line.brancheCompany == '3'}} | ||
| 124 | - 南汇三分 | ||
| 125 | - {{else if obj.line.brancheCompany == '4'}} | ||
| 126 | - 南汇维修公司 | ||
| 127 | - {{else if obj.line.brancheCompany == '5'}} | ||
| 128 | - 南汇公司 | ||
| 129 | - {{/if}} | ||
| 130 | - | ||
| 131 | - {{/if}} | ||
| 132 | - </td> | ||
| 133 | - <td> | ||
| 134 | - {{obj.line.name}} | ||
| 135 | - </td> | ||
| 136 | - <td> | ||
| 137 | - {{obj.name}} | ||
| 138 | - </td> | ||
| 139 | - <td> | ||
| 140 | - {{obj.user.name}} | ||
| 141 | - </td> | ||
| 142 | - <td> | ||
| 143 | - {{cutXml(obj.uploadXml)}} | ||
| 144 | - {{if obj.uploadXml != null && obj.uploadXml != ''}} | ||
| 145 | - {{if obj.state == '1'}} | ||
| 146 | - <button type="button" class="btn btn-primary" value="{{obj.uploadXml}}{{obj.uploadXmlSub}}" onclick="showXml(this)"> | ||
| 147 | - 查看 | ||
| 148 | - </button> | ||
| 149 | - {{else if obj.state == '0'}} | ||
| 150 | - <button type="button" class="btn btn-danger" value="{{obj.uploadXml}}{{obj.uploadXmlSub}}" onclick="showXml(this)"> | ||
| 151 | - 查看 | ||
| 152 | - </button> | ||
| 153 | - {{/if}} | ||
| 154 | - {{/if}} | ||
| 155 | - | ||
| 156 | - </td> | ||
| 157 | - <td> | ||
| 158 | - {{if obj.type == '1'}} | ||
| 159 | - 时刻表上传 | ||
| 160 | - {{else if obj.type == '2'}} | ||
| 161 | - 线路停靠站上传 | ||
| 162 | - {{else if obj.type == '3'}} | ||
| 163 | - 路单上传 | ||
| 164 | - {{/if}} | ||
| 165 | - </td> | ||
| 166 | - <td> | ||
| 167 | - {{if obj.state == '1'}} | ||
| 168 | - 成功 | ||
| 169 | - {{else if obj.state == '0'}} | ||
| 170 | - 失败 | ||
| 171 | - {{/if}} | ||
| 172 | - </td> | ||
| 173 | - <td> | ||
| 174 | - {{obj.createDate}} | ||
| 175 | - </td> | ||
| 176 | -</tr> | ||
| 177 | -{{/each}} | ||
| 178 | -{{if list.length == 0}} | ||
| 179 | -<tr class="muted"> | ||
| 180 | - <td colspan=10 style="text-align: center;"><h6>没有找到相关数据</h6></td> | ||
| 181 | -</tr> | ||
| 182 | -{{/if}} | ||
| 183 | - </script> | 1 | +<link href="css/trafficManage.css" rel="stylesheet" type="text/css" /> |
| 2 | +<link href="css/autocompleter.css" rel="stylesheet" type="text/css" /> | ||
| 3 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 4 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i | ||
| 5 | + class="fa fa-circle"></i></li> | ||
| 6 | + <li><span class="active">运维管理</span> <i class="fa fa-circle"></i></li> | ||
| 7 | + <li><span class="active">运管处上传日志</span></li> | ||
| 8 | +</ul> | ||
| 9 | +<div class="tab_line"> | ||
| 10 | + <div class="col-md-12"> | ||
| 11 | + <ul class="breadcrumb"> | ||
| 12 | + <li>筛选数据:</li> | ||
| 13 | + <li><select name="line.company_eq" class="form-control" id="companySelect"></select></li> | ||
| 14 | + <li><select name="line.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li> | ||
| 15 | + <li>日期:</li> | ||
| 16 | + <li><input type="text" class="inputCommon dateTime" name="createDate_dateEq" id="dateInput" placeholder="日期"> | ||
| 17 | + </li> | ||
| 18 | + <li>线路名称:</li> | ||
| 19 | + <li><input type="text" class="form-control form-filter input-sm" | ||
| 20 | + name="line.name_eq" id="line_name" maxlength="40" /></li> | ||
| 21 | + <li>上传用户:</li> | ||
| 22 | + <li><input type="text" class="inputCommon inputCarPlate" | ||
| 23 | + name="user.name_like" maxlength="40" /></li> | ||
| 24 | + <li>上传类型:</li> | ||
| 25 | + <li><select name="type_eq" class="form-control" id="uploadType"></select></li> | ||
| 26 | + <li><a class="btn btn-circle blue" id="search">筛选</a></li> | ||
| 27 | + </ul> | ||
| 28 | + </div> | ||
| 29 | + <div class="col-md-12 panel-wrap"> | ||
| 30 | + <div class="_panel"> | ||
| 31 | + <div class="table-container"> | ||
| 32 | + <table | ||
| 33 | + class="table table-striped table-bordered table-advance pb-table head" | ||
| 34 | + id="datatable_logger"> | ||
| 35 | + <thead> | ||
| 36 | + <tr> | ||
| 37 | + <th>序号</th> | ||
| 38 | + <th>公司</th> | ||
| 39 | + <th>分公司</th> | ||
| 40 | + <th>线路</th> | ||
| 41 | + <th>模板名称</th> | ||
| 42 | + <th>上传人员</th> | ||
| 43 | + <th>上传参数</th> | ||
| 44 | + <th>上传类型</th> | ||
| 45 | + <th>是否成功</th> | ||
| 46 | + <th>上传时间</th> | ||
| 47 | + </tr> | ||
| 48 | + </thead> | ||
| 49 | + <tbody> | ||
| 50 | + </tbody> | ||
| 51 | + </table> | ||
| 52 | + <div style="text-align: right;"> | ||
| 53 | + <ul id="pagination" class="pagination"></ul> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | +</div> | ||
| 59 | +<script id="timeTempletUploadRecord_list_temp" type="text/html"> | ||
| 60 | +{{each list as obj i}} | ||
| 61 | +<tr> | ||
| 62 | + <td class="seq" style="vertical-align: middle;"> | ||
| 63 | + {{i+1}} | ||
| 64 | + </td> | ||
| 65 | + <td> | ||
| 66 | + {{if obj.line.company == '55'}} | ||
| 67 | + 上南公司 | ||
| 68 | + {{else if obj.line.company == '22'}} | ||
| 69 | + 金高公司 | ||
| 70 | + {{else if obj.line.company == '05'}} | ||
| 71 | + 杨高公司 | ||
| 72 | + {{else if obj.line.company == '26'}} | ||
| 73 | + 南汇公司 | ||
| 74 | + {{else if obj.line.company == '77'}} | ||
| 75 | + 临港公交 | ||
| 76 | + {{/if}} | ||
| 77 | + </td> | ||
| 78 | + <td> | ||
| 79 | + {{if obj.line.company == '55'}} | ||
| 80 | + | ||
| 81 | + {{if obj.line.brancheCompany == '1'}} | ||
| 82 | + 上南二分公司 | ||
| 83 | + {{else if obj.line.brancheCompany == '2'}} | ||
| 84 | + 上南三分公司 | ||
| 85 | + {{else if obj.line.brancheCompany == '3'}} | ||
| 86 | + 上南六分公司 | ||
| 87 | + {{else if obj.line.brancheCompany == '4'}} | ||
| 88 | + 上南一分公司 | ||
| 89 | + {{/if}} | ||
| 90 | + | ||
| 91 | + {{else if obj.line.company == '22'}} | ||
| 92 | + | ||
| 93 | + {{if obj.line.brancheCompany == '1'}} | ||
| 94 | + 四分公司 | ||
| 95 | + {{else if obj.line.brancheCompany == '2'}} | ||
| 96 | + 二分公司 | ||
| 97 | + {{else if obj.line.brancheCompany == '3'}} | ||
| 98 | + 三分公司 | ||
| 99 | + {{else if obj.line.brancheCompany == '5'}} | ||
| 100 | + 一分公司 | ||
| 101 | + {{/if}} | ||
| 102 | + | ||
| 103 | + {{else if obj.line.company == '05'}} | ||
| 104 | + | ||
| 105 | + {{if obj.line.brancheCompany == '1'}} | ||
| 106 | + 川沙分公司 | ||
| 107 | + {{else if obj.line.brancheCompany == '2'}} | ||
| 108 | + 金桥分公司 | ||
| 109 | + {{else if obj.line.brancheCompany == '3'}} | ||
| 110 | + 芦潮港分公司 | ||
| 111 | + {{else if obj.line.brancheCompany == '5'}} | ||
| 112 | + 杨高分公司 | ||
| 113 | + {{else if obj.line.brancheCompany == '6'}} | ||
| 114 | + 周浦分公司 | ||
| 115 | + {{/if}} | ||
| 116 | + | ||
| 117 | + {{else if obj.line.company == '26'}} | ||
| 118 | + | ||
| 119 | + {{if obj.line.brancheCompany == '1'}} | ||
| 120 | + 南汇一分 | ||
| 121 | + {{else if obj.line.brancheCompany == '2'}} | ||
| 122 | + 南汇二分 | ||
| 123 | + {{else if obj.line.brancheCompany == '3'}} | ||
| 124 | + 南汇三分 | ||
| 125 | + {{else if obj.line.brancheCompany == '4'}} | ||
| 126 | + 南汇维修公司 | ||
| 127 | + {{else if obj.line.brancheCompany == '5'}} | ||
| 128 | + 南汇公司 | ||
| 129 | + {{/if}} | ||
| 130 | + | ||
| 131 | + {{/if}} | ||
| 132 | + </td> | ||
| 133 | + <td> | ||
| 134 | + {{obj.line.name}} | ||
| 135 | + </td> | ||
| 136 | + <td> | ||
| 137 | + {{obj.name}} | ||
| 138 | + </td> | ||
| 139 | + <td> | ||
| 140 | + {{obj.user.name}} | ||
| 141 | + </td> | ||
| 142 | + <td> | ||
| 143 | + {{cutXml(obj.uploadXml)}} | ||
| 144 | + {{if obj.uploadXml != null && obj.uploadXml != ''}} | ||
| 145 | + {{if obj.state == '1'}} | ||
| 146 | + <button type="button" class="btn btn-primary" value="{{obj.uploadXml}}{{obj.uploadXmlSub}}" onclick="showXml(this)"> | ||
| 147 | + 查看 | ||
| 148 | + </button> | ||
| 149 | + {{else if obj.state == '0'}} | ||
| 150 | + <button type="button" class="btn btn-danger" value="{{obj.uploadXml}}{{obj.uploadXmlSub}}" onclick="showXml(this)"> | ||
| 151 | + 查看 | ||
| 152 | + </button> | ||
| 153 | + {{/if}} | ||
| 154 | + {{/if}} | ||
| 155 | + | ||
| 156 | + </td> | ||
| 157 | + <td> | ||
| 158 | + {{if obj.type == '1'}} | ||
| 159 | + 时刻表上传 | ||
| 160 | + {{else if obj.type == '2'}} | ||
| 161 | + 线路停靠站上传 | ||
| 162 | + {{else if obj.type == '3'}} | ||
| 163 | + 路单上传 | ||
| 164 | + {{/if}} | ||
| 165 | + </td> | ||
| 166 | + <td> | ||
| 167 | + {{if obj.state == '1'}} | ||
| 168 | + 成功 | ||
| 169 | + {{else if obj.state == '0'}} | ||
| 170 | + 失败 | ||
| 171 | + {{/if}} | ||
| 172 | + </td> | ||
| 173 | + <td> | ||
| 174 | + {{obj.createDate}} | ||
| 175 | + </td> | ||
| 176 | +</tr> | ||
| 177 | +{{/each}} | ||
| 178 | +{{if list.length == 0}} | ||
| 179 | +<tr class="muted"> | ||
| 180 | + <td colspan=10 style="text-align: center;"><h6>没有找到相关数据</h6></td> | ||
| 181 | +</tr> | ||
| 182 | +{{/if}} | ||
| 183 | + </script> | ||
| 184 | <script src="./js/timeTempletUploadRecord.js"></script> | 184 | <script src="./js/timeTempletUploadRecord.js"></script> |
| 185 | \ No newline at end of file | 185 | \ No newline at end of file |
src/main/resources/static/real_control_v2/main.html
| @@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
| 55 | <div class="uk-width-4-10"> | 55 | <div class="uk-width-4-10"> |
| 56 | <div class="uk-panel"> | 56 | <div class="uk-panel"> |
| 57 | <h2 class="north-logo"> | 57 | <h2 class="north-logo"> |
| 58 | - <!--<i class="uk-icon-life-ring"></i>--> 浦东公交线路调度 | 58 | + <!--<i class="uk-icon-life-ring"></i>--> 临港公交线路调度 |
| 59 | </h2> | 59 | </h2> |
| 60 | </div> | 60 | </div> |
| 61 | </div> | 61 | </div> |
src/main/resources/traffic-jdbc.properties
| @@ -4,6 +4,6 @@ | @@ -4,6 +4,6 @@ | ||
| 4 | #ms.mysql.password= 123456 | 4 | #ms.mysql.password= 123456 |
| 5 | 5 | ||
| 6 | ms.mysql.driver= com.mysql.jdbc.Driver | 6 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | -ms.mysql.url= jdbc:mysql://10.10.150.122:3306/ms?useUnicode=true&characterEncoding=utf-8 | 7 | +ms.mysql.url= jdbc:mysql://10.10.150.103/ms?useUnicode=true&characterEncoding=utf-8 |
| 8 | ms.mysql.username= root | 8 | ms.mysql.username= root |
| 9 | -ms.mysql.password= root2jsp | ||
| 10 | \ No newline at end of file | 9 | \ No newline at end of file |
| 10 | +ms.mysql.password= Aa123456 | ||
| 11 | \ No newline at end of file | 11 | \ No newline at end of file |