TmstruckLeaveFactoryResultController.java 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.feign.ESFeign;
  3. import com.steerinfo.dil.service.ITmstruckLeaveFactoryResultService;
  4. import com.steerinfo.dil.util.BaseRESTfulController;
  5. import com.steerinfo.dil.util.ColumnDataUtil;
  6. import com.steerinfo.dil.util.DataChange;
  7. import com.steerinfo.dil.util.PageListAdd;
  8. import com.steerinfo.framework.controller.RESTfulResult;
  9. import com.steerinfo.framework.service.pagehelper.PageHelper;
  10. import io.swagger.annotations.ApiImplicitParam;
  11. import io.swagger.annotations.ApiImplicitParams;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. import java.text.SimpleDateFormat;
  16. import java.util.List;
  17. import java.util.Map;
  18. /**
  19. * TmstruckLeaveFactoryResult RESTful接口:
  20. * @author generator
  21. * @version 1.0-SNAPSHORT 2021-09-11 10:32
  22. * 类描述
  23. * 修订历史:
  24. * 日期:2021-09-11
  25. * 作者:TXF
  26. * 参考:
  27. * 描述:TmstruckLeaveFactoryResult RESTful接口
  28. * @see null
  29. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  30. */
  31. @RestController
  32. @RequestMapping("/${api.version}/tmstruckleavefactoryresults")
  33. public class TmstruckLeaveFactoryResultController extends BaseRESTfulController {
  34. @Autowired
  35. ITmstruckLeaveFactoryResultService tmstruckLeaveFactoryResultService;
  36. @Autowired
  37. ESFeign esFeign;
  38. @Autowired
  39. ColumnDataUtil columnDataUtil;
  40. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  41. @ApiOperation(value="新增汽车出厂实绩:oms远程调用")
  42. @ApiImplicitParams({
  43. @ApiImplicitParam(name = "mapValue", value = "总实绩ID、线路终点", required = false, dataType = "Map"),
  44. })
  45. @PostMapping("/addLeaveFactory")
  46. public RESTfulResult addLeaveFactory(@RequestBody(required=false) Map<String,Object> mapValue){
  47. int i = tmstruckLeaveFactoryResultService.addLeaveFactory(mapValue);
  48. return success(i);
  49. }
  50. @ApiOperation(value="查询出厂实绩")
  51. @ApiImplicitParams({
  52. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  53. @ApiImplicitParam(name = "apiId(110)", value = "动态表头", required = false, dataType = "Integer"),
  54. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  55. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  56. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  57. })
  58. @PostMapping("/getLeaveFactoryResult")
  59. public RESTfulResult getLeaveFactoryResult(@RequestBody(required=false) Map<String,Object> mapValue,
  60. Integer apiId,
  61. Integer pageNum,
  62. Integer pageSize,
  63. Integer orderType,
  64. String con,
  65. String carrierSsoId,
  66. String userId,
  67. String userIds,
  68. String startTime,
  69. String endTime){
  70. if (userId!=null){
  71. mapValue.put("userId",userId);
  72. }
  73. if (userIds!=null){
  74. mapValue.put("userIds",userIds);
  75. }
  76. if (orderType!=null) {
  77. mapValue.put("orderTypee", orderType);
  78. }
  79. if(carrierSsoId != null){
  80. if(!"null".equals(carrierSsoId)){
  81. mapValue.put("carrierSsoId", carrierSsoId);
  82. }
  83. }
  84. if(con!=null&&con.equals("undefined")){
  85. mapValue.put("con","%"+con+"%");
  86. }
  87. DataChange.queryDataByDateTime(startTime,endTime,mapValue,sdfDateTime);
  88. PageHelper.startPage(pageNum,pageSize);
  89. //分页数据
  90. List<Map<String, Object>> leaveFactoryResult = tmstruckLeaveFactoryResultService.getLeaveFactoryResult(mapValue);
  91. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,leaveFactoryResult);
  92. return success(pageList);
  93. }
  94. @ApiOperation(value="PAD扫描汽车出厂实绩")
  95. @ApiImplicitParams({
  96. @ApiImplicitParam(name = "mapValue", value = "", required = false, dataType = "Map"),
  97. @ApiImplicitParam(name = "orderNumber", value = "", required = false, dataType = "String"),
  98. })
  99. @PostMapping("/addLeaveFactoryResult")
  100. public RESTfulResult addLeaveFactoryResult(@RequestBody(required=false) Map<String,Object> mapValue){
  101. //中交新路接口
  102. // Map<String, Object> parem=tmstruckLeaveFactoryResultService.getTruckFactoryResult("WYSDD2021091000000002");
  103. // parem.put("turnOf","0");
  104. // routeService.saveRoute(parem);
  105. int leaveFactory = 0;
  106. try {
  107. leaveFactory = tmstruckLeaveFactoryResultService.leaveFactoryByPDA(mapValue);
  108. }catch (Exception e){
  109. return failed(e.getMessage());
  110. }
  111. return success(leaveFactory);
  112. }
  113. @ApiOperation(value="APP查询汽车出厂实绩")
  114. @PostMapping("/getLeaveFactoryList")
  115. public RESTfulResult getLeaveFactoryList(@RequestParam String orderNumber) {
  116. List<Map<String,Object>> mapList = tmstruckLeaveFactoryResultService.getLeaveFactoryList(orderNumber);
  117. return success(mapList);
  118. }
  119. }