提交 1ba548fc 编写于 作者: zhouweidong's avatar zhouweidong

代码规范检查

上级 b80e2b6d
...@@ -31,7 +31,7 @@ import org.springframework.stereotype.Component; ...@@ -31,7 +31,7 @@ import org.springframework.stereotype.Component;
* 实体[${item.codeName}] 服务对象接口 * 实体[${item.codeName}] 服务对象接口
*/ */
@Component @Component
public class ${item.codeName}Fallback implements ${item.codeName}FeignClient{ public class ${item.codeName}Fallback implements ${item.codeName}FeignClient {
<#if item.getPSSubSysServiceAPIDEMethods()??> <#if item.getPSSubSysServiceAPIDEMethods()??>
<#list item.getPSSubSysServiceAPIDEMethods() as apiMethod> <#list item.getPSSubSysServiceAPIDEMethods() as apiMethod>
...@@ -46,57 +46,57 @@ public class ${item.codeName}Fallback implements ${item.codeName}FeignClient{ ...@@ -46,57 +46,57 @@ public class ${item.codeName}Fallback implements ${item.codeName}FeignClient{
<#-- ${return_type} ${srfmethodname(apiMethod.getCodeName())}(<#if req_param_type?? && req_param_type=='ENTITY'><#if apiMethod.getPSDEName()??>${apiMethod.getPSDEName()} entity</#if></#if>); --> <#-- ${return_type} ${srfmethodname(apiMethod.getCodeName())}(<#if req_param_type?? && req_param_type=='ENTITY'><#if apiMethod.getPSDEName()??>${apiMethod.getPSDEName()} entity</#if></#if>); -->
<#if apiMethod.getCodeName()?lower_case == 'get'> <#if apiMethod.getCodeName()?lower_case == 'get'>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}")-->
public ${refDE.codeName} get(${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}){ public ${refDE.codeName} get(${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}) {
return null; return null;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'remove'> <#elseif apiMethod.getCodeName()?lower_case == 'remove'>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}")-->
public Boolean remove(${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}){ public Boolean remove(${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}) {
return false; return false;
} }
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")-->
public Boolean removeBatch(Collection<${srfr7javatype(refDE.getKeyDEField().stdDataType)}> idList){ public Boolean removeBatch(Collection<${srfr7javatype(refDE.getKeyDEField().stdDataType)}> idList) {
return false; return false;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'create'> <#elseif apiMethod.getCodeName()?lower_case == 'create'>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}")-->
public ${refDE.codeName} create(${refDE.codeName} ${refDE.codeName?lower_case}){ public ${refDE.codeName} create(${refDE.codeName} ${refDE.codeName?lower_case}) {
return null; return null;
} }
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")-->
public Boolean createBatch(List<${refDE.codeName}> ${srfpluralize(refDE.getCodeName()?lower_case)}){ public Boolean createBatch(List<${refDE.codeName}> ${srfpluralize(refDE.getCodeName()?lower_case)}) {
return false; return false;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'save'> <#elseif apiMethod.getCodeName()?lower_case == 'save'>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}")-->
public Boolean save(${refDE.codeName} ${refDE.codeName?lower_case}){ public Boolean save(${refDE.codeName} ${refDE.codeName?lower_case}) {
return false; return false;
} }
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")-->
public Boolean saveBatch(List<${refDE.codeName}> ${srfpluralize(refDE.getCodeName()?lower_case)}){ public Boolean saveBatch(List<${refDE.codeName}> ${srfpluralize(refDE.getCodeName()?lower_case)}) {
return false; return false;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'update'> <#elseif apiMethod.getCodeName()?lower_case == 'update'>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}")-->
public ${refDE.codeName} update(${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}, ${refDE.codeName} ${refDE.codeName?lower_case}){ public ${refDE.codeName} update(${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}, ${refDE.codeName} ${refDE.codeName?lower_case}) {
return null; return null;
} }
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")-->
public Boolean updateBatch(List<${refDE.codeName}> ${srfpluralize(refDE.getCodeName()?lower_case)}){ public Boolean updateBatch(List<${refDE.codeName}> ${srfpluralize(refDE.getCodeName()?lower_case)}) {
return false; return false;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'getdraft'> <#elseif apiMethod.getCodeName()?lower_case == 'getdraft'>
public ${refDE.codeName} getDraft(){ public ${refDE.codeName} getDraft(){
return null; return null;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'checkkey'> <#elseif apiMethod.getCodeName()?lower_case == 'checkkey'>
public Boolean checkKey(${refDE.codeName} ${refDE.codeName?lower_case}){ public Boolean checkKey(${refDE.codeName} ${refDE.codeName?lower_case}) {
return false; return false;
} }
<#elseif apiMethod.getCodeName()?lower_case == 'createbatch'> <#elseif apiMethod.getCodeName()?lower_case == 'createbatch'>
<#elseif apiMethod.getCodeName()?lower_case == 'updatebatch'> <#elseif apiMethod.getCodeName()?lower_case == 'updatebatch'>
...@@ -104,26 +104,26 @@ public class ${item.codeName}Fallback implements ${item.codeName}FeignClient{ ...@@ -104,26 +104,26 @@ public class ${item.codeName}Fallback implements ${item.codeName}FeignClient{
<#elseif apiMethod.getCodeName()?lower_case == 'savebatch'> <#elseif apiMethod.getCodeName()?lower_case == 'savebatch'>
<#else> <#else>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/{${item.getKeyDEField().getCodeName()?lower_case}}/${apiMethod.getCodeName()?lower_case}")-->
public ${refDE.codeName} ${apiMethod.getCodeName()?uncap_first}( ${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}, ${refDE.codeName} ${refDE.codeName?lower_case}){ public ${refDE.codeName} ${apiMethod.getCodeName()?uncap_first}( ${srfr7javatype(refDE.getKeyDEField().stdDataType)} ${refDE.getKeyDEField().getCodeName()?lower_case}, ${refDE.codeName} ${refDE.codeName?lower_case}) {
return null; return null;
} }
</#if> </#if>
<#elseif apiMethod.getActionType()=='SELECT'><#comment>简单查询</#comment> <#elseif apiMethod.getActionType()=='SELECT'><#comment>简单查询</#comment>
<#-- List<${item.codeName}> ${srfmethodname(apiMethod.getCodeName())}(<#if req_param_type?? && req_param_type=='ENTITY'><#if apiMethod.getPSDEName()??>${apiMethod.getPSDEName()} entity</#if></#if>); --> <#-- List<${item.codeName}> ${srfmethodname(apiMethod.getCodeName())}(<#if req_param_type?? && req_param_type=='ENTITY'><#if apiMethod.getPSDEName()??>${apiMethod.getPSDEName()} entity</#if></#if>); -->
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")-->
public Page<${refDE.codeName}> ${apiMethod.getCodeName()?uncap_first}(){ public Page<${refDE.codeName}> ${apiMethod.getCodeName()?uncap_first}() {
return null; return null;
} }
<#elseif apiMethod.getActionType()=='FETCH'><#comment>数据集合</#comment> <#elseif apiMethod.getActionType()=='FETCH'><#comment>数据集合</#comment>
<#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")--> <#--@RequestMapping(method = RequestMethod.<#if apiMethod.getRequestMethod()??>${apiMethod.getRequestMethod()}<#else>POST</#if>, value = "${fullpath}/${apiMethod.getCodeName()?lower_case}")-->
public Page<${refDE.codeName}> ${apiMethod.getCodeName()?uncap_first?replace("fetch","search")}(${refDE.getCodeName()}SearchContext context){ public Page<${refDE.codeName}> ${apiMethod.getCodeName()?uncap_first?replace("fetch","search")}(${refDE.getCodeName()}SearchContext context) {
return null; return null;
} }
<#elseif apiMethod.getActionType()=='USER'><#comment>用户自定义</#comment> <#elseif apiMethod.getActionType()=='USER'><#comment>用户自定义</#comment>
public void ${apiMethod.getCodeName()?uncap_first}(){ public void ${apiMethod.getCodeName()?uncap_first}() {
return null; return null;
} }
</#if> </#if>
</#list> </#list>
......
...@@ -26,7 +26,7 @@ import ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower ...@@ -26,7 +26,7 @@ import ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower
*/ */
@Slf4j @Slf4j
@Service @Service
public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}${item.codeName}Logic{ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}${item.codeName}Logic {
@Autowired @Autowired
private KieContainer kieContainer; private KieContainer kieContainer;
...@@ -66,11 +66,11 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$ ...@@ -66,11 +66,11 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
} }
@Override @Override
public void execute(${de.codeName} et){ public void execute(${de.codeName} et) {
KieSession kieSession = null; KieSession kieSession = null;
try{ try{
kieSession=kieContainer.newKieSession(); kieSession = kieContainer.newKieSession();
<#comment>插入逻辑参数</#comment> <#comment>插入逻辑参数</#comment>
<#if item.getPSDELogicParams?? && item.getPSDELogicParams()??> <#if item.getPSDELogicParams?? && item.getPSDELogicParams()??>
<#assign logicName=(de.codeName+item.codeName)?lower_case> <#assign logicName=(de.codeName+item.codeName)?lower_case>
...@@ -81,12 +81,12 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$ ...@@ -81,12 +81,12 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
<#assign paramObjValue="et"> <#assign paramObjValue="et">
<#elseif logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??> <#elseif logicParam.getParamPSDataEntity?? && logicParam.getParamPSDataEntity()??>
<#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()> <#assign ParamPSDataEntity=logicParam.getParamPSDataEntity()>
${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName} ${(logicName+logicParam.codeName)?lower_case} =new ${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName}(); ${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName} ${(logicName+logicParam.codeName)?lower_case} = new ${pub.getPKGCodeName()}.core.${ParamPSDataEntity.getPSSystemModule().codeName?lower_case}.domain.${ParamPSDataEntity.codeName}();
<#else> <#else>
Map ${(logicName+logicParam.codeName)?lower_case} =new HashMap(); Map ${(logicName+logicParam.codeName)?lower_case} = new HashMap();
</#if> </#if>
kieSession.insert(${paramObjValue}); <#comment>将逻辑参数存储到fact</#comment> kieSession.insert(${paramObjValue}); <#comment>将逻辑参数存储到fact</#comment>
kieSession.setGlobal("${paramObj}",${paramObjValue});<#comment>将逻辑参数存储到global</#comment> kieSession.setGlobal("${paramObj}", ${paramObjValue});<#comment>将逻辑参数存储到global</#comment>
</#list> </#list>
</#if> </#if>
<#comment>插入处理逻辑中所用到的service对象</#comment> <#comment>插入处理逻辑中所用到的service对象</#comment>
...@@ -94,21 +94,21 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$ ...@@ -94,21 +94,21 @@ public class ${de.codeName}${item.codeName}LogicImpl implements I${de.codeName}$
<#list item.getPSDELogicNodes() as deLogicNode> <#list item.getPSDELogicNodes() as deLogicNode>
<#if deLogicNode.getDstPSDataEntity?? && deLogicNode.getDstPSDataEntity()??> <#if deLogicNode.getDstPSDataEntity?? && deLogicNode.getDstPSDataEntity()??>
<#if !P.exists(item.codeName,"kieSessionGlobalService",deLogicNode.getDstPSDataEntity().getCodeName()?lower_case)> <#if !P.exists(item.codeName,"kieSessionGlobalService",deLogicNode.getDstPSDataEntity().getCodeName()?lower_case)>
kieSession.setGlobal("${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service",${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service);<#comment>将逻辑中引用到的service存储到global</#comment> kieSession.setGlobal("${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service", ${deLogicNode.getDstPSDataEntity().getCodeName()?lower_case}service);<#comment>将逻辑中引用到的service存储到global</#comment>
</#if> </#if>
</#if> </#if>
</#list> </#list>
</#if> </#if>
<#comment>插入当前实体的defaultService对象,供自定义查询使用</#comment> <#comment>插入当前实体的defaultService对象,供自定义查询使用</#comment>
kieSession.setGlobal("iBzSys${de.codeName?lower_case?cap_first}DefaultService",iBzSysDefaultService);<#comment>将逻辑中引用到的service存储到global</#comment> kieSession.setGlobal("iBzSys${de.codeName?lower_case?cap_first}DefaultService", iBzSysDefaultService);<#comment>将逻辑中引用到的service存储到global</#comment>
kieSession.setGlobal("curuser", ${pub.getPKGCodeName()}.util.security.AuthenticationUser.getAuthenticationUser()); kieSession.setGlobal("curuser", ${pub.getPKGCodeName()}.util.security.AuthenticationUser.getAuthenticationUser());
<#comment>插入wfclient</#comment> <#comment>插入wfclient</#comment>
<#if startWF> <#if startWF>
kieSession.setGlobal("wfClient",wfClient); kieSession.setGlobal("wfClient", wfClient);
</#if> </#if>
kieSession.startProcess("${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${item.getCodeName()?lower_case}");<#comment>执行所要执行的流程</#comment> kieSession.startProcess("${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.service.logic.${de.codeName?lower_case}${item.getCodeName()?lower_case}");<#comment>执行所要执行的流程</#comment>
}catch(Exception e){ }catch(Exception e) {
throw new RuntimeException("执行[${item.getName()}]处理逻辑发生异常"+e); throw new RuntimeException("执行[${item.getName()}]处理逻辑发生异常"+e);
<#--throw new BadRequestAlertException(""+e,"","");--> <#--throw new BadRequestAlertException(""+e,"","");-->
}finally { }finally {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册