上传租赁合同所属大区更改

This commit is contained in:
zhangchenbiao
2024-06-04 17:39:55 +08:00
parent d114275c7e
commit 66c8099c94
2 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
package com.cool.store.vo.shop;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -44,20 +45,23 @@ public class RentInfoToDoVO {
@ApiModelProperty("提交时间")
private Date submitTime;
public static List<RentInfoToDoVO> convert(List<RentInfoToDoVO> list, Map<Long, Long> shopPointMap, Map<Long, PointInfoDO> pointMap, Map<Long, String> regionNameMap, Map<Long, Date> rentContractSubmitTimeMap){
public static List<RentInfoToDoVO> convert(List<RentInfoToDoVO> list, Map<Long, ShopInfoDO> shopPointMap, Map<Long, PointInfoDO> pointMap, Map<Long, String> regionNameMap, Map<Long, Date> rentContractSubmitTimeMap){
if(CollectionUtils.isEmpty(list)){
return Lists.newArrayList();
}
List<RentInfoToDoVO> resultList = new ArrayList<>();
for (RentInfoToDoVO rent : list) {
Long pointId = shopPointMap.get(rent.getShopId());
rent.setPointId(pointId);
PointInfoDO pointInfo = pointMap.get(pointId);
ShopInfoDO shopInfo = shopPointMap.get(rent.getShopId());
if(Objects.isNull(shopInfo)){
continue;
}
PointInfoDO pointInfo = pointMap.get(shopInfo.getPointId());
if(Objects.nonNull(pointInfo)){
rent.setPointName(pointInfo.getPointName());
rent.setAddress(pointInfo.getAddress());
rent.setRegionNodeName(regionNameMap.get(pointInfo.getRegionId()));
}
rent.setPointId(shopInfo.getPointId());
rent.setRegionNodeName(regionNameMap.get(shopInfo.getRegionId()));
rent.setSubmitTime(rentContractSubmitTimeMap.get(rent.getShopId()));
resultList.add(rent);
}