ERPWMSController.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package com.uas.eis.controller;
  2. import com.fasterxml.jackson.dataformat.xml.XmlMapper;
  3. import com.uas.eis.sdk.entity.WMSApiResult;
  4. import com.uas.eis.sdk.entity.WMSApiResultResp;
  5. import com.uas.eis.service.ERPWMSService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.http.MediaType;
  8. import org.springframework.web.bind.annotation.*;
  9. import javax.servlet.http.HttpServletRequest;
  10. import java.io.IOException;
  11. /**
  12. * @author wuyx
  13. * @email wuyx@usoftchina.com
  14. */
  15. @RestController
  16. public class ERPWMSController {
  17. @Autowired
  18. private ERPWMSService erpwmsService;
  19. /**
  20. * 出入库确认
  21. * 入库订单确认 openapi.entryorder.confirm
  22. * ● http://{openapiUrl}?method=openapi.entryorder.confirm&timestamp=2015-04-26%2000:00:07&format=xml&app_key={app_key}&v=2.0&sign=D06D88CB34B2EC0E5C9BAB396C9542B6&sign_method=md5&customerId={customerId}
  23. *
  24. */
  25. @RequestMapping(value="/wms",method=RequestMethod.POST, produces = MediaType.APPLICATION_XML_VALUE)
  26. @ResponseBody
  27. public String IOConfirm(String method, HttpServletRequest request) throws IOException {
  28. WMSApiResult res = erpwmsService.IOConfirm(method, request);
  29. XmlMapper xmlMapper = new XmlMapper();
  30. String xml = xmlMapper.writeValueAsString(res);
  31. return xml;
  32. }
  33. }