jyy
2021-03-18 a5c67e27c22831e54e0a4b9eb22166368d446673
积分商城1
2 files added
1 files deleted
15 files modified
554 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java 141 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java 65 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java 18 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java 27 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java 8 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/db/increment/推广员.sql 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml 85 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml 16 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml 27 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html 103 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html 36 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopShoppingCartAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
@@ -97,7 +97,7 @@
    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);
        //取出购物车中选中的产品
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesProductAction.java
@@ -5,7 +5,6 @@
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;
@@ -47,14 +46,13 @@
    })
    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);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxScoreProductAction.java
New file
@@ -0,0 +1,65 @@
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);
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java
@@ -146,7 +146,7 @@
    @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) {
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
@@ -75,7 +75,7 @@
    @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());
@@ -136,6 +136,7 @@
        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;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreProductDto.java
New file
@@ -0,0 +1,18 @@
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;
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/ShoppingCartService.java
@@ -79,10 +79,10 @@
     * @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;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java
@@ -134,7 +134,7 @@
        }
        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, "请选择您需要购买的产品");
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
@@ -14,7 +14,16 @@
 */
public class ShopShoppingCart  extends EntityDTOExt {
    @Extend
    private static final long serialVersionUID = 1L;
    private static final long serialVersionUID = 1L;
    /**
     *购物车类型-微商城
     */
    public static  final int CAR_TYPE_MICRO =1;
    /**
     *购物车类型-积分商城
     */
    public static  final int CAR_TYPE_SCORE=2;
    
