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

Commit 2e1a2d5f authored by 胡佳晨's avatar 胡佳晨

admin 正在下单 和 商品关联接口 待测

goblin 活动添加 商品sku 待测
goblin 正在下单 未测
parent ebb7d79a
...@@ -31,7 +31,7 @@ public class GoblinSelfMarketingVo implements Serializable, Cloneable { ...@@ -31,7 +31,7 @@ public class GoblinSelfMarketingVo implements Serializable, Cloneable {
@ApiModelProperty(value = "活动状态[-1-全部|0-等待开始|1-活动中|2-活动结束|7-停用]") @ApiModelProperty(value = "活动状态[-1-全部|0-等待开始|1-活动中|2-活动结束|7-停用]")
private Integer status; private Integer status;
@ApiModelProperty(value = "营销描述") @ApiModelProperty(value = "营销描述")
private String desc; private String describes;
@ApiModelProperty(value = "营销开始时间") @ApiModelProperty(value = "营销开始时间")
private String startTime; private String startTime;
@ApiModelProperty(value = "营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间") @ApiModelProperty(value = "营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间")
......
...@@ -20,7 +20,7 @@ public class GoblinStoreMarketVo implements Cloneable { ...@@ -20,7 +20,7 @@ public class GoblinStoreMarketVo implements Cloneable {
@ApiModelProperty(value = " 商铺id") @ApiModelProperty(value = " 商铺id")
private String storeId; private String storeId;
@ApiModelProperty(value = " 营销描述") @ApiModelProperty(value = " 营销描述")
private String desc; private String describes;
@ApiModelProperty(value = " 营销开始时间") @ApiModelProperty(value = " 营销开始时间")
private String startTime; private String startTime;
@ApiModelProperty(value = " 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间") @ApiModelProperty(value = " 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间")
......
...@@ -63,12 +63,12 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -63,12 +63,12 @@ public class GoblinSelfZhengzaiController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@PutMapping("zhengzai/status") @PostMapping("zhengzai/status")
@ApiOperation("活动操作-正在下单") @ApiOperation("活动操作-正在下单-修改状态")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@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 = "Integer", name = "status", value = "活动状态[0-等待开始|7-停用]", example = "0"), @ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "status", value = "活动状态[0-等待开始|7-停用|-1-删除]", example = "0"),
}) })
public ResponseDto<Boolean> purchasingStatus(@RequestParam(value = "marketId") @Valid String marketId, public ResponseDto<Boolean> purchasingStatus(@RequestParam(value = "marketId") @Valid String marketId,
@RequestParam(value = "status") @Valid Integer status) { @RequestParam(value = "status") @Valid Integer status) {
...@@ -104,7 +104,7 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -104,7 +104,7 @@ public class GoblinSelfZhengzaiController extends BaseController {
@PostMapping("zhengzai/store") @PostMapping("zhengzai/store")
@ApiOperation("活动详情-正在下单-配置店铺") @ApiOperation("活动详情-正在下单-新增店铺")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@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"),
...@@ -114,7 +114,7 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -114,7 +114,7 @@ public class GoblinSelfZhengzaiController extends BaseController {
public ResponseDto<Boolean> purchasingStore(@RequestParam("marketId") @Valid String marketId, public ResponseDto<Boolean> purchasingStore(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId, @RequestParam("storeId") @Valid String storeId,
@RequestParam("showTime") @Valid String showTime) { @RequestParam("showTime") @Valid String showTime) {
return goblinZhengzaiMarketService.zhengzaiStore(marketId,storeId,showTime); return goblinZhengzaiMarketService.zhengzaiStore(marketId, storeId, showTime);
} }
@PutMapping("zhengzai/store") @PutMapping("zhengzai/store")
...@@ -130,7 +130,7 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -130,7 +130,7 @@ public class GoblinSelfZhengzaiController extends BaseController {
@RequestParam("storeId") @Valid String storeId, @RequestParam("storeId") @Valid String storeId,
@RequestParam("showTime") @Valid String showTime, @RequestParam("showTime") @Valid String showTime,
@RequestParam("delTag") @Valid Integer delTag) { @RequestParam("delTag") @Valid Integer delTag) {
return goblinZhengzaiMarketService.zhengzaiStore(marketId,storeId,showTime); return goblinZhengzaiMarketService.zhengzaiStore(marketId, storeId, showTime, delTag);
} }
......
...@@ -73,16 +73,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -73,16 +73,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override @Override
public ResponseDto<Boolean> zhengzaiStatus(String marketId, int status) { public ResponseDto<Boolean> zhengzaiStatus(String marketId, int status) {
GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew(); GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew();
selfMarketing.setStatus(status); if (status == -1) {
selfMarketing.setUpdatedAt(LocalDateTime.now()); selfMarketing.setStatus(0);
//mysql selfMarketing.setDelFlag(1);
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId)); selfMarketing.setUpdatedAt(LocalDateTime.now());
//mongo //mysql
GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew(); goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
BeanUtils.copyProperties(selfMarketing, vo); //mongo
goblinMongoUtils.updateSelfMarket(marketId, vo); goblinMongoUtils.delSelfMarket(marketId);
//redis //redis
goblinRedisUtils.setSelfMarket(marketId, vo); goblinRedisUtils.delSelfMarket(marketId);
} else {
selfMarketing.setStatus(status);
selfMarketing.setUpdatedAt(LocalDateTime.now());
//mysql
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
//mongo
GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(selfMarketing, vo);
goblinMongoUtils.updateSelfMarket(marketId, vo);
//redis
goblinRedisUtils.setSelfMarket(marketId, vo);
}
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -95,6 +107,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -95,6 +107,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue()); selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue());
selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS)); selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS)); selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
selfMarketing.setCreatedAt(LocalDateTime.now());
//mysql //mysql
goblinSelfMarketingMapper.insert(selfMarketing); goblinSelfMarketingMapper.insert(selfMarketing);
//mongo //mongo
...@@ -132,7 +145,13 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -132,7 +145,13 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override @Override
public ResponseDto<GoblinSelfMarketingVo> zhengzaiDetails(String marketId) { public ResponseDto<GoblinSelfMarketingVo> zhengzaiDetails(String marketId) {
return null; GoblinSelfMarketing bean = goblinSelfMarketingMapper.selectOne(Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(bean, vo);
vo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.format(bean.getStartTime()));
vo.setEndTime(DateUtil.Formatter.yyyyMMddHHmmss.format(bean.getEndTime()));
vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(bean.getCreatedAt()));
return ResponseDto.success(vo);
} }
// @Override // @Override
...@@ -186,17 +205,22 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -186,17 +205,22 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
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));
entity.setUpdatedAt(LocalDateTime.now());
//mysql //mysql
goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId)); goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId));
//mongo //mongo
GoblinMarketingZhengzaiRelationVo vo = GoblinMarketingZhengzaiRelationVo.getNew(); GoblinMarketingZhengzaiRelationVo vo = GoblinMarketingZhengzaiRelationVo.getNew();
BeanUtils.copyProperties(entity, vo); BeanUtils.copyProperties(entity, vo);
vo.setShowTime(showTime); vo.setShowTime(showTime);
vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(entity.getCreatedAt()));
goblinMongoUtils.updateZhengzaiRelation(marketId, storeId, vo); goblinMongoUtils.updateZhengzaiRelation(marketId, storeId, vo);
//redis //redis
goblinRedisUtils.setZhengzaiRelation(marketId, vo); goblinRedisUtils.setZhengzaiRelation(marketId, vo);
} else if (delTag == 1) { } else if (delTag == 1) {
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
entity.setDelTag(1);
entity.setUpdatedAt(LocalDateTime.now());
//mysql
goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId));
//mongo //mongo
goblinMongoUtils.delZhengzaiRelation(marketId, storeId); goblinMongoUtils.delZhengzaiRelation(marketId, storeId);
//redis //redis
......
...@@ -33,6 +33,10 @@ public class GoblinMongoUtils { ...@@ -33,6 +33,10 @@ public class GoblinMongoUtils {
object); object);
} }
public DeleteResult delSelfMarket(String selfMarketId) {
return mongoTemplate.remove(Query.query(Criteria.where("selfMarketId").is(selfMarketId)), GoblinSelfMarketingVo.class.getSimpleName());
}
public GoblinMarketingZhengzaiRelationVo insertZhengzaiRelation(GoblinMarketingZhengzaiRelationVo data) { public GoblinMarketingZhengzaiRelationVo insertZhengzaiRelation(GoblinMarketingZhengzaiRelationVo data) {
return mongoTemplate.insert(data, GoblinMarketingZhengzaiRelationVo.class.getSimpleName()); return mongoTemplate.insert(data, GoblinMarketingZhengzaiRelationVo.class.getSimpleName());
} }
......
...@@ -27,6 +27,16 @@ public class GoblinRedisUtils { ...@@ -27,6 +27,16 @@ public class GoblinRedisUtils {
redisDataSourceUtil.getRedisGoblinUtil().set(redisKey, data); redisDataSourceUtil.getRedisGoblinUtil().set(redisKey, data);
} }
/**
* 删除店铺活动
*
* @param selfMarketId
*/
public void delSelfMarket(String selfMarketId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SELF_MARKET.concat(selfMarketId);
redisDataSourceUtil.getRedisGoblinUtil().del(redisKey);
}
/** /**
* 正在下单 可参加商户 * 正在下单 可参加商户
* *
......
...@@ -73,7 +73,7 @@ public class GoblinBackOrder implements Serializable { ...@@ -73,7 +73,7 @@ public class GoblinBackOrder implements Serializable {
/** /**
* 问题说明 * 问题说明
*/ */
private String desc; private String describes;
/** /**
* 申请凭据[0-没有任何凭据|1-有发票|2-有质检报告] * 申请凭据[0-没有任何凭据|1-有发票|2-有质检报告]
......
...@@ -49,7 +49,7 @@ public class GoblinSelfMarketing implements Serializable, Cloneable { ...@@ -49,7 +49,7 @@ public class GoblinSelfMarketing implements Serializable, Cloneable {
/** /**
* 营销描述 * 营销描述
*/ */
private String desc; private String describes;
/** /**
* 营销开始时间 * 营销开始时间
......
...@@ -54,7 +54,7 @@ public class GoblinStoreMarketing implements Serializable ,Cloneable{ ...@@ -54,7 +54,7 @@ public class GoblinStoreMarketing implements Serializable ,Cloneable{
/** /**
* 营销描述 * 营销描述
*/ */
private String desc; private String describes;
/** /**
* 营销开始时间 * 营销开始时间
......
...@@ -49,7 +49,7 @@ public class GoblinStorePurchasingController { ...@@ -49,7 +49,7 @@ public class GoblinStorePurchasingController {
return goblinStorePurchasingService.purchasingList(page, purchaseName, status, st, et, ct); return goblinStorePurchasingService.purchasingList(page, purchaseName, status, st, et, ct);
} }
@PutMapping("purchasing/status") @PostMapping("purchasing/status")
@ApiOperation("活动操作-限时秒杀") @ApiOperation("活动操作-限时秒杀")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ @ApiImplicitParams({
......
...@@ -12,6 +12,7 @@ import com.liquidnet.service.goblin.service.manage.IGoblinStorePurchasingService ...@@ -12,6 +12,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 me.chanjar.weixin.common.util.DataUtils; import me.chanjar.weixin.common.util.DataUtils;
import org.apache.commons.lang.time.DateUtils;
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;
...@@ -33,8 +34,19 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -33,8 +34,19 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
@Override @Override
public ResponseDto<PageInfo<GoblinStoreMarketVo>> purchasingList(int page, String purchaseName, int status, String st, String et, String ct) { public ResponseDto<PageInfo<GoblinStoreMarketVo>> purchasingList(int page, String purchaseName, int status, String st, String et, String ct) {
PageInfo pageInfo = new PageInfo(); PageInfo pageInfo = new PageInfo();
LocalDateTime now = LocalDateTime.now();
HashMap<String, Object> map = goblinMongoUtils.getStoreMarketList(page, purchaseName, status, st, et, ct); HashMap<String, Object> map = goblinMongoUtils.getStoreMarketList(page, purchaseName, status, st, et, ct);
pageInfo.setList((List) map.get("data")); List<GoblinStoreMarketVo> list = (List<GoblinStoreMarketVo>) map.get("data");
for (GoblinStoreMarketVo item : list) {
if (LocalDateTime.parse(item.getStartTime(), DTF_YMD_HMS).isAfter(now)) {
item.setStatus(0);
} else if (LocalDateTime.parse(item.getEndTime(), DTF_YMD_HMS).isBefore(now)) {
item.setStatus(2);
} else {
item.setStatus(1);
}
}
pageInfo.setList(list);
pageInfo.setTotal((Long) map.get("total")); pageInfo.setTotal((Long) map.get("total"));
return ResponseDto.success(pageInfo); return ResponseDto.success(pageInfo);
} }
......
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