Commit a4370868 authored by Memorydoc's avatar Memorydoc

#分析debug

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