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

Commit 8b7542d5 authored by 张国柄's avatar 张国柄

+API:服务保障列表;

parent 691efc05
......@@ -21,6 +21,11 @@ public class GoblinGoodsExtagVo implements Serializable, Cloneable {
@ApiModelProperty(position = 14, value = "排序[数值越小,排序越前]")
private Integer sort;
public GoblinGoodsExtagVo setSort(Integer sort) {
this.sort = sort;
return this;
}
private static final GoblinGoodsExtagVo obj = new GoblinGoodsExtagVo();
public static GoblinGoodsExtagVo getNew() {
try {
......@@ -29,4 +34,13 @@ public class GoblinGoodsExtagVo implements Serializable, Cloneable {
return new GoblinGoodsExtagVo();
}
}
public GoblinGoodsExtagVo copy(GoblinSelfTagVo source) {
if (null == source) return this;
this.setTagId(source.getTagId());
this.setTagName(source.getTagName());
this.setTagDesc(source.getTagDesc());
this.setTagPic(source.getTagPic());
return this;
}
}
......@@ -17,6 +17,11 @@ public class GoblinGoodsTagVo implements Serializable, Cloneable {
@ApiModelProperty(position = 13, value = "排序[数值越小,排序越前]")
private Integer sort;
public GoblinGoodsTagVo setSort(Integer sort) {
this.sort = sort;
return this;
}
private static final GoblinGoodsTagVo obj = new GoblinGoodsTagVo();
public static GoblinGoodsTagVo getNew() {
try {
......@@ -28,7 +33,8 @@ public class GoblinGoodsTagVo implements Serializable, Cloneable {
public GoblinGoodsTagVo copy(GoblinSelfTagVo source) {
if (null == source) return this;
this.setTagId(source.getTagId());
this.setTagName(source.getTagName());
return this;
}
}
......@@ -19,6 +19,26 @@ public class GoblinServiceSupportVo implements Serializable, Cloneable {
@ApiModelProperty(position = 13, value = "服务支持图片地址[256]")
private String url;
public GoblinServiceSupportVo setSsid(String ssid) {
this.ssid = ssid;
return this;
}
public GoblinServiceSupportVo setName(String name) {
this.name = name;
return this;
}
public GoblinServiceSupportVo setDesc(String desc) {
this.desc = desc;
return this;
}
public GoblinServiceSupportVo setUrl(String url) {
this.url = url;
return this;
}
private static final GoblinServiceSupportVo obj = new GoblinServiceSupportVo();
public static GoblinServiceSupportVo getNew() {
try {
......
package com.liquidnet.service.goblin.controller.manage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinServiceSupportVo;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ApiSupport(order = 149003)
@Api(tags = "服务支持管理")
@Slf4j
@Validated
@RestController
@RequestMapping("mgt/sevs")
public class GoblinMgtServiceSupportController {
@Autowired
GoblinMongoUtils goblinMongoUtils;
@ApiOperationSupport(order = 1)
@ApiOperation(value = "服务支持列表")
@PostMapping("list")
public ResponseDto<List<GoblinServiceSupportVo>> list() {
return ResponseDto.success(goblinMongoUtils.getMgtServiceSupportVo());
}
}
......@@ -61,28 +61,36 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
if (!CollectionUtils.isEmpty(tagIdList)) {
List<GoblinSelfTagVo> selfTagVoList = goblinMongoUtils.getSelfTagVos(tagIdList);
if (!goodsTagIsEmpty) {
List<GoblinGoodsTagVo> goodsTagVoList = ObjectUtil.getGoblinGoodsTagVoArrayList();
for (int i = 0; i < tagIdList.size(); i++) {
String tagId = tagIdList.get(i);
selfTagVoList.forEach(r -> {
for (GoblinSelfTagVo r : selfTagVoList) {
if (r.getTagId().equals(tagId)) {
GoblinGoodsTagVo.getNew();
goodsTagVoList.add(GoblinGoodsTagVo.getNew().copy(r).setSort(i));
}
});
}
}
// vo.setTagVoList();
vo.setTagVoList(goodsTagVoList);
}
if (!goodsExtagIsEmpty) {
// vo.setExtagVoList();
List<GoblinGoodsExtagVo> goodsExtagVoList = ObjectUtil.getGoblinGoodsExtagVoArrayList();
for (int i = 0; i < tagIdList.size(); i++) {
String tagId = tagIdList.get(i);
for (GoblinSelfTagVo r : selfTagVoList) {
if (r.getTagId().equals(tagId)) {
goodsExtagVoList.add(GoblinGoodsExtagVo.getNew().copy(r).setSort(i));
}
}
}
vo.setExtagVoList(goodsExtagVoList);
}
}
}
// 服务保障处理
vo.setServiceSupportVoList(goblinMongoUtils.getServiceSupportVo(storeMgtGoodsAddParam.getSsidList()));
goblinMongoUtils.setGoodsInfoVo(vo);
goblinMongoUtils.setGoodsSkuInfoVos(goodsSkuInfoVoList);
}
......
......@@ -57,8 +57,19 @@ public class GoblinMongoUtils {
public List<GoblinServiceSupportVo> getServiceSupportVo(List<String> ssids) {
if (CollectionUtils.isEmpty(ssids)) return ObjectUtil.getGoblinServiceSupportVoArrayList();
return mongoTemplate.find(Query.query(Criteria.where("ssid").in(ssids)),
GoblinServiceSupportVo.class,GoblinServiceSupportVo.class.getSimpleName());
}
return null;
public List<GoblinServiceSupportVo> getMgtServiceSupportVo() {
List<GoblinServiceSupportVo> serviceSupportVoList = mongoTemplate.findAll(GoblinServiceSupportVo.class, GoblinServiceSupportVo.class.getSimpleName());
if (CollectionUtils.isEmpty(serviceSupportVoList)) {
serviceSupportVoList.add(GoblinServiceSupportVo.getNew().setName("正品保证").setDesc("商品为正版行货").setSsid("101"));
serviceSupportVoList.add(GoblinServiceSupportVo.getNew().setName("极速发货").setDesc("24小时内发送货物").setSsid("102"));
serviceSupportVoList.add(GoblinServiceSupportVo.getNew().setName("无忧退货").setDesc("支持7天无理由退款").setSsid("103"));
mongoTemplate.insert(serviceSupportVoList, GoblinServiceSupportVo.class.getSimpleName());
}
return serviceSupportVoList;
}
/* ---------------------------------------- 店铺数据源 ---------------------------------------- */
......
......@@ -89,7 +89,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_STORE.concat(storeId);
GoblinStoreInfoVo vo = (GoblinStoreInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getStoreInfoVo(storeId))) {
redisUtil.set(rk, vo);
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb:暂不设置
}
return vo;
}
......@@ -119,7 +119,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getGoodsInfoVo(spuId))) {
redisUtil.set(rk, vo);
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb:暂不设置
}
return vo;
}
......@@ -128,7 +128,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getMgtGoodsInfoVo(spuId))) {
redisUtil.set(rk, vo);
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb:暂不设置
}
return vo;
}
......@@ -151,7 +151,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_GOODS_SKU.concat(skuId);
GoblinGoodsSkuInfoVo vo = (GoblinGoodsSkuInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getGoodsSkuInfoVo(skuId))) {
redisUtil.set(rk, vo);
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb:暂不设置
}
return vo;
}
......@@ -160,7 +160,7 @@ public class GoblinRedisUtils {
String rk = GoblinRedisConst.BASIC_GOODS_SKU.concat(skuId);
GoblinGoodsSkuInfoVo vo = (GoblinGoodsSkuInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getMgtGoodsSkuInfoVo(skuId))) {
redisUtil.set(rk, vo);
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb:暂不设置
}
return vo;
}
......
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