public int save(ItemSupplyQO qo) { ItemSupply record = new ItemSupply(); BeanUtils.copyProperties(qo, record); record.setFacePrice(qo.getFacePrice()); record.setCostPrice(BigDecimalUtils.integerMultiply(qo.getCostPrice())); return dao.save(record); }
@Override public int save(ItemSupply record) { record.setGmtCreate(new Date()); record.setGmtModified(new Date()); return this.itemSupplyMapper.insertSelective(record); }
List<ItemSupply> listFieItemSupply = new ArrayList<>(); for (ItemSupply itemSupply : listItemSuppley) { if (!itemSupply.getItemStatus().equals(ItemStatusEnum.UP.getCode())) { logger.warn("商品没上架-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; if (itemSupply.getCostPrice().compareTo(orderTrade.getSalesPrice()) > 0) { logger.warn("商品的成本价大于商品的销售价-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; SupplyInfo supplyInfo = supplyInfoDao.getById(itemSupply.getSupplyInfoId()); if (ObjectUtils.isEmpty(supplyInfo)) { logger.warn("找不到合适的供货商-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; logger.warn("该供货商状态不可用-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; orderTrade.setCostPrice(itemSupply.getCostPrice()); orderTrade.setItemSupplyId(itemSupply.getId()); orderTrade.setSupplyCount(orderTrade.getSupplyCount().intValue() + 1); orderTrade.setSupplyIndex(orderTrade.getSupplyIndex().intValue() + 1);// 索引加1
public int updateById(ItemSupplyQO qo) { ItemSupply record = new ItemSupply(); BeanUtils.copyProperties(qo, record); if (ObjectUtil.isNotNull(qo.getCostPrice())) { record.setCostPrice(BigDecimalUtils.integerMultiply(qo.getCostPrice())); } return dao.updateById(record); }
@Override public int updateById(ItemSupply record) { record.setGmtModified(new Date()); return this.itemSupplyMapper.updateByPrimaryKeySelective(record); }
public int statusById(ItemSupplyQO qo) { ItemSupply record = new ItemSupply(); BeanUtils.copyProperties(qo, record); return dao.updateById(record); }
List<ItemSupply> listFieItemSupply = new ArrayList<>(); for (ItemSupply itemSupply : listItemSuppley) { if (!itemSupply.getItemStatus().equals(ItemStatusEnum.UP.getCode())) { logger.warn("货商品没上架-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; if (itemSupply.getCostPrice().compareTo(orderTrade.getSalesPrice()) > 0) { logger.warn("商品的成本价大于商品的销售价-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; SupplyInfo supplyInfo = supplyInfoDao.getById(itemSupply.getSupplyInfoId()); if (ObjectUtils.isEmpty(supplyInfo)) { logger.warn("找不到合适的供货商-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; logger.warn("该供货商状态不可用-供货商品ID={}, 商品编号={},状态={}", itemSupply.getId(), itemSupply.getItemNo(), itemSupply.getItemStatus()); continue; orderTrade.setCostPrice(itemSupply.getCostPrice()); orderTrade.setItemSupplyId(itemSupply.getId()); orderTrade.setSupplyCount(orderTrade.getSupplyCount().intValue() + 1); orderTrade.setSupplyIndex(orderTrade.getSupplyIndex().intValue() + 1);// 索引加1