Commit b033dda7 authored by kevin's avatar kevin

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

parents 4b42458a 236e7971
...@@ -209,7 +209,8 @@ public class AssetListController { ...@@ -209,7 +209,8 @@ public class AssetListController {
ApiResultDto assetsImport(@RequestParam MultipartFile file, ApiResultDto assetsImport(@RequestParam MultipartFile file,
@RequestParam String filename, @RequestParam String filename,
@RequestParam String tempFileName, @RequestParam String tempFileName,
@RequestParam String projectId){ @RequestParam String projectId,
@RequestParam Integer importType){
logger.info("CIT资产导入"); logger.info("CIT资产导入");
ApiResultDto apiResultDto = new ApiResultDto(); ApiResultDto apiResultDto = new ApiResultDto();
try{ try{
...@@ -224,7 +225,7 @@ public class AssetListController { ...@@ -224,7 +225,7 @@ public class AssetListController {
try { try {
input = file.getInputStream(); input = file.getInputStream();
//调用资产导入业务逻辑 //调用资产导入业务逻辑
OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId); OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId,importType);
//判断是否导入成功,若成功获取资产类别并返回页面 //判断是否导入成功,若成功获取资产类别并返回页面
if(assetsImportResult.getResult() != null && !assetsImportResult.getResult()){ if(assetsImportResult.getResult() != null && !assetsImportResult.getResult()){
apiResultDto.setData(assetListService.getAssetGroupResultData(projectId)); apiResultDto.setData(assetListService.getAssetGroupResultData(projectId));
......
...@@ -194,7 +194,7 @@ public class AssetListServiceImpl extends BaseService { ...@@ -194,7 +194,7 @@ public class AssetListServiceImpl extends BaseService {
* @param fileName * @param fileName
* @return * @return
*/ */
public OperationResultDto assetsImport(InputStream inputStream, String fileName, String projectId) throws IOException, InvalidFormatException, ParseException { public OperationResultDto assetsImport(InputStream inputStream, String fileName, String projectId, Integer importType) throws IOException, InvalidFormatException, ParseException {
logger.debug("导入excel文件开始"); logger.debug("导入excel文件开始");
//定义返回变量 //定义返回变量
OperationResultDto<Object> importResult = new OperationResultDto<>(); OperationResultDto<Object> importResult = new OperationResultDto<>();
...@@ -249,7 +249,9 @@ public class AssetListServiceImpl extends BaseService { ...@@ -249,7 +249,9 @@ public class AssetListServiceImpl extends BaseService {
} }
//在循环存储新的资产之前先删除原有资产 //在循环存储新的资产之前先删除原有资产
deleteByExample(projectId); if(importType == 1){
deleteByExample(projectId);
}
//循环存储新的资产 //循环存储新的资产
int insertBatch = assetListMapper.insertBatch(citAssetsLists); int insertBatch = assetListMapper.insertBatch(citAssetsLists);
// for (CitAssetsList citAsset : citAssetsLists){ // for (CitAssetsList citAsset : citAssetsLists){
......
...@@ -237,7 +237,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -237,7 +237,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
ExportDto exportDto = new ExportDto(); ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表生成版"); exportDto.setFileName("试算平衡表生成版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneVer.xlsx"); exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceGene.xlsx");
exportDto.setResponse(response); exportDto.setResponse(response);
exportDto.setList(citTbList); exportDto.setList(citTbList);
exportDto.setRelation(null); exportDto.setRelation(null);
...@@ -322,7 +322,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -322,7 +322,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
ExportDto exportDto = new ExportDto(); ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表Mapping版"); exportDto.setFileName("试算平衡表Mapping版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneMapping.xlsx"); exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceMapping.xlsx");
exportDto.setResponse(response); exportDto.setResponse(response);
exportDto.setList(citTbList); exportDto.setList(citTbList);
exportDto.setRelation(citTbList.get(0)); exportDto.setRelation(citTbList.get(0));
......
...@@ -350,9 +350,7 @@ ...@@ -350,9 +350,7 @@
<select id="getTbMappingData" parameterType="map" resultMap="citTbDtoResultMap"> <select id="getTbMappingData" parameterType="map" resultMap="citTbDtoResultMap">
select select
tb.id, tb.organization_id, tb.project_id, tb.date, tb.source, tb.period, tb.account_code, tb.account_description, tb.*,dam.attribute as attribute
tb.account_period, tb.debit_amount, tb.credit_amount, tb.beginning_balance, tb.ending_balance, tb.create_by,
tb.create_time, tb.update_time,dam.attribute as attribute
from from
cit_trial_balance tb cit_trial_balance tb
left join left join
......
...@@ -77,13 +77,13 @@ ...@@ -77,13 +77,13 @@
} }
$log.log('Page changed to: ' + $scope.pageOptions.pageIndex); $log.log('Page changed to: ' + $scope.pageOptions.pageIndex);
refreshDataTable(); $scope.refreshAssetResultListGrid();
}, },
//每页显示的数据下拉改变 //每页显示的数据下拉改变
pageSizeSelectionChanged: function () { pageSizeSelectionChanged: function () {
$scope.pageOptions.pageSize = parseInt($scope.pageOptions.pageSizeString); $scope.pageOptions.pageSize = parseInt($scope.pageOptions.pageSizeString);
refreshDataTable(); $scope.refreshAssetResultListGrid();
}, },
}; };
...@@ -270,7 +270,8 @@ ...@@ -270,7 +270,8 @@
data: { data: {
filename: $scope.file.name, filename: $scope.file.name,
tempFileName: tempFileName, tempFileName: tempFileName,
projectId: projectId projectId: projectId,
importType: importType
}, },
file: $scope.file, file: $scope.file,
resumeChunkSize: resumable ? $scope.chunkSize : null, resumeChunkSize: resumable ? $scope.chunkSize : null,
...@@ -316,6 +317,11 @@ ...@@ -316,6 +317,11 @@
function getAssetResultList(assetType) { function getAssetResultList(assetType) {
debugger; debugger;
$scope.citAssetsListDto.assetType = assetType; $scope.citAssetsListDto.assetType = assetType;
$scope.citAssetsListDto.pageInfo = {
pageIndex: $scope.pagingOptions.pageIndex,
totalItems: $scope.pagingOptions.totalItems,
pageSize: $scope.pagingOptions.pageSize
};
$scope.TotalCount = 0; $scope.TotalCount = 0;
$scope.TotalAccountAcquisitionValue = 0; $scope.TotalAccountAcquisitionValue = 0;
$scope.TotalAccountYearDepreciationAmount = 0; $scope.TotalAccountYearDepreciationAmount = 0;
......
...@@ -24,18 +24,22 @@ ...@@ -24,18 +24,22 @@
<form class="form-inline"> <form class="form-inline">
<div class="form-group"> <div class="form-group">
<div class="col-sm-5"> <div class="col-sm-4">
<input class="form-control" type="text" name="fileName" <input class="form-control" type="text" name="fileName"
value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required> value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-3">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx" <button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx"
class="btn btn-secondary browse">{{'SelectFile' | translate}} class="btn btn-secondary browse">{{'SelectFile' | translate}}
</button> </button>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn" <button class="btn btn-vat-primary" style="height: 34px" translate="ConverImportBtn"
ng-click="importDataNew()"></button> ng-click="importDataNew(1)"></button>
</div>
<div class="col-sm-2">
<button class="btn btn-vat-primary" style="height: 34px" translate="AddImportBtn"
ng-click="importDataNew(0)"></button>
</div> </div>
</div> </div>
......
...@@ -46,15 +46,12 @@ ...@@ -46,15 +46,12 @@
}; };
//从数据库中load数据 //从数据库中load数据
var loadJournalEntryDataFromDB = function (pageIndex) { var loadJournalEntryDataFromDB = function () {
initJournalEntryPagination();
$scope.curJournalEntryPage = pageIndex;
//初始化查询信息 //初始化查询信息
$scope.queryParams.pageInfo = { $scope.queryParams.pageInfo = {
totalCount: $scope.queryJournalEntryResult.pageInfo.totalCount, totalCount: $scope.pagingOptions.totalItems,
pageIndex: pageIndex, pageIndex: $scope.pagingOptions.pageIndex,
pageSize: $scope.queryJournalEntryResult.pageInfo.pageSize, pageSize: $scope.pagingOptions.pageSize,
totalPage: 0 totalPage: 0
}; };
$scope.getDataFromDatabase($scope.queryParams); $scope.getDataFromDatabase($scope.queryParams);
...@@ -62,6 +59,7 @@ ...@@ -62,6 +59,7 @@
$scope.getDataFromDatabase = function (queryParams){ $scope.getDataFromDatabase = function (queryParams){
citPreviewService.getTbGeneVerData(queryParams).success(function (data) { citPreviewService.getTbGeneVerData(queryParams).success(function (data) {
debugger;
if (data) { if (data) {
// minDate = data. // minDate = data.
var index = 1; var index = 1;
...@@ -69,110 +67,15 @@ ...@@ -69,110 +67,15 @@
v.index = index++; v.index = index++;
}); });
$scope.gridOptions.data = data.list; $scope.gridOptions.data = data.list;
$scope.queryJournalEntryResult.pageInfo = data;
computeJournalEntryPage();
// $scope.ledgerName = data.list[0].ledgerName;
// $scope.currencyCode = data.list[0].currencyCode;
// $scope.status = data.list[0].status;
// $scope.importDate = $filter('date')(data.list[0].date, "yyyy-MM-dd hh:mm:ss");
}
});
};
//点击任意一页加载数据事件
var loadIncomeInvoiceDataByPage = function (pageIndex) {
loadJournalEntryDataFromDB(pageIndex);
};
//计算页数,创建分页栏
var computeJournalEntryPage = function () {
if ($scope.queryJournalEntryResult.pageInfo && $scope.queryJournalEntryResult.pageInfo.total > 0) {
var totalPage = parseInt($scope.queryJournalEntryResult.pageInfo.total / $scope.queryJournalEntryResult.pageInfo.pageSize);
totalPage = $scope.queryJournalEntryResult.pageInfo.totalCount % $scope.queryJournalEntryResult.pageInfo.pageSize == 0 ? totalPage : totalPage + 1;
//计算本页记录数
if ($scope.queryJournalEntryResult.pageInfo.pageNum === totalPage) {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.total % $scope.queryJournalEntryResult.pageInfo.pageSize;
}
else {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.pageSize;
}
$scope.queryJournalEntryResult.pageInfo.totalPage = totalPage;
var createPage = $("#totalInvoicePage").createPage({
pageCount: totalPage,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
} else {
//如果查询结果为0,则直接设置本页记录数为0
$scope.curPageItemCount = 0;
var createPage = $("#totalInvoicePage").createPage({
pageCount: 0,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block'); $scope.pagingOptions.totalItems = data.total;
}
};
//初始化分页信息
var initJournalEntryPagination = function () {
$scope.queryJournalEntryResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0,
} }
} });
$scope.curJournalEntryPage = 1;
}; };
//将选择了的查询条件显示在grid上方 //将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) { var doDataFilter = function (removeData) {
// if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) { loadJournalEntryDataFromDB();
// $scope.queryParams.periodEnd = $scope.queryParams.periodStart;
// }
// 设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|");
removeItem.forEach(function (v) {
$scope.queryParams[v] = null;
// if ($scope.queryParams.accountCode === null) {
// $scope.queryParams.accountCode = '';
// }
// if ($scope.queryParams.accountDescription === null) {
// $scope.queryParams.accountDescription = '';
// }
});
}
loadJournalEntryDataFromDB(1);
if ($scope.criteriaList.length > 6) {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, 6);
$scope.criteriaListSecondRow = $scope.criteriaList.slice(6, $scope.criteriaList.length);
}
else {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, $scope.criteriaList.length);
}
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}; };
...@@ -184,19 +87,11 @@ ...@@ -184,19 +87,11 @@
periodEnd: '', periodEnd: '',
accountCode:'', accountCode:'',
accountDescription:'', accountDescription:'',
// segment3: null,
// segment3Name: null,
// segment5: null,
// segment5Name: null,
// segment6: null,
// segment6Name: null,
// description: null,
// containsAdjustmentRecord: null
projectId: vatSessionService.project.id projectId: vatSessionService.project.id
}; };
$scope.queryParams.periodStart = $scope.startMonth; $scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth; $scope.queryParams.periodEnd = $scope.endMonth;
loadJournalEntryDataFromDB(1); loadJournalEntryDataFromDB();
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}; };
...@@ -250,10 +145,21 @@ ...@@ -250,10 +145,21 @@
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
}); });
}; };
$scope.refreshGrid = function () {
$log.debug("refreshGrid");
loadJournalEntryDataFromDB();
};
(function initialize() { (function initialize() {
$log.debug('citPreviewTbGeneVerController.ctor()...'); $log.debug('citPreviewTbGeneVerController.ctor()...');
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 50 //每页多少条数据
};
$('#input-invoice-period-picker').focus(function () { $('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
}); });
...@@ -276,7 +182,7 @@ ...@@ -276,7 +182,7 @@
$scope.queryParams.periodStart = startMonth; $scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth; $scope.queryParams.periodEnd = endMonth;
loadJournalEntryDataFromDB(1); loadJournalEntryDataFromDB();
}); });
...@@ -306,7 +212,7 @@ ...@@ -306,7 +212,7 @@
$scope.downloadJE = downloadJE; $scope.downloadJE = downloadJE;
initPeriods(); initPeriods();
initJournalEntryPagination(); // initJournalEntryPagination();
//初始化查询条件-期间范围 //初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month; $scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month; $scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;
...@@ -316,7 +222,7 @@ ...@@ -316,7 +222,7 @@
}else{ }else{
$('.periodInput')[0].style.left = "150px"; $('.periodInput')[0].style.left = "150px";
} }
loadJournalEntryDataFromDB(1); loadJournalEntryDataFromDB();
})(); })();
} }
]); ]);
......
...@@ -10,15 +10,17 @@ ...@@ -10,15 +10,17 @@
</button> </button>
<span translate="TrialBalanceGeneVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp; <span translate="TrialBalanceGeneVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
<span class="text-bold" translate="InvoiceQJ" style="display: none"></span> <span class="text-bold" translate="InvoiceQJ" style="display: none"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;display: none;" id="input-invoice-period-picker" /> <input type="text" class="form-control input-width-middle periodInput"
<span ng-click="downloadJE()" style="position: relative; left: 85%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span> style="position: relative; top: -30px; left: 180px;display: none;" id="input-invoice-period-picker"/>
<span ng-click="downloadJE()" style="position: relative; left: 85%;"><i class="fa fa-file-excel-o"
aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div> </div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">--> <!--<div style="margin-bottom: 8px;margin-left: 30px">-->
<!--{{'EnterpriseAccountSetName' | translate}}<span class="numAmount">{{ledgerName}}</span>&nbsp;&nbsp;&nbsp;--> <!--{{'EnterpriseAccountSetName' | translate}}<span class="numAmount">{{ledgerName}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'EnterpriseAccountSetCurrency' | translate}}<span class="numAmount">{{currencyCode}}</span>&nbsp;&nbsp;&nbsp;--> <!--{{'EnterpriseAccountSetCurrency' | translate}}<span class="numAmount">{{currencyCode}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'IsCloseAccount' | translate}}<span class="numAmount">{{status}}</span>--> <!--{{'IsCloseAccount' | translate}}<span class="numAmount">{{status}}</span>-->
<!--{{'ImportTime' | translate}}<span class="numAmount">{{importDate| date:'yyyy-MM-dd hh:mm:ss'}}</span>--> <!--{{'ImportTime' | translate}}<span class="numAmount">{{importDate| date:'yyyy-MM-dd hh:mm:ss'}}</span>-->
<!--</div>--> <!--</div>-->
<div id="filterCriteriaDiv" style="max-width:98%;margin-bottom:2px;" ng-show="criteriaList.length>0"> <div id="filterCriteriaDiv" style="max-width:98%;margin-bottom:2px;" ng-show="criteriaList.length>0">
...@@ -27,15 +29,18 @@ ...@@ -27,15 +29,18 @@
<span title="{{criteria.fullName}}"> <span title="{{criteria.fullName}}">
{{criteria.name}} {{criteria.name}}
</span> </span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a> <a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white"
ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span> </span>
<span ng-if="criteriaList.length>6"><br /></span> <span ng-if="criteriaList.length>6"><br/></span>
<span ng-if="criteriaList.length>6" style="margin-left: 81px; margin-top: 19px; display: inline-block;"></span> <span ng-if="criteriaList.length>6" style="margin-left: 81px; margin-top: 19px; display: inline-block;"></span>
<span ng-if="criteriaList.length>6" class="tag label label-default" ng-repeat="criteria in criteriaListSecondRow"> <span ng-if="criteriaList.length>6" class="tag label label-default"
ng-repeat="criteria in criteriaListSecondRow">
<span title="{{criteria.fullName}}"> <span title="{{criteria.fullName}}">
{{criteria.name}} {{criteria.name}}
</span> </span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a> <a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white"
ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span> </span>
</div> </div>
...@@ -43,11 +48,10 @@ ...@@ -43,11 +48,10 @@
<div class="inputInvoiceGrid" ui-grid="gridOptions"> <div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div> <div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div> </div>
<div class="pagination-container"> </div>
<span>本页{{curPageItemCount}}条记录,共{{queryJournalEntryResult.pageInfo.total}}条记录</span> <div class="page-footer">
<div id="totalInvoicePage" class="common-pagination" style="display:none;"> <ack-pagination page-options="pagingOptions"
</div> refresh-table="refreshGrid()"></ack-pagination>
</div>
</div> </div>
</div> </div>
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
/*Filter Criteria tags:*/ /*Filter Criteria tags:*/
/*******************************************/ /*******************************************/
.main-area { .main-area {
height: 100%;
margin: 0 20px; margin: 0 20px;
.watermark { .watermark {
......
...@@ -916,7 +916,7 @@ ...@@ -916,7 +916,7 @@
$scope.openExportPop = function (evenType) { $scope.openExportPop = function (evenType) {
$scope.evenType = evenType; $scope.evenType = evenType;
var grp = _.find($scope.$parent.$parent.groups, function (g) { var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType'; return g.name == 'TaxReturnType' || g.name == 'WorkingPaperType';
}); });
if (!grp || !grp.children) { if (!grp || !grp.children) {
......
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