--抽取功能

Web_Manager_Develope
wu ming 8 years ago
parent aff4037514
commit 9768e31db1

2
defs.d.ts vendored

@ -37,7 +37,6 @@
/// <reference path="d.ts/developer/ts/projects.d.ts"/>
/// <reference path="d.ts/developer/ts/workspace.d.ts"/>
/// <reference path="d.ts/developer/ts/workspaces.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/apps.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/breadcrumbs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/build.d.ts"/>
@ -78,6 +77,7 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/system/ts/systemHelpers.d.ts"/>
/// <reference path="d.ts/system/ts/systemPlugin.d.ts"/>
/// <reference path="d.ts/system/ts/regionalismCodeSearch.d.ts"/>

File diff suppressed because one or more lines are too long

@ -248,8 +248,8 @@ gulp.task('connect', ['watch'], function() {
targetPath: '/hawtio/git'
}, {
proto: "http",
port: "8080",
hostname: "192.168.0.181",
port: "8088",
hostname: "192.168.0.110",
path: '/java/console/api',
targetPath: "/"
}];

@ -49,6 +49,9 @@ module Developer{
year: year
}
}
function createAlias(cityName:string, districtName:string, systemName:string, version:string, year:string){
return cityName + "_" + districtName + "_" + systemName + "_" + year + "_版本" + version;
}
function createKey(regionalismCode, systemId, version){
return regionalismCode + "-" + systemId + "-" + version;
}
@ -59,6 +62,15 @@ module Developer{
return result;
}
function createItemsAlias(items: Array<any>){
var result = [];
angular.forEach(items, (item) => {
item.alias = createAlias(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
result.push(item);
});
return result;
}
function populateLabel(item){
var result = item
result["labels"] = createLabel(item.cityName, item.districtName, item.systemName, item.dataVersion, item.year);
@ -166,6 +178,7 @@ module Developer{
this.data = populateKeys(this.data);
this.data = populateNames(this.data);
this.data = populateLabels(this.data);
this.data = createItemsAlias(this.data);
}
//更新用户选择参数

@ -65,6 +65,10 @@ module Developer {
return field.systemCode;
}
},
{
field: "dataBaseType",
displayName: '数据库类型',
},
{
field: "labels",
displayName: '数据标签',
@ -82,7 +86,7 @@ module Developer {
field: "extractStatus",
displayName: '汇总状态',
cellTemplate: $templateCache.get("dataExtractTemplate.html")
}
}
],
sortInfo: {
sortBy: "_key",
@ -183,7 +187,7 @@ module Developer {
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'id',
index: 'alias',
onClose: (result:boolean) => {
var idColl = [];
if (result) {
@ -269,10 +273,18 @@ module Developer {
}
};
$scope.createOracleService = (items) =>{
var exitedItems = Kubernetes.checkForCreateOracle($scope.model.transferTasks, items);
$scope.createOracleService = (items) =>{
var exitedItems = Kubernetes.checkForCreateOracle($scope.model.transferTasks, items);
for (var i = 0; i < items.length; ++i) {
// code...
if(items[i].dataBaseType != 'ORACLE'){
Configs.customAlert("提示", "操作失败: 非ORACLE数据不需要挂载启动", '', null, 0, "error");
return;
}
}
if(exitedItems.length == 0){
angular.forEach(items,(item)=>{
angular.forEach(items,(item)=>{
console.log(item);
var isExited = Kubernetes.checkForExit($scope.replicasModel.replicationControllers, item);
if(!isExited){
Kubernetes.createRC({
@ -288,7 +300,7 @@ module Developer {
systemName: item.systemName,
id: item.id+"",
year: item.year,
checkStatus: item.check
checkoutFlag: item.checkoutFlag
},
path: item.dataPath+"app/",
isTarget: "false",

@ -275,7 +275,10 @@
</script>
<script type="text/ng-template" id="dataCheckStatus.html">
<div class="ngCellText" ng-init="entity=row.entity">
<div class="ngCellText" ng-init="entity=row.entity">
<span ng-show="entity.metadata.annotations.checkoutFlag == 0">未校验</span>
<span ng-show="entity.metadata.annotations.checkoutFlag == 1">已校验</span>
<span ng-show="entity.metadata.annotations.checkoutFlag == 2">校验中</span>
</div>
</script>

@ -359,6 +359,10 @@ module Kubernetes {
replicationController.$oracleStatus = getOracleStatus(getLabels(replicationController));
replicationController.$extractStatus = getExtractStatus(getLabels(replicationController));
//
var annotation = getAnnotations(replicationController);
var label = getLabels(replicationController);
replicationController.$alias = annotation.cityName + "_" + annotation.districtName + "_" + annotation.systemName + "_" + annotation.year + "_" + label.version;
var selectedPods = replicationController.$pods;
replicationController.connectTo = selectedPods.map((pod) => {

@ -91,7 +91,7 @@ module Kubernetes {
if(extractItems.length == 0){
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'metadata.name',
index: '$alias',
onClose: (result:boolean) => {
if (result) {
function deleteSelected(selected:Array<KubePod>, next:KubePod) {
@ -156,7 +156,7 @@ module Kubernetes {
if(extractItems.length == 0){
UI.multiItemConfirmActionDialog(<UI.MultiItemConfirmActionOptions>{
collection: selected,
index: 'metadata.name',
index: '$alias',
onClose: (result:boolean) => {
if (result) {
function stopSelected(selected:Array<KubePod>, next:KubePod) {
@ -213,8 +213,7 @@ module Kubernetes {
/**
**/
$scope.extract = (selected) =>{
console.log(selected);
$scope.extract = (selected) =>{
var answer = false;
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
if(ConfigsModel.oracleParam[i].type == 1){

@ -118,7 +118,7 @@ module Kubernetes {
item: null,
open: (entity) => {
if(entity.status == 1)
Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能迁移", '',null, 0, "error");
Configs.customAlert("提示", "操作失败: 正在迁移的任务,不能删除", '',null, 0, "error");
else{
var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = true;

@ -27,7 +27,12 @@
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="check()">
<i class="glyphicon glyphicon-save"></i> 校验
</button>
</div>
</div>
<div class="row clear fr mr5">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="checkSQLSERVER()">
<i class="glyphicon glyphicon-save"></i> 抽取
</button>
</div>
</div>
<div class="col-md-12 clear">
<table ng-show="tableData.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped table_sj_td_center">
@ -40,8 +45,20 @@
</td>
<td title="'验证结果'">{{row.checkResult}}</td>
<td title="'采集'">{{row.collection}}</td>
<td title="'支付信息标准表'">{{row.payResultLast}}</td>
<td title="'可执行标准表'">{{row.execResultLast}}</td>
<td title="'支付信息标准表'">
<span ng-show="row.payResultLast == 0">未校验</span>
<span ng-show="row.payResultLast == 1">不需校验</span>
<span ng-show="row.payResultLast == 2">校验中</span>
<span ng-show="row.payResultLast == 3">标准表存在</span>
<span ng-show="row.payResultLast == 4">标准表不存在</span>
</td>
<td title="'可执行标准表'">
<span ng-show="row.execResultLast == 0">未校验</span>
<span ng-show="row.execResultLast == 1">不需校验</span>
<span ng-show="row.execResultLast == 2">校验中</span>
<span ng-show="row.execResultLast == 3">标准表存在</span>
<span ng-show="row.execResultLast == 4">标准表不存在</span>
</td>
<td title="'市'">{{row.cityName}}</td>
<td title="'区/县'">{{row.districtName}}</td>
<td title="'行政区划代码'">{{row.areaCode}}</td>

@ -66,6 +66,60 @@ module System{
}
}
$scope.checkSQLSERVER = () => {
/**
**
**/
var answer = false;
for (var i = 0; i < ConfigsModel.oracleParam.length; ++i) {
if(ConfigsModel.oracleParam[i].type == 1){
answer = true
break;
}
}
if(answer == false){
/**
**/
Configs.customAlert("提示", "操作失败:没有配置默认的标准表汇总库", '',null, 0, "error");
return;
}
var selectedItems = [];
if($scope.tableData && $scope.tableData.length > 0){
for (var i = 0; i < $scope.tableData.length; ++i) {
var item = $scope.tableData[i];
if($scope.checkboxes.items[item.id]){
if(item.collection == '否'){
/*
**
code
*/
Configs.customAlert("提示", "操作失败:选择的系统存在没有数据的系统", '',null, 0, "error");
return;
}
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
if(item.dataBaseType == 'ORACLE'){
Configs.customAlert("提示", "操作失败:ORACLE数据请在服务集群界面中抽取标准表", '',null, 0, "error");
return;
}
selectedItems.push(item);
}
}
$http({
url: "/java/console/api/checkout/extractList",
method: "POST",
data: selectedItems
}).success((data, header, config, status) => {
//console.log(data);
}).error((data, header, config, status) => {
throw "请求失败"
});
}
}
$scope.deleteRows = () =>{
var filter = [];
if($scope.tableData && $scope.tableData.length > 0){
@ -99,8 +153,9 @@ module System{
}
$scope.check = () => {
var sqlServerDB = [];
//var sqlServerDB = [];
var oracleDB = [];
var selectedItems = [];
/**
**
**/
@ -132,25 +187,26 @@ module System{
return;
}
item["_key"] = item.areaCode + "-" + item.sysCode + "-" + item.dataVersion;
selectedItems.push(item);
if(item.dataBaseType == 'ORACLE'){
oracleDB.push(item);
}else{
sqlServerDB.push(item);
}
}
}
if(oracleDB.length >= 0){
/*
*/
var exitedOracle = Kubernetes.checkForCreateOracle(DataModel.transferTasks, oracleDB);
var exitedSqlServer = Kubernetes.checkForCreateOracle(DataModel.transferTasks, sqlServerDB);
if(exitedSqlServer.length > 0 || exitedOracle.length > 0){
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能执行校验操作!", '', null, 0, "error");
return;
}
/*
*/
var exited = Kubernetes.checkForCreateOracle(DataModel.transferTasks, selectedItems);
if(exited.length > 0 ){
Configs.customAlert("提示", "操作失败: 正在迁移的数据不能执行校验操作!", '', null, 0, "error");
return;
}
/*
Oracleoracle
*/
if(oracleDB.length >= 0){
angular.forEach(oracleDB, (item) =>{
Kubernetes.createRC({
name: item._key,
@ -164,13 +220,14 @@ module System{
districtName: item.districtName,
systemName: item.sysName,
id: item.dataId+"",
year: item.year
year: item.year,
checkoutFlag: item.checkoutFlag
},
path: item.dataPath+"app/",
path: item.path+"app/",
isTarget: "false",
isExtract: item.extractStatus
}, (rc) =>{
Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", rc, 0);
//Kubernetes.connectOracle($http, $timeout, "/java/console/api/connectOracle", "create", rc, 0);
});
});
$timeout(() => {
@ -181,8 +238,9 @@ module System{
$http({
url: "/java/console/api/checkout/checkList",
method: "POST",
data: oracleDB
}).success((data, header, config, status) => {
data: selectedItems
}).success((data, header, config, status) => {
console.log(data);
/*$scope.tableData = data.data;
var result = [];
if($scope.y != 'all'){

Loading…
Cancel
Save