DilBatchController.java 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. package com.steerinfo.dil.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.steerinfo.dil.feign.ESFeign;
  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 com.steerinfo.framework.service.pagehelper.PageList;
  10. import com.steerinfo.framework.utils.collection.ListUtils;
  11. import com.steerinfo.dil.model.DilBatch;
  12. import com.steerinfo.dil.service.IDilBatchService;
  13. import io.swagger.annotations.ApiImplicitParam;
  14. import io.swagger.annotations.ApiImplicitParams;
  15. import io.swagger.annotations.ApiOperation;
  16. import org.apache.commons.lang3.AnnotationUtils;
  17. import org.apache.commons.lang3.StringUtils;
  18. import org.apache.shiro.authz.annotation.RequiresPermissions;
  19. import org.springframework.beans.factory.annotation.Autowired;
  20. import org.springframework.web.bind.annotation.*;
  21. import java.util.*;
  22. import java.math.BigDecimal;
  23. /**
  24. * DilBatch RESTful接口:
  25. * @author generator
  26. * @version 1.0-SNAPSHORT 2021-11-06 10:22
  27. * 类描述
  28. * 修订历史:
  29. * 日期:2021-11-06
  30. * 作者:generator
  31. * 参考:
  32. * 描述:DilBatch RESTful接口
  33. * @see null
  34. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  35. */
  36. @RestController
  37. @RequestMapping("/${api.version}/dilbatchs")
  38. public class DilBatchController extends BaseRESTfulController {
  39. @Autowired
  40. IDilBatchService dilBatchService;
  41. @Autowired
  42. ESFeign esFeign;
  43. @Autowired
  44. ColumnDataUtil columnDataUtil;
  45. @ApiOperation(value="批次展示列表", notes="分页查询")
  46. @ApiImplicitParams({
  47. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  48. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  49. @ApiImplicitParam(name = "apiId", value = "375", required = false, dataType = "Integer")
  50. })
  51. @PostMapping("/getBatchList")
  52. public RESTfulResult getBatchList(@RequestBody(required = false) Map<String, Object> mapValue,
  53. Integer pageNum,
  54. Integer pageSize,
  55. Integer apiId) {
  56. List<Map<String, Object>> listTotal = dilBatchService.getBatchList(mapValue);
  57. PageHelper.startPage(pageNum, pageSize);
  58. //分页查询数据
  59. List<Map<String, Object>> columnList = dilBatchService.getBatchList(mapValue);
  60. PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
  61. return success(data);
  62. }
  63. @ApiOperation(value="为提货委托查询批次展示列表", notes="分页查询")
  64. @ApiImplicitParams({
  65. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  66. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  67. @ApiImplicitParam(name = "apiId", value = "375", required = false, dataType = "Integer")
  68. })
  69. @PostMapping("/getBatchListForAttorney")
  70. public RESTfulResult getBatchListForAttorney(@RequestBody(required = false) Map<String, Object> mapValue,
  71. Integer pageNum,
  72. Integer pageSize,
  73. Integer apiId,
  74. String con) {
  75. if (mapValue==null){
  76. mapValue=new HashMap<>();
  77. }
  78. mapValue.put("con",con);
  79. List<Map<String, Object>> listTotal = dilBatchService.getBatchListFortTransfer(mapValue);
  80. PageHelper.startPage(pageNum, pageSize);
  81. //分页查询数据
  82. List<Map<String, Object>> columnList = dilBatchService.getBatchListFortTransfer(mapValue);
  83. PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
  84. return success(data);
  85. }
  86. @PostMapping("/getBatchListForInstruction")
  87. public RESTfulResult getBatchListForInstruction(@RequestBody(required = false) Map<String, Object> mapValue,
  88. Integer pageNum,
  89. Integer pageSize,
  90. Integer apiId,
  91. String con) {
  92. if (mapValue==null){
  93. mapValue=new HashMap<>();
  94. }
  95. mapValue.put("con",con);
  96. List<Map<String, Object>> listTotal = dilBatchService.getBatchListForInstruction(mapValue);
  97. PageHelper.startPage(pageNum, pageSize);
  98. //分页查询数据
  99. List<Map<String, Object>> columnList = dilBatchService.getBatchListForInstruction(mapValue);
  100. PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
  101. return success(data);
  102. }
  103. @ApiOperation(value="查询批次列表", notes="分页查询")
  104. @ApiImplicitParams({
  105. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  106. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  107. @ApiImplicitParam(name = "apiId", value = "489", required = false, dataType = "Integer")
  108. })
  109. @PostMapping("/getBatchIdByForeign")
  110. public RESTfulResult getBatchIdByForeign(@RequestBody(required = false) Map<String, Object> mapValue,
  111. Integer pageNum,
  112. Integer pageSize,
  113. Integer apiId,
  114. String con) {
  115. if (mapValue==null){
  116. mapValue=new HashMap<>();
  117. }
  118. if (con!=null&&!"null".equals(con)){
  119. mapValue.put("con",con);
  120. }
  121. List<Map<String, Object>> listTotal = dilBatchService.getBatchIdByForeign(mapValue);
  122. PageHelper.startPage(pageNum, pageSize);
  123. //分页查询数据
  124. List<Map<String, Object>> columnList = dilBatchService.getBatchIdByForeign(mapValue);
  125. PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
  126. return success(data);
  127. }
  128. // 根据索引模糊查询外轮船名
  129. @ApiOperation(value="根据用户输入输出船名", notes="模糊查询")
  130. @ApiImplicitParams({
  131. @ApiImplicitParam(name = "con",value = "用户输入的江船名", required = false, dataType = "String")
  132. })
  133. @PostMapping("/getShipNameList")
  134. public RESTfulResult getShipNameList(@RequestParam(value ="state") String state){
  135. return success(dilBatchService.getShipNameList(state));
  136. }
  137. //根据用户输入提货联系人模糊查询提货联系人、提货人身份证号、联系电话
  138. @ApiOperation(value="根据用户输入提货联系人模糊查询提货联系人", notes="模糊查询")
  139. @ApiImplicitParams({
  140. @ApiImplicitParam(name = "con",value = "用户输入的联系人", required = false, dataType = "String")
  141. })
  142. @PostMapping("/getPersonByName")
  143. public RESTfulResult getPersonByName(@RequestParam(value ="personName")String personName){
  144. return success(dilBatchService.getPersonByName(personName));
  145. }
  146. //根据用户输入提货联系人模糊查询提货联系人、提货人身份证号、联系电话
  147. @ApiOperation(value="根据用户在发货通知输入的提货联系人模糊查询提货联系人", notes="模糊查询")
  148. @ApiImplicitParams({
  149. @ApiImplicitParam(name = "con",value = "用户输入的联系人", required = false, dataType = "String")
  150. })
  151. @PostMapping("/getNoticeContactNumberByPerson")
  152. public RESTfulResult getNoticeContactNumberByPerson(@RequestParam(value ="personName")String personName){
  153. return success(dilBatchService.getNoticeContactNumberByPerson(personName));
  154. }
  155. @ApiOperation(value="采购绑定批次查询", notes="模糊查询")
  156. @ApiImplicitParams({
  157. @ApiImplicitParam(name = "apiId",value = "用户输入的联系人", required = false, dataType = "Integer")
  158. })
  159. @PostMapping("/findBatchForBind")
  160. public RESTfulResult findBatchForBind(@RequestBody(required = false) Map<String, Object> map,
  161. Integer pageNum,
  162. Integer pageSize,
  163. Integer apiId,
  164. String materialName,
  165. String foreignShipName
  166. ){
  167. if(materialName!=null)
  168. map.put("materialName",materialName);
  169. if(foreignShipName!=null)
  170. map.put("foreignShipName",foreignShipName);
  171. List<Map<String, Object>> listTotal = dilBatchService.findBatchForBind(map);
  172. PageHelper.startPage(pageNum, pageSize);
  173. //分页查询数据
  174. List<Map<String, Object>> columnList = dilBatchService.findBatchForBind(map);
  175. PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
  176. return success(data);
  177. }
  178. @ApiOperation(value="修改绑定批次", notes="模糊查询")
  179. @ApiImplicitParams({
  180. @ApiImplicitParam(name = "apiId",value = "用户输入的联系人", required = false, dataType = "Integer")
  181. })
  182. @PostMapping("/bindBatch")
  183. public RESTfulResult bindBatch(@RequestBody(required = false) Map<String, Object> map) throws Exception {
  184. return success(dilBatchService.bindBatch(map));
  185. }
  186. }