TestController.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.util.BaseRESTfulController;
  5. import com.steerinfo.route.service.impl.RouteServiceImpl;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Controller;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.RequestBody;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import java.util.HashMap;
  12. import java.util.Map;
  13. @RestController
  14. public class TestController extends BaseRESTfulController {
  15. @Autowired
  16. private RouteServiceImpl routeService;
  17. @Autowired
  18. private ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
  19. @Autowired
  20. TmstruckMeasureCommissionServiceImpl tmstruckMeasureCommissionService;
  21. @PostMapping("/savePath")
  22. public String savePath() throws Exception {
  23. Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2021091000000002");
  24. parem.put("turnOf","0");
  25. //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
  26. //初始化请求参数
  27. // HashMap<String,Object> mapValue=new HashMap<>();
  28. // mapValue.put("orderNumber","WYSDD2021091000000001");
  29. // mapValue.put("capacityNumber","豫SB6238");
  30. // mapValue.put("resultOutGateTime","2021-11-17 14:20:19");
  31. // mapValue.put("turnOf","0");
  32. // mapValue.put("shipperName","四川达州钢铁集团有限");
  33. // mapValue.put("receiveAddress","长沙市");
  34. return routeService.saveRoute(parem).toString();
  35. }
  36. @PostMapping("/fullPath")
  37. public Object fullPath(String orderNumber) throws Exception {
  38. //运输订单号:orderNumber、车牌号:capacityNumber、出厂时间:resultOutGateTime、预警开关:turnOf、发货地址:shipperName、收货地址:receiveAddress
  39. //初始化请求参数
  40. HashMap<String,Object> mapValue=new HashMap<>();
  41. mapValue.put("orderNumber",orderNumber);
  42. return routeService.fullPathVisualization(mapValue);
  43. }
  44. @PostMapping("/addMao")
  45. public int addMaoMeasureCommission(@RequestBody(required = false) Map<String, Object> map){
  46. return tmstruckMeasureCommissionService.addMaoMeasureCommission(map);
  47. }
  48. }