|
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
+import thyyxxk.webserver.constants.GetDateFormat;
|
|
|
import thyyxxk.webserver.constants.YesOrNo;
|
|
|
import thyyxxk.webserver.constants.sidicts.*;
|
|
|
import thyyxxk.webserver.dao.his.medicalinsurance.SiManageDao;
|
|
@@ -23,7 +24,6 @@ import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.datamodify.GetDropdownBox;
|
|
|
import thyyxxk.webserver.entity.dictionary.PureCodeName;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.manage.*;
|
|
|
-import thyyxxk.webserver.entity.medicalinsurance.query.SiPatInfo;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.query.SiSetlFeeDetl;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.setlinfo.SiSetlinfo;
|
|
|
import thyyxxk.webserver.entity.medicalinsurance.setlinfo.SlctSetlPrm;
|
|
@@ -34,6 +34,7 @@ import thyyxxk.webserver.service.PublicServer;
|
|
|
import thyyxxk.webserver.utils.*;
|
|
|
import thyyxxk.webserver.websocket.WebSocketServer;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Paths;
|
|
@@ -504,13 +505,12 @@ public class SiManageService {
|
|
|
* @param param 患者信息
|
|
|
* @return 返回
|
|
|
*/
|
|
|
- public ResultVo<String> upldSetlListBatch(List<SiPatInfo> param) {
|
|
|
+ public ResultVo<String> upldSetlListBatch(List<TSiSetlinfo> param) {
|
|
|
if (ListUtil.isBlank(param)) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "请选择需要上传的患者。");
|
|
|
}
|
|
|
-
|
|
|
for (int i = 0; i < param.size(); i++) {
|
|
|
- SiPatInfo siPatInfo = param.get(i);
|
|
|
+ TSiSetlinfo siPatInfo = param.get(i);
|
|
|
int percentage = makePercentage(i + 1, param.size());
|
|
|
try {
|
|
|
ResultVo<String> resultVo = upldSetlList(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn());
|
|
@@ -527,15 +527,18 @@ public class SiManageService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据时间上传
|
|
|
+ * 全部上传
|
|
|
*
|
|
|
- * @param startTime 开始时间
|
|
|
- * @param endTime 结算时间
|
|
|
* @return 返回信息
|
|
|
*/
|
|
|
- public ResultVo<String> upldSetlListTimes(String startTime, String endTime, String insutype) {
|
|
|
+ public ResultVo<String> upldSetlListTimes(JieSuanDanChaXun param) {
|
|
|
try {
|
|
|
- upldSetlListBatch(upIdCollectionDao.getHuanZheXinXi(startTime, endTime, insutype));
|
|
|
+ param.setPageSize(param.getTotal());
|
|
|
+ List<TSiSetlinfo> list = huoQuJieSuanRenYuan(param).getData().getRecords();
|
|
|
+ if (ListUtil.isBlank(list)) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有要上传的信息。");
|
|
|
+ }
|
|
|
+ upldSetlListBatch(list);
|
|
|
} catch (Exception e) {
|
|
|
log.info("时间范围上传结算单错误:{}", JSON.toJSONString(e));
|
|
|
}
|
|
@@ -624,17 +627,15 @@ public class SiManageService {
|
|
|
log.info("参数:{}", JSONObject.toJSONString(param));
|
|
|
IPage<TSiSetlinfo> page = new Page<>();
|
|
|
page.setRecords(upIdCollectionDao.huoQuJieSuanRenYuan(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
|
|
|
- param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getCurrentPage(), param.getPageSize()));
|
|
|
+ param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag(), param.getCurrentPage(),
|
|
|
+ param.getPageSize()));
|
|
|
if (ListUtil.isBlank(page.getRecords())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NO_DATA_EXIST);
|
|
|
}
|
|
|
for (TSiSetlinfo item : page.getRecords()) {
|
|
|
item.setGendName(item.getGend().equals("1") ? "男" : "女");
|
|
|
- Admdvs admdvs = Admdvs.get(item.getClrOptins());
|
|
|
- if (null == admdvs) {
|
|
|
- item.setClrOptinsName(dao.selectRegion(item.getClrOptins()));
|
|
|
- } else {
|
|
|
- item.setClrOptinsName(admdvs.getName());
|
|
|
+ if (item.getClrOptinsName() == null) {
|
|
|
+ item.setClrOptinsName(Objects.requireNonNull(Admdvs.get(item.getClrOptins())).getName());
|
|
|
}
|
|
|
Insutype insutype = Insutype.get(item.getInsutype());
|
|
|
if (null != insutype) {
|
|
@@ -651,12 +652,11 @@ public class SiManageService {
|
|
|
}
|
|
|
if (param.getTotal() == 0) {
|
|
|
page.setTotal(upIdCollectionDao.huoQuJieSuanRenYuanTotal(param.getStartTime(), param.getEndTime(), param.getClrType(), param.getPatNo(),
|
|
|
- param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType()));
|
|
|
+ param.getInsutype(), param.getOutDept(), param.getMedType(), param.getPsnType(), param.getClrOptins(), param.getFlag()));
|
|
|
}
|
|
|
return ResultVoUtil.success(page);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public ResultVo<List<Object>> getMedType() {
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
for (MedType e : MedType.values()) {
|
|
@@ -668,4 +668,37 @@ public class SiManageService {
|
|
|
return ResultVoUtil.success(jsonArray);
|
|
|
}
|
|
|
|
|
|
+ public void exportExcel(HttpServletResponse response, JieSuanDanChaXun param) {
|
|
|
+ param.setPageSize(param.getTotal());
|
|
|
+ log.info("医保结算单: {}", JSON.toJSONStringWithDateFormat(param, GetDateFormat.DATE));
|
|
|
+ List<TSiSetlinfo> list = huoQuJieSuanRenYuan(param).getData().getRecords();
|
|
|
+ String[] title = {"姓名", "住院号/门诊号", "次数", "性别", "出生日期", "险种类型", "人员类别", "就诊ID", "结算ID", "结算时间", "医疗类别", "总费用", "报销金额", "个人账户支出", "个人现金支出",
|
|
|
+ "清算机构", "出院科室"};
|
|
|
+ String[][] content = new String[list.size()][];
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ content[i] = new String[title.length];
|
|
|
+ TSiSetlinfo pojo = list.get(i);
|
|
|
+ content[i][0] = pojo.getPsnName();
|
|
|
+ content[i][1] = pojo.getPatNo();
|
|
|
+ content[i][2] = pojo.getTimes().toString();
|
|
|
+ content[i][3] = pojo.getGendName();
|
|
|
+ content[i][4] = DateUtil.formatDatetime(pojo.getBrdy(), GetDateFormat.DATE);
|
|
|
+ content[i][5] = pojo.getInsutypeName();
|
|
|
+ content[i][6] = pojo.getPsnTypeName();
|
|
|
+ content[i][7] = pojo.getMdtrtId();
|
|
|
+ content[i][8] = pojo.getSetlId();
|
|
|
+ content[i][9] = DateUtil.formatDatetime(pojo.getSetlTime(), GetDateFormat.DATE_TIME);
|
|
|
+ content[i][10] = pojo.getMedTypeName();
|
|
|
+ content[i][11] = pojo.getMedfeeSumamt();
|
|
|
+ content[i][12] = pojo.getFundPaySumamt();
|
|
|
+ content[i][13] = pojo.getAcctPay();
|
|
|
+ content[i][14] = pojo.getPsnCashPay();
|
|
|
+ content[i][15] = pojo.getClrOptinsName();
|
|
|
+ content[i][16] = pojo.getOutDeptName();
|
|
|
+ }
|
|
|
+ //传三个参数 一个是 固定的 response ,excel的头部信息,excel的内容
|
|
|
+ ExcelUtil.exportExcel(response, title, content);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|