package com.cim.idm.mwmsextend.webservice.service.impl;

import javax.jws.WebService;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.cim.idm.mwmsextend.webservice.service.MaterialBomService;
import com.cim.idm.wmspackage.supplier.management.data.Supplier;



@WebService(serviceName = "MaterialBomService",
			targetNamespace = "http://service.idm.cim.com")
@Component
public class MaterialBomServiceImpl implements MaterialBomService {
	private static Log log = LogFactory.getLog(MaterialBomServiceImpl.class);
	@Override
	public String materialBomService(String json) {
		log.info("hello " + json);
		JSONObject jsonObject =(JSONObject)JSONObject.parse(json);
		String id = jsonObject.getString("LIFNR");
		String name = jsonObject.getString("SORT1");
		Supplier supplier = new	Supplier();
		supplier.setSupplierName(id);
		supplier.setAddress(name);
		
		return "hello " + JSONObject.toJSONString(supplier);
	}

}
