Commit 23275658 authored by eddie.woo's avatar eddie.woo

modify

parent a0961ae6
...@@ -12,7 +12,8 @@ public enum EnumImportType { ...@@ -12,7 +12,8 @@ public enum EnumImportType {
CertifiedInvoicesList(8), CertifiedInvoicesList(8),
InvoiceRecord(9), InvoiceRecord(9),
ExtractFinancialData(10), ExtractFinancialData(10),
ExtractInvoiceData(11) ExtractInvoiceData(11),
RevenueMapping(12)
; ;
private Integer code; private Integer code;
......
package pwc.taxtech.atms.dto.revenuconf; package pwc.taxtech.atms.dto.revenuconf;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.constant.enums.RevenueConfEnum; import pwc.taxtech.atms.constant.enums.RevenueConfEnum;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping; import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
public class RevenueTypeResult extends RevenueTypeMapping { public class RevenueTypeResult extends RevenueTypeMapping {
@JsonSerialize(using = PwCIdSerialize.class)
private String id;
public String getStatusStr() { public String getStatusStr() {
return RevenueConfEnum.Status.MAPPING.get(this.getStatus()); return RevenueConfEnum.Status.MAPPING.get(this.getStatus());
} }
} }
...@@ -41,6 +41,7 @@ public class RevenueConfService extends BaseService { ...@@ -41,6 +41,7 @@ public class RevenueConfService extends BaseService {
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize()); Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
RevenueConfigExample example = new RevenueConfigExample(); RevenueConfigExample example = new RevenueConfigExample();
example.createCriteria().andOrgIdIn(orgDtoList.stream().map(OrgSelectDto::getId).collect(Collectors.toList())); example.createCriteria().andOrgIdIn(orgDtoList.stream().map(OrgSelectDto::getId).collect(Collectors.toList()));
example.setOrderByClause("org_id");
PageInfo<RevenueConfResult> pageInfo = new PageInfo<>(revenueConfigMapper.selectByExample(example).stream() PageInfo<RevenueConfResult> pageInfo = new PageInfo<>(revenueConfigMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new RevenueConfResult())).collect(Collectors.toList())); .map(o -> beanUtil.copyProperties(o, new RevenueConfResult())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal()); pageInfo.setTotal(page.getTotal());
......
...@@ -53,6 +53,7 @@ public class RevenueTypeMappingService extends BaseService { ...@@ -53,6 +53,7 @@ public class RevenueTypeMappingService extends BaseService {
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize()); Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
RevenueTypeMappingExample example = new RevenueTypeMappingExample(); RevenueTypeMappingExample example = new RevenueTypeMappingExample();
example.createCriteria().andOrgIdIn(orgDtoList.stream().map(OrgSelectDto::getId).collect(Collectors.toList())); example.createCriteria().andOrgIdIn(orgDtoList.stream().map(OrgSelectDto::getId).collect(Collectors.toList()));
example.setOrderByClause("org_id");
PageInfo<RevenueTypeResult> pageInfo = new PageInfo<>(typeMappingMapper.selectByExample(example).stream() PageInfo<RevenueTypeResult> pageInfo = new PageInfo<>(typeMappingMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new RevenueTypeResult())).collect(Collectors.toList())); .map(o -> beanUtil.copyProperties(o, new RevenueTypeResult())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal()); pageInfo.setTotal(page.getTotal());
......
...@@ -1545,7 +1545,8 @@ constant.importFileType = { ...@@ -1545,7 +1545,8 @@ constant.importFileType = {
certifiedInvoicesList: 8, certifiedInvoicesList: 8,
invoiceRecord: 9, invoiceRecord: 9,
ExtractFinancialData: 10, ExtractFinancialData: 10,
ExtractInvoiceData: 11 ExtractInvoiceData: 11,
RevenueMapping: 12
}; };
constant.citImportFileType = { constant.citImportFileType = {
......
...@@ -106,6 +106,11 @@ ...@@ -106,6 +106,11 @@
//导入事件 //导入事件
var callFinancialApi = function () { var callFinancialApi = function () {
if (!$scope.formParam || !$scope.formParam.orgIds || !$scope.formParam.dataTypes
|| !$scope.formParam.period) {
SweetAlert.warning($translate.instant('PleaseSelectAtLeastOneItem'));
return;
}
dataImportService.callExtractFinancialData($scope.formParam).success(function (data) { dataImportService.callExtractFinancialData($scope.formParam).success(function (data) {
if (data) { if (data) {
getFinancialDataStatus(); getFinancialDataStatus();
......
...@@ -20,15 +20,17 @@ ...@@ -20,15 +20,17 @@
<div dx-date-box="dateBoxStart"></div> <div dx-date-box="dateBoxStart"></div>
</div> </div>
<label class="col-sm-1 control-label">{{'SelectedDataType' | translate}}:</label> <label class="col-sm-1 control-label">{{'SelectedDataType' | translate}}:</label>
<div class="col-sm-3"> <div class="col-sm-2">
<div dx-tag-box="selectTypeOptions"></div> <div dx-tag-box="selectTypeOptions"></div>
</div> </div>
<div class="col-sm-1"> <div class="col-sm-2">
<button type="button" atms-permission permission-control-type="ngIf" <button type="button" atms-permission permission-control-type="ngIf"
permission-code="{{$root.vatPermission.dataImport.balanceSheet.importCode}}" permission-code="{{$root.vatPermission.dataImport.balanceSheet.importCode}}"
class="btn btn-vat-primary" class="btn btn-vat-primary"
translate="ImportBtn" translate="ImportBtn" style="min-width: 50px;"
ng-click="callFinancialApi()"></button> ng-click="callFinancialApi()"></button>
<button type="button" class="btn btn-vat-primary" translate="Refresh"
ng-click="refreshConfigGrid()" style="min-width: 50px;"></button>
</div> </div>
</div> </div>
......
vatModule.controller('VatRevenueConfMappingController', ['$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q', vatModule.controller('VatRevenueConfMappingController', ['$scope', '$log', '$translate', '$timeout', 'SweetAlert', '$q',
'$interval','dxDataGridService','$http','apiConfig','Upload','apiInterceptor', '$interval','dxDataGridService','$http','apiConfig','Upload','apiInterceptor','templateService',
function ($scope, $log, $translate, $timeout, SweetAlert, $q, $interval,dxDataGridService,$http,apiConfig,Upload,apiInterceptor) { function ($scope, $log, $translate, $timeout, SweetAlert, $q, $interval,dxDataGridService,$http,apiConfig,Upload,
apiInterceptor,templateService) {
'use strict'; 'use strict';
//表格配置 //表格配置
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
}).appendTo(container); }).appendTo(container);
$('<i class="fa fa-trash" style="cursor: pointer;margin-left: 5px;"></i>') $('<i class="fa fa-trash" style="cursor: pointer;margin-left: 5px;"></i>')
.on('click', function () { .on('click', function () {
$scope.editConfig(options.data); $scope.delConfig([options.data.id]);
}).appendTo(container); }).appendTo(container);
} }
catch (e) { catch (e) {
...@@ -48,7 +49,11 @@ ...@@ -48,7 +49,11 @@
mode: 'multiple', mode: 'multiple',
showCheckBoxesMode: 'always', showCheckBoxesMode: 'always',
allowSelectAll: true allowSelectAll: true
} },
onSelectionChanged: function (data) {
$scope.selectedItems = data.selectedRowsData;
$scope.selectedRecourdCount = data.selectedRowsData.length;
},
}); });
//刷新页面 //刷新页面
...@@ -71,9 +76,25 @@ ...@@ -71,9 +76,25 @@
$($scope.revenueConfAddDiv).modal('show'); $($scope.revenueConfAddDiv).modal('show');
}; };
//删除配置 $scope.batchDelConfig = function () {
$scope.delConfig = function () { if (!!$scope.selectedRecourdCount) {
SweetAlert.info('del'); $scope.delConfig(_.map($scope.selectedItems, function(item){ return item.id; }));
}else {
SweetAlert.warning($translate.instant('PleaseSelectAtLeastOneItem'));
}
};
///删除配置
$scope.delConfig = function (idList) {
$http.post('/revenueConfMapping/del',idList, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
SweetAlert.success($translate.instant('RevenueDelSuccess'));
$scope.refreshConfigGrid();
}else {
SweetAlert.error($translate.instant('SystemError'));
}
})
}; };
//添加配置 //添加配置
...@@ -85,6 +106,7 @@ ...@@ -85,6 +106,7 @@
SweetAlert.success($translate.instant('RevenueAddSuccess')); SweetAlert.success($translate.instant('RevenueAddSuccess'));
$scope.refreshConfigGrid(); $scope.refreshConfigGrid();
$($scope.revenueConfAddDiv).modal('hide'); $($scope.revenueConfAddDiv).modal('hide');
$scope.cancelModal();
}else { }else {
SweetAlert.error($translate.instant('SystemError')); SweetAlert.error($translate.instant('SystemError'));
} }
...@@ -96,6 +118,7 @@ ...@@ -96,6 +118,7 @@
SweetAlert.success($translate.instant('RevenueAddSuccess')); SweetAlert.success($translate.instant('RevenueAddSuccess'));
$scope.refreshConfigGrid(); $scope.refreshConfigGrid();
$($scope.revenueConfAddDiv).modal('hide'); $($scope.revenueConfAddDiv).modal('hide');
$scope.cancelModal();
}else { }else {
SweetAlert.error($translate.instant('SystemError')); SweetAlert.error($translate.instant('SystemError'));
} }
...@@ -182,6 +205,35 @@ ...@@ -182,6 +205,35 @@
}); });
}; };
$scope.downloadTemplate = function () {
templateService.downloadTemplate(constant.importFileType.RevenueMapping).success(function (data, status, headers) {
var octetStreamMime = 'application/octet-stream';
var contentType = headers('content-type') || octetStreamMime;
if (window.navigator.msSaveBlob) {
var blob = new Blob([data], {
type: contentType
});
navigator.msSaveBlob(blob, "开票记录与收入类型映射模板");
} else {
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
var a = document.createElement('a');
var blob = new Blob([data], {
type: contentType
});
var url = urlCreator.createObjectURL(blob);
a.href = url;
a.target = '_blank';
a.download = "开票记录与收入类型映射模板.xlsx";
document.body.appendChild(a);
a.click();
}
}
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
(function initialize() { (function initialize() {
......
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
</div> </div>
<div id="tab_total"> <div id="tab_total">
<form class="form-inline"> <form class="form-inline">
<div class="form-group"> <div class="form-group" style="margin-top: 5px;">
<button type="button" class="btn btn-secondary" ng-click="addConfig()">{{'RevenueAddBtn' | translate }}</button>&nbsp;&nbsp;&nbsp; <button type="button" class="btn btn-secondary" ng-click="addConfig()">{{'RevenueAddBtn' | translate }}</button>&nbsp;&nbsp;&nbsp;
<button type="button" class="btn btn-third" ng-click="delConfig()">{{'RevenueDelBtn' | translate }}</button>&nbsp;&nbsp;&nbsp; <button type="button" class="btn btn-third" ng-click="batchDelConfig()">{{'RevenueDelBtn' | translate }}</button>&nbsp;&nbsp;&nbsp;
<label class="control-label">文件:</label> <label class="control-label">文件:</label>
<input class="form-control" type="text" name="fileName" ng-model="uploadFile.file.name" readonly placeholder=""/> <input class="form-control" type="text" name="fileName" ng-model="uploadFile.file.name" readonly placeholder=""/>
<button type="button" type="file" ngf-select ng-model="uploadFile.file" accept=".xls,.xlsx" class="btn btn-secondary browse">{{'SelectFile' | translate }}</button> <button type="button" type="file" ngf-select ng-model="uploadFile.file" accept=".xls,.xlsx" class="btn btn-secondary browse">{{'SelectFile' | translate }}</button>
<button type="button" class="btn btn-secondary" translate="CoverImportBtn" ng-click="upload()"></button> <button type="button" class="btn btn-secondary" translate="CoverImportBtn" ng-click="upload()"></button>
<button type="button" class="btn btn-secondary" translate="AddImportBtn" ng-click="upload()"></button> <button type="button" class="btn btn-secondary" translate="AddImportBtn" ng-click="upload()"></button>
<button type="button" class="btn btn-in-grid inline-div" ng-click="downEntepriseAccountTemplate()"><i <button type="button" class="btn btn-in-grid inline-div" ng-click="downloadTemplate()"><i
class="fa fa-download" aria-hidden="true"></i>下载模板 class="fa fa-download" aria-hidden="true"></i>下载模板
</button> </button>
</div> </div>
......
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
SweetAlert.success($translate.instant('RevenueAddSuccess')); SweetAlert.success($translate.instant('RevenueAddSuccess'));
$scope.refreshConfigGrid(); $scope.refreshConfigGrid();
$($scope.revenueConfAddDiv).modal('hide'); $($scope.revenueConfAddDiv).modal('hide');
$scope.cancelModal();
}else { }else {
SweetAlert.error($translate.instant('SystemError')); SweetAlert.error($translate.instant('SystemError'));
} }
...@@ -119,6 +120,7 @@ ...@@ -119,6 +120,7 @@
SweetAlert.success($translate.instant('RevenueAddSuccess')); SweetAlert.success($translate.instant('RevenueAddSuccess'));
$scope.refreshConfigGrid(); $scope.refreshConfigGrid();
$($scope.revenueConfAddDiv).modal('hide'); $($scope.revenueConfAddDiv).modal('hide');
$scope.cancelModal();
}else { }else {
SweetAlert.error($translate.instant('SystemError')); SweetAlert.error($translate.instant('SystemError'));
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</div> </div>
<div id="tab_total"> <div id="tab_total">
<form class="form-inline"> <form class="form-inline">
<div class="form-group"><div class="import-wrapper"> <div class="form-group" style="margin-top: 5px;"><div class="import-wrapper">
<button type="button" class="btn btn-primary" ng-click="addConfig()">{{'RevenueAddBtn' | translate }}</button>&nbsp;&nbsp;&nbsp; <button type="button" class="btn btn-primary" ng-click="addConfig()">{{'RevenueAddBtn' | translate }}</button>&nbsp;&nbsp;&nbsp;
<button type="button" class="btn btn-third" ng-click="batchDelConfig()">{{'RevenueDelBtn' | translate }}</button> <button type="button" class="btn btn-third" ng-click="batchDelConfig()">{{'RevenueDelBtn' | translate }}</button>
</div></div> </div></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