ariesy 增加非空税号

release
yefei 2 years ago
parent 8b01eecde5
commit 4504b1e2ad
  1. 42
      dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java

@ -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> 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())); 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 = ""; String gfsh = "";
for(String companyCode : companyCodes){ for (String companyCode : companyCodes) {
QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>(); QueryWrapper<SysDeptEntity> wrapper = new QueryWrapper<>();
wrapper.eq("org_code",companyCode); wrapper.eq("org_code", companyCode);
SysDeptEntity sysDeptEntity = sysDeptAuthDao.selectOne(wrapper); List<SysDeptEntity> sysDeptEntityList = sysDeptAuthDao.selectList(wrapper);
if(sysDeptEntity != null) { SysDeptEntity sysDeptEntity = sysDeptEntityList.get(0);
if (sysDeptEntity != null) {
String dId = sysDeptEntity.getDeptId(); String dId = sysDeptEntity.getDeptId();
log.info("获取deptId为:{}", dId);
gfsh = getGfsh(dId, taxnoMap, parentIdMap); if (StringUtils.isNotEmpty(dId)) {
gfshList.add(gfsh); gfsh = getGfsh(dId, taxnoMap, parentIdMap);
log.info("获取的税号为:{}",gfsh); if (StringUtils.isNotEmpty(gfsh))
gfshList.add(gfsh);
log.info("获取的税号为:{}", gfsh);
}
} }
} }
log.info("购方税号list为:{}",gfshList); log.info("购方税号list为:{}", gfshList);
return gfshList; return gfshList;
} }
private String getGfsh(String deptId,Map<String, String> taxnoMap,Map<String, String> parentIdMap) { private String getGfsh(String deptId, Map<String, String> taxnoMap, Map<String, String> parentIdMap) {
log.info("deptId={}",deptId); String taxno = "";
String taxno = taxnoMap.get(deptId); if (StringUtils.isNotEmpty(deptId)) {
log.info("deptId={}", deptId);
taxno = taxnoMap.get(deptId);
if(StringUtils.isEmpty(taxno)){ if (StringUtils.isEmpty(taxno)) {
deptId = parentIdMap.get(deptId); deptId = parentIdMap.get(deptId);
log.info("获取map中的deptId:{}",deptId); log.info("获取map中的deptId:{}", deptId);
getGfsh(deptId,taxnoMap,parentIdMap); getGfsh(deptId, taxnoMap, parentIdMap);
}
} }
return taxno; return taxno;
} }

Loading…
Cancel
Save