|
|
|
@ -4,7 +4,6 @@ package com.weaver.seconddev.cockpit.cmd;
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
|
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
|
import com.weaver.project.entity.SimpleMainline;
|
|
|
|
|
import com.weaver.project.service.RemoteMainlineService;
|
|
|
|
|
import com.weaver.seconddev.cockpit.util.DatabaseUtils;
|
|
|
|
|
import com.weaver.teams.domain.user.SimpleEmployee;
|
|
|
|
@ -70,38 +69,45 @@ public class CockpitProjectDataCmd {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
String sql =" select w.* from (\n" +
|
|
|
|
|
" select convert(m.id,char) as mainline_id,m.name as mainline_name,\n" +
|
|
|
|
|
" convert(m.manager,char) as manager_id,\n" +
|
|
|
|
|
" convert(p.rel_custom,char) as rel_custom,p.proj_amount,p.proj_approval_date,\n" +
|
|
|
|
|
" p.actual_val_date \n" +
|
|
|
|
|
" from ec_customerservice.mainline m \n" +
|
|
|
|
|
" inner JOIN ec_customerservice.mainline_form_data f ON f.mainline_id = m.id \n" +
|
|
|
|
|
" inner join ec_customerservice.proj_pms_base p on p.form_data_id = f.form_data_id \n" +
|
|
|
|
|
" inner join ec_customerservice.mainline_status_custom msc on msc.mainline_id = m.id \n" +
|
|
|
|
|
" inner join ec_customerservice.mainline_cust_status mcs on msc.status_id = mcs.id\n" +
|
|
|
|
|
" where m.group_id = '4527875868755238091' \n" +
|
|
|
|
|
" and m.manager in( select id\n" +
|
|
|
|
|
" from eteams.employee \n" +
|
|
|
|
|
" where (superior = "+employeeid+" or id = "+employeeid+")\n" +
|
|
|
|
|
" and status='normal'\n" +
|
|
|
|
|
" and delete_type=0" +
|
|
|
|
|
" and tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and password is not null\n" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and m.delete_type = 0 \n" +
|
|
|
|
|
" and m.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and f.delete_type = 0 \n" +
|
|
|
|
|
" and f.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and p.delete_type = 0\n" +
|
|
|
|
|
" and p.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and msc.delete_type = 0\n" +
|
|
|
|
|
" and msc.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and mcs.delete_type = 0\n" +
|
|
|
|
|
" and mcs.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and mcs.enabled = 1 \n" +
|
|
|
|
|
" and mcs.name <> '结案'\n" +
|
|
|
|
|
" order by m.create_time desc\n" +
|
|
|
|
|
") w limit 6";
|
|
|
|
|
" select convert(m.id,char) as mainline_id,m.name as mainline_name,\n" +
|
|
|
|
|
" convert(m.manager,char) as manager_id,e.username as manager_name,d.id as departmentid,d.name as departmentname,\n" +
|
|
|
|
|
" convert(p.rel_custom,char) as rel_custom,p.proj_amount,p.proj_approval_date,\n" +
|
|
|
|
|
" p.actual_val_date \n" +
|
|
|
|
|
" from ec_customerservice.mainline m \n" +
|
|
|
|
|
" inner JOIN ec_customerservice.mainline_form_data f ON f.mainline_id = m.id \n" +
|
|
|
|
|
" inner join ec_customerservice.proj_pms_base p on p.form_data_id = f.form_data_id \n" +
|
|
|
|
|
" inner join ec_customerservice.mainline_status_custom msc on msc.mainline_id = m.id \n" +
|
|
|
|
|
" inner join ec_customerservice.mainline_cust_status mcs on msc.status_id = mcs.id\n" +
|
|
|
|
|
" left join eteams.employee e ON m.manager = e.id \n" +
|
|
|
|
|
" left join eteams.department d ON e.department = d.id \n" +
|
|
|
|
|
" where m.group_id = '4527875868755238091' \n" +
|
|
|
|
|
" and m.manager in( select id\n" +
|
|
|
|
|
" from eteams.employee \n" +
|
|
|
|
|
" where (superior = "+employeeid+" or id = "+employeeid+")\n" +
|
|
|
|
|
" and status='normal'\n" +
|
|
|
|
|
" and delete_type=0 " +
|
|
|
|
|
" and tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and e.status = 'normal' " +
|
|
|
|
|
" and d.type='department' " +
|
|
|
|
|
" and mcs.name <> '结案'" +
|
|
|
|
|
" and m.delete_type = 0 \n" +
|
|
|
|
|
" and m.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and f.delete_type = 0 \n" +
|
|
|
|
|
" and f.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and p.delete_type = 0\n" +
|
|
|
|
|
" and p.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and msc.delete_type = 0\n" +
|
|
|
|
|
" and msc.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and mcs.delete_type = 0\n" +
|
|
|
|
|
" and mcs.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and mcs.enabled = 1 \n" +
|
|
|
|
|
" and e.delete_type = 0 \n" +
|
|
|
|
|
" and e.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" and d.delete_type = 0 \n" +
|
|
|
|
|
" and d.tenant_key = '"+tenantKey+"'\n" +
|
|
|
|
|
" order by m.create_time desc\n" +
|
|
|
|
|
") w limit 6";
|
|
|
|
|
|
|
|
|
|
log.error("sql:"+sql);
|
|
|
|
|
|
|
|
|
@ -134,7 +140,7 @@ public class CockpitProjectDataCmd {
|
|
|
|
|
|
|
|
|
|
String sql =" select w.* from (\n" +
|
|
|
|
|
" select convert(m.id,char) as mainline_id,m.name as mainline_name,\n" +
|
|
|
|
|
" convert(m.manager,char) as manager_id,\n" +
|
|
|
|
|
" convert(m.manager,char) as manager_id,e.username as manager_name,d.id as departmentid,d.name as departmentname,\n" +
|
|
|
|
|
" convert(p.rel_custom,char) as rel_custom,p.proj_amount,p.proj_approval_date,\n" +
|
|
|
|
|
" p.actual_val_date \n" +
|
|
|
|
|
" from ec_customerservice.mainline m \n" +
|
|
|
|
@ -142,6 +148,8 @@ public class CockpitProjectDataCmd {
|
|
|
|
|
" inner join ec_customerservice.proj_pms_base p on p.form_data_id = f.form_data_id \n" +
|
|
|
|
|
" inner join ec_customerservice.mainline_status_custom msc on msc.mainline_id = m.id \n" +
|
|
|
|
|
" inner join ec_customerservice.mainline_cust_status mcs on msc.status_id = mcs.id\n" +
|
|
|
|
|
" left join eteams.employee e ON m.manager = e.id \n" +
|
|
|
|
|
" left join eteams.department d ON e.department = d.id \n" +
|
|
|
|
|
" where m.group_id = ? \n" +
|
|
|
|
|
" and m.manager in( select id\n" +
|
|
|
|
|
" from eteams.employee \n" +
|
|
|
|
@ -149,8 +157,10 @@ public class CockpitProjectDataCmd {
|
|
|
|
|
" and status='normal'\n" +
|
|
|
|
|
" and delete_type=0" +
|
|
|
|
|
" and tenant_key = ?\n" +
|
|
|
|
|
" and password is not null\n" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and e.status = 'normal' " +
|
|
|
|
|
" and d.type='department' " +
|
|
|
|
|
" and mcs.name <> '结案'\n" +
|
|
|
|
|
" and m.delete_type = 0 \n" +
|
|
|
|
|
" and m.tenant_key = ?\n" +
|
|
|
|
|
" and f.delete_type = 0 \n" +
|
|
|
|
@ -162,7 +172,11 @@ public class CockpitProjectDataCmd {
|
|
|
|
|
" and mcs.delete_type = 0\n" +
|
|
|
|
|
" and mcs.tenant_key = ?\n" +
|
|
|
|
|
" and mcs.enabled = 1 \n" +
|
|
|
|
|
" and mcs.name <> '结案'\n" +
|
|
|
|
|
" and e.delete_type = 0 \n" +
|
|
|
|
|
" and e.tenant_key = ? \n" +
|
|
|
|
|
" and d.delete_type = 0 \n" +
|
|
|
|
|
" and d.tenant_key = ?\n" +
|
|
|
|
|
|
|
|
|
|
" order by m.create_time desc\n" +
|
|
|
|
|
") w limit 6";
|
|
|
|
|
|
|
|
|
@ -214,6 +228,16 @@ public class CockpitProjectDataCmd {
|
|
|
|
|
sqlParamEntity.setValue(tenantKey+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
projectList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
|
|
|
|
|