提交 14b1fb19 编写于 作者: tony001's avatar tony001

临时更新基础服务类

上级 c2246dc8
...@@ -52,6 +52,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -52,6 +52,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.${minorPSAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case} = null; item.${minorPSAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case} = null;
<#-- 置空父键 -->
if(item.hasOwnProperty('${majorPSAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}') && item.${majorPSAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case}) item.${majorPSAppDataEntity.getKeyPSAppDEField().getCodeName()?lower_case} = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
...@@ -65,6 +67,32 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -65,6 +67,32 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
</#if> </#if>
</#macro> </#macro>
<#-- 本地供数satrt -->
<#macro local_supply item singleAppMethod>
<#if singleAppMethod.getPredefinedType?? && singleAppMethod.getPredefinedType()??>
<#-- 预定义类型为索引实体start -->
<#if singleAppMethod.getPredefinedType() == "INDEXDE">
<#if singleAppMethod.getPSAppCodeList?? && singleAppMethod.getPSAppCodeList()??>
<#assign appCodeList = singleAppMethod.getPSAppCodeList() />
let codelistModel:any = {tag:'${appCodeList.codeName}',codelistType:'${appCodeList.getCodeListType()}'};
let res:any = await this.getCodeList(codelistModel.tag,codelistModel.codelistType,context,data);
if(res && res.length > 0){
res.forEach((ele:any) => {
// 仿真返回数据集
ele.${item.getKeyPSAppDEField().getCodeName()?lower_case} = ele.value;
ele.${item.getMajorPSAppDEField().getCodeName()?lower_case} = ele.text
});
}
return {status:200,data:res};
</#if>
<#else>
<@service_block item=item singleAppMethod=singleAppMethod />
</#if>
<#-- 预定义类型为索引实体end -->
</#if>
</#macro>
<#-- 本地供数end -->
<#-- 检查行为是否可以执行 start --> <#-- 检查行为是否可以执行 start -->
<#-- @author zpc --> <#-- @author zpc -->
<#-- @update 2020.7.13 18:00 --> <#-- @update 2020.7.13 18:00 -->
...@@ -78,7 +106,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -78,7 +106,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#-- 定义service_block start --> <#-- 定义service_block start -->
<#macro service_block item singleAppMethod afterActionStr = ""> <#macro service_block item singleAppMethod afterActionStr = "">
<#if item.getPSAppDERSPathCount() gt 0 && singleServiceApi??> <#if item.getPSAppDERSPathCount() gt 0 && singleAppMethod.getPSDEServiceAPIMethod?? && singleAppMethod.getPSDEServiceAPIMethod()??>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
<#list 1..item.getPSAppDERSPathCount() as count> <#list 1..item.getPSAppDERSPathCount() as count>
<#assign path = ''/> <#assign path = ''/>
<#assign condition = ''/> <#assign condition = ''/>
...@@ -190,7 +219,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -190,7 +219,8 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
</#if> </#if>
</#list> </#list>
</#if> </#if>
<#if item.isMajor()> <#if item.isMajor() && singleAppMethod.getPSDEServiceAPIMethod?? && singleAppMethod.getPSDEServiceAPIMethod()??>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
<#-- 方法类型为SELECT --> <#-- 方法类型为SELECT -->
<#if singleAppMethod.getMethodType() == "SELECT"> <#if singleAppMethod.getMethodType() == "SELECT">
<#-- if(context.${item.getCodeName()?lower_case}){ --> <#-- if(context.${item.getCodeName()?lower_case}){ -->
...@@ -303,7 +333,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -303,7 +333,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
</#if> </#if>
</#if> </#if>
<#-- 嵌套成员 --> <#-- 嵌套成员 -->
<#if item.isMajor() == false && !singleServiceApi??> <#if item.isMajor() == false && !(singleAppMethod.getPSDEServiceAPIMethod?? && singleAppMethod.getPSDEServiceAPIMethod()??)>
<#if singleAppMethod.getMethodType() == "SELECT"> <#if singleAppMethod.getMethodType() == "SELECT">
// ${singleAppMethod.getCodeName()} ---SELECT // ${singleAppMethod.getCodeName()} ---SELECT
<#-- 方法类型为FETCH --> <#-- 方法类型为FETCH -->
...@@ -486,7 +516,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -486,7 +516,7 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#macro excuteBeforeAction appdeAction> <#macro excuteBeforeAction appdeAction>
<#if appdeAction.getBeforePSDEActionLogics?? && appdeAction.getBeforePSDEActionLogics()??> <#if appdeAction.getBeforePSDEActionLogics?? && appdeAction.getBeforePSDEActionLogics()??>
<#list appdeAction.getBeforePSDEActionLogics() as beforelogic> <#list appdeAction.getBeforePSDEActionLogics() as beforelogic>
<#if beforelogic.getPSDELogic()??> <#if beforelogic.getPSDELogic()?? && beforelogic.getPSDELogic().getLogicHolder?? && beforelogic.getPSDELogic().getLogicHolder()?? && (beforelogic.getPSDELogic().getLogicHolder() == 2 || beforelogic.getPSDELogic().getLogicHolder() == 3)>
<#assign singleLogic = beforelogic.getPSDELogic() /> <#assign singleLogic = beforelogic.getPSDELogic() />
let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))}); let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
data = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,data,isloading?true:false); data = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,data,isloading?true:false);
...@@ -502,10 +532,11 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr ...@@ -502,10 +532,11 @@ import ${srfclassname('${singleLogic.getCodeName()}')}Logic from '@/service/${sr
<#macro excuteAfterAction appdeAction> <#macro excuteAfterAction appdeAction>
<#if appdeAction.getAfterPSDEActionLogics?? && appdeAction.getAfterPSDEActionLogics()??> <#if appdeAction.getAfterPSDEActionLogics?? && appdeAction.getAfterPSDEActionLogics()??>
<#list appdeAction.getAfterPSDEActionLogics() as afterlogic> <#list appdeAction.getAfterPSDEActionLogics() as afterlogic>
<#if afterlogic.getPSDELogic()??> <#if afterlogic.getPSDELogic()?? && afterlogic.getPSDELogic().getLogicHolder?? && afterlogic.getPSDELogic().getLogicHolder()?? && (afterlogic.getPSDELogic().getLogicHolder() == 2 || afterlogic.getPSDELogic().getLogicHolder() == 3)>
<#assign singleLogic = afterlogic.getPSDELogic() /> <#assign singleLogic = afterlogic.getPSDELogic() />
<@compress single_line=true>let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(res))});</@compress> <@compress single_line=true>let ${singleLogic.getCodeName()?lower_case}:${srfclassname('${singleLogic.getCodeName()}')}Logic = new ${srfclassname('${singleLogic.getCodeName()}')}Logic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(res)).data});</@compress>
<@compress single_line=true>res = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,res,isloading?true:false);</@compress> <@compress single_line=true>let ${singleLogic.getCodeName()?lower_case}Data:any = await ${singleLogic.getCodeName()?lower_case}.onExecute(context,res.data,isloading?true:false);</@compress>
res ={status:200,data:${singleLogic.getCodeName()?lower_case}Data};
</#if> </#if>
</#list> </#list>
</#if> </#if>
...@@ -550,9 +581,6 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends ...@@ -550,9 +581,6 @@ 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()??>
<#assign singleServiceApi = singleAppMethod.getPSDEServiceAPIMethod()/>
</#if>
<#if singleAppMethod.render??> <#if singleAppMethod.render??>
${singleAppMethod.render.code} ${singleAppMethod.render.code}
<#else> <#else>
...@@ -601,64 +629,13 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends ...@@ -601,64 +629,13 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
</#if> </#if>
<#--是否存在前端处理逻辑end --> <#--是否存在前端处理逻辑end -->
<#else> <#else>
<#-- 行为执行之后 start --> <#-- 无实体行为,有接口走接口,无接口走本地供数 start -->
<#-- @author zpc --> <#-- @author zpc -->
<#-- @update 2020.7.14 14:00 --> <#-- @update 2020.7.22 17:00 -->
<@service_block item=item singleAppMethod=singleAppMethod /> <@local_supply item=item singleAppMethod=singleAppMethod />
<#-- 行为执行之后 end --> <#-- 无实体行为,有接口走接口,无接口走本地供数 end -->
</#if> </#if>
} }
<#-- 查询数据集(post方式)start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 15:00 -->
<#-- <#if singleAppMethod.getMethodType?? && singleAppMethod.getMethodType()?? && singleAppMethod.getMethodType() == "FETCH">
<#assign dataSet = singleAppMethod.getPSDEDataSet() /> -->
<#-- /**
* search${dataSet.getCodeName()}接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
public async search${dataSet.getCodeName()}(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { -->
<#-- 检查行为是否可以执行 start -->
<#-- @author zpc -->
<#-- @update 2020.7.13 16:00 -->
<#-- <#if singleAppMethod.getPSDEAction()??>
<#assign appdeAction = singleAppMethod.getPSDEAction() />
<#if appdeAction.getTestActionMode?? && appdeAction.getTestActionMode()?? && (appdeAction.getTestActionMode() == 1 || appdeAction.getTestActionMode() == 3)>
let result:any = await this.test${srfclassname('search${dataSet.getCodeName()}')}(context,data);
if(!result) return;
</#if>
</#if> -->
<#-- 检查行为是否可以执行 end -->
<#-- <#if item.getPSAppDERSPathCount() gt 0 && singleServiceApi??>
<#list 1..item.getPSAppDERSPathCount() as count>
<#assign path = ''/>
<#assign condition = ''/>
<#list item.getPSAppDERSPath(count_index) as deRSPath>
<#if deRSPath.getMajorPSAppDataEntity?? && deRSPath.getMajorPSAppDataEntity()??>
<#assign _dataEntity = deRSPath.getMajorPSAppDataEntity()/>
<#assign condition>${condition}context.${_dataEntity.getCodeName()?lower_case} && </#assign>
<#assign path>${path}${srfpluralize(_dataEntity.codeName)?lower_case}/<#noparse>$</#noparse>{context.${_dataEntity.getCodeName()?lower_case}}/</#assign>
</#if>
</#list>
if(${condition}true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().post(`/${path}${srfpluralize(item.codeName)?lower_case}/search${dataSet.getCodeName()?lower_case}`,tempData,isloading);
}
</#list>
</#if>
<#if item.isMajor()>
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().post(`/${srfpluralize(item.codeName)?lower_case}/search${dataSet.getCodeName()?lower_case}`,tempData,isloading);
</#if>
}
</#if> -->
<#-- 查询数据集(post方式)end -->
<#-- 检查行为是否可以执行 start --> <#-- 检查行为是否可以执行 start -->
<#-- @author zpc --> <#-- @author zpc -->
<#-- @update 2020.7.13 17:00 --> <#-- @update 2020.7.13 17:00 -->
...@@ -677,21 +654,6 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends ...@@ -677,21 +654,6 @@ export default class ${srfclassname('${item.getCodeName()}')}ServiceBase extends
<@getTestActionModifier appdeAction=appdeAction/> async test${srfclassname('${singleAppMethod.getCodeName()}')}(context: any = {},data: any = {}): Promise<any> { <@getTestActionModifier appdeAction=appdeAction/> async test${srfclassname('${singleAppMethod.getCodeName()}')}(context: any = {},data: any = {}): Promise<any> {
return true; return true;
} }
<#if singleAppMethod.getMethodType?? && singleAppMethod.getMethodType()?? && singleAppMethod.getMethodType() == "FETCH">
<#assign dataSet = singleAppMethod.getPSDEDataSet() />
/**
* test${srfclassname('search${dataSet.getCodeName()}')}方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @returns {Promise<any>}
* @memberof ${srfclassname('${item.getCodeName()}')}ServiceBase
*/
<@getTestActionModifier appdeAction=appdeAction/> async test${srfclassname('search${dataSet.getCodeName()}')}(context: any = {},data: any = {}): Promise<any> {
return true;
}
</#if>
</#if> </#if>
</#if> </#if>
<#-- 检查行为是否可以执行 end --> <#-- 检查行为是否可以执行 end -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册