Commit 24be89fb authored by zhkwei's avatar zhkwei

CIT固定资产导入优化

parent 302b70ff
......@@ -288,10 +288,10 @@ public class AssetListServiceImpl extends BaseService {
return null;
}
citAsset.setAssetNumber(value.toString());
citAsset.setSerialNumber(String.valueOf(CitCommonUtil.getValue(rowData.getCell(2))));
citAsset.setSerialNumber(CitCommonUtil.getValue(rowData.getCell(2)).toString());
//获取资产描述
citAsset.setAssetDescription(String.valueOf(CitCommonUtil.getValue(rowData.getCell(5))));
citAsset.setAssetDescription(CitCommonUtil.getValue(rowData.getCell(5)).toString());
//获取资产类别
value = CitCommonUtil.getValue(rowData.getCell(7));
if (value == null) {
......@@ -303,7 +303,9 @@ public class AssetListServiceImpl extends BaseService {
//获取购入日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
value = CitCommonUtil.getValue(rowData.getCell(15));
citAsset.setBuyDate(value==null?null:sdf.parse(value.toString()));
if(!"".equals(value)){
citAsset.setBuyDate(sdf.parse(value.toString()));
}
//获取开始折旧日期,DD没有提供,我们要根据购入日期和税法分类做预处理自己转化
// citAsset.setDepreciationDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(15)).toString()));
......@@ -324,8 +326,10 @@ public class AssetListServiceImpl extends BaseService {
// citAsset.setAdjustmentValue(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(32)).toString()));
//获取报废日期
value = CitCommonUtil.getValue(rowData.getCell(37));
citAsset.setDisposedDate(value==null?null:sdf.parse(value.toString()));
citAsset.setScrapType(String.valueOf(CitCommonUtil.getValue(rowData.getCell(38))));
if(!"".equals(value)){
citAsset.setDisposedDate(sdf.parse(value.toString()));
}
citAsset.setScrapType(CitCommonUtil.getValue(rowData.getCell(38)).toString());
//获取残值额,原为残值率现为残值额,接下来计算需要用到,所以赋给一个对象
BigDecimal residualRate = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(20)).toString());
citAsset.setResidualRate(residualRate);
......
......@@ -63,7 +63,6 @@
taxGroupType:''
};
$scope.refreshAssetResultListGrid = function () {
$log.debug("refreshAssetResultListGrid");
getAssetResultList($scope.citAssetsListDto.assetType);
};
......@@ -232,25 +231,31 @@
}, withCredentials: true
}).success(function(resp){
$('#busy-indicator-container').hide();
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
$scope.assetGroupResultDataSource = groupResultData.data;
});
// $scope.assetGroupResultDataSource = resp.data;
InitGrid(false);
$scope.saveGroupType = 1;
$scope.isDisabled = true;
//为方便开发暂时先改为false
$scope.isDisabled = false;
$scope.modalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
keyboard: false,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'set-asset-group-modal.html',
scope: $scope,
windowClass: "set-asset-list-modal"
});
if(resp.code == 1){
assetListService.getAssetGroupResultData(projectId).success(function (groupResultData) {
$scope.assetGroupResultDataSource = groupResultData.data;
});
// $scope.assetGroupResultDataSource = resp.data;
InitGrid(false);
$scope.saveGroupType = 1;
$scope.isDisabled = true;
//为方便开发暂时先改为false
$scope.isDisabled = false;
$scope.modalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
keyboard: false,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'set-asset-group-modal.html',
scope: $scope,
windowClass: "set-asset-list-modal"
});
}else{
SweetAlert.error("文件导入出现错误,请重试");
}
}).error(function(resp){
SweetAlert.error("文件导入出现错误,请重试");
});
......@@ -258,6 +263,7 @@
//根据分类获取数据
function getAssetResultList(assetType) {
debugger;
$scope.citAssetsListDto.assetType = assetType;
$scope.TotalCount = 0;
$scope.TotalAccountAcquisitionValue = 0;
......@@ -265,7 +271,7 @@
$scope.TotalTaxCurrentYearDepreciationAmount = 0;
$scope.TotalYearDifferenceAmount = 0;
assetListService.getAssetResultListPage($scope.citAssetsListDto).success(function (assetListData) {
debugger;
var data = assetListData.data.list;
if (data) {
var index = 1;
......@@ -279,7 +285,7 @@
// }
// });
$scope.assetsResultData = data;
$scope.TotalCount = data.total;
// $scope.TotalAccountAcquisitionValue = PWC.round($scope.TotalAccountAcquisitionValue, 2);
// $scope.TotalAccountYearDepreciationAmount = PWC.round($scope.TotalAccountYearDepreciationAmount, 2);
// $scope.TotalTaxCurrentYearDepreciationAmount = PWC.round($scope.TotalTaxCurrentYearDepreciationAmount, 2);
......@@ -289,6 +295,7 @@
$scope.TotalTaxCurrentYearDepreciationAmount = PWC.round(data[0].totalTaxCurrentYearDepreciationAmount, 2);
$scope.TotalYearDifferenceAmount = PWC.round(data[0].totalYearDifferenceAmount, 2);
}
$scope.TotalCount = assetListData.data.total;
$scope.pagingOptions.totalItems = assetListData.data.total;
});
}
......@@ -1006,13 +1013,12 @@
//开始
(function initialize() {
//分页的设置
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
totalItems: 1, //总数据
pageSize: 100, //每页多少条数据
pageSizeString: "100"
};
/**************************************** function start*************************************************/
$scope.displayType = 2;
......@@ -1030,8 +1036,9 @@
initColumns();
initDxGrid();
initAssetResultDxGrid();
getAssetResultList(1);
// getAssetResultList(1);
$scope.refreshAssetResultListGrid();
getGroupList();
getGroupDetailList();
getUserPermission();
......
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