package com.jeequan.jeepay.pay.task;


import com.jeequan.jeepay.pay.service.TransferOrderReissueService;
import com.jeequan.jeepay.service.impl.TransferOrderService;
import com.jeequan.jeepay.thirdparty.channel.alipay.AliAqfV2Service;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class AqfSettlementDataTask {

    @Autowired
    private TransferOrderService transferOrderService;

    @Autowired private TransferOrderReissueService transferOrderReissueService;

    @Autowired
    private AliAqfV2Service aliAqfV2Service;

    @XxlJob("aqfSettlementDataTaskHandler")
    public void start() {
        log.info("定时执行安全发代付代结算信息！");
//        List<TransferOrderEntity> transferOrderList = transferOrderService.list(TransferOrderEntity.gw().eq(TransferOrderEntity::getState, TransferOrderEntity.STATE_INIT).eq(TransferOrderEntity::getIfCode, CS.IF_CODE.ALIAQF));
//        if (!transferOrderList.isEmpty()){
//            for (TransferOrderEntity transferOrder : transferOrderList) {
//                //将金额参数改为string类型
//                ChannelRetMsg retMsg = aliAqfV2Service.transUniTransfer(transferOrder);
//                transferOrderReissueService.processChannelMsg(retMsg, transferOrder);
//            }
//        }
    }
}
