| | |
| | | //重量 |
| | | private BigDecimal goodsWeight; |
| | | |
| | | @TableField(exist = false) |
| | | private BigDecimal skuGoodsWeight; |
| | | |
| | | private String sample; |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | List<String> images = goodsImagesMapper.selectGoodsImagesByGoodsId(mallGoods.getId()); |
| | | MallGoodsDetailsVo mallGoodsDetailsVo = MallGoodsConversion.INSTANCE.entityToDetailsVo(mallGoods); |
| | | |
| | | List<GoodsDetailsStyleVo> styles = mallGoodsDetailsVo.getStyles(); |
| | | if(ObjectUtil.isNotEmpty(styles)){ |
| | | for(GoodsDetailsStyleVo goodsDetailsStyleVo : styles){ |
| | | List<GoodsDetailsSkuVo> skus = goodsDetailsStyleVo.getSkus(); |
| | | if(CollUtil.isNotEmpty(skus) ){ |
| | | for(GoodsDetailsSkuVo goodsDetailsSkuVo : skus){ |
| | | if(StrUtil.isNotEmpty(goodsDetailsSkuVo.getSample())){ |
| | | goodsDetailsSkuVo.setSampleFlag(true); |
| | | }else{ |
| | | goodsDetailsSkuVo.setSampleFlag(false); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (CollUtil.isNotEmpty(mallGoods.getStyles())) { |
| | | Map<String, BigDecimal> stockAndVolume = this.baseMapper.selectGoodsStockAndVolume(id); |
| | | mallGoodsDetailsVo.setStock(stockAndVolume.get("stock").intValue()); |
| | |
| | | @ApiModelProperty(value = "样品,为空则代表不是样品") |
| | | private String sample; |
| | | |
| | | @ApiModelProperty(value = "样品,为空则代表不是样品") |
| | | private Boolean sampleFlag; |
| | | |
| | | @ApiModelProperty(value = "重量") |
| | | private BigDecimal goodsWeight; |
| | | } |
| | |
| | | <result property="carriageType" column="carriage_type" /> |
| | | <result property="carriageAmount" column="carriage_amount" /> |
| | | <result property="carriageRuleId" column="carriage_rule_id" /> |
| | | <!-- <result property="goodsWeight" column="goods_weight" />--> |
| | | <result property="goodsWeight" column="goods_weight" /> |
| | | <collection property="styles" ofType="cc.mrbird.febs.mall.entity.MallGoodsStyle"> |
| | | <id property="id" column="style_id" /> |
| | | <result property="name" column="style_name" /> |
| | |
| | | <result property="presentPrice" column="sku_present_price" /> |
| | | <result property="styleId" column="sku_style_id"/> |
| | | <result property="goodsId" column="sku_goods_id" /> |
| | | <result property="goodsWeight" column="goods_weight" /> |
| | | <result property="skuGoodsWeight" column="goods_weight" /> |
| | | <result property="sample" column="sample" /> |
| | | </collection> |
| | | </collection> |
| | | </resultMap> |
| | |
| | | c.original_price sku_original_price, |
| | | c.present_price sku_present_price, |
| | | c.style_id sku_style_id, |
| | | c.goods_weight goodsWeight, |
| | | c.goods_weight skuGoodsWeight, |
| | | c.sample sample, |
| | | c.goods_id sku_goods_id |
| | | from mall_goods a |
| | | left join mall_goods_style b on a.id = b.goods_id |
| | |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | let currPageGoods = 1;//首先默认值为1,防止出错 |
| | | //获取当前页 |
| | | currPageGoods = $view.find(".layui-laypage-em").next().html(); |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | // params.pageNum = $view.find(".layui-laypage-em").next().html(); |
| | | tableIns.reload({where: params, page: {curr: currPageGoods}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | tableIns.reload({where: getQueryParams(), page: {curr: currPageGoods}, initSort: sortObject}); |
| | | }); |
| | | |
| | | $add.on('click', function () { |
| | |
| | | laydate = layui.laydate, |
| | | tableIns; |
| | | |
| | | let currPageOrder = 1;//首先默认值为1,防止出错 |
| | | //获取当前页 |
| | | currPageOrder = $view.find(".layui-laypage-em").next().html(); |
| | | //日期范围 |
| | | laydate.render({ |
| | | elem: '#febs-form-group-date-start' |
| | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); |
| | | tableIns.reload({where: params, page: {curr: 1}}); |
| | | tableIns.reload({where: params, page: {curr: currPageOrder}}); |
| | | }); |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | tableIns.reload({where: getQueryParams(), page: {curr: currPageOrder}, initSort: sortObject}); |
| | | }); |
| | | |
| | | $add.on('click', function () { |