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

Commit 5e49f2dc authored by 胡佳晨's avatar 胡佳晨

正在活动编辑 批量修改状态 批量添加可参与店铺

parent 60fb7a26
package com.liquidnet.service.goblin.dto.manage;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "GoblinInsertZhengzaiParam")
@Data
public class GoblinInsertZhengzaiParam {
@ApiModelProperty(required = true, value = "活动id")
private String marketId;
@ApiModelProperty(required = true, value = "商铺id")
private String storeId;
@ApiModelProperty(required = true, value = "显示时间")
private String showTime;
}
......@@ -4,6 +4,7 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
......@@ -113,10 +114,8 @@ public class GoblinSelfZhengzaiController extends BaseController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "商铺id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "showTime", value = "显示时间", example = "0"),
})
public ResponseDto<Boolean> purchasingStore(@RequestParam("marketId") @Valid String marketId,
@RequestParam("storeId") @Valid String storeId,
@RequestParam("showTime") @Valid String showTime) {
return goblinZhengzaiMarketService.zhengzaiStore(marketId, storeId, showTime);
public ResponseDto<Boolean> purchasingStore(@RequestBody List<GoblinInsertZhengzaiParam> params) {
return goblinZhengzaiMarketService.zhengzaiStore(params);
}
@PostMapping("zhengzai/store/insert")
......
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfZhengzaiSkuVo;
......@@ -94,11 +95,9 @@ public interface IGoblinZhengzaiMarketService {
/**
* 添加正在下单 可参与活动店铺
*
* @param marketId
* @param storeId
* @return
*/
ResponseDto<Boolean> zhengzaiStore(String marketId, String storeId, String showTime);
ResponseDto<Boolean> zhengzaiStore(List<GoblinInsertZhengzaiParam> params);
/**
* 编辑正在下单 可参与活动店铺
......
......@@ -15,6 +15,7 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreDetailsDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.*;
/*import com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiVo;*/
import com.liquidnet.service.goblin.entity.GoblinMarketingZhengzaiRelation;
......@@ -72,7 +73,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
if ((st != null && !st.equals("")) && (et != null && !et.equals(""))) {
queryMapper.ge(GoblinSelfMarketing::getStartTime, st).le(GoblinSelfMarketing::getEndTime, et);
}
if (ct != null&& !ct.equals("")) {
if (ct != null && !ct.equals("")) {
queryMapper.eq(GoblinSelfMarketing::getCreatedAt, ct);
}
return ResponseDto.success(goblinSelfMarketingMapper.selectList(queryMapper));
......@@ -81,29 +82,32 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override
public ResponseDto<Boolean> zhengzaiStatus(String marketId, int status) {
GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew();
if (status == -1) {
selfMarketing.setStatus(0);
selfMarketing.setDelFlag(1);
selfMarketing.setUpdatedAt(LocalDateTime.now());
//mysql
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId));
//mongo
goblinMongoUtils.delSelfMarket(marketId);
//redis
goblinRedisUtils.delSelfMarket(marketId);
goblinRedisUtils.delZhengzaiList(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);
GoblinSelfMarketingVo changeVo = goblinMongoUtils.updateSelfMarket(marketId, vo);
//redis
goblinRedisUtils.setSelfMarket(marketId, changeVo);
goblinRedisUtils.changeZhengzaiList(changeVo);
String[] marketIdArray = marketId.split(",");
for (String item : marketIdArray) {
if (status == -1) {
selfMarketing.setStatus(0);
selfMarketing.setDelFlag(1);
selfMarketing.setUpdatedAt(LocalDateTime.now());
//mysql
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, item));
//mongo
goblinMongoUtils.delSelfMarket(item);
//redis
goblinRedisUtils.delSelfMarket(item);
goblinRedisUtils.delZhengzaiList(item);
} else {
selfMarketing.setStatus(status);
selfMarketing.setUpdatedAt(LocalDateTime.now());
//mysql
goblinSelfMarketingMapper.update(selfMarketing, Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, item));
//mongo
GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(selfMarketing, vo);
GoblinSelfMarketingVo changeVo = goblinMongoUtils.updateSelfMarket(item, vo);
//redis
goblinRedisUtils.setSelfMarket(item, changeVo);
goblinRedisUtils.changeZhengzaiList(changeVo);
}
}
return ResponseDto.success();
}
......@@ -182,22 +186,27 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
}
@Override
public ResponseDto<Boolean> zhengzaiStore(String marketId, String storeId, String showTime) {
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
entity.setSelfMarketId(marketId);
entity.setStoreId(storeId);
entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS));
//mysql
goblinMarketingZhengzaiRelationMapper.insert(entity);
//mongo
GoblinMarketingZhengzaiRelationVo vo = GoblinMarketingZhengzaiRelationVo.getNew();
BeanUtils.copyProperties(entity, vo);
vo.setShowTime(showTime);
vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(entity.getCreatedAt()));
goblinMongoUtils.insertZhengzaiRelation(vo);
//redis
goblinRedisUtils.setZhengzaiRelation(marketId, vo);
goblinRedisUtils.addStoreSelfRelation(marketId, storeId);
public ResponseDto<Boolean> zhengzaiStore(List<GoblinInsertZhengzaiParam> params) {
for (GoblinInsertZhengzaiParam item : params) {
String marketId = item.getMarketId();
String storeId = item.getStoreId();
String showTime = item.getShowTime();
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
entity.setSelfMarketId(marketId);
entity.setStoreId(storeId);
entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS));
//mysql
goblinMarketingZhengzaiRelationMapper.insert(entity);
//mongo
GoblinMarketingZhengzaiRelationVo vo = GoblinMarketingZhengzaiRelationVo.getNew();
BeanUtils.copyProperties(entity, vo);
vo.setShowTime(showTime);
vo.setCreatedAt(DateUtil.Formatter.yyyyMMddHHmmss.format(entity.getCreatedAt()));
goblinMongoUtils.insertZhengzaiRelation(vo);
//redis
goblinRedisUtils.setZhengzaiRelation(marketId, vo);
goblinRedisUtils.addStoreSelfRelation(marketId, storeId);
}
return ResponseDto.success();
}
......@@ -233,11 +242,11 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
}
@Override
public ResponseDto<List<GoblinMarketSpuListVo>> zhengzaiSpuList(String marketId, String storeId,int page) {
public ResponseDto<List<GoblinMarketSpuListVo>> zhengzaiSpuList(String marketId, String storeId, int page) {
MultiValueMap<String, String> params = new LinkedMultiValueMap();
params.add("selfMarketId", marketId);
params.add("storeId", storeId);
params.add("page", page+"");
params.add("page", page + "");
String returnData = HttpUtil.post(goblinUrl + "/goblin/inner/config/del", params, null);
ResponseDto<List<GoblinMarketSpuListVo>> rsp = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<List<GoblinMarketSpuListVo>>>() {
});
......
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