TmstruckEnfactoryResultController.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.feign.ESFeign;
  3. import com.steerinfo.dil.service.ITmstruckEnfactoryResultService;
  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.HashMap;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * TmstruckEnfactoryResult RESTful接口:
  21. * @author generator
  22. * @version 1.0-SNAPSHORT 2021-09-08 06:23
  23. * 类描述
  24. * 修订历史:
  25. * 日期:2021-09-08
  26. * 作者:TXF
  27. * 参考:
  28. * 描述:TmstruckEnfactoryResult RESTful接口
  29. * @see null
  30. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  31. */
  32. @RestController
  33. @RequestMapping("/${api.version}/tmstruckenfactoryresults")
  34. public class TmstruckEnfactoryResultController extends BaseRESTfulController {
  35. @Autowired
  36. ITmstruckEnfactoryResultService tmstruckEnfactoryResultService;
  37. @Autowired
  38. ESFeign esFeign;
  39. @Autowired
  40. ColumnDataUtil columnDataUtil;
  41. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  42. @ApiOperation(value="查询所有的进厂实绩")
  43. @ApiImplicitParams({
  44. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  45. @ApiImplicitParam(name = "apiId(220)", value = "动态表头", required = false, dataType = "Integer"),
  46. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  47. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  48. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  49. })
  50. @PostMapping("/getAllEnFactoryResult")
  51. public RESTfulResult getAllEnFactoryResult(@RequestBody(required=false) Map<String,Object> mapValue,
  52. Integer apiId,
  53. Integer pageNum,
  54. Integer pageSize,
  55. Integer orderType,
  56. String startTime,
  57. String endTime,
  58. String userId,
  59. String userIds
  60. ){
  61. DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
  62. if (userId!=null){
  63. mapValue.put("userId",userId);
  64. }
  65. if (userIds!=null){
  66. mapValue.put("userIds",userIds);
  67. }
  68. if (orderType!=null){
  69. mapValue.put("orderTypee", orderType);
  70. }
  71. PageHelper.startPage(pageNum,pageSize);
  72. //分页数据
  73. List<Map<String, Object>> enFactoryResult = tmstruckEnfactoryResultService.getAllEnFactoryResult(mapValue);
  74. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,enFactoryResult);
  75. return success(pageList);
  76. }
  77. @ApiOperation(value="通过PDA添加进厂实绩")
  78. @ApiImplicitParams({
  79. @ApiImplicitParam(name = "mapValue", value = "门岗名称 运输订单号", required = false, dataType = "Map"),
  80. })
  81. @PostMapping("/enFactoryResultByPDA")
  82. public RESTfulResult enFactoryResultByPDA(@RequestBody(required=false) Map<String,Object> mapValue){
  83. int i = 0;
  84. try {
  85. i = tmstruckEnfactoryResultService.enFactoryResultByPDA(mapValue);
  86. } catch (Exception e) {
  87. return failed(e.getMessage());
  88. }
  89. return success(i);
  90. }
  91. @ApiOperation(value="通过门禁进厂")
  92. @ApiImplicitParams({
  93. @ApiImplicitParam(name = "mapValue", value = "门岗名称 运输订单号 车牌号 进厂时间", required = false, dataType = "Map"),
  94. })
  95. @PostMapping("/enFactoryResultByMJ")
  96. public RESTfulResult enFactoryResultByMJ(@RequestBody(required=false) Map<String,Object> mapValue){
  97. int i = tmstruckEnfactoryResultService.enFactoryResultByMJ(mapValue);
  98. return success(i);
  99. }
  100. @ApiOperation(value="新增进厂作业实绩:oms远程调用")
  101. @ApiImplicitParams({
  102. @ApiImplicitParam(name = "mapValue", value = "总实绩Id、线路起点", required = false, dataType = "Map"),
  103. })
  104. @PostMapping("/addEnFactoryResult")
  105. public RESTfulResult addEnFactoryResult(@RequestBody(required=false) Map<String,Object> mapValue){
  106. int i = tmstruckEnfactoryResultService.addEnFactoryResult(mapValue);
  107. return success(i);
  108. }
  109. @ApiOperation(value="通过运输订单id查询物资信息")
  110. @ApiImplicitParams({
  111. @ApiImplicitParam(name = "orderId", value = "运输订单id", required = false, dataType = "Integer"),
  112. })
  113. @GetMapping("/getMaterial")
  114. public RESTfulResult getMaterial(Integer orderId){
  115. List<Map<String, Object>> material = tmstruckEnfactoryResultService.getMaterial(orderId);
  116. return success(material);
  117. }
  118. @ApiOperation(value="APP查询进厂实绩")
  119. @PostMapping("/getEnfactoryResultList")
  120. public RESTfulResult getEnfactoryResultList() {
  121. List<Map<String,Object>> mapList = tmstruckEnfactoryResultService.getEnfactoryResultList();
  122. return success(mapList);
  123. }
  124. @ApiOperation(value="APP通过运输订单id查询进厂实绩")
  125. @PostMapping("/getEnfactoryMessageByOrderId")
  126. public RESTfulResult getEnfactoryMessageByOrderId(@RequestParam String orderNumber) {
  127. List<Map<String,Object>> mapList = tmstruckEnfactoryResultService.getEnfactoryMessageByOrderId(orderNumber);
  128. return success(mapList);
  129. }
  130. @ApiOperation(value="更新进厂实绩")
  131. @PostMapping("/updateEnSge")
  132. public int updateEnSge() {
  133. int i = tmstruckEnfactoryResultService.updateEnSge();
  134. return i;
  135. }
  136. }