Commit c881f5d0 authored by 向怀芳's avatar 向怀芳 🎱

新增发布配置

联调预约等接口
parent 7723d52f
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
......@@ -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:
......
......@@ -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
......
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
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
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
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,
......
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<NumSourceInfo> 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> 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);
}
}
......@@ -27,12 +27,14 @@ public class HpAppointment extends Model<HpAppointment> {
//医院代码
@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<HpAppointment> {
//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<HpAppointment> {
@ApiModelProperty(value = "状态:0-默认 1-取消预约")
private String status;
private String orderNumType;
private String doctorId;
private String orderId;
private String visitNo;
......
......@@ -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";
}
......@@ -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 {
......
......@@ -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
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}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment