|
|
|
@ -0,0 +1,217 @@
|
|
|
|
|
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.seconddev.cockpit.util.JucailinCockpitUtils;
|
|
|
|
|
import com.weaver.teams.core.orm.mybatis.Page;
|
|
|
|
|
import com.weaver.teams.domain.crm.RemoteCustomerService;
|
|
|
|
|
import com.weaver.teams.domain.crm.SimpleCustomer;
|
|
|
|
|
import com.weaver.teams.domain.user.SimpleEmployee;
|
|
|
|
|
import com.weaver.workrelate.performance.api.rest.RemotePerformanceService;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 流程、日程、协助、文档 4个类型数据
|
|
|
|
|
*
|
|
|
|
|
* @author shil
|
|
|
|
|
* @version 1.00版本
|
|
|
|
|
* @Date 2024/5/22
|
|
|
|
|
*/
|
|
|
|
|
@Component
|
|
|
|
|
public class CockpitWorkDate3TypeCmd {
|
|
|
|
|
//日志
|
|
|
|
|
private final static Logger log = LoggerFactory.getLogger(CockpitWorkDate4TypeCmd.class);
|
|
|
|
|
|
|
|
|
|
@RpcReference
|
|
|
|
|
public RemotePerformanceService remotePerformanceService;
|
|
|
|
|
|
|
|
|
|
@RpcReference
|
|
|
|
|
RemoteCustomerService remoteCustomerService;
|
|
|
|
|
|
|
|
|
|
@RpcReference
|
|
|
|
|
RemoteMainlineService remoteMainlineService ;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private JucailinCockpitUtils jucailinCockpitUtils;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private DatabaseUtils databaseUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> getDataInfo(SimpleEmployee employee, Map<String, Object> paramMap,String tenantKey) {
|
|
|
|
|
|
|
|
|
|
Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
List<SimpleMainline> projectList = new ArrayList<SimpleMainline>();
|
|
|
|
|
List<SimpleCustomer> customerList = new ArrayList<SimpleCustomer>();
|
|
|
|
|
List<Map<String,Object>> getProjectDate2 = new ArrayList<Map<String,Object>>();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
projectList = getProjectDate(employee,tenantKey);
|
|
|
|
|
customerList = getCustomerDate(employee,tenantKey);
|
|
|
|
|
getProjectDate2 = getProjectDate2(employee,tenantKey);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("PortalPerformanceInfoCmd :" + e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
recordMap.put("projectList",projectList);
|
|
|
|
|
recordMap.put("customerList",customerList);
|
|
|
|
|
recordMap.put("getProjectDate2",getProjectDate2);
|
|
|
|
|
return recordMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<SimpleMainline> getProjectDate(SimpleEmployee employee,String tenantKey) {
|
|
|
|
|
|
|
|
|
|
List<SimpleMainline> projectList = new ArrayList<SimpleMainline>(100);
|
|
|
|
|
try {
|
|
|
|
|
SimpleMainline mainline = new SimpleMainline();
|
|
|
|
|
|
|
|
|
|
Page<SimpleMainline> page = new Page<SimpleMainline>();
|
|
|
|
|
page.setPageNo(0);
|
|
|
|
|
page.setPageSize(20);
|
|
|
|
|
projectList = remoteMainlineService.search(mainline,page);
|
|
|
|
|
log.error("projectList:"+projectList.size());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("DevQuestCountCmd-Exception:" + e);
|
|
|
|
|
}
|
|
|
|
|
return projectList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
*
|
|
|
|
|
* @param employee
|
|
|
|
|
* @param tenantKey
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<SimpleCustomer> getCustomerDate(SimpleEmployee employee,String tenantKey) {
|
|
|
|
|
|
|
|
|
|
List<SimpleCustomer> customerList = new ArrayList<SimpleCustomer>(100);
|
|
|
|
|
try {
|
|
|
|
|
Page<SimpleCustomer> page = new Page<SimpleCustomer>();
|
|
|
|
|
page.setPageNo(0);
|
|
|
|
|
page.setPageSize(20);
|
|
|
|
|
Page<SimpleCustomer> customerPage = remoteCustomerService.findCustomerByTenantKey(tenantKey,page);
|
|
|
|
|
log.error("customerList:"+customerPage.getTotalCount());
|
|
|
|
|
customerList = customerPage.getResult();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("DevQuestCountCmd-Exception:" + e);
|
|
|
|
|
}
|
|
|
|
|
return customerList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String,Object>> getProjectDate2(SimpleEmployee employee, String tenantKey) {
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> projectList = new ArrayList<Map<String,Object>>();
|
|
|
|
|
String groupId = "weaver-project-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
String groupid = "4527875868755238091";
|
|
|
|
|
|
|
|
|
|
long employeeid = employee.getEmployeeId();
|
|
|
|
|
|
|
|
|
|
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 = ? \n" +
|
|
|
|
|
" and m.manager in( select id\n" +
|
|
|
|
|
" from eteams.employee \n" +
|
|
|
|
|
" where (SUPERIOR = ? or id = ?)\n" +
|
|
|
|
|
" and status='normal'\n" +
|
|
|
|
|
" and delete_type=0\n" +
|
|
|
|
|
" and password is not null\n" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and m.delete_type = 0 \n" +
|
|
|
|
|
" and m.tenant_key = ?\n" +
|
|
|
|
|
" and f.delete_type = 0 \n" +
|
|
|
|
|
" and f.tenant_key = ?\n" +
|
|
|
|
|
" and p.delete_type = 0\n" +
|
|
|
|
|
" and p.tenant_key = ?\n" +
|
|
|
|
|
" and msc.delete_type = 0\n" +
|
|
|
|
|
" and msc.tenant_key = ?\n" +
|
|
|
|
|
" and mcs.delete_type = 0\n" +
|
|
|
|
|
" and mcs.tenant_key = ?\n" +
|
|
|
|
|
" and mcs.enabled = 1 \n" +
|
|
|
|
|
" and mcs.name <> '结案'\n" +
|
|
|
|
|
" order by m.create_time desc\n" +
|
|
|
|
|
") w limit 6";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(groupid);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(employeeid+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(employeeid+"");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey+"");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
projectList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getProjectDate2-Exception:" + e);
|
|
|
|
|
}
|
|
|
|
|
return projectList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|