123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- package com.emato.biz.controller.warehouse;
- import java.util.List;
- 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.OWbInveReceiptGoods;
- import com.emato.biz.service.warehouse.IOWbInveReceiptGoodsService;
- import com.emato.common.utils.poi.ExcelUtil;
- import com.emato.common.core.page.TableDataInfo;
- /**
- * 库存入库货品,发WMS货品数据Controller
- *
- * @author yangbo
- * @date 2021-02-01
- */
- @RestController
- @RequestMapping("/biz/invereceiptgoods")
- public class OWbInveReceiptGoodsController extends BaseController
- {
- @Autowired
- private IOWbInveReceiptGoodsService oWbInveReceiptGoodsService;
- @Autowired
- private ISysDeptService sysDeptService;
- /**
- * 查询库存入库货品,发WMS货品数据列表
- */
- @PreAuthorize("@ss.hasPermi('biz:invereceiptgoods:list')")
- @GetMapping("/list")
- public TableDataInfo list(OWbInveReceiptGoods oWbInveReceiptGoods)
- {
- startPage();
- List<OWbInveReceiptGoods> list = oWbInveReceiptGoodsService.selectOWbInveReceiptGoodsList(oWbInveReceiptGoods);
- return getDataTable(list);
- }
- /**
- * 导出库存入库货品,发WMS货品数据列表
- */
- @PreAuthorize("@ss.hasPermi('biz:invereceiptgoods:export')")
- @Log(title = "库存入库货品,发WMS货品数据", businessType = BusinessType.EXPORT)
- @GetMapping("/export")
- public AjaxResult export(OWbInveReceiptGoods oWbInveReceiptGoods)
- {
- List<OWbInveReceiptGoods> list = oWbInveReceiptGoodsService.selectOWbInveReceiptGoodsList(oWbInveReceiptGoods);
- ExcelUtil<OWbInveReceiptGoods> util = new ExcelUtil<OWbInveReceiptGoods>(OWbInveReceiptGoods.class);
- return util.exportExcel(list, "invereceiptgoods");
- }
- /**
- * 获取库存入库货品,发WMS货品数据详细信息
- */
- @PreAuthorize("@ss.hasPermi('biz:invereceiptgoods:query')")
- @GetMapping(value = "/{receiptGoodsSn}")
- public AjaxResult getInfo(@PathVariable("receiptGoodsSn") String receiptGoodsSn)
- {
- return AjaxResult.success(oWbInveReceiptGoodsService.selectOWbInveReceiptGoodsById(receiptGoodsSn));
- }
- /**
- * 新增库存入库货品,发WMS货品数据
- */
- @PreAuthorize("@ss.hasPermi('biz:invereceiptgoods:add')")
- @Log(title = "库存入库货品,发WMS货品数据", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody OWbInveReceiptGoods oWbInveReceiptGoods)
- {
- return toAjax(oWbInveReceiptGoodsService.insertOWbInveReceiptGoods(oWbInveReceiptGoods));
- }
- /**
- * 修改库存入库货品,发WMS货品数据
- */
- @PreAuthorize("@ss.hasPermi('biz:invereceiptgoods:edit')")
- @Log(title = "库存入库货品,发WMS货品数据", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody OWbInveReceiptGoods oWbInveReceiptGoods)
- {
- return toAjax(oWbInveReceiptGoodsService.updateOWbInveReceiptGoods(oWbInveReceiptGoods));
- }
- /**
- * 删除库存入库货品,发WMS货品数据
- */
- @PreAuthorize("@ss.hasPermi('biz:invereceiptgoods:remove')")
- @Log(title = "库存入库货品,发WMS货品数据", businessType = BusinessType.DELETE)
- @DeleteMapping("/{receiptGoodsSns}")
- public AjaxResult remove(@PathVariable String[] receiptGoodsSns)
- {
- return toAjax(oWbInveReceiptGoodsService.deleteOWbInveReceiptGoodsByIds(receiptGoodsSns));
- }
- @PreAuthorize("@ss.hasPermi('biz:invemng:pull')")
- @PostMapping("/pullReceiptGoods")
- public AjaxResult pullReceiptGoods()
- {
- // 获取当前的用户
- LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
- SysUser user = loginUser.getUser();
- // 根据当前登录用户部门查询所属商户
- SysDept sysDept = sysDeptService.selectDeptById(user.getDeptId());
- // 获取当前商户号
- String merchSn = sysDept.getMerchSn();
- return toAjax(oWbInveReceiptGoodsService.pullReceiptGoods(merchSn));
- }
- }
|