| | |
| | | params.put("ServiceOrdCoName", StringUtils.nvl(emergency.getPatientContact(), "")); |
| | | params.put("ServiceOrdCoPhone", StringUtils.nvl(emergency.getPatientPhone(), "")); |
| | | params.put("ServiceOrdPtName", StringUtils.nvl(emergency.getPatientName(), "")); |
| | | |
| | | params.put("ServiceOrdTraStreet",StringUtils.nvl(task.getDepartureAddress(), StringUtils.nvl(emergency.getHospitalOutAddress(), ""))); |
| | | // 地址信息 |
| | | params.put("DispatchOrdTraStreet", StringUtils.nvl(task.getDepartureAddress(), StringUtils.nvl(emergency.getHospitalOutAddress(), ""))); |
| | | params.put("DispatchOrdTraEnd", StringUtils.nvl(task.getDestinationAddress(), StringUtils.nvl(emergency.getHospitalInAddress(), ""))); |
| | |
| | | params.put("DispatchOrdID", emergency.getLegacyDispatchOrdId().toString()); |
| | | params.put("ServiceOrdID", emergency.getLegacyServiceOrdId().toString()); |
| | | params.put("DispatchOrdState", "3"); |
| | | log.info("重新同步调度单到旧系统请求参数: {}", params); |
| | | // 发送HTTP请求到旧系统(使用admin_save_25.asp接口) |
| | | String response = sendHttpPost(legacyConfig.getDispatchUpdateUrl(), params); |
| | | |
| | | log.info("重新同步调度单到旧系统响应: ServiceOrdID:{},DispatchOrdId:{},Result: {}",emergency.getLegacyServiceOrdId(),emergency.getLegacyDispatchOrdId(), response); |
| | | // 解析响应 |
| | | Long dispatchOrdId = parseResponse(response); |
| | | // Long dispatchOrdId = parseResponse(response); |
| | | |
| | | if (dispatchOrdId != null && dispatchOrdId > 0) { |
| | | if (response != null && response.equals("OK")) { |
| | | // 重新同步成功,清除重新同步标记 |
| | | emergency.setNeedResync(0); |
| | | emergency.setDispatchSyncTime(new Date()); |
| | | emergency.setDispatchSyncErrorMsg(null); |
| | | sysTaskEmergencyService.updateSysTaskEmergency(emergency); |
| | | |
| | | log.info("调度单重新同步成功,任务ID: {}, DispatchOrdID: {}", taskId, dispatchOrdId); |
| | | log.info("调度单重新同步成功,任务ID: {}, DispatchOrdID: {}", taskId, emergency.getLegacyDispatchOrdId()); |
| | | return true; |
| | | } else { |
| | | // 重新同步失败 |