增加委托机构调用接口
This commit is contained in:
parent
7a4ca0f43f
commit
23d599e235
39
.idea/misc.xml
generated
39
.idea/misc.xml
generated
@ -8,6 +8,45 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
|
||||
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
|
||||
<option name="myOrdered" value="false" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="11">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jspecify.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
||||
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
||||
<item index="4" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
||||
<item index="5" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
|
||||
<item index="6" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="7" class="java.lang.String" itemvalue="jakarta.annotation.Nullable" />
|
||||
<item index="8" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="9" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
||||
<item index="10" class="java.lang.String" itemvalue="org.springframework.lang.Nullable" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="11">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jspecify.annotations.NonNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
||||
<item index="4" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
||||
<item index="5" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
|
||||
<item index="6" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="7" class="java.lang.String" itemvalue="jakarta.annotation.Nonnull" />
|
||||
<item index="8" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="9" class="java.lang.String" itemvalue="lombok.NonNull" />
|
||||
<item index="10" class="java.lang.String" itemvalue="org.springframework.lang.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
|
||||
@ -343,7 +343,10 @@ public class RegTransitSample {
|
||||
* 上机人姓名
|
||||
*/
|
||||
private String opername;
|
||||
|
||||
/**
|
||||
* 发送标志,0-未发送,1-已发送
|
||||
*/
|
||||
private String sendFlag;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.transitPlatForm.transitPF.mapper;
|
||||
|
||||
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegReportFile;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.*;
|
||||
import com.transitPlatForm.transitPF.pojo.RegGetReportsList;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -13,4 +13,10 @@ public interface RegLisReportMapper {
|
||||
List<Map<String,Object>> getLisReportDetail(String bgdh);
|
||||
List<Map<String, Object>> getRegGetresultmed(@Param("bgdh") String bgdh ,@Param("xmdh") String xmdh);
|
||||
RegReportFile getRegReportFile(String bgdh);
|
||||
RegPatMain queryRegPatMain(String bgdh);
|
||||
List<RegPatMain> queryRegPatMainList(RegPatMain regPatMain);
|
||||
List<RegResult> queryRegResult(String bgdh);
|
||||
List<RegResultGerm> queryRegResultGerm(String bgdh);
|
||||
List<RegResultMed> queryRegResultMed(String bgdh);
|
||||
List<String> queryCyclicData(String srcHospCode);
|
||||
}
|
||||
|
||||
@ -65,6 +65,6 @@ public class SampleSignVO {
|
||||
@ApiModelProperty(value = "上机操作人姓名")
|
||||
private String opername;
|
||||
//目前就只是取消审核的时候用
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
@ApiModelProperty(value = "审核状态,1取消审核")
|
||||
private String checkStatus;
|
||||
}
|
||||
|
||||
@ -1,23 +1,29 @@
|
||||
package com.transitPlatForm.transitPF.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApply;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.*;
|
||||
import com.transitPlatForm.common.utils.spring.SpringUtils;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.RegApplyMapper;
|
||||
import com.transitPlatForm.interfaceCommon.utils.CommonUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LisUtil;
|
||||
import com.transitPlatForm.transitPF.mapper.RegLisReportMapper;
|
||||
import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.LisReportDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegTransitSampleDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.SampleSignVO;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSample;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail;
|
||||
import com.transitPlatForm.transitPF.service.util.RequestInfoUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -29,6 +35,12 @@ public class RegInterfaceImpl {
|
||||
RegTransitSampleMapper regTransitSampleMapper;
|
||||
@Autowired
|
||||
RequestInfoUtil requestInfoUtil;
|
||||
@Autowired
|
||||
RegLisReportMapper regLisReportMapper;
|
||||
|
||||
@Value("${transitInterface.postURL:}")
|
||||
String postURL;
|
||||
|
||||
|
||||
/**
|
||||
* 新增条码信息
|
||||
@ -82,11 +94,8 @@ public class RegInterfaceImpl {
|
||||
regTransitSample.setCheckPUR(checkPUR);
|
||||
regTransitSample.setStatus("10");
|
||||
regTransitSample.setDataSource("1");
|
||||
regTransitSampleMapper.addRegTransitSample(regTransitSample);
|
||||
for (RegTransitSampleDetail regTransitSampleDetail : regTransitSampleDetailList) {
|
||||
regTransitSampleMapper.addRegTransitSampleDetail(regTransitSampleDetail);
|
||||
}
|
||||
return new Result("0","");
|
||||
SpringUtils.getBean(RegInterfaceImpl.class).saveRegTransitSample(regTransitSample, regTransitSampleDetailList);
|
||||
return new Result("0","保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -280,7 +289,7 @@ public class RegInterfaceImpl {
|
||||
}
|
||||
regTransitSample60.setBarcode(barcode);
|
||||
regTransitSample60.setStatus("60");
|
||||
|
||||
regTransitSample60.setSendFlag("0"); //发送标志
|
||||
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample60,regApply);
|
||||
break;
|
||||
case "70": //结果审核
|
||||
@ -297,7 +306,7 @@ public class RegInterfaceImpl {
|
||||
regTransitSample70.setReportUserCode(reportUserCode);
|
||||
regTransitSample70.setReportUserName(reportUserName);
|
||||
regTransitSample70.setStatus("70");
|
||||
|
||||
regTransitSample70.setSendFlag("0"); //发送标志
|
||||
List<RegTransitSample> collect1 = regTransitSampleList1.stream().filter(regTransitSample2 -> Integer.parseInt(regTransitSample2.getStatus()) < 70).collect(Collectors.toList());
|
||||
if(collect1.size() <= 1){
|
||||
regApply.setStatus("30");
|
||||
@ -403,10 +412,6 @@ public class RegInterfaceImpl {
|
||||
return new Result("0","删除成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public Result test(){
|
||||
RegTransitSample regTransitSample = new RegTransitSample();
|
||||
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
|
||||
@ -426,4 +431,127 @@ public class RegInterfaceImpl {
|
||||
return new Result("0","成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报告数据
|
||||
* @param jsonStr
|
||||
* @return
|
||||
*/
|
||||
public Result queryReport(String jsonStr) {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(jsonStr).getJSONObject("req");
|
||||
String barcode = jsonObject.getStr("barcode");
|
||||
if(barcode == null || barcode.equals("")) return new Result("-1","barcode条码号不能为空!");
|
||||
List<LisReportDTO> lisReportDTOList = new ArrayList<>();
|
||||
RegPatMain regPatMain = new RegPatMain();
|
||||
regPatMain.setBarcode(barcode);
|
||||
List<RegPatMain> regPatMainList = regLisReportMapper.queryRegPatMainList(regPatMain);
|
||||
for (RegPatMain patMain : regPatMainList) {
|
||||
String reportNo = patMain.getReportNo();
|
||||
List<RegResult> regResultList = regLisReportMapper.queryRegResult(reportNo);
|
||||
List<RegResultGerm> regResultGermList = regLisReportMapper.queryRegResultGerm(reportNo);
|
||||
List<RegResultMed> regResultMedList = regLisReportMapper.queryRegResultMed(reportNo);
|
||||
LisReportDTO lisReportDTO = new LisReportDTO();
|
||||
lisReportDTO.setRegPatMain(regPatMain);
|
||||
lisReportDTO.setRegResultList(regResultList);
|
||||
lisReportDTO.setRegResultGermList(regResultGermList);
|
||||
lisReportDTO.setRegResultMedList(regResultMedList);
|
||||
lisReportDTOList.add(lisReportDTO);
|
||||
}
|
||||
return new Result("0","查询成功!",lisReportDTOList);
|
||||
}
|
||||
|
||||
public Result queryReportPDF(String jsonStr) {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(jsonStr).getJSONObject("req");
|
||||
String barcode = jsonObject.getStr("barcode");
|
||||
if(barcode == null || barcode.equals("")) return new Result("-1","barcode条码号不能为空!");
|
||||
RegPatMain regPatMain = new RegPatMain();
|
||||
regPatMain.setBarcode(barcode);
|
||||
List<RegReportFile> regReportFileList = new ArrayList<>();
|
||||
List<String> reportPDFList = new ArrayList<>();
|
||||
List<RegPatMain> regPatMainList = regLisReportMapper.queryRegPatMainList(regPatMain);
|
||||
for (RegPatMain patMain : regPatMainList) {
|
||||
String reportNo = patMain.getReportNo();
|
||||
RegReportFile regReportFile = regLisReportMapper.getRegReportFile(reportNo);
|
||||
if(regReportFile != null){
|
||||
regReportFileList.add(regReportFile);
|
||||
reportPDFList.add(regReportFile.getReport());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(regReportFileList.isEmpty()){
|
||||
//使用接口去查询数据
|
||||
for (RegPatMain patMain : regPatMainList) {
|
||||
String reportNo = patMain.getReportNo();
|
||||
String jsonStr1 = "{\"method\":\"pdfData\",\"bgdh\":\""+reportNo+"\"}";
|
||||
Result result = postHttp(jsonStr1);
|
||||
if(!result.getCode().equals("0")) return result;
|
||||
reportPDFList.add(LisUtil.isBank(result.getData()));
|
||||
}
|
||||
}
|
||||
return new Result("0","查询成功",reportPDFList);
|
||||
}
|
||||
|
||||
public Result postHttp(String json){
|
||||
String url = "";
|
||||
String ret = "";
|
||||
|
||||
url = postURL;
|
||||
|
||||
log.info("调用地址:"+url);
|
||||
//log.info("调用lis接口,入参:"+json);
|
||||
try (HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("Content-Type", "application/json;charset=utf-8")
|
||||
.body(json)
|
||||
.execute()) {
|
||||
int status = httpResponse.getStatus();
|
||||
ret = httpResponse.body();
|
||||
if(status != 200){
|
||||
log.error("调用lis的http接口失败!"+ret);
|
||||
return new Result("-1",ret);
|
||||
}
|
||||
|
||||
} catch (Exception e){
|
||||
log.error("调用lis的http接口失败!"+e.getMessage());
|
||||
return new Result("-1",e.getMessage());
|
||||
}
|
||||
log.info("调用lis的接口,入参:"+json+"\r\n出参:"+ret);
|
||||
//解析出参
|
||||
JSONObject jsonObject = JSONUtil.parseObj(ret);
|
||||
String resultCode = String.valueOf(jsonObject.get("resultCode"));
|
||||
String message = String.valueOf(jsonObject.get("message"));
|
||||
if(!resultCode.equals("0")){
|
||||
return new Result("-1","调用lis接口失败:"+message);
|
||||
}
|
||||
return new Result("0","调用lis接口成功",message);
|
||||
}
|
||||
|
||||
public Result cyclicQuery(String jsonStr) {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(jsonStr).getJSONObject("req");
|
||||
String srcHospCode = jsonObject.getStr("SrcHospCode");
|
||||
if(srcHospCode == null || srcHospCode.equals("")) return new Result("-1","srcHospCode医院编码不能为空!");
|
||||
List<String> stringList = regLisReportMapper.queryCyclicData(srcHospCode);
|
||||
return new Result("0","查询成功!",stringList);
|
||||
}
|
||||
|
||||
public Result updateSendFlag(String jsonStr) {
|
||||
JSONObject jsonObject = JSONUtil.parseObj(jsonStr).getJSONObject("req");
|
||||
String barcode = jsonObject.getStr("barcode");
|
||||
if(barcode == null || barcode.equals("")) return new Result("-1","barcode条码号不能为空!");
|
||||
RegTransitSample regTransitSample = new RegTransitSample();
|
||||
regTransitSample.setBarcode(barcode);
|
||||
regTransitSample.setSendFlag("1");
|
||||
regTransitSampleMapper.updateRegTransitSample(regTransitSample);
|
||||
return new Result("0","修改标志成功!");
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveRegTransitSample(RegTransitSample regTransitSample,List<RegTransitSampleDetail> regTransitSampleDetailList) {
|
||||
String barcode = regTransitSample.getBarcode();
|
||||
regTransitSampleMapper.delRegTransitSample(barcode);
|
||||
regTransitSampleMapper.delRegTransitSampleDetail(barcode);
|
||||
regTransitSampleMapper.addRegTransitSample(regTransitSample);
|
||||
for (RegTransitSampleDetail regTransitSampleDetail : regTransitSampleDetailList) {
|
||||
regTransitSampleMapper.addRegTransitSampleDetail(regTransitSampleDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,6 +70,14 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
|
||||
return regInterfaceImpl.addReport(jsonStr);
|
||||
case "delReport": //删除报告
|
||||
return regInterfaceImpl.delReport(jsonStr);
|
||||
case "queryReport": //查询报告
|
||||
return regInterfaceImpl.queryReport(jsonStr);
|
||||
case "queryReportPDF": //查询pdf报告
|
||||
return regInterfaceImpl.queryReportPDF(jsonStr);
|
||||
case "cyclicQuery":
|
||||
return regInterfaceImpl.cyclicQuery(jsonStr);
|
||||
case "updateSendFlag":
|
||||
return regInterfaceImpl.updateSendFlag(jsonStr);
|
||||
// case "test":
|
||||
// return test();
|
||||
case "pdfData":
|
||||
|
||||
@ -31,5 +31,23 @@
|
||||
<select id="getRegReportFile" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegReportFile">
|
||||
select * from reg_report_file where ReportNo = #{bgdh}
|
||||
</select>
|
||||
<select id="queryRegPatMain" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegPatMain">
|
||||
select * from reg_pat_main where ReportNo = #{bgdh}
|
||||
</select>
|
||||
<select id="queryRegResult" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegResult">
|
||||
select * from reg_result where ReportNo = #{bgdh}
|
||||
</select>
|
||||
<select id="queryRegResultGerm" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegResultGerm">
|
||||
select * from reg_result_germ where ReportNo = #{bgdh}
|
||||
</select>
|
||||
<select id="queryRegResultMed" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegResultMed">
|
||||
select * from reg_result_med where ReportNo = #{bgdh}
|
||||
</select>
|
||||
<select id="queryCyclicData" resultType="java.lang.String">
|
||||
select barcode from reg_TransitSample where SrcHospCode = #{srcHospCode} and status IN ( '70','80') and (sendFlag = '0' or sendFlag is null)
|
||||
</select>
|
||||
<select id="queryRegPatMainList" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegPatMain">
|
||||
select * from reg_pat_main where barcode = #{barcode}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -289,12 +289,13 @@
|
||||
<if test="operdatetime != null ">operdatetime = #{operdatetime},</if>
|
||||
<if test="opercode != null and opercode != ''">opercode = #{opercode},</if>
|
||||
<if test="opername != null and opername != ''">opername = #{opername},</if>
|
||||
<if test="sendFlag != null and sendFlag != ''">sendFlag = #{sendFlag},</if>
|
||||
update_by = #{update_by},update_time = #{update_time}
|
||||
</set>
|
||||
where barcode = #{barcode}
|
||||
</update>
|
||||
|
||||
<select id="getRegTransitSampleSignBack">
|
||||
<select id="getRegTransitSampleSignBack" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegTransitSample">
|
||||
<![CDATA[select * from Reg_TransitSample where Status in (select dict_code from reg_dict where dict_type = 'ZT' AND dict_code = '100')]]>
|
||||
<if test="SrcHospCode != null and SrcHospCode != ''"> and SrcHospCode = #{SrcHospCode}</if>
|
||||
<if test="DstHospCode != null and DstHospCode != ''"> and DstHospCode = #{DstHospCode}</if>
|
||||
|
||||
@ -16,4 +16,10 @@ if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_
|
||||
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_pat_main' AND COLUMN_NAME = 'printFlag')
|
||||
begin
|
||||
alter table reg_pat_main add printFlag varchar(2)
|
||||
end
|
||||
|
||||
|
||||
if not exists(SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'reg_TransitSample' AND COLUMN_NAME = 'sendFlag')
|
||||
begin
|
||||
alter table reg_TransitSample add sendFlag varchar(10)
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user