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

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

提交 代码

parent 12853a35
...@@ -8,7 +8,6 @@ public class GoblinStatusConst { ...@@ -8,7 +8,6 @@ public class GoblinStatusConst {
COMMON_TYPE_MEMBER(1, "购买条件-会员用户"), COMMON_TYPE_MEMBER(1, "购买条件-会员用户"),
COMMON_TYPE_CAN(2, "购买条件-指定用户"), COMMON_TYPE_CAN(2, "购买条件-指定用户"),
; ;
private final int value; private final int value;
private final String desc; private final String desc;
...@@ -75,6 +74,27 @@ public class GoblinStatusConst { ...@@ -75,6 +74,27 @@ public class GoblinStatusConst {
} }
} }
public enum MarketPreStatus {
MARKET_PRE_ZHENGZAI("ZZ", "正在下单前缀"),
MARKET_PRE_PURCHASE("PC", "限时秒杀前缀"),
;
private final String value;
private final String desc;
MarketPreStatus(String value, String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
......
...@@ -12,7 +12,7 @@ public class GoblinStorePurchaseParam { ...@@ -12,7 +12,7 @@ public class GoblinStorePurchaseParam {
@ApiModelProperty(required = false, value = "活动id[添加操作不需要]", example = "1") @ApiModelProperty(required = false, value = "活动id[添加操作不需要]", example = "1")
private String marketId; private String marketId;
@ApiModelProperty(required = true, value = "商铺id", example = "活动名称") @ApiModelProperty(required = true, value = "商铺id", example = "1")
private String storeId; private String storeId;
@ApiModelProperty(required = true, value = "活动名称", example = "活动名称") @ApiModelProperty(required = true, value = "活动名称", example = "活动名称")
...@@ -24,7 +24,7 @@ public class GoblinStorePurchaseParam { ...@@ -24,7 +24,7 @@ public class GoblinStorePurchaseParam {
@ApiModelProperty(required = true, value = "活动结束时间", example = "2021-12-12 12:00:00") @ApiModelProperty(required = true, value = "活动结束时间", example = "2021-12-12 12:00:00")
private String endTime; private String endTime;
@ApiModelProperty(required = true, value = "是否预热", example = "0") @ApiModelProperty(required = false, value = "是否预热", example = "0")
private Integer isPre; private Integer isPre;
@ApiModelProperty(required = false, value = "预热时间(不能早于开始时间7天)[开启预热必填]", example = "2021-12-10 12:00:00") @ApiModelProperty(required = false, value = "预热时间(不能早于开始时间7天)[开启预热必填]", example = "2021-12-10 12:00:00")
......
...@@ -22,15 +22,15 @@ public class GoblinStoreMarketVo implements Cloneable { ...@@ -22,15 +22,15 @@ public class GoblinStoreMarketVo implements Cloneable {
@ApiModelProperty(value = " 营销描述") @ApiModelProperty(value = " 营销描述")
private String desc; private String desc;
@ApiModelProperty(value = " 营销开始时间") @ApiModelProperty(value = " 营销开始时间")
private LocalDateTime startTime; private String startTime;
@ApiModelProperty(value = " 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间") @ApiModelProperty(value = " 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间")
private LocalDateTime endTime; private String endTime;
@ApiModelProperty(value = "活动是否预热[0-否|1-是]") @ApiModelProperty(value = "活动是否预热[0-否|1-是]")
private Integer isPre; private Integer isPre;
@ApiModelProperty(value = " 活动预热时间") @ApiModelProperty(value = " 活动预热时间")
private LocalDateTime preTime; private String preTime;
@ApiModelProperty(value = " 创建时间") @ApiModelProperty(value = " 创建时间")
private LocalDateTime createdAt; private String createdAt;
private static final GoblinStoreMarketVo obj = new GoblinStoreMarketVo(); private static final GoblinStoreMarketVo obj = new GoblinStoreMarketVo();
......
...@@ -14,7 +14,6 @@ import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto; ...@@ -14,7 +14,6 @@ import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketingZhengzaiRelationVo; import com.liquidnet.service.goblin.dto.vo.GoblinMarketingZhengzaiRelationVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo; import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo; import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiStoreListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiVo;
import com.liquidnet.service.goblin.entity.GoblinMarketingZhengzaiRelation; import com.liquidnet.service.goblin.entity.GoblinMarketingZhengzaiRelation;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.liquidnet.service.goblin.mapper.GoblinMarketingZhengzaiRelationMapper; import com.liquidnet.service.goblin.mapper.GoblinMarketingZhengzaiRelationMapper;
...@@ -132,18 +131,23 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -132,18 +131,23 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
} }
@Override @Override
public ResponseDto<GoblinZhengzaiVo> zhengzaiDetails(String marketId) { public ResponseDto<GoblinSelfMarketingVo> zhengzaiDetails(String marketId) {
GoblinSelfMarketing data = goblinSelfMarketingMapper.selectOne(Wrappers.lambdaQuery(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
GoblinZhengzaiVo vo = GoblinZhengzaiVo.getNew();
vo.setMarketId(data.getSelfMarketId());
vo.setName(data.getName());
vo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.format(data.getStartTime()));
vo.setEndTime(DateUtil.Formatter.yyyyMMddHHmmss.format(data.getEndTime()));
vo.setStatus(data.getStatus());
vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(data.getCreatedAt()));
return null; return null;
} }
// @Override
// public ResponseDto<GoblinZhengzaiVo> zhengzaiDetails(String marketId) {
// GoblinSelfMarketing data = goblinSelfMarketingMapper.selectOne(Wrappers.lambdaQuery(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
// GoblinZhengzaiVo vo = GoblinZhengzaiVo.getNew();
// vo.setMarketId(data.getSelfMarketId());
// vo.setName(data.getName());
// vo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.format(data.getStartTime()));
// vo.setEndTime(DateUtil.Formatter.yyyyMMddHHmmss.format(data.getEndTime()));
// vo.setStatus(data.getStatus());
// vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(data.getCreatedAt()));
// return null;
// }
@Override @Override
public ResponseDto<List<GoblinZhengzaiStoreListVo>> zhengzaiStoreList(String marketId) { public ResponseDto<List<GoblinZhengzaiStoreListVo>> zhengzaiStoreList(String marketId) {
List<GoblinZhengzaiStoreListDto> dtoList = goblinSelfMarketingMapper.getZhengzaiStoreList(marketId); List<GoblinZhengzaiStoreListDto> dtoList = goblinSelfMarketingMapper.getZhengzaiStoreList(marketId);
......
...@@ -34,7 +34,8 @@ public final class RedisUtil extends AbstractRedisUtil{ ...@@ -34,7 +34,8 @@ public final class RedisUtil extends AbstractRedisUtil{
public static void main(String[] args) { public static void main(String[] args) {
String[] keys = { String[] keys = {
"chime:per:openNum:Allow510093798172016641784538" "stone:user:773650",
"stone:item:logs:list:773650"
}; };
for (String key : keys) { for (String key : keys) {
long value = key.hashCode(); long value = key.hashCode();
......
...@@ -42,7 +42,7 @@ public class GoblinStorePurchasingController { ...@@ -42,7 +42,7 @@ public class GoblinStorePurchasingController {
}) })
public ResponseDto<PageInfo<GoblinStoreMarketVo>> purchasingList(@RequestParam(value = "page", required = false) @Valid Integer page, public ResponseDto<PageInfo<GoblinStoreMarketVo>> purchasingList(@RequestParam(value = "page", required = false) @Valid Integer page,
@RequestParam(value = "purchaseName", required = false) String purchaseName, @RequestParam(value = "purchaseName", required = false) String purchaseName,
@RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "status", required = true) Integer status,
@RequestParam(value = "startTime", required = false) String st, @RequestParam(value = "startTime", required = false) String st,
@RequestParam(value = "endTime", required = false) String et, @RequestParam(value = "endTime", required = false) String et,
@RequestParam(value = "createdAt", required = false) String ct) { @RequestParam(value = "createdAt", required = false) String ct) {
...@@ -60,22 +60,20 @@ public class GoblinStorePurchasingController { ...@@ -60,22 +60,20 @@ public class GoblinStorePurchasingController {
public ResponseDto<Boolean> purchasingStatus(@RequestParam(value = "marketId") @Valid String marketId, public ResponseDto<Boolean> purchasingStatus(@RequestParam(value = "marketId") @Valid String marketId,
@RequestParam(value = "storeId") @Valid String storeId, @RequestParam(value = "storeId") @Valid String storeId,
@RequestParam(value = "status") @Valid Integer status) { @RequestParam(value = "status") @Valid Integer status) {
return goblinStorePurchasingService.purchasingStatus(marketId, storeId,status); return goblinStorePurchasingService.purchasingStatus(marketId, storeId, status);
} }
@PostMapping("purchasing") @PostMapping("purchasing")
@ApiOperation("创建活动-限时秒杀") @ApiOperation("创建活动-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ResponseBody public ResponseDto<Boolean> purchasingInsert(@RequestBody GoblinStorePurchaseParam goblinStorePurchaseParam) {
public ResponseDto<Boolean> purchasingInsert(GoblinStorePurchaseParam goblinStorePurchaseParam) {
return goblinStorePurchasingService.purchasingInsert(goblinStorePurchaseParam.getName(), goblinStorePurchaseParam.getStoreId(), goblinStorePurchaseParam.getStartTime(), goblinStorePurchaseParam.getEndTime(), goblinStorePurchaseParam.getIsPre(), goblinStorePurchaseParam.getPreTime()); return goblinStorePurchasingService.purchasingInsert(goblinStorePurchaseParam.getName(), goblinStorePurchaseParam.getStoreId(), goblinStorePurchaseParam.getStartTime(), goblinStorePurchaseParam.getEndTime(), goblinStorePurchaseParam.getIsPre(), goblinStorePurchaseParam.getPreTime());
} }
@PutMapping("purchasing") @PutMapping("purchasing")
@ApiOperation("修改活动-限时秒杀") @ApiOperation("修改活动-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ResponseBody public ResponseDto<String> purchasingUpdate(@RequestBody GoblinStorePurchaseParam goblinStorePurchaseParam) {
public ResponseDto<String> purchasingUpdate(GoblinStorePurchaseParam goblinStorePurchaseParam) {
goblinStorePurchasingService.purchasingUpdate(goblinStorePurchaseParam.getMarketId(), goblinStorePurchaseParam.getName(), goblinStorePurchaseParam.getStoreId(), goblinStorePurchaseParam.getStartTime(), goblinStorePurchaseParam.getEndTime(), goblinStorePurchaseParam.getIsPre(), goblinStorePurchaseParam.getPreTime()); goblinStorePurchasingService.purchasingUpdate(goblinStorePurchaseParam.getMarketId(), goblinStorePurchaseParam.getName(), goblinStorePurchaseParam.getStoreId(), goblinStorePurchaseParam.getStartTime(), goblinStorePurchaseParam.getEndTime(), goblinStorePurchaseParam.getIsPre(), goblinStorePurchaseParam.getPreTime());
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -107,11 +105,19 @@ public class GoblinStorePurchasingController { ...@@ -107,11 +105,19 @@ public class GoblinStorePurchasingController {
} }
@PostMapping("purchasing/sku") @PostMapping("purchasing/sku")
@ApiOperation("活动详情-限时秒杀-sku配置") @ApiOperation("活动详情-限时秒杀-sku新增")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ResponseBody
public ResponseDto<Boolean> purchasingSkuInsert(List<GoblinStorePurchaseItemParam> params) {
return goblinStorePurchasingService.purchasingSkuInsert(params);
}
@PutMapping("purchasing/sku")
@ApiOperation("活动详情-限时秒杀-sku修改")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ResponseBody @ResponseBody
public ResponseDto<Boolean> purchasingSkuOperation(List<GoblinStorePurchaseItemParam> params) { public ResponseDto<Boolean> purchasingSkuUpdate(List<GoblinStorePurchaseItemParam> params) {
return goblinStorePurchasingService.purchasingSkuOperation(params); return goblinStorePurchasingService.purchasingSkuUpdate(params);
} }
@DeleteMapping("purchasing/sku") @DeleteMapping("purchasing/sku")
...@@ -120,12 +126,14 @@ public class GoblinStorePurchasingController { ...@@ -120,12 +126,14 @@ public class GoblinStorePurchasingController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuId", value = "skuId", example = "1"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "skuId", value = "skuId", example = "1"),
}) })
public ResponseDto<Boolean> purchasingSkuDel(@RequestParam("marketId") @Valid String marketId, public ResponseDto<Boolean> purchasingSkuDel(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId, @RequestParam("storeId") @Valid String storeId,
@RequestParam("spuId") @Valid String spuId,
@RequestParam("skuId") @Valid String skuId) { @RequestParam("skuId") @Valid String skuId) {
return goblinStorePurchasingService.purchasingSkuDel(marketId, storeId, skuId); return goblinStorePurchasingService.purchasingSkuDel(marketId, storeId, spuId, skuId);
} }
} }
package com.liquidnet.service.goblin.service.impl.manage; 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.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam; import com.liquidnet.service.goblin.dto.manage.GoblinStorePurchaseItemParam;
...@@ -10,6 +11,7 @@ import com.liquidnet.service.goblin.entity.GoblinStoreMarketing; ...@@ -10,6 +11,7 @@ import com.liquidnet.service.goblin.entity.GoblinStoreMarketing;
import com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService; 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 me.chanjar.weixin.common.util.DataUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -85,6 +87,10 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -85,6 +87,10 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
GoblinStoreMarketVo vo = GoblinStoreMarketVo.getNew(); GoblinStoreMarketVo vo = GoblinStoreMarketVo.getNew();
BeanUtils.copyProperties(bean, vo); BeanUtils.copyProperties(bean, vo);
vo.setStartTime(st);
vo.setEndTime(et);
vo.setCreatedAt(DateUtil.getNowTime());
vo.setPreTime(preTime);
//mongo //mongo
goblinMongoUtils.insertStoreMarket(vo); goblinMongoUtils.insertStoreMarket(vo);
//redis //redis
......
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