主程序
This commit is contained in:
parent
f7d6f62b17
commit
b11e6a4bf4
@ -0,0 +1,23 @@
|
|||||||
|
package com.czlis.common.core.domain.entity.lis;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class BactMedium {
|
||||||
|
|
||||||
|
private String mediumno;
|
||||||
|
private String mediumname;
|
||||||
|
private String conidtions;
|
||||||
|
private String culturehour;
|
||||||
|
private String watchinterval;
|
||||||
|
private String comments;
|
||||||
|
private String inputcode;
|
||||||
|
private Integer seq;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package com.czlis.common.core.domain.entity.lis;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class BactMediumgroupdet {
|
||||||
|
|
||||||
|
private String mediumgroupno;
|
||||||
|
private String mediumno;
|
||||||
|
private Integer seq;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.czlis.common.core.domain.entity.lis;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LabGermsheetNew {
|
||||||
|
|
||||||
|
private Integer gsid;
|
||||||
|
private Date jyrq;
|
||||||
|
private String yq;
|
||||||
|
private String ybh;
|
||||||
|
private String mediumno;
|
||||||
|
private Date sheetdate;
|
||||||
|
private String sheetuser;
|
||||||
|
private String medium;
|
||||||
|
private String condtions;
|
||||||
|
private String smear;
|
||||||
|
private String dyeing;
|
||||||
|
private String colonyresult;
|
||||||
|
private String colonynum;
|
||||||
|
private String otherresult;
|
||||||
|
}
|
||||||
@ -16,4 +16,5 @@ public interface LabResultMapper {
|
|||||||
int delNullLabResult(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
|
int delNullLabResult(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
|
||||||
List<LabResult> getLabResultWithSql(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh,@Param("wheresql") String wheresql);
|
List<LabResult> getLabResultWithSql(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh,@Param("wheresql") String wheresql);
|
||||||
int insertLabResultByBarcode(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
|
int insertLabResultByBarcode(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
|
||||||
|
int updateLabResultText(LabResult labResult);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -282,6 +282,10 @@ public class CommonUtil {
|
|||||||
public int updateLabResult(LabResult labResult) {
|
public int updateLabResult(LabResult labResult) {
|
||||||
return labResultMapper.updateLabResult(labResult);
|
return labResultMapper.updateLabResult(labResult);
|
||||||
}
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int updateLabResultText(LabResult labResult){
|
||||||
|
return labResultMapper.updateLabResultText(labResult);
|
||||||
|
}
|
||||||
//======危急值操作集合=======
|
//======危急值操作集合=======
|
||||||
public List<LabResultwarning> getLabResultwarning(Date jyrq, String yq, String ybh) {
|
public List<LabResultwarning> getLabResultwarning(Date jyrq, String yq, String ybh) {
|
||||||
return labResultwarningMapper.getLabResultwarning(jyrq, yq, ybh);
|
return labResultwarningMapper.getLabResultwarning(jyrq, yq, ybh);
|
||||||
|
|||||||
@ -388,5 +388,12 @@
|
|||||||
and ybh = #{ybh,jdbcType=VARCHAR}
|
and ybh = #{ybh,jdbcType=VARCHAR}
|
||||||
and xmdh = #{xmdh,jdbcType=VARCHAR}
|
and xmdh = #{xmdh,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateLabResultText" parameterType="com.czlis.common.core.domain.entity.lis.LabResult">
|
||||||
|
update lab_result
|
||||||
|
set textresult = #{textresult,jdbcType=LONGVARCHAR}
|
||||||
|
where jyrq = #{jyrq}
|
||||||
|
and yq = #{yq,jdbcType=CHAR}
|
||||||
|
and ybh = #{ybh,jdbcType=VARCHAR}
|
||||||
|
and xmdh = #{xmdh,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -3,16 +3,16 @@ package com.czlis.liswork.controller.work;
|
|||||||
import com.czlis.common.core.controller.BaseController;
|
import com.czlis.common.core.controller.BaseController;
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.common.core.domain.entity.lis.LabPat;
|
import com.czlis.common.core.domain.entity.lis.LabPat;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||||
import com.czlis.common.core.page.TableDataInfo;
|
import com.czlis.common.core.page.TableDataInfo;
|
||||||
import com.czlis.liswork.service.LabResultService;
|
import com.czlis.liswork.service.LabResultService;
|
||||||
|
import com.czlis.liswork.service.LisWorkGermService;
|
||||||
import com.czlis.liswork.service.LisWorkService;
|
import com.czlis.liswork.service.LisWorkService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -26,26 +26,28 @@ public class LisWorkGermController extends BaseController {
|
|||||||
private LisWorkService lisWorkService;
|
private LisWorkService lisWorkService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private LabResultService labResultService;
|
private LabResultService labResultService;
|
||||||
|
@Autowired
|
||||||
|
LisWorkGermService lisWorkGermService;
|
||||||
@ApiOperation("获取微生物样本信息")
|
@ApiOperation("获取微生物样本信息")
|
||||||
@GetMapping("/sampleMedInfo")
|
@GetMapping("/sampleMedInfo")
|
||||||
public Result sampleMedInfo(Date jyrq, String yq, String ybh) {
|
public Result sampleMedInfo(Date jyrq, String yq, String ybh) {
|
||||||
return lisWorkService.sampleMedInfo(jyrq, yq, ybh);
|
return lisWorkService.sampleMedInfo(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
@ApiOperation("获取样本列表")
|
@ApiOperation("获取仪器ID")
|
||||||
@GetMapping("/samplelist")
|
@GetMapping("/getinstrid")
|
||||||
public Result getSampleList(Date jyrq,String yq,Long days){
|
public Result getInstrid(String yq){
|
||||||
return new Result("0", "获取样本数据成功!",lisWorkService.getSampleList(jyrq,yq,days));
|
return new Result("0", "获取样本数据成功!",lisWorkGermService.getInstrid(yq));
|
||||||
}
|
}
|
||||||
@ApiOperation("获取样本列表")
|
|
||||||
@GetMapping("/samplelistpage")
|
@ApiOperation("写入专家评语")
|
||||||
public TableDataInfo samplelistpage(Date jyrq, String yq, Long days) {
|
@PostMapping("/savetestresult")
|
||||||
try {
|
public Result savetestresult(@RequestBody LabResult labResult) {
|
||||||
startPage();
|
return lisWorkGermService.saveTestResult(labResult);
|
||||||
startOrderBy();
|
|
||||||
List<LabPat> labPatList = lisWorkService.getSampleList(jyrq, yq, days);
|
|
||||||
return getDataTable(labPatList);
|
|
||||||
} finally {
|
|
||||||
clearPage();
|
|
||||||
}
|
}
|
||||||
|
@ApiOperation("获取培养基记录")
|
||||||
|
@GetMapping("/getmedium")
|
||||||
|
public Result getmedium(Date jyrq, String yq, String ybh){
|
||||||
|
return lisWorkGermService.getmedium(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.czlis.liswork.mapper;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.BactMediumgroupdet;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabGermsheetNew;
|
||||||
|
import com.czlis.liswork.pojo.DTO.MediumDTO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
public interface LisWorkGermMapper {
|
||||||
|
List<MediumDTO> getmedium(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh")String ybh);
|
||||||
|
String getmediumno(@Param("sqh") String sqh,@Param("yblx") String yblx);
|
||||||
|
String getmediumnox(String yblx);
|
||||||
|
List<BactMediumgroupdet> getBactMediumgroupdet(String mediumno);
|
||||||
|
int insertmedium(LabGermsheetNew labGermsheetNew);
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.czlis.liswork.pojo.DTO;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabGermsheetNew;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.BactMedium;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class MediumDTO {
|
||||||
|
private LabGermsheetNew labGermsheetNew;
|
||||||
|
private BactMedium bactMedium;
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.czlis.liswork.service;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||||
|
import com.czlis.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public interface LisWorkGermService {
|
||||||
|
Result saveTestResult(LabResult labResult);
|
||||||
|
Result getInstrid(String yq);
|
||||||
|
Result getmedium(Date jyrq, String yq, String ybh);
|
||||||
|
}
|
||||||
@ -0,0 +1,142 @@
|
|||||||
|
package com.czlis.liswork.service.impl;
|
||||||
|
|
||||||
|
import com.czlis.common.core.domain.Result;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.BactMediumgroupdet;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabGermsheetNew;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabPat;
|
||||||
|
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||||
|
import com.czlis.common.utils.SecurityUtils;
|
||||||
|
import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||||
|
import com.czlis.liswork.mapper.LisWorkGermMapper;
|
||||||
|
import com.czlis.liswork.pojo.DTO.MediumDTO;
|
||||||
|
import com.czlis.liswork.service.LisWorkGermService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class LisWorkGermServiceImpl implements LisWorkGermService {
|
||||||
|
@Autowired
|
||||||
|
CommonUtil commonUtil;
|
||||||
|
@Autowired
|
||||||
|
LisWorkGermMapper lisWorkGermMapper;
|
||||||
|
/**
|
||||||
|
* 保存专家评语
|
||||||
|
* @param labResult
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result saveTestResult(LabResult labResult){
|
||||||
|
String xmdh=labResult.getXmdh();
|
||||||
|
String yq=labResult.getYq();
|
||||||
|
String ybh=labResult.getYbh();
|
||||||
|
Date jyrq=labResult.getJyrq();
|
||||||
|
if (jyrq == null) return new Result("-1", "检验日期不能为空!");
|
||||||
|
if ("".equals(ybh) || ybh == null) return new Result("-1", "样本号不能为空!");
|
||||||
|
if ("".equals(yq) || yq == null) return new Result("-1", "仪器不能为空!");
|
||||||
|
if ("".equals(xmdh) || xmdh == null) return new Result("-1", "项目代号不能为空!");
|
||||||
|
commonUtil.updateLabResultText(labResult);
|
||||||
|
return new Result("0","成功",labResult);
|
||||||
|
}
|
||||||
|
/**初级报告仪器ID**/
|
||||||
|
@Override
|
||||||
|
public Result getInstrid(String yq){
|
||||||
|
String yq1=getFirstInstrid(yq);
|
||||||
|
if(yq1==null)return new Result("-1","没有设置初步报告仪器");
|
||||||
|
String yq2=yq1.replace("CBBG","EJBG");
|
||||||
|
Map<String,String> map=new HashMap<>();
|
||||||
|
map.put("yq1",yq1);
|
||||||
|
map.put("yq2",yq2);
|
||||||
|
return new Result("0","成功",map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取培养基记录
|
||||||
|
* @param jyrq
|
||||||
|
* @param yq
|
||||||
|
* @param ybh
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result getmedium(Date jyrq, String yq, String ybh){
|
||||||
|
return new Result("0","成功",getnewmedium(jyrq,yq,ybh));
|
||||||
|
}
|
||||||
|
private List<MediumDTO> getnewmedium(Date jyrq, String yq, String ybh){
|
||||||
|
List<MediumDTO> mediumDTO=lisWorkGermMapper.getmedium(jyrq,yq,ybh);
|
||||||
|
if(mediumDTO==null||mediumDTO.size()==0) {
|
||||||
|
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||||
|
if (labPat == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String sqh = labPat.getSqh();
|
||||||
|
if (sqh == null || sqh.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String yblx = labPat.getYblx();
|
||||||
|
String yblx0 = commonUtil.getComDictIdByName("BT", yblx);
|
||||||
|
if (yblx0 == null || yblx0.isEmpty()) yblx0 = yblx;
|
||||||
|
String mediumno = lisWorkGermMapper.getmediumno(sqh, yblx0);
|
||||||
|
if (mediumno == null || mediumno.isEmpty()) {
|
||||||
|
mediumno = lisWorkGermMapper.getmediumnox(yblx0);
|
||||||
|
}
|
||||||
|
if (sqh == null || sqh.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String yhdh = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
List<BactMediumgroupdet> mediumnolist = getmediumgroup(mediumno);
|
||||||
|
if (!mediumnolist.isEmpty()) {
|
||||||
|
for (BactMediumgroupdet mediumgroupdet : mediumnolist) {
|
||||||
|
LabGermsheetNew labGermsheet = new LabGermsheetNew();
|
||||||
|
labGermsheet.setYq(yq);
|
||||||
|
labGermsheet.setYbh(ybh);
|
||||||
|
labGermsheet.setJyrq(jyrq);
|
||||||
|
labGermsheet.setSheetdate(labPat.getSqsj());
|
||||||
|
labGermsheet.setSheetuser(yhdh);
|
||||||
|
labGermsheet.setMediumno(mediumgroupdet.getMediumno());
|
||||||
|
insertmedium(labGermsheet);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LabGermsheetNew labGermsheet = new LabGermsheetNew();
|
||||||
|
labGermsheet.setYq(yq);
|
||||||
|
labGermsheet.setYbh(ybh);
|
||||||
|
labGermsheet.setJyrq(jyrq);
|
||||||
|
labGermsheet.setSheetdate(labPat.getSqsj());
|
||||||
|
labGermsheet.setSheetuser(yhdh);
|
||||||
|
labGermsheet.setMediumno(mediumno);
|
||||||
|
insertmedium(labGermsheet);
|
||||||
|
}
|
||||||
|
return lisWorkGermMapper.getmedium(jyrq,yq,ybh);
|
||||||
|
}
|
||||||
|
return mediumDTO;
|
||||||
|
}
|
||||||
|
private List<BactMediumgroupdet> getmediumgroup(String mediumno){
|
||||||
|
return lisWorkGermMapper.getBactMediumgroupdet(mediumno);
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void insertmedium(LabGermsheetNew labGermsheet){
|
||||||
|
lisWorkGermMapper.insertmedium(labGermsheet);
|
||||||
|
}
|
||||||
|
/**初级报告仪器ID**/
|
||||||
|
private String getFirstInstrid(String yq){
|
||||||
|
if(yq==null)return null;
|
||||||
|
yq=yq.trim();
|
||||||
|
if("CBBG".contains(yq))return yq;
|
||||||
|
String bm=commonUtil.getComOptValue(yq,"cbbgyq");
|
||||||
|
if(bm==null||"".equals(bm))return null;
|
||||||
|
return "CBBG"+bm;
|
||||||
|
}
|
||||||
|
/**二级报告仪器ID**/
|
||||||
|
private String getSecondInstrid(String yq){
|
||||||
|
if(yq==null)return null;
|
||||||
|
yq=yq.trim();
|
||||||
|
if("EJBG".contains(yq))return yq;
|
||||||
|
String bm=commonUtil.getComOptValue(yq,"cbbgyq");
|
||||||
|
if(bm==null||"".equals(bm))return null;
|
||||||
|
return "EJBG"+bm;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
39
liswork/src/main/resources/mapper/LisWorkGermMapper.xml
Normal file
39
liswork/src/main/resources/mapper/LisWorkGermMapper.xml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?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.liswork.mapper.LisWorkGermMapper">
|
||||||
|
|
||||||
|
<select id="getmedium" resultType="com.czlis.liswork.pojo.DTO.MediumDTO">
|
||||||
|
SELECT lab_germsheet_new.jyrq,
|
||||||
|
lab_germsheet_new.yq,
|
||||||
|
lab_germsheet_new.ybh,
|
||||||
|
lab_germsheet_new.mediumno,
|
||||||
|
lab_germsheet_new.sheetdate,
|
||||||
|
lab_germsheet_new.sheetuser,
|
||||||
|
lab_germsheet_new.medium,
|
||||||
|
bact_medium.mediumname,
|
||||||
|
bact_medium.watchinterval,
|
||||||
|
bact_medium.conidtions,
|
||||||
|
bact_medium.culturehour,
|
||||||
|
bact_medium.comments
|
||||||
|
FROM lab_germsheet_new
|
||||||
|
left join bact_medium on
|
||||||
|
bact_medium.mediumno=lab_germsheet_new.mediumno
|
||||||
|
WHERE ( lab_germsheet_new.jyrq = #{jyrq} ) AND
|
||||||
|
( lab_germsheet_new.yq = #{yq}) AND
|
||||||
|
( lab_germsheet_new.ybh = #{ybh} )
|
||||||
|
</select>
|
||||||
|
<select id="getmediumno" resultType="String">
|
||||||
|
select max(mediumno) from bact_specimen_medium a join lab_reqdetail b on a.req_itemid=b.sqxmdh where specimencode=#{yblx} and b.sqh=#{sqh};
|
||||||
|
</select>
|
||||||
|
<select id="getmediumnox" resultType="String">
|
||||||
|
select max(mediumno) from bact_specimen_medium where specimencode=#{yblx} and req_itemid='-1';
|
||||||
|
</select>
|
||||||
|
<select id="getBactMediumgroupdet" resultType="com.czlis.common.core.domain.entity.lis.BactMediumgroupdet">
|
||||||
|
SELECT * FROM bact_mediumgroupdet WHERE mediumgroupno = #{mediumno}
|
||||||
|
</select>
|
||||||
|
<insert id="insertmedium" parameterType="com.czlis.common.core.domain.entity.lis.LabGermsheetNew">
|
||||||
|
insert into lab_germsheet_new (jyrq, yq, ybh,mediumno,sheetdate,sheetuser,medium)
|
||||||
|
values (#{jyrq},#{yq},#{ybh},#{mediumno},#{sheetdate},#{sheetuser},#{medium})
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
Loading…
x
Reference in New Issue
Block a user