Commit 4ef2e0b7 authored by sherlock's avatar sherlock

Merge branch 'dev_oracle_sherlock' into 'dev_oracle'

xxfp

See merge request root/atms!218
parents cc888f21 6a3bbbed
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import jdk.internal.util.xml.impl.Input;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -9,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.service.impl.IdentityServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelSheet;
......@@ -18,6 +20,7 @@ import pwc.taxtech.atms.vat.entity.InputInvoice;
import pwc.taxtech.atms.vat.entity.InputInvoiceDetail;
import pwc.taxtech.atms.vat.entity.InputVatInvoiceItem;
import pwc.taxtech.atms.vat.service.impl.InputInvoiceDataImportServiceImpl;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -41,7 +44,18 @@ public class InputInvoiceImportController {
public @ResponseBody
List<InputInvoice> getInputInvoiceTree(@RequestBody InputInvoicePreviewQueryParam paras,
@RequestHeader("from") String projectId) {
return inputInvoiceDataImportService.getInputInvoiceTree(paras, projectId);
double hjje = 0;
double hjse = 0;
for(InputInvoice inputInvoice : inputInvoiceDataImportService.getInputInvoice(paras, projectId)){
hjje += FormulaHelper.roundValue(new BigDecimal(inputInvoice.getHJJE()), KeyValueConfigResultType.Accounting, true, null).doubleValue();
hjse += FormulaHelper.roundValue(new BigDecimal(inputInvoice.getHJSE()), KeyValueConfigResultType.Accounting, true, null).doubleValue();
}
InputInvoice i = new InputInvoice();
i.setHJJE(hjje + "");
i.setHJSE(hjse + "");
List<InputInvoice> list = Lists.newArrayList();
list.add(i);
return list;
}
@RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.common.util.BeanUtil;
import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
......@@ -21,6 +22,7 @@ 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;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -55,7 +57,19 @@ public class OutputInvoiceController {
@RequestMapping(value = "queryOutputInvoiceAllList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<OutputInvoice> queryOutputInvoiceAllList(@RequestBody QueryOutputDto queryDto,
@RequestHeader("from") String projectId) {
return outputInvoiceService.queryOutputInvoiceAllList(queryDto,projectId);
List<OutputInvoice> list = outputInvoiceService.getOutputInvoice(queryDto, projectId);
double hjje = 0;
double hjse = 0;
for(OutputInvoice outputInvoice : list){
hjje += FormulaHelper.roundValue(new BigDecimal(outputInvoice.getHJJE()), KeyValueConfigResultType.Accounting, true, null).doubleValue();
hjse += FormulaHelper.roundValue(new BigDecimal(outputInvoice.getHJSE()), KeyValueConfigResultType.Accounting, true, null).doubleValue();
}
list = Lists.newArrayList();
OutputInvoice o = new OutputInvoice();
o.setHJJE(hjje + "");
o.setHJSE(hjse + "");
list.add(o);
return list;
}
@RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -55,7 +55,7 @@ public class InputInvoiceDataImportServiceImpl {
@Autowired
private OrganizationMapper organizationMapper;
public List<InputInvoice> getInputInvoiceTree(InputInvoicePreviewQueryParam paras, String projectId){
public List<InputInvoice> getInputInvoice(InputInvoicePreviewQueryParam paras, String projectId){
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
InputInvoiceExample invoiceExample = new InputInvoiceExample();
......@@ -63,7 +63,11 @@ public class InputInvoiceDataImportServiceImpl {
project.getYear(), paras.getPeriodStart(), Constant.DateFormat.YYYYMM), DateUtils.getPeriodEndFormat(project.getYear(),
paras.getPeriodEnd(), Constant.DateFormat.YYYYMM)).andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER)
.andFPZTNotEqualTo("1");
List<InputInvoice> invoices = inputInvoiceMapper.selectByExample(invoiceExample);
return inputInvoiceMapper.selectByExample(invoiceExample);
}
public List<InputInvoice> getInputInvoiceTree(InputInvoicePreviewQueryParam paras, String projectId){
List<InputInvoice> invoices = getInputInvoice(paras, projectId);
DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> {
x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
......
......@@ -73,7 +73,7 @@ public class OutputInvoiceServiceImpl {
@Autowired
private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public List<OutputInvoice> queryOutputInvoiceAllList(QueryOutputDto queryDto, String projectId) {
public List<OutputInvoice> getOutputInvoice(QueryOutputDto queryDto, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
......@@ -89,7 +89,11 @@ public class OutputInvoiceServiceImpl {
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1");
}
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
return outputInvoiceMapper.selectByExample(outputInvoiceExample);
}
public List<OutputInvoice> queryOutputInvoiceAllList(QueryOutputDto queryDto, String projectId) {
List<OutputInvoice> invoices = getOutputInvoice(queryDto, projectId);
DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> {
x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
......@@ -12,10 +14,8 @@ 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.invoice.OutputInvoiceMapper;
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.*;
......@@ -75,7 +75,9 @@ public class XXFP extends FunctionBase implements FreeRefFunction {
// String dbName = SpringContextUtil.projectDao.getDbNameWithYearAndOrgId(formulaContext.getOrganizationId(), curYear);
// List<OutputVATInvoiceDto> outputInvoice = SpringContextUtil.outputVatInvoiceMapper.getVatInvoiceWithItems(dbName);
List<OutputInvoiceDto> outputInvoice = SpringContextUtil.outputInvoiceMapper.getOutputInvoiceWithDetail();
PageHelper.clearPage();
// logger.warn(PageHelper.getLocalPage().toString());
List<OutputInvoiceDto> outputInvoice = SpringContextUtil.getBean(OutputInvoiceMapper.class).getOutputInvoiceWithDetail();
if (invoiceTypeParam == 1) {
outputInvoice = outputInvoice.stream()
......
......@@ -196,7 +196,7 @@
<select id="getOutputInvoiceWithDetail" resultMap="outputInvoiceDto">
SELECT
INVOICE.ID AS INVOICE_ID,
-- INVOICE.ID AS INVOICE_ID,
INVOICE.ID AS INVOICEID,
INVOICE.FPQQLSH,
INVOICE.FPDM,
......@@ -284,7 +284,8 @@
JOIN
OUTPUT_INVOICE_DETAIL INVOICEDETAIL
ON
INVOICE.FPQQLSH = INVOICEDETAIL.FPQQLSH and INVOICE.FPZT != '1'
INVOICE.FPQQLSH = INVOICEDETAIL.FPQQLSH
where INVOICE.FPZT != '1' and 1=1
ORDER BY
INVOICE.FPHM
</select>
......
......@@ -424,7 +424,7 @@
var criteria = JSON.stringify($scope.queryParams);
if (browserService.isIE() || browserService.isEdge())
criteria = encodeURIComponent(criteria);
countTotal();
loadIncomeInvoiceItemDataFromDB(1);
if ($scope.criteriaList.length > 6) {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, 6);
......@@ -457,6 +457,7 @@
$scope.criteriaList = [];
$scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth;
countTotal();
loadIncomeInvoiceItemDataFromDB(1);
$('.filter-button').popover("hide");
};
......@@ -568,7 +569,7 @@
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
countTotal();
loadIncomeInvoiceItemDataFromDB(1);
});
......
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