WMSController.java 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.annotaion.LogAround;
  3. import com.steerinfo.dil.feign.ATWmsFeign;
  4. import com.steerinfo.dil.feign.WMSFeign;
  5. import com.steerinfo.dil.model.WmsSlmDlivDir;
  6. import com.steerinfo.dil.util.BaseRESTfulController;
  7. import com.steerinfo.dil.util.ColumnDataUtil;
  8. import com.steerinfo.dil.util.PageListAdd;
  9. import com.steerinfo.framework.controller.RESTfulResult;
  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.transaction.annotation.Transactional;
  15. import org.springframework.web.bind.annotation.*;
  16. import java.math.BigDecimal;
  17. import java.util.ArrayList;
  18. import java.text.ParseException;
  19. import java.text.SimpleDateFormat;
  20. import java.util.Date;
  21. import java.util.HashMap;
  22. import java.util.List;
  23. import java.util.Map;
  24. /**
  25. * @author luobang
  26. * @create 2021-09-17 14:09
  27. */
  28. @RestController
  29. @RequestMapping("${api.version}/wms")
  30. public class WMSController extends BaseRESTfulController {
  31. @Autowired
  32. WMSFeign wmsFeign;
  33. @Autowired
  34. ATWmsFeign atWmsFeign;
  35. @Autowired
  36. ColumnDataUtil columnDataUtil;
  37. @ApiOperation(value = "查询", notes = "分页查询销售订单")
  38. @ApiImplicitParams({
  39. @ApiImplicitParam(name = "params", value = "查询条件", required = false, dataType = "HashMap"),
  40. @ApiImplicitParam(name = "apiId", value = "表单ID", required = false, dataType = "Integer"),
  41. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  42. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
  43. })
  44. @PostMapping(value = "/selectSaleOrderPage")
  45. public Map<String, Object> selectSaleOrderPage(@RequestBody(required = false) HashMap parmas,
  46. Integer apiId,
  47. Integer pageNum,
  48. Integer pageSize) {
  49. return wmsFeign.selectSaleOrderPage(parmas == null ? new HashMap<>() : parmas, apiId, pageNum, pageSize);
  50. }
  51. @ApiOperation(value = "新增销售订单")
  52. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = false, dataType = "Map<String, Object>")
  53. @PostMapping("/add")
  54. public RESTfulResult addet(@RequestBody(required = false) HashMap params) {
  55. return wmsFeign.addet(params);
  56. }
  57. @ApiOperation(value = "查询", notes = "分页查询发货单")
  58. @ApiImplicitParams({
  59. @ApiImplicitParam(name = "params", value = "查询条件", required = false, dataType = "HashMap"),
  60. @ApiImplicitParam(name = "apiId", value = "表单ID", required = false, dataType = "Integer"),
  61. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  62. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer")
  63. })
  64. @PostMapping(value = "/selectDlivDirNo")
  65. public Map<String, Object> selectDlivDirNo(@RequestBody(required = false) HashMap parmas,
  66. Integer apiId,
  67. Integer pageNum,
  68. Integer pageSize) {
  69. return wmsFeign.selectDlivDirNo(parmas == null ? new HashMap<>() : parmas, apiId, pageNum, pageSize);
  70. }
  71. @ApiOperation(value = "修改发货单状态", notes = "修改发货单状态")
  72. @ApiImplicitParam(name = "params", value = "修改内容", required = false, dataType = "ArrayList<HashMap<String, Object>>")
  73. @PostMapping(value = "/updateOrder")
  74. public RESTfulResult udpateOrder(@RequestBody(required = false) HashMap<String, Object> parmas) {
  75. return wmsFeign.udpateOrder(parmas);
  76. }
  77. @ApiOperation(value = "查询发货单第几次退库", notes = "查询发货单第几次退库")
  78. @ApiImplicitParam(name = "dlivDirno", value = "查询内容", required = false, dataType = "String")
  79. @GetMapping(value = "/getcut/{dlivDirno}")
  80. public RESTfulResult getcut(@PathVariable String dlivDirno) {
  81. return wmsFeign.getcut(dlivDirno);
  82. }
  83. @ApiOperation(value = "退货", notes = "根据填写的数据将发货单进行退货")
  84. @ApiImplicitParam(name = "params", value = "查询内容", required = false, dataType = "HashMap<String, Object>")
  85. @PostMapping(value = "/returnGoods")
  86. public RESTfulResult returnGoods(@RequestBody(required = false) HashMap<String, Object> params) {
  87. return wmsFeign.returnGoods(params);
  88. }
  89. @ApiOperation(value = "撤销退货", notes = "根据发货单号将发货单的退货记录清除")
  90. @ApiImplicitParam(name = "id", value = "查询内容", required = false, dataType = "String")
  91. @PostMapping(value = "revokeReturnGoods/{id}")
  92. public RESTfulResult revokeReturnGoods(@PathVariable("id") String id) {
  93. return wmsFeign.revokeReturnGoods(id);
  94. }
  95. @ApiOperation(value = "删除发货单", notes = "根据发货单号将发货单删除")
  96. @ApiImplicitParam(name = "id", value = "查询内容", required = false, dataType = "String")
  97. @PostMapping(value = "deleteDlivDirno/{id}")
  98. public RESTfulResult deleteDlivDirno(@PathVariable("id") String id) {
  99. return wmsFeign.deleteDlivDirno(id);
  100. }
  101. @ApiOperation(value = "修改发货单信息", notes = "根据填写的数据将发货单进行修改")
  102. @ApiImplicitParam(name = "params", value = "查询内容", required = false, dataType = "HashMap<String, Object>")
  103. @PostMapping(value = "/editButton")
  104. public RESTfulResult editButton(@RequestBody(required = false) HashMap<String, Object> params) {
  105. return wmsFeign.editButton(params);
  106. }
  107. //实时库存
  108. @ApiOperation(value = "实时库存")
  109. @ApiImplicitParams({
  110. @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"),
  111. @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
  112. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  113. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  114. })
  115. @PostMapping(value = "/wmsgridmaterialsList")
  116. public Map<String, Object> getAmsSalaryContracList(@RequestBody(required = false) Map<String, Object> map, Integer apiId,
  117. Integer pageNum,
  118. Integer pageSize) {
  119. return wmsFeign.list(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  120. }
  121. @ApiOperation(value = "新增实时库存")
  122. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  123. @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"实时库存"})
  124. @PostMapping("/wmsgridmaterialsinsert")
  125. public Map<String, Object> insertAmsSalaryContrac(@RequestBody(required = false) Map<String, Object> map) throws ParseException {
  126. map.put("insertUsername", map.get("userName").toString());
  127. return wmsFeign.insert(map);
  128. }
  129. @ApiOperation(value = "修改实时库存")
  130. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  131. @PutMapping(value = "/wmsgridmaterialsUpdate/{id}")
  132. @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"实时库存"})
  133. public Map<String, Object> updateAmsSalaryContrac(@PathVariable BigDecimal id, @RequestBody(required = false) Map<String, Object> map) {
  134. map.put("updateUsername", map.get("userName").toString());
  135. return wmsFeign.update(id, map);
  136. }
  137. @ApiOperation(value = "实时库存逻辑删除")
  138. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  139. @PutMapping(value = "/wmsgridmaterialsDelete")
  140. @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"实时库存"})
  141. public Map<String, Object> logicdeleteAmsSaalryContrac(@RequestBody(required = false) Map<String, Object> map) {
  142. return wmsFeign.delete(map);
  143. }
  144. @ApiOperation(value = "查询实时库存")
  145. @ApiImplicitParams({
  146. @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"),
  147. @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
  148. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  149. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  150. })
  151. @PostMapping(value = "/getGridMaterialList")
  152. public Map<String, Object> getGridMaterialList(@RequestBody(required = false) Map<String, Object> map, Integer apiId,
  153. Integer pageNum,
  154. Integer pageSize) {
  155. return wmsFeign.getGridMaterialList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  156. }
  157. @ApiOperation(value = "查询")
  158. @ApiImplicitParams({
  159. @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"),
  160. @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
  161. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  162. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  163. })
  164. @PostMapping(value = "/getGridMaterialDailyReport")
  165. public Map<String, Object> getGridMaterialDailyReport(@RequestBody(required = false) Map<String, Object> map, Integer apiId,
  166. Integer pageNum,
  167. Integer pageSize) {
  168. return wmsFeign.getGridMaterialDailyReport(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  169. }
  170. @ApiOperation(value = "查询入库实绩")
  171. @ApiImplicitParams({
  172. @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"),
  173. @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
  174. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  175. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  176. })
  177. @PostMapping(value = "/getInboundList")
  178. public Map<String, Object> getInboundList(@RequestBody(required = false) Map<String, Object> map, Integer apiId,
  179. Integer pageNum,
  180. Integer pageSize) {
  181. return wmsFeign.getInboundList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  182. }
  183. @ApiOperation(value = "入库")
  184. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  185. @LogAround(foreignKeys = {"inboundResultId"}, foreignKeyTypes = {"入库实绩"})
  186. @PostMapping("/inbound")
  187. public Map<String, Object> inbound(@RequestBody(required = false) Map<String, Object> map){
  188. return wmsFeign.inbound(map);
  189. }
  190. @ApiOperation(value = "查询出库实绩")
  191. @ApiImplicitParams({
  192. @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"),
  193. @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
  194. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  195. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  196. })
  197. @PostMapping(value = "/getOutboundList")
  198. public Map<String, Object> getOutboundList(@RequestBody(required = false) Map<String, Object> map, Integer apiId,
  199. Integer pageNum,
  200. Integer pageSize) {
  201. return wmsFeign.getOutboundList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
  202. }
  203. @ApiOperation(value = "出库")
  204. @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
  205. @LogAround(foreignKeys = {"outboundResultId"}, foreignKeyTypes = {"出库实绩"})
  206. @PostMapping("/outbound")
  207. public Map<String, Object> outbound(@RequestBody(required = false) Map<String, Object> map){
  208. return wmsFeign.outbound(map);
  209. }
  210. @PostMapping("/selectkcmx")
  211. public RESTfulResult selectkcmx(@RequestBody HashMap map,
  212. Integer apiId,
  213. Integer pageNum,
  214. Integer pageSize){
  215. if (map.get("createTime") != null) {
  216. ArrayList arrayList = (ArrayList)map.get("createTime");
  217. map.put("starttime", arrayList.get(0).toString());
  218. map.put("endtime", arrayList.get(1).toString());
  219. }
  220. if (map.get("inDt") != null) {
  221. ArrayList arrayList = (ArrayList)map.get("inDt");
  222. map.put("indtstart", arrayList.get(0).toString());
  223. map.put("indtend", arrayList.get(1).toString());
  224. }
  225. RESTfulResult selectkcmx = atWmsFeign.wuliuSelectkcmx(map, pageNum, pageSize);
  226. Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
  227. List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
  228. PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
  229. pageList.setTotal((int)data.get("total"));
  230. return success(pageList);
  231. }
  232. @PostMapping("/selectbybatchno")
  233. public RESTfulResult selectbybatchno(@RequestBody HashMap map,
  234. Integer apiId,
  235. Integer pageNum,
  236. Integer pageSize){
  237. if (map.get("createTime") != null) {
  238. ArrayList arrayList = (ArrayList)map.get("createTime");
  239. map.put("starttime", arrayList.get(0).toString());
  240. map.put("endtime", arrayList.get(1).toString());
  241. }
  242. if (map.get("inDt") != null) {
  243. ArrayList arrayList = (ArrayList)map.get("inDt");
  244. map.put("indtstart", arrayList.get(0).toString());
  245. map.put("indtend", arrayList.get(1).toString());
  246. }
  247. RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbybatchno(map, pageNum, pageSize);
  248. Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
  249. List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
  250. PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
  251. pageList.setTotal((int)data.get("total"));
  252. return success(pageList);
  253. }
  254. @PostMapping("/selectbyprod")
  255. public RESTfulResult selectbyprod(@RequestBody HashMap map,
  256. Integer apiId,
  257. Integer pageNum,
  258. Integer pageSize){
  259. if (map.get("createTime") != null) {
  260. ArrayList arrayList = (ArrayList)map.get("createTime");
  261. map.put("starttime", arrayList.get(0).toString());
  262. map.put("endtime", arrayList.get(1).toString());
  263. }
  264. if (map.get("inDt") != null) {
  265. ArrayList arrayList = (ArrayList)map.get("inDt");
  266. map.put("indtstart", arrayList.get(0).toString());
  267. map.put("indtend", arrayList.get(1).toString());
  268. }
  269. RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbyprod(map, pageNum, pageSize);
  270. Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
  271. List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
  272. PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
  273. pageList.setTotal((int)data.get("total"));
  274. return success(pageList);
  275. }
  276. @PostMapping("/selectbybuttress")
  277. public RESTfulResult selectbybuttress(@RequestBody HashMap map,
  278. Integer apiId,
  279. Integer pageNum,
  280. Integer pageSize){
  281. if (map.get("createTime") != null) {
  282. ArrayList arrayList = (ArrayList)map.get("createTime");
  283. map.put("starttime", arrayList.get(0).toString());
  284. map.put("endtime", arrayList.get(1).toString());
  285. }
  286. if (map.get("inDt") != null) {
  287. ArrayList arrayList = (ArrayList)map.get("inDt");
  288. map.put("indtstart", arrayList.get(0).toString());
  289. map.put("indtend", arrayList.get(1).toString());
  290. }
  291. RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbybuttress(map, pageNum, pageSize);
  292. Map<String, Object> data = (Map<String, Object>)selectkcmx.getData();
  293. List<Map<String, Object>> list = (List<Map<String,Object>>)data.get("list");
  294. PageListAdd pageList = columnDataUtil.tableColumnData(apiId,list);
  295. pageList.setTotal((int)data.get("total"));
  296. return success(pageList);
  297. }
  298. }