|
|
@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.dingtalk.api.request.OapiRobotSendRequest; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
|
import com.epmet.commons.tools.constant.DingDingRobotConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
@ -250,41 +251,6 @@ public class GovOrgServiceImpl implements GovOrgService { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
List<NextAreaCodeResultDTO> allList = new ArrayList<>(); |
|
|
|
NextAreaCodeResultDTO m1 = new NextAreaCodeResultDTO(); |
|
|
|
m1.setAreaCode("1"); |
|
|
|
m1.setAreaName("a"); |
|
|
|
allList.add(m1); |
|
|
|
|
|
|
|
NextAreaCodeResultDTO m2 = new NextAreaCodeResultDTO(); |
|
|
|
m2.setAreaCode("2"); |
|
|
|
m2.setAreaName("b"); |
|
|
|
allList.add(m2); |
|
|
|
|
|
|
|
|
|
|
|
NextAreaCodeResultDTO m3 = new NextAreaCodeResultDTO(); |
|
|
|
m3.setAreaCode("3"); |
|
|
|
m3.setAreaName("c"); |
|
|
|
allList.add(m3); |
|
|
|
|
|
|
|
List<String> stringList = new ArrayList<>(); |
|
|
|
stringList.add("1"); |
|
|
|
stringList.add("2"); |
|
|
|
|
|
|
|
Iterator<NextAreaCodeResultDTO> iterator = allList.iterator(); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
NextAreaCodeResultDTO next = iterator.next(); |
|
|
|
for (String usedAreaCode : stringList) { |
|
|
|
if (next.getAreaCode().equals(usedAreaCode)) { |
|
|
|
iterator.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
System.out.println(JSON.toJSONString(allList, true)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param staffId |
|
|
|
* @Author sun |
|
|
@ -643,7 +609,45 @@ public class GovOrgServiceImpl implements GovOrgService { |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public CustomerAgencyEntity getAgencyInfo(String agencyId) { |
|
|
|
return customerAgencyDao.selectById(agencyId); |
|
|
|
CustomerAgencyEntity customerAgencyEntity=customerAgencyDao.selectById(agencyId); |
|
|
|
//设置行政地区编码全路径
|
|
|
|
if (StringUtils.isNotBlank(customerAgencyEntity.getAreaCode()) && StringUtils.isNotBlank(customerAgencyEntity.getParentAreaCode())) { |
|
|
|
customerAgencyEntity.setAreaCodePath(queryAreaCodePath(customerAgencyEntity)); |
|
|
|
} |
|
|
|
|
|
|
|
return customerAgencyEntity; |
|
|
|
} |
|
|
|
|
|
|
|
private List<String> queryAreaCodePath(CustomerAgencyEntity customerAgencyEntity) { |
|
|
|
List<String> areaCodePath = new ArrayList<>(); |
|
|
|
switch (customerAgencyEntity.getLevel()) { |
|
|
|
case Constant.COMMUNITY: |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO)); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR)); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.SIX)); |
|
|
|
areaCodePath.add(customerAgencyEntity.getParentAreaCode()); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode()); |
|
|
|
break; |
|
|
|
case Constant.STREET: |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO)); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.FOUR)); |
|
|
|
areaCodePath.add(customerAgencyEntity.getParentAreaCode()); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode()); |
|
|
|
break; |
|
|
|
case Constant.DISTRICT: |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode().substring(NumConstant.ZERO, NumConstant.TWO)); |
|
|
|
areaCodePath.add(customerAgencyEntity.getParentAreaCode()); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode()); |
|
|
|
break; |
|
|
|
case Constant.CITY: |
|
|
|
areaCodePath.add(customerAgencyEntity.getParentAreaCode()); |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode()); |
|
|
|
break; |
|
|
|
case Constant.PROVINCE: |
|
|
|
areaCodePath.add(customerAgencyEntity.getAreaCode()); |
|
|
|
break; |
|
|
|
} |
|
|
|
return areaCodePath; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|