ERPController.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package com.uas.eis.controller;
  2. import com.uas.eis.service.SynaService;
  3. import io.xlate.edi.schema.EDISchemaException;
  4. import io.xlate.edi.stream.EDIStreamException;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import org.springframework.web.bind.annotation.RestController;
  9. import java.io.IOException;
  10. import java.util.HashMap;
  11. import java.util.Map;
  12. @RestController
  13. public class ERPController {
  14. @Autowired
  15. private SynaService synaService;
  16. @RequestMapping(value="/erp/sendPurchase")
  17. @ResponseBody
  18. public Map<String, Object> sendPurchase(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException {
  19. return synaService.sendPurchaseToSyna(master,id);
  20. }
  21. @RequestMapping(value="/erp/sendPurchaseChange")
  22. @ResponseBody
  23. public Map<String, Object> sendPurchaseChange(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException {
  24. return synaService.sendPurchaseChangeToSyna(master,id);
  25. }
  26. @RequestMapping(value="/erp/sendPOS")
  27. @ResponseBody
  28. public Map<String, Object> sendPOS(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException {
  29. return synaService.sendPosToSyna(master,id);
  30. }
  31. @RequestMapping(value="/erp/sendINV")
  32. @ResponseBody
  33. public Map<String, Object> sendINV(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException {
  34. return synaService.sendInvToSyna(master,id);
  35. }
  36. @RequestMapping(value="/erp/testEIS")
  37. @ResponseBody
  38. public Map<String, Object> testEIS(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException {
  39. Map<String, Object> modelMap = new HashMap<String, Object>();
  40. modelMap.put("master", master);
  41. modelMap.put("success", true);
  42. return modelMap;
  43. }
  44. }