记得上下班打卡 | git大法好,push需谨慎

Commit f5dec7ba authored by zhangguobing's avatar zhangguobing

~api:券商品业务-添加券商品;

parent 8a069918
package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSpecValueVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSpecVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ApiModel(value = "GoblinStoreMgtGoodsCouponAddParam", description = "商品管理:添加券类商品入参")
@Data
public class GoblinStoreMgtGoodsCouponAddParam implements Serializable {
private static final long serialVersionUID = -6261151635859590265L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID")
@NotNull(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = false, value = "商品ID[编辑时必传]")
private String spuId;
/**
* ---------------------------- 基本信息 ----------------------------
**/
@ApiModelProperty(position = 12, required = true, value = "商品名称[36]")
@NotBlank(message = "商品名称不能为空")
@Size(max = 36, message = "商品名称长度超限")
private String name;
@ApiModelProperty(position = 13, required = false, value = "商品名称[128]")
@Size(max = 128, message = "商品副名称长度超限")
private String subtitle;//-
@ApiModelProperty(position = 14, required = false, value = "商品销售价-原价[20,2]")
private BigDecimal sellPrice;//-
@ApiModelProperty(position = 15, required = true, value = "商品一级分类ID[30]")
@NotBlank(message = "商品分类ID不能为空")
private String cateFid;
@ApiModelProperty(position = 16, required = true, value = "商品二级分类ID[30]")
private String cateSid;
@ApiModelProperty(position = 17, required = true, value = "商品三级分类ID[30]")
private String cateTid;
@ApiModelProperty(position = 18, required = false, value = "商品简介[256]", example = "商品简介...")
@Size(max = 256, message = "商品简介内容过长")
private String intro;
@ApiModelProperty(position = 19, required = false, value = "商品标签列表")
private List<String> tagList;
@ApiModelProperty(position = 20, required = true, value = "商品图片列表")
private List<String> imageList;
@ApiModelProperty(position = 21, required = false, value = "商品图片封面")
@Size(max = 256, message = "商品图片封面URL过长")
private String coverPic;
@ApiModelProperty(position = 22, required = false, value = "商品视频地址")
@Size(max = 256, message = "商品视频地址URL过长")
private String video;
/**
* ---------------------------- 价格库存 ----------------------------
**/
@ApiModelProperty(position = 23, required = true, value = "规格展现方式[1-常规|2-组合]", allowableValues = "1,2", example = "1")
@NotBlank(message = "规格展现方式不能为空")
@Pattern(regexp = "\\b(1|2)\\b", message = "规格展现方式参数无效")
private String specMode;
@ApiModelProperty(position = 24, required = false, value = "SKU规格信息[初次添加商品必填]")
// @NotNull(message = "SKU规格信息不能为空")
@Valid
private GoblinStoreMgtGoodsCouponAddSkuParam skuParam;
@ApiModelProperty(position = 25, required = true, value = "物流模版", example = "松鼠德邦")
@Size(max = 50, message = "物流模版ID过长")
private String logisticsTemplate;//-
@ApiModelProperty(position = 26, required = false, value = "商品编码[默认为系统编码,也可手动输入商家自己的编码]")
@Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_UNDER_50, message = "商品编码格式或长度有误")
private String spuNo;
@ApiModelProperty(position = 26, required = true, value = "ERP类型[WANGDIAN-旺店通]")
@Pattern(regexp = "\\b(WANGDIAN)\\b", message = "ERP类型无效")
private String erpType;//-
@ApiModelProperty(position = 26, required = false, value = "ERP货品编号[商品对应在ERP的商品编码,默认为空]")
@Size(max = 40, message = "ERP货品编号长度限制40")
private String spuErpCode;//-
/**
* ---------------------------- 商品介绍 ----------------------------
**/
@ApiModelProperty(position = 27, required = true, value = "商品详情", example = "商品详情...")
@Size(max = 10000, message = "商品详情内容过长")
private String details;
/**
* ---------------------------- 销售属性 ----------------------------
**/
@ApiModelProperty(position = 28, required = true, value = "上架处理方式[1-等待手动上架|2-直接上架售卖|3-预约定时上架]", example = "1")
@NotNull(message = "上架处理方式不能为空")
@Pattern(regexp = "\\b(1|2|3)\\b", message = "规格展现方式参数无效")
private String shelvesHandle;
@ApiModelProperty(position = 29, required = false, value = "预约上架时间[yyyy-MM-dd HH:mm:ss][上架处理方式为3-预约定时上架时需要指定]")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "预约上架时间格式有误")
private String shelvesTime;
@ApiModelProperty(position = 30, required = false, value = "商品有效期[yyyy-MM-dd]")
@Pattern(regexp = LnsRegex.Valid.DATETIME_YMD, message = "商品有效期格式有误")
private String spuValidity;
@ApiModelProperty(position = 31, required = true, value = "是否虚拟商品[0-否|1-是]", allowableValues = "0,1", example = "0")
@Pattern(regexp = "\\b(0|1)\\b", message = "是否虚拟商品参数无效")
private String virtualFlg;//---默认1
/**
* ---------------------------- 服务保障 ----------------------------
**/
@ApiModelProperty(position = 32, required = false, value = "商品服务支持ID列表")
private List<String> ssidList;
/**
* ---------------------------- 专属标签 ----------------------------
**/
@ApiModelProperty(position = 33, required = false, value = "商品关联音乐人、艺术家、品牌方、厂牌列表")
private List<String> extagList;
/**
* ---------------------------- AR标签 ----------------------------
**/
@ApiModelProperty(position = 33, required = false, value = "商品关联音乐人、艺术家、品牌方、厂牌、AR列表")
private List<String> artagList;
/**
* 生成券类SPU
*
* @return GoblinGoodsInfoVo
*/
public GoblinGoodsInfoVo initGoodsInfoVo(String currentUid, LocalDateTime nowTime) {
GoblinGoodsInfoVo vo = GoblinGoodsInfoVo.getNew();
vo.setStoreId(this.getStoreId());
if (StringUtils.isBlank(this.getSpuId())) {
vo.setSpuId(IDGenerator.nextMilliId2());
} else {
vo.setSpuId(this.getSpuId());
}
if (StringUtils.isBlank(this.getSpuNo())) {
vo.setSpuNo(vo.getSpuId());
} else {
vo.setSpuNo(this.getSpuNo());
}
vo.setName(this.getName());
vo.setSubtitle(this.getSubtitle());
vo.setSellPrice(this.getSellPrice());
// vo.setPriceGe(BigDecimal.ZERO);
// vo.setPriceLe(BigDecimal.ZERO);
vo.setIntro(this.getIntro());
vo.setDetails(this.getDetails());
vo.setCoverPic(StringUtils.isBlank(this.getCoverPic()) ? this.getImageList().get(0) : this.getCoverPic());
vo.setVideo(this.getVideo());
vo.setSpecMode("1");
vo.setCateFid(this.getCateFid());
vo.setCateSid(this.getCateSid());
vo.setCateTid(this.getCateTid());
vo.setShelvesHandle(this.getShelvesHandle());
vo.setShelvesTime(this.getShelvesTime());
vo.setSpuValidity(this.getSpuValidity());
vo.setVirtualFlg("1");
vo.setStatus("3");
// vo.setReason(null);
// vo.setShelvesStatus("0");
if (vo.getShelvesHandle().equals("2")) {
vo.setShelvesStatus("3");// `上架处理方式`:2-直接上架售卖,直接上架
vo.setShelvesAt(LocalDateTime.now());
} else {
vo.setShelvesStatus("0");
}
vo.setSpuAppear("0");
vo.setDelFlg("0");
// vo.setShelvesAt(null);
vo.setImageList(this.getImageList());
vo.setLogisticsTemplate("");
vo.setCreatedBy(currentUid);
vo.setCreatedAt(nowTime);
// vo.setUpdatedBy();
// vo.setUpdatedAt();
// vo.setSpecVoList();
// vo.setTagVoList();
// vo.setServiceSupportVoList();
// vo.setExtagVoList();
vo.setErpType(StringUtils.isBlank(this.getErpType()) ? "WANGDIAN" : this.getErpType());
vo.setSpuErpCode(StringUtils.trim(this.getSpuErpCode()));
return vo;
}
/**
* 编辑SPU参数整理
*
* @return GoblinGoodsInfoVo
*/
public GoblinGoodsInfoVo initEditGoodsInfoVo() {
GoblinGoodsInfoVo vo = GoblinGoodsInfoVo.getNew();
vo.setStoreId(this.getStoreId());
vo.setSpuId(this.getSpuId());
vo.setSpuNo(this.getSpuNo());
vo.setName(this.getName());
vo.setSubtitle(this.getSubtitle());
vo.setSellPrice(this.getSellPrice());
vo.setIntro(this.getIntro());
vo.setDetails(this.getDetails());
vo.setCoverPic(StringUtils.isBlank(this.getCoverPic()) ? this.getImageList().get(0) : this.getCoverPic());
vo.setVideo(this.getVideo());
vo.setSpecMode("1");
vo.setCateFid(this.getCateFid());
vo.setCateSid(this.getCateSid());
vo.setCateTid(this.getCateTid());
vo.setShelvesHandle(this.getShelvesHandle());
vo.setShelvesTime(this.getShelvesTime());
vo.setSpuValidity(this.getSpuValidity());
vo.setVirtualFlg("1");
vo.setImageList(this.getImageList());
vo.setLogisticsTemplate("");
// vo.setErpType();// 暂不考虑更改ERP类型
vo.setSpuErpCode(StringUtils.trim(this.getSpuErpCode()));
return vo;
}
/**
* 生成SKU列表以及SPU规格等信息
*
* @param goodsInfoVo GoblinGoodsInfoVo
* @param vos List<GoblinGoodsSkuInfoVo>
* @param goodsSpecVos List<GoblinGoodsSpecVo>
*/
public void initGoodsSkuInfoVo(GoblinGoodsInfoVo goodsInfoVo, List<GoblinGoodsSkuInfoVo> vos,
List<GoblinGoodsSpecVo> goodsSpecVos) {
GoblinGoodsSkuInfoVo skuInfoVo = GoblinGoodsSkuInfoVo.getNew();
GoblinStoreMgtGoodsCouponAddSkuParam addSkuParam = this.getSkuParam();
{// 券信息设置
skuInfoVo.setIsTrueName(null == addSkuParam.getIsTrueName() ? 1 : addSkuParam.getIsTrueName());// 券类商品默认需要实名登记
skuInfoVo.setBusiType(1);// 业务类别暂时只支持演出
skuInfoVo.setCouType(1);// 券类型暂时只支持代金券
skuInfoVo.setUseScope(addSkuParam.getUseScope());
skuInfoVo.setValFace(addSkuParam.getValFace());
skuInfoVo.setValidity(0);
skuInfoVo.setEffectAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(addSkuParam.getEffectTime()));
skuInfoVo.setExpireAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(addSkuParam.getExpireTime()));
}
if (StringUtils.isBlank(addSkuParam.getSkuId())) {
skuInfoVo.setSkuId(goodsInfoVo.getSpuId().concat(StringUtils.right(String.valueOf(System.nanoTime()), 5)));
} else {
skuInfoVo.setSkuId(addSkuParam.getSkuId());
}
skuInfoVo.setSpuId(goodsInfoVo.getSpuId());
if (StringUtils.isNotBlank(addSkuParam.getSkuNo())) {
skuInfoVo.setSkuNo(addSkuParam.getSkuNo());
} else {
skuInfoVo.setSkuNo(goodsInfoVo.getSpuNo());
}
if (StringUtils.isNotBlank(addSkuParam.getSkuBarCode())) {
skuInfoVo.setSkuBarCode(addSkuParam.getSkuBarCode());
} else {
skuInfoVo.setSkuBarCode(goodsInfoVo.getSpuNo());
}
skuInfoVo.setName("张");
skuInfoVo.setSubtitle(goodsInfoVo.getSubtitle());
skuInfoVo.setSkuPic("");
skuInfoVo.setSkuIsbn("");
skuInfoVo.setStock(addSkuParam.getStock());
skuInfoVo.setSkuStock(skuInfoVo.getStock());
skuInfoVo.setWarningStock(addSkuParam.getWarningStock());
skuInfoVo.setSellPrice(addSkuParam.getSellPrice());
skuInfoVo.setPrice(addSkuParam.getPrice());
skuInfoVo.setPriceMember(null == addSkuParam.getPriceMember() ? addSkuParam.getPrice() : addSkuParam.getPriceMember());
skuInfoVo.setWeight(addSkuParam.getWeight());
skuInfoVo.setBuyFactor(addSkuParam.getBuyFactor());
skuInfoVo.setBuyRoster(addSkuParam.getBuyRoster());
skuInfoVo.setBuyLimit(addSkuParam.getBuyLimit());
skuInfoVo.setStoreId(goodsInfoVo.getStoreId());
// skuInfoVo.setSkuValidity(DateUtil.Formatter.yyyyMMddHHmmss.parse(addSkuParam.getSkuValidity()));
skuInfoVo.setVirtualFlg("1");
skuInfoVo.setStatus("3");// 没有审核流程,默认通过
// skuInfoVo.setReason();
skuInfoVo.setShelvesStatus(goodsInfoVo.getShelvesStatus());
skuInfoVo.setSkuAppear(StringUtils.isBlank(addSkuParam.getSkuAppear()) ? "0" : addSkuParam.getSkuAppear());
skuInfoVo.setDelFlg("0");
// skuInfoVo.setShelvesAt();
skuInfoVo.setCreatedBy(goodsInfoVo.getCreatedBy());
skuInfoVo.setCreatedAt(goodsInfoVo.getCreatedAt());
// skuInfoVo.setUpdatedBy();
// skuInfoVo.setUpdatedAt();
skuInfoVo.setLogisticsTemplate("");
skuInfoVo.setSkuErpCode(StringUtils.trim(addSkuParam.getSkuErpCode()));
skuInfoVo.setErpType(goodsInfoVo.getErpType());
skuInfoVo.setErpWarehouseNo(StringUtils.trim(addSkuParam.getErpWarehouseNo()));
if (StringUtils.equals(addSkuParam.getErpHosting(), "1")) {
skuInfoVo.setErpHosting(1);
if (StringUtils.isBlank(goodsInfoVo.getSpuErpCode())) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("149022");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
if (StringUtils.isBlank(skuInfoVo.getSkuErpCode())) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("149023");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
if (StringUtils.isBlank(skuInfoVo.getErpWarehouseNo())) {
ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("149024");
throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
} else {
skuInfoVo.setErpHosting(0);
}
{// 规格信息处理
// 券类商品固定规格
GoblinGoodsSpecDto goblinGoodsSpecDto = GoblinGoodsSpecDto.getNew();
goblinGoodsSpecDto.setSpecName("规格");
goblinGoodsSpecDto.setSpecVname("张");
// SKU规格设置
List<GoblinGoodsSpecDto> skuSpecList = addSkuParam.getSkuSpecList();
skuSpecList.add(goblinGoodsSpecDto);
skuInfoVo.setSkuSpecList(skuSpecList);
// SPU规格集合
GoblinGoodsSpecValueVo specValueVo = GoblinGoodsSpecValueVo.getNew().setSpecVname(goblinGoodsSpecDto.getSpecVname()).setSpecVsort(0);
ArrayList<GoblinGoodsSpecValueVo> specValueVos = new ArrayList<>();
specValueVos.add(specValueVo);
goodsSpecVos.add(GoblinGoodsSpecVo.getNew().setSpecName(goblinGoodsSpecDto.getSpecName()).setSpecSort(0).setSpecValues(specValueVos));
}
vos.add(skuInfoVo);
List<String> skuIdList = CollectionUtil.arrayListString();
skuIdList.add(skuInfoVo.getSkuId());
goodsInfoVo.setPriceGe(skuInfoVo.getPrice());
goodsInfoVo.setPriceLe(skuInfoVo.getPrice());
goodsInfoVo.setSpecVoList(goodsSpecVos);
goodsInfoVo.setSkuIdList(skuIdList);
}
}
package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ApiModel(value = "GoblinStoreMgtGoodsCouponAddSkuParam", description = "商品管理:添加券类商品:添加券SKU入参")
@Data
public class GoblinStoreMgtGoodsCouponAddSkuParam implements Serializable {
private static final long serialVersionUID = 7886534346305369761L;
@ApiModelProperty(position = 10, required = false, value = "单品ID[编辑时必传]")
private String skuId;
@ApiModelProperty(position = 11, required = false, value = "单品编码[默认为系统编码,也可手动输入商家自己的编码]")
@Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_UNDER_50, message = "单品编码格式或长度有误")
private String skuNo;
@ApiModelProperty(position = 12, required = false, value = "单品条码")
@Pattern(regexp = LnsRegex.Valid.ALPHABET_NUMBER_32, message = "单品条码格式或长度有误")
private String skuBarCode;
@ApiModelProperty(position = 13, required = false, value = "ERP商家编码")
@Size(max = 40, message = "ERP商家编码长度限制40")
private String skuErpCode;//-
@ApiModelProperty(position = 14, value = "ERP托管[0-否|1-是],默认0")
@Pattern(regexp = "\\b(0|1)\\b", message = "ERP托管参数无效")
private String erpHosting;//-
@ApiModelProperty(position = 15, required = false, value = "ERP仓库编号")
@Size(max = 40, message = "ERP仓库编号长度限制40")
private String erpWarehouseNo;//-
@ApiModelProperty(position = 16, required = true, value = "单品默认图片的url[256]")
@NotBlank(message = "单品图片不能为空")
private String skuPic;
@ApiModelProperty(position = 12, required = true, value = "单品规格信息")
@NotNull(message = "规格信息不能为空")
// @Valid// 初始化写死['规格':'张']
private List<GoblinGoodsSpecDto> skuSpecList;
@ApiModelProperty(position = 18, required = false, value = "单品销售价-原价[20,2]")
private BigDecimal sellPrice;
@ApiModelProperty(position = 19, required = true, value = "单品现价[20,2]")
@Digits(integer = 6, fraction = 2, message = "参数'单品现价'无效")
@DecimalMin(value = "0.01", message = "参数'单品现价'必须为大于0")
private BigDecimal price;
@ApiModelProperty(position = 20, required = true, value = "单品会员价格[20,2]")
@NotNull(message = "单品会员价格不能为空")
@Min(value = 0, message = "单品会员价格不能小于0")
private BigDecimal priceMember;
@ApiModelProperty(position = 21, required = false, value = "单品的重量[20,2]")
private BigDecimal weight;//-
@ApiModelProperty(position = 20, required = true, value = "总库存")
@Min(value = 0, message = "总库存不能小于0")
private Integer stock;
@ApiModelProperty(position = 21, required = false, value = "预警库存")
private Integer warningStock;
@ApiModelProperty(position = 22, required = false, value = "ISBN,针对CD/图书等[100]")
private String skuIsbn;//-
@ApiModelProperty(position = 23, required = true, value = "购买限制[0-全部用户|1-仅会员|2-指定用户]")
@NotNull(message = "购买限制不能为空")
private String buyFactor;
@ApiModelProperty(position = 24, required = false, value = "购买限制人员名单[购买限制为2-指定用户时必填]")
private String buyRoster;
@ApiModelProperty(position = 25, required = false, value = "限量[0-无限制|X:限购数量]")
private Integer buyLimit;
@ApiModelProperty(position = 26, required = false, value = "单品有效期[yyyy-MM-dd HH:mm:ss]")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "单品有效期格式有误")
private String skuValidity;
@ApiModelProperty(position = 27, value = "自定义展示[0-默认展示|1-隐藏不可购买]")
private String skuAppear;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 28, required = true, value = "是否实名[0-否|1-是]", example = "1")
@Pattern(regexp = "\\b(0|1)\\b", message = "参数'是否实名'无效")
private Integer isTrueName;
@ApiModelProperty(position = 29, required = true, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]")
@Pattern(regexp = "\\b(101|102|103)\\b", message = "参数'适用范围'无效")
private Integer useScope;
@ApiModelProperty(position = 30, required = true, value = "面值", example = "99.00")
@Digits(integer = 3, fraction = 2, message = "参数'面值'无效")
@DecimalMin(value = "0.01", message = "参数'面值'必须为大于0")
private BigDecimal valFace;
@ApiModelProperty(position = 31, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-01-01 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "开始时间格式有误")
@NotNull(message = "参数'开始时间'不可为空")
private String effectTime;
@ApiModelProperty(position = 32, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-12-31 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "结束时间格式有误")
@NotNull(message = "参数'结束时间'不可为空")
private String expireTime;
}
package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.commons.lang.constant.LnsRegex;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
@ApiModel(value = "GoblinStoreMgtGoodsCouponEditSkuParam", description = "商品管理:编辑券类商品:编辑券SKU入参")
@Data
public class GoblinStoreMgtGoodsCouponEditSkuParam implements Serializable {
private static final long serialVersionUID = 8174428924922310702L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID[64]")
@NotBlank(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "商品ID[64]")
@NotNull(message = "商品ID不能为空")
private String spuId;
@ApiModelProperty(position = 12, required = true, value = "单品ID[编辑时必传]")
@NotNull(message = "商品SKU_ID不能为空")
private String skuId;
@ApiModelProperty(position = 13, required = true, value = "单品现价[20,2]")
@Digits(integer = 3, fraction = 2, message = "参数'单品现价'无效")
@DecimalMin(value = "0.01", message = "参数'单品现价'必须为大于0")
private BigDecimal price;
@ApiModelProperty(position = 14, required = false, value = "总库存")
private Integer stock;
@ApiModelProperty(position = 14, required = false, value = "总库存")
private Integer skuStock;
@ApiModelProperty(position = 14, required = false, value = "加减库存")
private Integer operStock;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 15, required = true, value = "是否实名[0-否|1-是]", example = "1")
@Pattern(regexp = "\\b(0|1)\\b", message = "参数'是否实名'无效")
private Integer isTrueName;
@ApiModelProperty(position = 16, required = true, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]")
@Pattern(regexp = "\\b(101|102|103)\\b", message = "参数'适用范围'无效")
private Integer useScope;
@ApiModelProperty(position = 17, required = true, value = "面值", example = "99.00")
@Digits(integer = 3, fraction = 2, message = "参数'面值'无效")
@DecimalMin(value = "0.01", message = "参数'面值'必须为大于0")
private BigDecimal valFace;
@ApiModelProperty(position = 18, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-01-01 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "开始时间格式有误")
@NotNull(message = "参数'开始时间'不可为空")
private String effectTime;
@ApiModelProperty(position = 19, required = true, value = "结束时间[yyyy-MM-dd HH:mm:ss]", example = "2024-12-31 00:00:00")
@Pattern(regexp = LnsRegex.Valid.DATETIME_FULL, message = "结束时间格式有误")
@NotNull(message = "参数'结束时间'不可为空")
private String expireTime;
public GoblinGoodsSkuInfoVo initEditGoodsSkuInfoVo() {
GoblinGoodsSkuInfoVo goodsSkuInfoVo = GoblinGoodsSkuInfoVo.getNew();
goodsSkuInfoVo.setSkuId(this.getSkuId());
goodsSkuInfoVo.setPrice(this.getPrice());
goodsSkuInfoVo.setPriceMember(this.getPrice());
goodsSkuInfoVo.setStock(this.getStock());
goodsSkuInfoVo.setSkuStock(this.getSkuStock());
goodsSkuInfoVo.setIsTrueName(this.getIsTrueName());
goodsSkuInfoVo.setUseScope(this.getUseScope());
goodsSkuInfoVo.setValFace(this.getValFace());
goodsSkuInfoVo.setEffectAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getEffectTime()));
goodsSkuInfoVo.setExpireAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getExpireTime()));
return goodsSkuInfoVo;
}
}
package com.liquidnet.service.goblin.dto.vo; package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto; import com.liquidnet.service.goblin.dto.GoblinGoodsSpecDto;
...@@ -137,6 +136,30 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable { ...@@ -137,6 +136,30 @@ public class GoblinGoodsSkuInfoVo implements Serializable, Cloneable {
private String nftHash; private String nftHash;
@ApiModelProperty(position = 33, value = "NFT系列声明时间") @ApiModelProperty(position = 33, value = "NFT系列声明时间")
private String declareAt; private String declareAt;
/**
* ---------------------------- 券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 33, value = "是否实名[0-否|1-是]")
private Integer isTrueName;
@ApiModelProperty(position = 33, value = "业务类别[0-全场|1-演出|2-商品|3-优先购]")
private Integer busiType;
@ApiModelProperty(position = 33, value = "券类型[1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]")
private Integer couType;
@ApiModelProperty(position = 33, value = "适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]")
private Integer useScope;
@ApiModelProperty(position = 33, value = "面值")
private BigDecimal valFace;
@ApiModelProperty(position = 33, value = "购买后(单位天)有效期,与生效/过期时间二选一")
private Integer validity;
@ApiModelProperty(position = 33, value = "生效时间[yyyy-MM-dd HH:mm:ss]")
private LocalDateTime effectAt;
@ApiModelProperty(position = 33, value = "过期时间[yyyy-MM-dd HH:mm:ss]")
private LocalDateTime expireAt;
/**
* ---------------------------- 以上为券类商品-代金券属性 ----------------------------
*/
@ApiModelProperty(position = 34, value = "删除标记[0-未删除|1-删除]") @ApiModelProperty(position = 34, value = "删除标记[0-未删除|1-删除]")
private String delFlg; private String delFlg;
@ApiModelProperty(position = 35, value = "上架时间") @ApiModelProperty(position = 35, value = "上架时间")
......
...@@ -78,6 +78,13 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable { ...@@ -78,6 +78,13 @@ public class GoblinOrderSkuVo implements Serializable, Cloneable {
@ApiModelProperty(value = "erp-仓库号") @ApiModelProperty(value = "erp-仓库号")
private String erpWarehouseNo; private String erpWarehouseNo;
@ApiModelProperty(value = "关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证")
private Integer idType;
@ApiModelProperty(value = "关联人姓名")
private String idName;
@ApiModelProperty(value = "关联人证件号码")
private String idNo;
public String getPushTime() { public String getPushTime() {
return pushTime == null ? "" : pushTime; return pushTime == null ? "" : pushTime;
} }
......
...@@ -69,6 +69,16 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -69,6 +69,16 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
boolean digitalGoodsEditSpu(String uid, GoblinStoreMgtDigitalGoodsAddParam mgtDigitalGoodsAddParam, GoblinGoodsInfoVo goodsInfoVo); boolean digitalGoodsEditSpu(String uid, GoblinStoreMgtDigitalGoodsAddParam mgtDigitalGoodsAddParam, GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:商品编辑:SPU编辑
*
* @param uid UID
* @param mgtGoodsCouponAddParam GoblinStoreMgtGoodsCouponAddParam
* @param goodsInfoVo GoblinGoodsInfoVo
* @return boolean
*/
boolean couponGoodsEditSpu(String uid, GoblinStoreMgtGoodsCouponAddParam mgtGoodsCouponAddParam, GoblinGoodsInfoVo goodsInfoVo);
/** /**
* 商品管理:商品编辑:SKU编辑 * 商品管理:商品编辑:SKU编辑
* *
...@@ -93,6 +103,16 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -93,6 +103,16 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
boolean digitalGoodsEditSku(String uid, GoblinStoreMgtDigitalGoodsAddSkuParam mgtDigitalGoodsAddSkuParam, GoblinGoodsInfoVo mgtGoodsInfoVo); boolean digitalGoodsEditSku(String uid, GoblinStoreMgtDigitalGoodsAddSkuParam mgtDigitalGoodsAddSkuParam, GoblinGoodsInfoVo mgtGoodsInfoVo);
/**
* 商品管理:商品编辑:SKU编辑-券类商品
*
* @param uid UID
* @param mgtGoodsEditSkuParam GoblinStoreMgtGoodsCouponEditSkuParam
* @param goodsInfoVo GoblinGoodsInfoVo
* @return boolean
*/
boolean couponGoodsEditSku(String uid, GoblinStoreMgtGoodsCouponEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo);
/** /**
* 商品管理:商品编辑:SKU添加 * 商品管理:商品编辑:SKU添加
* *
......
...@@ -104,6 +104,26 @@ public class CandyCoupon implements Serializable { ...@@ -104,6 +104,26 @@ public class CandyCoupon implements Serializable {
*/ */
private Integer validity; private Integer validity;
/**
* 是否实名[0-否|1-是,表示该券需要实名使用]
*/
private Integer isTrueName;
/**
* 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private Integer idType;
/**
* 关联人姓名
*/
private String idName;
/**
* 关联人证件号码
*/
private String idNo;
/** /**
* 兑换有效期(单位天) * 兑换有效期(单位天)
*/ */
......
...@@ -30,6 +30,11 @@ public class GoblinGoodsSkuCoupon implements Serializable { ...@@ -30,6 +30,11 @@ public class GoblinGoodsSkuCoupon implements Serializable {
*/ */
private String skuId; private String skuId;
/**
* 是否实名[0-否|1-是,表示该券需要实名使用]
*/
private Integer isTrueName;
/** /**
* 业务类别[1-演出] * 业务类别[1-演出]
*/ */
...@@ -45,11 +50,6 @@ public class GoblinGoodsSkuCoupon implements Serializable { ...@@ -45,11 +50,6 @@ public class GoblinGoodsSkuCoupon implements Serializable {
*/ */
private Integer useScope; private Integer useScope;
/**
* 注意/须知
*/
private String notice;
/** /**
* 面值 * 面值
*/ */
......
...@@ -30,19 +30,19 @@ public class GoblinOrderSkuAssoc implements Serializable { ...@@ -30,19 +30,19 @@ public class GoblinOrderSkuAssoc implements Serializable {
private String orderSkuId; private String orderSkuId;
/** /**
* 1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证 * 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/ */
private Integer idType; private Integer idType;
/** /**
* 关联人证件号码 * 关联人姓名
*/ */
private String idCard; private String idName;
/** /**
* 关联人姓名 * 关联人证件号码
*/ */
private String personName; private String idNo;
/** /**
* 操作人 * 操作人
......
...@@ -182,7 +182,28 @@ create table candy_coupon_relate ...@@ -182,7 +182,28 @@ create table candy_coupon_relate
) engine InnoDB comment '券适用关联配置'; ) engine InnoDB comment '券适用关联配置';
create index idx_ccr_coupon_id on candy_coupon_relate (coupon_id); create index idx_ccr_coupon_id on candy_coupon_relate (coupon_id);
# -- >>------------------------------------------------------------------------------------ |20240123 商品券业务 # -- >>------------------------------------------------------------------------------------ |20240123 商品券业务
alter table candy_coupon add is_true_name smallint default 0 comment '是否实名[0-否|1-是,表示该券需要实名使用]' after validity;
alter table candy_coupon add id_type smallint default 0 comment '关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证' after is_true_name;
alter table candy_coupon add id_name varchar(30) default '' comment '关联人姓名' after id_type;
alter table candy_coupon add id_no varchar(30) default '' comment '关联人证件号码' after id_name;
alter table candy_coupon_rule modify use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]'; alter table candy_coupon_rule modify use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演|100-全场|90-演出|91-场次|92-票|80-商品|81-款式]';
drop table if exists candy_mgt_coupon_snapshot;
create table candy_mgt_coupon_snapshot
(
mid bigint unsigned auto_increment primary key,
mcoupon_id varchar(64) not null comment '~candy_coupon.coupon_id',
coupon_template text,
operator varchar(64) not null comment '操作人',
created_at datetime(3) not null,
updated_at datetime(3),
comment text
) engine InnoDB comment '券适用关联配置';
create index idx_cmcs_mcoupon_id on candy_mgt_coupon_snapshot (mcoupon_id);
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
\ No newline at end of file
...@@ -1253,11 +1253,11 @@ create table goblin_goods_sku_coupon ...@@ -1253,11 +1253,11 @@ create table goblin_goods_sku_coupon
busi_type smallint null comment '业务类别[1-演出]', busi_type smallint null comment '业务类别[1-演出]',
cou_type smallint null comment '券类型[1-代金券]', cou_type smallint null comment '券类型[1-代金券]',
use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]', use_scope smallint null comment '适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]',
notice varchar(200) null comment '注意/须知',
val_face decimal(8, 2) comment '面值', val_face decimal(8, 2) comment '面值',
validity int null comment '购买后(单位天)有效期,与生效/过期时间二选一', is_true_name smallint default 0 comment '是否实名[0-否|1-是,表示该券需要实名使用]',
validity int default 0 comment '购买后(单位天)有效期,与生效/过期时间二选一',
effect_at datetime(3) null comment '生效时间', effect_at datetime(3) null comment '生效时间',
expire_at datetime(3) null comment '过期时间', expire_at datetime(3) null comment '过期时间',
...@@ -1272,9 +1272,9 @@ create table goblin_order_sku_assoc ...@@ -1272,9 +1272,9 @@ create table goblin_order_sku_assoc
mid bigint unsigned auto_increment primary key, mid bigint unsigned auto_increment primary key,
order_sku_id varchar(64) default '' null comment '订单sku_id', order_sku_id varchar(64) default '' null comment '订单sku_id',
id_type tinyint not null comment '1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证', id_type tinyint not null comment '关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证',
id_card varchar(30) not null comment '关联人证件号码', id_name varchar(30) not null comment '关联人姓名',
person_name varchar(60) not null comment '关联人姓名', id_no varchar(30) not null comment '关联人证件号码',
operator varchar(64) not null comment '操作人', operator varchar(64) not null comment '操作人',
created_at datetime(3) not null, created_at datetime(3) not null,
......
...@@ -540,7 +540,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -540,7 +540,7 @@ public class GoblinStoreMgtGoodsController {
} }
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("商品管理:SPU添加:[GoblinStoreMgtGoodsAddParam={}]", JsonUtils.toJson(mgtDigitalGoodsAddParam)); log.debug("商品管理:SPU添加:[GoblinStoreMgtDigitalGoodsAddParam={}]", JsonUtils.toJson(mgtDigitalGoodsAddParam));
} }
initGoodsInfoVo.setCreatedBy(currentUid); initGoodsInfoVo.setCreatedBy(currentUid);
initGoodsInfoVo.setCreatedAt(LocalDateTime.now()); initGoodsInfoVo.setCreatedAt(LocalDateTime.now());
...@@ -548,6 +548,98 @@ public class GoblinStoreMgtGoodsController { ...@@ -548,6 +548,98 @@ public class GoblinStoreMgtGoodsController {
return ResponseDto.success(initGoodsInfoVo.getSpuId()); return ResponseDto.success(initGoodsInfoVo.getSpuId());
} }
@ApiOperationSupport(order = 402)
@ApiOperation(value = "SPU添加-券类商品")
@PostMapping("coupon/add")
public ResponseDto<Object> couponAdd(@Valid @RequestBody GoblinStoreMgtGoodsCouponAddParam mgtGoodsCouponAddParam) {
String currentUid = CurrentUtil.getCurrentUid(), storeId = mgtGoodsCouponAddParam.getStoreId();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) return ResponseDto.failure(ErrorMapping.get("149002"));
if (log.isDebugEnabled()) {
log.debug("商品管理:SPU添加-券类商品:[GoblinStoreMgtGoodsCouponAddParam={}]", JsonUtils.toJson(mgtGoodsCouponAddParam));
}
if (Objects.isNull(mgtGoodsCouponAddParam.getSkuParam())) {
return ResponseDto.failure(ErrorMapping.get("149006"));
}
if (CollectionUtils.isEmpty(mgtGoodsCouponAddParam.getImageList())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品图片不能为空");
}
{// 分类、ISBN校验
String cateFid = mgtGoodsCouponAddParam.getCateFid(), cateSid = mgtGoodsCouponAddParam.getCateSid(), cateTid = mgtGoodsCouponAddParam.getCateTid();
List<GoblinSelfGoodsCategoryVo> selfGoodsCategoryVos = goblinStoreMgtExtraService.listCategoryVo();
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateFid) && r.getGrade().equals("1"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品一级分类无效");
}
if (StringUtils.isNotBlank(cateSid)) {
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateSid) && r.getGrade().equals("2"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品二级分类无效");
}
}
if (StringUtils.isNotBlank(cateTid)) {
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateTid) && r.getGrade().equals("3"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品三级分类无效");
}
}
}
if (goblinMongoUtils.countMgtGoodsInfoVo(mgtGoodsCouponAddParam.getName()) > 0) {
return ResponseDto.failure(ErrorMapping.get("149007"));
}
if (mgtGoodsCouponAddParam.getShelvesHandle().equals("3") && null == mgtGoodsCouponAddParam.getShelvesTime()) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "预约上架时间未指定");
}
GoblinGoodsInfoVo goodsInfoVo = mgtGoodsCouponAddParam.initGoodsInfoVo(currentUid, LocalDateTime.now());
ArrayList<GoblinGoodsSpecVo> goodsSpecVoList = ObjectUtil.getGoblinGoodsSpecVoArrayList();
List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList = ObjectUtil.getGoblinGoodsSkuInfoVoArrayList();
mgtGoodsCouponAddParam.initGoodsSkuInfoVo(goodsInfoVo, goodsSkuInfoVoList, goodsSpecVoList);
{// 标签处理
List<String> goodsTagIdList = mgtGoodsCouponAddParam.getTagList(),
goodsExtagIdList = mgtGoodsCouponAddParam.getExtagList(),
goodsArtagIdList = mgtGoodsCouponAddParam.getArtagList();
if (!CollectionUtils.isEmpty(goodsTagIdList)) {
List<GoblinSelfTagVo> selfGoodsTagVos = goblinRedisUtils.getSelfTagVos();
List<GoblinGoodsTagVo> goodsTagVoList = ObjectUtil.getGoblinGoodsTagVoArrayList();
for (int i = 0; i < goodsTagIdList.size(); i++)
for (GoblinSelfTagVo r : selfGoodsTagVos)
if (r.getTagId().equals(goodsTagIdList.get(i)) && r.getTagBelong().equals("0")) {
goodsTagVoList.add(GoblinGoodsTagVo.getNew().copy(r).setSort(i));
break;
}
goodsInfoVo.setTagVoList(goodsTagVoList);
}
if (!CollectionUtils.isEmpty(goodsExtagIdList)) {
List<GoblinSelfTagVo> selfExtagVos = goblinRedisUtils.getSelfExtagVos();
List<GoblinGoodsExtagVo> goodsExtagVoList = ObjectUtil.getGoblinGoodsExtagVoArrayList();
for (int i = 0; i < goodsExtagIdList.size(); i++)
for (GoblinSelfTagVo r : selfExtagVos)
if (r.getTagId().equals(goodsExtagIdList.get(i)) && r.getTagBelong().equals("1") && !r.getTagType().equals("5")) {
goodsExtagVoList.add(GoblinGoodsExtagVo.getNew().copy(r).setSort(i));
break;
}
goodsInfoVo.setExtagVoList(goodsExtagVoList);
}
if (!CollectionUtils.isEmpty(goodsArtagIdList)) {
List<GoblinSelfTagVo> selfExtagVos = goblinRedisUtils.getSelfExtagVos();
List<GoblinGoodsExtagVo> goodsArtagVoList = ObjectUtil.getGoblinGoodsExtagVoArrayList();
for (int i = 0; i < goodsArtagIdList.size(); i++)
for (GoblinSelfTagVo r : selfExtagVos)
if (r.getTagId().equals(goodsArtagIdList.get(i)) && r.getTagBelong().equals("1")) {
goodsArtagVoList.add(GoblinGoodsExtagVo.getNew().copy(r).setSort(i));
break;
}
goodsInfoVo.setArtagVoList(goodsArtagVoList);
}
}
// 服务保障处理
List<String> ssidList = mgtGoodsCouponAddParam.getSsidList();
if (!CollectionUtils.isEmpty(ssidList)) {
goodsInfoVo.setServiceSupportVoList(goblinMongoUtils.getServiceSupportVos(ssidList));
}
goblinstoreMgtGoodsService.goodsAdd(goodsInfoVo, goodsSkuInfoVoList);
return ResponseDto.success(goodsInfoVo.getSpuId());
}
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ApiOperation(value = "SPU详情") @ApiOperation(value = "SPU详情")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -584,8 +676,8 @@ public class GoblinStoreMgtGoodsController { ...@@ -584,8 +676,8 @@ public class GoblinStoreMgtGoodsController {
|| !mgtGoodsInfoVo.getDelFlg().equals("0")) { || !mgtGoodsInfoVo.getDelFlg().equals("0")) {
return ResponseDto.failure(ErrorMapping.get("149010")); return ResponseDto.failure(ErrorMapping.get("149010"));
} }
if (mgtGoodsInfoVo.getSpuType() == 1) { if (mgtGoodsInfoVo.getSpuType() != 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品为数字藏品"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非常规商品");
} }
if (!mgtGoodsInfoVo.getName().equals(mgtGoodsAddParam.getName()) if (!mgtGoodsInfoVo.getName().equals(mgtGoodsAddParam.getName())
// && null != goblinMongoUtils.getMgtGoodsInfoVo(storeId, mgtGoodsAddParam.getName())) { // && null != goblinMongoUtils.getMgtGoodsInfoVo(storeId, mgtGoodsAddParam.getName())) {
...@@ -656,7 +748,7 @@ public class GoblinStoreMgtGoodsController { ...@@ -656,7 +748,7 @@ public class GoblinStoreMgtGoodsController {
} }
@ApiOperationSupport(order = 601) @ApiOperationSupport(order = 601)
@ApiOperation(value = "SPU编辑-数字藏品", notes = "只修改商品信息,不包含价格库存相关信息") @ApiOperation(value = "商品编辑:SPU编辑-数字藏品", notes = "只修改商品信息,不包含价格库存相关信息")
@PutMapping("digital/edit_spu") @PutMapping("digital/edit_spu")
public ResponseDto<Object> digitalEditSpu(@Valid @RequestBody GoblinStoreMgtDigitalGoodsAddParam mgtDigitalGoodsEditParam) { public ResponseDto<Object> digitalEditSpu(@Valid @RequestBody GoblinStoreMgtDigitalGoodsAddParam mgtDigitalGoodsEditParam) {
String currentUid = CurrentUtil.getCurrentUid(), storeId = mgtDigitalGoodsEditParam.getStoreId(); String currentUid = CurrentUtil.getCurrentUid(), storeId = mgtDigitalGoodsEditParam.getStoreId();
...@@ -696,13 +788,73 @@ public class GoblinStoreMgtGoodsController { ...@@ -696,13 +788,73 @@ public class GoblinStoreMgtGoodsController {
} }
} }
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:SPU编辑:[GoblinStoreMgtGoodsAddParam={}]", JsonUtils.toJson(mgtDigitalGoodsEditParam)); log.debug("商品管理:商品编辑:SPU编辑:[GoblinStoreMgtDigitalGoodsAddParam={}]", JsonUtils.toJson(mgtDigitalGoodsEditParam));
} }
boolean resultFlg = goblinstoreMgtGoodsService.digitalGoodsEditSpu(currentUid, mgtDigitalGoodsEditParam, mgtGoodsInfoVo); boolean resultFlg = goblinstoreMgtGoodsService.digitalGoodsEditSpu(currentUid, mgtDigitalGoodsEditParam, mgtGoodsInfoVo);
return resultFlg ? ResponseDto.success() : ResponseDto.failure(); return resultFlg ? ResponseDto.success() : ResponseDto.failure();
} }
@ApiOperationSupport(order = 602)
@ApiOperation(value = "商品编辑:SPU编辑-券类商品", notes = "只修改商品信息,不包含价格库存相关信息")
@PutMapping("coupon/edit_spu")
public ResponseDto<Object> couponEditSpu(@Valid @RequestBody GoblinStoreMgtGoodsCouponAddParam mgtGoodsEditParam) {
String currentUid = CurrentUtil.getCurrentUid(), storeId = mgtGoodsEditParam.getStoreId();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) return ResponseDto.failure(ErrorMapping.get("149002"));
GoblinGoodsInfoVo mgtGoodsInfoVo;
if (StringUtils.isBlank(mgtGoodsEditParam.getSpuId())
|| null == (mgtGoodsInfoVo = goblinRedisUtils.getGoodsInfoVo(mgtGoodsEditParam.getSpuId()))
|| !mgtGoodsInfoVo.getStoreId().equals(storeId)
|| !mgtGoodsInfoVo.getDelFlg().equals("0")) {
return ResponseDto.failure(ErrorMapping.get("149010"));
}
if (mgtGoodsInfoVo.getSpuType() != 2) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非券类商品");
}
if (!mgtGoodsInfoVo.getName().equals(mgtGoodsEditParam.getName())
&& goblinMongoUtils.countMgtGoodsInfoVo(mgtGoodsEditParam.getName()) > 0) {
return ResponseDto.failure(ErrorMapping.get("149007"));
}
if (!mgtGoodsEditParam.getShelvesHandle().equals(mgtGoodsInfoVo.getShelvesHandle())
&& mgtGoodsInfoVo.getShelvesStatus().equals("3")) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "上架处理方式只限商品未上架时变更");
}
List<String> skuIdList = mgtGoodsInfoVo.getSkuIdList();
List<GoblinGoodsSkuInfoVo> goodsSkuInfoVos = CollectionUtils.isEmpty(skuIdList) ? null : goblinMongoUtils.getGoodsSkuInfoVos(skuIdList);
boolean hasSkuFlg = !CollectionUtils.isEmpty(goodsSkuInfoVos);
{// 分类、ISBN校验
String cateFid = mgtGoodsEditParam.getCateFid(), cateSid = mgtGoodsEditParam.getCateSid(), cateTid = mgtGoodsEditParam.getCateTid();
List<GoblinSelfGoodsCategoryVo> selfGoodsCategoryVos = goblinStoreMgtExtraService.listCategoryVo();
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateFid) && r.getGrade().equals("1"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品一级分类无效");
}
if (StringUtils.isNotBlank(cateSid)) {
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateSid) && r.getGrade().equals("2"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品二级分类无效");
}
}
if (StringUtils.isNotBlank(cateTid)) {
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateTid) && r.getGrade().equals("3"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品三级分类无效");
}
}
}
if (StringUtils.isNotEmpty(mgtGoodsInfoVo.getSpuErpCode()) && StringUtils.isBlank(mgtGoodsEditParam.getSpuErpCode())) {
if (hasSkuFlg && goodsSkuInfoVos.stream().anyMatch(r -> r.getErpHosting() == 1)) {// 存在SKU启用ERP托管,不可修改`spu_erp_code`
mgtGoodsEditParam.setSpuErpCode(mgtGoodsInfoVo.getSpuErpCode());
} else {
mgtGoodsEditParam.setSpuErpCode(mgtGoodsEditParam.getSpuErpCode());
}
}
if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:SPU编辑:[GoblinStoreMgtGoodsCouponAddParam={}]", JsonUtils.toJson(mgtGoodsEditParam));
}
boolean resultFlg = goblinstoreMgtGoodsService.couponGoodsEditSpu(currentUid, mgtGoodsEditParam, mgtGoodsInfoVo);
return resultFlg ? ResponseDto.success() : ResponseDto.failure();
}
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@ApiOperation(value = "商品编辑:SKU编辑", notes = "只修改单品信息,不包含商品信息") @ApiOperation(value = "商品编辑:SKU编辑", notes = "只修改单品信息,不包含商品信息")
@PostMapping("edit_sku") @PostMapping("edit_sku")
...@@ -723,8 +875,8 @@ public class GoblinStoreMgtGoodsController { ...@@ -723,8 +875,8 @@ public class GoblinStoreMgtGoodsController {
if (null == goodsInfoVo || !goodsInfoVo.getDelFlg().equals("0")) { if (null == goodsInfoVo || !goodsInfoVo.getDelFlg().equals("0")) {
return ResponseDto.failure(ErrorMapping.get("149010")); return ResponseDto.failure(ErrorMapping.get("149010"));
} }
if (goodsInfoVo.getSpuType() == 1) { if (goodsInfoVo.getSpuType() != 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品为数字藏品"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非常规商品");
} }
{// 分类、ISBN校验 {// 分类、ISBN校验
String cateFid = goodsInfoVo.getCateFid(), cateSid = goodsInfoVo.getCateSid(), cateTid = goodsInfoVo.getCateTid(); String cateFid = goodsInfoVo.getCateFid(), cateSid = goodsInfoVo.getCateSid(), cateTid = goodsInfoVo.getCateTid();
...@@ -895,11 +1047,10 @@ public class GoblinStoreMgtGoodsController { ...@@ -895,11 +1047,10 @@ public class GoblinStoreMgtGoodsController {
return ResponseDto.success(mgtGoodsSkuInfoVo); return ResponseDto.success(mgtGoodsSkuInfoVo);
} else { } else {
if (null != operStock && operStock != 0) {// 处理库存:回滚 if (null != operStock && operStock != 0) {// 处理库存:回滚
int operStockVal = Math.abs(operStock);
if (operStock > 0) {// 增加的减回去 if (operStock > 0) {// 增加的减回去
goblinRedisUtils.decrSkuStock(null, paramSkuId, operStockVal); goblinRedisUtils.decrSkuStock(null, paramSkuId, Math.abs(operStock));
} else {// 扣减的加回去 } else {// 扣减的加回去
goblinRedisUtils.incrSkuStock(null, paramSkuId, operStockVal); goblinRedisUtils.incrSkuStock(null, paramSkuId, Math.abs(operStock));
} }
} }
return ResponseDto.failure(ErrorMapping.get("149013")); return ResponseDto.failure(ErrorMapping.get("149013"));
...@@ -990,6 +1141,73 @@ public class GoblinStoreMgtGoodsController { ...@@ -990,6 +1141,73 @@ public class GoblinStoreMgtGoodsController {
return ResponseDto.failure(ErrorMapping.get("149013")); return ResponseDto.failure(ErrorMapping.get("149013"));
} }
@ApiOperationSupport(order = 7)
@ApiOperation(value = "商品编辑:SKU编辑-券类商品", notes = "只修改单品信息,不包含商品信息")
@PostMapping("coupon/edit_sku")
public ResponseDto<Object> couponEditSku(@Valid @RequestBody GoblinStoreMgtGoodsCouponEditSkuParam mgtGoodsEditSkuParam) {
String currentUid = CurrentUtil.getCurrentUid(), storeId = mgtGoodsEditSkuParam.getStoreId();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
String paramSkuId = mgtGoodsEditSkuParam.getSkuId();
GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo;
if (StringUtils.isBlank(paramSkuId)
|| null == (mgtGoodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(paramSkuId))
|| !mgtGoodsSkuInfoVo.getStoreId().equals(storeId)
|| !mgtGoodsSkuInfoVo.getDelFlg().equals("0")) {
return ResponseDto.failure(ErrorMapping.get("149011"));
}
if (mgtGoodsSkuInfoVo.getSkuType() != 2) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非券类商品");
}
if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:SKU编辑:[GoblinStoreMgtGoodsEditSkuParam={}]", JsonUtils.toJson(mgtGoodsEditSkuParam));
}
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(mgtGoodsSkuInfoVo.getSpuId());
mgtGoodsEditSkuParam.setStock(mgtGoodsSkuInfoVo.getStock());
mgtGoodsEditSkuParam.setSkuStock(mgtGoodsSkuInfoVo.getSkuStock());
// mgtGoodsEditSkuParam.setWarningStock(mgtGoodsSkuInfoVo.getWarningStock());
Integer operStock = mgtGoodsEditSkuParam.getOperStock();
if (null != operStock && operStock != 0) {// 处理库存
int operStockVal = Math.abs(operStock);
Integer stock = mgtGoodsSkuInfoVo.getStock();// 总库存
Integer skuStock = mgtGoodsSkuInfoVo.getSkuStock();// SKU总库存
int surplusStock = goblinRedisUtils.getSkuStock(null, paramSkuId);// 当前剩余库存
if (operStock < 0 && surplusStock > 0 && surplusStock >= operStockVal) {// SKU实时库存充足时允许扣减
if (goblinRedisUtils.decrSkuStock(null, paramSkuId, operStockVal) < 0) {// 过程中库存不足时,回滚库存,编辑无效
goblinRedisUtils.incrSkuStock(null, paramSkuId, operStockVal);
return ResponseDto.failure(ErrorMapping.get("149012"));
} else {
mgtGoodsEditSkuParam.setSkuStock(skuStock - operStockVal);
mgtGoodsEditSkuParam.setStock(stock - operStockVal);
}
} else if (operStock > 0) {// 增加
goblinRedisUtils.incrSkuStock(null, paramSkuId, operStockVal);
mgtGoodsEditSkuParam.setSkuStock(skuStock + operStockVal);
mgtGoodsEditSkuParam.setStock(stock + operStockVal);
} else {
return ResponseDto.failure(ErrorMapping.get("149012"));
}
}
if (goblinstoreMgtGoodsService.couponGoodsEditSku(currentUid, mgtGoodsEditSkuParam, goodsInfoVo)) {
mgtGoodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(paramSkuId);
mgtGoodsSkuInfoVo.setSurplusStock(goblinRedisUtils.getSkuStock(null, paramSkuId));
return ResponseDto.success(mgtGoodsSkuInfoVo);
} else {
if (null != operStock && operStock != 0) {// 处理库存:回滚
int operStockVal = Math.abs(operStock);
if (operStock > 0) {// 增加的减回去
goblinRedisUtils.decrSkuStock(null, paramSkuId, operStockVal);
} else {// 扣减的加回去
goblinRedisUtils.incrSkuStock(null, paramSkuId, operStockVal);
}
}
return ResponseDto.failure(ErrorMapping.get("149013"));
}
}
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@ApiOperation(value = "商品编辑:SKU添加") @ApiOperation(value = "商品编辑:SKU添加")
@PutMapping("edit_sku/add") @PutMapping("edit_sku/add")
...@@ -1010,8 +1228,8 @@ public class GoblinStoreMgtGoodsController { ...@@ -1010,8 +1228,8 @@ public class GoblinStoreMgtGoodsController {
|| !goodsInfoVo.getStoreId().equals(storeId)) { || !goodsInfoVo.getStoreId().equals(storeId)) {
return ResponseDto.failure(ErrorMapping.get("149010")); return ResponseDto.failure(ErrorMapping.get("149010"));
} }
if (goodsInfoVo.getSpuType() == 1) { if (goodsInfoVo.getSpuType() != 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品为数字藏品"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非常规商品");
} }
{// 分类、ISBN校验 {// 分类、ISBN校验
String cateFid = goodsInfoVo.getCateFid(), cateSid = goodsInfoVo.getCateSid(), cateTid = goodsInfoVo.getCateTid(); String cateFid = goodsInfoVo.getCateFid(), cateSid = goodsInfoVo.getCateSid(), cateTid = goodsInfoVo.getCateTid();
......
...@@ -153,6 +153,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -153,6 +153,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
} }
} }
LinkedList<Object[]> initGoodsSkuCouponObjs = CollectionUtil.linkedListObjectArr();// 券类商品信息
int skuSize = goodsSkuInfoVoList.size(); int skuSize = goodsSkuInfoVoList.size();
for (int i = 0; i < skuSize; i++) { for (int i = 0; i < skuSize; i++) {
GoblinGoodsSkuInfoVo skuInfoVo = goodsSkuInfoVoList.get(i); GoblinGoodsSkuInfoVo skuInfoVo = goodsSkuInfoVoList.get(i);
...@@ -170,6 +171,10 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -170,6 +171,10 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
skuInfoVo.getVirtualFlg(), skuInfoVo.getStatus(), skuInfoVo.getShelvesStatus(), skuInfoVo.getSkuAppear(), skuInfoVo.getShelvesAt(), skuInfoVo.getVirtualFlg(), skuInfoVo.getStatus(), skuInfoVo.getShelvesStatus(), skuInfoVo.getSkuAppear(), skuInfoVo.getShelvesAt(),
createdBy, createdAt, skuInfoVo.getLogisticsTemplate() createdBy, createdAt, skuInfoVo.getLogisticsTemplate()
}); });
if (2 == goodsInfoVo.getSpuType()) {// 券类商品为一个SPU对应一个SKU
initGoodsSkuCouponObjs.add(new Object[]{skuId, skuInfoVo.getBusiType(), skuInfoVo.getCouType(), skuInfoVo.getUseScope(),
skuInfoVo.getValFace(), skuInfoVo.getIsTrueName(), skuInfoVo.getValidity(), skuInfoVo.getEffectAt(), skuInfoVo.getExpireAt()});
}
skuInfoVo.getSkuSpecList().forEach(skuSpecDto -> initGoodsSkuSpecValueObjs.add(new Object[]{ skuInfoVo.getSkuSpecList().forEach(skuSpecDto -> initGoodsSkuSpecValueObjs.add(new Object[]{
spuId, skuId, skuSpecDto.getSpecName(), skuSpecDto.getSpecVname() spuId, skuId, skuSpecDto.getSpecName(), skuSpecDto.getSpecVname()
...@@ -192,6 +197,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -192,6 +197,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goodsInfoVo.getShelvesAt(), createdBy, createdAt, goodsInfoVo.getLogisticsTemplate() goodsInfoVo.getShelvesAt(), createdBy, createdAt, goodsInfoVo.getLogisticsTemplate()
}); });
toMqSqls.add(SqlMapping.get("goblin_goods_sku.insert")); toMqSqls.add(SqlMapping.get("goblin_goods_sku.insert"));
toMqSqls.add(SqlMapping.get("goblin_goods_sku_coupon.insert"));
toMqSqls.add(SqlMapping.get("goblin_goods_image.insert_byreplace")); toMqSqls.add(SqlMapping.get("goblin_goods_image.insert_byreplace"));
LinkedList<Object[]> initGoodsImageObjs = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> initGoodsImageObjs = CollectionUtil.linkedListObjectArr();
if (CollectionUtils.isEmpty(goodsInfoVo.getImageList())) { if (CollectionUtils.isEmpty(goodsInfoVo.getImageList())) {
...@@ -235,7 +241,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -235,7 +241,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
toMqSqls.add(SqlMapping.get("goblin_goods_category_spec.insert_byreplace"));// 分类关联规格信息 toMqSqls.add(SqlMapping.get("goblin_goods_category_spec.insert_byreplace"));// 分类关联规格信息
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, initGoodsObjs, initGoodsSkuObjs, initGoodsImageObjs, SqlMapping.gets(toMqSqls, initGoodsObjs, initGoodsSkuObjs, initGoodsSkuCouponObjs, initGoodsImageObjs,
initGoodsTagObjs, initGoodsArTagObjs, initGoodsServiceSupportObjs, initGoodsSpecObjs, initGoodsSpecValueObjs, initGoodsTagObjs, initGoodsArTagObjs, initGoodsServiceSupportObjs, initGoodsSpecObjs, initGoodsSpecValueObjs,
initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs, initGoodsCategorySpecObjs) initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs, initGoodsCategorySpecObjs)
); );
...@@ -648,6 +654,290 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -648,6 +654,290 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
return false; return false;
} }
@Override
public boolean couponGoodsEditSpu(String uid, GoblinStoreMgtGoodsCouponAddParam mgtGoodsAddParam, GoblinGoodsInfoVo mgtGoodsInfoVo) {
String spuId = mgtGoodsAddParam.getSpuId();
GoblinGoodsInfoVo updateSpuInfoVo = mgtGoodsAddParam.initEditGoodsInfoVo();
boolean updateTagFlg = false, updateExtagFlg = false, updateArtagFlg = false;
List<GoblinGoodsTagVo> befTagVoList = mgtGoodsInfoVo.getTagVoList();
boolean befTagIsEmptyFlg = CollectionUtils.isEmpty(befTagVoList);
List<GoblinGoodsExtagVo> befExtagVoList = mgtGoodsInfoVo.getExtagVoList();
boolean befExtagIsEmptyFlg = CollectionUtils.isEmpty(befExtagVoList);
List<GoblinGoodsExtagVo> befArtagVoList = mgtGoodsInfoVo.getArtagVoList();
boolean befArtagIsEmptyFlg = CollectionUtils.isEmpty(befArtagVoList);
boolean paramTagIsEmptyFlg, paramExtagIsEmptyFlg, paramArtagIsEmptyFlg;
List<GoblinGoodsTagVo> paramTagVoList = ObjectUtil.getGoblinGoodsTagVoArrayList();
List<GoblinGoodsExtagVo> paramExtagVoList = ObjectUtil.getGoblinGoodsExtagVoArrayList();
List<GoblinGoodsExtagVo> paramArtagVoList = ObjectUtil.getGoblinGoodsExtagVoArrayList();
{// 标签处理
List<String> goodsTagIdList = mgtGoodsAddParam.getTagList(),
goodsExtagIdList = mgtGoodsAddParam.getExtagList(),
goodsArtagIdList = mgtGoodsAddParam.getArtagList();
if (!CollectionUtils.isEmpty(goodsTagIdList)) {
List<GoblinSelfTagVo> selfGoodsTagVos = goblinRedisUtils.getSelfTagVos();
for (int i = 0; i < goodsTagIdList.size(); i++)
for (GoblinSelfTagVo r : selfGoodsTagVos)
if (r.getTagId().equals(goodsTagIdList.get(i)) && r.getTagBelong().equals("0")) {
paramTagVoList.add(GoblinGoodsTagVo.getNew().copy(r).setSort(i));
break;
}
}
List<GoblinSelfTagVo> selfExtagVos = null;
if (!CollectionUtils.isEmpty(goodsExtagIdList)) {
selfExtagVos = goblinRedisUtils.getSelfExtagVos();
for (int i = 0; i < goodsExtagIdList.size(); i++)
for (GoblinSelfTagVo r : selfExtagVos)
if (r.getTagId().equals(goodsExtagIdList.get(i)) && r.getTagBelong().equals("1") && !r.getTagType().equals("5")) {
paramExtagVoList.add(GoblinGoodsExtagVo.getNew().copy(r).setSort(i));
break;
}
}
if (!CollectionUtils.isEmpty(goodsArtagIdList)) {
selfExtagVos = CollectionUtils.isEmpty(selfExtagVos) ? goblinRedisUtils.getSelfExtagVos() : selfExtagVos;
for (int i = 0; i < goodsArtagIdList.size(); i++)
for (GoblinSelfTagVo r : selfExtagVos)
if (r.getTagId().equals(goodsArtagIdList.get(i)) && r.getTagBelong().equals("1")) {
paramArtagVoList.add(GoblinGoodsExtagVo.getNew().copy(r).setSort(i));
break;
}
}
paramTagIsEmptyFlg = CollectionUtils.isEmpty(paramTagVoList);
paramExtagIsEmptyFlg = CollectionUtils.isEmpty(paramExtagVoList);
paramArtagIsEmptyFlg = CollectionUtils.isEmpty(paramArtagVoList);
if (!befTagIsEmptyFlg || !paramTagIsEmptyFlg) {
if (!befTagIsEmptyFlg && !paramTagIsEmptyFlg) {
if (paramTagVoList.size() != befTagVoList.size()) {
updateTagFlg = true;
} else {
List<String> befTagIdList = befTagVoList.stream().map(GoblinGoodsTagVo::getTagId).collect(Collectors.toList());
for (GoblinGoodsTagVo vo : paramTagVoList) {
if (!befTagIdList.contains(vo.getTagId())) {
updateTagFlg = true;
break;
}
}
}
} else {
updateTagFlg = true;
}
}
if (updateTagFlg) {
updateSpuInfoVo.setTagVoList(paramTagIsEmptyFlg ? ObjectUtil.getGoblinGoodsTagVoArrayList() : paramTagVoList);
}
if (!befExtagIsEmptyFlg || !paramExtagIsEmptyFlg) {
if (!befExtagIsEmptyFlg && !paramExtagIsEmptyFlg) {
if (paramExtagVoList.size() != befExtagVoList.size()) {
updateExtagFlg = true;
} else {
List<String> befExtagIdList = befExtagVoList.stream().map(GoblinGoodsExtagVo::getTagId).collect(Collectors.toList());
for (GoblinGoodsExtagVo vo : paramExtagVoList) {
if (!befExtagIdList.contains(vo.getTagId())) {
updateExtagFlg = true;
break;
}
}
}
} else {
updateExtagFlg = true;
}
}
if (updateExtagFlg) {
updateSpuInfoVo.setExtagVoList(paramExtagIsEmptyFlg ? ObjectUtil.getGoblinGoodsExtagVoArrayList() : paramExtagVoList);
}
if (!befArtagIsEmptyFlg || !paramArtagIsEmptyFlg) {
if (!befArtagIsEmptyFlg && !paramArtagIsEmptyFlg) {
if (paramArtagVoList.size() != befArtagVoList.size()) {
updateArtagFlg = true;
} else {
List<String> befArtagIdList = befArtagVoList.stream().map(GoblinGoodsExtagVo::getTagId).collect(Collectors.toList());
for (GoblinGoodsExtagVo vo : paramArtagVoList) {
if (!befArtagIdList.contains(vo.getTagId())) {
updateArtagFlg = true;
break;
}
}
}
} else {
updateArtagFlg = true;
}
}
if (updateArtagFlg) {
updateSpuInfoVo.setArtagVoList(paramArtagIsEmptyFlg ? ObjectUtil.getGoblinGoodsExtagVoArrayList() : paramArtagVoList);
}
}
boolean updateSsidFlg = false;
List<String> ssidList = mgtGoodsAddParam.getSsidList();
boolean paramSsidListIsEmptyFlg = CollectionUtils.isEmpty(ssidList);
List<GoblinServiceSupportVo> serviceSupportVoList = mgtGoodsInfoVo.getServiceSupportVoList();
boolean befServiceSupportVoListIsEmptyFlg = CollectionUtils.isEmpty(serviceSupportVoList);
{// 服务支持处理
if (!befServiceSupportVoListIsEmptyFlg || !paramSsidListIsEmptyFlg) {
if (!befServiceSupportVoListIsEmptyFlg && !paramSsidListIsEmptyFlg) {
if (serviceSupportVoList.size() != ssidList.size()) {
updateSsidFlg = true;
} else {
List<String> befSsidList = serviceSupportVoList.stream().map(GoblinServiceSupportVo::getSsid).collect(Collectors.toList());
for (String ssid : ssidList) {
if (!befSsidList.contains(ssid)) {
updateSsidFlg = true;
break;
}
}
}
} else {
updateSsidFlg = true;
}
}
if (updateSsidFlg) {
updateSpuInfoVo.setServiceSupportVoList(paramSsidListIsEmptyFlg ? ObjectUtil.getGoblinServiceSupportVoArrayList() : goblinMongoUtils.getServiceSupportVos(ssidList));
}
}
boolean updateImageFlg = false;
List<String> paramImageList = mgtGoodsAddParam.getImageList();
List<String> befImageList = mgtGoodsInfoVo.getImageList();
{// 图片处理
if (befImageList.size() != paramImageList.size()) {
updateImageFlg = true;
} else {
for (String imageUrl : paramImageList) {
if (!befImageList.contains(imageUrl)) {
updateImageFlg = true;
break;
}
}
}
if (updateImageFlg) {
updateSpuInfoVo.setImageList(paramImageList);
}
}
updateSpuInfoVo.setUpdatedBy(uid);
updateSpuInfoVo.setUpdatedAt(LocalDateTime.now());
if (goblinMongoUtils.updateGoodsInfoVo(updateSpuInfoVo)) {
goblinRedisUtils.delGoodsInfoVo(updateSpuInfoVo.getSpuId());
log.info("商品管理:SPU编辑[UID={},PARAMS={}]", uid, JsonUtils.toJson(mgtGoodsAddParam));
GoblinGoodsSkuInfoVo updateSkuInfoVo = GoblinGoodsSkuInfoVo.getNew();
updateSkuInfoVo.setSpuId(updateSpuInfoVo.getSpuId());
updateSkuInfoVo.setSkuNo(updateSpuInfoVo.getSpuNo());
// updateSkuInfoVo.setName(updateSpuInfoVo.getName());
// updateSkuInfoVo.setSubtitle(updateSpuInfoVo.getSubtitle());
updateSkuInfoVo.setVirtualFlg(updateSpuInfoVo.getVirtualFlg());
updateSkuInfoVo.setLogisticsTemplate(updateSpuInfoVo.getLogisticsTemplate());
updateSkuInfoVo.setUpdatedBy(updateSpuInfoVo.getUpdatedBy());
updateSkuInfoVo.setUpdatedAt(updateSpuInfoVo.getUpdatedAt());
LinkedList<Object[]> updateGoodsInfoObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> updateGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
// 参与活动的同一商品更新处理
List<String> marketSpuIdList = goblinMongoUtils.updateGoodsInfoVoForMarket(spuId, mgtGoodsInfoVo.getSpuNo(), updateSpuInfoVo);
if (!CollectionUtils.isEmpty(marketSpuIdList)) {
marketSpuIdList.forEach(marketSpuId -> {
goblinRedisUtils.delGoodsInfoVo(marketSpuId);
updateGoodsInfoObjs.add(new Object[]{
updateSpuInfoVo.getSpuNo(), updateSpuInfoVo.getName(), updateSpuInfoVo.getSubtitle(), updateSpuInfoVo.getSellPrice(),
updateSpuInfoVo.getIntro(), updateSpuInfoVo.getDetails(), updateSpuInfoVo.getCoverPic(), updateSpuInfoVo.getVideo(),
"2", updateSpuInfoVo.getCateFid(), updateSpuInfoVo.getCateSid(), updateSpuInfoVo.getCateTid(),
updateSpuInfoVo.getShelvesHandle(), updateSpuInfoVo.getShelvesTime(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
marketSpuId
});
updateGoodsSkuObjs.add(new Object[]{
updateSkuInfoVo.getSkuNo(), updateSkuInfoVo.getVirtualFlg(), updateSkuInfoVo.getLogisticsTemplate(),
updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), marketSpuId
});
});
}
// goblinMongoUtils.updateGoodsSkuInfoVoBySpuId(updateSkuInfoVo);
goblinMongoUtils.updateGoodsSkuInfoVoPropBySpuId(updateSkuInfoVo);
goblinRedisUtils.delGoodsSkuInfoVo(mgtGoodsInfoVo.getSkuIdList().get(0));
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_edit"));
updateGoodsInfoObjs.add(new Object[]{
updateSpuInfoVo.getSpuNo(), updateSpuInfoVo.getName(), updateSpuInfoVo.getSubtitle(), updateSpuInfoVo.getSellPrice(),
updateSpuInfoVo.getIntro(), updateSpuInfoVo.getDetails(), updateSpuInfoVo.getCoverPic(), updateSpuInfoVo.getVideo(),
updateSpuInfoVo.getSpecMode(), updateSpuInfoVo.getCateFid(), updateSpuInfoVo.getCateSid(), updateSpuInfoVo.getCateTid(),
updateSpuInfoVo.getShelvesHandle(), updateSpuInfoVo.getShelvesTime(), updateSpuInfoVo.getSpuValidity(), updateSpuInfoVo.getVirtualFlg(),
updateSpuInfoVo.getLogisticsTemplate(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getUpdatedAt(), updateSpuInfoVo.getSpuErpCode(),
updateSpuInfoVo.getSpuId()
});
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_spu"));
updateGoodsSkuObjs.add(new Object[]{
updateSkuInfoVo.getSkuNo(), updateSkuInfoVo.getVirtualFlg(), updateSkuInfoVo.getLogisticsTemplate(),
updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), updateSkuInfoVo.getSpuId()
});
toMqSqls.add(SqlMapping.get("goblin_goods_tag.delete"));
LinkedList<Object[]> deleteGoodsTagObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_tag.insert_byreplace"));
LinkedList<Object[]> initGoodsTagObjs = CollectionUtil.linkedListObjectArr();
if (updateTagFlg) {
if (!befTagIsEmptyFlg) {
deleteGoodsTagObjs.add(new Object[]{spuId, '0'});
}
if (!paramTagIsEmptyFlg) {
updateSpuInfoVo.getTagVoList().forEach(vo -> initGoodsTagObjs.add(new Object[]{spuId, vo.getTagId(), vo.getSort(), "0"}));
}
}
if (updateExtagFlg) {
if (!befExtagIsEmptyFlg) {
deleteGoodsTagObjs.add(new Object[]{spuId, '1'});
}
if (!paramExtagIsEmptyFlg) {
updateSpuInfoVo.getExtagVoList().forEach(vo -> initGoodsTagObjs.add(new Object[]{spuId, vo.getTagId(), vo.getSort(), "1"}));
}
}
toMqSqls.add(SqlMapping.get("goblin_goods_artag.delete"));
LinkedList<Object[]> deleteGoodsArTagObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_artag.insert_byreplace"));
LinkedList<Object[]> initGoodsArTagObjs = CollectionUtil.linkedListObjectArr();
if (updateArtagFlg) {
if (!befArtagIsEmptyFlg) {
deleteGoodsArTagObjs.add(new Object[]{spuId, '1'});
}
if (!paramArtagIsEmptyFlg) {
updateSpuInfoVo.getArtagVoList().forEach(vo -> initGoodsArTagObjs.add(new Object[]{spuId, vo.getTagId(), vo.getSort(), "1"}));
}
}
toMqSqls.add(SqlMapping.get("goblin_goods_service_support.delete"));
LinkedList<Object[]> deleteServiceSupportObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_service_support.insert_byreplace"));
LinkedList<Object[]> initServiceSupportObjs = CollectionUtil.linkedListObjectArr();
if (updateSsidFlg) {
if (!befServiceSupportVoListIsEmptyFlg) {
deleteServiceSupportObjs.add(new Object[]{spuId});
}
if (!paramSsidListIsEmptyFlg) {
updateSpuInfoVo.getServiceSupportVoList().forEach(vo -> initServiceSupportObjs.add(new Object[]{spuId, vo.getSsid()}));
}
}
toMqSqls.add(SqlMapping.get("goblin_goods_image.delete"));
LinkedList<Object[]> deleteGoodsImageObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_image.insert_byreplace"));
LinkedList<Object[]> initGoodsImageObjs = CollectionUtil.linkedListObjectArr();
if (updateImageFlg) {
deleteGoodsImageObjs.add(new Object[]{spuId});
updateSpuInfoVo.getImageList().forEach(imageUrl -> initGoodsImageObjs.add(new Object[]{spuId, imageUrl}));
}
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsInfoObjs, updateGoodsSkuObjs,
deleteGoodsTagObjs, initGoodsTagObjs, deleteGoodsArTagObjs, initGoodsArTagObjs,
deleteServiceSupportObjs, initServiceSupportObjs, deleteGoodsImageObjs, initGoodsImageObjs));
return true;
}
return false;
}
@Override @Override
public boolean goodsEditSku(String uid, GoblinStoreMgtGoodsEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo, public boolean goodsEditSku(String uid, GoblinStoreMgtGoodsEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo,
GoblinGoodsInfoVo goodsInfoVo, Map<String, String> delSpuSpecMap, Map<String, String> addSpuSpecMap) { GoblinGoodsInfoVo goodsInfoVo, Map<String, String> delSpuSpecMap, Map<String, String> addSpuSpecMap) {
...@@ -760,14 +1050,6 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -760,14 +1050,6 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateSkuSpecValueObjs, initSpuSpecValueObjs, delSpuSpecValueObjs, updateGoodsObjs)); updateSkuSpecValueObjs, initSpuSpecValueObjs, delSpuSpecValueObjs, updateGoodsObjs));
return true; return true;
} }
Integer operStock = mgtGoodsEditSkuParam.getOperStock();
if (null != operStock && operStock != 0) {
if (operStock > 0) {
goblinRedisUtils.decrSkuStock(null, skuId, Math.abs(operStock));
} else {
goblinRedisUtils.incrSkuStock(null, skuId, Math.abs(operStock));
}
}
return false; return false;
} }
...@@ -886,6 +1168,80 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi ...@@ -886,6 +1168,80 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
return false; return false;
} }
@Override
public boolean couponGoodsEditSku(String uid, GoblinStoreMgtGoodsCouponEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo) {
LocalDateTime nowTime = LocalDateTime.now();
GoblinGoodsSkuInfoVo updateSkuInfoVo = mgtGoodsEditSkuParam.initEditGoodsSkuInfoVo();
updateSkuInfoVo.setUpdatedBy(uid);
updateSkuInfoVo.setUpdatedAt(nowTime);
String skuId = updateSkuInfoVo.getSkuId();
if (goblinMongoUtils.updateGoodsSkuInfoVo(updateSkuInfoVo)) {
goblinRedisUtils.delGoodsSkuInfoVo(skuId);
log.info("商品管理:SKU编辑[UID={},PARAMS={}]", uid, JsonUtils.toJson(mgtGoodsEditSkuParam));
LinkedList<Object[]> updateGoodsSkuForMarketObjs = CollectionUtil.linkedListObjectArr();
// 参与活动的同一商品更新处理
List<String> marketSkuIdList = goblinRedisUtils.getSkuRe(updateSkuInfoVo.getSkuId());
if (!CollectionUtils.isEmpty(marketSkuIdList)) {
goblinMongoUtils.updateGoodsSkuInfoVoForMarket(marketSkuIdList, updateSkuInfoVo);
marketSkuIdList.forEach(marketSkuId -> {
goblinRedisUtils.delGoodsSkuInfoVo(marketSkuId);
updateGoodsSkuForMarketObjs.add(new Object[]{
updateSkuInfoVo.getStock(), updateSkuInfoVo.getIsTrueName(), updateSkuInfoVo.getUseScope(),
updateSkuInfoVo.getValFace(), updateSkuInfoVo.getEffectAt(), updateSkuInfoVo.getExpireAt(),
updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), marketSkuId
});
});
}
BigDecimal priceGe = BigDecimal.ZERO, priceLe = BigDecimal.ZERO;
for (String skuIdStr : goodsInfoVo.getSkuIdList()) {
GoblinGoodsSkuInfoVo skuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuIdStr);
if (null != skuInfoVo && skuInfoVo.getDelFlg().equals("0")) {
priceGe = priceGe.compareTo(BigDecimal.ZERO) == 0 ? skuInfoVo.getPrice() : (priceGe.compareTo(skuInfoVo.getPrice()) > 0 ? skuInfoVo.getPrice() : priceGe);
priceLe = priceLe.compareTo(skuInfoVo.getPrice()) < 0 ? skuInfoVo.getPrice() : priceLe;
}
}
boolean updateGoodsInfoVoFlg = false;
LinkedList<Object[]> updateGoodsObjs = CollectionUtil.linkedListObjectArr();
if (priceGe.compareTo(goodsInfoVo.getPriceGe()) != 0 || priceLe.compareTo(goodsInfoVo.getPriceLe()) != 0) {
updateGoodsInfoVoFlg = true;
goodsInfoVo.setPriceGe(priceGe);
goodsInfoVo.setPriceLe(priceLe);
goodsInfoVo.setUpdatedBy(uid);
goodsInfoVo.setUpdatedAt(nowTime);
updateGoodsObjs.add(new Object[]{priceGe, priceLe, uid, nowTime, goodsInfoVo.getSpuId()});
}
if (updateGoodsInfoVoFlg) {
goblinMongoUtils.updateGoodsInfoVo(goodsInfoVo);
goblinRedisUtils.delGoodsInfoVo(goodsInfoVo.getSpuId());
}
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_for_market2"));
// LinkedList<Object[]> updateGoodsSkuForMarketObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_for_coupon"));
LinkedList<Object[]> updateGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
updateGoodsSkuObjs.add(new Object[]{
updateSkuInfoVo.getPrice(), updateSkuInfoVo.getPriceMember(), updateSkuInfoVo.getStock(), updateSkuInfoVo.getSkuStock(),
updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), skuId
});
toMqSqls.add(SqlMapping.get("goblin_goods_sku_coupon.update"));
LinkedList<Object[]> updateGoodsSkuCouponObjs = CollectionUtil.linkedListObjectArr();
updateGoodsSkuCouponObjs.add(new Object[]{
updateSkuInfoVo.getUseScope(), updateSkuInfoVo.getValFace(), updateSkuInfoVo.getIsTrueName(),
updateSkuInfoVo.getEffectAt(), updateSkuInfoVo.getExpireAt(), skuId});
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_edit_sku"));
// LinkedList<Object[]> updateGoodsObjs = CollectionUtil.linkedListObjectArr();
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsSkuForMarketObjs, updateGoodsSkuObjs, updateGoodsObjs));
return true;
}
return false;
}
@Override @Override
public void goodsEditSkuAdd(String uid, GoblinStoreMgtGoodsEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo) { public void goodsEditSkuAdd(String uid, GoblinStoreMgtGoodsEditSkuParam mgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
......
...@@ -57,6 +57,7 @@ goblin_goods_sku.insert=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_b ...@@ -57,6 +57,7 @@ goblin_goods_sku.insert=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_b
goblin_goods_sku.insert_for_digital=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_type,name,subtitle,sku_pic,sku_watch,watch_type,sku_watch_pic,stock,sku_stock,hit_ratio,price,price_v,product_id,price_member,intro,details,buy_factor,buy_limit,store_id,shelves_handle,shelves_time,sale_start_time,virtual_flg,status,shelves_status,sku_appear,sku_canbuy,unbox,opening_time,shelves_at,created_by,created_at,sku_erp_code,erp_type,erp_hosting,erp_warehouse_no)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin_goods_sku.insert_for_digital=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,sku_type,name,subtitle,sku_pic,sku_watch,watch_type,sku_watch_pic,stock,sku_stock,hit_ratio,price,price_v,product_id,price_member,intro,details,buy_factor,buy_limit,store_id,shelves_handle,shelves_time,sale_start_time,virtual_flg,status,shelves_status,sku_appear,sku_canbuy,unbox,opening_time,shelves_at,created_by,created_at,sku_erp_code,erp_type,erp_hosting,erp_warehouse_no)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#goblin_goods_sku.update_by_edit_for_market=UPDATE goblin_goods_sku SET sku_bar_code=?,name=?,sku_pic=?,sell_price=?,weight=?,stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,sku_validity=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' #goblin_goods_sku.update_by_edit_for_market=UPDATE goblin_goods_sku SET sku_bar_code=?,name=?,sku_pic=?,sell_price=?,weight=?,stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,sku_validity=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_for_market=UPDATE goblin_goods_sku SET sku_bar_code=?,name=?,sku_pic=?,sell_price=?,weight=?,stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,sku_validity=?,updated_by=?,updated_at=?,sku_erp_code=?,erp_hosting=?,erp_warehouse_no=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_edit_for_market=UPDATE goblin_goods_sku SET sku_bar_code=?,name=?,sku_pic=?,sell_price=?,weight=?,stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,sku_validity=?,updated_by=?,updated_at=?,sku_erp_code=?,erp_hosting=?,erp_warehouse_no=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_for_market2=UPDATE goblin_goods_sku SET stock=?,is_true_name=?,use_scope=?,val_face=?,effect_at=?,expire_at=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
#goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sell_price=?,price=?,price_member=?,weight=?,stock=?,sku_stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,buy_factor=?,buy_roster=?,buy_limit=?,sku_validity=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' #goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sell_price=?,price=?,price_member=?,weight=?,stock=?,sku_stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,buy_factor=?,buy_roster=?,buy_limit=?,sku_validity=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sell_price=?,price=?,price_member=?,weight=?,stock=?,sku_stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,buy_factor=?,buy_roster=?,buy_limit=?,sku_validity=?,updated_by=?,updated_at=?,sku_erp_code=?,erp_hosting=?,erp_warehouse_no=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sell_price=?,price=?,price_member=?,weight=?,stock=?,sku_stock=?,warning_stock=?,sku_appear=?,sku_isbn=?,buy_factor=?,buy_roster=?,buy_limit=?,sku_validity=?,updated_by=?,updated_at=?,sku_erp_code=?,erp_hosting=?,erp_warehouse_no=? WHERE sku_id=? AND del_flg='0'
#goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_ratio=?,buy_factor=?,buy_limit=?,sku_appear=?,sku_canbuy=?,shelves_handle=?,shelves_time=?,sale_start_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' #goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_ratio=?,buy_factor=?,buy_limit=?,sku_appear=?,sku_canbuy=?,shelves_handle=?,shelves_time=?,sale_start_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
...@@ -66,6 +67,7 @@ goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,s ...@@ -66,6 +67,7 @@ goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,s
goblin_goods_sku.update_by_edit_spu=UPDATE goblin_goods_sku SET sku_no=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0' goblin_goods_sku.update_by_edit_spu=UPDATE goblin_goods_sku SET sku_no=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods_sku.update_by_shelves=UPDATE goblin_goods_sku SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE sku_id=? AND store_id=? AND del_flg='0' goblin_goods_sku.update_by_shelves=UPDATE goblin_goods_sku SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE sku_id=? AND store_id=? AND del_flg='0'
goblin_goods_sku.update_by_soldout=UPDATE goblin_goods_sku SET soldout_status=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_soldout=UPDATE goblin_goods_sku SET soldout_status=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_for_coupon=UPDATE goblin_goods_sku SET price=?,price_member=?,stock=?,sku_stock=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_del_store=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=? AND del_flg='0' goblin_goods_sku.update_by_del_store=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=? AND del_flg='0'
goblin_goods_sku.update_by_del_spu=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND del_flg='0' goblin_goods_sku.update_by_del_spu=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE sku_id=? AND del_flg='0'
...@@ -75,6 +77,8 @@ goblin_goods_sku_extra.del_ar=UPDATE goblin_goods_sku_extra SET del_flg='1',upda ...@@ -75,6 +77,8 @@ goblin_goods_sku_extra.del_ar=UPDATE goblin_goods_sku_extra SET del_flg='1',upda
#goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id,route_type,material_type,material_url,upchain,display_url,nft_url,series_id,series_hash,nft_hash,declare_at,created_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?) #goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id,route_type,material_type,material_url,upchain,display_url,nft_url,series_id,series_hash,nft_hash,declare_at,created_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id,route_type,material_type,material_url,upchain,display_url,nft_url,created_at)VALUES(?,?,?,?,?,?,?,?) goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id,route_type,material_type,material_url,upchain,display_url,nft_url,created_at)VALUES(?,?,?,?,?,?,?,?)
#goblin_goods_sku_nft.update_for_digital=UPDATE goblin_goods_sku_nft SET upchain=?,series_id=?,series_hash=?,nft_hash=?,declare_at=?,updated_at=? WHERE skuId=? AND upchain=9 #goblin_goods_sku_nft.update_for_digital=UPDATE goblin_goods_sku_nft SET upchain=?,series_id=?,series_hash=?,nft_hash=?,declare_at=?,updated_at=? WHERE skuId=? AND upchain=9
goblin_goods_sku_coupon.insert=INSERT INTO goblin_goods_sku_coupon (sku_id,busi_type,cou_type,use_scope,val_face,is_true_name,validity,effect_at,expire_at)VALUES(?,?,?,?,?,?,?,?,?)
goblin_goods_sku_coupon.update=UPDATE goblin_goods_sku_coupon SET use_scope=?,val_face=?,is_true_name=?,effect_at=?,expire_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_image.insert_byreplace=REPLACE INTO goblin_goods_image (spu_id,url,del_flg)VALUES(?,?,'0') goblin_goods_image.insert_byreplace=REPLACE INTO goblin_goods_image (spu_id,url,del_flg)VALUES(?,?,'0')
goblin_goods_image.delete=UPDATE goblin_goods_image SET del_flg='1' WHERE spu_id=? AND del_flg='0' goblin_goods_image.delete=UPDATE goblin_goods_image SET del_flg='1' WHERE spu_id=? AND del_flg='0'
goblin_goods_tag.insert_byreplace=REPLACE INTO goblin_goods_tag (spu_id,tag_id,sort,tag_belong,del_flg)VALUES(?,?,?,?,'0') goblin_goods_tag.insert_byreplace=REPLACE INTO goblin_goods_tag (spu_id,tag_id,sort,tag_belong,del_flg)VALUES(?,?,?,?,'0')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment