Commit 8144562b by zhouhaibao

[+]新增预警管理,录音查询

1 parent b67f0102
......@@ -109,4 +109,8 @@ public class ConversationBatchDTO extends ConversationBatch implements Serializa
@ApiModelProperty(notes = "平均攻防得分")
private BigDecimal avgDefScore;
// ai导师建议
@ApiModelProperty(notes = "ai导师建议")
private String aiTutorSuggest;
}
\ No newline at end of file
......@@ -127,4 +127,11 @@ public class EarlyWarningRuleCondition {
private String ruleType;
/**
* 指标名,例如 A010
*/
@Column(name = "staff_field_name")
private String staffFieldName;
}
\ No newline at end of file
......@@ -21,5 +21,5 @@ public interface RuleMapper extends OreMapper<Rule> {
List<WarningMsgRuleModel> executePrefixSql(@Param("ruleSql") String ruleSql);
List<Rule> selectByTypeAndMetricType(Integer businessType,Integer monitorType, Integer metricTypeId);
List<Rule> selectByTypeAndMetricType(@Param("businessType") Integer businessType,@Param("monitorType") Integer monitorType, @Param("metricTypeId") Integer metricTypeId);
}
\ No newline at end of file
......@@ -369,13 +369,14 @@ public class MonitoringService {
warningMsg.setFieldName(rule.getFieldName());
if(s.getConfigValue()!=null){
log.info("返回值:{}", JSONObject.toJSONString(s));
warningMsg.setMsgDetail("周期指标:"+s.getItemValue().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)+"%,"+"兜底要求:"+s.getConfigValueOld().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)+"%");
warningMsg.setCycleIndicator(s.getItemValue().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
warningMsg.setFallbackIndicator(s.getConfigValueOld().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
if (("兜底指标").equals(rule.getRuleType())){
warningMsg.setMsgDetail("周期指标:"+s.getItemValue().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)+"%,"+"兜底要求:"+s.getConfigValueOld().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)+"%");
warningMsg.setCycleIndicator(s.getItemValue().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
warningMsg.setFallbackIndicator(s.getConfigValueOld().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP));
warningMsg.setWarningText("兜底预警:"+rule.getRule()+"低于兜底指标"+s.getConfigValueOld().multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP)+"%");
} else if (("生态系数").equals(rule.getRuleType())){
warningMsg.setWarningText("生态系数预警:"+rule.getRule()+rule.getRuleType()+"低于"+rule.getConditionValue());
warningMsg.setCycleIndicator(s.getItemValue());
warningMsg.setWarningText("生态系数预警:"+rule.getRule()+rule.getRuleType()+"低于"+s.getConfigValue());
}
}
return warningMsg;
......
......@@ -273,10 +273,13 @@ public interface ConditionStrategy {
if (earlyWarningRuleCondition.getExts()!=null){
// 如果传了,按照业务侧的分组
monitorType=earlyWarningRuleCondition.getExts().byteValue();
earlyWarningRuleCondition.setMonitorType(monitorType);
}
if(monitorType!=null){
if(monitorType.intValue()==1){
queryParams.setExts("merchantIds,staffIds");
queryParams.setItemCodes(earlyWarningRuleCondition.getStaffFieldName());
queryParams.setStaffIds(earlyWarningRuleCondition.getStaffIds());
}
if(monitorType.intValue()==2){
queryParams.setExts("merchantIds");
......
......@@ -44,6 +44,7 @@ public class NumericConditionStrategy implements ConditionStrategy {
for (ItemDetail itemDetail : itemDetails) {
BigDecimal coefficient = ecoCoefficientService.getCoefficient(itemDetail.getItemCode(), itemDetail.getItemValue().doubleValue());
itemDetail.setItemValue(coefficient);
itemDetail.setConfigValue(BigDecimal.valueOf(threshold));
}
}
}
......
......@@ -20,6 +20,7 @@
<result column="custom_time_expression" jdbcType="LONGVARCHAR" property="customTimeExpression" />
<result column="field_value_type" jdbcType="INTEGER" property="fieldValueType" />
<result column="brand_param" jdbcType="VARCHAR" property="brandParam" />
<result column="staff_field_name" jdbcType="VARCHAR" property="staffFieldName" />
</resultMap>
<sql id="Base_Column_List">
......@@ -27,7 +28,7 @@
WARNING - @mbg.generated
-->
id, field_name, operator, value_type, logical_relation, time_window, rule_id, time_unit,
continuous_days, dynamic_time_range_type, dynamic_time_range_value,value_text,custom_time_expression,field_value_type,brand_param
continuous_days, dynamic_time_range_type, dynamic_time_range_value,value_text,custom_time_expression,field_value_type,brand_param,staff_field_name
</sql>
......
......@@ -69,12 +69,12 @@
resultMap="BaseResultMap">
SELECT t1.*,t2.field_name FROM early_warning_rule t1
LEFT JOIN early_warning_rule_condition t2 ON t1.id=t2.rule_id
where 1=1 and strategy_flag=1 and del_flag='N' and
where strategy_flag=1 and t1.deleted_flag='N'
<if test="monitorType!=null">
and monitor_type_dict_id=#{monitorType}
</if>
<if test="metricTypeId!=null">
AND id=#{metricTypeId}
AND t1.id=#{metricTypeId}
</if>
group by t1.id
</select>
......
package cn.com.glsx.dj.mindworkplate.service;
import cn.com.glsx.dj.mindworkplate.dto.monitoring.MonitorBaseRequest;
import cn.com.glsx.dj.mindworkplate.dto.monitoring.MonitorFilterRequest;
import cn.com.glsx.dj.mindworkplate.dto.monitoring.StoreItemResponse;
import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfig;
......@@ -7,6 +8,9 @@ import cn.com.glsx.dj.mindworkplate.model.EmployeeWeeklyStatsDTO;
import cn.com.glsx.dj.mindworkplate.model.MonitorTypeDict;
import cn.com.glsx.dj.mindworkplate.model.WarningNotification;
import cn.com.glsx.dj.mindworkplate.model.WeekRange;
import cn.com.glsx.dj.mindworkplate.model.warning.LearningEffectAnalysisDTO;
import cn.com.glsx.dj.mindworkplate.model.warning.LearningEffectAnalysisRequest;
import cn.com.glsx.dj.mindworkplate.model.warning.MonitoringMsgDTO;
import cn.com.glsx.dj.mindworkplate.request.warning.EmployeeDailyStatsReq;
import cn.com.glsx.dj.mindworkplate.service.monitoring.MonitoringService;
import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService;
......@@ -18,6 +22,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
......@@ -142,4 +147,27 @@ public class EarlyWarningTest extends BaseServiceTest{
List<MonitorTypeDict> monitorTypeDictList = monitoringService.findMonitorTypeDictList();
System.out.println("aa"+JSONObject.toJSONString(monitorTypeDictList));
}
@Test
public void findLearningEffectAnalysis() throws ParseException {
LearningEffectAnalysisRequest request=new LearningEffectAnalysisRequest();
request.setStartDate("2024-11-01");
request.setEndDate("2024-11-18");
LearningEffectAnalysisDTO learningEffectAnalysis = monitoringService.findLearningEffectAnalysis(request);
System.out.println("aa"+JSONObject.toJSONString(learningEffectAnalysis));
}
@Test
public void findLastWarningNotification() throws ParseException {
MonitorBaseRequest request=new MonitorBaseRequest();
request.setStartDate("2025-11-01");
request.setEndDate("2025-12-31");
request.setMonitorType(1);
request.setMetricTypeId(143);
request.setBusinessType(4);
List<MonitoringMsgDTO> monitorListByCondition = monitoringService.getMonitorListByCondition(
request);
System.out.println("aa"+JSONObject.toJSONString(monitorListByCondition));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!