#E10-10# 增加自定义参数获取接口
parent
43adafd7b6
commit
437349ca4f
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,55 @@
|
||||
package com.weaver.seconddev.jcldoor.util;
|
||||
|
||||
import com.weaver.common.base.entity.result.WeaResult;
|
||||
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
||||
import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
|
||||
import com.weaver.seconddev.jcldoor.controller.JucailinPortalController;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class JucailinPortalUtils {
|
||||
|
||||
private final Logger log = LoggerFactory.getLogger(JucailinPortalController.class);
|
||||
|
||||
@Autowired
|
||||
private DatabaseUtils databaseUtils;
|
||||
|
||||
public String getUfPropData(String pkey,String tenant_key) {
|
||||
String pvalue = "" ;
|
||||
String groupId = "weaver-ebuilder-form-service";
|
||||
String sourceType = "LOGIC";
|
||||
try{
|
||||
if(StringUtils.isNotBlank(pkey))
|
||||
{
|
||||
String dataSql =" select pvalue \n" +
|
||||
" from uf_nj_prop \n" +
|
||||
" where pkey= ? \n" +
|
||||
" and delete_type = 0 \n" +
|
||||
" and tenant_key='"+tenant_key+"'" ;
|
||||
|
||||
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
||||
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
||||
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
||||
sqlParamEntity.setValue(pkey);
|
||||
sqlparam.add(sqlParamEntity);
|
||||
|
||||
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam);
|
||||
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
||||
if(CollectionUtils.isNotEmpty(recordList)) {
|
||||
Map<String,Object> recordMap = recordList.get(0);
|
||||
if(recordMap.containsKey("pvalue")){
|
||||
pvalue = String.valueOf(recordMap.get("pvalue"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("getUfPropData-Exception:"+e.getMessage());
|
||||
}
|
||||
return pvalue;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue