Commit 8c1e9fa7 authored by frank.xa.zhang's avatar frank.xa.zhang

Merge remote-tracking branch 'origin/dev_oracle' into dev_oracle

parents 04d46791 2d52fc08
......@@ -533,6 +533,21 @@ public class DateUtils {
return true;
}
public static String getPeriodBegin(int year, int period) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.set(year, period - 1, 1, 0, 0, 0);
return sdf.format(calendar.getTime());
}
public static String getPeriodEnd(int year, int period) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Calendar calendar = Calendar.getInstance();
calendar.set(year, period - 1, -1, 23, 59, 59);
return sdf.format(calendar.getTime());
}
// /***************************************************************************
// * //nd=1表示返回的值中包含年度 //yf=1表示返回的值中包含月份 //rq=1表示返回的值中包含日期 //format表示返回的格式 1
// * 以年月日中文返回 2 以横线-返回 // 3 以斜线/返回 4 以缩写不带其它符号形式返回 // 5 以点号.返回
......
......@@ -10,9 +10,11 @@ import pwc.taxtech.atms.dao.ProjectDao;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.*;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetail;
//用来获取spring托管的bean
@Component
......@@ -41,12 +43,12 @@ public class SpringContextUtil implements ApplicationContextAware {
public static VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
public static PeriodEnterpriseAccountMapper periodEnterpriseAccountMapper;
public static BalanceStdManualMapper balanceStdManualMapper;
// public static OutputVatInvoiceMapper outputVATInvoiceMapper;
public static OutputInvoiceMapper outputInvoiceMapper;
public static OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
public static InputInvoiceDao inputInvoiceDao;
// public static InputVatInvoiceMapper inputVATInvoiceMapper;
public static InputInvoiceMapper inputInvoiceMapper;
public static InputVatInvoiceMapper inputVatInvoiceMapper;
public static AssetsListMapper assetsListMapper;
public static ProjectMapper projectMapper;
public static CellDataSourceMapper cellDataSourceMapper;
......@@ -89,8 +91,12 @@ public class SpringContextUtil implements ApplicationContextAware {
vatEnterpriseAccountMapper = webApplicationContext.getBean(VatEnterpriseAccountMapper.class);
periodEnterpriseAccountMapper = webApplicationContext.getBean(PeriodEnterpriseAccountMapper.class);
balanceStdManualMapper = webApplicationContext.getBean(BalanceStdManualMapper.class);
// outputVatInvoiceMapper = webApplicationContext.getBean(OutputVatInvoiceMapper.class);
outputInvoiceMapper = webApplicationContext.getBean(OutputInvoiceMapper.class);
outputInvoiceDetailMapper = webApplicationContext.getBean(OutputInvoiceDetailMapper.class);
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
// inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class);
inputVatInvoiceMapper = webApplicationContext.getBean(InputVatInvoiceMapper.class);
inputInvoiceDao = webApplicationContext.getBean(InputInvoiceDao.class);
inputInvoiceMapper = webApplicationContext.getBean(InputInvoiceMapper.class);
assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class);
......
......@@ -48,6 +48,16 @@ public final class Constant {
public static final String EMPTY = "";
public static final String DateTimeFormate = "%d年%d月";
public static final String INPUT_RZJG_SUCCESS="0";
public static final String INPUT_RZJG_FAILED="1";
public static final String INPUT_RZZT_NOT_BEGIN="0";
public static final String INPUT_RZZT_BEGINNING="1";
public static final String INPUT_RZZT_OVER="2";
public static final String OUTPUT_KPZT_NO="0";
public static final String OUTPUT_KPZT_YES="1";
public static class DataSourceName {
public static final String KeyValueDataSource = "KeyValueDataSource";
public static final String InputInvoiceDataSource = "IncomeDataSource";
......
package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.PagingResultDto;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.ImportInputInvoiceItemDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoice;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceBaseDto;
import pwc.taxtech.atms.service.impl.IdentityServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelSheet;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.vat.entity.InputInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceItem;
import pwc.taxtech.atms.vat.service.impl.InputInvoiceDataImportServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
......@@ -46,12 +37,14 @@ public class InputInvoiceImportController {
@RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
PagingResultDto<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras) {
return inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras);
PageInfo<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras,
@RequestHeader("from") String projectId) {
return inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras, projectId);
}
@RequestMapping(value = "exportQueryData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadInvoiceQueryData(@RequestBody InputInvoicePreviewQueryParam paras, HttpServletResponse response) {
public void downloadInvoiceQueryData(@RequestBody InputInvoicePreviewQueryParam paras, HttpServletResponse response,
@RequestHeader("from") String projectId) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + UUID.randomUUID() + ".xlsx");
response.setHeader("x-file-name", UUID.randomUUID() + ".xlsx");
......@@ -59,7 +52,7 @@ public class InputInvoiceImportController {
OutputStream os = null;
try {
os = response.getOutputStream();
int count = getDownloadFilePath(paras, os);
int count = getDownloadFilePath(paras, os, projectId);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
......@@ -82,8 +75,8 @@ public class InputInvoiceImportController {
return ResponseEntity.ok().body(inputInvoiceDataImportService.getInputInvoiceItemList(period));
}
private int getDownloadFilePath(InputInvoicePreviewQueryParam paras, OutputStream outputStream) {
List<InputInvoice> list = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras).getList();
private int getDownloadFilePath(InputInvoicePreviewQueryParam paras, OutputStream outputStream, String projectId) {
List<InputInvoice> list = inputInvoiceDataImportService.getInputInvoiceTreeViewData(paras, projectId).getList();
if (list.size() == 0) {
return 0;
}
......@@ -119,7 +112,7 @@ public class InputInvoiceImportController {
List<InputVatInvoiceItem> inputInvoiceItemList = new ArrayList<>();
for (InputInvoice item : list) {
inputInvoiceItemList.addAll(inputInvoiceDataImportService.getInputInvoiceItemTreeViewData(item.getId()));
inputInvoiceItemList.addAll(inputInvoiceDataImportService.getInputInvoiceItemTreeViewData(item.getID()));
}
excelSheetB.setDataset(inputInvoiceItemList);
List<ExcelSheet<InputVATInvoiceBaseDto>> sheets = new ArrayList<>();
......
package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.OutputInvoice;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.service.impl.IdentityServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.vat.dpo.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.ImportFile;
import pwc.taxtech.atms.vat.entity.OutputInvoice;
import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter;
import pwc.taxtech.atms.vat.service.impl.OutputInvoiceServiceImpl;
......@@ -49,8 +46,9 @@ public class OutputInvoiceController {
private FileUploadAdapter fileUploadAdapter;
@RequestMapping(value = "queryOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public PagingResultDto<OutputInvoice> queryOutputInvoiceList(@RequestBody QueryOutputDto queryDto) {
return outputInvoiceService.queryOutputInvoiceList(queryDto);
public PageInfo<OutputInvoice> queryOutputInvoiceList(@RequestBody QueryOutputDto queryDto,
@RequestHeader("from") String projectId) {
return outputInvoiceService.queryOutputInvoiceList(queryDto,projectId);
}
@RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -4,6 +4,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.InputVatInvoiceExample;
......@@ -14,27 +16,29 @@ public class InputInvoiceDao {
@Autowired
InputInvoiceMapper inputInvoiceMapper;
public List<InputVatInvoice> getInputInvoice(Integer period, Integer invoiceType, String checkPass, String scanPass, String notPass) {
InputVatInvoiceExample example = new InputVatInvoiceExample();
InputVatInvoiceExample.Criteria criteria = example.createCriteria();
InputVatInvoiceExample.Criteria criteria1 = example.createCriteria();
public List<InputInvoice> getInputInvoice(Integer period, String invoiceType, String checkPass, String scanPass, String notPass) {
InputInvoiceExample example = new InputInvoiceExample();
InputInvoiceExample.Criteria criteria = example.createCriteria();
InputInvoiceExample.Criteria criteria1 = example.createCriteria();
if (period != null) {
criteria.andPeriodIdEqualTo(period);
criteria1.andPeriodIdEqualTo(period);
criteria.andRZSQEqualTo(String.valueOf(period));
criteria1.andRZSQEqualTo(String.valueOf(period));
}
if (invoiceType != null) {
criteria.andInvoiceTypeEqualTo(invoiceType);
criteria1.andInvoiceTypeEqualTo(invoiceType);
criteria.andFPLXEqualTo(String.valueOf(invoiceType));
criteria1.andFPLXEqualTo(String.valueOf(invoiceType));
}
if (StringUtils.isNotBlank(notPass)) {
criteria.andCertificationResultEqualTo(notPass);
criteria1.andCertificationResultEqualTo(notPass);
String unPass = "1";
criteria.andRZJGEqualTo(unPass);
criteria1.andRZJGEqualTo(unPass);
} else if (StringUtils.isNotBlank(checkPass) && StringUtils.isNotBlank(scanPass)) {
criteria.andCertificationResultEqualTo(checkPass);
criteria.andCertificationResultEqualTo(scanPass);
String pass = "0";
criteria.andRZJGEqualTo(pass);
criteria1.andRZJGEqualTo(pass);
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);
// }
//}
package pwc.taxtech.atms.vat.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.constant.enums.EnumValidationType;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dto.FieldsMapper;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.InputInvoice;
import pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.vat.dao.InputVatInvoiceItemMapper;
import pwc.taxtech.atms.vat.dao.InputVatInvoiceMapper;
import pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceItem;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceItemExample;
import pwc.taxtech.atms.vat.entity.*;
import java.io.IOException;
import java.io.StringReader;
import java.util.*;
import static pwc.taxtech.atms.constant.Constant.INPUT_RZJG_SUCCESS;
import static pwc.taxtech.atms.constant.Constant.INPUT_RZZT_OVER;
@Service
public class InputInvoiceDataImportServiceImpl {
private static final String _tableName = "InputVATInvoice";
......@@ -43,28 +39,24 @@ public class InputInvoiceDataImportServiceImpl {
private SqlSessionTemplate dynamicSqlSessionTemplate;
@Autowired
private InputVatInvoiceItemMapper inputVATInvoiceItemMapper;
public PagingResultDto<InputInvoice> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras) {
return get(paras.getInvoiceCode(), paras.getPeriodStart(), paras.getPageInfo().getPageIndex(), paras.getPageInfo().getPageSize());
}
private PagingResultDto<InputInvoice> get(String code, int period, int page, int size) {
PagingResultDto<InputInvoice> pageInput = null;
try (CloseableHttpClient httpclient = HttpClients.createDefault();) {
HttpGet httpget = new HttpGet("http://localhost:8089/input_invoices?page=" + page + "&size=" + size
+ "&code=" + code + "&period=" + period);
try (CloseableHttpResponse response = httpclient.execute(httpget)) {
String inputStr = EntityUtils.toString(response.getEntity());
pageInput = JSONObject.parseObject(inputStr, new TypeReference<PagingResultDto<InputInvoice>>() {
}.getType());
}
} catch (IOException e) {
e.printStackTrace();
}
return pageInput;
@Autowired
private InputInvoiceMapper inputInvoiceMapper;
@Autowired
private ProjectMapper projectMapper;
public PageInfo<InputInvoice> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
InputInvoiceExample invoiceExample = new InputInvoiceExample();
invoiceExample.createCriteria().andCOMPANYIDEqualTo(project.getCode()).andRZSJBetween(DateUtils.getPeriodBegin(
project.getYear(), paras.getPeriodStart()), DateUtils.getPeriodEnd(project.getYear(), paras.getPeriodEnd()))
.andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER);
PageHelper.startPage(paras.getPageInfo().getPageIndex(), paras.getPageInfo().getPageSize());
List<InputInvoice> invoices = inputInvoiceMapper.selectByExample(invoiceExample);
PageInfo<InputInvoice> pageInfo = new PageInfo<>(invoices);
return pageInfo;
}
public List<InputVatInvoiceItem> getInputInvoiceItemTreeViewData(String id) {
InputVatInvoiceItemExample example = new InputVatInvoiceItemExample();
example.createCriteria().andInputVATInvoiceIdEqualTo(id);
......
......@@ -2,6 +2,9 @@ package pwc.taxtech.atms.vat.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import javafx.geometry.Orientation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
......@@ -15,12 +18,19 @@ import org.reflections.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.OutputInvoice;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.Message;
import pwc.taxtech.atms.vat.dao.ImportFileMapper;
import pwc.taxtech.atms.vat.dao.OutputVatInvoiceItemMapper;
import pwc.taxtech.atms.vat.dao.OutputVatInvoiceMapper;
......@@ -36,6 +46,8 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static pwc.taxtech.atms.constant.Constant.OUTPUT_KPZT_YES;
@Service
public class OutputInvoiceServiceImpl {
@Autowired
......@@ -48,25 +60,26 @@ public class OutputInvoiceServiceImpl {
private OutputVatInvoiceMapper outputVATInvoiceMapper;
@Autowired
private OutputVatInvoiceItemMapper outputVATInvoiceItemMapper;
@Autowired
private OutputInvoiceMapper outputInvoiceMapper;
@Autowired
private ProjectMapper projectMapper;
@Autowired
private OrganizationMapper organizationMapper;
public PagingResultDto<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto) {
return get("", queryDto.getPeriodStart(), queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
}
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
private PagingResultDto<OutputInvoice> get(String code, int period, int page, int size) {
PagingResultDto<OutputInvoice> pageInput = null;
try (CloseableHttpClient httpclient = HttpClients.createDefault();) {
HttpGet httpget = new HttpGet("http://localhost:8089/output_invoices?page=" + page + "&size=" + size
+ "&code=" + code + "&period=" + period);
try (CloseableHttpResponse response = httpclient.execute(httpget)) {
String inputStr = EntityUtils.toString(response.getEntity());
pageInput = JSONObject.parseObject(inputStr, new TypeReference<PagingResultDto<OutputInvoice>>() {
}.getType());
}
} catch (IOException e) {
e.printStackTrace();
}
return pageInput;
OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample();
outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()));
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(invoices);
return pageInfo;
}
public OperationResultDto<List<OutputVATInvoiceInfoDto>> getExportOutputInvoiceList(QueryOutputDto queryDto) {
......
......@@ -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.ValueEval;
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.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
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.util.ArrayList;
......@@ -50,12 +51,14 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
}
int certificationPeriod = getIntParam(args[0], ec);
int invoiceType = getIntParam(args[1], ec);
int authenticationType = getIntParam(args[2], 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 + ")";
logger.debug(formulaExpression);
......@@ -79,24 +82,24 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
calendar.add(Calendar.YEAR, 1);
Date endDate = calendar.getTime();
List<InputVatInvoice> inputVATInvoices;
List<InputInvoice> inputInvoices;
if (authenticationType == 1 && formulaContext.getIsYear()) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(null, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null);
} else if (authenticationType == 1) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType,
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType,
Constant.InputInvoiceCertificationResult.CheckPass, Constant.InputInvoiceCertificationResult.ScanPass,
null);
}
// 认证未通过与未认证暂认为是同一个意思
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);
}
// 认证未通过与未认证暂认为是同一个意思
else if (authenticationType == 0 || authenticationType == 2) {
inputVATInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null,
inputInvoices = SpringContextUtil.inputInvoiceDao.getInputInvoice(period, invoiceType, null,
null, Constant.InputInvoiceCertificationResult.NotPass);
} else {
saveFormulaBlock(period, ec, formulaExpression, new BigDecimal("0.0"), 0L, formulaContext.getProjectId());
......@@ -112,8 +115,8 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
calendar.set(formulaContext.getYear(), formulaContext.getPeriod(), 1);
endDate = calendar.getTime();
Date finalEndDate = endDate;
inputVATInvoices = inputVATInvoices.stream()
.filter(a -> a.getCertificationDate().before(finalEndDate))
inputInvoices = inputInvoices.stream()
.filter(a -> DateUtils.strToDate(a.getRZSJ()).before(finalEndDate))
.collect(Collectors.toList());
} else if (certificationPeriod != 99) {
calendar.set(formulaContext.getYear(), certificationPeriod, 1);
......@@ -123,27 +126,27 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
endDate = calendar.getTime();
Date finalEndDate1 = endDate;
Date finalStartDate = startDate;
inputVATInvoices = inputVATInvoices.stream()
.filter(a -> a.getCertificationDate().after(finalStartDate)
&& a.getCertificationDate().before(finalEndDate1))
inputInvoices = inputInvoices.stream()
.filter(a -> DateUtils.strToDate(a.getRZSJ()).after(finalStartDate)
&& DateUtils.strToDate(a.getRZSJ()).before(finalEndDate1))
.collect(Collectors.toList());
}
}
List<InputInvoiceDataSourceDto> dataSource = new ArrayList<>();
for (InputVatInvoice x : inputVATInvoices) {
for (InputInvoice x : inputInvoices) {
InputInvoiceDataSourceDto inputInvoiceDataSourceDto = new InputInvoiceDataSourceDto();
inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getAmount(), KeyValueConfigResultType.Accounting,
inputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(new BigDecimal(x.getHJJE()), KeyValueConfigResultType.Accounting,
null, formulaContext));
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));
inputInvoiceDataSourceDto.setCertificationDate(x.getCertificationDate());
inputInvoiceDataSourceDto.setInvoiceCode(x.getInvoiceCode());
inputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoiceNumber());
inputInvoiceDataSourceDto.setInvoiceType(x.getInvoiceType());
inputInvoiceDataSourceDto.setPeriod(x.getPeriodId());
inputInvoiceDataSourceDto.setSellerTaxNumber(x.getSellerTaxNumber());
inputInvoiceDataSourceDto.setCertificationDate(DateUtils.strToDate(x.getRZSJ()));
inputInvoiceDataSourceDto.setInvoiceCode(x.getFPDM());
inputInvoiceDataSourceDto.setInvoiceNumber(x.getFPHM());
inputInvoiceDataSourceDto.setInvoiceType(Integer.parseInt(x.getFPLX()));
inputInvoiceDataSourceDto.setPeriod(Integer.parseInt(x.getRZSQ()));
inputInvoiceDataSourceDto.setSellerTaxNumber(x.getXFSH());
inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource);
inputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource.add(inputInvoiceDataSourceDto);
......
......@@ -84,7 +84,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
}
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")) {
inputInvoice = inputInvoice.stream()
......
......@@ -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.ValueEval;
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.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
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.entity.OutputInvoice;
import pwc.taxtech.atms.vat.entity.OutputInvoiceDetailExample;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
......@@ -41,9 +43,10 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
}
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 period = getIntParam(args[3], ec);
String invoiceType = "004";
String formulaExpression = "XXFP(\"" + taxRate + "\"," + invoiceType + "," + amountType + "," + period + ")";
logger.debug(formulaExpression);
......@@ -70,42 +73,49 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
taxRateVal = taxRateVal.divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP); //保留两位小数,然后四舍五入
}
String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getVatInvoiceWithItems(dbName);
// String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
// List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputVatInvoiceMapper.getVatInvoiceWithItems(dbName);
List<OutputInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getOutputInvoiceWithDetail();
if (invoiceType != 99) {
if (invoiceTypeParam == 1) {
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());
}
if (taxRateVal.compareTo(new BigDecimal("99")) != 0) {
BigDecimal finalTaxRateVal = taxRateVal;
outputInvoice = outputInvoice.stream()
.filter(a -> a.getInvoiceItem().getTaxRate().compareTo(finalTaxRateVal) == 0)
.filter(a -> new BigDecimal(a.getInvoiceDeatil().getSLV()).compareTo(finalTaxRateVal) == 0)
.collect(Collectors.toList());
}
if (period != 99) {
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<>();
for (OutputVATInvoiceDto x : outputInvoice) {
for (OutputInvoiceDto x : outputInvoice) {
OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto();
outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(x.getInvoiceItem().getAmount(),
outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(new BigDecimal(x.getInvoiceDeatil().getJE()),
KeyValueConfigResultType.Accounting, null, formulaContext));
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));
outputInvoiceDataSourceDto.setTaxRate(x.getInvoiceItem().getTaxRate());
outputInvoiceDataSourceDto.setBuyerName(x.getInvoice().getBuyerName());
outputInvoiceDataSourceDto.setInvoiceCode(x.getInvoice().getClassCode());
outputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoice().getInvoiceNumber());
outputInvoiceDataSourceDto.setInvoiceDate(x.getInvoice().getInvoiceDate());
outputInvoiceDataSourceDto.setInvoiceType(x.getInvoice().getInvoiceType());
outputInvoiceDataSourceDto.setPeriod(x.getInvoice().getPeriodId());
outputInvoiceDataSourceDto.setTaxRate(new BigDecimal(x.getInvoiceDeatil().getSLV()));
outputInvoiceDataSourceDto.setBuyerName(x.getInvoice().getGFMC());
outputInvoiceDataSourceDto.setInvoiceCode(x.getInvoice().getFPDM());
outputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoice().getFPHM());
outputInvoiceDataSourceDto.setInvoiceDate(DateUtils.strToDate(x.getInvoice().getKPRQ()));
outputInvoiceDataSourceDto.setInvoiceType(invoiceTypeParam);
outputInvoiceDataSourceDto.setPeriod(getPeriodFromDate(x.getInvoice().getKPRQ()));
outputInvoiceDataSourceDto.setName(Constant.DataSourceName.OutputInvoiceDataSource);
outputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource.add(outputInvoiceDataSourceDto);
......@@ -128,4 +138,11 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
}
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;
import java.util.List;
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.dpo.CellInvoiceDto;
import pwc.taxtech.atms.vat.dpo.InputInvoicePreviewQueryParam;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceItemExtendDto;
import pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto;
import pwc.taxtech.atms.vat.entity.InputVatInvoice;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceExample;
import java.util.List;
//import pwc.taxtech.atms.vat.dpo.InputInvoiceItemExtendDto;
import pwc.taxtech.atms.vat.entity.InputInvoice;
import pwc.taxtech.atms.vat.entity.InputInvoiceExample;
@Mapper
public interface InputInvoiceMapper extends MyVatMapper {
/**
* 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
*/
long countByExample(InputVatInvoiceExample example);
long countByExample(InputInvoiceExample example);
/**
* 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
*/
int deleteByExample(InputVatInvoiceExample example);
int deleteByExample(InputInvoiceExample example);
/**
* 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
*/
int deleteByPrimaryKey(String id);
int deleteByPrimaryKey(String ID);
/**
* 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
*/
int insert(InputVatInvoice record);
int insert(InputInvoice record);
/**
* 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
*/
int insertSelective(InputVatInvoice record);
int insertSelective(InputInvoice record);
/**
* 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
*/
List<InputVatInvoice> selectByExampleWithRowbounds(InputVatInvoiceExample example, RowBounds rowBounds);
List<InputInvoice> selectByExampleWithRowbounds(InputInvoiceExample example, RowBounds rowBounds);
/**
* 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
*/
List<InputVatInvoice> selectByExample(InputVatInvoiceExample example);
List<InputInvoice> selectByExample(InputInvoiceExample example);
/**
* 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
*/
InputVatInvoice selectByPrimaryKey(String id);
InputInvoice selectByPrimaryKey(String ID);
/**
* 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
*/
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 corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
*
* @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 corresponds to the database table TAX_PROJECT. INPUT_VAT_INVOICE
* This method corresponds to the database table PWC_INVOICE.INPUT_INVOICE
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(InputVatInvoice record);
int updateByPrimaryKeySelective(InputInvoice record);
/**
* 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
*/
int updateByPrimaryKey(InputVatInvoice 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);
int updateByPrimaryKey(InputInvoice record);
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;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.OutputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputInvoiceDto;
import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.vat.dpo.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.OutputVatInvoice;
import pwc.taxtech.atms.vat.entity.OutputVatInvoiceExample;
import java.util.List;
import pwc.taxtech.atms.vat.entity.OutputInvoice;
import pwc.taxtech.atms.vat.entity.OutputInvoiceExample;
import pwc.taxtech.atms.vat.entity.OutputInvoiceKey;
@Mapper
public interface OutputInvoiceMapper extends MyVatMapper {
/**
* 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
*/
long countByExample(OutputVatInvoiceExample example);
long countByExample(OutputInvoiceExample example);
/**
* 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
*/
int deleteByExample(OutputVatInvoiceExample example);
int deleteByExample(OutputInvoiceExample example);
/**
* 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
*/
int deleteByPrimaryKey(String invoiceId);
int deleteByPrimaryKey(OutputInvoiceKey key);
/**
* 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
*/
int insert(OutputVatInvoice record);
int insert(OutputInvoice record);
/**
* 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
*/
int insertSelective(OutputVatInvoice record);
int insertSelective(OutputInvoice record);
/**
* 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
*/
List<OutputVatInvoice> selectByExampleWithRowbounds(OutputVatInvoiceExample example, RowBounds rowBounds);
List<OutputInvoice> selectByExampleWithRowbounds(OutputInvoiceExample example, RowBounds rowBounds);
/**
* 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
*/
List<OutputVatInvoice> selectByExample(OutputVatInvoiceExample example);
List<OutputInvoice> selectByExample(OutputInvoiceExample example);
/**
* 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
*/
OutputVatInvoice selectByPrimaryKey(String invoiceId);
OutputInvoice selectByPrimaryKey(OutputInvoiceKey key);
/**
* 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
*/
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 corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
*
* @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 corresponds to the database table TAX_PROJECT. OUTPUT_VAT_INVOICE
* This method corresponds to the database table PWC_INVOICE.OUTPUT_INVOICE
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OutputVatInvoice record);
int updateByPrimaryKeySelective(OutputInvoice record);
/**
* 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
*/
int updateByPrimaryKey(OutputVatInvoice record);
List<OutputVATInvoiceInfoDto> selectOutputVATInvoiceInfoLeftJoinItem(@Param("queryDto") QueryOutputDto queryDto);
int updateByPrimaryKey(OutputInvoice record);
@Select("SELECT " +
" o.PERIOD_ID as periodId, " +
......@@ -185,7 +181,6 @@ public interface OutputInvoiceMapper extends MyVatMapper {
" ")
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
......@@ -3,7 +3,7 @@
<mapper namespace="pwc.taxtech.atms.dao.EnterpriseAccountSetOrgMapper">
<resultMap extends="BaseResultMap" id="ResultMapWithAssociation"
type="pwc.taxtech.atms.entity.EnterpriseAccountSetOrg">
<association column="OrganizationID" property="organization"
<association column="ORGANIZATION_ID" property="organization"
select="pwc.taxtech.atms.dao.OrganizationMapper.selectByPrimaryKey"/>
</resultMap>
<select id="selectByExampleWithAssociation" parameterType="pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample"
......
......@@ -10,7 +10,7 @@
FROM
PERIOD_TAX_RULE_SETTING TRS
LEFT JOIN
PERIOD_TAX_RULE_SETTING_ORGANIZATION TRSO
PERIOD_TAX_RULE_SETTING_ORG TRSO
ON
TRS.TAX_RULE_SETTING_ID = TRSO.TAX_SETTING_ID
WHERE
......
......@@ -94,9 +94,9 @@
<input type="hidden" id="enterpriseAccountSetID" value="{{editModel.enterpriseAccountSetID}}" />
<div class="form-group">
<label for="code" class="col-sm-3 control-label">{{'EnterpriceAccountSetName' | translate}}:</label>
<label for="code" class="col-sm-3 control-label">{{'EnterpriseAccountSetName' | translate}}:</label>
<div class="col-sm-6">
<input class="form-control" id="enterpriceAccountSetName" readonly name="enterpriceAccountSetName" ng-model="editModel.enterpriceAccountSetName" maxlength="50" placeholder="" required>
<input class="form-control" id="enterpriseAccountSetName" readonly name="enterpriseAccountSetName" ng-model="editModel.enterpriceAccountSetName" maxlength="50" placeholder="" required>
</div>
</div>
......
......@@ -358,8 +358,7 @@
<form class="form-horizontal" id="updateEnterpriceAccountSetRelevantOrgForm">
<input type="hidden" value="{{editModel.id}}"/>
<div class="form-group">
<label for="code" class="col-sm-2 control-label">{{'EnterpriceAccountSetName' |
translate}}:</label>
<label for="code" class="col-sm-2 control-label">{{'EnterpriseAccountSetName' | translate}}:</label>
<div class="col-sm-4">
<label class="control-label" style="width: none;">{{editModel.name}}</label>
</div>
......
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