package com.uas.eis.controller; import com.uas.eis.service.SynaService; import io.xlate.edi.schema.EDISchemaException; import io.xlate.edi.stream.EDIStreamException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; import java.util.HashMap; import java.util.Map; @RestController public class ERPController { @Autowired private SynaService synaService; @RequestMapping(value="/erp/sendPurchase") @ResponseBody public Map sendPurchase(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException { return synaService.sendPurchaseToSyna(master,id); } @RequestMapping(value="/erp/sendPurchaseChange") @ResponseBody public Map sendPurchaseChange(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException { return synaService.sendPurchaseChangeToSyna(master,id); } @RequestMapping(value="/erp/sendPOS") @ResponseBody public Map sendPOS(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException { return synaService.sendPosToSyna(master,id); } @RequestMapping(value="/erp/sendINV") @ResponseBody public Map sendINV(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException { return synaService.sendInvToSyna(master,id); } @RequestMapping(value="/erp/testEIS") @ResponseBody public Map testEIS(String master,Integer id) throws EDISchemaException, EDIStreamException, IOException { Map modelMap = new HashMap(); modelMap.put("master", master); modelMap.put("success", true); return modelMap; } }