#E10-39# 驾驶舱接口新增项目、客户、协作数据接口

main
shilei 11 months ago
parent 0fc698bfdc
commit df2b1b2e27

@ -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;
}
}

@ -133,7 +133,7 @@ public class JucailinCockpitController {
}
@GetMapping("/getUserData")
@GetMapping("/getUserInfo")
@WeaPermission(publicPermission = true)
public WeaResult<Object> getUserData(HttpServletRequest request){
log.error("getWorkData");
@ -142,7 +142,7 @@ public class JucailinCockpitController {
Map<String,Object> params = jucailinCockpitUtils.request2Map(request);
try{
dataList = jucailinCockpitService.getUserData(simpleEmployee,params,tenant_key);
dataList = jucailinCockpitService.getUserInfo(simpleEmployee,params,tenant_key);
}catch (Exception e){
log.error("getWorkData-Exception:"+e.getMessage());
}
@ -150,6 +150,29 @@ public class JucailinCockpitController {
}
/***
*
* @param request
* @return
*/
@GetMapping("/getUserData3Type")
@WeaPermission(publicPermission = true)
public WeaResult<Object> getUserData3Type(HttpServletRequest request){
log.error("getWorkData");
Map<String, Object> dataList = new HashMap<String, Object>();
SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
Map<String,Object> params = jucailinCockpitUtils.request2Map(request);
try{
dataList = jucailinCockpitService.getUserData3Type(simpleEmployee,params,tenant_key);
}catch (Exception e){
log.error("getWorkData-Exception:"+e.getMessage());
}
return WeaResult.success(dataList);
}
@GetMapping("/getBlogData")
@WeaPermission(publicPermission = true)

@ -16,7 +16,9 @@ public interface JucailinCockpitService {
Map<String, Object> getDocmentAnalysis(SimpleEmployee simpleEmployee,Map<String,Object> paramMap,String tenantKey);
Map<String, Object> getUserData(SimpleEmployee simpleEmployee,Map<String,Object> paramMap,String tenantKey);
Map<String, Object> getUserInfo(SimpleEmployee simpleEmployee,Map<String,Object> paramMap,String tenantKey);
Map<String, Object> getUserData3Type(SimpleEmployee simpleEmployee,Map<String,Object> paramMap,String tenantKey);
Map<String, Object> getBlogData(SimpleEmployee simpleEmployee,Map<String,Object> paramMap,String tenantKey);

@ -66,11 +66,19 @@ public class JucailinCockpitServiceimpl implements JucailinCockpitService {
}
@Override
public Map<String, Object> getUserData(SimpleEmployee simpleEmployee, Map<String, Object> paramMap, String tenantKey) {
public Map<String, Object> getUserInfo(SimpleEmployee simpleEmployee, Map<String, Object> paramMap, String tenantKey) {
Map<String,Object> dataMap = cockpitUserDataCmd.getDataInfo(simpleEmployee,paramMap,tenantKey);
return dataMap;
}
@Override
public Map<String, Object> getUserData3Type(SimpleEmployee simpleEmployee, Map<String, Object> paramMap, String tenantKey) {
Map<String,Object> dataMap = cockpitUserDataCmd.getDataInfo(simpleEmployee,paramMap,tenantKey);
return dataMap;
}
@Override
public Map<String, Object> getBlogData(SimpleEmployee simpleEmployee, Map<String, Object> paramMap, String tenantKey) {
Map<String,Object> dataMap = cockpitBlogDataCmd.getDataInfo(simpleEmployee,paramMap,tenantKey);

Loading…
Cancel
Save