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

Commit c0116767 authored by 胡佳晨's avatar 胡佳晨

提交 名单创建bug

parent 7c952949
...@@ -35,12 +35,12 @@ public class GoblinListController { ...@@ -35,12 +35,12 @@ public class GoblinListController {
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "列表") @ApiOperation(value = "列表")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "name", value = "活动名称"), @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "name", value = "活动名称"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
}) })
@GetMapping("list") @GetMapping("list")
public ResponseDto<PageInfo<GoblinListVo>> list(@RequestParam String name, public ResponseDto<PageInfo<GoblinListVo>> list(@RequestParam(value = "name", required = false) String name,
@RequestParam Integer page) { @RequestParam Integer page) {
return goblinListService.getList(name, page); return goblinListService.getList(name, page);
} }
......
...@@ -60,6 +60,7 @@ public class GoblinListServiceImpl implements IGoblinListService { ...@@ -60,6 +60,7 @@ public class GoblinListServiceImpl implements IGoblinListService {
vo.setTimeEnd(item.getTimeEnd()); vo.setTimeEnd(item.getTimeEnd());
vo.setSkuCount(item.getItemVo().size()); vo.setSkuCount(item.getItemVo().size());
vo.setHasBlack(item.getBlackUrl().equals("") ? 0 : 1); vo.setHasBlack(item.getBlackUrl().equals("") ? 0 : 1);
voList.add(vo);
} }
pageResult = new PageInfo(voList); pageResult = new PageInfo(voList);
pageResult.setTotal((Long) map.get("total")); pageResult.setTotal((Long) map.get("total"));
...@@ -127,8 +128,8 @@ public class GoblinListServiceImpl implements IGoblinListService { ...@@ -127,8 +128,8 @@ public class GoblinListServiceImpl implements IGoblinListService {
} }
collectVos = redisUtils.getGoblinListCollect(skuId); collectVos = redisUtils.getGoblinListCollect(skuId);
for (GoblinListCollectVo collectItem : collectVos) { for (GoblinListCollectVo collectItem : collectVos) {
if (st.isAfter(collectItem.getTimeStart()) || st.isBefore(collectItem.getTimeEnd()) || if ((st.isAfter(collectItem.getTimeStart().minusSeconds(1)) && st.isBefore(collectItem.getTimeEnd().plusSeconds(1))) ||
et.isAfter(collectItem.getTimeStart()) || et.isBefore(collectItem.getTimeEnd())) { (et.isAfter(collectItem.getTimeStart().minusSeconds(1)) && et.isBefore(collectItem.getTimeEnd().plusSeconds(1)))) {
return ResponseDto.failure("sku时间不能重合"); return ResponseDto.failure("sku时间不能重合");
} }
} }
...@@ -138,7 +139,7 @@ public class GoblinListServiceImpl implements IGoblinListService { ...@@ -138,7 +139,7 @@ public class GoblinListServiceImpl implements IGoblinListService {
} }
collectVos = redisUtils.getGoblinListCollect(skuId); collectVos = redisUtils.getGoblinListCollect(skuId);
for (GoblinListCollectVo collectItem : collectVos) { for (GoblinListCollectVo collectItem : collectVos) {
if (st.isAfter(collectItem.getTimeStart()) || st.isBefore(collectItem.getTimeEnd())) { if (st.isAfter(collectItem.getTimeStart().minusSeconds(1)) && st.isBefore(collectItem.getTimeEnd().plusSeconds(1))) {
return ResponseDto.failure("sku时间不能重合"); return ResponseDto.failure("sku时间不能重合");
} }
} }
...@@ -192,9 +193,9 @@ public class GoblinListServiceImpl implements IGoblinListService { ...@@ -192,9 +193,9 @@ public class GoblinListServiceImpl implements IGoblinListService {
collectVos.add(collectVo); collectVos.add(collectVo);
redisUtils.setGoblinListCollect(itemVo.getSkuId(), collectVos); redisUtils.setGoblinListCollect(itemVo.getSkuId(), collectVos);
// 白名单 // 白名单
queueUtils.sendMsgByRedisXls(param.getWhiteUrl(), "", "3", item.getSkuId()); queueUtils.sendMsgByRedisXls(vo.getWhiteUrl(), "", "3", item.getSkuId());
// 黑名单 // 黑名单
queueUtils.sendMsgByRedisXls(param.getBlackUrl(), "", "4", item.getSkuId()); queueUtils.sendMsgByRedisXls(vo.getBlackUrl(), "", "4", item.getSkuId());
goblinListDetails.add(new Object[]{ goblinListDetails.add(new Object[]{
vo.getListId(), itemVo.getSpuId(), itemVo.getSkuId(), now, itemVo.getSkuStock(), itemVo.getPriceV(), itemVo.getProductId(), itemVo.getPrice() vo.getListId(), itemVo.getSpuId(), itemVo.getSkuId(), now, itemVo.getSkuStock(), itemVo.getPriceV(), itemVo.getProductId(), itemVo.getPrice()
}); });
......
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