Commit 363a4c85 authored by eddie.woo's avatar eddie.woo

Merge remote-tracking branch 'origin/dev_mysql' into uat_didi

# Conflicts:
#	atms-api/src/main/resources/conf/conf_profile_pub.properties
parents 18d788c7 0ea0ffce
......@@ -37,6 +37,8 @@ public class SystemConfig {
private String tableauAustralianTax;
@Value("${tableau_brazilian_tax}")
private String tableauBrazilianTax;
@Value("${tableau_dashboard}")
private String tableauDashboard;
public String getLongiApiBasicUser() {
return this.longiApiBasicUser;
......@@ -157,4 +159,12 @@ public class SystemConfig {
public void setTableauBrazilianTax(String tableauBrazilianTax) {
this.tableauBrazilianTax = tableauBrazilianTax;
}
public String getTableauDashboard() {
return this.tableauDashboard;
}
public void setTableauDashboard(String tableauDashboard) {
this.tableauDashboard = tableauDashboard;
}
}
......@@ -83,4 +83,10 @@ public class TableauController extends BaseController {
return ApiResultDto.success(tableauService.getBrazilianTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("dashboard")
public ApiResultDto getDashboard() {
return ApiResultDto.success(tableauService.getBrazilianTax().orElse(StringUtils.EMPTY));
}
}
......@@ -113,4 +113,10 @@ public class TableauService extends BaseService {
return optional.map(s -> String.format(systemConfig.getTableauBrazilianTax(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getDashboard() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauDashboard(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
}
......@@ -311,16 +311,9 @@ public class TaxDocumentServiceImpl {
public boolean editFilesType(TaxDocument taxDocument) {
try {
TaxDocumentExample taxDocumentExample = new TaxDocumentExample();
taxDocumentExample.createCriteria().andFileNameEqualTo(taxDocument.getFileName());
List<TaxDocument> list = taxDocumentMapper.selectByExample(taxDocumentExample);
if (list.size() > 0) {
return false;
}
//更新上传时间和文件名称
taxDocument.setUpdateTime(new Date());
taxDocument.setUploadTime(new Date());
int num = taxDocumentMapper.updateByPrimaryKey(taxDocument);
if (num > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
......
......@@ -231,8 +231,7 @@ public class ReportServiceImpl extends BaseService {
return operationResult;
}
private void clearPeriodData(String projectId, Integer period, List<Long> templateIds, boolean isMergeManualData) {
if (templateIds.isEmpty()) templateIds.add(Long.MAX_VALUE);
private void clearPeriodData(String projectId, Integer period, boolean isMergeManualData) {
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodFormulaBlockMapper.deleteByExample(periodFormulaBlockExample);
......@@ -242,15 +241,15 @@ public class ReportServiceImpl extends BaseService {
periodTaxRuleSettingMapper.deleteByExample(periodTaxRuleSettingExample);
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andReportTemplateIdNotIn(templateIds);
periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodCellTemplateMapper.deleteByExample(periodCellTemplateExample);
PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample();
periodCellTemplateConfigExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andReportTemplateIdNotIn(templateIds);
periodCellTemplateConfigExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodCellTemplateConfigMapper.deleteByExample(periodCellTemplateConfigExample);
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andTemplateIdNotIn(templateIds);
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodTemplateMapper.deleteByExample(periodTemplateExample);
PeriodTaxPayerReportRuleExample periodTaxPayerReportRuleExample = new PeriodTaxPayerReportRuleExample();
......@@ -304,12 +303,13 @@ public class ReportServiceImpl extends BaseService {
}
private void updateConfig(String projectId, Integer period, Boolean isMergeManualData, List<Template> templates, PeriodJob job) {
List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
//财务报表不删除,这个逻辑用不到,先注释掉
// List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
//根据收入类型映射生成开票记录关联数据
assembleInvoiceRecord(projectId, period, isMergeManualData);
//生成trial_balance_final数据
assembleTrialBalanceFinal(projectId, period);
clearPeriodData(projectId, period, exceptTemplateIds, isMergeManualData);
clearPeriodData(projectId, period, isMergeManualData);
copyTemplateAndConfigFromAdmin(projectId, templates, period);
setStatus(job, STATUS_END);
periodJobMapper.updateByPrimaryKey(job);
......
......@@ -186,13 +186,13 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
for (TrialBalanceFinal balance : temp) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.setAmount(balance.getPeriodCr());
dto.setAmount(balance.getPeriodCrBeq());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.Report.getCode());
contain.add(dto);
}
return temp.stream().mapToDouble(a -> a.getPeriodCr().doubleValue()).sum();
return temp.stream().mapToDouble(a -> a.getPeriodCrBeq().doubleValue()).sum();
}
}
......@@ -183,13 +183,13 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
for (TrialBalanceFinal balance : temp) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.setAmount(balance.getPeriodDr());
dto.setAmount(balance.getPeriodDrBeq());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.Report.getCode());
contain.add(dto);
}
return temp.stream().mapToDouble(a -> a.getPeriodDr().doubleValue()).sum();
return temp.stream().mapToDouble(a -> a.getPeriodDrBeq().doubleValue()).sum();
}
}
......@@ -80,4 +80,5 @@ tableau_doc_situation=${tableau_doc_situation}
tableau_global_overview=${tableau_global_overview}
tableau_mexican_tax=${tableau_mexican_tax}
tableau_australian_tax=${tableau_australian_tax}
tableau_brazilian_tax=${tableau_brazilian_tax}
\ No newline at end of file
tableau_brazilian_tax=${tableau_brazilian_tax}
tableau_dashboard=${tableau_dashboard}
\ No newline at end of file
......@@ -70,3 +70,4 @@ tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_2019
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -74,4 +74,6 @@ tableau_global_overview=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/
tableau_mexican_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -69,3 +69,5 @@ tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_2019
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -74,4 +74,5 @@ tableau_global_overview=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/
tableau_mexican_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -1905,5 +1905,22 @@ var analysisModule = angular.module('app.analysis', ['ui.grid', 'ui.router','ui.
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'analysisDashboard',
url: "/analysis/analysisDashboard",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<analysis-dashboard></analysis-dashboard>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
}]);
\ No newline at end of file
......@@ -63,7 +63,7 @@
<!--@Html.AntiForgeryToken()-->
<div class="wrapper">
<app-nav></app-nav>
<div class="page-wrapper" style="position:relative;overflow-x:hidden;overflow-y:auto;margin-top:55px">
<div class="page-wrapper" style="position:relative;overflow-x:hidden;margin-top:55px">
<div class="main-contents" ui-view></div>
<div class="data-import-contents" ui-view="importContent"></div><!--style="display: none"-->
</div>
......
......@@ -907,6 +907,7 @@
"MenuAustralianTax": "澳洲税务分析",
"MenuBrazilianTax": "巴西税务分析",
"MenuOtherCountries": "其他国家税务分析",
"MenuDashboard": "Dashboard",
"ApproveCommitted":"审核中",
"ApproveAgreed":"通过",
......
analysisModule.controller('AnalysisDashboardController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/dashboard', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('analysisDashboard', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/dashboard/dashboard.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'AnalysisDashboardController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
......@@ -341,7 +341,7 @@ taxDocumentManageModule.controller('taxDocumentListController',
var row_height = $("table").find("tr").height();
if (row_height) {
return {
height: (row_height * 12) + "px"
height:(row_height*12+18)+"px"
}
}
};
......@@ -1313,8 +1313,8 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
taxDocumentManageModule.directive('filePreview', function () {
return {
restrict: 'EA',
controller: ['$scope', '$translate', 'SweetAlert', '$compile', 'taxDocumentListService', '$q',
function ($scope, $translate, SweetAlert, $compile, taxDocumentListService, $q) {
controller: ['$log','$scope', '$translate', 'SweetAlert', '$compile', 'taxDocumentListService', '$q',
function ($log,$scope, $translate, SweetAlert, $compile, taxDocumentListService, $q) {
$scope.previewData = [];
/**上传时预览的功能取消 2019/3/8*/
......@@ -1576,13 +1576,13 @@ taxDocumentManageModule.directive('pdfPreview', function () {
restrict: 'EA',
controller: ['$scope','taxDocumentListService', function ($scope,taxDocumentListService) {
window.PDFJS.workerSrc = './bundles/pdf.worker.js';
var canvas = document.getElementById('the-canvas');
var context = canvas.getContext('2d');
var pdfCurPageIndex = 1;
var pdfSumPages = 1;
// var canvas = document.getElementById('the-canvas');
// var context = canvas.getContext('2d');
// var pdfCurPageIndex = 1;
// var pdfSumPages = 1;
var container = document.getElementById("pdfLayoutDialog");
var pdfPromise = null;
var cacheUrl = null;
// var pdfPromise = null;
// var cacheUrl = null;
$scope.openPdfPreviewPop_bak = function (url) {
container.style.display = "block";
if (cacheUrl !== url) {
......@@ -1593,37 +1593,32 @@ taxDocumentManageModule.directive('pdfPreview', function () {
renderPdf(pdf)
})
};
$scope.openPdfPreviewPop = function (url) {
container.style.display = "block";
function start() {
return new Promise(function (resolve, reject){
resolve('start');
});
}
start().then(function(data) {
console.log('result of start: ', data);
return taxDocumentListService.readPDF({path:url});
}).then(function(dataURL) {
var pdfData=null;
if(typeof dataURL =="string"){
pdfData = convertDataURIToBinary(dataURL);
$scope.openPdfPreviewPop = function (url)
{
var params={path:url};
taxDocumentListService.readPDF(params).then(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
}
console.log(pdfData);
return window.PDFJS.getDocument({data:pdfData});
}).then(function(data) {
pdfSumPages = data.numPages;
return data.getPage(pdfCurPageIndex);
}).then(function(page){
var scale = 1.5;
var viewport = page.getViewport(scale);
canvas.height = viewport.height;
canvas.width = viewport.width;
var renderContext = {
canvasContext: context,
viewport: viewport
container.style.display = "block";
var blob=data;
var img = document.createElement('img');
var myBlob = new window.Blob([blob], {type: 'image/png'});
console.log(myBlob);
var qrUrl = window.URL.createObjectURL(myBlob);
img.src = qrUrl;
img.onload = function () {
window.URL.revokeObjectURL(qrUrl);
$("div.busy-indicator-container").removeClass("busy-indicator-container");
$(".TDL-content-container")[0].style.display="none";
$(".TDL-header")[0].style.display="none";
$(".navbar-custom-top")[0].style.display="none";
container.append(img);
};
page.render(renderContext);
});
},function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
})
};
function convertDataURIToBinary(dataURI) { //将encodeBase64解码
var raw = window.atob(dataURI);
......
......@@ -306,6 +306,8 @@
}
.TDL-pdf-layout-dialog {
text-align: center;
float: top;
display: none;
}
......@@ -1462,14 +1464,10 @@
</div>
</div>
<div class="TDL-pdf-layout-dialog" id="pdfLayoutDialog" pdf-preview>
<div class="wrapper TDL-pdf-preview-pop" id="pdfContainer">
<div class="TDL-pdf-layout-dialog" id="pdfLayoutDialog" pdf-preview>
<div id="pdfContainer" style="width:0px;height:0px;overflow: hidden;">
<canvas id="the-canvas"></canvas>
</div>
<button class="TDL-pdf-preview-pop-close-btn" ng-click="closePdfPop()">×</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-prev" ng-click="prevPaging()" title="上一页">&lt;</button>
<button class="TDL-pdf-paging-btn TDL-pdf-paging-btn-next" ng-click="nextPaging()" title="下一页">&gt;</button>
</div>
<div class="modal fade" id="imgLayoutDialog" img-preview tabindex="-1" role="dialog" aria-labelledby="myModal"
......
......@@ -134,7 +134,21 @@ taxDocumentManageModule.factory('taxDocumentListService',
return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/previewExcelToJson', params);
},
readPDF:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/previewPDF', params);
$('#busy-indicator-container').show();
var defer = $q.defer();
var xhr = new XMLHttpRequest();
xhr.onload = function(result) {
if (this.status == 200) {
var blob = this.response;
defer.resolve(blob,xhr.status,xhr.getAllResponseHeaders());
}
};
xhr.open("post", apiInterceptor.webApiHostUrl + "/taxDoc/previewPDF", true);
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
xhr.responseType="blob";
xhr.send(JSON.stringify(params));
return defer.promise;
},
getBinaryData:function(url){
var defer = $q.defer();
......
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