|
@@ -1,12 +1,15 @@
|
|
package org.jeecg.modules.medical.job;
|
|
package org.jeecg.modules.medical.job;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.modules.medical.Constant;
|
|
import org.jeecg.modules.medical.Constant;
|
|
|
|
+import org.jeecg.modules.medical.afterwaring.XCFYDataTransferService;
|
|
import org.jeecg.modules.medical.entity.AfterIncidentDetailLog;
|
|
import org.jeecg.modules.medical.entity.AfterIncidentDetailLog;
|
|
import org.jeecg.modules.medical.entity.AfterIncidentLog;
|
|
import org.jeecg.modules.medical.entity.AfterIncidentLog;
|
|
import org.jeecg.modules.medical.entity.HospitalizatioSettleDetail;
|
|
import org.jeecg.modules.medical.entity.HospitalizatioSettleDetail;
|
|
import org.jeecg.modules.medical.entity.MasterAdmissionBill;
|
|
import org.jeecg.modules.medical.entity.MasterAdmissionBill;
|
|
import org.jeecg.modules.medical.ruleengine.RuleEngine;
|
|
import org.jeecg.modules.medical.ruleengine.RuleEngine;
|
|
|
|
+import org.jeecg.modules.medical.ruleengine.TransferDataCallFunction;
|
|
import org.jeecg.modules.medical.service.IAfterIncidentDetailLogService;
|
|
import org.jeecg.modules.medical.service.IAfterIncidentDetailLogService;
|
|
import org.jeecg.modules.medical.service.IAfterIncidentLogService;
|
|
import org.jeecg.modules.medical.service.IAfterIncidentLogService;
|
|
import org.jeecg.modules.medical.service.IHospitalizatioSettleDetailService;
|
|
import org.jeecg.modules.medical.service.IHospitalizatioSettleDetailService;
|
|
@@ -23,11 +26,15 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 事后监管任务生成
|
|
* 事后监管任务生成
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Component
|
|
@Component
|
|
public class AfterWaringLogTestJob{
|
|
public class AfterWaringLogTestJob{
|
|
@Autowired
|
|
@Autowired
|
|
@@ -45,6 +52,11 @@ public class AfterWaringLogTestJob{
|
|
@Autowired
|
|
@Autowired
|
|
ISysUserService sysUserService;
|
|
ISysUserService sysUserService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ XCFYDataTransferService xcfyDataTransferService;
|
|
|
|
+// @Autowired
|
|
|
|
+// IMasterAdmissionBillService masterAdmissionBillService;
|
|
|
|
+
|
|
|
|
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
List<MasterAdmissionBill> masterAdmissionBillList = masterAdmissionBillService.lambdaQuery().isNull(MasterAdmissionBill::getState).last(" limit 1000").list();
|
|
List<MasterAdmissionBill> masterAdmissionBillList = masterAdmissionBillService.lambdaQuery().isNull(MasterAdmissionBill::getState).last(" limit 1000").list();
|
|
@@ -110,4 +122,40 @@ public class AfterWaringLogTestJob{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public void testMasterAdmBill() {
|
|
|
|
+ log.info("开始同步master_admission_bill数据");
|
|
|
|
+ String whereSql = "";
|
|
|
|
+ Date visitTime = getLastVisitDate();
|
|
|
|
+ log.info("开始同步master_admission_bill数据,获取上个同步记录访问日期:{}", visitTime);
|
|
|
|
+ Map<String,Object> paramMap = new HashMap<>();
|
|
|
|
+ if(null != visitTime){
|
|
|
|
+ whereSql = "where VISIT_TIME>:VISIT_TIME and rownum<1000";
|
|
|
|
+ paramMap.put("VISIT_TIME", visitTime);
|
|
|
|
+ }
|
|
|
|
+ String sql = "select * from master_admission_bill %s order by VISIT_TIME asc";
|
|
|
|
+ sql = String.format(sql, whereSql);
|
|
|
|
+ String insertSql = "INSERT INTO master_admission_bill (id, bridge_id, hisid, zyh, recipe_no, pay_method, benefit_type, hospital_id, hospital_name, p_level_yy, refund_flag, p_level, bmi_area_id, bmi_area_name, bill_date, refund_date, admission_dept_id, admission_dept_name, adm_bed, transfer_dept_id, transfer_dept_name, discharge_dept_id, discharge_dept_name, dscg_bed, doctor_id, doctor_name, patient_id, patient_name, patient_gender, patient_birthday, patient_age, patient_age_days, claim_type, visit_time, if_local_flag, admission_date, discharge_date, zyts, discharge_status, pre_admission_date, days_re_admission_31, yb_admission_disease_id, yb_admission_disease_name, yb_discharge_disease_id_main, yb_discharge_disease_name_main, admission_disease_id, admission_disease_name, discharge_disease_id_main, discharge_disease_name_main, yb_pay_type, drgs_code, drgs_name, medfee_sumamt, fulamt_ownpay_amt, overlmt_selfpay, preselfpay_amt, inscp_scp_amt, act_pay_dedc, hifp_pay, pool_prop_selfpay, cvlserv_pay, hifes_pay, hifmi_pay, hifob_pay, maf_pay, oth_pay, fund_pay_sumamt, state, create_time, create_by) " +
|
|
|
|
+ "VALUES (:ID,:BRIDGE_ID,:HISID,:ZYH,:RECIPE_NO,:PAY_METHOD,:BENEFIT_TYPE,:HOSPITAL_ID,:HOSPITAL_NAME,:P_LEVEL_YY,:REFUND_FLAG,:P_LEVEL,:BMI_AREA_ID,:BMI_AREA_NAME,:BILL_DATE,:REFUND_DATE,:ADMISSION_DEPT_ID,:ADMISSION_DEPT_NAME,:ADM_BED,:TRANSFER_DEPT_ID,:TRANSFER_DEPT_NAME,:DISCHARGE_DEPT_ID,:DISCHARGE_DEPT_NAME,:DSCG_BED,:DOCTOR_ID,:DOCTOR_NAME,:PATIENT_ID,:PATIENT_NAME,:PATIENT_GENDER,:PATIENT_BIRTHDAY,:PATIENT_AGE,:PATIENT_AGE_DAYS,:CLAIM_TYPE,:VISIT_TIME,:IF_LOCAL_FLAG,:ADMISSION_DATE,:DISCHARGE_DATE,:ZYTS,:DISCHARGE_STATUS,:PRE_ADMISSION_DATE,:DAYS_RE_ADMISSION_31,:YB_ADMISSION_DISEASE_ID,:YB_ADMISSION_DISEASE_NAME,:YB_DISCHARGE_DISEASE_ID_MAIN,:YB_DISCHARGE_DISEASE_NAME_MAIN,:ADMISSION_DISEASE_ID,:ADMISSION_DISEASE_NAME,:DISCHARGE_DISEASE_ID_MAIN,:DISCHARGE_DISEASE_NAME_MAIN,:YB_PAY_TYPE,:DRGS_CODE,:DRGS_NAME,:MEDFEE_SUMAMT,:FULAMT_OWNPAY_AMT,:OVERLMT_SELFPAY,:PRESELFPAY_AMT,:INSCP_SCP_AMT,:ACT_PAY_DEDC,:HIFP_PAY,:POOL_PROP_SELFPAY,:CVLSERV_PAY,:HIFES_PAY,:HIFMI_PAY,:HIFOB_PAY,:MAF_PAY,:OTH_PAY,:FUND_PAY_SUMAMT,:STATE,:NOW,:CREATE_BY)";
|
|
|
|
+ xcfyDataTransferService.transferDataList(sql, insertSql, paramMap, new TransferDataCallFunction() {
|
|
|
|
+ @Override
|
|
|
|
+ public void transferData(Map<String, Object> dataMap) throws Exception {
|
|
|
|
+ dataMap.put("CREATE_BY","auto");
|
|
|
|
+ dataMap.put("NOW",new Date());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public Date getLastVisitDate(){
|
|
|
|
+ List<MasterAdmissionBill> masterAdmissionBillList = masterAdmissionBillService.lambdaQuery().orderByDesc(MasterAdmissionBill::getVisitTime).last("limit 1").list();
|
|
|
|
+ if(CollectionUtil.isEmpty(masterAdmissionBillList)){
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ return masterAdmissionBillList.get(0).getVisitTime();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|