提交 4b4e5c22 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--执行之前,执行之后逻辑附加

上级 05c7aba8
......@@ -70,21 +70,21 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleAppMethod.getMethodType() == "SELECT">
if(${condition}context.${item.getCodeName()?lower_case}){
<#if singleServiceApi.getRequestMethod() == 'PUT' || singleServiceApi.getRequestMethod() == 'POST'>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if>
}
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
let res:any = await Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
}
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
if(${condition}true){
return Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().get(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
}
<#else>
<#-- 方法类型为DEACTION start -->
......@@ -94,7 +94,6 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item />
return res;
}
<#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
......@@ -105,11 +104,10 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleServiceApi.getRequestMethod() == "GET">
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item />
return res;
<#elseif singleServiceApi.getRequestMethod() == "POST">
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if>
<#-- 指定属性情况end -->
}
......@@ -138,7 +136,6 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
</#list>
</#if>
return res;
}
<#else>
if(${condition}context.${item.getCodeName()?lower_case}){
......@@ -147,7 +144,6 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
Object.assign(data,masterData);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${path}${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
return res;
}
</#if>
<#-- 提交对象数据情况end -->
......@@ -165,18 +161,18 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if singleAppMethod.getMethodType() == "SELECT">
<#-- if(context.${item.getCodeName()?lower_case}){ -->
<#if singleServiceApi.getRequestMethod() == 'PUT' || singleServiceApi.getRequestMethod() == 'POST'>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
</#if>
<#-- } -->
<#-- 方法类型为FETCH -->
<#elseif singleAppMethod.getMethodType() == "FETCH">
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
let res:any = await Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,tempData,isloading);
<#-- 方法类型为FETCHTEMP -->
<#elseif singleAppMethod.getMethodType() == "FETCHTEMP">
return Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().get(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#else>
<#-- 方法类型为DEACTION start -->
<#if singleServiceApi.getRequestParamType() == "NONE">
......@@ -184,7 +180,6 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
res.data.${item.getCodeName()?lower_case} = data.${item.getCodeName()?lower_case};
<@setStore appEntity=item />
return res;
<#-- 无参数情况end -->
<#elseif singleServiceApi.getRequestParamType() == "FIELD">
<#-- 指定属性情况start -->
......@@ -193,16 +188,15 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<@setStore appEntity=item />
return res;
<#-- } -->
<#elseif singleServiceApi.getRequestMethod() == "POST">
<#-- REMOVE -->
<#-- if(context.${item.getCodeName()?lower_case}){ -->
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#-- } -->
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,isloading);
<#-- } -->
</#if>
<#-- 指定属性情况end -->
......@@ -215,7 +209,6 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
return res;
<#-- } -->
<#elseif singleAppMethod.getCodeName() == 'Save'>
let masterData:any = {};
......@@ -224,7 +217,6 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- if(context.${item.getCodeName()?lower_case}){ -->
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<@setStore appEntity=item />
return res;
<#-- } -->
<#elseif singleAppMethod.getCodeName() == 'Create'>
let masterData:any = {};
......@@ -247,10 +239,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
this.tempStorage.setItem(tempContext.srfsessionkey+'_${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}',JSON.stringify(res.data.${srfpluralize(minorPSAppDataEntity.codeName)?lower_case}));
</#list>
</#if>
return res;
<#else>
<#-- if(context.${item.getCodeName()?lower_case}){ -->
return Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
let res:any = await Http.getInstance().${singleServiceApi.getRequestMethod()?lower_case}(`/${srfpluralize(item.codeName)?lower_case}/<#noparse>$</#noparse>{context.${item.getCodeName()?lower_case}}<#if singleServiceApi.getRequestPath()??>${singleServiceApi.getRequestPath()}</#if>`,data,isloading);
<#-- } -->
</#if>
<#-- 提交对象数据情况end -->
......@@ -272,15 +263,16 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
if(result){
return {"status":200,"data":result};
res = {"status":200,"data":result};
}else{
return {"status":200,"data":[]};
res = {"status":200,"data":[]};
}
}else{
return {"status":200,"data":[]};
res = {"status":200,"data":[]};
}
</#list>
</#if>
......@@ -290,15 +282,16 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
if(result){
return {"status":200,"data":result};
res = {"status":200,"data":result};
}else{
return {"status":200,"data":[]};
res = {"status":200,"data":[]};
}
}else{
return {"status":200,"data":[]};
res = {"status":200,"data":[]};
}
</#list>
</#if>
......@@ -309,16 +302,17 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
if(result){
let tempResult:any = result.filter((item:any) =>{
return !Object.is(item.${item.getCodeName()?lower_case},data.${item.getCodeName()?lower_case});
res = !Object.is(item.${item.getCodeName()?lower_case},data.${item.getCodeName()?lower_case});
})
this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}',JSON.stringify(tempResult));
return {"status":200,"data":data};
res = {"status":200,"data":data};
}else{
return {"status":500,"data":null};
res = {"status":500,"data":null};
}
}
</#list>
......@@ -327,6 +321,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
let tempData:Array<any> = [];
......@@ -345,9 +340,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
}
});
this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}',JSON.stringify(tempData));
return {"status":200,"data":data};
res = {"status":200,"data":data};
}else{
return {"status":500,"data":null};
res = {"status":500,"data":null};
}
}
</#list>
......@@ -360,12 +355,13 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
Object.assign(tempData,{${majorEntity.getCodeName()?lower_case}:data.${majorEntity.getCodeName()?lower_case}});
</#list>
</#if>
return {"status":200,"data":tempData};
let res:any = {"status":200,"data":tempData};
<#elseif singleAppMethod.getCodeName() == "Create">
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let ${srfpluralize(item.codeName)?lower_case}:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -375,9 +371,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
}
${srfpluralize(item.codeName)?lower_case}.push(data);
this.tempStorage.setItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}',JSON.stringify(${srfpluralize(item.codeName)?lower_case}));
return {"status":200,"data":data};
res = {"status":200,"data":data};
}else{
return {"status":200,"data":{}};
res = {"status":200,"data":{}};
}
</#list>
</#if>
......@@ -385,6 +381,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
if(result){
......@@ -394,9 +391,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
flag = true;
}
});
return {"status":200,"data":flag};
res = {"status":200,"data":flag};
}else{
return {"status":500,"data":null};
res = {"status":500,"data":null};
}
}
</#list>
......@@ -405,16 +402,17 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#if item.getMinorPSAppDERSs()??>
<#list item.getMinorPSAppDERSs() as singleDeRs>
<#assign majorEntity = singleDeRs.getMajorPSAppDataEntity()/>
let res:any = null;
if(context.srfsessionkey && !Object.is(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}'),'undefined')){
let result:any = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_${srfpluralize(item.codeName)?lower_case}') as any);
if(result){
let tempResult:any = result.filter((item:any) =>{
return Object.is(item.${item.getCodeName()?lower_case},data.${item.getCodeName()?lower_case});
res = Object.is(item.${item.getCodeName()?lower_case},data.${item.getCodeName()?lower_case});
})
let tempResultData:any = tempResult.length>0?tempResult[0]:Object.assign({},data);
return {"status":200,"data":tempResultData};
res = {"status":200,"data":tempResultData};
}else{
return {"status":500,"data":null};
res = {"status":500,"data":null};
}
}
</#list>
......@@ -430,8 +428,9 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#assign path>${path}${srfpluralize(_dataEntity.codeName)?lower_case}/<#noparse>$</#noparse>{context.${_dataEntity.getCodeName()?lower_case}}/</#assign>
</#if>
</#list>
if(${condition} true){
return Http.getInstance().post(`${path}${srfpluralize(item.codeName)?lower_case}/${singleAppMethod.getCodeName()?lower_case}`,data,isloading);
let res:any = null;
<#if count_index != 0>else</#if>if(${condition} true){
res = await Http.getInstance().post(`${path}${srfpluralize(item.codeName)?lower_case}/${singleAppMethod.getCodeName()?lower_case}`,data,isloading);
}
</#list>
</#if>
......@@ -477,14 +476,14 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
// 实体接口
<#-- 实体接口调用start -->
<#if item.getAllPSAppDEMethods?? && item.getAllPSAppDEMethods()??>
<#list item.getAllPSAppDEMethods() as singleAppMethod>
<#if singleAppMethod.getPSDEServiceAPIMethod?? && singleAppMethod.getPSDEServiceAPIMethod()??>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
</#if>
<#list item.getAllPSAppDEMethods() as singleAppMethod>
<#if singleAppMethod.getPSDEServiceAPIMethod?? && singleAppMethod.getPSDEServiceAPIMethod()??>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
</#if>
<#if singleAppMethod.render??>
${singleAppMethod.render.code}
<#else>
<#if singleAppMethod.isBuiltinMethod() == false>
<#if singleAppMethod.isBuiltinMethod() == false>
/**
* ${singleAppMethod.getCodeName()}接口方法
......@@ -496,25 +495,42 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
public async ${singleAppMethod.getCodeName()}(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
<#--是否存在前端处理逻辑start -->
<#if singleAppMethod.getPSDEAction()??>
<#assign appdeAction = singleAppMethod.getPSDEAction() />
<#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) >
<#assign appdelogic = appdeAction.getPSDELogic() />
<#if singleAppMethod.getPSDEAction()??>
<#assign appdeAction = singleAppMethod.getPSDEAction() />
<#-- BEGIN: 执行之前逻辑附加 -->
<#if appdeAction.getBeforePSDEActionLogics?? && appdeAction.getBeforePSDEActionLogics()??>
<#list appdeAction.getBeforePSDEActionLogics() as appdelogic>
let ${appdelogic.getCodeName()?lower_case}:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
data = await ${appdelogic.getCodeName()?lower_case}.onExecute(JSON.parse(JSON.stringify(context)),JSON.parse(JSON.stringify(data)),isloading?true:false);
</#list>
</#if>
<#-- END: 执行之前逻辑附加 -->
<#--是否存在前端处理逻辑start -->
<#if appdeAction.getPSDELogic?? && appdeAction.getPSDELogic()?? && (appdeAction.getActionHolder() == 2 || appdeAction.getActionHolder() == 3) >
<#assign appdelogic = appdeAction.getPSDELogic() />
let appLogic:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
const result = await appLogic.onExecute(context,data,isloading?true:false);
return {status:200,data:result};
<#else>
let res:any = {status:200,data:result};
<#else>
<@service_block item=item singleAppMethod=singleAppMethod/>
</#if>
<#--是否存在前端处理逻辑end -->
<#else>
</#if>
<#--是否存在前端处理逻辑end -->
<#-- BEGIN: 执行之后逻辑附加 -->
<#if appdeAction.getAfterPSDEActionLogics?? && appdeAction.getAfterPSDEActionLogics()??>
<#list appdeAction.getAfterPSDEActionLogics() as appdelogic>
let ${appdelogic.getCodeName()?lower_case}:${srfclassname('${appdelogic.getCodeName()}')}Logic = new ${srfclassname('${appdelogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(res))});
res = await ${appdelogic.getCodeName()?lower_case}.onExecute(JSON.parse(JSON.stringify(context)),JSON.parse(JSON.stringify(res)),isloading?true:false);
</#list>
</#if>
<#-- END: 执行之后逻辑附加 -->
<#else>
<@service_block item=item singleAppMethod=singleAppMethod/>
</#if>
</#if>
return res;
}
</#if>
</#if>
</#if>
</#list>
</#list>
</#if>
<#-- 实体接口调用end -->
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册