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

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

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