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

Commit 830666c8 authored by 胡佳晨's avatar 胡佳晨

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

parents cae93ec2 2abc5710
...@@ -42,4 +42,6 @@ public class GoblinStoreMgtGoodsListVo implements Serializable, Cloneable { ...@@ -42,4 +42,6 @@ public class GoblinStoreMgtGoodsListVo implements Serializable, Cloneable {
private Integer totalStock; private Integer totalStock;
@ApiModelProperty(position = 24, value = "剩余库存") @ApiModelProperty(position = 24, value = "剩余库存")
private Integer surplusStock; private Integer surplusStock;
@ApiModelProperty(position = 25, value = "库存不足预警值")
private Integer warningStock;
} }
...@@ -114,12 +114,12 @@ ...@@ -114,12 +114,12 @@
width: '100', width: '100',
align: 'center' align: 'center'
}, },
{ // {
field: 'bindType', // field: 'bindType',
title: '其他活动占用库存', // title: '其他活动占用库存',
width: '120', // width: '120',
align: 'center' // align: 'center'
}, // },
{ {
field: 'priceMarketing', field: 'priceMarketing',
// title: `线下售价<a onclick="setPrice(1)">批量</a>`, // title: `线下售价<a onclick="setPrice(1)">批量</a>`,
...@@ -144,25 +144,44 @@ ...@@ -144,25 +144,44 @@
} }
}, },
{ {
field: 'buyRoster', field: 'buyLimit',
// title: '用户限购<a onclick="setPrice(3)">批量</a>', // title: '用户限购<a onclick="setPrice(3)">批量</a>',
title: '用户限购', title: '用户限购',
width: '150', width: '150',
align: 'center' align: 'center',
formatter: function (value, row) {
if (value == 0) {
return '无限制'
} else {
return value
}
}
}, },
{ {
field: 'buyFactor',
title: '购买条件', title: '购买条件',
align: 'center', align: 'center',
align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
return `<div style="display:flex;"> if (value == 0) {
return `<div style="display:flex;">
<label style="margin-right:12px;"> <label style="margin-right:12px;">
<input type="radio" checked value="1" id="optionsRadios1" name="optionsRadios${index}"><span>全部用户</span></label> <input type="radio" checked value="1" id="optionsRadios1" name="optionsRadios${index}"><span>全部用户</span></label>
<label style="margin-right:12px;"> <label style="margin-right:12px;">
<input type="radio" value="2" id="optionsRadios1" name="optionsRadios${index}"><span>仅支持会员购买</span></label> <input type="radio" value="2" id="optionsRadios1" name="optionsRadios${index}"><span>仅支持会员购买</span></label>
<label style="margin-right:12px;"> <label style="margin-right:12px;">
<input type="radio" value="3" id="optionsRadios1" name="optionsRadios${index}"><span>指定用户购买</span></label> <input type="radio" value="3" id="optionsRadios1" name="optionsRadios${index}"><span>指定用户购买</span></label>
</div>` </div>`
} else {
return `<div style="display:flex;">
<label style="margin-right:12px;">
<input type="radio" value="1" id="optionsRadios1" name="optionsRadios${index}"><span>全部用户</span></label>
<label style="margin-right:12px;">
<input type="radio" checked value="2" id="optionsRadios1" name="optionsRadios${index}"><span>仅支持会员购买</span></label>
<label style="margin-right:12px;">
<input type="radio" value="3" id="optionsRadios1" name="optionsRadios${index}"><span>指定用户购买</span></label>
</div>`
}
} }
} }
] ]
......
...@@ -158,10 +158,10 @@ ...@@ -158,10 +158,10 @@
</div> </div>
</div> </div>
<div class="content_footer"> <!-- <div class="content_footer">
<button class="btn btn-primary">保存</button> <button class="btn btn-primary">保存</button>
<button class="btn" style="margin: 0 12px">取消</button> <button class="btn" style="margin: 0 12px">取消</button>
</div> </div> -->
</form> </form>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
</body> </body>
......
...@@ -19,7 +19,7 @@ public interface IGoblinSelfTagService extends IService<GoblinSelfTag> { ...@@ -19,7 +19,7 @@ public interface IGoblinSelfTagService extends IService<GoblinSelfTag> {
boolean editSave(GoblinSelfTag selfTag); boolean editSave(GoblinSelfTag selfTag);
boolean remove(String[] tagIdArr, String tagBelong); boolean remove(Object[] tagIdArr, String tagBelong);
List<GoblinSelfTag> countsForList(List<String> tagIds); List<GoblinSelfTag> countsForList(List<String> tagIds);
} }
...@@ -11,8 +11,10 @@ import com.liquidnet.commons.lang.util.JsonUtils; ...@@ -11,8 +11,10 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst; import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo; import com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo;
import com.liquidnet.service.goblin.entity.GoblinGoodsArtag;
import com.liquidnet.service.goblin.entity.GoblinGoodsTag; import com.liquidnet.service.goblin.entity.GoblinGoodsTag;
import com.liquidnet.service.goblin.entity.GoblinSelfTag; import com.liquidnet.service.goblin.entity.GoblinSelfTag;
import com.liquidnet.service.goblin.mapper.GoblinGoodsArtagMapper;
import com.liquidnet.service.goblin.mapper.GoblinGoodsTagMapper; import com.liquidnet.service.goblin.mapper.GoblinGoodsTagMapper;
import com.liquidnet.service.goblin.mapper.GoblinSelfTagMapper; import com.liquidnet.service.goblin.mapper.GoblinSelfTagMapper;
import com.mongodb.client.result.UpdateResult; import com.mongodb.client.result.UpdateResult;
...@@ -48,6 +50,8 @@ public class GoblinSelfTagServiceImpl extends ServiceImpl<GoblinSelfTagMapper, G ...@@ -48,6 +50,8 @@ public class GoblinSelfTagServiceImpl extends ServiceImpl<GoblinSelfTagMapper, G
private GoblinSelfTagMapper goblinSelfTagMapper; private GoblinSelfTagMapper goblinSelfTagMapper;
@Autowired @Autowired
private GoblinGoodsTagMapper goblinGoodsTagMapper; private GoblinGoodsTagMapper goblinGoodsTagMapper;
@Autowired
private GoblinGoodsArtagMapper goblinGoodsArtagMapper;
@Transactional @Transactional
@Override @Override
...@@ -123,7 +127,7 @@ public class GoblinSelfTagServiceImpl extends ServiceImpl<GoblinSelfTagMapper, G ...@@ -123,7 +127,7 @@ public class GoblinSelfTagServiceImpl extends ServiceImpl<GoblinSelfTagMapper, G
@Transactional @Transactional
@Override @Override
public boolean remove(String[] tagIdArr, String tagBelong) { public boolean remove(Object[] tagIdArr, String tagBelong) {
boolean rmvResultFlg = this.update(Wrappers.lambdaUpdate(GoblinSelfTag.class) boolean rmvResultFlg = this.update(Wrappers.lambdaUpdate(GoblinSelfTag.class)
.in(GoblinSelfTag::getTagId, tagIdArr) .in(GoblinSelfTag::getTagId, tagIdArr)
.eq(GoblinSelfTag::getTagBelong, tagBelong) .eq(GoblinSelfTag::getTagBelong, tagBelong)
...@@ -147,22 +151,34 @@ public class GoblinSelfTagServiceImpl extends ServiceImpl<GoblinSelfTagMapper, G ...@@ -147,22 +151,34 @@ public class GoblinSelfTagServiceImpl extends ServiceImpl<GoblinSelfTagMapper, G
redisGoblinUtil.del(GoblinRedisConst.BASIC_SELF_EXTAG); redisGoblinUtil.del(GoblinRedisConst.BASIC_SELF_EXTAG);
try { try {
GoblinGoodsTag updateRelateGoods = new GoblinGoodsTag(); int updateGoodsTagCount = -1, updateGoodsArtagCount = -1;
updateRelateGoods.setDelFlg("1"); GoblinGoodsTag updateGoodsTag = new GoblinGoodsTag();
int updateRelateGoodsCount = goblinGoodsTagMapper.update(updateRelateGoods, Wrappers.lambdaUpdate(GoblinGoodsTag.class) updateGoodsTag.setDelFlg("1");
updateGoodsTagCount = goblinGoodsTagMapper.update(updateGoodsTag, Wrappers.lambdaUpdate(GoblinGoodsTag.class)
.in(GoblinGoodsTag::getTagId, tagIdArr).eq(GoblinGoodsTag::getTagBelong, tagBelong).eq(GoblinGoodsTag::getDelFlg, "0")); .in(GoblinGoodsTag::getTagId, tagIdArr).eq(GoblinGoodsTag::getTagBelong, tagBelong).eq(GoblinGoodsTag::getDelFlg, "0"));
//
boolean isTagVoListFlg = tagBelong.equals("0");
if (!isTagVoListFlg) {
GoblinGoodsArtag updateGoodsArtag = new GoblinGoodsArtag();
updateGoodsArtag.setDelFlg("1");
updateGoodsArtagCount = goblinGoodsArtagMapper.update(updateGoodsArtag, Wrappers.lambdaUpdate(GoblinGoodsArtag.class)
.in(GoblinGoodsArtag::getTagId, tagIdArr).eq(GoblinGoodsArtag::getTagBelong, tagBelong).eq(GoblinGoodsArtag::getDelFlg, "0"));
}
String subDocName = tagBelong.equals("0") ? "tagVoList" : "extagVoList"; Query query = Query.query(isTagVoListFlg ? Criteria.where("tagVoList.tagId").in(tagIdArr) :
Query query = Query.query(Criteria.where(subDocName.concat(".tagId")).in(tagIdArr)); new Criteria().orOperator(Criteria.where("extagVoList.tagId").in(tagIdArr), Criteria.where("artagVoList.tagId").in(tagIdArr)));
query.fields().include("spuId"); query.fields().include("spuId");
List<GoblinGoodsInfoVo> matchedGoodsInfoVoList = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); List<GoblinGoodsInfoVo> matchedGoodsInfoVoList = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
if (!CollectionUtils.isEmpty(matchedGoodsInfoVoList)) { if (!CollectionUtils.isEmpty(matchedGoodsInfoVoList)) {
List<String> matchedSpuIdList = matchedGoodsInfoVoList.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList()); List<String> matchedSpuIdList = matchedGoodsInfoVoList.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList());
Update update = isTagVoListFlg ? new Update().pull("tagVoList", Query.query(Criteria.where("tagId").in(tagIdArr))) :
new Update().pull("extagVoList", Query.query(Criteria.where("tagId").in(tagIdArr)))
.pull("artagVoList", Query.query(Criteria.where("tagId").in(tagIdArr)));
UpdateResult updateRelateGoodsResult = mongoTemplate.updateMulti(Query.query(Criteria.where("spuId").in(matchedSpuIdList)), UpdateResult updateRelateGoodsResult = mongoTemplate.updateMulti(Query.query(Criteria.where("spuId").in(matchedSpuIdList)),
new Update().pull(subDocName, Query.query(Criteria.where("tagId").in(tagIdArr))), update, GoblinGoodsInfoVo.class.getSimpleName());
GoblinGoodsInfoVo.class.getSimpleName()); log.info("店铺管理:标签管理:删除:MDB更新关联商品[匹配={},更新={},MYSQL更新:TAG={},ARTAG={}]",
log.info("店铺管理:标签管理:删除:MDB更新关联商品[匹配={},更新={},MYSQL更新={}]", updateRelateGoodsResult.getMatchedCount(), updateRelateGoodsResult.getModifiedCount(), updateGoodsTagCount, updateGoodsArtagCount);
updateRelateGoodsResult.getMatchedCount(), updateRelateGoodsResult.getModifiedCount(), updateRelateGoodsCount);
if (updateRelateGoodsResult.getModifiedCount() > 0) { if (updateRelateGoodsResult.getModifiedCount() > 0) {
matchedSpuIdList.forEach(spuId -> { matchedSpuIdList.forEach(spuId -> {
......
package com.liquidnet.service.goblin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 商品关联标签
* </p>
*
* @author liquidnet
* @since 2022-02-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinGoodsArtag implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 商品id
*/
private String spuId;
/**
* 标签id,对应 goblin_self_tag.tag_id
*/
private String tagId;
/**
* 排序[数值越小,排序越前]
*/
private Integer sort;
/**
* 标签所属[0-普通标签|1-专属标签]
*/
private String tagBelong;
/**
* 删除标记[0-未删除|1-删除]
*/
private String delFlg;
private String comment;
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.entity.GoblinGoodsArtag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 商品关联标签 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2022-02-25
*/
public interface GoblinGoodsArtagMapper extends BaseMapper<GoblinGoodsArtag> {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.goblin.mapper.GoblinGoodsArtagMapper">
</mapper>
...@@ -210,8 +210,7 @@ create table goblin_goods_service_support ...@@ -210,8 +210,7 @@ create table goblin_goods_service_support
comment varchar(255) comment varchar(255)
) engine = InnoDB comment '商品关联服务支持'; ) engine = InnoDB comment '商品关联服务支持';
create index idx_ggss_service_support_id on goblin_goods_service_support (ssid); create unique index uidx_ggss_spu_ssid on goblin_goods_service_support (spu_id, ssid);
create index idx_ggss_spu_id on goblin_goods_service_support (spu_id);
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
drop table if exists goblin_goods_tag; drop table if exists goblin_goods_tag;
create table goblin_goods_tag create table goblin_goods_tag
...@@ -225,8 +224,21 @@ create table goblin_goods_tag ...@@ -225,8 +224,21 @@ create table goblin_goods_tag
comment varchar(255) comment varchar(255)
) engine = InnoDB comment '商品关联标签'; ) engine = InnoDB comment '商品关联标签';
create index idx_ggt_tag_id on goblin_goods_tag (tag_id); create unique index uidx_ggt_spu_tag on goblin_goods_tag (spu_id, tag_id);
create index idx_ggt_spu_id on goblin_goods_tag (spu_id); # 临时添加用作商品关联现场AR标签
drop table if exists goblin_goods_artag;
create table goblin_goods_artag
(
mid bigint auto_increment primary key,
spu_id varchar(64) not null comment '商品id',
tag_id varchar(30) not null comment '标签id,对应 goblin_self_tag.tag_id',
sort int default 0 comment '排序[数值越小,排序越前]',
tag_belong char default '0' comment '标签所属[0-普通标签|1-专属标签]',
del_flg char default '0' comment '删除标记[0-未删除|1-删除]',
comment varchar(255)
) engine = InnoDB comment '商品关联标签';
create unique index uidx_gga_spu_tag on goblin_goods_artag (spu_id, tag_id);
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
drop table if exists goblin_goods_image; drop table if exists goblin_goods_image;
create table goblin_goods_image create table goblin_goods_image
...@@ -238,7 +250,7 @@ create table goblin_goods_image ...@@ -238,7 +250,7 @@ create table goblin_goods_image
comment varchar(255) comment varchar(255)
) engine = InnoDB comment '商品图片'; ) engine = InnoDB comment '商品图片';
create index idx_ggi_spu_id on goblin_goods_image (spu_id); create unique index uidx_ggi_spu_url on goblin_goods_image (spu_id, url);
# -- >>------------------------------------------------------------------------------------ # -- >>------------------------------------------------------------------------------------
drop table if exists goblin_goods; drop table if exists goblin_goods;
create table goblin_goods create table goblin_goods
......
...@@ -50,7 +50,7 @@ public class GoblinStoreMgtExtraServiceImpl implements IGoblinStoreMgtExtraServi ...@@ -50,7 +50,7 @@ public class GoblinStoreMgtExtraServiceImpl implements IGoblinStoreMgtExtraServi
serviceSupportVos.forEach(vo -> upsertServiceSupportObjs.add(new Object[]{vo.getSsid(), vo.getName(), vo.getDesc(), vo.getUrl()})); serviceSupportVos.forEach(vo -> upsertServiceSupportObjs.add(new Object[]{vo.getSsid(), vo.getName(), vo.getDesc(), vo.getUrl()}));
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.get("goblin_service_support.insert_by_replace", upsertServiceSupportObjs)); SqlMapping.get("goblin_service_support.insert_byreplace", upsertServiceSupportObjs));
} }
return serviceSupportVos; return serviceSupportVos;
} }
......
#---- 服务支持信息 #---- 服务支持信息
goblin_service_support.insert_by_replace=REPLACE INTO goblin_service_support (ssid,name,`desc`,url,created_by,created_at)VALUES(?,?,?,?,'-',sysdate()) goblin_service_support.insert_byreplace=REPLACE INTO goblin_service_support (ssid,name,`desc`,url,created_by,created_at)VALUES(?,?,?,?,'-',sysdate())
#---- 店铺信息 #---- 店铺信息
goblin_store_info.insert_by_cert=INSERT INTO goblin_store_info (store_id,uid,status,store_type,cert_type,created_by,created_at)VALUES(?,?,?,?,?,?,?) goblin_store_info.insert_by_cert=INSERT INTO goblin_store_info (store_id,uid,status,store_type,cert_type,created_by,created_at)VALUES(?,?,?,?,?,?,?)
goblin_store_info.update_by_cert1=UPDATE goblin_store_info SET store_type=?,cert_type=?,updated_by=?,updated_at=? WHERE store_id=? goblin_store_info.update_by_cert1=UPDATE goblin_store_info SET store_type=?,cert_type=?,updated_by=?,updated_at=? WHERE store_id=?
...@@ -50,10 +50,13 @@ goblin_goods_sku.update_by_edit_spu=UPDATE goblin_goods_sku SET sku_no=?,virtual ...@@ -50,10 +50,13 @@ goblin_goods_sku.update_by_edit_spu=UPDATE goblin_goods_sku SET sku_no=?,virtual
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_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_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=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_image.insert_byreplace=REPLACE 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(?,?,?,?) goblin_goods_image.delete=UPDATE goblin_goods_image SET del_flg='1' WHERE spu_id=? AND del_flg='0'
goblin_goods_tag.insert_byreplace=REPLACE INTO goblin_goods_tag (spu_id,tag_id,sort,tag_belong)VALUES(?,?,?,?)
goblin_goods_tag.delete=UPDATE goblin_goods_tag SET del_flg='1' WHERE spu_id=? AND tag_belong=? AND del_flg='0' goblin_goods_tag.delete=UPDATE goblin_goods_tag SET del_flg='1' WHERE spu_id=? AND tag_belong=? AND del_flg='0'
goblin_goods_service_support.insert=INSERT INTO goblin_goods_service_support (spu_id,ssid)VALUES(?,?) goblin_goods_artag.insert_byreplace=REPLACE INTO goblin_goods_tag (spu_id,tag_id,sort,tag_belong)VALUES(?,?,?,?)
goblin_goods_artag.delete=UPDATE goblin_goods_tag SET del_flg='1' WHERE spu_id=? AND tag_belong=? AND del_flg='0'
goblin_goods_service_support.insert_byreplace=REPLACE INTO goblin_goods_service_support (spu_id,ssid)VALUES(?,?)
goblin_goods_service_support.delete=UPDATE goblin_goods_service_support SET del_flg='1' WHERE spu_id=? AND del_flg='0' goblin_goods_service_support.delete=UPDATE goblin_goods_service_support SET del_flg='1' WHERE spu_id=? AND del_flg='0'
#---- 商铺活动 #---- 商铺活动
goblin.store.market.insert=INSERT INTO goblin_store_marketing (`store_market_id`,`name`,`type`,`status`,`store_id`,`start_time`,`end_time`,`del_flag`,`is_pre`,`pre_time`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?) goblin.store.market.insert=INSERT INTO goblin_store_marketing (`store_market_id`,`name`,`type`,`status`,`store_id`,`start_time`,`end_time`,`del_flag`,`is_pre`,`pre_time`,`created_at`) 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