Commit a610a78c by 范富荣

修改门店/员工查询预警信息逻辑

1 parent ac6177da
......@@ -19,7 +19,10 @@ import cn.com.glsx.dj.strategy.dto.OperatorResponse;
import cn.com.glsx.dj.strategy.dto.SceneMerchantBaseParam;
import cn.com.glsx.dj.strategy.dto.StaffHistoryRecordDTO;
import cn.com.glsx.dj.strategy.dto.StaffSummaryDTO;
import cn.com.glsx.dj.strategy.dto.warning.WarningRecordDTO;
import cn.com.glsx.dj.strategy.dto.warning.WarningRecordQueryRequest;
import cn.com.glsx.dj.strategy.remote.StrategyInfoRemote;
import cn.com.glsx.dj.strategy.remote.WarningEngineRemote;
import cn.com.glsx.dj.strategy.request.MerchantStaffHistoryRecordRequest;
import cn.com.glsx.dj.strategy.request.MonitorDictRopRequest;
import cn.com.glsx.dj.strategy.request.MonitorFilterRopRequest;
......@@ -82,6 +85,9 @@ public class MerchantAnalysisController {
@Resource
private WarningMsgRemote warningMsgRemote;
@Resource
private WarningEngineRemote warningEngineRemote;
@ApiOperation("查询驻店员工列表")
@ServiceMethod(method = "dj.api.strategy.staff.list.analysis")
public RopResponse<List<StaffAnalysisDTO>> listStaffAnalysis(SceneMerchantBaseRequest request) {
......@@ -104,10 +110,34 @@ public class MerchantAnalysisController {
@ApiOperation("查询门店预警信息列表")
@ServiceMethod(method = "dj.api.strategy.merchant.list.warningInfo")
public RopResponse<List<String>> listMerchantWarningInfo(SceneMerchantBaseRequest request) {
public RopResponse<List<WarningRecordDTO>> listMerchantWarningInfo(SceneMerchantBaseRequest request) {
try {
SceneBaseReq req = CommonUtil.convertRequest(SceneBaseReq.class);
RpcResponse<List<String>> response = businessSceneAnalysisRemote.listMerchantWarningInfo(req);
WarningRecordQueryRequest queryRequest = new WarningRecordQueryRequest();
// 1.1 bizs -> businessType
queryRequest.setBusinessType(request.getBizs());
// 1.2 时间维度映射:自定义直接返回空列表;cycleType 2=周(W), 3=月(M)
Integer cycleType = request.getCycleType();
if (cycleType != null && cycleType == 4) {
return RopResponse.success(Collections.emptyList());
}
if (cycleType != null) {
if (cycleType == 2) {
queryRequest.setTimeDimension("W");
} else if (cycleType == 3) {
queryRequest.setTimeDimension("M");
}
}
// 1.3 开始/结束日期
queryRequest.setStartDate(request.getStartTime());
queryRequest.setEndDate(request.getEndTime());
// 1.4 monitorTarget=2(门店)
queryRequest.setMonitorTarget(2);
// 1.5 门店号取第一个
if (CollectionUtils.isNotEmpty(request.getMerchantIds())) {
queryRequest.setStoreId(request.getMerchantIds().get(0));
}
RpcResponse<List<WarningRecordDTO>> response = warningEngineRemote.findWarningDetailByStoreAndStaff(queryRequest);
if (response.hasError()) {
log.error(response.getMessage());
return RopResponse.error(response.getError(), response.getMessage());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!