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