| | |
| | | import com.supersavedriving.driver.modular.system.dao.AgentMapper; |
| | | import com.supersavedriving.driver.modular.system.dao.TBranchOfficeAreaMapper; |
| | | import com.supersavedriving.driver.modular.system.model.Agent; |
| | | import com.supersavedriving.driver.modular.system.model.BranchOffice; |
| | | import com.supersavedriving.driver.modular.system.model.TBranchOfficeArea; |
| | | import com.supersavedriving.driver.modular.system.service.IAgentService; |
| | | import com.supersavedriving.driver.modular.system.service.IBranchOfficeService; |
| | | import com.supersavedriving.driver.modular.system.service.ITBranchOfficeAreaService; |
| | | import com.supersavedriving.driver.modular.system.warpper.OpenCityWarpper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @Autowired |
| | | private TBranchOfficeAreaMapper branchOfficeAreaMapper; |
| | | |
| | | @Autowired |
| | | private IBranchOfficeService branchOfficeService; |
| | | |
| | | /** |
| | | * 获取开通省市数据 |
| | | * @return |
| | |
| | | */ |
| | | @Override |
| | | public List<OpenCityWarpper> queryOpenCity() throws Exception { |
| | | List<TBranchOfficeArea> branchOfficeAreas = branchOfficeAreaMapper.selectList(new EntityWrapper<TBranchOfficeArea>()); |
| | | List<BranchOffice> branchOffices = branchOfficeService.selectList(new EntityWrapper<BranchOffice>().eq("status", 1)); |
| | | List<Integer> collect = new ArrayList<>(); |
| | | if(branchOffices.size() == 0){ |
| | | collect.add(-1); |
| | | }else{ |
| | | collect = branchOffices.stream().map(BranchOffice::getId).collect(Collectors.toList()); |
| | | } |
| | | List<TBranchOfficeArea> branchOfficeAreas = branchOfficeAreaMapper.selectList(new EntityWrapper<TBranchOfficeArea>().in("branchOfficeId", collect)); |
| | | List<OpenCityWarpper> province = new ArrayList<>(); |
| | | |
| | | //遍历处理省级数据 |