chen.lin
22 小时以前 e56277542f60f386a109b1b072a1dbda390588fd
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/MatnrServiceImpl.java
@@ -25,6 +25,7 @@
import com.vincent.rsf.server.system.constant.SerialRuleCode;
import com.vincent.rsf.server.system.service.FieldsService;
import com.vincent.rsf.server.system.utils.SerialRuleUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -158,8 +159,18 @@
            }
        }
        // locUseStatus 仅用于下方 EXISTS 子查询,不能作为 man_matnr 表字段参与 buildWrapper
        Object locUseStatus = params.get("locUseStatus");
        if (pageParam.getWhere() != null && pageParam.getWhere().getMap() != null) {
            pageParam.getWhere().getMap().remove("locUseStatus");
        }
        QueryWrapper<Matnr> queryWrapper = pageParam.buildWrapper(true);
        queryWrapper.in(!longs.isEmpty(),"group_id", longs);
        // 出库选物料:按库位状态筛选(仅展示在该库位状态下有有效库存的物料,与 listStockByMatnrIds 口径一致:排除已删明细与已删库位)
        if (locUseStatus != null && StringUtils.isNotBlank(locUseStatus.toString())) {
            String useStatus = locUseStatus.toString().replace("'", "''");
            queryWrapper.apply("EXISTS (SELECT 1 FROM man_loc_item li INNER JOIN man_loc l ON li.loc_id = l.id AND (l.deleted = 0 OR l.deleted IS NULL) WHERE li.matnr_id = man_matnr.id AND li.deleted = 0 AND l.use_status = '" + useStatus + "')");
        }
        FieldsUtils.setFieldsFilters(queryWrapper,pageParam,Matnr.class);
        /**拼接扩展字段*/