Codota Logo
MainProductRepository
Code IndexAdd Codota to your IDE (free)

How to use
MainProductRepository
in
cn.lmjia.market.core.repository

Best Java code snippets using cn.lmjia.market.core.repository.MainProductRepository (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: JoleneOL/market-manage

@Override
public List<MainProduct> allEnabledMainProduct() {
  return mainProductRepository.findByEnableTrue();
}
origin: JoleneOL/market-manage

@GetMapping("/manageProductEdit")
public String indexForEdit(String code, Model model) {
  model.addAttribute("currentData", mainProductRepository.getOne(code));
  return "_productOperate.html";
}
origin: JoleneOL/market-manage

private void products() throws IOException {
  if (mainProductRepository.count() > 0) {
    mainProductRepository.findByProductTypeNull().forEach(product -> {
        log.info(product + "需要设置货品属性");
      mainProductRepository.save(product);
    });
    return;
      final String productName = value[0];
      MainProduct mainProduct = mainProductRepository.findOne(type);
      ProductType productType = productTypeRepository.findTop1ByName(productName);
      if (mainProduct == null) {
        mainProduct = mainProductRepository.save(mainProduct);
origin: JoleneOL/market-manage

  if (StringUtils.isEmpty(productName))
    throw new IllegalArgumentException("");
  if (mainProductRepository.findOne(code) != null)
    throw new IllegalArgumentException("");
  if (productTypeRepository.findOne(productType) == null)
  product.setCode(code);
} else {
  product = mainProductRepository.getOne(code);
product = mainProductRepository.saveAndFlush(product);
mainProductRepository.save(product);
if(isCleanProductStock){
  marketStockService.cleanProductStock(product);
origin: JoleneOL/market-manage

@GetMapping("/manageProductDetail")
public String detail(String code, Model model) {
  model.addAttribute("currentData", mainProductRepository.getOne(code));
  return "_productDetail.html";
}
origin: JoleneOL/market-manage

@PostMapping("/products")
@ResponseStatus(HttpStatus.NO_CONTENT)
@Transactional
public void disable(String code) {
  mainProductRepository.getOne(code).setEnable(false);
}
origin: JoleneOL/market-manage

@PutMapping("/products")
@ResponseStatus(HttpStatus.NO_CONTENT)
@Transactional
public void enable(String code) {
  mainProductRepository.getOne(code).setEnable(true);
}
origin: JoleneOL/market-manage

@DeleteMapping("/products")
@ResponseStatus(HttpStatus.NO_CONTENT)
@Transactional
public void delete(String code) {
  final MainProduct one = mainProductRepository.getOne(code);
  one.setEnable(false);
  one.setDeleted(true);
}
origin: JoleneOL/market-manage

@PutMapping("/productsHaier")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void pushHaier(String code) {
  MainProduct product = mainProductRepository.getOne(code);
  // 信息校验下先
  if (StringUtils.isEmpty(product.getBrand()))
    throw new IllegalArgumentException("");
  if (StringUtils.isEmpty(product.getUnit()))
    throw new IllegalArgumentException("");
  if (StringUtils.isEmpty(product.getSKU()))
    throw new IllegalArgumentException("");
  if (StringUtils.isEmpty(product.getMainCategory()))
    throw new IllegalArgumentException("");
  if (product.getVolumeHeight() == null)
    throw new IllegalArgumentException("");
  if (product.getVolumeHeight() == null)
    throw new IllegalArgumentException("");
  if (product.getVolumeWidth() == null)
    throw new IllegalArgumentException("");
  if (product.getWeight() == null)
    throw new IllegalArgumentException("");
  haierSupplier.updateProduct(product);
}
origin: JoleneOL/market-manage

good.setProduct(mainProductRepository.getOne(product));
cn.lmjia.market.core.repositoryMainProductRepository

Most used methods

  • findOne
  • save
  • count
  • findByEnableTrue
  • findByProductTypeNull
  • getOne
  • saveAndFlush

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • findViewById (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now