|
|
|
@ -17,6 +17,8 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @BelongsProject: docus-webservice-sdry
|
|
|
|
@ -39,6 +41,9 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
@Resource
|
|
|
|
|
private SdRyHospitalRpc sdRyHospitalRpc;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ThreadPoolExecutor threadPoolExecutor;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void setTBasic(TBasicDto tBasicDto) throws Exception {
|
|
|
|
@ -119,9 +124,10 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicMapper.insert(tBasic);
|
|
|
|
|
tBasicMapper.insertExtend(tBasicExtend);
|
|
|
|
|
sdRyHospitalRpc.confirmAndUpdIcuRecordState(tBasic.getInpatientNo(),tBasic.getAdmissTimes());
|
|
|
|
|
confirmAndUpdIcuRecordState(tBasic.getInpatientNo(),tBasic.getAdmissTimes());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void updateTBasic(TBasicDto tBasicDto) throws Exception {
|
|
|
|
@ -202,7 +208,7 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicMapper.update(tBasic);
|
|
|
|
|
tBasicMapper.updateExtend(tBasicExtend);
|
|
|
|
|
sdRyHospitalRpc.confirmAndUpdIcuRecordState(tBasic.getInpatientNo(),tBasic.getAdmissTimes());
|
|
|
|
|
confirmAndUpdIcuRecordState(tBasic.getInpatientNo(),tBasic.getAdmissTimes());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -289,7 +295,7 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
//持久化
|
|
|
|
|
tBasicMapper.update(tBasic);
|
|
|
|
|
tBasicMapper.updateExtend(tBasicExtend);
|
|
|
|
|
sdRyHospitalRpc.confirmAndUpdIcuRecordState(tBasic.getInpatientNo(),tBasic.getAdmissTimes());
|
|
|
|
|
confirmAndUpdIcuRecordState(tBasic.getInpatientNo(),tBasic.getAdmissTimes());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -319,6 +325,19 @@ public class TBasicServiceImpl implements ITBasicService {
|
|
|
|
|
TBasic tBasic= tBasicMapper.getByPatientId(patientId);
|
|
|
|
|
return Func.isNotEmpty(tBasic) && Func.isNotBlank(tBasic.getInpatientNo()) && tBasic.getInpatientNo().toUpperCase().contains("B");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void confirmAndUpdIcuRecordState(String inpatientNo,Integer admissTimes){
|
|
|
|
|
threadPoolExecutor.execute(()->{
|
|
|
|
|
// 此处异步,睡眠一秒保证事务提交
|
|
|
|
|
try {
|
|
|
|
|
TimeUnit.SECONDS.sleep(1);
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
sdRyHospitalRpc.confirmAndUpdIcuRecordState(inpatientNo,admissTimes);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|