Commit 8eccbe2242fa0dab795ab115b3fb66af6cd851e2
Committed by
周勤
1 parent
f66076b6
增加功能:上传路单及时刻表到青浦运管处
Showing
1 changed file
with
40 additions
and
0 deletions
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| @@ -24,6 +24,7 @@ import com.bsth.util.db.DBUtils_MS; | @@ -24,6 +24,7 @@ import com.bsth.util.db.DBUtils_MS; | ||
| 24 | import com.bsth.webService.trafficManage.org.tempuri.Results; | 24 | import com.bsth.webService.trafficManage.org.tempuri.Results; |
| 25 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; | 25 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 26 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; | 26 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 27 | +import com.bsth.webService.trafficManage.qp.WebServiceSoap_PortType; | ||
| 27 | import org.apache.commons.lang.StringEscapeUtils; | 28 | import org.apache.commons.lang.StringEscapeUtils; |
| 28 | import org.apache.commons.lang.StringUtils; | 29 | import org.apache.commons.lang.StringUtils; |
| 29 | import org.apache.commons.lang.time.DateUtils; | 30 | import org.apache.commons.lang.time.DateUtils; |
| @@ -130,6 +131,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -130,6 +131,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 130 | e.printStackTrace(); | 131 | e.printStackTrace(); |
| 131 | } | 132 | } |
| 132 | } | 133 | } |
| 134 | + // 青浦接口 | ||
| 135 | + private WebServiceSoap_PortType qp_ssop; | ||
| 136 | + { | ||
| 137 | + try { | ||
| 138 | + qp_ssop = new com.bsth.webService.trafficManage.qp.WebServiceLocator().getWebServiceSoap(); | ||
| 139 | + } catch (Exception e) { | ||
| 140 | + e.printStackTrace(); | ||
| 141 | + } | ||
| 142 | + } | ||
| 133 | // 格式化 年月日时分秒 nyrsfm是年月日时分秒的拼音首字母 | 143 | // 格式化 年月日时分秒 nyrsfm是年月日时分秒的拼音首字母 |
| 134 | private SimpleDateFormat sdfnyrsfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 144 | private SimpleDateFormat sdfnyrsfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 135 | 145 | ||
| @@ -144,6 +154,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -144,6 +154,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 144 | // 密码 | 154 | // 密码 |
| 145 | private final String passwordOther = "user"; | 155 | private final String passwordOther = "user"; |
| 146 | 156 | ||
| 157 | + private final String userNameOther_qp = "china317"; | ||
| 158 | + | ||
| 159 | + private final String passwordOther_qp = "china317"; | ||
| 160 | + | ||
| 147 | // 用户名 | 161 | // 用户名 |
| 148 | private final String userNameUp = "user"; | 162 | private final String userNameUp = "user"; |
| 149 | // 密码 | 163 | // 密码 |
| @@ -514,6 +528,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -514,6 +528,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 514 | results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); | 528 | results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); |
| 515 | // 记录日志 | 529 | // 记录日志 |
| 516 | result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str); | 530 | result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str); |
| 531 | + // 发送到青浦运管处 | ||
| 532 | + try { | ||
| 533 | + com.bsth.webService.trafficManage.qp.Results res | ||
| 534 | + = qp_ssop.setLD(userNameOther_qp,passwordOther_qp,StringEscapeUtils.unescapeHtml(str)); | ||
| 535 | + logger.info("青浦路单是否上传成功:"+res.isSuccess()); | ||
| 536 | + }catch (Exception e){ | ||
| 537 | + e.printStackTrace(); | ||
| 538 | + continue; | ||
| 539 | + } | ||
| 517 | } | 540 | } |
| 518 | } | 541 | } |
| 519 | // 每per条线路上传后剩下的数据再上传 | 542 | // 每per条线路上传后剩下的数据再上传 |
| @@ -521,6 +544,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -521,6 +544,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 521 | sf.append("</DLDS>"); | 544 | sf.append("</DLDS>"); |
| 522 | str = sf.toString().replace("'","");// 去掉'号 | 545 | str = sf.toString().replace("'","");// 去掉'号 |
| 523 | results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); | 546 | results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); |
| 547 | + // 发送到青浦运管处 | ||
| 548 | + try { | ||
| 549 | + com.bsth.webService.trafficManage.qp.Results res | ||
| 550 | + = qp_ssop.setLD(userNameOther_qp,passwordOther_qp,StringEscapeUtils.unescapeHtml(str)); | ||
| 551 | + logger.info("青浦路单是否上传成功:"+res.isSuccess()); | ||
| 552 | + }catch (Exception e){ | ||
| 553 | + e.printStackTrace(); | ||
| 554 | + } | ||
| 524 | } | 555 | } |
| 525 | // 记录日志 | 556 | // 记录日志 |
| 526 | result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str); | 557 | result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str); |
| @@ -1125,6 +1156,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -1125,6 +1156,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 1125 | skbUploadLoggerRepository.save(skbUploadLogger); | 1156 | skbUploadLoggerRepository.save(skbUploadLogger); |
| 1126 | } | 1157 | } |
| 1127 | } | 1158 | } |
| 1159 | + | ||
| 1160 | + // 发送到青浦运管处 | ||
| 1161 | + try { | ||
| 1162 | + com.bsth.webService.trafficManage.qp.Results res = | ||
| 1163 | + qp_ssop.setSKB(userNameOther_qp,passwordOther_qp,sBuffer.toString()); | ||
| 1164 | + logger.info("青浦时刻表上传结果:"+ res.isSuccess()); | ||
| 1165 | + }catch (Exception e){ | ||
| 1166 | + e.printStackTrace(); | ||
| 1167 | + } | ||
| 1128 | } catch (Exception e) { | 1168 | } catch (Exception e) { |
| 1129 | logger.error("setSKB:", e); | 1169 | logger.error("setSKB:", e); |
| 1130 | e.printStackTrace(); | 1170 | e.printStackTrace(); |