Commit dd9daf6f authored by Memorydoc's avatar Memorydoc

分析模块初始化

parent c12993fb
...@@ -179,4 +179,5 @@ public final class Constant { ...@@ -179,4 +179,5 @@ public final class Constant {
} }
} }
\ No newline at end of file
...@@ -203,12 +203,19 @@ public class AnalysisJobServiceImpl extends BaseService { ...@@ -203,12 +203,19 @@ public class AnalysisJobServiceImpl extends BaseService {
String regionMeg = regionMap.get(o.getRegionId()); String regionMeg = regionMap.get(o.getRegionId());
List<String> regionMs = Lists.newArrayList(); List<String> regionMs = Lists.newArrayList();
if (StringUtils.isNotEmpty(regionMeg)) { if (StringUtils.isNotEmpty(regionMeg)) {
regionMs = Arrays.asList(regionMeg.split(".")); regionMs = Arrays.asList(regionMeg.split(","));
} }
if (!regionMs.isEmpty()) { if (!regionMs.isEmpty()) {
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : ""); if(regionMs.size() == 4){
am.setCity(regionMs.get(2) != null ? regionMs.get(2) : ""); am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
am.setDistrict(regionMs.get(3) != null ? regionMs.get(4) : ""); am.setCity(regionMs.get(2) != null ? regionMs.get(2) : "");
am.setDistrict(regionMs.get(3) != null ? regionMs.get(3) : "");
}else if(regionMs.size() == 3){
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
am.setCity(regionMs.get(2) != null ? regionMs.get(2) : "");
}else if(regionMs.size() == 2){
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
}
} }
am.setBusinessLine(buMap.get(o.getBusinessUnitId())); am.setBusinessLine(buMap.get(o.getBusinessUnitId()));
am.setCode(o.getCode()); am.setCode(o.getCode());
...@@ -223,7 +230,8 @@ public class AnalysisJobServiceImpl extends BaseService { ...@@ -223,7 +230,8 @@ public class AnalysisJobServiceImpl extends BaseService {
} }
analysisMasterMapper.insertSelective(am); analysisMasterMapper.insertSelective(am);
} catch (Exception e) { } catch (Exception e) {
logger.error(String.format("公司:[%s]生成机构分析数据失败!", o.getName()), e); e.printStackTrace();
logger.error(String.format("生成机构分析数据失败!", e.getMessage()));
} }
} }
......
...@@ -932,7 +932,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -932,7 +932,7 @@ public class AnalysisServiceImpl extends BaseService {
.andCompanyNameEqualTo(getCellValue(sheetAt.getRow(i).getCell(3), false).toString()) .andCompanyNameEqualTo(getCellValue(sheetAt.getRow(i).getCell(3), false).toString())
.andPeriodEqualTo(period); .andPeriodEqualTo(period);
List<AnalysisMaster> analysisMasters = analysisMasterMapper.selectByExample(example); List<AnalysisMaster> analysisMasters = analysisMasterMapper.selectByExample(example);
if (breakFlag > 3) { if (breakFlag > 20) {
logger.info("大于三条数据不匹配,直接停止进程"); logger.info("大于三条数据不匹配,直接停止进程");
break; break;
} }
...@@ -962,8 +962,14 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -962,8 +962,14 @@ public class AnalysisServiceImpl extends BaseService {
salesList.add(sales); salesList.add(sales);
} }
} }
int salesInt = analysisSalesMapper.insertBatch(salesList); int salesInt = 0;
int taxInt = analysisTaxMapper.insertBatch(taxList); if (salesList.size() != 0) {
salesInt = analysisSalesMapper.insertBatch(salesList);
}
int taxInt = 0;
if (taxList.size() != 0) {
taxInt = analysisTaxMapper.insertBatch(taxList);
}
logger.info("analysis_salesInt 更新数据条数" + salesInt); logger.info("analysis_salesInt 更新数据条数" + salesInt);
logger.info("analysis_tax 更新数据条数" + taxInt); logger.info("analysis_tax 更新数据条数" + taxInt);
System.out.println("数据初始化消耗: " + (System.currentTimeMillis() - now)); System.out.println("数据初始化消耗: " + (System.currentTimeMillis() - now));
......
...@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils; ...@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType; import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.entity.Organization; import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample; import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.vat.entity.EbitCellData;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment