zhijiezhao před 1 rokem
rodič
revize
4c9d8a8b16

+ 2 - 0
src/main/java/com/caimei/modules/product/dao/CmPromotionDao.java

@@ -111,4 +111,6 @@ public interface CmPromotionDao extends CrudDao<CmPromotion> {
     void deleteOldTouchPrice(String promotionId);
 
     void insertNewTouchPrice(@Param("skuId")Integer skuId,@Param("touchPrice") Double touchPrice,@Param("promotionId")  String promotionId);
+
+    Integer findShopId(Integer productID);
 }

+ 5 - 1482
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -4,6 +4,7 @@ import com.caimei.modules.brand.entity.CmBrand;
 import com.caimei.po.ProductLadderPrice;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.thinkgem.jeesite.common.persistence.DataEntity;
+import lombok.Data;
 
 import java.beans.Transient;
 import java.math.BigDecimal;
@@ -11,6 +12,7 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
+@Data
 public class Product extends DataEntity<Product> {
     private String name;
     private String shopName;//供应商名称
@@ -116,7 +118,9 @@ public class Product extends DataEntity<Product> {
     private Double sqlSupplierTaxPoint;//供应商开票税点(基于不含税基础) :增值税默认13%,普通票6%取值范围[0-100]
     private Integer giftNumber;//赠品数量
     private BigDecimal reducedPrice;//优惠价格
-    private String promotionType;//促销类型
+    private String promotionType;//促销类型 1单品促销,2凑单促销,3店铺促销
+
+    private Integer promotionMode;//    促销方式:1优惠,2满减,3满赠
     private String delProductIds;//删除商品id
     private List<Integer> delIdList;//删除商品
     private String sold;//是否已售:0和空未出售,1已出售
@@ -300,1486 +304,5 @@ public class Product extends DataEntity<Product> {
     private Integer orderProductID;
     //税率
     private Double taxRate;
-    public List<CmOrganizeProductInfo> getCmOrganizeProductInfos() {
-        return cmOrganizeProductInfos;
-    }
-
-    public void setCmOrganizeProductInfos(List<CmOrganizeProductInfo> cmOrganizeProductInfos) {
-        this.cmOrganizeProductInfos = cmOrganizeProductInfos;
-    }
-    public String getOrganizeNameValidFlag() {
-        return organizeNameValidFlag;
-    }
-
-    public void setOrganizeNameValidFlag(String organizeNameValidFlag) {
-        this.organizeNameValidFlag = organizeNameValidFlag;
-    }
-
-    public String getLabelIds() {
-        return labelIds;
-    }
-
-    public void setLabelIds(String labelIds) {
-        this.labelIds = labelIds;
-    }
-
-    public String getRelatedLabels() {
-        return relatedLabels;
-    }
-
-    public void setRelatedLabels(String relatedLabels) {
-        this.relatedLabels = relatedLabels;
-    }
-
-    public Integer getSkuId() {
-        return skuId;
-    }
-
-    public void setSkuId(Integer skuId) {
-        this.skuId = skuId;
-    }
-
-    public List<CmSku> getSkuList() {
-        return skuList;
-    }
-
-    public void setSkuList(List<CmSku> skuList) {
-        this.skuList = skuList;
-    }
-
-    public List<CmSku> getMallSkuList() {
-        return mallSkuList;
-    }
-
-    public void setMallSkuList(List<CmSku> mallSkuList) {
-        this.mallSkuList = mallSkuList;
-    }
-
-    public String[] getValidFlagString() {
-        return validFlagString;
-    }
-
-    public void setValidFlagString(String[] validFlagString) {
-        this.validFlagString = validFlagString;
-    }
-
-    public String getQualificationNo() {
-        return qualificationNo;
-    }
-
-    public void setQualificationNo(String qualificationNo) {
-        this.qualificationNo = qualificationNo;
-    }
-
-    public String getProductName() {
-        return productName;
-    }
-
-    public void setProductName(String productName) {
-        this.productName = productName;
-    }
-
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    public String getQualificationTime() {
-        return qualificationTime;
-    }
-
-    public void setQualificationTime(String qualificationTime) {
-        this.qualificationTime = qualificationTime;
-    }
-
-    public String getQualificationLink() {
-        return qualificationLink;
-    }
-
-    public void setQualificationLink(String qualificationLink) {
-        this.qualificationLink = qualificationLink;
-    }
-
-    public Integer getNewProductType() {
-        return newProductType;
-    }
-
-    public void setNewProductType(Integer newProductType) {
-        this.newProductType = newProductType;
-    }
-
-    public Integer getShowFlag() {
-        return showFlag;
-    }
-
-    public void setShowFlag(Integer showFlag) {
-        this.showFlag = showFlag;
-    }
-
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    public String getShowTime() {
-        return showTime;
-    }
-
-    public void setShowTime(String showTime) {
-        this.showTime = showTime;
-    }
-
-
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    public String getNewshowTime() {
-        return newshowTime;
-    }
-
-    public void setNewshowTime(String newshowTime) {
-        this.newshowTime = newshowTime;
-    }
-
-    public Integer getRecommend() {
-        return recommend;
-    }
-
-    public void setRecommend(Integer recommend) {
-        this.recommend = recommend;
-    }
-
-    public Integer getNewvalidFlag() {
-        return newvalidFlag;
-    }
-
-    public void setNewvalidFlag(Integer newvalidFlag) {
-        this.newvalidFlag = newvalidFlag;
-    }
-
-    public String getBeautyActFlag() {
-        return beautyActFlag;
-    }
-
-    public void setBeautyActFlag(String beautyActFlag) {
-        this.beautyActFlag = beautyActFlag;
-    }
-
-    public Integer getAnnounType() {
-        return announType;
-    }
-
-    public void setAnnounType(Integer announType) {
-        this.announType = announType;
-    }
-
-    public Double getSqlShopPercent() {
-        return sqlShopPercent;
-    }
-
-    public void setSqlShopPercent(Double sqlShopPercent) {
-        this.sqlShopPercent = sqlShopPercent;
-    }
-
-    public Double getSqlTaxPoint() {
-        return sqlTaxPoint;
-    }
-
-    public void setSqlTaxPoint(Double sqlTaxPoint) {
-        this.sqlTaxPoint = sqlTaxPoint;
-    }
-
-    public Double getSqlCostPrice() {
-        return SqlCostPrice;
-    }
-
-    public void setSqlCostPrice(Double sqlCostPrice) {
-        SqlCostPrice = sqlCostPrice;
-    }
-
-    public Integer getShopType() {
-        return shopType;
-    }
-
-    public void setShopType(Integer shopType) {
-        this.shopType = shopType;
-    }
-
-    public Double getSqlSupplierTaxPoint() {
-        return sqlSupplierTaxPoint;
-    }
-
-    public void setSqlSupplierTaxPoint(Double sqlSupplierTaxPoint) {
-        this.sqlSupplierTaxPoint = sqlSupplierTaxPoint;
-    }
-
-    public String getCompanyName() {
-        return companyName;
-    }
-
-    public void setCompanyName(String companyName) {
-        this.companyName = companyName;
-    }
-
-    public String getImage1() {
-        return image1;
-    }
-
-    public void setImage1(String image1) {
-        this.image1 = image1;
-    }
-
-    public String getImage2() {
-        return image2;
-    }
-
-    public void setImage2(String image2) {
-        this.image2 = image2;
-    }
-
-    public String getImage3() {
-        return image3;
-    }
-
-    public void setImage3(String image3) {
-        this.image3 = image3;
-    }
-
-    public String getImage4() {
-        return image4;
-    }
-
-    public void setImage4(String image4) {
-        this.image4 = image4;
-    }
-
-    public String getImage5() {
-        return image5;
-    }
-
-    public void setImage5(String image5) {
-        this.image5 = image5;
-    }
-
-    public String getSplitCode() {
-        return splitCode;
-    }
-
-    public void setSplitCode(String splitCode) {
-        this.splitCode = splitCode;
-    }
-
-    public Integer getPublishIdentity() {
-        return publishIdentity;
-    }
-
-    public void setPublishIdentity(Integer publishIdentity) {
-        this.publishIdentity = publishIdentity;
-    }
-
-    public String getProductDescribe() {
-        return productDescribe;
-    }
-
-    public void setProductDescribe(String productDescribe) {
-        this.productDescribe = productDescribe;
-    }
-
-    public String getProductDetail() {
-        return productDetail;
-    }
-
-    public void setProductDetail(String productDetail) {
-        this.productDetail = productDetail;
-    }
-
-    public String getCommonDetailInfo() {
-        return commonDetailInfo;
-    }
-
-    public void setCommonDetailInfo(String commonDetailInfo) {
-        this.commonDetailInfo = commonDetailInfo;
-    }
-
-    public List<ProductLadderPrice> getLadderPriceList() {
-        return ladderPriceList;
-    }
-
-    public void setLadderPriceList(List<ProductLadderPrice> ladderPriceList) {
-        this.ladderPriceList = ladderPriceList;
-    }
-
-    public String getProductIds() {
-        return productIds;
-    }
-
-    public void setProductIds(String productIds) {
-        this.productIds = productIds;
-    }
-
-    public String getGroundMall() {
-        return groundMall;
-    }
-
-    public void setGroundMall(String groundMall) {
-        this.groundMall = groundMall;
-    }
-
-    public List<String> getOrganizeNames() {
-        return organizeNames;
-    }
-
-    public void setOrganizeNames(List<String> organizeNames) {
-        this.organizeNames = organizeNames;
-    }
-
-    public BigDecimal getActivityPrice() {
-        return activityPrice;
-    }
-
-    public void setActivityPrice(BigDecimal activityPrice) {
-        this.activityPrice = activityPrice;
-    }
-
-    public boolean isStoreStatus() {
-        return storeStatus;
-    }
-
-    public void setStoreStatus(boolean storeStatus) {
-        this.storeStatus = storeStatus;
-    }
-
-    public String getItemsList() {
-        return itemsList;
-    }
-
-    public void setItemsList(String itemsList) {
-        this.itemsList = itemsList;
-    }
-
-    public List<Integer> getIds() {
-        return ids;
-    }
-
-    public void setIds(List<Integer> ids) {
-        this.ids = ids;
-    }
-
-    private static final long serialVersionUID = 1L;
-
-    public String getDetailInfo() {
-        return detailInfo;
-    }
-
-    public void setDetailInfo(String detailInfo) {
-        this.detailInfo = detailInfo;
-    }
-
-    public String getServiceInfo() {
-        return serviceInfo;
-    }
-
-    public void setServiceInfo(String serviceInfo) {
-        this.serviceInfo = serviceInfo;
-    }
-
-    public String getOrderInfo() {
-        return orderInfo;
-    }
-
-    public void setOrderInfo(String orderInfo) {
-        this.orderInfo = orderInfo;
-    }
-
-    public Product() {
-        super();
-    }
-
-    public Product(String id) {
-        super(id);
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getValidFlag() {
-        return validFlag;
-    }
-
-    public void setValidFlag(String validFlag) {
-        this.validFlag = validFlag;
-    }
-
-    public String getDisplayOnCRMFlag() {
-        return displayOnCRMFlag;
-    }
-
-    public void setDisplayOnCRMFlag(String displayOnCRMFlag) {
-        this.displayOnCRMFlag = displayOnCRMFlag;
-    }
-
-    public Integer getProductID() {
-        return productID;
-    }
-
-    public void setProductID(Integer productID) {
-        this.productID = productID;
-    }
-
-    public Integer getBrandID() {
-        return brandID;
-    }
-
-    public void setBrandID(Integer brandID) {
-        this.brandID = brandID;
-    }
-
-    public Integer getTinyTypeID() {
-        return tinyTypeID;
-    }
-
-    public void setTinyTypeID(Integer tinyTypeID) {
-        this.tinyTypeID = tinyTypeID;
-    }
-
-    public Integer getShopID() {
-        return shopID;
-    }
-
-    public void setShopID(Integer shopID) {
-        this.shopID = shopID;
-    }
-
-    public String getSearchKey() {
-        return searchKey;
-    }
-
-    public void setSearchKey(String searchKey) {
-        this.searchKey = searchKey;
-    }
-
-    public String getPriceFlag() {
-        return priceFlag;
-    }
-
-    public void setPriceFlag(String priceFlag) {
-        this.priceFlag = priceFlag;
-    }
-
-
-    public String getLadderPriceFlag() {
-        return ladderPriceFlag;
-    }
-
-    public void setLadderPriceFlag(String ladderPriceFlag) {
-        this.ladderPriceFlag = ladderPriceFlag;
-    }
-
-    public String getStock() {
-        return stock;
-    }
-
-    public void setStock(String stock) {
-        this.stock = stock;
-    }
-
-    public String getHasSkuFlag() {
-        return hasSkuFlag;
-    }
-
-    public void setHasSkuFlag(String hasSkuFlag) {
-        this.hasSkuFlag = hasSkuFlag;
-    }
-
-    public String getMainImage() {
-        return mainImage;
-    }
-
-    public void setMainImage(String mainImage) {
-        this.mainImage = mainImage;
-    }
-
-    public String getPropertiesInfo() {
-        return propertiesInfo;
-    }
-
-    public void setPropertiesInfo(String propertiesInfo) {
-        this.propertiesInfo = propertiesInfo;
-    }
-
-    public String getAddTime() {
-        return addTime;
-    }
-
-    public void setAddTime(String addTime) {
-        this.addTime = addTime;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getSellNumber() {
-        return sellNumber;
-    }
-
-    public void setSellNumber(String sellNumber) {
-        this.sellNumber = sellNumber;
-    }
-
-    public String getBeforeValidFlag() {
-        return beforeValidFlag;
-    }
-
-    public void setBeforeValidFlag(String beforeValidFlag) {
-        this.beforeValidFlag = beforeValidFlag;
-    }
-
-    public String getFavoriteTimes() {
-        return favoriteTimes;
-    }
-
-    public void setFavoriteTimes(String favoriteTimes) {
-        this.favoriteTimes = favoriteTimes;
-    }
-
-    public String getCommentScore() {
-        return commentScore;
-    }
-
-    public void setCommentScore(String commentScore) {
-        this.commentScore = commentScore;
-    }
-
-    public String getCommentTimes() {
-        return commentTimes;
-    }
-
-    public void setCommentTimes(String commentTimes) {
-        this.commentTimes = commentTimes;
-    }
-
-    public String getSortIndex() {
-        return sortIndex;
-    }
-
-    public void setSortIndex(String sortIndex) {
-        this.sortIndex = sortIndex;
-    }
-
-    public String getFeaturedFlag() {
-        return featuredFlag;
-    }
-
-    public void setFeaturedFlag(String featuredFlag) {
-        this.featuredFlag = featuredFlag;
-    }
-
-    public String getFeaturedSortIndex() {
-        return featuredSortIndex;
-    }
-
-    public void setFeaturedSortIndex(String featuredSortIndex) {
-        this.featuredSortIndex = featuredSortIndex;
-    }
-
-    public String getProductCode() {
-        return productCode;
-    }
-
-    public void setProductCode(String productCode) {
-        this.productCode = productCode;
-    }
-
-    public String getUnit() {
-        return unit;
-    }
-
-    public void setUnit(String unit) {
-        this.unit = unit;
-    }
-
-    public String getAllAreaFlag() {
-        return allAreaFlag;
-    }
-
-    public void setAllAreaFlag(String allAreaFlag) {
-        this.allAreaFlag = allAreaFlag;
-    }
-
-    public String getProvinceIDs() {
-        return provinceIDs;
-    }
-
-    public void setProvinceIDs(String provinceIDs) {
-        this.provinceIDs = provinceIDs;
-    }
-
-    public String getServiceNumber() {
-        return serviceNumber;
-    }
-
-    public void setServiceNumber(String serviceNumber) {
-        this.serviceNumber = serviceNumber;
-    }
-
-    public String getMaxBuyNumber() {
-        return maxBuyNumber;
-    }
-
-    public void setMaxBuyNumber(String maxBuyNumber) {
-        this.maxBuyNumber = maxBuyNumber;
-    }
-
-    public String getMinBuyNumber() {
-        return minBuyNumber;
-    }
-
-    public void setMinBuyNumber(String minBuyNumber) {
-        this.minBuyNumber = minBuyNumber;
-    }
-
-    public String getPackageCount() {
-        return packageCount;
-    }
-
-    public void setPackageCount(String packageCount) {
-        this.packageCount = packageCount;
-    }
-
-    public String getByFlag() {
-        return byFlag;
-    }
-
-    public void setByFlag(String byFlag) {
-        this.byFlag = byFlag;
-    }
-
-    public String getNormalProductFlag() {
-        return normalProductFlag;
-    }
-
-    public void setNormalProductFlag(String normalProductFlag) {
-        this.normalProductFlag = normalProductFlag;
-    }
-
-    public String getStep() {
-        return step;
-    }
-
-    public void setStep(String step) {
-        this.step = step;
-    }
-
-    public String getActFlag() {
-        return actFlag;
-    }
-
-    public void setActFlag(String actFlag) {
-        this.actFlag = actFlag;
-    }
-
-    public String getActType() {
-        return actType;
-    }
-
-    public void setActType(String actType) {
-        this.actType = actType;
-    }
-
-    public Date getOnlineTime() {
-        return onlineTime;
-    }
-
-    public void setOnlineTime(Date onlineTime) {
-        this.onlineTime = onlineTime;
-    }
-
-    public Date getDownlineTime() {
-        return downlineTime;
-    }
-
-    public void setDownlineTime(Date downlineTime) {
-        this.downlineTime = downlineTime;
-    }
-
-    public String getFreePostFlag() {
-        return freePostFlag;
-    }
-
-    public void setFreePostFlag(String freePostFlag) {
-        this.freePostFlag = freePostFlag;
-    }
-
-    public String getCostPrice() {
-        return costPrice;
-    }
-
-    public void setCostPrice(String costPrice) {
-        this.costPrice = costPrice;
-    }
-
-    public String getShopPercent() {
-        return shopPercent;
-    }
-
-    public void setShopPercent(String shopPercent) {
-        this.shopPercent = shopPercent;
-    }
-
-    public String getCostCheckFlag() {
-        return costCheckFlag;
-    }
-
-    public void setCostCheckFlag(String costCheckFlag) {
-        this.costCheckFlag = costCheckFlag;
-    }
-
-    public String getMallCostCheckFlag() {
-        return mallCostCheckFlag;
-    }
-
-    public void setMallCostCheckFlag(String mallCostCheckFlag) {
-        this.mallCostCheckFlag = mallCostCheckFlag;
-    }
-
-    public String getPrecisehKey() {
-        return precisehKey;
-    }
-
-    public void setPrecisehKey(String precisehKey) {
-        this.precisehKey = precisehKey;
-    }
-
-    public String getShopName() {
-        return shopName;
-    }
-
-    public void setShopName(String shopName) {
-        this.shopName = shopName;
-    }
-
-    public String getGiftFlag() {
-        return giftFlag;
-    }
-
-    public void setGiftFlag(String giftFlag) {
-        this.giftFlag = giftFlag;
-    }
-
-    public Double getNormalPrice() {
-        return normalPrice;
-    }
-
-    public void setNormalPrice(Double normalPrice) {
-        this.normalPrice = normalPrice;
-    }
-
-    public Double getPrice() {
-        return price;
-    }
-
-    public void setPrice(Double price) {
-        this.price = price;
-    }
-
-    public String getBeginTimeStr() {
-        return beginTimeStr;
-    }
-
-    public void setBeginTimeStr(String beginTimeStr) {
-        this.beginTimeStr = beginTimeStr;
-    }
-
-    public String getEndTimeStr() {
-        return endTimeStr;
-    }
-
-    public void setEndTimeStr(String endTimeStr) {
-        this.endTimeStr = endTimeStr;
-    }
-
-    public String getActStatus() {
-        return actStatus;
-    }
-
-    public void setActStatus(String actStatus) {
-        this.actStatus = actStatus;
-    }
-
-    @Transient
-    public boolean isCustomClass() {
-        return customClass;
-    }
-
-    public void setCustomClass(boolean customClass) {
-        this.customClass = customClass;
-    }
-
-    @Transient
-    public String getBrandName() {
-        return brandName;
-    }
-
-    public void setBrandName(String brandName) {
-        this.brandName = brandName;
-    }
-
-    public String getOtherBrandName() {
-        return otherBrandName;
-    }
-
-    public void setOtherBrandName(String otherBrandName) {
-        this.otherBrandName = otherBrandName;
-    }
-
-    @Transient
-    public String getDefaultType() {
-        return defaultType;
-    }
-
-    public void setDefaultType(String defaultType) {
-        this.defaultType = defaultType;
-    }
-
-    @Transient
-    public String getDefaultTypeName() {
-        return defaultTypeName;
-    }
-
-    public void setDefaultTypeName(String defaultTypeName) {
-        this.defaultTypeName = defaultTypeName;
-    }
-
-    public String getActSort() {
-        return actSort;
-    }
-
-    public void setActSort(String actSort) {
-        this.actSort = actSort;
-    }
-
-    public Integer getBigTypeID() {
-        return bigTypeID;
-    }
-
-    public void setBigTypeID(Integer bigTypeID) {
-        this.bigTypeID = bigTypeID;
-    }
-
-    public Integer getSmallTypeID() {
-        return smallTypeID;
-    }
-
-    public void setSmallTypeID(Integer smallTypeID) {
-        this.smallTypeID = smallTypeID;
-    }
-
-    public String getActTime() {
-        return actTime;
-    }
-
-    public void setActTime(String actTime) {
-        this.actTime = actTime;
-    }
-
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    public Date getActCreateTime() {
-        return actCreateTime;
-    }
-
-    public void setActCreateTime(Date actCreateTime) {
-        this.actCreateTime = actCreateTime;
-    }
-
-    public String getActCreateTimeStr() {
-        return actCreateTimeStr;
-    }
-
-    public void setActCreateTimeStr(String actCreateTimeStr) {
-        this.actCreateTimeStr = actCreateTimeStr;
-    }
-
-    public String getRecommendType() {
-        return recommendType;
-    }
-
-    public void setRecommendType(String recommendType) {
-        this.recommendType = recommendType;
-    }
-
-    public String getSort() {
-        return sort;
-    }
-
-    public void setSort(String sort) {
-        this.sort = sort;
-    }
-
-    public Integer getRecommendProductId() {
-        return recommendProductId;
-    }
-
-    public void setRecommendProductId(Integer recommendProductId) {
-        this.recommendProductId = recommendProductId;
-    }
-
-    public String getExistsFlag() {
-        return existsFlag;
-    }
-
-    public void setExistsFlag(String existsFlag) {
-        this.existsFlag = existsFlag;
-    }
-
-    public Integer getPreferredFlag() {
-        return preferredFlag;
-    }
-
-    public void setPreferredFlag(Integer preferredFlag) {
-        this.preferredFlag = preferredFlag;
-    }
-
-    public String getAliasName() {
-        return aliasName;
-    }
-
-    public void setAliasName(String aliasName) {
-        this.aliasName = aliasName;
-    }
-
-    public String getVisibility() {
-        return visibility;
-    }
-
-    public void setVisibility(String visibility) {
-        this.visibility = visibility;
-    }
-
-    public String getCommodityDetailsFlag() {
-        return commodityDetailsFlag;
-    }
-
-    public void setCommodityDetailsFlag(String commodityDetailsFlag) {
-        this.commodityDetailsFlag = commodityDetailsFlag;
-    }
-
-    public String getTags() {
-        return tags;
-    }
-
-    public void setTags(String tags) {
-        this.tags = tags;
-    }
-
-    public String getMachineType() {
-        return machineType;
-    }
-
-    public void setMachineType(String machineType) {
-        this.machineType = machineType;
-    }
-
-    public Integer getCombinationID() {
-        return combinationID;
-    }
-
-    public void setCombinationID(Integer combinationID) {
-        this.combinationID = combinationID;
-    }
-
-    public Integer getCombinationSort() {
-        return combinationSort;
-    }
-
-    public void setCombinationSort(Integer combinationSort) {
-        this.combinationSort = combinationSort;
-    }
-
-    public String getProductRemarks() {
-        return productRemarks;
-    }
-
-    public void setProductRemarks(String productRemarks) {
-        this.productRemarks = productRemarks;
-    }
-
-    public List<String> getSearchKeyList() {
-        return searchKeyList;
-    }
-
-    public void setSearchKeyList(List<String> searchKeyList) {
-        this.searchKeyList = searchKeyList;
-    }
-
-    public List<ProductParameters> getProductParametersList() {
-        return productParametersList;
-    }
-
-    public String getProductType() {
-        return productType;
-    }
-
-    public void setProductType(String productType) {
-        this.productType = productType;
-    }
-
-    public void setProductParametersList(List<ProductParameters> productParametersList) {
-        this.productParametersList = productParametersList;
-    }
-
-    public String getQualificationImg() {
-        return qualificationImg;
-    }
-
-    public void setQualificationImg(String qualificationImg) {
-        this.qualificationImg = qualificationImg;
-    }
-
-    public String getIncludedTax() {
-        return includedTax;
-    }
-
-    public void setIncludedTax(String includedTax) {
-        this.includedTax = includedTax;
-    }
-
-    public String getInvoiceType() {
-        return invoiceType;
-    }
-
-    public void setInvoiceType(String invoiceType) {
-        this.invoiceType = invoiceType;
-    }
-
-    public String getTaxPoint() {
-        return taxPoint;
-    }
-
-    public void setTaxPoint(String taxPoint) {
-        this.taxPoint = taxPoint;
-    }
-
-    public String getSupplierTaxPoint() {
-        return supplierTaxPoint;
-    }
-
-    public void setSupplierTaxPoint(String supplierTaxPoint) {
-        this.supplierTaxPoint = supplierTaxPoint;
-    }
-
-    public String getSearchName() {
-        return searchName;
-    }
-
-    public void setSearchName(String searchName) {
-        this.searchName = searchName;
-    }
-
-    public String getSearchShopName() {
-        return searchShopName;
-    }
-
-    public void setSearchShopName(String searchShopName) {
-        this.searchShopName = searchShopName;
-    }
-
-    public Integer getSearchShopID() {
-        return searchShopID;
-    }
-
-    public void setSearchShopID(Integer searchShopID) {
-        this.searchShopID = searchShopID;
-    }
-
-    public String getSearchCommodityType() {
-        return searchCommodityType;
-    }
-
-    public void setSearchCommodityType(String searchCommodityType) {
-        this.searchCommodityType = searchCommodityType;
-    }
-
-    public Integer getSearchBigTypeID() {
-        return searchBigTypeID;
-    }
-
-    public void setSearchBigTypeID(Integer searchBigTypeID) {
-        this.searchBigTypeID = searchBigTypeID;
-    }
-
-    public Integer getSearchSmallTypeID() {
-        return searchSmallTypeID;
-    }
-
-    public void setSearchSmallTypeID(Integer searchSmallTypeID) {
-        this.searchSmallTypeID = searchSmallTypeID;
-    }
-
-    public Integer getSearchTinyTypeID() {
-        return searchTinyTypeID;
-    }
-
-    public void setSearchTinyTypeID(Integer searchTinyTypeID) {
-        this.searchTinyTypeID = searchTinyTypeID;
-    }
-
-    public String getSearchValidFlag() {
-        return searchValidFlag;
-    }
-
-    public void setSearchValidFlag(String searchValidFlag) {
-        this.searchValidFlag = searchValidFlag;
-    }
-
-    public String getSearchActStatus() {
-        return searchActStatus;
-    }
-
-    public void setSearchActStatus(String searchActStatus) {
-        this.searchActStatus = searchActStatus;
-    }
-
-    public String getSearchProductType() {
-        return searchProductType;
-    }
-
-    public void setSearchProductType(String searchProductType) {
-        this.searchProductType = searchProductType;
-    }
-
-    public Integer getSearchBrandID() {
-        return searchBrandID;
-    }
-
-    public void setSearchBrandID(Integer searchBrandID) {
-        this.searchBrandID = searchBrandID;
-    }
-
-    public Integer getSearchPreferredFlag() {
-        return searchPreferredFlag;
-    }
-
-    public void setSearchPreferredFlag(Integer searchPreferredFlag) {
-        this.searchPreferredFlag = searchPreferredFlag;
-    }
-
-    public CmBrand getBrand() {
-        return brand;
-    }
-
-    public void setBrand(CmBrand brand) {
-        this.brand = brand;
-    }
-
-    public String getProductCategory() {
-        return productCategory;
-    }
-
-    public void setProductCategory(String productCategory) {
-        this.productCategory = productCategory;
-    }
-
-    public String getSecondHandType() {
-        return secondHandType;
-    }
-
-    public void setSecondHandType(String secondHandType) {
-        this.secondHandType = secondHandType;
-    }
-
-    public String getInstrumentType() {
-        return instrumentType;
-    }
-
-    public void setInstrumentType(String instrumentType) {
-        this.instrumentType = instrumentType;
-    }
-
-    public String getSearchProductCategory() {
-        return searchProductCategory;
-    }
-
-    public void setSearchProductCategory(String searchProductCategory) {
-        this.searchProductCategory = searchProductCategory;
-    }
-
-    public String getEditFlag() {
-        return editFlag;
-    }
-
-    public void setEditFlag(String editFlag) {
-        this.editFlag = editFlag;
-    }
-
-    public Integer getGiftNumber() {
-        return giftNumber;
-    }
-
-    public void setGiftNumber(Integer giftNumber) {
-        this.giftNumber = giftNumber;
-    }
-
-    public BigDecimal getReducedPrice() {
-        return reducedPrice;
-    }
-
-    public void setReducedPrice(BigDecimal reducedPrice) {
-        this.reducedPrice = reducedPrice;
-    }
-
-    public String getPromotionType() {
-        return promotionType;
-    }
-
-    public void setPromotionType(String promotionType) {
-        this.promotionType = promotionType;
-    }
-
-    public String getDelProductIds() {
-        return delProductIds;
-    }
-
-    public void setDelProductIds(String delProductIds) {
-        this.delProductIds = delProductIds;
-    }
-
-    public List<Integer> getDelIdList() {
-        return delIdList;
-    }
-
-    public void setDelIdList(List<Integer> delIdList) {
-        this.delIdList = delIdList;
-    }
-
-    public String getSold() {
-        return sold;
-    }
-
-    public void setSold(String sold) {
-        this.sold = sold;
-    }
-
-    public String getPayStatus() {
-        return payStatus;
-    }
-
-    public void setPayStatus(String payStatus) {
-        this.payStatus = payStatus;
-    }
-
-    public String getContactName() {
-        return contactName;
-    }
-
-    public void setContactName(String contactName) {
-        this.contactName = contactName;
-    }
-
-    public BigDecimal getOriginalPrice() {
-        return originalPrice;
-    }
-
-    public void setOriginalPrice(BigDecimal originalPrice) {
-        this.originalPrice = originalPrice;
-    }
-
-    public String getSubmitDate() {
-        return submitDate;
-    }
-
-    public void setSubmitDate(String submitDate) {
-        this.submitDate = submitDate;
-    }
-
-    public String getReviewedDate() {
-        return reviewedDate;
-    }
-
-    public void setReviewedDate(String reviewedDate) {
-        this.reviewedDate = reviewedDate;
-    }
-
-    public String getOnLineDate() {
-        return onLineDate;
-    }
-
-    public void setOnLineDate(String onLineDate) {
-        this.onLineDate = onLineDate;
-    }
-
-    public String getPublisher() {
-        return publisher;
-    }
-
-    public void setPublisher(String publisher) {
-        this.publisher = publisher;
-    }
-
-    public String getCommodityType() {
-        return commodityType;
-    }
-
-    public void setCommodityType(String commodityType) {
-        this.commodityType = commodityType;
-    }
-
-    public String getSource() {
-        return source;
-    }
-
-    public void setSource(String source) {
-        this.source = source;
-    }
-
-    public Integer getOrganizeId() {
-        return organizeId;
-    }
-
-    public void setOrganizeId(Integer organizeId) {
-        this.organizeId = organizeId;
-    }
-
-    public String getProductIdStr() {
-        return productIdStr;
-    }
-
-    public void setProductIdStr(String productIdStr) {
-        this.productIdStr = productIdStr;
-    }
-
-    public String getDockingPeopleName() {
-        return dockingPeopleName;
-    }
-
-    public void setDockingPeopleName(String dockingPeopleName) {
-        this.dockingPeopleName = dockingPeopleName;
-    }
-
-    public Integer getFloorId() {
-        return floorId;
-    }
-
-    public void setFloorId(Integer floorId) {
-        this.floorId = floorId;
-    }
-
-    public Integer getTrainingMethod() {
-        return trainingMethod;
-    }
-
-    public void setTrainingMethod(Integer trainingMethod) {
-        this.trainingMethod = trainingMethod;
-    }
-
-    public Integer getTrainingType() {
-        return trainingType;
-    }
-
-    public void setTrainingType(Integer trainingType) {
-        this.trainingType = trainingType;
-    }
-
-    public BigDecimal getTrainingFee() {
-        return trainingFee;
-    }
-
-    public void setTrainingFee(BigDecimal trainingFee) {
-        this.trainingFee = trainingFee;
-    }
-
-    public Integer getSvipFlag() {
-        return svipFlag;
-    }
-
-    public void setSvipFlag(Integer svipFlag) {
-        this.svipFlag = svipFlag;
-    }
-
-    public Integer getSearchType() {
-        return searchType;
-    }
-
-    public void setSearchType(Integer searchType) {
-        this.searchType = searchType;
-    }
-
-    public String getMobile() {
-        return mobile;
-    }
-
-    public void setMobile(String mobile) {
-        this.mobile = mobile;
-    }
-
-    public Integer getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Integer userId) {
-        this.userId = userId;
-    }
-
-    public String getReceiptID() {
-        return receiptID;
-    }
-
-    public void setReceiptID(String receiptID) {
-        this.receiptID = receiptID;
-    }
-
-    public Integer getShopOrderID() {
-        return shopOrderID;
-    }
-
-    public void setShopOrderID(Integer shopOrderID) {
-        this.shopOrderID = shopOrderID;
-    }
-
-    public Integer getOrderProductID() {
-        return orderProductID;
-    }
-
-    public void setOrderProductID(Integer orderProductID) {
-        this.orderProductID = orderProductID;
-    }
-
-    public Double getTaxRate() {
-        return taxRate;
-    }
-
-    public void setTaxRate(Double taxRate) {
-        this.taxRate = taxRate;
-    }
-
-    public Integer getReturnGoodsStutas() {
-        return returnGoodsStutas;
-    }
-
-    public void setReturnGoodsStutas(Integer returnGoodsStutas) {
-        this.returnGoodsStutas = returnGoodsStutas;
-    }
-
-    public Integer getInsertStatus() {
-        return insertStatus;
-    }
-
-    public void setInsertStatus(Integer insertStatus) {
-        this.insertStatus = insertStatus;
-    }
-
-    public Integer getIsRelevance() {
-        return isRelevance;
-    }
-
-    public void setIsRelevance(Integer isRelevance) {
-        this.isRelevance = isRelevance;
-    }
-
-    public String getKeywords() {
-        return keywords;
-    }
 
-    public void setKeywords(String keywords) {
-        this.keywords = keywords;
-    }
 }

+ 16 - 4
src/main/java/com/caimei/modules/product/service/CmPromotionService.java

@@ -192,11 +192,23 @@ public class CmPromotionService extends CrudService<CmPromotionDao, CmPromotion>
      * 查询促销可用商品
      */
     public Page findProductPage(Page<Product> productPage, Product product) {
-        if (!"1".equals(product.getPromotionType())) {
-            // 非单品锁死综合供应商,店铺满赠选择店铺shopid
-            if (!"3".equals(product.getPromotionType())) {
-                product.setShopID(1161);
+        /**
+         * 单品促销
+         * 满赠时,赠品只能选择和该促销单品相同供应商的商品
+         * 凑单促销
+         * 1.满赠时,凑单商品和赠品都只能选择[综合供应商]的商品
+         * 店铺促销
+         * 1.赠品只能在已选好的供应商的商品内选择
+         */
+        if ("1".equals(product.getPromotionType())) {
+            // 单品满赠
+            if (3 == product.getPromotionMode()) {
+                product.setShopID(cmPromotionDao.findShopId(product.getProductID()));
+                product.setProductID(null);
             }
+        } else if ("2".equals(product.getPromotionType())) {
+            // 凑单
+            product.setShopID(1161);
         }
         product.setPage(productPage);
         List<Integer> list = new ArrayList<>();

+ 1 - 1
src/main/java/com/caimei/modules/product/web/CmPromotionController.java

@@ -425,7 +425,7 @@ public class CmPromotionController extends BaseController {
     @RequiresPermissions("product:product:view")
     @RequestMapping(value = "findProductPage")
     public String findProductPage(Product product, Model model, HttpServletRequest request, HttpServletResponse response) {
-        //todo 非单品促销的时候当前版本限制死仅可选择综合供应商
+        //todo 非单品促销的时候当前版本限制死仅可选择综合供应商,赠品仅可选择和促销商品同一供应商
         Page page = cmPromotionService.findProductPage(new Page<Product>(request, response), product);
         model.addAttribute("page", page);
         model.addAttribute("promotionType", product.getPromotionType());

+ 4 - 0
src/main/resources/mappings/modules/product/CmPromotionMapper.xml

@@ -490,6 +490,10 @@
         WHERE cs.productId = #{productIds} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
 
+    <select id="findShopId" resultType="java.lang.Integer">
+        select shopId from prodduct where productId = #{productID}
+    </select>
+
     <delete id="deletePromotion">
         delete
         from cm_promotions_gift

+ 14 - 3
src/main/webapp/WEB-INF/views/modules/product-new/singlePromotionForm.jsp

@@ -164,6 +164,13 @@
 
         //选择添加商品
         function showSelect(type) {
+            var productId = $("#productCheckItem").val();
+            if (2 == type) {
+                if (!productId) {
+                    alertx("请先选择促销商品!");
+                    return false;
+                }
+            }
             var showSelectProductID = '';
             var url = '';
             var title = '';
@@ -182,7 +189,7 @@
                     var $itemProductID = $this.find('input[name="gift"]').val();
                     showSelectProductID += $itemProductID + ',';
                 });
-                url = "${ctx}/product/cmPromotions/findProductPage?productIds=" + showSelectProductID
+                url = "${ctx}/product/cmPromotions/findProductPage?productIds=" + showSelectProductID + "&promotionType=1&promotionMode=3&productID=" + productId;
                 title = "选择促销赠品";
             }
             showSelectProductID = showSelectProductID.slice(0, -1)
@@ -394,8 +401,12 @@
                     <tr>
                         <td hidden><input name="skus[${s.index}].skuId" value="${sku.skuId}"></td>
                         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格:${sku.unit}</td>
-                        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;优惠价:<input class="required" name="skus[${s.index}].touchPrice" value="${sku.touchPrice}" type="number"/></td>
-                        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;成本类型:${sku.costCheckFlag eq 1?'固定成本':'比例成本'}</td>
+                        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;优惠价:<input class="required"
+                                                                                       name="skus[${s.index}].touchPrice"
+                                                                                       value="${sku.touchPrice}"
+                                                                                       type="number"/></td>
+                        <td>
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;成本类型:${sku.costCheckFlag eq 1?'固定成本':'比例成本'}</td>
                         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                             <c:if test="${sku.costCheckFlag eq 1}">
                                 成本价格:¥${sku.costPrice}