TmstruckEnfactoryResultController.java 6.3 KB

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