package com.steerinfo.dil.controller; import com.steerinfo.dil.annotaion.LogAround; import com.steerinfo.dil.feign.ATWmsFeign; import com.steerinfo.dil.feign.WMSFeign; import com.steerinfo.dil.model.WmsSlmDlivDir; import com.steerinfo.dil.util.BaseRESTfulController; import com.steerinfo.dil.util.ColumnDataUtil; import com.steerinfo.dil.util.PageListAdd; import com.steerinfo.framework.controller.RESTfulResult; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.ArrayList; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author luobang * @create 2021-09-17 14:09 */ @RestController @RequestMapping("${api.version}/wms") public class WMSController extends BaseRESTfulController { @Autowired WMSFeign wmsFeign; @Autowired ATWmsFeign atWmsFeign; @Autowired ColumnDataUtil columnDataUtil; @ApiOperation(value = "查询", notes = "分页查询销售订单") @ApiImplicitParams({ @ApiImplicitParam(name = "params", value = "查询条件", required = false, dataType = "HashMap"), @ApiImplicitParam(name = "apiId", value = "表单ID", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer") }) @PostMapping(value = "/selectSaleOrderPage") public Map selectSaleOrderPage(@RequestBody(required = false) HashMap parmas, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.selectSaleOrderPage(parmas == null ? new HashMap<>() : parmas, apiId, pageNum, pageSize); } @ApiOperation(value = "新增销售订单") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = false, dataType = "Map") @PostMapping("/add") public RESTfulResult addet(@RequestBody(required = false) HashMap params) { return wmsFeign.addet(params); } @ApiOperation(value = "查询", notes = "分页查询发货单") @ApiImplicitParams({ @ApiImplicitParam(name = "params", value = "查询条件", required = false, dataType = "HashMap"), @ApiImplicitParam(name = "apiId", value = "表单ID", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer") }) @PostMapping(value = "/selectDlivDirNo") public Map selectDlivDirNo(@RequestBody(required = false) HashMap parmas, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.selectDlivDirNo(parmas == null ? new HashMap<>() : parmas, apiId, pageNum, pageSize); } @ApiOperation(value = "修改发货单状态", notes = "修改发货单状态") @ApiImplicitParam(name = "params", value = "修改内容", required = false, dataType = "ArrayList>") @PostMapping(value = "/updateOrder") public RESTfulResult udpateOrder(@RequestBody(required = false) HashMap parmas) { return wmsFeign.udpateOrder(parmas); } @ApiOperation(value = "查询发货单第几次退库", notes = "查询发货单第几次退库") @ApiImplicitParam(name = "dlivDirno", value = "查询内容", required = false, dataType = "String") @GetMapping(value = "/getcut/{dlivDirno}") public RESTfulResult getcut(@PathVariable String dlivDirno) { return wmsFeign.getcut(dlivDirno); } @ApiOperation(value = "退货", notes = "根据填写的数据将发货单进行退货") @ApiImplicitParam(name = "params", value = "查询内容", required = false, dataType = "HashMap") @PostMapping(value = "/returnGoods") public RESTfulResult returnGoods(@RequestBody(required = false) HashMap params) { return wmsFeign.returnGoods(params); } @ApiOperation(value = "撤销退货", notes = "根据发货单号将发货单的退货记录清除") @ApiImplicitParam(name = "id", value = "查询内容", required = false, dataType = "String") @PostMapping(value = "revokeReturnGoods/{id}") public RESTfulResult revokeReturnGoods(@PathVariable("id") String id) { return wmsFeign.revokeReturnGoods(id); } @ApiOperation(value = "删除发货单", notes = "根据发货单号将发货单删除") @ApiImplicitParam(name = "id", value = "查询内容", required = false, dataType = "String") @PostMapping(value = "deleteDlivDirno/{id}") public RESTfulResult deleteDlivDirno(@PathVariable("id") String id) { return wmsFeign.deleteDlivDirno(id); } @ApiOperation(value = "修改发货单信息", notes = "根据填写的数据将发货单进行修改") @ApiImplicitParam(name = "params", value = "查询内容", required = false, dataType = "HashMap") @PostMapping(value = "/editButton") public RESTfulResult editButton(@RequestBody(required = false) HashMap params) { return wmsFeign.editButton(params); } //实时库存 @ApiOperation(value = "实时库存") @ApiImplicitParams({ @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), }) @PostMapping(value = "/wmsgridmaterialsList") public Map getAmsSalaryContracList(@RequestBody(required = false) Map map, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.list(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize); } @ApiOperation(value = "新增实时库存") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"实时库存"}) @PostMapping("/wmsgridmaterialsinsert") public Map insertAmsSalaryContrac(@RequestBody(required = false) Map map) throws ParseException { map.put("insertUsername", map.get("userName").toString()); return wmsFeign.insert(map); } @ApiOperation(value = "修改实时库存") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @PutMapping(value = "/wmsgridmaterialsUpdate/{id}") @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"实时库存"}) public Map updateAmsSalaryContrac(@PathVariable BigDecimal id, @RequestBody(required = false) Map map) { map.put("updateUsername", map.get("userName").toString()); return wmsFeign.update(id, map); } @ApiOperation(value = "实时库存逻辑删除") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @PutMapping(value = "/wmsgridmaterialsDelete") @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"实时库存"}) public Map logicdeleteAmsSaalryContrac(@RequestBody(required = false) Map map) { return wmsFeign.delete(map); } @ApiOperation(value = "查询实时库存") @ApiImplicitParams({ @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), }) @PostMapping(value = "/getGridMaterialList") public Map getGridMaterialList(@RequestBody(required = false) Map map, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.getGridMaterialList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize); } @PostMapping(value = "/getGridMaterialInfo") public Map getGridMaterialInfo(@RequestBody(required = false) Map map) { return wmsFeign.getGridMaterialInfo(map == null ? new HashMap<>() : map); } @ApiOperation(value = "修改库存") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @LogAround(foreignKeys = {"gridMaterialId"}, foreignKeyTypes = {"入库实绩"}) @PostMapping("/updateGridMaterial") public Map updateGridMaterial(@RequestBody(required = false) Map map) { return wmsFeign.updateGridMaterial(map); } @ApiOperation(value = "查询") @ApiImplicitParams({ @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), }) @PostMapping(value = "/getGridMaterialDailyReport") public Map getGridMaterialDailyReport(@RequestBody(required = false) Map map, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.getGridMaterialDailyReport(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize); } @ApiOperation(value = "查询入库实绩") @ApiImplicitParams({ @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), }) @PostMapping(value = "/getInboundList") public Map getInboundList(@RequestBody(required = false) Map map, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.getInboundList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize); } @ApiOperation(value = "入库") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @LogAround(foreignKeys = {"inboundResultId"}, foreignKeyTypes = {"入库实绩"}) @PostMapping("/inbound") public Map inbound(@RequestBody(required = false) Map map) { return wmsFeign.inbound(map); } @ApiOperation(value = "修改入库") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @LogAround(foreignKeys = {"inboundResultId"}, foreignKeyTypes = {"入库实绩"}) @PostMapping("/updateInbound") public Map updateInbound(@RequestBody(required = false) Map map) { return wmsFeign.updateInbound(map); } @ApiOperation(value = "查询出库实绩") @ApiImplicitParams({ @ApiImplicitParam(name = "map", value = "参数", required = false, dataType = "map"), @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"), @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"), }) @PostMapping(value = "/getOutboundList") public Map getOutboundList(@RequestBody(required = false) Map map, Integer apiId, Integer pageNum, Integer pageSize) { return wmsFeign.getOutboundList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize); } @ApiOperation(value = "出库") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @LogAround(foreignKeys = {"outboundResultId"}, foreignKeyTypes = {"出库实绩"}) @PostMapping("/outbound") public Map outbound(@RequestBody(required = false) Map map) { return wmsFeign.outbound(map); } @ApiOperation(value = "修改出库") @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map") @LogAround(foreignKeys = {"outboundResultId"}, foreignKeyTypes = {"出库实绩"}) @PostMapping("/updateOutbound") public Map updateOutbound(@RequestBody(required = false) Map map) { return wmsFeign.updateOutbound(map); } @PostMapping("/selectkcmx") public RESTfulResult selectkcmx(@RequestBody HashMap map, Integer apiId, Integer pageNum, Integer pageSize) { if (map.get("createTime") != null) { ArrayList arrayList = (ArrayList) map.get("createTime"); map.put("starttime", arrayList.get(0).toString()); map.put("endtime", arrayList.get(1).toString()); } if (map.get("inDt") != null) { ArrayList arrayList = (ArrayList) map.get("inDt"); map.put("indtstart", arrayList.get(0).toString()); map.put("indtend", arrayList.get(1).toString()); } RESTfulResult selectkcmx = atWmsFeign.wuliuSelectkcmx(map, pageNum, pageSize); Map data = (Map) selectkcmx.getData(); List> list = (List>) data.get("list"); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, list); pageList.setTotal((int) data.get("total")); return success(pageList); } @PostMapping("/selectbybatchno") public RESTfulResult selectbybatchno(@RequestBody HashMap map, Integer apiId, Integer pageNum, Integer pageSize) { if (map.get("createTime") != null) { ArrayList arrayList = (ArrayList) map.get("createTime"); map.put("starttime", arrayList.get(0).toString()); map.put("endtime", arrayList.get(1).toString()); } if (map.get("inDt") != null) { ArrayList arrayList = (ArrayList) map.get("inDt"); map.put("indtstart", arrayList.get(0).toString()); map.put("indtend", arrayList.get(1).toString()); } RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbybatchno(map, pageNum, pageSize); Map data = (Map) selectkcmx.getData(); List> list = (List>) data.get("list"); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, list); pageList.setTotal((int) data.get("total")); return success(pageList); } @PostMapping("/selectbyprod") public RESTfulResult selectbyprod(@RequestBody HashMap map, Integer apiId, Integer pageNum, Integer pageSize) { if (map.get("createTime") != null) { ArrayList arrayList = (ArrayList) map.get("createTime"); map.put("starttime", arrayList.get(0).toString()); map.put("endtime", arrayList.get(1).toString()); } if (map.get("inDt") != null) { ArrayList arrayList = (ArrayList) map.get("inDt"); map.put("indtstart", arrayList.get(0).toString()); map.put("indtend", arrayList.get(1).toString()); } RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbyprod(map, pageNum, pageSize); Map data = (Map) selectkcmx.getData(); List> list = (List>) data.get("list"); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, list); pageList.setTotal((int) data.get("total")); return success(pageList); } @PostMapping("/selectbybuttress") public RESTfulResult selectbybuttress(@RequestBody HashMap map, Integer apiId, Integer pageNum, Integer pageSize) { if (map.get("createTime") != null) { ArrayList arrayList = (ArrayList) map.get("createTime"); map.put("starttime", arrayList.get(0).toString()); map.put("endtime", arrayList.get(1).toString()); } if (map.get("inDt") != null) { ArrayList arrayList = (ArrayList) map.get("inDt"); map.put("indtstart", arrayList.get(0).toString()); map.put("indtend", arrayList.get(1).toString()); } RESTfulResult selectkcmx = atWmsFeign.wuliuSelectbybuttress(map, pageNum, pageSize); Map data = (Map) selectkcmx.getData(); List> list = (List>) data.get("list"); PageListAdd pageList = columnDataUtil.tableColumnData(apiId, list); pageList.setTotal((int) data.get("total")); return success(pageList); } @ApiOperation(value = "增加装车记录", notes = "根据List信息来增加装车记录") public String addList(@RequestBody List> ListMap) { return wmsFeign.addList(ListMap); } @ApiOperation(value = "删除装车记录", notes = "根据派车单号信息来删除装车记录") @PutMapping(value = "/deleteSlmDlivDirListByDlivDirnoSeq") public String deleteSlmDlivDirListByDlivDirnoSeq(@RequestParam String dlivDirnoSeq) { return wmsFeign.deleteSlmDlivDirListByDlivDirnoSeq(dlivDirnoSeq); } }