Commit 8b651d54 authored by neo's avatar neo

[dev] merger goserver

parent 9afa0ddd
......@@ -723,109 +723,140 @@
}
}
$scope.goToService = function (project) {
if (!project.clicked) {
project.clicked = true;
$log.debug('goToService()...');
serviceLogService.addEnterProjectLog(loginContext.displayUserName, 'Enter project (id: ' + project.id + ', serviceType: ' + project.serviceTypeID + ')').then(function () {
if (project.serviceTypeID === enums.serviceType.AssetsManage) {
$state.go('assetsManage.importData.productItem');
assetsManageSessionService.product.fSetCode = project.fSetCode;
assetsManageSessionService.product.productIDs = project.productIDs;
assetsManageSessionService.project.organizationName = project.fSetName;
assetsManageSessionService.project.id = project.id;
assetsManageSessionService.project.serviceTypeID = project.serviceTypeID;
//window.location.href = '/#/assetsManage/importData/productItem';
}
else {
if (project.haveCreateProject) {
if (_.isUndefined(project.projectStatusList[vatSessionService.month])) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList[vatSessionService.month] = constant.ProjectStatusEnum.UnStarted;
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
//!!请把goRightPath()放在最内层的callback中,否则会在当前service没有执行完毕前就跳转到vat-layout.ctrl.js,
//从而造成一些bug
goRightPath(project);
}
});
}
else {
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
$scope.goToService = function (project) {
if (!project.clicked) {
project.clicked = true;
$log.debug('goToService()...');
serviceLogService.addEnterProjectLog(loginContext.displayUserName, 'Enter project (id: ' + project.id + ', serviceType: ' + project.serviceTypeID + ')').then(function () {
if (project.serviceTypeID === enums.serviceType.AssetsManage) {
$state.go('assetsManage.importData.productItem');
assetsManageSessionService.product.fSetCode = project.fSetCode;
assetsManageSessionService.product.productIDs = project.productIDs;
assetsManageSessionService.project.organizationName = project.fSetName;
assetsManageSessionService.project.id = project.id;
assetsManageSessionService.project.serviceTypeID = project.serviceTypeID;
//window.location.href = '/#/assetsManage/importData/productItem';
}
else if (project.serviceTypeID === enums.serviceType.VAT) {
if (project.haveCreateProject) {
if (_.isUndefined(project.projectStatusList[vatSessionService.month])) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList[vatSessionService.month] = constant.ProjectStatusEnum.UnStarted;
vatSessionService.project = project;
goRightPath(project);
}
});
}
else {
vatSessionService.project = citSessionService.project = project;
goRightPath(project);
}
} else {
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dbname;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
projectService.getProjectAllStatus(project.dbName).success(function (org) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList = org;
projectService.getProjectStatus(project.dbName, project.id, vatSessionService.month)
.success(function (or1) {
if (or1.result) {
project.importSubStatus = or1.data.importSubStatus;
vatSessionService.project = project;
goRightPath(project);
}
});
})
}
});
}
else {
vatSessionService.project = project;
goRightPath(project);
}
}
else {
SweetAlert.error($translate.instant('AddProjectFail'));
}
});
}
}
else { // project.serviceTypeID === enums.serviceType.CIT
if (project.haveCreateProject) {
if (_.isUndefined(project.projectStatusList[enums.wholeYearPeriod.import])) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, enums.wholeYearPeriod.import, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList[enums.wholeYearPeriod.import] = constant.ProjectStatusEnum.UnStarted;
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
});
}
else {
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
} else {
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dbname;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, enums.wholeYearPeriod.import, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
projectService.getProjectAllStatus(project.dbName).success(function (org) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList = org;
projectService.getProjectStatus(project.dbName, project.id, enums.wholeYearPeriod.import)
.success(function (or1) {
if (or1.result) {
project.importSubStatus = or1.data.importSubStatus;
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
});
})
}
});
}
else {
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
}
else {
SweetAlert.error($translate.instant('AddProjectFail'));
}
});
}
}
$timeout(function () {
project.clicked = false;
}, 1000);
});
}
};
goRightPath(project);
}
} else {
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dbname;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
projectService.getProjectAllStatus(project.dbName).success(function (org) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList = org;
projectService.getProjectStatus(project.dbName, project.id, vatSessionService.month)
.success(function (or1) {
if (or1.result) {
project.importSubStatus = or1.data.importSubStatus;
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
goRightPath(project);
}
});
})
}
});
}
else {
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
goRightPath(project);
}
}
else {
SweetAlert.error($translate.instant('AddProjectFail'));
}
});
}
}
$timeout(function () {
project.clicked = false;
}, 1000);
});
}
};
$scope.toggleExpand = function (item) {
item.expand = !item.expand;
......
......@@ -1650,108 +1650,138 @@ frameworkModule.controller('appOverviewController', ['$rootScope', '$scope', '$t
}
$scope.goToService = function (project) {
if (!project.clicked) {
project.clicked = true;
$log.debug('goToService()...');
serviceLogService.addEnterProjectLog(loginContext.displayUserName, 'Enter project (id: ' + project.id + ', serviceType: ' + project.serviceTypeID + ')').then(function () {
if (project.serviceTypeID === enums.serviceType.AssetsManage) {
$state.go('assetsManage.importData.productItem');
assetsManageSessionService.product.fSetCode = project.fSetCode;
assetsManageSessionService.product.productIDs = project.productIDs;
assetsManageSessionService.project.organizationName = project.fSetName;
assetsManageSessionService.project.id = project.id;
assetsManageSessionService.project.serviceTypeID = project.serviceTypeID;
//window.location.href = '/#/assetsManage/importData/productItem';
}
else {
if (project.haveCreateProject) {
if (_.isUndefined(project.projectStatusList[vatSessionService.month])) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList[vatSessionService.month] = constant.ProjectStatusEnum.UnStarted;
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
if (!project.clicked) {
project.clicked = true;
$log.debug('goToService()...');
serviceLogService.addEnterProjectLog(loginContext.displayUserName, 'Enter project (id: ' + project.id + ', serviceType: ' + project.serviceTypeID + ')').then(function () {
if (project.serviceTypeID === enums.serviceType.AssetsManage) {
$state.go('assetsManage.importData.productItem');
assetsManageSessionService.product.fSetCode = project.fSetCode;
assetsManageSessionService.product.productIDs = project.productIDs;
assetsManageSessionService.project.organizationName = project.fSetName;
assetsManageSessionService.project.id = project.id;
assetsManageSessionService.project.serviceTypeID = project.serviceTypeID;
//window.location.href = '/#/assetsManage/importData/productItem';
}
else if (project.serviceTypeID === enums.serviceType.VAT) {
if (project.haveCreateProject) {
if (_.isUndefined(project.projectStatusList[vatSessionService.month])) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList[vatSessionService.month] = constant.ProjectStatusEnum.UnStarted;
vatSessionService.project = project;
goRightPath(project);
}
});
}
else {
vatSessionService.project = citSessionService.project = project;
goRightPath(project);
}
} else {
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dbname;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
projectService.getProjectAllStatus(project.dbName).success(function (org) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList = org;
projectService.getProjectStatus(project.dbName, project.id, vatSessionService.month)
.success(function (or1) {
if (or1.result) {
project.importSubStatus = or1.data.importSubStatus;
vatSessionService.project = project;
goRightPath(project);
}
});
})
}
});
}
//!!请把goRightPath()放在最内层的callback中,否则会在当前service没有执行完毕前就跳转到vat-layout.ctrl.js,
//从而造成一些bug
else {
vatSessionService.project = project;
goRightPath(project);
}
}
else {
SweetAlert.error($translate.instant('AddProjectFail'));
}
});
}
else {
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
goRightPath(project);
}
} else {
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dbname;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, vatSessionService.month, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
projectService.getProjectAllStatus(project.dbName).success(function (org) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList = org;
projectService.getProjectStatus(project.dbName, project.id, vatSessionService.month)
.success(function (or1) {
if (or1.result) {
project.importSubStatus = or1.data.importSubStatus;
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
goRightPath(project);
}
});
})
}
});
}
else {
vatSessionService.project = project;
if (project.serviceTypeID === enums.serviceType.CIT) {
citSessionService.year = $scope.currentSelectedYear;
citSessionService.project = project;
}
else { // project.serviceTypeID === enums.serviceType.CIT
if (project.haveCreateProject) {
if (_.isUndefined(project.projectStatusList[enums.wholeYearPeriod.import])) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, enums.wholeYearPeriod.import, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList[enums.wholeYearPeriod.import] = constant.ProjectStatusEnum.UnStarted;
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
});
}
else {
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
}
else {
SweetAlert.error($translate.instant('AddProjectFail'));
} else {
projectService.addProject(project).success(function (rsp) {
if (rsp && rsp.result) {
project.haveCreateProject = true;
project.dbName = rsp.dbname;
project.id = rsp.projectID;
if (_.isNull(project.projectStatusList)) { //如果当前期间还没有导入任何数据的话,就添加一条未开始状态的记录
projectService.setProjectStatus(project.dbName, enums.wholeYearPeriod.import, constant.ProjectStatusEnum.UnStarted)
.success(function (or) {
if (or.result) {
projectService.getProjectAllStatus(project.dbName).success(function (org) {
//添加完成后,在vatSessionService.project中添加新加入的数据
project.projectStatusList = org;
projectService.getProjectStatus(project.dbName, project.id, enums.wholeYearPeriod.import)
.success(function (or1) {
if (or1.result) {
project.importSubStatus = or1.data.importSubStatus;
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
});
})
}
});
}
else {
vatSessionService.project = citSessionService.project = project;
citSessionService.year = $scope.currentSelectedYear;
goRightPath(project);
}
}
else {
SweetAlert.error($translate.instant('AddProjectFail'));
}
});
}
}
$timeout(function () {
project.clicked = false;
}, 1000);
});
}
}
$timeout(function () {
project.clicked = false;
}, 1000);
});
}
};
};
$scope.toggleExpand = function (item) {
item.expand = !item.expand;
......
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