|
|
|
@ -37,8 +37,8 @@ public class ColumnsUtils {
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(customerid)){
|
|
|
|
|
String sql =" select id,name from customer " +
|
|
|
|
|
" where id= ? " +
|
|
|
|
|
" and tenant_key= ? " ;
|
|
|
|
|
" where id= ? " +
|
|
|
|
|
" and tenant_key= ? " ;
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
@ -73,20 +73,20 @@ public class ColumnsUtils {
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(departmentid)) {
|
|
|
|
|
String dataSql =" select id,username" +
|
|
|
|
|
" from eteams.employee " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select oxmfzr from uf_proj_teams where td1= ? and tenant_key=? and delete_type = 0 " +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and tenant_key=? \n" +
|
|
|
|
|
" and status='normal'" +
|
|
|
|
|
" and type='inside'";
|
|
|
|
|
" from eteams.employee " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select oxmfzr from uf_proj_teams where td1= ? and tenant_key=? and delete_type = 0 " +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and tenant_key=? \n" +
|
|
|
|
|
" and status='normal'" +
|
|
|
|
|
" and type='inside'";
|
|
|
|
|
|
|
|
|
|
log.info("getSubcompanyFzr--dataSql:"+dataSql);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(departmentid+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -123,14 +123,14 @@ public class ColumnsUtils {
|
|
|
|
|
Map<String,Object> recordMap = new HashMap<String,Object>() ;
|
|
|
|
|
if(StringUtils.isNotBlank(mainline_id)){
|
|
|
|
|
String sql =" select group_concat(pc.hth) as hth "+
|
|
|
|
|
" from uf_proj_contract pc "+
|
|
|
|
|
" where pc.glxm_p402 = ? " +
|
|
|
|
|
" and pc.tenant_key = ? \n" +
|
|
|
|
|
" and pc.delete_type = 0 " ;
|
|
|
|
|
" from uf_proj_contract pc "+
|
|
|
|
|
" where pc.glxm_p402 = ? " +
|
|
|
|
|
" and pc.tenant_key = ? \n" +
|
|
|
|
|
" and pc.delete_type = 0 " ;
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(mainline_id+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -181,35 +181,35 @@ public class ColumnsUtils {
|
|
|
|
|
if(StringUtils.isNotBlank(mainlineid))
|
|
|
|
|
{
|
|
|
|
|
String dataSql =" select w.* from (\n" +
|
|
|
|
|
" select d.id,p.requestname,l.requestid,d.create_time\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_3786 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm= ? \n" +
|
|
|
|
|
" and d.TENANT_KEY=? \n" +
|
|
|
|
|
" and d.DELETE_TYPE=0\n" +
|
|
|
|
|
" and l.TENANT_KEY=? \n" +
|
|
|
|
|
" and l.DELETE_TYPE=0\n" +
|
|
|
|
|
" and p.TENANT_KEY=? \n" +
|
|
|
|
|
" and p.DELETE_TYPE=0\n" +
|
|
|
|
|
" union \n" +
|
|
|
|
|
" select d.id,p.requestname,l.requestid,d.CREATE_TIME\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_961 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm= ?\n" +
|
|
|
|
|
" and d.TENANT_KEY= ? \n" +
|
|
|
|
|
" and d.DELETE_TYPE=0\n" +
|
|
|
|
|
" and l.TENANT_KEY=? \n" +
|
|
|
|
|
" and l.DELETE_TYPE=0 \n" +
|
|
|
|
|
" and p.TENANT_KEY=? \n" +
|
|
|
|
|
" and p.DELETE_TYPE=0 \n" +
|
|
|
|
|
" ) w\n" +
|
|
|
|
|
" order by w.id desc " ;
|
|
|
|
|
" select d.id,p.requestname,l.requestid,d.create_time\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_3786 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm= ? \n" +
|
|
|
|
|
" and d.TENANT_KEY=? \n" +
|
|
|
|
|
" and d.DELETE_TYPE=0\n" +
|
|
|
|
|
" and l.TENANT_KEY=? \n" +
|
|
|
|
|
" and l.DELETE_TYPE=0\n" +
|
|
|
|
|
" and p.TENANT_KEY=? \n" +
|
|
|
|
|
" and p.DELETE_TYPE=0\n" +
|
|
|
|
|
" union \n" +
|
|
|
|
|
" select d.id,p.requestname,l.requestid,d.CREATE_TIME\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_961 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm= ?\n" +
|
|
|
|
|
" and d.TENANT_KEY= ? \n" +
|
|
|
|
|
" and d.DELETE_TYPE=0\n" +
|
|
|
|
|
" and l.TENANT_KEY=? \n" +
|
|
|
|
|
" and l.DELETE_TYPE=0 \n" +
|
|
|
|
|
" and p.TENANT_KEY=? \n" +
|
|
|
|
|
" and p.DELETE_TYPE=0 \n" +
|
|
|
|
|
" ) w\n" +
|
|
|
|
|
" order by w.id desc " ;
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(mainlineid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -229,7 +229,7 @@ public class ColumnsUtils {
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(mainlineid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -265,26 +265,26 @@ public class ColumnsUtils {
|
|
|
|
|
if(StringUtils.isNotBlank(mainlineid))
|
|
|
|
|
{
|
|
|
|
|
String dataSql =" select p.requestname,l.requestid,d.zht,d.cjrq,d.sqyy,d.wdfj\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_963 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where (d.xm = ? or d.xmid = ?)" +
|
|
|
|
|
" and d.tenant_key= ? \n" +
|
|
|
|
|
" and d.delete_type=0 \n" +
|
|
|
|
|
" and l.tenant_key= ? \n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key= ? \n" +
|
|
|
|
|
" and p.delete_type=0\n" +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_963 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where (d.xm = ? or d.xmid = ?)" +
|
|
|
|
|
" and d.tenant_key= ? \n" +
|
|
|
|
|
" and d.delete_type=0 \n" +
|
|
|
|
|
" and l.tenant_key= ? \n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key= ? \n" +
|
|
|
|
|
" and p.delete_type=0\n" +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(mainlineid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(mainlineid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -335,24 +335,24 @@ public class ColumnsUtils {
|
|
|
|
|
int yqys = 0;
|
|
|
|
|
|
|
|
|
|
dataSql = " select p.requestname,l.requestid,ifnull(yqys,0) as yqys\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_3785 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm = ? \n" +
|
|
|
|
|
" and d.tenant_key = ? \n" +
|
|
|
|
|
" and d.delete_type=0 \n" +
|
|
|
|
|
" and l.tenant_key = ? \n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key = ? \n" +
|
|
|
|
|
" and p.delete_type=0 \n" +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_3785 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm = ? \n" +
|
|
|
|
|
" and d.tenant_key = ? \n" +
|
|
|
|
|
" and d.delete_type=0 \n" +
|
|
|
|
|
" and l.tenant_key = ? \n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key = ? \n" +
|
|
|
|
|
" and p.delete_type=0 \n" +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
|
|
|
|
|
log.error("dataSql:"+dataSql);
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam2 = new ArrayList<SqlParamEntity>();
|
|
|
|
|
|
|
|
|
|
SqlParamEntity sqlParamEntity2 = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity2.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity2.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity2.setValue(mainlineid);
|
|
|
|
|
sqlparam2.add(sqlParamEntity2);
|
|
|
|
|
|
|
|
|
@ -473,23 +473,23 @@ public class ColumnsUtils {
|
|
|
|
|
if(StringUtils.isNotBlank(mainlineid))
|
|
|
|
|
{
|
|
|
|
|
String dataSql =" select p.requestname,l.requestid,ifnull(yqys,0) as yqys\n" +
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_3785 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm=? \n" +
|
|
|
|
|
" and d.tenant_key= ? \n" +
|
|
|
|
|
" and d.delete_type=0 \n" +
|
|
|
|
|
" and l.tenant_key= ? \n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key=? \n" +
|
|
|
|
|
" and p.delete_type=0 \n" +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
" from wfc_form_data l\n" +
|
|
|
|
|
" inner join formtable_main_3785 d on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm=? \n" +
|
|
|
|
|
" and d.tenant_key= ? \n" +
|
|
|
|
|
" and d.delete_type=0 \n" +
|
|
|
|
|
" and l.tenant_key= ? \n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key=? \n" +
|
|
|
|
|
" and p.delete_type=0 \n" +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
|
|
|
|
|
log.info("dataSql:"+dataSql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(mainlineid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -669,17 +669,17 @@ public class ColumnsUtils {
|
|
|
|
|
if(StringUtils.isNotBlank(mainlineid))
|
|
|
|
|
{
|
|
|
|
|
String dataSql =" select p.requestname,l.requestid " +
|
|
|
|
|
" from formtable_main_963 d \n" +
|
|
|
|
|
" inner join wfc_form_data l on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where (d.xm=? or d.xmid=?)\n" +
|
|
|
|
|
" and d.tenant_key=?\n" +
|
|
|
|
|
" and d.delete_type=0\n" +
|
|
|
|
|
" and l.tenant_key=?\n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key=?\n" +
|
|
|
|
|
" and p.delete_type=0 " +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
" from formtable_main_963 d \n" +
|
|
|
|
|
" inner join wfc_form_data l on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where (d.xm=? or d.xmid=?)\n" +
|
|
|
|
|
" and d.tenant_key=?\n" +
|
|
|
|
|
" and d.delete_type=0\n" +
|
|
|
|
|
" and l.tenant_key=?\n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key=?\n" +
|
|
|
|
|
" and p.delete_type=0 " +
|
|
|
|
|
" order by d.id desc " ;
|
|
|
|
|
|
|
|
|
|
log.info("dataSql:"+dataSql);
|
|
|
|
|
|
|
|
|
@ -785,16 +785,16 @@ public class ColumnsUtils {
|
|
|
|
|
recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if(CollectionUtils.isEmpty(recordList)) {
|
|
|
|
|
dataSql = " select p.requestname,l.requestid " +
|
|
|
|
|
" from formtable_main_3785 d \n" +
|
|
|
|
|
" inner join wfc_form_data l on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm=?\n" +
|
|
|
|
|
" and d.tenant_key=?\n" +
|
|
|
|
|
" and d.delete_type=0\n" +
|
|
|
|
|
" and l.tenant_key=?\n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key=?\n" +
|
|
|
|
|
" and p.delete_type=0\n" ;
|
|
|
|
|
" from formtable_main_3785 d \n" +
|
|
|
|
|
" inner join wfc_form_data l on d.id = l.dataid\n" +
|
|
|
|
|
" inner join wfc_requestbase p on p.requestid = l.requestid\n" +
|
|
|
|
|
" where d.xm=?\n" +
|
|
|
|
|
" and d.tenant_key=?\n" +
|
|
|
|
|
" and d.delete_type=0\n" +
|
|
|
|
|
" and l.tenant_key=?\n" +
|
|
|
|
|
" and l.delete_type=0\n" +
|
|
|
|
|
" and p.tenant_key=?\n" +
|
|
|
|
|
" and p.delete_type=0\n" ;
|
|
|
|
|
|
|
|
|
|
log.info("dataSql:"+dataSql);
|
|
|
|
|
|
|
|
|
@ -949,13 +949,46 @@ public class ColumnsUtils {
|
|
|
|
|
// sqlparam.add(sqlParamEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.error("queryProjectList--xm_bm:"+xm_bm);
|
|
|
|
|
if(StringUtils.isNotBlank(xm_bm)){
|
|
|
|
|
sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(xm_bm)+")" ;
|
|
|
|
|
|
|
|
|
|
String deptids = getDepartmentIds(xm_bm,tenant_key);
|
|
|
|
|
log.error("queryProjectList--deptids:"+deptids);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(deptids)){
|
|
|
|
|
sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(deptids)+")" ;
|
|
|
|
|
}else{
|
|
|
|
|
sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(xm_bm)+")" ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(xm_bm)+")" ;
|
|
|
|
|
|
|
|
|
|
// sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
// sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
// sqlParamEntity.setValue(xm_bm);
|
|
|
|
|
// sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("queryProjectList--xm_jg:"+xm_jg);
|
|
|
|
|
if(StringUtils.isNotBlank(xm_jg)){
|
|
|
|
|
sqlwhere += " and d.subcompanyid in("+SecurityUtil.ecodeForSql(xm_jg)+")" ;
|
|
|
|
|
|
|
|
|
|
String jgids = getSubCompanyIds(xm_jg,tenant_key);
|
|
|
|
|
log.error("queryProjectList-jgids:"+jgids);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(jgids)){
|
|
|
|
|
sqlwhere += " and d.subcompanyid in ("+SecurityUtil.ecodeForSql(jgids)+")" ;
|
|
|
|
|
}else{
|
|
|
|
|
sqlwhere += " and d.subcompanyid in ("+SecurityUtil.ecodeForSql(xm_jg)+")" ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// sqlwhere += " and d.subcompanyid in("+SecurityUtil.ecodeForSql(xm_jg)+")" ;
|
|
|
|
|
|
|
|
|
|
// sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
// sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
// sqlParamEntity.setValue(xm_jg);
|
|
|
|
|
// sqlparam.add(sqlParamEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("queryProjectList--xm_id:"+xm_id);
|
|
|
|
@ -970,8 +1003,8 @@ public class ColumnsUtils {
|
|
|
|
|
sqlwhere += " order by actual_val_date desc " ;
|
|
|
|
|
|
|
|
|
|
String dataSql =" select u.* from ( " +
|
|
|
|
|
" select w.*,(@i:=@i+1) as xh from (" + baseSql + sqlwhere + " ) w,(select @i:=0) b " +
|
|
|
|
|
" ) u " ;
|
|
|
|
|
" select w.*,(@i:=@i+1) as xh from (" + baseSql + sqlwhere + " ) w,(select @i:=0) b " +
|
|
|
|
|
" ) u " ;
|
|
|
|
|
log.error("queryProjectList---dataSql:"+dataSql);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam);
|
|
|
|
@ -1046,24 +1079,24 @@ public class ColumnsUtils {
|
|
|
|
|
String group_id = "4527875868755238091";
|
|
|
|
|
|
|
|
|
|
String dataSql =" select convert(m.id,char) as mainline_id,m.name as mainline_name," +
|
|
|
|
|
" convert(m.manager,char) as manager_id,e.username as manager_name, "+
|
|
|
|
|
" convert(d.id,char) as department_id,d.name as department_name,"+
|
|
|
|
|
" convert(d.subcompanyid,char) as subcompany_id,d2.name as subcompany_name,"+
|
|
|
|
|
" convert(p.rel_custom,char) as rel_custom," +
|
|
|
|
|
" p.proj_amount,p.proj_approval_date,p.actual_val_date "+
|
|
|
|
|
" from mainline m " +
|
|
|
|
|
" inner join (select distinct mainline_id,form_data_id from mainline_form_data where delete_type = 0 and tenant_key = ?) fd on fd.mainline_id = m.id "+
|
|
|
|
|
" inner join proj_pms_base p on p.form_data_id = fd.form_data_id "+
|
|
|
|
|
" inner join (select distinct mainline_id,status_id from mainline_status_custom where delete_type = 0 and tenant_key = ?) msc on msc.mainline_id = m.id and msc.status_id = m.status_id "+
|
|
|
|
|
" inner join mainline_cust_status mcs on msc.status_id = mcs.id "+
|
|
|
|
|
" inner join ( select id,username,department from eteams.employee where tenant_key = ? ) e on m.manager = e.id "+
|
|
|
|
|
" inner join ( select id,name,subcompanyid from eteams.department where type = 'department' and tenant_key = ? ) d on e.department = d.id "+
|
|
|
|
|
" inner join ( select id,name,subcompanyid from eteams.department where type = 'subcompany' and tenant_key = ? ) d2 on d.subcompanyid = d2.id "+
|
|
|
|
|
" where m.group_id = '"+group_id+"' " +
|
|
|
|
|
" and m.delete_type = 0 and m.tenant_key = ? " +
|
|
|
|
|
" and p.delete_type = 0 and p.tenant_key = ? " +
|
|
|
|
|
" and mcs.name in ('验收','结案') and mcs.tenant_key = ? "+
|
|
|
|
|
" and p.actual_val_date is not null " ;
|
|
|
|
|
" convert(m.manager,char) as manager_id,e.username as manager_name, "+
|
|
|
|
|
" convert(d.id,char) as department_id,d.name as department_name,"+
|
|
|
|
|
" convert(d.subcompanyid,char) as subcompany_id,d2.name as subcompany_name,"+
|
|
|
|
|
" convert(p.rel_custom,char) as rel_custom," +
|
|
|
|
|
" p.proj_amount,p.proj_approval_date,p.actual_val_date "+
|
|
|
|
|
" from mainline m " +
|
|
|
|
|
" inner join (select distinct mainline_id,form_data_id from mainline_form_data where delete_type = 0 and tenant_key = ?) fd on fd.mainline_id = m.id "+
|
|
|
|
|
" inner join proj_pms_base p on p.form_data_id = fd.form_data_id "+
|
|
|
|
|
" inner join (select distinct mainline_id,status_id from mainline_status_custom where delete_type = 0 and tenant_key = ?) msc on msc.mainline_id = m.id and msc.status_id = m.status_id "+
|
|
|
|
|
" inner join mainline_cust_status mcs on msc.status_id = mcs.id "+
|
|
|
|
|
" inner join ( select id,username,department from eteams.employee where tenant_key = ? ) e on m.manager = e.id "+
|
|
|
|
|
" inner join ( select id,name,subcompanyid from eteams.department where type = 'department' and tenant_key = ? ) d on e.department = d.id "+
|
|
|
|
|
" inner join ( select id,name,subcompanyid from eteams.department where type = 'subcompany' and tenant_key = ? ) d2 on d.subcompanyid = d2.id "+
|
|
|
|
|
" where m.group_id = '"+group_id+"' " +
|
|
|
|
|
" and m.delete_type = 0 and m.tenant_key = ? " +
|
|
|
|
|
" and p.delete_type = 0 and p.tenant_key = ? " +
|
|
|
|
|
" and mcs.name in ('验收','结案') and mcs.tenant_key = ? "+
|
|
|
|
|
" and p.actual_val_date is not null " ;
|
|
|
|
|
|
|
|
|
|
log.error("queryProjectSql--dataSql:"+dataSql);
|
|
|
|
|
return dataSql;
|
|
|
|
@ -1083,17 +1116,17 @@ public class ColumnsUtils {
|
|
|
|
|
if(StringUtils.isNotBlank(jtjname)){
|
|
|
|
|
|
|
|
|
|
String countSql = " select subcompanyid from ( " +
|
|
|
|
|
" select distinct subcompanyid as subcompanyid" +
|
|
|
|
|
" from eteams.department " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select td1 from uf_proj_teams " +
|
|
|
|
|
" where jtj= ? and tenant_key = ? and delete_type = 0 " +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and delete_type = 0 " +
|
|
|
|
|
" and type='department' " +
|
|
|
|
|
" and tenant_key= ? " +
|
|
|
|
|
" ) p " +
|
|
|
|
|
" where p.subcompanyid <> ? ";
|
|
|
|
|
" select distinct subcompanyid as subcompanyid" +
|
|
|
|
|
" from eteams.department " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select td1 from uf_proj_teams " +
|
|
|
|
|
" where jtj= ? and tenant_key = ? and delete_type = 0 " +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and delete_type = 0 " +
|
|
|
|
|
" and type='department' " +
|
|
|
|
|
" and tenant_key= ? " +
|
|
|
|
|
" ) p " +
|
|
|
|
|
" where p.subcompanyid <> ? ";
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
|
|
|
|
@ -1145,18 +1178,18 @@ public class ColumnsUtils {
|
|
|
|
|
List<Map<String, Object>> recordList = new ArrayList<Map<String, Object>>();
|
|
|
|
|
if(StringUtils.isNotBlank(jtjname)){
|
|
|
|
|
String countSql = " select subcompanyid from ( " +
|
|
|
|
|
" select distinct subcompanyid as subcompanyid" +
|
|
|
|
|
" from eteams.department " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select td1 from uf_proj_teams " +
|
|
|
|
|
" where jtj=? and tenant_key=?' and delete_type=0 " +
|
|
|
|
|
" and (oxmfzr=? or axmfzr=? or jtjxmfzr=?)" +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and delete_type= 0 " +
|
|
|
|
|
" and type='department' " +
|
|
|
|
|
" and tenant_key=?" +
|
|
|
|
|
" ) p " +
|
|
|
|
|
" where p.subcompanyid <> ?";
|
|
|
|
|
" select distinct subcompanyid as subcompanyid" +
|
|
|
|
|
" from eteams.department " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select td1 from uf_proj_teams " +
|
|
|
|
|
" where jtj=? and tenant_key=? and delete_type=0 " +
|
|
|
|
|
" and (oxmfzr=? or axmfzr=? or jtjxmfzr=?)" +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and delete_type= 0 " +
|
|
|
|
|
" and type='department' " +
|
|
|
|
|
" and tenant_key=?" +
|
|
|
|
|
" ) p " +
|
|
|
|
|
" where p.subcompanyid <> ?";
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
|
|
|
|
@ -1172,17 +1205,17 @@ public class ColumnsUtils {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(userid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
@ -1547,13 +1580,13 @@ public class ColumnsUtils {
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
String dataSql =" select id,username" +
|
|
|
|
|
" from eteams.employee " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select oxmfzr from uf_proj_teams where jtj=? and tenant_key=? " +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and tenant_key=? \n" +
|
|
|
|
|
" and status='normal'" +
|
|
|
|
|
" and type='inside'";
|
|
|
|
|
" from eteams.employee " +
|
|
|
|
|
" where id in( " +
|
|
|
|
|
" select oxmfzr from uf_proj_teams where jtj=? and tenant_key=? " +
|
|
|
|
|
" ) " +
|
|
|
|
|
" and tenant_key=? \n" +
|
|
|
|
|
" and status='normal'" +
|
|
|
|
|
" and type='inside'";
|
|
|
|
|
|
|
|
|
|
log.error("getSubcompanyManagerData--dataSql:"+dataSql);
|
|
|
|
|
|
|
|
|
@ -1870,7 +1903,15 @@ public class ColumnsUtils {
|
|
|
|
|
|
|
|
|
|
log.error("xm_bm:"+xm_bm);
|
|
|
|
|
if(StringUtils.isNotBlank(xm_bm)){
|
|
|
|
|
sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(xm_bm)+")" ;
|
|
|
|
|
String deptids = getDepartmentIds(xm_bm,tenant_key);
|
|
|
|
|
log.error("deptids:"+deptids);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(deptids)){
|
|
|
|
|
sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(deptids)+")" ;
|
|
|
|
|
}else{
|
|
|
|
|
sqlwhere += " and d.id in ("+SecurityUtil.ecodeForSql(xm_bm)+")" ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
// sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
@ -1880,7 +1921,16 @@ public class ColumnsUtils {
|
|
|
|
|
|
|
|
|
|
log.error("xm_jg:"+xm_jg);
|
|
|
|
|
if(StringUtils.isNotBlank(xm_jg)){
|
|
|
|
|
sqlwhere += " and d.subcompanyid in ("+SecurityUtil.ecodeForSql(xm_jg)+")" ;
|
|
|
|
|
|
|
|
|
|
String jgids = getSubCompanyIds(xm_jg,tenant_key);
|
|
|
|
|
log.error("jgids:"+jgids);
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(jgids)){
|
|
|
|
|
sqlwhere += " and d.subcompanyid in ("+SecurityUtil.ecodeForSql(jgids)+")" ;
|
|
|
|
|
}else{
|
|
|
|
|
sqlwhere += " and d.subcompanyid in ("+SecurityUtil.ecodeForSql(xm_jg)+")" ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
// sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
@ -2158,4 +2208,184 @@ public class ColumnsUtils {
|
|
|
|
|
return pvalue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getDepartmentIds(String deptid,String tenant_key){
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
String departmentids = "";
|
|
|
|
|
try{
|
|
|
|
|
if(StringUtils.isNotBlank(deptid))
|
|
|
|
|
{
|
|
|
|
|
String dataSql =" select id from eteams.department where parent in("+SecurityUtil.ecodeForSql(deptid)+") \n" +
|
|
|
|
|
" and delete_type = 0 \n" +
|
|
|
|
|
" and tenant_key=? and type = 'department' " ;
|
|
|
|
|
|
|
|
|
|
log.error("getDepartmentIds--dataSql:"+dataSql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key);
|
|
|
|
|
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) && recordList.size() >0 ) {
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> recordMap = recordList.get(i);
|
|
|
|
|
if(recordMap.containsKey("id")){
|
|
|
|
|
String id = String.valueOf(recordMap.get("id"));
|
|
|
|
|
departmentids += StringUtils.isBlank(departmentids) ? id : ","+id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(departmentids)){
|
|
|
|
|
getSecDepartmentIds(departmentids,tenant_key,departmentids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getUfPropData-Exception:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return departmentids;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void getSecDepartmentIds(String deptid,String tenant_key,String departmentids){
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
String secDepartmentIds = "";
|
|
|
|
|
try{
|
|
|
|
|
if(StringUtils.isNotBlank(deptid))
|
|
|
|
|
{
|
|
|
|
|
String dataSql =" select id from eteams.department where parent in ("+SecurityUtil.ecodeForSql(deptid)+") \n" +
|
|
|
|
|
" and delete_type = 0 \n" +
|
|
|
|
|
" and tenant_key=? and type = 'department' " ;
|
|
|
|
|
log.error("getSecDepartmentIds--dataSql:"+dataSql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key);
|
|
|
|
|
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) && recordList.size() >0 ) {
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> recordMap = recordList.get(i);
|
|
|
|
|
if(recordMap.containsKey("id")){
|
|
|
|
|
String id = String.valueOf(recordMap.get("id"));
|
|
|
|
|
secDepartmentIds += StringUtils.isBlank(secDepartmentIds) ? id : ","+id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
departmentids += StringUtils.isBlank(departmentids) ? secDepartmentIds : ","+secDepartmentIds ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(secDepartmentIds)){
|
|
|
|
|
getSecDepartmentIds(secDepartmentIds,tenant_key,departmentids);
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getUfPropData-Exception:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getSubCompanyIds(String subcompanyid,String tenant_key){
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
String subcompanyids = "";
|
|
|
|
|
try{
|
|
|
|
|
if(StringUtils.isNotBlank(subcompanyid))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
String dataSql =" select id from eteams.department where parent in("+SecurityUtil.ecodeForSql(subcompanyid)+") \n" +
|
|
|
|
|
" and delete_type = 0 \n" +
|
|
|
|
|
" and tenant_key=? and type='subcompany' " ;
|
|
|
|
|
log.error("getSubCompanyIds--dataSql:"+dataSql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key);
|
|
|
|
|
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) && recordList.size() >0 ) {
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> recordMap = recordList.get(i);
|
|
|
|
|
if(recordMap.containsKey("id")){
|
|
|
|
|
String id = String.valueOf(recordMap.get("id"));
|
|
|
|
|
subcompanyids += StringUtils.isBlank(subcompanyids) ? id : ","+id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(subcompanyids)){
|
|
|
|
|
getSecSubcompanyIds(subcompanyids,tenant_key,subcompanyids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getSubCompanyIds-Exception:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return subcompanyids;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void getSecSubcompanyIds(String subcompanyid,String tenant_key,String departmentids){
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
String secDepartmentIds = "";
|
|
|
|
|
try{
|
|
|
|
|
if(StringUtils.isNotBlank(subcompanyid))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
String dataSql =" select id from eteams.department where parent in("+SecurityUtil.ecodeForSql(subcompanyid)+") \n" +
|
|
|
|
|
" and delete_type = 0 \n" +
|
|
|
|
|
" and tenant_key=? and type = 'subcompany' " ;
|
|
|
|
|
log.error("getSecSubcompanyIds-dataSql:"+dataSql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenant_key);
|
|
|
|
|
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) && recordList.size() >0 ) {
|
|
|
|
|
for(int i=0;i<recordList.size();i++){
|
|
|
|
|
Map<String,Object> recordMap = recordList.get(i);
|
|
|
|
|
if(recordMap.containsKey("id")){
|
|
|
|
|
String id = String.valueOf(recordMap.get("id"));
|
|
|
|
|
secDepartmentIds += StringUtils.isBlank(secDepartmentIds) ? id : ","+id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
departmentids += StringUtils.isBlank(departmentids) ? secDepartmentIds : ","+secDepartmentIds ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(secDepartmentIds)){
|
|
|
|
|
getSecSubcompanyIds(secDepartmentIds,tenant_key,departmentids);
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getSecSubcompanyIds-Exception:"+e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|