Commit faa84bc3 authored by zhkwei's avatar zhkwei

CIT固资导入界面增加追加导入功能及数据预览bug界面及导出bug,以及还原之前正确pom文件

parent a99e1084
......@@ -432,23 +432,12 @@
<profiles>
<profile>
<id>dev</id>
<build>
<filters>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter>
</filters>
</build>
<properties>
<env>dev</env>
</properties>
</profile>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<filters>
<filter>src/main/resources/conf/conf_profile_dev_local.properties</filter>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter>
</filters>
</build>
<properties>
......@@ -488,7 +477,6 @@
<env>uat</env>
</properties>
</profile>
</profiles>
<build>
......
......@@ -209,7 +209,8 @@ public class AssetListController {
ApiResultDto assetsImport(@RequestParam MultipartFile file,
@RequestParam String filename,
@RequestParam String tempFileName,
@RequestParam String projectId){
@RequestParam String projectId,
@RequestParam Integer importType){
logger.info("CIT资产导入");
ApiResultDto apiResultDto = new ApiResultDto();
try{
......@@ -224,7 +225,7 @@ public class AssetListController {
try {
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()){
apiResultDto.setData(assetListService.getAssetGroupResultData(projectId));
......
......@@ -194,7 +194,7 @@ public class AssetListServiceImpl extends BaseService {
* @param fileName
* @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文件开始");
//定义返回变量
OperationResultDto<Object> importResult = new OperationResultDto<>();
......@@ -249,7 +249,9 @@ public class AssetListServiceImpl extends BaseService {
}
//在循环存储新的资产之前先删除原有资产
if(importType == 1){
deleteByExample(projectId);
}
//循环存储新的资产
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
// for (CitAssetsList citAsset : citAssetsLists){
......
......@@ -237,7 +237,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表生成版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneVer.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceGene.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(null);
......@@ -322,7 +322,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表Mapping版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneMapping.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceMapping.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(citTbList.get(0));
......
......@@ -350,9 +350,7 @@
<select id="getTbMappingData" parameterType="map" resultMap="citTbDtoResultMap">
select
tb.id, tb.organization_id, tb.project_id, tb.date, tb.source, tb.period, tb.account_code, tb.account_description,
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
tb.*,dam.attribute as attribute
from
cit_trial_balance tb
left join
......
......@@ -77,13 +77,13 @@
}
$log.log('Page changed to: ' + $scope.pageOptions.pageIndex);
refreshDataTable();
$scope.refreshAssetResultListGrid();
},
//每页显示的数据下拉改变
pageSizeSelectionChanged: function () {
$scope.pageOptions.pageSize = parseInt($scope.pageOptions.pageSizeString);
refreshDataTable();
$scope.refreshAssetResultListGrid();
},
};
......@@ -270,7 +270,8 @@
data: {
filename: $scope.file.name,
tempFileName: tempFileName,
projectId: projectId
projectId: projectId,
importType: importType
},
file: $scope.file,
resumeChunkSize: resumable ? $scope.chunkSize : null,
......@@ -316,6 +317,11 @@
function getAssetResultList(assetType) {
debugger;
$scope.citAssetsListDto.assetType = assetType;
$scope.citAssetsListDto.pageInfo = {
pageIndex: $scope.pagingOptions.pageIndex,
totalItems: $scope.pagingOptions.totalItems,
pageSize: $scope.pagingOptions.pageSize
};
$scope.TotalCount = 0;
$scope.TotalAccountAcquisitionValue = 0;
$scope.TotalAccountYearDepreciationAmount = 0;
......
......@@ -24,18 +24,22 @@
<form class="form-inline">
<div class="form-group">
<div class="col-sm-5">
<div class="col-sm-4">
<input class="form-control" type="text" name="fileName"
value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
</div>
<div class="col-sm-4">
<div class="col-sm-3">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx"
class="btn btn-secondary browse">{{'SelectFile' | translate}}
</button>
</div>
<div class="col-sm-3">
<button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn"
ng-click="importDataNew()"></button>
<button class="btn btn-vat-primary" style="height: 34px" translate="ConverImportBtn"
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>
......
......@@ -46,15 +46,12 @@
};
//从数据库中load数据
var loadJournalEntryDataFromDB = function (pageIndex) {
initJournalEntryPagination();
$scope.curJournalEntryPage = pageIndex;
var loadJournalEntryDataFromDB = function () {
//初始化查询信息
$scope.queryParams.pageInfo = {
totalCount: $scope.queryJournalEntryResult.pageInfo.totalCount,
pageIndex: pageIndex,
pageSize: $scope.queryJournalEntryResult.pageInfo.pageSize,
totalCount: $scope.pagingOptions.totalItems,
pageIndex: $scope.pagingOptions.pageIndex,
pageSize: $scope.pagingOptions.pageSize,
totalPage: 0
};
$scope.getDataFromDatabase($scope.queryParams);
......@@ -62,6 +59,7 @@
$scope.getDataFromDatabase = function (queryParams){
citPreviewService.getTbGeneVerData(queryParams).success(function (data) {
debugger;
if (data) {
// minDate = data.
var index = 1;
......@@ -69,110 +67,15 @@
v.index = index++;
});
$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);
$scope.pagingOptions.totalItems = data.total;
}
});
$('#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');
}
};
//初始化分页信息
var initJournalEntryPagination = function () {
$scope.queryJournalEntryResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0,
}
}
$scope.curJournalEntryPage = 1;
};
//将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) {
// if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) {
// $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);
}
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -184,19 +87,11 @@
periodEnd: '',
accountCode:'',
accountDescription:'',
// segment3: null,
// segment3Name: null,
// segment5: null,
// segment5Name: null,
// segment6: null,
// segment6Name: null,
// description: null,
// containsAdjustmentRecord: null
projectId: vatSessionService.project.id
};
$scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -250,10 +145,21 @@
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
$scope.refreshGrid = function () {
$log.debug("refreshGrid");
loadJournalEntryDataFromDB();
};
(function initialize() {
$log.debug('citPreviewTbGeneVerController.ctor()...');
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 50 //每页多少条数据
};
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
......@@ -276,7 +182,7 @@
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
});
......@@ -306,7 +212,7 @@
$scope.downloadJE = downloadJE;
initPeriods();
initJournalEntryPagination();
// initJournalEntryPagination();
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;
......@@ -316,7 +222,7 @@
}else{
$('.periodInput')[0].style.left = "150px";
}
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
})();
}
]);
......
......@@ -10,8 +10,10 @@
</button>
<span translate="TrialBalanceGeneVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
<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" />
<span ng-click="downloadJE()" style="position: relative; left: 85%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</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"/>
<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 style="margin-bottom: 8px;margin-left: 30px">-->
......@@ -27,15 +29,18 @@
<span title="{{criteria.fullName}}">
{{criteria.name}}
</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 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" 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}}">
{{criteria.name}}
</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>
</div>
......@@ -43,11 +48,10 @@
<div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div>
<div class="pagination-container">
<span>本页{{curPageItemCount}}条记录,共{{queryJournalEntryResult.pageInfo.total}}条记录</span>
<div id="totalInvoicePage" class="common-pagination" style="display:none;">
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshGrid()"></ack-pagination>
</div>
</div>
......@@ -79,7 +79,6 @@
/*Filter Criteria tags:*/
/*******************************************/
.main-area {
height: 100%;
margin: 0 20px;
.watermark {
......
......@@ -916,7 +916,7 @@
$scope.openExportPop = function (evenType) {
$scope.evenType = evenType;
var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType';
return g.name == 'TaxReturnType' || g.name == 'WorkingPaperType';
});
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