Commit 169546f8 authored by chase's avatar chase

fix jxfp bug

parent 80b609ea
...@@ -48,7 +48,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -48,7 +48,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
return null; return null;
} }
int certificationPeriod = getIntParam(args[0], ec); int certificationPeriod = getIntParam(args[0], ec);//暂时不做筛选条件
int invoiceTypeParam = getIntParam(args[1], ec); int invoiceTypeParam = getIntParam(args[1], ec);
int authenticationType = getIntParam(args[2], ec); int authenticationType = getIntParam(args[2], ec);
int resultType = getIntParam(args[3], ec); int resultType = getIntParam(args[3], ec);
...@@ -104,32 +104,32 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -104,32 +104,32 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
return NumberEval.ZERO; return NumberEval.ZERO;
} }
if (certificationPeriod != -99 && certificationPeriod != 99 // if (certificationPeriod != -99 && certificationPeriod != 99
&& (certificationPeriod < 1 || certificationPeriod > 12)) { // && (certificationPeriod < 1 || certificationPeriod > 12)) {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId()); // saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
return NumberEval.ZERO; // return NumberEval.ZERO;
} else if (!formulaContext.getIsYear()) { // } else if (!formulaContext.getIsYear()) {
if (certificationPeriod == -99) { // if (certificationPeriod == -99) {
calendar.set(formulaContext.getYear(), formulaContext.getPeriod(), 1); // calendar.set(formulaContext.getYear(), formulaContext.getPeriod(), 1);
endDate = calendar.getTime(); // endDate = calendar.getTime();
Date finalEndDate = endDate; // Date finalEndDate = endDate;
inputInvoices = inputInvoices.stream() // inputInvoices = inputInvoices.stream()
.filter(a -> a.getCertifiedDate().before(finalEndDate)) // .filter(a -> a.getCertifiedDate().before(finalEndDate))
.collect(Collectors.toList()); // .collect(Collectors.toList());
} else if (certificationPeriod != 99) { // } else if (certificationPeriod != 99) {
calendar.set(formulaContext.getYear(), certificationPeriod - 1, 1); // calendar.set(formulaContext.getYear(), certificationPeriod - 1, 1);
startDate = calendar.getTime(); // startDate = calendar.getTime();
calendar.set(formulaContext.getYear(), certificationPeriod, 1); // calendar.set(formulaContext.getYear(), certificationPeriod, 1);
// calendar.add(Calendar.MONTH, 1); //// calendar.add(Calendar.MONTH, 1);
endDate = calendar.getTime(); // endDate = calendar.getTime();
Date finalEndDate1 = endDate; // Date finalEndDate1 = endDate;
Date finalStartDate = startDate; // Date finalStartDate = startDate;
inputInvoices = inputInvoices.stream() // inputInvoices = inputInvoices.stream()
.filter(a -> a.getCertifiedDate().after(finalStartDate) // .filter(a -> a.getCertifiedDate().after(finalStartDate)
&& a.getCertifiedDate().before(finalEndDate1)) // && a.getCertifiedDate().before(finalEndDate1))
.collect(Collectors.toList()); // .collect(Collectors.toList());
} // }
} // }
List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>(); List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (CertifiedInvoicesList x : inputInvoices) { for (CertifiedInvoicesList x : inputInvoices) {
...@@ -198,7 +198,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -198,7 +198,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
public List<CertifiedInvoicesList> getInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) { public List<CertifiedInvoicesList> getInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) {
CertifiedInvoicesListExample example = new CertifiedInvoicesListExample(); CertifiedInvoicesListExample example = new CertifiedInvoicesListExample();
CertifiedInvoicesListExample.Criteria criteria = example.createCriteria(); CertifiedInvoicesListExample.Criteria criteria = example.createCriteria();
criteria.andProjectIdEqualTo(formulaContext.getProjectId());
if (period != null) { if (period != null) {
criteria.andPeriodEqualTo(Integer.valueOf(formulaContext.getYear() + (period > 9 ? period.toString() : "0" + period.toString()))); criteria.andPeriodEqualTo(Integer.valueOf(formulaContext.getYear() + (period > 9 ? period.toString() : "0" + period.toString())));
} }
......
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