2 files added
1 files deleted
15 files modified
| | |
| | | AjaxResult calculationCartOrder(@RequestBody AddShopOrderPOJO addShopOrderPOJO) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); //计算购物车中物品的优惠信息 |
| | | |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId()); |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId(),ShopShoppingCart.CAR_TYPE_MICRO); |
| | | |
| | | |
| | | //取出购物车中选中的产品 |
| | |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.dto.SaleProductDto; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.bean.ShopProductAttribute; |
| | | import com.matrix.system.shopXcx.dao.ShopProductAttributeDao; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | |
| | | }) |
| | | public AjaxResult getShopProductShowList(@RequestBody @Validated SaleProductDto saleProductDto) { |
| | | ShopProduct shopProduct=new ShopProduct(); |
| | | |
| | | ShopProductAttribute fxsc = shopProductAttributeDao.selectByCode("fxsc", HostInterceptor.getCompanyId()); |
| | | shopProduct.setLimit(saleProductDto.getPageSize()); |
| | | shopProduct.setOffset((saleProductDto.getPageNum()-1)* saleProductDto.getPageSize()); |
| | | shopProduct.setCategoryId(saleProductDto.getCategoryId()); |
| | | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); |
| | | shopProduct.setStatus(AppConstance.IS_PUTAWAY); |
| | | shopProduct.setAbleSales(ShopProduct.ABLE_SALES); |
| | | shopProduct.setCompanyId(HostInterceptor.getCompanyId()); |
| | | shopProduct.setAttrs(fxsc.getAttrId()+""); |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); |
| | | shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopProducts); |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.shopXcx.api.dto.SaleProductDto; |
| | | import com.matrix.system.shopXcx.api.dto.ScoreProductDto; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import com.matrix.system.shopXcx.dao.ShopProductDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2021-03-10 |
| | | **/ |
| | | @Api(tags = "积分商品类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/scoreProduct") |
| | | public class WxScoreProductAction { |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | | |
| | | @Autowired |
| | | private ShopSkuDao shopSkuDao; |
| | | |
| | | @ApiOperation(value = "查询积分商品", notes = "") |
| | | @PostMapping(value = "/getScoreProductList") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response=SaleProductDto.class) |
| | | }) |
| | | public AjaxResult getShopProductShowList(@RequestBody @Validated ScoreProductDto scoreProductDto) { |
| | | ShopProduct shopProduct=new ShopProduct(); |
| | | shopProduct.setLimit(scoreProductDto.getPageSize()); |
| | | shopProduct.setOffset((scoreProductDto.getPageNum()-1)* scoreProductDto.getPageSize()); |
| | | shopProduct.setScoreCategoryId(scoreProductDto.getScoreCategoryId()); |
| | | shopProduct.setDelFlag(AppConstance.DATA_USEABLE); |
| | | shopProduct.setStatus(AppConstance.IS_PUTAWAY); |
| | | shopProduct.setAbleSales(ShopProduct.NOT_ABLE_SALES); |
| | | shopProduct.setMallType(ShopProduct.MALL_SCORE); |
| | | shopProduct.setCompanyId(HostInterceptor.getCompanyId()); |
| | | List<ShopProduct> shopProducts = shopProductDao.selectByModelWx(shopProduct); |
| | | shopProducts.forEach(item->item.setSkus(shopSkuDao.selectByPid(item.getId()))); |
| | | return AjaxResult.buildSuccessInstance(shopProducts); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ResponseBody |
| | | public AjaxResult getShopProductShowList(@RequestBody ShopProduct shopProduct) { |
| | | List<ShopProduct> shopProducts = null; |
| | | |
| | | shopProduct.setMallType(ShopProduct.MALL_MICRO); |
| | | //查询是否匹配优惠条件 |
| | | ShopCoupon shopCoupon = shopCouponDao.getCouponByTitle(shopProduct.getTitle(),HostInterceptor.getCompanyId()); |
| | | if (shopCoupon != null && shopProduct.getOffset() < 1) { |
| | |
| | | @PostMapping("/findShoppingCart") |
| | | @ResponseBody |
| | | public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) { |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(shoppingCart.getShopId()); |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(shoppingCart.getShopId(),ShopShoppingCart.CAR_TYPE_MICRO); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, cartList, cartList.size()); |
| | | ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(cartList); |
| | | result.putInMap("billTotal", shopCartBill.getBillTotal().stripTrailingZeros().toPlainString()); |
| | |
| | | shoppingCart.setCreateBy(loginUser.getOpenId()); |
| | | shoppingCart.setUpdateBy(loginUser.getOpenId()); |
| | | shoppingCart.setCartUserId(loginUser.getOpenId()); |
| | | shoppingCart.setCartType(ShopShoppingCart.CAR_TYPE_MICRO); |
| | | ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(), |
| | | shoppingCart.getCartSkuId()); |
| | | // Integer buyLimitNum = 0; |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import com.matrix.core.pojo.BasePageQueryDto; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ScoreProductDto", description = "积分产品查询参数接收类") |
| | | public class ScoreProductDto extends BasePageQueryDto { |
| | | |
| | | @ApiModelProperty(value = "产品分类", example = "1") |
| | | private Integer scoreCategoryId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | * @param shopId |
| | | */ |
| | | public List<ShopCartVo> findUserCartList(Long shopId) { |
| | | public List<ShopCartVo> findUserCartList(Long shopId,Integer cartType) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String userId = loginUser.getOpenId(); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shopId,userId); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shopId,userId,cartType); |
| | | List<ShopCartVo> cartList = buildShopCart(list); |
| | | return cartList; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId()); |
| | | List<ShopCartVo> cartList = shoppingCartService.findUserCartList(addShopOrderPOJO.getShopId(),ShopShoppingCart.CAR_TYPE_MICRO); |
| | | //购物车不能为空 |
| | | if (CollectionUtils.isEmpty(cartList)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "请选择您需要购买的产品"); |
| | |
| | | public class ShopShoppingCart extends EntityDTOExt { |
| | | @Extend |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | *购物车类型-微商城 |
| | | */ |
| | | public static final int CAR_TYPE_MICRO =1; |
| | | /** |
| | | *购物车类型-积分商城 |
| | | */ |
| | | public static final int CAR_TYPE_SCORE=2; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * 用户是否选中 1选中 2未选中 |
| | | */ |
| | | private Integer isSelected; |
| | | /** |
| | | * 购物车类型 1微商城 2积分商城 |
| | | */ |
| | | private Integer cartType; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 门店id |
| | |
| | | return shopCoupons; |
| | | } |
| | | |
| | | public Integer getCartType() { |
| | | return cartType; |
| | | } |
| | | |
| | | public void setCartType(Integer cartType) { |
| | | this.cartType = cartType; |
| | | } |
| | | } |
| | |
| | | this.goodsName = goodsName; |
| | | } |
| | | |
| | | public Integer getScorePrice() { |
| | | return scorePrice; |
| | | } |
| | | |
| | | public void setScorePrice(Integer scorePrice) { |
| | | this.scorePrice = scorePrice; |
| | | } |
| | | |
| | | @Override |
| | | public boolean equals(Object obj) { |
| | | //这里以name为判定标准。 |
| | |
| | | |
| | | public ShopShoppingCart selectById(Integer cartId); |
| | | |
| | | public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId); |
| | | public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId,@Param("cartType") Integer cartType); |
| | | |
| | | public ShopShoppingCart selectForUpdate(Integer cartId); |
| | | |
| | |
| | | ADD COLUMN `able_sales` int(2) NULL COMMENT '是否为分销产品' AFTER `score_category_id`, |
| | | ADD COLUMN `mall_type` int(2) NULL COMMENT '上架卖场' AFTER `able_sales`; |
| | | |
| | | update shop_product set mall_type=1; |
| | | update shop_product set able_sales=2; |
| | | |
| | | ALTER TABLE `shop_shopping_cart` |
| | | ADD COLUMN `cart_type` int(2) NOT NULL COMMENT '购物车类型 1微商城 2积分商城' AFTER `company_id`; |
| | | |
| | | |
| | | update shop_shopping_cart set cart_type=1; |
| | | |
| | |
| | | <result property="couponId" column="couponId"></result> |
| | | <result property="serviceTime" column="service_time"></result> |
| | | <result property="companyId" column="company_id"/> |
| | | |
| | | <result property="mallType" column="mall_type"/> |
| | | <result property="ableSales" column="able_sales"/> |
| | | <result property="scoreCategoryId" column="score_category_id"/> |
| | | |
| | | <association property="shopCoupon" select="com.matrix.system.shopXcx.dao.ShopCouponDao.selectById" |
| | | column="{id=couponId}"></association> |
| | |
| | | <result property="couponId" column="couponId"></result> |
| | | <result property="serviceTime" column="service_time"></result> |
| | | <result property="companyId" column="company_id"/> |
| | | <result property="mallType" column="mall_type"/> |
| | | <result property="ableSales" column="able_sales"/> |
| | | <result property="scoreCategoryId" column="score_category_id"/> |
| | | </resultMap> |
| | | |
| | | <sql id="columns"> |
| | |
| | | is_service, |
| | | service_time, |
| | | shop_ids, |
| | | company_id |
| | | company_id, |
| | | mall_type, |
| | | able_sales, |
| | | score_category_id |
| | | |
| | | </sql> |
| | | |
| | | <!-- 属性sql --> |
| | |
| | | #{item.isService}, |
| | | #{item.serviceTime}, |
| | | #{item.shopIds}, |
| | | #{item.companyId} |
| | | #{item.companyId}, |
| | | #{item.mallType}, |
| | | #{item.ableSales}, |
| | | #{item.scoreCategoryId} |
| | | |
| | | </sql> |
| | | <!-- where sql --> |
| | | <sql id="where_sql"> |
| | |
| | | and a.company_id = #{record.companyId} |
| | | </if> |
| | | |
| | | <if test="record.mallType != null and record.mallType !='' "> |
| | | and a.mall_type = #{record.mallType} |
| | | </if> |
| | | <if test="record.ableSales != null and record.ableSales !='' "> |
| | | and a.able_sales = #{record.ableSales} |
| | | </if> |
| | | <if test="record.scoreCategoryId != null and record.scoreCategoryId "> |
| | | and a.score_category_id = #{record.scoreCategoryId} |
| | | </if> |
| | | |
| | | </if> |
| | | |
| | |
| | | |
| | | and b.attr_full_path like concat('%/',#{record.attrs},'/%') |
| | | </if> |
| | | |
| | | <if test="record.mallType != null and record.mallType !='' "> |
| | | and a.mall_type = #{record.mallType} |
| | | </if> |
| | | <if test="record.ableSales != null and record.ableSales !='' "> |
| | | and a.able_sales = #{record.ableSales} |
| | | </if> |
| | | <if test="record.scoreCategoryId != null and record.scoreCategoryId "> |
| | | and a.score_category_id = #{record.scoreCategoryId} |
| | | </if> |
| | | |
| | | |
| | | </if> |
| | | |
| | |
| | | <if test="_parameter.containsKey('companyId')"> |
| | | company_id = #{companyId}, |
| | | </if> |
| | | <if test="_parameter.containsKey('scoreCategoryId')"> |
| | | score_category_id = #{scoreCategoryId}, |
| | | </if> |
| | | <if test="_parameter.containsKey('ableSales')"> |
| | | able_sales = #{ableSales}, |
| | | </if> |
| | | <if test="_parameter.containsKey('mallType')"> |
| | | mall_type = #{mallType}, |
| | | </if> |
| | | |
| | | |
| | | </set> |
| | | WHERE id=#{id} |
| | |
| | | shop_ids = #{record.shopIds}, |
| | | </if> |
| | | |
| | | <if test="record.mallType != null and record.mallType !='' "> |
| | | mall_type = #{record.mallType}, |
| | | </if> |
| | | <if test="record.ableSales != null and record.ableSales !='' "> |
| | | able_sales = #{record.ableSales}, |
| | | </if> |
| | | <if test="record.scoreCategoryId != null and record.scoreCategoryId "> |
| | | score_category_id = #{record.scoreCategoryId}, |
| | | </if> |
| | | |
| | | </set> |
| | | WHERE id=#{record.id} |
| | |
| | | a.marked_price, |
| | | b.attr_full_path, |
| | | a.couponId, |
| | | a.mall_type, |
| | | a.able_sales, |
| | | a.score_category_id, |
| | | (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum, |
| | | GROUP_CONCAT(DISTINCT(s.atrid) order by a.id SEPARATOR ',') atrid |
| | | from shop_product a left join shop_product_attr_ref b on a.id = b.p_id |
| | |
| | | a.marked_price, |
| | | a.service_time, |
| | | a.couponId, |
| | | a.mall_type, |
| | | a.able_sales, |
| | | a.score_category_id, |
| | | (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum |
| | | from shop_product a |
| | | where a.id in (${productIds}) and shop_ids=#{shopId} |
| | |
| | | a.marked_price, |
| | | b.attr_full_path, |
| | | a.couponId, |
| | | a.mall_type, |
| | | a.able_sales, |
| | | a.score_category_id, |
| | | a.service_time, |
| | | (SELECT ROUND(SUM(ss.stock),2) from shop_sku ss where ss.p_id = a.id) as stockNum, |
| | | GROUP_CONCAT(DISTINCT(s.atrid) order by a.id SEPARATOR ',') atrid |
| | |
| | | b.attr_full_path, |
| | | a.service_time, |
| | | a.couponId, |
| | | a.mall_type, |
| | | a.able_sales, |
| | | a.score_category_id, |
| | | (SELECT ROUND(SUM(s.stock),2) from shop_sku s where s.p_id = a.id) as stockNum, |
| | | (SELECT COUNT(p.com_id) from shop_product_comment p where p.product_id=a.id and p.del_flag=2 and p.com_audit_status=1 and p.com_score=5) as comment |
| | | from shop_product a |
| | |
| | | <if test="(record.shopIds!=null and record.shopIds!='') or (record.shopIds!='' and record.shopIds==0) "> |
| | | and find_in_set(#{record.shopIds}, a.shop_ids) |
| | | </if> |
| | | |
| | | <if test="record.mallType != null and record.mallType !='' "> |
| | | and a.mall_type = #{record.mallType} |
| | | </if> |
| | | <if test="record.ableSales != null and record.ableSales !='' "> |
| | | and a.able_sales = #{record.ableSales} |
| | | </if> |
| | | <if test="record.scoreCategoryId != null and record.scoreCategoryId "> |
| | | and a.score_category_id = #{record.scoreCategoryId} |
| | | </if> |
| | | |
| | | |
| | | </where> |
| | | GROUP BY a.id |
| | | <if test="record.queryType != null and record.queryType == 1"> |
| | |
| | | is_special_price, |
| | | marked_price, |
| | | couponId, |
| | | a.mall_type, |
| | | a.able_sales, |
| | | a.score_category_id, |
| | | (SELECT SUM(s.stock) from shop_sku s where s.p_id = a.id) as stockNum, |
| | | (SELECT ROUND(SUM(s.stock),2) from shop_sku s where s.p_id = a.id) as stockNum, |
| | | shop_ids |
| | |
| | | <result property="isSelected" column="isSelected" /> |
| | | <result property="shopId" column="shop_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="cartType" column="cart_type" /> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | <result property="isSelected" column="isSelected" /> |
| | | <result property="shopId" column="shop_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | <result property="cartType" column="cart_type" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- 字段sql --> |
| | |
| | | cart_number, |
| | | isSelected, |
| | | shop_id, |
| | | company_id |
| | | company_id, |
| | | cart_type |
| | | |
| | | </sql> |
| | | |
| | | <!-- 属性sql --> |
| | |
| | | #{item.cartNumber}, |
| | | #{item.isSelected}, |
| | | #{item.shopId}, |
| | | #{item.companyId} |
| | | #{item.companyId}, |
| | | #{item.cartType} |
| | | |
| | | </sql> |
| | | |
| | | <!-- where sql --> |
| | |
| | | |
| | | <if test="record.companyId != null and record.companyId !='' "> |
| | | and c.company_id = #{record.companyId} |
| | | </if> |
| | | |
| | | <if test="record.cartType != null and record.cartType !='' "> |
| | | and c.cart_type = #{record.cartType} |
| | | </if> |
| | | |
| | | </if> |
| | |
| | | and p.STATUS = 1 |
| | | and p.del_flag = 2 |
| | | and c.cart_user_id = #{cartUserId} |
| | | and c.cart_type = #{cartType} |
| | | order by c.create_time desc |
| | | </select> |
| | | |
| | |
| | | <result property="shopId" column="shop_id"/> |
| | | <result property="sealesPrice" column="seales_price"/> |
| | | <result property="invitationPrice" column="invitation_price"/> |
| | | <result property="scorePrice" column="score_price"/> |
| | | |
| | | |
| | | |
| | |
| | | <result property="shopId" column="shop_id"/> |
| | | <result property="sealesPrice" column="seales_price"/> |
| | | <result property="invitationPrice" column="invitation_price"/> |
| | | <result property="scorePrice" column="score_price"/> |
| | | </resultMap> |
| | | |
| | | <!-- 字段sql --> |
| | |
| | | stock_code, |
| | | shop_id, |
| | | seales_price, |
| | | invitation_price |
| | | invitation_price, |
| | | score_price |
| | | |
| | | </sql> |
| | | |
| | | <!-- 属性sql --> |
| | |
| | | #{item.stockCode}, |
| | | #{item.shopId}, |
| | | #{item.sealesPrice}, |
| | | #{item.invitationPrice} |
| | | #{item.invitationPrice}, |
| | | #{item.scorePrice} |
| | | |
| | | |
| | | </sql> |
| | | |
| | |
| | | <if test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> |
| | | and shop_id = #{record.shopId} |
| | | </if> |
| | | |
| | | <if test="(record.scorePrice!=null and record.scorePrice!='') or (record.scorePrice!='' and record.scorePrice==0) "> |
| | | and score_price = #{record.scorePrice} |
| | | </if> |
| | | |
| | | |
| | | |
| | | </if> |
| | | |
| | | </sql> |
| | |
| | | <if test="_parameter.containsKey('sealesPrice')"> |
| | | seales_price = #{sealesPrice}, |
| | | </if> |
| | | |
| | | <if test="_parameter.containsKey('scorePrice')"> |
| | | score_price = #{scorePrice}, |
| | | </if> |
| | | |
| | | |
| | | </set> |
| | | WHERE id=#{id} |
| | | </update> |
| | |
| | | invitation_price = #{record.invitationPrice}, |
| | | </if> |
| | | |
| | | <if test="record.scorePrice != null "> |
| | | score_price = #{record.scorePrice}, |
| | | </if> |
| | | |
| | | |
| | | </set> |
| | | WHERE id=#{record.id} |
| | |
| | | <div class="panel-heading">基本信息</div> |
| | | <div class="panel-body"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">分类ID |
| | | <label class="col-sm-2 control-label">产品分类 |
| | | <span class="text-danger">*</span> |
| | | </label> |
| | | <div class="col-sm-4"> |
| | |
| | | maxLength="1000" dataType="*" |
| | | th:value="${obj.briefIntroduction}" nullmsg="产品简介不能为空"> |
| | | </div> |
| | | <label class="col-sm-2 control-label">是否可分销 |
| | | <span class="text-danger">*</span> |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <select th:field="${obj.ableSales}" class="form-control select2 " size="1" |
| | | name="ableSales" |
| | | id="ableSales" style="width: 100%"> |
| | | <option value="1" th:selected="${obj.ableSales == '1'}">可分销</option> |
| | | <option value="2" th:selected="${obj.ableSales == '2'}">不可分销</option> |
| | | </option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">上架卖场 |
| | | <span class="text-danger">*</span> |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <select th:field="${obj.mallType}" class="form-control select2 " size="1" |
| | | name="mallType" |
| | | id="mallType" style="width: 100%"> |
| | | <option value="1" th:selected="${obj.mallType == '1'}">微商城</option> |
| | | <option value="2" th:selected="${obj.mallType == '2'}">积分商城</option> |
| | | </option> |
| | | </select> |
| | | </div> |
| | | <label class="col-sm-2 control-label">积分商城分类 |
| | | <span class="text-danger">*</span> |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control select2 " size="1" name="scoreCategoryId" |
| | | id="scoreCategoryId" style="width: 100%"> |
| | | </select> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | dataType="n" nullmsg="展示销量不能为空" |
| | | th:value="${obj.dsVolume}" errormsg="请填写数字"> |
| | | </div> |
| | | <!--<label class="col-sm-2 control-label">运费 |
| | | <span class="text-danger">*</span> |
| | | </label> |
| | | <div class="col-sm-4"> |
| | | <input autocomplete="off" type="text" class="form-control" name="carriage" |
| | | maxLength="250" datatype="*" |
| | | th:value="${obj.carriage}" nullmsg="运费不能为空"> |
| | | </div>--> |
| | | |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">限购数量 |
| | |
| | | <th>规格图片地址<span class="text-danger">*</span></th> |
| | | <th>库存<span class="text-danger">*</span></th> |
| | | <th>价格<span class="text-danger">*</span></th> |
| | | <th>积分</th> |
| | | <th>消费可得积分</th> |
| | | <th>关联ERP产品</th> |
| | | <th>排序</th> |
| | | <th>推广提成</th> |
| | | <th>邀请提成</th> |
| | | <th>兑换所需积分</th> |
| | | <th>操作</th> |
| | | </tr> |
| | | </table> |
| | |
| | | }); |
| | | $(function () { |
| | | initSeclect("#parentId",[[${obj.categoryId}]]); |
| | | initScoreSeclect("#scoreCategoryId",[[${obj.scoreCategoryId}]]); |
| | | |
| | | |
| | | initAttrSeclect("#attrIds"); |
| | | $("#mobileDetails").html(obj.mobileDetails); |
| | | $("#pcDetails").html(obj.pcDetails); |
| | |
| | | if (invitationPrice == null || typeof invitationPrice == 'undefined') { |
| | | invitationPrice = ""; |
| | | } |
| | | var scorePrice = shopSkus[c].scorePrice; |
| | | if (scorePrice == null || typeof scorePrice == 'undefined') { |
| | | scorePrice = ""; |
| | | } |
| | | |
| | | |
| | | var html= |
| | |
| | | +'<td><input autocomplete="off" type="text" class="form-control" value="'+sort+'" name=""></td>' |
| | | +'<td><input autocomplete="off" type="text" class="form-control" value="'+sealesPrice+'" name=""></td>' |
| | | +'<td><input autocomplete="off" type="text" class="form-control" value="'+invitationPrice+'" name=""></td>' |
| | | +'<td><input autocomplete="off" type="text" class="form-control" value="'+scorePrice+'" name=""></td>' |
| | | +'<td><i class="fa fa-trash form-control-static" onclick="delThis(\''+trId+'\')"></i></td>' |
| | | +'</tr>'; |
| | | $("#skutable").find("tbody").append(html); |
| | |
| | | }); |
| | | }); |
| | | } |
| | | //初始化分积分商城分类ID |
| | | function initScoreSeclect(seler, def) { |
| | | $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=jfsccpfl&status=1", |
| | | function (loj) { |
| | | $(seler).createSelectTree( |
| | | loj.attr("result").rows, |
| | | { |
| | | id: "attrId", |
| | | parent: "parentId", |
| | | value: "attrName", |
| | | append: false, |
| | | defaultValue: def, |
| | | defaultHtml: '' |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | //添加图片节点 |
| | | function addImgTr() { |
| | |
| | | if (i != 0) { |
| | | var tds = $(this).find("td"); |
| | | var length = tds.length - 1; |
| | | var id = tds.eq(length - 10).find("input").val(); |
| | | var id = tds.eq(length - 11).find("input").val(); |
| | | if(id == null){ |
| | | id =""; |
| | | } |
| | | sku.id = id; |
| | | |
| | | //规格名称 |
| | | var name = tds.eq(length - 9).find("input").val(); |
| | | var name = tds.eq(length - 10).find("input").val(); |
| | | if(name == null){ |
| | | name = ""; |
| | | } |
| | | sku.name = name; |
| | | |
| | | //图片地址 |
| | | var path = tds.eq(length - 8).find("img").attr("src"); |
| | | var path = tds.eq(length - 9).find("img").attr("src"); |
| | | if(path == null){ |
| | | path = ""; |
| | | } |
| | | sku.imgPath = path; |
| | | |
| | | //库存 |
| | | var stock = tds.eq(length - 7).find("input").val(); |
| | | var stock = tds.eq(length - 8).find("input").val(); |
| | | if(stock == ""){ |
| | | stock = 0; |
| | | } |
| | | sku.stock = stock; |
| | | |
| | | //价格 |
| | | var price = tds.eq(length -6).find("input").val(); |
| | | var price = tds.eq(length -7).find("input").val(); |
| | | if(price == ""){ |
| | | price =0; |
| | | } |
| | | sku.price = price; |
| | | |
| | | //积分 |
| | | var score = tds.eq(length - 5).find("input").val(); |
| | | var score = tds.eq(length - 6).find("input").val(); |
| | | if(score == ""){ |
| | | score = 0; |
| | | } |
| | | sku.score = score; |
| | | |
| | | //品种编码 |
| | | var stockCode = tds.eq(length - 4).find("input").val(); |
| | | var stockCode = tds.eq(length - 5).find("input").val(); |
| | | if(stockCode == null || typeof stockCode == 'undefined'){ |
| | | stockCode = ''; |
| | | } |
| | | sku.stockCode = stockCode; |
| | | |
| | | //排序 |
| | | var sort = tds.eq(length - 3).find("input").val(); |
| | | var sort = tds.eq(length - 4).find("input").val(); |
| | | if(sort == ""){ |
| | | sort = 0; |
| | | } |
| | | sku.sort = sort; |
| | | |
| | | //推广提成 |
| | | var sealesPrice = tds.eq(length - 2).find("input").val(); |
| | | var sealesPrice = tds.eq(length - 3).find("input").val(); |
| | | sku.sealesPrice = sealesPrice; |
| | | |
| | | //邀请提成 |
| | | var invitationPrice = tds.eq(length - 1).find("input").val(); |
| | | var invitationPrice = tds.eq(length - 2).find("input").val(); |
| | | sku.invitationPrice = invitationPrice; |
| | | |
| | | //兑换所需积分 |
| | | var scorePrice = tds.eq(length - 1).find("input").val(); |
| | | sku.scorePrice = scorePrice; |
| | | |
| | | skus.push(sku); |
| | | } |
| | |
| | | |
| | | return skus; |
| | | } |
| | | |
| | | |
| | | /*验证sku表格中的参数*/ |
| | | function getSkusValues() { |
| | |
| | | if (i != 0) { |
| | | var tds = $(this).find("td"); |
| | | var length = tds.length - 1; |
| | | var name = tds.eq(length - 9).find("input").val(); |
| | | var name = tds.eq(length - 10).find("input").val(); |
| | | if(name == ""){ |
| | | layer.msg("请填写规格名称",{ |
| | | icon : 2, |
| | |
| | | return false; |
| | | } |
| | | |
| | | var stock = tds.eq(length -7).find("input").val(); |
| | | var stock = tds.eq(length -8).find("input").val(); |
| | | if(stock == ""){ |
| | | layer.msg("请填写库存",{ |
| | | icon : 2, |
| | |
| | | flag = true; |
| | | return false; |
| | | } |
| | | var price = tds.eq(length - 6).find("input").val(); |
| | | var price = tds.eq(length - 7 ).find("input").val(); |
| | | if(price == ""){ |
| | | layer.msg("请填写价格",{ |
| | | icon : 2, |
| | |
| | | <input autocomplete="off" id="search-text" name="title" placeholder="输入查询关键词" |
| | | type="text" class="form-control"> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="control-label">上架卖场</label> |
| | | <select style="width:100px;" class="form-control select2" size="1" |
| | | name="mallType" > |
| | | <option value="">请选择</option> |
| | | <option value="1">微商城</option> |
| | | <option value="2">积分商城</option> |
| | | </select> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="control-label">是否上架</label> |
| | | <select style="width:200px;" class="form-control select2" size="1" |
| | | <select style="width:100px;" class="form-control select2" size="1" |
| | | name="status" |
| | | id="status"> |
| | | <option value="">请选择</option> |
| | |
| | | </select> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="control-label">是否为服务</label> |
| | | <select style="width:200px;" class="form-control select2" size="1" |
| | | name="isService" |
| | | id="isService"> |
| | | <label class="control-label">是否可分销</label> |
| | | <select style="width:100px;" class="form-control select2" size="1" |
| | | name="ableSales" |
| | | id="ableSales"> |
| | | <option value="">请选择</option> |
| | | <option value="1">是</option> |
| | | <option value="2">否</option> |
| | |
| | | <tr> |
| | | <th data-checkbox="true"></th> |
| | | <th data-formatter="MGrid.indexfn" data-align="center">序号</th> |
| | | <th data-field="id" data-align="center">产品ID</th> |
| | | <th data-field="mallType" data-align="center" data-formatter="mallType">上架卖场</th> |
| | | <th data-field="title" data-align="center">产品名称</th> |
| | | <th data-field="imgMobile" data-align="center" data-formatter="MGrid.getImage">产品图片</th> |
| | | <th data-field="attrValues" data-align="center" data-formatter="formatAttr">产品属性</th> |
| | | <th data-field="price" data-align="center">价格</th> |
| | | <th data-field="score" data-align="center">积分</th> |
| | | <th data-field="scorePrice" data-align="center">兑换所需积分</th> |
| | | <th data-field="status" data-align="center" data-formatter="isStatus">是否上架</th> |
| | | <th data-field="rsVolume" data-align="center">真实销量</th> |
| | | |
| | |
| | | //初始化属性下拉选 |
| | | function initAttrsSeclect(seler, def) { |
| | | console.log(1); |
| | | $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=cpfl", |
| | | $.AjaxProxy().invoke(basePath + "/admin/shopProductAttribute/showSonAttribute?attrCode=productColumn", |
| | | function (loj) { |
| | | $(seler).createSelectTree( |
| | | loj.attr("result").rows, |
| | |
| | | }); |
| | | } |
| | | |
| | | function mallType(value, row, index) { |
| | | var html = ""; |
| | | if (value ==1) { |
| | | html="微商城" |
| | | }else{ |
| | | html="积分商城" |
| | | } |
| | | return html; |
| | | } |
| | | |
| | | /** |
| | | * 格式化属性 |
| | | */ |