|
|
@@ -139,6 +139,32 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
|
|
|
//不做重复挂号控制的号别
|
|
|
private List<String> jsyChargeTypes = Arrays.asList(new String[]{"26", "27"});
|
|
|
|
|
|
+ @Override
|
|
|
+ public int beforeSaveMzyReqrec(MzyReqrecPageDto mzyReqrecPageDto) throws MzException, ParseException {
|
|
|
+ MzyReqrec mzyReqrec = mzyReqrecPageDto.getMzyReqrec();
|
|
|
+ MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(mzyReqrec.getPatientId());
|
|
|
+ if (mzPatientMi == null) {
|
|
|
+ throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
|
|
|
+ }
|
|
|
+ if (mzyReqrecPageDto.getResponceType() == null || StringUtils.isBlank(mzyReqrecPageDto.getResponceType())) {
|
|
|
+ mzyReqrecPageDto.setResponceType(mzPatientMi.getResponseType());
|
|
|
+ }
|
|
|
+ MzyZdChargeType mzyZdChargeType = mzyRequestService.calculateAddition(mzyReqrecPageDto,mzyReqrecPageDto.getMzyRequestId(), mzPatientMi.getBirthDay(),mzyReqrec.getPatientId());
|
|
|
+ if (mzyZdChargeType == null) {
|
|
|
+ throw new MzException("当前号别不存在,请先设置!");
|
|
|
+ }
|
|
|
+ MzyRequest mzyRequest = mzyRequestMapper.selectMzyRequestById(mzyReqrecPageDto.getMzyRequestId());
|
|
|
+ if (mzyRequest == null) {
|
|
|
+ throw new MzException("挂号对应的排班不存在!");
|
|
|
+ }
|
|
|
+ int times = getTimes(mzPatientMi);
|
|
|
+ int serialNo = mzSerialNoService.getMzSerialNo();
|
|
|
+ Date now = new Date();
|
|
|
+ fomartReqrec(mzyReqrec, mzPatientMi, null, mzyZdChargeType, times, serialNo, now, mzyRequest);
|
|
|
+ List<MzyReqrec> mzyReqrecList = mzyReqrecMapper.getIsReq(mzyReqrec);
|
|
|
+ return mzyReqrecList == null ? 0 : mzyReqrecList.size();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
|
|
|
public int saveMzyReqrec(MzyReqrecPageDto mzyReqrecPageDto, String ipAddress) throws MzException, ParseException {
|