2025-06-24 18:01:25 +08:00
|
|
|
package com.czlis.interfaceCommon.utils;
|
|
|
|
|
|
|
|
|
|
import com.czlis.common.core.domain.entity.LabPat;
|
2025-06-27 13:05:23 +08:00
|
|
|
import com.czlis.common.core.domain.entity.LabReqmain;
|
2025-07-04 00:22:41 +08:00
|
|
|
import com.czlis.common.core.domain.entity.LabResult;
|
2025-07-01 11:52:54 +08:00
|
|
|
import com.czlis.interfaceCommon.mapper.*;
|
2025-07-04 00:22:41 +08:00
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
2025-06-24 18:01:25 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
2025-07-01 11:52:54 +08:00
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
2025-06-24 18:01:25 +08:00
|
|
|
|
2025-07-12 12:58:41 +08:00
|
|
|
|
2025-07-01 11:52:54 +08:00
|
|
|
import java.util.*;
|
2025-06-24 18:01:25 +08:00
|
|
|
|
|
|
|
|
@Component
|
|
|
|
|
public class CommonUtil {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
LabPatMapper labPatMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
ComOptMapper comOptMapper;
|
2025-06-27 13:05:23 +08:00
|
|
|
@Autowired
|
|
|
|
|
LabReqmainMapper labReqmainMapper;
|
2025-07-01 11:52:54 +08:00
|
|
|
@Autowired
|
|
|
|
|
CommonMapper commonMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
ComDictMapper comDictMapper;
|
2025-07-04 00:22:41 +08:00
|
|
|
@Autowired
|
|
|
|
|
private LabResultMapper labResultMapper;
|
2025-07-12 12:58:41 +08:00
|
|
|
|
2025-07-04 00:22:41 +08:00
|
|
|
//====检验主表操作方法集合===
|
2025-06-24 18:01:25 +08:00
|
|
|
public LabPat getLabPatOne(Date jyrq, String yq, String ybh){
|
|
|
|
|
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
|
|
|
|
|
}
|
2025-07-04 00:22:41 +08:00
|
|
|
public List<LabPat> getLabPatListBySqh(String sqh){return labPatMapper.getLabPatListBySqh(sqh);}
|
|
|
|
|
public List<LabPat> getLabPatList(LabPat labPat) {return labPatMapper.getLabPat(labPat);}
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int insertLabPat(LabPat labPat) {return labPatMapper.updateLabPat(labPat);}
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
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);}
|
|
|
|
|
//申请单主表方法集合
|
2025-06-27 13:05:23 +08:00
|
|
|
public LabReqmain getLabReqmainOne(String sqh){
|
|
|
|
|
return labReqmainMapper.getLabReqmainOne(sqh);
|
|
|
|
|
}
|
2025-07-04 00:22:41 +08:00
|
|
|
//申请单明细表集合
|
2025-07-01 11:52:54 +08:00
|
|
|
|
2025-07-04 00:22:41 +08:00
|
|
|
//====检验结果表操作方法集合===
|
|
|
|
|
public List<LabResult> getLabResult(Date jyrq, String yq, String ybh, String xmdh) {return labResultMapper.getLabResult(jyrq, yq, ybh,xmdh);}
|
|
|
|
|
public List<LabResult> getLabResultList(Date jyrq, String yq, String ybh) {return labResultMapper.getLabResultList(jyrq, yq, ybh);}
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int insertLabResult(LabResult labResult) {return labResultMapper.updateLabResult(labResult);}
|
|
|
|
|
public List<LabResult> getresultinfo(Date jyrq, String yq, String ybh) {return labResultMapper.getLabResultList(jyrq, yq, ybh);}
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int delLabResult(LabResult labResult) {return labResultMapper.delLabResult(labResult);}
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public int updateLabResult(LabResult labResult) {return labResultMapper.updateLabResult(labResult);}
|
2025-07-01 11:52:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-04 00:22:41 +08:00
|
|
|
//服务器时间方法
|
|
|
|
|
public Date getCurrentTime(){return commonMapper.getCurrentTime();}
|
|
|
|
|
public String getCurrentDate(){return DateFormatUtils.format(commonMapper.getCurrentTime(), "yyyy-MM-dd");}
|
|
|
|
|
public String getCurrentDateTime(){return DateFormatUtils.format(commonMapper.getCurrentTime(), "yyyy-MM-dd HH:mm:ss");}
|
2025-07-01 11:52:54 +08:00
|
|
|
|
2025-07-04 00:22:41 +08:00
|
|
|
//字典查询方法集合
|
2025-07-01 11:52:54 +08:00
|
|
|
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 getComDictIdByName(String zdlb,String zdmc){
|
|
|
|
|
String zddh = comDictMapper.getComDictIdByName(zdlb,zdmc);
|
|
|
|
|
if(zddh == null || zddh.equals("")){
|
|
|
|
|
return zdmc;
|
|
|
|
|
}else{
|
|
|
|
|
return zddh;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-04 00:22:41 +08:00
|
|
|
public String getComOptValue(String yq,String xxdh){
|
|
|
|
|
return comOptMapper.getComOptValue(yq,xxdh);
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-12 12:58:41 +08:00
|
|
|
|
2025-06-24 18:01:25 +08:00
|
|
|
}
|