QmsQueueListController.java 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.feign.ESFeign;
  3. import com.steerinfo.dil.service.impl.QmsQueueListServiceImpl;
  4. import com.steerinfo.dil.util.BaseRESTfulController;
  5. import com.steerinfo.dil.util.ColumnDataUtil;
  6. import com.steerinfo.dil.util.PageListAdd;
  7. import com.steerinfo.framework.controller.RESTfulResult;
  8. import com.steerinfo.framework.service.pagehelper.PageHelper;
  9. import io.swagger.annotations.ApiImplicitParam;
  10. import io.swagger.annotations.ApiImplicitParams;
  11. import io.swagger.annotations.ApiOperation;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.*;
  14. import java.util.*;
  15. import java.math.BigDecimal;
  16. /**
  17. * QmsQueueList RESTful接口:
  18. * @author generator
  19. * @version 1.0-SNAPSHORT 2021-09-14 11:29
  20. * 类描述
  21. * 修订历史:
  22. * 日期:2021-09-14
  23. * 作者:generator
  24. * 参考:
  25. * 描述:QmsQueueList RESTful接口
  26. * @see null
  27. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  28. */
  29. @RestController
  30. @RequestMapping("/${api.version}/qmsqueuelists")
  31. public class QmsQueueListController extends BaseRESTfulController {
  32. @Autowired
  33. QmsQueueListServiceImpl qmsQueueListService;
  34. @Autowired
  35. ColumnDataUtil columnDataUtil;
  36. @Autowired
  37. ESFeign esFeign;
  38. @ApiOperation(value="指令接收-->新增排队链表:需要运输订单号")
  39. @ApiImplicitParams({
  40. @ApiImplicitParam(name = "mapValue", value = "", required = false, dataType = "Map"),
  41. })
  42. @PostMapping("/addQueueList")
  43. public RESTfulResult addQueueList(String orderId){
  44. int i = qmsQueueListService.addQueueList(new BigDecimal(orderId));
  45. if(i == 0){
  46. return failed("该车已有排队!");
  47. }
  48. return success(i);
  49. }
  50. @ApiOperation(value="排队转移-->新增排队链表:实绩Id、门岗或月台、转移原因")
  51. @ApiImplicitParams({
  52. @ApiImplicitParam(name = "mapValue", value = "实绩Id、门岗或月台、转移原因", required = false, dataType = "Map"),
  53. })
  54. @PostMapping("/changeQueue")
  55. public RESTfulResult changeQueue(@RequestBody(required=false) Map<String, Object> mapValue){
  56. int i = qmsQueueListService.changeQueue(mapValue);
  57. return success(i);
  58. }
  59. @ApiOperation(value="排队取消-->修改排队链表deleted为1")
  60. @ApiImplicitParams({
  61. @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
  62. })
  63. @PostMapping("/queueCancel")
  64. public RESTfulResult queueCancel(@RequestBody(required=false) Map<String, Object> mapValue){
  65. int i = qmsQueueListService.queueCancel(mapValue);
  66. return success(i);
  67. }
  68. @ApiOperation(value="排队插队-->修改排队链表顺序号为最小")
  69. @ApiImplicitParams({
  70. @ApiImplicitParam(name = "mapValue", value = "运输订单号或者网格排队实绩ID取一个就行、插队原因", required = false, dataType = "Map"),
  71. })
  72. @PostMapping("/queueCutInLine")
  73. public RESTfulResult queueCutInLine(@RequestBody(required=false) Map<String, Object> mapValue){
  74. int i = qmsQueueListService.queueCutInLine(mapValue);
  75. return success(i);
  76. }
  77. @ApiOperation(value="排队结束-->修改deleted = 1:运输订单号 或者 网格排队实绩 ID 取一个就行")
  78. @ApiImplicitParams({
  79. @ApiImplicitParam(name = "mapValue", value = "运输订单号或者网格排队实绩ID取一个就行", required = false, dataType = "Map"),
  80. })
  81. @PostMapping("/queueEndByPDA")
  82. public RESTfulResult queueEnd(String resultTotalId){
  83. int i = qmsQueueListService.queueEndByPDA(new BigDecimal(resultTotalId));
  84. return success(i);
  85. }
  86. @ApiOperation(value="链表监控")
  87. @ApiImplicitParams({
  88. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  89. @ApiImplicitParam(name = "apiId(134)", value = "动态表头", required = false, dataType = "Integer"),
  90. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  91. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  92. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  93. })
  94. @PostMapping("/listMonitor")
  95. public RESTfulResult listMonitor(@RequestBody(required=false) Map<String,Object> mapValue,
  96. Integer apiId,
  97. Integer pageNum,
  98. Integer pageSize,
  99. String con
  100. ){
  101. if(con != null && !"".equals(con) && !"null".equals(con)){
  102. mapValue.put("index", con);
  103. }
  104. PageHelper.startPage(pageNum,pageSize);
  105. //分页数据
  106. List<Map<String, Object>> allListMonitor = qmsQueueListService.listMonitor(mapValue);
  107. List<Map<String, Object>> listMonitor = new ArrayList<>(allListMonitor);
  108. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allListMonitor,listMonitor);
  109. return success(pageList);
  110. }
  111. @ApiOperation(value="仓库排队结束-->修改deleted = 1:运输订单号 或者 网格排队实绩 ID 取一个就行")
  112. @ApiImplicitParams({
  113. @ApiImplicitParam(name = "mapValue", value = "运输订单号或者网格排队实绩ID取一个就行", required = false, dataType = "Map"),
  114. })
  115. @PostMapping("/queueEndWarehouse")
  116. public RESTfulResult queueEndWarehouse(@RequestBody(required=false) Map<String, Object> mapValue){
  117. int i = qmsQueueListService.queueEndWarehouse(mapValue);
  118. return success(i);
  119. }
  120. @ApiOperation(value="仓库链表监控")
  121. @ApiImplicitParams({
  122. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  123. @ApiImplicitParam(name = "apiId(134)", value = "动态表头", required = false, dataType = "Integer"),
  124. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  125. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  126. @ApiImplicitParam(name = "con", value = "索引", required = false, dataType = "String"),
  127. })
  128. @PostMapping("/warehouseListMonitor")
  129. public RESTfulResult warehouseListMonitor(@RequestBody(required=false) Map<String,Object> mapValue,
  130. Integer apiId,
  131. Integer pageNum,
  132. Integer pageSize,
  133. String con
  134. ){
  135. if(con != null){
  136. if(!"undefined".equals(con)){
  137. //设置要查询的索引名称
  138. String index="get_warehouse_list_monitor";
  139. //获取查询结果
  140. return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
  141. }
  142. }
  143. List<Map<String, Object>> allListMonitor = null;
  144. //如果有条件查询则跳过初始化,和创建索引
  145. if(mapValue.size() == 0){
  146. //将查询结果存入索引中
  147. allListMonitor = qmsQueueListService.warehouseListMonitor(mapValue);
  148. Map<String, Object> map = new HashMap<>();
  149. //添加索引
  150. map.put("index","get_warehouse_list_monitor");
  151. //添加id
  152. map.put("indexId","warehouselistId");
  153. allListMonitor.add(map);
  154. //新建索引
  155. esFeign.insertIndex(allListMonitor);
  156. //删除
  157. allListMonitor.remove(allListMonitor.size()-1);
  158. }
  159. if(allListMonitor == null)
  160. allListMonitor = qmsQueueListService.warehouseListMonitor(mapValue);
  161. PageHelper.startPage(pageNum,pageSize);
  162. //分页数据
  163. List<Map<String, Object>> listMonitor = qmsQueueListService.warehouseListMonitor(mapValue);
  164. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allListMonitor,listMonitor);
  165. return success(pageList);
  166. }
  167. @ApiOperation(value="查询某一个门岗的排队详情")
  168. @ApiImplicitParams({
  169. @ApiImplicitParam(name = "mapValue", value = "网格Id", required = false, dataType = "Map"),
  170. })
  171. @PostMapping("/getListQueueMes")
  172. public RESTfulResult getListQueueMes(@RequestBody(required=false) Map<String, Object> mapValue){
  173. return success(qmsQueueListService.getListQueueMes(mapValue));
  174. }
  175. @ApiOperation(value="钢材科允许进厂")
  176. @ApiImplicitParams({
  177. @ApiImplicitParam(name = "mapValue", value = "网格Id", required = false, dataType = "Map"),
  178. })
  179. @PostMapping("/allowEnFactory")
  180. public RESTfulResult allowEnFactory(@RequestBody(required=false) Map<String, Object> mapValue){
  181. return success(qmsQueueListService.allowEnFactory(mapValue));
  182. }
  183. }