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

Commit 6d9d9187 authored by jiangxiulong's avatar jiangxiulong

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

parents 5e41b441 82c004a1
......@@ -20,7 +20,7 @@ public interface IGoblinGoodsAnticipateService {
/**
* 用户预约
*/
ResponseDto<Object> userAbout(String skuId);
ResponseDto<Boolean> userAbout(String skuId);
ResponseDto<Boolean> selectAnticipate(String skuId);
......
......@@ -32,12 +32,12 @@ public interface IGoblinGoodsAnticipateMgService {
/**
* 修改预约人数
*/
ResponseDto<Object> updatePeople(String antId, BigInteger people);
ResponseDto<Boolean> updatePeople(String antId, BigInteger people);
/**
* 删除预约
*/
ResponseDto<Object> delete(String skuId);
ResponseDto<Boolean> delete(String skuId);
AnticipateValueVo getAnticipateValueBySkuId(String skuId,int hasHead);
}
......@@ -25,7 +25,7 @@ import java.util.List;
*/
@Slf4j
@RestController
@Api(tags = "预约相关")
@Api(tags = "预约相关(前)")
@RequestMapping("/anticipate")
public class GoblinGoodsAnticipateController {
......@@ -37,11 +37,11 @@ public class GoblinGoodsAnticipateController {
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "skuId", value = "skuId", example = ""),
})
public ResponseDto<Object> userAbout(@RequestParam(name = "skuId", required = true) String skuId) {
public ResponseDto<Boolean> userAbout(@RequestParam(name = "skuId", required = true) String skuId) {
return goblinGoodsAnticipateService.userAbout(skuId);
}
@ApiOperation("根据skuId和uid查询")
@ApiOperation("根据skuId和uid查询是否预约")
@GetMapping("/selectAnticipateBySkuIdAndUid")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "skuId", value = "skuId", example = ""),
......
......@@ -28,7 +28,7 @@ import java.math.BigInteger;
*/
@Slf4j
@RestController
@Api(tags = "预约相关")
@Api(tags = "预约相关(后)")
@RequestMapping("/goblin/anticipate")
public class GoblinGoodsAnticipateMgController {
......@@ -53,7 +53,7 @@ public class GoblinGoodsAnticipateMgController {
@ApiImplicitParam(type = "query", dataType = "String", name = "skuId", value = "skuId", example = ""),
@ApiImplicitParam(type = "query", dataType = "BigInteger", name = "people", value = "要修改的人数", example = "")
})
public ResponseDto<Object> updatePeople(@RequestParam(name = "skuId", required = true) String skuId, @RequestParam(name = "people", required = true) BigInteger people) {
public ResponseDto<Boolean> updatePeople(@RequestParam(name = "skuId", required = true) String skuId, @RequestParam(name = "people", required = true) BigInteger people) {
return goblinGoodsAnticipateMgService.updatePeople(skuId, people);
}
......@@ -62,7 +62,7 @@ public class GoblinGoodsAnticipateMgController {
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "skuId", value = "skuId", example = ""),
})
public ResponseDto<Object> delete(@RequestParam(name = "skuId") String skuId) {
public ResponseDto<Boolean> delete(@RequestParam(name = "skuId") String skuId) {
return goblinGoodsAnticipateMgService.delete(skuId);
}
......
......@@ -52,7 +52,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
GoblinMongoUtils goblinMongoUtils;
@Override
public ResponseDto<Object> userAbout(String skuId) {
public ResponseDto<Boolean> userAbout(String skuId) {
//查询该skuId是否能被预约
GoblinGoodsAnticipateValueVo anticipateValueVo = goblinRedisUtils.getValueBySkuId(skuId);
if (anticipateValueVo != null) {
......@@ -75,7 +75,6 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
if (sid != null) {
Integer people = goblinRedisUtils.getHelpSidAddHelp(sid);
if (anticipateValueVo.getPeopleType() > people) {
int num = anticipateValueVo.getPeopleType() - people;
log.debug(" skuId:{},分享sid:{},预约uid:{},需要助力人数:{},助力人数:{}", skuId, sid, uid, anticipateValueVo.getPeopleType(), people);
return ResponseDto.failure("预约失败!");
}
......@@ -148,9 +147,9 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//查询sku需要助力人数
//Integer skuIdPeople = goblinRedisUtils.getSharePeopleBySkuId(skuId);
String sId = IDGenerator.nextTimeId2();
sid = IDGenerator.nextTimeId2();
GoblinGoodsAnticipateShareVo goblinGoodsAnticipateShareVo = GoblinGoodsAnticipateShareVo.getNew();
goblinGoodsAnticipateShareVo.setSid(sId);
goblinGoodsAnticipateShareVo.setSid(sid);
goblinGoodsAnticipateShareVo.setUid(uid);
goblinGoodsAnticipateShareVo.setSkuId(skuId);
goblinGoodsAnticipateShareVo.setType(valueBySkuId.getType());
......@@ -164,7 +163,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//goblinMongoUtils.setGoblinGoodsAnticipateShareVo(goblinGoodsAnticipateShareVo);
//redis缓存
goblinRedisUtils.setShare(skuId, uid, sId);
goblinRedisUtils.setShare(skuId, uid, sid);
//redis存储用户分享
goblinRedisUtils.setShareVo(goblinGoodsAnticipateShareVo);
......@@ -180,7 +179,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
goblinGoodsAnticipateShareVo.getCreatedDate()
});
sendRedis("goblin_goods_anticipate_share", sqlValue);
return ResponseDto.success(sId);
return ResponseDto.success(sid);
}
}
......@@ -243,6 +242,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
}
return ResponseDto.success(true);
}
log.debug("help() false ------> sid:{}",sid);
return ResponseDto.success(false);
}
......
......@@ -13,7 +13,6 @@ import com.liquidnet.service.goblin.dto.manage.GoblinGoodsAnticipateValueAddPara
import com.liquidnet.service.goblin.dto.manage.GoblinGoodsAnticipateValueParam;
import com.liquidnet.service.goblin.dto.manage.vo.AnticipateValueVo;
import com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateHelp;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsAnticipateVo;
import com.liquidnet.service.goblin.service.manage.IGoblinGoodsAnticipateMgService;
import com.liquidnet.service.goblin.util.GoblinAnticipateUtils;
......@@ -24,7 +23,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.math.BigInteger;
import java.time.LocalDateTime;
......@@ -118,16 +116,6 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
//redis标识存入该sku处于预约列表
goblinRedisUtils.setValue(goodsAnticipateValueVo);
//redis缓存预约条件
/*GoblinGoodsAnticipateHelp goodsAnticipateHelp = GoblinGoodsAnticipateHelp.getNew();
goodsAnticipateHelp.setSkuId(goodsAnticipateValueVo.getSkuId());
goodsAnticipateHelp.setType(type);
goodsAnticipateHelp.setPeople(people);
goodsAnticipateHelp.setAboutStartDate(goodsAnticipateValueVo.getAboutStartDate());
goodsAnticipateHelp.setAboutEndDate(goodsAnticipateValueVo.getAboutEndDate());
goblinRedisUtils.setSharePeopleBySkuId(item.getSkuId(), goodsAnticipateHelp);*/
//保存mysql中间表
LinkedList<Object[]> sqlValue = CollectionUtil.linkedListObjectArr();
sqlValue.add(new Object[]{
......@@ -176,7 +164,7 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
}
@Override
public ResponseDto<Object> updatePeople(String skuId, BigInteger people) {
public ResponseDto<Boolean> updatePeople(String skuId, BigInteger people) {
//修改Mongodb
goblinMongoUtils.updateGoblinGoodsAnticipateValueVoPeople(skuId, people);
//修改redis
......@@ -194,7 +182,7 @@ public class GoblinGoodsAnticipateMgServiceImpl implements IGoblinGoodsAnticipat
}
@Override
public ResponseDto<Object> delete(String skuId) {
public ResponseDto<Boolean> delete(String skuId) {
//更具skuId查询
GoblinGoodsAnticipateValueVo goodsAnticipateValueVo = goblinRedisUtils.getValueBySkuId(skuId);
String uid = CurrentUtil.getCurrentUid();
......
......@@ -173,22 +173,6 @@ public class GoblinRedisUtils {
return (String) redisUtil.get(key);
}
/**
* 缓存sku预约助力人数
*/
public void setSharePeopleBySkuId(String skuId,GoblinGoodsAnticipateHelp goodsAnticipateHelp){
String key = GoblinRedisConst.ANTICIPATE_SHARE_SKUID_PEOPLE.concat(skuId);
redisUtil.set(key,goodsAnticipateHelp);
}
/**
* 缓存sku预约助力人数
*/
public GoblinGoodsAnticipateHelp getSharePeopleBySkuId(String skuId){
String key = GoblinRedisConst.ANTICIPATE_SHARE_SKUID_PEOPLE.concat(skuId);
return (GoblinGoodsAnticipateHelp) redisUtil.get(key);
}
/**
* 缓存sku预约助力人数
*/
......
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