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

chitanda 发布系统代码 [TrainSys,网页端]

上级 fba5ad13
流水线 #3283 已取消 ,包含阶段
......@@ -37,6 +37,121 @@ export class RawMaterialBaseService extends EntityBaseService<IRawMaterial> {
return new RawMaterial(data);
}
/**
* Create
*
* @param {*} [_context={}]
* @param {*} [_data = {}]
* @returns {Promise<HttpResponse>}
* @memberof RawMaterialService
*/
async Create(_context: any = {}, _data: any = {}): Promise<HttpResponse> {
try {
_data = await this.beforeExecuteAction(_context,_data,'Create');
if (!_data.srffrontuf || _data.srffrontuf != 1) {
_data[this.APPDEKEY] = null;
}
if (_data.srffrontuf != null) {
delete _data.srffrontuf;
}
_data = await RawMaterialDTOHelp.get(_context,_data);
const res = await this.http.post(`/rawmaterials`, _data);
res.data = await RawMaterialDTOHelp.set(_context,res.data);
return res;
} catch (error) {
return this.handleResponseError(error);
}
}
/**
* Get
*
* @param {*} [_context={}]
* @param {*} [_data = {}]
* @returns {Promise<HttpResponse>}
* @memberof RawMaterialService
*/
async Get(_context: any = {}, _data: any = {}): Promise<HttpResponse> {
try {
const res = await this.http.get(`/rawmaterials/${encodeURIComponent(_context.rawmaterial)}`, _data);
res.data = await RawMaterialDTOHelp.set(_context,res.data);
res.data = await this.afterExecuteAction(_context,res?.data,'Get');
return res;
} catch (error) {
return this.handleResponseError(error);
}
}
/**
* GetDraft
*
* @param {*} [_context={}]
* @param {*} [_data = {}]
* @returns {Promise<HttpResponse>}
* @memberof RawMaterialService
*/
async GetDraft(_context: any = {}, _data: any = {}): Promise<HttpResponse> {
try {
_data[this.APPDENAME?.toLowerCase()] = undefined;
_data[this.APPDEKEY] = undefined;
const res = await this.http.get(`/rawmaterials/getdraft`, _data);
res.data = await RawMaterialDTOHelp.set(_context,res.data);
return res;
} catch (error) {
return this.handleResponseError(error);
}
}
/**
* Remove
*
* @param {*} [_context={}]
* @param {*} [_data = {}]
* @returns {Promise<HttpResponse>}
* @memberof RawMaterialService
*/
async Remove(_context: any = {}, _data: any = {}): Promise<HttpResponse> {
try {
const res = await this.http.delete(`/rawmaterials/${encodeURIComponent(_context.rawmaterial)}`, _data);
return res;
} catch (error) {
return this.handleResponseError(error);
}
}
/**
* Update
*
* @param {*} [_context={}]
* @param {*} [_data = {}]
* @returns {Promise<HttpResponse>}
* @memberof RawMaterialService
*/
async Update(_context: any = {}, _data: any = {}): Promise<HttpResponse> {
try {
_data = await this.beforeExecuteAction(_context,_data,'Update');
_data = await RawMaterialDTOHelp.get(_context,_data);
const res = await this.http.put(`/rawmaterials/${encodeURIComponent(_context.rawmaterial)}`, _data);
res.data = await RawMaterialDTOHelp.set(_context,res.data);
return res;
} catch (error) {
return this.handleResponseError(error);
}
}
/**
* FetchDefault
*
* @param {*} [_context={}]
* @param {*} [_data = {}]
* @returns {Promise<HttpResponse>}
* @memberof RawMaterialService
*/
async FetchDefault(_context: any = {}, _data: any = {}): Promise<HttpResponse> {
try {
const res = await this.http.post(`/rawmaterials/fetchdefault`, _data);
res.data = await RawMaterialDTOHelp.ToDataObjArray(_context,res.data);
res.data = await this.afterExecuteActionBatch(_context,res?.data,'FetchDefault');
return res;
} catch (error) {
return this.handleResponseError(error);
}
}
/**
* Select
*
......
......@@ -3,7 +3,7 @@ services:
trainsys-app-web:
image: dstimage
ports:
- "50100:80"
- "80:80"
networks:
- agent_network
deploy:
......
......@@ -16,4 +16,4 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
yarn start:prod
EXPOSE 50100
\ No newline at end of file
EXPOSE 8080
\ No newline at end of file
......@@ -3,16 +3,9 @@ services:
trainsys-app-web:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/trainsys-app-web:latest
ports:
- "50100:50100"
- "8080:8080"
networks:
- agent_network
environment:
- NACOS_DISCOVERY_IP=172.16.240.140
- APPLICATION_PORT=50100
- NACOS_SERVER_ADDR=127.0.0.1:8848
- REDIS_HOST=127.0.0.1
- REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
deploy:
resources:
limits:
......
......@@ -7,6 +7,119 @@ import { Environment } from '@/environment';
export class RawMaterialController extends ControllerBase {
protected readonly http: NetService = new NetService('rawmaterial');
@Post('/rawmaterials')
async create(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Body() body: any,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/create`;
this.callAPI(request, response, url, body);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.post(request, response, url, body);
return this.parseResponse(request, response, res);
}
@Get('/rawmaterials/:rawmaterial')
async get(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Param('rawmaterial') rawmaterial: string,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/get/${encodeURIComponent(rawmaterial)}`;
this.callAPI(request, response, url);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.get(request, response, url);
return this.parseResponse(request, response, res);
}
@Delete('/rawmaterials/:rawmaterial')
async remove(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Param('rawmaterial') rawmaterial: string,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/remove/${encodeURIComponent(rawmaterial)}`;
this.callAPI(request, response, url);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.delete(request, response, url);
return this.parseResponse(request, response, res);
}
@Put('/rawmaterials/:rawmaterial')
async update(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Param('rawmaterial') rawmaterial: string,
@Body() body: any,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/update/${encodeURIComponent(rawmaterial)}`;
this.callAPI(request, response, url, body);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.put(request, response, url, body);
return this.parseResponse(request, response, res);
}
@Post('/rawmaterials/checkkey')
async checkKey(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Body() body: any,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/checkkey`;
this.callAPI(request, response, url, body);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.post(request, response, url, body);
return this.parseResponse(request, response, res);
}
@Get('/rawmaterials/getdraft')
async getDraft(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Body() body: any,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/getdraft`;
this.callAPI(request, response, url);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.get(request, response, url);
return this.parseResponse(request, response, res);
}
@Post('/rawmaterials/fetchdefault')
async fetchDefault(
@Req() request: FastifyRequest,
@Res() response: FastifyReply,
@Body() body: any,
): Promise<any> {
if (Environment.EnableRuntime) {
const url = `/rawmaterial/fetchdefault`;
this.callFetchAPI(request, response, url, body);
return;
}
const url = this.parseUrl(request.url);
const res = await this.http.post(request, response, url, body);
return this.parseResponse(request, response, res);
}
@Delete('/rawmaterials/batch')
async removeBatch(
@Req() request: FastifyRequest,
......
......@@ -55,34 +55,6 @@
git clone -b master $para2 trainsys/
export NODE_OPTIONS=--max-old-space-size=4096
cd trainsys/
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#$para5#g" swarm.yaml
if [[ $para3 = all ]];then
mv Dockerfile-ALL Dockerfile
sed -i "s#/api#/trainsys__web#g" src/environments/environment.ts
sed -i "s#outputDir#//outputDir#g" vue.config.js
yarn
ln -s /var/lib/jenkins/appcache/A3064A91-F42D-4D7F-BC1C-4173A4F5772C node_modules/.cache
yarn build
else
if [ -e .dynamic ]
then
mv ../trainsys-core/src/main/resources/model/cn/ibizlab/trainsys/PSSYSAPPS/Web model
else
mv ../../trainsys-core/src/main/resources/model/cn/ibizlab/trainsys/PSSYSAPPS/Web model
fi
sed -i "s#srcimagename#$para4#g" Dockerfile-MODEL
mv Dockerfile-MODEL Dockerfile
fi
docker build -t $para5 .
docker push $para5
docker -H $para1 stack deploy --compose-file=swarm.yaml ebsx --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
......@@ -991,7 +991,7 @@
"path" : "PSMODULES/common.json"
},
"saaSMode" : 0,
"serviceAPIMode" : 0,
"serviceAPIMode" : 1,
"serviceCodeName" : "RawMaterial",
"storageMode" : 1,
"systemTag" : "TrainSys",
......
......@@ -13,6 +13,206 @@
"logicName" : "原材料",
"name" : "RAWMATERIAL",
"getPSDEServiceAPIMethods" : [ {
"dataAccessAction" : "CREATE",
"methodType" : "DEACTION",
"name" : "Create",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/Create.json"
},
"getPSDEServiceAPIMethodInput" : {
"name" : "输入对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"requestMethod" : "POST",
"noServiceCodeName" : true
}, {
"dataAccessAction" : "READ",
"methodType" : "DEACTION",
"name" : "Get",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/Get.json"
},
"getPSDEServiceAPIMethodInput" : {
"getKeyPSDEServiceAPIField" : {
"modelref" : true,
"id" : "RawMaterialId"
},
"name" : "输入对象",
"type" : "KEYFIELD"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"requestMethod" : "GET",
"needResourceKey" : true,
"noServiceCodeName" : true
}, {
"dataAccessAction" : "DELETE",
"methodType" : "DEACTION",
"name" : "Remove",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/Remove.json"
},
"getPSDEServiceAPIMethodInput" : {
"getKeyPSDEServiceAPIField" : {
"modelref" : true,
"id" : "RawMaterialId"
},
"name" : "输入对象",
"type" : "KEYFIELDS"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"type" : "VOID"
},
"requestMethod" : "DELETE",
"needResourceKey" : true,
"noServiceCodeName" : true
}, {
"dataAccessAction" : "UPDATE",
"methodType" : "DEACTION",
"name" : "Update",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/Update.json"
},
"getPSDEServiceAPIMethodInput" : {
"name" : "输入对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"requestMethod" : "PUT",
"needResourceKey" : true,
"noServiceCodeName" : true
}, {
"codeName" : "CheckKey",
"dataAccessAction" : "CREATE",
"methodType" : "DEACTION",
"name" : "CheckKey",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/CheckKey.json"
},
"getPSDEServiceAPIMethodInput" : {
"name" : "输入对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"stdDataType" : 9,
"type" : "SIMPLE"
},
"requestMethod" : "POST"
}, {
"codeName" : "GetDraft",
"dataAccessAction" : "CREATE",
"methodType" : "DEACTION",
"name" : "GetDraft",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/GetDraft.json"
},
"getPSDEServiceAPIMethodInput" : {
"name" : "输入对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"requestMethod" : "GET"
}, {
"codeName" : "Save",
"methodType" : "DEACTION",
"name" : "Save",
"getPSDEAction" : {
"modelref" : true,
"path" : "PSMODULES/common/PSDATAENTITIES/RawMaterial/PSDEACTIONS/Save.json"
},
"getPSDEServiceAPIMethodInput" : {
"name" : "输入对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "DTO"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"type" : "VOID"
},
"requestMethod" : "POST",
"needResourceKey" : true
}, {
"codeName" : "FetchDefault",
"dataAccessAction" : "READ",
"methodType" : "FETCH",
"name" : "FetchDefault",
"getPSDEDataSet" : {
"modelref" : true,
"id" : "Default"
},
"getPSDEServiceAPIMethodInput" : {
"name" : "输入对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialFilterDTO"
},
"type" : "DTO"
},
"getPSDEServiceAPIMethodReturn" : {
"name" : "返回对象",
"getPSDEMethodDTO" : {
"modelref" : true,
"id" : "RawMaterialDTO"
},
"type" : "PAGE"
},
"requestMethod" : "POST"
}, {
"codeName" : "Select",
"dataAccessAction" : "READ",
"methodType" : "SELECT",
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册