package club.newepoch.admin.job import club.newepoch.admin.service.BizPayComfirmInfoJobService import club.newepoch.iweb.jfinal.plugins.quartz.AbstractJob import cn.szqhyf.qhyffs.app.fs.ctl.FinanceGeneralLedgerController import org.quartz.JobExecutionContext import club.newepoch.utils.TaskExecuteUtils /** * 获取付款确认书信息的job * */ class BizPayComfirmInfoJob : AbstractJob() { /** * 执行job任务 */ override fun doJob(p0: JobExecutionContext?) { println("定时器打印测试数据1111111111 ------------------------") try { // 获取保理系统中,付款确认书总数(以1000条为一页) var num = BizPayComfirmInfoJobService().getBizPayComfirmInfoTotalPages() // 总数据数 var total = ( num as Int ) // 总页数(即循环的次数) var time=total/1000+1 // 每次循环循环总条数 var startIndex=0 var totalNumber = 1000 // 开始异步获取信息 TaskExecuteUtils.callMethod { for (i in 1..time){ try { BizPayComfirmInfoJobService().getBizPayComfirmInfo(startIndex,totalNumber) startIndex +=1000 totalNumber +=1000 } catch (e: Exception) { e.printStackTrace() } } } }catch (e:Exception){ logger.error("获取付款确认书信息失败",e) } } }
@Override protected void doJob(JobExecutionContext arg0) { try { //返回绿城标识uuid String paymentUuid = getService().savePaymentInfo(); if(StringUtils.notBlank(paymentUuid)) { qhyfGetLcAttachmentService = new QhyfGetLcAttachmentService(); // 开始异步获取附件 TaskExecuteUtils.callMethod(() -> { String[] paymentIds = paymentUuid.split(","); for(String paymentId: paymentIds) { try { qhyfGetLcAttachmentService.PaymentListAttachmentIAnformation(null, paymentId); }catch (Exception e){ e.printStackTrace(); } } }); } } catch (Exception e) { logger.error("接收绿城付款单数据失败", e); } }