资源转移,接口调用优化
This commit is contained in:
parent
b90f1642cc
commit
9a2de7f386
@ -1,5 +1,7 @@
|
||||
package com.czlis.interfaceCommon.pojo.inter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.interfaceCommon.service.LisInterfaceType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -7,11 +9,15 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DayMessage {
|
||||
public class DayMessage implements LisInterfaceType {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String msgid;
|
||||
private String msg;
|
||||
private String yljg;
|
||||
|
||||
@Override
|
||||
public String serializationJson() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.czlis.interfaceCommon.pojo.inter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.interfaceCommon.service.LisInterfaceType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -7,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GetReqInterface {
|
||||
public class GetReqInterface implements LisInterfaceType {
|
||||
private String yljg;
|
||||
private String brdh;
|
||||
private String brly;
|
||||
@ -18,4 +20,9 @@ public class GetReqInterface {
|
||||
private String bz1;
|
||||
private String sqh;
|
||||
private String ip;
|
||||
|
||||
@Override
|
||||
public String serializationJson() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.czlis.interfaceCommon.pojo.inter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.interfaceCommon.service.LisInterfaceType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -7,10 +9,14 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SetDict {
|
||||
public class SetDict implements LisInterfaceType {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String zdlb;
|
||||
private String yljg;
|
||||
|
||||
@Override
|
||||
public String serializationJson() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.czlis.interfaceCommon.pojo.inter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.interfaceCommon.service.LisInterfaceType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -7,7 +9,7 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SetReport {
|
||||
public class SetReport implements LisInterfaceType {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String yq;
|
||||
@ -15,4 +17,8 @@ public class SetReport {
|
||||
private String ybh;
|
||||
private String status;
|
||||
|
||||
@Override
|
||||
public String serializationJson() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.czlis.interfaceCommon.pojo.inter;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.interfaceCommon.service.LisInterfaceType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -7,10 +9,14 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SetReqStatus {
|
||||
public class SetReqStatus implements LisInterfaceType {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String sqh;
|
||||
private String status;
|
||||
|
||||
@Override
|
||||
public String serializationJson() {
|
||||
return JSONUtil.toJsonStr(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
package com.czlis.interfaceCommon.service;
|
||||
|
||||
public interface LisInterfaceType {
|
||||
|
||||
public String serializationJson();
|
||||
}
|
||||
@ -12,6 +12,7 @@ import com.czlis.common.enums.BusinessType;
|
||||
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.interfaceCommon.mapper.LisInterfaceMapper;
|
||||
import com.czlis.interfaceCommon.service.LisInterfaceType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -32,13 +33,15 @@ public class LisInterfaceUtil {
|
||||
/**
|
||||
* 接口调用
|
||||
* @param type
|
||||
* @param inValue
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "接口调用",businessType = BusinessType.INTERFACE_INVOKE)
|
||||
public Result invokeLisInterface(String type, String inValue) {
|
||||
public Result invokeLisInterface(String type, LisInterfaceType lisInterfaceType) {
|
||||
String interfaceType = commonUtil.getComOptValue("HISOPT","SP_INTER");
|
||||
log.info("开始调用{}接口,入参:{}",type,interfaceType);
|
||||
String inValue = lisInterfaceType.serializationJson();
|
||||
log.info("接口入参:{}",inValue);
|
||||
switch (interfaceType){
|
||||
case "2": //存储过程
|
||||
return invokeSP(type, inValue);
|
||||
|
||||
@ -32,8 +32,7 @@ public class LisTask {
|
||||
setDict.setIp("");
|
||||
setDict.setUserid("admin");
|
||||
setDict.setYljg("1");
|
||||
String jsonStr = JSONUtil.toJsonStr(setDict);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, jsonStr);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, setDict);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,8 +45,7 @@ public class LisTask {
|
||||
setDict.setIp("");
|
||||
setDict.setUserid("admin");
|
||||
setDict.setYljg("1");
|
||||
String jsonStr = JSONUtil.toJsonStr(setDict);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, jsonStr);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, setDict);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,8 +58,7 @@ public class LisTask {
|
||||
setDict.setIp("");
|
||||
setDict.setUserid("admin");
|
||||
setDict.setYljg("1");
|
||||
String jsonStr = JSONUtil.toJsonStr(setDict);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, jsonStr);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, setDict);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,7 +71,6 @@ public class LisTask {
|
||||
setDict.setIp("");
|
||||
setDict.setUserid("admin");
|
||||
setDict.setYljg("1");
|
||||
String jsonStr = JSONUtil.toJsonStr(setDict);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, jsonStr);
|
||||
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETDICT, setDict);
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,8 +56,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
getReqInterface.setEtime("");
|
||||
getReqInterface.setEtime("");
|
||||
getReqInterface.setYljg("");
|
||||
String jsonStr = JSONUtil.toJsonStr(getReqInterface);
|
||||
lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GETREQINTERFACE, jsonStr);
|
||||
lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GETREQINTERFACE, getReqInterface);
|
||||
labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
||||
}
|
||||
if(labReqmainOne == null) return new Result("-1","没有获取到申请单信息!");
|
||||
@ -76,8 +75,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
setReqStatus.setSqh(sqh);
|
||||
setReqStatus.setUserid(userId.toString());
|
||||
setReqStatus.setStatus(SampleStatusConstants.SIGNFOR);
|
||||
String jsonStr = JSONUtil.toJsonStr(setReqStatus);
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREQSTATUS, jsonStr);
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREQSTATUS, setReqStatus);
|
||||
if(!result.getCode().equals("0")) return result;
|
||||
|
||||
//4.获取病人信息
|
||||
|
||||
@ -50,8 +50,7 @@ public class MZCXServiceImpl implements MZCXService {
|
||||
getReqInterface.setDept("");
|
||||
getReqInterface.setUserid(SecurityUtils.getLoginUser().getUsername());
|
||||
getReqInterface.setIp(IpUtils.getIpAddr());
|
||||
String jsonStr = JSONUtil.toJsonStr(getReqInterface);
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GETREQINTERFACE, jsonStr);
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GETREQINTERFACE, getReqInterface);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("brdh", brdh);
|
||||
map.put("st", stime);
|
||||
@ -69,8 +68,7 @@ public class MZCXServiceImpl implements MZCXService {
|
||||
dayMessage.setMsg("");
|
||||
dayMessage.setIp(IpUtils.getIpAddr());
|
||||
dayMessage.setUserid(SecurityUtils.getLoginUser().getUsername());
|
||||
String jsonStr = JSONUtil.toJsonStr(dayMessage);
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, jsonStr);
|
||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
|
||||
if (result != null && result.getData() != null) {
|
||||
try {
|
||||
JSONObject json = JSONUtil.parseFromXml(result.getData().toString());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user