|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.web.controller.zhdd;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.http.HttpStatus;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -73,13 +74,22 @@ public class ResourceController extends BaseController {
|
|
|
@GetMapping("/list")
|
|
|
@Security
|
|
|
public TableDataInfo<ResourceVo> list(@Validated(QueryGroup.class) ResourceBo bo) {
|
|
|
+ if (bo.getResourceType() != null && bo.getResourceType() == 1 && StrUtil.equals(bo.getNotNullFlag(), "1")) {
|
|
|
+ // 查询存在物资的仓库
|
|
|
+ List<Object> resourceIdExist = iResourceDetailService.queryExistResourceId();
|
|
|
+ bo.setResourceIds(resourceIdExist);
|
|
|
+ }
|
|
|
if (bo.getResourceType() != null && bo.getResourceType() == 1 && StrUtil.isNotBlank(bo.getGoodsName())) {
|
|
|
// 模糊查询有哪些仓库存在此物资
|
|
|
List<Object> objects = iResourceDetailService.listObjs(new QueryWrapper<ResourceDetail>()
|
|
|
.select("distinct resource_id")
|
|
|
.like("name", bo.getGoodsName()));
|
|
|
if (objects != null && objects.size() > 0) {
|
|
|
- bo.setResourceIds(objects);
|
|
|
+ if (ObjectUtil.isNotEmpty(bo.getResourceIds())) {
|
|
|
+ bo.setResourceIds(CollUtil.list(false, CollUtil.intersection(bo.getResourceIds(), objects)));
|
|
|
+ } else {
|
|
|
+ bo.setResourceIds(objects);
|
|
|
+ }
|
|
|
} else {
|
|
|
TableDataInfo<ResourceVo> rspData = new TableDataInfo<>();
|
|
|
rspData.setCode(HttpStatus.HTTP_OK);
|