whycxzp
2024-01-11 58812e817088e7e09d2d43c58edf0e222c048020
src/main/java/com/whyc/service/ProductHistoryService.java
@@ -14,6 +14,7 @@
import com.whyc.pojo.ProductLockLog;
import com.whyc.util.ActionUtil;
import com.whyc.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -251,4 +252,15 @@
        }
        return null;
    }
    public boolean checkExists(String parentCode, String customCode) {
        QueryWrapper<ProductHistory> query = Wrappers.query();
        query.eq("parent_code",parentCode);
        if(!StringUtils.isBlank(customCode)){ //标准产品
            query.eq("custom_code",customCode);
        }
        query.last(" limit 1");
        ProductHistory productHistory = mapper.selectOne(query);
        return productHistory!=null;
    }
}