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

Commit d571786d authored by dongchun's avatar dongchun

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

parents 97cc8824 755bfc72
...@@ -64,6 +64,7 @@ public class GoblinRedisConst { ...@@ -64,6 +64,7 @@ public class GoblinRedisConst {
public static final String REDIS_GOBLIN_BUY_COUNT = PREFIX.concat("uid:");//用户sku购买数量 key:uid:skuId:$skuId public static final String REDIS_GOBLIN_BUY_COUNT = PREFIX.concat("uid:");//用户sku购买数量 key:uid:skuId:$skuId
public static final String REDIS_GOBLIN_SALE_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$skuId public static final String REDIS_GOBLIN_SALE_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$skuId
public static final String REDIS_GOBLIN_SALE_SPU_COUNT = PREFIX.concat("sale:skuId:");//用户sku购买数量 key:sale:skuId:$spuId
public static final String REDIS_GOBLIN_ORDER = PREFIX.concat("order:");//用户sku购买数量 key:$orderId public static final String REDIS_GOBLIN_ORDER = PREFIX.concat("order:");//用户sku购买数量 key:$orderId
public static final String REDIS_GOBLIN_ORDER_BACK = PREFIX.concat("order:back:");//用户sku购买数量 key:$backOrderId public static final String REDIS_GOBLIN_ORDER_BACK = PREFIX.concat("order:back:");//用户sku购买数量 key:$backOrderId
public static final String REDIS_GOBLIN_ORDER_SKU = PREFIX.concat("orderSku:");//用户sku购买数量 key:$orderSkuId public static final String REDIS_GOBLIN_ORDER_SKU = PREFIX.concat("orderSku:");//用户sku购买数量 key:$orderSkuId
......
...@@ -15,4 +15,6 @@ public class GoblinInsertZhengzaiParam { ...@@ -15,4 +15,6 @@ public class GoblinInsertZhengzaiParam {
private String storeId; private String storeId;
@ApiModelProperty(required = true, value = "显示时间") @ApiModelProperty(required = true, value = "显示时间")
private String showTime; private String showTime;
@ApiModelProperty(required = true, value = "是否删除[0-否|1-是]")
private Integer delTag;
} }
...@@ -113,20 +113,11 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -113,20 +113,11 @@ public class GoblinSelfZhengzaiController extends BaseController {
return goblinZhengzaiMarketService.zhengzaiStore(params); return goblinZhengzaiMarketService.zhengzaiStore(params);
} }
@PostMapping("zhengzai/store/insert") @PostMapping("zhengzai/store/update")
@ApiOperation("活动详情-正在下单-配置店铺") @ApiOperation("活动详情-正在下单-修改店铺")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ public ResponseDto<Boolean> purchasingStoreUpdate(@RequestBody List<GoblinInsertZhengzaiParam> params) {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"), return goblinZhengzaiMarketService.zhengzaiStore(params);
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "showTime", value = "显示时间", example = "0"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integet", name = "delTag", value = "是否删除[0-否|1-是]", example = "0"),
})
public ResponseDto<Boolean> purchasingStore(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId,
@RequestParam("showTime") @Valid String showTime,
@RequestParam("delTag") @Valid Integer delTag) {
return goblinZhengzaiMarketService.zhengzaiStore(marketId, storeId, showTime, delTag);
} }
......
...@@ -102,11 +102,9 @@ public interface IGoblinZhengzaiMarketService { ...@@ -102,11 +102,9 @@ public interface IGoblinZhengzaiMarketService {
/** /**
* 编辑正在下单 可参与活动店铺 * 编辑正在下单 可参与活动店铺
* *
* @param marketId
* @param storeId
* @return * @return
*/ */
ResponseDto<Boolean> zhengzaiStore(String marketId, String storeId, String showTime, Integer delTag); ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params);
/** /**
* 查看详情(参加活动的商品列表) * 查看详情(参加活动的商品列表)
......
...@@ -217,7 +217,12 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -217,7 +217,12 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
} }
@Override @Override
public ResponseDto<Boolean> zhengzaiStore(String marketId, String storeId, String showTime, Integer delTag) { public ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params) {
for (GoblinInsertZhengzaiParam item:params) {
int delTag = item.getDelTag();
String showTime = item.getShowTime();
String marketId = item.getMarketId();
String storeId = item.getStoreId();
if (delTag == 0) { if (delTag == 0) {
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew(); GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS)); entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS));
...@@ -244,6 +249,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -244,6 +249,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
goblinRedisUtils.delZhengzaiRelation(marketId, storeId); goblinRedisUtils.delZhengzaiRelation(marketId, storeId);
goblinRedisUtils.delStoreSelfRelation(marketId, storeId); goblinRedisUtils.delStoreSelfRelation(marketId, storeId);
} }
}
return ResponseDto.success(); return ResponseDto.success();
} }
......
...@@ -579,7 +579,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -579,7 +579,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
for (String orderSkuVoIds : skuList) { for (String orderSkuVoIds : skuList) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoIds); GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(orderSkuVoIds);
//增加销量 //增加销量
redisUtils.incrSkuSaleCount(orderSkuVo.getSkuId(), orderSkuVo.getNum()); redisUtils.incrSkuSaleCount(orderSkuVo.getSpuId(),orderSkuVo.getSkuId(), orderSkuVo.getNum());
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_2.getValue()); orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_2.getValue());
//redis //redis
redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo); redisUtils.setGoblinOrderSku(orderSkuVo.getOrderSkuId(), orderSkuVo);
......
...@@ -484,14 +484,39 @@ public class GoblinRedisUtils { ...@@ -484,14 +484,39 @@ public class GoblinRedisUtils {
} }
// 增加 sku销量 // 增加 sku销量
public int incrSkuSaleCount(String skuId, int number) { public int incrSkuSaleCount(String spuId,String skuId, int number) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId);
incrSpuSaleCount(spuId,number);
return (int) redisUtil.incr(redisKey, number); return (int) redisUtil.incr(redisKey, number);
} }
// 减少 sku销量 // 减少 sku销量
public int decrSkuSaleCount(String skuId, int number) { public int decrSkuSaleCount(String spuId,String skuId, int number) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_COUNT.concat(skuId);
decrSpuSaleCount(spuId,number);
return (int) redisUtil.decr(redisKey, number);
}
//获取 spu销量
public Integer getSpuSaleCount(String spuId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_SPU_COUNT.concat(spuId);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return null;
} else {
return (Integer) obj;
}
}
// 增加 spu销量
private int incrSpuSaleCount(String spuId, int number) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_SPU_COUNT.concat(spuId);
return (int) redisUtil.incr(redisKey, number);
}
// 减少 spu销量
private int decrSpuSaleCount(String spuId, int number) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SALE_SPU_COUNT.concat(spuId);
return (int) redisUtil.decr(redisKey, number); return (int) redisUtil.decr(redisKey, number);
} }
......
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