Commit 15fef97a authored by zhkwei's avatar zhkwei

CIT固定资产-资产清单补充及优化

parent 5c1961e6
......@@ -134,6 +134,12 @@ public class AssetListController {
}
}
@RequestMapping(value="batchUpdateIsRetain",method = RequestMethod.POST)
public ApiResultDto batchUpdateIsRetain(Integer assetType, @RequestParam String projectId, @RequestParam Integer isRetain){
assetListService.batchUpdateIsRetain(assetType,projectId, isRetain);
return null;
}
@RequestMapping(value="saveAssetGroupInfo",method = RequestMethod.POST)
public ApiResultDto saveAssetGroupInfo(@RequestBody List<CitAssetGroupResult> assetGroupResults,
@RequestParam Integer saveGroupType,
......
......@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.dao.AssetDetailGroupMapper;
import pwc.taxtech.atms.dao.AssetGroupMapper;
......@@ -318,7 +319,7 @@ public class AssetListServiceImpl extends BaseService {
* @param cell
* @return
*/
private static Object getValue(Cell cell) {
public static Object getValue(Cell cell) {
Object obj = null;
switch (cell.getCellTypeEnum()) {
case BOOLEAN:
......@@ -488,6 +489,16 @@ public class AssetListServiceImpl extends BaseService {
return assetListMapper.selectByExample(assetListExample);
}
public void batchUpdateIsRetain(Integer assetType, String projectId, Integer isRetain){
CitAssetsListExample citAssetsListExample = new CitAssetsListExample();
CitAssetsListExample.Criteria criteria = citAssetsListExample.createCriteria();
criteria.andProjectIdEqualTo(projectId);
criteria.andAssetTypeEqualTo(assetType);
CitAssetsList citAsset = new CitAssetsList();
citAsset.setIsRetain(isRetain);
assetListMapper.updateByExampleSelective(citAsset,citAssetsListExample);
}
/**
* 根据主键获取资产一级分类
* @param id
......
......@@ -77,6 +77,8 @@
"~MustBeEndOneApp": "I Must be the End One, please!",
"TaxAccountDifference": "税会差异",
"TaxDepreciation": "会计折旧",
"AccountDepreciation": "税务折旧",
"TaxGreaterAccount": "会计折旧&lt;=税务折旧",
"TaxLessAccount": "会计折旧&gt;税务折旧"
}
\ No newline at end of file
......@@ -82,6 +82,8 @@
"TaxToLastYearDepreciationPeriod": "截止去年累计折旧期间",
"TaxToCurrentYearDepreciationPeriod": "截止本年累计折旧期间",
"TaxAccountDifference": "税会差异",
"TaxDepreciation": "会计折旧",
"AccountDepreciation": "税务折旧",
"TaxGreaterAccount": "会计折旧&lt;=税务折旧",
"TaxLessAccount": "会计折旧&gt;税务折旧",
"BuyDateType": "日期错误",
......
......@@ -656,18 +656,20 @@
$scope.ImportTotalAccountAcquisitionValue += v.accountAcquisitionValue;
$scope.ImportTotalAccountYearDepreciationAmount += v.accountYearDepreciationAmount;
$scope.ImportTotalTaxCurrentYearDepreciationAmount += v.taxCurrentYearDepreciationAmount;
$scope.ImportTotalYearDifferenceAmount += v.yearDifferenceAmount;
if(v.isRetain == 1){
$scope.ImportTotalYearDifferenceAmount += v.yearDifferenceAmount;
}
});
$scope.ImportTotalCount = rsp.length;
$scope.ImportTotalAccountAcquisitionValue = PWC.round($scope.ImportTotalAccountAcquisitionValue, 2);
$scope.ImportTotalAccountYearDepreciationAmount = PWC.round($scope.ImportTotalAccountYearDepreciationAmount, 2);
$scope.ImportTotalTaxCurrentYearDepreciationAmount = PWC.round($scope.ImportTotalTaxCurrentYearDepreciationAmount, 2);
$scope.ImportTotalYearDifferenceAmount = PWC.round($scope.ImportTotalYearDifferenceAmount, 2);
$scope.ImportTotalYearDifferenceAmount = PWC.round($scope.ImportTotalYearDifferenceAmount, 2);
}
}).error(function () {
SweetAlert.error(serviceErrorMsg);
});
}
}
//根据分类获取数据
function getAssetResultList(assetType) {
......@@ -687,7 +689,9 @@
$scope.TotalAccountAcquisitionValue += v.accountAcquisitionValue;
$scope.TotalAccountYearDepreciationAmount += v.accountYearDepreciationAmount;
$scope.TotalTaxCurrentYearDepreciationAmount += v.taxCurrentYearDepreciationAmount;
$scope.TotalYearDifferenceAmount += v.yearDifferenceAmount;
if(v.isRetain == 1){
$scope.TotalYearDifferenceAmount += v.yearDifferenceAmount;
}
});
$scope.assetsResultData = data;
$scope.TotalCount = data.length;
......@@ -712,7 +716,7 @@
$scope.ImportErrorTag = true;
$scope.errorMsg = $translate.instant('ImportAssetErrorMsg').formatObj({ "NumberOfError": $scope.errorList.length });
};
};
var initPagingControl = function (totalItemsCount) {
$scope.pagingOptions.totalItems = totalItemsCount;
......@@ -752,13 +756,13 @@
onInitialized: function (e) {
$scope.assetImportGridInstance = e.component;
},
hoverStateEnabled: true,
hoverStateEnabled: true,
scrolling: { mode: "virtual" },
noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'),
height: '99%',
}
}
}
//初始化编辑d资产分类(asset_group_result)ataGrid
var InitGrid = function (showAdd) {
$scope.assetsGridOptions = {
......@@ -768,10 +772,10 @@
keyExpr: "id",
paging: {
enabled: false
},
},
editing: {
mode: "batch",
allowUpdating: true,
allowUpdating: true,
},
onInitialized: function (e) {
$scope.assetGroupGridInstance = e.component;
......@@ -796,13 +800,13 @@
}
}
},
columns: [
columns: [
{
caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false,
},
{
caption: $translate.instant('AssetGroupName'), dataField: "assetName", width: 150, allowEditing: false,
caption: $translate.instant('AssetGroupName'), dataField: "assetName", width: 150, allowEditing: false,
},
{
caption: $translate.instant('LevelOneGroup'), dataField: "assetGroupId",
......@@ -876,7 +880,7 @@
if (item.name === 'saveButton' || item.name == 'revertButton') {
item.visible = false;
}
});
});
}
};
}
......@@ -933,14 +937,14 @@
$scope.assetsResultGridOptions = {
columns: dupColumns,
bindingOptions: {
"dataSource": "assetsResultData",
"dataSource": "assetsResultData",
},
editing: {
mode: "batch",
allowUpdating:true,
},
onInitialized: function (e) {
$scope.dataGridInstance = e.component;
$scope.dataGridInstance = e.component;
},
onCellPrepared: function (e) {
if (e.rowType === "header") {
......@@ -966,7 +970,7 @@
e.cellElement.addClass('herder-center');
e.cellElement.append($compile(inputElement)($scope));
}
}
}
},
loadPanel: {
enabled: true
......@@ -992,12 +996,12 @@
if(data.isRetain == true)
{
data.isRetain =1;
}
}
else if(data.isRetain == false)
{
data.isRetain =0;
}
targetArray.push(data);
targetArray.push(data);
},
onToolbarPreparing: function (e) {
var toolbarItems = e.toolbarOptions.items;
......@@ -1031,10 +1035,10 @@
name: $translate.instant('AllTheItems')
}, {
key: "0",
name: $translate.instant('TaxLessAccount')
name: $translate.instant('TaxDepreciation')+"<"+$translate.instant('TaxDepreciation')
}, {
key: "1",
name: $translate.instant('TaxGreaterAccount')
name: $translate.instant('TaxDepreciation')+">="+$translate.instant('TaxDepreciation')
}];
//初始化税会差异选项
$scope.taxAccountDifferenceOptions = {
......@@ -1049,7 +1053,7 @@
}
};
//获取数据服务
//获取数据服务
var getGroupList = function () {
debugger;
var deferred = $q.defer();
......@@ -1091,7 +1095,7 @@
|| PWC.isNullOrEmpty(m.assetGroupId)
|| PWC.isNullOrEmpty(m.assetDetailGroupId)
|| PWC.isNullOrEmpty(m.taxDepreciationPeriod)) {
isOk = false;
isOk = false;
}
});
return isOk;
......@@ -1111,8 +1115,8 @@
$scope.assetsResultData.forEach(function (m) {
m.isRetain = 0;
});
}
assetListService.batchUpdateIsRetain($scope.displayType -1, isRetain);
}
assetListService.batchUpdateIsRetain($scope.displayType -1,projectId, isRetain);
}
//验证信息
......
......@@ -30,6 +30,10 @@ webservices.factory('assetListService', ['$http', 'apiConfig', function ($http,
debugger;
return $http.post('/asset/updateAssetResultList?projectId=' + projectId,assetsList, apiConfig.create());
},
batchUpdateIsRetain:function (assetType,projectId, isRetain) {
debugger;
return $http.post('/asset/batchUpdateIsRetain?assetType=' + assetType + '&projectId=' + projectId + '&isRetain=' + isRetain, apiConfig.create());
},
getAllFixedAssetDetailGroup: function (assetGroupType,pageIndex,pageSize) {
debugger;
return $http.post('/asset/getFixedAssetDetailGroup',{"assetGroupType":assetGroupType,"pageIndex":pageIndex,"pageSize":pageSize}, apiConfig.create());
......
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