TmsshipLoadShipResultController.java 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. package com.steerinfo.dil.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.steerinfo.dil.feign.ESFeign;
  4. import com.steerinfo.dil.model.AmsshipDeliveryAttorney;
  5. import com.steerinfo.dil.model.TmsshipLoadShipResult;
  6. import com.steerinfo.dil.model.TmsshipShipLocation;
  7. import com.steerinfo.dil.service.ITmsshipLoadShipResultService;
  8. import com.steerinfo.dil.util.BaseRESTfulController;
  9. import com.steerinfo.dil.util.ColumnDataUtil;
  10. import com.steerinfo.dil.util.DataChange;
  11. import com.steerinfo.dil.util.PageListAdd;
  12. import com.steerinfo.framework.controller.RESTfulResult;
  13. import com.steerinfo.framework.service.pagehelper.PageHelper;
  14. import com.steerinfo.framework.service.pagehelper.PageList;
  15. import com.steerinfo.framework.utils.collection.ListUtils;
  16. import io.swagger.annotations.ApiImplicitParam;
  17. import io.swagger.annotations.ApiImplicitParams;
  18. import io.swagger.annotations.ApiOperation;
  19. import org.apache.commons.lang3.StringUtils;
  20. import org.apache.shiro.authz.annotation.RequiresPermissions;
  21. import org.springframework.beans.factory.annotation.Autowired;
  22. import org.springframework.web.bind.annotation.*;
  23. import java.text.SimpleDateFormat;
  24. import java.util.*;
  25. import java.math.BigDecimal;
  26. /**
  27. * TmsshipLoadShipResult RESTful接口:
  28. * @author generator
  29. * @version 1.0-SNAPSHORT 2021-08-19 08:47
  30. * 类描述
  31. * 修订历史:
  32. * 日期:2021-08-19
  33. * 作者:generator
  34. * 参考:
  35. * 描述:TmsshipLoadShipResult RESTful接口
  36. * @see null
  37. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  38. */
  39. @RestController
  40. @RequestMapping("/${api.version}/tmsshiploadshipresults")
  41. public class TmsshipLoadShipResultController extends BaseRESTfulController {
  42. @Autowired
  43. ITmsshipLoadShipResultService tmsshipLoadShipResultService;
  44. @Autowired
  45. ColumnDataUtil columnDataUtil;
  46. @Autowired
  47. ESFeign esFeign;
  48. private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  49. /**
  50. * 新增装船作业(附带新增装船卸船)
  51. * @param map
  52. * @return
  53. */
  54. @ApiOperation(value="新增装船作业", notes="根据TmsshipLoadShipResult对象创建")
  55. @ApiImplicitParams({
  56. @ApiImplicitParam(name = "map",value = "装船作业字段",required = true,paramType = "java.util.Map")
  57. })
  58. @PostMapping("/addLoadShip")
  59. public RESTfulResult addLoadShip(@RequestBody Map<String,Object> map){
  60. try{
  61. int o = tmsshipLoadShipResultService.insertLoadShip(map);
  62. }catch (Exception e){
  63. e.printStackTrace();
  64. return failed(e.getMessage());
  65. }
  66. return success(0);
  67. }
  68. /**
  69. * 修改装船作业信息
  70. * @param map
  71. * @return
  72. */
  73. @ApiOperation(value="修改装船作业信息", notes="根据TmsshipLoadShipResult对象修改")
  74. @ApiImplicitParams({
  75. @ApiImplicitParam(name = "tmsshipLoadShipResult",value = "装船作业字段",required = true,paramType = "TmsshipLoadShipResult")
  76. })
  77. @PostMapping("/updateLoadShip")
  78. public RESTfulResult updateLoadShip(@RequestBody Map<String,Object> map) {
  79. int code = tmsshipLoadShipResultService.updateLoadShip(map);
  80. return success(code);
  81. }
  82. /**
  83. * 修改装船作业信息
  84. * @param map
  85. * @return
  86. */
  87. @ApiOperation(value="修改装船作业信息", notes="根据TmsshipLoadShipResult对象修改")
  88. @ApiImplicitParams({
  89. @ApiImplicitParam(name = "tmsshipLoadShipResult",value = "装船作业字段",required = true,paramType = "TmsshipLoadShipResult")
  90. })
  91. @PostMapping("/updateThreeSectionDetails")
  92. public RESTfulResult updateThreeSectionDetails(@RequestBody Map<String,Object> map) {
  93. int code = tmsshipLoadShipResultService.updateThreeSectionDetails(map);
  94. return success(code);
  95. }
  96. /**
  97. * 删除装船作业信息
  98. * @param resultId
  99. * @return
  100. */
  101. @ApiOperation(value="删除装船作业信息")
  102. @ApiImplicitParams({
  103. @ApiImplicitParam(name = "resultId",value = "装船作业字段",required = true,paramType = "BigDecimal")
  104. })
  105. @PostMapping("/deleteLoadShip/{resultId}")
  106. public RESTfulResult deleteLoadShip(@PathVariable("resultId") BigDecimal resultId) {
  107. int code = tmsshipLoadShipResultService.deleteLoadShip(resultId);
  108. return success(code);
  109. }
  110. /**
  111. * 查询位置作业信息
  112. * @param reusltId
  113. * @return
  114. */
  115. @ApiOperation(value="查询位置作业信息")
  116. @ApiImplicitParams({
  117. @ApiImplicitParam(name = "reusltId",value = "位置作业字段",required = true,paramType = "java.util.Map")
  118. })
  119. @PostMapping("/selectLoadShip/{reusltId}")
  120. public RESTfulResult selectLoadShip(@PathVariable("reusltId") BigDecimal reusltId) {
  121. TmsshipLoadShipResult tmsshipLoadShipResult = tmsshipLoadShipResultService.selectLoadShip(reusltId);
  122. return success(tmsshipLoadShipResult);
  123. }
  124. /**
  125. * 查询装船作业表单
  126. * @param resultId
  127. * @return
  128. */
  129. @ApiOperation(value="查询装船作业表单")
  130. @ApiImplicitParams({
  131. @ApiImplicitParam(name = "resultId",value = "位置作业字段",required = true,paramType = "java.util.Map")
  132. })
  133. @PostMapping("/getLoadShip/{resultId}")
  134. public RESTfulResult getLoadShip(@PathVariable("resultId") BigDecimal resultId) {
  135. List<Map<String,Object>> tmsshipLoadShipResult = tmsshipLoadShipResultService.getLoadShip(resultId);
  136. return success(tmsshipLoadShipResult);
  137. }
  138. /**
  139. * 展示装船作业信息列表
  140. * @param mapVal
  141. * @param pageNum
  142. * @param pageSize
  143. * @param apiId
  144. * @return
  145. */
  146. @ApiOperation(value="展示装船作业信息列表", notes="分页查询")
  147. @ApiImplicitParams({
  148. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  149. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  150. @ApiImplicitParam(name = "apiId", value = "63", required = false, dataType = "BigDecimal"),
  151. })
  152. @PostMapping(value = "/getLoadShipList")
  153. public RESTfulResult getLoadShipList(@RequestBody(required = false) Map<String,Object> mapVal,
  154. Integer pageNum,
  155. Integer pageSize,
  156. Integer apiId,
  157. Integer status,
  158. String con,
  159. String startTime,
  160. String endTime){
  161. DataChange.queryDataByDateTime(startTime, endTime, mapVal, sdfDateTime);//根据时间段查询数据
  162. //判断状态值是否为空
  163. if (status!=null){
  164. mapVal.put("status",status);
  165. }
  166. if (con!=null && !"null".equals(con)){
  167. mapVal.put("con","%" + con + "%");
  168. }
  169. List<Map<String, Object>> detailListTotal = tmsshipLoadShipResultService.selectLoadShipList(mapVal);
  170. PageHelper.startPage(pageNum, pageSize);
  171. //分页查询数据
  172. List<Map<String, Object>> columnList = tmsshipLoadShipResultService.selectLoadShipList(mapVal);
  173. PageListAdd data = columnDataUtil.tableColumnData(apiId, detailListTotal, columnList);
  174. return success(data);
  175. }
  176. }