package com.weaver.seconddev.chapanda.beisen.esb;

import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.chapanda.beisen.util.Esb2BeisenAssessUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;

@Service("Esb2BeisenAssessCronJob")
public class Esb2BeisenAssessCronJob implements EsbServerlessRpcRemoteInterface {
    private final static Logger log = LoggerFactory.getLogger(Esb2BeisenAssessCronJob.class);

    @Autowired
    Esb2BeisenAssessUtil esb2BeisenAssessUtil;

    @Override
    public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {

        String emails = String.valueOf(params.get("emails"));
        log.error("emails:{}",emails);
        esb2BeisenAssessUtil.queryAssessData(emails);

        Map<String, Object> actionMap = new HashMap<String, Object>();
        actionMap.put("code",200);
        actionMap.put("msg","同步成功");
        return WeaResult.success(actionMap);
    }


}
