diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java index 55dc30d..fb606a0 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java @@ -117,7 +117,6 @@ public class LoginContoller { if (!hasOpenId) { return Result.fail("登录失败:" + wxResp.getString("errmsg")); } - String a = "{\"width\":\"58\",\"printerNum\":\"1\",\"categoryList\":[{\"id\":30,\"name\":\"奶茶\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":35,\"name\":\"酒水饮料\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":65,\"name\":\"火锅\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":95,\"name\":\"串串\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":96,\"name\":\"烧烤\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null}],\"model\":\"normal\",\"feet\":\"0\",\"autoCut\":\"1\"}"; // 3.接收微信接口服务 获取返回的参数 String openid = wxResp.getString("openid"); return loginService.wxCustomLogin(openid, "", "", "", IpUtil.getIpAddr(request)); diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java index 03d9409..6c334b4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java @@ -96,10 +96,9 @@ public class ProductController { @RequestParam(value = "code", required = false) String code, @RequestParam("shopId") String shopId, @RequestParam("productId") String productId, - @RequestParam("spec_tag") String spec_tag, - @RequestParam("isVip") String isVip + @RequestParam("spec_tag") String spec_tag ) { - return productService.queryProductSku(code,shopId, productId, spec_tag,isVip); + return productService.queryProductSku(code,shopId, productId, spec_tag); } @PostMapping("addCart") 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 4771272..f3850a4 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java @@ -1,7 +1,6 @@ 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.vo.ShopGroupInfoVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -15,7 +14,7 @@ import java.util.Set; @Mapper public interface TbProductMapper { - TbProductWithBLOBs selectByPrimaryKey(Integer id); + TbProduct selectByPrimaryKey(Integer id); TbProduct selectById(Integer id); @@ -27,7 +26,7 @@ public interface TbProductMapper { List selectByIds(@Param("list") List ids); Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId); - Integer selectByCodeAndSkuId(@Param("code") String code,@Param("skuId") Integer skuId,@Param("shopId") String shopId,@Param("isVip") String isVip); + Integer selectByCodeAndSkuId(@Param("code") String code,@Param("skuId") Integer skuId,@Param("shopId") String shopId); Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List list); List selGroups(@Param("proName") String proName,@Param("type") String type, @@ -39,9 +38,9 @@ public interface TbProductMapper { @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("cities") String cities, @Param("orderBy") String orderBy, @Param("lng") String lng, @Param("lat") String lat); - + @Update("update tb_product set real_sales_number = real_sales_number + #{number,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}") void upGroupRealSalesNumber(@Param("id") String id,@Param("number") Integer number); - + @Update("update tb_product set stock_number = stock_number - #{num,jdbcType=INTEGER} where id = #{productId}") void updateStockById(@Param("productId") String productId, @Param("num") Integer num); @Update("update tb_product set stock_number=stock_number-#{num} WHERE id=#{id} and stock_number-#{num} >= 0") 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 e455026..14a982d 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -1,685 +1,164 @@ package com.chaozhanggui.system.cashierservice.entity; +import lombok.Data; import org.springframework.data.annotation.Transient; import java.io.Serializable; import java.math.BigDecimal; +/** + * (TbProduct)实体类 + * + * @author ww + * @since 2024-11-18 14:41:53 + */ +@Data public class TbProduct implements Serializable { + private static final long serialVersionUID = -40921077034892720L; + /** + * 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; - + /** + * 商品类型(属性):普通商品 normal 套餐商品 package 称重商品 weigh 团购券商品 coupon + */ private String type; - + /** + * 包装费 + */ private BigDecimal packFee; - + /** + * 商品最低价 + */ private BigDecimal lowPrice; private BigDecimal lowMemberPrice; - - private String unitId; - + /** + * 单位Id + */ + private Integer unitId; private String unitSnap; - + /** + * 商品封面图 + */ private String coverImg; - - private String shareImg; - + /** + * 商品图片(第一张为缩略图,其他为详情) + */ private String images; - - private String videoCoverImg; - + /** + * 排序 + */ private Integer sort; - - private Integer limitNumber; - - private Integer productScore; - - private Byte status; - + /** + * 0--待审核 1审核通过 -1审核失败 -2违规下架 + */ + private Integer status; + /** + * 审核失败原因 + */ private String failMsg; - - private Byte isRecommend; - - private Byte isHot; - - private Byte isNew; - - private Byte isOnSale; - - private Byte isShow; - + /** + * 是否热销 + */ + private Integer isHot; + /** + * 计量商品 normal + * 称重商品 weight + * 多规格商品 sku + * 套餐商品 group + * 时价商品 currentPrice + */ private String typeEnum; - - 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; + /** + * 是否回收站 0-否,1回收站 + */ + private Integer isDel; + /** + * 是否开启库存 + */ + private Integer isStock; + /** + * 是否暂停销售 + */ + private Integer isPauseSale; 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 String cartNumber="0"; - private String groupCategoryId; - private Integer stockNumber; - private Integer suit; + private Integer isVip; //是否可售 1 可售 0非可售 private Integer isSale = 1; - private Integer warnLine = 0; - - - - public String getImages() { - return images; - } - - public void setImages(String images) { - this.images = images; - } - - public String getCartNumber() { - return cartNumber; - } - - public void setCartNumber(String cartNumber) { - this.cartNumber = cartNumber; - } - @Transient private TbProductSkuResult productSkuResult; - public TbProductSkuResult getProductSkuResult() { - return productSkuResult; - } - - public void setProductSkuResult(TbProductSkuResult productSkuResult) { - this.productSkuResult = productSkuResult; - } - - private static final long serialVersionUID = 1L; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getCategoryId() { - return categoryId; - } - - public void setCategoryId(String categoryId) { - this.categoryId = categoryId == null ? null : categoryId.trim(); - } - - public Integer getSpecId() { - return specId; - } - - public void setSpecId(Integer specId) { - this.specId = specId; - } - - public String getSourcePath() { - return sourcePath; - } - - public void setSourcePath(String sourcePath) { - this.sourcePath = sourcePath == null ? null : sourcePath.trim(); - } - - public Integer getBrandId() { - return brandId; - } - - public void setBrandId(Integer brandId) { - this.brandId = brandId; - } - - public String getMerchantId() { - return merchantId; - } - - public void setMerchantId(String merchantId) { - this.merchantId = merchantId == null ? null : merchantId.trim(); - } - - public String getShopId() { - return shopId; - } - - public void setShopId(String shopId) { - this.shopId = shopId == null ? null : shopId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getShortTitle() { - return shortTitle; - } - - public void setShortTitle(String shortTitle) { - this.shortTitle = shortTitle == null ? null : shortTitle.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public BigDecimal getPackFee() { - return packFee; - } - - public void setPackFee(BigDecimal packFee) { - this.packFee = packFee; - } - - public BigDecimal getLowPrice() { - return lowPrice; - } - - public void setLowPrice(BigDecimal lowPrice) { - this.lowPrice = lowPrice; - } - - public BigDecimal getLowMemberPrice() { - return lowMemberPrice; - } - - public void setLowMemberPrice(BigDecimal lowMemberPrice) { - this.lowMemberPrice = lowMemberPrice; - } - - public String getUnitId() { - return unitId; - } - - public void setUnitId(String unitId) { - this.unitId = unitId == null ? null : unitId.trim(); - } - - public String getUnitSnap() { - return unitSnap; - } - - public void setUnitSnap(String unitSnap) { - this.unitSnap = unitSnap == null ? null : unitSnap.trim(); - } - - public String getCoverImg() { - return coverImg; - } - - public void setCoverImg(String coverImg) { - this.coverImg = coverImg == null ? null : coverImg.trim(); - } - - public String getShareImg() { - return shareImg; - } - - public void setShareImg(String shareImg) { - this.shareImg = shareImg == null ? null : shareImg.trim(); - } - - public String getVideoCoverImg() { - return videoCoverImg; - } - - public void setVideoCoverImg(String videoCoverImg) { - this.videoCoverImg = videoCoverImg == null ? null : videoCoverImg.trim(); - } - - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; - } - - public Integer getLimitNumber() { - return limitNumber; - } - - public void setLimitNumber(Integer limitNumber) { - this.limitNumber = limitNumber; - } - - public Integer getProductScore() { - return productScore; - } - - public void setProductScore(Integer productScore) { - this.productScore = productScore; - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public String getFailMsg() { - return failMsg; - } - - public void setFailMsg(String failMsg) { - this.failMsg = failMsg == null ? null : failMsg.trim(); - } - - public Byte getIsRecommend() { - return isRecommend; - } - - public void setIsRecommend(Byte isRecommend) { - this.isRecommend = isRecommend; - } - - public Byte getIsHot() { - return isHot; - } - - public void setIsHot(Byte isHot) { - this.isHot = isHot; - } - - public Byte getIsNew() { - return isNew; - } - - public void setIsNew(Byte isNew) { - this.isNew = isNew; - } - - public Byte getIsOnSale() { - return isOnSale; - } - - public void setIsOnSale(Byte isOnSale) { - this.isOnSale = isOnSale; - } - - public Byte getIsShow() { - return isShow; - } - - public void setIsShow(Byte isShow) { - this.isShow = isShow; - } - - public String getTypeEnum() { - return typeEnum; - } - - public void setTypeEnum(String typeEnum) { - this.typeEnum = typeEnum == null ? null : typeEnum.trim(); - } - - - public Byte getIsDel() { - return isDel; - } - - public void setIsDel(Byte isDel) { - this.isDel = isDel; - } - - public Byte getIsStock() { - return isStock; - } - - public void setIsStock(Byte isStock) { - this.isStock = isStock; - } - - public Byte getIsPauseSale() { - return isPauseSale; - } - - public void setIsPauseSale(Byte isPauseSale) { - this.isPauseSale = isPauseSale; - } - - public Byte getIsFreeFreight() { - return isFreeFreight; - } - - public void setIsFreeFreight(Byte isFreeFreight) { - this.isFreeFreight = isFreeFreight; - } - - public Long getFreightId() { - return freightId; - } - - public void setFreightId(Long freightId) { - this.freightId = freightId; - } - - public String getStrategyType() { - return strategyType; - } - - public void setStrategyType(String strategyType) { - this.strategyType = strategyType == null ? null : strategyType.trim(); - } - - public Integer getStrategyId() { - return strategyId; - } - - public void setStrategyId(Integer strategyId) { - this.strategyId = strategyId; - } - - public Byte getIsVip() { - return isVip; - } - - public void setIsVip(Byte isVip) { - this.isVip = isVip; - } - - public Byte getIsDelete() { - return isDelete; - } - - public void setIsDelete(Byte isDelete) { - this.isDelete = isDelete; - } - - public Long getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Long createdAt) { - this.createdAt = createdAt; - } - - public Long getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(Long updatedAt) { - this.updatedAt = updatedAt; - } - - public Double getBaseSalesNumber() { - return baseSalesNumber; - } - - public void setBaseSalesNumber(Double baseSalesNumber) { - this.baseSalesNumber = baseSalesNumber; - } - - public Integer getRealSalesNumber() { - return realSalesNumber; - } - - public void setRealSalesNumber(Integer realSalesNumber) { - this.realSalesNumber = realSalesNumber; - } - - public Integer getSalesNumber() { - return salesNumber; - } - - public void setSalesNumber(Integer salesNumber) { - this.salesNumber = salesNumber; - } - - public Integer getThumbCount() { - return thumbCount; - } - - public void setThumbCount(Integer thumbCount) { - this.thumbCount = thumbCount; - } - - public Integer getStoreCount() { - return storeCount; - } - - public void setStoreCount(Integer storeCount) { - this.storeCount = storeCount; - } - - public Integer getFurnishMeal() { - return furnishMeal; - } - - public void setFurnishMeal(Integer furnishMeal) { - this.furnishMeal = furnishMeal; - } - - public Integer getFurnishExpress() { - return furnishExpress; - } - - public void setFurnishExpress(Integer furnishExpress) { - this.furnishExpress = furnishExpress; - } - - public Integer getFurnishDraw() { - return furnishDraw; - } - - public void setFurnishDraw(Integer furnishDraw) { - this.furnishDraw = furnishDraw; - } - - public Integer getFurnishVir() { - return furnishVir; - } - - public void setFurnishVir(Integer furnishVir) { - this.furnishVir = furnishVir; - } - - public Byte getIsCombo() { - return isCombo; - } - - public void setIsCombo(Byte isCombo) { - this.isCombo = isCombo; - } - - public Byte getIsShowCash() { - return isShowCash; - } - - public void setIsShowCash(Byte isShowCash) { - this.isShowCash = isShowCash; - } - - public Byte getIsShowMall() { - return isShowMall; - } - - public void setIsShowMall(Byte isShowMall) { - this.isShowMall = isShowMall; - } - - public Byte getIsNeedExamine() { - return isNeedExamine; - } - - public void setIsNeedExamine(Byte isNeedExamine) { - this.isNeedExamine = isNeedExamine; - } - - public Byte getShowOnMallStatus() { - return showOnMallStatus; - } - - public void setShowOnMallStatus(Byte showOnMallStatus) { - this.showOnMallStatus = showOnMallStatus; - } - - public Long getShowOnMallTime() { - return showOnMallTime; - } - - public void setShowOnMallTime(Long showOnMallTime) { - this.showOnMallTime = showOnMallTime; - } - - public String getShowOnMallErrorMsg() { - return showOnMallErrorMsg; - } - - public void setShowOnMallErrorMsg(String showOnMallErrorMsg) { - this.showOnMallErrorMsg = showOnMallErrorMsg == null ? null : showOnMallErrorMsg.trim(); - } - - public Byte getEnableLabel() { - return enableLabel; - } - - public void setEnableLabel(Byte enableLabel) { - this.enableLabel = enableLabel; - } - - public String getTaxConfigId() { - return taxConfigId; - } - - public void setTaxConfigId(String taxConfigId) { - this.taxConfigId = taxConfigId == null ? null : taxConfigId.trim(); - } - - public String getSpecTableHeaders() { - return specTableHeaders; - } - - public String getGroupCategoryId() { - return groupCategoryId; - } - - public void setGroupCategoryId(String groupCategoryId) { - this.groupCategoryId = groupCategoryId; - } - - - public void setSpecTableHeaders(String specTableHeaders) { - this.specTableHeaders = specTableHeaders == null ? null : specTableHeaders.trim(); - } - - public void setStockNumber(Integer stockNumber) { - this.stockNumber = stockNumber; - } - - public Integer getStockNumber() { - return this.stockNumber; - } - - public Integer getSuit() { - return suit; - } - - public void setSuit(Integer suit) { - this.suit = suit; - } - - public Integer getIsSale() { - return isSale; - } - - 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/TbProductWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java deleted file mode 100644 index 7e7b701..0000000 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.chaozhanggui.system.cashierservice.entity; - -import java.io.Serializable; - -public class TbProductWithBLOBs extends TbProduct implements Serializable { - private String images; - - private String video; - - private String notice; - - private String groupSnap; - - private String specInfo; - - private String selectSpec; - - private static final long serialVersionUID = 1L; - - public String getImages() { - return images; - } - - public void setImages(String images) { - this.images = images == null ? null : images.trim(); - } - - public String getVideo() { - return video; - } - - public void setVideo(String video) { - this.video = video == null ? null : video.trim(); - } - - public String getNotice() { - return notice; - } - - public void setNotice(String notice) { - this.notice = notice == null ? null : notice.trim(); - } - - public String getGroupSnap() { - return groupSnap; - } - - public void setGroupSnap(String groupSnap) { - this.groupSnap = groupSnap == null ? null : groupSnap.trim(); - } - - public String getSpecInfo() { - return specInfo; - } - - public void setSpecInfo(String specInfo) { - this.specInfo = specInfo == null ? null : specInfo.trim(); - } - - public String getSelectSpec() { - return selectSpec; - } - - public void setSelectSpec(String selectSpec) { - this.selectSpec = selectSpec == null ? null : selectSpec.trim(); - } -} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/redis/RedisCst.java b/src/main/java/com/chaozhanggui/system/cashierservice/redis/RedisCst.java index 0a87ea8..12d1fc6 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/redis/RedisCst.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/redis/RedisCst.java @@ -50,6 +50,9 @@ public class RedisCst { public static final String DINE_IN_TABLE_CART = "DINE_IN_TABLE_CART:"; // 当前台桌人数 public static final String CURRENT_TABLE_SEAR_COUNT = "CURRENT_TABLE_SEAR_COUNT:"; + // 取餐码 + public static final String MASTER_ID = "SHOP:CODE:USER:pc:"; + public static String getCurrentOrderKey(String tableId, String shopId) { @@ -87,4 +90,8 @@ public class RedisCst { public static String getCurrentTableSeatCount(Object shopId, String tableId) { return CURRENT_TABLE_SEAR_COUNT + (shopId + ":" + tableId); } + + public static String getMasterIdKey(String shopId, String day, String tableId) { + return MASTER_ID + shopId + ":" + day + ":" + tableId; + } } 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 5959f26..ae96e7c 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -45,6 +45,7 @@ import java.time.Instant; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -293,7 +294,6 @@ public class CartService { String skuId = jsonObject.getString("skuId"); Integer type = jsonObject.getInteger("type"); Integer buyNum = jsonObject.getInteger("num"); - Integer isVip = jsonObject.getInteger("isVip"); Integer userId = jsonObject.getInteger("userId"); // 商品备注 String note = jsonObject.getString("note"); @@ -355,7 +355,7 @@ public class CartService { if (Objects.isNull(array) || array.isEmpty()) { if (type == 1) { TbCashierCart cashierCart = addCart(productId, skuId, - jsonObject.getInteger("userId"), buyNum, tableId, shopId, isVip, note, shopEatTypeInfoDTO); + jsonObject.getInteger("userId"), buyNum, tableId, shopId, note, shopEatTypeInfoDTO); jsonArray.add(cashierCart); cashierCart.setPlaceNum(cashierCart.getPlaceNum() == null ? 0 : cashierCart.getPlaceNum()); cashierCartArrayList.add(cashierCart); @@ -374,11 +374,11 @@ public class CartService { TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class); cashierCart.setPlaceNum(cashierCart.getPlaceNum() == null ? 0 : cashierCart.getPlaceNum()); - if (cashierCart.getSkuId().equals(skuId) && (isVip == null || cashierCart.getIsVip().intValue() == isVip)) { + if (cashierCart.getSkuId().equals(skuId)) { cashierCart.setTotalNumber(buyNum); cashierCart.setNumber(buyNum); cashierCart.setNote(note); - if (tbProductSkuWithBLOBs != null && type == 0 && isVip != null && isVip == 0 && tbProductSkuWithBLOBs.getSuit() != null + if (tbProductSkuWithBLOBs != null && type == 0 && tbProductSkuWithBLOBs.getSuit() != null && tbProductSkuWithBLOBs.getSuit() > 1 && cashierCart.getNumber() < tbProductSkuWithBLOBs.getSuit()) { cashierCartMapper.deleteByPrimaryKey(cashierCart.getId()); continue; @@ -402,11 +402,11 @@ public class CartService { product.getPackFee().multiply(BigDecimal.valueOf(buyNum)) : BigDecimal.ZERO); } - if (isVip != null && isVip == 1) { - cashierCart.setTotalAmount(BigDecimal.ZERO); - } else { - cashierCart.resetTotalAmount(); - } +// if (isVip != null && isVip == 1) { +// cashierCart.setTotalAmount(BigDecimal.ZERO); +// } else { + cashierCart.resetTotalAmount(); +// } cashierCart.setUpdatedAt(Instant.now().toEpochMilli()); mpCashierCartMapper.updateById(cashierCart); } else { @@ -429,7 +429,7 @@ public class CartService { if (flag && type == 1) { TbCashierCart cashierCart = addCart(productId, skuId, - jsonObject.getInteger("userId"), buyNum, tableId, shopId, isVip, note, shopEatTypeInfoDTO); + jsonObject.getInteger("userId"), buyNum, tableId, shopId, note, shopEatTypeInfoDTO); jsonArray.add(cashierCart); amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); BigDecimal mPrice = cashierCart.getIsMember() != null && cashierCart.getIsMember() == 1 && @@ -442,19 +442,17 @@ public class CartService { } else { if (type == 1) { TbCashierCart cashierCart = addCart(productId, skuId, - jsonObject.getInteger("userId"), buyNum, tableId, shopId, isVip, note, shopEatTypeInfoDTO); + jsonObject.getInteger("userId"), buyNum, tableId, shopId, note, shopEatTypeInfoDTO); if (!TableConstant.CART_SEAT_ID.equals(productId)) { jsonArray.add(cashierCart); } cashierCart.setPlaceNum(cashierCart.getPlaceNum() == null ? 0 : cashierCart.getPlaceNum()); cashierCartArrayList.add(cashierCart); - if (isVip != 1) { - amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); - BigDecimal mPrice = cashierCart.getIsMember() != null && cashierCart.getIsMember() == 1 && - cashierCart.getMemberPrice() != null && cashierCart.getMemberPrice().compareTo(BigDecimal.ZERO) > 0 ? cashierCart.getMemberPrice() : cashierCart.getSalePrice(); - memberAmount = memberAmount.add(mPrice.multiply(BigDecimal.valueOf(cashierCart.getTotalNumber())).add(cashierCart.getPackFee())); + amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); + BigDecimal mPrice = cashierCart.getIsMember() != null && cashierCart.getIsMember() == 1 && + cashierCart.getMemberPrice() != null && cashierCart.getMemberPrice().compareTo(BigDecimal.ZERO) > 0 ? cashierCart.getMemberPrice() : cashierCart.getSalePrice(); + memberAmount = memberAmount.add(mPrice.multiply(BigDecimal.valueOf(cashierCart.getTotalNumber())).add(cashierCart.getPackFee())); - } } } } catch (MsgException e) { @@ -579,7 +577,7 @@ public class CartService { } private TbCashierCart addCart(String productId, String skuId, Integer userId, Integer num, - String tableId, String shopId, Integer isVip, String note, ShopEatTypeInfoDTO shopEatTypeInfoDTO) throws Exception { + String tableId, String shopId, String note, ShopEatTypeInfoDTO shopEatTypeInfoDTO) throws Exception { try { // 查询用户信息 TbShopUser shopUser = shopUserMapper.selectByUserIdAndShopId(String.valueOf(userId), shopId); @@ -591,7 +589,7 @@ public class CartService { String key = tableId + "-" + shopId; TbProductSkuWithBLOBs productSku = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId)); TbCashierCart cashierCart = new TbCashierCart(); - if (productSku.getSuit() != null && productSku.getSuit() > 1 && isVip != 1) { + if (productSku.getSuit() != null && productSku.getSuit() > 1) { if (product.getIsStock() == 1) { boolean isSale = false; if (num > productSku.getSuit()) { @@ -642,14 +640,8 @@ public class CartService { if (shopEatTypeInfoDTO.isTakeout() && product.getPackFee() != null) { cashierCart.setPackFee(product.getPackFee().multiply(BigDecimal.valueOf(num))); } - if (isVip == 1) { - cashierCart.setIsVip(Byte.parseByte("1")); - cashierCart.setTotalAmount(BigDecimal.ZERO); - cashierCart.setSalePrice(BigDecimal.ZERO); - } else { - cashierCart.setIsVip((byte) 0); - cashierCart.resetTotalAmount(); - } + cashierCart.setIsVip((byte) 0); + cashierCart.resetTotalAmount(); cashierCart.setPlatformType(PlatformTypeEnum.MINI_APP.getValue()); mpCashierCartMapper.insert(cashierCart); @@ -984,8 +976,19 @@ public class CartService { } + public synchronized void addGlobalCode(String day, String clientType, String shopId) { + String code = stringRedisTemplate.opsForValue().get("SHOP:CODE:" + clientType + ":" + shopId + ":" + day); + if (StrUtil.isBlank(code)) { + stringRedisTemplate.opsForValue().set("SHOP:CODE:" + clientType + ":" + shopId + ":" + day, "1"); + } else { + stringRedisTemplate.opsForValue().get("SHOP:CODE:" + clientType + ":" + shopId + ":" + (Integer.parseInt(code) + 1)); + } + stringRedisTemplate.opsForValue().setIfAbsent("SHOP:CODE:SET" + clientType + ":" + shopId + ":" + day, "1"); + } + + private TbOrderInfo createOrderInfoWithCoupon(CreateOrderDTO createOrderDTO, OrderPriceDTO priceDTO, ShopEatTypeInfoDTO eatTypeInfoDTO, - TbOrderInfo orderInfo, TbCashierCart seatCart, TbShopUser shopUser, TbShopTable shopTable, OrderCouponInfoDTO couponInfoDTO) { + TbOrderInfo orderInfo, TbCashierCart seatCart, TbShopUser shopUser, TbShopTable shopTable, OrderCouponInfoDTO couponInfoDTO, String masterId) { Integer placeNum = getCurrentPlaceNum(eatTypeInfoDTO.getTableId(), eatTypeInfoDTO.getShopInfo().getId(), eatTypeInfoDTO); // 修改订单信息 if (orderInfo == null) { @@ -1005,8 +1008,16 @@ public class CartService { } orderInfo.setMerchantId(merchantAccount.getId().toString()); orderInfo.setIsPostpaid(eatTypeInfoDTO.isDineInAfter() ? 1 : 0); + if (eatTypeInfoDTO.isIncrMaterId()) { + String key = RedisCst.getMasterIdKey(String.valueOf(createOrderDTO.getShopId()), DateUtils.getDay(), orderInfo.getTableId()); + stringRedisTemplate.delete(key); + } else { + addGlobalCode(DateUtils.getDay(), "pc", String.valueOf(createOrderDTO.getShopId())); + } } + // 更新取餐号 + orderInfo.setMasterId(masterId); orderInfo.setOutNumber(getOutNumber(createOrderDTO.getShopId().toString()).toString()); orderInfo.setUpdatedAt(System.currentTimeMillis()); orderInfo.setSettlementAmount(priceDTO.getTotalAmount()); @@ -1038,9 +1049,8 @@ public class CartService { } private OrderPriceDTO createOrderDetailWithCoupon(List fullCashierCarts, Integer orderId, - Integer shopId, ShopEatTypeInfoDTO shopEatTypeInfoDTO, boolean onlyChangeCoupon) { + Integer shopId, ShopEatTypeInfoDTO shopEatTypeInfoDTO, boolean onlyChangeCoupon, String masterId) { OrderPriceDTO priceDTO = new OrderPriceDTO(); - List cartIds = fullCashierCarts.stream().map(TbCashierCart::getId).collect(Collectors.toList()); // 查询历史orderDetail List oldOrderDetailList = orderDetailService @@ -1056,6 +1066,9 @@ public class CartService { }); for (TbCashierCart cashierCart : fullCashierCarts) { +// if (StrUtil.isNotBlank(cashierCart.getMasterId())) { + cashierCart.setMasterId(masterId); +// } // 设置打包费 if (shopEatTypeInfoDTO.isTakeout() && !TableConstant.CashierCart.ID.equals(cashierCart.getProductId())) { cashierCart.setTableId(""); @@ -1151,7 +1164,7 @@ public class CartService { couponVo.setCurrentUseNum(couponVo.getCurrentUseNum() - cashierCart.getNumber()); currentUseNum = BigDecimal.valueOf(cashierCart.getNumber()); // 优惠券数量小于购物车数量,分割购物车数据 - }else if (cashierCart.getNumber() > couponVo.getCurrentUseNum()) { + } else if (cashierCart.getNumber() > couponVo.getCurrentUseNum()) { currentUseNum = BigDecimal.valueOf(couponVo.getCurrentUseNum()); BigDecimal cartNum = BigDecimal.valueOf(cashierCart.getNumber()); int balanceNum = cashierCart.getTotalNumber() - couponVo.getCurrentUseNum(); @@ -1225,13 +1238,18 @@ public class CartService { tbUserCouponVos = new ArrayList<>(); tbUserCouponVos.add(item); couponMap.put(item.getProId().toString(), tbUserCouponVos); - }else { + } else { tbUserCouponVos.add(item); } }); HashMap> usedCouponMap = new HashMap<>(); ArrayList outRecords = new ArrayList<>(); + ArrayList resetCouponList = new ArrayList<>(); for (TbCashierCart cashierCart : cartInfoDTO.getNewCashierCarts()) { + if (!couponMap.isEmpty()) { + resetCouponList.add(cashierCart); + cashierCart.setUserCouponId(null); + } discountAmount = reduceProCoupon(couponMap, cashierCart, usedCouponMap, discountAmount, balanceCartList, outRecords, memberId); } @@ -1241,6 +1259,21 @@ public class CartService { cashierCartService.saveBatch(balanceCartList); } // 更新购物车信息 + if (!resetCouponList.isEmpty()) { + // 取消之前使用的历史券 + + ArrayList resetCartIds = new ArrayList<>(); + resetCouponList.forEach(item -> { + if (item.getUserCouponId() == null) { + resetCartIds.add(item.getId()); + } + }); + if (!resetCartIds.isEmpty()) { + cashierCartService.update(new LambdaUpdateWrapper() + .in(TbCashierCart::getId, resetCartIds) + .set(TbCashierCart::getUserCouponId, null)); + } + } cashierCartService.updateBatchById(cartInfoDTO.getNewCashierCarts()); couponInfoDTO.setOutRecordList(outRecords); @@ -1262,7 +1295,7 @@ public class CartService { // 设置会员信息及价格 if (shopUser.getIsVip() == 0) { tbCashierCart.setIsMember(0); - }else { + } else { if (!TableConstant.CashierCart.ID.equals(tbCashierCart.getProductId())) { TbProductSkuWithBLOBs sku = productSkuMapper.selectByPrimaryKey(Integer.valueOf(tbCashierCart.getSkuId())); tbCashierCart.setIsMember(sku.getMemberPrice() != null && sku.getMemberPrice().compareTo(BigDecimal.ZERO) > 0 ? 1 : 0); @@ -1325,6 +1358,42 @@ public class CartService { return null; } + private String getMasterId(String shopId, String tableId) { + String day = DateUtils.getDay(); + JSONObject jsonObject = new JSONObject(); + // 当前台桌码 + String key = RedisCst.getMasterIdKey(shopId, day, tableId); + String userCode = stringRedisTemplate.opsForValue().get(key); + + if (StringUtils.isEmpty(userCode) || "null".equals(userCode) || "#null".equals(userCode)) { + String code = "#" + generateOrderCode(day, "pc", String.valueOf(shopId)); + stringRedisTemplate.opsForValue().set(key, code); + return code; + } else { + return userCode; + } + } + + public synchronized String generateOrderCode(String day, String clientType, String shopId) { + String code = stringRedisTemplate.opsForValue().get("SHOP:CODE:" + clientType + ":" + shopId + ":" + day); + // 使用顺序递增的计数器生成取餐码 + String orderCode = ""; + if (StringUtils.isEmpty(code) || "null".equals(code)) { + orderCode = "1"; + stringRedisTemplate.opsForValue().set("SHOP:CODE:" + clientType + ":" + shopId + ":" + day, "1"); + } else { + orderCode = String.valueOf(Integer.parseInt(code.replace("#", "")) + 1); + } + stringRedisTemplate.opsForValue().set("SHOP:CODE:" + clientType + ":" + shopId + ":" + day, orderCode); + boolean flag = Boolean.TRUE.equals(stringRedisTemplate.opsForValue().setIfAbsent("SHOP:CODE:SET" + clientType + ":" + shopId + ":" + day, orderCode)); + if (flag) { + return generateOrderCode(day, clientType, shopId); + } + // 增加计数器 + + return orderCode; + } + @Transactional(rollbackFor = Exception.class) public Result createOrder(CreateOrderDTO orderDTO) { try { @@ -1357,7 +1426,7 @@ public class CartService { List cashierCartList; if (orderDTO.isOnlyChangeCoupon()) { cashierCartList = cashierCartService.selectByOrderId(orderDTO.getShopId(), orderDTO.getOrderId()); - }else { + } else { cashierCartList = cashierCartService.selectByShopEatTypeInfo(shopEatTypeInfoDTO, orderDTO.getUserId()); } if (cashierCartList.isEmpty()) { @@ -1394,12 +1463,14 @@ public class CartService { } // 创建订单详情数据 - OrderPriceDTO detailPriceDTO = createOrderDetailWithCoupon(cartInfoDTO.getCashierCarts(), cartInfoDTO.getOrderId(), orderDTO.getShopId(), shopEatTypeInfoDTO, orderDTO.isOnlyChangeCoupon()); + String masterId = getMasterId(shopId, shopEatTypeInfoDTO.getTableId()); + OrderPriceDTO detailPriceDTO = createOrderDetailWithCoupon(cartInfoDTO.getCashierCarts(), cartInfoDTO.getOrderId(), + orderDTO.getShopId(), shopEatTypeInfoDTO, orderDTO.isOnlyChangeCoupon(), masterId); detailPriceDTO.setProductDiscountAmount(discountAmount); // 是否是第一次创建订单 orderInfo = createOrderInfoWithCoupon(orderDTO, detailPriceDTO, shopEatTypeInfoDTO, - orderInfo, cartInfoDTO.getSeatCart(), tbShopUser, shopTable, couponInfo); + orderInfo, cartInfoDTO.getSeatCart(), tbShopUser, shopTable, couponInfo, masterId); if (orderInfo.getId() == null) { mpOrderInfoMapper.insert(orderInfo); @@ -1407,7 +1478,7 @@ public class CartService { // 计算订单满减优惠 TbActivateOutRecord outRecord = calcOrderInfoDiscount(orderDTO, orderInfo, couponInfo, Integer.valueOf(tbShopUser.getId())); - if (couponInfo != null) { + if (couponInfo != null) { if (outRecord != null) { couponInfo.getOutRecordList().add(outRecord); } @@ -1441,6 +1512,7 @@ public class CartService { mpOrderInfoMapper.updateById(orderInfo); if (!orderDTO.isOnlyChangeCoupon()) { + String tableCartKey = RedisCst.getTableCartKey(shopId, shopEatTypeInfoDTO.isOpenDineIn() ? tableId : null, Integer.valueOf(userId)); redisUtil.deleteByKey(tableCartKey); } @@ -1572,7 +1644,7 @@ public class CartService { // .eq(TbCashierCart::getTableId, choseEatModelDTO.getTableId()) .and(q -> q.eq(TbCashierCart::getUseType, shopEatTypeInfoDTO.getUseType()).or().isNull(TbCashierCart::getUseType).or().eq(TbCashierCart::getUseType, "")) .eq(TbCashierCart::getStatus, "create"); - }else { + } else { queryWrapper = new LambdaQueryWrapper() .eq(TbCashierCart::getShopId, choseEatModelDTO.getShopId()) .gt(TbCashierCart::getCreatedAt, DateUtil.offsetDay(DateUtil.date(), -1).getTime()) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/GroupOrderInfoService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/GroupOrderInfoService.java index 99dd1da..10efddd 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/GroupOrderInfoService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/GroupOrderInfoService.java @@ -86,7 +86,7 @@ public class GroupOrderInfoService { result.setAddress(shopInfo.getAddress()); result.setShopPhone(shopInfo.getPhone()); - TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(groupOrder.getProId()); + TbProduct product = tbProductMapper.selectByPrimaryKey(groupOrder.getProId()); result.setTagVos(JSONUtil.parseListTNewList(product.getGroupSnap(), ProductVo.class)); 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 d81d89d..0b6a90b 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -558,7 +558,13 @@ public class PayService { return Result.fail("订单十五分钟内有效,当前已超时,请重新下单。"); } - TbUserInfo userInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getUserId())); + TbShopUser user = tbShopUserMapper.selectByPrimaryKey(memberId); + if (ObjectUtil.isEmpty(user) || user.getIsVip() == null || !"1".equals(user.getIsVip().toString())) { +// return Result.failCode("会员卡余额不足","1"); + return Result.success(CodeEnum.SUCCESS, "4"); + } + + TbUserInfo userInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(user.getUserId())); if (ObjectUtil.isEmpty(userInfo)) { return Result.fail("未获取到用户信息"); } @@ -583,11 +589,6 @@ public class PayService { } - TbShopUser user = tbShopUserMapper.selectByPrimaryKey(memberId); - if (ObjectUtil.isEmpty(user) || user.getIsVip() == null || !"1".equals(user.getIsVip().toString())) { -// return Result.failCode("会员卡余额不足","1"); - return Result.success(CodeEnum.SUCCESS, "4"); - } if (N.gt(orderInfo.getOrderAmount(), user.getAmount())) { // return Result.failCode("会员卡余额不足","2"); @@ -615,6 +616,7 @@ public class PayService { orderInfo.setPayAmount(orderInfo.getOrderAmount()); orderInfo.setMemberId(memberId); + orderInfo.setUserId(userInfo.getId().toString()); orderInfo.setPayType("deposit"); orderInfo.setStatus("closed"); orderInfo.setPaidTime(System.currentTimeMillis()); @@ -684,6 +686,12 @@ public class PayService { // 重置台桌状态 if (StrUtil.isNotBlank(orderInfo.getTableId())) { + // 增加台桌取餐码 + if (TableConstant.OrderInfo.UseType.DINE_IN_AFTER.equalsVals(orderInfo.getUseType())) { + String key = RedisCst.getMasterIdKey(String.valueOf(orderInfo.getShopId()), DateUtils.getDay(), orderInfo.getTableId()); + stringRedisTemplate.delete(key); + } + TbShopTable shopTable = mpShopTableService.selectByQrcode(orderInfo.getTableId()); if (shopTable.getAutoClear() != null && shopTable.getAutoClear() == 1) { mpShopTableService.updateStateByQrcode(orderInfo.getTableId(), TableConstant.ShopTable.State.IDLE); @@ -1333,6 +1341,12 @@ public class PayService { // 重置台桌状态 if (StrUtil.isNotBlank(orderInfo.getTableId())) { + // 增加台桌取餐码 + if (TableConstant.OrderInfo.UseType.DINE_IN_AFTER.equalsVals(orderInfo.getUseType())) { + String key = RedisCst.getMasterIdKey(String.valueOf(orderInfo.getShopId()), DateUtils.getDay(), orderInfo.getTableId()); + stringRedisTemplate.delete(key); + } + TbShopTable shopTable = mpShopTableService.selectByQrcode(orderInfo.getTableId()); if (shopTable.getAutoClear() != null && shopTable.getAutoClear() == 1) { mpShopTableService.updateStateByQrcode(orderInfo.getTableId(), TableConstant.ShopTable.State.IDLE); @@ -1509,7 +1523,7 @@ public class PayService { //充值送积分 TbActivate activate = tbActivateMapper.selectByAmountScope(tbShopUser.getShopId(), memberIn.getAmount()); if (ObjectUtil.isNotNull(activate)) { - tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftAmount(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftAmount()), null, memberIn.getOrderNo()); + tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftPoints(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftPoints()), null, memberIn.getOrderNo()); } JSONObject jsonObject = new JSONObject(); @@ -1711,7 +1725,7 @@ public class PayService { //充值送积分 TbActivate activate = tbActivateMapper.selectByAmountScope(tbShopUser.getShopId(), memberIn.getAmount()); if (ObjectUtil.isNotNull(activate)) { - tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftAmount(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftAmount()), null, memberIn.getOrderNo()); + tbMemberPointsService.addPoints(Convert.toLong(tbShopUser.getId()), activate.getGiftPoints(), StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftPoints()), null, memberIn.getOrderNo()); } JSONObject jsonObject = new JSONObject(); jsonObject.put("shopId", memberIn.getShopId()); 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 2382dc8..8ecf8ef 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -424,7 +424,7 @@ public class ProductService { spec.put("isGrounding", true); TbProductSku sku = (TbProductSku) spec.get("info"); if (sku != null) { - tbProduct.setIsPauseSale(sku.getIsPauseSale().byteValue()); + tbProduct.setIsPauseSale(sku.getIsPauseSale()); checkPauseSale(tbProduct, new ArrayList<>(Collections.singletonList(sku)), true); spec.put("isPauseSale", tbProduct.getIsPauseSale()); }else { @@ -441,7 +441,7 @@ public class ProductService { itemMap.put("isGrounding", false); TbProductSku sku = unGroundingMap.get("specSnap"); if (sku != null) { - tbProduct.setIsPauseSale(sku.getIsPauseSale().byteValue()); + tbProduct.setIsPauseSale(sku.getIsPauseSale()); checkPauseSale(tbProduct, Collections.singletonList(sku), true); itemMap.put("isPauseSale", tbProduct.getIsPauseSale()); }else { @@ -515,7 +515,7 @@ public class ProductService { } if (item.getMemberPrice() == null || item.getMemberPrice().compareTo(BigDecimal.ZERO) <= 0) { - item.setMealPrice(item.getSalePrice()); + item.setMemberPrice(item.getSalePrice()); } } // 销量 @@ -535,7 +535,7 @@ public class ProductService { it.setProductSkuResult(skuResult); if (isVip) { it.setLowPrice(BigDecimal.ZERO); - it.setIsVip(Byte.parseByte("1")); + it.setIsVip(1); } }); return products; @@ -547,7 +547,7 @@ public class ProductService { public void checkPauseSale(TbProduct tbProduct, List skus, boolean isSingle) { if (tbProduct.getIsStock() == 1) {//库存开关 1开启 if (tbProduct.getStockNumber() != null && tbProduct.getStockNumber() <= 0) { - tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停 + tbProduct.setIsPauseSale(1);//售罄 1暂停 return; } @@ -573,14 +573,14 @@ public class ProductService { } } if (CollectionUtils.isEmpty(skus)) { - tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停 + tbProduct.setIsPauseSale(1);//售罄 1暂停 } } } - public Result queryProductSku(String code, String shopId, String productId, String spec_tag,String isVip) { - if (ObjectUtil.isEmpty(shopId) || ObjectUtil.isEmpty(productId) || StringUtils.isEmpty(isVip)|| isVip.equals("undefined") ) { + public Result queryProductSku(String code, String shopId, String productId, String spec_tag) { + if (ObjectUtil.isEmpty(shopId) || ObjectUtil.isEmpty(productId) ) { return Result.fail("参数错误"); } TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByShopIdAndProductIdAndSpec(shopId, productId, spec_tag); @@ -593,7 +593,7 @@ public class ProductService { tbProductSkuWithBLOBs.setId(null); }else { if (StringUtils.isNotBlank(code)) { - Integer sum = tbProductMapper.selectByCodeAndSkuId(code, tbProductSkuWithBLOBs.getId(), shopId,isVip); + Integer sum = tbProductMapper.selectByCodeAndSkuId(code, tbProductSkuWithBLOBs.getId(), shopId); tbProductSkuWithBLOBs.setNumber(sum); } } @@ -704,7 +704,11 @@ public class ProductService { homeVO.setDiscount(BigDecimalUtils.getDiscount(tbProductSku.getOriginPrice(), tbProductSku.getSalePrice())); } //销量 - homeVO.setRealSalesNumber(new BigDecimal(o.getNumber())); + if (o.getNumber() == null) { + homeVO.setRealSalesNumber(BigDecimal.ZERO); + }else { + homeVO.setRealSalesNumber(new BigDecimal(o.getNumber())); + } //现价 homeVO.setSalePrice(new BigDecimal(tbProductSku.getSalePrice().toString())); // 共省金额 @@ -734,13 +738,13 @@ public class ProductService { lat = "34.343207"; lng = "108.939645"; } - CompletableFuture product = CompletableFuture.supplyAsync(() -> + CompletableFuture product = CompletableFuture.supplyAsync(() -> tbProductMapper.selectByPrimaryKey(productId)); CompletableFuture> productSku = CompletableFuture.supplyAsync(() -> tbProductSkuMapper.selectSku(productId.toString())); Threads.call(product, productSku); - TbProductWithBLOBs tbProduct = product.get(); + TbProduct tbProduct = product.get(); TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(tbProduct.getShopId())); TbPurchaseNotice tbPurchaseNotice = purchaseNoticeMapper.queryByCouponId(tbProduct.getId()); diff --git a/src/main/resources/mapper/TbProductMapper.xml b/src/main/resources/mapper/TbProductMapper.xml index 753a331..84e9c14 100644 --- a/src/main/resources/mapper/TbProductMapper.xml +++ b/src/main/resources/mapper/TbProductMapper.xml @@ -1,1126 +1,251 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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, images, - 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,group_category_id,stock_number,warn_line - - - images, video, notice, group_snap, spec_info, select_spec - - - - 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_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,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}, - #{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}, - #{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}, - #{groupCategoryId,jdbcType=VARCHAR},#{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_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, - - - group_category_id, - - - 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}, - - - #{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}, - - - #{groupCategoryId,jdbcType=VARCHAR}, - - - #{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_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_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_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} - - - update tb_product - set real_sales_number = real_sales_number + #{number,jdbcType=INTEGER} - where id = #{id,jdbcType=INTEGER} - - - update tb_product - set stock_number = stock_number - #{num,jdbcType=INTEGER} - where id = #{productId} - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + id + , category_id, spec_id, merchant_id, shop_id, name, short_title, type, pack_fee, low_price, low_member_price, + unit_id, cover_img, images, sort, status, fail_msg, is_hot, type_enum, is_del, is_stock, is_pause_sale, + created_at, updated_at, group_snap, spec_info, select_spec, + spec_table_headers, group_category_id, real_sales_number, stock_number, is_grounding, is_refund_stock, warn_line + - + - + + + - + + + + + + + - - - - - - - - - - - + + + + - + - + + diff --git a/src/main/resources/mapper/TbProductSkuMapper.xml b/src/main/resources/mapper/TbProductSkuMapper.xml index 0b77dfe..ce20ff9 100644 --- a/src/main/resources/mapper/TbProductSkuMapper.xml +++ b/src/main/resources/mapper/TbProductSkuMapper.xml @@ -406,7 +406,7 @@ LEFT JOIN tb_product_sku sku ON pro.id = sku.product_id WHERE pro.type_enum = 'group' - AND pro.is_combo = '1' +# AND pro.is_combo = '1' GROUP BY sku.product_id ORDER BY @@ -426,7 +426,7 @@ LEFT JOIN tb_product_sku sku ON pro.id = sku.product_id WHERE pro.type_enum = 'group' - AND pro.is_combo = '1' +# AND pro.is_combo = '1' GROUP BY sku.product_id ORDER BY