From 5bf6bc4fed37069b1e6c24a3bfc96fdcac78b9fc Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Mon, 18 Nov 2024 15:16:52 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=95=86=E5=93=81=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/dao/TbProductMapper.java | 33 +- .../cashierservice/entity/TbProduct.java | 234 ++--- .../entity/TbProductStockDetail.java | 6 +- .../entity/TbProductWithBLOBs.java | 58 -- .../rabbit/ConsMsgConsumer.java | 2 +- .../cashierservice/service/DutyService.java | 2 +- .../cashierservice/service/OrderService.java | 8 +- .../cashierservice/service/PayService.java | 2 +- .../service/ProductService.java | 28 +- .../service/TbGroupOrderInfoService.java | 2 +- src/main/resources/mapper/TbProductMapper.xml | 954 +----------------- 11 files changed, 197 insertions(+), 1132 deletions(-) delete mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java index b15b5e8..6ab4228 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java @@ -1,45 +1,26 @@ package com.chaozhanggui.system.cashierservice.dao; import com.chaozhanggui.system.cashierservice.entity.TbProduct; -import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs; import com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo; -import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; -import org.springframework.stereotype.Component; import java.util.List; public interface TbProductMapper { - int deleteByPrimaryKey(Integer id); - int insert(TbProductWithBLOBs record); - - int insertSelective(TbProductWithBLOBs record); - - TbProductWithBLOBs selectByPrimaryKey(Integer id); - - int updateByPrimaryKeySelective(TbProductWithBLOBs record); - - int updateByPrimaryKeyWithBLOBs(TbProductWithBLOBs record); - - int updateByPrimaryKey(TbProduct record); - - - List selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName); - List selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); - - - - List selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); - List selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); - List selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); + TbProduct selectByPrimaryKey(Integer id); + List selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName); + List selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); + List selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); + List selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName); + List selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName); Integer countOrderByshopIdAndProductId(@Param("shopId") String shopId, @Param("productId") String productId, @Param("masterId") String masterId,@Param("day") String day, @Param("tableId") String tableId); - + @Update("update tb_product set stock_number = stock_number - #{num,jdbcType=INTEGER} where id = #{productId}") void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num); 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 ce271d4..a8390c3 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -1,154 +1,160 @@ package com.chaozhanggui.system.cashierservice.entity; -import com.baomidou.mybatisplus.annotation.TableField; import lombok.Data; -import org.springframework.data.annotation.Transient; import java.io.Serializable; import java.math.BigDecimal; +import java.util.List; @Data public class TbProduct implements Serializable { + /** + * id + */ private Integer id; - + /** + * 商品分类 + */ private String categoryId; - + /** + * 商品规格 + */ private Integer specId; - - private String sourcePath; - - private Integer brandId; - + /** + * 商户Id + */ private String merchantId; private String shopId; - + /** + * 商品名称 + */ private String name; - + /** + * 短标题--促销语 + */ private String shortTitle; - + /** + * 商品类型(属性):REAL- 实物商品 VIR---虚拟商品 + */ private String type; - + /** + * 包装费 + */ private BigDecimal packFee; - + /** + * 商品最低价 + */ private BigDecimal lowPrice; private BigDecimal lowMemberPrice; - - private String unitId; - - private String unitSnap; - - private String coverImg; - - private String shareImg; - - private String videoCoverImg; - - private Integer sort; - - private Integer limitNumber; - - private Integer productScore; - - private Byte status; - - private String failMsg; - - private Byte isRecommend; - - private Byte isHot; - - private Byte isNew; - - private Byte isOnSale; - - private Byte isShow; - - private String typeEnum; - /** - * 是否共享库存 + * 单位Id */ - private Byte isDistribute; - - private Byte isDel; - - private Byte isStock; - - private Byte isPauseSale; - - private Byte isFreeFreight; - - private Long freightId; - - private String strategyType; - - private Integer strategyId; - - private Byte isVip; - - private Byte isDelete; + private Integer unitId; + private String unitSnap; + /** + * 商品封面图 + */ + private String coverImg; + /** + * 商品图片(第一张为缩略图,其他为详情) + */ + private String images; + /** + * 排序 + */ + private Integer sort; + /** + * 0--待审核 1审核通过 -1审核失败 -2违规下架 + */ + private Integer status; + /** + * 审核失败原因 + */ + private String failMsg; + /** + * 是否热销 + */ + private Integer isHot; + /** + * 计量商品 normal + * 称重商品 weight + * 多规格商品 sku + * 套餐商品 group + * 时价商品 currentPrice + */ + private String typeEnum; + /** + * 是否回收站 0-否,1回收站 + */ + private Integer isDel; + /** + * 是否开启库存 + */ + private Integer isStock; + /** + * 是否暂停销售 + */ + private Integer isPauseSale; + /** + * 是否删除0不删1删除 + */ + private Integer isDelete; private Long createdAt; private Long updatedAt; - - private Double baseSalesNumber; - - private Integer realSalesNumber; - - private Integer salesNumber; - - private Integer thumbCount; - - private Integer storeCount; - - private Integer furnishMeal; - - private Integer furnishExpress; - - private Integer furnishDraw; - - private Integer furnishVir; - - private Byte isCombo; - - private Byte isShowCash; - - private Byte isShowMall; - - private Byte isNeedExamine; - - private Byte showOnMallStatus; - - private Long showOnMallTime; - - private String showOnMallErrorMsg; - - private Byte enableLabel; - - private String taxConfigId; - + /** + * 套餐内容 + */ + private String groupSnap; + /** + * 规格详情 + */ + private String specInfo; + /** + * 已选择的规格 + */ + private String selectSpec; + /** + * 已选规格表格头部 + */ private String specTableHeaders; - + /** + * 团购卷分类,可有多个分类 + */ + private String groupCategoryId; + /** + * 销量 + */ + private Integer realSalesNumber; + /** + * 商品级库存数量 + */ private Integer stockNumber; + /** + * 是否上架 + */ + private Integer isGrounding; + /** + * 退款是否退回库存 + */ + private Integer isRefundStock; + /** + * 库存警戒线 + */ + private Integer warnLine; - private Integer warnLine = 0; - - @Transient - @TableField(exist = false) private int orderCount; - - @Transient - @TableField(exist = false) private TbProductSpec tbProductSpec; - @Transient - @TableField(exist = false) private TbProductSkuResult productSkuResult; + private Object groundingSpecInfo; + private List skuList; + private static final long serialVersionUID = 1L; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java index 1328ac2..bdda082 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java @@ -12,7 +12,7 @@ public class TbProductStockDetail implements Serializable { private String productName; - private Byte isStock; + private Integer isStock; private String specSnap; @@ -90,11 +90,11 @@ public class TbProductStockDetail implements Serializable { this.productName = productName == null ? null : productName.trim(); } - public Byte getIsStock() { + public Integer getIsStock() { return isStock; } - public void setIsStock(Byte isStock) { + public void setIsStock(Integer isStock) { this.isStock = isStock; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java deleted file mode 100644 index 3302de2..0000000 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.chaozhanggui.system.cashierservice.entity; - -import lombok.Getter; - -import java.io.Serializable; -import java.util.List; - -@Getter -public class TbProductWithBLOBs extends TbProduct implements Serializable { - private Object groundingSpecInfo; - private String images; - - private String video; - - private String notice; - - private String groupSnap; - - private String specInfo; - - private String selectSpec; - - private List skuList; - - private static final long serialVersionUID = 1L; - - public void setGroundingSpecInfo(Object groundingSpecInfo) { - this.groundingSpecInfo = groundingSpecInfo; - } - - public void setSkuList(List skuList) { - this.skuList = skuList; - } - - public void setImages(String images) { - this.images = images == null ? null : images.trim(); - } - - public void setVideo(String video) { - this.video = video == null ? null : video.trim(); - } - - public void setNotice(String notice) { - this.notice = notice == null ? null : notice.trim(); - } - - public void setGroupSnap(String groupSnap) { - this.groupSnap = groupSnap == null ? null : groupSnap.trim(); - } - - public void setSpecInfo(String specInfo) { - this.specInfo = specInfo == null ? null : specInfo.trim(); - } - - public void setSelectSpec(String selectSpec) { - this.selectSpec = selectSpec == null ? null : selectSpec.trim(); - } -} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java index 80bae3a..ae0f4bc 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/ConsMsgConsumer.java @@ -108,7 +108,7 @@ public class ConsMsgConsumer { return; } - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId())); + TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId())); if (Objects.isNull(product)) { log.info("商品信息不存在"); return; diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java index c3df527..43ef61f 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/DutyService.java @@ -386,7 +386,7 @@ public class DutyService { if (tbProductSku == null) { return; } - TbProductWithBLOBs product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId())); + TbProduct product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId())); if (ObjectUtil.isNotEmpty(product)) { diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java index 5a1e3ca..2588a4c 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java @@ -601,7 +601,7 @@ public class OrderService { if (Objects.nonNull(skuWithBLOBs)) { cashierCart.setSkuName(skuWithBLOBs.getSpecSnap()); } - TbProductWithBLOBs tbProduct = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); + TbProduct tbProduct = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); if (Objects.nonNull(tbProduct)) { cashierCart.setSelectSpec(tbProduct.getSelectSpec()); if (tbProduct.getSpecId() != null) { @@ -643,7 +643,7 @@ public class OrderService { return Result.success(CodeEnum.SUCCESS, returnCart(dto)); } - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); + TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); if (ObjectUtil.isEmpty(product)) { return Result.fail(CodeEnum.PRODUCTINFOERROR); } @@ -901,7 +901,7 @@ public class OrderService { orderDetail.setPlaceNum(currentPlaceNum); } - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); + TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); if ("takeaway".equals(orderVo.getSendType()) || "takeself".equals(orderVo.getSendType())) { if (Objects.nonNull(product.getPackFee())) { packAMount = packAMount.add(product.getPackFee()); @@ -1269,7 +1269,7 @@ public class OrderService { } List list = cashierCartMapper.selectAllByMarketId(day, String.valueOf(cartVo.getShopId()), cartVo.getMasterId()); for (TbCashierCart cashierCart : list) { - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); + TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); if ("true".equals(cartVo.getStatus())) { cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(product.getPackFee()))); cashierCart.setPackFee(new BigDecimal(cashierCart.getTotalNumber()).multiply(product.getPackFee())); 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 8dffbe3..cededc7 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -1424,7 +1424,7 @@ public class PayService { detail = tbOrderDetailMapper.selectByPrimaryKey(detail.getId()); TbProductSku productSku = productSkuMapper.selectByPrimaryKey(detail.getProductSkuId()); - TbProductWithBLOBs product = productMapper.selectByPrimaryKey(detail.getProductId()); + TbProduct product = productMapper.selectByPrimaryKey(detail.getProductId()); TbProductStockDetail tbProductStockDetail = new TbProductStockDetail(); tbProductStockDetail.setCreatedAt(System.currentTimeMillis()); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java index eaede9b..d7669b8 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -71,16 +71,16 @@ public class ProductService { public Result queryCommodityInfo(String shopId, String categoryId, String commdityName, Integer page, Integer pageSize, String masterId){ - List tbProductWithBLOBs=null; + List TbProduct=null; if(ObjectUtil.isEmpty(categoryId)){ - tbProductWithBLOBs=tbProductMapper.selectByShopId(shopId,commdityName); + TbProduct=tbProductMapper.selectByShopId(shopId,commdityName); }else { - tbProductWithBLOBs=tbProductMapper.selectByShopIdAndShopType(shopId,categoryId,commdityName); + TbProduct=tbProductMapper.selectByShopIdAndShopType(shopId,categoryId,commdityName); } String day = DateUtils.getDay(); - if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){ - tbProductWithBLOBs.parallelStream().forEach(it->{ + if(ObjectUtil.isNotEmpty(TbProduct)){ + TbProduct.parallelStream().forEach(it->{ Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, ""); it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount); TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId()); @@ -96,7 +96,7 @@ public class ProductService { it.setProductSkuResult(skuResult); }); } - return Result.success(CodeEnum.SUCCESS,tbProductWithBLOBs); + return Result.success(CodeEnum.SUCCESS,TbProduct); } @@ -111,21 +111,21 @@ public class ProductService { } public Result queryNewCommodityInfo(String shopId, String categoryId, String commdityName, String tableId, int page, int pageSize, String masterId) { - List tbProductWithBLOBs=null; + List tbProducts=null; PageHelperUtil.startPage(page,pageSize); if(ObjectUtil.isEmpty(categoryId)){ - tbProductWithBLOBs=tbProductMapper.selectByShopIdAndCheckGrounding(shopId,commdityName); + tbProducts=tbProductMapper.selectByShopIdAndCheckGrounding(shopId,commdityName); }else { if (Integer.valueOf(categoryId).equals(-1)) { - tbProductWithBLOBs = tbProductMapper.selectByShopIdAndShopTypeUnGrounding(shopId,commdityName); + tbProducts = tbProductMapper.selectByShopIdAndShopTypeUnGrounding(shopId,commdityName); }else { - tbProductWithBLOBs=tbProductMapper.selectByShopIdAndShopTypeCheckGrounding(shopId,categoryId,commdityName); + tbProducts=tbProductMapper.selectByShopIdAndShopTypeCheckGrounding(shopId,categoryId,commdityName); } } String day = DateUtils.getDay(); - if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){ - tbProductWithBLOBs.parallelStream().forEach(it->{ + if(ObjectUtil.isNotEmpty(tbProducts)){ + tbProducts.parallelStream().forEach(it->{ Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, tableId); it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount); TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId()); @@ -143,7 +143,7 @@ public class ProductService { it.setGroundingSpecInfo(querySpec(Integer.valueOf(shopId), it.getId())); }); } - PageInfo pageInfo=new PageInfo(tbProductWithBLOBs); + PageInfo pageInfo=new PageInfo(tbProducts); return Result.success(CodeEnum.SUCCESS,pageInfo); } @@ -152,7 +152,7 @@ public class ProductService { } public void decrStock(String productId, String skuId, int decrNum) { - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(productId)); + TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(productId)); if (product.getIsStock() == 1) { if (tbProductMapper.decrStock(productId, decrNum) < 1) { throw new MsgException("库存不足,下单失败"); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java index 742a52a..06d2d7b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbGroupOrderInfoService.java @@ -50,7 +50,7 @@ public class TbGroupOrderInfoService { */ public Result queryById(Integer id) { TbGroupOrderInfo tbGroupOrderInfo = tbGroupOrderInfoMapper.queryById(id); - TbProductWithBLOBs tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId()); + TbProduct tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId()); TbProductSkuWithBLOBs tbProductSku = skuMapper.selectByProduct(tbGroupOrderInfo.getProId()); GroupOrderInfoVo productInfo = new GroupOrderInfoVo(); diff --git a/src/main/resources/mapper/TbProductMapper.xml b/src/main/resources/mapper/TbProductMapper.xml index 709b345..1a749ad 100644 --- a/src/main/resources/mapper/TbProductMapper.xml +++ b/src/main/resources/mapper/TbProductMapper.xml @@ -1,913 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - id, category_id, spec_id, source_path, brand_id, merchant_id, shop_id, name, short_title, - type, pack_fee, low_price, low_member_price, unit_id, unit_snap, cover_img, share_img, - video_cover_img, sort, limit_number, product_score, status, fail_msg, is_recommend, - is_hot, is_new, is_on_sale, is_show, type_enum, is_distribute, is_del, is_stock, - is_pause_sale, is_free_freight, freight_id, strategy_type, strategy_id, is_vip, is_delete, - 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, stock_number,warn_line - - - images, video, notice, group_snap, spec_info, select_spec - - select - , - from tb_product where id = #{id,jdbcType=INTEGER} - - delete from tb_product - where id = #{id,jdbcType=INTEGER} - - - insert into tb_product (id, category_id, spec_id, - source_path, brand_id, merchant_id, - shop_id, name, short_title, - type, pack_fee, low_price, - low_member_price, unit_id, unit_snap, - cover_img, share_img, video_cover_img, - sort, limit_number, product_score, - status, fail_msg, is_recommend, - is_hot, is_new, is_on_sale, - is_show, type_enum, is_distribute, - is_del, is_stock, is_pause_sale, - is_free_freight, freight_id, strategy_type, - strategy_id, is_vip, is_delete, - 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, - images, video, notice, - group_snap, spec_info, select_spec, stock_number,warn_line - ) - values (#{id,jdbcType=INTEGER}, #{categoryId,jdbcType=VARCHAR}, #{specId,jdbcType=INTEGER}, - #{sourcePath,jdbcType=VARCHAR}, #{brandId,jdbcType=INTEGER}, #{merchantId,jdbcType=VARCHAR}, - #{shopId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{shortTitle,jdbcType=VARCHAR}, - #{type,jdbcType=VARCHAR}, #{packFee,jdbcType=DECIMAL}, #{lowPrice,jdbcType=DECIMAL}, - #{lowMemberPrice,jdbcType=DECIMAL}, #{unitId,jdbcType=VARCHAR}, #{unitSnap,jdbcType=VARCHAR}, - #{coverImg,jdbcType=VARCHAR}, #{shareImg,jdbcType=VARCHAR}, #{videoCoverImg,jdbcType=VARCHAR}, - #{sort,jdbcType=INTEGER}, #{limitNumber,jdbcType=INTEGER}, #{productScore,jdbcType=INTEGER}, - #{status,jdbcType=TINYINT}, #{failMsg,jdbcType=VARCHAR}, #{isRecommend,jdbcType=TINYINT}, - #{isHot,jdbcType=TINYINT}, #{isNew,jdbcType=TINYINT}, #{isOnSale,jdbcType=TINYINT}, - #{isShow,jdbcType=TINYINT}, #{typeEnum,jdbcType=VARCHAR}, #{isDistribute,jdbcType=TINYINT}, - #{isDel,jdbcType=TINYINT}, #{isStock,jdbcType=TINYINT}, #{isPauseSale,jdbcType=TINYINT}, - #{isFreeFreight,jdbcType=TINYINT}, #{freightId,jdbcType=BIGINT}, #{strategyType,jdbcType=VARCHAR}, - #{strategyId,jdbcType=INTEGER}, #{isVip,jdbcType=TINYINT}, #{isDelete,jdbcType=TINYINT}, - #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{baseSalesNumber,jdbcType=DOUBLE}, - #{realSalesNumber,jdbcType=INTEGER}, #{salesNumber,jdbcType=INTEGER}, #{thumbCount,jdbcType=INTEGER}, - #{storeCount,jdbcType=INTEGER}, #{furnishMeal,jdbcType=INTEGER}, #{furnishExpress,jdbcType=INTEGER}, - #{furnishDraw,jdbcType=INTEGER}, #{furnishVir,jdbcType=INTEGER}, #{isCombo,jdbcType=TINYINT}, - #{isShowCash,jdbcType=TINYINT}, #{isShowMall,jdbcType=TINYINT}, #{isNeedExamine,jdbcType=TINYINT}, - #{showOnMallStatus,jdbcType=TINYINT}, #{showOnMallTime,jdbcType=BIGINT}, #{showOnMallErrorMsg,jdbcType=VARCHAR}, - #{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}, - #{stockNumber,jdbcType=INTEGER},#{warnLine,jdbcType=INTEGER} - ) - - - insert into tb_product - - - id, - - - category_id, - - - spec_id, - - - source_path, - - - brand_id, - - - merchant_id, - - - shop_id, - - - name, - - - short_title, - - - type, - - - pack_fee, - - - low_price, - - - low_member_price, - - - unit_id, - - - unit_snap, - - - cover_img, - - - share_img, - - - video_cover_img, - - - sort, - - - limit_number, - - - product_score, - - - status, - - - fail_msg, - - - is_recommend, - - - is_hot, - - - is_new, - - - is_on_sale, - - - is_show, - - - type_enum, - - - is_distribute, - - - is_del, - - - is_stock, - - - is_pause_sale, - - - is_free_freight, - - - freight_id, - - - strategy_type, - - - strategy_id, - - - is_vip, - - - is_delete, - - - 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, - - - images, - - - video, - - - notice, - - - group_snap, - - - spec_info, - - - select_spec, - - - stock_number, - - - warn_line, - - - - - #{id,jdbcType=INTEGER}, - - - #{categoryId,jdbcType=VARCHAR}, - - - #{specId,jdbcType=INTEGER}, - - - #{sourcePath,jdbcType=VARCHAR}, - - - #{brandId,jdbcType=INTEGER}, - - - #{merchantId,jdbcType=VARCHAR}, - - - #{shopId,jdbcType=VARCHAR}, - - - #{name,jdbcType=VARCHAR}, - - - #{shortTitle,jdbcType=VARCHAR}, - - - #{type,jdbcType=VARCHAR}, - - - #{packFee,jdbcType=DECIMAL}, - - - #{lowPrice,jdbcType=DECIMAL}, - - - #{lowMemberPrice,jdbcType=DECIMAL}, - - - #{unitId,jdbcType=VARCHAR}, - - - #{unitSnap,jdbcType=VARCHAR}, - - - #{coverImg,jdbcType=VARCHAR}, - - - #{shareImg,jdbcType=VARCHAR}, - - - #{videoCoverImg,jdbcType=VARCHAR}, - - - #{sort,jdbcType=INTEGER}, - - - #{limitNumber,jdbcType=INTEGER}, - - - #{productScore,jdbcType=INTEGER}, - - - #{status,jdbcType=TINYINT}, - - - #{failMsg,jdbcType=VARCHAR}, - - - #{isRecommend,jdbcType=TINYINT}, - - - #{isHot,jdbcType=TINYINT}, - - - #{isNew,jdbcType=TINYINT}, - - - #{isOnSale,jdbcType=TINYINT}, - - - #{isShow,jdbcType=TINYINT}, - - - #{typeEnum,jdbcType=VARCHAR}, - - - #{isDistribute,jdbcType=TINYINT}, - - - #{isDel,jdbcType=TINYINT}, - - - #{isStock,jdbcType=TINYINT}, - - - #{isPauseSale,jdbcType=TINYINT}, - - - #{isFreeFreight,jdbcType=TINYINT}, - - - #{freightId,jdbcType=BIGINT}, - - - #{strategyType,jdbcType=VARCHAR}, - - - #{strategyId,jdbcType=INTEGER}, - - - #{isVip,jdbcType=TINYINT}, - - - #{isDelete,jdbcType=TINYINT}, - - - #{createdAt,jdbcType=BIGINT}, - - - #{updatedAt,jdbcType=BIGINT}, - - - #{baseSalesNumber,jdbcType=DOUBLE}, - - - #{realSalesNumber,jdbcType=INTEGER}, - - - #{salesNumber,jdbcType=INTEGER}, - - - #{thumbCount,jdbcType=INTEGER}, - - - #{storeCount,jdbcType=INTEGER}, - - - #{furnishMeal,jdbcType=INTEGER}, - - - #{furnishExpress,jdbcType=INTEGER}, - - - #{furnishDraw,jdbcType=INTEGER}, - - - #{furnishVir,jdbcType=INTEGER}, - - - #{isCombo,jdbcType=TINYINT}, - - - #{isShowCash,jdbcType=TINYINT}, - - - #{isShowMall,jdbcType=TINYINT}, - - - #{isNeedExamine,jdbcType=TINYINT}, - - - #{showOnMallStatus,jdbcType=TINYINT}, - - - #{showOnMallTime,jdbcType=BIGINT}, - - - #{showOnMallErrorMsg,jdbcType=VARCHAR}, - - - #{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}, - - - #{stockNumber,jdbcType=INTEGER}, - - - #{warnLine,jdbcType=INTEGER}, - - - - - update tb_product - - - 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}, - - - 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}, - 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}, - stock_number = #{stockNumber,jdbcType=INTEGER}, - warn_line = #{warnLine,jdbcType=INTEGER} - where id = #{id,jdbcType=INTEGER} - - select * from tb_product where shop_id=#{shopId} and status=1 and is_show_cash = 1 and type_enum in ('normal','sku','currentPrice','weight') and name like CONCAT('%',#{commdityName},'%') @@ -915,7 +57,7 @@ order by `sort` asc - select a.* from tb_product as a left join tb_product_sku as b on a.id = b.product_id where a.shop_id=#{shopId} and a.status=1 and a.is_show_cash = 1 and a.type_enum in ('normal','sku','currentPrice','weight') @@ -927,7 +69,7 @@ - select * from tb_product where shop_id=#{shopId} and status=1 and category_id=#{categoryId} and is_show_cash = 1 and type_enum in ('normal','sku','currentPrice','weight') @@ -939,7 +81,7 @@ - select a.* from tb_product as a left join tb_product_sku as b on a.id = b.product_id @@ -951,7 +93,7 @@ and b.is_grounding=1 GROUP BY a.id ORDER BY a.`sort` - select a.* from tb_product as a left join tb_product_sku as b on a.id = b.product_id @@ -979,12 +121,6 @@ group by shop_id,product_id - - update tb_product - set stock_number = stock_number - #{num,jdbcType=INTEGER} - where id = #{productId} - - select a.* from tb_product as a left join tb_product_sku as b on a.id = b.product_id - where a.shop_id=#{shopId} and a.status=1 and a.is_show_cash = 1 and a.type_enum in ('normal','sku','currentPrice','weight') + where a.shop_id=#{shopId} and a.status=1 and a.is_del = 0 and a.is_grounding = 1 and a.type_enum in ('normal','sku','currentPrice','weight') and a.name like CONCAT('%',#{commdityName},'%') @@ -71,7 +70,7 @@ select @@ -49,28 +63,30 @@ + + + + + From 1157d4eb16b212ce3c71098cc5605e7cf621b6f2 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 19 Nov 2024 16:47:05 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=95=86=E5=93=81=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/entity/TbProduct.java | 2 ++ .../entity/vo/ProductGroupVo.java | 34 +++++++++++++++++++ .../service/ProductService.java | 6 ++++ 3 files changed, 42 insertions(+) create mode 100644 src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java 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 2d38cb3..42ea321 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -1,5 +1,6 @@ package com.chaozhanggui.system.cashierservice.entity; +import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo; import lombok.Data; import java.math.BigDecimal; import java.time.LocalTime; @@ -185,5 +186,6 @@ public class TbProduct implements Serializable { private Object groundingSpecInfo; private List skuList; + private List proGroupVo; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java new file mode 100644 index 0000000..61d7a28 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/ProductGroupVo.java @@ -0,0 +1,34 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +@Data +@JsonIgnoreProperties(ignoreUnknown = true) +public class ProductGroupVo { + + private Integer count; + //选几个 + private Integer number; + //类别 + private String title; + + //食物 + private List goods=new ArrayList<>(); + + @Data + @JsonIgnoreProperties(ignoreUnknown = true) + public static class Food { + private Integer proId; + private String proName; + private Integer skuId; + private String skuName; + private BigDecimal price; + private String number; + private String unitName; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java index 9fc02b9..797734b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -10,6 +10,8 @@ import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO; import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO; import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO; +import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo; +import com.chaozhanggui.system.cashierservice.entity.vo.ProductVo; import com.chaozhanggui.system.cashierservice.entity.vo.ShopCategoryVo; import com.chaozhanggui.system.cashierservice.exception.MsgException; import com.chaozhanggui.system.cashierservice.interceptor.LimitSubmitAspect; @@ -17,6 +19,7 @@ import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer; import com.chaozhanggui.system.cashierservice.sign.CodeEnum; import com.chaozhanggui.system.cashierservice.sign.Result; import com.chaozhanggui.system.cashierservice.util.DateUtils; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; import com.chaozhanggui.system.cashierservice.util.PageHelperUtil; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -126,6 +129,9 @@ public class ProductService { String day = DateUtils.getDay(); if(ObjectUtil.isNotEmpty(tbProducts)){ tbProducts.parallelStream().forEach(it->{ + if("package".equals(it.getType())){ + it.setProGroupVo(JSONUtil.parseListTNewList(it.getGroupSnap(), ProductGroupVo.class)); + } Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, tableId); it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount); TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId()); From 2b58a6f0ba0ddae1720f1f00efe3cd83f22a3184 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Wed, 20 Nov 2024 14:32:18 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E5=8F=91?= =?UTF-8?q?=E6=94=BE=20=E5=88=9D=E5=A7=8B=E5=8C=96=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/TbActivateInRecordMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/TbActivateInRecordMapper.xml b/src/main/resources/mapper/TbActivateInRecordMapper.xml index 8e742aa..cce9f16 100644 --- a/src/main/resources/mapper/TbActivateInRecordMapper.xml +++ b/src/main/resources/mapper/TbActivateInRecordMapper.xml @@ -111,7 +111,7 @@ over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json, source) values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num}, - #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, #{createTime}, + #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, now(), #{updateTime}, #{couponJson}, #{source}) @@ -124,7 +124,7 @@ (#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId}, #{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId}, #{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime}, - #{entity.createTime}, #{entity.updateTime}, #{entity.couponJson},#{entity.source}) + now(), #{entity.updateTime}, #{entity.couponJson},#{entity.source}) From 43c51fff6eb7ac9918e407cf9b1aa4c358cd708c Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 21 Nov 2024 15:39:12 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mapper/TbProductMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mapper/TbProductMapper.xml b/src/main/resources/mapper/TbProductMapper.xml index 7f29709..df2ec2b 100644 --- a/src/main/resources/mapper/TbProductMapper.xml +++ b/src/main/resources/mapper/TbProductMapper.xml @@ -47,7 +47,7 @@ - id, category_id, spec_id, merchant_id, shop_id, name, short_title, + id, category_id, spec_id, shop_id, name, short_title, type, pack_fee, low_price, unit_id, cover_img, images, sort, status, is_hot, type_enum, is_del, is_stock, is_pause_sale, created_at, updated_at, group_type, group_snap, spec_info, select_spec, spec_table_headers,