Compare commits
No commits in common. "fd7e817aa7f2d53e5f0a4e76831db2d20ba3c40a" and "933c912d95bba845229ed1b8cf8870479a5c5ddf" have entirely different histories.
fd7e817aa7
...
933c912d95
@ -17,5 +17,4 @@ public interface LabResultMapper {
|
|||||||
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);
|
int updateLabResultText(LabResult labResult);
|
||||||
List<LabResult> getLabResultListAll(LabResult labResult);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -252,10 +252,6 @@ public class CommonUtil {
|
|||||||
return labResultMapper.getLabResultList(jyrq, yq, ybh);
|
return labResultMapper.getLabResultList(jyrq, yq, ybh);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<LabResult> getLabResultListAll(LabResult labResult) {
|
|
||||||
return labResultMapper.getLabResultListAll(labResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void insertLabResult(LabResult labResult) {
|
public void insertLabResult(LabResult labResult) {
|
||||||
labResultMapper.insertLabResult(labResult);
|
labResultMapper.insertLabResult(labResult);
|
||||||
|
|||||||
@ -5,14 +5,10 @@ import com.czlis.common.core.domain.entity.lis.LabPat;
|
|||||||
import com.czlis.common.core.domain.entity.lis.LabResult;
|
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||||
import com.czlis.common.utils.SecurityUtils;
|
import com.czlis.common.utils.SecurityUtils;
|
||||||
import com.czlis.common.utils.ip.IpUtils;
|
import com.czlis.common.utils.ip.IpUtils;
|
||||||
import com.czlis.interfaceCommon.constants.ComLogConstants;
|
|
||||||
import com.czlis.interfaceCommon.constants.LabReqmainConstants;
|
|
||||||
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
||||||
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
|
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
|
||||||
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
|
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
|
||||||
import com.czlis.interfaceCommon.pojo.inter.SetReport;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -105,215 +101,4 @@ public class LisWorkUtils extends LisWorkconfirm {
|
|||||||
}
|
}
|
||||||
return lastLabPatParam;
|
return lastLabPatParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量审核前校验
|
|
||||||
*
|
|
||||||
* @param labPat
|
|
||||||
* @param labResultList
|
|
||||||
* @param checktype
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result beforeConfirm(LabPat labPat, List<LabResult> labResultList, Integer checktype) {
|
|
||||||
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
|
|
||||||
Date jyrq = labPat.getJyrq();
|
|
||||||
String yq = labPat.getYq();
|
|
||||||
String ybh = labPat.getYbh();
|
|
||||||
String jgbz = labPat.getJgbz();
|
|
||||||
if ("2".equals(jgbz)) return new Result("-1", "报告已审核!");
|
|
||||||
if ("5".equals(jgbz)) return new Result("-1", "已锁定报告禁止审核!");
|
|
||||||
if (!"1".equals(jgbz) && checktype == 2) {
|
|
||||||
String f_check1 = commonUtil.getComOptValue(yq, "f_check1");
|
|
||||||
if ("1".equals(f_check1)) return new Result("-1", "审核前必须先初审!");
|
|
||||||
}
|
|
||||||
if (checktype == 2) {
|
|
||||||
if (checkWorkTime(labPat) == 1) return new Result("-1", "核对医生不允许与检验医生相同!");
|
|
||||||
}
|
|
||||||
String limit_brly = commonUtil.getHISOPT("limit_brly");
|
|
||||||
String brly = labPat.getBrly();
|
|
||||||
if ("1".equals(limit_brly) && (brly == null || brly.isEmpty()))
|
|
||||||
return new Result("-1", "病人类型为空,禁止审核!");
|
|
||||||
String limit_yblx = commonUtil.getHISOPT("limit_yblx");
|
|
||||||
String yblx = labPat.getYblx();
|
|
||||||
if ("1".equals(limit_yblx) && (yblx == null || yblx.isEmpty()))
|
|
||||||
return new Result("-1", "样本类型为空,禁止审核!");
|
|
||||||
String limit_brxm = commonUtil.getHISOPT("limit_brxm");
|
|
||||||
String brxm = labPat.getBrxm();
|
|
||||||
if ("1".equals(limit_brxm) && (brxm == null || brxm.isEmpty()))
|
|
||||||
return new Result("-1", "病人姓名为空,禁止审核!");
|
|
||||||
if (brxm == null || brxm.isEmpty()) return new Result("-1", "姓名为空,不能审核");
|
|
||||||
String limit_ksdh = commonUtil.getHISOPT("limit_ksdh");
|
|
||||||
String ksdh = labPat.getKsdh();
|
|
||||||
if ("1".equals(limit_ksdh) && (ksdh == null || ksdh.isEmpty()))
|
|
||||||
return new Result("-1", "科室单位为空,禁止审核!");
|
|
||||||
String limit_patno = commonUtil.getHISOPT("limit_patno");
|
|
||||||
String brdh = labPat.getBrdh();
|
|
||||||
String brlyname = commonUtil.getComDictNameById("PT", brly);
|
|
||||||
if ("1".equals(limit_patno) && (brdh == null || brdh.isEmpty())) {
|
|
||||||
if (!"质控".equals(brlyname)) return new Result("-1", "病历号不能为空,禁止审核!");
|
|
||||||
}
|
|
||||||
String limit_brpatno = commonUtil.getHISOPT("limit_brpatno");
|
|
||||||
if ("1".equals(limit_brpatno) && (brdh == null || brdh.isEmpty())) {
|
|
||||||
if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!");
|
|
||||||
}
|
|
||||||
String yqdl = commonUtil.getYqdl(yq);
|
|
||||||
if (labResultList == null || labResultList.isEmpty()) return new Result("-1", "结果为空禁止审核!");
|
|
||||||
for (LabResult labResult : labResultList) {
|
|
||||||
String csjg = labResult.getCsjg();
|
|
||||||
if ("未做".equals(csjg)) {
|
|
||||||
return new Result("-1", "还有结果为“未做”的项目,不可审核!");
|
|
||||||
}
|
|
||||||
if (csjg != null) {
|
|
||||||
if (csjg.contains("ERR")) return new Result("-1", "有结果错误,不可审核!");
|
|
||||||
if (csjg.contains("需稀释")) return new Result("-1", "有结果需稀释,不可审核!");
|
|
||||||
if (csjg.contains("需复做")) return new Result("-1", "有结果需复做,不可审核!");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//多做结果判断
|
|
||||||
String otherresultmsg = commonUtil.getComOptValue(yq, "otherresultmsg");
|
|
||||||
if ("1".equals(otherresultmsg)) {
|
|
||||||
if (!"细菌仪".equals(yqdl)) {
|
|
||||||
int nullcount = lisWorkUtilsMapper.checkresultsqxmdh(jyrq, yq, ybh, labPat.getSqh());
|
|
||||||
if (nullcount > 0) return new Result("-1", "结果有多做的项目,不能审核!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String limit_jgwxh4 = commonUtil.getHISOPT("limit_jgwxh4");
|
|
||||||
if ("1".equals(limit_jgwxh4)) {
|
|
||||||
int wxh = lisWorkUtilsMapper.checkresultwxh(jyrq, yq, ybh);
|
|
||||||
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
|
|
||||||
}
|
|
||||||
String sqh = labPat.getSqh();
|
|
||||||
if (sqh != null && !sqh.isEmpty()) {
|
|
||||||
if (!"质控".equals(brlyname)) {
|
|
||||||
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
|
|
||||||
LabPat labPat0 = lisWorkUtilsMapper.checkdublereport(sqh, ybh);
|
|
||||||
if (labPat0 != null) {
|
|
||||||
String yqmc = commonUtil.getYqmc(yq);
|
|
||||||
String msg = "该申请单已经发过结果了,禁止审核!" + LisUtil.LINE_SEPARATOR + "日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
|
|
||||||
return new Result("-1", msg);
|
|
||||||
}
|
|
||||||
} else if ("1".equals(commonUtil.getHISOPT("sp_yqdublereport"))) {
|
|
||||||
LabPat labPat0 = lisWorkUtilsMapper.checkyqdublereport(sqh, yq, ybh);
|
|
||||||
if (labPat0 != null) {
|
|
||||||
String yqmc = commonUtil.getYqmc(yq);
|
|
||||||
String msg = "该申请单已经发过结果了,禁止审核!" + LisUtil.LINE_SEPARATOR + "日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
|
|
||||||
return new Result("-1", msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String Userid = labPat.getHdys();
|
|
||||||
if (Userid == null || Userid.isEmpty()) {
|
|
||||||
Userid = getusername();
|
|
||||||
}
|
|
||||||
//初审不需要调用接口
|
|
||||||
if (checktype == 1) return new Result("0", "保存成功!");
|
|
||||||
//调用his报告接口,检查外部接口对审核前的定制需求
|
|
||||||
SetReport setReport = new SetReport();
|
|
||||||
setReport.setIp(getIP());
|
|
||||||
setReport.setJyrq(DateFormatUtils.format(jyrq, "yyyy-MM-dd"));
|
|
||||||
setReport.setYbh(ybh);
|
|
||||||
setReport.setUserid(Userid);
|
|
||||||
setReport.setYq(yq.trim());
|
|
||||||
setReport.setStatus(LisinterfaceNameConstants.REPORTSTART);
|
|
||||||
if (!"细菌仪".equals(yqdl)) {
|
|
||||||
if (!"1".equals(commonUtil.getHISOPT("wswcbbgbl"))) {
|
|
||||||
String ls_cbbgyq = commonUtil.getComOptValue(yq, "cbbgyq");
|
|
||||||
if (ls_cbbgyq != null && !ls_cbbgyq.isEmpty()) {
|
|
||||||
String ls_ejbgyq = "EJBG" + ls_cbbgyq;
|
|
||||||
ls_cbbgyq = "CBBG" + ls_cbbgyq;
|
|
||||||
int count = commonUtil.getCountByKey(jyrq, ls_cbbgyq, ybh);
|
|
||||||
if (count > 0) {
|
|
||||||
setReport.setYq(ls_cbbgyq);
|
|
||||||
setReport.setStatus(LisinterfaceNameConstants.REPORTCANCAL);
|
|
||||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
|
|
||||||
if(!result.getCode().equals("0")) return new Result("-1", "调用审核接口失败1:"+result.getMsg());
|
|
||||||
}
|
|
||||||
count = commonUtil.getCountByKey(jyrq, ls_ejbgyq, ybh);
|
|
||||||
if (count > 0) {
|
|
||||||
setReport.setYq(ls_ejbgyq);
|
|
||||||
setReport.setStatus(LisinterfaceNameConstants.REPORTCANCAL);
|
|
||||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
|
|
||||||
if(!result.getCode().equals("0")) return new Result("-1", "调用取消审核接口失败2:"+result.getMsg());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setReport.setYq(yq.trim());
|
|
||||||
setReport.setStatus(LisinterfaceNameConstants.REPORTSTART);
|
|
||||||
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
|
|
||||||
if (result.getCode().equals("5")) {
|
|
||||||
return new Result("0", "保存成功!");
|
|
||||||
}
|
|
||||||
if (!result.getCode().equals("0")) return result;
|
|
||||||
checkxpywrgjz(labPat);
|
|
||||||
return new Result("0", "保存成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量审核
|
|
||||||
* @param labPat
|
|
||||||
* @param labResultList
|
|
||||||
* @param hdys
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Result confirm(LabPat labPat,List<LabResult> labResultList, String hdys) {
|
|
||||||
if (hdys == null || hdys.isEmpty()) return new Result("-1", "审核者为空,无法审核!");
|
|
||||||
labPat.setHdys(hdys);
|
|
||||||
String yq = labPat.getYq();
|
|
||||||
Date jyrq = labPat.getJyrq();
|
|
||||||
String ybh = labPat.getYbh();
|
|
||||||
//1,审核权限校验
|
|
||||||
if (!commonUtil.getUserPower(yq, hdys, 20)) {
|
|
||||||
return new Result("-1", "当前核对者无权对本仪器报告审核!");
|
|
||||||
}
|
|
||||||
//2:数据合法性校验
|
|
||||||
Result result0 = beforeConfirm(labPat, labResultList, 2);
|
|
||||||
if (!"0".equals(result0.getCode())) return result0;
|
|
||||||
|
|
||||||
|
|
||||||
//3:数据完整保存
|
|
||||||
labResultList = saveallresult(labPat, labResultList);
|
|
||||||
boolean wjz = getAlarmFlag(labResultList);
|
|
||||||
//同步主表危急值标识
|
|
||||||
String alarmflag = labPat.getAlarmflag();
|
|
||||||
if (("1".equals(alarmflag) && !wjz)) {
|
|
||||||
labPat.setAlarmflag("");
|
|
||||||
commonUtil.updateLabPat(labPat);
|
|
||||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz) {
|
|
||||||
labPat.setAlarmflag("1");
|
|
||||||
commonUtil.updateLabPat(labPat);
|
|
||||||
}
|
|
||||||
// if (wjz) {
|
|
||||||
// return new Result("4", getAlarmMsg(labResultList), 4);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//医学审核条件判断
|
|
||||||
Result result = chksample(labPat, labResultList, 0);
|
|
||||||
if (!"0".equals(result.getCode())) return result;
|
|
||||||
|
|
||||||
|
|
||||||
//高级医学审核条件判断
|
|
||||||
Result result1 = chksamplenew(labPat, labResultList, 0);
|
|
||||||
if (!"0".equals(result1.getCode())) return result1;
|
|
||||||
|
|
||||||
//4:CA请求业务的处理
|
|
||||||
//Result result=addCA(jyrq, yq, ybh, hdys);
|
|
||||||
//if("0".equals(result.getCode()))return result;
|
|
||||||
//5:数据状态修改,异步上传接口作业创建
|
|
||||||
Result result2 = afterconfirm(labPat, 0);
|
|
||||||
if (!"0".equals(result2.getCode())) return result2;
|
|
||||||
setComLog(jyrq, yq, ybh, hdys, ComLogConstants.LG_CK, "");
|
|
||||||
String sqh = labPat.getSqh();
|
|
||||||
if (sqh != null) {
|
|
||||||
setlabReqsteplog(sqh, LabReqmainConstants.CONFIRM, hdys);
|
|
||||||
}
|
|
||||||
return new Result("0", "审核成功!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -409,9 +409,4 @@
|
|||||||
and ybh = #{ybh,jdbcType=VARCHAR}
|
and ybh = #{ybh,jdbcType=VARCHAR}
|
||||||
and xmdh = #{xmdh,jdbcType=VARCHAR}
|
and xmdh = #{xmdh,jdbcType=VARCHAR}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getLabResultListAll" resultType="com.czlis.common.core.domain.entity.lis.LabResult">
|
|
||||||
select * from lab_Result where jyrq = #{jyrq} and yq = #{yq}
|
|
||||||
<if test="ybh != null and ybh !=''">and ybh = #{ybh}</if>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -2,15 +2,13 @@ package com.czlis.liswork.controller.work;
|
|||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.liswork.pojo.DTO.BatchCheckDTO;
|
import com.czlis.liswork.pojo.DTO.BatchCheckDTO;
|
||||||
import com.czlis.liswork.pojo.DTO.work.BatchCheckDataDTO;
|
|
||||||
import com.czlis.liswork.service.BatchCheckService;
|
import com.czlis.liswork.service.BatchCheckService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
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.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import java.util.List;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量审核
|
* 批量审核
|
||||||
@ -25,16 +23,9 @@ public class BatchCheckController {
|
|||||||
BatchCheckService batchCheckService;
|
BatchCheckService batchCheckService;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("获取数据")
|
@GetMapping("/query")
|
||||||
@PostMapping("/query")
|
public Result queryData(BatchCheckDTO batchCheckDTO){
|
||||||
public Result queryData(@RequestBody BatchCheckDTO batchCheckDTO){
|
|
||||||
return batchCheckService.queryData(batchCheckDTO);
|
return batchCheckService.queryData(batchCheckDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("审核条码")
|
|
||||||
@PostMapping("/checkData")
|
|
||||||
public Result checkData(@RequestBody List<BatchCheckDataDTO> batchCheckDTOList){
|
|
||||||
return batchCheckService.checkData(batchCheckDTOList);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
package com.czlis.liswork.pojo.DTO.work;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class BatchCheckDataDTO {
|
|
||||||
private Date jyrq;
|
|
||||||
private String yq;
|
|
||||||
private String ybh;
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -2,12 +2,7 @@ package com.czlis.liswork.service;
|
|||||||
|
|
||||||
import com.czlis.common.core.domain.Result;
|
import com.czlis.common.core.domain.Result;
|
||||||
import com.czlis.liswork.pojo.DTO.BatchCheckDTO;
|
import com.czlis.liswork.pojo.DTO.BatchCheckDTO;
|
||||||
import com.czlis.liswork.pojo.DTO.work.BatchCheckDataDTO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface BatchCheckService {
|
public interface BatchCheckService {
|
||||||
Result queryData(BatchCheckDTO batchCheckDTO);
|
Result queryData(BatchCheckDTO batchCheckDTO);
|
||||||
|
|
||||||
Result checkData(List<BatchCheckDataDTO> batchCheckDTOList);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,15 @@
|
|||||||
package com.czlis.liswork.service.impl.work;
|
package com.czlis.liswork.service.impl.work;
|
||||||
|
|
||||||
import com.czlis.common.annotation.RepeatSubmit;
|
|
||||||
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.interfaceCommon.utils.CommonUtil;
|
import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||||
import com.czlis.interfaceCommon.utils.LisUtil;
|
|
||||||
import com.czlis.interfaceCommon.utils.LisWorkUtils;
|
|
||||||
import com.czlis.liswork.mapper.work.BatchCheckMapper;
|
import com.czlis.liswork.mapper.work.BatchCheckMapper;
|
||||||
import com.czlis.liswork.pojo.DTO.BatchCheckDTO;
|
import com.czlis.liswork.pojo.DTO.BatchCheckDTO;
|
||||||
import com.czlis.liswork.pojo.DTO.work.BatchCheckDataDTO;
|
|
||||||
import com.czlis.liswork.service.BatchCheckService;
|
import com.czlis.liswork.service.BatchCheckService;
|
||||||
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.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -26,61 +20,10 @@ public class BatchCheckServiceImpl implements BatchCheckService {
|
|||||||
BatchCheckMapper batchCheckMapper;
|
BatchCheckMapper batchCheckMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CommonUtil commonUtil;
|
private CommonUtil commonUtil;
|
||||||
@Autowired
|
|
||||||
LisWorkUtils lisWorkUtils;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result queryData(BatchCheckDTO batchCheckDTO) {
|
public Result queryData(BatchCheckDTO batchCheckDTO) {
|
||||||
Date jyrq1 = batchCheckDTO.getJyrq1();
|
|
||||||
Date jyrq2 = batchCheckDTO.getJyrq2();
|
|
||||||
String yq = batchCheckDTO.getYq();
|
|
||||||
if (jyrq1 == null) return new Result("-1", "检验日期不能为空!");
|
|
||||||
if (jyrq2 == null) return new Result("-1", "检验日期不能为空!");
|
|
||||||
if(yq == null) return new Result("-1","仪器不能为空!");
|
|
||||||
List<LabPat> labPatList = batchCheckMapper.queryData(batchCheckDTO);
|
List<LabPat> labPatList = batchCheckMapper.queryData(batchCheckDTO);
|
||||||
return new Result("0","获取数据成功!",labPatList);
|
return new Result("0","获取数据成功!",labPatList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result checkData(List<BatchCheckDataDTO> batchCheckDTOList) {
|
|
||||||
String errText = "";
|
|
||||||
int i = 0;
|
|
||||||
for (BatchCheckDataDTO batchCheckDTO : batchCheckDTOList) {
|
|
||||||
Date jyrq = batchCheckDTO.getJyrq();
|
|
||||||
String yq = batchCheckDTO.getYq();
|
|
||||||
String ybh = batchCheckDTO.getYbh();
|
|
||||||
String userId = batchCheckDTO.getUserId();
|
|
||||||
if(userId == null || userId.equals("")) {
|
|
||||||
errText += "入参审核者不能为空!";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LabPat labPatOne = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
|
||||||
if (labPatOne == null) {
|
|
||||||
errText += "没有找到上机信息jyrq:" + LisUtil.isBank(jyrq) + " yq:" + LisUtil.isBank(yq) + " ybh:" + LisUtil.isBank(ybh) + "\r\n";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LabResult labResult = new LabResult();
|
|
||||||
labResult.setJyrq(jyrq);
|
|
||||||
labResult.setYq(yq);
|
|
||||||
labResult.setYbh(ybh);
|
|
||||||
List<LabResult> labResultList = commonUtil.getLabResultListAll(labResult);
|
|
||||||
if (labResultList.size() <= 0) {
|
|
||||||
errText += "没有找到结果信息:" + LisUtil.isBank(jyrq) + " yq:" + LisUtil.isBank(yq) + " ybh:" + LisUtil.isBank(ybh) + "\r\n";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//审核
|
|
||||||
Result result1 = lisWorkUtils.confirm(labPatOne,labResultList,userId);
|
|
||||||
if (!result1.getCode().equals("0")) {
|
|
||||||
errText += "审核失败:" + result1.getMsg() + "\r\n";
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//审核失败个数
|
|
||||||
int i1 = batchCheckDTOList.size() - i;
|
|
||||||
return new Result("1", "执行成功:" + i + "个,失败:" + i1 + "个,\r\n" + errText);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
<select id="queryData" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
<select id="queryData" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
select * from lab_pat where jyrq >= #{jyrq1} and jyrq <= #{jyrq2} and yq = #{yq}
|
select * from lab_pat where jyrq >= #{jyrq1} and jyrq <= #{jyrq2} and yq = #{yq}
|
||||||
|
and ( CASE WHEN ybh NOT LIKE '%[^0-9]%' THEN CAST(ybh AS INT) ELSE 0 END) between #{ybh1} and #{ybh2}
|
||||||
]]>
|
]]>
|
||||||
<if test="ybh1 != null and ybh1 != ''">and ( CASE WHEN ybh NOT LIKE '%[^0-9]%' THEN CAST(ybh AS bigint) ELSE 0 END) between #{ybh1} and #{ybh2}</if>
|
|
||||||
<if test="ksdh != null and ksdh != ''">and ksdh = #{ksdh}</if>
|
<if test="ksdh != null and ksdh != ''">and ksdh = #{ksdh}</if>
|
||||||
<if test="yhdh != null and yhdh != ''">and yhdh = #{yhdh}</if>
|
<if test="yhdh != null and yhdh != ''">and yhdh = #{yhdh}</if>
|
||||||
<if test="brly != null and brly != ''">and brly = #{brly}</if>
|
<if test="brly != null and brly != ''">and brly = #{brly}</if>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user