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

Commit 4fd42af4 authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin

parents 377d6e37 87649b99
......@@ -77,7 +77,7 @@ public class GoblinRedisConst {
public static final String FRONT_SECKILL = PREFIX.concat("front_seckill"); //前端 秒杀列表
public static final String SELECT_GOODS = PREFIX.concat("select_goods"); //配置的精选商品
public static final String SELECT_GOODS_PAGE1 = PREFIX.concat("select_goods_page1"); //精选商品 第一页
public static final String SELECT_GOODS_SORT = PREFIX.concat("select_goods_sort"); //精选商品 第一页
public static final String SELECT_GOODS_SORT = PREFIX.concat("select_goods_sort"); //精选商品 排序规则
public static final String SELECT_GOODS_SPUIDS = PREFIX.concat("select_goods_SPUIDS"); //精选商品 spuids
public static final String MOUDLE_INDEX = PREFIX.concat("moudle_index"); //moudle_index 组件排序
public static final String COMPLIATIONS = PREFIX.concat("goblinFrontCompilations"); // 合集
......
......@@ -149,7 +149,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
// vo.setPriceLe(BigDecimal.ZERO);
vo.setIntro(this.getIntro());
vo.setDetails(this.getDetails());
vo.setCoverPic(this.getCoverPic());
vo.setCoverPic(StringUtils.isBlank(this.getCoverPic()) ? this.getImageList().get(0) : this.getCoverPic());
vo.setVideo(this.getVideo());
vo.setSpecMode(this.getSpecMode());
vo.setCateFid(this.getCateFid());
......@@ -197,7 +197,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vo.setSellPrice(this.getSellPrice());
vo.setIntro(this.getIntro());
vo.setDetails(this.getDetails());
vo.setCoverPic(this.getCoverPic());
vo.setCoverPic(StringUtils.isBlank(this.getCoverPic()) ? this.getImageList().get(0) : this.getCoverPic());
vo.setVideo(this.getVideo());
vo.setSpecMode(this.getSpecMode());
vo.setCateFid(this.getCateFid());
......@@ -288,7 +288,7 @@ public class GoblinStoreMgtGoodsAddParam implements Serializable {
vos.add(skuInfoVo);
skuIdList.add(skuInfoVo.getSkuId());
priceGe = priceGe.compareTo(skuInfoVo.getPrice()) > 0 ? skuInfoVo.getPrice() : priceGe;
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;
if (CollectionUtils.isEmpty(skuSpecList) || (skuSpecSize > 0 && skuSpecSize != skuSpecList.size())) {
......
......@@ -9,7 +9,10 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -29,6 +32,8 @@ public class GoblinStoreMgtGoodsEditSkuParam implements Serializable {
@ApiModelProperty(position = 13, required = true, value = "单品默认图片的url[256]")
private String skuPic;
@ApiModelProperty(position = 14, required = true, value = "单品规格信息")
@Valid
@NotNull(message = "规格信息不能为空")
private List<GoblinGoodsSpecDto> skuSpecList;
@ApiModelProperty(position = 15, required = false, value = "单品销售价-原价[20,2]")
private BigDecimal sellPrice;
......
......@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import java.util.List;
import java.util.Map;
public interface IGoblinstoreMgtGoodsService {
/**
......@@ -38,10 +39,11 @@ public interface IGoblinstoreMgtGoodsService {
/**
* 商品管理:商品编辑:SPU编辑
*
* @param uid UID
* @param storeMgtGoodsAddParam GoblinStoreMgtGoodsAddParam
* @return boolean
*/
boolean goodsEditSpu(GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam);
boolean goodsEditSpu(String uid, GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam);
/**
* 商品管理:商品编辑:SKU编辑
......@@ -49,35 +51,40 @@ public interface IGoblinstoreMgtGoodsService {
* @param uid UID
* @param storeMgtGoodsEditSkuParam GoblinStoreMgtGoodsEditSkuParam
* @param goodsInfoVo GoblinGoodsInfoVo
* @param delSpuSpecMap Map<String, String>
* @param beUpdateSpuSpecFlg boolean
* @return boolean
*/
boolean goodsEditSku(String uid, GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo);
boolean goodsEditSku(String uid, GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam,
GoblinGoodsInfoVo goodsInfoVo, Map<String, String> delSpuSpecMap, boolean beUpdateSpuSpecFlg);
/**
* 商品管理:商品编辑:SKU添加
*
* @param uid UID
* @param storeMgtGoodsEditSkuParam GoblinStoreMgtGoodsEditSkuParam
* @param goodsInfoVo GoblinGoodsInfoVo
*/
void goodsEditSkuAdd(GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo);
void goodsEditSkuAdd(String uid, GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo);
/**
* 商品管理:商品编辑:SKU删除
*
* @param uid UID
* @param goodsSkuInfoVo GoblinGoodsSkuInfoVo
* @return boolean
*/
boolean goodsEditSkuDel(GoblinGoodsSkuInfoVo goodsSkuInfoVo);
boolean goodsEditSkuDel(String uid, GoblinGoodsSkuInfoVo goodsSkuInfoVo);
/**
* 商品管理:商品编辑:SKU批改
*
* @param spuId 商品ID
* @param batField 批量修改属性
* @param batFieldVal 批量修改属性值
* @return boolean
*/
boolean goodsEditSkuBat(String spuId, String batField, String batFieldVal);
// /**
// * 商品管理:商品编辑:SKU批改
// *
// * @param spuId 商品ID
// * @param batField 批量修改属性
// * @param batFieldVal 批量修改属性值
// * @return boolean
// */
// boolean goodsEditSkuBat(String spuId, String batField, String batFieldVal);
/**
* 商品管理:上下架商品
......
......@@ -49,6 +49,8 @@ public class GoblinFrontCompilationsController extends BaseController {
public AjaxResult goodsList(@RequestParam(name = "name", required = false) String name) {
LambdaQueryWrapper<GoblinGoods> queryWrapper = Wrappers.lambdaQuery(GoblinGoods.class);
queryWrapper.ne(GoblinGoods::getDelFlg,"1");
queryWrapper.eq(GoblinGoods::getShelvesStatus,"3");
queryWrapper.eq(GoblinGoods::getSpuAppear,"0");
if(StringUtil.isNotBlank(name)){
queryWrapper.like(GoblinGoods::getName,name);
}
......
......@@ -179,6 +179,15 @@
} else {
}
promiseMethods('/front-index/list','post').then(res=>{
console.log(res, 'resp')
let { data } = res;
data.forEach(item => {
if (item.moudleName == "moFang") {
$("#sorting").val(item.indexs)
}
})
})
promiseMethods('/goblin-front-cube/list', 'post').then(res => {
let { data } = res;
if (data && data.length > 0) {
......@@ -411,10 +420,9 @@
"status": 0
};
return promiseMethods('/front-index/update', 'post', JSON.stringify(data), 'application/json')
}).then(() => {
}).then((res) => {
layer.msg("保存成功!")
$.modal.close();
refreshItem()
$.operate.successCallback(res);
})
}
......
......@@ -328,8 +328,7 @@
console.log(res, 'res')
if (res.code == 0) {
layer.msg('保存成功!')
$.modal.close();
refreshItem()
$.operate.successCallback(res);
}
})
}
......
......@@ -14,7 +14,13 @@
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
align-items: flex-start;
height: 100vh;
position: relative;
}
.gitHot {
position: fixed;
bottom: 40px;
}
.left_title, .right_title {
margin-bottom: 12px;
......@@ -147,11 +153,11 @@
<div class="function_btn">
<button type="button" class="btn btn-primary" onclick="goArea(1)">金刚位</button>
<button type="button" class="btn btn-warning" onclick="goArea(2)">活动banner</button>
<button type="button" class="btn btn-info" onclick="goArea(3)">限时秒杀</button>
<button type="button" class="btn btn-success" onclick="goArea(4)">魔方</button>
<button type="button" class="btn" onclick="goArea(7)">精选商品</button>
<button type="button" class="btn btn-info" onclick="goArea(7)">精选商品</button>
<!-- <button type="button" class="btn" disabled onclick="goArea(3)">限时秒杀</button> -->
</div>
<button type="button" class="btn" onclick="git()">上线</button>
<button type="button" class="btn btn-danger gitHot" onclick="git()">上线</button>
</div>
<div class="right_content">
<div class="right_title">
......@@ -170,7 +176,7 @@
<div>
魔方位
</div>
<span class="mofangSp" onclick="delSp()">X</span>
<span class="mofangSp" onclick="delSp(4)">X</span>
</div>
<div class="jinGangWei" onclick="goArea(1)">
<div>
......@@ -183,8 +189,6 @@
活动BANNER
</div>
<span class="huDongBannerSp" onclick="delSp(2)">X</span>
</div>
<!-- <iframe id="iframe" src="http://172.16.3.82:8080/#/goods/home?place=admin" width="375" height="1190" frameborder="0"></iframe> -->
</div>
......@@ -209,32 +213,33 @@
switch(num) {
case 1:
// $.modal.open('添加用户', prefix2 + "/form", '900', '320', callback);
$.modal.open('金刚位', prefix2 + "/kingArea?id=" + 1212)
$.modal.open('金刚位', prefix2 + "/kingArea?id=" + 1212,900,800, cancel)
break;
case 5:
$.modal.open('商品搜索', prefix2 + "/searchStore?id=" + 1212)
$.modal.open('商品搜索', prefix2 + "/searchStore?id=" + 1212,900,800, cancel)
// $.modal.openTab('商品搜索', prefix2 + "/searchStore?id=" + 1212)
break;
case 6:
$.modal.open('顶部banner', prefix2 + "/topBanner?id=" + num)
$.modal.open('顶部banner', prefix2 + "/topBanner?id=" + num,900,800, cancel)
// $.modal.openTab('顶部banner', prefix2 + "/topBanner?id=" + num)
break;
case 2:
$.modal.open('活动banner', prefix2 + "/topBanner?id=" + num)
$.modal.open('活动banner', prefix2 + "/topBanner?id=" + num,900,800, cancel)
// $.modal.openTab('活动banner', prefix2 + "/topBanner?id=" + num)
break;
case 4:
$.modal.open('魔方位', prefix2 + "/RubikArea?id=" + num)
$.modal.open('魔方位', prefix2 + "/RubikArea?id=" + num,900,800, cancel)
// $.modal.openTab('魔方位', prefix2 + "/RubikArea?id=" + num)
break;
case 7:
$.modal.open('精选商品', prefix2 + "/carefullyGoods?id=" + num)
$.modal.open('精选商品', prefix2 + "/carefullyGoods?id=" + num,900,800, cancel)
// $.modal.openTab('精选商品', prefix2 + "/carefullyGoods?id=" + num)
break;
}
}
function delSp (num) {
console.log($('.goods-banner-props'), '有吗')
event.stopPropagation()
console.log($('.goods-banner-props'), '有吗2')
let arr = [
{"mid":2,"moudleIndexId":"708754120962334729770775","moudleName":"jinGangWei","indexs":2,"updateTime":"2022-01-11 17:40:03","createTime":"2022-01-06 13:53:45","delTag":0,"status":0},
{"mid":1,"moudleIndexId":"708753099180072962244503","moudleName":"huDongBanner","indexs":1,"updateTime":"2022-01-06 13:52:22","createTime":"2022-01-06 13:52:19","delTag":0,"status":0},
......@@ -245,12 +250,17 @@
$.ajax({
type: 'post',
url: '/front-index/update',
contentType: 'application/json',
data: JSON.stringify(arr[num-1]),
success:function (res) {
console.log(res, 'res')
modalPx();
}
})
}
function cancel () {
modalPx()
}
function git () {
$.ajax({
type: 'post',
......
......@@ -168,6 +168,15 @@
} else {
}
promiseMethods('/front-index/list','post').then(res=>{
console.log(res, 'resp')
let { data } = res;
data.forEach(item => {
if (item.moudleName == "jinGangWei") {
$("#sorting").val(item.indexs)
}
})
})
showDetail (1)
})
function showDetail (numType) {
......@@ -429,8 +438,7 @@
}).then((res)=> {
layer.msg('保存成功!')
// $.modal.closeTab();
$.modal.close();
refreshItem()
$.operate.successCallback(res);
})
}
function common (num) {
......
......@@ -184,7 +184,7 @@
console.log(data, 'data222')
promiseMethods('/hotWord/updateOrCreate', 'post', JSON.stringify(data), 'application/json').then(res => {
layer.msg('创建成功!')
$.modal.close();
// $.modal.close();
$.operate.successCallback(res);
})
// refreshItem()
......
......@@ -171,6 +171,15 @@
} else {
}
promiseMethods('/front-index/list','post').then(res=>{
console.log(res, 'resp')
let { data } = res;
data.forEach(item => {
if (item.moudleName == "huDongBanner") {
$("#sorting").val(item.indexs)
}
})
})
let name = 'id';
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
......@@ -387,8 +396,7 @@
}
}).then(res => {
layer.msg("保存成功!")
$.modal.close();
refreshItem()
$.operate.successCallback(res);
})
}
......
......@@ -380,7 +380,7 @@ create table goblin_goods_spu_spec_value
comment varchar(255)
) engine = InnoDB comment '商品关联规格值';
create unique index uidx_ggssv_spu_s_s on goblin_goods_spu_spec_value (spu_id, spec_name, spec_vname);
create unique index uidx_ggssv_spu_s_s on goblin_goods_spu_spec_value (spu_id, spec_name, spec_vname, del_flg);
# -- >>------------------------------------------------------------------------------------
drop table if exists goblin_goods_sku_spec_value;
create table goblin_goods_sku_spec_value
......@@ -395,7 +395,7 @@ create table goblin_goods_sku_spec_value
comment varchar(255)
) engine = InnoDB comment '单品关联规格值';
create unique index uidx_ggssv_s_s_s on goblin_goods_sku_spec_value (sku_id, spec_name, spec_vname);
create unique index uidx_ggssv_s_s_s on goblin_goods_sku_spec_value (sku_id, spec_name, del_flg);
# -- >>------------------------------------------------------------------------------------
# -- >>------------------------------------------------------------------------------------
drop table if exists goblin_goods_spec_value;
......@@ -447,26 +447,151 @@ create unique index uidx_ggcs_c_s on goblin_goods_category_spec (cate_id, spec_n
# -- >>------------------------------------------------------------------------------------
# -- >>------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `goblin_front_banner`;
CREATE TABLE `goblin_front_banner`
(
`mid` bigint NOT NULL COMMENT '主键',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片路径',
`indexs` int DEFAULT NULL COMMENT '排序',
`jump_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '1、票务2、H5',
`start_time` timestamp NULL DEFAULT NULL COMMENT '开启时间',
`end_time` timestamp NULL DEFAULT NULL COMMENT '结束时间',
`activity_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动url',
`ticket_name` varbinary(255) DEFAULT NULL COMMENT '票务名字',
`banner_type` int DEFAULT NULL COMMENT '1、首页顶部位置2、首页中部位置',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`banner_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'bannerId',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
PRIMARY KEY (`mid`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='轮播图';
CREATE TABLE `goblin_front_banner` (
`mid` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片路径',
`indexs` int DEFAULT NULL COMMENT '排序',
`jump_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '1、票务2、H5、3票务',
`start_time` timestamp NULL DEFAULT NULL COMMENT '开启时间',
`end_time` timestamp NULL DEFAULT NULL COMMENT '结束时间',
`activity_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动url',
`ticket_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '票务名字',
`banner_type` int DEFAULT NULL COMMENT '1、首页顶部位置2、首页中部位置',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`banner_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'bannerId',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`ticket_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '票务id',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='轮播图';
DROP TABLE IF EXISTS `goblin_front_compilations`;
CREATE TABLE `goblin_front_compilations` (
`mid` bigint NOT NULL AUTO_INCREMENT,
`compilations_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '合集id',
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '合集名称',
`spu_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'spu ids',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片',
`spu_count` int DEFAULT NULL COMMENT '商品数量',
`describes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '描述',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='合集';
DROP TABLE IF EXISTS `goblin_front_cube`;
CREATE TABLE `goblin_front_cube` (
`mid` bigint NOT NULL AUTO_INCREMENT,
`cube_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '魔方id',
`row_type` int DEFAULT NULL COMMENT '1、一行一个2一行二个3一行三个4上一下三',
`page_type` int DEFAULT NULL COMMENT '1、单商品2、合集',
`spu_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品名称',
`spu_id` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品id',
`information_a` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '推荐文案1',
`compilations_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '合集id',
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL,
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`information_b` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '推荐文案1',
`information_c` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '推荐文案2',
`information_d` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '推荐文案3',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ----------------------------
-- Table structure for goblin_front_hot_word
-- ----------------------------
DROP TABLE IF EXISTS `goblin_front_hot_word`;
CREATE TABLE `goblin_front_hot_word` (
`mid` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`word` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '热词',
`status` int DEFAULT NULL COMMENT '1开启2未开启',
`indexs` int DEFAULT NULL COMMENT '排序',
`change_type` int DEFAULT NULL COMMENT '1、滚动2、按时切换',
`change_time` int DEFAULT NULL COMMENT '切换时间单位为s',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`hot_word_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '热词id',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='热词\n';
-- ----------------------------
-- Table structure for goblin_front_moudle_index
-- ----------------------------
DROP TABLE IF EXISTS `goblin_front_moudle_index`;
CREATE TABLE `goblin_front_moudle_index` (
`mid` bigint NOT NULL AUTO_INCREMENT,
`moudle_index_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '组件排序id',
`moudle_name` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名字',
`indexs` int DEFAULT NULL COMMENT '顺序',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`status` int DEFAULT NULL COMMENT '0展示2不展示',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='组件排序';
BEGIN;
INSERT INTO `goblin_front_moudle_index` VALUES (1, '708753099180072962244503', 'huDongBanner', 2, '2022-01-21 14:13:58', '2022-01-06 13:52:19', 0, 0);
INSERT INTO `goblin_front_moudle_index` VALUES (2, '708754120962334729770775', 'jinGangWei', 4, '2022-01-21 14:13:46', '2022-01-06 13:53:45', 0, 0);
INSERT INTO `goblin_front_moudle_index` VALUES (3, '708754120962334729770777', 'xianShiMiaoSha', 3, '2022-01-06 13:55:04', '2022-01-06 13:55:07', 0, 0);
INSERT INTO `goblin_front_moudle_index` VALUES (4, '708754120962334729772770', 'moFang', 2, '2022-01-21 14:14:45', '2022-01-06 13:55:34', 0, 0);
COMMIT;
-- ----------------------------
-- Table structure for goblin_front_navigation
-- ----------------------------
DROP TABLE IF EXISTS `goblin_front_navigation`;
CREATE TABLE `goblin_front_navigation` (
`mid` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图片路径或id',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '标题',
`spu_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品id',
`display_type` int DEFAULT NULL COMMENT '展示形式:1、一行2、二行',
`category_type` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '分类',
`activity_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动链接',
`navigation_type` int DEFAULT NULL COMMENT '1、分类2、专题3、商品单品',
`indexs` int DEFAULT NULL COMMENT '顺序',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`navigation_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '导航id',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`spu_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品名字',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='首页导航栏\n';
-- ----------------------------
-- Table structure for goblin_front_seckill
-- ----------------------------
DROP TABLE IF EXISTS `goblin_front_seckill`;
CREATE TABLE `goblin_front_seckill` (
`mid` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`self_activityIds` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动id(官方g_,商铺s_)',
`show_type` int DEFAULT NULL COMMENT '1、一行三个2、两行三个',
`activityType` int DEFAULT NULL COMMENT '1、关闭模块2、保留模块',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`indexs` int DEFAULT NULL COMMENT '排序',
`seckil_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '秒杀id',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='秒杀表';
-- ----------------------------
-- Table structure for goblin_front_select_goods
-- ----------------------------
DROP TABLE IF EXISTS `goblin_front_select_goods`;
CREATE TABLE `goblin_front_select_goods` (
`mid` bigint NOT NULL AUTO_INCREMENT,
`select_goods_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品id',
`spu_id` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT 'spu的 ids拼接',
`del_tag` int DEFAULT NULL COMMENT '0未删除1已删除',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '修改时间',
`order_type` int DEFAULT NULL COMMENT '1、上架时间2、销量3、价格高到低4、价格低到高',
`indexs` int DEFAULT NULL COMMENT '顺序',
PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='精选商品\n';
# -- >>------------------------------------------------------------------------------------
# -- >>------------------------------------------------------------------------------------
# -- >>------------------------------------------------------------------------------------
......
......@@ -102,7 +102,7 @@ public class GoblinStoreMgtCategoryController {
} else {// 存在则判断,是否为已存在的父级分类
if (storeGoodsCategoryVosCache.stream().anyMatch(r -> r.getName().equals(catename))) {
log.warn("店铺商品分类管理:添加:分类名称重复[UID={},storeId={},catefid={},catesid={},catename={}]", currentUid, storeId, catefid, catesid, catename);
return ResponseDto.failure(ErrorMapping.get("149007"));
return ResponseDto.failure(ErrorMapping.get("149008"));
}
Map<String, GoblinStoreGoodsCategoryVo> existFilterMap = storeGoodsCategoryVosCache.stream().filter(r -> catePidList.contains(r.getCateId()))
......
package com.liquidnet.service.goblin.controller.manage;
import com.fasterxml.jackson.databind.JsonNode;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.IdentityUtils;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto;
......@@ -46,13 +48,24 @@ public class GoblinStoreMgtCertificationController {
@ApiOperation(value = "店铺认证第一步:认证资料")
@PostMapping("fstep")
public ResponseDto<String> certificationFirstStep(@Valid @RequestBody GoblinStoreMgtCertificationParam certificationParam) {
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(CurrentUtil.getCurrentUid());
String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
if (null != storeInfoVo && !ENABLE_CERT_STATUS.contains(storeInfoVo.getStatus())) {
log.warn("店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]", CurrentUtil.getCurrentUid(), storeInfoVo.getStoreId(), storeInfoVo.getStatus());
log.warn("店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]", currentUid, storeInfoVo.getStoreId(), storeInfoVo.getStatus());
return ResponseDto.failure(ErrorMapping.get("149001"));
}
if (log.isDebugEnabled()) {
log.debug("店铺认证[GoblinStoreMgtCertificationParam:{}]", JsonUtils.toJson(certificationParam));
log.debug("店铺认证[UID={},GoblinStoreMgtCertificationParam:{}]", currentUid, JsonUtils.toJson(certificationParam));
}
if (certificationParam.getPersonCertType().equals("1")) {
String personName = certificationParam.getPersonName();
String personCertCode = certificationParam.getPersonCertCode();
String respStr = IdentityUtils.aliThird(personName, personCertCode);
JsonNode respJNode = JsonUtils.fromJson(respStr, JsonNode.class);
if (null == respJNode || !"0".equals(String.valueOf(respJNode.get("error_code")))) {
log.info("###实名认证失败[UID={},name={},idcard={},respStr={}]", currentUid, personName, personCertCode, respStr);
return ResponseDto.failure(ErrorMapping.get("149004"));
}
}
storeInfoVo = goblinStoreMgtCertificationService.certificationInformationProcessing(certificationParam, storeInfoVo);
return ResponseDto.success(storeInfoVo.getStoreId());
......@@ -62,17 +75,18 @@ public class GoblinStoreMgtCertificationController {
@ApiOperation(value = "店铺认证第二步:完善信息")
@PostMapping("sstep")
public ResponseDto<Object> certificationSecondStep(@Valid @RequestBody GoblinStoreMgtCompleteParam completeParam) {
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(CurrentUtil.getCurrentUid());
String currentUid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVoByUid(currentUid);
if (null == storeInfoVo) {
log.warn("店铺认证:完善信息:店铺信息不存在,请按流程完成第一步:[UID={}]", CurrentUtil.getCurrentUid());
log.warn("店铺认证:完善信息:店铺信息不存在,请按流程完成第一步:[UID={}]", currentUid);
return ResponseDto.failure(ErrorMapping.get("149001"));
}
if (!ENABLE_CERT_STATUS.contains(storeInfoVo.getStatus())) {
log.warn("店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]", CurrentUtil.getCurrentUid(), storeInfoVo.getStoreId(), storeInfoVo.getStatus());
log.warn("店铺认证:无效请求:店铺已认证,无需再次认证[UID={},storeId={},storeStatus={}]", currentUid, storeInfoVo.getStoreId(), storeInfoVo.getStatus());
return ResponseDto.failure(ErrorMapping.get("149001"));
}
if (log.isDebugEnabled()) {
log.debug("店铺认证[GoblinStoreMgtCompleteParam:{}]", JsonUtils.toJson(completeParam));
log.debug("店铺认证[UID={},GoblinStoreMgtCompleteParam:{}]", currentUid, JsonUtils.toJson(completeParam));
}
return ResponseDto.success(goblinStoreMgtCertificationService.certificationCompleteProcessing(completeParam, storeInfoVo));
}
......@@ -103,6 +117,10 @@ public class GoblinStoreMgtCertificationController {
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVo(storeId);
if (null == storeInfoVo || Arrays.asList("3","4","5").contains(storeInfoVo.getStatus())) {
return ResponseDto.success();// 店铺认证通过后不允许删除
}
log.info("删除店铺[UID={},storeId={}]", currentUid, storeId);
return ResponseDto.success(goblinStoreMgtCertificationService.certificationCancelProcessing(storeId, currentUid));
}
......
......@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.controller.manage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.common.exception.constant.ErrorCode;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
......@@ -16,6 +17,7 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsFilterParam;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService;
import com.liquidnet.service.goblin.service.manage.IGoblinstoreMgtGoodsService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
......@@ -33,10 +35,9 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
......@@ -50,6 +51,8 @@ public class GoblinStoreMgtGoodsController {
@Autowired
IGoblinstoreMgtGoodsService goblinstoreMgtGoodsService;
@Autowired
IGoblinStoreMgtExtraService goblinStoreMgtExtraService;
@Autowired
GoblinRedisUtils goblinRedisUtils;
@Autowired
GoblinMongoUtils goblinMongoUtils;
......@@ -125,7 +128,8 @@ public class GoblinStoreMgtGoodsController {
@PutMapping("add")
public ResponseDto<Object> add(@Valid @RequestBody GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) {
String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsAddParam.getStoreId())) {
String storeId = storeMgtGoodsAddParam.getStoreId();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
if (log.isDebugEnabled()) {
......@@ -134,6 +138,25 @@ public class GoblinStoreMgtGoodsController {
if (CollectionUtils.isEmpty(storeMgtGoodsAddParam.getSkuParamList())) {
return ResponseDto.failure(ErrorMapping.get("149006"));
}
if (CollectionUtils.isEmpty(storeMgtGoodsAddParam.getImageList())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品图片不能为空");
}
String cateSid = storeMgtGoodsAddParam.getCateSid(), cateTid = storeMgtGoodsAddParam.getCateTid();
List<GoblinSelfGoodsCategoryVo> selfGoodsCategoryVos = goblinStoreMgtExtraService.listCategoryVo();
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(storeMgtGoodsAddParam.getCateFid()) && r.getGrade().equals("1"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类1无效");
}
if (StringUtils.isNotBlank(cateSid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateSid) && r.getGrade().equals("2"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类2无效");
}
if (StringUtils.isNotBlank(cateTid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateTid) && r.getGrade().equals("3"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类3无效");
}
GoblinGoodsInfoVo mgtGoodsInfoVo = goblinMongoUtils.getMgtGoodsInfoVo(storeId, storeMgtGoodsAddParam.getName());
if (null != mgtGoodsInfoVo) {
return ResponseDto.failure(ErrorMapping.get("149007"));
}
LocalDateTime now = LocalDateTime.now();
GoblinGoodsInfoVo goodsInfoVo = storeMgtGoodsAddParam.initGoodsInfoVo();
goodsInfoVo.setCreatedBy(currentUid);
......@@ -198,16 +221,36 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation(value = "商品编辑:SPU编辑", notes = "只修改商品信息,不包含规格相关信息")
@PostMapping("edit_spu")
public ResponseDto<Object> editSpu(@Valid @RequestBody GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) {
if (!goblinRedisUtils.hasStoreId(CurrentUtil.getCurrentUid(), storeMgtGoodsAddParam.getStoreId())) {
String currentUid = CurrentUtil.getCurrentUid();
String storeId = storeMgtGoodsAddParam.getStoreId();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
if (StringUtils.isBlank(storeMgtGoodsAddParam.getSpuId()) || null == goblinRedisUtils.getMgtGoodsInfoVo(storeMgtGoodsAddParam.getSpuId())) {
return ResponseDto.failure(ErrorMapping.get("149010"));
}
if (CollectionUtils.isEmpty(storeMgtGoodsAddParam.getImageList())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品图片不能为空");
}
String cateSid = storeMgtGoodsAddParam.getCateSid(), cateTid = storeMgtGoodsAddParam.getCateTid();
List<GoblinSelfGoodsCategoryVo> selfGoodsCategoryVos = goblinStoreMgtExtraService.listCategoryVo();
if (selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(storeMgtGoodsAddParam.getCateFid()) && r.getGrade().equals("1"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类1无效");
}
if (StringUtils.isNotBlank(cateSid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateSid) && r.getGrade().equals("2"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类2无效");
}
if (StringUtils.isNotBlank(cateTid) && selfGoodsCategoryVos.stream().noneMatch(r -> r.getCateId().equals(cateTid) && r.getGrade().equals("3"))) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "商品分类3无效");
}
GoblinGoodsInfoVo mgtGoodsInfoVo = goblinMongoUtils.getMgtGoodsInfoVo(storeId, storeMgtGoodsAddParam.getName());
if (null != mgtGoodsInfoVo && !mgtGoodsInfoVo.getSpuId().equals(storeMgtGoodsAddParam.getSpuId())) {
return ResponseDto.failure(ErrorMapping.get("149007"));
}
if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:SPU编辑:[GoblinStoreMgtGoodsAddParam={}]", JsonUtils.toJson(storeMgtGoodsAddParam));
}
return ResponseDto.success(goblinstoreMgtGoodsService.goodsEditSpu(storeMgtGoodsAddParam));
return ResponseDto.success(goblinstoreMgtGoodsService.goodsEditSpu(currentUid, storeMgtGoodsAddParam));
}
@ApiOperationSupport(order = 7)
......@@ -256,16 +299,21 @@ public class GoblinStoreMgtGoodsController {
List<GoblinGoodsSpecDto> paramSkuSpecList = storeMgtGoodsEditSkuParam.getSkuSpecList();
List<String> skuIdList = goodsInfoVo.getSkuIdList();
Map<String, List<GoblinGoodsSpecDto>> otherSkuSpecListMap = new HashMap<>();
Map<String, String> delSpuSpecMap = CollectionUtil.mapStringString();
boolean beUpdateSpuSpecFlg = false;
for (String skuId : skuIdList) {// 比对所有SKU规格信息
GoblinGoodsSkuInfoVo existMgtGoodsSkuInfoVo = goblinRedisUtils.getMgtGoodsSkuInfoVo(skuId);
Map<String, String> editBefSkuSpecMap = existMgtGoodsSkuInfoVo.getSkuSpecList().stream()
List<GoblinGoodsSpecDto> skuSpecList = existMgtGoodsSkuInfoVo.getSkuSpecList();
otherSkuSpecListMap.put(skuId, skuSpecList);
Map<String, String> editBefSkuSpecMap = skuSpecList.stream()
.collect(Collectors.toMap(GoblinGoodsSpecDto::getSpecName, GoblinGoodsSpecDto::getSpecVname, (k1, k2) -> k2));
boolean diffSpecFlg = false;
if (paramSkuSpecList.size() != editBefSkuSpecMap.size()) {
log.warn("商品管理:商品编辑:SKU编辑:规格信息不一致[skuId={},editBefSkuSpecMap={},paramGoodsSpecDto={}]",
paramSkuId, editBefSkuSpecMap, paramSkuSpecList);
return ResponseDto.failure(ErrorMapping.get("149014"));
}
boolean diffSpecFlg = false;
for (GoblinGoodsSpecDto paramGoodsSpecDto : paramSkuSpecList) {// 入参规格逐个与当前商品所有SKU规格比对
String editBefSkuSpecVname = editBefSkuSpecMap.get(paramGoodsSpecDto.getSpecName());
if (null == editBefSkuSpecVname) {// 入参规格不存在于原SKU中,则参数有误
......@@ -279,28 +327,45 @@ public class GoblinStoreMgtGoodsController {
}
}
if (skuId.equals(paramSkuId)) {
if (diffSpecFlg) {// 更改了规格,则同步修改SPU里的规格信息
otherSkuSpecListMap.remove(skuId);
if (diffSpecFlg) {// 更改了规格,则同步修改SPU里的规格信息(新增 + 删除,不做更新)
Map<String, String> paramSkuSpecMap = paramSkuSpecList.stream()
.collect(Collectors.toMap(GoblinGoodsSpecDto::getSpecName, GoblinGoodsSpecDto::getSpecVname, (k1, k2) -> k2));
List<GoblinGoodsSpecVo> specVoList = goodsInfoVo.getSpecVoList();
List<GoblinGoodsSpecVo> specVoList = goodsInfoVo.getSpecVoList();// SPU规格集
for (Map.Entry<String, String> entry : editBefSkuSpecMap.entrySet()) {
for (GoblinGoodsSpecVo specVo : specVoList) {
if (specVo.getSpecName().equals(entry.getKey())) {
List<GoblinGoodsSpecValueVo> specValues = specVo.getSpecValues();
int idx = IntStream.range(0, specValues.size())
.filter(i -> specValues.get(i).getSpecVname().equals(entry.getValue())).findFirst().orElse(-1);
if (idx == -1) {
log.warn("商品管理:商品编辑:SKU编辑:规格信息不一致[skuId={},specVoList={},editBefSkuSpecMap={}]",
paramSkuId, JsonUtils.toJson(specValues), editBefSkuSpecMap);
return ResponseDto.failure(ErrorMapping.get("149014"));
} else {
specValues.get(idx).setSpecVname(paramSkuSpecMap.get(specVo.getSpecName()));
String specName = entry.getKey();
String oldSpecVname = entry.getValue();
for (GoblinGoodsSpecVo specVo : specVoList) {// SPU规格集遍历
if (specVo.getSpecName().equals(specName)) {// SPU规格集中筛选出当前所编辑SKU的规格
List<GoblinGoodsSpecValueVo> specValues = specVo.getSpecValues();// 筛选得到的SPU的规格对应值集合
String newSpecVname = paramSkuSpecMap.get(specVo.getSpecName());
if (!newSpecVname.equals(oldSpecVname)) {
// 规格值集合中当前所编辑SKU规格值的索引
int idx = IntStream.range(0, specValues.size())
.filter(i -> specValues.get(i).getSpecVname().equals(newSpecVname)).findFirst().orElse(-1);
if (idx == -1) {// 不存在则新增且处理旧规格值,存在则不做处理
beUpdateSpuSpecFlg = true;
specValues.add(GoblinGoodsSpecValueVo.getNew().setSpecVname(newSpecVname).setSpecVsort(specValues.size() + 2));
boolean toDelOldSpecVnameFlg = true;// 其他SKU中只要存在该规格值,即不可删除该规格值
Set<Map.Entry<String, List<GoblinGoodsSpecDto>>> entries = otherSkuSpecListMap.entrySet();
for (Map.Entry<String, List<GoblinGoodsSpecDto>> ent : entries) {
for (GoblinGoodsSpecDto specDto : ent.getValue()) {
if (specDto.getSpecName().equals(specName) && specDto.getSpecVname().equals(oldSpecVname)) {
toDelOldSpecVnameFlg = false;
}
}
}
if (toDelOldSpecVnameFlg) {
specValues.removeIf(rmr -> rmr.getSpecVname().equals(oldSpecVname));
delSpuSpecMap.put(specName, oldSpecVname);
}
}
}
}
}
}
} else {// 未更改规格,则标记为NULL(用于判断MONGO是否更新SPU规格信息)
storeMgtGoodsEditSkuParam.setSkuSpecList(null);
}
continue;
}
......@@ -310,7 +375,7 @@ public class GoblinStoreMgtGoodsController {
return ResponseDto.failure(ErrorMapping.get("149015"));
}
}
if (goblinstoreMgtGoodsService.goodsEditSku(currentUid, storeMgtGoodsEditSkuParam, goodsInfoVo)) {
if (goblinstoreMgtGoodsService.goodsEditSku(currentUid, storeMgtGoodsEditSkuParam, goodsInfoVo, delSpuSpecMap, beUpdateSpuSpecFlg)) {
return ResponseDto.success(goblinRedisUtils.getMgtGoodsSkuInfoVo(paramSkuId));
} else {
if (null != operStock && operStock != 0) {// 处理库存:回滚
......@@ -329,43 +394,57 @@ public class GoblinStoreMgtGoodsController {
@ApiOperation(value = "商品编辑:SKU添加")
@PutMapping("edit_sku/add")
public ResponseDto<Object> editSkuAdd(@Valid @RequestBody GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam) {
if (!goblinRedisUtils.hasStoreId(CurrentUtil.getCurrentUid(), storeMgtGoodsEditSkuParam.getStoreId())) {
String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeMgtGoodsEditSkuParam.getStoreId())) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
if (storeMgtGoodsEditSkuParam.getPrice().compareTo(BigDecimal.ZERO) <= 0
|| storeMgtGoodsEditSkuParam.getPriceMember().compareTo(BigDecimal.ZERO) <= 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "价格无效");
}
if (storeMgtGoodsEditSkuParam.getStock() <= 0 || storeMgtGoodsEditSkuParam.getSkuStock() <= 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "库存无效");
}
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getMgtGoodsInfoVo(storeMgtGoodsEditSkuParam.getSpuId());
if (null == goodsInfoVo || !goodsInfoVo.getStoreId().equals(storeMgtGoodsEditSkuParam.getStoreId())) {
return ResponseDto.failure(ErrorMapping.get("149010"));
}
List<String> skuIdList = goodsInfoVo.getSkuIdList();
List<GoblinGoodsSpecDto> skuSpecList = storeMgtGoodsEditSkuParam.getSkuSpecList();
List<GoblinGoodsSpecDto> paramSkuSpecDtoList = storeMgtGoodsEditSkuParam.getSkuSpecList();
for (String skuId : skuIdList) {// 比对所有SKU规格信息
GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo = goblinRedisUtils.getMgtGoodsSkuInfoVo(skuId);
if (mgtGoodsSkuInfoVo.getSkuSpecList().size() != paramSkuSpecDtoList.size()) {
log.warn("商品管理:商品编辑:SKU添加:规格信息有误[skuSpecMap={},paramSkuSpecMap={}]", JsonUtils.toJson(mgtGoodsSkuInfoVo.getSkuSpecList()), JsonUtils.toJson(paramSkuSpecDtoList));
return ResponseDto.failure(ErrorMapping.get("149014"));
}
Map<String, String> skuSpecMap = mgtGoodsSkuInfoVo.getSkuSpecList().stream()
.collect(Collectors.toMap(GoblinGoodsSpecDto::getSpecName, GoblinGoodsSpecDto::getSpecVname, (k1, k2) -> k2));
boolean diffSpecFlg = false;
for (GoblinGoodsSpecDto goodsSpecDto : skuSpecList) {
for (GoblinGoodsSpecDto goodsSpecDto : paramSkuSpecDtoList) {
if (!skuSpecMap.get(goodsSpecDto.getSpecName()).equals(goodsSpecDto.getSpecVname())) {
diffSpecFlg = true;// 多个规格中只要存在一个不一致,即可跳过,标记为允许添加
break;
}
}
if (!diffSpecFlg) {
log.warn("商品管理:商品编辑:SKU添加:重复的规格信息[skuSpecMap={},paramSkuSpecMap={}]", skuSpecMap, JsonUtils.toJson(skuSpecList));
log.warn("商品管理:商品编辑:SKU添加:重复的规格信息[skuSpecMap={},paramSkuSpecMap={}]", skuSpecMap, JsonUtils.toJson(paramSkuSpecDtoList));
return ResponseDto.failure(ErrorMapping.get("149015"));
}
}
List<GoblinGoodsSpecVo> specVoList = goodsInfoVo.getSpecVoList();
if (CollectionUtils.isEmpty(specVoList)) {
if (null == specVoList) specVoList = ObjectUtil.getGoblinGoodsSpecVoArrayList();
int size = skuSpecList.size();
int size = paramSkuSpecDtoList.size();
for (int i = 0; i < size; i++) {
GoblinGoodsSpecDto specDto = skuSpecList.get(i);
GoblinGoodsSpecDto specDto = paramSkuSpecDtoList.get(i);
ArrayList<GoblinGoodsSpecValueVo> specValueVoList = ObjectUtil.getGoblinGoodsSpecValueVoArrayList();
specValueVoList.add(GoblinGoodsSpecValueVo.getNew().setSpecVname(specDto.getSpecVname()).setSpecVsort(i));
specVoList.add(GoblinGoodsSpecVo.getNew().setSpecName(specDto.getSpecName()).setSpecSort(i).setSpecValues(specValueVoList));
}
} else {
Map<String, String> paramSkuSpecMap = skuSpecList.stream()
Map<String, String> paramSkuSpecMap = paramSkuSpecDtoList.stream()
.collect(Collectors.toMap(GoblinGoodsSpecDto::getSpecName, GoblinGoodsSpecDto::getSpecVname, (k1, k2) -> k2));
for (GoblinGoodsSpecVo specVo : specVoList) {// 同步添加SPU规格信息
List<GoblinGoodsSpecValueVo> specValues = specVo.getSpecValues();
......@@ -376,7 +455,7 @@ public class GoblinStoreMgtGoodsController {
if (log.isDebugEnabled()) {
log.debug("商品管理:商品编辑:SKU添加:[GoblinStoreMgtGoodsEditSkuParam={}]", JsonUtils.toJson(storeMgtGoodsEditSkuParam));
}
goblinstoreMgtGoodsService.goodsEditSkuAdd(storeMgtGoodsEditSkuParam, goodsInfoVo);
goblinstoreMgtGoodsService.goodsEditSkuAdd(currentUid, storeMgtGoodsEditSkuParam, goodsInfoVo);
return ResponseDto.success();
}
......@@ -389,14 +468,15 @@ public class GoblinStoreMgtGoodsController {
@PostMapping("edit_sku/del")
public ResponseDto<Object> editSkuDel(@NotBlank(message = "店铺ID不能为空") String storeId,
@NotBlank(message = "单品ID不能为空") String skuId) {
if (!goblinRedisUtils.hasStoreId(CurrentUtil.getCurrentUid(), storeId)) {
String currentUid = CurrentUtil.getCurrentUid();
if (!goblinRedisUtils.hasStoreId(currentUid, storeId)) {
return ResponseDto.failure(ErrorMapping.get("149002"));
}
GoblinGoodsSkuInfoVo mgtGoodsSkuInfoVo = goblinRedisUtils.getMgtGoodsSkuInfoVo(skuId);
if (null == mgtGoodsSkuInfoVo || !mgtGoodsSkuInfoVo.getStoreId().equals(storeId)) {
return ResponseDto.failure(ErrorMapping.get("149011"));
}
return ResponseDto.success(goblinstoreMgtGoodsService.goodsEditSkuDel(mgtGoodsSkuInfoVo));
return ResponseDto.success(goblinstoreMgtGoodsService.goodsEditSkuDel(currentUid, mgtGoodsSkuInfoVo));
}
// @ApiOperationSupport(order = 10)
......
......@@ -309,9 +309,10 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
public GoblinStoreInfoVo getStore(String storId){
Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storId));
query.addCriteria(Criteria.where("storeId").is(storId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
GoblinStoreInfoVo goblinStoreInfoVo=goblinRedisUtils.getStoreInfoVo(storId);
//GoblinStoreNoticeVo goblinStoreNoticeVo=goblinRedisUtils.getStoreNoticeVo(storId,LocalDateTime.now());
goblinStoreInfoVo.setCount((int) count);
return goblinStoreInfoVo;
}
......@@ -357,7 +358,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public List<GoblinGoodsInfoVo> searchGoodesName(String name){
Pattern pattern = Pattern.compile("^.*"+name+".*$", Pattern.CASE_INSENSITIVE);
Query query = new Query();
query.addCriteria(Criteria.where("name").regex(pattern));
query.addCriteria(Criteria.where("name").regex(pattern).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
query.with(Sort.by(
Sort.Order.desc("count"),
Sort.Order.desc("createdAt")
......@@ -389,7 +390,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public GoblinFrontCategoryListVo getStoreGoodes(String storeId,String categoryId,String name){
//
Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storeId));
query.addCriteria(Criteria.where("storeId").is(storeId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
if(StringUtil.isNotBlank(categoryId)){
query.addCriteria(new Criteria().orOperator(
Criteria.where("storeCateFid").is(categoryId),
......@@ -401,6 +402,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Pattern pattern = Pattern.compile("^.*"+name+".*$", Pattern.CASE_INSENSITIVE);
query.addCriteria(Criteria.where("name").regex(pattern));
}
query.with(Sort.by(Sort.Direction.DESC, "count"));
// 查询总数
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if(list.size()>0){
......@@ -430,13 +432,13 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
//
Query query = new Query();
query.addCriteria(new Criteria().orOperator(
Criteria.where("extagVoList.tagId").is(tagId)
Criteria.where("extagVoList.tagId").is(tagId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3")
));
Pageable pageable=null;
//
boolean isRe=false;
if(type.equals("1")){
isRe=true;
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "count"));
}else if(type.equals("2")){
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "shelvesAt"));
}else if(type.equals("3")){
......@@ -449,11 +451,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
// 查询总数
long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if(!isRe){
query.with(pageable);
}
query.with(pageable);
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if(list.size()>0&&isRe){
/*if(list.size()>0&&isRe){
//找到 销量
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
Integer counts=goblinRedisUtils.getSpuSaleCount(goblinGoodsInfoVo.getSpuId());
......@@ -467,7 +467,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) {
return -(arg0.getCount().compareTo(arg1.getCount()));
}});
}
}*/
GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew();
goblinFrontCategoryListVo.setCount(count);
goblinFrontCategoryListVo.setSpuList(list);
......@@ -485,11 +485,11 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Criteria.where("cateSid").is(categoryId),
Criteria.where("cateTid").is(categoryId)
));
query.addCriteria(Criteria.where("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
Pageable pageable=null;
//
boolean isRe=false;
if(type.equals("1")){
isRe=true;
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "count"));
}else if(type.equals("2")){
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "shelvesAt"));
}else if(type.equals("3")){
......@@ -502,11 +502,9 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
// 查询总数
long count = mongoTemplate.count(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if(!isRe){
query.with(pageable);
}
query.with(pageable);
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if(list.size()>0&&isRe){
/* if(list.size()>0&&isRe){
//找到 销量
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
Integer counts=goblinRedisUtils.getSpuSaleCount(goblinGoodsInfoVo.getSpuId());
......@@ -520,7 +518,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) {
return -(arg0.getCount().compareTo(arg1.getCount()));
}});
}
}*/
GoblinFrontCategoryListVo goblinFrontCategoryListVo=GoblinFrontCategoryListVo.getNew();
goblinFrontCategoryListVo.setCount(count);
goblinFrontCategoryListVo.setSpuList(list);
......@@ -536,7 +534,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if(StringUtil.isNotBlank(spuids)){
query.addCriteria(Criteria.where("spuId").nin(spuids.split(",")));
}
query.addCriteria(Criteria.where("delFlg").is("0").and("shelvesStatus").is("3"));
query.addCriteria(Criteria.where("delFlg").is("0").and("shelvesStatus").is("3").and("spuAppear").is("0"));
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
int sortType=0;
......
......@@ -54,8 +54,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
goblinMongoUtils.setStoreInfoVo(storeInfoVo);
goblinRedisUtils.addStoreId(uid, storeInfoVo.getStoreId());
// TODO: 2022/1/6 zhanggb redis
// goblinRedisUtils.setStoreInfoVo(storeInfoVo);
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
LinkedList<Object[]> initStoreInfoObjs = CollectionUtil.linkedListObjectArr();
......@@ -89,9 +87,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
storeInfoVo.setCertificationVo(storeCertificationVo);
if (goblinMongoUtils.updateStoreInfoVo(storeInfoVo)) {
// TODO: 2022/1/6 zhanggb redis
// goblinRedisUtils.setStoreInfoVo(storeInfoVo);
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
LinkedList<Object[]> updateStoreInfoObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_store_info.update_by_cert1"));
......@@ -124,8 +119,6 @@ public class GoblinStoreMgtCertificationServiceImpl implements IGoblinStoreMgtCe
storeInfoVo.setUpdatedAt(LocalDateTime.now());
storeInfoVo.setUpdatedBy(CurrentUtil.getCurrentUid());
if (goblinMongoUtils.updateStoreInfoVo(param.completeStoreInfoVo(storeInfoVo))) {
// TODO: 2022/1/6 zhanggb redis
// LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
// LinkedList<Object[]> updateStoreInfoObjs = CollectionUtil.linkedListObjectArr();
// toMqSqls.add(SqlMapping.get("goblin_store_info.update_by_cert2"));
......
......@@ -13,7 +13,7 @@ import org.springframework.util.CollectionUtils;
import java.util.List;
@Service
public class GoblinStoreMgtExtraImpl implements IGoblinStoreMgtExtraService {
public class GoblinStoreMgtExtraServiceImpl implements IGoblinStoreMgtExtraService {
@Autowired
private GoblinRedisUtils goblinRedisUtils;
@Autowired
......
package com.liquidnet.service.goblin.service.impl.manage;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst;
......@@ -13,10 +12,8 @@ import com.liquidnet.service.goblin.dto.manage.GoblinStoreMgtGoodsFilterParam;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinMgtCategorySpecVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsInfoVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtGoodsListVo;
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 com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtExtraService;
import com.liquidnet.service.goblin.service.manage.IGoblinstoreMgtGoodsService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
......@@ -27,10 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service
......@@ -41,10 +37,37 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
GoblinRedisUtils goblinRedisUtils;
@Autowired
GoblinMongoUtils goblinMongoUtils;
@Autowired
IGoblinStoreMgtExtraService goblinStoreMgtExtraService;
@Override
public PagedResult<GoblinStoreMgtGoodsListVo> goodsList(GoblinStoreMgtGoodsFilterParam filterParam) {
return goblinMongoUtils.getGoodsInfoVo(filterParam);
PagedResult<GoblinStoreMgtGoodsListVo> goodsListVoPagedResult = goblinMongoUtils.getMgtGoodsInfoVos(filterParam);
if (goodsListVoPagedResult.getTotal() > 0) {
List<GoblinSelfGoodsCategoryVo> selfGoodsCategoryVos = goblinStoreMgtExtraService.listCategoryVo();
List<GoblinStoreMgtGoodsListVo> list = goodsListVoPagedResult.getList();
list.forEach(r -> {
String cateFid = r.getCateFid(), cateSid = r.getCateSid(), cateTid = r.getCateTid();
List<GoblinSelfGoodsCategoryVo> categoryVoList = selfGoodsCategoryVos.stream()
.filter(cr -> Arrays.asList(cateFid, cateSid, cateTid).contains(cr.getCateId())).collect(Collectors.toList());
categoryVoList.forEach(cr -> {
if (cr.getCateId().equals(cateFid)) {
r.setCateFid(cr.getName());
}
if (cr.getCateId().equals(cateSid)) {
r.setCateFid(cr.getName());
}
if (cr.getCateId().equals(cateSid)) {
r.setCateFid(cr.getName());
}
});
});
goodsListVoPagedResult.setList(list);
}
return goodsListVoPagedResult;
}
@Override
......@@ -67,14 +90,14 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
if (null == mgtCategorySpecVoCache) {// 根据分类ID未查取到规格信息,则Cache、数据库新增
GoblinMgtCategorySpecVo initMgtCategorySpecVo = GoblinMgtCategorySpecVo.getNew().setCateId(filterCateId).setSpecNameList(addSpecNameList);
goblinMongoUtils.setCategorySpecVo(initMgtCategorySpecVo);
// goblinRedisUtils.setCategorySpec(filterCateId, initMgtCategorySpecVo);// TODO: 2022/1/19 zhanggb==
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);// TODO: 2022/1/19 zhanggb==
goblinRedisUtils.setCategorySpec(filterCateId, mgtCategorySpecVoCache);
confirmAddSpecNameList.forEach(r -> initGoodsCategorySpecObjs.add(new Object[]{filterCateId, r}));
}
}
......@@ -142,8 +165,8 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
goodsInfoVo.getServiceSupportVoList().forEach(ssvo -> initGoodsServiceSupportObjs.add(new Object[]{spuId, ssvo.getSsid()}));
}
toMqSqls.add(SqlMapping.get("goblin_goods_spec.insert_by_ignore"));
toMqSqls.add(SqlMapping.get("goblin_goods_spec_value.insert_by_ignore"));
LinkedList<Object[]> initGoodsSpecObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spec_value.insert_by_ignore"));
LinkedList<Object[]> initGoodsSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.insert_by_ignore"));// SPU规格信息
LinkedList<Object[]> initGoodsSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
......@@ -189,42 +212,119 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
@Override
public boolean goodsEditSpu(GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) {
GoblinGoodsInfoVo editGoodsSkuInfoVo = storeMgtGoodsAddParam.initEditGoodsInfoVo();
if (goblinMongoUtils.updateGoodsInfoVo(editGoodsSkuInfoVo)) {
public boolean goodsEditSpu(String uid, GoblinStoreMgtGoodsAddParam storeMgtGoodsAddParam) {
GoblinGoodsInfoVo updateSpuInfoVo = storeMgtGoodsAddParam.initEditGoodsInfoVo();
updateSpuInfoVo.setUpdatedBy(uid);
updateSpuInfoVo.setUpdatedAt(LocalDateTime.now());
if (goblinMongoUtils.updateGoodsInfoVo(updateSpuInfoVo)) {
GoblinGoodsSkuInfoVo updateSkuInfoVo = GoblinGoodsSkuInfoVo.getNew();
updateSkuInfoVo.setSpuId(editGoodsSkuInfoVo.getSpuId());
updateSkuInfoVo.setSkuNo(editGoodsSkuInfoVo.getSpuNo());
updateSkuInfoVo.setName(editGoodsSkuInfoVo.getName());
updateSkuInfoVo.setSubtitle(editGoodsSkuInfoVo.getSubtitle());
updateSkuInfoVo.setVirtualFlg(editGoodsSkuInfoVo.getVirtualFlg());
updateSkuInfoVo.setLogisticsTemplate(editGoodsSkuInfoVo.getLogisticsTemplate());
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());
goblinMongoUtils.updateGoodsSkuInfoVoBySpuId(updateSkuInfoVo);
// TODO: 2022/1/5 zhanggb redis+sql
goblinRedisUtils.delGoodsInfoVo(updateSpuInfoVo.getSpuId());
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_edit"));
LinkedList<Object[]> updateGoodsInfoObjs = CollectionUtil.linkedListObjectArr();
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.getSpuId()
});
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit_spu"));
LinkedList<Object[]> updateGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
updateGoodsSkuObjs.add(new Object[]{
updateSkuInfoVo.getSkuNo(), updateSkuInfoVo.getVirtualFlg(), updateSkuInfoVo.getLogisticsTemplate(),
updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(), updateSkuInfoVo.getSpuId()
});
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsInfoObjs, updateGoodsSkuObjs));
return true;
}
return false;
}
@Override
public boolean goodsEditSku(String uid, GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo) {
GoblinGoodsSkuInfoVo editGoodsSkuInfoVo = storeMgtGoodsEditSkuParam.initEditGoodsSkuInfoVo();
editGoodsSkuInfoVo.setUpdatedBy(uid);
editGoodsSkuInfoVo.setUpdatedAt(LocalDateTime.now());
if (goblinMongoUtils.updateGoodsSkuInfoVo(editGoodsSkuInfoVo)) {
public boolean goodsEditSku(String uid, GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo,
Map<String, String> updateSpuSpecMap, boolean beUpdateSpuSpecFlg) {
GoblinGoodsSkuInfoVo updateSkuInfoVo = storeMgtGoodsEditSkuParam.initEditGoodsSkuInfoVo();
updateSkuInfoVo.setUpdatedBy(uid);
updateSkuInfoVo.setUpdatedAt(LocalDateTime.now());
if (goblinMongoUtils.updateGoodsSkuInfoVo(updateSkuInfoVo)) {
String skuId = updateSkuInfoVo.getSkuId();
String spuId = goodsInfoVo.getSpuId();
Integer operStock = storeMgtGoodsEditSkuParam.getOperStock();
if (null != operStock && operStock != 0) {
goblinRedisUtils.setSkuStock(null, editGoodsSkuInfoVo.getSkuId(), editGoodsSkuInfoVo.getSkuStock());
goblinRedisUtils.setSkuStock(null, skuId, updateSkuInfoVo.getSkuStock());
}
goblinRedisUtils.delGoodsSkuInfoVo(skuId);
LinkedList<Object[]> updateSkuSpecValueObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> initSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> delSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> updateSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
if (beUpdateSpuSpecFlg) {
List<GoblinGoodsSpecVo> specVoList = goodsInfoVo.getSpecVoList();
for (GoblinGoodsSpecVo specVo : specVoList) {
List<GoblinGoodsSpecValueVo> specValues = specVo.getSpecValues();
specValues.sort(Comparator.comparing(GoblinGoodsSpecValueVo::getSpecVsort));
for (int i = 0; i < specValues.size(); i++) {
GoblinGoodsSpecValueVo specValueVo = specValues.get(i);
specValueVo.setSpecVsort(i);
updateSpuSpecValueObjs.add(new Object[]{i, spuId, specVo.getSpecName(), specValueVo.getSpecVname()});
}
}
List<GoblinGoodsSpecDto> skuSpecList = storeMgtGoodsEditSkuParam.getSkuSpecList();
skuSpecList.forEach(spec -> {
String specName = spec.getSpecName(), specVname = spec.getSpecVname();
GoblinGoodsSpecVo specVo = specVoList.stream().filter(r -> r.getSpecName().equals(specName)).findAny().get();
GoblinGoodsSpecValueVo specValueVo = specVo.getSpecValues().stream().filter(rv -> rv.getSpecVname().equals(specVname)).findAny().get();
initSpuSpecValueObjs.add(new Object[]{spuId, specName, specVname, specValueVo.getSpecVsort()});
});
if (!CollectionUtils.isEmpty(updateSpuSpecMap)) {// 更改了规格,需要同步SPU里的规格信息
goodsInfoVo.setUpdatedBy(uid);
goodsInfoVo.setUpdatedAt(updateSkuInfoVo.getUpdatedAt());
goblinMongoUtils.updateGoodsInfoVo(goodsInfoVo);
goblinRedisUtils.delGoodsInfoVo(spuId);
if (!CollectionUtils.isEmpty(storeMgtGoodsEditSkuParam.getSkuSpecList())) {// 更改了规格,需要同步SPU里的规格信息
goodsInfoVo.setUpdatedBy(uid);
goodsInfoVo.setUpdatedAt(editGoodsSkuInfoVo.getUpdatedAt());
goblinMongoUtils.updateGoodsInfoVo(goodsInfoVo);
updateSpuSpecMap.forEach((k, v) -> delSpuSpecValueObjs.add(new Object[]{spuId, k, v}));
}
}
// TODO: 2022/1/5 zhanggb redis+sql
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_edit"));
LinkedList<Object[]> updateGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
updateGoodsSkuObjs.add(new Object[]{
updateSkuInfoVo.getSkuPic(), updateSkuInfoVo.getSellPrice(), updateSkuInfoVo.getPrice(), updateSkuInfoVo.getPriceMember(),
updateSkuInfoVo.getWeight(), updateSkuInfoVo.getStock(), updateSkuInfoVo.getSkuStock(), updateSkuInfoVo.getWarningStock(),
updateSkuInfoVo.getSkuAppear(), updateSkuInfoVo.getSkuIsbn(), updateSkuInfoVo.getBuyFactor(), updateSkuInfoVo.getBuyRoster(),
updateSkuInfoVo.getBuyLimit(), updateSkuInfoVo.getSkuValidity(), updateSkuInfoVo.getUpdatedBy(), updateSkuInfoVo.getUpdatedAt(),
skuId
});
toMqSqls.add(SqlMapping.get("goblin_goods_sku_spec_value.update_by_edit"));
// LinkedList<Object[]> updateSkuSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.insert_by_ignore"));
// LinkedList<Object[]> initSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.update_by_editdel"));
// LinkedList<Object[]> delSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.update_by_edit"));
// LinkedList<Object[]> updateSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, updateGoodsSkuObjs, updateSkuSpecValueObjs, initSpuSpecValueObjs, delSpuSpecValueObjs));
return true;
}
......@@ -232,49 +332,89 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
}
@Override
public void goodsEditSkuAdd(GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo) {
String spuId = storeMgtGoodsEditSkuParam.getSpuId();
String uid = CurrentUtil.getCurrentUid();
public void goodsEditSkuAdd(String uid, GoblinStoreMgtGoodsEditSkuParam storeMgtGoodsEditSkuParam, GoblinGoodsInfoVo goodsInfoVo) {
LocalDateTime now = LocalDateTime.now();
String spuId = storeMgtGoodsEditSkuParam.getSpuId();
String skuId = spuId.concat(StringUtils.right(String.valueOf(System.nanoTime()), 5));
GoblinGoodsSkuInfoVo addGoodsSkuInfoVo = storeMgtGoodsEditSkuParam.initEditAddGoodsSkuInfoVo();
addGoodsSkuInfoVo.setSkuId(spuId.concat(StringUtils.right(String.valueOf(System.nanoTime()), 5)));
addGoodsSkuInfoVo.setSpuId(spuId);
addGoodsSkuInfoVo.setSkuNo(goodsInfoVo.getSpuNo());
addGoodsSkuInfoVo.setName(goodsInfoVo.getName());
addGoodsSkuInfoVo.setSubtitle(goodsInfoVo.getSubtitle());
addGoodsSkuInfoVo.setVirtualFlg(goodsInfoVo.getVirtualFlg());
addGoodsSkuInfoVo.setStatus("3");
addGoodsSkuInfoVo.setShelvesStatus(goodsInfoVo.getShelvesStatus());
addGoodsSkuInfoVo.setDelFlg("0");
addGoodsSkuInfoVo.setCreatedAt(now);
addGoodsSkuInfoVo.setCreatedBy(uid);
addGoodsSkuInfoVo.setLogisticsTemplate(goodsInfoVo.getLogisticsTemplate());
goblinMongoUtils.setGoodsSkuInfoVo(addGoodsSkuInfoVo);
GoblinGoodsSkuInfoVo addSkuInfoVo = storeMgtGoodsEditSkuParam.initEditAddGoodsSkuInfoVo();
addSkuInfoVo.setSkuId(skuId);
addSkuInfoVo.setSpuId(spuId);
addSkuInfoVo.setSkuNo(goodsInfoVo.getSpuNo());
addSkuInfoVo.setName(goodsInfoVo.getName());
addSkuInfoVo.setSubtitle(goodsInfoVo.getSubtitle());
addSkuInfoVo.setVirtualFlg(goodsInfoVo.getVirtualFlg());
addSkuInfoVo.setStatus("3");
addSkuInfoVo.setShelvesStatus(goodsInfoVo.getShelvesStatus());
addSkuInfoVo.setDelFlg("0");
addSkuInfoVo.setCreatedAt(now);
addSkuInfoVo.setCreatedBy(uid);
addSkuInfoVo.setLogisticsTemplate(goodsInfoVo.getLogisticsTemplate());
goblinMongoUtils.setGoodsSkuInfoVo(addSkuInfoVo);
List<String> skuIdList = goodsInfoVo.getSkuIdList();
skuIdList.add(addGoodsSkuInfoVo.getSkuId());
skuIdList.add(addSkuInfoVo.getSkuId());
goodsInfoVo.setSkuIdList(skuIdList);
goblinMongoUtils.updateGoodsInfoVo(goodsInfoVo);
goblinRedisUtils.delGoodsSkuInfoVo(spuId);
// TODO: 2022/1/5 zhanggb redis+sql
goblinRedisUtils.setSkuStock(null, addGoodsSkuInfoVo.getSkuId(), addGoodsSkuInfoVo.getSkuStock());
goblinRedisUtils.setSkuStock(null, addSkuInfoVo.getSkuId(), addSkuInfoVo.getSkuStock());
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods_sku.insert"));
LinkedList<Object[]> initGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
initGoodsSkuObjs.add(new Object[]{
addSkuInfoVo.getSkuId(), addSkuInfoVo.getSpuId(), addSkuInfoVo.getSkuNo(), addSkuInfoVo.getName(), addSkuInfoVo.getSubtitle(),
addSkuInfoVo.getSellPrice(), addSkuInfoVo.getSkuPic(), addSkuInfoVo.getSkuIsbn(), addSkuInfoVo.getStock(), addSkuInfoVo.getSkuStock(),
addSkuInfoVo.getWarningStock(), addSkuInfoVo.getPrice(), addSkuInfoVo.getPriceMember(), addSkuInfoVo.getWeight(), addSkuInfoVo.getBuyFactor(),
addSkuInfoVo.getBuyRoster(), addSkuInfoVo.getBuyLimit(), addSkuInfoVo.getStoreId(), addSkuInfoVo.getSkuValidity(), addSkuInfoVo.getVirtualFlg(),
addSkuInfoVo.getStatus(), addSkuInfoVo.getShelvesStatus(), addSkuInfoVo.getSkuAppear(), addSkuInfoVo.getShelvesAt(), uid,
now, addSkuInfoVo.getLogisticsTemplate()
});
toMqSqls.add(SqlMapping.get("goblin_goods_spec.insert_by_ignore"));
LinkedList<Object[]> initGoodsSpecObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spec_value.insert_by_ignore"));
LinkedList<Object[]> initGoodsSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.insert_by_ignore"));// SPU规格信息
LinkedList<Object[]> initGoodsSpuSpecValueObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_sku_spec_value.insert_by_ignore"));// SKU规格信息
LinkedList<Object[]> initGoodsSkuSpecValueObjs = CollectionUtil.linkedListObjectArr();
addSkuInfoVo.getSkuSpecList().forEach(skuSpecDto -> initGoodsSkuSpecValueObjs.add(new Object[]{
spuId, skuId, skuSpecDto.getSpecName(), skuSpecDto.getSpecVname()
}));
{// 规格记录
List<GoblinGoodsSpecVo> specVoList = goodsInfoVo.getSpecVoList();
specVoList.forEach(s -> {
initGoodsSpecObjs.add(new Object[]{s.getSpecName(), now});
s.getSpecValues().forEach(sv -> {
initGoodsSpecValueObjs.add(new Object[]{s.getSpecName(), sv.getSpecVname(), now});
initGoodsSpuSpecValueObjs.add(new Object[]{spuId, s.getSpecName(), sv.getSpecVname(), sv.getSpecVsort()});
});
});
}
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, initGoodsSkuObjs, initGoodsSkuSpecValueObjs, initGoodsSpecObjs,
initGoodsSpecValueObjs, initGoodsSpuSpecValueObjs, initGoodsSkuSpecValueObjs)
);
}
@Override
public boolean goodsEditSkuDel(GoblinGoodsSkuInfoVo goodsSkuInfoVo) {
String skuId = goodsSkuInfoVo.getSkuId();
public boolean goodsEditSkuDel(String uid, GoblinGoodsSkuInfoVo goodsSkuInfoVo) {
String spuId = goodsSkuInfoVo.getSpuId();
String delSkuId = goodsSkuInfoVo.getSkuId();
GoblinGoodsInfoVo mgtGoodsInfoVo = goblinRedisUtils.getMgtGoodsInfoVo(goodsSkuInfoVo.getSpuId());
List<String> skuIdList = mgtGoodsInfoVo.getSkuIdList();
skuIdList.removeIf(r -> r.equals(skuId));
mgtGoodsInfoVo.setSkuIdList(skuIdList);
GoblinGoodsInfoVo mgtGoodsInfoVo = goblinRedisUtils.getMgtGoodsInfoVo(spuId);
mgtGoodsInfoVo.getSkuIdList().removeIf(r -> r.equals(delSkuId));
List<GoblinGoodsSpecVo> specVoList = mgtGoodsInfoVo.getSpecVoList();
Map<String, String> delGoodsSkuSpecMap = goodsSkuInfoVo.getSkuSpecList().stream()
.collect(Collectors.toMap(GoblinGoodsSpecDto::getSpecName, GoblinGoodsSpecDto::getSpecVname, (k1, k2) -> k2));
.collect(Collectors.toMap(GoblinGoodsSpecDto::getSpecName, GoblinGoodsSpecDto::getSpecVname));
LinkedList<Object[]> updateGoodsSpuSpecObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> updateGoodsSpuSpecDelObjs = CollectionUtil.linkedListObjectArr();
for (int i = 0; i < specVoList.size(); i++) {// 处理商品规格信息
GoblinGoodsSpecVo specVo = specVoList.get(i);
List<GoblinGoodsSpecValueVo> modifySpecValues = ObjectUtil.getGoblinGoodsSpecValueVoArrayList();
......@@ -286,34 +426,72 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
if (specValue.getSpecVname().equals(delSpecVname)) {
modifySpecValues.remove(specValue);
rmIdx = specValue.getSpecVsort();
updateGoodsSpuSpecDelObjs.add(new Object[]{spuId, specVo.getSpecName(), delSpecVname});
} else {
modifySpecValues.add(specValue);
}
if (null != rmIdx && specValue.getSpecVsort() > rmIdx) {
specValue.setSpecVsort(specValue.getSpecVsort() - 1);
updateGoodsSpuSpecObjs.add(new Object[]{specValue.getSpecVsort(), spuId, specVo.getSpecName(), specValue.getSpecVname()});
}
}
if (modifySpecValues.size() == 0) {// 规格下规格值为0的时候,移除规格
specVoList.remove(specVo);
// specVoList.remove(specVo);
} else {
specVo.setSpecValues(modifySpecValues);
}
}
LocalDateTime now = LocalDateTime.now();
goodsSkuInfoVo.setUpdatedBy(uid);
goodsSkuInfoVo.setUpdatedAt(now);
goodsSkuInfoVo.setDeletedBy(uid);
goodsSkuInfoVo.setDeletedAt(now);
if (goblinMongoUtils.delGoodsSkuInfoVo(goodsSkuInfoVo)) {
goblinRedisUtils.delGoodsSkuInfoVo(delSkuId);
BigDecimal priceGe = BigDecimal.ZERO, priceLe = BigDecimal.ZERO;
for (String skuId : mgtGoodsInfoVo.getSkuIdList()) {
GoblinGoodsSkuInfoVo skuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId);
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;
}
mgtGoodsInfoVo.setUpdatedBy(uid);
mgtGoodsInfoVo.setUpdatedAt(now);
LinkedList<Object[]> updateGoodsInfoObjs = CollectionUtil.linkedListObjectArr();
if (priceGe.compareTo(mgtGoodsInfoVo.getPriceGe()) != 0 || priceLe.compareTo(mgtGoodsInfoVo.getPriceLe()) != 0) {
mgtGoodsInfoVo.setPriceGe(priceGe);
mgtGoodsInfoVo.setPriceLe(priceLe);
updateGoodsInfoObjs.add(new Object[]{priceGe, priceLe, uid, now, spuId});
}
goblinMongoUtils.updateGoodsInfoVo(mgtGoodsInfoVo);
goblinRedisUtils.delGoodsInfoVo(spuId);
goblinMongoUtils.delGoodsSkuInfoVo(skuId);
goblinRedisUtils.delGoodsSkuInfoVo(skuId);
// TODO: 2022/1/5 zhanggb redis+sql
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_del"));
LinkedList<Object[]> delGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
delGoodsSkuObjs.add(new Object[]{uid, now, uid, now, spuId, goodsSkuInfoVo.getStoreId()});
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.update_by_del_sku1"));
// LinkedList<Object[]> updateGoodsSpuSpecDelObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods_spu_spec_value.update_by_del_sku2"));
// LinkedList<Object[]> updateGoodsSpuSpecObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_del_sku"));
// LinkedList<Object[]> updateGoodsInfoObjs = CollectionUtil.linkedListObjectArr();
return goblinMongoUtils.updateGoodsInfoVo(mgtGoodsInfoVo);
}
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_GOODS.getKey(),
SqlMapping.gets(toMqSqls, delGoodsSkuObjs, updateGoodsSpuSpecDelObjs, updateGoodsSpuSpecObjs, updateGoodsInfoObjs));
@Override
public boolean goodsEditSkuBat(String spuId, String batField, String batFieldVal) {
// TODO: 2022/1/5 zhanggb
return true;
}
return false;
}
// @Override
// public boolean goodsEditSkuBat(String spuId, String batField, String batFieldVal) {
// return false;
// }
@Override
public void goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam storeMgtGoodsActionParam, String uid, boolean shelvesFlg) {
LocalDateTime now = LocalDateTime.now();
......@@ -322,7 +500,11 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
if (goblinMongoUtils.updateGoodsInfoVoByShelves(storeId, spuIdList, shelvesFlg, uid, now)) {
if (goblinMongoUtils.updateGoodsSkuInfoVoByShelves(storeId, spuIdList, shelvesFlg, uid, now)) {
// TODO: 2022/1/7 zhanggb redis
goblinRedisUtils.deleteKeyForSelectGoods();// 精选商品:商品上架、下架、删除 调用的方法
spuIdList.forEach(spuId -> goblinRedisUtils.delGoodsInfoVo(spuId));
List<String> skuIds = goblinMongoUtils.getMgtGoodsSkuIds(storeId, spuIdList);
skuIds.forEach(skuId -> goblinRedisUtils.delGoodsSkuInfoVo(skuId));
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_shelves"));
......@@ -348,7 +530,11 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
List<String> spuIdList = storeMgtGoodsActionParam.getSpuIdList();
if (goblinMongoUtils.delGoodsInfoVoBySpuIds(storeId, spuIdList, uid, now)) {
// TODO: 2022/1/7 zhanggb redis
goblinRedisUtils.deleteKeyForSelectGoods();// 精选商品:商品上架、下架、删除 调用的方法
spuIdList.forEach(spuId -> goblinRedisUtils.delGoodsInfoVo(spuId));
List<String> skuIdList = goblinMongoUtils.getMgtGoodsSkuIds(storeId, spuIdList);
skuIdList.forEach(skuId -> goblinRedisUtils.delGoodsSkuInfoVo(skuId));
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_del"));
......
......@@ -66,19 +66,41 @@ public class GoblinStoreMgtServiceImpl implements IGoblinStoreMgtService {
}
}
if (!CollectionUtils.isEmpty(updateStoreConfigVoList) && goblinMongoUtils.updateStoreConfigVos(updateStoreConfigVoList)) {
// goblinRedisUtils.setStoreConfigVos(storeId, storeConfigVos);// TODO: 2022/1/17 zhanggb==
// goblinRedisUtils.setStoreConfigVos(storeId, storeConfigVos);// TODO: 2022/1/17 zhanggb==redis
LinkedList<Object[]> updateStoreInfoObjs = CollectionUtil.linkedListObjectArr();
LinkedList<Object[]> updateGoodsInfoObjs = CollectionUtil.linkedListObjectArr();
if (toUpdateStoreStatusFlg) {
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVo(storeId);
storeInfoVo.setStatus(confMap.get(GoblinStoreConf.BUSINESS_STATUS.name()));
goblinMongoUtils.updateStoreInfoVo(storeInfoVo);
// goblinRedisUtils.setStoreInfoVo(storeInfoVo);// TODO: 2022/1/17 zhanggb==
String status = confMap.get(GoblinStoreConf.BUSINESS_STATUS.name());
GoblinStoreInfoVo updateStoreInfoVo = goblinRedisUtils.getStoreInfoVo(storeId);
updateStoreInfoVo.setStatus(status);
updateStoreInfoVo.setUpdatedBy(uid);
updateStoreInfoVo.setUpdatedAt(now);
goblinMongoUtils.updateStoreInfoVo(updateStoreInfoVo);
// goblinRedisUtils.setStoreInfoVo(updateStoreInfoVo);// TODO: 2022/1/17 zhanggb==redis
goblinMongoUtils.updateGoodsInfoVoAppear(storeId, status, now, uid);
List<String> spuIdList = goblinMongoUtils.getMgtGoodsSpuIds(storeId);
spuIdList.forEach(spuId -> goblinRedisUtils.delGoodsInfoVo(spuId));
updateStoreInfoObjs.add(new Object[]{updateStoreInfoVo.getStatus(), uid, now, storeId});
updateGoodsInfoObjs.add(new Object[]{status, uid, now, storeId});
}
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_store_config.update"));
LinkedList<Object[]> updateStoreConfigVoObjs = CollectionUtil.linkedListObjectArr();
updateStoreConfigVoList.forEach(uc -> updateStoreConfigVoObjs.add(new Object[]{uc.getConfigVal(), uc.getUpdatedBy(), uc.getUpdatedAt(), uc.getStoreId(), uc.getConfigKey()}));
updateStoreConfigVoList.forEach(uc -> updateStoreConfigVoObjs.add(new Object[]{
uc.getConfigVal(), uc.getUpdatedBy(), uc.getUpdatedAt(), uc.getStoreId(), uc.getConfigKey()}));
toMqSqls.add(SqlMapping.get("goblin_store_info.update_by_setting"));
// LinkedList<Object[]> updateStoreInfoObjs = CollectionUtil.linkedListObjectArr();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_status"));
// LinkedList<Object[]> updateGoodsInfoObjs = CollectionUtil.linkedListObjectArr();
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.get("goblin_store_config.update", updateStoreConfigVoObjs));
SqlMapping.gets(toMqSqls, updateStoreConfigVoObjs, updateStoreInfoObjs, updateGoodsInfoObjs));
return true;
}
return false;
......
......@@ -295,14 +295,14 @@ public class GoblinMongoUtils {
public boolean delGoodsInfoVoBySpuIds(String storeId, List<String> spuIdList, String uid, LocalDateTime time) {
return mongoTemplate.updateMulti(
Query.query(Criteria.where("store_id").is(storeId).and("spuId").in(spuIdList.toArray()).and("delFlg").is("0")),
Query.query(Criteria.where("storeId").is(storeId).and("spuId").in(spuIdList.toArray()).and("delFlg").is("0")),
Update.update("delFlg", 1).set("updatedBy", uid).set("updatedAt", time).set("deletedBy", uid).set("deletedAt", time),
GoblinGoodsInfoVo.class.getSimpleName()
).getModifiedCount() > 0;
}
public List<String> delGoodsInfoVoByStoreId(String storeId, String uid, LocalDateTime time) {
Query query = Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("shelves_status").is("3"));
Query query = Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("shelvesStatus").is("3"));
query.fields().include("spuId");
List<GoblinGoodsInfoVo> storeSpus = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
......@@ -320,7 +320,7 @@ public class GoblinMongoUtils {
}
// SPU分页
public PagedResult<GoblinStoreMgtGoodsListVo> getGoodsInfoVo(GoblinStoreMgtGoodsFilterParam filterParam) {
public PagedResult<GoblinStoreMgtGoodsListVo> getMgtGoodsInfoVos(GoblinStoreMgtGoodsFilterParam filterParam) {
Criteria criteria = Criteria.where("delFlg").is("0").and("storeId").is(filterParam.getStoreId()).and("marketId").exists(false);
if (StringUtils.isNotBlank(filterParam.getKeyword())) {
Pattern pattern = Pattern.compile("^.*" + filterParam.getKeyword() + ".*$", Pattern.CASE_INSENSITIVE);
......@@ -368,9 +368,27 @@ public class GoblinMongoUtils {
return pagedResult.setList(goodsListVos).setTotal(count, filterParam.getPageSize());
}
// SPU信息
public List<String> getMgtGoodsSpuIds(String storeId) {
Query query = Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0"));
query.fields().include("spuId");
List<GoblinGoodsInfoVo> vos = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
return CollectionUtils.isEmpty(vos) ? CollectionUtil.arrayListString()
: vos.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList());
}
// SKU信息
public List<String> getMgtGoodsSkuIds(String storeId, List<String> spuIdList) {
Query query = Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("spuId").in(spuIdList.toArray()));
query.fields().include("skuId");
List<GoblinGoodsSkuInfoVo> vos = mongoTemplate.find(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
return CollectionUtils.isEmpty(vos) ? CollectionUtil.arrayListString()
: vos.stream().map(GoblinGoodsSkuInfoVo::getSkuId).collect(Collectors.toList());
}
// SPU信息
public GoblinGoodsInfoVo getGoodsInfoVo(String spuId) {
return mongoTemplate.findOne(Query.query(Criteria.where("spuId").is(spuId).and("delFlg").is("0").and("shelvesStatus").is("3")),
return mongoTemplate.findOne(Query.query(Criteria.where("spuId").is(spuId).and("delFlg").is("0").and("shelvesStatus").is("3").and("spuAppear").is("0")),
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
}
......@@ -380,15 +398,28 @@ public class GoblinMongoUtils {
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
}
// SPU信息
public GoblinGoodsInfoVo getMgtGoodsInfoVo(String storeId, String name) {
return mongoTemplate.findOne(Query.query(Criteria.where("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
}
// SPU信息
public boolean updateGoodsInfoVo(GoblinGoodsInfoVo vo) {
return mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName())
.updateOne(
return mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("spuId").is(vo.getSpuId()).and("delFlg").is("0")).getQueryObject(),
ObjectUtil.cloneBasicDBObject().append("$set", mongoConverter.convertToMongoType(vo))
).getModifiedCount() > 0;
}
// SPU信息
public boolean updateGoodsInfoVoAppear(String storeId, String spuAppear, LocalDateTime time, String uid) {
return mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0")).getQueryObject(),
Update.update("spuAppear", spuAppear).set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
).getModifiedCount() > 0;
}
public boolean updateGoodsInfoVoByShelves(String storeId, List<String> spuIdList, boolean shelvesFlg, String uid, LocalDateTime time) {
return mongoTemplate.updateMulti(Query.query(Criteria.where("storeId").is(storeId).and("spuId").in(spuIdList.toArray())),
Update.update("shelvesStatus", shelvesFlg ? "3" : "1").set("shelvesAt", time).set("updatedBy", uid).set("updatedAt", time),
......@@ -405,13 +436,16 @@ public class GoblinMongoUtils {
return (List<GoblinGoodsSkuInfoVo>) mongoTemplate.insert(vos, GoblinGoodsSkuInfoVo.class.getSimpleName());
}
public boolean delGoodsSkuInfoVo(String skuId) {
return mongoTemplate.remove(Query.query(Criteria.where("skuId").is(skuId).and("delFlg").is("0")),
GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName()).getDeletedCount() > 0;
public boolean delGoodsSkuInfoVo(GoblinGoodsSkuInfoVo vo) {
return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("skuId").is(vo.getSkuId()).and("delFlg").is("0")).getQueryObject(),
Update.update("updatedBy", vo.getUpdatedBy()).set("updatedAt", vo.getUpdatedAt())
.set("deletedBy", vo.getDeletedBy()).set("deletedAt", vo.getDeletedAt()).getUpdateObject()
).getModifiedCount() > 0;
}
public List<String> delGoodsSkuInfoVoByStoreId(String storeId, String uid, LocalDateTime time) {
Query query = Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("shelves_status").is("3"));
Query query = Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("shelvesStatus").is("3"));
query.fields().include("skuId");
List<GoblinGoodsSkuInfoVo> storeSkus = mongoTemplate.find(query, GoblinGoodsSkuInfoVo.class, GoblinGoodsSkuInfoVo.class.getSimpleName());
......
......@@ -784,4 +784,9 @@ public class GoblinRedisUtils {
list.add(backOrderId);
redisUtil.set(redisKey, list);
}
//商品上架、下架、删除 调用的方法
public void deleteKeyForSelectGoods(){
redisUtil.del(GoblinRedisConst.SELECT_GOODS_SPUIDS);
redisUtil.del(GoblinRedisConst.SELECT_GOODS_PAGE1);
}
}
......@@ -18,11 +18,11 @@
149001=无效操作
149002=无权操作该店铺,请核实
149003=处理失败,请联系客服
149004=
149004=身份认证失败,请核实
149005=
149006=添加商品失败,规格信息无效
149007=商品分类名称重复,请核实
149008=
149007=添加商品失败,商品名称重复
149008=商品分类名称重复,请核实
149009=
149010=商品不存在,请核实
149011=SKU不存在,请核实
......
......@@ -4,6 +4,7 @@ goblin_store_info.update_by_cert1=UPDATE goblin_store_info SET store_type=?,cert
goblin_store_info.update_by_cert2=UPDATE goblin_store_info SET store_name=?,logo_pic=?,background_pic=?,introduce=?,status=?,store_type=?,updated_by=?,updated_at=? WHERE store_id=?
goblin_store_info.update_by_del=UPDATE goblin_store_info SET del_flg=1,updated_by=?,updated_at=? WHERE store_id=?
goblin_store_info.update_by_edit=UPDATE goblin_store_info SET store_name=?,logo_pic=?,background_pic=?,introduce=?,updated_by=?,updated_at=? WHERE store_id=?
goblin_store_info.update_by_setting=UPDATE goblin_store_info SET status=?,updated_by=?,updated_at=? WHERE store_id=? AND del_flg='0'
goblin_store_certification.insert_by_cert=INSERT INTO goblin_store_certification (store_id,person_cert_type,person_name,person_cert_code,person_cert_validity,person_cert_lasting,person_cert_fpic,person_cert_bpic,person_cert_spic,province_id,province_name,city_id,city_name,county_id,county_name,bus_address,bus_name,bus_cert_code,bus_cert_validity,bus_cert_lasting,bus_cert_pic,bus_quality_pic,created_by,created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_store_certification.update_by_cert=UPDATE goblin_store_certification SET person_cert_type=?,person_name=?,person_cert_code=?,person_cert_validity=?,person_cert_lasting=?,person_cert_fpic=?,person_cert_bpic=?,person_cert_spic=?,province_id=?,province_name=?,city_id=?,city_name=?,county_id=?,county_name=?,bus_address=?,bus_name=?,bus_cert_code=?,bus_cert_validity=?,bus_cert_lasting=?,bus_cert_pic=?,bus_quality_pic=?,updated_by=?,updated_at=? WHERE store_id=?
......@@ -27,17 +28,28 @@ goblin_goods_spec.insert_by_ignore=INSERT IGNORE INTO goblin_goods_spec (spec_na
goblin_goods_spec_value.insert_by_ignore=INSERT IGNORE INTO goblin_goods_spec_value (spec_name,spec_vname,created_by,created_at)VALUES(?,?,'-',?)
#---- 商品关联规格信息
goblin_goods_spu_spec_value.insert_by_ignore=INSERT IGNORE INTO goblin_goods_spu_spec_value (spu_id,spec_name,spec_vname,sort)VALUES(?,?,?,?)
goblin_goods_spu_spec_value.update_by_editdel=UPDATE goblin_goods_spu_spec_value SET del_flg='1' WHERE spu_id=? AND spec_name=? AND spec_vname=? AND del_flg='0'
goblin_goods_spu_spec_value.update_by_edit=UPDATE goblin_goods_spu_spec_value SET sort=? WHERE spu_id=? AND spec_name=? AND spec_vname=? AND del_flg='0'
goblin_goods_spu_spec_value.update_by_del_sku1=UPDATE goblin_goods_spu_spec_value SET del_flg='1' WHERE spu_id=? AND spec_name=? AND spec_vname=?
goblin_goods_spu_spec_value.update_by_del_sku2=UPDATE goblin_goods_spu_spec_value SET sort=? WHERE spu_id=? AND spec_name=? AND spec_vname=?
goblin_goods_sku_spec_value.insert_by_ignore=INSERT IGNORE INTO goblin_goods_sku_spec_value (spu_id,sku_id,spec_name,spec_vname)VALUES(?,?,?,?)
goblin_goods_sku_spec_value.update_by_edit=UPDATE goblin_goods_sku_spec_value SET spec_vname=? WHERE sku_id=? AND spec_name=? AND del_flg='0'
goblin_goods_sku_spec_value.update_by_del=UPDATE goblin_goods_sku_spec_value SET del_flg='1' WHERE sku_id=? AND del_flg='0'
#---- 商品信息
goblin_goods.insert=INSERT INTO goblin_goods (spu_id,spu_no,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods.update_by_edit=UPDATE goblin_goods SET spu_no=?,name=?,subtitle=?,sell_price=?,intro=?,details=?,cover_pic=?,video=?,spec_mode=?,cate_fid=?,cate_sid=?,cate_tid=?,shelves_handle=?,shelves_time=?,spu_validity=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_shelves=UPDATE goblin_goods SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND spu_appear='0'
goblin_goods.update_by_del_store=UPDATE goblin_goods SET del_flg=1,updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=?
goblin_goods.update_by_del=UPDATE goblin_goods SET del_flg=1,updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND store_id=?
goblin_goods.update_by_status=UPDATE goblin_goods SET spu_appear=?,updated_by=?,updated_at=? WHERE store_id=? AND del_flg='0'
goblin_goods.update_by_del_sku=UPDATE goblin_goods SET price_ge=?,price_le=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_del_store=UPDATE goblin_goods SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=?
goblin_goods.update_by_del=UPDATE goblin_goods SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND store_id=?
goblin_goods_sku.insert=INSERT INTO goblin_goods_sku (sku_id,spu_id,sku_no,name,subtitle, sell_price,sku_pic,sku_isbn,stock,sku_stock, warning_stock,price,price_member,weight,buy_factor, buy_roster,buy_limit,store_id,sku_validity,virtual_flg, status,shelves_status,sku_appear,shelves_at,created_by, created_at,logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET 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_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 spu_id=? AND store_id=? AND sku_appear='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=?
goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg=1,updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND store_id=?
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=?
goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND store_id=?
goblin_goods_image.insert=INSERT INTO goblin_goods_image (spu_id,url)VALUES(?,?)
goblin_goods_tag.insert=insert into goblin_goods_tag (spu_id,tag_id,sort,tag_belong)VALUES(?,?,?,?)
......
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