商品表字段 修改

This commit is contained in:
2024-11-18 14:59:47 +08:00
parent 24d11bc14e
commit ac73c1ebfb
7 changed files with 373 additions and 1831 deletions

View File

@@ -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));

View File

@@ -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);
@@ -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")

View File

@@ -1,685 +1,168 @@
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;
/**
* 商品类型(属性):REAL- 实物商品 VIR---虚拟商品
*/
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;
/**
* 是否删除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 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;
}
}

View File

@@ -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();
}
}

View File

@@ -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));

View File

@@ -419,7 +419,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 {
@@ -436,7 +436,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 {
@@ -530,7 +530,7 @@ public class ProductService {
it.setProductSkuResult(skuResult);
if (isVip) {
it.setLowPrice(BigDecimal.ZERO);
it.setIsVip(Byte.parseByte("1"));
it.setIsVip(1);
}
});
return products;
@@ -542,7 +542,7 @@ public class ProductService {
public void checkPauseSale(TbProduct tbProduct, List<TbProductSku> 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;
}
@@ -568,7 +568,7 @@ public class ProductService {
}
}
if (CollectionUtils.isEmpty(skus)) {
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
tbProduct.setIsPauseSale(1);//售罄 1暂停
}
}
}
@@ -729,13 +729,13 @@ public class ProductService {
lat = "34.343207";
lng = "108.939645";
}
CompletableFuture<TbProductWithBLOBs> product = CompletableFuture.supplyAsync(() ->
CompletableFuture<TbProduct> product = CompletableFuture.supplyAsync(() ->
tbProductMapper.selectByPrimaryKey(productId));
CompletableFuture<List<TbProductSku>> 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());

File diff suppressed because it is too large Load Diff