Commit 8b651d54 authored by neo's avatar neo

[dev] merger goserver

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