Commit f603ca62 authored by zhh's avatar zhh
Browse files

注释信息完善

parent a41633a9
......@@ -10,6 +10,7 @@ import java.util.Map;
/**
* 通用返回对象
* Created by macro on 2018/4/26.
*/
public class CommonResult {
//操作成功
......
......@@ -10,6 +10,7 @@ import javax.validation.constraints.NotNull;
/**
* 品牌传递参数
* Created by macro on 2018/4/26.
*/
public class PmsBrandParam {
@ApiModelProperty(value = "品牌名称",required = true)
......
......@@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.NotEmpty;
/**
* 商品属性参数
* Created by macro on 2018/4/26.
*/
public class PmsProductAttributeParam {
@ApiModelProperty("属性分类ID")
......
......@@ -8,6 +8,7 @@ import javax.validation.constraints.Min;
/**
* 添加更新产品分类的参数
* Created by macro on 2018/4/26.
*/
public class PmsProductCategoryParam {
@ApiModelProperty("父分类的编号")
......
......@@ -8,6 +8,7 @@ import java.util.List;
/**
* 创建和修改商品时使用的参数
* Created by macro on 2018/4/26.
*/
public class PmsProductParam {
@ApiModelProperty("商品信息")
......
......@@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.NotEmpty;
/**
* 用户登录参数
* Created by macro on 2018/4/26.
*/
public class UmsAdminLoginParam {
@ApiModelProperty(value = "用户名", required = true)
......
......@@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.NotEmpty;
/**
* 用户登录参数
* Created by macro on 2018/4/26.
*/
public class UmsAdminParam {
@ApiModelProperty(value = "用户名", required = true)
......
......@@ -7,6 +7,7 @@ import java.util.List;
/**
* 商品品牌Service
* Created by macro on 2018/4/26.
*/
public interface PmsBrandService {
List<PmsBrand> listAllBrand();
......
......@@ -6,6 +6,7 @@ import java.util.List;
/**
* 商品属性分类Service
* Created by macro on 2018/4/26.
*/
public interface PmsProductAttributeCategoryService {
int create(String name);
......
......@@ -7,6 +7,7 @@ import java.util.List;
/**
* 商品属性Service
* Created by macro on 2018/4/26.
*/
public interface PmsProductAttributeService {
/**
......
......@@ -7,6 +7,7 @@ import java.util.List;
/**
* 产品分类Service
* Created by macro on 2018/4/26.
*/
public interface PmsProductCategoryService {
int create(PmsProductCategoryParam pmsProductCategoryParam);
......
......@@ -4,6 +4,7 @@ import com.macro.mall.dto.PmsProductParam;
/**
* 商品管理Service
* Created by macro on 2018/4/26.
*/
public interface PmsProductService {
/**
......
......@@ -5,6 +5,7 @@ import com.macro.mall.model.UmsAdmin;
/**
* 后台管理员Service
* Created by macro on 2018/4/26.
*/
public interface UmsAdminService {
/**
......
......@@ -6,6 +6,7 @@ import java.util.List;
/**
* 会员等级管理Service
* Created by macro on 2018/4/26.
*/
public interface UmsMemberLevelService {
/**
......
......@@ -15,6 +15,7 @@ import java.util.List;
/**
* 商品品牌Service实现类
* Created by macro on 2018/4/26.
*/
@Service
public class PmsBrandServiceImpl implements PmsBrandService {
......
......@@ -12,6 +12,7 @@ import java.util.List;
/**
* PmsProductAttributeCategoryService实现类
* Created by macro on 2018/4/26.
*/
@Service
public class PmsProductAttributeCategoryServiceImpl implements PmsProductAttributeCategoryService {
......
......@@ -14,6 +14,7 @@ import java.util.List;
/**
* 商品属性Service实现类
* Created by macro on 2018/4/26.
*/
@Service
public class PmsProductAttributeServiceImpl implements PmsProductAttributeService {
......
......@@ -14,6 +14,7 @@ import java.util.List;
/**
* PmsProductCategoryService实现类
* Created by macro on 2018/4/26.
*/
@Service
public class PmsProductCategoryServiceImpl implements PmsProductCategoryService {
......
......@@ -20,7 +20,7 @@ import java.util.List;
* 商品管理Service实现类
*/
@Service
public class PmsProductServiceImpl implements PmsProductService{
public class PmsProductServiceImpl implements PmsProductService {
@Autowired
private PmsProductMapper productMapper;
@Autowired
......@@ -29,6 +29,7 @@ public class PmsProductServiceImpl implements PmsProductService{
private PmsProductLadderDao productLadderDao;
@Autowired
private PmsProductFullReductionDao productFullReductionDao;
@Override
public int create(PmsProductParam productParam) {
int count;
......@@ -38,43 +39,39 @@ public class PmsProductServiceImpl implements PmsProductService{
productMapper.insertSelective(product);
//根据促销类型设置价格:、阶梯价格、满减价格
Long productId = product.getId();
if(product.getPromotionType()==2){
//会员价格
List<PmsMemberPrice> memberPriceList = productParam.getPmsMemberPriceList();
if(!CollectionUtils.isEmpty(memberPriceList)){
for(PmsMemberPrice pmsMemberPrice: memberPriceList){
pmsMemberPrice.setId(null);
pmsMemberPrice.setProductId(productId);
}
memberPriceDao.insertList(memberPriceList);
//会员价格
List<PmsMemberPrice> memberPriceList = productParam.getPmsMemberPriceList();
if (!CollectionUtils.isEmpty(memberPriceList)) {
for (PmsMemberPrice pmsMemberPrice : memberPriceList) {
pmsMemberPrice.setId(null);
pmsMemberPrice.setProductId(productId);
}
}else if(product.getPromotionType()==3){
//阶梯价格
List<PmsProductLadder> productLadderList = productParam.getProductLadderList();
if(!CollectionUtils.isEmpty(productLadderList)){
for(PmsProductLadder productLadder:productLadderList){
productLadder.setId(null);
productLadder.setProductId(productId);
}
productLadderDao.insertList(productLadderList);
memberPriceDao.insertList(memberPriceList);
}
//阶梯价格
List<PmsProductLadder> productLadderList = productParam.getProductLadderList();
if (!CollectionUtils.isEmpty(productLadderList)) {
for (PmsProductLadder productLadder : productLadderList) {
productLadder.setId(null);
productLadder.setProductId(productId);
}
}else if(product.getPromotionType()==4){
//满减价格
List<PmsProductFullReduction> productFullReductionList = productParam.getPmsProductFullReductionList();
if(!CollectionUtils.isEmpty(productFullReductionList)){
for (PmsProductFullReduction productFullReduction: productFullReductionList) {
productFullReduction.setId(null);
productFullReduction.setProductId(productId);
}
productFullReductionDao.insertList(productFullReductionList);
productLadderDao.insertList(productLadderList);
}
//满减价格
List<PmsProductFullReduction> productFullReductionList = productParam.getPmsProductFullReductionList();
if (!CollectionUtils.isEmpty(productFullReductionList)) {
for (PmsProductFullReduction productFullReduction : productFullReductionList) {
productFullReduction.setId(null);
productFullReduction.setProductId(productId);
}
productFullReductionDao.insertList(productFullReductionList);
}
//添加sku库存信息
//添加商品参数
//添加自定义商品规格
//关联专题
//关联优选
count=1;
count = 1;
return count;
}
}
......@@ -25,6 +25,7 @@ import java.util.List;
/**
* UmsAdminService实现类
* Created by macro on 2018/4/26.
*/
@Service
public class UmsAdminServiceImpl implements UmsAdminService{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment