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

Commit c0e99ee8 authored by GaoHu's avatar GaoHu

exit

parent 65bc8bcc
......@@ -36,6 +36,10 @@ public class AnticipateValueVo implements Cloneable {
private String rule;
@ApiModelProperty("预约人数")
private BigInteger aboutPeople;
@ApiModelProperty("预约类型")
private Integer type;
@ApiModelProperty("设置预约人数")
private Integer peopleType;
@ApiModelProperty("前三预约头像")
private List<String> aboutAvatarList;
......
......@@ -21,6 +21,11 @@ public class GoblinGoodsAnticipateHelp implements Serializable {
*/
private String skuId;
/**
* 预约类型
*/
private Integer type;
/**
* 配置预约人数
*/
......
......@@ -3,6 +3,8 @@ package com.liquidnet.service.goblin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateHelpVo;
import java.util.List;
/**
* <p>
......@@ -27,4 +29,7 @@ public interface IGoblinGoodsAnticipateService {
ResponseDto<Object> help(String sid);
ResponseDto<Object> getHelpAvatar(String sid);
ResponseDto<String> getTurnOnHelp(String skuId);
}
......@@ -10,6 +10,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 预约表 前端控制器
......@@ -58,4 +60,10 @@ public class GoblinGoodsAnticipateController {
return goblinGoodsAnticipateService.getHelpAvatar(sid);
}
@ApiOperation("是否开启助力(返回助力的sid)")
@GetMapping("getTurnOnHelp")
public ResponseDto<String> getTurnOnHelp(@RequestParam(name = "skuId") String skuId){
return goblinGoodsAnticipateService.getTurnOnHelp(skuId);
}
}
......@@ -197,6 +197,9 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//获取uid
String uid = CurrentUtil.getCurrentUid();
if (shareVo.getUid().equals(uid)){
return ResponseDto.failure("助力失败,本人不能为本人助力!");
}
//查询mongodb 是否助力过该分享
// GoblinGoodsAnticipateHelpVo goodsAnticipateHelpVo = goblinMongoUtils.getHelpVo(sid, uid);
......@@ -245,6 +248,12 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
return ResponseDto.success(goblinRedisUtils.getHelpUserAvatar(sid));
}
@Override
public ResponseDto<String> getTurnOnHelp(String skuId) {
String uid = CurrentUtil.getCurrentUid();
return ResponseDto.success(goblinRedisUtils.getShare(skuId, uid));
}
public void sendRedis(String sqlKey, LinkedList<Object[]> sqlData) {
LinkedList<String> sql = CollectionUtil.linkedListString();
sql.add(SqlMapping.get(sqlKey));
......
......@@ -91,7 +91,7 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
//mongodb新增
goblinMongoUtils.setGoblinGoodsAnticipateVo(goodsAnticipateVo);
addAnticipateValues(antId, goodsAnticipateAddParam.getRule(), goodsAnticipateAddParam.getList(),goodsAnticipateAddParam.getPeople());
addAnticipateValues(antId, goodsAnticipateAddParam.getRule(), goodsAnticipateAddParam.getList(),goodsAnticipateAddParam.getPeople(),goodsAnticipateAddParam.getType());
//返回预约id
return ResponseDto.success(antId);
......@@ -99,7 +99,7 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
return ResponseDto.failure("参数有误");
}
public void addAnticipateValues(String antId, String rule, List<GoblinGoodsAnticipateValueAddParam> list,Integer people) {
public void addAnticipateValues(String antId, String rule, List<GoblinGoodsAnticipateValueAddParam> list,Integer people,Integer type) {
//获取创建者uid
String uid = CurrentUtil.getCurrentUid();
if (list != null && list.size() > 0) {
......@@ -120,6 +120,7 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
//redis缓存预约条件
GoblinGoodsAnticipateHelp goodsAnticipateHelp = GoblinGoodsAnticipateHelp.getNew();
goodsAnticipateHelp.setSkuId(goodsAnticipateValueVo.getSkuId());
goodsAnticipateHelp.setType(type);
goodsAnticipateHelp.setPeople(people);
goodsAnticipateHelp.setAboutStartDate(goodsAnticipateValueVo.getAboutStartDate());
goodsAnticipateHelp.setAboutEndDate(goodsAnticipateValueVo.getAboutEndDate());
......@@ -226,6 +227,9 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
AnticipateValueVo valueVo = AnticipateValueVo.getNew();
if (anticipateValueVo != null) {
valueVo = valueVo.copy(anticipateValueVo);
GoblinGoodsAnticipateHelp help = goblinRedisUtils.getSharePeopleBySkuId(skuId);
valueVo.setType(help.getType());
valueVo.setPeopleType(help.getPeople());
valueVo.setState(GoblinAnticipateUtils.setState(valueVo.getAboutStartDate(), valueVo.getAboutEndDate()));
} else {
valueVo.setState(null);
......
......@@ -2,4 +2,4 @@ spring:
application:
name: liquidnet-service-goblin
profiles:
active: test
\ No newline at end of file
active: dev
\ No newline at end of file
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