|
|
@@ -2,6 +2,8 @@ package cn.hnthyy.thmz.service.impl.his.mz;
|
|
|
|
|
|
import cn.hnthyy.thmz.entity.MzException;
|
|
|
import cn.hnthyy.thmz.entity.his.mz.MzYshConfig;
|
|
|
+import cn.hnthyy.thmz.mapper.his.mz.MzBlRecordMapper;
|
|
|
+import cn.hnthyy.thmz.mapper.his.mz.MzYjReqMapper;
|
|
|
import cn.hnthyy.thmz.mapper.his.mz.MzYshConfigMapper;
|
|
|
import cn.hnthyy.thmz.service.his.mz.MzYshConfigService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -15,7 +17,12 @@ public class MzYshConfigServiceImpl implements MzYshConfigService {
|
|
|
@SuppressWarnings("all")
|
|
|
@Autowired
|
|
|
private MzYshConfigMapper mzYshConfigMapper;
|
|
|
-
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private MzYjReqMapper mzYjReqMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private MzBlRecordMapper mzBlRecordMapper;
|
|
|
/**
|
|
|
* 医技申请单号
|
|
|
* @return
|
|
|
@@ -31,6 +38,13 @@ public class MzYshConfigServiceImpl implements MzYshConfigService {
|
|
|
}
|
|
|
Integer oldReqNo = mzYshConfig.getReqNo();
|
|
|
mzYshConfig.setReqNo(mzYshConfig.getReqNo() + 1);
|
|
|
+ Integer lastReqNo= mzYjReqMapper.selectLastReqNo();
|
|
|
+ if(lastReqNo!=null){
|
|
|
+ Integer realLastReqNo =lastReqNo-2000000000;
|
|
|
+ if(realLastReqNo>oldReqNo){
|
|
|
+ mzYshConfig.setReqNo(realLastReqNo + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
int num = mzYshConfigMapper.updateReqNo(oldReqNo,mzYshConfig.getReqNo());
|
|
|
if (num == 0) {
|
|
|
throw new MzException("获取医技申请单号失败,请重试!");
|
|
|
@@ -54,6 +68,13 @@ public class MzYshConfigServiceImpl implements MzYshConfigService {
|
|
|
}
|
|
|
Integer oldReqPageNo = mzYshConfig.getReqPageNo();
|
|
|
mzYshConfig.setReqPageNo(mzYshConfig.getReqPageNo() + 1);
|
|
|
+ String lastPageNo= mzYjReqMapper.selectLastPageNo();
|
|
|
+ if(lastPageNo!=null){
|
|
|
+ Integer realLastPageNo =Integer.valueOf(lastPageNo.replace("N",""));
|
|
|
+ if(realLastPageNo>oldReqPageNo){
|
|
|
+ mzYshConfig.setReqPageNo(realLastPageNo + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
int num = mzYshConfigMapper.updateReqPageNo(oldReqPageNo,mzYshConfig.getReqPageNo());
|
|
|
if (num == 0) {
|
|
|
throw new MzException("获取医技申请单号失败,请重试!");
|
|
|
@@ -76,6 +97,13 @@ public class MzYshConfigServiceImpl implements MzYshConfigService {
|
|
|
}
|
|
|
Integer oldBlNo = mzYshConfig.getBlNo();
|
|
|
mzYshConfig.setBlNo(mzYshConfig.getBlNo() + 1);
|
|
|
+ String lastEmrNo= mzBlRecordMapper.selectLastEmrNo();
|
|
|
+ if(lastEmrNo!=null){
|
|
|
+ Integer realLastEmrNo =Integer.valueOf(lastEmrNo.replace("N",""));
|
|
|
+ if(realLastEmrNo>oldBlNo){
|
|
|
+ mzYshConfig.setBlNo(realLastEmrNo + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
int num = mzYshConfigMapper.updateBlNo(oldBlNo,mzYshConfig.getBlNo());
|
|
|
if (num == 0) {
|
|
|
throw new MzException("获取病历单号失败,请重试!");
|