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

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

新增 删除参加正在下单活动店铺 接口

parent 2e1f9c31
......@@ -55,7 +55,7 @@ public class GoblinSelfZhengzaiController extends BaseController {
@RequestParam(value = "createdAt", required = false) String ct) {
LocalDateTime now = LocalDateTime.now();
PageHelper.startPage(page, size);
List<GoblinSelfMarketingDto> list = goblinZhengzaiMarketService.zhengzaiList(page, size,purchaseName, status, st, et, ct).getData();
List<GoblinSelfMarketingDto> list = goblinZhengzaiMarketService.zhengzaiList(page, size, purchaseName, status, st, et, ct).getData();
for (GoblinSelfMarketingDto item : list) {
if (item.getStatus() != 7) {
if (now.isBefore(item.getStartTime())) {
......@@ -110,12 +110,24 @@ public class GoblinSelfZhengzaiController extends BaseController {
@PostMapping("zhengzai/store")
@ApiOperation("活动详情-正在下单-新增店铺")
@ApiOperation("活动详情-正在下单-新增/修改店铺")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> purchasingStore(@RequestBody List<GoblinInsertZhengzaiParam> params) {
return goblinZhengzaiMarketService.zhengzaiStore(params);
}
@PostMapping("zhengzai/store/del")
@ApiOperation("活动详情-正在下单-删除店铺")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@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 = "0"),
})
public ResponseDto<Boolean> zhengzaiDelStore(@RequestParam(value = "marketId") @Valid String marketId,
@RequestParam(value = "storeId") @Valid String storeId) {
return goblinZhengzaiMarketService.zhengzaiDelStore(marketId, storeId);
}
// @PostMapping("zhengzai/store/update")
// @ApiOperation("活动详情-正在下单-修改店铺")
// @ApiResponse(code = 200, message = "接口返回对象参数")
......
......@@ -101,6 +101,13 @@ public interface IGoblinZhengzaiMarketService {
*/
ResponseDto<Boolean> zhengzaiStore(List<GoblinInsertZhengzaiParam> params);
/**
* 删除正在下单 可参与活动店铺
*
* @return
*/
ResponseDto<Boolean> zhengzaiDelStore(String marketId ,String storeId);
/**
* 编辑正在下单 可参与活动店铺
*
......
......@@ -274,6 +274,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
return ResponseDto.success();
}
@Override
public ResponseDto<Boolean> zhengzaiDelStore(String marketId, String storeId) {
try {
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
entity.setDelTag(1);
entity.setUpdatedAt(LocalDateTime.now());
entity.setStoreId(storeId);
entity.setSelfMarketId(marketId);
//mysql
goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId));
//mongo
goblinMongoUtils.delZhengzaiRelation(marketId, storeId);
//redis
goblinRedisUtils.delZhengzaiRelation(marketId, storeId);
goblinRedisUtils.delStoreSelfRelation(marketId, storeId);
return ResponseDto.success();
} catch (Exception e) {
e.printStackTrace();
return ResponseDto.failure("删除失败");
}
}
@Override
public ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params) {
for (GoblinInsertZhengzaiParam item : params) {
......
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