LogicRPCServiceImpl.java 1.63 KB
package com.diligrp.website.rpc.impl;

import com.alibaba.fastjson.JSONObject;
import com.diligrp.website.rpc.APIClient;
import com.diligrp.website.rpc.LogicRPCService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.Map;


/**
 * <B>Description</B> 物流接口
 * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved. <br />
 * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
 * <B>Company</B> 地利集团
 *
 * @author LaiKui
 * @createTime 2016年1月5日 下午5:32:34
 */
@Service
public class LogicRPCServiceImpl implements LogicRPCService {

    private String wlHost;
    private Map<String, String> header;
    private static final Logger log = LoggerFactory.getLogger(LogicRPCServiceImpl.class);

    @Override
    public JSONObject shopLosOrdersCount(Long shopId) {
        String url = wlHost + "/api/company/pc/shop/shopLosOrdersCount";
        JSONObject object=new JSONObject();
        object.put("id",shopId);
        JSONObject res = null;
        if (shopId != null) {
            try{
                res = JSONObject.parseObject(APIClient.postJson(url, object, getHeader()));
            }catch (Exception e){
                log.error("调用物流未完结订单接口出错!");
                e.printStackTrace();
            }
        }
        return res;
    }

    public void setWlHost(String wlHost) {
        this.wlHost = wlHost;
    }

    public Map<String, String> getHeader() {
        return header;
    }

    public void setHeader(Map<String, String> header) {
        this.header = header;
    }
}