Commit dd9daf6f authored by Memorydoc's avatar Memorydoc

分析模块初始化

parent c12993fb
......@@ -179,4 +179,5 @@ public final class Constant {
}
}
\ No newline at end of file
......@@ -203,12 +203,19 @@ public class AnalysisJobServiceImpl extends BaseService {
String regionMeg = regionMap.get(o.getRegionId());
List<String> regionMs = Lists.newArrayList();
if (StringUtils.isNotEmpty(regionMeg)) {
regionMs = Arrays.asList(regionMeg.split("."));
regionMs = Arrays.asList(regionMeg.split(","));
}
if (!regionMs.isEmpty()) {
if(regionMs.size() == 4){
am.setProvince(regionMs.get(1) != null ? regionMs.get(1) : "");
am.setCity(regionMs.get(2) != null ? regionMs.get(2) : "");
am.setDistrict(regionMs.get(3) != null ? regionMs.get(4) : "");
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.setCode(o.getCode());
......@@ -223,7 +230,8 @@ public class AnalysisJobServiceImpl extends BaseService {
}
analysisMasterMapper.insertSelective(am);
} 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 {
.andCompanyNameEqualTo(getCellValue(sheetAt.getRow(i).getCell(3), false).toString())
.andPeriodEqualTo(period);
List<AnalysisMaster> analysisMasters = analysisMasterMapper.selectByExample(example);
if (breakFlag > 3) {
if (breakFlag > 20) {
logger.info("大于三条数据不匹配,直接停止进程");
break;
}
......@@ -962,8 +962,14 @@ public class AnalysisServiceImpl extends BaseService {
salesList.add(sales);
}
}
int salesInt = analysisSalesMapper.insertBatch(salesList);
int taxInt = analysisTaxMapper.insertBatch(taxList);
int salesInt = 0;
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_tax 更新数据条数" + taxInt);
System.out.println("数据初始化消耗: " + (System.currentTimeMillis() - now));
......
......@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.vat.entity.EbitCellData;
import java.io.FileInputStream;
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