|
|
|
@@ -3,7 +3,12 @@ package com.iformall.service.impl; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.domain.po.WxMall; |
|
|
|
import com.iformall.domain.po.WxMallBuilding; |
|
|
|
import com.iformall.domain.po.WxMallFloor; |
|
|
|
import com.iformall.mapper.WxMallBuildingMapper; |
|
|
|
import com.iformall.mapper.WxMallFloorMapper; |
|
|
|
import com.iformall.mapper.WxMallMapper; |
|
|
|
import com.iformall.service.WxMallBuildingService; |
|
|
|
import com.iformall.service.WxMallService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@@ -11,6 +16,9 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class WxMallServiceImpl implements WxMallService { |
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
@@ -18,6 +26,11 @@ public class WxMallServiceImpl implements WxMallService { |
|
|
|
@Autowired |
|
|
|
WxMallMapper wxMallMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMallBuildingMapper wxMallBuildingMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxMallFloorMapper wxMallFloorMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxMall> listAsPage(WxMall record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -54,9 +67,38 @@ public class WxMallServiceImpl implements WxMallService { |
|
|
|
wxMall.setTenantId(id); |
|
|
|
return wxMallMapper.findList(wxMall).get(0); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public WxMall getByTenantIdExt(String id) { |
|
|
|
WxMall wxMallParam = new WxMall(); |
|
|
|
wxMallParam.setTenantId(id); |
|
|
|
WxMall wxMall = wxMallMapper.findList(wxMallParam).get(0); |
|
|
|
|
|
|
|
WxMallBuilding wxMallBuilding = new WxMallBuilding(); |
|
|
|
wxMallBuilding.setTenantId(id); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
wxMall.setBuildings(wxMallBuildings); |
|
|
|
return wxMall; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |