InventoryController.java
3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.huaheng.api.general.controller;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.huaheng.api.general.domain.CycCountDomain;
import com.huaheng.api.general.domain.InventoryDomain;
import com.huaheng.api.general.domain.InventoryQueryDomain;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.lang.ref.WeakReference;
import java.util.List;
public class InventoryController {
@Resource
private InventoryDetailService inventoryHeaderService;
/**
* 查询库存
*/
@Log(title = "查询库存", action = BusinessType.INSERT)
@PostMapping("/searchInventory")
@ApiOperation("查询库存系统库存")
@ResponseBody
@ApiLogger(apiName = "查询库存", from="ERP")
public AjaxResult searchInventory(@RequestBody InventoryQueryDomain inventoryQueryDomain)
{
LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
inventoryDetailLambdaQueryWrapper.eq(StringUtils.isNotEmpty(inventoryQueryDomain.getWarehouseCode()),
InventoryDetail::getWarehouseCode, inventoryQueryDomain.getWarehouseCode())
.eq(StringUtils.isNotEmpty(inventoryQueryDomain.getContainerCode()),
InventoryDetail::getContainerCode, inventoryQueryDomain.getContainerCode())
.eq(StringUtils.isNotEmpty(inventoryQueryDomain.getLocationCode()),
InventoryDetail::getLocationCode, inventoryQueryDomain.getLocationCode())
.eq(StringUtils.isNotEmpty(inventoryQueryDomain.getCompanyCode()),
InventoryDetail::getCompanyCode, inventoryQueryDomain.getCompanyCode())
.eq(StringUtils.isNotEmpty(inventoryQueryDomain.getMaterialCode()),
InventoryDetail::getMaterialCode, inventoryQueryDomain.getMaterialCode());
List<InventoryDetail> inventoryDetailList = inventoryHeaderService.list(inventoryDetailLambdaQueryWrapper);
return AjaxResult.success(inventoryDetailList);
}
}