接口调整和输血前评估业务
This commit is contained in:
parent
38606033a6
commit
a332e4fe3a
67
blood_bus/src/main/java/com/czblood/bus/cache/OptionCache.java
vendored
Normal file
67
blood_bus/src/main/java/com/czblood/bus/cache/OptionCache.java
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
package com.czblood.bus.cache;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.czblood.bus.pojo.XkDmzd;
|
||||||
|
import com.czblood.bus.pojo.XkParameter;
|
||||||
|
import com.czblood.common.constant.CacheConstants;
|
||||||
|
import com.czblood.common.core.redis.RedisCache;
|
||||||
|
import com.czblood.common.utils.StringUtils;
|
||||||
|
import com.czblood.common.utils.spring.SpringUtils;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数缓存
|
||||||
|
*/
|
||||||
|
public class OptionCache {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置字典缓存
|
||||||
|
*
|
||||||
|
* @param key 参数键
|
||||||
|
* @param xkParameter 参数值
|
||||||
|
*/
|
||||||
|
public static void setDictCache(String key, XkParameter xkParameter) {
|
||||||
|
removeDictCache( key);
|
||||||
|
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), xkParameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典缓存
|
||||||
|
*
|
||||||
|
* @param key 参数键
|
||||||
|
* @return dictDatas 字典数据列表
|
||||||
|
*/
|
||||||
|
public static XkParameter getOptCache(String key) {
|
||||||
|
return SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指定字典缓存
|
||||||
|
*
|
||||||
|
* @param key 字典键
|
||||||
|
*/
|
||||||
|
public static void removeDictCache(String key) {
|
||||||
|
SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空字典缓存
|
||||||
|
*/
|
||||||
|
public static void clearDictCache() {
|
||||||
|
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.XK_PARAMETER_KEY + "*");
|
||||||
|
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置cache key
|
||||||
|
*
|
||||||
|
* @param configKey 参数键
|
||||||
|
* @return 缓存键key
|
||||||
|
*/
|
||||||
|
public static String getCacheKey(String configKey) {
|
||||||
|
return CacheConstants.XK_PARAMETER_KEY + configKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.czblood.bus.constants;
|
||||||
|
|
||||||
|
public class BloodInterfaceTypeConstants {
|
||||||
|
/**
|
||||||
|
* 申请单审核
|
||||||
|
*/
|
||||||
|
public static final String SQD_AUDIT = "SQD_AUDIT";
|
||||||
|
/**
|
||||||
|
* 获取检验结果
|
||||||
|
*/
|
||||||
|
public static final String GET_TEST_RESULT = "GET_TEST_RESULT";
|
||||||
|
/**
|
||||||
|
* 获取患者信息
|
||||||
|
*/
|
||||||
|
public static final String GET_PATIENT_INFO = "GET_PATIENT_INFO";
|
||||||
|
}
|
||||||
@ -1,10 +1,12 @@
|
|||||||
package com.czblood.bus.controller;
|
package com.czblood.bus.controller;
|
||||||
|
|
||||||
|
import com.czblood.bus.cache.OptionCache;
|
||||||
import com.czblood.bus.mapper.XkProTransfuseProjectMapper;
|
import com.czblood.bus.mapper.XkProTransfuseProjectMapper;
|
||||||
import com.czblood.bus.pojo.XkDmzd;
|
import com.czblood.bus.pojo.XkDmzd;
|
||||||
import com.czblood.bus.pojo.XkProTransfuseProject;
|
import com.czblood.bus.pojo.XkProTransfuseProject;
|
||||||
import com.czblood.bus.utils.BloodBankUtil;
|
import com.czblood.bus.utils.BloodBankUtil;
|
||||||
import com.czblood.common.core.domain.Result;
|
import com.czblood.common.core.domain.Result;
|
||||||
|
import com.czblood.system.util.CommonUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -21,6 +23,8 @@ public class BloodCommonController {
|
|||||||
private XkProTransfuseProjectMapper xkProTransfuseProjectMapper;
|
private XkProTransfuseProjectMapper xkProTransfuseProjectMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private BloodBankUtil bloodBankUtil;
|
private BloodBankUtil bloodBankUtil;
|
||||||
|
@Resource
|
||||||
|
CommonUtil commonUtil;
|
||||||
|
|
||||||
@ApiOperation("获取输血前检验项目")
|
@ApiOperation("获取输血前检验项目")
|
||||||
@PostMapping("/queryLisProject")
|
@PostMapping("/queryLisProject")
|
||||||
@ -42,4 +46,17 @@ public class BloodCommonController {
|
|||||||
XkDmzd dictCacheOne = bloodBankUtil.getDictCacheOne(dictType, dictCode);
|
XkDmzd dictCacheOne = bloodBankUtil.getDictCacheOne(dictType, dictCode);
|
||||||
return new Result("0","获取数据成功!",dictCacheOne);
|
return new Result("0","获取数据成功!",dictCacheOne);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("获取当前服务器时间")
|
||||||
|
@GetMapping("/currentDateTime")
|
||||||
|
public Result getCurrentDateTime(){
|
||||||
|
return new Result("0","获取数据成功",commonUtil.getCurrentTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("获取参数的值")
|
||||||
|
@GetMapping("/getParameterOne")
|
||||||
|
public Result getParameterOne(String parameterCode){
|
||||||
|
String parameterValue = bloodBankUtil.getParameterValue(parameterCode);
|
||||||
|
return new Result("0","获取参数成功!",parameterValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
package com.czblood.bus.enums;
|
|
||||||
|
|
||||||
import com.czblood.bus.pojo.inter.SqdAuditRequest;
|
|
||||||
|
|
||||||
public enum BloodInterfaceType {
|
|
||||||
/**
|
|
||||||
* 申请单审核
|
|
||||||
*/
|
|
||||||
SQD_AUDIT("SQD_AUDIT",SqdAuditRequest.class);
|
|
||||||
|
|
||||||
private final String type;
|
|
||||||
private final Class<?> dataType; // 用 ? 通配符
|
|
||||||
|
|
||||||
BloodInterfaceType(String type, Class<?> dataType) {
|
|
||||||
this.type = type;
|
|
||||||
this.dataType = dataType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Class<?> getDataType() {
|
|
||||||
return dataType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package com.czblood.bus.mapper;
|
||||||
|
|
||||||
|
import com.czblood.bus.pojo.XkParameter;
|
||||||
|
|
||||||
|
public interface XkParameterMapper {
|
||||||
|
XkParameter queryOne(String parameter_code);
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.czblood.bus.mapper;
|
||||||
|
|
||||||
|
import com.czblood.bus.pojo.XkTransfuseApplyTestitem;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface XkTransfuseApplyTestitemMapper {
|
||||||
|
List<XkTransfuseApplyTestitem> queryList(String bill_no);
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.czblood.bus.pojo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class XkParameter {
|
||||||
|
private String parameter_code;
|
||||||
|
private String module_code;
|
||||||
|
private String parameter_name;
|
||||||
|
private String parameter_value;
|
||||||
|
private String parameter_default;
|
||||||
|
private String parameter_bound;
|
||||||
|
private String parameter_remark;
|
||||||
|
private Date last_modified;
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.czblood.bus.pojo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class XkTransfuseApplyTestitem {
|
||||||
|
private String bill_no;
|
||||||
|
private Integer sid;
|
||||||
|
private String item_name;
|
||||||
|
private String item_result;
|
||||||
|
private String Item_unit;
|
||||||
|
private Date test_date;
|
||||||
|
private String upload_flag;
|
||||||
|
}
|
||||||
@ -1,14 +0,0 @@
|
|||||||
package com.czblood.bus.pojo.inter;
|
|
||||||
|
|
||||||
import com.czblood.bus.enums.BloodInterfaceType;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class BloodInterfaceStr<T> {
|
|
||||||
public BloodInterfaceType bloodInterfaceType;
|
|
||||||
public T data;
|
|
||||||
}
|
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.czblood.bus.pojo.inter;
|
||||||
|
|
||||||
|
public interface BloodInterfaceType {
|
||||||
|
public String serializationJson();
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.czblood.bus.pojo.inter;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.czblood.bus.constants.BloodInterfaceTypeConstants;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取病人基本信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class GetPatientInfoRequest implements BloodInterfaceType {
|
||||||
|
|
||||||
|
private final String method = BloodInterfaceTypeConstants.GET_PATIENT_INFO;
|
||||||
|
@ApiModelProperty("住院号")
|
||||||
|
private String beinhos_id;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String serializationJson() {
|
||||||
|
return JSONUtil.toJsonStr(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.czblood.bus.pojo.inter;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.czblood.bus.constants.BloodInterfaceTypeConstants;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取检验结果
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class GetTestResultRequest implements BloodInterfaceType {
|
||||||
|
private final String method = BloodInterfaceTypeConstants.GET_TEST_RESULT;
|
||||||
|
@ApiModelProperty("住院号")
|
||||||
|
private String beinhos_id;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String serializationJson() {
|
||||||
|
return JSONUtil.toJsonStr( this);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
package com.czblood.bus.pojo.inter;
|
package com.czblood.bus.pojo.inter;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.czblood.bus.constants.BloodInterfaceTypeConstants;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@ -10,7 +12,8 @@ import lombok.NoArgsConstructor;
|
|||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class SqdAuditRequest {
|
public class SqdAuditRequest implements BloodInterfaceType {
|
||||||
|
private final String method = BloodInterfaceTypeConstants.SQD_AUDIT;
|
||||||
/**
|
/**
|
||||||
* 申请单编号
|
* 申请单编号
|
||||||
*/
|
*/
|
||||||
@ -19,4 +22,9 @@ public class SqdAuditRequest {
|
|||||||
* 申请单状态
|
* 申请单状态
|
||||||
*/
|
*/
|
||||||
private String billStatus;
|
private String billStatus;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String serializationJson() {
|
||||||
|
return JSONUtil.toJsonStr(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,13 @@ package com.czblood.bus.utils;
|
|||||||
|
|
||||||
|
|
||||||
import com.czblood.bus.cache.DmzdCache;
|
import com.czblood.bus.cache.DmzdCache;
|
||||||
|
import com.czblood.bus.cache.OptionCache;
|
||||||
import com.czblood.bus.mapper.XkDmzdMapper;
|
import com.czblood.bus.mapper.XkDmzdMapper;
|
||||||
|
import com.czblood.bus.mapper.XkParameterMapper;
|
||||||
import com.czblood.bus.pojo.XkDmzd;
|
import com.czblood.bus.pojo.XkDmzd;
|
||||||
|
import com.czblood.bus.pojo.XkParameter;
|
||||||
|
import com.czblood.common.core.domain.Result;
|
||||||
|
import org.springframework.data.redis.connection.ReactiveSubscription;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -15,6 +20,8 @@ public class BloodBankUtil {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
XkDmzdMapper xkDmzdMapper;
|
XkDmzdMapper xkDmzdMapper;
|
||||||
|
@Resource
|
||||||
|
XkParameterMapper xkParameterMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,5 +61,19 @@ public class BloodBankUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据参数编码获取参数值
|
||||||
|
* @param parameterCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getParameterValue(String parameterCode){
|
||||||
|
XkParameter parameterCache = OptionCache.getOptCache(parameterCode);
|
||||||
|
if(parameterCache == null){
|
||||||
|
XkParameter xkParameter = xkParameterMapper.queryOne(parameterCode);
|
||||||
|
return xkParameter.getParameter_value();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,12 +4,10 @@ import cn.hutool.http.HttpRequest;
|
|||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.czblood.bus.enums.BloodInterfaceType;
|
import com.czblood.bus.pojo.inter.BloodInterfaceType;
|
||||||
import com.czblood.bus.pojo.inter.BloodInterfaceStr;
|
|
||||||
import com.czblood.common.config.RuoYiConfig;
|
import com.czblood.common.config.RuoYiConfig;
|
||||||
import com.czblood.common.core.domain.Result;
|
import com.czblood.common.core.domain.Result;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口调用类
|
* 接口调用类
|
||||||
@ -17,11 +15,8 @@ import org.apache.poi.ss.formula.functions.T;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class BloodInterfaceUtil {
|
public class BloodInterfaceUtil {
|
||||||
|
|
||||||
public Result invokeBloodInterface(BloodInterfaceStr<T> bloodInterfaceStr) {
|
public static Result invokeBloodInterface(BloodInterfaceType bloodInterfaceType) {
|
||||||
// BloodInterfaceStr<SqdAuditRequest> sqdAuditRequestBloodInterfaceStr = new BloodInterfaceStr<>();
|
String jsonStr = bloodInterfaceType.serializationJson();
|
||||||
// sqdAuditRequestBloodInterfaceStr.setBloodInterfaceType(BloodInterfaceType.SQD_AUDIT);
|
|
||||||
// sqdAuditRequestBloodInterfaceStr.setData(new SqdAuditRequest());
|
|
||||||
String jsonStr = JSONUtil.toJsonStr(bloodInterfaceStr);
|
|
||||||
return invokeHttp(jsonStr);
|
return invokeHttp(jsonStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,10 +26,12 @@ public class BloodInterfaceUtil {
|
|||||||
* @param jsonStr
|
* @param jsonStr
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Result invokeHttp(String jsonStr){
|
private static Result invokeHttp(String jsonStr){
|
||||||
String interfaceUrl = RuoYiConfig.getInterfaceUrl();
|
String interfaceUrl = RuoYiConfig.getInterfaceUrl();
|
||||||
if(interfaceUrl == null || "".equals(interfaceUrl)) return new Result("-1","没有配置接口地址,请检查interfaceUrl配置项!!!");
|
if(interfaceUrl == null || "".equals(interfaceUrl)) return new Result("-1","没有配置接口地址,请检查interfaceUrl配置项!!!");
|
||||||
String retMsg = "";
|
String retMsg = "";
|
||||||
|
log.info("开始调用后台http接口,地址:{}",interfaceUrl);
|
||||||
|
log.info("入参:{}",jsonStr);
|
||||||
try {
|
try {
|
||||||
HttpRequest httpRequest = HttpRequest.post(interfaceUrl);
|
HttpRequest httpRequest = HttpRequest.post(interfaceUrl);
|
||||||
httpRequest.header("Content-Type","application/json");
|
httpRequest.header("Content-Type","application/json");
|
||||||
@ -42,15 +39,15 @@ public class BloodInterfaceUtil {
|
|||||||
int status = httpResponse.getStatus();
|
int status = httpResponse.getStatus();
|
||||||
retMsg = httpResponse.body();
|
retMsg = httpResponse.body();
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
log.info("调用http接口失败:"+retMsg);
|
log.info("调用后台http接口失败:"+retMsg);
|
||||||
return new Result("-1","调用http接口失败:"+retMsg);
|
return new Result("-1","调用http接口失败:"+retMsg);
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("调用lis的http接口出错:",e);
|
log.error("调用后台http接口出错:",e);
|
||||||
return new Result("-1","调用http接口失败:"+e.getMessage());
|
return new Result("-1","调用后台http接口失败:"+e.getMessage());
|
||||||
}
|
}
|
||||||
log.info("调用http接口成功类型:,入参:{}\r\n,出参:{}",jsonStr,retMsg);
|
log.info("调用后台http接口成功,入参:{}\r\n,出参:{}",jsonStr,retMsg);
|
||||||
String message="";
|
String message="";
|
||||||
String resultCode="";
|
String resultCode="";
|
||||||
// 检查输入是否为空
|
// 检查输入是否为空
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.czblood.bus.mapper.XkParameterMapper">
|
||||||
|
<select id="queryOne" resultType="com.czblood.bus.pojo.XkParameter">
|
||||||
|
select * from xk_parameter where parameter_code = #{parameter_code}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="com.czblood.bus.mapper.XkTransfuseApplyTestitemMapper">
|
||||||
|
<select id="queryList" resultType="com.czblood.bus.pojo.XkTransfuseApplyTestitem">
|
||||||
|
select * from xk_transfuse_apply_testitem where bill_no = #{bill_no}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -1,13 +1,40 @@
|
|||||||
package com.czblood.busDoctor.controller;
|
package com.czblood.busDoctor.controller;
|
||||||
|
|
||||||
|
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
|
||||||
|
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
|
||||||
|
import com.czblood.busDoctor.service.TransfuseApplyBeforeService;
|
||||||
|
import com.czblood.common.core.domain.Result;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@Api(tags = "输血前评估")
|
@Api(tags = "输血前评估")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/doctor/applyBefore")
|
@RequestMapping("/doctor/applyBefore")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TransfuseApplyBeforeController {
|
public class TransfuseApplyBeforeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TransfuseApplyBeforeService transfuseApplyBeforeService;
|
||||||
|
|
||||||
|
@ApiOperation("查询单据信息")
|
||||||
|
@GetMapping("/queryList")
|
||||||
|
public Result queryList(XkTransfuseApplyBefore xkTransfuseApplyBefore){
|
||||||
|
return transfuseApplyBeforeService.queryList(xkTransfuseApplyBefore);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据住院号获取病人信息")
|
||||||
|
@GetMapping("/getPatInfo")
|
||||||
|
public Result getPatInfo(String patNo){
|
||||||
|
return transfuseApplyBeforeService.getPatInfo(patNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("保存信息")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public Result save(@RequestBody TransfuseApplyBeforeDTO transfuseApplyBeforeDTO){
|
||||||
|
return transfuseApplyBeforeService.save(transfuseApplyBeforeDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.czblood.busDoctor.pojo;
|
||||||
|
|
||||||
|
import com.czblood.bus.pojo.*;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TransfuseApplyBeforeDTO {
|
||||||
|
@ApiModelProperty(value = "病人信息")
|
||||||
|
private XkPatientInfo xkPatientInfo;
|
||||||
|
@ApiModelProperty(value = "输血评估信息")
|
||||||
|
private List<XkTransfuseApplyBefore> xkTransfuseApplyBefore;
|
||||||
|
@ApiModelProperty(value = "输血前lis检查项目")
|
||||||
|
private XkTransfuseApplyTestitem xkTransfuseApplyTestitem;
|
||||||
|
@ApiModelProperty(value = "输血前申请信息")
|
||||||
|
private XkTransfuseApply xkTransfuseApply;
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.czblood.busDoctor.service;
|
||||||
|
|
||||||
|
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
|
||||||
|
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
|
||||||
|
import com.czblood.common.core.domain.Result;
|
||||||
|
|
||||||
|
public interface TransfuseApplyBeforeService {
|
||||||
|
Result queryList(XkTransfuseApplyBefore xkTransfuseApplyBefore);
|
||||||
|
|
||||||
|
Result getPatInfo(String patNo);
|
||||||
|
|
||||||
|
Result save(TransfuseApplyBeforeDTO transfuseApplyBeforeDTO);
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
package com.czblood.busDoctor.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.czblood.bus.mapper.XkPatientInfoMapper;
|
||||||
|
import com.czblood.bus.mapper.XkTransfuseApplyBeforeMapper;
|
||||||
|
import com.czblood.bus.pojo.XkPatientInfo;
|
||||||
|
import com.czblood.bus.pojo.XkTransfuseApply;
|
||||||
|
import com.czblood.bus.pojo.XkTransfuseApplyBefore;
|
||||||
|
import com.czblood.bus.pojo.XkTransfuseApplyTestitem;
|
||||||
|
import com.czblood.bus.pojo.inter.GetPatientInfoRequest;
|
||||||
|
import com.czblood.bus.pojo.inter.GetTestResultRequest;
|
||||||
|
import com.czblood.bus.utils.BloodInterfaceUtil;
|
||||||
|
import com.czblood.busDoctor.pojo.TransfuseApplyBeforeDTO;
|
||||||
|
import com.czblood.busDoctor.service.TransfuseApplyBeforeService;
|
||||||
|
import com.czblood.common.core.domain.Result;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TransfuseApplyBeforeServiceImpl implements TransfuseApplyBeforeService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
XkPatientInfoMapper xkPatientInfoMapper;
|
||||||
|
@Resource
|
||||||
|
XkTransfuseApplyBeforeMapper xkTransfuseApplyBeforeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result queryList(XkTransfuseApplyBefore xkTransfuseApplyBefore) {
|
||||||
|
String beinhosId = xkTransfuseApplyBefore.getBeinhos_id();
|
||||||
|
//病人基本信息
|
||||||
|
XkPatientInfo xkPatientInfo = new XkPatientInfo();
|
||||||
|
xkPatientInfo.setBeinhos_id(beinhosId);
|
||||||
|
List<XkPatientInfo> xkPatientInfoList = xkPatientInfoMapper.queryList(xkPatientInfo);
|
||||||
|
//输血前评估信息
|
||||||
|
List<XkTransfuseApplyBefore> xkTransfuseApplyBeforeList = xkTransfuseApplyBeforeMapper.queryList(xkTransfuseApplyBefore);
|
||||||
|
TransfuseApplyBeforeDTO transfuseApplyBeforeDTO = new TransfuseApplyBeforeDTO();
|
||||||
|
if(xkPatientInfoList.size() > 0) transfuseApplyBeforeDTO.setXkPatientInfo(xkPatientInfoList.get(0));
|
||||||
|
transfuseApplyBeforeDTO.setXkTransfuseApplyBefore(xkTransfuseApplyBeforeList);
|
||||||
|
return new Result("0","获取数据成功!", transfuseApplyBeforeDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result getPatInfo(String patNo) {
|
||||||
|
//调用接口获取病人基本信息
|
||||||
|
GetPatientInfoRequest getPatientInfoRequest = new GetPatientInfoRequest();
|
||||||
|
getPatientInfoRequest.setBeinhos_id(patNo);
|
||||||
|
Result result = BloodInterfaceUtil.invokeBloodInterface(getPatientInfoRequest);
|
||||||
|
if(!result.getCode().equals("0")) return result;
|
||||||
|
XkTransfuseApply xkTransfuseApply = JSONUtil.parseObj(result.getData()).toBean(XkTransfuseApply.class);
|
||||||
|
XkPatientInfo xkPatientInfo = JSONUtil.parseObj(result.getData()).toBean(XkPatientInfo.class);
|
||||||
|
if(xkPatientInfo == null){
|
||||||
|
XkPatientInfo xkPatientInfoOne = new XkPatientInfo();
|
||||||
|
xkPatientInfoOne.setBeinhos_id(patNo);
|
||||||
|
List<XkPatientInfo> xkPatientInfoList = xkPatientInfoMapper.queryList(xkPatientInfoOne);
|
||||||
|
if(!xkPatientInfoList.isEmpty()) xkPatientInfo = xkPatientInfoList.get(0);
|
||||||
|
}
|
||||||
|
//调用检验接口,获取病人检验信息
|
||||||
|
GetTestResultRequest getTestResultRequest = new GetTestResultRequest();
|
||||||
|
getTestResultRequest.setBeinhos_id(patNo);
|
||||||
|
Result result1 = BloodInterfaceUtil.invokeBloodInterface(getTestResultRequest);
|
||||||
|
if(!result1.getCode().equals("0")) return result1;
|
||||||
|
XkTransfuseApplyTestitem xkTransfuseApplyTestitem = JSONUtil.parseObj(result.getData()).toBean(XkTransfuseApplyTestitem.class);
|
||||||
|
TransfuseApplyBeforeDTO transfuseApplyBeforeDTO = new TransfuseApplyBeforeDTO();
|
||||||
|
transfuseApplyBeforeDTO.setXkPatientInfo(xkPatientInfo);
|
||||||
|
transfuseApplyBeforeDTO.setXkTransfuseApplyTestitem(xkTransfuseApplyTestitem);
|
||||||
|
transfuseApplyBeforeDTO.setXkTransfuseApply(xkTransfuseApply);
|
||||||
|
return new Result("0","获取数据成功!", transfuseApplyBeforeDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result save(TransfuseApplyBeforeDTO transfuseApplyBeforeDTO) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -49,6 +49,6 @@ public class CacheConstants
|
|||||||
/**
|
/**
|
||||||
* 参数
|
* 参数
|
||||||
*/
|
*/
|
||||||
//public static final String COM_OPT_KEY = "com_opt:";
|
public static final String XK_PARAMETER_KEY = "xk_parameter:";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user