package com.ecep.contract.task;

import com.ecep.contract.MessageHolder;
import com.ecep.contract.SpringApp;
import com.ecep.contract.WebSocketClientTasker;
import com.ecep.contract.WebSocketClientService;
import com.ecep.contract.service.YongYouU8Service;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 合同同步任务
 */
public class ContractSyncTask extends Tasker<Object> implements WebSocketClientTasker {
    private static final Logger logger = LoggerFactory.getLogger(ContractSyncTask.class);

    private YongYouU8Service yongYouU8Service;

    private YongYouU8Service getYongYouU8Service() {
        if (yongYouU8Service == null) {
            yongYouU8Service = SpringApp.getBean(YongYouU8Service.class);
        }
        return yongYouU8Service;
    }

    public String getTaskName() {
        return "ContractSyncTask";
    }

    @Override
    public void updateProgress(long current, long total) {
        super.updateProgress(current, total);
    }

    @Override

    protected Object execute(MessageHolder holder) throws Exception {
        updateTitle("用友U8系统-同步合同");
        return callRemoteTask(holder, getLocale());
    }

}
