QmsQueueListController.java 10 KB

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