|
|
|
@@ -1,15 +1,19 @@ |
|
|
|
package com.simple.service.impl; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.simple.common.IdWorker; |
|
|
|
import com.simple.common.ResultData; |
|
|
|
import com.simple.domain.po.WxMallBuilding; |
|
|
|
import com.simple.domain.po.WxMallFloor; |
|
|
|
import com.simple.mapper.WxMallBuildingMapper; |
|
|
|
import com.simple.mapper.WxMallFloorMapper; |
|
|
|
import com.simple.service.WxMallBuildingService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.simple.common.IdWorker; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxMallBuildingServiceImpl implements WxMallBuildingService { |
|
|
|
@@ -17,6 +21,8 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { |
|
|
|
@Autowired |
|
|
|
WxMallBuildingMapper wxMallBuildingMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMallFloorMapper wxMallFloorMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMallBuilding> listAsPage(WxMallBuilding record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -53,5 +59,33 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService { |
|
|
|
return new ResultData(list); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData getbuildingfloorlist(String tenantId) { |
|
|
|
WxMallBuilding wxMallBuilding = new WxMallBuilding(); |
|
|
|
wxMallBuilding.setTenantId(tenantId); |
|
|
|
List<WxMallBuilding> buildings = wxMallBuildingMapper.findList(wxMallBuilding); |
|
|
|
List<WxMallBuilding> wxMallBuildings = buildings.stream().map(b -> { |
|
|
|
WxMallBuilding tempb = new WxMallBuilding(); |
|
|
|
tempb.setId(b.getId()); |
|
|
|
tempb.setName(b.getName()); |
|
|
|
return tempb; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
for(WxMallBuilding building:wxMallBuildings){ |
|
|
|
WxMallFloor wxMallFloor = new WxMallFloor(); |
|
|
|
wxMallFloor.setBuildingId(building.getId()); |
|
|
|
List<WxMallFloor> wxMallFloors = wxMallFloorMapper.findList(wxMallFloor).stream().map(f -> { |
|
|
|
WxMallFloor tempf = new WxMallFloor(); |
|
|
|
tempf.setId(f.getId()); |
|
|
|
tempf.setFloorName(f.getFloorName()); |
|
|
|
return tempf; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
building.setFloors(wxMallFloors); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new ResultData(wxMallBuildings); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |