|
|
|
@ -585,36 +585,42 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl<BaseTDx |
|
|
|
|
Map<String, String> taxnoMap = taxnoList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, SysDeptEntity::getTaxno)); |
|
|
|
|
Map<String, String> parentIdMap = parentIdList.stream().collect(Collectors.toMap(SysDeptEntity::getDeptId, e -> e.getParentId() == null ? "" : e.getParentId())); |
|
|
|
|
|
|
|
|
|
log.info("taxnoMap={},parentIdMap={}",taxnoMap,parentIdMap); |
|
|
|
|
log.info("taxnoMap={},parentIdMap={}", taxnoMap, parentIdMap); |
|
|
|
|
|
|
|
|
|
String gfsh = ""; |
|
|
|
|
for(String companyCode : companyCodes){ |
|
|
|
|
for (String companyCode : companyCodes) { |
|
|
|
|
QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>(); |
|
|
|
|
wrapper.eq("org_code",companyCode); |
|
|
|
|
SysDeptEntity sysDeptEntity = sysDeptAuthDao.selectOne(wrapper); |
|
|
|
|
if(sysDeptEntity != null) { |
|
|
|
|
wrapper.eq("org_code", companyCode); |
|
|
|
|
List<SysDeptEntity> sysDeptEntityList = sysDeptAuthDao.selectList(wrapper); |
|
|
|
|
SysDeptEntity sysDeptEntity = sysDeptEntityList.get(0); |
|
|
|
|
if (sysDeptEntity != null) { |
|
|
|
|
String dId = sysDeptEntity.getDeptId(); |
|
|
|
|
|
|
|
|
|
gfsh = getGfsh(dId, taxnoMap, parentIdMap); |
|
|
|
|
gfshList.add(gfsh); |
|
|
|
|
log.info("获取的税号为:{}",gfsh); |
|
|
|
|
|
|
|
|
|
log.info("获取deptId为:{}", dId); |
|
|
|
|
if (StringUtils.isNotEmpty(dId)) { |
|
|
|
|
gfsh = getGfsh(dId, taxnoMap, parentIdMap); |
|
|
|
|
if (StringUtils.isNotEmpty(gfsh)) |
|
|
|
|
gfshList.add(gfsh); |
|
|
|
|
log.info("获取的税号为:{}", gfsh); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.info("购方税号list为:{}",gfshList); |
|
|
|
|
log.info("购方税号list为:{}", gfshList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return gfshList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getGfsh(String deptId,Map<String, String> taxnoMap,Map<String, String> parentIdMap) { |
|
|
|
|
log.info("deptId={}",deptId); |
|
|
|
|
String taxno = taxnoMap.get(deptId); |
|
|
|
|
private String getGfsh(String deptId, Map<String, String> taxnoMap, Map<String, String> parentIdMap) { |
|
|
|
|
String taxno = ""; |
|
|
|
|
if (StringUtils.isNotEmpty(deptId)) { |
|
|
|
|
log.info("deptId={}", deptId); |
|
|
|
|
taxno = taxnoMap.get(deptId); |
|
|
|
|
|
|
|
|
|
if(StringUtils.isEmpty(taxno)){ |
|
|
|
|
deptId = parentIdMap.get(deptId); |
|
|
|
|
log.info("获取map中的deptId:{}",deptId); |
|
|
|
|
getGfsh(deptId,taxnoMap,parentIdMap); |
|
|
|
|
if (StringUtils.isEmpty(taxno)) { |
|
|
|
|
deptId = parentIdMap.get(deptId); |
|
|
|
|
log.info("获取map中的deptId:{}", deptId); |
|
|
|
|
getGfsh(deptId, taxnoMap, parentIdMap); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return taxno; |
|
|
|
|
} |
|
|
|
|