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

Commit 2ca63d68 authored by 胡佳晨's avatar 胡佳晨

提交 app 正在下单 活动、店铺列表

parent 24f92a6c
package com.liquidnet.service.goblin.dto.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreCertificationVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ApiModel(value = "GoblinShowStoreInfoVo", description = "店铺基础信息[前端显示]")
@Data
public class GoblinShowStoreInfoVo implements Serializable, Cloneable {
private static final long serialVersionUID = -2268722236055938975L;
@ApiModelProperty(position = 11, value = "店铺ID[64]")
private String storeId;
@ApiModelProperty(position = 13, value = "店铺名称[128]")
private String storeName;
@ApiModelProperty(position = 14, value = "店铺LOGO[256]")
private String logoPic;
@ApiModelProperty(position = 15, value = "店铺背景图[256]")
private String backgroundPic;
@ApiModelProperty(position = 16, value = "店铺介绍[500]")
private String introduce;
@ApiModelProperty(position = 17, value = "店铺状态[0-填写资料中|1-店铺审核中|2-审核不通过|3-审核通过|4-停业|5-营业]")
private String status;
@ApiModelProperty(position = 19, value = "店铺类型[1-普通店铺|2-加盟|3-连锁|5-直营]")
private String storeType;
@ApiModelProperty(position = 20, value = "认证类型[1-企业/公司|2-个体工商户]")
private String certType;
@ApiModelProperty(position = 21, value = "店铺评分[8,2]")
private BigDecimal aveScore;
@ApiModelProperty(position = 22, value = "客服账号[128]")
private String serviceAcc;
@ApiModelProperty(position = 23, value = "店铺有效期")
private String createdBy;
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private LocalDateTime createdAt;
private static final GoblinShowStoreInfoVo obj = new GoblinShowStoreInfoVo();
public static GoblinShowStoreInfoVo getNew() {
try {
return (GoblinShowStoreInfoVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new GoblinShowStoreInfoVo();
}
}
}
package com.liquidnet.service.goblin.service;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinShowStoreInfoVo;
import java.util.List;
public interface IGoblinAppZhengzaiService {
/**
* 正在下单活动列表
*
* @return
*/
List<GoblinSelfMarketingVo> getZhengzaiMarketList();
List<GoblinStoreInfoVo> getStoreList(String marketId);
/**
* 正在下单店铺列表
*
* @param marketId
* @return
*/
List<GoblinShowStoreInfoVo> getStoreList(String marketId);
}
package com.liquidnet.service.goblin.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinShowStoreInfoVo;
import com.liquidnet.service.goblin.service.IGoblinAppZhengzaiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
@Slf4j
@Api(tags = "正在下单相关")
......@@ -16,4 +21,18 @@ public class GoblinAppZhengzaiController {
@Autowired
IGoblinAppZhengzaiService goblinAppZhengzaiService;
@GetMapping("market/list")
@ApiOperation("正在下单-活动列表")
public ResponseDto<List<GoblinSelfMarketingVo>> getZhengzaiMarketList() {
return ResponseDto.success(goblinAppZhengzaiService.getZhengzaiMarketList());
}
@GetMapping("store/list")
@ApiOperation("正在下单-参与活动的店铺")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
})
public ResponseDto<List<GoblinShowStoreInfoVo>> getStoreList(@RequestParam("marketId") @Valid String marketId) {
return ResponseDto.success(goblinAppZhengzaiService.getStoreList(marketId));
}
}
......@@ -4,6 +4,7 @@ import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinStoreMgtInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketRelationVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinShowStoreInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo;
import com.liquidnet.service.goblin.service.IGoblinAppZhengzaiService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
......@@ -32,7 +33,7 @@ public class GoblinAppZhengzaiServiceImpl implements IGoblinAppZhengzaiService {
}
@Override
public List<GoblinStoreInfoVo> getStoreList(String marketId) {
public List<GoblinShowStoreInfoVo> getStoreList(String marketId) {
List<GoblinMarketRelationVo> relationVo = redisUtils.getMarketRelation(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue(), marketId);
List<String> storeIdList = relationVo.stream().map(GoblinMarketRelationVo::getStoreId).collect(Collectors.toList());
return mongoUtils.getGoblinStoreVoList(storeIdList);
......
......@@ -306,9 +306,9 @@ public class GoblinMongoUtils {
}
//获取 参加正在下单的商品列表
public List<GoblinStoreInfoVo> getGoblinStoreVoList(List<String> storeIdList) {
public List<GoblinShowStoreInfoVo> getGoblinStoreVoList(List<String> storeIdList) {
//todo 没redis
List<GoblinStoreInfoVo> voList = mongoTemplate.find(Query.query(Criteria.where("storeId").in(storeIdList)), GoblinStoreInfoVo.class, GoblinStoreInfoVo.class.getSimpleName());
List<GoblinShowStoreInfoVo> voList = mongoTemplate.find(Query.query(Criteria.where("storeId").in(storeIdList).and("status").is(5)), GoblinShowStoreInfoVo.class, GoblinStoreInfoVo.class.getSimpleName());
return voList;
}
}
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