package com.uas.eis.controller; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.uas.eis.sdk.entity.WMSApiResult; import com.uas.eis.sdk.entity.WMSApiResultResp; import com.uas.eis.service.ERPWMSService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.io.IOException; /** * @author wuyx * @email wuyx@usoftchina.com */ @RestController public class ERPWMSController { @Autowired private ERPWMSService erpwmsService; /** * 出入库确认 * 入库订单确认 openapi.entryorder.confirm * ● http://{openapiUrl}?method=openapi.entryorder.confirm×tamp=2015-04-26%2000:00:07&format=xml&app_key={app_key}&v=2.0&sign=D06D88CB34B2EC0E5C9BAB396C9542B6&sign_method=md5&customerId={customerId} * */ @RequestMapping(value="/wms",method=RequestMethod.POST, produces = MediaType.APPLICATION_XML_VALUE) @ResponseBody public String IOConfirm(String method, HttpServletRequest request) throws IOException { WMSApiResult res = erpwmsService.IOConfirm(method, request); XmlMapper xmlMapper = new XmlMapper(); String xml = xmlMapper.writeValueAsString(res); return xml; } }