|
|
@@ -3,10 +3,7 @@ package thyyxxk.simzfeeoprnsystm.service;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import thyyxxk.simzfeeoprnsystm.dao.SiLogDao;
|
|
|
-import thyyxxk.simzfeeoprnsystm.dao.SiMzDao;
|
|
|
-import thyyxxk.simzfeeoprnsystm.dao.SiSetldetailDao;
|
|
|
-import thyyxxk.simzfeeoprnsystm.dao.SiSetlinfoDao;
|
|
|
+import thyyxxk.simzfeeoprnsystm.dao.*;
|
|
|
import thyyxxk.simzfeeoprnsystm.dicts.*;
|
|
|
import thyyxxk.simzfeeoprnsystm.external.WebHisService;
|
|
|
import thyyxxk.simzfeeoprnsystm.pojo.*;
|
|
|
@@ -31,6 +28,7 @@ public class SiMzFeeService {
|
|
|
private final SiMzDao mzDao;
|
|
|
private final SiSetlinfoDao setlinfoDao;
|
|
|
private final SiSetldetailDao setldetailDao;
|
|
|
+ private final ScheduledDao scheduledDao;
|
|
|
private final ExecService exec;
|
|
|
private final WebHisService webHisService;
|
|
|
private final MariadbService mariadbService;
|
|
|
@@ -45,12 +43,13 @@ public class SiMzFeeService {
|
|
|
|
|
|
@Autowired
|
|
|
public SiMzFeeService(SiMzDao mzDao, SiSetlinfoDao setlinfoDao,
|
|
|
- SiSetldetailDao setldetailDao, ExecService exec,
|
|
|
+ SiSetldetailDao setldetailDao, ScheduledDao scheduledDao, ExecService exec,
|
|
|
WebHisService webHisService, MariadbService mariadbService,
|
|
|
SiLogDao logDao) {
|
|
|
this.mzDao = mzDao;
|
|
|
this.setlinfoDao = setlinfoDao;
|
|
|
this.setldetailDao = setldetailDao;
|
|
|
+ this.scheduledDao = scheduledDao;
|
|
|
this.exec = exec;
|
|
|
this.webHisService = webHisService;
|
|
|
this.mariadbService = mariadbService;
|
|
|
@@ -78,6 +77,9 @@ public class SiMzFeeService {
|
|
|
if (readCardBizType != ReadCardBizType.REGISTRATION && !p.getInsuplcAdmdvs().startsWith("43")) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "省外异地的患者请读社保卡或医保电子凭证登记!");
|
|
|
}
|
|
|
+
|
|
|
+ checkSettledButNotPay(p.getPatNo(), p.getTimes());
|
|
|
+
|
|
|
if (StringUtil.notBlank(p.getMedType())) {
|
|
|
mzDao.updateMedtype(p.getMedType(), p.getPatNo(), p.getTimes());
|
|
|
}
|
|
|
@@ -820,6 +822,18 @@ public class SiMzFeeService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void checkSettledButNotPay(String patNo, int times) {
|
|
|
+ List<SiSetlinfo> setlinfos = scheduledDao.selectSettleInfosByPatient(patNo, times);
|
|
|
+ for (SiSetlinfo item : setlinfos) {
|
|
|
+ if (null != item.getPayCount() && item.getPayCount() > 0) {
|
|
|
+ scheduledDao.updateMzSaved(item.getSetlId());
|
|
|
+ } else {
|
|
|
+ log.info("【结算ID: {}】有未支付的医保结算,发起撤销结算。", item.getSetlId());
|
|
|
+ revokeOutpatientSettlementForTask(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void test() {
|
|
|
JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.REVOKE_OUTPATIENT_SETTLEMENT, "430105", "01897");
|
|
|
JSONObject data = new JSONObject();
|