主程序报告处理审核初步代码
This commit is contained in:
parent
d0c905821e
commit
17e75c4c52
@ -46,4 +46,9 @@ public class CacheConstants
|
||||
* lis字典缓存
|
||||
*/
|
||||
public static final String COM_DICT_KEY = "com_dict:";
|
||||
/**
|
||||
* lis设置缓存
|
||||
*/
|
||||
public static final String COM_OPT_KEY = "com_opt:";
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
package com.czlis.common.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.czlis.common.constant.CacheConstants;
|
||||
import com.czlis.common.core.domain.entity.lis.ComOpt;
|
||||
import com.czlis.common.core.redis.RedisCache;
|
||||
import com.czlis.common.utils.spring.SpringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ComOptionUtils {
|
||||
|
||||
/**
|
||||
* 设置字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @param dictDatas 字典数据列表
|
||||
*/
|
||||
public static void setOptCache(String key, List<ComOpt> optDatas) {
|
||||
//先清除该key的所有缓存,然后再重新设置该key的缓存
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(key);
|
||||
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), optDatas);
|
||||
}
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
public static void clearOptCache() {
|
||||
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys("com_opt:" + "*");
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||
}
|
||||
/**
|
||||
* 获取字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @return dictDatas 字典数据列表
|
||||
*/
|
||||
public static List<ComOpt> getOptCache(String key) {
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(arrayCache)) {
|
||||
return arrayCache.toList(ComOpt.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
public static String getCacheKey(String configKey) {
|
||||
return CacheConstants.COM_OPT_KEY + configKey;
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,11 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface CommonMapper {
|
||||
Date getCurrentTime();
|
||||
String getyhjs(@Param("yhdh")String yhdh);
|
||||
String getUserPower(@Param("yq")String yq,@Param("yhdh")String yhdh);
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@ public interface LabPatMapper {
|
||||
List<LabPat> getSampleList(@Param("jyrq") Date jyrq, @Param("yq") String yq);
|
||||
List<LabPat> getSampleListday(@Param("yq") String yq,@Param("days")Long days);
|
||||
List<LabPat> getLabPat(LabPat labPat);
|
||||
int delLabPat(@Param("jyrq") String jyrq, @Param("yq") String yq,@Param("ybh") String ybh);
|
||||
int delLabPat(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh);
|
||||
int updateLabPat(LabPat labPat);
|
||||
//根据主键判断是否存在数据
|
||||
int getCountByKey(@Param("jyrq") String jyrq, @Param("yq") String yq,@Param("ybh") String ybh) ;
|
||||
int getCountByKey(@Param("jyrq") Date jyrq, @Param("yq") String yq,@Param("ybh") String ybh) ;
|
||||
//根据编号查sqh
|
||||
String getSqhByKey(@Param("jyrq")String jyrq,@Param("yq") String yq,@Param("ybh") String ybh);
|
||||
String getSqhByKey(@Param("jyrq")Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh);
|
||||
|
||||
}
|
||||
|
||||
@ -6,4 +6,5 @@ import java.util.List;
|
||||
|
||||
public interface LabReqdetailMapper {
|
||||
List<LabReqdetail> getLabReqdetailList(String sqh);
|
||||
int getCountByKey(String sqh);
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.czlis.interfaceCommon.utils;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.LabPat;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqdetail;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
import com.czlis.common.core.domain.entity.lis.LabResult;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.*;
|
||||
import com.czlis.common.utils.ComDictUtils;
|
||||
import com.czlis.common.utils.ComOptionUtils;
|
||||
import com.czlis.interfaceCommon.mapper.*;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -43,8 +43,8 @@ public class CommonUtil {
|
||||
public int delLabPat(LabPat labPat){return labPatMapper.updateLabPat(labPat);}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateLabPat(LabPat labPat){return labPatMapper.updateLabPat(labPat);}
|
||||
public int getCountByKey(String jyrq, String yq,String ybh) {return labPatMapper.getCountByKey(jyrq,yq,ybh);}
|
||||
public String getSqhByKey(String jyrq,String yq,String ybh){return labPatMapper.getSqhByKey(jyrq,yq,ybh);}
|
||||
public int getCountByKey(Date jyrq, String yq,String ybh) {return labPatMapper.getCountByKey(jyrq,yq,ybh);}
|
||||
public String getSqhByKey(Date jyrq,String yq,String ybh){return labPatMapper.getSqhByKey(jyrq,yq,ybh);}
|
||||
//申请单主表方法集合
|
||||
public LabReqmain getLabReqmainOne(String sqh){
|
||||
return labReqmainMapper.getLabReqmainOne(sqh);
|
||||
@ -88,24 +88,35 @@ public class CommonUtil {
|
||||
}
|
||||
|
||||
//字典查询方法集合
|
||||
public String getComDictNameById(String zdlb,String xxdh){
|
||||
String zdmc = comDictMapper.getComDictNameById(zdlb,xxdh);
|
||||
if(zdmc == null || zdmc.equals("")){
|
||||
return xxdh;
|
||||
}else{
|
||||
return zdmc;
|
||||
}
|
||||
public String getComDictNameById(String zdlb, String zddh) {
|
||||
List<ComDict> comDictList =getDictCache(zdlb);
|
||||
if(comDictList!=null){
|
||||
for (ComDict dict : comDictList) {
|
||||
if (zddh.equals(dict.getZddh())) {
|
||||
return dict.getZdmc();
|
||||
}
|
||||
}}
|
||||
return comDictMapper.getComDictNameById(zdlb,zddh);
|
||||
}
|
||||
|
||||
public String getComDictIdByName(String zdlb,String zdmc){
|
||||
String zddh = comDictMapper.getComDictIdByName(zdlb,zdmc);
|
||||
if(zddh == null || zddh.equals("")){
|
||||
return zdmc;
|
||||
}else{
|
||||
return zddh;
|
||||
}
|
||||
public String getComDictIdByName(String zdlb,String zdmc) {
|
||||
List<ComDict> comDictList =getDictCache(zdlb);
|
||||
if(comDictList!=null){
|
||||
for (ComDict dict : comDictList) {
|
||||
if (zdmc.equals(dict.getZdmc())) {
|
||||
return dict.getZddh();
|
||||
}
|
||||
}}
|
||||
return comDictMapper.getComDictIdByName(zdlb,zdmc);
|
||||
}
|
||||
public String getComOptValue(String yq,String xxdh){
|
||||
List<ComOpt> comOptList =getOptCache(yq);
|
||||
if(comOptList!=null){
|
||||
for (ComOpt opt : comOptList) {
|
||||
if (xxdh.equals(opt.getXxdh())) {
|
||||
return opt.getXxqz();
|
||||
}
|
||||
}}
|
||||
return comOptMapper.getComOptValue(yq,xxdh);
|
||||
}
|
||||
|
||||
@ -113,6 +124,21 @@ public class CommonUtil {
|
||||
return labReqdetailMapper.getLabReqdetailList(sqh);
|
||||
}
|
||||
|
||||
private List<ComDict> getDictCache(String zdlb) {
|
||||
return ComDictUtils.getDictCache(zdlb);
|
||||
}
|
||||
private List<ComOpt> getOptCache(String yq) {
|
||||
return ComOptionUtils.getOptCache(yq);
|
||||
}
|
||||
|
||||
|
||||
public Boolean getUserPower(String yq,String yhdh,int powerIdx){
|
||||
if ("LIS".equals(yhdh)) return true;
|
||||
if ("lis".equals(yhdh)) return true;
|
||||
String yhjs= commonMapper.getyhjs(yhdh);
|
||||
if ("S".equals(yhjs)) return true;
|
||||
String userPower=commonMapper.getUserPower(yq,yhdh);
|
||||
if(userPower==null) return false;
|
||||
if("Y".equals(userPower.substring(powerIdx - 1,1)))return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,8 @@
|
||||
package com.czlis.interfaceCommon.utils;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LisUtil {
|
||||
|
||||
/**
|
||||
@ -29,4 +23,49 @@ public class LisUtil {
|
||||
public static Date getBirthDayFromAge(int nl, String nldw) {
|
||||
return AgeUtils.getBirthDayFromAge(nl,nldw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按GBK编码的字节宽度截取字符串,最多取cutlens个字节(避免截取半个汉字)
|
||||
* @param str 原始字符串
|
||||
* @param beginidx 起始位置
|
||||
* @param cutlens 截取长度
|
||||
* @return 截取后的字符串
|
||||
*/
|
||||
public static String substringByGbkWidth(String str,int beginidx,int cutlens) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
int targetWidth = cutlens; // 目标字节宽度
|
||||
int currentWidth =beginidx; // 当前累计字节宽度
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
for (char c : str.toCharArray()) {
|
||||
// 计算当前字符在GBK编码下的字节数
|
||||
int charWidth;
|
||||
try {
|
||||
// GBK编码中,汉字占2字节,英文等占1字节
|
||||
charWidth = String.valueOf(c).getBytes("GBK").length;
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// 理论上GBK是Java默认支持的编码,不会走到这里
|
||||
throw new RuntimeException("不支持GBK编码", e);
|
||||
}
|
||||
|
||||
// 判断加上当前字符后是否超过目标宽度
|
||||
if (currentWidth + charWidth > targetWidth) {
|
||||
break; // 超过则停止,不截取当前字符
|
||||
}
|
||||
|
||||
// 未超过则累加宽度并添加字符
|
||||
currentWidth += charWidth;
|
||||
result.append(c);
|
||||
|
||||
// 如果刚好达到目标宽度,提前结束
|
||||
if (currentWidth == targetWidth) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,9 +5,12 @@
|
||||
<select id="getCurrentTime">
|
||||
select getdate()
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getUserPower" resultType="String">
|
||||
select yhqx Into :ls_powerdet from com_usrpower where yhdh = #{yhdh} and yq = #{yq} and xtdh = 'LIS'
|
||||
</select>
|
||||
<select id="getyhjs" resultType="String">
|
||||
select yhjs from com_usr where yhdh=#{yhdh}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
<select id="getLabReqdetailList" resultType="com.czlis.common.core.domain.entity.lis.LabReqdetail">
|
||||
select * from lab_reqdetail where sqh = #{sqh}
|
||||
</select>
|
||||
|
||||
<select id="getCountByKey" resultType="int">
|
||||
select count(1) from lab_reqdetail where sqh = #{sqh}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -37,4 +37,18 @@ public class LisWorkOperController extends BaseController {
|
||||
public Result changePat(LabPat labPat){
|
||||
return lisWorkOperService.changePat(labPat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病人信息
|
||||
* @param jyrq 检验日期
|
||||
* @param yq 仪器
|
||||
* @param ybh 样本号
|
||||
* @param hdys 核对医生
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("修改病人信息")
|
||||
@PostMapping("/check2")
|
||||
public Result check2(Date jyrq, String yq, String ybh,String hdys){
|
||||
return lisWorkOperService.check2(jyrq, yq, ybh, hdys);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,14 @@
|
||||
package com.czlis.liswork.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
public interface LisWorkOperMapper {
|
||||
Long checkReqClass(String sqh,String yq);
|
||||
Long checkReqClass(@Param("sqh") String sqh,@Param("yq") String yq);
|
||||
String selectsqxmdh(String sqh);
|
||||
String selectyqdl(String yq);
|
||||
void sp_setrefs(Map<String,Object> map);
|
||||
void updatelabresultsqxmdhall(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqxmdh") String sqxmdh);
|
||||
void updatelabresultsqxmdh(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
|
||||
}
|
||||
|
||||
@ -14,8 +14,8 @@ public interface LabPatService {
|
||||
Result delLabPat(LabPat labPat);
|
||||
Result updateLabPat(LabPat labPat);
|
||||
//根据主键判断是否存在数据
|
||||
int getCountById(String jyrq, String yq,String ybh) ;
|
||||
int getCountById(Date jyrq, String yq,String ybh) ;
|
||||
//根据编号查sqh
|
||||
String getSqhById(String jyrq,String yq,String ybh);
|
||||
String getSqhById(Date jyrq,String yq,String ybh);
|
||||
|
||||
}
|
||||
|
||||
@ -8,4 +8,6 @@ import java.util.Date;
|
||||
public interface LisWorkOperService {
|
||||
Result newPatInfo(Date jyrq,String ybh, String sqh, String yq, Long userId);
|
||||
Result changePat(LabPat labPat);
|
||||
|
||||
Result check2(Date jyrq, String yq, String ybh, String hdys);
|
||||
}
|
||||
|
||||
@ -63,13 +63,13 @@ public class LabPatServiceImpl implements LabPatService {
|
||||
//根据主键判断是否存在数据
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int getCountById(String jyrq, String yq,String ybh) {
|
||||
public int getCountById(Date jyrq, String yq,String ybh) {
|
||||
return labPatMapper.getCountByKey(jyrq,yq,ybh);
|
||||
}
|
||||
//根据编号查sqh
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public String getSqhById(String jyrq,String yq,String ybh){
|
||||
public String getSqhById(Date jyrq,String yq,String ybh){
|
||||
return labPatMapper.getSqhByKey(jyrq,yq,ybh);
|
||||
}
|
||||
|
||||
|
||||
@ -2,20 +2,21 @@ package com.czlis.liswork.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.czlis.common.core.domain.entity.lis.*;
|
||||
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
|
||||
import com.czlis.common.core.domain.Result;
|
||||
import com.czlis.common.core.domain.entity.lis.LabPat;
|
||||
import com.czlis.common.core.domain.entity.lis.LabReqmain;
|
||||
import com.czlis.interfaceCommon.constants.SampleStatusConstants;
|
||||
import com.czlis.interfaceCommon.mapper.LabReqdetailMapper;
|
||||
import com.czlis.interfaceCommon.mapper.LabReqmainMapper;
|
||||
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
|
||||
import com.czlis.interfaceCommon.pojo.inter.GetReqInterface;
|
||||
import com.czlis.interfaceCommon.pojo.inter.SetReqStatus;
|
||||
import com.czlis.interfaceCommon.utils.AgeUtils;
|
||||
import com.czlis.interfaceCommon.utils.CommonUtil;
|
||||
import com.czlis.interfaceCommon.utils.LisInterfaceUtil;
|
||||
import com.czlis.interfaceCommon.utils.LisUtil;
|
||||
import com.czlis.liswork.mapper.LisWorkOperMapper;
|
||||
import com.czlis.liswork.mapper.dict.LabInstrvsreqclassMapper;
|
||||
import com.czlis.common.core.domain.entity.lis.LabInstrvsreqclass;
|
||||
import com.czlis.liswork.service.LisWorkOperService;
|
||||
import com.czlis.liswork.utils.LisWorkUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -40,7 +41,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
LabInstrvsreqclassMapper labInstrvsreqclassMapper;
|
||||
@Autowired
|
||||
LabReqmainMapper labReqmainMapper;
|
||||
|
||||
@Autowired
|
||||
LabReqdetailMapper labReqdetailMapper;
|
||||
@Override
|
||||
public Result newPatInfo(Date jyrq,String ybh, String sqh, String yq, Long userId) {
|
||||
|
||||
@ -161,17 +163,17 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
labPat.setBrxb(labReqmain.getBrxb());
|
||||
labPat.setBrly(labReqmain.getBrly());
|
||||
labPat.setCh(labReqmain.getCh());
|
||||
Map<String, String> ageFromBirthDay = LisWorkUtil.getAgeFromBirthDay(DateUtil.format(labReqmain.getBrsr(), "yyyy-MM-dd"));
|
||||
String age = ageFromBirthDay.get("age");
|
||||
String unit = ageFromBirthDay.get("unit");
|
||||
Map<String, Object> ageFromBirthDay = AgeUtils.getAgeByBirthDate(labReqmain.getBrsr());
|
||||
String age = ageFromBirthDay.get("nl").toString();
|
||||
String unit = ageFromBirthDay.get("nldw").toString();
|
||||
labPat.setNl(Integer.parseInt(age));
|
||||
labPat.setNldw(unit);
|
||||
labPat.setSqh(sqh);
|
||||
labPat.setSqsj(labReqmain.getSqsj());
|
||||
labPat.setSqsj(commonUtil.getCurrentTime());
|
||||
labPat.setJgbz("0");
|
||||
labPat.setZd(labReqmain.getZd());
|
||||
labPat.setCyrq(labReqmain.getCysj());
|
||||
labPat.setJymd(labReqmain.getJymd());
|
||||
labPat.setJymd(LisUtil.substringByGbkWidth(labReqmain.getJymd(),0,50));
|
||||
labPat.setLastuser(userId);
|
||||
labPat.setLastdt(commonUtil.getCurrentTime());
|
||||
labPat.setShcs(0);
|
||||
@ -192,5 +194,125 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
labReqmainMapper.updateLabReqmainZT(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核报告单全流程
|
||||
* @param jyrq
|
||||
* @param yq
|
||||
* @param ybh
|
||||
* @param hdys
|
||||
* @return
|
||||
*/
|
||||
public Result check2(Date jyrq, String yq, String ybh, String hdys){
|
||||
//1,审核权限校验
|
||||
if(!commonUtil.getUserPower(yq,hdys,20))return new Result("-1","当前核对者无权对本仪器报告审核!");
|
||||
//2:数据合法性校验
|
||||
Result result=beforecheck2(jyrq, yq, ybh, hdys);
|
||||
if("0".equals(result.getCode()))return result;
|
||||
//3:数据完整性校验
|
||||
result= saveallresult(jyrq, yq, ybh, hdys);
|
||||
if("0".equals(result.getCode()))return result;
|
||||
//4:CA请求业务的处理
|
||||
//Result result=addCA(jyrq, yq, ybh, hdys);
|
||||
//if("0".equals(result.getCode()))return result;
|
||||
//5:数据状态修改,异步上传接口作业创建
|
||||
//Result result=aftercheck2(jyrq, yq, ybh, hdys);
|
||||
//if("0".equals(result.getCode()))return result;
|
||||
return new Result("0","保存成功!");
|
||||
}
|
||||
public Result beforecheck2(Date jyrq, String yq, String ybh, String hdys){
|
||||
if(hdys==null || "".equals(hdys) ) new Result("-1","审核者为空,无法审核!");
|
||||
LabPat labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
if(labPat==null)return new Result("-1","病人信息为空禁止审核!");
|
||||
String jgbz=labPat.getJgbz();
|
||||
if("2".equals(jgbz)) new Result("0","保存成功!");
|
||||
if("5".equals(jgbz)) return new Result("-1","已锁定报告禁止审核!");
|
||||
if(!"1".equals(jgbz)){
|
||||
String f_check1=commonUtil.getComOptValue(yq,"f_check1");
|
||||
if("1".equals(f_check1)) return new Result("-1","审核前必须先初审!");
|
||||
}
|
||||
String brxm=labPat.getBrxm();
|
||||
if(brxm==null || "".equals(brxm) ) new Result("-1","姓名为空禁止审核!");
|
||||
return new Result("0","保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存所有结果的修正值,涉及:空结果清除,计算项目添加,添加单位,添加申请项目编码,参考值重新计算更新,结果标志重新计算更新,危急值标志计算更新
|
||||
* @param jyrq
|
||||
* @return
|
||||
*/
|
||||
public Result saveallresult(Date jyrq, String yq, String ybh, String hdys){
|
||||
List<LabResult> labResultList =commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
if(labResultList==null)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 keepnodataitem=commonUtil.getComOptValue(yq,"keepnodataitem");
|
||||
if("1".equals(keepnodataitem)){}else{
|
||||
for (LabResult labResult : labResultList) {
|
||||
String csjg=labResult.getCsjg();
|
||||
if (csjg==null || "".equals(csjg)) {
|
||||
commonUtil.delLabResult(labResult);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
String yqdl=lisWorkOperMapper.selectyqdl(yq);
|
||||
if(!"细菌仪".equals(yqdl)) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("jyrq", jyrq);
|
||||
map.put("yq", yq);
|
||||
map.put("ybh", ybh);
|
||||
map.put("settype", "1");
|
||||
map.put("retcode", "");
|
||||
map.put("retmsg", "");
|
||||
lisWorkOperMapper.sp_setrefs(map);
|
||||
String retCode = String.valueOf(map.get("retcode"));
|
||||
String retMsg = String.valueOf(map.get("retmsg"));
|
||||
log.info("调用存储过程{}返回值:{},{}", "sp_setrefs", retCode, retMsg);
|
||||
if (retCode == null || "".equals(retCode) || "-1".equals(retCode))
|
||||
return new Result("-1", "保存常规参考值失败!");
|
||||
}
|
||||
setItemSqxmdh(jyrq, yq, ybh);
|
||||
return new Result("0","保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 结果表补充申请单项目代码
|
||||
* @param jyrq
|
||||
* @param yq
|
||||
* @param ybh
|
||||
*/
|
||||
public void setItemSqxmdh(Date jyrq, String yq, String ybh){
|
||||
String sqh=commonUtil.getSqhByKey(jyrq,yq,ybh);
|
||||
if (sqh==null || "".equals(sqh)) {}else{
|
||||
int sl=labReqdetailMapper.getCountByKey(sqh);
|
||||
if(sl==1){
|
||||
String sqxmdh=lisWorkOperMapper.selectsqxmdh(sqh);
|
||||
lisWorkOperMapper.updatelabresultsqxmdhall(jyrq,yq,ybh,sqxmdh);
|
||||
}else{
|
||||
lisWorkOperMapper.updatelabresultsqxmdh(jyrq,yq,ybh,sqh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算项目增加及重新计算
|
||||
* @param jyrq
|
||||
* @param yq
|
||||
* @param ybh
|
||||
*/
|
||||
public void calcsample(Date jyrq, String yq, String ybh){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,27 @@
|
||||
where lab_reqdetail.sqxmdh=xm_feeinstr.sfxmdh
|
||||
and lab_reqdetail.sqh=#{sqh} and xm_feeinstr.yq=#{yq};
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectsqxmdh" resultType="String">
|
||||
select sqxmdh from lab_reqdetail where lab_reqdetail.sqh=#{sqh}
|
||||
</select>
|
||||
<select id="selectyqdl" resultType="String">
|
||||
select yqdl from lab_instr where lab_instr.yq=#{yq}
|
||||
</select>
|
||||
<update id="updatelabresultsqxmdhall">
|
||||
update lab_result set sqxmdh=#{sqxmdh} where yq=#{yq} and jyrq=#{jyrq} and ybh=#{ybh};
|
||||
</update>
|
||||
<update id="updatelabresultsqxmdh">
|
||||
<![CDATA[ update a set a.sqxmdh=c.sqxmdh from lab_result a,xm_reqitem_vs_reportitem b ,lab_reqdetail c
|
||||
where b.sqxmdh=c.sqxmdh and b.xmdh=a.xmdh and b.yq=a.yq and c.sqh=#{sqh} and a.yq=#{yq} and a.ybh=#{ybh} and a.jyrq=#{jyrq} ;
|
||||
]]>
|
||||
</update>
|
||||
<select id="spSetrefs" parameterType="map" statementType="CALLABLE" useCache="false">
|
||||
{call sp_setrefs(#{jyrq,mode=IN,jdbcType=DATETIME},
|
||||
#{yq,mode=IN,jdbcType=VARCHAR},
|
||||
#{ybh,mode=IN,jdbcType=VARCHAR},
|
||||
#{settype,mode=IN,jdbcType=VARCHAR},
|
||||
#{retmsg,mode=OUT,jdbcType=VARCHAR},
|
||||
#{retcode,mode=OUT,jdbcType=INTEGER})
|
||||
}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user