提交 ae6deb42 编写于 作者: ibizdev's avatar ibizdev

chitanda 部署微服务应用 [TrainSys,网页端]

上级 46816b45
import { IPSDEAppendParamLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppDeLogicAppendParamNode extends AppDeLogicNodeBase {
this.onAppendParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEBindParamLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppDeLogicBindParamNode extends AppDeLogicNodeBase {
this.onBindParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDECopyParamLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppDeLogicCopyParamNode extends AppDeLogicNodeBase {
this.onCopyParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { getDstPSAppDEAction, IPSDEDEActionLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { AppDeLogicNodeBase } from './logic-node-base';
import { ActionContext } from '../action-context';
import { LogUtil, Util } from '../../../../utils';
import { Util } from '../../../../utils';
import { LogicParamType } from '../const/logic-param-type';
import { DataServiceHelp } from '../../data-service-help';
......@@ -30,7 +30,7 @@ export class AppDeLogicDeActionNode extends AppDeLogicNodeBase {
await this.handleDEAction(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -106,7 +106,7 @@ export class AppDeLogicDeActionNode extends AppDeLogicNodeBase {
}
}
} catch (error: any) {
throw new Error(`${error.message ? error.message : '执行实体行为失败'}`);
throw new Error(`${error.message ? error.message : error.data?.message ? error.data.message : '执行实体行为失败'}`);
}
} else {
throw new Error(`执行实体行为所需参数不足`);
......
import { IPSDEDEDataSetLogic } from "@ibiz/dynamic-model-api";
import { LogUtil } from "../../../../utils";
import { DataServiceHelp } from "../../data-service-help";
import { ActionContext } from "../action-context";
import { LogicParamType } from "../const/logic-param-type";
......@@ -31,7 +30,7 @@ export class AppDeDataSetNode extends AppDeLogicNodeBase {
await this.handleDataSet(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -67,7 +66,7 @@ export class AppDeDataSetNode extends AppDeLogicNodeBase {
throw new Error(`查询实体数据集失败`);
}
} catch (error: any) {
throw new Error(`查询实体数据集失败`);
throw new Error(`${error.message ? error.message : error.data?.message ? error.data.message : '查询实体数据集失败'}`);
}
} else {
throw new Error(`查询实体数据集参数不足`);
......
......@@ -35,7 +35,7 @@ export class AppDeEndNode extends AppDeLogicNodeBase {
}
return { nextNodes: [], actionContext };
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
......@@ -30,7 +30,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
this.handleParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -45,7 +45,8 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
if (!logicNode || !logicNode.getPSDELogicNodeParams()) {
return;
}
for (let logicNodeParam of (logicNode.getPSDELogicNodeParams() as IPSDELogicNodeParam[])) {
try {
for (let logicNodeParam of (logicNode.getPSDELogicNodeParams() as IPSDELogicNodeParam[])) {
// 设置变量
if (Object.is(logicNodeParam.paramAction, LogicParamValueType.SETPARAMVALUE)) {
this.onSetParamValue(logicNodeParam, actionContext);
......@@ -74,6 +75,9 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
if (Object.is(logicNodeParam.paramAction, LogicParamValueType.SORTPARAM)) {
this.onSortParam(logicNodeParam, actionContext);
}
}
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -85,6 +89,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onSetParamValue(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 源类型参数/目标逻辑参数/目标属性缺一跳过不做处理
if (!logicNodeParam.getDstPSDELogicParam() || !logicNodeParam.dstFieldName || !logicNodeParam.srcValueType) {
throw new Error(`逻辑参数${logicNodeParam.name}源类型参数、目标属性或者目标逻辑参数缺失`);
......@@ -98,6 +103,9 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
const result = this.computeTargetParam(logicNodeParam, actionContext);
dstParam.set(logicNodeParam.dstFieldName.toLowerCase(), result);
}
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -108,9 +116,13 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onResetParam(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 目标数据
const dstParam: any = actionContext.getParam((logicNodeParam.getDstPSDELogicParam() as IPSDELogicParam)?.codeName);
dstParam.resetAll();
} catch (error: any) {
throw new Error(`逻辑参数${logicNodeParam.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -121,6 +133,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onBindParam(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 源数据
const srcParam: any = actionContext.getParam((logicNodeParam.getSrcPSDELogicParam() as IPSDELogicParam)?.codeName);
// 目标数据
......@@ -132,6 +145,9 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
} else {
dstParam.bind(srcParam.getReal());
}
} catch (error: any) {
throw new Error(`逻辑参数${logicNodeParam.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -142,11 +158,15 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onCopyParam(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 源数据
const srcParam: any = actionContext.getParam((logicNodeParam.getSrcPSDELogicParam() as IPSDELogicParam)?.codeName);
// 目标数据
const dstParam: any = actionContext.getParam((logicNodeParam.getDstPSDELogicParam() as IPSDELogicParam)?.codeName);
srcParam.copyTo(dstParam);
} catch (error: any) {
throw new Error(`逻辑参数${logicNodeParam.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -157,9 +177,13 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onRenewParam(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 目标参数
const dstParam: any = actionContext.getParam((logicNodeParam.getDstPSDELogicParam() as IPSDELogicParam)?.codeName);
dstParam.renew();
} catch (error: any) {
throw new Error(`逻辑参数${logicNodeParam.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -170,6 +194,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onAppendParam(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 源数据
const srcParam: any = actionContext.getParam((logicNodeParam.getSrcPSDELogicParam() as IPSDELogicParam)?.codeName);
// 目标数据
......@@ -184,6 +209,9 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
objParam = srcParam.getReal();
}
dstParam.append(logicNodeParam.dstIndex, objParam, logicNodeParam.srcIndex, logicNodeParam.srcSize);
} catch (error: any) {
throw new Error(`逻辑参数${logicNodeParam.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -194,6 +222,7 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
* @memberof AppDeLogicPrepareParamNode
*/
public onSortParam(logicNodeParam: IPSDELogicNodeParam, actionContext: ActionContext) {
try {
// 目标数据
const dstParam: any = actionContext.getParam((logicNodeParam.getDstPSDELogicParam() as IPSDELogicParam)?.codeName);
// 目标属性
......@@ -202,6 +231,9 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
throw new Error(`逻辑参数${logicNodeParam.name}未指定设置排序属性`);
}
dstParam.sort(dstFieldName, logicNodeParam.dstSortDir);
} catch (error: any) {
throw new Error(`逻辑参数${logicNodeParam.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -217,7 +249,8 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
const srcParam: any = actionContext.getParam((logicNodeParam.getSrcPSDELogicParam() as IPSDELogicParam)?.codeName);
// 源属性
const srcFieldName: string = logicNodeParam?.srcFieldName?.toLowerCase();
switch (logicNodeParam.srcValueType) {
try {
switch (logicNodeParam.srcValueType) {
case "SRCDLPARAM": // 源逻辑参数
targetValue = srcParam.get(srcFieldName) ? srcParam.get(srcFieldName) : srcParam;
break;
......@@ -247,8 +280,11 @@ export class AppDeLogicPrepareParamNode extends AppDeLogicNodeBase {
break;
default:
throw new Error(`逻辑参数${logicNodeParam.name}源值类型${logicNodeParam.srcValueType}暂未支持`);
}
return targetValue;
}
return targetValue;
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......
import { IPSDERawCodeLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppRawsfcodeNode extends AppDeLogicNodeBase {
this.handleRawCode(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDERenewParamLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppDeLogicReNewParamNode extends AppDeLogicNodeBase {
this.onRenewParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEResetParamLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppDeLogicResetParamNode extends AppDeLogicNodeBase {
this.onResetParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDESortParamLogic, IPSDELogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil } from '../../../../utils';
import { ActionContext } from '../action-context';
import { AppDeLogicNodeBase } from './logic-node-base';
......@@ -28,7 +27,7 @@ export class AppDeLogicSortParamNode extends AppDeLogicNodeBase {
this.onSortParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
......@@ -54,6 +54,7 @@ export class AppDeLogicService {
* @memberof AppDeLogicService
*/
public async onExecute(logic: IPSAppDELogic, context: IContext, data: IParams) {
try {
let actionContext = await this.beforeExecute(logic, context, data);
// 自定义脚本代码
if (logic && logic.customCode) {
......@@ -75,17 +76,19 @@ export class AppDeLogicService {
}
return data;
} else {
LogUtil.warn('自定义代码不能为空');
throw new Error('自定义代码不能为空');
}
} else {
let startNode: IPSDELogicNode | null = logic.getStartPSDELogicNode();
if (!startNode) {
LogUtil.warn('没有开始节点');
return data;
throw new Error('没有开始节点');
}
await this.executeNode(startNode, actionContext);
return actionContext.getResult();
}
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -97,7 +100,8 @@ export class AppDeLogicService {
*/
public async executeNode(logicNode: any, actionContext: ActionContext) {
let result: any = { actionContext };
switch (logicNode.logicNodeType) {
try {
switch (logicNode.logicNodeType) {
// 开始节点
case 'BEGIN':
result = await new AppDeLogicBeginNode().executeNode(logicNode, actionContext);
......@@ -148,10 +152,13 @@ export class AppDeLogicService {
break;
default:
console.log(`${logicNode.logicNodeType}暂未支持`);
}
// 有后续节点时继续递归,反之返回值。
if (result && (result.nextNodes?.length > 0)) {
await this.executeNextNodes(result.nextNodes, actionContext);
}
// 有后续节点时继续递归,反之返回值。
if (result && (result.nextNodes?.length > 0)) {
await this.executeNextNodes(result.nextNodes, actionContext);
}
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
......@@ -35,7 +35,8 @@ export class AppDEUIAction {
public async executeDEUILogic(args: any[], context: any = {}, params: any = {},
$event?: any, xData?: any, actionContext?: any, srfParentDeName?: string) {
// 识别面板项按钮执行界面逻辑
if (Object.is(this.actionModel.uILogicType, 'DEUILOGIC') || Object.is(this.actionModel.uILogicType, 'DELOGIC')) {
try {
if (Object.is(this.actionModel.uILogicType, 'DEUILOGIC') || Object.is(this.actionModel.uILogicType, 'DELOGIC')) {
const appDEUILogic = await getPSAppDEUILogicByModelObject(this.actionModel);
if (appDEUILogic) {
let data = null;
......@@ -48,8 +49,11 @@ export class AppDEUIAction {
} else {
LogUtil.warn('未找到实体界面处理逻辑对象');
}
} else {
LogUtil.warn('未实现应用界面处理逻辑');
} else {
LogUtil.warn('未实现应用界面处理逻辑');
}
} catch (error: any) {
actionContext.$throw(`${error?.message ? error.message : '发生未知错误!'}`)
}
}
......
import { IPSDEUILogicParam, IPSDEUIAppendParamLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicAppendParamNode extends AppUILogicNodeBase {
this.onAppendParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUILogicParam, IPSDEUIBindParamLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicBindParamNode extends AppUILogicNodeBase {
this.onBindParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUILogicParam, IPSDEUICopyParamLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicCopyParamNode extends AppUILogicNodeBase {
this.onCopyParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { getDstPSAppDEAction, IPSDEUIDEActionLogic, IPSDEUILogicParam } from '@ibiz/dynamic-model-api';
import { DataServiceHelp, LogUtil, Util } from 'ibiz-core';
import { DataServiceHelp, Util } from 'ibiz-core';
import { UILogicParamType } from '../const/ui-logic-param-type';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
......@@ -27,7 +27,7 @@ export class AppUILogicDeactionNode extends AppUILogicNodeBase {
await this.handleDEAction(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -103,7 +103,7 @@ export class AppUILogicDeactionNode extends AppUILogicNodeBase {
}
}
} catch (error: any) {
throw new Error(`${error.message ? error.message : '执行实体行为失败'}`);
throw new Error(`${error.message ? error.message : error.data?.message ? error.data.message : '执行实体行为失败'}`);
}
} else {
throw new Error(`执行实体行为所需参数不足`);
......
......@@ -26,7 +26,7 @@ export class AppUILogicDebugParamNode extends AppUILogicNodeBase {
this.handleDebugParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -40,7 +40,6 @@ export class AppUILogicDebugParamNode extends AppUILogicNodeBase {
*/
private handleDebugParam(logicNode: IPSDEUIDebugParamLogic, actionContext: UIActionContext) {
if (logicNode.getDstPSDEUILogicParam()) {
debugger;
const dstParamValue = actionContext.getParam(logicNode.getDstPSDEUILogicParam()?.codeName as string).getReal();
actionContext.bindLastReturnParam(null);
LogUtil.log(`逻辑节点${logicNode.name}操作参数值:`, dstParamValue);
......
import { IPSDEUIDEDataSetLogic } from "@ibiz/dynamic-model-api";
import { DataServiceHelp, LogUtil } from "ibiz-core";
import { DataServiceHelp } from "ibiz-core";
import { UILogicParamType } from "../const/ui-logic-param-type";
import { UIActionContext } from "../uiaction-context";
import { AppUILogicNodeBase } from "./logic-node-base";
......@@ -31,7 +31,7 @@ export class AppDeUIDataSetNode extends AppUILogicNodeBase {
await this.handleDataSet(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......@@ -67,7 +67,7 @@ export class AppDeUIDataSetNode extends AppUILogicNodeBase {
throw new Error(`查询实体数据集失败`);
}
} catch (error: any) {
throw new Error(`查询实体数据集失败`);
throw new Error(`${error.message ? error.message : error.data?.message ? error.data.message : '查询实体数据集失败'}`);
}
} else {
throw new Error(`查询实体数据集参数不足`);
......
import { getDstPSAppDEAction, IPSDEUIDELogicLogic, IPSDEUILogicParam } from '@ibiz/dynamic-model-api';
import { DataServiceHelp, LogUtil } from 'ibiz-core';
import { IPSDEUIDELogicLogic, IPSDEUILogicParam } from '@ibiz/dynamic-model-api';
import { DataServiceHelp } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +26,7 @@ export class AppUILogicDeLogicNode extends AppUILogicNodeBase {
await this.handleDELogic(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUIActionLogic, getDstPSAppDEUIAction, IPSDEUILogicParam } from '@ibiz/dynamic-model-api';
import { LogUtil, UIServiceHelp } from 'ibiz-core';
import { UIServiceHelp } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +26,7 @@ export class AppUILogicDeUIActionNode extends AppUILogicNodeBase {
await this.handleDEUIAction(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext)
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
......@@ -33,7 +33,7 @@ export class AppUILogicEndNode extends AppUILogicNodeBase {
}
return { nextNodes: [], actionContext };
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUILogicParam, IPSDEUIMsgBoxLogic } from '@ibiz/dynamic-model-api';
import { Subject } from 'rxjs';
import { LogUtil } from 'ibiz-core';
import { AppMessageBoxService } from '../../../app-service';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
......@@ -46,7 +45,7 @@ export class AppUILogicMsgboxNode extends AppUILogicNodeBase {
})
});
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
......@@ -22,6 +22,6 @@ export class AppUILogicPluginNode extends AppUILogicNodeBase {
* @memberof AppUILogicPluginNode
*/
public async executeNode(logicNode: IPSDEUIPFPluginLogic, actionContext: UIActionContext) {
LogUtil.error(`逻辑节点${logicNode.name}前端扩展插件类型暂未实现!`);
throw new Error(`逻辑节点${logicNode.name}前端扩展插件类型暂未实现!`);
}
}
\ No newline at end of file
import { IPSDEUIRawCodeLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicRawCodeNode extends AppUILogicNodeBase {
this.handleRawCode(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUILogicParam, IPSDEUIRenewParamLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicReNewParamNode extends AppUILogicNodeBase {
this.onRenewParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUILogicParam, IPSDEUIResetParamLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicResetParamNode extends AppUILogicNodeBase {
this.onResetParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUILogicParam, IPSDEUISortParamLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicSortParamNode extends AppUILogicNodeBase {
this.onSortParam(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUICtrlFireEventLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicViewctrlFireEventNode extends AppUILogicNodeBase {
await this.handleViewCtrFireEvent(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
import { IPSDEUICtrlInvokeLogic } from '@ibiz/dynamic-model-api';
import { LogUtil } from 'ibiz-core';
import { UIActionContext } from '../uiaction-context';
import { AppUILogicNodeBase } from './logic-node-base';
/**
......@@ -26,7 +25,7 @@ export class AppUILogicViewctrlInvokeNode extends AppUILogicNodeBase {
await this.handleViewCtrlInvoke(logicNode, actionContext);
return this.computeNextNodes(logicNode, actionContext);
} catch (error: any) {
LogUtil.error(`逻辑节点${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
throw new Error(`逻辑节点 ${logicNode.name}${error?.message ? error?.message : '发生未知错误!'}`);
}
}
......
......@@ -83,15 +83,18 @@ export class AppUILogicService {
*/
public async onExecute(logic: any, args: any, context: any = {}, params: any = {},
$event?: any, xData?: any, actioncontext?: any, srfParentDeName?: string) {
try {
let actionContext = await this.beforeExecute(logic, args, context, params, $event, xData, actioncontext, srfParentDeName);
let startNode: any | null = logic.getStartPSDEUILogicNode();
if (!startNode) {
LogUtil.warn('没有开始节点');
return;
throw new Error('没有开始节点');
}
LogUtil.log(`${logic.name}逻辑开始执行`);
await this.executeNode(startNode, actionContext);
return actionContext.getResult();
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......@@ -102,91 +105,95 @@ export class AppUILogicService {
* @memberof AppUILogicService
*/
public async executeNode(logicNode: any, actionContext: UIActionContext) {
let result: any = { actionContext };
let result: any = { actionContext };
try {
switch (logicNode.logicNodeType) {
// 开始节点
case 'BEGIN':
// 开始节点
case 'BEGIN':
result = await new AppUILogicBeginNode().executeNode(logicNode, actionContext);
break;
// 准备参数节点
case 'PREPAREJSPARAM':
// 准备参数节点
case 'PREPAREJSPARAM':
result = await new AppUILogicPrepareParamNode().executeNode(logicNode, actionContext);
break;
// 重置参数节点
case 'RESETPARAM':
// 重置参数节点
case 'RESETPARAM':
result = await new AppUILogicResetParamNode().executeNode(logicNode, actionContext);
break;
// 拷贝参数
case 'COPYPARAM':
// 拷贝参数
case 'COPYPARAM':
result = await new AppUILogicCopyParamNode().executeNode(logicNode, actionContext);
break;
// 绑定参数
case 'BINDPARAM':
// 绑定参数
case 'BINDPARAM':
result = await new AppUILogicBindParamNode().executeNode(logicNode, actionContext);
break;
// 重新建立参数
case 'RENEWPARAM':
// 重新建立参数
case 'RENEWPARAM':
result = await new AppUILogicReNewParamNode().executeNode(logicNode, actionContext);
break;
// 调用实体界面行为
case 'DEUIACTION':
// 调用实体界面行为
case 'DEUIACTION':
result = await new AppUILogicDeUIActionNode().executeNode(logicNode, actionContext);
break;
// 行为处理节点
case 'DEACTION':
// 行为处理节点
case 'DEACTION':
result = await new AppUILogicDeactionNode().executeNode(logicNode, actionContext);
break;
// 实体处理逻辑
case 'DELOGIC':
// 实体处理逻辑
case 'DELOGIC':
result = await new AppUILogicDeLogicNode().executeNode(logicNode, actionContext);
break;
// 实体数据集
case 'DEDATASET':
// 实体数据集
case 'DEDATASET':
result = await new AppDeUIDataSetNode().executeNode(logicNode, actionContext);
break;
// 附加到数组参数
case 'APPENDPARAM':
// 附加到数组参数
case 'APPENDPARAM':
result = await new AppUILogicAppendParamNode().executeNode(logicNode, actionContext);
break;
// 排序数组参数
case 'SORTPARAM':
// 排序数组参数
case 'SORTPARAM':
result = await new AppUILogicSortParamNode().executeNode(logicNode, actionContext);
break;
// 视图部件调用
case 'VIEWCTRLINVOKE':
// 视图部件调用
case 'VIEWCTRLINVOKE':
result = await new AppUILogicViewctrlInvokeNode().executeNode(logicNode, actionContext);
break;
// 视图部件事件触发
case 'VIEWCTRLFIREEVENT':
// 视图部件事件触发
case 'VIEWCTRLFIREEVENT':
result = await new AppUILogicViewctrlFireEventNode().executeNode(logicNode, actionContext);
break;
// 调试逻辑参数
case 'DEBUGPARAM':
// 调试逻辑参数
case 'DEBUGPARAM':
result = await new AppUILogicDebugParamNode().executeNode(logicNode, actionContext);
break;
// 消息弹窗
case 'MSGBOX':
// 消息弹窗
case 'MSGBOX':
result = await new AppUILogicMsgboxNode().executeNode(logicNode, actionContext);
break;
// 前端代码
case 'RAWJSCODE':
// 前端代码
case 'RAWJSCODE':
result = await new AppUILogicRawCodeNode().executeNode(logicNode, actionContext);
break;
// 异常处理
case 'THROWEXCEPTION':
// 异常处理
case 'THROWEXCEPTION':
result = await new AppUILogicThrowExceptionNode().executeNode(logicNode, actionContext);
break;
// 结束
case 'END':
// 结束
case 'END':
result = await new AppUILogicEndNode().executeNode(logicNode, actionContext);
break;
default:
default:
console.log(`${logicNode.logicNodeType}暂未支持`);
}
// 有后续节点时继续递归,反之返回,抛异常无返回值
if (result && result.nextNodes && (result.nextNodes?.length > 0)) {
await this.executeNextNodes(result.nextNodes, actionContext);
await this.executeNextNodes(result.nextNodes, actionContext);
}
} catch (error: any) {
throw new Error(`${error?.message ? error?.message : '发生未知错误!'}`);
}
}
/**
......
......@@ -55,12 +55,15 @@
git clone -b master $para2 trainsys/
export NODE_OPTIONS=--max-old-space-size=4096
cd trainsys/
mvn clean package -Ptrainsys
mvn install -Ptrainsys
cd trainsys-provider
mvn -Ptrainsys docker:build
mvn -Ptrainsys docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/trainsys-provider-trainsys.yaml ebsx --with-registry-auth
mkdir -p /var/lib/jenkins/appcache/A3064A91-F42D-4D7F-BC1C-4173A4F5772C
if [ -e app_Web/.dynamic ]
then
cd app_Web
else
cd app_Web/app
fi
sed -i "s#dstimage#registry.cn-shanghai.aliyuncs.com/ibizsys/ibizcloud-standardsys-app-webapp:2022.07.29.003#g" swarm.yaml
docker -H $para1 stack deploy --compose-file=swarm.yaml ebsx --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -74,6 +74,25 @@
</createTable>
</changeSet>
<!--输出实体[RAWMATERIAL]数据结构 -->
<changeSet author="root" id="tab-rawmaterial-9-4">
<createTable tableName="T_RAWMATERIAL">
<column name="RAWMATERIALID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_RAWMATERIAL"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="RAWMATERIALNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
</createTable>
</changeSet>
<!--输出实体[REGINFO]数据结构 -->
<changeSet author="root" id="tab-reginfo-34-5">
<createTable tableName="T_REGINFO">
......
......@@ -174,6 +174,14 @@
},
"builtinAction" : true
} ],
"getAllPSDEDBConfigs" : [ {
"dBType" : "MYSQL5",
"name" : "MYSQL5",
"objNameCase" : "DEFAULT",
"standardTableName" : "`T_RAWMATERIAL`",
"tableName" : "T_RAWMATERIAL",
"valid" : true
} ],
"getAllPSDEDBTables" : [ {
"getAllPSDEFields" : [ {
"name" : "RAWMATERIALID",
......
......@@ -34,7 +34,7 @@
<profiles>
<profile>
<id>trainsys</id>
<id>runtime</id>
<build>
<resources>
<resource>
......
......@@ -10,6 +10,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /trainsys-provider.jar
EXPOSE 50000
EXPOSE 8081
ADD trainsys-provider.jar /trainsys-provider.jar
......@@ -22,32 +22,7 @@ spec:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/trainsys-provider:latest
imagePullPolicy: Always
ports:
- containerPort: 50000
env:
- name: SPRING_CLOUD_NACOS_DISCOVERY_IP
value: "172.16.240.140"
- name: SERVER_PORT
value: "50000"
- name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value: "172.16.240.140:8848"
- name: SPRING_REDIS_HOST
value: "127.0.0.1"
- name: SPRING_REDIS_PORT
value: "6379"
- name: SPRING_REDIS_DATABASE
value: "0"
- name: SPRING_DATASOURCE_USERNAME
value: "a_LAB01_d23cc850e"
- name: SPRING_DATASOURCE_PASSWORD
value: "f9Df4556"
- name: SPRING_DATASOURCE_URL
value: "jdbc:mysql://172.16.186.185:3306/a_LAB01_d23cc850e?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&serverTimezone=GMT%2B8"
- name: SPRING_DATASOURCE_DRIVER-CLASS-NAME
value: "com.mysql.jdbc.Driver"
- name: SPRING_DATASOURCE_DEFAULTSCHEMA
value: "a_LAB01_d23cc850e"
- name: NACOS
value: "172.16.240.140:8848"
- containerPort: 8081
---
apiVersion: v1
......@@ -60,9 +35,9 @@ spec:
type: NodePort
ports:
- name: http
port: 50000
targetPort: 50000
nodePort: 50000
port: 8081
targetPort: 8081
nodePort: 8081
protocol: TCP
selector:
app: trainsys-provider
......
......@@ -3,23 +3,9 @@ services:
trainsys-provider:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/trainsys-provider:latest
ports:
- "50000:50000"
- "8081:8081"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.140
- SERVER_PORT=50000
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.140:8848
- SPRING_CLOUD_NACOS_CONFIG_SERVER-ADDR=172.16.240.140:8848
- SPRING_REDIS_HOST=127.0.0.1
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_d23cc850e
- SPRING_DATASOURCE_PASSWORD=f9Df4556
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_d23cc850e?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&serverTimezone=GMT%2B8
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_d23cc850e
- NACOS=172.16.240.140:8848
deploy:
resources:
limits:
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册