上传租赁合同所属大区更改
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.vo.shop;
|
package com.cool.store.vo.shop;
|
||||||
|
|
||||||
import com.cool.store.entity.PointInfoDO;
|
import com.cool.store.entity.PointInfoDO;
|
||||||
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -44,20 +45,23 @@ public class RentInfoToDoVO {
|
|||||||
@ApiModelProperty("提交时间")
|
@ApiModelProperty("提交时间")
|
||||||
private Date submitTime;
|
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)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
List<RentInfoToDoVO> resultList = new ArrayList<>();
|
List<RentInfoToDoVO> resultList = new ArrayList<>();
|
||||||
for (RentInfoToDoVO rent : list) {
|
for (RentInfoToDoVO rent : list) {
|
||||||
Long pointId = shopPointMap.get(rent.getShopId());
|
ShopInfoDO shopInfo = shopPointMap.get(rent.getShopId());
|
||||||
rent.setPointId(pointId);
|
if(Objects.isNull(shopInfo)){
|
||||||
PointInfoDO pointInfo = pointMap.get(pointId);
|
continue;
|
||||||
|
}
|
||||||
|
PointInfoDO pointInfo = pointMap.get(shopInfo.getPointId());
|
||||||
if(Objects.nonNull(pointInfo)){
|
if(Objects.nonNull(pointInfo)){
|
||||||
rent.setPointName(pointInfo.getPointName());
|
rent.setPointName(pointInfo.getPointName());
|
||||||
rent.setAddress(pointInfo.getAddress());
|
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()));
|
rent.setSubmitTime(rentContractSubmitTimeMap.get(rent.getShopId()));
|
||||||
resultList.add(rent);
|
resultList.add(rent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1035,7 +1035,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
if(Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())){
|
if(Objects.nonNull(todoPage) && CollectionUtils.isNotEmpty(todoPage.getResult())){
|
||||||
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());
|
List<Long> shopIds = todoPage.getResult().stream().map(RentInfoToDoVO::getShopId).collect(Collectors.toList());
|
||||||
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
List<ShopInfoDO> shopList = shopInfoDAO.getShopListByIds(shopIds);
|
||||||
Map<Long, Long> shopPointMap = shopList.stream().collect(Collectors.toMap(k->k.getId(), v->v.getPointId()));
|
Map<Long, ShopInfoDO> shopPointMap = shopList.stream().collect(Collectors.toMap(k->k.getId(), Function.identity()));
|
||||||
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
List<Long> regionIds = shopList.stream().map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
|
||||||
List<Long> pointIds = shopList.stream().map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
List<Long> pointIds = shopList.stream().map(ShopInfoDO::getPointId).collect(Collectors.toList());
|
||||||
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
List<PointInfoDO> pointList = pointInfoDAO.getPointListByIds(pointIds);
|
||||||
|
|||||||
Reference in New Issue
Block a user