TestController.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
  3. import com.steerinfo.dil.service.impl.TmstruckMeasureCommissionServiceImpl;
  4. import com.steerinfo.dil.service.impl.UtilsServiceImpl;
  5. import com.steerinfo.dil.util.BaseRESTfulController;
  6. import com.steerinfo.route.service.impl.RouteServiceImpl;
  7. import com.steerinfo.route.vo.Map.RouteVo;
  8. import org.junit.jupiter.api.Test;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Controller;
  11. import org.springframework.web.bind.annotation.PostMapping;
  12. import org.springframework.web.bind.annotation.RequestBody;
  13. import org.springframework.web.bind.annotation.RequestMapping;
  14. import org.springframework.web.bind.annotation.RestController;
  15. import java.util.HashMap;
  16. import java.util.Map;
  17. import java.util.concurrent.CompletableFuture;
  18. @RestController
  19. @RequestMapping("/${api.version}/Test")
  20. public class TestController extends BaseRESTfulController {
  21. @Autowired
  22. private RouteServiceImpl routeService;
  23. @Autowired
  24. private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
  25. @Autowired
  26. TmstruckMeasureCommissionServiceImpl tmstruckMeasureCommissionService;
  27. @Autowired
  28. private UtilsServiceImpl utilsService;
  29. @PostMapping("/savePath")
  30. public String savePath() throws Exception {
  31. Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2021091000000002");
  32. parem.put("turnOf","0");
  33. //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
  34. //初始化请求参数
  35. // HashMap<String,Object> mapValue=new HashMap<>();
  36. // mapValue.put("orderNumber","WYSDD2021091000000001");
  37. // mapValue.put("capacityNumber","豫SB6238");
  38. // mapValue.put("resultOutGateTime","2021-11-17 14:20:19");
  39. // mapValue.put("turnOf","0");
  40. // mapValue.put("shipperName","四川达州钢铁集团有限");
  41. // mapValue.put("receiveAddress","长沙市");
  42. return routeService.saveRoute(parem).toString();
  43. }
  44. @PostMapping("/fullPath")
  45. public Object fullPath(String orderNumber) throws Exception {
  46. //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
  47. //初始化请求参数
  48. HashMap<String,Object> mapValue=new HashMap<>();
  49. mapValue.put("orderNumber",orderNumber);
  50. return routeService.fullPathVisualization(mapValue);
  51. }
  52. @PostMapping("/addMao")
  53. public int addMaoMeasureCommission(@RequestBody(required = false) Map<String, Object> map){
  54. return tmstruckMeasureCommissionService.addMaoMeasureCommission(map);
  55. }
  56. @PostMapping("/fullPathVisualizationByCarNumber")
  57. public RouteVo fullPathVisualizationByCarNumber(@RequestBody HashMap mapValue) throws Exception {
  58. CompletableFuture<RouteVo> createOrder =routeService.fullPathVisualizationByCarNumber(mapValue);
  59. return createOrder.get();
  60. }
  61. @PostMapping("/Test")
  62. public int test(){
  63. utilsService.pushMesToWebsocket("湘M99999","排队信息");
  64. return 1;
  65. }
  66. }