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

代码规范检查

上级 699b696e
...@@ -30,33 +30,33 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa ...@@ -30,33 +30,33 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa
<#if item.getAllPSDEDataSets()??> <#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dedataset> <#list item.getAllPSDEDataSets() as dedataset>
Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(IPage page, @Param("srf") ${de.codeName}SearchContext context, @Param("ew") Wrapper<${item.getCodeName()}> wrapper) ; Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(IPage page, @Param("srf") ${de.codeName}SearchContext context, @Param("ew") Wrapper<${item.getCodeName()}> wrapper);
</#list> </#list>
</#if> </#if>
<#assign keyfieldCodeName=item.getKeyPSDEField().codeName?lower_case> <#assign keyfieldCodeName=item.getKeyPSDEField().codeName?lower_case>
@Override @Override
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@Cacheable(value="${item.codeName?lower_case}",key = "'row:'+#p0") @Cacheable(value ="${item.codeName?lower_case}", key = "'row:'+#p0")
</#if> </#if>
${item.getCodeName()} selectById(Serializable id); ${item.getCodeName()} selectById(Serializable id);
@Override @Override
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",key = "'row:'+#p0.${keyfieldCodeName}") @CacheEvict(value ="${item.codeName?lower_case}", key = "'row:'+#p0.${keyfieldCodeName}")
</#if> </#if>
int insert(${item.getCodeName()} entity); int insert(${item.getCodeName()} entity);
@Override @Override
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",key = "'row:'+#p0.${keyfieldCodeName}") @CacheEvict(value ="${item.codeName?lower_case}", key = "'row:'+#p0.${keyfieldCodeName}")
</#if> </#if>
int updateById(@Param(Constants.ENTITY) ${item.getCodeName()} entity); int updateById(@Param(Constants.ENTITY) ${item.getCodeName()} entity);
@Override @Override
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",key = "'row:'+#p0.${keyfieldCodeName}") @CacheEvict(value ="${item.codeName?lower_case}", key = "'row:'+#p0.${keyfieldCodeName}")
</#if> </#if>
int update(@Param(Constants.ENTITY) ${item.getCodeName()} entity, @Param("ew") Wrapper<${item.codeName}> updateWrapper); int update(@Param(Constants.ENTITY) ${item.getCodeName()} entity, @Param("ew") Wrapper<${item.codeName}> updateWrapper);
@Override @Override
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",key = "'row:'+#p0") @CacheEvict(value ="${item.codeName?lower_case}", key = "'row:'+#p0")
</#if> </#if>
int deleteById(Serializable id); int deleteById(Serializable id);
/** /**
...@@ -104,7 +104,7 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa ...@@ -104,7 +104,7 @@ public interface ${item.getCodeName()}Mapper extends BaseMapper<${item.getCodeNa
<#if de.getDefaultPSDEDataSet()??> <#if de.getDefaultPSDEDataSet()??>
<#assign deDefaultDataSet=de.getDefaultPSDEDataSet()> <#assign deDefaultDataSet=de.getDefaultPSDEDataSet()>
<#if deDefaultDataSet.getPSDEDataQueries()??> <#if deDefaultDataSet.getPSDEDataQueries()??>
List<${item.getCodeName()}> selectBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(@Param("${MajorkeyField.codeName?lower_case}") Serializable ${MajorkeyField.codeName?lower_case}) ; List<${item.getCodeName()}> selectBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(@Param("${MajorkeyField.codeName?lower_case}") Serializable ${MajorkeyField.codeName?lower_case});
</#if> </#if>
</#if> </#if>
......
...@@ -63,8 +63,8 @@ public interface I${item.codeName}Service extends IService<${item.codeName}> { ...@@ -63,8 +63,8 @@ public interface I${item.codeName}Service extends IService<${item.codeName}> {
boolean execute(String sql, Map param); boolean execute(String sql, Map param);
<#if hasDEPrefield> <#if hasDEPrefield>
List<${de.codeName}> get${deCodeNameCamel}ByIds(List<${srfr7javatype(keyfield.stdDataType)}> ids) ; List<${de.codeName}> get${deCodeNameCamel}ByIds(List<${srfr7javatype(keyfield.stdDataType)}> ids);
List<${de.codeName}> get${deCodeNameCamel}ByEntities(List<${de.codeName}> entities) ; List<${de.codeName}> get${deCodeNameCamel}ByEntities(List<${de.codeName}> entities);
</#if> </#if>
} }
<#comment>NoSQL存储-MongoDB</#comment> <#comment>NoSQL存储-MongoDB</#comment>
...@@ -73,13 +73,13 @@ public interface I${item.codeName}Service extends IService<${item.codeName}> { ...@@ -73,13 +73,13 @@ public interface I${item.codeName}Service extends IService<${item.codeName}> {
/** /**
* 实体[${item.codeName}] 服务对象接口 * 实体[${item.codeName}] 服务对象接口
*/ */
public interface I${item.codeName}Service{ public interface I${item.codeName}Service {
<@addIDESerivceBody /> <@addIDESerivceBody />
<#if hasDEPrefield> <#if hasDEPrefield>
List<${de.codeName}> get${deCodeNameCamel}ByIds(List<${srfr7javatype(keyfield.stdDataType)}> ids) ; List<${de.codeName}> get${deCodeNameCamel}ByIds(List<${srfr7javatype(keyfield.stdDataType)}> ids);
List<${de.codeName}> get${deCodeNameCamel}ByEntities(List<${de.codeName}> entities) ; List<${de.codeName}> get${deCodeNameCamel}ByEntities(List<${de.codeName}> entities);
</#if> </#if>
} }
...@@ -88,7 +88,7 @@ public interface I${item.codeName}Service{ ...@@ -88,7 +88,7 @@ public interface I${item.codeName}Service{
/** /**
* 实体[${item.codeName}] 服务对象接口 * 实体[${item.codeName}] 服务对象接口
*/ */
public interface I${item.codeName}Service{ public interface I${item.codeName}Service {
<@addIDESerivceBody /> <@addIDESerivceBody />
...@@ -99,7 +99,7 @@ public interface I${item.codeName}Service{ ...@@ -99,7 +99,7 @@ public interface I${item.codeName}Service{
/** /**
* 实体[${item.codeName}] 服务对象接口 * 实体[${item.codeName}] 服务对象接口
*/ */
public interface I${item.codeName}Service{ public interface I${item.codeName}Service {
<@addIDESerivceBody /> <@addIDESerivceBody />
...@@ -122,25 +122,25 @@ public interface I${item.codeName}Service{ ...@@ -122,25 +122,25 @@ public interface I${item.codeName}Service{
<#elseif deaction.codeName?lower_case == "create"> <#elseif deaction.codeName?lower_case == "create">
boolean create(${item.codeName} et) ; boolean create(${item.codeName} et) ;
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}", allEntries = true)
</#if> </#if>
void createBatch(List<${item.codeName}> list) ; void createBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "update"> <#elseif deaction.codeName?lower_case == "update">
boolean update(${item.codeName} et) ; boolean update(${item.codeName} et) ;
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}", allEntries = true)
</#if> </#if>
void updateBatch(List<${item.codeName}> list) ; void updateBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "remove"> <#elseif deaction.codeName?lower_case == "remove">
boolean remove(${srfr7javatype(keyfield.stdDataType)} key) ; boolean remove(${srfr7javatype(keyfield.stdDataType)} key);
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}", allEntries = true)
</#if> </#if>
void removeBatch(Collection<${srfr7javatype(keyfield.stdDataType)}> idList) ; void removeBatch(Collection<${srfr7javatype(keyfield.stdDataType)}> idList);
<#elseif deaction.codeName?lower_case == "save"> <#elseif deaction.codeName?lower_case == "save">
boolean save(${item.codeName} et) ; boolean save(${item.codeName} et) ;
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}",allEntries = true)
</#if> </#if>
void saveBatch(List<${item.codeName}> list) ; void saveBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "getdraft"> <#elseif deaction.codeName?lower_case == "getdraft">
...@@ -152,7 +152,7 @@ public interface I${item.codeName}Service{ ...@@ -152,7 +152,7 @@ public interface I${item.codeName}Service{
<#elseif deaction.codeName?lower_case == "updatebatch"> <#elseif deaction.codeName?lower_case == "updatebatch">
<#elseif deaction.codeName?lower_case == "removebatch"> <#elseif deaction.codeName?lower_case == "removebatch">
<#else> <#else>
${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et) ; ${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et);
</#if> </#if>
<@outputTestActionDetail deaction /> <@outputTestActionDetail deaction />
</#if> </#if>
...@@ -160,7 +160,7 @@ public interface I${item.codeName}Service{ ...@@ -160,7 +160,7 @@ public interface I${item.codeName}Service{
</#if> </#if>
<#if item.getAllPSDEDataSets()??> <#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dedataset> <#list item.getAllPSDEDataSets() as dedataset>
Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(${item.codeName}SearchContext context) ; Page<<#if dedataset.isEnableGroup()>HashMap<#else>${item.getCodeName()}</#if>> search${dedataset.getCodeName()}(${item.codeName}SearchContext context);
</#list> </#list>
</#if> </#if>
<#comment>1N关系中,在子实体中创建父实体的实例对象</#comment> <#comment>1N关系中,在子实体中创建父实体的实例对象</#comment>
...@@ -186,13 +186,13 @@ public interface I${item.codeName}Service{ ...@@ -186,13 +186,13 @@ public interface I${item.codeName}Service{
void resetBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(Collection<${srfr7javatype(MajorField.stdDataType)}> ids); void resetBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(Collection<${srfr7javatype(MajorField.stdDataType)}> ids);
<#elseif MinorPSDER.getRemoveActionType()?c=='1'><#comment>同时删除</#comment> <#elseif MinorPSDER.getRemoveActionType()?c=='1'><#comment>同时删除</#comment>
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}", allEntries = true)
</#if> </#if>
void removeBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(Collection<${srfr7javatype(MajorField.stdDataType)}> ids); void removeBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(Collection<${srfr7javatype(MajorField.stdDataType)}> ids);
</#if> </#if>
</#if> </#if>
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}", allEntries = true)
</#if> </#if>
void removeBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfr7javatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case}); void removeBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfr7javatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case});
<#assign nested=MinorPSDER.isNestedRS()> <#assign nested=MinorPSDER.isNestedRS()>
...@@ -205,9 +205,9 @@ public interface I${item.codeName}Service{ ...@@ -205,9 +205,9 @@ public interface I${item.codeName}Service{
</#if> </#if>
<#if nested> <#if nested>
<#if item.isEnableEntityCache()==true> <#if item.isEnableEntityCache()==true>
@CacheEvict(value="${item.codeName?lower_case}",allEntries=true) @CacheEvict(value = "${item.codeName?lower_case}", allEntries = true)
</#if> </#if>
void saveBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfr7javatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case},List<${item.getCodeName()}> list) ; void saveBy${srfcaseformat(MajorField.codeName,'l_u2lC')?cap_first}(${srfr7javatype(MajorField.stdDataType)} ${MajorkeyField.codeName?lower_case}, List<${item.getCodeName()}> list) ;
</#if> </#if>
</#if> </#if>
</#if> </#if>
...@@ -219,10 +219,10 @@ public interface I${item.codeName}Service{ ...@@ -219,10 +219,10 @@ public interface I${item.codeName}Service{
</#if> </#if>
<#comment>实体数据导入</#comment> <#comment>实体数据导入</#comment>
<#if hasDEImport> <#if hasDEImport>
JSONObject importData(List<${de.codeName}> entities,int batchSize,boolean isIgnoreError); JSONObject importData(List<${de.codeName}> entities, int batchSize, boolean isIgnoreError);
@Async("asyncExecutor") @Async("asyncExecutor")
void asyncImportData(List<${de.codeName}> entities,int batchSize,boolean isIgnoreError); void asyncImportData(List<${de.codeName}> entities, int batchSize, boolean isIgnoreError);
</#if> </#if>
</#macro> </#macro>
......
...@@ -91,14 +91,14 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -91,14 +91,14 @@ public class PermissionSyncJob implements ApplicationRunner {
public void run(ApplicationArguments args) { public void run(ApplicationArguments args) {
try { try {
Thread.sleep(10000); Thread.sleep(10000);
InputStream permission= this.getClass().getResourceAsStream("/permission/systemResource.json"); //获取当前系统所有实体资源能力 InputStream permission = this.getClass().getResourceAsStream("/permission/systemResource.json"); //获取当前系统所有实体资源能力
String permissionResult = IOUtils.toString(permission,"UTF-8"); String permissionResult = IOUtils.toString(permission,"UTF-8");
JSONObject system= new JSONObject(); JSONObject system= new JSONObject();
system.put("pssystemid",systemId); system.put("pssystemid",systemId);
system.put("pssystemname",systemName); system.put("pssystemname",systemName);
system.put("sysstructure",JSONObject.parseObject(permissionResult)); system.put("sysstructure",JSONObject.parseObject(permissionResult));
system.put("md5check",DigestUtils.md5DigestAsHex(permissionResult.getBytes())); system.put("md5check",DigestUtils.md5DigestAsHex(permissionResult.getBytes()));
if(client.syncSysAuthority(system)){ if(client.syncSysAuthority(system)) {
log.info("向[UAA]同步系统资源成功"); log.info("向[UAA]同步系统资源成功");
}else{ }else{
log.error("向[UAA]同步系统资源失败"); log.error("向[UAA]同步系统资源失败");
...@@ -109,9 +109,9 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -109,9 +109,9 @@ public class PermissionSyncJob implements ApplicationRunner {
} }
try { try {
InputStream sysModel= this.getClass().getResourceAsStream("/sysmodel/${sys.codeName}.json"); //获取当前系统所有实体资源能力 InputStream sysModel = this.getClass().getResourceAsStream("/sysmodel/${sys.codeName}.json"); //获取当前系统所有实体资源能力
String strSysModel = IOUtils.toString(sysModel,"UTF-8"); String strSysModel = IOUtils.toString(sysModel,"UTF-8");
if(liteFeignClient.syncSysModel(JSONObject.parseObject(strSysModel))){ if(liteFeignClient.syncSysModel(JSONObject.parseObject(strSysModel))) {
log.info("向[lite]同步系统模型成功"); log.info("向[lite]同步系统模型成功");
}else{ }else{
log.error("向[lite]同步系统模型失败"); log.error("向[lite]同步系统模型失败");
...@@ -123,7 +123,7 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -123,7 +123,7 @@ public class PermissionSyncJob implements ApplicationRunner {
<#if hasWF> <#if hasWF>
try{ try{
List<Map<String,Object>> bpmnfiles=new ArrayList(); List<Map<String,Object>> bpmnfiles = new ArrayList();
<#list sys.getAllPSWorkflows() as wf> <#list sys.getAllPSWorkflows() as wf>
<#if wf.getPSWFVersions()??> <#if wf.getPSWFVersions()??>
<#list wf.getPSWFVersions() as wfvs> <#list wf.getPSWFVersions() as wfvs>
...@@ -131,23 +131,23 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -131,23 +131,23 @@ public class PermissionSyncJob implements ApplicationRunner {
</#list> </#list>
</#if> </#if>
</#list> </#list>
if(client2.deployBpmnFile(bpmnfiles)){ if(client2.deployBpmnFile(bpmnfiles)) {
log.info("部署流程成功"); log.info("部署流程成功");
}else{ }else{
log.error("部署流程失败"); log.error("部署流程失败");
} }
}catch(Exception ex){ }catch(Exception ex) {
log.error(String.format("部署流程失败,请检查[WF]服务是否正常! [%s]",ex)); log.error(String.format("部署流程失败,请检查[WF]服务是否正常! [%s]",ex));
} }
</#if> </#if>
<#if hasMsgTemplate> <#if hasMsgTemplate>
try { try {
InputStream msgTemplate= this.getClass().getResourceAsStream("/msgtempl/systemMsgTempl.json"); //获取当前系统所有实体资源能力 InputStream msgTemplate = this.getClass().getResourceAsStream("/msgtempl/systemMsgTempl.json"); //获取当前系统所有实体资源能力
String strMsgTemplate = IOUtils.toString(msgTemplate,"UTF-8"); String strMsgTemplate = IOUtils.toString(msgTemplate,"UTF-8");
JSONObject template= new JSONObject(); JSONObject template = new JSONObject();
template.put("template",JSONArray.parseArray(strMsgTemplate)); template.put("template", JSONArray.parseArray(strMsgTemplate));
if(notifyFeignClient.createMsgTemplate(template)){ if(notifyFeignClient.createMsgTemplate(template)) {
log.info("推送消息模板成功"); log.info("推送消息模板成功");
}else{ }else{
log.error("推送消息模板失败"); log.error("推送消息模板失败");
...@@ -159,9 +159,9 @@ public class PermissionSyncJob implements ApplicationRunner { ...@@ -159,9 +159,9 @@ public class PermissionSyncJob implements ApplicationRunner {
<#if hasPredefinedCodeList> <#if hasPredefinedCodeList>
try { try {
InputStream runtimeDict= this.getClass().getResourceAsStream("/sysmodel/RuntimeDict.json"); //获取当前系统所有实体资源能力 InputStream runtimeDict = this.getClass().getResourceAsStream("/sysmodel/RuntimeDict.json"); //获取当前系统所有实体资源能力
String strRuntimeDict = IOUtils.toString(runtimeDict,"UTF-8"); String strRuntimeDict = IOUtils.toString(runtimeDict,"UTF-8");
if(dictFeignClient.syncRuntimeDict(JSONArray.parseArray(strRuntimeDict))){ if(dictFeignClient.syncRuntimeDict(JSONArray.parseArray(strRuntimeDict))) {
log.info("推送系统预置代码表成功"); log.info("推送系统预置代码表成功");
}else{ }else{
log.error("推送系统预置代码表失败"); log.error("推送系统预置代码表失败");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册