package com.steerinfo.dil.controller; import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService; import com.steerinfo.dil.service.impl.TmstruckMeasureCommissionServiceImpl; import com.steerinfo.dil.service.impl.UtilsServiceImpl; import com.steerinfo.dil.util.BaseRESTfulController; import com.steerinfo.route.service.impl.RouteServiceImpl; import com.steerinfo.route.vo.Map.RouteVo; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.Map; import java.util.concurrent.CompletableFuture; @RestController @RequestMapping("/${api.version}/Test") public class TestController extends BaseRESTfulController { @Autowired private RouteServiceImpl routeService; @Autowired private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService; @Autowired TmstruckMeasureCommissionServiceImpl tmstruckMeasureCommissionService; @Autowired private UtilsServiceImpl utilsService; @PostMapping("/savePath") public String savePath() throws Exception { Map parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2021091000000002"); parem.put("turnOf","0"); //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress //初始化请求参数 // HashMap mapValue=new HashMap<>(); // mapValue.put("orderNumber","WYSDD2021091000000001"); // mapValue.put("capacityNumber","豫SB6238"); // mapValue.put("resultOutGateTime","2021-11-17 14:20:19"); // mapValue.put("turnOf","0"); // mapValue.put("shipperName","四川达州钢铁集团有限"); // mapValue.put("receiveAddress","长沙市"); return routeService.saveRoute(parem).toString(); } @PostMapping("/fullPath") public Object fullPath(String orderNumber) throws Exception { //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress //初始化请求参数 HashMap mapValue=new HashMap<>(); mapValue.put("orderNumber",orderNumber); return routeService.fullPathVisualization(mapValue); } @PostMapping("/addMao") public int addMaoMeasureCommission(@RequestBody(required = false) Map map){ return tmstruckMeasureCommissionService.addMaoMeasureCommission(map); } @PostMapping("/fullPathVisualizationByCarNumber") public RouteVo fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception { CompletableFuture createOrder =routeService.fullPathVisualizationByCarNumber(mapValue); return createOrder.get(); } @PostMapping("/Test") public int test(){ utilsService.pushMesToWebsocket("湘M99999","排队信息"); return 1; } }