whycxzp
2023-09-20 ff83a01df6bd810003fc60c39ed8247cd989590f
src/main/java/com/whyc/service/ProductHistoryService.java
@@ -201,4 +201,22 @@
    public void insert(ProductHistory his) {
        mapper.insert(his);
    }
    /**
     *  获取标准产品
     * @param parentCode
     * @return
     */
    public ProductHistory getStandard(String parentCode) {
        QueryWrapper<ProductHistory> query = Wrappers.query();
        query.eq("parent_code",parentCode);
        List<ProductHistory> historyList = mapper.selectList(query);
        for (ProductHistory history : historyList) {
            String customCode = history.getCustomCode();
            if(customCode == null || customCode.trim().equals("")){ //不存在定制表单号,是标准产品
                return history;
            }
        }
        return null;
    }
}