    /**
@@ -50,6 +59,12 @@
     * 用户是否选中 1选中  2未选中
     */
    private Integer isSelected;
    /**
     * 购物车类型 1微商城  2积分商城
     */
    private Integer cartType;
    /**
     * 门店id
@@ -324,6 +339,12 @@
    public List<ShopCoupon> getShopCoupons() {
        return shopCoupons;
    }
    public Integer getCartType() {
        return cartType;
    }
    public void setCartType(Integer cartType) {
        this.cartType = cartType;
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSku.java
@@ -256,6 +256,14 @@
        this.goodsName = goodsName;
    }
    public Integer getScorePrice() {
        return scorePrice;
    }
    public void setScorePrice(Integer scorePrice) {
        this.scorePrice = scorePrice;
    }
    @Override
    public boolean equals(Object obj) {
        //这里以name为判定标准。
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java
@@ -36,7 +36,7 @@
    
    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);
zq-erp/src/main/resources/config/db/increment/推广员.sql
@@ -191,5 +191,12 @@
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;
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductDao.xml
@@ -42,7 +42,9 @@
        <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>
@@ -82,6 +84,9 @@
        <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">
@@ -115,7 +120,11 @@
            is_service,
            service_time,
            shop_ids,
            company_id
            company_id,
        mall_type,
        able_sales,
        score_category_id
    </sql>
    <!-- 属性sql -->
@@ -150,7 +159,11 @@
            #{item.isService},
            #{item.serviceTime},
            #{item.shopIds},
            #{item.companyId}
            #{item.companyId},
            #{item.mallType},
            #{item.ableSales},
            #{item.scoreCategoryId}
    </sql>
    <!-- where sql -->
    <sql id="where_sql">
@@ -239,6 +252,15 @@
                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>
@@ -313,6 +335,17 @@
                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>
@@ -420,6 +453,16 @@
            <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}
@@ -502,6 +545,15 @@
                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}
@@ -590,6 +642,9 @@
        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
@@ -630,6 +685,9 @@
        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}
@@ -667,6 +725,9 @@
        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
@@ -732,6 +793,9 @@
        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
@@ -773,6 +837,18 @@
            <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">
@@ -830,6 +906,9 @@
            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
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
@@ -27,6 +27,7 @@
            <result property="isSelected" column="isSelected" />
            <result property="shopId" column="shop_id" />
        <result property="companyId" column="company_id" />
        <result property="cartType" column="cart_type" />
    </resultMap>
    
    
@@ -44,6 +45,8 @@
        <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 -->
@@ -59,7 +62,9 @@
            cart_number,
            isSelected,
            shop_id,
            company_id
            company_id,
        cart_type
    </sql>
    
    <!-- 属性sql -->
@@ -75,7 +80,9 @@
            #{item.cartNumber},
            #{item.isSelected},
            #{item.shopId},
        #{item.companyId}
        #{item.companyId},
        #{item.cartType}
    </sql>
    
    <!-- where sql -->
@@ -121,6 +128,10 @@
             <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>
@@ -334,6 +345,7 @@
            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>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopSkuDao.xml
@@ -24,6 +24,7 @@
        <result property="shopId" column="shop_id"/>
        <result property="sealesPrice" column="seales_price"/>
        <result property="invitationPrice" column="invitation_price"/>
        <result property="scorePrice" column="score_price"/>
@@ -50,6 +51,7 @@
        <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 -->
@@ -72,7 +74,9 @@
            stock_code,
            shop_id,
seales_price,
invitation_price
invitation_price,
        score_price
    </sql>
    <!-- 属性sql -->
@@ -95,7 +99,9 @@
            #{item.stockCode},
            #{item.shopId},
            #{item.sealesPrice},
            #{item.invitationPrice}
            #{item.invitationPrice},
            #{item.scorePrice}
    </sql>
@@ -136,6 +142,13 @@
            <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>
@@ -202,6 +215,12 @@
            <if test="_parameter.containsKey('sealesPrice')">
                seales_price = #{sealesPrice},
            </if>
            <if test="_parameter.containsKey('scorePrice')">
                score_price = #{scorePrice},
            </if>
        </set>
        WHERE id=#{id}
    </update>
@@ -252,6 +271,10 @@
                invitation_price = #{record.invitationPrice},
            </if>
            <if test="record.scorePrice != null ">
                score_price = #{record.scorePrice},
            </if>
        </set>
        WHERE id=#{record.id}
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-form.html
@@ -42,7 +42,7 @@
                        <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">
@@ -69,6 +69,40 @@
                                           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">
@@ -87,14 +121,7 @@
                                           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">限购数量
@@ -226,11 +253,12 @@
                                    <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>
@@ -395,6 +423,9 @@
    });
    $(function () {
        initSeclect("#parentId",[[${obj.categoryId}]]);
        initScoreSeclect("#scoreCategoryId",[[${obj.scoreCategoryId}]]);
        initAttrSeclect("#attrIds");
        $("#mobileDetails").html(obj.mobileDetails);
        $("#pcDetails").html(obj.pcDetails);
@@ -538,6 +569,10 @@
            if (invitationPrice == null || typeof invitationPrice == 'undefined') {
                invitationPrice = "";
            }
   var scorePrice = shopSkus[c].scorePrice;
            if (scorePrice == null || typeof scorePrice == 'undefined') {
                scorePrice = "";
            }
            var html=
@@ -554,6 +589,7 @@
                +'<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);
@@ -668,6 +704,22 @@
                    });
            });
    }
    //初始化分积分商城分类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() {
@@ -724,68 +776,72 @@
            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);
            }
@@ -793,6 +849,7 @@
        return skus;
    }
    /*验证sku表格中的参数*/
    function getSkusValues() {
@@ -803,7 +860,7 @@
            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,
@@ -821,7 +878,7 @@
                    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,
@@ -830,7 +887,7 @@
                    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,
zq-erp/src/main/resources/templates/views/admin/shop/shopProduct-list.html
@@ -35,10 +35,18 @@
                <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>
@@ -47,10 +55,10 @@
                </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>
@@ -114,12 +122,12 @@
                <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>
@@ -275,7 +283,7 @@
    //初始化属性下拉选
    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,
@@ -290,6 +298,16 @@
            });
    }
    function mallType(value, row, index) {
        var html = "";
        if (value ==1) {
          html="微商城"
        }else{
            html="积分商城"
        }
        return html;
    }
    /**
     * 格式化属性
     */