|
|
@@ -2,10 +2,9 @@ package thyyxxk.webserver.service.hospitalizationCosts;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import jdk.nashorn.internal.runtime.RewriteException;
|
|
|
import lombok.Data;
|
|
|
+import lombok.Getter;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.poi.ss.formula.udf.IndexedUDFFinder;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import thyyxxk.webserver.config.Assertion;
|
|
|
@@ -70,6 +69,22 @@ public class HospitalizationCostsService implements Assertion {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Getter
|
|
|
+ public enum RefundStatus {
|
|
|
+ REFUNDS(-1, "退费数据"),
|
|
|
+ APPLY_FOR_A_REFUND(-2, "申请退药"),
|
|
|
+ REFUSAL_TO_RETURN_THE_DRUG(-3, "拒绝退药");
|
|
|
+
|
|
|
+ private final int code;
|
|
|
+ private final String name;
|
|
|
+
|
|
|
+ RefundStatus(int code, String name) {
|
|
|
+ this.code = code;
|
|
|
+ this.name = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public HospitalizationCostsService(HospitalizationCostsDao dao, RedisLikeService redisLikeService, XiangMuLuRuDao luRuDao, PublicServer publicServer) {
|
|
|
this.dao = dao;
|
|
|
this.redisLikeService = redisLikeService;
|
|
|
@@ -142,16 +157,16 @@ public class HospitalizationCostsService implements Assertion {
|
|
|
item.setSerial("00");
|
|
|
}
|
|
|
// -3 退药申请,拒绝退药申请是可以重新申请的
|
|
|
- if (item.getOriDetailSn() != null && item.getOriDetailSn().equals(-3)) {
|
|
|
+ if (item.getOriDetailSn() != null && item.getOriDetailSn().equals(RefundStatus.REFUSAL_TO_RETURN_THE_DRUG.getCode())) {
|
|
|
item.setOriDetailSn(null);
|
|
|
}
|
|
|
- if (item.getOriDetailSn() != null && item.getOriDetailSn().equals(-2)) {
|
|
|
+ if (item.getOriDetailSn() != null && item.getOriDetailSn().equals(RefundStatus.APPLY_FOR_A_REFUND.code)) {
|
|
|
sb.append("该药品在申请退药。");
|
|
|
}
|
|
|
if (item.getOriDetailSn() != null) {
|
|
|
sb.append("该数据为退费数据。");
|
|
|
}
|
|
|
- if (BigUtils.bigXiaoYu(item.getChargeFee(), 0) || BigUtils.bigXiaoYu(item.getChargeAmount(), 0)) {
|
|
|
+ if (BigUtils.bigXiaoYu(item.getChargeFee(), BigDecimal.ZERO) || BigUtils.bigXiaoYu(item.getChargeAmount(), BigDecimal.ZERO)) {
|
|
|
sb.append("该数据为负数。");
|
|
|
}
|
|
|
if (StringUtil.isBlank(item.getExecUnit())) {
|
|
|
@@ -168,7 +183,7 @@ public class HospitalizationCostsService implements Assertion {
|
|
|
sb.append("请对应的执行科室或申请科室退费。");
|
|
|
}
|
|
|
// 只退费设置
|
|
|
- refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, -1));
|
|
|
+ refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, RefundStatus.REFUNDS.code));
|
|
|
} else {
|
|
|
// 药品判断
|
|
|
// 医技科室录入的费用
|
|
|
@@ -176,15 +191,15 @@ public class HospitalizationCostsService implements Assertion {
|
|
|
if (!deptList.contains(item.getExecUnit())) {
|
|
|
sb.append("此药品为医技科室录入,请对应的医技科室退费。");
|
|
|
}
|
|
|
- refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, -1));
|
|
|
- medicalTechnologyDrugReturnForm.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, -1));
|
|
|
+ refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, RefundStatus.REFUNDS.code));
|
|
|
+ medicalTechnologyDrugReturnForm.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, RefundStatus.REFUNDS.code));
|
|
|
} else {
|
|
|
// 仅退费不退药品
|
|
|
if ("refundOnly".equals(param.getRefundFlag())) {
|
|
|
- refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, -1));
|
|
|
+ refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, RefundStatus.REFUNDS.code));
|
|
|
} else {
|
|
|
// 退费又退药.不需要向refundOnly中添加数据,且oriDetailSn 要设置为 -2 代表申请退费
|
|
|
- generateAReturnOrder.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, -2));
|
|
|
+ generateAReturnOrder.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, RefundStatus.APPLY_FOR_A_REFUND.code));
|
|
|
}
|
|
|
|
|
|
OrderInfo order = orderCacheOnce.get(orderNo, (key) -> dao.selectDrugClassByOrderNo(new BigDecimal(orderNo)));
|
|
|
@@ -334,7 +349,7 @@ public class HospitalizationCostsService implements Assertion {
|
|
|
|
|
|
for (ZyDetailChargeTable item : list) {
|
|
|
maxDetailSn += 1;
|
|
|
- refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, -1));
|
|
|
+ refundOnly.add(setDefaultValuesAndAutoincrements(item, maxDetailSn, RefundStatus.REFUNDS.code));
|
|
|
}
|
|
|
|
|
|
// 直接退费
|