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

Commit f95772f1 authored by 张国柄's avatar 张国柄

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

parents 093a9fa5 4ea36fda
...@@ -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 = " 营销结束时间营销为定金预售的时候,该时间也是第二阶段付款的时间营销为全款预售的时候,该时间也是发货时间")
......
...@@ -78,7 +78,7 @@ public class GoblinFrontBannerController extends BaseController { ...@@ -78,7 +78,7 @@ public class GoblinFrontBannerController extends BaseController {
@ApiOperation(value = "查看详情") @ApiOperation(value = "查看详情")
@ResponseBody @ResponseBody
public AjaxResult getOne( @RequestBody GoblinFrontBanner goblinFrontBanner) { public AjaxResult getOne( @RequestBody GoblinFrontBanner goblinFrontBanner) {
logger.info("修改banner{}", JSON.toJSONString(goblinFrontBanner)); logger.info("查看详情{}", JSON.toJSONString(goblinFrontBanner));
GoblinFrontBanner goblinFrontBanner1=goblinFrontBannerService.getOne(goblinFrontBanner.getMid()); GoblinFrontBanner goblinFrontBanner1=goblinFrontBannerService.getOne(goblinFrontBanner.getMid());
return AjaxResult.success(goblinFrontBanner1); return AjaxResult.success(goblinFrontBanner1);
} }
......
package com.liquidnet.client.admin.web.controller.zhengzai.goblin; package com.liquidnet.client.admin.web.controller.zhengzai.goblin;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.client.admin.common.core.controller.BaseController; import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult; import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.zhengzai.goblin.service.impl.GoblinFrontSeckillServiceImpl;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.goblin.entity.GoblinFrontSeckill;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing; 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 io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -35,6 +35,8 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -35,6 +35,8 @@ public class GoblinFrontSeckillController extends BaseController {
GoblinStoreMarketingMapper goblinStoreMarketingMapper; GoblinStoreMarketingMapper goblinStoreMarketingMapper;
@Autowired @Autowired
GoblinSelfMarketingMapper goblinSelfMarketingMapper; GoblinSelfMarketingMapper goblinSelfMarketingMapper;
@Autowired
GoblinFrontSeckillServiceImpl goblinFrontSeckillService;
/** /**
* @author zhangfuxin * @author zhangfuxin
...@@ -65,29 +67,80 @@ public class GoblinFrontSeckillController extends BaseController { ...@@ -65,29 +67,80 @@ public class GoblinFrontSeckillController extends BaseController {
* @Description:限时秒杀添加 * @Description:限时秒杀添加
* @date 2021/12/29 下午2:51 * @date 2021/12/29 下午2:51
*/ */
@PostMapping("create")
@ApiOperation(value = "增加秒杀")
@ResponseBody
public AjaxResult create( @RequestBody GoblinFrontSeckill goblinFrontSeckill) {
logger.info("增加秒杀{}", JSON.toJSONString(goblinFrontSeckill));
boolean result=goblinFrontSeckillService.create(goblinFrontSeckill);
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
/** /**
* @author zhangfuxin * @author zhangfuxin
* @Description:限时秒杀修改 * @Description:限时秒杀修改
* @date 2021/12/29 下午2:52 * @date 2021/12/29 下午2:52
*/ */
@PostMapping("update")
@ApiOperation(value = "限时秒杀修改")
@ResponseBody
public AjaxResult update( @RequestBody GoblinFrontSeckill goblinFrontSeckill) {
logger.info("限时秒杀修改{}", JSON.toJSONString(goblinFrontSeckill));
boolean result=goblinFrontSeckillService.update(goblinFrontSeckill);
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
/*** /***
* @author zhangfuxin * @author zhangfuxin
* @Description:限时秒杀删除 * @Description:限时秒杀删除
* @date 2021/12/29 下午2:52 * @date 2021/12/29 下午2:52
*/ */
@PostMapping("delete")
@ApiOperation(value = "限时秒杀删除")
@ResponseBody
public AjaxResult delete( @RequestBody GoblinFrontSeckill goblinFrontSeckill) {
logger.info("限时秒杀删除{}", JSON.toJSONString(goblinFrontSeckill));
boolean result=goblinFrontSeckillService.delte(goblinFrontSeckill.getMid());
if (result ) {
return success("操作成功");
} else {
return error("操作失败");
}
}
/** /**
* @author zhangfuxin * @author zhangfuxin
* @Description:限时秒杀分页 * @Description:限时秒杀分页
* @date 2021/12/29 下午2:52 * @date 2021/12/29 下午2:52
*/ */
@PostMapping("page")
@ApiOperation(value = "分页")
@ResponseBody
public AjaxResult page( @RequestParam(name = "pageSize", required = true) int pageSize,@RequestParam(name = "pageNumber", required = true)int pageNumber,@RequestBody GoblinFrontSeckill goblinFrontSeckill) {
logger.info("限时秒杀分页{}", JSON.toJSONString(goblinFrontSeckill));
return AjaxResult.success(goblinFrontSeckillService.page(pageSize,pageNumber,null));
}
/** /**
* @author zhangfuxin * @author zhangfuxin
* @Description:限时秒杀详情 * @Description:限时秒杀详情
* @date 2021/12/29 下午2:54 * @date 2021/12/29 下午2:54
*/ */
@PostMapping("getOne")
@ApiOperation(value = "查看详情")
@ResponseBody
public AjaxResult getOne( @RequestBody GoblinFrontSeckill goblinFrontSeckill) {
logger.info("查看详情{}", JSON.toJSONString(goblinFrontSeckill));
GoblinFrontSeckill goblinFrontSeckill1=goblinFrontSeckillService.getOne(goblinFrontSeckill.getMid());
return AjaxResult.success(goblinFrontSeckill1);
}
} }
...@@ -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);
} }
......
package com.liquidnet.client.admin.zhengzai.goblin.service.impl; package com.liquidnet.client.admin.zhengzai.goblin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontSeckillService; import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontSeckillService;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.entity.GoblinFrontSeckill; import com.liquidnet.service.goblin.entity.GoblinFrontSeckill;
import com.liquidnet.service.goblin.mapper.GoblinFrontSeckillMapper; import com.liquidnet.service.goblin.mapper.GoblinFrontSeckillMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
/** /**
* <p> * <p>
* 秒杀表 服务实现类 * 秒杀表 服务实现类
...@@ -16,5 +26,55 @@ import org.springframework.stereotype.Service; ...@@ -16,5 +26,55 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class GoblinFrontSeckillServiceImpl extends ServiceImpl<GoblinFrontSeckillMapper, GoblinFrontSeckill> implements IGoblinFrontSeckillService { public class GoblinFrontSeckillServiceImpl extends ServiceImpl<GoblinFrontSeckillMapper, GoblinFrontSeckill> implements IGoblinFrontSeckillService {
@Autowired
GoblinFrontSeckillMapper goblinFrontSeckillMapper;
public boolean create(GoblinFrontSeckill goblinFrontSeckill){
goblinFrontSeckill.setCreateTime(LocalDateTime.now());
//设置bannerid
goblinFrontSeckill.setSeckilId(GoblinRedisConst.FRONT_BANNER+ IDGenerator.nextTimeId());
//增加 banner
goblinFrontSeckillMapper.insert(goblinFrontSeckill);
return true;
}
/***
* @author zhangfuxin
* @Description: 修改
* @date 2021/12/27 下午4:03
*/
public boolean update(GoblinFrontSeckill goblinFrontSeckill){
goblinFrontSeckill.setUpdateTime(LocalDateTime.now());
//数据库修改
goblinFrontSeckillMapper.updateById(goblinFrontSeckill);
return true;
}
public GoblinFrontSeckill getOne(Long id){
return goblinFrontSeckillMapper.selectById(id);
}
public boolean delte(Long id){
GoblinFrontSeckill goblinFrontSeckill=goblinFrontSeckillMapper.selectById(id);
goblinFrontSeckill.setDelTag(1);
this.update(goblinFrontSeckill);
return true;
}
/**
* @author zhangfuxin
* @Description:分页
* @date 2021/12/27 下午5:19
*/
public PageInfo<GoblinFrontSeckill> page(int pageSize, int pageNumber, GoblinFrontSeckill goblinFrontSeckill) {
PageInfo<GoblinFrontSeckill> pageInfoTmp = null;
try {
PageHelper.startPage(pageNumber, pageSize);
LambdaQueryWrapper<GoblinFrontSeckill> queryWrapper = Wrappers.lambdaQuery(GoblinFrontSeckill.class);
queryWrapper.orderByDesc(GoblinFrontSeckill::getCreateTime);
List<GoblinFrontSeckill> list=goblinFrontSeckillMapper.selectList(queryWrapper);
pageInfoTmp = new PageInfo(list);
} catch (Exception e) {
return new PageInfo();
}
return pageInfoTmp;
}
} }
...@@ -74,16 +74,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -74,16 +74,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();
} }
...@@ -96,6 +108,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -96,6 +108,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
...@@ -123,6 +136,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -123,6 +136,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
//mongo //mongo
GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew(); GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(selfMarketing, vo); BeanUtils.copyProperties(selfMarketing, vo);
vo.setName(purchaseName);
vo.setStartTime(st); vo.setStartTime(st);
vo.setEndTime(et); vo.setEndTime(et);
goblinMongoUtils.updateSelfMarket(marketId, vo); goblinMongoUtils.updateSelfMarket(marketId, vo);
...@@ -133,22 +147,15 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -133,22 +147,15 @@ 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
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);
...@@ -179,6 +186,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -179,6 +186,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
goblinMongoUtils.insertZhengzaiRelation(vo); goblinMongoUtils.insertZhengzaiRelation(vo);
//redis //redis
goblinRedisUtils.setZhengzaiRelation(marketId, vo); goblinRedisUtils.setZhengzaiRelation(marketId, vo);
goblinRedisUtils.addStoreSelfRelation(marketId,storeId);
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -187,21 +195,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -187,21 +195,28 @@ 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);
goblinRedisUtils.addStoreSelfRelation(marketId,storeId);
} 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
goblinRedisUtils.delZhengzaiRelation(marketId, storeId); goblinRedisUtils.delZhengzaiRelation(marketId, storeId);
goblinRedisUtils.delStoreSelfRelation(marketId,storeId);
} }
return ResponseDto.success(); return ResponseDto.success();
} }
......
...@@ -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-有质检报告]
......
...@@ -66,5 +66,7 @@ public class GoblinFrontSeckill implements Serializable { ...@@ -66,5 +66,7 @@ public class GoblinFrontSeckill implements Serializable {
*/ */
private Integer indexs; private Integer indexs;
private String seckilId;
} }
...@@ -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);
} }
...@@ -48,6 +60,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -48,6 +60,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
case 0: case 0:
case 7: case 7:
bean.setStatus(status); bean.setStatus(status);
bean.setDelFlag(0);
GoblinStoreMarketVo vo = GoblinStoreMarketVo.getNew(); GoblinStoreMarketVo vo = GoblinStoreMarketVo.getNew();
vo.setStatus(status); vo.setStatus(status);
goblinMongoUtils.updateStoreMarket(marketId, storeId, vo); goblinMongoUtils.updateStoreMarket(marketId, storeId, vo);
...@@ -75,7 +88,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -75,7 +88,7 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
bean.setType(2); bean.setType(2);
bean.setStatus(0); bean.setStatus(0);
bean.setStoreId(storeId); bean.setStoreId(storeId);
bean.setDesc(""); bean.setDescribes("");
bean.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS)); bean.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
bean.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS)); bean.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
bean.setDelFlag(0); bean.setDelFlag(0);
...@@ -106,15 +119,17 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS ...@@ -106,15 +119,17 @@ public class GoblinStorePurchasingServiceImpl implements IGoblinStorePurchasingS
bean.setType(2); bean.setType(2);
bean.setStatus(0); bean.setStatus(0);
bean.setStoreId(storeId); bean.setStoreId(storeId);
bean.setDesc(""); bean.setDescribes("");
bean.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS)); bean.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
bean.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS)); bean.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
bean.setDelFlag(0); bean.setDelFlag(0);
bean.setIsPre(isPre); bean.setIsPre(isPre);
if (isPre == 1) { if (isPre == 1) {
bean.setPreTime(LocalDateTime.parse(preTime, DTF_YMD_HMS)); bean.setPreTime(LocalDateTime.parse(preTime, DTF_YMD_HMS));
}else{
bean.setPreTime(null);
} }
bean.setCreatedAt(LocalDateTime.now()); bean.setUpdatedAt(LocalDateTime.now());
GoblinStoreMarketVo vo = GoblinStoreMarketVo.getNew(); GoblinStoreMarketVo vo = GoblinStoreMarketVo.getNew();
BeanUtils.copyProperties(bean, vo); BeanUtils.copyProperties(bean, vo);
......
...@@ -38,4 +38,5 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -38,4 +38,5 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
} }
return null; return null;
} }
} }
...@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo; ...@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.dto.vo.GoblinStoreMarketVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Component @Component
......
goblin.store.market.insert=INSERT INTO goblin_store_marketing (`store_market_id`,`name`,`type`,`status`,`store_id`,`start_time`,`end_time`,`del_flag`,`is_pre`,`pre_time`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?)
goblin.store.market.status=UPDATE goblin_store_marketing SET status=? , del_flag=? WHERE store_market_id =? and store_id =?
goblin.store.market.update=UPDATE goblin_store_marketing SET name=?,type=?,status=?,store_id=?,describes=?,start_time=?,end_time=?,del_flag=?,is_pre=?,pre_time=?,updated_at=? WHERE store_market_id =? and store_id =?
\ No newline at end of file
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