|
@@ -122,7 +122,7 @@ public class XiangMuLuRuService {
|
|
|
if (StringUtil.isBlank(param.getInpatientNo()) || param.getAdmissTimes() == null || param.getList().size() == 0) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER, "患者信息不全");
|
|
|
}
|
|
|
- // 判断数据是否为 退费数据
|
|
|
+ // 判断数据是否为 退费数据
|
|
|
List<ZyDetailCharge> chaKanSFtuiFei = dao.chaKanSFYiJingTuiFeiLe(param.getInpatientNo(), param.getAdmissTimes(), param.getList());
|
|
|
|
|
|
for (ZyDetailCharge charge : chaKanSFtuiFei) {
|
|
@@ -186,6 +186,7 @@ public class XiangMuLuRuService {
|
|
|
} else {
|
|
|
List<List<ZyDetailCharge>> fenGe = ListUtils.partition(tuiFeiList, 20);
|
|
|
fenGe.forEach(dao::xiangMuTuiFei);
|
|
|
+ dao.huanZheZongFeiYong(fy, param.getInpatientNo(), param.getAdmissTimes(), "zy_ledger_file");
|
|
|
dao.huanZheZongFeiYong(fy, param.getInpatientNo(), param.getAdmissTimes(), "zy_actpatient");
|
|
|
log.info("操作项目退费 ==》 操作人:{},数据:{}", TokenUtil.getTokenUserId(), JSON.toJSONString(tuiFeiList));
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "项目退费操作成功。乁( ˙ ω˙乁)");
|
|
@@ -223,7 +224,7 @@ public class XiangMuLuRuService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取科室
|
|
|
+ * 获取病区
|
|
|
*
|
|
|
* @return 返回科室信息
|
|
|
*/
|
|
@@ -272,6 +273,9 @@ public class XiangMuLuRuService {
|
|
|
if (StringUtil.isBlank(param.getZySerialNo())) {
|
|
|
errorStr.append("5、住院流水号为空 <br />");
|
|
|
}
|
|
|
+ if (dao.getHuanZheSFZaiYuan(param.getInpatientNo()) == 0) {
|
|
|
+ errorStr.append("6、没有患者的在院信息 <br />");
|
|
|
+ }
|
|
|
if (errorStr.length() > 3) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, errorStr.toString());
|
|
|
}
|
|
@@ -286,7 +290,6 @@ public class XiangMuLuRuService {
|
|
|
BigDecimal sum = new BigDecimal(0);
|
|
|
// 录入人的id
|
|
|
param.setOpIdCode(TokenUtil.getTokenUserId());
|
|
|
-
|
|
|
for (ZyDetailCharge zyDetailCharge : param.getList()) {
|
|
|
switch (zyDetailCharge.getBillItemCode()) {
|
|
|
case "001":
|
|
@@ -320,6 +323,11 @@ public class XiangMuLuRuService {
|
|
|
if (zyDetailCharge.getChargeCodeMx() == null) {
|
|
|
zyDetailCharge.setChargeCodeMx(zyDetailCharge.getChargeCode());
|
|
|
}
|
|
|
+ if (param.getOrderNo() != null) {
|
|
|
+ zyDetailCharge.setOrderNo(param.getOrderNo());
|
|
|
+ } else {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医嘱号为空");
|
|
|
+ }
|
|
|
sum = sum.add(zyDetailCharge.getChargeAmount().multiply(zyDetailCharge.getAmount()));
|
|
|
// 这里不会保存单价 只会总价
|
|
|
zyDetailCharge.setChargeAmount(zyDetailCharge.getChargeAmount().multiply(zyDetailCharge.getAmount()));
|
|
@@ -329,6 +337,7 @@ public class XiangMuLuRuService {
|
|
|
fy.setTotalCharge(sum);
|
|
|
// 在此处 插入费用
|
|
|
dao.chaRuFeiYong(param, param.getList(), infantFlag);
|
|
|
+ dao.huanZheZongFeiYong(fy, param.getInpatientNo(), param.getAdmissTimes(), "zy_ledger_file");
|
|
|
dao.huanZheZongFeiYong(fy, param.getInpatientNo(), param.getAdmissTimes(), "zy_actpatient");
|
|
|
log.info("项目录入费用上传 ==》 操作人:{},数据:{}", param.getOpIdCode(), JSON.toJSONString(param));
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "费用上传成功。<( ̄︶ ̄)>");
|
|
@@ -396,11 +405,11 @@ public class XiangMuLuRuService {
|
|
|
for (ZyDetailCharge fuShu : getYiZhuFeiYongFuShu) {
|
|
|
String key = fuShu.getOrderNo() + DateUtil.formatDatetime(fuShu.getChargeDate()) + fuShu.getChargeCodeMx() + fuShu.getChargeAmount().negate() + fuShu.getLedgerSn();
|
|
|
if (zhenShuMap.containsKey(key)) {
|
|
|
- for (int i = 0; i < zhenShuMap.get(key).size(); i++) {
|
|
|
- if (zhenShuMap.get(key).get(i).getTuiFeiFlag() == null) {
|
|
|
- fuShu.setOriDetailSn(zhenShuMap.get(key).get(i).getDetailSn());
|
|
|
+ for (ZyDetailCharge zyDetailCharge : zhenShuMap.get(key)) {
|
|
|
+ if (zyDetailCharge.getTuiFeiFlag() == null) {
|
|
|
+ fuShu.setOriDetailSn(zyDetailCharge.getDetailSn());
|
|
|
piPei.add(fuShu);
|
|
|
- zhenShuMap.get(key).get(i).setTuiFeiFlag(1);
|
|
|
+ zyDetailCharge.setTuiFeiFlag(1);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -448,11 +457,11 @@ public class XiangMuLuRuService {
|
|
|
for (ZyDetailCharge zyDetailCharge : erCiPiPei) {
|
|
|
String key = zyDetailCharge.getExecUnit() + zyDetailCharge.getChargeCodeMx() + zyDetailCharge.getChargeAmount().negate() + zyDetailCharge.getLedgerSn();
|
|
|
if (erCiPiPeiZhenShu.containsKey(key)) {
|
|
|
- for (int i = 0; i < erCiPiPeiZhenShu.get(key).size(); i++) {
|
|
|
- if (erCiPiPeiZhenShu.get(key).get(i).getTuiFeiFlag() == null) {
|
|
|
- zyDetailCharge.setOriDetailSn(erCiPiPeiZhenShu.get(key).get(i).getDetailSn());
|
|
|
+ for (ZyDetailCharge detailCharge : erCiPiPeiZhenShu.get(key)) {
|
|
|
+ if (detailCharge.getTuiFeiFlag() == null) {
|
|
|
+ zyDetailCharge.setOriDetailSn(detailCharge.getDetailSn());
|
|
|
piPei.add(zyDetailCharge);
|
|
|
- erCiPiPeiZhenShu.get(key).get(i).setTuiFeiFlag(1);
|
|
|
+ detailCharge.setTuiFeiFlag(1);
|
|
|
break;
|
|
|
}
|
|
|
}
|