Commit f74c5e27 authored by sherlock's avatar sherlock

count total, templateName

parent 09412b34
...@@ -37,6 +37,13 @@ public class InputInvoiceImportController { ...@@ -37,6 +37,13 @@ public class InputInvoiceImportController {
private IdentityServiceImpl identityService; private IdentityServiceImpl identityService;
private Logger logger = LoggerFactory.getLogger(InputInvoiceImportController.class); private Logger logger = LoggerFactory.getLogger(InputInvoiceImportController.class);
@RequestMapping(value = "inputInvoicePreviewAllList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody
List<InputInvoice> getInputInvoiceTree(@RequestBody InputInvoicePreviewQueryParam paras,
@RequestHeader("from") String projectId) {
return inputInvoiceDataImportService.getInputInvoiceTree(paras, projectId);
}
@RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "inputInvoicePreviewList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
PageInfo<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras, PageInfo<InputInvoice> getInputInvoiceTreeViewData(@RequestBody InputInvoicePreviewQueryParam paras,
......
...@@ -52,6 +52,12 @@ public class OutputInvoiceController { ...@@ -52,6 +52,12 @@ public class OutputInvoiceController {
return outputInvoiceService.queryOutputInvoiceList(queryDto,projectId); return outputInvoiceService.queryOutputInvoiceList(queryDto,projectId);
} }
@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);
}
@RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) { public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
......
...@@ -73,7 +73,7 @@ public class OutputInvoiceServiceImpl { ...@@ -73,7 +73,7 @@ public class OutputInvoiceServiceImpl {
@Autowired @Autowired
private OutputInvoiceDetailMapper outputInvoiceDetailMapper; private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) { public List<OutputInvoice> queryOutputInvoiceAllList(QueryOutputDto queryDto, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId); Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId()); Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
...@@ -89,9 +89,6 @@ public class OutputInvoiceServiceImpl { ...@@ -89,9 +89,6 @@ public class OutputInvoiceServiceImpl {
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd())) DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1"); .andFPZTNotEqualTo("1");
} }
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample); List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00"); DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> { invoices.stream().forEach(x -> {
...@@ -99,7 +96,11 @@ public class OutputInvoiceServiceImpl { ...@@ -99,7 +96,11 @@ public class OutputInvoiceServiceImpl {
x.setHJSE(df.format(new BigDecimal(x.getHJSE()))); x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
} }
); );
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(invoices); return invoices;
}
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(queryOutputInvoiceAllList(queryDto, projectId));
return pageInfo; return pageInfo;
} }
......
...@@ -654,6 +654,8 @@ public class ReportServiceImpl { ...@@ -654,6 +654,8 @@ public class ReportServiceImpl {
dataSourceDto.setDataSourceType(CellDataSourceType.InputInvoice.getCode()); dataSourceDto.setDataSourceType(CellDataSourceType.InputInvoice.getCode());
} else if (a.getType().equals(FormulaDataSourceType.Voucher.getCode())) { } else if (a.getType().equals(FormulaDataSourceType.Voucher.getCode())) {
dataSourceDto.setDataSourceType(CellDataSourceType.Voucher.getCode()); dataSourceDto.setDataSourceType(CellDataSourceType.Voucher.getCode());
} else if(a.getType().equals(FormulaDataSourceType.OutputInvoice.getCode())){
dataSourceDto.setDataSourceType(CellDataSourceType.OutputInvoice.getCode());
} else { } else {
dataSourceDto.setDataSourceType(0); dataSourceDto.setDataSourceType(0);
} }
...@@ -692,6 +694,13 @@ public class ReportServiceImpl { ...@@ -692,6 +694,13 @@ public class ReportServiceImpl {
if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) { if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) {
z.getItem2().getItems().forEach(m -> { z.getItem2().getItems().forEach(m -> {
ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class); ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class);
PeriodTemplateExample periodTemplateExample1 = new PeriodTemplateExample();
periodTemplateExample1.createCriteria().andTemplateIdEqualTo(a.getReportTemplateId())
.andPeriodEqualTo(report.getPeriod());
Optional<PeriodTemplate> optional = periodTemplateMapper.selectByExample(periodTemplateExample1).stream().findFirst();
if(optional.isPresent()){
dto.setReportName(optional.get().getName());
}
dataSourceDtoList.add(dto); dataSourceDtoList.add(dto);
}); });
} else } else
......
commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams', commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams',
'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService', 'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService', 'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService',
function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService, function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService,
...@@ -972,7 +972,7 @@ ...@@ -972,7 +972,7 @@
delete x.cellValue; delete x.cellValue;
}); });
reportData.data.cellData.reportName = node.name; // reportData.data.cellData.reportName = node.name;
reportData.data.cellData.orderIndex = node.orderIndex; reportData.data.cellData.orderIndex = node.orderIndex;
reportData.data.cellData.templateId = node.id; reportData.data.cellData.templateId = node.id;
exportReportData.push(reportData.data.cellData); exportReportData.push(reportData.data.cellData);
......
...@@ -5,6 +5,25 @@ ...@@ -5,6 +5,25 @@
return $http.get('url', apiConfig.createVat()); return $http.get('url', apiConfig.createVat());
}, },
queryOutputInvoiceAllList: function (param) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceAllList', {
// PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
InvoiceType: param.invoiceType,
StartInvoiceDate: param.invoiceDateStart,
EndInvoiceDate: param.invoiceDateEnd,
ClassCode: param.classCode,
InvoiceNumber: param.invoiceNumber,
BuyerName: param.buyerName,
ProductName: param.productName,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
}, apiConfig.createVat());
},
queryOutputInvoiceList: function (param) { queryOutputInvoiceList: function (param) {
return $http.post('/outputInvoiceImport/queryOutputInvoiceList', { return $http.post('/outputInvoiceImport/queryOutputInvoiceList', {
PageInfo: param.pageInfo, PageInfo: param.pageInfo,
...@@ -67,6 +86,25 @@ ...@@ -67,6 +86,25 @@
}, apiConfig.createVat()); }, apiConfig.createVat());
}, },
queryInputInvoiceAllList: function (param) {
return $http.post('/inputInvoiceImport/inputInvoicePreviewAllList', {
// PageInfo: param.pageInfo,
PeriodStart: param.periodStart,
PeriodEnd: param.periodEnd,
CertificationDateStart: param.certificationDateStart,
CertificationDateEnd: param.certificationDateEnd,
InvoiceCode: param.invoiceCode,
InvoiceNumber: param.invoiceNumber,
SellerTaxNumber: param.sellerTaxNumber,
AmountStart: param.amountStart,
AmountEnd: param.amountEnd,
InvoiceType: param.invoiceType,
TaxAmountStart: param.taxAmountStart,
TaxAmountEnd: param.taxAmountEnd,
CertificationStatus: param.certificationStatus
}, apiConfig.createVat());
},
queryInputInvoiceItemList: function (inputInvoiceID) { queryInputInvoiceItemList: function (inputInvoiceID) {
return $http.get('/inputInvoiceImport/inputInvoiceItemPreviewList/' + inputInvoiceID, apiConfig.createVat()); return $http.get('/inputInvoiceImport/inputInvoiceItemPreviewList/' + inputInvoiceID, apiConfig.createVat());
}, },
......
...@@ -89,11 +89,11 @@ ...@@ -89,11 +89,11 @@
pageSize: -1, pageSize: -1,
totalPage: 0, totalPage: 0,
}; };
vatPreviewService.queryInputInvoiceList($scope.queryParams).success(function (data) { vatPreviewService.queryInputInvoiceAllList($scope.queryParams).success(function (data) {
if (data) { if (data) {
var totalMoneyAmount = 0; var totalMoneyAmount = 0;
var totalTaxAmount = 0; var totalTaxAmount = 0;
_.each(data.list, function (x) { _.each(data, function (x) {
totalMoneyAmount = totalMoneyAmount + parseFloat(x.hjje.replace(/,/g, "")); totalMoneyAmount = totalMoneyAmount + parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount = totalTaxAmount + parseFloat(x.hjse.replace(/,/g, "")); totalTaxAmount = totalTaxAmount + parseFloat(x.hjse.replace(/,/g, ""));
}) })
...@@ -124,13 +124,12 @@ ...@@ -124,13 +124,12 @@
var index = 1; var index = 1;
data.list.forEach(function (v) { data.list.forEach(function (v) {
v.index = index++; v.index = index++;
v.amount = PWC.round(v.amount, 2); v.amount = PWC.round(parseFloat(v.hjje.replace(/,/g, "")), 2);
v.taxAmount = PWC.round(v.taxAmount, 2); v.taxAmount = PWC.round(parseFloat(v.hjse.replace(/,/g, "")), 2);
}); });
$scope.gridOptions.data = data.list; $scope.gridOptions.data = data.list;
$scope.queryIncomeInvoiceItemResult.pageInfo = data; $scope.queryIncomeInvoiceItemResult.pageInfo = data;
computeIncomeInvoiceItemPage(); computeIncomeInvoiceItemPage();
countTotal();
} }
}); });
}; };
......
...@@ -68,6 +68,23 @@ ...@@ -68,6 +68,23 @@
$scope.queryParams.periodEnd = vatSessionService.month; $scope.queryParams.periodEnd = vatSessionService.month;
}; };
var countTotal = function(){
var totalMoneyAmount = 0;
var totalTaxAmount = 0;
vatPreviewService.queryOutputInvoiceAllList($scope.queryParams).success(function (data) {
if (data) {
_.each(data, function (x) {
totalMoneyAmount += parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount += parseFloat(x.hjse.replace(/,/g, ""));
})
}
$scope.totalMoneyAmount = totalMoneyAmount.toLocaleString();
$scope.totalTaxAmount = totalTaxAmount.toLocaleString();
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
}
//从数据库中load数据 //从数据库中load数据
var loadOutputInvoiceDataFromDB = function (pageIndex) { var loadOutputInvoiceDataFromDB = function (pageIndex) {
initOutputInvoicePagination(); initOutputInvoicePagination();
...@@ -81,24 +98,15 @@ ...@@ -81,24 +98,15 @@
totalPage: 0, totalPage: 0,
} }
var countTotal = function(){
var totalMoneyAmount = 0;
var totalTaxAmount = 0;
_.each($scope.gridOptions.data, function (x) {
totalMoneyAmount = totalMoneyAmount + parseFloat(x.hjje.replace(/,/g, ""));
totalTaxAmount = totalTaxAmount + parseFloat(x.hjse.replace(/,/g, ""));
})
$scope.totalMoneyAmount = totalMoneyAmount.toLocaleString();
$scope.totalTaxAmount = totalTaxAmount.toLocaleString();
}
vatPreviewService.queryOutputInvoiceList($scope.queryParams).success(function (data) { vatPreviewService.queryOutputInvoiceList($scope.queryParams).success(function (data) {
if (data) { if (data) {
var index = 1; var index = 1;
data.list.forEach(function (v) { data.list.forEach(function (v) {
v.index = index++; v.index = index++;
v.amount = PWC.round(v.amount, 2); v.amount = PWC.round(parseFloat(v.hjje.replace(/,/g, "")), 2);
v.taxAmount = PWC.round(v.taxAmount, 2); v.taxAmount = PWC.round(parseFloat(v.hjse.replace(/,/g, "")), 2);
}); });
$scope.gridOptions.data = data.list; $scope.gridOptions.data = data.list;
$scope.queryOutputInvoiceResult.pageInfo = data; $scope.queryOutputInvoiceResult.pageInfo = data;
...@@ -381,7 +389,7 @@ ...@@ -381,7 +389,7 @@
var criteria = JSON.stringify($scope.queryParams); var criteria = JSON.stringify($scope.queryParams);
if (browserService.isIE() || browserService.isEdge()) if (browserService.isIE() || browserService.isEdge())
criteria = encodeURIComponent(criteria); criteria = encodeURIComponent(criteria);
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}; };
...@@ -407,6 +415,7 @@ ...@@ -407,6 +415,7 @@
$scope.criteriaList = []; $scope.criteriaList = [];
$scope.queryParams.periodStart = startMonth; $scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth; $scope.queryParams.periodEnd = endMonth;
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}; };
...@@ -598,7 +607,7 @@ ...@@ -598,7 +607,7 @@
endMonth = result[1][0]; endMonth = result[1][0];
$scope.queryParams.periodStart = startMonth; $scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth; $scope.queryParams.periodEnd = endMonth;
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(1);
}); });
...@@ -651,6 +660,7 @@ ...@@ -651,6 +660,7 @@
$scope.showPopover = showPopover; $scope.showPopover = showPopover;
initPeriods(); initPeriods();
initOutputInvoicePagination(); initOutputInvoicePagination();
countTotal();
loadOutputInvoiceDataFromDB(1); loadOutputInvoiceDataFromDB(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