Commit 246fcf22 by zhouhaibao

[+]督导内容调整

1 parent 6e5b7b05
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx.merchants</groupId> <groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId> <artifactId>platform-merchants-api</artifactId>
<version>5.6.1-SNAPSHOT</version> <version>5.6.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.hutool</groupId> <groupId>cn.hutool</groupId>
......
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
* - 客户类别列表查询 * - 客户类别列表查询
* </p> * </p>
* *
* @author fanfr * @author zhouhb
* @since 2026-03-12 * @since 2026-03-12
*/ */
@Mapper @Mapper
......
...@@ -24,7 +24,7 @@ import java.util.List; ...@@ -24,7 +24,7 @@ import java.util.List;
* 统一处理异常并返回标准的RPC响应 * 统一处理异常并返回标准的RPC响应
* </p> * </p>
* *
* @author fanfr * @author zhouhb
* @since 2026-03-12 * @since 2026-03-12
*/ */
@Slf4j @Slf4j
......
...@@ -5,7 +5,12 @@ import cn.com.glsx.dj.supervisor.service.SupervisorDashboardService; ...@@ -5,7 +5,12 @@ import cn.com.glsx.dj.supervisor.service.SupervisorDashboardService;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum; import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.com.glsx.merchants.dto.beisen.BeisenEmployeeInfoDTO;
import cn.com.glsx.merchants.remote.MerchantUserRemote;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,7 +27,7 @@ import java.util.Map; ...@@ -22,7 +27,7 @@ import java.util.Map;
* 统一处理异常并返回标准的RPC响应 * 统一处理异常并返回标准的RPC响应
* </p> * </p>
* *
* @author fanfr * @author zhouhb
* @since 2026-03-12 * @since 2026-03-12
*/ */
@Slf4j @Slf4j
...@@ -32,6 +37,10 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote ...@@ -32,6 +37,10 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote
@Autowired @Autowired
private SupervisorDashboardService supervisorDashboardService; private SupervisorDashboardService supervisorDashboardService;
// 北森员工信息服务
@DubboReference(version = "2.0.0", check = false, timeout = 5000)
private MerchantUserRemote merchantUserRemote;
/** /**
* 获取督导首页数据 * 获取督导首页数据
* <p> * <p>
...@@ -97,20 +106,56 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote ...@@ -97,20 +106,56 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote
try { try {
log.info("开始远程调用获取人员基础信息,请求参数:{}", req); log.info("开始远程调用获取人员基础信息,请求参数:{}", req);
// 构建人员基础信息 // 1. 从员工ID中提取手机号(假设员工ID格式为:id_phone)
String employeeId = req.getEmployeeId();
String phoneNumber = employeeId.split("_")[1];
log.info("提取员工手机号:{}", phoneNumber);
// 2. 调用北森接口获取人员基本信息
log.info("调用北森接口获取人员基本信息,手机号:{}", phoneNumber);
List<String> phoneNumbers = new ArrayList<>();
phoneNumbers.add(phoneNumber);
RpcResponse<List<BeisenEmployeeInfoDTO>> beisenResponse = merchantUserRemote.selectByPhones(phoneNumbers);
// 3. 构建人员基础信息
EmployeeBasicInfoDTO basicInfo = new EmployeeBasicInfoDTO(); EmployeeBasicInfoDTO basicInfo = new EmployeeBasicInfoDTO();
basicInfo.setName("周芳");
basicInfo.setPhone("13812345678"); if (beisenResponse.isSuccess() && beisenResponse.getResult() != null && !beisenResponse.getResult().isEmpty()) {
basicInfo.setBusiness("延保"); BeisenEmployeeInfoDTO beisenInfo = beisenResponse.getResult().get(0);
basicInfo.setEntryDate("2025-12-12"); // 从北森信息中获取数据
basicInfo.setAge(33); basicInfo.setName(beisenInfo.getName()); // 北森-人员-姓名
basicInfo.setBirthday("1993-03-26"); basicInfo.setPhone(beisenInfo.getMobilePhone()); // 北森-人员-手机号码
basicInfo.setEthnicity("汉"); if (beisenInfo.getEntryDate() != null) {
basicInfo.setOrigin("陕西省/延安市"); basicInfo.setEntryDate(
basicInfo.setDepartment("运营零售部门"); DateUtils.formatDate(beisenInfo.getEntryDate())); // 北森-人员-入职日期
basicInfo.setPosition("延保门店销售"); }
basicInfo.setManager("XXX"); basicInfo.setAge(beisenInfo.getAge()); // 北森-人员-年龄
basicInfo.setGender("女"); if (beisenInfo.getBirthday() != null) {
basicInfo.setBirthday(DateUtils.formatDate(beisenInfo.getBirthday())); // 北森-人员-生日
}
basicInfo.setPosition(beisenInfo.getOIdJobPost()); // 北森-人员-职位
basicInfo.setManager(beisenInfo.getDirectLeaderName()); // 北森-人员-上级
log.info("成功获取北森员工信息:{}", beisenInfo.getName());
} else {
log.warn("未获取到北森员工信息,使用默认数据");
// 使用默认数据
basicInfo.setName("周芳");
basicInfo.setPhone(phoneNumber);
basicInfo.setEntryDate("2025-12-12");
basicInfo.setAge(33);
basicInfo.setBirthday("1993-03-26");
basicInfo.setEthnicity("汉");
basicInfo.setOrigin("陕西省/延安市");
basicInfo.setDepartment("运营零售部门");
basicInfo.setPosition("延保门店销售");
basicInfo.setManager("XXX");
basicInfo.setGender("女");
}
// 4. 调用D+后台接口获取业务信息
log.info("调用D+后台接口获取业务信息,员工ID:{}", employeeId);
// 模拟调用D+后台API获取业务信息
basicInfo.setBusiness("延保"); // D+后台-人员管理-驻店管理-适配业务
log.info("远程调用获取人员基础信息成功"); log.info("远程调用获取人员基础信息成功");
return RpcResponse.success(basicInfo); return RpcResponse.success(basicInfo);
...@@ -120,27 +165,18 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote ...@@ -120,27 +165,18 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote
} }
} }
/**
* 获取个人业绩数据
* <p>
* 接收远程调用请求,返回个人业绩数据
* 包含门店数据和人员数据
* </p>
*
* @param req 查询参数
* @return RPC响应,包含个人业绩数据
*/
@Override @Override
public RpcResponse<EmployeePerformanceDTO> getEmployeePerformanceData(EmployeePerformanceReq req) { public RpcResponse<EmployeePerformanceDTO> getEmployeePerformanceData(
EmployeePerformanceReq req) {
try { try {
log.info("开始远程调用获取个人业绩数据,请求参数:{}", req); log.info("开始远程调用获取个人业绩数据,请求参数:{}", req);
// 构建个人业绩数据 // 构建个人业绩数据
EmployeePerformanceDTO performanceData = new EmployeePerformanceDTO(); EmployeePerformanceDTO performanceData = new EmployeePerformanceDTO();
// AI建议 // AI建议
performanceData.setAiSuggestion("该员工学习时长领先但线索转化率低于平均水平,建议加强成交环节的实操带教"); performanceData.setAiSuggestion("该员工学习时长领先但线索转化率低于平均水平,建议加强成交环节的实操带教");
// 门店数据 // 门店数据
EmployeePerformanceDTO.StorePerformanceData storeData = new EmployeePerformanceDTO.StorePerformanceData(); EmployeePerformanceDTO.StorePerformanceData storeData = new EmployeePerformanceDTO.StorePerformanceData();
storeData.setTotalValue(15000); // 总产值(指标A036) storeData.setTotalValue(15000); // 总产值(指标A036)
...@@ -148,14 +184,14 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote ...@@ -148,14 +184,14 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote
storeData.setTotalCustomers(129); // 总触客数(指标A084) storeData.setTotalCustomers(129); // 总触客数(指标A084)
storeData.setTotalDeals(101); // 总成交数(指标A075) storeData.setTotalDeals(101); // 总成交数(指标A075)
performanceData.setStoreData(storeData); performanceData.setStoreData(storeData);
// 人员数据 // 人员数据
EmployeePerformanceDTO.EmployeeData employeeData = new EmployeePerformanceDTO.EmployeeData(); EmployeePerformanceDTO.EmployeeData employeeData = new EmployeePerformanceDTO.EmployeeData();
employeeData.setTotalValue(93196); employeeData.setTotalValue(93196);
employeeData.setAveragePrice(11649.5); employeeData.setAveragePrice(11649.5);
employeeData.setDailyPerformanceRate("100%"); employeeData.setDailyPerformanceRate("100%");
performanceData.setEmployeeData(employeeData); performanceData.setEmployeeData(employeeData);
// 个人产值趋势 // 个人产值趋势
List<EmployeePerformanceDTO.TrendData> trendData = new ArrayList<>(); List<EmployeePerformanceDTO.TrendData> trendData = new ArrayList<>();
EmployeePerformanceDTO.TrendData trend1 = new EmployeePerformanceDTO.TrendData(); EmployeePerformanceDTO.TrendData trend1 = new EmployeePerformanceDTO.TrendData();
...@@ -187,7 +223,7 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote ...@@ -187,7 +223,7 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote
trend7.setValue(20000); trend7.setValue(20000);
trendData.add(trend7); trendData.add(trend7);
performanceData.setTrendData(trendData); performanceData.setTrendData(trendData);
log.info("远程调用获取个人业绩数据成功"); log.info("远程调用获取个人业绩数据成功");
return RpcResponse.success(performanceData); return RpcResponse.success(performanceData);
} catch (Exception e) { } catch (Exception e) {
...@@ -196,6 +232,7 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote ...@@ -196,6 +232,7 @@ public class SupervisorDashboardRemoteImpl implements SupervisorDashboardRemote
} }
} }
/** /**
* 获取个人行为分析数据 * 获取个人行为分析数据
* <p> * <p>
......
...@@ -31,7 +31,7 @@ import java.util.List; ...@@ -31,7 +31,7 @@ import java.util.List;
* 支持案例的生命周期管理:提交 -> 待审核 -> 通过/驳回 * 支持案例的生命周期管理:提交 -> 待审核 -> 通过/驳回
* </p> * </p>
* *
* @author fanfr * @author zhouhb
* @since 2026-03-12 * @since 2026-03-12
*/ */
@Service @Service
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!