| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.sap.service.OrderBomSync; |
| | | import org.jeecg.modules.sap.service.OrderProcessSync; |
| | | import org.jeecg.modules.sap.service.ProductionOrderSync; |
| | | import org.jeecg.modules.sap.service.SAPService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RequestMapping("/sap/client") |
| | | @Slf4j |
| | | public class SAPTestController { |
| | | @Autowired |
| | | private SAPService sapService; |
| | | //新火炬工厂编码 |
| | | private static final String factoryCode = "2301"; |
| | | //标准生产订单 |
| | | private static final String orderTypeCode1 = "Z001"; |
| | | //返工订单 暂时不用 |
| | | private static final String orderTypeCode2 = "Z002"; |
| | | //八分厂调度员 |
| | | // private static final String productionManager = "012"; |
| | | private static final String productionManager = "010"; |
| | | //生产订单状态 CRTD 新建,REL 下达,TECO 关闭 实际上,只有REL状态的工单才可以进行操作 |
| | | private static final String orderStatus = "REL"; |
| | | |
| | | private static final String createTime = "20250508"; |
| | | private static final String updateTime = "20250101"; |
| | | // @Autowired |
| | | // private SAPService sapService; |
| | | @Autowired |
| | | private ProductionOrderSync productionOrderSync; |
| | | @Autowired |
| | | private OrderBomSync orderBomSync; |
| | | @Autowired |
| | | private OrderProcessSync orderProcessSync; |
| | | |
| | | @ApiOperation(value = "SAP集成测试-测试接口", notes = "SAP集成测试-测试接口") |
| | | @GetMapping("/test") |
| | | public Result<?> test() { |
| | | String test = sapService.test(); |
| | | return Result.ok(test); |
| | | } |
| | | // @ApiOperation(value = "SAP集成测试-测试接口", notes = "SAP集成测试-测试接口") |
| | | // @GetMapping("/test") |
| | | // public Result<?> test() { |
| | | // String test = sapService.test(); |
| | | // return Result.ok(test); |
| | | // } |
| | | |
| | | @ApiOperation(value = "SAP集成测试-生产订单同步接口", notes = "SAP集成测试-生产订单同步接口") |
| | | @GetMapping("/syncProductionOrder") |
| | | public Result<?> syncProductionOrder() throws Exception { |
| | | Map<String, Object> resultMap = productionOrderSync.syncProductionOrder(); |
| | | Map<String, Object> resultMap = productionOrderSync.syncProductionOrder(factoryCode, orderTypeCode1, productionManager, orderStatus, createTime, null); |
| | | return Result.ok(resultMap); |
| | | } |
| | | |
| | | @ApiOperation(value = "SAP集成测试-订单BOM同步", notes = "SAP集成测试-订单BOM同步") |
| | | @GetMapping("/syncOrderBom") |
| | | public Result<?> syncOrderBom() throws Exception { |
| | | String orderCode = "10706312,10706988,10708077,10708078,10708825,10711404,10711404,10711543"; |
| | | Map<String, Object> resultMap = orderBomSync.syncOrderBom(factoryCode, orderCode); |
| | | return Result.ok(resultMap); |
| | | } |
| | | |
| | | @ApiOperation(value = "SAP集成测试-订单工序同步", notes = "SAP集成测试-订单工序同步") |
| | | @GetMapping("/syncOrderProcess") |
| | | public Result<?> syncOrderProcess() throws Exception { |
| | | String orderCode = "10706312,10706988,10708077,10708078,10708825,10711404,10711404,10711543"; |
| | | Map<String, Object> resultMap = orderProcessSync.syncOrderProcess(factoryCode, orderCode); |
| | | return Result.ok(resultMap); |
| | | } |
| | | } |