123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- package com.emato.biz.controller.warehouse;
- import java.util.List;
- import com.emato.biz.domain.OutRequest;
- import com.emato.biz.domain.warehouse.PullInveQueryVO;
- import com.emato.biz.util.RoleUtils;
- import com.emato.common.annotation.AnonymousAccess;
- import com.emato.common.core.Result;
- import com.emato.common.core.domain.entity.SysDept;
- import com.emato.common.core.domain.entity.SysUser;
- import com.emato.common.core.domain.model.LoginUser;
- import com.emato.common.utils.ServletUtils;
- import com.emato.common.utils.spring.SpringUtils;
- import com.emato.framework.web.service.TokenService;
- import com.emato.system.service.ISysDeptService;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.emato.common.annotation.Log;
- import com.emato.common.core.controller.BaseController;
- import com.emato.common.core.domain.AjaxResult;
- import com.emato.common.enums.BusinessType;
- import com.emato.biz.domain.warehouse.OWbInveMng;
- import com.emato.biz.service.warehouse.IOWbInveMngService;
- import com.emato.common.utils.poi.ExcelUtil;
- import com.emato.common.core.page.TableDataInfo;
- /**
- * 库存管理,wms入库回传时,增加库存数Controller
- *
- * @author scott
- * @date 2021-02-01
- */
- @RestController
- @RequestMapping("/biz/invemng")
- public class OWbInveMngController extends BaseController
- {
- @Autowired
- private IOWbInveMngService oWbInveMngService;
- @Autowired
- private ISysDeptService sysDeptService;
- /**
- * 查询库存管理,wms入库回传时,增加库存数列表
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:list')")
- @GetMapping("/list")
- public TableDataInfo list(OWbInveMng oWbInveMng)
- {
- startPage();
- List<OWbInveMng> list = oWbInveMngService.selectOWbInveMngList(oWbInveMng);
- return getDataTable(list);
- }
- /**
- * 导出库存管理,wms入库回传时,增加库存数列表
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:export')")
- @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult export(OWbInveMng oWbInveMng)
- {
- List<OWbInveMng> list = oWbInveMngService.selectOWbInveMngList(oWbInveMng);
- ExcelUtil<OWbInveMng> util = new ExcelUtil<OWbInveMng>(OWbInveMng.class);
- return util.exportExcel(list, "invemng");
- }
- /**
- * 获取库存管理,wms入库回传时,增加库存数详细信息
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:query')")
- @GetMapping(value = "/{inveSn}")
- public AjaxResult getInfo(@PathVariable("inveSn") String inveSn)
- {
- return AjaxResult.success(oWbInveMngService.selectOWbInveMngById(inveSn));
- }
- /**
- * 新增库存管理,wms入库回传时,增加库存数
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:add')")
- @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody OWbInveMng oWbInveMng)
- {
- return toAjax(oWbInveMngService.insertOWbInveMng(oWbInveMng));
- }
- /**
- * 修改库存管理,wms入库回传时,增加库存数
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:edit')")
- @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody OWbInveMng oWbInveMng)
- {
- return toAjax(oWbInveMngService.updateOWbInveMng(oWbInveMng));
- }
- /**
- * 删除库存管理,wms入库回传时,增加库存数
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:remove')")
- @Log(title = "库存管理,wms入库回传时,增加库存数", businessType = BusinessType.DELETE)
- @DeleteMapping("/{inveSns}")
- public AjaxResult remove(@PathVariable String[] inveSns)
- {
- return toAjax(oWbInveMngService.deleteOWbInveMngByIds(inveSns));
- }
- /**
- * 拉取库存数据
- *
- * @param queryVO
- * @return
- */
- @PreAuthorize("@ss.hasPermi('biz:invemng:pull')")
- @PostMapping("/pullInveMng")
- public AjaxResult pullInveMng(PullInveQueryVO queryVO)
- {
- return oWbInveMngService.pullInveMng(queryVO);
- }
- /**
- * 接收 OMS 仓库库存数据
- *
- * @param outRequest
- * @return
- */
- @AnonymousAccess
- @PostMapping("/receive")
- public Result receiveInveMng(@RequestBody OutRequest outRequest) {
- return oWbInveMngService.receiveInveMng(outRequest);
- }
- }
|