主业务添加代码

This commit is contained in:
tangw 2025-08-22 19:59:30 +08:00
parent e48fd1cc98
commit 82141d9cf8
11 changed files with 462 additions and 170 deletions

View File

@ -55,8 +55,6 @@ public class LabPat extends BaseEntity {
private String instrid;
private String jzbz;
private String sbbr;
// private String qrr;
// private Date qrsj;
private String alarmflag;
private String alarmconfirm;
private Date alarmconfirmdt;
@ -80,4 +78,6 @@ public class LabPat extends BaseEntity {
private String fault;
private String faults;
private Date faultdt;
private String sn_tss;
private String sn_result;
}

View File

@ -42,6 +42,29 @@ public class LabReqmain extends BaseEntity {
private String zd;
private Date cysj;
private Date cksj;
private String ckzj;
private String ckyh;
private String djry;
private String inputman;
private String powerman;
private String contactman;
private String refsqh;
private String cyr;
private String bbsjr;
private Date bbsjsj;
private String performby;
private String sbbr;
private String inzt;
private String libpos;
private Date inlibtime;
private String inlibman;
private Date outlibtime;
private String outlibman;
private String refused;
private Date confirmtime;
private String confirmer;
private String cybl;
private String bbsjbl;
private String yljg;
private String kh;
private String klx;
@ -50,22 +73,15 @@ public class LabReqmain extends BaseEntity {
private String sfzh;
private String phone;
private String phone1;
private Date confirmtime;
private String confirmer;
private String cyr;
private String addr;
private String fb;
private String bbsjr;
private Date bbsjsj;
private String czid;
private String czmc;
private String jzjlid;
private String hzdh;
private String zxks;
private String hosid;
private String lstd;
private String jcptbz;
private String slzq;
private Date sjsj;
private String yqdh;
private Date sjsj;
private String addr;
private String lstd;
private String ssrq;
private String slzq;
private Date cyblsj;
private Date bbsjblsj;
private String ybrl;
private String qsyljg;
private String cjbw;
}

View File

@ -18,6 +18,7 @@ public class LabResult extends BaseEntity {
private String yq;
private String ybh;
private String xmdh;
private String wyh;
private String csjg;
private String od;
private String cutoff;
@ -25,8 +26,7 @@ public class LabResult extends BaseEntity {
private String bz1;
private String bz2;
private String yhdh;
private String textresult;
private String instrid;
private Integer instrid;
private Date operdt;
private String operna;
private String refs;
@ -36,6 +36,9 @@ public class LabResult extends BaseEntity {
private String alarmFlag;
private String redoFlag;
private String sqxmdh;
private String redoText;
private String bz3;
private String textresult;
private String xmmc;
private String ygzd;
private String ygzq;

View File

@ -6,6 +6,9 @@ import java.util.Map;
public interface LabReqmainMapper {
LabReqmain getLabReqmainOne(String sqh);
void updateLabReqmain(LabReqmain labReqmain);
void updateLabReqmainZT(Map<String,Object> map);
int updateLabReqmain(LabReqmain labReqmain);
int updateLabReqmainAll(LabReqmain labReqmain);
int deleteLabReqmain(String sqh);
void insertLabReqmain(LabReqmain labReqmain);
int updateLabReqmainZT(Map<String,Object> map);
}

View File

@ -17,45 +17,65 @@ public class CalcUtils {
* @param variableMap 入参MAP
* @return
*/
public static String getValueFromCalc(String CalcExpression,Map<String,String> variableMap){
// 创建SpEL解析器
public static String getValueFromCalc(String CalcExpression, Map<String, String> variableMap) {
ExpressionParser parser = new SpelExpressionParser();
// 创建评估上下文
StandardEvaluationContext context = new StandardEvaluationContext();
// 循环遍历Map,将键值对添加到上下文
for (Map.Entry<String, String> entry : variableMap.entrySet()) {
// 键作为变量名,值作为变量值
String str = entry.getValue();
if(isNumber(str)){
if (isNumber(str)) {
context.setVariable(entry.getKey(), Double.parseDouble(str));
}else {
} else {
context.setVariable(entry.getKey(), entry.getValue());
}
}
// 测试表达式:使用多个变量进行判断"#score >= 60 ? #name + '的' + #subject + '成绩及格' : #name + '的' + #subject + '成绩不及格'"
String expression = getCalc(CalcExpression);
Expression exp = parser.parseExpression(expression);
// 执行表达式(传入上下文)
try {
String result = exp.getValue(context, String.class);
//System.out.println(result); // 输出:张三的数学成绩及格
return result;
} catch (Exception e) {
// 意外错误时返回null
return null;
}
// 先获取原始结果(可能是Number、Boolean、String等)
Object result = exp.getValue(context);
// 安全转换为String
if (result == null) {
return ""; // 空值返回空字符串(或根据业务返回null)
}
// 特殊处理数字类型,避免科学计数法(如1000000.0 → "1000000")
if (result instanceof Number) {
Number num = (Number) result;
// 判断是否为整数(无小数部分)
if (num.doubleValue() == Math.floor(num.doubleValue())) {
return String.valueOf(num.longValue());
} else {
return String.valueOf(num.doubleValue());
}
}
// 其他类型直接调用toString()
return result.toString();
} catch (Exception e) {
throw new RuntimeException("表达式计算失败: " + expression, e);
}
}
public static boolean getBooleanFromCalc(String CalcExpression,Map<String,String> variableMap){
public static boolean getBooleanFromCalc(String CalcExpression, Map<String, String> variableMap) {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
// 统一变量处理:数字转Double,否则保留String
for (Map.Entry<String, String> entry : variableMap.entrySet()) {
context.setVariable(entry.getKey(), entry.getValue());
String str = entry.getValue();
if (isNumber(str)) {
context.setVariable(entry.getKey(), Double.parseDouble(str));
} else {
context.setVariable(entry.getKey(), entry.getValue());
}
}
String expression = getCalc(CalcExpression);
Expression exp = parser.parseExpression(expression);
boolean result = exp.getValue(context, Boolean.class);
return result;
try {
return exp.getValue(context, Boolean.class);
} catch (Exception e) {
throw new RuntimeException("布尔表达式计算失败: " + expression, e); // 增强异常信息
}
}
/**
@ -64,6 +84,7 @@ public class CalcUtils {
* @return
*/
public static String getCalc(String CalcExpression){
// 1. 替换逻辑运算符:and→&&,or→||
String processed = CalcExpression.replaceAll("\\band|AND\\b", "&&").replaceAll("\\bor|OR\\b", "||");
// 2. 替换变量格式:[a] → #a
@ -72,9 +93,47 @@ public class CalcUtils {
processed = replaceLenFunction(processed);
//4.like '%aa'或者 like 'aa%'或者 like '%aa%'
processed = replaceLikeExpressions(processed);
// 1. 先将所有比较用的=替换为==(关键修复)
processed = processed.replaceAll("(\\w+)\\s*=\\s*('.*?'|\\w+)", "$1 == $2");
//5. 递归处理if结构:if(cond, trueExpr, falseExpr) → cond?trueExpr:falseExpr
return processIf(processed);
}
/**
* 取出公式中所有[参数]返回数组,供调用传值引用
* @param input
* @return
*/
public static String[] getParameters(String input) {
// 正则表达式匹配 [] 中的内容
Pattern pattern = Pattern.compile("\\[(.*?)\\]");
Matcher matcher = pattern.matcher(input);
// 第一步:统计匹配数量,确定数组长度
int count = 0;
// 临时存储匹配结果的数组(初始长度设为10,可根据实际场景调整)
String[] tempArray = new String[10];
// 循环查找所有匹配项
while (matcher.find()) {
// 存储当前匹配的内容([]中的字符串)
tempArray[count] = matcher.group(1);
count++;
// 若临时数组容量不足,扩容(每次翻倍)
if (count == tempArray.length) {
String[] newArray = new String[tempArray.length * 2];
System.arraycopy(tempArray, 0, newArray, 0, tempArray.length);
tempArray = newArray;
}
}
// 第二步:创建与实际数量匹配的结果数组
String[] result = new String[count];
System.arraycopy(tempArray, 0, result, 0, count);
return result;
}
/**
* 递归解析并替换if表达式
*/
@ -162,29 +221,29 @@ public class CalcUtils {
for (int i = 0; i < 3; i++) {
parts[i] = new StringBuilder();
}
boolean inQuotes = false; // 标记是否在字符串中(单引号内)
for (char c : inner.toCharArray()) {
if (c == ',' && stack.isEmpty()) {
// 处理单引号包裹的字符串(忽略内部逗号)
if (c == '\'') {
inQuotes = !inQuotes;
parts[partIndex].append(c);
continue;
}
// 仅当不在字符串中且栈为空时,才用逗号分割参数
if (c == ',' && !inQuotes && stack.isEmpty()) {
partIndex++;
if (partIndex >= 3) {
break;
}
if (partIndex >= 3) break;
} else {
if (c == '(') {
stack.push('(');
} else if (c == ')') {
if (!stack.isEmpty()) {
stack.pop();
}
}
if (c == '(') stack.push('(');
else if (c == ')') if (!stack.isEmpty()) stack.pop();
parts[partIndex].append(c);
}
}
return new String[]{
parts[0].toString(),
parts[1].toString(),
parts[2].toString()
parts[0].toString().trim(),
parts[1].toString().trim(),
parts[2].toString().trim()
};
}
/**
@ -215,24 +274,18 @@ public class CalcUtils {
* 支持:like '%xxx'、like 'xxx%'、like '%xxx%'、like 'xxx'(精确匹配)
*/
private static String replaceLikeExpressions(String expression) {
// 正则匹配 like 表达式(支持空格变化和引号)
// 分组说明:
// group1: 左侧表达式(如字段或变量)
// group2: 匹配模式(如'%aa%'、'aa%'等)
Pattern pattern = Pattern.compile("(\\w+)\\s+like\\s+'([^']+)'", Pattern.CASE_INSENSITIVE);
// 修正正则:左侧表达式允许包含#、字母、数字、下划线(#[a-zA-Z0-9_]+)
Pattern pattern = Pattern.compile("([#\\w]+)\\s+like\\s+'([^']+)'", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(expression);
StringBuffer result = new StringBuffer();
while (matcher.find()) {
String leftExpr = matcher.group(1); // 左侧表达式(如 field1)
String patternStr = matcher.group(2); // 匹配模式(如 %aa%)
// 根据模式生成对应的SpEL方法调用
String leftExpr = matcher.group(1); // 支持#变量(如#RESULT)
String patternStr = matcher.group(2);
String replacement = generateLikeReplacement(leftExpr, patternStr);
matcher.appendReplacement(result, replacement);
}
matcher.appendTail(result);
return result.toString();
}
/**
@ -270,9 +323,8 @@ public class CalcUtils {
*/
public static boolean isNumber(String str) {
if (str == null || str.trim().isEmpty()) {
return false;
return false; // 空值不视为数字
}
// 正则表达式:匹配正负整数、正负小数
String regex = "^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$";
return str.matches(regex);
}

View File

@ -50,6 +50,7 @@ public class CommonUtil {
LabReqreportPdffileMapper labReqreportPdffileMapper;
@Autowired
LabReqsteplogMapper labReqsteplogMapper;
//====检验主表操作方法集合===
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
@ -90,6 +91,19 @@ public class CommonUtil {
public LabReqmain getLabReqmainOne(String sqh) {
return labReqmainMapper.getLabReqmainOne(sqh);
}
public int updateLabReqmain(LabReqmain labReqmain) {
return labReqmainMapper.updateLabReqmain(labReqmain);
}
public int deleteLabReqmain(String sqh) {
return labReqmainMapper.deleteLabReqmain(sqh);
}
public void insertLabReqmain(LabReqmain labReqmain) {
labReqmainMapper.insertLabReqmain(labReqmain);
}
public List<LabReqsteplog> getLabReqsteplog(String sqh) {
return labReqsteplogMapper.getLabReqsteplog(sqh);
}
@ -105,8 +119,8 @@ public class CommonUtil {
}
@Transactional(rollbackFor = Exception.class)
public int insertLabResult(LabResult labResult) {
return labResultMapper.insertLabResult(labResult);
public void insertLabResult(LabResult labResult) {
labResultMapper.insertLabResult(labResult);
}
public List<LabResult> getresultinfo(Date jyrq, String yq, String ybh) {
@ -270,8 +284,11 @@ public class CommonUtil {
} else {
//没有获取到缓存,则先从数据库中查询数据,然后再进行缓存
ComOpt comOpt1 = comOptMapper.getComOptOne(yq, xxdh);
ComOptionUtils.setOptCache(yq, xxdh, comOpt1);
return comOpt1.getXxqz();
if (comOpt1 != null) {
ComOptionUtils.setOptCache(yq, xxdh, comOpt1);
return comOpt1.getXxqz();
}
return null;
}
}
@ -310,7 +327,7 @@ public class CommonUtil {
return labReqreportPdffileMapper.getLabReqreportPdffileList(sqh);
}
public LabReqreportPdffile getLabReqreportPdffileOne(Date jyrq,String yq,String ybh) {
return labReqreportPdffileMapper.getLabReqreportPdffileOne(jyrq,yq,ybh);
public LabReqreportPdffile getLabReqreportPdffileOne(Date jyrq, String yq, String ybh) {
return labReqreportPdffileMapper.getLabReqreportPdffileOne(jyrq, yq, ybh);
}
}

View File

@ -76,8 +76,6 @@
<if test="instrid != null and instrid != ''">instrid,</if>
<if test="jzbz != null and jzbz != ''">jzbz,</if>
<if test="sbbr != null and sbbr != ''">sbbr,</if>
<if test="qrr != null and qrr != ''">qrr,</if>
<if test="qrsj != null ">qrsj,</if>
<if test="alarmflag != null and alarmflag != ''">alarmflag,</if>
<if test="alarmconfirm != null and alarmconfirm != ''">alarmconfirm,</if>
<if test="alarmconfirmdt != null ">alarmconfirmdt,</if>
@ -99,15 +97,8 @@
<if test="lstd != null and lstd !=''">lstd,</if>
<if test="zjlx != null and zjlx != ''">zjlx,</if>
<if test="slzq != null and slzq != ''">slzq,</if>
<if test="uploaddate != null">uploaddate,</if>
<if test="lastupdatetime != null">lastupdatetime,</if>
<if test="ylfw != null and ylfw != ''">ylfw,</if>
<if test="upload != null and upload != ''">upload,</if>
<if test="checker != null and checker != ''">checker,</if>
<if test="lisptsc != null and lisptsc != ''">lisptsc,</if>
<if test="autojgbz != null and autojgbz != ''">autojgbz,</if>
<if test="crbsj != null and crbsj != ''">crbsj,</if>
<if test="testName != null and testName != ''">testName,</if>
jyrq,yq,ybh
)
values(
@ -151,8 +142,6 @@
<if test="instrid != null and instrid != ''">#{instrid},</if>
<if test="jzbz != null and jzbz != ''">#{jzbz},</if>
<if test="sbbr != null and sbbr != ''">#{sbbr},</if>
<if test="qrr != null and qrr != ''">#{qrr},</if>
<if test="qrsj != null ">#{qrsj},</if>
<if test="alarmflag != null and alarmflag != ''">#{alarmflag},</if>
<if test="alarmconfirm != null and alarmconfirm != ''">#{alarmconfirm},</if>
<if test="alarmconfirmdt != null ">#{alarmconfirmdt},</if>
@ -174,15 +163,8 @@
<if test="lstd != null and lstd !=''">#{lstd},</if>
<if test="zjlx != null and zjlx != ''">#{zjlx},</if>
<if test="slzq != null and slzq != ''">#{slzq},</if>
<if test="uploaddate != null">#{uploaddate},</if>
<if test="lastupdatetime != null">#{lastupdatetime},</if>
<if test="ylfw != null and ylfw != ''">#{ylfw},</if>
<if test="upload != null and upload != ''">#{upload},</if>
<if test="checker != null and checker != ''">#{checker},</if>
<if test="lisptsc != null and lisptsc != ''">#{lisptsc},</if>
<if test="autojgbz != null and autojgbz != ''">#{autojgbz},</if>
<if test="crbsj != null and crbsj != ''">#{crbsj},</if>
<if test="testName != null and testName != ''">#{testName},</if>
#{jyrq},#{yq},#{ybh}
)
</insert>
@ -309,12 +291,6 @@
<if test="sbbr != null">
sbbr = #{sbbr,jdbcType=VARCHAR},
</if>
<if test="qrr != null">
qrr = #{qrr,jdbcType=VARCHAR},
</if>
<if test="qrsj != null">
qrsj = #{qrsj,jdbcType=TIMESTAMP},
</if>
<if test="alarmflag != null">
alarmflag = #{alarmflag,jdbcType=CHAR},
</if>
@ -375,12 +351,6 @@
<if test="slzq != null">
slzq = #{slzq,jdbcType=VARCHAR},
</if>
<if test="uploaddate != null">
uploaddate = #{uploaddate,jdbcType=TIMESTAMP},
</if>
<if test="whonetupdate != null">
whonetupdate = #{whonetupdate,jdbcType=TIMESTAMP},
</if>
<if test="checker != null">
checker = #{checker,jdbcType=VARCHAR},
</if>

View File

@ -11,8 +11,201 @@
UPDATE lab_reqmain SET zt = '2', jsys = #{userId}, jssj =getdate() WHERE sqh = #{sqh} AND (zt < '2' or zt='8' or jssj<zxsj)
]]>
</update>
<delete id="deleteLabReqmain" parameterType="String">
delete from lab_reqmain
where sqh = #{sqh}
</delete>
<insert id="insertLabReqmain" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain">
insert into lab_reqmain (sqh, ksdh, sqys,
sqsj, jsys, jssj,
zt, jjzt, brly, brdh,
brxm, brxb, brsr, bz1,
bz2, bz3, jzbz, txm,
ch, yblx, zxys, zxsj,
bgddh, costs, nl, nldw,
zd, cysj, cksj,
ckzj, ckyh, djry, inputman,
powerman, contactman, refsqh,
cyr, bbsjr, bbsjsj,
performby, sbbr, inzt,
libpos, inlibtime, inlibman,
outlibtime, outlibman, refused,
confirmtime, confirmer, cybl,
bbsjbl, yljg, kh, klx,
jzsj, jymd, sfzh,
phone, phone1, yqdh, sjsj,
addr, lstd, ssrq,
slzq, cyblsj, bbsjblsj,
ybrl,qsyljg,cjbw)
values (#{sqh}, #{ksdh}, #{sqys},
#{sqsj}, #{jsys}, #{jssj},
#{zt}, #{jjzt}, #{brly}, #{brdh},
#{brxm}, #{brxb}, #{brsr}, #{bz1},
#{bz2}, #{bz3}, #{jzbz}, #{txm},
#{ch}, #{yblx}, #{zxys}, #{zxsj},
#{bgddh}, #{costs}, #{nl}, #{nldw},
#{zd}, #{cysj}, #{cksj},
#{ckzj}, #{ckyh}, #{djry}, #{inputman},
#{powerman}, #{contactman}, #{refsqh},
#{cyr}, #{bbsjr}, #{bbsjsj},
#{performby}, #{sbbr}, #{inzt},
#{libpos}, #{inlibtime}, #{inlibman},
#{outlibtime}, #{outlibman}, #{refused},
#{confirmtime}, #{confirmer}, #{cybl},
#{bbsjbl}, #{yljg}, #{kh}, #{klx},
#{jzsj}, #{jymd}, #{sfzh},
#{phone}, #{phone1}, #{yqdh}, #{sjsj},
#{addr}, #{lstd}, #{ssrq},
#{slzq}, #{cyblsj}, #{bbsjblsj},
#{ybrl},#{qsyljg},#{cjbw})
</insert>
<update id="updateLabReqmain" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain">
update lab_reqmain
<set>
<if test="ksdh != null">ksdh = #{ksdh},</if>
<if test="sqys != null">sqys = #{sqys},</if>
<if test="sqsj != null">sqsj = #{sqsj},</if>
<if test="jsys != null">jsys = #{jsys},</if>
<if test="jssj != null">jssj = #{jssj},</if>
<if test="zt != null">zt = #{zt},</if>
<if test="jjzt != null">jjzt = #{jjzt},</if>
<if test="brly != null">brly = #{brly},</if>
<if test="brdh != null">brdh = #{brdh},</if>
<if test="brxm != null">brxm = #{brxm},</if>
<if test="brxb != null">brxb = #{brxb},</if>
<if test="brsr != null">brsr = #{brsr},</if>
<if test="bz1 != null">bz1 = #{bz1},</if>
<if test="bz2 != null">bz2 = #{bz2},</if>
<if test="bz3 != null">bz3 = #{bz3},</if>
<if test="jzbz != null">jzbz = #{jzbz},</if>
<if test="txm != null">txm = #{txm},</if>
<if test="ch != null">ch = #{ch},</if>
<if test="yblx != null">yblx = #{yblx},</if>
<if test="zxys != null">zxys = #{zxys},</if>
<if test="zxsj != null">zxsj = #{zxsj},</if>
<if test="bgddh != null">bgddh = #{bgddh},</if>
<if test="costs != null">costs = #{costs},</if>
<if test="nl != null">nl = #{nl},</if>
<if test="nldw != null">nldw = #{nldw},</if>
<if test="zd != null">zd = #{zd},</if>
<if test="cysj != null">cysj = #{cysj},</if>
<if test="cksj != null">cksj = #{cksj},</if>
<if test="ckzj != null">ckzj = #{ckzj},</if>
<if test="ckyh != null">ckyh = #{ckyh},</if>
<if test="djry != null">djry = #{djry},</if>
<if test="inputman != null">inputman = #{inputman},</if>
<if test="powerman != null">powerman = #{powerman},</if>
<if test="contactman != null">contactman = #{contactman},</if>
<if test="refsqh != null">refsqh = #{refsqh},</if>
<if test="cyr != null">cyr = #{cyr},</if>
<if test="bbsjr != null">bbsjr = #{bbsjr},</if>
<if test="bbsjsj != null">bbsjsj = #{bbsjsj},</if>
<if test="performby != null">performby = #{performby},</if>
<if test="sbbr != null">sbbr = #{sbbr},</if>
<if test="inzt != null">inzt = #{inzt},</if>
<if test="libpos != null">libpos = #{libpos},</if>
<if test="inlibtime != null">inlibtime = #{inlibtime},</if>
<if test="inlibman != null">inlibman = #{inlibman},</if>
<if test="outlibtime != null">outlibtime = #{outlibtime},</if>
<if test="outlibman != null">outlibman = #{outlibman},</if>
<if test="refused != null">refused = #{refused},</if>
<if test="confirmtime != null">confirmtime = #{confirmtime},</if>
<if test="confirmer != null">confirmer = #{confirmer},</if>
<if test="cybl != null">cybl = #{cybl},</if>
<if test="bbsjbl != null">bbsjbl = #{bbsjbl},</if>
<if test="yljg != null">yljg = #{yljg},</if>
<if test="kh != null">kh = #{kh},</if>
<if test="klx != null">klx = #{klx},</if>
<if test="jzsj != null">jzsj = #{jzsj},</if>
<if test="jymd != null">jymd = #{jymd},</if>
<if test="sfzh != null">sfzh = #{sfzh},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="phone1 != null">phone1 = #{phone1},</if>
<if test="yqdh != null">yqdh = #{yqdh},</if>
<if test="sjsj != null">sjsj = #{sjsj},</if>
<if test="addr != null">addr = #{addr},</if>
<if test="lstd != null">lstd = #{lstd},</if>
<if test="ssrq != null">ssrq = #{ssrq},</if>
<if test="slzq != null">slzq = #{slzq},</if>
<if test="cyblsj != null">cyblsj = #{cyblsj},</if>
<if test="bbsjblsj != null">bbsjblsj = #{bbsjblsj},</if>
<if test="ybrl != null">ybrl = #{ybrl},</if>
<if test="qsyljg != null">qsyljg = #{qsyljg},</if>
</set>
where sqh = #{sqh}
</update>
<update id="updateLabReqmainAll" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain">
update lab_reqmain
set ksdh = #{ksdh},
sqys = #{sqys},
sqsj = #{sqsj},
jsys = #{jsys},
jssj = #{jssj},
zt = #{zt},
jjzt = #{jjzt},
brly = #{brly},
brdh = #{brdh},
brxm = #{brxm},
brxb = #{brxb},
brsr = #{brsr},
bz1 = #{bz1},
bz2 = #{bz2},
bz3 = #{bz3},
jzbz = #{jzbz},
txm = #{txm},
ch = #{ch},
yblx = #{yblx},
zxys = #{zxys},
zxsj = #{zxsj},
bgddh = #{bgddh},
costs = #{costs},
nl = #{nl},
nldw = #{nldw},
zd = #{zd},
cysj = #{cysj},
cksj = #{cksj},
ckzj = #{ckzj},
ckyh = #{ckyh},
djry = #{djry},
inputman = #{inputman},
powerman = #{powerman},
contactman = #{contactman},
refsqh = #{refsqh},
cyr = #{cyr},
bbsjr = #{bbsjr},
bbsjsj = #{bbsjsj},
performby = #{performby},
sbbr = #{sbbr},
inzt = #{inzt},
libpos = #{libpos},
inlibtime = #{inlibtime},
inlibman = #{inlibman},
outlibtime = #{outlibtime},
outlibman = #{outlibman},
refused = #{refused},
confirmtime = #{confirmtime},
confirmer = #{confirmer},
cybl = #{cybl},
bbsjbl = #{bbsjbl},
yljg = #{yljg},
kh = #{kh},
klx = #{klx},
jzsj = #{jzsj},
jymd = #{jymd},
sfzh = #{sfzh},
phone = #{phone},
phone1 = #{phone1},
yqdh = #{yqdh},
sjsj = #{sjsj},
addr = #{addr},
lstd = #{lstd},
ssrq = #{ssrq},
slzq = #{slzq},
cyblsj = #{cyblsj},
bbsjblsj = #{bbsjblsj},
ybrl = #{ybrl},
qsyljg = #{qsyljg}
where sqh = #{sqh}
</update>
</mapper>

View File

@ -50,7 +50,7 @@ public class LisWorkOperController extends BaseController {
*/
@ApiOperation("审核报告")
@GetMapping("/check2")
public Result check21( Date jyrq, String yq, String ybh, String hdys){
public Result check2( Date jyrq, String yq, String ybh, String hdys){
log.info("yq:{}", yq);
hdys="lis";

View File

@ -10,7 +10,7 @@ import java.util.Map;
public interface LisWorkOperMapper {
Long checkReqClass(@Param("sqh") String sqh,@Param("yq") String yq);
String selectSqxmdh(String sqh);
void sp_setrefs(Map<String,Object> map);
void spSetrefs(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);
List<ResultCalcDTO> getResultCalc(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);

View File

@ -323,7 +323,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
}
String sqh = labPat.getSqh();
if (sqh == null || "".equals(sqh)) {
if (sqh != null && !"".equals(sqh)) {
if (!"质控".equals(brlyname)) {
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
LabPat labPat0 = lisWorkOperMapper.checkdublereport(sqh, ybh);
@ -413,9 +413,50 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
if (labReqmain != null) {
String zt = labReqmain.getZt();
if (SampleStatusConstants.CANCAL.equals(zt)) return new Result("-1", "申请单已作废禁止审核!");
labReqmain.setYqdh(yq);
labReqmain.setSjsj(jysj);
labReqmain.setConfirmer(hdys);
Date confirmtime = dysj;
labReqmain.setConfirmtime(confirmtime);
labReqmain.setConfirmtime(Confirmdt);
labReqmain = checklabReqmainTAT(labReqmain);
if (!SampleStatusConstants.CANCAL.equals(zt)) labReqmain.setZt(SampleStatusConstants.CONFIRM);
commonUtil.updateLabReqmain(labReqmain);
Date cysj = labReqmain.getCysj();
if (cysj != null) labPat.setCyrq(cysj);
}
//调用his报告接口,完成报告同时调用外部接口任务
SetReport setReport = new SetReport();
setReport.setIp(IpUtils.getIpAddr());
setReport.setJyrq(DateFormatUtils.format(jyrq, "yyyy-MM-dd"));
setReport.setYq(yq.trim());
setReport.setYbh(ybh);
setReport.setUserid(hdys);
setReport.setStatus(LisinterfaceNameConstants.REPORTEND);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
if (result.getCode().equals("5")) {
if (problemId < 4) {
return new Result(result.getCode(), result.getMsg(), 4);
}
return new Result("0", "保存成功!");
}
if (!result.getCode().equals("0")) return result;
//最后完成
labPat.setJgbz(ReportStatusConstants.CONFIRM);
commonUtil.updateLabPat(labPat);
return new Result("0", "保存成功!");
}
/**
* 申请单表校验TAT时间顺序,恢复时间倒置的时间轴
*
* @param labReqmain
* @return
*/
private LabReqmain checklabReqmainTAT(LabReqmain labReqmain) {
if (labReqmain != null) {
Date confirmtime = labReqmain.getConfirmtime();
Date jysj = labReqmain.getSjsj();
String sqh = labReqmain.getSqh();
Date zxsj = labReqmain.getZxsj();
Date cysj = labReqmain.getCysj();
Date bbsjsj = labReqmain.getBbsjsj();
@ -491,31 +532,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
labReqmain.setZxsj(zxsj);
}
labReqmain.setSjsj(sjsj);
labReqmain.setYqdh(yq);
if (!SampleStatusConstants.CANCAL.equals(zt)) labReqmain.setZt(SampleStatusConstants.CONFIRM);
if (cysj != null) labPat.setCyrq(cysj);
// commonUtil.updateLabReqmain(labReqmain);
}
//调用his报告接口,完成报告同时调用外部接口任务
SetReport setReport = new SetReport();
setReport.setIp(IpUtils.getIpAddr());
setReport.setJyrq(DateFormatUtils.format(jyrq, "yyyy-MM-dd"));
setReport.setYq(yq.trim());
setReport.setYbh(ybh);
setReport.setUserid(hdys);
setReport.setStatus(LisinterfaceNameConstants.REPORTEND);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
if (result.getCode().equals("5")) {
if (problemId < 4) {
return new Result(result.getCode(), result.getMsg(), 4);
}
return new Result("0", "保存成功!");
}
if (!result.getCode().equals("0")) return result;
//最后完成
labPat.setJgbz(ReportStatusConstants.CONFIRM);
commonUtil.updateLabPat(labPat);
return new Result("0", "保存成功!");
return labReqmain;
}
/**
@ -555,7 +573,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
//保存最新参考值结果标志
int wjz = saverefs(labPat);
//补写结果表申请单项目编号
String sqh = labPat.getYbh();
String sqh = labPat.getSqh();
if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
return wjz;
}
@ -577,8 +595,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
//内部使用
private void setItemSqxmdh(Date jyrq, String yq, String ybh, String sqh) {
if (sqh == null || "".equals(sqh)) {
} else {
if (sqh != null && !"".equals(sqh)) {
int sl = labReqdetailMapper.getCountByKey(sqh);
if (sl == 1) {
String sqxmdh = lisWorkOperMapper.selectSqxmdh(sqh);
@ -614,28 +631,45 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String xmdh = resultCalc.getJsxm();
if (!xmdhold.equals(xmdh)) {
xmdhold = xmdh;
String sex = labPat.getBrxb().trim();
if ("1".equals(sex)) sex = "男";
if ("2".equals(sex)) sex = "女";
double age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
boolean setjgsg=true;
Map<String, String> variables = new HashMap<>();
variables.put("SEX", sex); // 示例值
variables.put("AGE", String.valueOf(age));
String result = CalcUtils.getValueFromCalc(jsgs, variables);
if (result != null && !result.trim().isEmpty()) {
//插入结果值
LabResult labResult = commonUtil.getLabResult(jyrq, yq, ybh, xmdh);
if (labResult == null) {
labResult = new LabResult();
labResult.setJyrq(jyrq);
labResult.setYq(yq);
labResult.setYbh(ybh);
labResult.setXmdh(xmdh);
labResult.setCsjg(result);
commonUtil.insertLabResult(labResult);
} else {
labResult.setCsjg(result);
commonUtil.updateLabResult(labResult);
String[] parameters =CalcUtils.getParameters(jsgs);
for (int i = 0; i < parameters.length; i++) {
String itemcode=parameters[i];
if("SEX".equals(itemcode)){
String sex = labPat.getBrxb().trim();
if ("1".equals(sex)) sex = "男";
if ("2".equals(sex)) sex = "女";
variables.put("SEX", sex);
}else if("AGE".equals(itemcode)){
double age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
variables.put("AGE", String.valueOf(age));
}else{
List<ResultCalcDTO> collect = resultCalcDTO.stream().filter(result -> result.getXmdh().equals(itemcode)).collect(Collectors.toList());
if (collect.size() > 0) {
variables.put(itemcode, collect.get(0).getCsjg());
}else{
setjgsg=false;
}
}
}
if(setjgsg) {
String result = CalcUtils.getValueFromCalc(jsgs, variables);
if (result != null && !result.trim().isEmpty()) {
//插入结果值
LabResult labResult = commonUtil.getLabResult(jyrq, yq, ybh, xmdh);
if (labResult == null) {
labResult = new LabResult();
labResult.setJyrq(jyrq);
labResult.setYq(yq);
labResult.setYbh(ybh);
labResult.setXmdh(xmdh);
labResult.setCsjg(result);
commonUtil.insertLabResult(labResult);
} else {
labResult.setCsjg(result);
commonUtil.updateLabResult(labResult);
}
}
}
}
@ -685,7 +719,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
map.put("settype", "1");
map.put("retcode", "");
map.put("retmsg", "");
lisWorkOperMapper.sp_setrefs(map);
lisWorkOperMapper.spSetrefs(map);
String retCode = String.valueOf(map.get("retcode"));
String retMsg = String.valueOf(map.get("retmsg"));
log.info("调用存储过程{}返回值:{},{}", "sp_setrefs", retCode, retMsg);
@ -835,10 +869,10 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
lmtflag = "P";
resultflag = lmtflag;
if ("J".equals(lmtflag)) wjzflag = "H";
int wjzf = alarmcondition(labPat, labResult);
if (wjzf == 1) wjzflag = "H";//满足特定危机值条件
if (wjzf == 0) wjzflag = "";//存在特定危机值条件,但不满足不提示
}
int wjzf = alarmcondition(labPat, labResult);
if (wjzf == 1) wjzflag = "H";//满足特定危机值条件
if (wjzf == 0) wjzflag = "";//存在特定危机值条件,但不满足不提示
//小数保留位数计算
Integer xsws = xmInfo.getXsws();
if (xsws >= 0) csjg = LisUtil.round(csjg, xsws);
@ -873,11 +907,15 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String brxm = "";
String brdh = "";
String ksdh = labPat.getKsdh();
String ksdh1 = commonUtil.getComDictIdByName("BT", ksdh);
if (ksdh1 != null && !ksdh1.trim().isEmpty()) ksdh = ksdh1;
if(ksdh !=null &&!ksdh.trim().isEmpty()) {
String ksdh1 = commonUtil.getComDictIdByName("DP", ksdh);
if (ksdh1 != null && !ksdh1.trim().isEmpty()) ksdh = ksdh1;
}
String ybzt = labPat.getYbzt();
String ybzt1 = commonUtil.getComDictIdByName("ST", ybzt);
if (ybzt1 != null && !ybzt1.trim().isEmpty()) ybzt = ybzt1;
if(ybzt !=null &&!ybzt.trim().isEmpty()){
String ybzt1 = commonUtil.getComDictIdByName("ST", ybzt);
if (ybzt1 != null && !ybzt1.trim().isEmpty()) ybzt = ybzt1;
}
String zd = labPat.getZd();
for (XmAlarmdetail xmAlarmdetail : getXmAlarmdetail) {
String samplecondition = xmAlarmdetail.getSamplecondition();