|
@@ -19,8 +19,10 @@ import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.TZDBConn;
|
|
|
import com.diagbot.vo.data.ABehospitalInfoVO;
|
|
|
import com.diagbot.vo.data.ADeleteFlagVO;
|
|
|
+import com.diagbot.vo.data.AMedicalRecordVO;
|
|
|
import com.diagbot.vo.data.APlaceFileVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -40,6 +42,8 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
|
|
|
@Value("${log_switch.enable}")
|
|
|
private boolean logSwitch;
|
|
|
+ @Autowired
|
|
|
+ private AMedicalRecordFacade aMedicalRecordFacade;
|
|
|
|
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
|
|
|
@@ -154,25 +158,32 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
*/
|
|
|
private Long initQcTypeId(BehospitalInfo s) {
|
|
|
Long qcTypeId = Long.valueOf("0");
|
|
|
- //根据科室查找对应质控类型
|
|
|
- QcType qcTypeList = qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
- .eq("beh_dept_id", s.getBehDeptId())
|
|
|
- .eq("hospital_id", s.getHospitalId())
|
|
|
- .eq("default_module", 0)
|
|
|
- .eq("sex",s.getSex())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N));
|
|
|
- if(qcTypeList == null){
|
|
|
- //无质控类型时,新增后初始化
|
|
|
- QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
- .eq("default_module", 1)
|
|
|
+ MedicalRecord medicalRecord= aMedicalRecordFacade.getOne(new QueryWrapper<MedicalRecord>()
|
|
|
+ .eq("mode_id",1)
|
|
|
+ .eq("behospital_code",s.getBehospitalCode())
|
|
|
+ .eq("hospital_id",s.getHospitalId())
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N));
|
|
|
+ if (medicalRecord != null){
|
|
|
+ //根据科室查找对应质控类型
|
|
|
+ QcType qcTypeList = qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
+ .eq("beh_dept_id", s.getBehDeptId())
|
|
|
.eq("hospital_id", s.getHospitalId())
|
|
|
+ .eq("default_module", 0)
|
|
|
.eq("sex",s.getSex())
|
|
|
.eq("is_deleted", IsDeleteEnum.N));
|
|
|
- if(qcType!=null){
|
|
|
- qcTypeId = qcType.getId();
|
|
|
+ if(qcTypeList == null){
|
|
|
+ //无质控类型时,新增后初始化
|
|
|
+ QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
+ .eq("default_module", 1)
|
|
|
+ .eq("hospital_id", s.getHospitalId())
|
|
|
+ .eq("sex",s.getSex())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N));
|
|
|
+ if(qcType!=null){
|
|
|
+ qcTypeId = qcType.getId();
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ qcTypeId = qcTypeList.getId();
|
|
|
}
|
|
|
- }else {
|
|
|
- qcTypeId = qcTypeList.getId();
|
|
|
}
|
|
|
return qcTypeId;
|
|
|
}
|