Commit 163acc9d authored by neo's avatar neo

Merge branch 'dev_oracle' of code.tech.tax.asia.pwcinternal.com:root/atms into neo_jpa_withoutgen

parents 767045f8 655f5bc0
...@@ -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
......
...@@ -14,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; ...@@ -14,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto; import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.AccountMapping; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.AccountMappingExample;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrg;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.GlBalance; import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample; import pwc.taxtech.atms.vat.entity.GlBalanceExample;
...@@ -70,7 +67,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -70,7 +67,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
double result = 0; double result = 0;
for(AccountMapping a : accountMappings){ for(AccountMapping a : accountMappings){
result += count(a.getEnterpriseAccountCode(), dataSource, period, year); result += count(a.getEnterpriseAccountCode(), dataSource, period, year, orgId);
} }
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto, FormulaDataSourceDetailType.FormulaDataSourceDto,
...@@ -80,7 +77,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -80,7 +77,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return new NumberEval(result); return new NumberEval(result);
} else if(type == 1){ } else if(type == 1){
double result = count(code, dataSource, period, year); double result = count(code, dataSource, period, year, orgId);
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto, FormulaDataSourceDetailType.FormulaDataSourceDto,
new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId()); new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
...@@ -95,10 +92,17 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -95,10 +92,17 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return year + "-" + (period > 9 ? period : ("0" + period)); return year + "-" + (period > 9 ? period : ("0" + period));
} }
private double count(String code, List<ReportCellDataSourceDto> contain, int period, int year){ private double count(String code, List<ReportCellDataSourceDto> contain, int period, int year, String orgId){
Organization organization = SpringContextUtil.organizationMapper.selectByPrimaryKey(orgId);
GlBalanceExample glBalanceExample = new GlBalanceExample(); GlBalanceExample glBalanceExample = new GlBalanceExample();
GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code).andPeriodNameEqualTo(periodName(period, year)); GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code)
GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code).andPeriodNameEqualTo(periodName(period, year)); .andPeriodNameEqualTo(periodName(period, year));
GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code)
.andPeriodNameEqualTo(periodName(period, year));
if(organization != null){
c1.andSegment1EqualTo(organization.getClientCode());
c2.andSegment1EqualTo(organization.getClientCode());
}
glBalanceExample.or(c2); glBalanceExample.or(c2);
List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample); List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample);
if(CollectionUtils.isEmpty(list)){ if(CollectionUtils.isEmpty(list)){
......
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