Commit bddd6c58 authored by ken.q.you's avatar ken.q.you

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents f74dfd9b c033ce6b
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -52,7 +51,6 @@ import pwc.taxtech.atms.vat.entity.*; ...@@ -52,7 +51,6 @@ import pwc.taxtech.atms.vat.entity.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
...@@ -740,6 +738,7 @@ public class DataImportService extends BaseService { ...@@ -740,6 +738,7 @@ public class DataImportService extends BaseService {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) { if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod); throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
} }
...@@ -843,34 +842,34 @@ public class DataImportService extends BaseService { ...@@ -843,34 +842,34 @@ public class DataImportService extends BaseService {
iData.setSpecialInvoiceAmount4(getCellLongDecimalValue(cell5)); iData.setSpecialInvoiceAmount4(getCellLongDecimalValue(cell5));
Cell cell6 = sheet.getRow(6).getCell(j); Cell cell6 = sheet.getRow(6).getCell(j);
iData.setSpecialInvoiceSalesAmount1(getCellBigDecimalValue(cell6)); iData.setSpecialInvoiceSalesAmount1(getCellBigDecimalValue(cell6,evaluator));
Cell cell7 = sheet.getRow(7).getCell(j); Cell cell7 = sheet.getRow(7).getCell(j);
iData.setSpecialInvoiceSalesAmount2(getCellBigDecimalValue(cell7)); iData.setSpecialInvoiceSalesAmount2(getCellBigDecimalValue(cell7,evaluator));
Cell cell8 = sheet.getRow(8).getCell(j); Cell cell8 = sheet.getRow(8).getCell(j);
iData.setSpecialInvoiceSalesAmount3(getCellBigDecimalValue(cell8)); iData.setSpecialInvoiceSalesAmount3(getCellBigDecimalValue(cell8,evaluator));
Cell cell9 = sheet.getRow(9).getCell(j); Cell cell9 = sheet.getRow(9).getCell(j);
iData.setSpecialInvoiceSalesAmount4(getCellBigDecimalValue(cell9)); iData.setSpecialInvoiceSalesAmount4(getCellBigDecimalValue(cell9,evaluator));
Cell cell10 = sheet.getRow(10).getCell(j); Cell cell10 = sheet.getRow(10).getCell(j);
iData.setSpecialInvoiceSalesAmount5(getCellBigDecimalValue(cell10)); iData.setSpecialInvoiceSalesAmount5(getCellBigDecimalValue(cell10,evaluator));
Cell cell11 = sheet.getRow(11).getCell(j); Cell cell11 = sheet.getRow(11).getCell(j);
iData.setSpecialInvoiceTaxAmount1(getCellBigDecimalValue(cell11)); iData.setSpecialInvoiceTaxAmount1(getCellBigDecimalValue(cell11,evaluator));
Cell cell12 = sheet.getRow(12).getCell(j); Cell cell12 = sheet.getRow(12).getCell(j);
iData.setSpecialInvoiceTaxAmount2(getCellBigDecimalValue(cell12)); iData.setSpecialInvoiceTaxAmount2(getCellBigDecimalValue(cell12,evaluator));
Cell cell13 = sheet.getRow(13).getCell(j); Cell cell13 = sheet.getRow(13).getCell(j);
iData.setSpecialInvoiceTaxAmount3(getCellBigDecimalValue(cell13)); iData.setSpecialInvoiceTaxAmount3(getCellBigDecimalValue(cell13,evaluator));
Cell cell14 = sheet.getRow(14).getCell(j); Cell cell14 = sheet.getRow(14).getCell(j);
iData.setSpecialInvoiceTaxAmount4(getCellBigDecimalValue(cell14)); iData.setSpecialInvoiceTaxAmount4(getCellBigDecimalValue(cell14,evaluator));
Cell cell15 = sheet.getRow(15).getCell(j); Cell cell15 = sheet.getRow(15).getCell(j);
iData.setSpecialInvoiceTaxAmount5(getCellBigDecimalValue(cell15)); iData.setSpecialInvoiceTaxAmount5(getCellBigDecimalValue(cell15,evaluator));
Cell cell16 = sheet.getRow(16).getCell(j); Cell cell16 = sheet.getRow(16).getCell(j);
iData.setInvoiceAmount1(getCellLongDecimalValue(cell16)); iData.setInvoiceAmount1(getCellLongDecimalValue(cell16));
...@@ -885,34 +884,34 @@ public class DataImportService extends BaseService { ...@@ -885,34 +884,34 @@ public class DataImportService extends BaseService {
iData.setInvoiceAmount4(getCellLongDecimalValue(cell19)); iData.setInvoiceAmount4(getCellLongDecimalValue(cell19));
Cell cell20 = sheet.getRow(20).getCell(j); Cell cell20 = sheet.getRow(20).getCell(j);
iData.setInvoiceSalesAmount1(getCellBigDecimalValue(cell20)); iData.setInvoiceSalesAmount1(getCellBigDecimalValue(cell20,evaluator));
Cell cell21 = sheet.getRow(21).getCell(j); Cell cell21 = sheet.getRow(21).getCell(j);
iData.setInvoiceSalesAmount2(getCellBigDecimalValue(cell21)); iData.setInvoiceSalesAmount2(getCellBigDecimalValue(cell21,evaluator));
Cell cell22 = sheet.getRow(22).getCell(j); Cell cell22 = sheet.getRow(22).getCell(j);
iData.setInvoiceSalesAmount3(getCellBigDecimalValue(cell22)); iData.setInvoiceSalesAmount3(getCellBigDecimalValue(cell22,evaluator));
Cell cell23 = sheet.getRow(23).getCell(j); Cell cell23 = sheet.getRow(23).getCell(j);
iData.setInvoiceSalesAmount4(getCellBigDecimalValue(cell23)); iData.setInvoiceSalesAmount4(getCellBigDecimalValue(cell23,evaluator));
Cell cell24 = sheet.getRow(24).getCell(j); Cell cell24 = sheet.getRow(24).getCell(j);
iData.setInvoiceSalesAmount5(getCellBigDecimalValue(cell24)); iData.setInvoiceSalesAmount5(getCellBigDecimalValue(cell24,evaluator));
Cell cell25 = sheet.getRow(25).getCell(j); Cell cell25 = sheet.getRow(25).getCell(j);
iData.setInvoiceTaxAmount1(getCellBigDecimalValue(cell25)); iData.setInvoiceTaxAmount1(getCellBigDecimalValue(cell25,evaluator));
Cell cell26 = sheet.getRow(26).getCell(j); Cell cell26 = sheet.getRow(26).getCell(j);
iData.setInvoiceTaxAmount2(getCellBigDecimalValue(cell26)); iData.setInvoiceTaxAmount2(getCellBigDecimalValue(cell26,evaluator));
Cell cell27 = sheet.getRow(27).getCell(j); Cell cell27 = sheet.getRow(27).getCell(j);
iData.setInvoiceTaxAmount3(getCellBigDecimalValue(cell27)); iData.setInvoiceTaxAmount3(getCellBigDecimalValue(cell27,evaluator));
Cell cell28 = sheet.getRow(28).getCell(j); Cell cell28 = sheet.getRow(28).getCell(j);
iData.setInvoiceTaxAmount4(getCellBigDecimalValue(cell28)); iData.setInvoiceTaxAmount4(getCellBigDecimalValue(cell28,evaluator));
Cell cell29 = sheet.getRow(29).getCell(j); Cell cell29 = sheet.getRow(29).getCell(j);
iData.setInvoiceTaxAmount5(getCellBigDecimalValue(cell29)); iData.setInvoiceTaxAmount5(getCellBigDecimalValue(cell29,evaluator));
iDatas.add(iData); iDatas.add(iData);
} }
...@@ -952,6 +951,7 @@ public class DataImportService extends BaseService { ...@@ -952,6 +951,7 @@ public class DataImportService extends BaseService {
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) { if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod); throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
} }
...@@ -960,7 +960,7 @@ public class DataImportService extends BaseService { ...@@ -960,7 +960,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;
List<RedLetterInfoTable> rlits = generalRLITs(sheet); List<RedLetterInfoTable> rlits = generalRLITs(sheet,evaluator);
if (rlits.size() < 1) continue; if (rlits.size() < 1) continue;
// 根据主体分组处理 // 根据主体分组处理
Map<String, List<RedLetterInfoTable>> atsGroupRes = Map<String, List<RedLetterInfoTable>> atsGroupRes =
...@@ -1060,6 +1060,7 @@ public class DataImportService extends BaseService { ...@@ -1060,6 +1060,7 @@ public class DataImportService extends BaseService {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) { if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod); throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
} }
...@@ -1068,7 +1069,7 @@ public class DataImportService extends BaseService { ...@@ -1068,7 +1069,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;
List<AdjustmentTable> ats = generalATs(sheet); List<AdjustmentTable> ats = generalATs(sheet, evaluator);
if (ats.size() < 1) continue; if (ats.size() < 1) continue;
// 根据主体分组处理 // 根据主体分组处理
Map<String, List<AdjustmentTable>> atsGroupRes = Map<String, List<AdjustmentTable>> atsGroupRes =
...@@ -1166,6 +1167,7 @@ public class DataImportService extends BaseService { ...@@ -1166,6 +1167,7 @@ public class DataImportService extends BaseService {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) { if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod); throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
} }
...@@ -1174,7 +1176,7 @@ public class DataImportService extends BaseService { ...@@ -1174,7 +1176,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;
List<CoupaPurchasingReport> ats = generalCPRs(sheet); List<CoupaPurchasingReport> ats = generalCPRs(sheet,evaluator);
if (ats.size() < 1) continue; if (ats.size() < 1) continue;
// 根据主体分组处理 // 根据主体分组处理
Map<String, List<CoupaPurchasingReport>> atsGroupRes = Map<String, List<CoupaPurchasingReport>> atsGroupRes =
...@@ -1285,6 +1287,7 @@ public class DataImportService extends BaseService { ...@@ -1285,6 +1287,7 @@ public class DataImportService extends BaseService {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) { if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod); throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
} }
...@@ -1405,10 +1408,10 @@ public class DataImportService extends BaseService { ...@@ -1405,10 +1408,10 @@ public class DataImportService extends BaseService {
cil.setSalespersonName(getCellStringValue(cell6)); cil.setSalespersonName(getCellStringValue(cell6));
Cell cell7 = row.getCell(6); Cell cell7 = row.getCell(6);
cil.setAmount(getCellBigDecimalValue(cell7)); cil.setAmount(getCellBigDecimalValue(cell7,evaluator));
Cell cell8 = row.getCell(7); Cell cell8 = row.getCell(7);
cil.setTaxAmount(getCellBigDecimalValue(cell8)); cil.setTaxAmount(getCellBigDecimalValue(cell8,evaluator));
Cell cell9 = row.getCell(8); Cell cell9 = row.getCell(8);
...@@ -1565,6 +1568,7 @@ public class DataImportService extends BaseService { ...@@ -1565,6 +1568,7 @@ public class DataImportService extends BaseService {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) { if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod); throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
} }
...@@ -1574,7 +1578,7 @@ public class DataImportService extends BaseService { ...@@ -1574,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,evaluator);
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();
...@@ -1736,7 +1740,7 @@ public class DataImportService extends BaseService { ...@@ -1736,7 +1740,7 @@ public class DataImportService extends BaseService {
dataImportLogs.add(dataImportLog); dataImportLogs.add(dataImportLog);
} }
private List<RedLetterInfoTable> generalRLITs(Sheet sheet) { private List<RedLetterInfoTable> generalRLITs(Sheet sheet,FormulaEvaluator evaluator) {
List<RedLetterInfoTable> rlits = Lists.newArrayList(); List<RedLetterInfoTable> rlits = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) { for (int j = 1; j <= sheet.getLastRowNum(); j++) {
RedLetterInfoTable rlit = new RedLetterInfoTable(); RedLetterInfoTable rlit = new RedLetterInfoTable();
...@@ -1756,8 +1760,8 @@ public class DataImportService extends BaseService { ...@@ -1756,8 +1760,8 @@ public class DataImportService extends BaseService {
rlit.setFillInDate(row.getCell(3).getDateCellValue()); rlit.setFillInDate(row.getCell(3).getDateCellValue());
rlit.setSalesTaxNumber(getCellStringValue(row.getCell(4))); rlit.setSalesTaxNumber(getCellStringValue(row.getCell(4)));
rlit.setSalespersonName(getCellStringValue(row.getCell(5))); rlit.setSalespersonName(getCellStringValue(row.getCell(5)));
rlit.setTotalAmount(getCellBigDecimalValue(row.getCell(6))); rlit.setTotalAmount(getCellBigDecimalValue(row.getCell(6),evaluator));
rlit.setTotalTaxAmount(getCellBigDecimalValue(row.getCell(7))); rlit.setTotalTaxAmount(getCellBigDecimalValue(row.getCell(7),evaluator));
rlit.setApplicationDescription(getCellStringValue(row.getCell(8))); rlit.setApplicationDescription(getCellStringValue(row.getCell(8)));
rlit.setApplicantManager(getCellStringValue(row.getCell(9))); rlit.setApplicantManager(getCellStringValue(row.getCell(9)));
rlit.setInvoiceCode(getCellStringValue(row.getCell(10))); rlit.setInvoiceCode(getCellStringValue(row.getCell(10)));
...@@ -1767,7 +1771,7 @@ public class DataImportService extends BaseService { ...@@ -1767,7 +1771,7 @@ public class DataImportService extends BaseService {
return rlits; return rlits;
} }
private DataImportResponseDto<InvoiceRecord> generalIRs(Sheet sheet) { private DataImportResponseDto<InvoiceRecord> generalIRs(Sheet sheet,FormulaEvaluator evaluator) {
List<InvoiceRecord> irs = Lists.newArrayList(); List<InvoiceRecord> irs = Lists.newArrayList();
List<DataImportErrorDto> errorDtos = Lists.newArrayList(); List<DataImportErrorDto> errorDtos = Lists.newArrayList();
Set<String> orgsNot = new HashSet<>(); Set<String> orgsNot = new HashSet<>();
...@@ -1815,11 +1819,11 @@ public class DataImportService extends BaseService { ...@@ -1815,11 +1819,11 @@ public class DataImportService extends BaseService {
ir.setCustomerCompanyName(getCellStringValue(row.getCell(2))); ir.setCustomerCompanyName(getCellStringValue(row.getCell(2)));
ir.setInvoiceType(getCellStringValue(row.getCell(3))); ir.setInvoiceType(getCellStringValue(row.getCell(3)));
ir.setBillingContent(getCellStringValue(row.getCell(4))); ir.setBillingContent(getCellStringValue(row.getCell(4)));
ir.setInvoiceAmount(getCellBigDecimalValue(row.getCell(5))); ir.setInvoiceAmount(getCellBigDecimalValue(row.getCell(5),evaluator));
ir.setApplicant(getCellStringValue(row.getCell(6))); ir.setApplicant(getCellStringValue(row.getCell(6)));
ir.setOaApplicationNum(getCellStringValue(row.getCell(7))); ir.setOaApplicationNum(getCellStringValue(row.getCell(7)));
ir.setContractNo(getCellStringValue(row.getCell(8))); ir.setContractNo(getCellStringValue(row.getCell(8)));
ir.setContractAmount(getCellBigDecimalValue(row.getCell(9))); ir.setContractAmount(getCellBigDecimalValue(row.getCell(9),evaluator));
ir.setDepartment(getCellStringValue(row.getCell(10))); ir.setDepartment(getCellStringValue(row.getCell(10)));
ir.setApplicationDate(row.getCell(11).getDateCellValue()); ir.setApplicationDate(row.getCell(11).getDateCellValue());
ir.setBillingDate(row.getCell(12).getDateCellValue()); ir.setBillingDate(row.getCell(12).getDateCellValue());
...@@ -1831,8 +1835,8 @@ public class DataImportService extends BaseService { ...@@ -1831,8 +1835,8 @@ public class DataImportService extends BaseService {
ir.setInvoicesAmount(getCellIntegerValue(row.getCell(17))); ir.setInvoicesAmount(getCellIntegerValue(row.getCell(17)));
ir.setCustomerCompanyTaxNum(getCellStringValue(row.getCell(18))); ir.setCustomerCompanyTaxNum(getCellStringValue(row.getCell(18)));
ir.setContractSourceSystem(getCellStringValue(row.getCell(19))); ir.setContractSourceSystem(getCellStringValue(row.getCell(19)));
ir.setTaxRate(getCellBigDecimalValue(row.getCell(20))); ir.setTaxRate(getCellBigDecimalValue(row.getCell(20),evaluator));
ir.setTaxAmount(getCellBigDecimalValue(row.getCell(21))); ir.setTaxAmount(getCellBigDecimalValue(row.getCell(21),evaluator));
ir.setInvoiceStatus(getCellStringValue(row.getCell(22))); ir.setInvoiceStatus(getCellStringValue(row.getCell(22)));
ir.setSource(getCellStringValue(row.getCell(23))); ir.setSource(getCellStringValue(row.getCell(23)));
irs.add(ir); irs.add(ir);
...@@ -1913,7 +1917,7 @@ public class DataImportService extends BaseService { ...@@ -1913,7 +1917,7 @@ public class DataImportService extends BaseService {
return fg; return fg;
} }
private List<AdjustmentTable> generalATs(Sheet sheet) { private List<AdjustmentTable> generalATs(Sheet sheet,FormulaEvaluator evaluator) {
List<AdjustmentTable> ats = Lists.newArrayList(); List<AdjustmentTable> ats = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) { for (int j = 1; j <= sheet.getLastRowNum(); j++) {
AdjustmentTable at = new AdjustmentTable(); AdjustmentTable at = new AdjustmentTable();
...@@ -1955,15 +1959,15 @@ public class DataImportService extends BaseService { ...@@ -1955,15 +1959,15 @@ public class DataImportService extends BaseService {
at.setSegment8Name(getCellStringValue(row.getCell(18))); at.setSegment8Name(getCellStringValue(row.getCell(18)));
at.setSegment9Name(getCellStringValue(row.getCell(19))); at.setSegment9Name(getCellStringValue(row.getCell(19)));
at.setSegment10Name(getCellStringValue(row.getCell(20))); at.setSegment10Name(getCellStringValue(row.getCell(20)));
at.setPeriodDrBeq(getCellBigDecimalValue(row.getCell(21))); at.setPeriodDrBeq(getCellBigDecimalValue(row.getCell(22),evaluator));
at.setPeriodCrBeq(getCellBigDecimalValue(row.getCell(22))); at.setPeriodCrBeq(getCellBigDecimalValue(row.getCell(22),evaluator));
at.setEndBalBeq(getCellBigDecimalValue(row.getCell(23))); at.setEndBalBeq(getCellBigDecimalValue(row.getCell(23),evaluator));
ats.add(at); ats.add(at);
} }
return ats; return ats;
} }
private List<CoupaPurchasingReport> generalCPRs(Sheet sheet) { private List<CoupaPurchasingReport> generalCPRs(Sheet sheet,FormulaEvaluator evaluator) {
List<CoupaPurchasingReport> cprs = Lists.newArrayList(); List<CoupaPurchasingReport> cprs = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) { for (int j = 1; j <= sheet.getLastRowNum(); j++) {
CoupaPurchasingReport cpr = new CoupaPurchasingReport(); CoupaPurchasingReport cpr = new CoupaPurchasingReport();
...@@ -1984,7 +1988,7 @@ public class DataImportService extends BaseService { ...@@ -1984,7 +1988,7 @@ public class DataImportService extends BaseService {
cpr.setDescription(getCellStringValue(row.getCell(8))); cpr.setDescription(getCellStringValue(row.getCell(8)));
cpr.setSupplierNum(getCellStringValue(row.getCell(9))); cpr.setSupplierNum(getCellStringValue(row.getCell(9)));
cpr.setSupplier(getCellStringValue(row.getCell(10))); cpr.setSupplier(getCellStringValue(row.getCell(10)));
cpr.setTotalAmount(getCellBigDecimalValue(row.getCell(11))); cpr.setTotalAmount(getCellBigDecimalValue(row.getCell(11),evaluator));
cpr.setCurrency(getCellStringValue(row.getCell(12))); cpr.setCurrency(getCellStringValue(row.getCell(12)));
String billNum = getCellStringValue(row.getCell(13)); String billNum = getCellStringValue(row.getCell(13));
cpr.setBillNum(billNum); cpr.setBillNum(billNum);
...@@ -2001,8 +2005,8 @@ public class DataImportService extends BaseService { ...@@ -2001,8 +2005,8 @@ public class DataImportService extends BaseService {
cpr.setPeriod(DateUtils.dateToPeriod(cpr.getBillingDate())); cpr.setPeriod(DateUtils.dateToPeriod(cpr.getBillingDate()));
cpr.setLastUpdatedDate(DateUtils.strToDate3(getCellStringValue(row.getCell(24)))); cpr.setLastUpdatedDate(DateUtils.strToDate3(getCellStringValue(row.getCell(24))));
cpr.setLastUpdatedPerson(getCellStringValue(row.getCell(25))); cpr.setLastUpdatedPerson(getCellStringValue(row.getCell(25)));
cpr.setTotalTaxAmount(getCellBigDecimalValue(row.getCell(26))); cpr.setTotalTaxAmount(getCellBigDecimalValue(row.getCell(26),evaluator));
cpr.setTotalTaxAmountHeader(getCellBigDecimalValue(row.getCell(27))); cpr.setTotalTaxAmountHeader(getCellBigDecimalValue(row.getCell(27),evaluator));
cpr.setBillingNote(getCellStringValue(row.getCell(28))); cpr.setBillingNote(getCellStringValue(row.getCell(28)));
cprs.add(cpr); cprs.add(cpr);
} }
...@@ -2060,10 +2064,19 @@ public class DataImportService extends BaseService { ...@@ -2060,10 +2064,19 @@ public class DataImportService extends BaseService {
return null; return null;
} }
private BigDecimal getCellBigDecimalValue(Cell cell) { private BigDecimal getCellBigDecimalValue(Cell cell,FormulaEvaluator evaluator) {
if (null == cell) { if (null == cell) {
return null; return null;
} }
if(cell.getCellTypeEnum().equals(CellType.FORMULA)){
CellValue cellValue = evaluator.evaluate(cell);
if (cellValue.getCellTypeEnum().equals(CellType.STRING)) {
return new BigDecimal(cellValue.getStringValue().trim());
} else if (cellValue.getCellTypeEnum().equals(CellType.NUMERIC)) {
return new BigDecimal(cellValue.getNumberValue());
}
return null;
}
if (cell.getCellTypeEnum().equals(CellType.STRING)) { if (cell.getCellTypeEnum().equals(CellType.STRING)) {
return new BigDecimal(cell.getStringCellValue().trim()); return new BigDecimal(cell.getStringCellValue().trim());
} else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) { } else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
...@@ -2072,6 +2085,18 @@ public class DataImportService extends BaseService { ...@@ -2072,6 +2085,18 @@ public class DataImportService extends BaseService {
logger.warn("获取单元格数据类型未匹配"); logger.warn("获取单元格数据类型未匹配");
return null; return null;
} }
// private BigDecimal getCellBigDecimalValue(Cell cell) {
// if (null == cell) {
// return null;
// }
// if (cell.getCellTypeEnum().equals(CellType.STRING)) {
// return new BigDecimal(cell.getStringCellValue().trim());
// } else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
// return new BigDecimal(cell.getNumericCellValue());
// }
// logger.warn("获取单元格数据类型未匹配");
// return null;
// }
private Long getCellLongDecimalValue(Cell cell) { private Long getCellLongDecimalValue(Cell cell) {
if (null == cell) { if (null == cell) {
......
...@@ -812,7 +812,7 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -812,7 +812,7 @@ public class EbsApiServiceImpl implements EbsApiService {
public void changeCallBackStatus(EbsCallBackDto ebsCallBackDto) { public void changeCallBackStatus(EbsCallBackDto ebsCallBackDto) {
DataImportLog dataImportLog = new DataImportLog(); DataImportLog dataImportLog = new DataImportLog();
dataImportLog.setId(ebsCallBackDto.getTaskId()); dataImportLog.setId(ebsCallBackDto.getTaskId());
dataImportLog.setImportResult(ebsCallBackDto.getTaskStatus().equals("S")?true:false); dataImportLog.setImportResult("S".equals(ebsCallBackDto.getTaskStatus())?true:false);
dataImportLog.setErrorMsg(ebsCallBackDto.getTaskDesc()); dataImportLog.setErrorMsg(ebsCallBackDto.getTaskDesc());
dataImportLog.setUpdateTime(new Date()); dataImportLog.setUpdateTime(new Date());
int res = dataImportLogMapper.updateByPrimaryKeySelective(dataImportLog); int res = dataImportLogMapper.updateByPrimaryKeySelective(dataImportLog);
......
jdbc_url=jdbc:mysql://10.88.128.65:8806/fintax_stage?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;useSSL=false jdbc_url=jdbc:mysql://172.20.2.218:3300/fintax_test?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;useSSL=false
jdbc_user=fintax_user_stage jdbc_user=fintax_user_test
jdbc_password=Fintaxuser@123Stage jdbc_password=Fintaxuser@123Test
#jdbc_password=111111 #jdbc_password=111111
jdbc_admin_db=taxadmin2018 jdbc_admin_db=taxadmin2018
...@@ -15,7 +15,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster ...@@ -15,7 +15,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL mail_jdbc_password=atmsunittestSQL
web.url=http://dts.erp.didichuxing.com web.url=http://dts.erp.didichuxing.com:9001
#web.url=* #web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg== jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx jwt.powerToken=xxxx
...@@ -33,7 +33,7 @@ max_file_length=104857600 ...@@ -33,7 +33,7 @@ max_file_length=104857600
distributed_id_datacenter=10 distributed_id_datacenter=10
distributed_id_machine=15 distributed_id_machine=15
api.url=http://dts.erp.didichuxing.com api.url=http://dts.erp.didichuxing.com:8180
# Longi config # Longi config
longi_api_basic_user= longi_api_basic_user=
...@@ -59,7 +59,7 @@ org_sync_token=174af08f ...@@ -59,7 +59,7 @@ org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ== dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.2.220:8080/ebs-proxy-test/dts ebs_call_url=http://172.20.3.109:8010/ebs-proxy-test/dts
#tableau config #tableau config
tableau_get_ticket=http://172.20.2.220:8080/trusted?username=%s tableau_get_ticket=http://172.20.2.220:8080/trusted?username=%s
...@@ -75,5 +75,3 @@ tableau_mexican_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Mexi ...@@ -75,5 +75,3 @@ tableau_mexican_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Mexi
tableau_australian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no tableau_australian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no tableau_brazilian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
api.url=http://dts.erp.didichuxing.com api.url=http://dts.erp.didichuxing.com:8180/
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg== jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx jwt.powerToken=xxxx
......
...@@ -744,7 +744,7 @@ ...@@ -744,7 +744,7 @@
<span class="required-tip"> * </span> <span class="required-tip"> * </span>
{{'Company Name' | translate}} {{'Company Name' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%" id="companyNameOptionsMap"> <div class="col-sm-11" style="width:61.67%;height: 13px" id="companyNameOptionsMap">
<div dx-select-box="editOrgOptions"></div> <div dx-select-box="editOrgOptions"></div>
<!--<select ng-model="editFieldModel.companyName" class="form-control"--> <!--<select ng-model="editFieldModel.companyName" class="form-control"-->
<!--title="{{editFieldModel.companyName}}" required--> <!--title="{{editFieldModel.companyName}}" required-->
...@@ -987,7 +987,7 @@ ...@@ -987,7 +987,7 @@
<span class="required-tip"> * </span> <span class="required-tip"> * </span>
{{'Company Name' | translate}} {{'Company Name' | translate}}
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%;height: 13px">
<div ng-class="{'upload-fail-mark':!editFieldItem.companyName}" dx-select-box="editFieldItemOrgOptions"></div> <div ng-class="{'upload-fail-mark':!editFieldItem.companyName}" dx-select-box="editFieldItemOrgOptions"></div>
<!--<select ng-model="editFieldItem.companyName" class="form-control"--> <!--<select ng-model="editFieldItem.companyName" class="form-control"-->
<!--title="{{editFieldItem.companyName}}"--> <!--title="{{editFieldItem.companyName}}"-->
......
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