From 011273f123c8bb3e197528f677f3baf396fb9489 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Fri, 27 Sep 2024 10:16:48 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=95=86=E5=93=81=E5=8D=B7=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0shopId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/entity/vo/UserCouponVo.java | 1 + src/main/resources/mapper/TbActivateInRecordMapper.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserCouponVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserCouponVo.java index 8dfec49..4e2d67b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserCouponVo.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/UserCouponVo.java @@ -14,6 +14,7 @@ public class UserCouponVo { * 卷描述 */ private String detail; + private String shopId; private String shopName; /** * 优惠金额 diff --git a/src/main/resources/mapper/TbActivateInRecordMapper.xml b/src/main/resources/mapper/TbActivateInRecordMapper.xml index 8e47129..d980a6c 100644 --- a/src/main/resources/mapper/TbActivateInRecordMapper.xml +++ b/src/main/resources/mapper/TbActivateInRecordMapper.xml @@ -52,6 +52,7 @@ SELECT tb_product.name as detail, 0 as status, sum(tb_activate_in_record.over_num) as num, + tb_activate_in_record.shop_id as shopId, #{shopName} '' From b57aa1d4c42fa1b5963ec93ba5d0b2e9e3cc4f50 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 8 Oct 2024 11:29:06 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=BA=93=E5=AD=98=E8=AD=A6=E6=88=92?= =?UTF-8?q?=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/entity/TbProduct.java | 11 + .../cashierservice/entity/TbProductSku.java | 9 - .../cashierservice/service/CartService.java | 29 +- src/main/resources/mapper/TbProductMapper.xml | 287 +++++++++--------- .../resources/mapper/TbProductSkuMapper.xml | 14 +- 5 files changed, 166 insertions(+), 184 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java index ba7404d..54dde96 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -140,6 +140,9 @@ public class TbProduct implements Serializable { //是否可售 1 可售 0非可售 private Integer isSale = 1; + private Integer warnLine = 0; + + public String getImages() { return images; @@ -683,4 +686,12 @@ public class TbProduct implements Serializable { public void setIsSale(Integer isSale) { this.isSale = isSale; } + + public Integer getWarnLine() { + return warnLine; + } + + public void setWarnLine(Integer warnLine) { + this.warnLine = warnLine; + } } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java index 325eda4..5005cce 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java @@ -32,7 +32,6 @@ public class TbProductSku implements Serializable { private String coverImg; - private Integer warnLine; private Double weight; @@ -175,14 +174,6 @@ public class TbProductSku implements Serializable { this.coverImg = coverImg == null ? null : coverImg.trim(); } - public Integer getWarnLine() { - return warnLine; - } - - public void setWarnLine(Integer warnLine) { - this.warnLine = warnLine; - } - public Double getWeight() { return weight; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java index f68534f..f78a8cb 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -329,22 +329,9 @@ public class CartService { * @param num 库存数 */ private void updateProductStock(TbProduct product, TbProductSkuWithBLOBs productSku, Integer num) { - String key = RedisCst.PRODUCT + product.getShopId() + ":product" + product.getId(); - double stock = num; - if (product.getIsDistribute() == 1) { - productMapper.updateStockById(product.getId().toString(), num); - stock = (double) (product.getStockNumber() - num); - } else { - key = RedisCst.PRODUCT + product.getShopId() + ":" + productSku.getId(); - productSkuMapper.updateStockById(productSku.getId().toString(), num); - stock = productSku.getStockNumber() - num; - } - if (num > 0) { - redisUtil.getIncrNum(key, "1"); - } else { - redisUtil.getIncrNum(key, "2"); - } + productMapper.updateStockById(product.getId().toString(), num); + CompletableFuture.runAsync(() -> checkWarnLineAndSendMsg(productSku, product, num)); @@ -356,7 +343,7 @@ public class CartService { * @param productSku sku */ private void checkWarnLineAndSendMsg(TbProductSku productSku, TbProduct product, Integer num) { - if (productSku.getWarnLine() == null) { + if (product.getWarnLine() == null) { return; } @@ -370,23 +357,17 @@ public class CartService { return; } - if (productSku.getStockNumber() == null) { - productSku.setStockNumber((double) 0); - } if (product.getStockNumber() == null) { product.setStockNumber(0); } - if ( - (product.getIsDistribute() == 1 && product.getStockNumber() - num <= productSku.getWarnLine()) - || (product.getIsDistribute() != 1) && productSku.getStockNumber() - num <= productSku.getWarnLine() - ) { + if (product.getStockNumber() - num <= product.getWarnLine()) { List shopOpenIds = shopOpenIdMapper.selectStateByShopIdAndType(product.getShopId(), ShopWxMsgTypeEnum.STOCK_MSG.getType()); shopOpenIds.forEach(item -> { String message = redisUtil.getMessage(RedisCst.SEND_STOCK_WARN_MSG + product.getId() + ":" + item.getOpenId()); if (message == null) { wxAccountUtil.sendStockWarnMsg("商品库存不足", product.getName(), - product.getIsDistribute() == 1 ? product.getStockNumber() - num : (int) (productSku.getStockNumber() - num) + product.getStockNumber() - num , item.getOpenId(), ShopWxMsgTypeEnum.STOCK_MSG, shopInfo.getId()); redisUtil.saveMessage(RedisCst.SEND_STOCK_WARN_MSG + product.getId() + ":" + item.getOpenId(), product.getId().toString(), 60 * 30L); }else { diff --git a/src/main/resources/mapper/TbProductMapper.xml b/src/main/resources/mapper/TbProductMapper.xml index 4946725..27be261 100644 --- a/src/main/resources/mapper/TbProductMapper.xml +++ b/src/main/resources/mapper/TbProductMapper.xml @@ -64,6 +64,7 @@ + @@ -82,7 +83,7 @@ created_at, updated_at, base_sales_number, real_sales_number, sales_number, thumb_count, store_count, furnish_meal, furnish_express, furnish_draw, furnish_vir, is_combo, is_show_cash, is_show_mall, is_need_examine, show_on_mall_status, show_on_mall_time, - show_on_mall_error_msg, enable_label, tax_config_id, spec_table_headers,group_category_id,stock_number + show_on_mall_error_msg, enable_label, tax_config_id, spec_table_headers,group_category_id,stock_number,warn_line images, video, notice, group_snap, spec_info, select_spec @@ -121,7 +122,7 @@ show_on_mall_status, show_on_mall_time, show_on_mall_error_msg, enable_label, tax_config_id, spec_table_headers, images, video, notice, - group_snap, spec_info, select_spec,group_category_id,stock_number + group_snap, spec_info, select_spec,group_category_id,stock_number,warn_line ) values (#{id,jdbcType=INTEGER}, #{categoryId,jdbcType=VARCHAR}, #{specId,jdbcType=INTEGER}, #{sourcePath,jdbcType=VARCHAR}, #{brandId,jdbcType=INTEGER}, #{merchantId,jdbcType=VARCHAR}, @@ -145,8 +146,7 @@ #{enableLabel,jdbcType=TINYINT}, #{taxConfigId,jdbcType=VARCHAR}, #{specTableHeaders,jdbcType=VARCHAR}, #{images,jdbcType=LONGVARCHAR}, #{video,jdbcType=LONGVARCHAR}, #{notice,jdbcType=LONGVARCHAR}, #{groupSnap,jdbcType=LONGVARCHAR}, #{specInfo,jdbcType=LONGVARCHAR}, #{selectSpec,jdbcType=LONGVARCHAR}, - #{groupCategoryId,jdbcType=VARCHAR},#{stockNumber,jdbcType=INTEGER}, - #{groupCategoryId,jdbcType=VARCHAR},#{stockNumber,jdbcType=INTEGER} + #{groupCategoryId,jdbcType=VARCHAR},#{stockNumber,jdbcType=INTEGER},#{warnLine,jdbcType=INTEGER} ) @@ -356,6 +356,9 @@ stock_number, + + warn_line, + @@ -556,12 +559,15 @@ #{selectSpec,jdbcType=LONGVARCHAR}, - - #{groupCategoryId,jdbcType=VARCHAR}, - - - #{stockNumber,jdbcType=INTEGER}, - + + #{groupCategoryId,jdbcType=VARCHAR}, + + + #{stockNumber,jdbcType=INTEGER}, + + + #{warnLine,jdbcType=INTEGER}, + @@ -768,143 +774,148 @@ stock_number = #{stockNumber,jdbcType=INTEGER}, + + warn_line = #{warnLine,jdbcType=INTEGER}, + where id = #{id,jdbcType=INTEGER} update tb_product - set category_id = #{categoryId,jdbcType=VARCHAR}, - spec_id = #{specId,jdbcType=INTEGER}, - source_path = #{sourcePath,jdbcType=VARCHAR}, - brand_id = #{brandId,jdbcType=INTEGER}, - merchant_id = #{merchantId,jdbcType=VARCHAR}, - shop_id = #{shopId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - short_title = #{shortTitle,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pack_fee = #{packFee,jdbcType=DECIMAL}, - low_price = #{lowPrice,jdbcType=DECIMAL}, - low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, - unit_id = #{unitId,jdbcType=VARCHAR}, - unit_snap = #{unitSnap,jdbcType=VARCHAR}, - cover_img = #{coverImg,jdbcType=VARCHAR}, - share_img = #{shareImg,jdbcType=VARCHAR}, - video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - limit_number = #{limitNumber,jdbcType=INTEGER}, - product_score = #{productScore,jdbcType=INTEGER}, - status = #{status,jdbcType=TINYINT}, - fail_msg = #{failMsg,jdbcType=VARCHAR}, - is_recommend = #{isRecommend,jdbcType=TINYINT}, - is_hot = #{isHot,jdbcType=TINYINT}, - is_new = #{isNew,jdbcType=TINYINT}, - is_on_sale = #{isOnSale,jdbcType=TINYINT}, - is_show = #{isShow,jdbcType=TINYINT}, - type_enum = #{typeEnum,jdbcType=VARCHAR}, - is_distribute = #{isDistribute,jdbcType=TINYINT}, - is_del = #{isDel,jdbcType=TINYINT}, - is_stock = #{isStock,jdbcType=TINYINT}, - is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, - is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, - freight_id = #{freightId,jdbcType=BIGINT}, - strategy_type = #{strategyType,jdbcType=VARCHAR}, - strategy_id = #{strategyId,jdbcType=INTEGER}, - is_vip = #{isVip,jdbcType=TINYINT}, - is_delete = #{isDelete,jdbcType=TINYINT}, - created_at = #{createdAt,jdbcType=BIGINT}, - updated_at = #{updatedAt,jdbcType=BIGINT}, - base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, - real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, - sales_number = #{salesNumber,jdbcType=INTEGER}, - thumb_count = #{thumbCount,jdbcType=INTEGER}, - store_count = #{storeCount,jdbcType=INTEGER}, - furnish_meal = #{furnishMeal,jdbcType=INTEGER}, - furnish_express = #{furnishExpress,jdbcType=INTEGER}, - furnish_draw = #{furnishDraw,jdbcType=INTEGER}, - furnish_vir = #{furnishVir,jdbcType=INTEGER}, - is_combo = #{isCombo,jdbcType=TINYINT}, - is_show_cash = #{isShowCash,jdbcType=TINYINT}, - is_show_mall = #{isShowMall,jdbcType=TINYINT}, - is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, - show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, - show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, - show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, - enable_label = #{enableLabel,jdbcType=TINYINT}, - tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, - spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR}, - images = #{images,jdbcType=LONGVARCHAR}, - video = #{video,jdbcType=LONGVARCHAR}, - notice = #{notice,jdbcType=LONGVARCHAR}, - group_snap = #{groupSnap,jdbcType=LONGVARCHAR}, - spec_info = #{specInfo,jdbcType=LONGVARCHAR}, - select_spec = #{selectSpec,jdbcType=LONGVARCHAR}, - group_category_id = #{groupCategoryId,jdbcType=VARCHAR}, - stock_number = #{stockNumber,jdbcType=INTEGER} + set category_id = #{categoryId,jdbcType=VARCHAR}, + spec_id = #{specId,jdbcType=INTEGER}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + brand_id = #{brandId,jdbcType=INTEGER}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + short_title = #{shortTitle,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + pack_fee = #{packFee,jdbcType=DECIMAL}, + low_price = #{lowPrice,jdbcType=DECIMAL}, + low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, + unit_id = #{unitId,jdbcType=VARCHAR}, + unit_snap = #{unitSnap,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + limit_number = #{limitNumber,jdbcType=INTEGER}, + product_score = #{productScore,jdbcType=INTEGER}, + status = #{status,jdbcType=TINYINT}, + fail_msg = #{failMsg,jdbcType=VARCHAR}, + is_recommend = #{isRecommend,jdbcType=TINYINT}, + is_hot = #{isHot,jdbcType=TINYINT}, + is_new = #{isNew,jdbcType=TINYINT}, + is_on_sale = #{isOnSale,jdbcType=TINYINT}, + is_show = #{isShow,jdbcType=TINYINT}, + type_enum = #{typeEnum,jdbcType=VARCHAR}, + is_distribute = #{isDistribute,jdbcType=TINYINT}, + is_del = #{isDel,jdbcType=TINYINT}, + is_stock = #{isStock,jdbcType=TINYINT}, + is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, + is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, + freight_id = #{freightId,jdbcType=BIGINT}, + strategy_type = #{strategyType,jdbcType=VARCHAR}, + strategy_id = #{strategyId,jdbcType=INTEGER}, + is_vip = #{isVip,jdbcType=TINYINT}, + is_delete = #{isDelete,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, + real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, + sales_number = #{salesNumber,jdbcType=INTEGER}, + thumb_count = #{thumbCount,jdbcType=INTEGER}, + store_count = #{storeCount,jdbcType=INTEGER}, + furnish_meal = #{furnishMeal,jdbcType=INTEGER}, + furnish_express = #{furnishExpress,jdbcType=INTEGER}, + furnish_draw = #{furnishDraw,jdbcType=INTEGER}, + furnish_vir = #{furnishVir,jdbcType=INTEGER}, + is_combo = #{isCombo,jdbcType=TINYINT}, + is_show_cash = #{isShowCash,jdbcType=TINYINT}, + is_show_mall = #{isShowMall,jdbcType=TINYINT}, + is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, + show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, + show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, + show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, + enable_label = #{enableLabel,jdbcType=TINYINT}, + tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, + spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR}, + images = #{images,jdbcType=LONGVARCHAR}, + video = #{video,jdbcType=LONGVARCHAR}, + notice = #{notice,jdbcType=LONGVARCHAR}, + group_snap = #{groupSnap,jdbcType=LONGVARCHAR}, + spec_info = #{specInfo,jdbcType=LONGVARCHAR}, + select_spec = #{selectSpec,jdbcType=LONGVARCHAR}, + group_category_id = #{groupCategoryId,jdbcType=VARCHAR}, + stock_number = #{stockNumber,jdbcType=INTEGER}, + warn_line = #{warnLine,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} update tb_product - set category_id = #{categoryId,jdbcType=VARCHAR}, - spec_id = #{specId,jdbcType=INTEGER}, - source_path = #{sourcePath,jdbcType=VARCHAR}, - brand_id = #{brandId,jdbcType=INTEGER}, - merchant_id = #{merchantId,jdbcType=VARCHAR}, - shop_id = #{shopId,jdbcType=VARCHAR}, - name = #{name,jdbcType=VARCHAR}, - short_title = #{shortTitle,jdbcType=VARCHAR}, - type = #{type,jdbcType=VARCHAR}, - pack_fee = #{packFee,jdbcType=DECIMAL}, - low_price = #{lowPrice,jdbcType=DECIMAL}, - low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, - unit_id = #{unitId,jdbcType=VARCHAR}, - unit_snap = #{unitSnap,jdbcType=VARCHAR}, - cover_img = #{coverImg,jdbcType=VARCHAR}, - share_img = #{shareImg,jdbcType=VARCHAR}, - video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, - sort = #{sort,jdbcType=INTEGER}, - limit_number = #{limitNumber,jdbcType=INTEGER}, - product_score = #{productScore,jdbcType=INTEGER}, - status = #{status,jdbcType=TINYINT}, - fail_msg = #{failMsg,jdbcType=VARCHAR}, - is_recommend = #{isRecommend,jdbcType=TINYINT}, - is_hot = #{isHot,jdbcType=TINYINT}, - is_new = #{isNew,jdbcType=TINYINT}, - is_on_sale = #{isOnSale,jdbcType=TINYINT}, - is_show = #{isShow,jdbcType=TINYINT}, - type_enum = #{typeEnum,jdbcType=VARCHAR}, - is_distribute = #{isDistribute,jdbcType=TINYINT}, - is_del = #{isDel,jdbcType=TINYINT}, - is_stock = #{isStock,jdbcType=TINYINT}, - is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, - is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, - freight_id = #{freightId,jdbcType=BIGINT}, - strategy_type = #{strategyType,jdbcType=VARCHAR}, - strategy_id = #{strategyId,jdbcType=INTEGER}, - is_vip = #{isVip,jdbcType=TINYINT}, - is_delete = #{isDelete,jdbcType=TINYINT}, - created_at = #{createdAt,jdbcType=BIGINT}, - updated_at = #{updatedAt,jdbcType=BIGINT}, - base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, - real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, - sales_number = #{salesNumber,jdbcType=INTEGER}, - thumb_count = #{thumbCount,jdbcType=INTEGER}, - store_count = #{storeCount,jdbcType=INTEGER}, - furnish_meal = #{furnishMeal,jdbcType=INTEGER}, - furnish_express = #{furnishExpress,jdbcType=INTEGER}, - furnish_draw = #{furnishDraw,jdbcType=INTEGER}, - furnish_vir = #{furnishVir,jdbcType=INTEGER}, - is_combo = #{isCombo,jdbcType=TINYINT}, - is_show_cash = #{isShowCash,jdbcType=TINYINT}, - is_show_mall = #{isShowMall,jdbcType=TINYINT}, - is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, - show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, - show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, - show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, - enable_label = #{enableLabel,jdbcType=TINYINT}, - tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, - spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR}, - group_category_id = #{groupCategoryId,jdbcType=VARCHAR}, - stock_number = #{stockNumber,jdbcType=INTEGER} + set category_id = #{categoryId,jdbcType=VARCHAR}, + spec_id = #{specId,jdbcType=INTEGER}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + brand_id = #{brandId,jdbcType=INTEGER}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + short_title = #{shortTitle,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + pack_fee = #{packFee,jdbcType=DECIMAL}, + low_price = #{lowPrice,jdbcType=DECIMAL}, + low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, + unit_id = #{unitId,jdbcType=VARCHAR}, + unit_snap = #{unitSnap,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + limit_number = #{limitNumber,jdbcType=INTEGER}, + product_score = #{productScore,jdbcType=INTEGER}, + status = #{status,jdbcType=TINYINT}, + fail_msg = #{failMsg,jdbcType=VARCHAR}, + is_recommend = #{isRecommend,jdbcType=TINYINT}, + is_hot = #{isHot,jdbcType=TINYINT}, + is_new = #{isNew,jdbcType=TINYINT}, + is_on_sale = #{isOnSale,jdbcType=TINYINT}, + is_show = #{isShow,jdbcType=TINYINT}, + type_enum = #{typeEnum,jdbcType=VARCHAR}, + is_distribute = #{isDistribute,jdbcType=TINYINT}, + is_del = #{isDel,jdbcType=TINYINT}, + is_stock = #{isStock,jdbcType=TINYINT}, + is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, + is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, + freight_id = #{freightId,jdbcType=BIGINT}, + strategy_type = #{strategyType,jdbcType=VARCHAR}, + strategy_id = #{strategyId,jdbcType=INTEGER}, + is_vip = #{isVip,jdbcType=TINYINT}, + is_delete = #{isDelete,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, + real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, + sales_number = #{salesNumber,jdbcType=INTEGER}, + thumb_count = #{thumbCount,jdbcType=INTEGER}, + store_count = #{storeCount,jdbcType=INTEGER}, + furnish_meal = #{furnishMeal,jdbcType=INTEGER}, + furnish_express = #{furnishExpress,jdbcType=INTEGER}, + furnish_draw = #{furnishDraw,jdbcType=INTEGER}, + furnish_vir = #{furnishVir,jdbcType=INTEGER}, + is_combo = #{isCombo,jdbcType=TINYINT}, + is_show_cash = #{isShowCash,jdbcType=TINYINT}, + is_show_mall = #{isShowMall,jdbcType=TINYINT}, + is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, + show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, + show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, + show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, + enable_label = #{enableLabel,jdbcType=TINYINT}, + tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, + spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR}, + group_category_id = #{groupCategoryId,jdbcType=VARCHAR}, + stock_number = #{stockNumber,jdbcType=INTEGER}, + warn_line = #{warnLine,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} diff --git a/src/main/resources/mapper/TbProductSkuMapper.xml b/src/main/resources/mapper/TbProductSkuMapper.xml index d02c9b6..44e2f8e 100644 --- a/src/main/resources/mapper/TbProductSkuMapper.xml +++ b/src/main/resources/mapper/TbProductSkuMapper.xml @@ -16,7 +16,6 @@ - @@ -70,7 +69,7 @@ #{productId,jdbcType=VARCHAR}, #{originPrice,jdbcType=DECIMAL}, #{costPrice,jdbcType=DECIMAL}, #{memberPrice,jdbcType=DECIMAL}, #{mealPrice,jdbcType=DECIMAL}, #{salePrice,jdbcType=DECIMAL}, #{guidePrice,jdbcType=DECIMAL}, #{strategyPrice,jdbcType=DECIMAL}, #{stockNumber,jdbcType=DOUBLE}, - #{coverImg,jdbcType=VARCHAR}, #{warnLine,jdbcType=INTEGER}, #{weight,jdbcType=DOUBLE}, + #{coverImg,jdbcType=VARCHAR}, #{weight,jdbcType=DOUBLE}, #{volume,jdbcType=REAL}, #{realSalesNumber,jdbcType=DOUBLE}, #{firstShared,jdbcType=DECIMAL}, #{secondShared,jdbcType=DECIMAL}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{specInfo,jdbcType=LONGVARCHAR}, #{specSnap,jdbcType=LONGVARCHAR}), @@ -118,9 +117,6 @@ cover_img, - - warn_line, - weight, @@ -192,9 +188,6 @@ #{coverImg,jdbcType=VARCHAR}, - - #{warnLine,jdbcType=INTEGER}, - #{weight,jdbcType=DOUBLE}, @@ -266,9 +259,6 @@ cover_img = #{coverImg,jdbcType=VARCHAR}, - - warn_line = #{warnLine,jdbcType=INTEGER}, - weight = #{weight,jdbcType=DOUBLE}, @@ -316,7 +306,6 @@ strategy_price = #{strategyPrice,jdbcType=DECIMAL}, stock_number = #{stockNumber,jdbcType=DOUBLE}, cover_img = #{coverImg,jdbcType=VARCHAR}, - warn_line = #{warnLine,jdbcType=INTEGER}, weight = #{weight,jdbcType=DOUBLE}, volume = #{volume,jdbcType=REAL}, real_sales_number = #{realSalesNumber,jdbcType=DOUBLE}, @@ -343,7 +332,6 @@ strategy_price = #{strategyPrice,jdbcType=DECIMAL}, stock_number = #{stockNumber,jdbcType=DOUBLE}, cover_img = #{coverImg,jdbcType=VARCHAR}, - warn_line = #{warnLine,jdbcType=INTEGER}, weight = #{weight,jdbcType=DOUBLE}, volume = #{volume,jdbcType=REAL}, real_sales_number = #{realSalesNumber,jdbcType=DOUBLE}, From f52bb0dc15e53aefa7b2162c479868e6c9419b7e Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 8 Oct 2024 15:16:17 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chaozhanggui/system/cashierservice/service/PayService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index 7e4f1fc..152f0e4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -908,6 +908,7 @@ public class PayService { orderInfo.setPayType("wx_lite"); orderInfo.setPayOrderNo(payOrderNO); orderInfo.setPayAmount(orderInfo.getOrderAmount()); + orderInfo.setPaidTime(System.currentTimeMillis()); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); @@ -962,6 +963,7 @@ public class PayService { orderInfo.setPayType("wx_lite"); orderInfo.setPayOrderNo(payOrderNO); orderInfo.setPayAmount(orderInfo.getOrderAmount()); + orderInfo.setPaidTime(System.currentTimeMillis()); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed"); From f7db296035d023ab237b11e41b52d50355fb73f4 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 8 Oct 2024 15:26:45 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=8D=B7=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E4=BD=99=E9=87=8F=E4=B8=BA0=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/TbActivateInRecordMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mapper/TbActivateInRecordMapper.xml b/src/main/resources/mapper/TbActivateInRecordMapper.xml index d980a6c..8f406ee 100644 --- a/src/main/resources/mapper/TbActivateInRecordMapper.xml +++ b/src/main/resources/mapper/TbActivateInRecordMapper.xml @@ -62,7 +62,7 @@ LEFT JOIN tb_product ON tb_activate_in_record.pro_id = tb_product.id WHERE vip_user_id = #{vipUserId} and tb_activate_in_record.shop_id = #{shopId} - and num!=0 + and tb_activate_in_record.over_num!=0 group by tb_activate_in_record.pro_id From 0f000cd0e0e051d33d85df8380ce5ad3ee25f844 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 8 Oct 2024 15:40:26 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=9A=E5=91=98=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/LoginService.java | 3 +++ .../system/cashierservice/service/PayService.java | 4 ++-- .../system/cashierservice/service/UserService.java | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java index 86b6a1b..009cf6a 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/LoginService.java @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.sql.Timestamp; import java.util.*; @Service @@ -483,6 +484,7 @@ public class LoginService { TbShopUser tbShopUserSM = tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(), shopId); if (tbShopUserSM != null) { tbShopUserSM.setIsVip(Byte.parseByte("1")); + tbShopUserSM.setJoinTime(new Timestamp(System.currentTimeMillis())); tbShopUserSM.setTelephone(phone); tbShopUserSM.setUpdatedAt(System.currentTimeMillis()); tbShopUserMapper.updateByPrimaryKey(tbShopUserSM); @@ -505,6 +507,7 @@ public class LoginService { shopUser.setTelephone(userInfo.getTelephone()); shopUser.setAmount(BigDecimal.ZERO); shopUser.setIsVip(Byte.parseByte("1")); + shopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); shopUser.setCreditAmount(BigDecimal.ZERO); shopUser.setConsumeAmount(BigDecimal.ZERO); shopUser.setConsumeNumber(0); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index 152f0e4..8373c14 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -1117,12 +1117,12 @@ public class PayService { if (!"1".equals(tbShopUser.getIsVip().toString())) { tbShopUser.setIsVip(Byte.parseByte("1")); + tbShopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); } //修改客户资金 tbShopUser.setAmount(tbShopUser.getAmount().add(memberIn.getAmount())); tbShopUser.setUpdatedAt(System.currentTimeMillis()); - tbShopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser); TbShopUserFlow flow = new TbShopUserFlow(); @@ -1216,12 +1216,12 @@ public class PayService { tbShopUser.setTelephone(userInfo.getTelephone()); tbShopUser.setCode(RandomUtil.randomNumbers(8)); tbShopUser.setIsVip(Byte.parseByte("1")); + tbShopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); } //修改客户资金 tbShopUser.setAmount(tbShopUser.getAmount().add(memberIn.getAmount())); tbShopUser.setUpdatedAt(System.currentTimeMillis()); - tbShopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser); TbShopUserFlow flow = new TbShopUserFlow(); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/UserService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/UserService.java index c6441e6..aac35b7 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/UserService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/UserService.java @@ -34,6 +34,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.math.BigDecimal; +import java.sql.Timestamp; import java.util.*; import java.util.concurrent.TimeUnit; @@ -280,6 +281,7 @@ public class UserService { tbShopUser.setTelephone(memberVo.getTelephone()); tbShopUser.setBirthDay(StringUtils.isNotBlank(memberVo.getBirthDay()) ? memberVo.getBirthDay() : null); tbShopUser.setIsVip(Byte.parseByte("1")); + tbShopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); shopUserMapper.updateByPrimaryKeySelective(tbShopUser); } else { TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(memberVo.getId()); @@ -304,6 +306,7 @@ public class UserService { tbShopUser.setTelephone(memberVo.getTelephone()); tbShopUser.setAmount(BigDecimal.ZERO); tbShopUser.setIsVip(Byte.parseByte("1")); + tbShopUser.setJoinTime(new Timestamp(System.currentTimeMillis())); tbShopUser.setCreditAmount(BigDecimal.ZERO); tbShopUser.setConsumeAmount(BigDecimal.ZERO); tbShopUser.setConsumeNumber(0); From a420de86d0244dcff514bf656ccf7f95dea60584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Tue, 8 Oct 2024 15:58:18 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=9C=A8=E6=94=AF=E4=BB=98=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=94=AF=E4=BB=98=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/PayService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java index 711fcd7..f63d980 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -449,6 +449,7 @@ public class PayService { orderInfo.setMemberId(memberId); orderInfo.setPayType("deposit"); orderInfo.setStatus("closed"); + orderInfo.setPaidTime(System.currentTimeMillis()); orderInfo.setPayOrderNo("deposit".concat(SnowFlakeUtil.generateOrderNo())); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); //更新购物车状态 @@ -768,6 +769,7 @@ public class PayService { orderInfo.setPayType("wx_lite"); orderInfo.setPayOrderNo(payment.getTradeNumber()); orderInfo.setPayAmount(orderInfo.getOrderAmount()); + orderInfo.setPaidTime(System.currentTimeMillis()); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); @@ -820,6 +822,7 @@ public class PayService { orderInfo.setPayType("wx_lite"); orderInfo.setPayOrderNo(payment.getTradeNumber()); orderInfo.setPayAmount(orderInfo.getOrderAmount()); + orderInfo.setPaidTime(System.currentTimeMillis()); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); @@ -970,6 +973,7 @@ public class PayService { orderInfo.setPayType("wx_lite"); orderInfo.setPayOrderNo(payOrderNO); orderInfo.setPayAmount(orderInfo.getOrderAmount()); + orderInfo.setPaidTime(System.currentTimeMillis()); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); @@ -1024,6 +1028,7 @@ public class PayService { orderInfo.setPayType("wx_lite"); orderInfo.setPayOrderNo(payOrderNO); orderInfo.setPayAmount(orderInfo.getOrderAmount()); + orderInfo.setPaidTime(System.currentTimeMillis()); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(), "closed");