diff --git a/cloud-auth/src/main/resources/bootstrap-cs.yml b/cloud-auth/src/main/resources/bootstrap-cs.yml deleted file mode 100644 index 17abe5f0ccc2a28a3e1801c1513c4435f119bd86..0000000000000000000000000000000000000000 --- a/cloud-auth/src/main/resources/bootstrap-cs.yml +++ /dev/null @@ -1,20 +0,0 @@ -server: - port: 10254 - -spring: - application: - name: @artifactId@ - main: - allow-bean-definition-overriding: true - # nacos - cloud: - nacos: - server-addr: 172.26.140.130:8848 - discovery: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 - config: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 - file-extension: yml - shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - shared-configs: - - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file diff --git a/cloud-auth/src/main/resources/bootstrap-test.yml b/cloud-auth/src/main/resources/bootstrap-hp.yml similarity index 74% rename from cloud-auth/src/main/resources/bootstrap-test.yml rename to cloud-auth/src/main/resources/bootstrap-hp.yml index 9a92d72e885fdcb86c42b3658c9bbf8c1bebdd64..f5db4fb29d532a4a78642f2bce7c9c0dca971677 100644 --- a/cloud-auth/src/main/resources/bootstrap-test.yml +++ b/cloud-auth/src/main/resources/bootstrap-hp.yml @@ -9,11 +9,11 @@ spring: # nacos cloud: nacos: - server-addr: 127.0.0.1:8848 + server-addr: 173.18.1.63:8848 discovery: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 config: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 file-extension: yml shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} shared-configs: diff --git a/cloud-gateway/src/main/resources/bootstrap-cs.yml b/cloud-gateway/src/main/resources/bootstrap-hp.yml similarity index 59% rename from cloud-gateway/src/main/resources/bootstrap-cs.yml rename to cloud-gateway/src/main/resources/bootstrap-hp.yml index 38ea8a074b8b25f5430ca494c4af81fbf9343104..3a21e9dea4754892f2eb2f112aef1366bc9e0281 100644 --- a/cloud-gateway/src/main/resources/bootstrap-cs.yml +++ b/cloud-gateway/src/main/resources/bootstrap-hp.yml @@ -7,15 +7,15 @@ spring: # nacos cloud: nacos: - server-addr: 172.26.140.130:8848 + server-addr: 173.18.1.63:8848 discovery: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 config: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 file-extension: yml shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} profiles: - active: dev + active: hp logging: config: classpath:logback-spring.xml diff --git a/cloud-gateway/src/main/resources/bootstrap-test.yml b/cloud-gateway/src/main/resources/bootstrap-test.yml deleted file mode 100644 index b61530a05d62fa039f796b81b2f15d3778404b53..0000000000000000000000000000000000000000 --- a/cloud-gateway/src/main/resources/bootstrap-test.yml +++ /dev/null @@ -1,19 +0,0 @@ -server: - port: 12999 - -spring: - application: - name: @artifactId@ - # nacos - cloud: - nacos: - server-addr: 127.0.0.1:8848 - discovery: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 - config: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 - file-extension: yml - shared-configs: - shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - profiles: - active: test \ No newline at end of file diff --git a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-cs.yml b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-cs.yml deleted file mode 100644 index f704d0944da4b69fd3af4daff18683404a6ed10e..0000000000000000000000000000000000000000 --- a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-cs.yml +++ /dev/null @@ -1,18 +0,0 @@ -server: - port: 10255 - -spring: - application: - name: @artifactId@ - main: - allow-bean-definition-overriding: true - # nacos - cloud: - nacos: - server-addr: 172.26.140.130:8848 - discovery: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 - config: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 - file-extension: yml - shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file diff --git a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-test.yml b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-hp.yml similarity index 61% rename from smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-test.yml rename to smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-hp.yml index 63758176cc03c1c9f1de7d4a3d58687d69cb570e..f77b7dd464e5848b96505abc61b2d0e5160d1ffd 100644 --- a/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-test.yml +++ b/smart-health-modules/cloud-upms/cloud-upms-biz/src/main/resources/bootstrap-hp.yml @@ -1,5 +1,5 @@ server: - port: 10255 + port: 10256 spring: application: @@ -9,10 +9,12 @@ spring: # nacos cloud: nacos: - server-addr: 127.0.0.1:8848 + server-addr: 173.18.1.63:8848 discovery: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 config: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 file-extension: yml shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + profiles: + active: hp diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentController.java index f8fce834ac8a49c18dd52682dc4ff76eb14c443b..64d114cf5f6f0641f3294f6fa8b6efab265e10cf 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentController.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/AppointmentController.java @@ -1,6 +1,9 @@ package cn.sh.stc.sict.theme.hphy.controller.mp; +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.net.Ipv4Util; +import cn.hutool.core.util.IdcardUtil; import cn.hutool.core.util.StrUtil; import cn.sh.stc.sict.cloud.common.core.constant.Constant; import cn.sh.stc.sict.cloud.common.core.util.R; @@ -14,6 +17,7 @@ import cn.sh.stc.sict.theme.hphy.model.HpHosInfo; import cn.sh.stc.sict.theme.hphy.model.HphyPatientBase; import cn.sh.stc.sict.theme.hphy.service.HpAppointmentService; import cn.sh.stc.sict.theme.hphy.service.HpDocInfoService; +import cn.sh.stc.sict.theme.hphy.service.HpHosInfoService; import cn.sh.stc.sict.theme.hphy.service.HphyPatientBaseService; import cn.sh.stc.sict.theme.hphy.wd.*; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -40,6 +44,7 @@ public class AppointmentController { private HpAppointmentService hpAppointmentService; private HpDocInfoService hpDocInfoService; private HphyPatientBaseService hphyPatientBaseService; + private HpHosInfoService hosInfoService; @ApiOperation("预约须知") @GetMapping("/app/rule") @@ -50,7 +55,7 @@ public class AppointmentController { @ApiOperation("预约") @PostMapping("/app") - public R appointment(@RequestBody OrderInfo order) { + public R appointment(@RequestBody OrderInfo order) throws Exception { CurrentUser current = SecurityUtils.getCurrentUser(); if (StrUtil.isBlank(current.getOpenId())) { return new R().error("患者信息异常!"); @@ -64,6 +69,10 @@ public class AppointmentController { if (StrUtil.isBlank(order.getScheduleId()) || StrUtil.isBlank(order.getNumSourceId())) { return new R().error("预约排班号源信息不可为空!"); } +// HpHosInfo hos = hosInfoService.getById(order.getHosOrgCode()); +// if (null == hos) { +// return new R().error("未找到医院信息!"); +// } HphyPatientBase patient = hphyPatientBaseService.getByOpenId(current.getOpenId()); if (null == patient) { return new R().error("未找到患者信息!"); @@ -92,6 +101,10 @@ public class AppointmentController { order.setPlatformType(WanDaConstant.PLATFORM_TYPE); order.setChannelName(WanDaConstant.CHANNEL_NAME); order.setNumSourceFrom(WanDaConstant.NUM_SOURCE_FROM); + order.setPatient_type(WanDaConstant.PATIENT_TYPE_NORMAL); + order.setMediCardId(""); + order.setMediCardType(""); + order.setUserBD(DateUtil.format(IdcardUtil.getBirthDate(patient.getCertId()), DatePattern.NORM_DATE_PATTERN)); AppResult result = WanDaHttpUtil.submitOrderByUserInfo(order); if (null != result) { MapperFactory factory = new DefaultMapperFactory.Builder().build(); @@ -105,6 +118,12 @@ public class AppointmentController { app.setRoom(result.getRoom()); app.setHosNumSourceId(result.getHosNumSourceId()); app.setStatus(Constant.STRING_NO); + app.setHosOrgName(docInfo.getHosName()); + app.setDeptName(docInfo.getDeptName()); + app.setOrderNumType(order.getOrderNumType()); + app.setPatientName(patient.getName()); + app.setResourceName(docInfo.getResourceName()); + app.setStatus(Constant.STRING_NO); hpAppointmentService.save(app); return new R().success(result); } @@ -113,7 +132,7 @@ public class AppointmentController { @ApiOperation("取消预约") @PostMapping("/cancel/app") - public R cancelAppointment(@RequestBody CancelOrderInfo order) { + public R cancelAppointment(@RequestBody CancelOrderInfo order) throws Exception { if (StrUtil.isBlank(order.getAppId())) { return new R().error("预约信息不可为空!"); } @@ -121,6 +140,9 @@ public class AppointmentController { if (null == app) { return new R().error("未找到预约信息!"); } + order.setCancelObj(WanDaConstant.CANCELOBJ_PATIENT); + order.setHosOrgCode(app.getHosOrgCode()); + order.setOrderId(app.getOrderId()); boolean flag = WanDaHttpUtil.orderCancelInfo(order); if (flag) { @@ -133,7 +155,6 @@ public class AppointmentController { return new R().error("取消预约失败!"); } - @ApiOperation("预约列表") @GetMapping("/app/list") public R appList(Page page, diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java index 8eb56b36de2777b0fca4c78d352abc1d6a253707..a902bd2cd08ef1b9f2a5ef8252114c347bb245a9 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/controller/mp/WDController.java @@ -1,8 +1,9 @@ package cn.sh.stc.sict.theme.hphy.controller.mp; +import cn.hutool.core.collection.CollUtil; +import cn.sh.stc.sict.cloud.common.core.constant.Constant; import cn.sh.stc.sict.cloud.common.core.util.R; -import cn.sh.stc.sict.theme.hphy.wd.NumSourceInfo; -import cn.sh.stc.sict.theme.hphy.wd.WanDaHttpUtil; +import cn.sh.stc.sict.theme.hphy.wd.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -22,6 +23,7 @@ import java.util.List; public class WDController { /** + * 0. 发短信 * 1. 医生查询 * 2. 门诊信息查询 * 3. 号源查询 @@ -35,6 +37,22 @@ public class WDController { List list = WanDaHttpUtil.getOrderNumInfo(numSourceInfo); - return new R(list); + if(CollUtil.isNotEmpty(list)){ + return R.builder().code(Constant.BYTE_YES).data(list).bizCode(Constant.INT_NO).build(); + } + + DeptInfo deptInfo = new DeptInfo(); + deptInfo.setHosOrgCode(numSourceInfo.getHosOrgCode()); + deptInfo.setOneDeptCode(numSourceInfo.getOneDeptCode()); + deptInfo.setDeptCode(numSourceInfo.getDeptCode()); + List outPatInfo = WanDaHttpUtil.getResourceOutPatInfo(deptInfo); + if(CollUtil.isNotEmpty(outPatInfo)){ + numSourceInfo.setOrderType(WanDaConstant.ORDER_TYPE_CLINC); + numSourceInfo.setResourceCode(outPatInfo.get(0).getResourceCode()); + list = WanDaHttpUtil.getOrderNumInfo(numSourceInfo); + + return new R(list); + } + return new R().success(list); } } diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java index ae69033b85ef6eb2c7f067d9c92fcb2d49fc2a45..34147070fe76b59a0498d6639ba8dff5ddf8f315 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/model/HpAppointment.java @@ -27,12 +27,14 @@ public class HpAppointment extends Model { //医院代码 @ApiModelProperty(value = "医院代码") private String hosOrgCode; + private String hosOrgName; //一级科室代码 @ApiModelProperty(value = "一级科室代码") private String oneDeptCode; //二级科室代码 @ApiModelProperty(value = "二级科室代码") private String deptCode; + private String deptName; //预约类型:1-医生 2-门诊 @ApiModelProperty(value = "预约类型:1-医生 2-门诊") private String orderType; @@ -61,6 +63,7 @@ public class HpAppointment extends Model { //1+1+1 签约编号 @ApiModelProperty(value = "1+1+1 签约编号") private String patientId; + private String patientName; //就诊人卡号 @ApiModelProperty(value = "就诊人卡号") private String mediCardId; @@ -134,6 +137,8 @@ public class HpAppointment extends Model { @ApiModelProperty(value = "状态:0-默认 1-取消预约") private String status; + private String orderNumType; + private String doctorId; private String orderId; private String visitNo; diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaConstant.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaConstant.java index 18c8661b49efab4d789fb4481c5dbc1461fdc047..cd62311486691644ea4b5dc57a53e189cf7a7ef8 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaConstant.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaConstant.java @@ -6,12 +6,13 @@ public class WanDaConstant { * 预约类型:医生 */ public static final String ORDER_TYPE_OUTP = "1"; + public static final String ORDER_TYPE_CLINC = "2"; /** * 预约方式:其他 */ - public static final String CHANNEL_CODE_OTHER = "9"; + public static final String CHANNEL_CODE_OTHER = "0"; /** * 支付方式:到院支付 @@ -35,4 +36,8 @@ public class WanDaConstant { public static final String CHANNEL_NAME = "高血压精准导医平台"; public static final String NUM_SOURCE_FROM = "3"; + + public static final String PATIENT_TYPE_NORMAL = "1"; + + public static final String CANCELOBJ_PATIENT = "1"; } diff --git a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaHttpUtil.java b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaHttpUtil.java index f6cead31cb3f29250a5f4e9b6bfc5404f0c20c6c..c773c8d094117e241fc6feb36d106607caa0867b 100644 --- a/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaHttpUtil.java +++ b/smart-health-modules/theme-schema/src/main/java/cn/sh/stc/sict/theme/hphy/wd/WanDaHttpUtil.java @@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j; import org.w3c.dom.Document; import org.w3c.dom.NodeList; +import javax.print.DocFlavor; import javax.xml.xpath.XPathConstants; import java.util.ArrayList; import java.util.List; @@ -18,6 +19,7 @@ import java.util.List; public class WanDaHttpUtil { String URL = "http://173.18.1.29:7001/yyzlWS/webservice/ss"; String CODE_XPATH = "//Response/MessageHeader/code"; + String DESC_XPATH = "//Response/MessageHeader/desc"; /** * 调用万达 webservice 接口获取医院信息 @@ -188,16 +190,16 @@ public class WanDaHttpUtil { * @param orderInfo * @return */ - public AppResult submitOrderByUserInfo(OrderInfo orderInfo) { + public AppResult submitOrderByUserInfo(OrderInfo orderInfo) throws Exception { String xml = WanDaUtil.SubmitOrderByUserInfoServiceXML(orderInfo); log.error("预约xml = {}", xml); - String body = ""; +// String body = ""; // TODO 测试环境 -// String body = HttpRequest.post(URL) -// .body(xml) -// .execute() -// .body(); + String body = HttpRequest.post(URL) + .body(xml) + .execute() + .body(); if (StrUtil.isBlank(body)) { log.error("号源预约 失败"); @@ -207,10 +209,12 @@ public class WanDaHttpUtil { String returnXml = getReturn(body, "SubmitOrderByUserInfoService"); if (Constant.STRING_NO.equals(getCode(returnXml))) { Document document = XmlUtil.readXML(returnXml); - NodeList list = document.getElementsByTagName("OrderInfo"); + NodeList list = document.getElementsByTagName("Result"); if (list.getLength() > 0) { return XmlUtil.xmlToBean(list.item(0), AppResult.class); } + } else { + throw new Exception(getDesc(returnXml)); } return null; } @@ -221,7 +225,7 @@ public class WanDaHttpUtil { * @param cancelOrderInfo * @return */ - public boolean orderCancelInfo(CancelOrderInfo cancelOrderInfo) { + public boolean orderCancelInfo(CancelOrderInfo cancelOrderInfo) throws Exception { String xml = WanDaUtil.OrderCancelInfoServiceXML(cancelOrderInfo); String body = HttpRequest.post(URL) @@ -238,7 +242,7 @@ public class WanDaHttpUtil { if (Constant.STRING_NO.equals(getCode(returnXml))) { return true; } else { - return false; + throw new Exception(getDesc(returnXml)); } } @@ -475,6 +479,18 @@ public class WanDaHttpUtil { return code; } + private String getDesc(String returnStr) { + String desc = ""; + try { + Document returnDoc = XmlUtil.readXML(returnStr); + desc = (String) XmlUtil.getByXPath(DESC_XPATH, returnDoc, XPathConstants.STRING); + } catch (Exception ex) { + log.error("获取desc失败!"); + log.error(ex.getMessage(), ex); + } + return desc; + } + private static String getReturn(String body, String response) { String returnStr = ""; try { diff --git a/smart-health-modules/theme-schema/src/main/resources/bootstrap-cs.yml b/smart-health-modules/theme-schema/src/main/resources/bootstrap-hp.yml similarity index 58% rename from smart-health-modules/theme-schema/src/main/resources/bootstrap-cs.yml rename to smart-health-modules/theme-schema/src/main/resources/bootstrap-hp.yml index f945f75c83d5829310182a060c07eee8f8f880bf..220482c9df5e74ce603e68c174b5aa7bbcdda9b9 100644 --- a/smart-health-modules/theme-schema/src/main/resources/bootstrap-cs.yml +++ b/smart-health-modules/theme-schema/src/main/resources/bootstrap-hp.yml @@ -9,10 +9,10 @@ spring: # nacos cloud: nacos: - server-addr: 172.26.140.130:8848 + server-addr: 173.18.1.63:8848 discovery: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 config: - namespace: 8e95da30-3e0e-4622-8818-9a9cb4cc6641 + namespace: d8aa6c84-076c-4a31-826e-5da727d63e06 file-extension: yml shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} \ No newline at end of file diff --git a/smart-health-modules/theme-schema/src/main/resources/bootstrap-test.yml b/smart-health-modules/theme-schema/src/main/resources/bootstrap-test.yml deleted file mode 100644 index 097ac7341a2ab58e14f61a0b0c5554755dabc4c6..0000000000000000000000000000000000000000 --- a/smart-health-modules/theme-schema/src/main/resources/bootstrap-test.yml +++ /dev/null @@ -1,20 +0,0 @@ -server: - port: 10253 - -spring: - application: - name: @artifactId@ - main: - allow-bean-definition-overriding: true - # nacos - cloud: - nacos: - server-addr: 127.0.0.1:8848 - discovery: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 - config: - namespace: 173eb3a0-1782-4b36-9681-0a229b2483e5 - file-extension: yml - shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} - shared-configs: - - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}