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

Commit b40e2858 authored by 张国柄's avatar 张国柄

~API:藏品SKU管理;

parent d2de582d
package com.liquidnet.service.goblin.dto.manage; package com.liquidnet.service.goblin.dto.manage;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo; import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -90,6 +91,7 @@ public class GoblinStoreMgtDigitalGoodsAddParam implements Serializable { ...@@ -90,6 +91,7 @@ public class GoblinStoreMgtDigitalGoodsAddParam implements Serializable {
vo.setShelvesStatus("0"); vo.setShelvesStatus("0");
vo.setSpuAppear("1"); vo.setSpuAppear("1");
vo.setDelFlg("0"); vo.setDelFlg("0");
vo.setSkuIdList(CollectionUtil.linkedListString());
return vo; return vo;
} }
...@@ -101,6 +103,7 @@ public class GoblinStoreMgtDigitalGoodsAddParam implements Serializable { ...@@ -101,6 +103,7 @@ public class GoblinStoreMgtDigitalGoodsAddParam implements Serializable {
public GoblinGoodsInfoVo initEditGoodsInfoVo() { public GoblinGoodsInfoVo initEditGoodsInfoVo() {
GoblinGoodsInfoVo vo = GoblinGoodsInfoVo.getNew(); GoblinGoodsInfoVo vo = GoblinGoodsInfoVo.getNew();
vo.setSpuId(this.getSpuId()); vo.setSpuId(this.getSpuId());
vo.setSpuType(1);
vo.setName(this.getName()); vo.setName(this.getName());
vo.setIntro(this.getIntro()); vo.setIntro(this.getIntro());
vo.setCateFid(this.getCateFid()); vo.setCateFid(this.getCateFid());
......
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;
@ApiModel(value = "GoblinStoreMgtGoodsActionParam", description = "商品管理:商品列表操作入参")
@Data
public class GoblinStoreMgtGoodsSkuActionParam implements Serializable {
private static final long serialVersionUID = 6564996671833040261L;
@ApiModelProperty(position = 10, required = true, value = "店铺ID[64]")
@NotBlank(message = "店铺ID不能为空")
private String storeId;
@ApiModelProperty(position = 11, required = true, value = "商品ID[64]")
@NotBlank(message = "商品ID不能为空")
private String spuId;
@ApiModelProperty(position = 12, required = true, value = "操作类型[ONSHELVES-上架|UNSHELVE-下架|REMOVE-删除]")
@Pattern(regexp = "\\b(ONSHELVES|UNSHELVE|REMOVE)\\b", message = "操作类型无效")
private String action;
@ApiModelProperty(position = 13, required = true, value = "单品ID列表")
private List<String> skuIdList;
}
...@@ -17,6 +17,8 @@ public class GoblinStoreMgtGoodsListVo implements Serializable, Cloneable { ...@@ -17,6 +17,8 @@ public class GoblinStoreMgtGoodsListVo implements Serializable, Cloneable {
private String spuId; private String spuId;
@ApiModelProperty(position = 12, value = "商品编码[45]") @ApiModelProperty(position = 12, value = "商品编码[45]")
private String spuNo; private String spuNo;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]")
private int spuType;
@ApiModelProperty(position = 13, value = "封面图片地址[256]") @ApiModelProperty(position = 13, value = "封面图片地址[256]")
private String coverPic; private String coverPic;
@ApiModelProperty(position = 14, value = "商品名称[100]") @ApiModelProperty(position = 14, value = "商品名称[100]")
......
...@@ -11,9 +11,6 @@ import lombok.Data; ...@@ -11,9 +11,6 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
@ApiModel(value = "GoblinGoodsInfoVo", description = "商品SPU详情[不包含具体SKU,SKU详情参见'GoblinGoobsSkuInfoVo']") @ApiModel(value = "GoblinGoodsInfoVo", description = "商品SPU详情[不包含具体SKU,SKU详情参见'GoblinGoobsSkuInfoVo']")
...@@ -28,7 +25,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable { ...@@ -28,7 +25,7 @@ public class GoblinGoodsInfoVo implements Serializable, Cloneable {
@ApiModelProperty(position = 12, value = "商品编码[默认为系统编码,也可手动输入商家自己的编码]") @ApiModelProperty(position = 12, value = "商品编码[默认为系统编码,也可手动输入商家自己的编码]")
private String spuNo; private String spuNo;
@ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]") @ApiModelProperty(position = 12, value = "商品类型[0-常规|1-数字藏品]")
private Integer spuType; private int spuType;
@ApiModelProperty(position = 13, value = "商品名称[100]") @ApiModelProperty(position = 13, value = "商品名称[100]")
private String name; private String name;
@ApiModelProperty(position = 14, value = "商品副标题[128]") @ApiModelProperty(position = 14, value = "商品副标题[128]")
......
...@@ -136,6 +136,16 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -136,6 +136,16 @@ public interface IGoblinstoreMgtGoodsService {
*/ */
boolean goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, boolean shelvesFlg, List<String> spuNoList); boolean goodsShelvesProcessing(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, boolean shelvesFlg, List<String> spuNoList);
/**
* 商品管理:上下架商品-单品
*
* @param mgtGoodsSkuActionParam GoblinStoreMgtGoodsSkuActionParam
* @param uid UID
* @param shelvesFlg true:上架|false:下架
* @return boolean
*/
boolean goodsSkuShelvesProcessing(GoblinStoreMgtGoodsSkuActionParam mgtGoodsSkuActionParam, String uid, boolean shelvesFlg);
/** /**
* 商品管理:删除商品 * 商品管理:删除商品
* *
...@@ -145,4 +155,13 @@ public interface IGoblinstoreMgtGoodsService { ...@@ -145,4 +155,13 @@ public interface IGoblinstoreMgtGoodsService {
* @return boolean * @return boolean
*/ */
boolean goodsRemove(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, List<String> spuNoList); boolean goodsRemove(GoblinStoreMgtGoodsActionParam mgtGoodsActionParam, String uid, List<String> spuNoList);
/**
* 商品管理:删除商品-单品
*
* @param mgtGoodsSkuActionParam GoblinStoreMgtGoodsSkuActionParam
* @param uid UID
* @return boolean
*/
boolean goodsSkuRemove(GoblinStoreMgtGoodsSkuActionParam mgtGoodsSkuActionParam, String uid);
} }
...@@ -537,11 +537,11 @@ public class GoblinMongoUtils { ...@@ -537,11 +537,11 @@ public class GoblinMongoUtils {
return (List<GoblinGoodsSkuInfoVo>) mongoTemplate.insert(vos, GoblinGoodsSkuInfoVo.class.getSimpleName()); return (List<GoblinGoodsSkuInfoVo>) mongoTemplate.insert(vos, GoblinGoodsSkuInfoVo.class.getSimpleName());
} }
public boolean delGoodsSkuInfoVo(GoblinGoodsSkuInfoVo vo, List<String> skuIdList) { public boolean delGoodsSkuInfoVo(List<String> skuIdList, String operator, LocalDateTime time) {
return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany( return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("skuId").in(skuIdList).and("delFlg").is("0")).getQueryObject(), Query.query(Criteria.where("skuId").in(skuIdList).and("delFlg").is("0")).getQueryObject(),
Update.update("delFlg", "1").set("updatedBy", vo.getUpdatedBy()).set("updatedAt", vo.getUpdatedAt()) Update.update("delFlg", "1").set("updatedBy", operator).set("updatedAt", time)
.set("deletedBy", vo.getDeletedBy()).set("deletedAt", vo.getDeletedAt()).getUpdateObject() .set("deletedBy", operator).set("deletedAt", time).getUpdateObject()
).getModifiedCount() > 0; ).getModifiedCount() > 0;
} }
...@@ -639,6 +639,12 @@ public class GoblinMongoUtils { ...@@ -639,6 +639,12 @@ public class GoblinMongoUtils {
GoblinGoodsSkuInfoVo.class.getSimpleName()).getModifiedCount() > 0; GoblinGoodsSkuInfoVo.class.getSimpleName()).getModifiedCount() > 0;
} }
public boolean updateGoodsSkuInfoVoByShelvesSku(String storeId, List<String> skuIdList, boolean shelvesFlg, String uid, LocalDateTime time) {
return mongoTemplate.updateMulti(Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("skuId").in(skuIdList)),
Update.update("shelvesStatus", shelvesFlg ? "3" : "1").set("shelvesAt", time).set("updatedBy", uid).set("updatedAt", time),
GoblinGoodsSkuInfoVo.class.getSimpleName()).getModifiedCount() > 0;
}
/* ---------------------------------------- ---------------------------------------- */ /* ---------------------------------------- ---------------------------------------- */
/** /**
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
149004=身份认证失败,请核实 149004=身份认证失败,请核实
149005= 149005=
149006=添加商品失败,规格信息无效 149006=添加商品失败,规格信息无效
149007=添加商品失败,商品名称重复 149007=商品名称重复,请核实
149008=商品分类名称重复,请核实 149008=商品分类名称重复,请核实
149009=请点选商品后操作 149009=请点选商品后操作
149010=商品不存在或已删除,请核实 149010=商品不存在或已删除,请核实
......
...@@ -52,7 +52,7 @@ goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sel ...@@ -52,7 +52,7 @@ goblin_goods_sku.update_by_edit=UPDATE goblin_goods_sku SET name=?,sku_pic=?,sel
goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_ratio=?,buy_factor=?,buy_roster=?,buy_limit=?,shelves_handle=?,shelves_time=?,sale_start_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_edit_for_digital=UPDATE goblin_goods_sku SET hit_ratio=?,buy_factor=?,buy_roster=?,buy_limit=?,shelves_handle=?,shelves_time=?,sale_start_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0'
goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,subtitle=?,sku_pic=?,sku_watch=?,watch_type=?,price=?,price_member=?,intro=?,details=?,shelves_handle=?,shelves_time=?,sale_start_time=?,opening_time=?,updated_by=?,updated_at=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_edit_box_digital=UPDATE goblin_goods_sku SET name=?,subtitle=?,sku_pic=?,sku_watch=?,watch_type=?,price=?,price_member=?,intro=?,details=?,shelves_handle=?,shelves_time=?,sale_start_time=?,opening_time=?,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_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_shelves=UPDATE goblin_goods_sku SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND del_flg='0'
goblin_goods_sku.update_by_del_store=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=? AND del_flg='0' goblin_goods_sku.update_by_del_store=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE store_id=? AND del_flg='0'
goblin_goods_sku.update_by_del_spu=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND del_flg='0' goblin_goods_sku.update_by_del_spu=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE sku_id=? AND del_flg='0' goblin_goods_sku.update_by_del=UPDATE goblin_goods_sku SET del_flg='1',updated_by=?,updated_at=?,deleted_by=?,deleted_at=? WHERE sku_id=? AND del_flg='0'
......
...@@ -41,7 +41,7 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G ...@@ -41,7 +41,7 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
LambdaQueryWrapper<GoblinGoods> queryWrapper = Wrappers.lambdaQuery(GoblinGoods.class); LambdaQueryWrapper<GoblinGoods> queryWrapper = Wrappers.lambdaQuery(GoblinGoods.class);
queryWrapper.eq(GoblinGoods::getDelFlg, "0"); queryWrapper.eq(GoblinGoods::getDelFlg, "0");
queryWrapper.eq(GoblinGoods::getStatus, "3"); queryWrapper.eq(GoblinGoods::getStatus, "3");
// queryWrapper.eq(GoblinGoods::getSpuAppear, "0"); queryWrapper.eq(GoblinGoods::getSpuAppear, "0");
queryWrapper.eq(GoblinGoods::getShelvesHandle, "3"); queryWrapper.eq(GoblinGoods::getShelvesHandle, "3");
queryWrapper.le(GoblinGoods::getShelvesTime, now); queryWrapper.le(GoblinGoods::getShelvesTime, now);
// queryWrapper.eq(GoblinGoods::getShelvesStatus, "0"); // queryWrapper.eq(GoblinGoods::getShelvesStatus, "0");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment