package com.kingdee.eas.custom.beisen.synchronouspos.osf;

import com.kingdee.bos.Context;
import com.kingdee.eas.custom.beisen.synchronouspos.handler.ExecutorCountUtil;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Map;

/**
 * description: SyncStaffManageRunnable <br>
 * date: 2025/8/11 18:43 <br>
 * author: lhbj <br>
 * version: 1.0 <br>
 */
public class SyncOrgStaffManageRunnable implements Runnable{
    private List<Map<String,Object>> listMap;
    private Context context;
    private Map<String,List<Map<String,Object>>> result;
    private ExecutorCountUtil countUtil;
    private boolean state = false;
    public SyncOrgStaffManageRunnable(Context context, List<Map<String,Object>> listMap, ExecutorCountUtil countUtil) {
        this.context=context;
        this.listMap=listMap;
        this.countUtil=countUtil;
    }
    public SyncOrgStaffManageRunnable(Context context, List<Map<String,Object>> listMap) {
        this.context=context;
        this.listMap=listMap;

    }
    public Map<String, List<Map<String, Object>>> getResult() {
        return result;
    }

    public boolean getState() {
        return state;
    }

    @Override
    public void run() {
        try {
            result = new StaffManageProcess().orgProcess(context,listMap);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }finally {
            if(null!=countUtil) {
                countUtil.countLessLess();
            }
            state=true;
        }
    }
}
