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

Commit ea4f634a authored by zhangguobing's avatar zhangguobing

~api:券商品业务-添加/编辑券商品+创建/更新券模板;

parent f5dec7ba
......@@ -259,7 +259,7 @@ public class GoblinStoreMgtGoodsCouponAddParam implements Serializable {
skuInfoVo.setCouType(1);// 券类型暂时只支持代金券
skuInfoVo.setUseScope(addSkuParam.getUseScope());
skuInfoVo.setValFace(addSkuParam.getValFace());
skuInfoVo.setValidity(0);
skuInfoVo.setValidity(-1);
skuInfoVo.setEffectAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(addSkuParam.getEffectTime()));
skuInfoVo.setExpireAt(DateUtil.Formatter.yyyyMMddHHmmss.parse(addSkuParam.getExpireTime()));
}
......
......@@ -40,6 +40,14 @@ public interface IGoblinstoreMgtGoodsService {
*/
void digitalGoodsAdd(GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:SPU添加-券类商品
*
* @param goodsInfoVo GoblinGoodsInfoVo
* @param goodsSkuInfoVoList List<GoblinGoodsSkuInfoVo>
*/
void couponGoodsAdd(GoblinGoodsInfoVo goodsInfoVo, List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList);
/**
* 商品管理:SPU详情
*
......
......@@ -109,21 +109,6 @@ public class CandyCoupon implements Serializable {
*/
private Integer isTrueName;
/**
* 关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证
*/
private Integer idType;
/**
* 关联人姓名
*/
private String idName;
/**
* 关联人证件号码
*/
private String idNo;
/**
* 兑换有效期(单位天)
*/
......
......@@ -183,12 +183,24 @@ create table candy_coupon_relate
create index idx_ccr_coupon_id on candy_coupon_relate (coupon_id);
# -- >>------------------------------------------------------------------------------------ |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-款式]';
drop table if exists candy_user_coupon_assoc;
create table candy_user_coupon_assoc
(
mid bigint unsigned auto_increment primary key,
ucoupon_id varchar(64) not null comment '~candy_user_coupon.ucoupon_id',
id_type tinyint not null comment '关联人证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证',
id_name varchar(30) not null comment '关联人姓名',
id_no varchar(30) not null comment '关联人证件号码',
comment text
) engine InnoDB comment '券关联适用人信息';
create index idx_cuca_ucoupon_id on candy_user_coupon_assoc (ucoupon_id);
drop table if exists candy_mgt_coupon_snapshot;
create table candy_mgt_coupon_snapshot
(
......
......@@ -635,7 +635,7 @@ public class GoblinStoreMgtGoodsController {
if (!CollectionUtils.isEmpty(ssidList)) {
goodsInfoVo.setServiceSupportVoList(goblinMongoUtils.getServiceSupportVos(ssidList));
}
goblinstoreMgtGoodsService.goodsAdd(goodsInfoVo, goodsSkuInfoVoList);
goblinstoreMgtGoodsService.couponGoodsAdd(goodsInfoVo, goodsSkuInfoVoList);
return ResponseDto.success(goodsInfoVo.getSpuId());
}
......@@ -1447,8 +1447,8 @@ public class GoblinStoreMgtGoodsController {
if (null == mgtGoodsSkuInfoVo || !mgtGoodsSkuInfoVo.getDelFlg().equals("0") || !mgtGoodsSkuInfoVo.getStoreId().equals(storeId)) {
return ResponseDto.failure(ErrorMapping.get("149011"));
}
if (mgtGoodsSkuInfoVo.getSkuType() == 1) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品为数字藏品");
if (mgtGoodsSkuInfoVo.getSkuType() != 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非常规商品");
}
if (mgtGoodsSkuInfoVo.getShelvesStatus().equals("3")) {
return ResponseDto.failure(ErrorMapping.get("149016"));
......
......@@ -3,6 +3,7 @@ package com.liquidnet.service.goblin.service.impl.manage;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.SqlMapping;
......@@ -153,7 +154,6 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
}
LinkedList<Object[]> initGoodsSkuCouponObjs = CollectionUtil.linkedListObjectArr();// 券类商品信息
int skuSize = goodsSkuInfoVoList.size();
for (int i = 0; i < skuSize; i++) {
GoblinGoodsSkuInfoVo skuInfoVo = goodsSkuInfoVoList.get(i);
......@@ -171,10 +171,6 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
skuInfoVo.getVirtualFlg(), skuInfoVo.getStatus(), skuInfoVo.getShelvesStatus(), skuInfoVo.getSkuAppear(), skuInfoVo.getShelvesAt(),
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[]{
spuId, skuId, skuSpecDto.getSpecName(), skuSpecDto.getSpecVname()
......@@ -197,7 +193,6 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goodsInfoVo.getShelvesAt(), createdBy, createdAt, goodsInfoVo.getLogisticsTemplate()
});
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"));
LinkedList<Object[]> initGoodsImageObjs = CollectionUtil.linkedListObjectArr();
if (CollectionUtils.isEmpty(goodsInfoVo.getImageList())) {
......@@ -241,7 +236,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
toMqSqls.add(SqlMapping.get("goblin_goods_category_spec.insert_byreplace"));// 分类关联规格信息
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, initGoodsObjs, initGoodsSkuObjs, initGoodsSkuCouponObjs, initGoodsImageObjs,
SqlMapping.gets(toMqSqls, initGoodsObjs, initGoodsSkuObjs, initGoodsImageObjs,
initGoodsTagObjs, initGoodsArTagObjs, initGoodsServiceSupportObjs, initGoodsSpecObjs, initGoodsSpecValueObjs,
initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs, initGoodsCategorySpecObjs)
);
......@@ -270,6 +265,158 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(), SqlMapping.gets(toMqSqls, initGoodsObjs));
}
@Override
public void couponGoodsAdd(GoblinGoodsInfoVo goodsInfoVo, List<GoblinGoodsSkuInfoVo> goodsSkuInfoVoList) {
goblinMongoUtils.setGoodsInfoVo(goodsInfoVo);
goblinMongoUtils.setGoodsSkuInfoVos(goodsSkuInfoVoList);
if (goodsInfoVo.getShelvesHandle().equals("2")) {
goblinRedisUtils.deleteKeyForSelectGoods();// 精选商品:商品上架、下架、删除 调用的方法
}
String createdBy = goodsInfoVo.getCreatedBy();
LocalDateTime createdAt = goodsInfoVo.getCreatedAt();
String spuId = goodsInfoVo.getSpuId();
LinkedList<Object[]> initGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> initGoodsSkuSpecValueObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> initGoodsCategorySpecObjs = CollectionUtil.linkedListObjectArr();
{// 分类规格记录
String cateFid = goodsInfoVo.getCateFid(), cateSid = goodsInfoVo.getCateSid(), cateTid = goodsInfoVo.getCateTid();
String filterCateId = StringUtils.isBlank(cateTid) ? (StringUtils.isBlank(cateSid) ? cateFid : cateSid) : cateTid;
GoblinMgtCategorySpecVo mgtCategorySpecVoCache = goblinRedisUtils.getCategorySpec(filterCateId);// 分类绑定的规格信息
List<String> addSpecNameList = goodsSkuInfoVoList.get(0).getSkuSpecList().stream().map(GoblinGoodsSpecDto::getSpecName).collect(Collectors.toList());
if (null == mgtCategorySpecVoCache) {// 根据分类ID未查取到规格信息,则Cache、数据库新增
GoblinMgtCategorySpecVo initMgtCategorySpecVo = GoblinMgtCategorySpecVo.getNew().setCateId(filterCateId).setSpecNameList(addSpecNameList);
goblinMongoUtils.setCategorySpecVo(initMgtCategorySpecVo);
goblinRedisUtils.setCategorySpec(filterCateId, initMgtCategorySpecVo);
addSpecNameList.forEach(r -> initGoodsCategorySpecObjs.add(new Object[]{filterCateId, r}));
} else {// 根据分类ID查取到规格信息,则进一步比对判断是否新增
List<String> confirmAddSpecNameList = addSpecNameList.stream().filter(r -> !mgtCategorySpecVoCache.getSpecNameList().contains(r)).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(confirmAddSpecNameList)) {// 不存在于`mgtCategorySpecVoCache`的,则更新Cache,数据库新增
mgtCategorySpecVoCache.getSpecNameList().addAll(confirmAddSpecNameList);
goblinMongoUtils.updateCategorySpecVo(mgtCategorySpecVoCache);
goblinRedisUtils.setCategorySpec(filterCateId, mgtCategorySpecVoCache);
confirmAddSpecNameList.forEach(r -> initGoodsCategorySpecObjs.add(new Object[]{filterCateId, r}));
}
}
}
LinkedList<Object[]> initGoodsSkuCouponObjs = CollectionUtil.linkedListObjectArr();// 券类商品信息
LinkedList<Object[]> initCandyCouponObjs = CollectionUtil.linkedListObjectArr();// 券信息
LinkedList<Object[]> initCandyCouponRuleObjs = CollectionUtil.linkedListObjectArr();// 券规则信息
int skuSize = goodsSkuInfoVoList.size();
for (int i = 0; i < skuSize; i++) {
GoblinGoodsSkuInfoVo skuInfoVo = goodsSkuInfoVoList.get(i);
String skuId = skuInfoVo.getSkuId();
String buyRoster = skuInfoVo.getBuyRoster();
goblinRedisUtils.setSkuStock(null, skuId, skuInfoVo.getSkuStock());
initGoodsSkuObjs.add(new Object[]{
skuId, skuInfoVo.getSpuId(), skuInfoVo.getSkuNo(), skuInfoVo.getSkuBarCode(), skuInfoVo.getSkuErpCode(),
skuInfoVo.getErpType(), skuInfoVo.getErpHosting(), skuInfoVo.getErpWarehouseNo(), skuInfoVo.getName(),
skuInfoVo.getSubtitle(), skuInfoVo.getSellPrice(), skuInfoVo.getSkuPic(), skuInfoVo.getSkuIsbn(), skuInfoVo.getStock(),
skuInfoVo.getSkuStock(), skuInfoVo.getWarningStock(), skuInfoVo.getPrice(), skuInfoVo.getPriceMember(), skuInfoVo.getWeight(),
skuInfoVo.getBuyFactor(), buyRoster, skuInfoVo.getBuyLimit(), skuInfoVo.getStoreId(), skuInfoVo.getSkuValidity(),
skuInfoVo.getVirtualFlg(), skuInfoVo.getStatus(), skuInfoVo.getShelvesStatus(), skuInfoVo.getSkuAppear(), skuInfoVo.getShelvesAt(),
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()});
initCandyCouponObjs.add(new Object[]{spuId, goodsInfoVo.getName(), goodsInfoVo.getIntro(), skuInfoVo.getBusiType(),
skuInfoVo.getCouType(), skuInfoVo.getValFace(), skuInfoVo.getValidity(), skuInfoVo.getIsTrueName(),
skuInfoVo.getEffectAt(), skuInfoVo.getExpireAt(), goodsInfoVo.getCreatedBy(), goodsInfoVo.getCreatedAt()
});
String busiName = "%s系列";
switch (skuInfoVo.getUseScope()) {// 适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]
case 101:// 音乐节
busiName = String.format(busiName, "音乐节");
break;
case 102:// 小型演出(LiveHouse演出)
busiName = String.format(busiName, "小型演出(LiveHouse演出)");
break;
case 103:// 巡演
busiName = String.format(busiName, "巡演");
break;
}
initCandyCouponRuleObjs.add(new Object[]{IDGenerator.nextTimeId2(), spuId, skuInfoVo.getUseScope(), busiName, "", 1});
}
skuInfoVo.getSkuSpecList().forEach(skuSpecDto -> initGoodsSkuSpecValueObjs.add(new Object[]{
spuId, skuId, skuSpecDto.getSpecName(), skuSpecDto.getSpecVname()
}));
if (skuInfoVo.getBuyFactor().equals("2") && StringUtils.isNotBlank(buyRoster) && buyRoster.startsWith("http")) {
queueUtils.sendMsgByRedisXls(buyRoster, "1", skuId);
}
}
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods.insert"));
LinkedList<Object[]> initGoodsObjs = CollectionUtil.linkedListObjectArr();
initGoodsObjs.add(new Object[]{
spuId, goodsInfoVo.getSpuNo(), goodsInfoVo.getSpuBarCode(), goodsInfoVo.getSpuErpCode(), goodsInfoVo.getErpType(),
goodsInfoVo.getName(), goodsInfoVo.getSubtitle(), goodsInfoVo.getSellPrice(), goodsInfoVo.getPriceGe(), goodsInfoVo.getPriceLe(),
goodsInfoVo.getIntro(), goodsInfoVo.getDetails(), goodsInfoVo.getCoverPic(), goodsInfoVo.getVideo(), goodsInfoVo.getSpecMode(),
goodsInfoVo.getStoreId(), goodsInfoVo.getCateFid(), goodsInfoVo.getCateSid(), goodsInfoVo.getCateTid(), goodsInfoVo.getStoreCateFid(),
goodsInfoVo.getStoreCateSid(), goodsInfoVo.getStoreCateTid(), goodsInfoVo.getBrandId(), goodsInfoVo.getShelvesHandle(), goodsInfoVo.getShelvesTime(),
goodsInfoVo.getSpuValidity(), goodsInfoVo.getVirtualFlg(), goodsInfoVo.getStatus(), goodsInfoVo.getShelvesStatus(), goodsInfoVo.getSpuAppear(),
goodsInfoVo.getShelvesAt(), createdBy, createdAt, goodsInfoVo.getLogisticsTemplate()
});
toMqSqls.add(SqlMapping.get("goblin_goods_sku.insert"));
toMqSqls.add(SqlMapping.get("goblin_goods_sku_coupon.insert"));
toMqSqls.add(SqlMapping.get("candy_coupon.goods_insert"));
toMqSqls.add(SqlMapping.get("candy_coupon_rule.goods_insert"));
toMqSqls.add(SqlMapping.get("goblin_goods_image.insert_byreplace"));
LinkedList<Object[]> initGoodsImageObjs = CollectionUtil.linkedListObjectArr();
if (CollectionUtils.isEmpty(goodsInfoVo.getImageList())) {
goodsInfoVo.getImageList().forEach(imageUrl -> initGoodsImageObjs.add(new Object[]{spuId, imageUrl}));
}
toMqSqls.add(SqlMapping.get("goblin_goods_tag.insert_byreplace"));
LinkedList<Object[]> initGoodsTagObjs = CollectionUtil.linkedListObjectArr();
if (!CollectionUtils.isEmpty(goodsInfoVo.getTagVoList())) {
goodsInfoVo.getTagVoList().forEach(tagVo -> initGoodsTagObjs.add(new Object[]{spuId, tagVo.getTagId(), tagVo.getSort(), "0"}));
}
if (!CollectionUtils.isEmpty(goodsInfoVo.getExtagVoList())) {
goodsInfoVo.getExtagVoList().forEach(exTagVo -> initGoodsTagObjs.add(new Object[]{spuId, exTagVo.getTagId(), exTagVo.getSort(), "1"}));
}
toMqSqls.add(SqlMapping.get("goblin_goods_artag.insert_byreplace"));
LinkedList<Object[]> initGoodsArTagObjs = CollectionUtil.linkedListObjectArr();
if (!CollectionUtils.isEmpty(goodsInfoVo.getArtagVoList())) {
goodsInfoVo.getArtagVoList().forEach(arTagVo -> initGoodsArTagObjs.add(new Object[]{spuId, arTagVo.getTagId(), arTagVo.getSort(), "1"}));
}
toMqSqls.add(SqlMapping.get("goblin_goods_service_support.insert_byreplace"));
LinkedList<Object[]> initGoodsServiceSupportObjs = CollectionUtil.linkedListObjectArr();
if (!CollectionUtils.isEmpty(goodsInfoVo.getServiceSupportVoList())) {
goodsInfoVo.getServiceSupportVoList().forEach(ssvo -> initGoodsServiceSupportObjs.add(new Object[]{spuId, ssvo.getSsid()}));
}
toMqSqls.add(SqlMapping.get("goblin_goods_spec.insert_byreplace"));
LinkedList<Object[]> initGoodsSpecObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spec_value.insert_byreplace"));
LinkedList<Object[]> initGoodsSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.insert_byreplace"));// SPU规格信息
LinkedList<Object[]> initGoodsSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_sku_spec_value.insert_byreplace"));// SKU规格信息
{// 规格记录
List<GoblinGoodsSpecVo> specVoList = goodsInfoVo.getSpecVoList();
specVoList.forEach(s -> {
initGoodsSpecObjs.add(new Object[]{s.getSpecName(), createdAt});
s.getSpecValues().forEach(sv -> {
initGoodsSpecValueObjs.add(new Object[]{s.getSpecName(), sv.getSpecVname(), createdAt});
initGoodsSpuSpecValueObjs.add(new Object[]{spuId, s.getSpecName(), sv.getSpecVname(), sv.getSpecVsort()});
});
});
}
toMqSqls.add(SqlMapping.get("goblin_goods_category_spec.insert_byreplace"));// 分类关联规格信息
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, initGoodsObjs, initGoodsSkuObjs, initGoodsSkuCouponObjs, initCandyCouponObjs, initCandyCouponRuleObjs,
initGoodsImageObjs, initGoodsTagObjs, initGoodsArTagObjs, initGoodsServiceSupportObjs, initGoodsSpecObjs,
initGoodsSpecValueObjs, initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs, initGoodsCategorySpecObjs)
);
}
@Override
public GoblinStoreMgtGoodsInfoVo goodsInfo(String storeId, String spuId) {
GoblinStoreMgtGoodsInfoVo vo = GoblinStoreMgtGoodsInfoVo.getNew();
......@@ -873,6 +1020,9 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateSkuInfoVo.getSkuNo(), updateSkuInfoVo.getVirtualFlg(), updateSkuInfoVo.getLogisticsTemplate(),
updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), updateSkuInfoVo.getSpuId()
});
toMqSqls.add(SqlMapping.get("candy_coupon.goods_spu_update"));
LinkedList<Object[]> updateCandyCouponObjs = CollectionUtil.linkedListObjectArr();
updateCandyCouponObjs.add(new Object[]{updateSpuInfoVo.getName(), updateSpuInfoVo.getIntro(), updateSpuInfoVo.getUpdatedBy(), updateSpuInfoVo.getUpdatedAt(), spuId});
toMqSqls.add(SqlMapping.get("goblin_goods_tag.delete"));
LinkedList<Object[]> deleteGoodsTagObjs = CollectionUtil.linkedListObjectArr();
......@@ -930,7 +1080,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsInfoObjs, updateGoodsSkuObjs,
SqlMapping.gets(toMqSqls, updateGoodsInfoObjs, updateGoodsSkuObjs, updateCandyCouponObjs,
deleteGoodsTagObjs, initGoodsTagObjs, deleteGoodsArTagObjs, initGoodsArTagObjs,
deleteServiceSupportObjs, initServiceSupportObjs, deleteGoodsImageObjs, initGoodsImageObjs));
return true;
......@@ -1232,11 +1382,33 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
updateGoodsSkuCouponObjs.add(new Object[]{
updateSkuInfoVo.getUseScope(), updateSkuInfoVo.getValFace(), updateSkuInfoVo.getIsTrueName(),
updateSkuInfoVo.getEffectAt(), updateSkuInfoVo.getExpireAt(), skuId});
toMqSqls.add(SqlMapping.get("candy_coupon.goods_sku_update"));
LinkedList<Object[]> updateCandyCouponObjs = CollectionUtil.linkedListObjectArr();
updateCandyCouponObjs.add(new Object[]{
updateSkuInfoVo.getValFace(), updateSkuInfoVo.getIsTrueName(), updateSkuInfoVo.getEffectAt(),
updateSkuInfoVo.getExpireAt(), updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), goodsInfoVo.getSpuId()
});
toMqSqls.add(SqlMapping.get("candy_coupon_rule.goods_sku_update"));
LinkedList<Object[]> updateCandyCouponRuleObjs = CollectionUtil.linkedListObjectArr();
String busiName = "%s系列";
switch (updateSkuInfoVo.getUseScope()) {// 适用范围[101-音乐节|102-小型演出(livehouse演出)|103-巡演]
case 101:// 音乐节
busiName = String.format(busiName, "音乐节");
break;
case 102:// 小型演出(LiveHouse演出)
busiName = String.format(busiName, "小型演出(LiveHouse演出)");
break;
case 103:// 巡演
busiName = String.format(busiName, "巡演");
break;
}
updateCandyCouponRuleObjs.add(new Object[]{updateSkuInfoVo.getUseScope(), busiName, goodsInfoVo.getSpuId()});
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));
SqlMapping.gets(toMqSqls, updateGoodsSkuForMarketObjs, updateGoodsSkuObjs, updateGoodsSkuCouponObjs,
updateCandyCouponObjs, updateCandyCouponRuleObjs, updateGoodsObjs));
return true;
}
return false;
......
......@@ -79,6 +79,11 @@ goblin_goods_sku_nft.insert_for_digital=INSERT INTO goblin_goods_sku_nft (sku_id
#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'
candy_coupon.goods_insert=INSERT INTO candy_coupon (coupon_id,state,title,notice,`exclusive`,busi_type,cou_type,bind_type,val_face,validity,is_true_name,effect_at,expire_at,operator,created_at) VALUES (?,1,?,?,0,?,?,1,?,?,?,?,?,?,?)
candy_coupon.goods_spu_update=UPDATE candy_coupon SET title=?,notice=?,operator=?,updated_at=? WHERE coupon_id=?
candy_coupon.goods_sku_update=UPDATE candy_coupon SET val_face=?,is_true_name=?,effect_at=?,expire_at=?,operator=?,updated_at=? WHERE coupon_id=?
candy_coupon_rule.goods_insert=INSERT INTO candy_coupon_rule (crule_id,coupon_id,use_scope,busi_name,busi_id,state) VALUES (?,?,?,?,?,1)
candy_coupon_rule.goods_sku_update=UPDATE candy_coupon_rule SET use_scope=?,busi_name=? WHERE coupon_id=?
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_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