|
@@ -7,7 +7,6 @@ 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;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.GetDateFormat;
|
|
@@ -18,7 +17,7 @@ import thyyxxk.webserver.dao.his.yibao.DismissDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.datamodify.TYbSetModifyTime;
|
|
|
-import thyyxxk.webserver.entity.medicalinsurance.inpatient.YbZyDisDiag;
|
|
|
+import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyDisDiagYb;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.inpatient.ZyInactpatient;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.query.SiSetlFeeDetl;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.setllistupld.*;
|
|
@@ -53,8 +52,6 @@ public class SetlListUpldService {
|
|
|
|
|
|
private final PublicServer publicServer;
|
|
|
|
|
|
-
|
|
|
- @Autowired
|
|
|
public SetlListUpldService(ExecService exec, SiQueryDao queryDao, UpIdCollectionDao upIdCollectionDao, DismissDao dismissDao, PublicServer publicServer) {
|
|
|
this.exec = exec;
|
|
|
this.queryDao = queryDao;
|
|
@@ -63,6 +60,7 @@ public class SetlListUpldService {
|
|
|
this.publicServer = publicServer;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public ResultVo<String> upldSetlList(String patNo, Integer times, Integer ledgerSn) throws Exception {
|
|
|
ResultVo<UpldCollection> upldCollection = getUploadInfo(patNo, times, ledgerSn);
|
|
|
if (upldCollection.getCode() != 200) {
|
|
@@ -79,15 +77,15 @@ public class SetlListUpldService {
|
|
|
JSONObject jsonObject = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_SI_SETTLE_INFO, upldCollection.getData().getSetlinfo().getInsuplc());
|
|
|
jsonObject.replace("input", input);
|
|
|
// 这里是上传
|
|
|
- JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
|
|
|
+// JSONObject result = exec.executeTrade(jsonObject, SiFunction.UPLOAD_SI_SETTLE_INFO);
|
|
|
|
|
|
-// JSONObject result = new JSONObject();
|
|
|
-// if (times % 2 == 0) {
|
|
|
-// result.put("infcode", 0);
|
|
|
-// } else {
|
|
|
-// result.put("infcode", -1);
|
|
|
-// result.put("err_msg", "知道你为啥失败吗?");
|
|
|
-// }
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ if (times % 2 == 0) {
|
|
|
+ result.put("infcode", 0);
|
|
|
+ } else {
|
|
|
+ result.put("infcode", -1);
|
|
|
+ result.put("err_msg", "知道你为啥失败吗?");
|
|
|
+ }
|
|
|
log.info("医保结算信息上传 \n操作人:{}\n参数:{} \n结果:{}", TokenUtil.getTokenUserId(), jsonObject, result);
|
|
|
if (null == result) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
|
|
@@ -231,7 +229,7 @@ public class SetlListUpldService {
|
|
|
// 基金支付信息
|
|
|
upldCollection.setPayinfo(payinfo);
|
|
|
// 门特慢特病诊断信息 目前还没有
|
|
|
- // upldCollection.setOpspdiseinfo(new ArrayList<>());
|
|
|
+ upldCollection.setOpspdiseinfo(new ArrayList<>());
|
|
|
// 住院诊断信息
|
|
|
upldCollection.setDiseinfo(diseinfos);
|
|
|
// 收费项目信息
|
|
@@ -278,6 +276,7 @@ public class SetlListUpldService {
|
|
|
public ResultVo<String> upldSetlListTimes(JieSuanDanChaXun param) {
|
|
|
try {
|
|
|
param.setPageSize(param.getTotal());
|
|
|
+ param.setCurrentPage(1);
|
|
|
List<SiSetlinfoTemp> list = huoQuJieSuanRenYuan(param).getData().getRecords();
|
|
|
if (ListUtil.isBlank(list)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有要上传的信息。");
|
|
@@ -375,10 +374,9 @@ public class SetlListUpldService {
|
|
|
*/
|
|
|
public ResultVo<IPage<SiSetlinfoTemp>> huoQuJieSuanRenYuan(JieSuanDanChaXun param) {
|
|
|
IPage<SiSetlinfoTemp> page = new Page<>();
|
|
|
- // TODO: 2021/12/9 自己看
|
|
|
page.setRecords(upIdCollectionDao.huoQuJieSuanRenYuan(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
|
|
|
- param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), null,
|
|
|
- param.getCurrentPage(), param.getPageSize()));
|
|
|
+ param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), param.getReferPhysician(), param.getCurrentPage(),
|
|
|
+ param.getPageSize()));
|
|
|
if (ListUtil.isBlank(page.getRecords())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
}
|
|
@@ -402,22 +400,20 @@ public class SetlListUpldService {
|
|
|
item.setMedTypeName(medType.getName());
|
|
|
}
|
|
|
}
|
|
|
- Map<String, YbZyDisDiag> zhuZhenDuan = upIdCollectionDao.zhuZhenDuan(inpatientNos).stream().collect(
|
|
|
+ Map<String, ZyDisDiagYb> zhuZhenDuan = upIdCollectionDao.zhuZhenDuan(inpatientNos).stream().collect(
|
|
|
Collectors.toMap(item -> item.getInpatientNo() + item.getAdmissTimes(), a -> a, (k1, k2) -> k1)
|
|
|
);
|
|
|
for (SiSetlinfoTemp item : page.getRecords()) {
|
|
|
String key = item.getPatNo() + item.getTimes();
|
|
|
- YbZyDisDiag dis = zhuZhenDuan.get(key);
|
|
|
+ ZyDisDiagYb dis = zhuZhenDuan.get(key);
|
|
|
if (dis != null) {
|
|
|
item.setDisDiag(dis.getDisDiag());
|
|
|
item.setDisDiagComment(dis.getDisDiagComment());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (param.getTotal() == 0) {
|
|
|
- // TODO: 2021/12/9 自己看
|
|
|
page.setTotal(upIdCollectionDao.huoQuJieSuanRenYuanTotal(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
|
|
|
- param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), null));
|
|
|
+ param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), param.getReferPhysician()));
|
|
|
}
|
|
|
return ResultVoUtil.success(page);
|
|
|
}
|
|
@@ -446,10 +442,10 @@ public class SetlListUpldService {
|
|
|
*/
|
|
|
public void exportExcel(HttpServletResponse response, JieSuanDanChaXun param) {
|
|
|
param.setPageSize(param.getTotal());
|
|
|
+ param.setCurrentPage(1);
|
|
|
log.info("医保结算单: {}", JSON.toJSONStringWithDateFormat(param, GetDateFormat.DATE));
|
|
|
List<SiSetlinfoTemp> list = huoQuJieSuanRenYuan(param).getData().getRecords();
|
|
|
- String[] title = {"姓名", "出院科室", "住院号/门诊号", "次数", "性别", "出生日期", "险种类型", "人员类别", "就诊ID", "结算ID", "结算时间", "医疗类别", "总费用", "报销金额", "个人账户支出", "个人现金支出",
|
|
|
- "清算机构"};
|
|
|
+ String[] title = {"姓名", "出院科室", "住院号/门诊号", "性别", "住院天数", "诊断编码", "诊断名称", "治疗方式", "总费用", "报销金额", "险种类型", "人员类别", "结算时间", "医疗类别", "清算机构"};
|
|
|
String[][] content = new String[list.size()][];
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
content[i] = new String[title.length];
|
|
@@ -486,7 +482,6 @@ public class SetlListUpldService {
|
|
|
String[] strNow1 = new SimpleDateFormat("yyyy-MM").format(setlinfoUpld.getSetlEndDate()).split("-");
|
|
|
String[] strNow2 = new SimpleDateFormat("yyyy-MM").format(new Date()).split("-");
|
|
|
List<Integer> code = publicServer.getRoleCode().getData();
|
|
|
- log.info("code:{}", JSONObject.toJSONString(code));
|
|
|
if (!code.contains(1) && !code.contains(8)) {
|
|
|
if (!strNow1[0].equals(strNow2[0])) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "当前年份和患者的结算年份不一致。");
|