Commit ea7464d4 authored by sherlock's avatar sherlock

another dataSource

parent 12a80630
...@@ -10,9 +10,11 @@ import pwc.taxtech.atms.dao.ProjectDao; ...@@ -10,9 +10,11 @@ import pwc.taxtech.atms.dao.ProjectDao;
import pwc.taxtech.atms.dao.ProjectMapper; import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper; import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.invoice.InputInvoiceMapper; import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper; import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.DistributedIdService; import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.*; import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetail;
//用来获取spring托管的bean //用来获取spring托管的bean
@Component @Component
...@@ -41,12 +43,12 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -41,12 +43,12 @@ public class SpringContextUtil implements ApplicationContextAware {
public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper; public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper; public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
public static BalanceStdManualMapper balanceStdManualMapper; public static BalanceStdManualMapper balanceStdManualMapper;
// public static OutputVatInvoiceMapper outputVATInvoiceMapper;
public static OutputInvoiceMapper outputInvoiceMapper; public static OutputInvoiceMapper outputInvoiceMapper;
public static OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper; public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
public static InputInvoiceDao inputInvoiceDao; public static InputInvoiceDao inputInvoiceDao;
// public static InputVatInvoiceMapper inputVATInvoiceMapper;
public static InputInvoiceMapper inputInvoiceMapper; public static InputInvoiceMapper inputInvoiceMapper;
public static InputVatInvoiceMapper inputVatInvoiceMapper;
public static AssetsListMapper assetsListMapper; public static AssetsListMapper assetsListMapper;
public static ProjectMapper projectMapper; public static ProjectMapper projectMapper;
public static CellDataSourceMapper cellDataSourceMapper; public static CellDataSourceMapper cellDataSourceMapper;
...@@ -89,8 +91,12 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -89,8 +91,12 @@ public class SpringContextUtil implements ApplicationContextAware {
vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class); vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class);
periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class); periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class);
balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class); balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class);
// outputVatInvoiceMapper = webApplicationContext.getBean(OutputVatInvoiceMapper.class);
outputInvoiceMapper = webApplicationContext.getBean(OutputInvoiceMapper.class); outputInvoiceMapper = webApplicationContext.getBean(OutputInvoiceMapper.class);
outputInvoiceDetailMapper = webApplicationContext.getBean(OutputInvoiceDetailMapper.class);
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class); periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
// inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class);
inputVatInvoiceMapper = webApplicationContext.getBean(InputVatInvoiceMapper.class);
inputInvoiceDao = webApplicationContext.getBean(InputInvoiceDao.class); inputInvoiceDao = webApplicationContext.getBean(InputInvoiceDao.class);
inputInvoiceMapper = webApplicationContext.getBean(InputInvoiceMapper.class); inputInvoiceMapper = webApplicationContext.getBean(InputInvoiceMapper.class);
assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class); assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class);
......
...@@ -4,6 +4,8 @@ import org.apache.commons.lang3.StringUtils; ...@@ -4,6 +4,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.invoice.InputInvoiceMapper; import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.vat.entity.InputInvoice;
import pwc.taxtech.atms.vat.entity.InputInvoiceExample;
import pwc.taxtech.atms.vat.entity.InputVatInvoice; import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample; import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
...@@ -14,27 +16,29 @@ public class InputInvoiceDao { ...@@ -14,27 +16,29 @@ public class InputInvoiceDao {
@Autowired @Autowired
InputInvoiceMapper inputInvoiceMapper; InputInvoiceMapper inputInvoiceMapper;
public List<InputVatInvoice> getInputInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) { public List<InputInvoice> getInputInvoice(Integer period, String invoiceType, String checkPass, String scanPass, String notPass) {
InputVatInvoiceExample example = new InputVatInvoiceExample(); InputInvoiceExample example = new InputInvoiceExample();
InputVatInvoiceExample.Criteria criteria = example.createCriteria(); InputInvoiceExample.Criteria criteria = example.createCriteria();
InputVatInvoiceExample.Criteria criteria1 = example.createCriteria(); InputInvoiceExample.Criteria criteria1 = example.createCriteria();
if (period != null) { if (period != null) {
criteria.andPeriodIdEqualTo(period); criteria.andRZSQEqualTo(String.valueOf(period));
criteria1.andPeriodIdEqualTo(period); criteria1.andRZSQEqualTo(String.valueOf(period));
} }
if (invoiceType != null) { if (invoiceType != null) {
criteria.andInvoiceTypeEqualTo(invoiceType); criteria.andFPLXEqualTo(String.valueOf(invoiceType));
criteria1.andInvoiceTypeEqualTo(invoiceType); criteria1.andFPLXEqualTo(String.valueOf(invoiceType));
} }
if (StringUtils.isNotBlank(notPass)) { if (StringUtils.isNotBlank(notPass)) {
criteria.andCertificationResultEqualTo(notPass); String unPass = "1";
criteria1.andCertificationResultEqualTo(notPass); criteria.andRZJGEqualTo(unPass);
criteria1.andRZJGEqualTo(unPass);
} else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) { } else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) {
criteria.andCertificationResultEqualTo(checkPass); String pass = "0";
criteria.andCertificationResultEqualTo(scanPass); criteria.andRZJGEqualTo(pass);
criteria1.andRZJGEqualTo(pass);
example.or(criteria1); example.or(criteria1);
} }
......
//package pwc.taxtech.atms.vat.dao;
//
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
//import pwc.taxtech.atms.vat.entity.OutputInvoice;
//import pwc.taxtech.atms.vat.entity.OutputInvoiceExample;
//
//import java.util.List;
//
//@Service
//public class OutputInvoiceDao {
// @Autowired
// OutputInvoiceMapper outputInvoiceMapper;
//
// public List<OutputInvoice> getOutputInvoice(Integer period, String invoiceType, String checkPass, String scanPass, String notPass) {
// OutputInvoiceExample example = new OutputInvoiceExample();
// OutputInvoiceExample.Criteria criteria = example.createCriteria();
// OutputInvoiceExample.Criteria criteria1 = example.createCriteria();
//
// if (period != null) {
//
// criteria.andRZSQEqualTo(String.valueOf(period));
// criteria1.andRZSQEqualTo(String.valueOf(period));
// }
// if (invoiceType != null) {
// criteria.andFPLXEqualTo(String.valueOf(invoiceType));
// criteria1.andFPLXEqualTo(String.valueOf(invoiceType));
// }
//
// if (StringUtils.isNotBlank(notPass)) {
// String unPass = "1";
// criteria.andRZJGEqualTo(unPass);
// criteria1.andRZJGEqualTo(unPass);
// } else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) {
// String pass = "0";
// criteria.andRZJGEqualTo(pass);
// criteria1.andRZJGEqualTo(pass);
// example.or(criteria1);
// }
//
// return outputInvoiceMapper.selectByExample(example);
// }
//}
...@@ -4,13 +4,14 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; ...@@ -4,13 +4,14 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType; import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto; import pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.entity.InputVatInvoice; import pwc.taxtech.atms.vat.entity.InputInvoice;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -50,12 +51,14 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -50,12 +51,14 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
} }
int certificationPeriod = getIntParam(args[0], ec); int certificationPeriod = getIntParam(args[0], ec);
int invoiceType = 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);
int period = getIntParam(args[3], ec); int period = getIntParam(args[4], ec);
int invoiceTypeParam = getIntParam(args[1], ec);
// 客户情况只计算增值税专票
String invoiceType = "004";
String formulaExpression = "JXFP(" + certificationPeriod + "," + invoiceType + "," String formulaExpression = "JXFP(" + certificationPeriod + "," + invoiceTypeParam + ","
+ authenticationType + "," + resultType + "," + period + ")"; + authenticationType + "," + resultType + "," + period + ")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
...@@ -79,24 +82,24 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -79,24 +82,24 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
calendar.add(Calendar.YEAR, 1); calendar.add(Calendar.YEAR, 1);
Date endDate = calendar.getTime(); Date endDate = calendar.getTime();
List<InputVatInvoice> inputVATInvoices; List<InputInvoice> inputInvoices;
if (authenticationType == 1 && formulaContext.getIsYear()) { if (authenticationType == 1 && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType, inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass, Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null); null);
} else if (authenticationType == 1) { } else if (authenticationType == 1) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass, Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null); null);
} }
// 认证未通过与未认证暂认为是同一个意思 // 认证未通过与未认证暂认为是同一个意思
else if ((authenticationType == 1 || authenticationType == 2) && formulaContext.getIsYear()) { else if ((authenticationType == 1 || authenticationType == 2) && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType, inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
null, null, Constant.InputInvoiceCertificationResult.NotPass); null, null, Constant.InputInvoiceCertificationResult.NotPass);
} }
// 认证未通过与未认证暂认为是同一个意思 // 认证未通过与未认证暂认为是同一个意思
else if (authenticationType == 0 || authenticationType == 2) { else if (authenticationType == 0 || authenticationType == 2) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null, inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null,
null, Constant.InputInvoiceCertificationResult.NotPass); null, Constant.InputInvoiceCertificationResult.NotPass);
} else { } else {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId()); saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
...@@ -112,8 +115,8 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -112,8 +115,8 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
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;
inputVATInvoices = inputVATInvoices.stream() inputInvoices = inputInvoices.stream()
.filter(a -> a.getCertificationDate().before(finalEndDate)) .filter(a -> DateUtils.strToDate(a.getRZSJ()).before(finalEndDate))
.collect(Collectors.toList()); .collect(Collectors.toList());
} else if (certificationPeriod != 99) { } else if (certificationPeriod != 99) {
calendar.set(formulaContext.getYear(), certificationPeriod, 1); calendar.set(formulaContext.getYear(), certificationPeriod, 1);
...@@ -123,27 +126,27 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -123,27 +126,27 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
endDate = calendar.getTime(); endDate = calendar.getTime();
Date finalEndDate1 = endDate; Date finalEndDate1 = endDate;
Date finalStartDate = startDate; Date finalStartDate = startDate;
inputVATInvoices = inputVATInvoices.stream() inputInvoices = inputInvoices.stream()
.filter(a -> a.getCertificationDate().after(finalStartDate) .filter(a -> DateUtils.strToDate(a.getRZSJ()).after(finalStartDate)
&& a.getCertificationDate().before(finalEndDate1)) && DateUtils.strToDate(a.getRZSJ()).before(finalEndDate1))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }
List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>(); List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (InputVatInvoice x : inputVATInvoices) { for (InputInvoice x : inputInvoices) {
InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto(); InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto();
inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getAmount(), KeyValueConfigResultType.Accounting, inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(new BigDecimal(x.getHJJE()), KeyValueConfigResultType.Accounting,
null, formulaContext)); null, formulaContext));
inputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode()); inputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
inputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(x.getTaxAmount(), KeyValueConfigResultType.Accounting, inputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(new BigDecimal(x.getHJSE()), KeyValueConfigResultType.Accounting,
null, formulaContext)); null, formulaContext));
inputInvoiceDataSourceDto.setCertificationDate(x.getCertificationDate()); inputInvoiceDataSourceDto.setCertificationDate(DateUtils.strToDate(x.getRZSJ()));
inputInvoiceDataSourceDto.setInvoiceCode(x.getInvoiceCode()); inputInvoiceDataSourceDto.setInvoiceCode(x.getFPDM());
inputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoiceNumber()); inputInvoiceDataSourceDto.setInvoiceNumber(x.getFPHM());
inputInvoiceDataSourceDto.setInvoiceType(x.getInvoiceType()); inputInvoiceDataSourceDto.setInvoiceType(Integer.parseInt(x.getFPLX()));
inputInvoiceDataSourceDto.setPeriod(x.getPeriodId()); inputInvoiceDataSourceDto.setPeriod(Integer.parseInt(x.getRZSQ()));
inputInvoiceDataSourceDto.setSellerTaxNumber(x.getSellerTaxNumber()); inputInvoiceDataSourceDto.setSellerTaxNumber(x.getXFSH());
inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource); inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource);
inputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode()); inputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource.add(inputInvoiceDataSourceDto); dataSource.add(inputInvoiceDataSourceDto);
......
...@@ -84,7 +84,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction { ...@@ -84,7 +84,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
} }
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear); String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputInvoiceMapper.getInputVATInvoiceResultDto(dbName); List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVatInvoiceMapper.getInputVATInvoiceResultDto(dbName);
if (!goodsName.equals("99")) { if (!goodsName.equals("99")) {
inputInvoice = inputInvoice.stream() inputInvoice = inputInvoice.stream()
......
...@@ -5,18 +5,20 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; ...@@ -5,18 +5,20 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType; import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto; import pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.dpo.OutputInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceDto; import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceDto;
import pwc.taxtech.atms.vat.entity.OutputInvoice;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetailExample;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -41,9 +43,10 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -41,9 +43,10 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
} }
String taxRate = getStringParam(args[0], ec); String taxRate = getStringParam(args[0], ec);
int invoiceType = getIntParam(args[1], ec); int invoiceTypeParam = getIntParam(args[1], ec);
int amountType = getIntParam(args[2], ec); int amountType = getIntParam(args[2], ec);
int period = getIntParam(args[3], ec); int period = getIntParam(args[3], ec);
String invoiceType = "004";
String formulaExpression = "XXFP(\"" + taxRate + "\"," + invoiceType + "," + amountType + "," + period + ")"; String formulaExpression = "XXFP(\"" + taxRate + "\"," + invoiceType + "," + amountType + "," + period + ")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
...@@ -70,42 +73,49 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -70,42 +73,49 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
taxRateVal = taxRateVal.divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP); //保留两位小数,然后四舍五入 taxRateVal = taxRateVal.divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP); //保留两位小数,然后四舍五入
} }
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear); // String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getVatInvoiceWithItems(dbName); // List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputVatInvoiceMapper.getVatInvoiceWithItems(dbName);
List<OutputInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getOutputInvoiceWithDetail();
if (invoiceType != 99) { if (invoiceTypeParam == 1) {
outputInvoice = outputInvoice.stream() outputInvoice = outputInvoice.stream()
.filter(a -> a.getInvoice().getInvoiceType() == invoiceType) // .filter(a -> a.getInvoice().getInvoiceType() == invoiceType)
.filter(a -> StringUtils.equals(a.getInvoice().getFPLXDM(), invoiceType))
.collect(Collectors.toList());
} else if(invoiceTypeParam == 0){
outputInvoice = outputInvoice.stream()
// .filter(a -> a.getInvoice().getInvoiceType() == invoiceType)
.filter(a -> !StringUtils.equals(a.getInvoice().getFPLXDM(), invoiceType))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (taxRateVal.compareTo(new BigDecimal("99")) != 0) { if (taxRateVal.compareTo(new BigDecimal("99")) != 0) {
BigDecimal finalTaxRateVal = taxRateVal; BigDecimal finalTaxRateVal = taxRateVal;
outputInvoice = outputInvoice.stream() outputInvoice = outputInvoice.stream()
.filter(a -> a.getInvoiceItem().getTaxRate().compareTo(finalTaxRateVal) == 0) .filter(a -> new BigDecimal(a.getInvoiceDeatil().getSLV()).compareTo(finalTaxRateVal) == 0)
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (period != 99) { if (period != 99) {
int finalPeriod = period; int finalPeriod = period;
outputInvoice = outputInvoice.stream().filter(a -> a.getInvoice().getPeriodId().equals(finalPeriod)).collect(Collectors.toList()); outputInvoice = outputInvoice.stream().filter(a -> getPeriodFromDate(a.getInvoice().getKPRQ()) == finalPeriod).collect(Collectors.toList());
} }
List<OutputInvoiceDataSourceDto> dataSource = new ArrayList<>(); List<OutputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (OutputVATInvoiceDto x : outputInvoice) { for (OutputInvoiceDto x : outputInvoice) {
OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto(); OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto();
outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getInvoiceItem().getAmount(), outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(new BigDecimal(x.getInvoiceDeatil().getJE()),
KeyValueConfigResultType.Accounting, null, formulaContext)); KeyValueConfigResultType.Accounting, null, formulaContext));
outputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode()); outputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
outputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(x.getInvoiceItem().getAmount(), outputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(new BigDecimal(x.getInvoiceDeatil().getSE()),
KeyValueConfigResultType.Accounting, null, formulaContext)); KeyValueConfigResultType.Accounting, null, formulaContext));
outputInvoiceDataSourceDto.setTaxRate(x.getInvoiceItem().getTaxRate()); outputInvoiceDataSourceDto.setTaxRate(new BigDecimal(x.getInvoiceDeatil().getSLV()));
outputInvoiceDataSourceDto.setBuyerName(x.getInvoice().getBuyerName()); outputInvoiceDataSourceDto.setBuyerName(x.getInvoice().getGFMC());
outputInvoiceDataSourceDto.setInvoiceCode(x.getInvoice().getClassCode()); outputInvoiceDataSourceDto.setInvoiceCode(x.getInvoice().getFPDM());
outputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoice().getInvoiceNumber()); outputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoice().getFPHM());
outputInvoiceDataSourceDto.setInvoiceDate(x.getInvoice().getInvoiceDate()); outputInvoiceDataSourceDto.setInvoiceDate(DateUtils.strToDate(x.getInvoice().getKPRQ()));
outputInvoiceDataSourceDto.setInvoiceType(x.getInvoice().getInvoiceType()); outputInvoiceDataSourceDto.setInvoiceType(invoiceTypeParam);
outputInvoiceDataSourceDto.setPeriod(x.getInvoice().getPeriodId()); outputInvoiceDataSourceDto.setPeriod(getPeriodFromDate(x.getInvoice().getKPRQ()));
outputInvoiceDataSourceDto.setName(Constant.DataSourceName.OutputInvoiceDataSource); outputInvoiceDataSourceDto.setName(Constant.DataSourceName.OutputInvoiceDataSource);
outputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode()); outputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource.add(outputInvoiceDataSourceDto); dataSource.add(outputInvoiceDataSourceDto);
...@@ -128,4 +138,11 @@ public class XXFP extends FunctionBase implements FreeRefFunction { ...@@ -128,4 +138,11 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
} }
return NumberEval.ZERO; return NumberEval.ZERO;
} }
private int getPeriodFromDate(String dateStr){
Date date = DateUtils.strToDate(dateStr);
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.MONTH) + 1;
}
} }
package pwc.taxtech.atms.invoice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.InputInvoiceDetail;
import pwc.taxtech.atms.vat.entity.InputInvoiceDetailExample;
import java.util.List;
@Mapper
public interface InputInvoiceDetailMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
long countByExample(InputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int deleteByExample(InputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int insert(InputInvoiceDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int insertSelective(InputInvoiceDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
List<InputInvoiceDetail> selectByExampleWithRowbounds(InputInvoiceDetailExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
List<InputInvoiceDetail> selectByExample(InputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") InputInvoiceDetail record, @Param("example") InputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int updateByExample(@Param("record") InputInvoiceDetail record, @Param("example") InputInvoiceDetailExample example);
}
\ No newline at end of file
package pwc.taxtech.atms.invoice; package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.CellInvoiceDto; import pwc.taxtech.atms.vat.dpo.CellInvoiceDto;
import pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam; //import pwc.taxtech.atms.vat.dpo.InputInvoiceItemExtendDto;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceItemExtendDto; import pwc.taxtech.atms.vat.entity.InputInvoice;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto; import pwc.taxtech.atms.vat.entity.InputInvoiceExample;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.List;
@Mapper @Mapper
public interface InputInvoiceMapper extends MyVatMapper { public interface InputInvoiceMapper extends MyVatMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
long countByExample(InputVatInvoiceExample example); long countByExample(InputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int deleteByExample(InputVatInvoiceExample example); int deleteByExample(InputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int deleteByPrimaryKey(String id); int deleteByPrimaryKey(String ID);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int insert(InputVatInvoice record); int insert(InputInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int insertSelective(InputVatInvoice record); int insertSelective(InputInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
List<InputVatInvoice> selectByExampleWithRowbounds(InputVatInvoiceExample example, RowBounds rowBounds); List<InputInvoice> selectByExampleWithRowbounds(InputInvoiceExample example, RowBounds rowBounds);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
List<InputVatInvoice> selectByExample(InputVatInvoiceExample example); List<InputInvoice> selectByExample(InputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
InputVatInvoice selectByPrimaryKey(String id); InputInvoice selectByPrimaryKey(String ID);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByExampleSelective(@Param("record") InputVatInvoice record, @Param("example") InputVatInvoiceExample example); int updateByExampleSelective(@Param("record") InputInvoice record, @Param("example") InputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByExample(@Param("record") InputVatInvoice record, @Param("example") InputVatInvoiceExample example); int updateByExample(@Param("record") InputInvoice record, @Param("example") InputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKeySelective(InputVatInvoice record); int updateByPrimaryKeySelective(InputInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(InputVatInvoice record); int updateByPrimaryKey(InputInvoice record);
long getInputVATInvoiceCountByCondition(@Param("paras") InputInvoicePreviewQueryParam param);
List<InputVatInvoice> getInputVATInvoiceCountByConditionWithPaging(@Param("paras") InputInvoicePreviewQueryParam param,
@Param("limitFrom") int limitFrom);
List<InputVATInvoiceResultDto> getInputVATInvoiceResultDto(@Param("dbName") String dbName);
List<CellInvoiceDto> selectInputInvoiceWithItem(); List<CellInvoiceDto> selectInputInvoiceWithItem();
InputVATInvoiceItemExtendDto selectInvoiceExtendDto(@Param("invoiceItemId") String invoiceItemId); // InputInvoiceItemExtendDto selectInvoiceExtendDto(@Param("invoiceItemId") String invoiceItemId);
} }
\ No newline at end of file
package pwc.taxtech.atms.invoice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.InputMaterialItem;
import pwc.taxtech.atms.vat.entity.InputMaterialItemExample;
import java.util.List;
@Mapper
public interface InputMaterialItemMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
long countByExample(InputMaterialItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
int deleteByExample(InputMaterialItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
int insert(InputMaterialItem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
int insertSelective(InputMaterialItem record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
List<InputMaterialItem> selectByExampleWithRowbounds(InputMaterialItemExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
List<InputMaterialItem> selectByExample(InputMaterialItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") InputMaterialItem record, @Param("example") InputMaterialItemExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.INPUT_MATERIAL_ITEM
*
* @mbg.generated
*/
int updateByExample(@Param("record") InputMaterialItem record, @Param("example") InputMaterialItemExample example);
}
\ No newline at end of file
package pwc.taxtech.atms.invoice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetail;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetailExample;
import java.util.List;
@Mapper
public interface OutputInvoiceDetailMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
long countByExample(OutputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int deleteByExample(OutputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int deleteByPrimaryKey(String ID);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int insert(OutputInvoiceDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int insertSelective(OutputInvoiceDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
List<OutputInvoiceDetail> selectByExampleWithRowbounds(OutputInvoiceDetailExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
List<OutputInvoiceDetail> selectByExample(OutputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
OutputInvoiceDetail selectByPrimaryKey(String ID);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") OutputInvoiceDetail record, @Param("example") OutputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int updateByExample(@Param("record") OutputInvoiceDetail record, @Param("example") OutputInvoiceDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OutputInvoiceDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE_DETAIL
*
* @mbg.generated
*/
int updateByPrimaryKey(OutputInvoiceDetail record);
}
\ No newline at end of file
package pwc.taxtech.atms.invoice; package pwc.taxtech.atms.invoice;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.OutputInvoiceDataSourceDto; import pwc.taxtech.atms.vat.dpo.OutputInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto; import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.vat.dpo.QueryOutputDto; import pwc.taxtech.atms.vat.entity.OutputInvoice;
import pwc.taxtech.atms.vat.entity.OutputVatInvoice; import pwc.taxtech.atms.vat.entity.OutputInvoiceExample;
import pwc.taxtech.atms.vat.entity.OutputVatInvoiceExample; import pwc.taxtech.atms.vat.entity.OutputInvoiceKey;
import java.util.List;
@Mapper @Mapper
public interface OutputInvoiceMapper extends MyVatMapper { public interface OutputInvoiceMapper extends MyVatMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
long countByExample(OutputVatInvoiceExample example); long countByExample(OutputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int deleteByExample(OutputVatInvoiceExample example); int deleteByExample(OutputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int deleteByPrimaryKey(String invoiceId); int deleteByPrimaryKey(OutputInvoiceKey key);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int insert(OutputVatInvoice record); int insert(OutputInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int insertSelective(OutputVatInvoice record); int insertSelective(OutputInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
List<OutputVatInvoice> selectByExampleWithRowbounds(OutputVatInvoiceExample example, RowBounds rowBounds); List<OutputInvoice> selectByExampleWithRowbounds(OutputInvoiceExample example, RowBounds rowBounds);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
List<OutputVatInvoice> selectByExample(OutputVatInvoiceExample example); List<OutputInvoice> selectByExample(OutputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
OutputVatInvoice selectByPrimaryKey(String invoiceId); OutputInvoice selectByPrimaryKey(OutputInvoiceKey key);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByExampleSelective(@Param("record") OutputVatInvoice record, @Param("example") OutputVatInvoiceExample example); int updateByExampleSelective(@Param("record") OutputInvoice record, @Param("example") OutputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByExample(@Param("record") OutputVatInvoice record, @Param("example") OutputVatInvoiceExample example); int updateByExample(@Param("record") OutputInvoice record, @Param("example") OutputInvoiceExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKeySelective(OutputVatInvoice record); int updateByPrimaryKeySelective(OutputInvoice record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE * This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
* *
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(OutputVatInvoice record); int updateByPrimaryKey(OutputInvoice record);
List<OutputVATInvoiceInfoDto> selectOutputVATInvoiceInfoLeftJoinItem(@Param("queryDto") QueryOutputDto queryDto);
@Select("SELECT " + @Select("SELECT " +
" o.PERIOD_ID as periodId, " + " o.PERIOD_ID as periodId, " +
...@@ -185,7 +181,6 @@ public interface OutputInvoiceMapper extends MyVatMapper { ...@@ -185,7 +181,6 @@ public interface OutputInvoiceMapper extends MyVatMapper {
" ") " ")
List<OutputVATInvoiceInfoDto> queryOutputDetailWithItem(Integer period); List<OutputVATInvoiceInfoDto> queryOutputDetailWithItem(Integer period);
List<OutputVATInvoiceDto> getVatInvoiceWithItems(@Param("dbName") String dbName); List<OutputInvoiceDto> getOutputInvoiceWithDetail();
List<OutputInvoiceDataSourceDto> selectOutputInvoiceAndItem();
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.vat.entity.*;
public class InputInvoiceResultDto {
private String invoiceID;
private InputInvoice inputInvoice;
private InputInvoiceDetail inputInvoiceDetail;
private InputMaterialItem inputMaterialItem;
public InputInvoiceDetail getInputInvoiceDetail() {
return inputInvoiceDetail;
}
public void setInputInvoiceDetail(InputInvoiceDetail inputInvoiceDetail) {
this.inputInvoiceDetail = inputInvoiceDetail;
}
public String getInvoiceID() {
return invoiceID;
}
public void setInvoiceID(String invoiceID) {
this.invoiceID = invoiceID;
}
public InputInvoice getInputInvoice() {
return inputInvoice;
}
public void setInputInvoice(InputInvoice inputInvoice) {
this.inputInvoice = inputInvoice;
}
public InputMaterialItem getInputMaterialItem() {
return inputMaterialItem;
}
public void setInputMaterialItem(InputMaterialItem inputMaterialItem) {
this.inputMaterialItem = inputMaterialItem;
}
}
package pwc.taxtech.atms.vat.dpo;
import pwc.taxtech.atms.vat.entity.OutputInvoice;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetail;
import pwc.taxtech.atms.vat.entity.OutputVatInvoice;
import pwc.taxtech.atms.vat.entity.OutputVatInvoiceItem;
public class OutputInvoiceDto {
private String invoiceID;
private OutputInvoice invoice;
private OutputInvoiceDetail invoiceDetail;
public String getInvoiceID() {
return invoiceID;
}
public void setInvoiceID(String invoiceID) {
this.invoiceID = invoiceID;
}
public OutputInvoice getInvoice() {
return invoice;
}
public void setInvoice(OutputInvoice invoice) {
this.invoice = invoice;
}
public OutputInvoiceDetail getInvoiceDeatil() {
return invoiceDetail;
}
public void setInvoiceDetail(OutputInvoiceDetail invoiceDetail) {
this.invoiceDetail = invoiceDetail;
}
}
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
*
* @mbg.generated do_not_delete_during_merge
*/
public class OutputInvoiceKey implements Serializable {
/**
* Database Column Remarks:
* 唯一id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column PWC_INVOICE.OUTPUT_INVOICE.ID
*
* @mbg.generated
*/
private String ID;
/**
* Database Column Remarks:
* 发票请求流水号 发票的唯一识别号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column PWC_INVOICE.OUTPUT_INVOICE.FPQQLSH
*
* @mbg.generated
*/
private String FPQQLSH;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column PWC_INVOICE.OUTPUT_INVOICE.ID
*
* @return the value of PWC_INVOICE.OUTPUT_INVOICE.ID
*
* @mbg.generated
*/
public String getID() {
return ID;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PWC_INVOICE.OUTPUT_INVOICE.ID
*
* @param ID the value for PWC_INVOICE.OUTPUT_INVOICE.ID
*
* @mbg.generated
*/
public void setID(String ID) {
this.ID = ID == null ? null : ID.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column PWC_INVOICE.OUTPUT_INVOICE.FPQQLSH
*
* @return the value of PWC_INVOICE.OUTPUT_INVOICE.FPQQLSH
*
* @mbg.generated
*/
public String getFPQQLSH() {
return FPQQLSH;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PWC_INVOICE.OUTPUT_INVOICE.FPQQLSH
*
* @param FPQQLSH the value for PWC_INVOICE.OUTPUT_INVOICE.FPQQLSH
*
* @mbg.generated
*/
public void setFPQQLSH(String FPQQLSH) {
this.FPQQLSH = FPQQLSH == null ? null : FPQQLSH.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", ID=").append(ID);
sb.append(", FPQQLSH=").append(FPQQLSH);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
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