net.wicp.tams.cas.components.TreeGridOrg Maven / Gradle / Ivy
package net.wicp.tams.cas.components;
import java.sql.Connection;
import java.util.List;
import java.util.Map;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.http.Link;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.util.TextStreamResponse;
import lombok.extern.slf4j.Slf4j;
import net.wicp.tams.cas.services.IQuery;
import net.wicp.tams.common.apiext.json.EasyUiAssist;
import net.wicp.tams.common.apiext.json.easyuibean.EasyUINode;
import net.wicp.tams.common.apiext.json.easyuibean.EasyUINodeConf;
import net.wicp.tams.common.jdbc.DruidAssit;
import net.wicp.tams.component.tools.TapestryAssist;
/*****
* 用户下拉列表
*
* TODO pageSize设置会有问题
*
* @author Andy.zhou
*
*/
@Import(stack = "easyuistack")
@Slf4j
public class TreeGridOrg {
@Parameter
private String userName;
@Parameter
private String orgId;
/**
* 是否查询子组织?默认为是
*/
@Parameter(value = "true")
private boolean hasSub;
@Inject
protected IQuery query;
@Inject
protected ComponentResources resources;
@Property
private String url;
@SetupRender
void initializeValues() {
Link link = resources.createEventLink("treeGridOrg");
this.url = link.getBasePath();// 示例/zh/cas/usermanager.comboboxuser:queryuser
}
TextStreamResponse onTreeGridOrg() {
String retstr = "";
try {
// 查询
Connection connection = DruidAssit.getConnection("default");
// String sql = String.format("select * from %s.%s %s", getDb(), ColsSysOrg.tb,
// buff.toString());
List