| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public FebsResponse findLeaderListInPage(ApiLeaderListDto apiLeaderListDto) { |
| | | //根据当前位置的经纬度查询在所属配送区域内的团长 |
| | |
| | | apiLeaderInfoVo.setTownship(mallTeamLeader.getTownship()); |
| | | apiLeaderInfoVo.setDetailAddress(mallTeamLeader.getDetailAddress()); |
| | | apiLeaderInfoVo.setAddressArea(mallTeamLeader.getAddressArea()); |
| | | } |
| | | if(ObjectUtil.isEmpty(apiLeaderInfoVo)){ |
| | | return new FebsResponse().success(); |
| | | } |
| | | return new FebsResponse().success().data(apiLeaderInfoVo); |
| | | } |
| | |
| | | return MallLeaderAchieveConversion.INSTANCE.entitysToVos(mallLeaderAchieves.getRecords()); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse findSomeLeaderListInPage(ApiLeaderListDto apiLeaderListDto) { |
| | | Page<MallTeamLeader> page = new Page<>(apiLeaderListDto.getPageNum(), apiLeaderListDto.getPageSize()); |
| | | IPage<MallTeamLeader> mallTeamLeaderIPage = this.baseMapper.selectApiLeaderListInPage(page, apiLeaderListDto); |
| | | List<ApiLeaderListVo> apiLeaderListVos = new ArrayList<>(); |
| | | |
| | | DataDictionaryCustom rangeSwitchDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.RANGE_SWITCH.getType(), DataDictionaryEnum.RANGE_SWITCH.getCode()); |
| | | if (ObjectUtil.isNotNull(rangeSwitchDic)) { |
| | | int rangeSwitch = Integer.parseInt(rangeSwitchDic.getValue()); |
| | | if(1 == rangeSwitch){ |
| | | DataDictionaryCustom rangeSizeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.RANGE_SIZE.getType(), DataDictionaryEnum.RANGE_SIZE.getCode()); |
| | | double rangeSize = Double.parseDouble(rangeSizeDic.getValue())*1000; |
| | | for(MallTeamLeader mallTeamLeader : mallTeamLeaderIPage.getRecords()){ |
| | | Double distance = mallTeamLeader.getDistance(); |
| | | if(distance <= rangeSize){ |
| | | ApiLeaderListVo apiLeaderListVo = MallTeamLeaderConversion.INSTANCE.entityToApiVo(mallTeamLeader); |
| | | apiLeaderListVos.add(apiLeaderListVo); |
| | | } |
| | | } |
| | | }else{ |
| | | apiLeaderListVos = MallTeamLeaderConversion.INSTANCE.entitysToVos(mallTeamLeaderIPage.getRecords()); |
| | | } |
| | | } |
| | | return new FebsResponse().success().data(apiLeaderListVos); |
| | | } |
| | | |
| | | } |