Commit f603ca62 authored by zhh's avatar zhh
Browse files

注释信息完善

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