|
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.common.system.vo.DictModel;
|
|
import org.jeecg.common.system.vo.DictModel;
|
|
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.modules.medical.Constant;
|
|
import org.jeecg.modules.medical.Constant;
|
|
|
import org.jeecg.modules.medical.afterwaring.XCFYDataTransferService;
|
|
import org.jeecg.modules.medical.afterwaring.XCFYDataTransferService;
|
|
|
import org.jeecg.modules.medical.common.CommonUtil;
|
|
import org.jeecg.modules.medical.common.CommonUtil;
|
|
@@ -15,6 +16,7 @@ import org.quartz.Job;
|
|
|
import org.quartz.JobExecutionContext;
|
|
import org.quartz.JobExecutionContext;
|
|
|
import org.quartz.JobExecutionException;
|
|
import org.quartz.JobExecutionException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@@ -36,6 +38,8 @@ public class XCFYDatav_outpatient_settle_billJob implements Job {
|
|
|
JdbcTemplate jdbcTemplate;
|
|
JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
ISysDictService sysDictService;
|
|
ISysDictService sysDictService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ RedisTemplate redisTemplate;
|
|
|
|
|
|
|
|
String insertSql = "INSERT INTO outpatient_settle_bill (id, hisid, visit_no, recipe_no, pay_method, " +
|
|
String insertSql = "INSERT INTO outpatient_settle_bill (id, hisid, visit_no, recipe_no, pay_method, " +
|
|
|
"bmi_area_id, bmi_area_name, hospital_id, hospital_name, p_level_yy, benefit_type, " +
|
|
"bmi_area_id, bmi_area_name, hospital_id, hospital_name, p_level_yy, benefit_type, " +
|
|
@@ -85,6 +89,8 @@ public class XCFYDatav_outpatient_settle_billJob implements Job {
|
|
|
Integer count = xcfyDataTransferService.transferDataList(querySql, insertSql, paramMap, new TransferDataCallFunction() {
|
|
Integer count = xcfyDataTransferService.transferDataList(querySql, insertSql, paramMap, new TransferDataCallFunction() {
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean transferData(Map<String, Object> dataMap) throws Exception {
|
|
public Boolean transferData(Map<String, Object> dataMap) throws Exception {
|
|
|
|
|
+ String billDateStr = DateUtils.date2Str((Date) dataMap.get("BILL_DATE"), DateUtils.date_sdf.get());
|
|
|
|
|
+ redisTemplate.opsForHash().put(Constant.JOB_CONTINUE_PARAM, "OUTPATIENT_SETTLE_BILL", billDateStr);
|
|
|
String hisId = dataMap.get("HISID").toString();
|
|
String hisId = dataMap.get("HISID").toString();
|
|
|
Integer count = getDetailByHisId(hisId);
|
|
Integer count = getDetailByHisId(hisId);
|
|
|
if (null == count || count <= 0) {
|
|
if (null == count || count <= 0) {
|
|
@@ -182,8 +188,13 @@ public class XCFYDatav_outpatient_settle_billJob implements Job {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Date getBillDate() {
|
|
public Date getBillDate() {
|
|
|
- Date billDate = jdbcTemplate.queryForObject("select max(BILL_DATE) as id from outpatient_settlement_bill", Date.class);
|
|
|
|
|
- return billDate;
|
|
|
|
|
|
|
+// Date billDate = jdbcTemplate.queryForObject("select max(BILL_DATE) as id from outpatient_settlement_bill", Date.class);
|
|
|
|
|
+// return billDate;
|
|
|
|
|
+ Object startBillDate = redisTemplate.opsForHash().get(Constant.JOB_CONTINUE_PARAM, "OUTPATIENT_SETTLE_BILL");
|
|
|
|
|
+ if(null == startBillDate){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ return DateUtils.str2Date(startBillDate.toString(), DateUtils.date_sdf.get());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|