use of com.itrus.portal.db.ProductSpec in project portal by ixinportal.
the class ProductSpecServiceImpl method getProductSpec.
/**
* 获取订单list对应的规格Map
*
* @param billList
* @return
*/
public Map<Long, ProductSpec> getProductSpec(List<Bill> billList) {
Map<Long, ProductSpec> productSpecMap = new HashMap<Long, ProductSpec>();
List<Long> productSpecIds = new ArrayList<Long>();
for (Bill bill : billList) {
if (null != bill.getProductSpec() && 0 != bill.getProductSpec()) {
productSpecIds.add(bill.getProductSpec());
}
if (null != bill.getProductSpec1() && 0 != bill.getProductSpec1()) {
productSpecIds.add(bill.getProductSpec1());
}
if (null != bill.getProductSpec2() && 0 != bill.getProductSpec2()) {
productSpecIds.add(bill.getProductSpec2());
}
if (null != bill.getProductSpec3() && 0 != bill.getProductSpec3()) {
productSpecIds.add(bill.getProductSpec3());
}
}
if (productSpecIds.isEmpty())
return productSpecMap;
ProductSpecExample example = new ProductSpecExample();
ProductSpecExample.Criteria criteria = example.or();
criteria.andIdIn(productSpecIds);
productSpecMap = sqlSession.selectMap("com.itrus.portal.db.ProductSpecMapper.selectByExample", example, "id");
return productSpecMap;
}
use of com.itrus.portal.db.ProductSpec in project portal by ixinportal.
the class ProductSpecServiceImpl method updateProductSpecByProduct.
/**
* 根据产品id,将产品规格对应的优惠价格设置为null
* @param productId
* @throws Exception
*/
public void updateProductSpecByProduct(Long productId) throws Exception {
List<ProductSpec> productSpecList = getProductSpecs(productId, true);
for (ProductSpec productSpec : productSpecList) {
productSpec.setProductField1(null);
updateProductSpec(productSpec);
}
}
Aggregations