主界面功能
This commit is contained in:
parent
30fb9dd9d6
commit
846ebff8ec
@ -0,0 +1,12 @@
|
||||
package com.czlis.common.constant;
|
||||
|
||||
/**
|
||||
* 接口名称常量类
|
||||
*/
|
||||
public class LisinterfaceNameConstants {
|
||||
public static final String GETREQINTERFACE = "getreqinterface";
|
||||
public static final String SETDICT = "setdict";
|
||||
public static final String SETREPORT = "setreport";
|
||||
public static final String SETREQSTATUS = "setreqstatus";
|
||||
public static final String DAYMESSAGE = "daymessage";
|
||||
}
|
||||
@ -1,4 +1,7 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import com.czlis.common.core.domain.entity.LabReqmain;
|
||||
|
||||
public interface LabReqmainMapper {
|
||||
LabReqmain getLabReqmainOne(String sqh);
|
||||
}
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.czlis.interfaceCommon.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DayMessage {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String msgid;
|
||||
private String msg;
|
||||
private String yljg;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.czlis.interfaceCommon.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GetReqInterface {
|
||||
private String yljg;
|
||||
private String brdh;
|
||||
private String brly;
|
||||
private String dept;
|
||||
private String userid;
|
||||
private String stime;
|
||||
private String etime;
|
||||
private String bz1;
|
||||
private String sqh;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.czlis.interfaceCommon.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SetDict {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String zdlb;
|
||||
private String yljg;
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.czlis.interfaceCommon.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SetReport {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String yq;
|
||||
private String jyrq;
|
||||
private String ybh;
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.czlis.interfaceCommon.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SetReqStatus {
|
||||
private String ip;
|
||||
private String userid;
|
||||
private String sqh;
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -1,8 +1,10 @@
|
||||
package com.czlis.interfaceCommon.utils;
|
||||
|
||||
import com.czlis.common.core.domain.entity.LabPat;
|
||||
import com.czlis.common.core.domain.entity.LabReqmain;
|
||||
import com.czlis.interfaceCommon.mapper.ComOptMapper;
|
||||
import com.czlis.interfaceCommon.mapper.LabPatMapper;
|
||||
import com.czlis.interfaceCommon.mapper.LabReqmainMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -15,7 +17,8 @@ public class CommonUtil {
|
||||
LabPatMapper labPatMapper;
|
||||
@Autowired
|
||||
ComOptMapper comOptMapper;
|
||||
|
||||
@Autowired
|
||||
LabReqmainMapper labReqmainMapper;
|
||||
|
||||
public LabPat getLabPatOne(Date jyrq, String yq, String ybh){
|
||||
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
|
||||
@ -24,4 +27,8 @@ public class CommonUtil {
|
||||
public String getComOptValue(String yq,String xxdh){
|
||||
return comOptMapper.getComOptValue(yq,xxdh);
|
||||
}
|
||||
|
||||
public LabReqmain getLabReqmainOne(String sqh){
|
||||
return labReqmainMapper.getLabReqmainOne(sqh);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,34 +1,46 @@
|
||||
package com.czlis.interfaceCommon.utils;
|
||||
|
||||
import cn.hutool.core.util.XmlUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.common.config.RuoYiConfig;
|
||||
import com.czlis.common.constant.LisinterfaceNameConstants;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.interfaceCommon.mapper.LisInterfaceMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class LisInterfaceUtil {
|
||||
@Resource
|
||||
LisInterfaceMapper lisInterfaceMapper;
|
||||
@Resource
|
||||
CommonUtil commonUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type
|
||||
* @param inValue
|
||||
* @return
|
||||
*/
|
||||
public Result invokeLisInterface(String type,String inValue) {
|
||||
String interfaceType = RuoYiConfig.getInterfaceType();
|
||||
String interfaceType = commonUtil.getComOptValue("HISOPT","SP_INTER");
|
||||
switch (interfaceType){
|
||||
case "1": //存储过程
|
||||
case "2": //存储过程
|
||||
return invokeSP(type, inValue);
|
||||
case "2": //http方式
|
||||
case "3": //http方式
|
||||
return invokeHttp(type, inValue);
|
||||
}
|
||||
|
||||
return new Result("-1","无效的接口方式,请检查配置文件的interfaceType!!");
|
||||
return new Result("-1","无效的接口方式,请检查参数设置!!");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,26 +49,28 @@ public class LisInterfaceUtil {
|
||||
* @param inValue
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result invokeSP(String type,String inValue){
|
||||
//@Transactional(rollbackFor = Exception.class)
|
||||
private Result invokeSP(String type,String inValue){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("invalue",inValue);
|
||||
//为了兼容老接口,存储过程方式使用的是xml,这里需要把入参转成xml格式
|
||||
String xmlStr = changeXml(inValue);
|
||||
map.put("invalue",xmlStr);
|
||||
map.put("retcode","");
|
||||
map.put("retmsg","");
|
||||
switch (type){
|
||||
case "getreqinterface":
|
||||
case LisinterfaceNameConstants.GETREQINTERFACE:
|
||||
lisInterfaceMapper.sp_lis_getreqinterface(map);
|
||||
break;
|
||||
case "setdict":
|
||||
case LisinterfaceNameConstants.SETDICT:
|
||||
lisInterfaceMapper.sp_lis_setdict(map);
|
||||
break;
|
||||
case "setreport":
|
||||
case LisinterfaceNameConstants.SETREPORT:
|
||||
lisInterfaceMapper.sp_lis_setreport(map);
|
||||
break;
|
||||
case "setreqstatus":
|
||||
case LisinterfaceNameConstants.SETREQSTATUS:
|
||||
lisInterfaceMapper.sp_lis_setreqstatus(map);
|
||||
break;
|
||||
case "daymessage":
|
||||
case LisinterfaceNameConstants.DAYMESSAGE:
|
||||
lisInterfaceMapper.sp_lis_daymessage(map);
|
||||
break;
|
||||
}
|
||||
@ -76,7 +90,7 @@ public class LisInterfaceUtil {
|
||||
* @param jsonStr
|
||||
* @return
|
||||
*/
|
||||
public Result invokeHttp(String transCode,String jsonStr){
|
||||
private Result invokeHttp(String transCode,String jsonStr){
|
||||
String interfaceUrl = RuoYiConfig.getInterfaceUrl();
|
||||
if(interfaceUrl == null || "".equals(interfaceUrl)) return new Result("-1","没有配置地址,请检查interfaceUrl配置项!!!");
|
||||
interfaceUrl = interfaceUrl+"/"+transCode;
|
||||
@ -98,5 +112,14 @@ public class LisInterfaceUtil {
|
||||
|
||||
return new Result("0","调用接口成功!",retMsg);
|
||||
}
|
||||
|
||||
|
||||
public String changeXml(String inValue){
|
||||
JSONObject jsonObj = JSONUtil.parseObj(inValue);
|
||||
Map<String,Object> map = jsonObj.toBean(Map.class);
|
||||
return XmlUtil.mapToXmlStr(map, "Request");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
<?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.czlis.interfaceCommon.mapper.LabReqmainMapper">
|
||||
<select id="getLabReqmainOne" resultType="com.czlis.common.core.domain.entity.LabReqmain">
|
||||
select * from lab_reqmain where sqh = #{sqh}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,24 @@
|
||||
package com.czlis.liswork.controller.work;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.liswork.service.LisWorkOperService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/lisworkoper")
|
||||
public class LisWorkOperController {
|
||||
|
||||
@Autowired
|
||||
private LisWorkOperService lisWorkOperService;
|
||||
|
||||
|
||||
@ApiOperation(("新增病人信息"))
|
||||
@GetMapping("/newpat")
|
||||
public Result newPatInfo(String sqh){
|
||||
return lisWorkOperService.newPatInfo(sqh);
|
||||
}
|
||||
}
|
||||
@ -49,9 +49,10 @@ public class LisWorkPageInfoController {
|
||||
return lisWorkPageInfoService.getReqdetail(jyrq,yq,ybh);
|
||||
}
|
||||
|
||||
@ApiOperation("获取标本流转信息")
|
||||
@GetMapping("/reqinfo")
|
||||
public Result getReqInfo(Date jyrq,String yq,String ybh){
|
||||
return null;
|
||||
return lisWorkPageInfoService.getReqInfo(jyrq,yq,ybh);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package com.czlis.liswork.mapper;
|
||||
|
||||
public interface LisWorkOperMapper {
|
||||
}
|
||||
@ -18,4 +18,5 @@ public interface LisWorkPageInfoMapper {
|
||||
List<LabResultRe> getRedo(Date jyrq, String yq, String ybh);
|
||||
List<Map<String,Object>> getReqdetail(String sqh);
|
||||
List<Map<String, Object>> getOtherinstr(Date dayStart, DateTime dayEnd, String brdh, String brxm);
|
||||
List<Map<String, Object>> getReqInfo(Date jyrq, String yq, String ybh);
|
||||
}
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
package com.czlis.liswork.service;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
|
||||
public interface LisWorkOperService {
|
||||
Result newPatInfo(String sqh);
|
||||
}
|
||||
@ -10,4 +10,5 @@ public interface LisWorkPageInfoService {
|
||||
Result getHistory(Date jyrq, String yq, String ybh);
|
||||
Result getReqdetail(Date jyrq, String yq, String ybh);
|
||||
Result getOtherinstr(Date jyrq, String yq, String ybh);
|
||||
Result getReqInfo(Date jyrq, String yq, String ybh);
|
||||
}
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
package com.czlis.liswork.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.common.constant.LisinterfaceNameConstants;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.LabReqmain;
|
||||
import com.czlis.interfaceCommon.pojo.GetReqInterface;
|
||||
import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||
import com.czlis.interfaceCommon.utils.LisInterfaceUtil;
|
||||
import com.czlis.liswork.mapper.LisWorkOperMapper;
|
||||
import com.czlis.liswork.service.LisWorkOperService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
|
||||
@Autowired
|
||||
LisWorkOperMapper lisWorkOperMapper;
|
||||
@Autowired
|
||||
LisInterfaceUtil lisInterfaceUtil;
|
||||
@Autowired
|
||||
CommonUtil commonUtil;
|
||||
|
||||
@Override
|
||||
public Result newPatInfo(String sqh) {
|
||||
|
||||
LabReqmain labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
||||
if (labReqmainOne == null) {
|
||||
//1.调用接口,获取申请单信息
|
||||
GetReqInterface getReqInterface = new GetReqInterface();
|
||||
getReqInterface.setSqh(sqh);
|
||||
getReqInterface.setBrdh("");
|
||||
getReqInterface.setDept("");
|
||||
getReqInterface.setUserid("");
|
||||
getReqInterface.setEtime("");
|
||||
getReqInterface.setEtime("");
|
||||
getReqInterface.setYljg("");
|
||||
String jsonStr = JSONUtil.toJsonStr(getReqInterface);
|
||||
lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.GETREQINTERFACE, jsonStr);
|
||||
labReqmainOne = commonUtil.getLabReqmainOne(sqh);
|
||||
}
|
||||
if(labReqmainOne == null) return new Result("-1","没有获取到申请单信息!");
|
||||
String zt = labReqmainOne.getZt().trim();
|
||||
if(zt.equals("9")) return new Result("-1","当前条码已经作废,不允许上机!");
|
||||
String SP_GETTOWREQOK = commonUtil.getComOptValue("HISOPT", "SP_GETTOWREQOK"); //申请单禁止重复上机
|
||||
String SP_GETTOWREQOKYQ = commonUtil.getComOptValue("HISOPT", "SP_GETTOWREQOKYQ");//申请单禁止同仪器重复上机
|
||||
if(zt.equals("2")){
|
||||
if(SP_GETTOWREQOK.equals("1")) return new Result("-1","当前条码已经上机!");
|
||||
if(SP_GETTOWREQOKYQ.equals("1")){
|
||||
//仪器代码取值要考虑
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -74,5 +74,11 @@ public class LisWorkPageInfoServiceImpl implements LisWorkPageInfoService {
|
||||
return new Result("0","查询数据成功!",queryList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getReqInfo(Date jyrq, String yq, String ybh) {
|
||||
List<Map<String,Object>> reqInfoList = lisWorkPageInfoMapper.getReqInfo(jyrq,yq,ybh);
|
||||
return new Result("0","获取标本流转数据成功!",reqInfoList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
package com.czlis.liswork.utils;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class LisWorkUtil {
|
||||
|
||||
|
||||
}
|
||||
@ -39,4 +39,28 @@
|
||||
]]>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getReqInfo" resultType="map">
|
||||
SELECT lab_reqmain.sqys,
|
||||
lab_reqmain.sqsj,
|
||||
lab_reqmain.jsys,
|
||||
lab_reqmain.jssj,
|
||||
lab_reqmain.zxys,
|
||||
lab_reqmain.zxsj,
|
||||
lab_reqmain.cysj,
|
||||
lab_reqmain.cyr,
|
||||
lab_reqmain.bbsjr,
|
||||
lab_reqmain.bbsjsj,
|
||||
lab_reqmain.libpos,
|
||||
lab_reqmain.inlibtime,
|
||||
lab_reqmain.inlibman,
|
||||
lab_reqmain.outlibtime,
|
||||
lab_reqmain.outlibman,
|
||||
lab_pat.yhdh as cp_jyz,
|
||||
lab_pat.hdys as cp_hdz,
|
||||
lab_reqmain.phone,lab_reqmain.phone1,lab_reqmain.sfzh,lab_reqmain.addr
|
||||
FROM lab_reqmain ,lab_pat
|
||||
WHERE lab_reqmain.sqh = lab_pat.sqh and lab_pat.jyrq = #{jyrq} and lab_pat.yq = #{yq} and lab_pat.ybh = #{ybh}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user