| | |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStreamReader; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | |
| | | return adminID; |
| | | } |
| | | |
| | | private String getCoo(BigDecimal lng, BigDecimal lat){ |
| | | return lng+","+lat; |
| | | } |
| | | /** |
| | | * 构建同步参数 |
| | | */ |
| | |
| | | params.put("ServiceOrdCoName", StringUtils.nvl(emergency.getPatientContact(), "")); |
| | | params.put("ServiceOrdCoPhone", StringUtils.nvl(emergency.getPatientPhone(), "")); |
| | | params.put("ServiceOrdCoTies", ""); // 联系人与患者关系 |
| | | |
| | | //ServiceOrdTraVia |
| | | // 患者信息 |
| | | params.put("ServiceOrdPtName", StringUtils.nvl(emergency.getPatientName(), "")); |
| | | params.put("ServiceOrdPtAge", ""); // 年龄 |
| | |
| | | params.put("ServiceOrdTraStreetCoo", ""); // 出发地坐标 |
| | | params.put("ServiceOrdTraEnd", StringUtils.nvl(task.getDestinationAddress(), StringUtils.nvl(emergency.getHospitalInAddress(), ""))); |
| | | params.put("ServiceOrdTraEndCoo", ""); // 目的地坐标 |
| | | params.put("ServiceOrdTraVia", ""); // 途经地 |
| | | params.put("ServiceOrdTraVia", emergency.getHospitalOutAddress()!=null ? emergency.getHospitalOutAddress() : ""); // 途经地 |
| | | |
| | | // 距离和价格信息 |
| | | params.put("ServiceOrdViaDistance", "0"); // 中途距离 |
| | | params.put("ServiceOrdTraDistance", emergency.getTransferDistance() != null ? emergency.getTransferDistance().toString() : "0"); |
| | | params.put("ServiceOrdTraDuration", ""); // 预计行程时间 |
| | | params.put("ServiceOrdTraUnitPrice", "0"); // 单价/公里 |
| | | params.put("ServiceOrdTraOfferPrice", emergency.getTransferPrice() != null ? emergency.getTransferPrice().toString() : "0"); |
| | | // params.put("ServiceOrdTraOfferPrice", emergency.getTransferPrice() != null ? emergency.getTransferPrice().toString() : "0"); |
| | | params.put("ServiceOrdTraTxnPrice", emergency.getTransferPrice() != null ? emergency.getTransferPrice().toString() : "0"); |
| | | params.put("ServiceOrdTraPrePayment", "0"); // 需预付款 |
| | | params.put("SettlementPrice", "0"); // 结算价 |
| | |
| | | params.put("CommissionScenarioID", "0"); // 企微绩效方案 |
| | | params.put("ServiceOrdOperationRemarks", "新系统同步创建"); // 操作备注 |
| | | params.put("ServiceOrdEstimatedOrderDate", ""); // 预计派单时间 |
| | | params.put("ServiceOrdSource", "10"); // 订单来源(10=新系统) |
| | | params.put("ServiceOrdSource", "0"); // 订单来源(10=新系统) |
| | | params.put("OrderLevel", "0"); // 查看等级 |
| | | params.put("ServiceOrdDepartureType", "1"); // 预约类型 |
| | | params.put("ConditionLevel", "0"); // 病重级别 |
| | |
| | | postData.append(URLEncoder.encode(entry.getValue().toString(), legacySystemConfig.getCharset())); |
| | | } |
| | | |
| | | // log.info("发送POST请求到旧系统,URL: {}, 参数: {}", urlString, postData.toString()); |
| | | |
| | | // 发送POST数据 |
| | | try (OutputStream os = conn.getOutputStream()) { |
| | | os.write(postData.toString().getBytes(legacySystemConfig.getCharset())); |