Commit 169546f8 authored by chase's avatar chase

fix jxfp bug

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