|
@@ -2,6 +2,8 @@ package thyyxxk.webserver.service.yibao;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.ListUtils;
|
|
@@ -224,8 +226,15 @@ public class XiangMuLuRuService {
|
|
|
* @param deptCode 根据科室搜索
|
|
|
* @return 返回模板
|
|
|
*/
|
|
|
- public ResultVo<List<ZyDetailCharge>> getMuBan(String deptCode) {
|
|
|
- return ResultVoUtil.success(dao.getMuBan(deptCode, 1));
|
|
|
+ public ResultVo<IPage<ZyDetailCharge>> getMuBan(String deptCode, long currentPage, long pageSize, long total) {
|
|
|
+ IPage<ZyDetailCharge> page = new Page<>(currentPage, pageSize, total == 0);
|
|
|
+ QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
+ qw.ne("isnull(pattern_name,'')", "''");
|
|
|
+ if (publicServer.noNeedRule()) {
|
|
|
+ qw.eq("op_dept", deptCode);
|
|
|
+ }
|
|
|
+ dao.getMuBan(page, qw);
|
|
|
+ return ResultVoUtil.success(page);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -301,7 +310,7 @@ public class XiangMuLuRuService {
|
|
|
if (dao.getHuanZheSFZaiYuan(param.getInpatientNo(), param.getAdmissTimes()) == 0) {
|
|
|
errorStr.append("没有患者的在院信息 <br />");
|
|
|
}
|
|
|
- if (errorStr.length() > 3) {
|
|
|
+ if (errorStr.length() > 0) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, errorStr.toString());
|
|
|
}
|
|
|
// 收费项目的编码
|
|
@@ -317,13 +326,9 @@ public class XiangMuLuRuService {
|
|
|
// if (ListUtil.notBlank(meiYouKuCun)) {
|
|
|
// return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "费用录入错误,药品无库存 【" + JSON.toJSONString(meiYouKuCun) + "】");
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
if (ListUtil.notBlank(yiTingYong)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "费用录入错误,包含已停用的项目 【" + JSON.toJSONString(yiTingYong) + "】");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
// 婴儿 要特殊处理
|
|
|
// 如果带有这个 $ 说明是婴儿
|
|
|
int infantFlag = publicServer.getInfantFlag(param.getInpatientNo());
|
|
@@ -356,7 +361,6 @@ public class XiangMuLuRuService {
|
|
|
zyDetailCharge.setChargeCode(zyDetailCharge.getChargeCodeMx());
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
if (zyDetailCharge.getChargeAmount() == null || zyDetailCharge.getAmount() == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "数量或金额不能为空。");
|
|
|
}
|
|
@@ -389,7 +393,7 @@ public class XiangMuLuRuService {
|
|
|
// 这里不会保存单价 只会总价
|
|
|
zyDetailCharge.setChargeAmount(zyDetailCharge.getChargeAmount().multiply(zyDetailCharge.getAmount()));
|
|
|
zyDetailCharge.setDetailSn(maxDetailSn += 1);
|
|
|
- if (zyDetailCharge.getSerial().equals("01")) {
|
|
|
+ if ("01".equals(zyDetailCharge.getSerial())) {
|
|
|
ZyDetailCharge shenQing = new ZyDetailCharge();
|
|
|
BeanUtils.copyProperties(zyDetailCharge, shenQing);
|
|
|
shenQing.setChargeFee(zyDetailCharge.getChargeAmount());
|
|
@@ -421,10 +425,10 @@ public class XiangMuLuRuService {
|
|
|
zyDetailCharge.setOpIdCode(TokenUtil.getTokenUserId());
|
|
|
for (ZyDetailCharge detailCharge : zyDetailCharge.getList()) {
|
|
|
if (StringUtil.notBlank(zyDetailCharge.getBillItemCode())) {
|
|
|
- if (detailCharge.getBillItemCode().equals("001") || detailCharge.getBillItemCode().equals("002")) {
|
|
|
+ if ("001".equals(detailCharge.getBillItemCode()) || "002".equals(detailCharge.getBillItemCode())) {
|
|
|
detailCharge.setSerial("01");
|
|
|
detailCharge.setGroupNo("73");
|
|
|
- } else if (zyDetailCharge.getBillItemCode().equals("028")) {
|
|
|
+ } else if ("028".equals(zyDetailCharge.getBillItemCode())) {
|
|
|
zyDetailCharge.setSerial("01");
|
|
|
zyDetailCharge.setChargeCode("BILL28");
|
|
|
} else {
|
|
@@ -583,7 +587,7 @@ public class XiangMuLuRuService {
|
|
|
if (zyDetailCharge == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未查询到对应信息,可能该费用可能已经被撤销了或被正负相抵了。");
|
|
|
}
|
|
|
- if (!zyDetailCharge.getTransFlagYb().equals("0")) {
|
|
|
+ if (!"0".equals(zyDetailCharge.getTransFlagYb())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "费用已经被上传了,无法撤销。");
|
|
|
}
|
|
|
if (zyDetailCharge.getOriDetailSn() != null && zyDetailCharge.getOriDetailSn() == -1) {
|
|
@@ -613,7 +617,7 @@ public class XiangMuLuRuService {
|
|
|
}
|
|
|
patient.setWeiPiPei(new ArrayList<>());
|
|
|
patient.setWeiXieDaiYuanLiuShui(new ArrayList<>());
|
|
|
- if (patient.getResponceType().equals("al")) {
|
|
|
+ if ("al".equals(patient.getResponceType())) {
|
|
|
patient.getWeiPiPei().addAll(dao.gongShangWeiPiPei(patient.getInpatientNo(), patient.getAdmissTimes(), patient.getLedgerSn(), patient.getInfantFlag()));
|
|
|
} else {
|
|
|
patient.getWeiPiPei().addAll(dao.weiGuiYaoPin(patient.getInpatientNo(), patient.getAdmissTimes(), patient.getLedgerSn(), patient.getInfantFlag()));
|
|
@@ -674,7 +678,7 @@ public class XiangMuLuRuService {
|
|
|
ZyDetailCharge zy = dao.piPeiXinXiFuShu(inpatientNo, zyDetailCharge.getAdmissTimes(), zyDetailCharge.getLedgerSn(), infantFlag, zyDetailCharge.getDetailSn());
|
|
|
if (zy == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未找到负数费用信息,可能已经被删除了,请刷新页面重试。");
|
|
|
- } else if (zy.getOriDetailSn() != null || zy.getTransFlagYb().equals("2")) {
|
|
|
+ } else if (zy.getOriDetailSn() != null || "2".equals(zy.getTransFlagYb())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "该负数费用已被正负相抵。");
|
|
|
}
|
|
|
List<ZyDetailCharge> zhenShuShuJu = dao.piPeiXinXi(inpatientNo, zyDetailCharge.getAdmissTimes(), zyDetailCharge.getLedgerSn(), infantFlag, detailSnList);
|
|
@@ -689,9 +693,11 @@ public class XiangMuLuRuService {
|
|
|
for (ZyDetailCharge detailCharge : zhenShuShuJu) {
|
|
|
if (!BigUtils.dengYu(detailCharge.getOrderNo(), zyDetailCharge.getOrderNo())) {
|
|
|
ResultVo<String> LOGICAL_ERROR = getStringResultVo(yongHuJueSe, zhiXinKeShi, zyDetailCharge, detailCharge, false);
|
|
|
- if (LOGICAL_ERROR != null) return LOGICAL_ERROR;
|
|
|
+ if (LOGICAL_ERROR != null) {
|
|
|
+ return LOGICAL_ERROR;
|
|
|
+ }
|
|
|
}
|
|
|
- if (detailCharge.getTransFlagYb().equals("2")) {
|
|
|
+ if ("2".equals(detailCharge.getTransFlagYb())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, String.format("流水号为:{%d},已被正负抵消。", detailCharge.getDetailSn()));
|
|
|
}
|
|
|
if (tuiFeiYuErPiPei.containsKey(detailCharge.getDetailSn())) {
|
|
@@ -734,7 +740,7 @@ public class XiangMuLuRuService {
|
|
|
content[i][8] = pojo.getDeptCode();
|
|
|
content[i][9] = pojo.getChargeFee().toString();
|
|
|
content[i][10] = pojo.getChargeAmount().toString();
|
|
|
- content[i][11] = pojo.getChargeStatus().equals("1") ? "录入" : pojo.getChargeStatus().equals("2") ? "上账" : "结算";
|
|
|
+ content[i][11] = "1".equals(pojo.getChargeStatus()) ? "录入" : "2".equals(pojo.getChargeStatus()) ? "上账" : "结算";
|
|
|
content[i][12] = pojo.getOpName();
|
|
|
content[i][13] = pojo.getBillItemName();
|
|
|
}
|