shopList增加能否修改shopCode 标识

This commit is contained in:
shuo.wang
2024-10-09 16:25:48 +08:00
parent 340bcf91a6
commit f7e3ef7679
2 changed files with 23 additions and 4 deletions

View File

@@ -1,11 +1,15 @@
package com.cool.store.vo.shop;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author zhangchenbiao
@@ -25,16 +29,27 @@ public class MiniShopPageVO {
@ApiModelProperty("店铺编码")
private String shopCode;
public MiniShopPageVO(Long shopId, String shopName,String shopCode) {
@ApiModelProperty("加盟合同签约完成标识0-未完成1-完成")
private Boolean flag;
public MiniShopPageVO(Long shopId, String shopName,String shopCode,Boolean flag) {
this.shopId = shopId;
this.shopName = shopName;
this.shopCode = shopCode;
this.flag = flag;
}
public static List<MiniShopPageVO> convertList(List<ShopInfoDO> shopInfoList) {
public static List<MiniShopPageVO> convertList(List<ShopInfoDO> shopInfoList, Map<Long, ShopStageInfoDO> stageMap ) {
List<MiniShopPageVO> resultList = new ArrayList<>();
for (ShopInfoDO shopInfo : shopInfoList) {
resultList.add(new MiniShopPageVO(shopInfo.getId(), shopInfo.getShopName(),shopInfo.getShopCode()));
ShopStageInfoDO stageInfoDO = stageMap.get(shopInfo.getId());
Boolean flag = Boolean.FALSE;
if (Objects.nonNull(stageInfoDO)) {
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_84.getShopSubStageStatus().equals(stageInfoDO.getShopSubStageStatus())) {
flag = Boolean.TRUE;
}
}
resultList.add(new MiniShopPageVO(shopInfo.getId(), shopInfo.getShopName(),shopInfo.getShopCode(),flag));
}
return resultList;
}