From 482c4d31a383af516fa53814e40b695d66b3e314 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Mon, 20 Feb 2023 15:29:11 +0800 Subject: [PATCH] 支付剩余时间 --- src/main/resources/mapper/modules/MallGoodsMapper.xml | 8 +++++--- src/main/java/cc/mrbird/febs/mall/vo/GoodsDetailsSkuVo.java | 3 +++ src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java | 17 +++++++++++++++++ src/main/resources/templates/febs/views/modules/order/orderList.html | 7 +++++-- src/main/resources/templates/febs/views/modules/goods/goodsList.html | 9 ++++++--- src/main/java/cc/mrbird/febs/mall/entity/MallGoodsSku.java | 3 +++ 6 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/entity/MallGoodsSku.java b/src/main/java/cc/mrbird/febs/mall/entity/MallGoodsSku.java index 226b5d4..0796bdc 100644 --- a/src/main/java/cc/mrbird/febs/mall/entity/MallGoodsSku.java +++ b/src/main/java/cc/mrbird/febs/mall/entity/MallGoodsSku.java @@ -41,5 +41,8 @@ //重量 private BigDecimal goodsWeight; + @TableField(exist = false) + private BigDecimal skuGoodsWeight; + private String sample; } diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java index 1c89a4b..cc9f184 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java @@ -13,6 +13,7 @@ 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; @@ -91,6 +92,22 @@ 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()); diff --git a/src/main/java/cc/mrbird/febs/mall/vo/GoodsDetailsSkuVo.java b/src/main/java/cc/mrbird/febs/mall/vo/GoodsDetailsSkuVo.java index c39f5b3..b8c9c19 100644 --- a/src/main/java/cc/mrbird/febs/mall/vo/GoodsDetailsSkuVo.java +++ b/src/main/java/cc/mrbird/febs/mall/vo/GoodsDetailsSkuVo.java @@ -38,6 +38,9 @@ @ApiModelProperty(value = "样品,为空则代表不是样品") private String sample; + @ApiModelProperty(value = "样品,为空则代表不是样品") + private Boolean sampleFlag; + @ApiModelProperty(value = "重量") private BigDecimal goodsWeight; } diff --git a/src/main/resources/mapper/modules/MallGoodsMapper.xml b/src/main/resources/mapper/modules/MallGoodsMapper.xml index 46d4717..04077f2 100644 --- a/src/main/resources/mapper/modules/MallGoodsMapper.xml +++ b/src/main/resources/mapper/modules/MallGoodsMapper.xml @@ -25,7 +25,7 @@ <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" /> @@ -40,7 +40,8 @@ <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> @@ -59,7 +60,8 @@ 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 diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsList.html b/src/main/resources/templates/febs/views/modules/goods/goodsList.html index 8b8520a..3155432 100644 --- a/src/main/resources/templates/febs/views/modules/goods/goodsList.html +++ b/src/main/resources/templates/febs/views/modules/goods/goodsList.html @@ -104,7 +104,9 @@ tableIns; form.render(); - + let currPageGoods = 1;//首先默认值为1,防止出错 + //获取当前页 + currPageGoods = $view.find(".layui-laypage-em").next().html(); // 表格初始化 initTable(); @@ -194,14 +196,15 @@ // 查询按钮 $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 () { diff --git a/src/main/resources/templates/febs/views/modules/order/orderList.html b/src/main/resources/templates/febs/views/modules/order/orderList.html index 7c5a871..16adc16 100644 --- a/src/main/resources/templates/febs/views/modules/order/orderList.html +++ b/src/main/resources/templates/febs/views/modules/order/orderList.html @@ -143,6 +143,9 @@ laydate = layui.laydate, tableIns; + let currPageOrder = 1;//首先默认值为1,防止出错 + //获取当前页 + currPageOrder = $view.find(".layui-laypage-em").next().html(); //日期范围 laydate.render({ elem: '#febs-form-group-date-start' @@ -357,14 +360,14 @@ // 查询按钮 $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 () { -- Gitblit v1.9.1