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

Commit 1078c1b0 authored by 张国柄's avatar 张国柄

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

parents e3aba145 c277499e
...@@ -17,7 +17,7 @@ import java.time.LocalDateTime; ...@@ -17,7 +17,7 @@ import java.time.LocalDateTime;
* @since 2021-12-28 * @since 2021-12-28
*/ */
@Data @Data
@ApiModel(value = "GoblinFrontHotWordBuildParam", description = "首页导航栏") @ApiModel(value = "GoblinFrontNavigationBuildParam", description = "首页导航栏")
public class GoblinFrontNavigationBuildParam implements Serializable { public class GoblinFrontNavigationBuildParam implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 秒杀表
* </p>
*
* @author liquidnet
* @since 2021-12-30
*/
@Data
@ApiModel(value = "GoblinFrontSeckillBuildParam", description = "秒杀表")
public class GoblinFrontSeckillBuildParam implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@ApiModelProperty(value = "主键")
private Long mid;
/**
* 官方活动id
*/
@ApiModelProperty(value = "活动id(官方g_,商铺s_),按照顺序添加")
private String selfActivityids;
/**
* 1、一行三个2、两行三个
*/
@ApiModelProperty(value = "1、一行三个2、两行三个")
private Integer showType;
/**
* 1、关闭模块2、保留模块
*/
@ApiModelProperty(value = "1、关闭模块2、保留模块")
private Integer activityType;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
/**
* 0未删除1已删除
*/
@ApiModelProperty(value = "0未删除1已删除")
private Integer delTag;
/**
* 排序
*/
@ApiModelProperty(value = "忽略")
private Integer indexs;
/**
* 秒杀id
*/
@ApiModelProperty(value = "秒杀id")
private String seckilId;
}
...@@ -13,8 +13,10 @@ import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; ...@@ -13,8 +13,10 @@ import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.liquidnet.service.goblin.entity.GoblinStoreMarketing; import com.liquidnet.service.goblin.entity.GoblinStoreMarketing;
import com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper; import com.liquidnet.service.goblin.mapper.GoblinSelfMarketingMapper;
import com.liquidnet.service.goblin.mapper.GoblinStoreMarketingMapper; import com.liquidnet.service.goblin.mapper.GoblinStoreMarketingMapper;
import com.liquidnet.service.goblin.param.GoblinFrontSeckillBuildParam;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -75,7 +77,9 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -75,7 +77,9 @@ public class GoblinFrontSeckillController extends BaseController {
@PostMapping("create") @PostMapping("create")
@ApiOperation(value = "增加秒杀") @ApiOperation(value = "增加秒杀")
@ResponseBody @ResponseBody
public AjaxResult create( @RequestBody GoblinFrontSeckill goblinFrontSeckill) { public AjaxResult create(@RequestBody GoblinFrontSeckillBuildParam goblinFrontSeckillBuildParam) {
GoblinFrontSeckill goblinFrontSeckill=new GoblinFrontSeckill();
BeanUtils.copyProperties(goblinFrontSeckillBuildParam,goblinFrontSeckill);
logger.info("增加秒杀{}", JSON.toJSONString(goblinFrontSeckill)); logger.info("增加秒杀{}", JSON.toJSONString(goblinFrontSeckill));
boolean result=goblinFrontSeckillService.create(goblinFrontSeckill); boolean result=goblinFrontSeckillService.create(goblinFrontSeckill);
if (result ) { if (result ) {
...@@ -94,7 +98,9 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -94,7 +98,9 @@ public class GoblinFrontSeckillController extends BaseController {
@PostMapping("update") @PostMapping("update")
@ApiOperation(value = "限时秒杀修改") @ApiOperation(value = "限时秒杀修改")
@ResponseBody @ResponseBody
public AjaxResult update( @RequestBody GoblinFrontSeckill goblinFrontSeckill) { public AjaxResult update( @RequestBody GoblinFrontSeckillBuildParam goblinFrontSeckillBuildParam) {
GoblinFrontSeckill goblinFrontSeckill=new GoblinFrontSeckill();
BeanUtils.copyProperties(goblinFrontSeckillBuildParam,goblinFrontSeckill);
logger.info("限时秒杀修改{}", JSON.toJSONString(goblinFrontSeckill)); logger.info("限时秒杀修改{}", JSON.toJSONString(goblinFrontSeckill));
boolean result=goblinFrontSeckillService.update(goblinFrontSeckill); boolean result=goblinFrontSeckillService.update(goblinFrontSeckill);
if (result ) { if (result ) {
...@@ -112,7 +118,9 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -112,7 +118,9 @@ public class GoblinFrontSeckillController extends BaseController {
@PostMapping("delete") @PostMapping("delete")
@ApiOperation(value = "限时秒杀删除") @ApiOperation(value = "限时秒杀删除")
@ResponseBody @ResponseBody
public AjaxResult delete( @RequestBody GoblinFrontSeckill goblinFrontSeckill) { public AjaxResult delete( @RequestBody GoblinFrontSeckillBuildParam goblinFrontSeckillBuildParam) {
GoblinFrontSeckill goblinFrontSeckill=new GoblinFrontSeckill();
BeanUtils.copyProperties(goblinFrontSeckillBuildParam,goblinFrontSeckill);
logger.info("限时秒杀删除{}", JSON.toJSONString(goblinFrontSeckill)); logger.info("限时秒杀删除{}", JSON.toJSONString(goblinFrontSeckill));
boolean result=goblinFrontSeckillService.delte(goblinFrontSeckill.getMid()); boolean result=goblinFrontSeckillService.delte(goblinFrontSeckill.getMid());
if (result ) { if (result ) {
...@@ -130,7 +138,9 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -130,7 +138,9 @@ public class GoblinFrontSeckillController extends BaseController {
@PostMapping("page") @PostMapping("page")
@ApiOperation(value = "分页") @ApiOperation(value = "分页")
@ResponseBody @ResponseBody
public AjaxResult page( @RequestParam(name = "pageSize", required = true) int pageSize,@RequestParam(name = "pageNumber", required = true)int pageNumber,@RequestBody GoblinFrontSeckill goblinFrontSeckill) { public AjaxResult page( @RequestParam(name = "pageSize", required = true) int pageSize,@RequestParam(name = "pageNumber", required = true)int pageNumber,@RequestBody GoblinFrontSeckillBuildParam goblinFrontSeckillBuildParam) {
GoblinFrontSeckill goblinFrontSeckill=new GoblinFrontSeckill();
BeanUtils.copyProperties(goblinFrontSeckillBuildParam,goblinFrontSeckill);
logger.info("限时秒杀分页{}", JSON.toJSONString(goblinFrontSeckill)); logger.info("限时秒杀分页{}", JSON.toJSONString(goblinFrontSeckill));
return AjaxResult.success(goblinFrontSeckillService.page(pageSize,pageNumber,null)); return AjaxResult.success(goblinFrontSeckillService.page(pageSize,pageNumber,null));
} }
...@@ -143,7 +153,9 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -143,7 +153,9 @@ public class GoblinFrontSeckillController extends BaseController {
@PostMapping("getOne") @PostMapping("getOne")
@ApiOperation(value = "查看详情") @ApiOperation(value = "查看详情")
@ResponseBody @ResponseBody
public AjaxResult getOne( @RequestBody GoblinFrontSeckill goblinFrontSeckill) { public AjaxResult getOne( @RequestBody GoblinFrontSeckillBuildParam goblinFrontSeckillBuildParam) {
GoblinFrontSeckill goblinFrontSeckill=new GoblinFrontSeckill();
BeanUtils.copyProperties(goblinFrontSeckillBuildParam,goblinFrontSeckill);
logger.info("查看详情{}", JSON.toJSONString(goblinFrontSeckill)); logger.info("查看详情{}", JSON.toJSONString(goblinFrontSeckill));
GoblinFrontSeckill goblinFrontSeckill1=goblinFrontSeckillService.getOne(goblinFrontSeckill.getMid()); GoblinFrontSeckill goblinFrontSeckill1=goblinFrontSeckillService.getOne(goblinFrontSeckill.getMid());
return AjaxResult.success(goblinFrontSeckill1); return AjaxResult.success(goblinFrontSeckill1);
......
...@@ -85,6 +85,15 @@ public class IDGenerator { ...@@ -85,6 +85,15 @@ public class IDGenerator {
return "QR" + qrCode.substring(5) + "" + qrCode.substring(0, 4); return "QR" + qrCode.substring(5) + "" + qrCode.substring(0, 4);
} }
/**
* 获得活动 spu sku
* @param marketId
* @return
*/
public static String marketGoodId(String marketId) {
return StringUtil.right(marketId,5);
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(""+IDGenerator.payCode()); System.out.println(""+IDGenerator.payCode());
System.out.println(""+IDGenerator.refundCode()); System.out.println(""+IDGenerator.refundCode());
......
...@@ -3,10 +3,14 @@ package com.liquidnet.service.goblin.service.impl.manage; ...@@ -3,10 +3,14 @@ package com.liquidnet.service.goblin.service.impl.manage;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam; import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo; import com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo;
import com.liquidnet.service.goblin.entity.GoblinStoreMarketPurchasing; import com.liquidnet.service.goblin.entity.GoblinStoreMarketPurchasing;
import com.liquidnet.service.goblin.entity.GoblinStoreMarketing; import com.liquidnet.service.goblin.entity.GoblinStoreMarketing;
...@@ -14,6 +18,7 @@ import com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService ...@@ -14,6 +18,7 @@ import com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService
import com.liquidnet.service.goblin.util.GoblinMongoUtils; import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.QueueUtils; import com.liquidnet.service.goblin.util.QueueUtils;
import io.github.classgraph.json.Id;
import me.chanjar.weixin.common.util.DataUtils; import me.chanjar.weixin.common.util.DataUtils;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -168,6 +173,9 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -168,6 +173,9 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
public ResponseDto<Boolean> purchasingSkuInsert(List<GoblinStorePurchaseItemParam> params) { public ResponseDto<Boolean> purchasingSkuInsert(List<GoblinStorePurchaseItemParam> params) {
String purchaseId = IDGenerator.nextMilliId2(); String purchaseId = IDGenerator.nextMilliId2();
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
String marketId = params.get(0).getStoreMarketId();
String spuId = params.get(0).getStoreMarketId();
String marketSpuId = spuId.concat(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue()).concat(IDGenerator.marketGoodId(marketId));
for (GoblinStorePurchaseItemParam item : params) { for (GoblinStorePurchaseItemParam item : params) {
GoblinStoreMarketPurchasing bean = GoblinStoreMarketPurchasing.getNew(); GoblinStoreMarketPurchasing bean = GoblinStoreMarketPurchasing.getNew();
bean.setPurchaseId(purchaseId); bean.setPurchaseId(purchaseId);
...@@ -182,10 +190,20 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -182,10 +190,20 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
bean.setDelFlag(0); bean.setDelFlag(0);
bean.setCreatedAt(now); bean.setCreatedAt(now);
//mongo //mongo
goblinRedisUtils.getGoodsInfoVo(item.getSpuId()); GoblinGoodsSkuInfoVo skuVo = goblinRedisUtils.getGoodsSkuInfoVo(item.getSkuId());
goblinRedisUtils.getGoodsSkuInfoVo(item.getSkuId()); skuVo.setSpuId(marketSpuId);
skuVo.setPrice(bean.getPriceMarketing());
skuVo.setSkuStock(bean.getStockMarketing());
// skuVo.setBuyLimit(item.getBuyLimit().toString());//限购 , 限量
//redis //redis
goblinRedisUtils.setGoodsSkuInfoVo(skuVo);
} }
//mongo
GoblinGoodsInfoVo spuVo = goblinRedisUtils.getGoodsInfoVo(spuId);
spuVo.setSpuId(marketSpuId);
goblinMongoUtils.setGoodsInfoVo(spuVo);
//redis
goblinRedisUtils.setGoodsInfoVo(spuVo);
//mysql //mysql
return null; return null;
......
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