|
@@ -1620,6 +1620,90 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
}
|
|
|
return clinic;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * @description: 增加挂号费用明细
|
|
|
+ * @author: lihong
|
|
|
+ * @date: 2025/5/15 15:21
|
|
|
+ * @param: mzPrescriptionVo
|
|
|
+ * @param: times
|
|
|
+ * @param: mzPatientMi
|
|
|
+ **/
|
|
|
+ private void setGhFeePrescriptionVo(MzPrescriptionVo mzPrescriptionVo,Integer times,MzPatientMi mzPatientMi)throws MzException {
|
|
|
+ if(StrUtil.isBlank(mzPrescriptionVo.getDoctorCode()) || StrUtil.isBlank(mzPrescriptionVo.getPatientId()) || mzPatientMi == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(CollUtil.isNotEmpty(mzPrescriptionVo.getMzChargeDetailList()) && mzPrescriptionVo.getMzChargeDetailList().stream().anyMatch(item->Constants.GHF.equals(item.getBillItemCode()))){
|
|
|
+ // 先删除防止重复
|
|
|
+ List<MzChargeDetail> mzChargeDetailList = mzPrescriptionVo.getMzChargeDetailList();
|
|
|
+ Iterator<MzChargeDetail> iterator = mzChargeDetailList.iterator();
|
|
|
+ while (iterator.hasNext()){
|
|
|
+ MzChargeDetail chargeDetail = iterator.next();
|
|
|
+ if(Constants.GHF.equals(chargeDetail.getBillItemCode())){
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(NumberEnum.ONE.getCode().equals(mzPrescriptionVo.getGhFeeFlag())){
|
|
|
+ ZdChargeItem zdChargeItem = zdChargeItemService.queryZdChargeItemGhFeeByEmpCode(mzPrescriptionVo.getDoctorCode());
|
|
|
+ if(zdChargeItem == null || zdChargeItem.getChargeAmount() == null || BigDecimal.ZERO.compareTo(zdChargeItem.getChargeAmount()) == 0){
|
|
|
+ throw new MzException("选择收取挂号费,您未配置收取的挂号类别或配置的费用已停用,请先配置!");
|
|
|
+ }
|
|
|
+ Integer maxOrderNo = 1;
|
|
|
+ if(CollUtil.isNotEmpty(mzPrescriptionVo.getMzChargeDetailList())){
|
|
|
+ maxOrderNo = mzPrescriptionVo.getMzChargeDetailList().stream().map(item -> Convert.toInt(item.getOrderNo(), 0)).max(Integer::compareTo).get() + 1;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ mzPrescriptionVo.setMzChargeDetailList(new ArrayList<>());
|
|
|
+ }
|
|
|
+ MzChargeDetail newMzChargeDetail = new MzChargeDetail();
|
|
|
+ newMzChargeDetail.setPatientId(mzPrescriptionVo.getPatientId());
|
|
|
+ newMzChargeDetail.setTimes(times);
|
|
|
+ newMzChargeDetail.setReceiptNo(0);
|
|
|
+ newMzChargeDetail.setOrderNo(maxOrderNo);
|
|
|
+ newMzChargeDetail.setItemNo(1);
|
|
|
+ newMzChargeDetail.setChargeItemCode(zdChargeItem.getCode());
|
|
|
+ newMzChargeDetail.setDrugUnit(zdChargeItem.getChargeUnit());
|
|
|
+ newMzChargeDetail.setDrugQuan(1D);
|
|
|
+ newMzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount());
|
|
|
+ newMzChargeDetail.setBillItemCode(Constants.GHF);
|
|
|
+ newMzChargeDetail.setOrigPrice(zdChargeItem.getChargeAmount());
|
|
|
+ newMzChargeDetail.setQuantity(1D);
|
|
|
+ newMzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
|
|
|
+ newMzChargeDetail.setSerial("");
|
|
|
+ newMzChargeDetail.setSerialNo(0);
|
|
|
+ newMzChargeDetail.setName(mzPatientMi.getName());
|
|
|
+ newMzChargeDetail.setGroupNo(StrUtil.isBlank(zdChargeItem.getGroupNo())? Constants.YJ_GROUP_NO : zdChargeItem.getGroupNo());
|
|
|
+ newMzChargeDetail.setDrugWin(1);
|
|
|
+ newMzChargeDetail.setPriceId(mzPrescriptionVo.getDoctorCode());
|
|
|
+ newMzChargeDetail.setPriceTime(new Date());
|
|
|
+ newMzChargeDetail.setExecDept(zdChargeItem.getExecUnit());
|
|
|
+ newMzChargeDetail.setPrintFlag(YesNoEnum.NO.code.toString());
|
|
|
+ newMzChargeDetail.setConfirmFlag(ConfirmFlagEnum.NOT_CONFIRM.code);
|
|
|
+ newMzChargeDetail.setWarnDept(mzPrescriptionVo.getVisitDeptCode());
|
|
|
+ newMzChargeDetail.setJzFlag("0");
|
|
|
+ newMzChargeDetail.setDoctorCode(mzPrescriptionVo.getDoctorCode());
|
|
|
+ newMzChargeDetail.setDoctorFlag(YesNoEnum.YES.code.toString());
|
|
|
+ newMzChargeDetail.setInjectRes(Double.valueOf(YesNoEnum.YES.code));
|
|
|
+ newMzChargeDetail.setRealNo(0);
|
|
|
+ newMzChargeDetail.setYbbxFlag(YesNoEnum.NO.code.toString());
|
|
|
+ newMzChargeDetail.setTcNo("");
|
|
|
+ newMzChargeDetail.setOrderDays(1);
|
|
|
+ newMzChargeDetail.setPaySelf("0");
|
|
|
+ newMzChargeDetail.setTcName(zdChargeItem.getName());
|
|
|
+ newMzChargeDetail.setDetailFlag(YesNoEnum.NO.code.toString());
|
|
|
+ newMzChargeDetail.setOrderType(YesNoEnum.YES.code.toString());
|
|
|
+ newMzChargeDetail.setSupplyNo("");
|
|
|
+ newMzChargeDetail.setGroupType(GroupTypeEnum.DIAGNOSIS.code);
|
|
|
+ newMzChargeDetail.setOrderBill(100);
|
|
|
+ String chargeBillCode = Constants.BILL_ITEM_CODE_prev + zdChargeItem.getBillItemMz().substring(1);
|
|
|
+ newMzChargeDetail.setChargeBillCode(chargeBillCode);
|
|
|
+ newMzChargeDetail.setSelfFlag(YesNoEnum.NO.code.toString());
|
|
|
+ newMzChargeDetail.setResponceType(mzPatientMi == null ? Constants.SELF_PAYING_RESPONCE_TYPE : mzPatientMi.getResponseType());
|
|
|
+ newMzChargeDetail.setReqYj(YesNoEnum.NO.code.toString());
|
|
|
+ newMzChargeDetail.setGroupId(YesNoEnum.NO.code);
|
|
|
+ mzPrescriptionVo.getMzChargeDetailList().add(newMzChargeDetail);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
|
|
@@ -3002,7 +3086,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
patientAllergenInfo.setPatNo(mzPrescriptionVo.getPatientId());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //收费挂号费处方,增加挂号费
|
|
|
+ setGhFeePrescriptionVo(mzPrescriptionVo,times,mzPatientMi);
|
|
|
//设置外配药
|
|
|
if(CollUtil.isNotEmpty(mzPrescriptionVo.getRxDruginfoList())){
|
|
|
String hospRxno = IdUtil.simpleUUID();
|
|
@@ -7410,7 +7495,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
if(zyActpatientService.checkZaiYuan(mzPrescriptionVo.getPatientId())){
|
|
|
throw new MzException("病人已经在住院,不能再开门诊处方");
|
|
|
}
|
|
|
- if(mzPrescriptionVo.getOrderType() == 5 && CollUtil.isEmpty(mzPrescriptionVo.getWxmallPackagePurchasedItemList())){
|
|
|
+ if(Convert.toInt(mzPrescriptionVo.getOrderType(),1) == 5 && CollUtil.isEmpty(mzPrescriptionVo.getWxmallPackagePurchasedItemList())){
|
|
|
throw new MzException("开具商城处方,必须选择商城项目明细!");
|
|
|
}
|
|
|
if(!wxmallPackagePurchasedItemService.checkWxMallPrescription(mzPrescriptionVo)){
|
|
@@ -7437,7 +7522,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
|
|
|
getMzChargeDetailService().chargeFee(Constants.BRZZJF_CODE, mzDepositFileVo, Constants.BRZZJF_CODE);
|
|
|
}
|
|
|
}
|
|
|
- else if(mzPrescriptionVo.getOrderType() == 5){
|
|
|
+ else if(Convert.toInt(mzPrescriptionVo.getOrderType(),1) == 5){
|
|
|
setMallPrescription(mzPrescriptionVo);
|
|
|
insertClinic = getMzChargeDetailService().savePrescription(mzPrescriptionVo, dbClinic, false);
|
|
|
if(insertClinic !=null && insertClinic.getId() != null){
|