| | |
| | | */ |
| | | public static ServiceOrderAppResultVo CreateServiceOrder(ServiceOrderAppVo model) { |
| | | if (AddServiceOrederAPI.isEmpty()) { |
| | | log.info("AddServiceOrederAPI 未设置,请先设置接口地址。"); |
| | | // log.info("AddServiceOrederAPI 未设置,请先设置接口地址。"); |
| | | return null; |
| | | } |
| | | |
| | |
| | | params.put(field.getName(), value.toString()); |
| | | } |
| | | } catch (IllegalAccessException e) { |
| | | log.error("获取对象属性值时出错", e); |
| | | // log.error("获取对象属性值时出错", e); |
| | | } |
| | | } |
| | | |
| | |
| | | .append(value.toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("拼接表单数据时出错", e); |
| | | // log.error("拼接表单数据时出错", e); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | if (responseData != null && !responseData.isEmpty()) { |
| | | log.info("接口响应: " + responseData); |
| | | // log.info("接口响应: " + responseData); |
| | | try { |
| | | // 使用 FastJSON 将响应数据转换为 ServiceOrderAppResultVo 对象 |
| | | return JSON.parseObject(responseData, ServiceOrderAppResultVo.class); |
| | | } catch (Exception e) { |
| | | log.info("解析接口响应数据失败: " + e.getMessage()); |
| | | // log.info("解析接口响应数据失败: " + e.getMessage()); |
| | | } |
| | | } else { |
| | | log.info("接口调用失败,未获取到有效响应数据"); |
| | | // log.info("接口调用失败,未获取到有效响应数据"); |
| | | } |
| | | |
| | | return null; |
| | |
| | | */ |
| | | public static ServiceOrderAppResultVo CancelServiceOrder(ServiceOrderDelVo model) { |
| | | if (AddServiceOrederAPI.isEmpty()) { |
| | | log.info("AddServiceOrederAPI 未设置,请先设置接口地址。"); |
| | | // log.info("AddServiceOrederAPI 未设置,请先设置接口地址。"); |
| | | return null; |
| | | } |
| | | |
| | |
| | | params.put(field.getName(), value.toString()); |
| | | } |
| | | } catch (IllegalAccessException e) { |
| | | log.error("获取对象属性值时出错", e); |
| | | // log.error("获取对象属性值时出错", e); |
| | | } |
| | | } |
| | | |
| | |
| | | .append(value.toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("拼接表单数据时出错", e); |
| | | // log.error("拼接表单数据时出错", e); |
| | | } |
| | | } |
| | | |
| | | String responseData = HttpUtils.sendPost(AddServiceOrederAPI, formData.toString(), "application/x-www-form-urlencoded"); |
| | | |
| | | if (responseData != null && !responseData.isEmpty()) { |
| | | log.info("接口响应: " + responseData); |
| | | // log.info("接口响应: " + responseData); |
| | | try { |
| | | return JSON.parseObject(responseData, ServiceOrderAppResultVo.class); |
| | | } catch (Exception e) { |
| | | log.info("解析接口响应数据失败: " + e.getMessage()); |
| | | // log.info("解析接口响应数据失败: " + e.getMessage()); |
| | | } |
| | | } else { |
| | | log.info("接口调用失败,未获取到有效响应数据"); |
| | | // log.info("接口调用失败,未获取到有效响应数据"); |
| | | } |
| | | |
| | | return null; |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | // 创建服务单应用值对象并设置相关模拟属性 |
| | | // test(); |
| | | test(); |
| | | |
| | | testCancelServiceOrder(); |
| | | // testCancelServiceOrder(); |
| | | } |
| | | |
| | | //测试取消服务单 |
| | |
| | | model.setPtAge((int) (Math.random() * 100) + "岁"); // 随机生成患者年龄 |
| | | model.setPtSex(Math.random() > 0.5 ? "男" : "女"); // 随机生成患者性别 |
| | | model.setPtNat("中国"); // 随机设置患者国籍 |
| | | model.setOutHosp("随机转出医院" + (int) (Math.random() * 10)); // 随机设置转出医院 |
| | | model.setInHosp("随机转入医院" + (int) (Math.random() * 10)); // 随机设置转入医院 |
| | | model.setOutHosp("广州天河"); // 随机设置转出医院 |
| | | model.setInHosp("广州海珠"); // 随机设置转入医院 |
| | | model.setPtServices("科室" + (int) (Math.random() * 10)); // 随机设置患者所在科室 |
| | | model.setPtDiagnosis("随机诊断信息"); // 随机设置诊断信息 |
| | | model.setCondition("随机备注信息"); // 随机设置备注信息 |