Commit a4370868 authored by Memorydoc's avatar Memorydoc

#分析debug

parent ce7e50b6
......@@ -19,6 +19,9 @@ public class DataImportErrorDto {
@JSONField(name="开票金额")
private String amount;
@JSONField(name="开票日期")
private String openDate;
@JSONField(name="确认/认证日期")
private String confirmTime;
......@@ -27,6 +30,14 @@ public class DataImportErrorDto {
@JSONField(name="Sheet")
private Integer sheet;
public String getOpenDate() {
return openDate;
}
public void setOpenDate(String openDate) {
this.openDate = openDate;
}
public Integer getSheet() {
return sheet;
}
......
......@@ -322,6 +322,8 @@ public class AnalysisServiceImpl extends BaseService {
return null;
}
public Organization getOrgByCompanyName(String companyName) {
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andNameEqualTo(companyName);
......@@ -649,6 +651,7 @@ public class AnalysisServiceImpl extends BaseService {
continue;
}
model.setGmv(getCellBigDecimalValue(cell1));
model.setCompanyName(getOrgById(organizationId).getName());
model.setTrips(getCellBigDecimalValue(sheet.getRow(j).getCell(1)));
model.setSubsidyB(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
model.setSubsidyC(getCellBigDecimalValue(sheet.getRow(j).getCell(3)));
......@@ -682,11 +685,11 @@ public class AnalysisServiceImpl extends BaseService {
List<Object> objects = new ArrayList<>();
Integer period = DateUtils.strToPeriod(param.getPeriod());
String country = param.getCountry();
String companyName = param.getCompanyName();
String organizationId = param.getCompanyName();
switch (param.getType()) {
case 100:
AnalysisInternationalBusinessDataExample analysisInternationalBusinessDataExample = new AnalysisInternationalBusinessDataExample();
analysisInternationalBusinessDataExample.createCriteria().andPeriodEqualTo(period).andCompanyNameEqualTo(companyName).andCountryEqualTo(country);
analysisInternationalBusinessDataExample.createCriteria().andPeriodEqualTo(period).andOrganizationIdEqualTo(organizationId).andCountryEqualTo(country);
List<AnalysisInternationalBusinessData> list = analysisInternationalBusinessDataMapper.selectByExample(analysisInternationalBusinessDataExample);
/*List<AnalysisInternationalBUDataDto> dtos = Lists.newArrayList();
......@@ -726,7 +729,7 @@ public class AnalysisServiceImpl extends BaseService {
return objects;
case 101:
AnalysisInternationalTaxDataExample analysisInternationalTaxDataExample = new AnalysisInternationalTaxDataExample();
analysisInternationalTaxDataExample.createCriteria().andPeriodEqualTo(period).andCompanyNameEqualTo(companyName).andCountryEqualTo(country);
analysisInternationalTaxDataExample.createCriteria().andPeriodEqualTo(period).andOrganizationIdEqualTo(organizationId).andCountryEqualTo(country);
List<AnalysisInternationalTaxData> list2 = analysisInternationalTaxDataMapper.selectByExample(analysisInternationalTaxDataExample);
List<AnalysisInternationalTaxDataDto> dtos2 = Lists.newArrayList();
list2.forEach(l2 -> {
......
......@@ -1578,7 +1578,7 @@ public class DataImportService extends BaseService {
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
DataImportResponseDto<InvoiceRecord> dataImportResponseDto= generalIRs(sheet);
DataImportResponseDto<InvoiceRecord> dataImportResponseDto= generalIRs(sheet, tmsPeriod);
dataImportResponseDto1.addAll(dataImportResponseDto.getDataImportErrorDtos());
//List<InvoiceRecord> irs = generalIRs(sheet);
List<InvoiceRecord> irs=dataImportResponseDto.getObjectList();
......@@ -1726,8 +1726,10 @@ public class DataImportService extends BaseService {
return rlits;
}
private DataImportResponseDto<InvoiceRecord> generalIRs(Sheet sheet) {
private DataImportResponseDto<InvoiceRecord> generalIRs(Sheet sheet, Integer period) {
List<InvoiceRecord> irs = Lists.newArrayList();
//存在错误的期间跳过
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMM");
List<DataImportErrorDto> errorDtos = Lists.newArrayList();
Set<String> orgsNot = new HashSet<>();
//先循环校验字段
......@@ -1752,7 +1754,6 @@ public class DataImportService extends BaseService {
errorDtos.add(importErrorDto);
}
}
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
InvoiceRecord ir = new InvoiceRecord();
Long irId = idService.nextId();
......@@ -1770,6 +1771,13 @@ public class DataImportService extends BaseService {
if (validIRExcelCell(row, orgsNot).contains(getCellStringValue(row.getCell(1)))) {
continue;
}
//存在错误的期间跳过
if( !simpleDateFormat.format(row.getCell(12).getDateCellValue()).equals(period.toString())){
DataImportErrorDto importErrorDto=new DataImportErrorDto();
importErrorDto.setOpenDate("存在日期不匹配");
errorDtos.add(importErrorDto);
continue;
}
ir.setBillingBody(getCellStringValue(row.getCell(1)));
ir.setCustomerCompanyName(getCellStringValue(row.getCell(2)));
ir.setInvoiceType(getCellStringValue(row.getCell(3)));
......
......@@ -1215,7 +1215,7 @@
"ImportNotMatch" : "导入文件与选择机构或期间不匹配",
"ProjectDescription": "项目描述",
"ProductDescription": "产品描述",
"Company":"公司",
"Company":"公司",
"CompanyDescription": "公司间描述",
"Segment1":"备用段",
"Segment1Description": "备用段描述",
......
......@@ -243,6 +243,7 @@
}).success(function(resp) {
var ret = resp.data;
$scope.fileName= '';
$scope.importExcelFile = null;
$('#busy-indicator-container').hide();
deferred.resolve();
uploadAfter();
......
......@@ -207,6 +207,7 @@
}).then(function (resp) {
var ret = resp.data;
$scope.fileName = '';
$scope.importExcelFile = null;
$('#busy-indicator-container').hide();
deferred.resolve();
if (ret.result) {
......@@ -540,9 +541,9 @@
var setButtonWrapStyle = function () {
if ($scope.fileName) {
/* if ($scope.fileName) {
return {width: "100%"};
}
}*/
};
var setGridStyle = function () {
......
......@@ -49,7 +49,7 @@
ng-click="downloadTemplate()"></button>
<button type="button"
class="btn btn-vat-primary" style=""
class="btn btn-vat-primary"
translate="ImportBtn"
ng-click="doUpload()"></button>
......@@ -61,7 +61,7 @@
</div>
<div class="row" style="margin-top: 10px;">
<span class="text-bold" translate="Country">:</span>
<span class="text-bold" translate="Country"><span>:</span></span>
<!-- <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu3"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 150px;margin-left: 28px;">
......@@ -90,7 +90,7 @@
data-none-results-text ="没有匹配的国家">
</select>
<span class="text-bold" translate="Company">:</span>
<span class="text-bold" translate="Company"><span>:</span></span>
<!--<div dx-tag-box="selectOrgOptionsComany" style="width: 287px;display: inline-block"></div>-->
<select class="selectpicker show-tick dropup" multiple data-live-search="true"
data-width="auto" data-max-options="1"
......
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