主程序
This commit is contained in:
parent
a50f54ebe9
commit
59e1e8fd58
@ -0,0 +1,16 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.czlis.common.core.domain.entity.lis.LabResultRe;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface LabResultReMapper {
|
||||
List<LabResultRe> getLabResultRe(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh, @Param("xmdh") String xmdh);
|
||||
List<LabResultRe> getLabResultReAll(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
|
||||
int insertLabResultRe(LabResultRe labResultRe);
|
||||
int updateLabResultRe(LabResultRe labResultRe);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
<?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.LabResultReMapper">
|
||||
<select id="getLabResultRe" resultType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
select *
|
||||
from lab_result_re
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
and jyrq = #{jyrq}
|
||||
</if>
|
||||
<if test="yq != null and yq != ''">
|
||||
and yq = #{yq}
|
||||
</if>
|
||||
<if test="ybh != null and ybh != ''">
|
||||
and ybh = #{ybh}
|
||||
</if>
|
||||
<if test="xmdh != null and xmdh != ''">
|
||||
and xmdh = #{xmdh}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getLabResultReAll" resultType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
SELECT lab_result_re.jyrq,
|
||||
lab_result_re.yq,
|
||||
lab_result_re.ybh,
|
||||
lab_result_re.xmdh,
|
||||
lab_result_re.csjg
|
||||
FROM lab_result_re,
|
||||
xm_info
|
||||
WHERE ( lab_result_re.yq = xm_info.yq ) and
|
||||
( lab_result_re.xmdh = xm_info.xmdh ) and
|
||||
( ( lab_result_re.jyrq = :jyrq ) AND
|
||||
( lab_result_re.yq = :yq ) AND
|
||||
( lab_result_re.ybh = :ybh ) )
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
and jyrq = #{jyrq}
|
||||
</if>
|
||||
<if test="yq != null and yq != ''">
|
||||
and yq = #{yq}
|
||||
</if>
|
||||
<if test="ybh != null and ybh != ''">
|
||||
and ybh = #{ybh}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY xm_info.dyxh asc
|
||||
</select>
|
||||
<insert id="insertLabResultRe" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
insert into lab_result_re (jyrq, yq, ybh,xmdh,csjg)
|
||||
values (#{jyrq},#{yq},#{ybh},#{xmdh},#{csjg})
|
||||
</insert>
|
||||
<update id="updateLabResultRe" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
update lab_result_re
|
||||
<set>
|
||||
<if test="xmdh != null">
|
||||
xmdh = #{xmdh},
|
||||
</if>
|
||||
<if test="csjg != null">
|
||||
csjg = #{csjg},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
and jyrq = #{jyrq}
|
||||
</if>
|
||||
<if test="yq != null and yq != ''">
|
||||
and yq = #{yq}
|
||||
</if>
|
||||
<if test="ybh != null and ybh != ''">
|
||||
and ybh = #{ybh}
|
||||
</if>
|
||||
<if test="xmdh != null and xmdh != ''">
|
||||
and xmdh = #{xmdh}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
</mapper>
|
||||
@ -3,13 +3,12 @@ package com.czlis.liswork.controller.work;
|
||||
import com.czlis.common.annotation.Anonymous;
|
||||
import com.czlis.common.core.controller.BaseController;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabResultRe;
|
||||
import com.czlis.liswork.service.LisWorkPageInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -33,6 +32,20 @@ public class LisWorkPageInfoController extends BaseController {
|
||||
return lisWorkPageInfoService.getRedo(jyrq, yq, ybh);
|
||||
}
|
||||
|
||||
@ApiOperation("交换复查结果")
|
||||
@PostMapping("/swapredo")
|
||||
public Result swapredo(@RequestBody LabResultRe labResultRe) {
|
||||
|
||||
return lisWorkPageInfoService.swapRedo(labResultRe);
|
||||
}
|
||||
|
||||
@ApiOperation("保存复查结果")
|
||||
@PostMapping("/saveredo")
|
||||
public Result saveredo(@RequestBody LabResultRe labResultRe) {
|
||||
|
||||
return lisWorkPageInfoService.saveRedo(labResultRe);
|
||||
}
|
||||
|
||||
@Anonymous
|
||||
@ApiOperation("获取历史结果")
|
||||
@GetMapping("/history")
|
||||
@ -78,6 +91,4 @@ public class LisWorkPageInfoController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,4 +25,7 @@ public interface LisWorkPageInfoMapper {
|
||||
List<Map<String,Object>> getbgxm(@Param("yq") String yq,@Param("sqxmdh") String sqxmdh);
|
||||
|
||||
List<LabInputmdl> getInputmdl(String yq);
|
||||
int insertLabResultRe(LabResultRe labResultRe);
|
||||
int updateLabResultRe(LabResultRe labResultRe);
|
||||
LabResultRe getLabResultRe(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("xmdh") String xmdh);
|
||||
}
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
package com.czlis.liswork.service;
|
||||
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabResultRe;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface LisWorkPageInfoService {
|
||||
Result resultGraph(Date jyrq, String yq, String ybh);
|
||||
Result getRedo(Date jyrq, String yq, String ybh);
|
||||
Result swapRedo(LabResultRe labResultRe);
|
||||
Result saveRedo(LabResultRe labResultRe);
|
||||
Result getHistory(Date jyrq, String yq, String ybh);
|
||||
Result getReqdetail(Date jyrq, String yq, String ybh);
|
||||
Result getOtherinstr(Date jyrq, String yq, String ybh);
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.*;
|
||||
import com.czlis.interfaceCommon.utils.LisWorkUtils;
|
||||
import com.czlis.interfaceCommon.utils.ReportUtil;
|
||||
import com.czlis.liswork.mapper.LisWorkPageInfoMapper;
|
||||
import com.czlis.liswork.pojo.DTO.HistoryResultDTO;
|
||||
@ -14,6 +15,7 @@ import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||
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.*;
|
||||
import java.util.stream.Collectors;
|
||||
@ -27,7 +29,7 @@ public class LisWorkPageInfoServiceImpl implements LisWorkPageInfoService {
|
||||
@Autowired
|
||||
CommonUtil commonUtil;
|
||||
@Autowired
|
||||
ReportUtil reportUtil;
|
||||
LisWorkUtils lisWorkUtils;
|
||||
|
||||
@Override
|
||||
public Result resultGraph(Date jyrq, String yq, String ybh) {
|
||||
@ -58,6 +60,49 @@ public class LisWorkPageInfoServiceImpl implements LisWorkPageInfoService {
|
||||
List<LabResultRe> labResultReList = lisWorkPageInfoMapper.getRedo(jyrq,yq,ybh);
|
||||
return new Result("0","获取数据成功!",labResultReList);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result swapRedo(LabResultRe labResultRe) {
|
||||
Date jyrq=labResultRe.getJyrq();
|
||||
String yq=labResultRe.getYq();
|
||||
String ybh=labResultRe.getYbh();
|
||||
String xmdh=labResultRe.getXmdh();
|
||||
String csjg=labResultRe.getCsjg();
|
||||
LabPat labPat=commonUtil.getLabPatOne(jyrq,yq,ybh);
|
||||
if(labPat!=null){
|
||||
String jgbz=labPat.getJgbz();
|
||||
if(jgbz==null)jgbz="0";
|
||||
if("2".equals(jgbz)||"5".equals(jgbz)){
|
||||
return new Result("1","样本已审核禁止交换!");
|
||||
}
|
||||
}
|
||||
LabResult labResult=commonUtil.getLabResult(jyrq,yq,ybh,xmdh);
|
||||
if(labResult==null){
|
||||
return new Result("1","当前结果为空无法交换!");
|
||||
}
|
||||
String csjg0=labResult.getCsjg();
|
||||
labResultRe.setCsjg(csjg0);
|
||||
labResult.setCsjg(csjg);
|
||||
labResult.setRedo_flag("1");
|
||||
lisWorkUtils.changeresult(labResult);
|
||||
lisWorkPageInfoMapper.updateLabResultRe(labResultRe);
|
||||
return new Result("0","交换数据成功!",labResultRe);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result saveRedo(LabResultRe labResultRe) {
|
||||
Date jyrq=labResultRe.getJyrq();
|
||||
String yq=labResultRe.getYq();
|
||||
String ybh=labResultRe.getYbh();
|
||||
String xmdh=labResultRe.getXmdh();
|
||||
LabResultRe labResultRe0 =lisWorkPageInfoMapper.getLabResultRe(jyrq,yq,ybh,xmdh);
|
||||
if(labResultRe0==null){
|
||||
lisWorkPageInfoMapper.updateLabResultRe(labResultRe);
|
||||
}else{
|
||||
lisWorkPageInfoMapper.insertLabResultRe(labResultRe);
|
||||
}
|
||||
return new Result("0","交换数据成功!",labResultRe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getHistory(Date jyrq, String yq, String ybh) {
|
||||
|
||||
@ -17,9 +17,62 @@
|
||||
</select>
|
||||
|
||||
<select id="getRedo" resultType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
select * from lab_result_re where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
|
||||
SELECT lab_result_re.*
|
||||
FROM lab_result_re,xm_info
|
||||
WHERE ( lab_result_re.yq = xm_info.yq ) and
|
||||
( lab_result_re.xmdh = xm_info.xmdh ) and
|
||||
( ( lab_result_re.jyrq = #{jyrq} ) AND
|
||||
( lab_result_re.yq = #{yq} ) AND
|
||||
( lab_result_re.ybh =#{ybh} ) )
|
||||
ORDER BY xm_info.dyxh asc
|
||||
</select>
|
||||
|
||||
<select id="getLabResultRe" resultType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
select *
|
||||
from lab_result_re
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
and jyrq = #{jyrq}
|
||||
</if>
|
||||
<if test="yq != null and yq != ''">
|
||||
and yq = #{yq}
|
||||
</if>
|
||||
<if test="ybh != null and ybh != ''">
|
||||
and ybh = #{ybh}
|
||||
</if>
|
||||
<if test="xmdh != null and xmdh != ''">
|
||||
and xmdh = #{xmdh}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<insert id="insertLabResultRe" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
insert into lab_result_re (jyrq, yq, ybh,xmdh,csjg)
|
||||
values (#{jyrq},#{yq},#{ybh},#{xmdh},#{csjg})
|
||||
</insert>
|
||||
<update id="updateLabResultRe" parameterType="com.czlis.common.core.domain.entity.lis.LabResultRe">
|
||||
update lab_result_re
|
||||
<set>
|
||||
<if test="xmdh != null">
|
||||
xmdh = #{xmdh},
|
||||
</if>
|
||||
<if test="csjg != null">
|
||||
csjg = #{csjg},
|
||||
</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
and jyrq = #{jyrq}
|
||||
</if>
|
||||
<if test="yq != null and yq != ''">
|
||||
and yq = #{yq}
|
||||
</if>
|
||||
<if test="ybh != null and ybh != ''">
|
||||
and ybh = #{ybh}
|
||||
</if>
|
||||
<if test="xmdh != null and xmdh != ''">
|
||||
and xmdh = #{xmdh}
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
<select id="getReqdetail" resultType="map">
|
||||
SELECT lab_reqdetail.sqh , lab_reqdetail.xh , lab_reqdetail.sqxmdh , lab_reqdetail.sqxmmc , lab_reqdetail.sl , lab_reqdetail.dj , lab_reqdetail.zt , lab_reqdetail.jjzt , lab_reqdetail.bz1 , lab_reqdetail.bz2 , lab_reqmain.ksdh , lab_reqmain.sqys , lab_reqmain.sqsj , lab_reqmain.jsys , lab_reqmain.jssj , lab_reqmain.brly , lab_reqmain.brdh , lab_reqmain.brxm , lab_reqdetail.numbk1 , lab_reqdetail.numbk2 FROM lab_reqdetail , lab_reqmain WHERE ( lab_reqdetail.sqh = lab_reqmain.sqh ) and ( ( lab_reqmain.sqh = #{sqh} ) )
|
||||
</select>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user