InventoryContainer.java
1.72 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
package com.huaheng.api.wcs.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.huaheng.api.wcs.domain.InventoryDomain;
import com.huaheng.api.wcs.service.inventoryHandle.InventoryViewService;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**库存查看接口
*
* @author lty
* @date 2021/9/28
*
*/
@RestController
@RequestMapping("/API/WMS/v2")
public class InventoryContainer {
@Resource
private com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService InventoryDetailService;
@Resource
private InventoryViewService InventoryViewService;
@PostMapping("/InventoryView")
// @Log(title = "库存查看", operating = "查看库存", action = BusinessType.OTHER)
@ResponseBody
@Transactional
public AjaxResult manyEmptyIn(@RequestBody InventoryDomain inventoryDomain) {
LambdaQueryWrapper<InventoryDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.like(InventoryDetail::getMaterialName,inventoryDomain.getMaterialName());
if (inventoryDomain.getZoneCode().length()>0)
{lambdaQueryWrapper.eq(InventoryDetail::getZoneCode,inventoryDomain.getZoneCode());}
List<InventoryDetail> list = InventoryDetailService.list(lambdaQueryWrapper);
List<InventoryDetail> details = InventoryViewService.duplicateRemoval(list);
return AjaxResult.success(details);
}
}