use of com.vartech.common.app.beans.ParamMap in project varsql by varsqlinfo.
the class UserMgmtServiceImpl method updateAccept.
/**
* @Method Name : updateAccept
* @Method 설명 : 사용자 수락 거부 .
* @작성자 : ytkim
* @작성일 : 2017. 12. 1.
* @변경이력 :
* @param paramMap
* @return
*/
@Transactional(value = ResourceConfigConstants.APP_TRANSMANAGER, rollbackFor = Exception.class)
public ResponseResult updateAccept(String acceptyn, String selectItem) {
String[] viewidArr = StringUtils.split(selectItem, ",");
AuthorityType role = "Y".equals(acceptyn) ? AuthorityType.USER : AuthorityType.GUEST;
List<UserEntity> users = userMgmtRepository.findByViewidIn(Arrays.asList(viewidArr)).stream().map(item -> {
item.setUserRole(role.name());
item.setAcceptYn("Y".equals(acceptyn) ? true : false);
return item;
}).collect(Collectors.toList());
userMgmtRepository.saveAll(users);
return VarsqlUtils.getResponseResultItemOne(1);
}
use of com.vartech.common.app.beans.ParamMap in project varsql by varsqlinfo.
the class TableInfoHandler method handleResult.
@Override
public void handleResult(ResultContext<? extends ParamMap> paramResultContext) {
ParamMap rowData = paramResultContext.getResultObject();
String tblName = rowData.getString(MetaColumnConstants.TABLE_NAME);
if (!tblName.equals(beforeTableName)) {
if (useTableIndex) {
currentTableInfo = this.tableInfoList.get(this.tableIndexInfo.get(tblName));
currentTableInfo.setColList(new ArrayList<ColumnInfo>());
currentTableInfo.setRemarks(StringUtils.nullToString(currentTableInfo.getRemarks(), ""));
} else {
currentTableInfo = new TableInfo();
currentTableInfo.setName(tblName);
currentTableInfo.setColList(new ArrayList<ColumnInfo>());
currentTableInfo.setRemarks(rowData.getString(MetaColumnConstants.REMARKS, ""));
tableInfoList.add(currentTableInfo);
}
}
ColumnInfo column = new ColumnInfo();
String cName = rowData.getString(MetaColumnConstants.COLUMN_NAME);
String columnSize = rowData.getString(MetaColumnConstants.COLUMN_SIZE);
String degitsLen = rowData.getString(MetaColumnConstants.DECIMAL_DIGITS);
String dataType = rowData.getString(MetaColumnConstants.DATA_TYPE);
DataTypeInfo dataTypeInfo = dataTypeImpl.getDataType(dataType);
column.setName(cName);
column.setDataType(dataType);
Object lenInfoObj = rowData.get(MetaColumnConstants.COLUMN_SIZE);
if (lenInfoObj != null) {
if (lenInfoObj instanceof Integer) {
column.setLength(Integer.parseInt(lenInfoObj + ""));
} else {
column.setLength(new BigDecimal(lenInfoObj + ""));
}
}
column.setDefaultVal(rowData.getString(MetaColumnConstants.COLUMN_DEF));
column.setNullable(rowData.getString(MetaColumnConstants.IS_NULLABLE));
column.setTypeName(dataTypeInfo.getDataTypeName());
String typeAndLength = rowData.getString(MetaColumnConstants.TYPE_NAME_SIZE, "");
if ("".equals(typeAndLength)) {
column.setTypeAndLength(DbMetaUtils.getTypeName(dataTypeInfo, column, dataTypeInfo.getDataTypeName(), columnSize, degitsLen));
} else {
column.setTypeAndLength(typeAndLength);
}
column.setComment(rowData.getString(MetaColumnConstants.COMMENT, ""));
column.setConstraints(rowData.getString(MetaColumnConstants.CONSTRAINTS, ""));
currentTableInfo.addColInfo(column);
beforeTableName = tblName;
}
use of com.vartech.common.app.beans.ParamMap in project varsql by varsqlinfo.
the class AuthDAO method loadUserByUsername.
/**
* @Method Name : loadUserByUsername
* @Method 설명 : 사용자 로그인 정보 추출.
* @작성일 : 2015. 6. 22.
* @작성자 : ytkim
* @변경이력 :
* @param username
* @return
* @throws UsernameNotFoundException
*/
public User loadUserByUsername(final String userInfoJson) throws UsernameNotFoundException {
ParamMap userInfo = VartechUtils.jsonStringToObject(userInfoJson);
String username = userInfo.getString("username");
String password = userInfo.getString("password");
return loadUserByUsername(username, password, false);
}
use of com.vartech.common.app.beans.ParamMap in project varsql by varsqlinfo.
the class AbstractXmlLoad method getNodeValue.
private ParamMap<String, Object> getNodeValue(Element el) {
ParamMap<String, Object> dataMap = new ParamMap<String, Object>();
List list = el.getChildren();
Iterator<Element> it = list.iterator();
Map childMap = null;
List childList = null;
Object tmpChildObj = null;
int childNodeLen = -1;
Element sEle = null;
String nodeName = null;
List sChildList = null;
while (it.hasNext()) {
childMap = new HashMap();
sEle = (Element) it.next();
nodeName = sEle.getName();
sChildList = sEle.getChildren();
childNodeLen = sChildList.size();
if (childNodeLen != 0) {
childMap = getNodeValue(sEle);
}
if (dataMap.containsKey(nodeName)) {
tmpChildObj = dataMap.get(nodeName);
if (!(tmpChildObj instanceof List)) {
childList = new ArrayList();
childList.add(tmpChildObj);
} else {
childList = (List) tmpChildObj;
}
childList.add(childNodeLen > 0 ? childMap : sEle.getValue());
dataMap.put(nodeName, childList);
} else {
dataMap.put(nodeName, childNodeLen > 0 ? childMap : sEle.getValue());
}
}
return dataMap;
}
use of com.vartech.common.app.beans.ParamMap in project varsql by varsqlinfo.
the class CubridDDLScript method getTables.
@Override
public List<DDLInfo> getTables(DatabaseParamInfo dataParamInfo, DDLCreateOption ddlOption, String... objNmArr) throws Exception {
SqlSession client = SQLManager.getInstance().sqlSessionTemplate(dataParamInfo.getVconnid());
List<DDLInfo> reval = new ArrayList<DDLInfo>();
DDLInfo ddlInfo;
StringBuilder ddlStr;
for (String name : objNmArr) {
ddlStr = new StringBuilder();
ddlInfo = new DDLInfo();
ddlInfo.setName(name);
dataParamInfo.setObjectName(name);
if (ddlOption.isAddDropClause()) {
ddlStr.append("/* DROP TABLE " + name + "; */").append(BlankConstants.NEW_LINE_TWO);
}
ParamMap source = client.selectOne("tableScript", dataParamInfo);
ddlStr.append(source.getString("CREATE TABLE"));
ddlInfo.setCreateScript(VarsqlFormatterUtil.ddlFormat(VarsqlFormatterUtil.addLastSemicolon(ddlStr, ddlOption), dbType));
reval.add(ddlInfo);
}
return reval;
}
Aggregations