Commit b9b9699f by 叶立庆

Merge branch 'v5.6.1' into 'master'

上线合并

See merge request !6
2 parents 1d8d5ebc 08764bbe
Showing 81 changed files with 3305 additions and 82 deletions
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</parent> </parent>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.5.3-SNAPSHOT</version> <version>5.6.1-SNAPSHOT</version>
<name>rpc-dj-mindworkplate-api</name> <name>rpc-dj-mindworkplate-api</name>
<properties> <properties>
<deploy.scanPackage>cn.com.glsx.remote</deploy.scanPackage> <deploy.scanPackage>cn.com.glsx.remote</deploy.scanPackage>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.5.3-SNAPSHOT</version> <version>5.6.1-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
......
...@@ -2,11 +2,10 @@ package cn.com.glsx.dj.mindworkplate.dto; ...@@ -2,11 +2,10 @@ package cn.com.glsx.dj.mindworkplate.dto;
import cn.com.glsx.dj.mindworkplate.model.ConversationBatch; import cn.com.glsx.dj.mindworkplate.model.ConversationBatch;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import lombok.Data; import lombok.Data;
...@@ -18,20 +17,25 @@ public class ConversationBatchDTO extends ConversationBatch implements Serializa ...@@ -18,20 +17,25 @@ public class ConversationBatchDTO extends ConversationBatch implements Serializa
/** /**
* 接待日期 * 接待日期
*/ */
@ApiModelProperty(notes = "接待日期")
private String receptionDate; private String receptionDate;
/** /**
* 电话 * 电话
*/ */
@ApiModelProperty(notes = "客户电话")
private String phoneNumber; private String phoneNumber;
/** /**
* 电话 * 电话
*/ */
@ApiModelProperty(notes = "客户姓名")
private String customerName; private String customerName;
/** /**
* 车型 * 车型
*/ */
@ApiModelProperty(notes = "车型")
private String carModel; private String carModel;
...@@ -102,4 +106,21 @@ public class ConversationBatchDTO extends ConversationBatch implements Serializa ...@@ -102,4 +106,21 @@ public class ConversationBatchDTO extends ConversationBatch implements Serializa
private Date receptionStartTime; private Date receptionStartTime;
private String merchantName; private String merchantName;
@ApiModelProperty(notes = "平均质检得分")
private BigDecimal avgScore;
@ApiModelProperty(notes = "平均攻防得分")
private BigDecimal avgDefScore;
// ai导师建议
@ApiModelProperty(notes = "ai导师建议")
private String aiTutorSuggest;
/**
* 持续时长,单位毫秒
*/
@ApiModelProperty(notes = "录音时长")
private Long durationTime;
} }
\ No newline at end of file \ No newline at end of file
...@@ -74,6 +74,10 @@ public class EmployeeBadgeV2DTO implements Serializable { ...@@ -74,6 +74,10 @@ public class EmployeeBadgeV2DTO implements Serializable {
@ApiModelProperty(notes = "质检商户号") @ApiModelProperty(notes = "质检商户号")
private String merchantNo; private String merchantNo;
@ApiModelProperty(notes = "质检商户号")
private String merchantId;
/** /**
* 录音开始时间 yyyy-MM-dd HH:mm:ss * 录音开始时间 yyyy-MM-dd HH:mm:ss
*/ */
......
package cn.com.glsx.dj.mindworkplate.dto;
import lombok.Data;
@Data
public class MerchantIdSceneDTO {
/**
* 商户号
*/
private Integer merchantId;
/**
* 场景
*/
private Integer sceneType;
}
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
/**
* 模块类型详情处理器接口
* 根据module_type查询不同的业务详情
*/
public interface ModuleTypeDetailHandler {
/**
* 根据消息对象获取详情
* @param padMessageBox 消息对象
* @return 详情对象
*/
Object getDetail(PadMessageBox padMessageBox);
/**
* 更新业务消息状态
* @param padMessageBox 消息对象
*/
void updateBusinessStatus(PadMessageBox padMessageBox);
/**
* 获取处理器支持的模块类型
* @return 模块类型
*/
Integer getModuleType();
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 模块未读消息数量DTO
*/
@Data
public class ModuleUnreadCountDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("模块类型")
private Integer moduleType;
@ApiModelProperty("未读消息数量")
private Long unreadCount;
public ModuleUnreadCountDTO() {
}
public ModuleUnreadCountDTO(Integer moduleType, Long unreadCount) {
this.moduleType = moduleType;
this.unreadCount = unreadCount;
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 按模块类型分组查询未读消息的查询条件DTO
*/
@Data
public class ModuleUnreadQueryDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("模块类型列表")
private List<Integer> moduleTypes;
@ApiModelProperty("业务场景:0-延保,1-精品, 2-权益")
private Integer businessType;
@ApiModelProperty("手机号")
private String phone;
public ModuleUnreadQueryDTO() {
}
public ModuleUnreadQueryDTO(List<Integer> moduleTypes, Integer businessType, String phone) {
this.moduleTypes = moduleTypes;
this.businessType = businessType;
this.phone = phone;
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @Title:
* @Description: 新消息盒子数据对象DTO
* @Author xiehx
* @Date 2026/1/19
**/
@Data
public class NewPadMessageBoxDTO extends PadMessageBox {
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdTime;
@ApiModelProperty(notes = "消息详情-业务方消息详情。根据moduleType返回不同数据结构,6-学习类策略数据结构-PmbLearningTaskBaseDetailDTO,7-优秀案例分享策略数据结构,8-任务型策略数据结构-PmbEnterpriseDetailDTO")
private Object msgDetail;
/**
* 根据创建时间排序方式:0-顺序,1-倒序,默认1
*/
@ApiModelProperty(notes = "根据创建时间排序方式:0-顺序,1-倒序,默认1")
private Integer createdTimeSortType;
}
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Title:
* @Description: 系统通知/企业通知 业务消息详细通用DTO
* @Author xiehx
* @Date 2026/1/19
**/
@Data
public class PmbEnterpriseDetailDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 业务主键ID
*/
@ApiModelProperty(notes = "业务主键ID")
private Integer id;
@ApiModelProperty(notes = "所属消息盒子消息模块分类:0-系统通知,1-优秀话术,2-话术预警,3-ai导师(短课程), 4-学习任务(长课程),5-活动中心,6-学习类策略,7-优秀案例分享策略,8-任务型策略")
private Integer moduleType;
/**
* 标题
*/
@ApiModelProperty(notes = "标题")
private String title;
/**
* 消息推送时间
*/
@ApiModelProperty(notes = "消息推送时间")
private Date actualSendTime;
/**
* 副标题
*/
@ApiModelProperty(notes = "副标题")
private String subtitle;
/**
* 内容类型(1:图文,2:视频,3:pdf)
*/
@ApiModelProperty(notes = "内容类型(1:图文,2:视频,3:pdf)")
private Byte contentType;
/**
* 内容
*/
@ApiModelProperty(notes = "内容")
private String content;
}
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 学习类业务消息基础详情通用DTO(目前:学习类策略、优秀案例分享策略)
*/
@Data
public class PmbLearningTaskBaseDetailDTO<T> implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "任务id")
private Integer taskId;
@ApiModelProperty(notes = "任务标题")
private String taskTitle;
/**
* 任务进度
*/
@ApiModelProperty(notes = "任务进度")
private BigDecimal taskProgress;
/**
* 任务总数
*/
@ApiModelProperty(notes = "任务总数")
private Integer courseTotalCount;
/**
* 累计时长,分钟数
*/
@ApiModelProperty(notes = "累计时长,分钟数")
private BigDecimal totalDuration;
@ApiModelProperty(notes = "任务配置完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date taskDeadline;
@ApiModelProperty(notes = "任务实际完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date finishDate;
/**
* 完成状态
*/
@ApiModelProperty(notes = "任务完成状态 0=待完成 1=已完成")
private Integer completeStatus;
@ApiModelProperty(notes = "学习课程列表(课程-PmbStaffCourseDetailDTO、案例-ConversationBatchDTO)")
private List<T> courseList;
}
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import javax.persistence.Column;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 员工-课程 当前情况DTO
*/
@Data
@SuperBuilder
@ToString
@NoArgsConstructor
public class PmbStaffCourseDetailDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(notes = "课程id")
private String courseId;
/**
* 课程名称
*/
@ApiModelProperty(notes = "课程名称")
@Column(name = "course_name")
private String courseName;
/**
* 学习状态
* @see cn.com.glsx.dj.smartcarlife.enums.study.StaffStudyCourseStatusEnum
*/
@ApiModelProperty(notes = "学习状态|进度")
@Column(name = "status")
private Byte status;
/**
* 学习进度(百分比)
* 示例值: 0.6 表示 60%
*/
@ApiModelProperty(notes = "学习进度(百分比) 示例值: 0.6 表示 60%")
@Column(name = "progress")
private BigDecimal progress;
/**
* 成绩
*/
@ApiModelProperty(notes = "成绩")
@Column(name = "total_score")
private BigDecimal totalScore;
/**
* 课程时长(分钟)
*/
@ApiModelProperty(notes = "课程时长(分钟)")
@Column(name = "learn_duration")
private BigDecimal learnDuration;
/**
* 完成时间
*/
@ApiModelProperty(notes = "完成时间")
@Column(name = "finish_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date finishDate;
}
package cn.com.glsx.dj.mindworkplate.dto.monitoring;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 盯防指标筛选请求参数
*/
@Data
@Accessors(chain = true)
public class MonitorBaseRequest implements java.io.Serializable{
/**
* 业务 1.延保 2.轻改 3.权益
*/
@NotNull
private Integer businessType;
/**
* 盯防类型:1=兜底指标(默认),2=生态系数
*/
private Integer monitorType;
/**
* 指标类型ID
*/
private Integer metricTypeId;
/**
* 日期类型:0,按日;1,按周;2,按月;3,按年;4,自定义;
*/
@NotNull
private Integer periodType;
/**
* 开始日期,格式:yyyy-MM-dd
*/
@NotNull
private String startDate;
/**
* 结束日期,格式:yyyy-MM-dd
*/
@NotNull
private String endDate;
/**
* 商户ID列表
*/
List<Integer> merchantIds;
/**
* 用户ID
*/
private List<String> uuidLists;
/**
* 分组类型,如果不传默认策略配置的类型,1.员工 2.门店
*/
private Integer exts;
/**
* 是否查询下一时间段数据
*/
private boolean findNextTimeDataFlag=false;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.dto.monitoring;
import lombok.Data;
import java.util.List;
/**
* 盯防指标筛选请求参数
*/
@Data
public class MonitorFilterRequest extends MonitorBaseRequest{
/**
* 区域ID:0=全部,其他为省份整型ID(如内部编码)
*/
private Integer regionId ;
/**
* 品牌ID列表:空列表表示“全部”,支持一级品牌ID
*/
private List<Integer> firstbrandIds;
/**
* 二级品牌ids
*/
private List<Integer> twoBrandIds;
/**
* 区域运营员工ID
*/
private String regionalOperatorId ;
/**
* 线上运营员工ID
*/
private String onlineOperatorId;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.dto.monitoring;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.Data;
import java.util.List;
/**
* 单个门店展示信息
*/
@Data
public class StoreItemResponse implements Serializable {
/**
* 商户号
*/
@ApiModelProperty(notes = "商户号")
private String merchantNo;
/**
* 门店名称(商户名称)
*/
@ApiModelProperty(notes = "门店名称(商户名称)")
private String storeName;
/**
* 主营品牌(一级-子品牌),多个用 "/" 拼接,前端控制显示长度 + 悬浮窗
* 示例:"丰田-凯美瑞/本田-雅阁"
*/
@ApiModelProperty(notes = "主营品牌(一级-子品牌),多个用 \"/\" 拼接,前端控制显示长度 + 悬浮窗")
private String mainBrands; // 如 "丰田-凯美瑞/本田-雅阁"
/**
* 线上运营人员姓名,多个用 "/" 拼接
* 示例:"张三/李四"
*/
@ApiModelProperty(notes = "线上运营人员姓名,多个用 \"/\" 拼接")
private String onlineOperators;
/**
* 区域运营人员姓名,多个用 "/" 拼接
* 示例:"王五/赵六"
*/
@ApiModelProperty(notes = "区域运营人员姓名,多个用 \"/\" 拼接")
private String regionalOperators;
/**
* 预警事项摘要:最多展示2条,用于列表快速预览
* 示例:
* - "「转化率」低于兜底目标「80%」"
* - "「生态系数-活跃度」低于「0.6」"
*/
@ApiModelProperty(notes = "预警事项摘要:最多展示2条,用于列表快速预览")
private List<String> warningSummary;
/**
* 当前门店在当前筛选条件下存在的预警事项总数量
*/
@ApiModelProperty(notes = "当前门店在当前筛选条件下存在的预警事项总数量")
private int warningTotalCount;
}
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ import java.util.Date; ...@@ -9,7 +9,7 @@ import java.util.Date;
@Data @Data
public class PadMessageSummaryDetail implements Serializable { public class PadMessageSummaryDetail implements Serializable {
@ApiModelProperty(notes = "消息类型,0-系统通知,1-优秀话术,2-话术预警,3-短课程,4-长课程") @ApiModelProperty(notes = "消息类型,0-系统通知,1-优秀话术,2-话术预警,3-短课程,4-长课程,7-优秀案例分享策略")
private Integer moduleType; private Integer moduleType;
@ApiModelProperty(notes = "创建日期") @ApiModelProperty(notes = "创建日期")
......
package cn.com.glsx.dj.mindworkplate.dto.warning;
import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory;
import lombok.Data;
/**
* @Title:
* @Description: 门店指标历史记录DTO
* @Author xiehx
* @Date 2026/1/19
**/
@Data
public class EarlyWarningThresholdConfigHistoryDTO extends EarlyWarningThresholdConfigHistory {
}
...@@ -19,7 +19,9 @@ public enum MindWorkplateServiceErrorEnum implements ErrorEnum { ...@@ -19,7 +19,9 @@ public enum MindWorkplateServiceErrorEnum implements ErrorEnum {
COMMON_ERROR("10086", "{}"), COMMON_ERROR("10086", "{}"),
DATA_NOT_FULL_ERROR("10001000", "数据不完整!"); DATA_NOT_FULL_ERROR("10001000", "数据不完整!"),
BUSINESS_EXCEPTION("10001001", "业务异常"),
;
private final String value; private final String value;
private final String displayName; private final String displayName;
......
...@@ -12,14 +12,25 @@ import lombok.Getter; ...@@ -12,14 +12,25 @@ import lombok.Getter;
@AllArgsConstructor @AllArgsConstructor
@Getter @Getter
public enum ModuleTypeEnums { public enum ModuleTypeEnums {
//模块分类:0-系统通知,1-优秀话术,2-话术预警,3-AI导师(短课程),4-学习任务(长课程) // 模块分类:0-系统通知,1-优秀话术,2-话术预警,3-ai导师(短课程), 4-学习任务(长课程),5-活动中心,6-学习类策略,7-优秀案例分享策略,8-任务型策略
/** 系统通知 */
SYSTEM_NOTICE(0, "系统通知"), SYSTEM_NOTICE(0, "系统通知"),
/** 优秀话术 */
SCRIPT_EXCELLENT(1, "优秀话术"), SCRIPT_EXCELLENT(1, "优秀话术"),
/** 话术预警 */
SCRIPT_WARN(2, "话术预警"), SCRIPT_WARN(2, "话术预警"),
/** AI导师(短课程) */
AI_MENTOR(3, "AI导师"), AI_MENTOR(3, "AI导师"),
/** 学习任务(长课程) */
STUDY_TASK(4, "学习任务"), STUDY_TASK(4, "学习任务"),
/** 活动中心 */ /** 活动中心 */
ACTIVITY_CENTER(5, "活动中心"), ACTIVITY_CENTER(5, "活动中心"),
/** 学习类策略 */
LEARNING_POLICY(6, "学习类策略"),
/** 优秀案例分享策略 */
EXCELLENT_CASE_POLICY(7, "优秀案例分享策略"),
/** 任务型策略 */
TASK_POLICY(8, "任务型策略")
; ;
private final Integer code; private final Integer code;
......
package cn.com.glsx.dj.mindworkplate.enums.messagebox;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 提醒类型枚举
*
* @Description 消息盒子提醒类型
* @Author system
* @Date 2026/01/16
* @Version 1.0
*/
@AllArgsConstructor
@Getter
public enum ReminderTypeEnums {
// 提醒类型:1-首次提醒,2-进度提醒
/** 首次提醒 */
FIRST_REMINDER((byte) 1, "首次提醒"),
/** 进度提醒 */
PROGRESS_REMINDER((byte) 2, "进度提醒");
private final Byte code;
private final String name;
/**
* 根据code获取名称
*
* @param code 提醒类型编码
* @return 提醒类型名称
*/
public static String getName(Byte code) {
for (ReminderTypeEnums item : values()) {
if (item.getCode().equals(code)) {
return item.getName();
}
}
return null;
}
/**
* 根据name获取code
*
* @param name 提醒类型名称
* @return 提醒类型编码
*/
public static Byte getCode(String name) {
for (ReminderTypeEnums item : values()) {
if (item.getName().equals(name)) {
return item.getCode();
}
}
return null;
}
/**
* 验证code是否有效
*
* @param code 提醒类型编码
* @return 是否有效
*/
public static boolean isValid(Byte code) {
if (code == null) {
return false;
}
for (ReminderTypeEnums item : values()) {
if (item.getCode().equals(code)) {
return true;
}
}
return false;
}
}
...@@ -51,6 +51,7 @@ public class ConversationBatch implements Serializable { ...@@ -51,6 +51,7 @@ public class ConversationBatch implements Serializable {
/** /**
* 持续时长,单位毫秒 * 持续时长,单位毫秒
*/ */
@ApiModelProperty(notes = "录音时长")
private String duration; private String duration;
/** /**
......
...@@ -117,5 +117,21 @@ public class EarlyWarningRuleCondition { ...@@ -117,5 +117,21 @@ public class EarlyWarningRuleCondition {
@Transient @Transient
private String endDate; private String endDate;
/**
* 分组类型,如果不传默认策略配置的类型,1.员工 2.门店
*/
@Transient
private Integer exts;
@Transient
private String ruleType;
/**
* 指标名,例如 A010
*/
@Column(name = "staff_field_name")
private String staffFieldName;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import lombok.Data;
/**
* 门店-指标历史记录表
*/
@Table(name = "early_warning_threshold_config_history")
@Data
public class EarlyWarningThresholdConfigHistory implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
/**
* 记录年月(YYYY-MM格式)
*/
@Column(name = "record_year_month")
@ApiModelProperty(notes = "记录年月(YYYY-MM格式)")
private String recordYearMonth;
/**
* 商户号
*/
@Column(name = "merchant_no")
private String merchantNo;
/**
* 延保转化率
*/
@Column(name = "ew_con_rate")
@ApiModelProperty(notes = "延保转化率")
private BigDecimal ewConRate;
/**
* 延保安心包转化率
*/
@Column(name = "ew_axb_con_rate")
@ApiModelProperty(notes = "延保安心包转化率")
private BigDecimal ewAxbConRate;
/**
* 延保轮胎转化率
*/
@Column(name = "ew_lt_con_rate")
@ApiModelProperty(notes = "延保轮胎转化率")
private BigDecimal ewLtConRate;
/**
* 延保电池转化率
*/
@Column(name = "battery_conversion_rate")
@ApiModelProperty(notes = "延保电池转化率")
private BigDecimal batteryConversionRate;
/**
* 权益转化率
*/
@Column(name = "ri_con_rate")
@ApiModelProperty(notes = "权益转化率")
private BigDecimal riConRate;
/**
* 延保渗透率
*/
@Column(name = "ew_penetration_rate")
@ApiModelProperty(notes = "延保渗透率")
private BigDecimal ewPenetrationRate;
/**
* 延保安心包渗透率
*/
@Column(name = "ew_axb_penetration_rate")
@ApiModelProperty(notes = "延保安心包渗透率")
private BigDecimal ewAxbPenetrationRate;
/**
* 延保轮胎渗透率
*/
@Column(name = "ew_lt_penetration_rate")
@ApiModelProperty(notes = "延保轮胎渗透率")
private BigDecimal ewLtPenetrationRate;
/**
* 延保电池渗透率
*/
@Column(name = "battery_penetration_rate")
@ApiModelProperty(notes = "延保电池渗透率")
private BigDecimal batteryPenetrationRate;
/**
* 创建时间
*/
@Column(name = "created_date")
private Date createdDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@Column(name = "deleted_flag")
private String deletedFlag;
}
package cn.com.glsx.dj.mindworkplate.model;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
@Table(name = "eco_coefficient_rule")
public class EcoCoefficientRule {
/**
* 主键
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 指标编码,如 A091, A077
*/
@Column(name = "indicator_code")
private String indicatorCode;
/**
* 渗透率下限(含),范围 [0.0000, 1.0000]
*/
@Column(name = "min_penetration")
private BigDecimal minPenetration;
/**
* 渗透率上限(不含),NULL 表示无穷大
*/
@Column(name = "max_penetration")
private BigDecimal maxPenetration;
/**
* 生态系数
*/
private BigDecimal coefficient;
/**
* 排序字段,用于区间顺序
*/
@Column(name = "sort_order")
private Integer sortOrder;
/**
* 是否启用:1-是,0-否
*/
private Boolean enabled;
@Column(name = "create_time")
private Date createTime;
@Column(name = "update_time")
private Date updateTime;
/**
* 获取主键
*
* @return id - 主键
*/
public Long getId() {
return id;
}
/**
* 设置主键
*
* @param id 主键
*/
public void setId(Long id) {
this.id = id;
}
/**
* 获取指标编码,如 A091, A077
*
* @return indicator_code - 指标编码,如 A091, A077
*/
public String getIndicatorCode() {
return indicatorCode;
}
/**
* 设置指标编码,如 A091, A077
*
* @param indicatorCode 指标编码,如 A091, A077
*/
public void setIndicatorCode(String indicatorCode) {
this.indicatorCode = indicatorCode == null ? null : indicatorCode.trim();
}
/**
* 获取渗透率下限(含),范围 [0.0000, 1.0000]
*
* @return min_penetration - 渗透率下限(含),范围 [0.0000, 1.0000]
*/
public BigDecimal getMinPenetration() {
return minPenetration;
}
/**
* 设置渗透率下限(含),范围 [0.0000, 1.0000]
*
* @param minPenetration 渗透率下限(含),范围 [0.0000, 1.0000]
*/
public void setMinPenetration(BigDecimal minPenetration) {
this.minPenetration = minPenetration;
}
/**
* 获取渗透率上限(不含),NULL 表示无穷大
*
* @return max_penetration - 渗透率上限(不含),NULL 表示无穷大
*/
public BigDecimal getMaxPenetration() {
return maxPenetration;
}
/**
* 设置渗透率上限(不含),NULL 表示无穷大
*
* @param maxPenetration 渗透率上限(不含),NULL 表示无穷大
*/
public void setMaxPenetration(BigDecimal maxPenetration) {
this.maxPenetration = maxPenetration;
}
/**
* 获取生态系数
*
* @return coefficient - 生态系数
*/
public BigDecimal getCoefficient() {
return coefficient;
}
/**
* 设置生态系数
*
* @param coefficient 生态系数
*/
public void setCoefficient(BigDecimal coefficient) {
this.coefficient = coefficient;
}
/**
* 获取排序字段,用于区间顺序
*
* @return sort_order - 排序字段,用于区间顺序
*/
public Integer getSortOrder() {
return sortOrder;
}
/**
* 设置排序字段,用于区间顺序
*
* @param sortOrder 排序字段,用于区间顺序
*/
public void setSortOrder(Integer sortOrder) {
this.sortOrder = sortOrder;
}
/**
* 获取是否启用:1-是,0-否
*
* @return enabled - 是否启用:1-是,0-否
*/
public Boolean getEnabled() {
return enabled;
}
/**
* 设置是否启用:1-是,0-否
*
* @param enabled 是否启用:1-是,0-否
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
* @return create_time
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* @return update_time
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* @param updateTime
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model;
import cn.com.glsx.dj.mindworkplate.model.warning.Rule;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import lombok.Data;
@Table(name = "monitor_type_dict")
@Data
public class MonitorTypeDict implements Serializable {
@Id
@Column(name = "id")
@ApiModelProperty(notes = "盯防类型ID")
private Integer id;
/**
* 盯防类型编码:1-兜底指标,2-生态系数
*/
@Id
@Column(name = "type_code")
@ApiModelProperty(notes = "盯防类型编码:1-兜底指标,2-生态系数")
private Byte typeCode;
/**
* 类型名称
*/
@Column(name = "type_name")
@ApiModelProperty(notes = "类型名称")
private String typeName;
/**
* 描述
*/
@Column(name = "description")
@ApiModelProperty(notes = "描述")
private String description;
/**
* 排序
*/
@Column(name = "sort_order")
@ApiModelProperty(notes = "排序")
private Integer sortOrder;
/**
* 是否启用:1-启用,0-禁用
*/
@Column(name = "is_enabled")
@ApiModelProperty(notes = "是否启用:1-启用,0-禁用")
private Boolean enabled;
@Column(name = "create_time")
@ApiModelProperty(notes = "创建时间")
private Date createTime;
@Transient
@ApiModelProperty(notes = "规则")
private List<Rule> rules;
}
\ No newline at end of file \ No newline at end of file
...@@ -23,16 +23,18 @@ public class PadMessageBox implements Serializable { ...@@ -23,16 +23,18 @@ public class PadMessageBox implements Serializable {
private Integer id; private Integer id;
/** /**
* 模块分类:0-系统通知,1-优秀话术,2-话术预警,3-AI导师 * 模块分类:0-系统通知,1-优秀话术,2-话术预警,3-ai导师(短课程), 4-学习任务(长课程),5-活动中心,6-学习类策略,7-优秀案例分享策略,8-任务型策略
* @see ModuleTypeEnums * @see ModuleTypeEnums
*/ */
@ApiModelProperty(notes = "模块分类:0-系统通知,1-优秀话术,2-话术预警,3-ai导师(短课程), 4-学习任务(长课程),5-活动中心,6-学习类策略,7-优秀案例分享策略,8-任务型策略")
@Column(name = "module_type") @Column(name = "module_type")
private Integer moduleType; private Integer moduleType;
/** /**
* 业务场景:0-延保,1-精品 * 业务场景:0-延保,1-精品, 2-权益
* @see BusinessTypeEnums * @see BusinessTypeEnums
*/ */
@ApiModelProperty(notes = "业务场景:0-延保,1-精品, 2-权益")
@Column(name = "business_type") @Column(name = "business_type")
private Integer businessType; private Integer businessType;
...@@ -114,4 +116,35 @@ public class PadMessageBox implements Serializable { ...@@ -114,4 +116,35 @@ public class PadMessageBox implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date latestReadTime; private Date latestReadTime;
/**
* 提醒类型:1-首次提醒,2-进度提醒
* @see cn.com.glsx.dj.mindworkplate.enums.messagebox.ReminderTypeEnums
*/
@ApiModelProperty(notes = "提醒类型:1-首次提醒,2-进度提醒")
@Column(name = "reminder_type")
private Byte reminderType;
/**
* 消息标题
*/
@ApiModelProperty(notes = "消息标题")
@Column(name = "msg_title")
private String msgTitle;
/**
* 任务类型消息-任务开始时间
*/
@ApiModelProperty(notes = "任务类型消息-任务开始时间 yyyy-MM-dd HH:mm:ss")
@Column(name = "task_start_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date taskStartTime;
/**
* 任务类型消息-任务结束时间
*/
@ApiModelProperty(notes = "任务类型消息-任务结束时间 yyyy-MM-dd HH:mm:ss")
@Column(name = "task_end_time")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date taskEndTime;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model.warning;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;
/**
* 学习效果分析 - 响应结果
*/
@Data
public class LearningEffectAnalysisDTO implements Serializable {
/**
* 学习前指标
*/
@ApiModelProperty(notes = "学习前指标")
private MonMetricsDTO beforeLearning;
/**
* 学习后指标
*/
@ApiModelProperty(notes = "学习后指标")
private MonMetricsDTO afterLearning;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model.warning;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
* 学习效果分析 - 请求参数
*/
@Data
public class LearningEffectAnalysisRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 分析周期1 -> 一周2 -> 两周 3 -> 一月
*/
@NotNull
private Integer analysisPeriodDays; // 必填
/**
* 门店ID 或 用户ID(根据业务)
*/
private Integer merchantId;
/**
* 员工ID
*/
@NotNull
private String staffId;
/**
* 可选:开始日期(若不传,则自动计算为当前时间往前推 analysisPeriodDays)
*/
@NotNull
private String startDate; // 格式: yyyy-MM-dd
/**
* 可选:结束日期
*/
@NotNull
private String endDate; // 格式: yyyy-MM-dd
/**
* 业务类型:1.延保 2.轻改 3.权益
*/
@NotNull
private Integer businessType;
/**
* 1.学习前,2.学习后
*/
private Integer learningEffectType;
/**
* 员工名称
*/
private String staffName;
/**
* 员工手机号
*/
private String staffPhone;
/**
* 接待时间
*/
@ApiModelProperty(notes = "接待时间, yyyy-MM-dd")
private String receptionDate;
private List<Integer> recordIdList;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model.warning;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import lombok.Data;
/**
* 核心业务指标集合
*/
@Data
public class MonMetricsDTO implements java.io.Serializable {
/**
* 转化率(百分比数值,如 55.0 表示 55%)
*/
@ApiModelProperty(notes = "转化率")
private BigDecimal conversionRate; // %
/**
* 客单价(金额)
*/
@ApiModelProperty(notes = "客单价")
private BigDecimal avgOrderAmount; // 元
/**
* 套餐销售率(百分比)
*/
@ApiModelProperty(notes = "套餐销售率")
private BigDecimal packageSalesRate; // %
/**
* 整车延保渗透率(百分比)
*/
@ApiModelProperty(notes = "整车延保渗透率")
private BigDecimal wholeVehicleWarrantyPenetration; // %
/**
* 安心包渗透率(注意:UI 显示为金额,但逻辑应为百分比?)
* ⚠️ 根据你提供的数据:
* "安心包渗透率 8888.00 → 9600.00" —— 这看起来像 **客单价**,不是渗透率!
* 建议确认业务含义。
*
* 方案 A(按渗透率):用百分比(BigDecimal)
* 方案 B(按金额):用金额(BigDecimal),但字段名应为 `anxinPackageAvgPrice`
*
* 此处按 **渗透率(百分比)** 设计,若实际是金额,请重命名字段!
*/
@ApiModelProperty(notes = "安心包渗透率")
private BigDecimal anxinPackagePenetration; // %
/**
* 电池渗透率(百分比)
*/
@ApiModelProperty(notes = "电池渗透率")
private BigDecimal batteryPenetration; // %
/**
* 轮胎渗透率(百分比)
*/
@ApiModelProperty(notes = "轮胎渗透率")
private BigDecimal tirePenetration; // %
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model.warning;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Transient;
import lombok.Data;
@Data
public class MonitoringMsgDTO implements Serializable {
/**
* 生成预警消息的规则id
*/
@ApiModelProperty(notes = "生成预警消息的规则id")
private Integer ruleId;
/**
* 员工id
*/
@ApiModelProperty(notes = "员工id")
private String staffId;
/**
* 员工姓名
*/
@ApiModelProperty(notes = "员工姓名")
private String staffName;
/**
* 员工手机号
*/
@ApiModelProperty(notes = "员工手机号")
private String staffPhone;
/**
* 4s店门店号
*/
@ApiModelProperty(notes = "4s店门店号")
private Integer merchantId4s;
/**
* 4s门店名称
*/
@ApiModelProperty(notes = "4s门店名称")
private String merchantName4s;
/**
* 预警类型
*/
@ApiModelProperty(notes = "预警类型")
private String ruleType;
/**
* 预警事项
*/
@ApiModelProperty(notes = "预警事项")
private String rule;
/**
* 预警明细说明
*/
@ApiModelProperty(notes = "预警明细说明")
private String msgDetail;
/**
* 周期指标值
*/
@ApiModelProperty(notes = "周期指标值")
private BigDecimal cycleIndicator;
/**
* 兜底指标
*/
@ApiModelProperty(notes = "兜底指标")
private BigDecimal fallbackIndicator;
@ApiModelProperty(notes = "预警明细")
private String ruleDetail;
@ApiModelProperty(notes = "盯店描述")
private String warningText;
/**
* 下期指标值
*/
@ApiModelProperty(notes = "下期指标值")
private BigDecimal nextCycleIndicator;
/**
* 指标编码
*/
@ApiModelProperty(notes = "指标编码")
private String fieldName;
/**
* sortId
*/
@ApiModelProperty(notes = "sortId")
private Integer sortId;
/**
* sortOrder
*/
@ApiModelProperty(notes = "sortOrder")
private Integer sortOrder;
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.model.warning; package cn.com.glsx.dj.mindworkplate.model.warning;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.List;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -15,63 +18,74 @@ public class Rule implements Serializable { ...@@ -15,63 +18,74 @@ public class Rule implements Serializable {
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(notes = "id")
private Integer id; private Integer id;
/** /**
* 监控对象(1-员工,2-门店) * 监控对象(1-员工,2-门店)
*/ */
@Column(name = "monitor_type") @Column(name = "monitor_type")
@ApiModelProperty(notes = "监控对象(1-员工,2-门店)")
private Byte monitorType; private Byte monitorType;
/** /**
* 业务类型(2-轻改,3-权益,4-延保) * 业务类型(2-轻改,3-权益,4-延保)
*/ */
@Column(name = "business_type") @Column(name = "business_type")
@ApiModelProperty(notes = "业务类型(2-轻改,3-权益,4-延保)")
private Byte businessType; private Byte businessType;
/** /**
* 数据统计类型(1-行为预警,2-业绩预警) * 数据统计类型(1-行为预警,2-业绩预警)
*/ */
@Column(name = "data_statistics_type") @Column(name = "data_statistics_type")
@ApiModelProperty(notes = "数据统计类型(1-行为预警,2-业绩预警)")
private Byte dataStatisticsType; private Byte dataStatisticsType;
/** /**
* 优先级(从1往后排,数字越大优先级越高) * 优先级(从1往后排,数字越大优先级越高)
*/ */
@Column(name = "priority_level") @Column(name = "priority_level")
@ApiModelProperty(notes = "优先级(从1往后排,数字越大优先级越高)")
private Byte priorityLevel; private Byte priorityLevel;
/** /**
* 预警阶段 * 预警阶段
*/ */
private Integer stage; private Integer stage;
/** /**
* 预警类型 * 预警类型
*/ */
@Column(name = "rule_type") @Column(name = "rule_type")
@ApiModelProperty(notes = "预警类型")
private String ruleType; private String ruleType;
/** /**
* 规则定义 * 规则定义
*/ */
@ApiModelProperty(notes = "规则定义")
private String rule; private String rule;
/** /**
* 规则sql * 规则sql
*/ */
@Column(name = "rule_sql") @Column(name = "rule_sql")
@ApiModelProperty(notes = "规则sql")
private String ruleSql; private String ruleSql;
/** /**
* 规则描述 * 规则描述
*/ */
@Column(name = "rule_describe") @Column(name = "rule_describe")
@ApiModelProperty(notes = "规则描述")
private String ruleDescribe; private String ruleDescribe;
/** /**
* 统计天数, * 统计天数,
*/ */
@Column(name = "count_days") @Column(name = "count_days")
@ApiModelProperty(notes = "统计天数,")
private Integer countDays; private Integer countDays;
/** /**
...@@ -146,4 +160,53 @@ public class Rule implements Serializable { ...@@ -146,4 +160,53 @@ public class Rule implements Serializable {
@Column(name = "static_cycle") @Column(name = "static_cycle")
private Integer staticCycle; private Integer staticCycle;
/**
* 触发条件值
*/
@Column(name = "condition_value")
private BigDecimal conditionValue;
@Transient
@ApiModelProperty(notes = "开始时间")
private String startTime;
@Transient
@ApiModelProperty(notes = "结束时间")
private String endTime;
@Transient
@ApiModelProperty(notes = "商户id")
private List<Integer> merchantIds;
@Transient
@ApiModelProperty(notes = "uuid")
private List<String> uuidList;
/**
* 分组类型,如果不传默认策略配置的类型,1.员工 2.门店
*/
@Transient
private Integer exts;
/**
* 统计指标名
*/
@Transient
private String fieldName;
/**
* sortId
*/
@Column(name = "sort_id")
private Integer sortId;
/**
* sortId
*/
@Transient
private Integer sortOrder;
} }
\ No newline at end of file \ No newline at end of file
...@@ -234,6 +234,10 @@ public class WarningMsg implements Serializable { ...@@ -234,6 +234,10 @@ public class WarningMsg implements Serializable {
@ApiModelProperty(notes = "预警明细") @ApiModelProperty(notes = "预警明细")
private String ruleDetail; private String ruleDetail;
@Transient
@ApiModelProperty(notes = "盯店描述")
private String warningText;
public WarningMsg() { public WarningMsg() {
} }
......
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.*; import cn.com.glsx.dj.mindworkplate.dto.*;
import cn.com.glsx.dj.mindworkplate.dto.warning.EarlyWarningThresholdConfigHistoryDTO;
import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg; import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg;
import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse; import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse;
import cn.com.glsx.framework.core.annotation.ApiMethod; import cn.com.glsx.framework.core.annotation.ApiMethod;
...@@ -76,4 +77,9 @@ public interface EarlyWarningMsgRemote { ...@@ -76,4 +77,9 @@ public interface EarlyWarningMsgRemote {
@ApiParam(name="month",notes="月份 格式yyyy-mm",dataType= ApiParam.DataTypeEnum.OBJECT, required=true) @ApiParam(name="month",notes="月份 格式yyyy-mm",dataType= ApiParam.DataTypeEnum.OBJECT, required=true)
@ApiResponse("查询月份内中的门店的预警明细 1.兜底预警 2.丢店预警(展业预警)") @ApiResponse("查询月份内中的门店的预警明细 1.兜底预警 2.丢店预警(展业预警)")
RpcResponse<Map<Integer, List<WarningMsgResponse>>> findWarnMsgListByMonth(MerchantDdWarningMsgRequestDTO merchantDdWarningMsgRequestDTO); RpcResponse<Map<Integer, List<WarningMsgResponse>>> findWarnMsgListByMonth(MerchantDdWarningMsgRequestDTO merchantDdWarningMsgRequestDTO);
@ApiMethod("策略中心-门店分析-历史兜底指标")
@ApiParam(name="merchantNo",notes="商户号",dataType= ApiParam.DataTypeEnum.STRING,required=true)
@ApiResponse("返回门店历史兜底指标数据")
RpcResponse<List<EarlyWarningThresholdConfigHistoryDTO>> listMerchantAnalysisIndexHistory(String merchantNo);
} }
package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.ConversationBatchDTO;
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.MonitorTypeDict;
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.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiParam.DataTypeEnum;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.List;
import javax.validation.constraints.NotNull;
@ApiService(value = "策略中心", owner = "zhouhb",version = "1.0.0")
public interface MonitoringRemote {
@ApiMethod("根据条件查询所有预警")
@ApiParam(name="request",notes="入参",dataType= DataTypeEnum.OBJECT,required=true)
@ApiResponse("预警信息")
RpcResponse<List<MonitoringMsgDTO>> getMonitorListByCondition(MonitorBaseRequest request) ;
@ApiMethod("查询所有预警类型")
@ApiResponse("预警类型")
RpcResponse<List<MonitorTypeDict>> findMonitorTypeDictList(@NotNull Integer businessType);
@ApiMethod("查询预警")
@ApiParam(name="request",notes="入参",dataType= DataTypeEnum.OBJECT,required=true)
@ApiResponse("预警信息")
RpcResponse<List<StoreItemResponse>> findMonitorListPage(MonitorFilterRequest request);
@ApiMethod("查询录音记录概览")
@ApiParam(name="request",notes="入参",dataType= DataTypeEnum.OBJECT,required=true)
@ApiResponse("录音记录概览")
RpcResponse<ConversationBatchDTO> findRecordStaticByCondition(LearningEffectAnalysisRequest request);
@ApiMethod("查询录音记录")
@ApiParam(name="request",notes="入参",dataType= DataTypeEnum.OBJECT,required=true)
@ApiResponse("录音记录")
RpcResponse<RpcPagination<ConversationBatchDTO>> getRecordPageListByCondition(RpcPagination<LearningEffectAnalysisRequest> request);
@ApiMethod("查询学习前后的指标")
@ApiParam(name="request",notes="入参",dataType= DataTypeEnum.OBJECT,required=true)
@ApiResponse("学习前后的指标")
RpcResponse<LearningEffectAnalysisDTO> findLearningEffectAnalysis(LearningEffectAnalysisRequest request);
}
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*; import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
...@@ -110,4 +111,20 @@ public interface PadMessageBoxRemote { ...@@ -110,4 +111,20 @@ public interface PadMessageBoxRemote {
@ApiParam(name = "msgId", notes = "消息id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "msgId", notes = "消息id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("更新结果") @ApiResponse("更新结果")
RpcResponse<Boolean> updActivityPopUpWindowStatus(Integer msgId); RpcResponse<Boolean> updActivityPopUpWindowStatus(Integer msgId);
@ApiMethod("分页查询消息盒子列表")
@ApiParam(name = "pagination", notes = "分页查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("消息盒子分页列表")
RpcResponse<RpcPagination<NewPadMessageBoxDTO>> pagePadMessageBox(RpcPagination<NewPadMessageBoxDTO> pagination);
@ApiMethod("查询消息盒子消息详情")
@ApiParam(name = "dto", notes = "消息ID", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("消息盒子详情")
RpcResponse<NewPadMessageBoxDTO> getMessageBoxDetail(NewPadMessageBoxDTO dto);
@ApiMethod("按模块类型分组查询未读消息数量")
@ApiParam(name = "dto", notes = "查询条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("按模块类型分组的未读消息数量列表")
RpcResponse<List<ModuleUnreadCountDTO>> listUnreadMessageCountByModuleType(ModuleUnreadQueryDTO dto);
} }
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cn.com.glsx.dj.strategy</groupId>
<artifactId>rpc-dj-strategy-api</artifactId>
<version>5.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-riskmanage-api</artifactId> <artifactId>rpc-dj-riskmanage-api</artifactId>
<version>5.5.3-SNAPSHOT</version> <version>5.5.3-SNAPSHOT</version>
...@@ -46,12 +51,12 @@ ...@@ -46,12 +51,12 @@
<dependency> <dependency>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.5.3-SNAPSHOT</version> <version>5.6.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.5.3-SNAPSHOT</version> <version>5.6.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
...@@ -160,5 +165,11 @@ ...@@ -160,5 +165,11 @@
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>cn.com.glsx.merchants</groupId>
<artifactId>platform-merchants-api</artifactId>
<version>5.6.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file \ No newline at end of file
...@@ -7,6 +7,7 @@ import cn.com.glsx.dj.beisen.remote.BeiSenDynamicRecordRemote; ...@@ -7,6 +7,7 @@ import cn.com.glsx.dj.beisen.remote.BeiSenDynamicRecordRemote;
import cn.com.glsx.dj.smartcarlife.remote.*; import cn.com.glsx.dj.smartcarlife.remote.*;
import cn.com.glsx.entmicro.remote.BatchMessagingRemote; import cn.com.glsx.entmicro.remote.BatchMessagingRemote;
import cn.com.glsx.entmicro.remote.EntmicroStaffRemote; import cn.com.glsx.entmicro.remote.EntmicroStaffRemote;
import cn.com.glsx.merchants.remote.MerchantRemote;
import cn.com.glsx.merchants.remote.MerchantStaffRemote; import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import cn.com.glsx.scrm.clue.remote.BurialPointRecordRemote; import cn.com.glsx.scrm.clue.remote.BurialPointRecordRemote;
import cn.com.glsx.scrm.equity.remote.ServicePackageRemote; import cn.com.glsx.scrm.equity.remote.ServicePackageRemote;
...@@ -176,6 +177,10 @@ public class DubboConfig { ...@@ -176,6 +177,10 @@ public class DubboConfig {
public ContentManagerTaskRemote getContentManagerTaskRemote() { public ContentManagerTaskRemote getContentManagerTaskRemote() {
return factory.builder(ContentManagerTaskRemote.class).check(false).version("1.0.0").timeout(30000).build(); return factory.builder(ContentManagerTaskRemote.class).check(false).version("1.0.0").timeout(30000).build();
} }
@Bean
public MerchantRemote getMerchantRemote() {
return factory.builder(MerchantRemote.class).check(false).version("2.0.0").timeout(30000).build();
}
} }
package cn.com.glsx.dj.mindworkplate.config;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ExecutorConfiguration {
/**
* 自定义线程池:用于数据查询类异步任务
* - 核心线程数:4
* - 最大线程数:8
* - 队列容量:100(有界队列,防 OOM)
* - 线程空闲回收时间:60 秒
* - 拒绝策略:CallerRunsPolicy(主线程执行,避免丢任务)
*/
@Bean("dataQueryExecutor")
public ExecutorService dataQueryExecutor() {
ThreadFactory threadFactory = new ThreadFactory() {
private final AtomicInteger threadNumber = new AtomicInteger(1);
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r, "data-query-pool-thread-" + threadNumber.getAndIncrement());
t.setDaemon(false); // 非守护线程,确保应用关闭前完成任务
return t;
}
};
return new ThreadPoolExecutor(
4, // corePoolSize
8, // maximumPoolSize
60L, TimeUnit.SECONDS, // keepAliveTime
new LinkedBlockingQueue<>(100), // 有界工作队列
threadFactory,
new ThreadPoolExecutor.CallerRunsPolicy() // 拒绝策略
);
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.config;
import cn.com.glsx.dj.strategy.remote.StrategyStaffMessageRemote;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class StrategyDubboConfig {
@Autowired
private ReferenceBuilderFactory factory;
@Bean
public StrategyStaffMessageRemote strategyStaffMessageRemote() {
return factory.builder(StrategyStaffMessageRemote.class).check(false).timeout(30000).version("1.0.0").build();
}
}
package cn.com.glsx.dj.mindworkplate.handler.messagebox;
import cn.com.glsx.dj.mindworkplate.dto.ConversationBatchDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ModuleTypeDetailHandler;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.PmbLearningTaskBaseDetailDTO;
import cn.com.glsx.dj.mindworkplate.enums.MindWorkplateServiceErrorEnum;
import cn.com.glsx.dj.mindworkplate.enums.messagebox.ModuleTypeEnums;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.strategy.dto.StrategyStaffRecordingRelDTO;
import cn.com.glsx.dj.strategy.model.LearningRecord;
import cn.com.glsx.dj.strategy.remote.StrategyStaffMessageRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 优秀案例分享策略详情处理器 (module_type = 7)
*/
@Component
@Slf4j
public class ExcellentCaseShareDetailHandler implements ModuleTypeDetailHandler {
@Autowired
private StrategyStaffMessageRemote strategyStaffMessageRemote;
@Override
public Object getDetail(PadMessageBox padMessageBox) {
try {
RpcResponse<Object> response = strategyStaffMessageRemote.getBusinessMessageDetailByMessageId(padMessageBox.getId());
if (response.isSuccess() && response.getResult() != null) {
List<StrategyStaffRecordingRelDTO> strategyStaffRecordingRelDTOS = (List<StrategyStaffRecordingRelDTO>) response.getResult();
int courseTotalCount = strategyStaffRecordingRelDTOS.size();
List<LearningRecord> learningRecords = strategyStaffRecordingRelDTOS.stream().filter(dto -> Objects.nonNull(dto.getLearningRecord())).map(StrategyStaffRecordingRelDTO::getLearningRecord).collect(Collectors.toList());
int learningRecordCount = learningRecords.size();
PmbLearningTaskBaseDetailDTO<ConversationBatchDTO> detail = new PmbLearningTaskBaseDetailDTO<>();
detail.setTaskTitle(padMessageBox.getMsgTitle());
detail.setTaskDeadline(padMessageBox.getTaskEndTime());
detail.setCourseTotalCount(courseTotalCount);
// 任务进度:当前员工在对应录音任务的学习进度,即(已学习录音数/总录音数)*100%,四舍五入保留百分比整数;
detail.setTaskProgress(new BigDecimal(learningRecordCount).divide(new BigDecimal(courseTotalCount), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0, BigDecimal.ROUND_HALF_UP));
detail.setCompleteStatus(learningRecordCount == courseTotalCount ? 1 : 0);
detail.setFinishDate(padMessageBox.getTaskEndTime());
List<ConversationBatchDTO> courseList = strategyStaffRecordingRelDTOS.stream().map(dto -> (ConversationBatchDTO) dto.getRecordingDetail()).collect(Collectors.toList());
detail.setCourseList(courseList);
// courseList ConversationBatchDTO的durationTime 毫秒数转分钟数, 转成 BigDecimal 类型,汇总
detail.setTotalDuration(courseList.stream().map(ConversationBatchDTO::getDurationTime)
.filter(Objects::nonNull).reduce(Long::sum).map(time -> new BigDecimal(time).divide(new BigDecimal(60 * 1000), 2, BigDecimal.ROUND_HALF_UP)).orElse(BigDecimal.ZERO));
return detail;
}
return null;
} catch (Exception e) {
log.error("查询优秀案例分享策略详情异常,消息ID:{}", padMessageBox.getId(), e);
return null;
}
}
@Override
public void updateBusinessStatus(PadMessageBox padMessageBox) {
// 调用远程服务更新业务消息记录的已读状态
try {
RpcResponse<Boolean> response = strategyStaffMessageRemote.updateReadStatusByMessageId(padMessageBox.getId());
if (!response.isSuccess()) {
log.error("更新优秀案例分享策略业务消息记录已读状态失败: {}", response.getMessage());
throw new RpcServiceException(MindWorkplateServiceErrorEnum.BUSINESS_EXCEPTION, response.getMessage());
}
} catch (RpcServiceException e) {
log.error("更新优秀案例分享策略业务消息记录已读状态失败: {}", e.getMessage());
throw e;
} catch (Exception e) {
log.error("更新优秀案例分享策略业务消息记录已读状态异常", e);
throw new RpcServiceException(MindWorkplateServiceErrorEnum.BUSINESS_EXCEPTION, e.getMessage());
}
}
@Override
public Integer getModuleType() {
return ModuleTypeEnums.EXCELLENT_CASE_POLICY.getCode();
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.handler.messagebox;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ModuleTypeDetailHandler;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.PmbLearningTaskBaseDetailDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.PmbStaffCourseDetailDTO;
import cn.com.glsx.dj.mindworkplate.enums.MindWorkplateServiceErrorEnum;
import cn.com.glsx.dj.mindworkplate.enums.messagebox.ModuleTypeEnums;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.riskmanage.model.course.BeiSenCourse;
import cn.com.glsx.dj.riskmanage.model.course.BeiSenCourseStaff;
import cn.com.glsx.dj.smartcarlife.enums.study.StaffStudyCourseStatusEnum;
import cn.com.glsx.dj.strategy.dto.StrategyStaffCourseRelDTO;
import cn.com.glsx.dj.strategy.remote.StrategyStaffMessageRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* 学习类策略详情处理器 (module_type = 6)
*/
@Component
@Slf4j
public class LearningTaskDetailHandler implements ModuleTypeDetailHandler {
@Autowired
private StrategyStaffMessageRemote strategyStaffMessageRemote;
@Override
public Object getDetail(PadMessageBox padMessageBox) {
try {
RpcResponse<Object> response = strategyStaffMessageRemote.getBusinessMessageDetailByMessageId(padMessageBox.getId());
if (response.isSuccess() && response.getResult() != null) {
List<StrategyStaffCourseRelDTO> strategyStaffCourseRelDTOS = (List<StrategyStaffCourseRelDTO>) response.getResult();
int courseTotalCount = strategyStaffCourseRelDTOS.size();
List<BeiSenCourseStaff> learningRecords = strategyStaffCourseRelDTOS.stream().filter(dto -> Objects.nonNull(dto.getLearningRecord())).map(dto -> (BeiSenCourseStaff) dto.getLearningRecord()).collect(Collectors.toList());
int finishedCount = learningRecords.stream().filter(record -> record.getLearnStatus().equals("50")).collect(Collectors.toList()).size();
PmbLearningTaskBaseDetailDTO<PmbStaffCourseDetailDTO> detail = new PmbLearningTaskBaseDetailDTO<>();
detail.setTaskTitle(padMessageBox.getMsgTitle());
detail.setTaskDeadline(padMessageBox.getTaskEndTime());
detail.setCourseTotalCount(courseTotalCount);
// 任务进度:当前员工在对应录音任务的学习进度,即(已学习录音数/总录音数)*100%,四舍五入保留百分比整数;
detail.setTaskProgress(new BigDecimal(finishedCount).divide(new BigDecimal(courseTotalCount), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(0, BigDecimal.ROUND_HALF_UP));
detail.setCompleteStatus(finishedCount == courseTotalCount ? 1 : 0);
detail.setFinishDate(padMessageBox.getTaskEndTime());
List<BeiSenCourse> courseList = strategyStaffCourseRelDTOS.stream().map(dto -> (BeiSenCourse) dto.getCourseDetail()).collect(Collectors.toList());
detail.setTotalDuration(courseList.stream().map(BeiSenCourse::getTotalDuration)
.filter(Objects::nonNull).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
Map<String, BeiSenCourseStaff> courseStaffMap = new HashMap<>();
if (CollectionUtils.isNotEmpty(learningRecords)) {
learningRecords.forEach(record -> courseStaffMap.put(record.getCourseId(), record));
}
List<PmbStaffCourseDetailDTO> courseDTOList = new ArrayList<>();
for (BeiSenCourse beiSenCourse : courseList) {
PmbStaffCourseDetailDTO courseDTO = new PmbStaffCourseDetailDTO();
courseDTO.setCourseId(beiSenCourse.getId());
courseDTO.setCourseName(beiSenCourse.getTitle());
courseDTO.setLearnDuration(beiSenCourse.getTotalDuration());
BeiSenCourseStaff courseStaff = courseStaffMap.get(beiSenCourse.getId());
byte status = StaffStudyCourseStatusEnum.NOT_STUDY.getValue();
if (Objects.nonNull(courseStaff)) {
String learnStatus = courseStaff.getLearnStatus();
status = Byte.parseByte(learnStatus.replace("0", ""));
courseDTO.setStatus(status);
courseDTO.setProgress(courseStaff.getProcess());
courseDTO.setTotalScore(courseStaff.getTotalScore());
courseDTO.setFinishDate(courseStaff.getLearnEndTime());
} else {
courseDTO.setStatus(status);
}
courseDTOList.add(courseDTO);
}
detail.setCourseList(courseDTOList);
return detail;
}
return null;
} catch (Exception e) {
log.error("查询优秀案例分享策略详情异常,消息ID:{}", padMessageBox.getId(), e);
return null;
}
}
@Override
public void updateBusinessStatus(PadMessageBox padMessageBox) {
// 调用远程服务更新业务消息记录的已读状态
try {
RpcResponse<Boolean> response = strategyStaffMessageRemote.updateReadStatusByMessageId(padMessageBox.getId());
if (!response.isSuccess()) {
log.error("更新学习类策略业务消息记录已读状态失败: {}", response.getMessage());
throw new RpcServiceException(MindWorkplateServiceErrorEnum.BUSINESS_EXCEPTION, response.getMessage());
}
} catch (RpcServiceException e) {
log.error("更新学习类策略业务消息记录已读状态失败: {}", e.getMessage());
throw e;
} catch (Exception e) {
log.error("更新学习类策略业务消息记录已读状态异常", e);
throw new RpcServiceException(MindWorkplateServiceErrorEnum.BUSINESS_EXCEPTION, e.getMessage());
}
}
@Override
public Integer getModuleType() {
return ModuleTypeEnums.LEARNING_POLICY.getCode();
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.handler.messagebox;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ModuleTypeDetailHandler;
import cn.com.glsx.dj.mindworkplate.enums.MindWorkplateServiceErrorEnum;
import cn.com.glsx.dj.mindworkplate.enums.messagebox.ModuleTypeEnums;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.PmbEnterpriseDetailDTO;
import cn.com.glsx.dj.strategy.model.StrategyInfo;
import cn.com.glsx.dj.strategy.remote.StrategyStaffMessageRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 任务型策略详情处理器 (module_type = 8)
*/
@Component
@Slf4j
public class TaskTypeDetailHandler implements ModuleTypeDetailHandler {
@Autowired
private StrategyStaffMessageRemote strategyStaffMessageRemote;
@Override
public Object getDetail(PadMessageBox padMessageBox) {
try {
RpcResponse<Object> response = strategyStaffMessageRemote.getBusinessMessageDetailByMessageId(padMessageBox.getId());
if (response.isSuccess() && response.getResult() != null) {
StrategyInfo strategyInfo = (StrategyInfo) response.getResult();
PmbEnterpriseDetailDTO detail = new PmbEnterpriseDetailDTO();
detail.setId(strategyInfo.getId());
detail.setModuleType(padMessageBox.getModuleType());
detail.setTitle(strategyInfo.getTitle());
detail.setActualSendTime(padMessageBox.getCreatedTime());
detail.setSubtitle(strategyInfo.getSubTitle());
detail.setContent(strategyInfo.getContent());
detail.setContentType((byte) 1);
return detail;
}
return null;
} catch (Exception e) {
log.error("查询任务型策略详情异常,消息ID:{}", padMessageBox.getId(), e);
return null;
}
}
@Override
public void updateBusinessStatus(PadMessageBox padMessageBox) {
try {
RpcResponse<Boolean> response = strategyStaffMessageRemote.updateReadStatusByMessageId(padMessageBox.getId());
if (!response.isSuccess()) {
log.error("更新任务型策略业务消息记录已读状态失败: {}", response.getMessage());
throw new RpcServiceException(MindWorkplateServiceErrorEnum.BUSINESS_EXCEPTION, response.getMessage());
}
} catch (RpcServiceException e) {
log.error("更新任务型策略业务消息记录已读状态失败: {}", e.getMessage());
throw e;
} catch (Exception e) {
log.error("更新任务型策略业务消息记录已读状态异常", e);
throw new RpcServiceException(MindWorkplateServiceErrorEnum.BUSINESS_EXCEPTION, e.getMessage());
}
}
@Override
public Integer getModuleType() {
return ModuleTypeEnums.TASK_POLICY.getCode();
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.job.warning;
import cn.com.glsx.dj.mindworkplate.service.EarlyWarningThresholdConfigService;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Description 门店指标配置月度备份定时任务
* 每月1号凌晨1点执行,将early_warning_threshold_config表中每个门店的指标记录
* copy到early_warning_threshold_config_history表中作为每个门店上一个月的指标数据
* @Date 2026-01-16
*/
@Slf4j
@Service
@ElasticJobConf(name = "ThresholdConfigMonthlyBackupJob", cron = "0 0 1 1 * ?", description = "门店指标配置月度备份任务", overwrite = false)
public class ThresholdConfigMonthlyBackupJob implements SimpleJob {
@Autowired
private EarlyWarningThresholdConfigService earlyWarningThresholdConfigService;
@Override
public void execute(ShardingContext shardingContext) {
log.info("门店指标配置月度备份任务开始执行");
try {
earlyWarningThresholdConfigService.backupThresholdConfigToHistory();
log.info("门店指标配置月度备份任务执行成功");
} catch (Exception e) {
log.error("门店指标配置月度备份任务执行失败", e);
}
log.info("门店指标配置月度备份任务执行结束");
}
}
package cn.com.glsx.dj.mindworkplate.mapper; package cn.com.glsx.dj.mindworkplate.mapper;
import cn.com.glsx.dj.mindworkplate.model.AiInspectionRequest; import cn.com.glsx.dj.mindworkplate.model.AiInspectionRequest;
import cn.com.glsx.dj.mindworkplate.request.longcourse.ItemStaffSearchRequestDTO;
import java.util.List; import java.util.List;
import javax.validation.constraints.NotNull;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper; import org.oreframework.datasource.mybatis.mapper.OreMapper;
...@@ -14,4 +14,7 @@ public interface AiInspectionRequestMapper extends OreMapper<AiInspectionRequest ...@@ -14,4 +14,7 @@ public interface AiInspectionRequestMapper extends OreMapper<AiInspectionRequest
List<AiInspectionRequest> findAiInspectionCheck(@Param("phone") String phone, @Param("time")String time); List<AiInspectionRequest> findAiInspectionCheck(@Param("phone") String phone, @Param("time")String time);
String getAiTutorSuggest(@Param("tutorTime") String tutorTime,@Param("uuid") String uuid,
@Param("businessType") Integer businessType);
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,8 +7,10 @@ import cn.com.glsx.dj.mindworkplate.dto.ReceptionDetailRequestDTO; ...@@ -7,8 +7,10 @@ import cn.com.glsx.dj.mindworkplate.dto.ReceptionDetailRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.ReceptionRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.ReceptionRequestDTO;
import cn.com.glsx.dj.mindworkplate.model.ConversationBatch; import cn.com.glsx.dj.mindworkplate.model.ConversationBatch;
import cn.com.glsx.dj.mindworkplate.model.ConversationDate; import cn.com.glsx.dj.mindworkplate.model.ConversationDate;
import cn.com.glsx.dj.mindworkplate.model.warning.LearningEffectAnalysisRequest;
import cn.com.glsx.dj.mindworkplate.response.warning.WarningMsgStaffRes; import cn.com.glsx.dj.mindworkplate.response.warning.WarningMsgStaffRes;
import cn.com.glsx.dj.mindworkplate.service.recordmodelcall.model.ReceptionOrderDetailExportModel; import cn.com.glsx.dj.mindworkplate.service.recordmodelcall.model.ReceptionOrderDetailExportModel;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import java.util.List; import java.util.List;
...@@ -67,4 +69,8 @@ public interface ConversationBatchMapper extends OreMapper<ConversationBatch> { ...@@ -67,4 +69,8 @@ public interface ConversationBatchMapper extends OreMapper<ConversationBatch> {
ConversationBatch findHisFlagByBatchId(@Param("batchId") Integer batchId); ConversationBatch findHisFlagByBatchId(@Param("batchId") Integer batchId);
void updatReviewFlag(@Param("batchId") Integer batchId); void updatReviewFlag(@Param("batchId") Integer batchId);
Page<ConversationBatchDTO> getRecordPageListByCondition(@Param("condition") LearningEffectAnalysisRequest request);
ConversationBatchDTO getRecordStaticByCondition(@Param("condition")LearningEffectAnalysisRequest request);
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.mapper;
import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface EarlyWarningThresholdConfigHistoryMapper extends OreMapper<EarlyWarningThresholdConfigHistory> {
/**
* 直接从配置表备份数据到历史表,自动计算上一个月的年月
* @return 插入条数
*/
int backupConfigToHistory();
/**
* 根据商户号查询历史指标数据,按月份倒序排列
*
* @param merchantNo 商户号
* @return 历史指标数据列表
*/
List<EarlyWarningThresholdConfigHistory> selectByMerchantNoOrderByMonthDesc(@Param("merchantNo") String merchantNo);
}
package cn.com.glsx.dj.mindworkplate.mapper;
import cn.com.glsx.dj.mindworkplate.model.EcoCoefficientRule;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface EcoCoefficientRuleMapper extends OreMapper<EcoCoefficientRule> {
List<EcoCoefficientRule> selectAllEnabledRules();
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.mapper;
import cn.com.glsx.dj.mindworkplate.model.MonitorTypeDict;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.oreframework.datasource.mybatis.mapper.OreMapper;
@Mapper
public interface MonitorTypeDictMapper extends OreMapper<MonitorTypeDict> {
List<MonitorTypeDict> findMonitorTypeDictList(@Param("bussinessType") Integer businessType);
List<Integer> findMerchantIdsByUUidAndType(@Param("uuid") String uuid,@Param("typeValue") byte typeValue);
}
\ No newline at end of file \ No newline at end of file
...@@ -30,6 +30,8 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> { ...@@ -30,6 +30,8 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> {
List<ScriptRecordPadPushDTO> listLongCourseBoxMessage(ScriptSearchDTO request); List<ScriptRecordPadPushDTO> listLongCourseBoxMessage(ScriptSearchDTO request);
List<ScriptRecordPadPushDTO> listExcellentCaseBoxMessage(ScriptSearchDTO request);
int markDeadline(@Param("ids") List<Integer> ids, @Param("updatedBy") String updatedBy); int markDeadline(@Param("ids") List<Integer> ids, @Param("updatedBy") String updatedBy);
/** /**
...@@ -67,4 +69,20 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> { ...@@ -67,4 +69,20 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> {
* @return cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO * @return cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO
*/ */
ActivityMessagePopUpWindowRespDTO getActivityMsgPopUpWindow(ActivityMessagePopUpWindowDTO request); ActivityMessagePopUpWindowRespDTO getActivityMsgPopUpWindow(ActivityMessagePopUpWindowDTO request);
/**
* 分页查询消息盒子列表
*
* @param newPadMessageBoxDTO 查询条件
* @return 消息盒子列表
*/
List<NewPadMessageBoxDTO> pagePadMessageBox(NewPadMessageBoxDTO newPadMessageBoxDTO);
/**
* 按模块类型分组查询未读消息数量
*
* @param moduleUnreadQueryDTO 查询条件
* @return 按模块类型分组的未读消息数量列表
*/
List<ModuleUnreadCountDTO> listUnreadMessageCountByModuleType(ModuleUnreadQueryDTO moduleUnreadQueryDTO);
} }
\ No newline at end of file \ No newline at end of file
...@@ -20,4 +20,6 @@ public interface RuleMapper extends OreMapper<Rule> { ...@@ -20,4 +20,6 @@ public interface RuleMapper extends OreMapper<Rule> {
List<Rule> selectByType(@Param("type") Integer type); List<Rule> selectByType(@Param("type") Integer type);
List<WarningMsgRuleModel> executePrefixSql(@Param("ruleSql") String ruleSql); List<WarningMsgRuleModel> executePrefixSql(@Param("ruleSql") String ruleSql);
List<Rule> selectByTypeAndMetricType(@Param("businessType") Integer businessType,@Param("monitorType") Integer monitorType, @Param("metricTypeId") Integer metricTypeId);
} }
\ No newline at end of file \ No newline at end of file
...@@ -168,17 +168,6 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor ...@@ -168,17 +168,6 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor
@Override @Override
public RpcResponse<Integer> save(SaveStaffRecordRequestDTO dto) { public RpcResponse<Integer> save(SaveStaffRecordRequestDTO dto) {
try { try {
// Map<String, String> form = dto.getForm();
// if (MapUtil.isNotEmpty(form)) {
// for (String key : form.keySet()) {
// String value = form.get(key);
// if (ObjectUtil.isNotNull(value)) {
// form.remove(key);
// form.put(key, ObjectUtil.toString(value));
// }
// }
// }
ReportSaveStrategy strategy = reportSaveFactory.getStrategy(dto.getTemplateCode()); ReportSaveStrategy strategy = reportSaveFactory.getStrategy(dto.getTemplateCode());
return RpcResponse.success(strategy.save(dto)); return RpcResponse.success(strategy.save(dto));
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
......
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.*; import cn.com.glsx.dj.mindworkplate.dto.*;
import cn.com.glsx.dj.mindworkplate.dto.warning.EarlyWarningThresholdConfigHistoryDTO;
import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg; import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg;
import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse; import cn.com.glsx.dj.mindworkplate.model.warning.WarningMsgResponse;
import cn.com.glsx.dj.mindworkplate.service.EarlyWarningThresholdConfigService;
import cn.com.glsx.dj.mindworkplate.service.warning.WarningMsgService; import cn.com.glsx.dj.mindworkplate.service.warning.WarningMsgService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import java.util.Map;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
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;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -29,6 +31,9 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{ ...@@ -29,6 +31,9 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{
@Autowired @Autowired
private WarningMsgService warningMsgService; private WarningMsgService warningMsgService;
@Autowired
private EarlyWarningThresholdConfigService earlyWarningThresholdConfigService;
@Override @Override
public RpcResponse<RpcPagination<EarlyWarningMsgDTO>> listStaffWaringMsgWithPage(RpcPagination<EarlyWarningMsgDTO> pagination) { public RpcResponse<RpcPagination<EarlyWarningMsgDTO>> listStaffWaringMsgWithPage(RpcPagination<EarlyWarningMsgDTO> pagination) {
try{ try{
...@@ -151,4 +156,18 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{ ...@@ -151,4 +156,18 @@ public class EarlyWarningMsgRemoteImpl implements EarlyWarningMsgRemote{
return RpcResponse.error(e); return RpcResponse.error(e);
} }
} }
@Override
public RpcResponse<List<EarlyWarningThresholdConfigHistoryDTO>> listMerchantAnalysisIndexHistory(String merchantNo) {
try{
List<EarlyWarningThresholdConfigHistoryDTO> result = earlyWarningThresholdConfigService.listMerchantAnalysisIndexHistory(merchantNo);
return RpcResponse.success(result);
}catch(RpcServiceException e){
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}catch(Exception e){
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
} }
package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.ConversationBatchDTO;
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.MonitorTypeDict;
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.service.ConversationBatchService;
import cn.com.glsx.dj.mindworkplate.service.monitoring.MonitoringService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author zhouhb
* @version V1.0
* @Title MonitoringRemoteImpl
* @Description:
* @date 2026/1/16 10:58
* @Company:didihu.com.cn
*/
@Slf4j
@DubboService(protocol = "dubbo",version = "1.0.0")
public class MonitoringRemoteImpl implements MonitoringRemote{
@Autowired
private MonitoringService monitoringService;
@Autowired
private ConversationBatchService conversationBatchService;
@Override
public RpcResponse<List<MonitoringMsgDTO>> getMonitorListByCondition(MonitorBaseRequest request) {
try {
return RpcResponse.success(monitoringService.getMonitorListByCondition(request));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<MonitorTypeDict>> findMonitorTypeDictList(Integer businessType) {
try {
return RpcResponse.success(monitoringService.findMonitorTypeDictList(businessType));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<StoreItemResponse>> findMonitorListPage(MonitorFilterRequest request) {
try {
return RpcResponse.success(monitoringService.findMonitorListPage(request));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<LearningEffectAnalysisDTO> findLearningEffectAnalysis(
LearningEffectAnalysisRequest request) {
try {
return RpcResponse.success(monitoringService.findLearningEffectAnalysis(request));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<RpcPagination<ConversationBatchDTO>> getRecordPageListByCondition(
RpcPagination<LearningEffectAnalysisRequest> request) {
try {
Page<ConversationBatchDTO> res = conversationBatchService.getRecordPageListByCondition(request);
return RpcResponse.success(RpcPagination.copyPage(res));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<ConversationBatchDTO> findRecordStaticByCondition(
LearningEffectAnalysisRequest request) {
try {
return RpcResponse.success(conversationBatchService.getRecordStaticByCondition(request));
} catch (RpcServiceException e) {
log.error(e.getMessage(), e);
return RpcResponse.error(e);
}
}
}
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*; import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox; import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.mindworkplate.model.WarningNotification; import cn.com.glsx.dj.mindworkplate.model.WarningNotification;
import cn.com.glsx.dj.mindworkplate.service.messagebox.ModuleTypeDetailHandlerService;
import cn.com.glsx.dj.mindworkplate.service.script.PadMessageBoxService; import cn.com.glsx.dj.mindworkplate.service.script.PadMessageBoxService;
import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService; import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
...@@ -28,6 +30,10 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote { ...@@ -28,6 +30,10 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote {
@Autowired @Autowired
private WarningNotificationService warningNotificationService; private WarningNotificationService warningNotificationService;
@Autowired
private ModuleTypeDetailHandlerService moduleTypeDetailHandlerService;
@Override @Override
public RpcResponse<PadMessageBoxRecordDTO> listUnreadScriptMessageBoxRecord(ScriptSearchDTO request) { public RpcResponse<PadMessageBoxRecordDTO> listUnreadScriptMessageBoxRecord(ScriptSearchDTO request) {
try { try {
...@@ -143,7 +149,7 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote { ...@@ -143,7 +149,7 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote {
@Override @Override
public RpcResponse<PadMessageBox> messageBoxSaveRemote(PadMessageBox requestDTO) { public RpcResponse<PadMessageBox> messageBoxSaveRemote(PadMessageBox requestDTO) {
try { try {
return RpcResponse.success(padMessageBoxService.saveMessageBoxRecord(requestDTO)); return RpcResponse.success(padMessageBoxService.newSaveMessageBoxRecord(requestDTO));
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.error("消息盒子数据保存异常[{}]", e.getMessage(),e); log.error("消息盒子数据保存异常[{}]", e.getMessage(),e);
throw e; throw e;
...@@ -296,4 +302,47 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote { ...@@ -296,4 +302,47 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote {
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
} }
} }
@Override
public RpcResponse<RpcPagination<NewPadMessageBoxDTO>> pagePadMessageBox(RpcPagination<NewPadMessageBoxDTO> pagination) {
try {
Page<NewPadMessageBoxDTO> page = padMessageBoxService.pagePadMessageBox(pagination);
return RpcResponse.success(RpcPagination.copyPage(page));
} catch (RpcServiceException e) {
log.error("分页查询消息盒子列表异常", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("分页查询消息盒子列表异常", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<NewPadMessageBoxDTO> getMessageBoxDetail(NewPadMessageBoxDTO dto) {
try {
NewPadMessageBoxDTO result = moduleTypeDetailHandlerService.getMessageBoxDetail(dto);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("查询消息盒子消息详情异常", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("查询消息盒子消息详情异常", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
@Override
public RpcResponse<List<ModuleUnreadCountDTO>> listUnreadMessageCountByModuleType(ModuleUnreadQueryDTO dto) {
try {
List<ModuleUnreadCountDTO> result = padMessageBoxService.listUnreadMessageCountByModuleType(dto);
return RpcResponse.success(result);
} catch (RpcServiceException e) {
log.error("按模块类型分组查询未读消息数量异常", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("按模块类型分组查询未读消息数量异常", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
} }
...@@ -10,7 +10,10 @@ import cn.com.glsx.dj.mindworkplate.model.ConversationBatch; ...@@ -10,7 +10,10 @@ import cn.com.glsx.dj.mindworkplate.model.ConversationBatch;
import cn.com.glsx.dj.mindworkplate.model.ReceptionStaffStaticDTO; import cn.com.glsx.dj.mindworkplate.model.ReceptionStaffStaticDTO;
import cn.com.glsx.dj.mindworkplate.model.export.BadgeCheckExportModel; import cn.com.glsx.dj.mindworkplate.model.export.BadgeCheckExportModel;
import cn.com.glsx.dj.mindworkplate.model.export.BadgeReceptionExportModel; import cn.com.glsx.dj.mindworkplate.model.export.BadgeReceptionExportModel;
import cn.com.glsx.dj.mindworkplate.model.warning.LearningEffectAnalysisRequest;
import cn.com.glsx.dj.mindworkplate.response.warning.WarningMsgStaffRes; import cn.com.glsx.dj.mindworkplate.response.warning.WarningMsgStaffRes;
import cn.com.glsx.dj.mindworkplate.service.monitoring.LearningPeriodCalculator;
import cn.com.glsx.dj.mindworkplate.service.monitoring.LearningPeriodCalculator.LearningTimeRange;
import cn.com.glsx.dj.mindworkplate.service.recordmodelcall.model.ReceptionOrderDetailExportModel; import cn.com.glsx.dj.mindworkplate.service.recordmodelcall.model.ReceptionOrderDetailExportModel;
import cn.com.glsx.dj.mindworkplate.util.excel.EasyExcelUtil; import cn.com.glsx.dj.mindworkplate.util.excel.EasyExcelUtil;
import cn.com.glsx.dj.smartcarlife.util.DateUtils; import cn.com.glsx.dj.smartcarlife.util.DateUtils;
...@@ -26,6 +29,10 @@ import com.github.pagehelper.PageHelper; ...@@ -26,6 +29,10 @@ import com.github.pagehelper.PageHelper;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
...@@ -74,6 +81,12 @@ public class ConversationBatchService { ...@@ -74,6 +81,12 @@ public class ConversationBatchService {
@Autowired @Autowired
private MerchantService merchantService; private MerchantService merchantService;
@Autowired
private AiInspectionRequestMapper aiInspectionRequestMapper;
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
/** /**
* 分页查询质检批次列表 * 分页查询质检批次列表
...@@ -509,4 +522,118 @@ public class ConversationBatchService { ...@@ -509,4 +522,118 @@ public class ConversationBatchService {
public void updatReviewFlag(Integer batchId) { public void updatReviewFlag(Integer batchId) {
conversationBatchMapper.updatReviewFlag(batchId); conversationBatchMapper.updatReviewFlag(batchId);
} }
/**
* 获取录音列表
*
* @param request 入参
* @return 录音列表
*/
public Page<ConversationBatchDTO> getRecordPageListByCondition(
RpcPagination<LearningEffectAnalysisRequest> request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
convertTime(request.getCondition());
convertLearningEffectAnalysis(request.getCondition());
Page<ConversationBatchDTO> recordPageListByCondition = conversationBatchMapper.getRecordPageListByCondition(
request.getCondition());
for (ConversationBatchDTO conversationBatchDTO : recordPageListByCondition){
if (conversationBatchDTO.getDuration() != null) {
conversationBatchDTO.setDurationTime(Long.valueOf(conversationBatchDTO.getDuration()));
conversationBatchDTO.setDuration(convertMillisecondsToHoursMinutesSeconds(
conversationBatchDTO.getDuration() == null ? 0
: Long.parseLong(conversationBatchDTO.getDuration())));
}
}
return recordPageListByCondition;
}
private void convertTime(LearningEffectAnalysisRequest condition) {
Integer analysisPeriodDays = condition.getAnalysisPeriodDays();
if (analysisPeriodDays != null){
if (analysisPeriodDays==1){
condition.setAnalysisPeriodDays(7);
} else if (analysisPeriodDays==2){
condition.setAnalysisPeriodDays(14);
} else if (analysisPeriodDays==3){
condition.setAnalysisPeriodDays(30);
}
}
}
/**
* 转换学习效果分析的开始时间和结束时间
*
* @param condition 入参
*/
private void convertLearningEffectAnalysis(LearningEffectAnalysisRequest condition) {
Integer analysisPeriodDays = condition.getAnalysisPeriodDays();
if (analysisPeriodDays != null){
if (condition.getStartDate()== null || condition.getEndDate() == null){
throw new RpcServiceException("请选择开始时间和结束时间");
}
// 计算学习效果分析的开始时间和结束时间
LearningTimeRange learningTimeRange = LearningPeriodCalculator.calculateLearningPeriod(
condition.getStartDate(), condition.getEndDate(), condition.getAnalysisPeriodDays());
if (condition.getLearningEffectType()==null||condition.getLearningEffectType().intValue()==1){
condition.setStartDate(learningTimeRange.getBeforeStartDate());
condition.setEndDate(learningTimeRange.getBeforeEndDate());
}else{
condition.setStartDate(learningTimeRange.getAfterStartDate());
condition.setEndDate(learningTimeRange.getAfterEndDate());
}
}
}
/**
* 获取录音总览统计
*
* @param request 入参
* @return 质检平均分以及攻防平均分
*/
public ConversationBatchDTO getRecordStaticByCondition(LearningEffectAnalysisRequest request) {
// 查询ai导师建议
Integer learningEffectType = request.getLearningEffectType();
String aiTutorTime=null;
if (learningEffectType != null && learningEffectType.intValue() == 1){
if (request.getAnalysisPeriodDays()==1){
aiTutorTime= getMondayOfWeekOffset(request.getStartDate(), 0);
}else {
aiTutorTime = getMondayOfWeekOffset(request.getStartDate(),
-(request.getAnalysisPeriodDays() - 1));
}
}else{
aiTutorTime = getMondayOfWeekOffset(request.getEndDate(), request.getAnalysisPeriodDays()+1);
}
log.info("获取startDate的n周前|后周一时间:{}",aiTutorTime);
convertTime(request);
convertLearningEffectAnalysis(request);
ConversationBatchDTO recordStaticByCondition = conversationBatchMapper.getRecordStaticByCondition(
request);
// 获取startDate的n周前|后周一时间
recordStaticByCondition.setAiTutorSuggest(aiInspectionRequestMapper.getAiTutorSuggest(aiTutorTime,request.getStaffId(),request.getBusinessType()));
return recordStaticByCondition;
}
/**
* 获取 startDateStr 的 n 周前/后(n 可为负)的周一日期字符串
*
* @param startDateStr 格式: "yyyy-MM-dd",如 "2026-01-24"
* @param n 周偏移量(0=当前周,1=下周,-1=上周)
* @return 周一日期字符串,格式 "yyyy-MM-dd"
* @throws IllegalArgumentException 如果日期格式无效
*/
public static String getMondayOfWeekOffset(String startDateStr, int n) {
try {
LocalDate startDate = LocalDate.parse(startDateStr, FORMATTER);
LocalDate monday = startDate.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
LocalDate targetMonday = monday.plusWeeks(n);
return targetMonday.format(FORMATTER); // 或直接 targetMonday.toString()
} catch (Exception e) {
throw new IllegalArgumentException("日期格式错误,应为 yyyy-MM-dd,输入: " + startDateStr, e);
}
}
} }
package cn.com.glsx.dj.mindworkplate.service; package cn.com.glsx.dj.mindworkplate.service;
import cn.com.glsx.dj.mindworkplate.dto.warning.EarlyWarningThresholdConfigHistoryDTO;
import cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigHistoryMapper;
import cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigMapper; import cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigMapper;
import cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdRangeConfigMapper; import cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdRangeConfigMapper;
import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfig; import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfig;
import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory;
import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdRangeConfig; import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdRangeConfig;
import java.util.Date; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Slf4j
@Service @Service
public class EarlyWarningThresholdConfigService { public class EarlyWarningThresholdConfigService {
...@@ -18,6 +26,9 @@ public class EarlyWarningThresholdConfigService { ...@@ -18,6 +26,9 @@ public class EarlyWarningThresholdConfigService {
@Autowired @Autowired
private EarlyWarningThresholdRangeConfigMapper earlyWarningThresholdRangeConfigMapper; private EarlyWarningThresholdRangeConfigMapper earlyWarningThresholdRangeConfigMapper;
@Autowired
private EarlyWarningThresholdConfigHistoryMapper earlyWarningThresholdConfigHistoryMapper;
/** /**
* 根据商户号查询预警阈值 * 根据商户号查询预警阈值
* *
...@@ -80,4 +91,54 @@ public class EarlyWarningThresholdConfigService { ...@@ -80,4 +91,54 @@ public class EarlyWarningThresholdConfigService {
earlyWarningThresholdConfigMapper.insert(earlyWarningThresholdConfig); earlyWarningThresholdConfigMapper.insert(earlyWarningThresholdConfig);
} }
} }
/**
* 备份当前所有门店的指标记录到历史表
* 每月1号凌晨1点执行,记录上一个月的指标数据
*/
public void backupThresholdConfigToHistory() {
log.info("开始备份门店指标记录到历史表");
try {
// 直接使用SQL将数据从配置表备份到历史表,SQL内部自动计算上一个月的年月
int insertCount = earlyWarningThresholdConfigHistoryMapper.backupConfigToHistory();
log.info("成功备份{}条门店指标记录到历史表", insertCount);
} catch (Exception e) {
log.error("备份门店指标记录到历史表失败", e);
throw new RuntimeException("备份门店指标记录失败: " + e.getMessage(), e);
}
}
/**
* 查询门店历史兜底指标
*
* @param merchantNo 请求参数
* @return 历史指标数据列表
*/
public List<EarlyWarningThresholdConfigHistoryDTO> listMerchantAnalysisIndexHistory(String merchantNo) {
// 查询历史指标数据,按月份倒序排列
List<EarlyWarningThresholdConfigHistory> historyList = earlyWarningThresholdConfigHistoryMapper.selectByMerchantNoOrderByMonthDesc(merchantNo);
// 转换为DTO并设置月份显示格式
List<EarlyWarningThresholdConfigHistoryDTO> dtoList = new ArrayList<>();
for (EarlyWarningThresholdConfigHistory history : historyList) {
EarlyWarningThresholdConfigHistoryDTO dto = new EarlyWarningThresholdConfigHistoryDTO();
BeanUtils.copyProperties(history, dto);
// 将月份格式转换为 yyyy年MM月 格式
String recordYearMonth = history.getRecordYearMonth();
if (recordYearMonth != null && recordYearMonth.length() >= 7) {
String year = recordYearMonth.substring(0, 4);
String month = recordYearMonth.substring(5, 7);
String displayMonth = year + "年" + month + "月";
dto.setRecordYearMonth(displayMonth);
}
dtoList.add(dto);
}
return dtoList;
}
} }
...@@ -301,6 +301,7 @@ public class EmployeeBadgeService { ...@@ -301,6 +301,7 @@ public class EmployeeBadgeService {
dto.setDefencePoint(formatDefenceScore(dto.getDefencePoint())); dto.setDefencePoint(formatDefenceScore(dto.getDefencePoint()));
// phoneNumber脱敏显示为 139****8888 格式 // phoneNumber脱敏显示为 139****8888 格式
dto.setPhoneNumber(maskPhoneNumber(dto.getPhoneNumber())); dto.setPhoneNumber(maskPhoneNumber(dto.getPhoneNumber()));
dto.setMerchantId(dto.getMerchantNo());
} }
return page; return page;
} }
......
...@@ -95,6 +95,10 @@ public class RecordingCheckResultService { ...@@ -95,6 +95,10 @@ public class RecordingCheckResultService {
recordingCheckResult.setScriptRec("[]"); recordingCheckResult.setScriptRec("[]");
} }
} }
}else{
for (RecordingCheckResult recordingCheckResult : recordingCheckResults) {
recordingCheckResult.setScriptRec("[]");
}
} }
recordingCheckResultMapper.insertList(recordingCheckResults); recordingCheckResultMapper.insertList(recordingCheckResults);
} }
......
package cn.com.glsx.dj.mindworkplate.service.messagebox;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ModuleTypeDetailHandler;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.NewPadMessageBoxDTO;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.mindworkplate.mapper.PadMessageBoxMapper;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.bean.BeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.util.*;
@Slf4j
@Service
public class ModuleTypeDetailHandlerService {
@Autowired
private PadMessageBoxMapper padMessageBoxMapper;
private final List<ModuleTypeDetailHandler> handlers;
private Map<Integer, ModuleTypeDetailHandler> handlerMap = new HashMap<>();
public ModuleTypeDetailHandlerService(List<ModuleTypeDetailHandler> handlers) {
this.handlers = handlers;
}
@PostConstruct
public void init() {
if (handlers != null) {
for (ModuleTypeDetailHandler handler : handlers) {
handlerMap.put(handler.getModuleType(), handler);
}
}
}
/**
* 查询消息详情
* @param dto 消息ID
* @return 消息详情
*/
@Transactional
public NewPadMessageBoxDTO getMessageBoxDetail(NewPadMessageBoxDTO dto) {
PadMessageBox padMessageBox = padMessageBoxMapper.selectByPrimaryKey(dto.getId());
if (padMessageBox == null) {
throw new RpcServiceException(DefaultErrorEnum.DATA_NOT_EXIST, "消息不存在");
}
if (!dto.getPhone().equals(padMessageBox.getPhone())) {
log.warn("查询消息详情时手机号不匹配,用户手机号:{}, 消息手机号:{}", dto.getPhone(), padMessageBox.getPhone());
return null;
}
// 3. 查询消息具体业务信息
NewPadMessageBoxDTO result = BeanUtil.copyProperties(padMessageBox, NewPadMessageBoxDTO.class);
ModuleTypeDetailHandler handler = handlerMap.get(padMessageBox.getModuleType());
if (handler != null) {
Object detail = handler.getDetail(padMessageBox);
result.setMsgDetail(detail);
}
// 4. 更新pad_message_box表对应消息的已读状态
updateMessageBoxStatus(dto.getId());
// 5. 根据module_type不同的类型去调不同的业务接口更新业务消息记录的已读状态
if (handler != null && Objects.nonNull(result.getMsgDetail())) {
handler.updateBusinessStatus(padMessageBox);
}
return result;
}
/**
* 更新消息盒子状态
* @param id 消息ID
*/
private void updateMessageBoxStatus(Integer id) {
PadMessageBox updateRecord = new PadMessageBox();
updateRecord.setId(id);
updateRecord.setStatus(1); // 已读状态
updateRecord.setUpdatedTime(new Date());
padMessageBoxMapper.updateByPrimaryKeySelective(updateRecord);
log.debug("已更新消息盒子状态,ID:{}", id);
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.service.monitoring;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
public class LearningPeriodCalculator {
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
/**
* 计算学习前、学习后的时间范围
*
* @param startDateStr 执行周期开始时间(格式: yyyy-MM-dd)
* @param endDateStr 执行周期结束时间(格式: yyyy-MM-dd)
* @param periodDays 分析周期天数(7=一周, 14=两周, 30=一月)
* @return 包含四个时间点的结果对象
*/
public static LearningTimeRange calculateLearningPeriod(
String startDateStr,
String endDateStr,
int periodDays) {
LocalDate startDate = LocalDate.parse(startDateStr, FORMATTER);
LocalDate endDate = LocalDate.parse(endDateStr, FORMATTER);
// 学习前:从 (startDate - periodDays) 到 startDate
LocalDate beforeStart = startDate.minusDays(periodDays);
LocalDate beforeEnd = startDate.minusDays(1); // 通常“前”不包含 start 当天
// 学习后:从 (endDate + 1) 到 (endDate + periodDays)
LocalDate afterStart = endDate.plusDays(1);
LocalDate afterEnd = endDate.plusDays(periodDays);
return new LearningTimeRange(
beforeStart.format(FORMATTER),
beforeEnd.format(FORMATTER),
afterStart.format(FORMATTER),
afterEnd.format(FORMATTER)
);
}
// -------------------------
// 结果封装类
// -------------------------
public static class LearningTimeRange {
private final String beforeStartDate; // 学习前开始
private final String beforeEndDate; // 学习前结束
private final String afterStartDate; // 学习后开始
private final String afterEndDate; // 学习后结束
public LearningTimeRange(String beforeStartDate, String beforeEndDate,
String afterStartDate, String afterEndDate) {
this.beforeStartDate = beforeStartDate;
this.beforeEndDate = beforeEndDate;
this.afterStartDate = afterStartDate;
this.afterEndDate = afterEndDate;
}
// Getters
public String getBeforeStartDate() { return beforeStartDate; }
public String getBeforeEndDate() { return beforeEndDate; }
public String getAfterStartDate() { return afterStartDate; }
public String getAfterEndDate() { return afterEndDate; }
@Override
public String toString() {
return String.format(
"学习前: [%s, %s], 学习后: [%s, %s]",
beforeStartDate, beforeEndDate, afterStartDate, afterEndDate
);
}
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.service.monitoring;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
public class NextPeriodCalculator {
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd");
public static void main(String[] args) {
System.out.println(calculateNextPeriod(2, "2025-01-31"));
}
/**
* 计算下一周期的开始和结束时间
*
* @param periodType 周期类型:1-周,2-月,4-自定义
* @param endDateStr 仅当 periodType=3 时需要,格式 yyyy-MM-dd
* @return 下一周期的时间范围
*/
public static NextPeriodRange calculateNextPeriod(Integer periodType, String endDateStr) {
LocalDate referenceDate;
if (endDateStr == null || endDateStr.trim().isEmpty()) {
referenceDate = LocalDate.now(); // 默认用当前时间
} else {
referenceDate = LocalDate.parse(endDateStr, FORMATTER);
}
LocalDate nextStart;
LocalDate nextEnd;
switch (periodType) {
case 1: // 周:以下一周期周一到周日
LocalDate nextMonday = referenceDate.with(DayOfWeek.MONDAY).plusWeeks(1);
nextStart = nextMonday;
nextEnd = nextMonday.plusDays(6);
break;
case 2: // 月:下一个月的完整月
nextStart = referenceDate.plusMonths(1).withDayOfMonth(1);
nextEnd = nextStart.with(TemporalAdjusters.lastDayOfMonth());
break;
case 4: // 自定义:结束后的一周(7天)
nextStart = referenceDate.plusDays(1);
nextEnd = referenceDate.plusDays(7);
break;
default:
throw new IllegalArgumentException("不支持的 periodType: " + periodType);
}
return new NextPeriodRange(
nextStart.format(FORMATTER),
nextEnd.format(FORMATTER)
);
}
// -------------------------
// 结果封装类
// -------------------------
public static class NextPeriodRange {
private final String startDate;
private final String endDate;
public NextPeriodRange(String startDate, String endDate) {
this.startDate = startDate;
this.endDate = endDate;
}
public String getStartDate() { return startDate; }
public String getEndDate() { return endDate; }
@Override
public String toString() {
return String.format("下一周期: [%s, %s]", startDate, endDate);
}
}
}
\ No newline at end of file \ No newline at end of file
...@@ -316,6 +316,14 @@ public class PadMessageBoxService { ...@@ -316,6 +316,14 @@ public class PadMessageBoxService {
return record; return record;
} }
public PadMessageBox newSaveMessageBoxRecord(PadMessageBox padMessageBox) {
padMessageBox.setCreatedTime(new Date());
padMessageBox.setDelFlag(DeleteFlagEnum.N.getValue());
int i = padMessageBoxMapper.insert(padMessageBox);
return padMessageBox;
}
/** /**
* 批量插入AI导师消息盒子记录 * 批量插入AI导师消息盒子记录
* @param messageList * @param messageList
...@@ -408,10 +416,10 @@ public class PadMessageBoxService { ...@@ -408,10 +416,10 @@ public class PadMessageBoxService {
//2.优秀话术 //2.优秀话术
PadMessageSummaryDetail lastScriptMessage = findLastScriptMessage(request); PadMessageSummaryDetail lastScriptMessage = findLastScriptMessage(request);
if (lastScriptMessage != null) list.add(lastScriptMessage); if (lastScriptMessage != null) list.add(lastScriptMessage);
//3.企业消息 //3.企业消息 + 任务策略类
PadMessageSummaryDetail lastContentManagerMessage = findLastContentManagerMessage(request); PadMessageSummaryDetail lastContentManagerMessage = findLastContentManagerMessage(request);
if (lastContentManagerMessage != null) list.add(lastContentManagerMessage); if (lastContentManagerMessage != null) list.add(lastContentManagerMessage);
//4.长课程 //4.长课程 + 学习策略类
request.setModuleType(ModuleTypeEnums.STUDY_TASK.getCode()); request.setModuleType(ModuleTypeEnums.STUDY_TASK.getCode());
PadMessageSummaryDetail lastLongCourseMessage = findCourseMessage(request); PadMessageSummaryDetail lastLongCourseMessage = findCourseMessage(request);
if (lastLongCourseMessage != null) list.add(lastLongCourseMessage); if (lastLongCourseMessage != null) list.add(lastLongCourseMessage);
...@@ -423,6 +431,11 @@ public class PadMessageBoxService { ...@@ -423,6 +431,11 @@ public class PadMessageBoxService {
// 6.活动消息 // 6.活动消息
Optional.ofNullable(activityMsgSummaryDetailBuilder(request)).ifPresent(list::add); Optional.ofNullable(activityMsgSummaryDetailBuilder(request)).ifPresent(list::add);
//7.优秀案例分享策略
request.setModuleType(ModuleTypeEnums.EXCELLENT_CASE_POLICY.getCode());
PadMessageSummaryDetail excellentCasePolicyMessage = findCourseMessage(request);
if (excellentCasePolicyMessage != null) list.add(excellentCasePolicyMessage);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList(); return Collections.emptyList();
} else { } else {
...@@ -443,9 +456,23 @@ public class PadMessageBoxService { ...@@ -443,9 +456,23 @@ public class PadMessageBoxService {
if (CollectionUtils.isNotEmpty(countList)) { if (CollectionUtils.isNotEmpty(countList)) {
Map<Integer, PadMessageSummaryDetail> moduleTypeMap = countList.stream().collect(Collectors.toMap(PadMessageSummaryDetail::getModuleType, x -> x)); Map<Integer, PadMessageSummaryDetail> moduleTypeMap = countList.stream().collect(Collectors.toMap(PadMessageSummaryDetail::getModuleType, x -> x));
list.forEach(x -> { list.forEach(x -> {
if (moduleTypeMap.containsKey(x.getModuleType())) { if (x.getModuleType().equals(ModuleTypeEnums.STUDY_TASK.getCode())) {
PadMessageSummaryDetail countInfo = moduleTypeMap.get(x.getModuleType()); //将学习类课程 合并到 长课程 类型
x.setCount(countInfo.getCount()); PadMessageSummaryDetail learningPolicy = moduleTypeMap.get(ModuleTypeEnums.LEARNING_POLICY.getCode());
int count = 0;
if (learningPolicy != null) {
count += learningPolicy.getCount();
}
PadMessageSummaryDetail studyTask = moduleTypeMap.get(ModuleTypeEnums.STUDY_TASK.getCode());
if (studyTask != null) {
count += studyTask.getCount();
}
x.setCount(count);
} else {
if (moduleTypeMap.containsKey(x.getModuleType())) {
PadMessageSummaryDetail countInfo = moduleTypeMap.get(x.getModuleType());
x.setCount(countInfo.getCount());
}
} }
}); });
} }
...@@ -563,7 +590,11 @@ public class PadMessageBoxService { ...@@ -563,7 +590,11 @@ public class PadMessageBoxService {
if (Objects.equals(ModuleTypeEnums.AI_MENTOR.getCode(),request.getModuleType())) { if (Objects.equals(ModuleTypeEnums.AI_MENTOR.getCode(),request.getModuleType())) {
padMessageBoxMapper.listShortCourseBoxMessage(request); padMessageBoxMapper.listShortCourseBoxMessage(request);
} else if (Objects.equals(ModuleTypeEnums.STUDY_TASK.getCode(),request.getModuleType())) { } else if (Objects.equals(ModuleTypeEnums.STUDY_TASK.getCode(),request.getModuleType())) {
//返回长课程+学习类策略 消息
padMessageBoxMapper.listLongCourseBoxMessage(request); padMessageBoxMapper.listLongCourseBoxMessage(request);
} else if(Objects.equals(ModuleTypeEnums.EXCELLENT_CASE_POLICY.getCode(), request.getModuleType())) {
//优秀案例分享策略
padMessageBoxMapper.listExcellentCaseBoxMessage(request);
} else { } else {
throw new RpcServiceException("消息类型错误"); throw new RpcServiceException("消息类型错误");
} }
...@@ -686,4 +717,26 @@ public class PadMessageBoxService { ...@@ -686,4 +717,26 @@ public class PadMessageBoxService {
} }
return true; return true;
} }
/**
* 按模块类型分组查询未读消息数量
*
* @param moduleUnreadQueryDTO 查询条件
* @return 按模块类型分组的未读消息数量列表
*/
public List<ModuleUnreadCountDTO> listUnreadMessageCountByModuleType(ModuleUnreadQueryDTO moduleUnreadQueryDTO) {
return padMessageBoxMapper.listUnreadMessageCountByModuleType(moduleUnreadQueryDTO);
}
/**
* 分页查询消息盒子
*
* @param pagination 查询条件
* @return 分页结果
*/
public Page<NewPadMessageBoxDTO> pagePadMessageBox(RpcPagination<NewPadMessageBoxDTO> pagination) {
Page<NewPadMessageBoxDTO> page = PageHelper.startPage(pagination.getPageNum(), pagination.getPageSize());
padMessageBoxMapper.pagePadMessageBox(pagination.getCondition());
return page;
}
} }
package cn.com.glsx.dj.mindworkplate.service.warning;
import cn.com.glsx.dj.mindworkplate.mapper.EcoCoefficientRuleMapper;
import cn.com.glsx.dj.mindworkplate.model.EcoCoefficientRule;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@Slf4j
@Service
public class EcoCoefficientService {
@Autowired
private EcoCoefficientRuleMapper ruleMapper;
// 内存缓存:Map<indicatorCode, List<规则(按min升序)>>
private final Map<String, List<EcoCoefficientRule>> ruleCache = new ConcurrentHashMap<>();
@PostConstruct
public void init() {
reloadRules();
}
/**
* 重新加载规则到内存(可用于定时刷新或配置变更后调用)
*/
public void reloadRules() {
List<EcoCoefficientRule> rules = ruleMapper.selectAllEnabledRules();
Map<String, List<EcoCoefficientRule>> grouped = rules.stream()
.collect(Collectors.groupingBy(
EcoCoefficientRule::getIndicatorCode,
Collectors.collectingAndThen(
Collectors.toList(),
list -> list.stream()
.sorted(Comparator.comparing(EcoCoefficientRule::getMinPenetration))
.collect(Collectors.toList())
)
));
ruleCache.clear();
ruleCache.putAll(grouped);
log.info("生态系数规则加载完成,共 {} 条规则,覆盖 {} 个指标", rules.size(), grouped.size());
}
/**
* 根据指标编码和渗透率获取生态系数
*
* @param indicatorCode 指标编码,如 "A091"
* @param penetration 渗透率(0.0 ~ 1.0),如 0.25 表示 25%
* @return 生态系数
* @throws IllegalArgumentException 如果未找到匹配规则
*/
public BigDecimal getCoefficient(String indicatorCode, double penetration) {
List<EcoCoefficientRule> rules = ruleCache.get(indicatorCode);
if (rules == null || rules.isEmpty()) {
throw new IllegalArgumentException("未配置指标 [" + indicatorCode + "] 的生态系数规则");
}
for (EcoCoefficientRule rule : rules) {
BigDecimal min = rule.getMinPenetration();
BigDecimal max = rule.getMaxPenetration();
boolean match = (new BigDecimal(penetration).compareTo(min) >= 0) &&
(max == null || new BigDecimal(penetration).compareTo(max) < 0);
if (match) {
return rule.getCoefficient();
}
}
throw new IllegalStateException("指标 [" + indicatorCode + "] 的规则未覆盖渗透率: " + penetration);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -282,4 +282,8 @@ public class RuleService { ...@@ -282,4 +282,8 @@ public class RuleService {
public Rule selectById(Integer ruleId) { public Rule selectById(Integer ruleId) {
return ruleMapper.selectByPrimaryKey(ruleId); return ruleMapper.selectByPrimaryKey(ruleId);
} }
} }
...@@ -33,25 +33,11 @@ public interface ConditionStrategy { ...@@ -33,25 +33,11 @@ public interface ConditionStrategy {
throw new RuntimeException("比较值值配置为空"); throw new RuntimeException("比较值值配置为空");
} }
// 获取操作符、阈值和连续天数
Integer continuousDays = earlyWarningRuleCondition.getContinuousDays();
Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue();
Integer fieldValueType = earlyWarningRuleCondition.getFieldValueType();
if (continuousDays == null && dynamicTimeRangeValue == null ) {
throw new RuntimeException("continuousDays或者dynamicTimeRangeValue是空");
}
if (fieldValueType == null ) {
throw new RuntimeException("fieldValueType是空");
}
return buildDateParam(earlyWarningRuleCondition); return buildDateParam(earlyWarningRuleCondition);
} }
List<WarningMsgRuleModel> evaluate(EarlyWarningRuleCondition earlyWarningRuleCondition, QueryParams prepare); List<WarningMsgRuleModel> evaluate(EarlyWarningRuleCondition earlyWarningRuleCondition, QueryParams prepare);
default List<WarningMsgRuleModel> aftereValuate(EarlyWarningRuleCondition context, List<WarningMsgRuleModel> warningMsgRuleModels, List<WarningMsgRuleModel> evaluate){ default List<WarningMsgRuleModel> aftereValuate(EarlyWarningRuleCondition context, List<WarningMsgRuleModel> warningMsgRuleModels, List<WarningMsgRuleModel> evaluate){
if(context.getLogicalRelation()==null){ if(context.getLogicalRelation()==null){
return getUnion(warningMsgRuleModels,evaluate); return getUnion(warningMsgRuleModels,evaluate);
...@@ -148,9 +134,11 @@ public interface ConditionStrategy { ...@@ -148,9 +134,11 @@ public interface ConditionStrategy {
static List<WarningMsgRuleModel> getItemDetailByStaff(EarlyWarningRuleCondition earlyWarningRuleCondition,List<ItemDetail> itemDetails,Integer continuousDays,Integer dynamicTimeRangeValue){ static List<WarningMsgRuleModel> getItemDetailByStaff(EarlyWarningRuleCondition earlyWarningRuleCondition,List<ItemDetail> itemDetails,Integer continuousDays,Integer dynamicTimeRangeValue){
Byte monitorType = earlyWarningRuleCondition.getMonitorType(); Byte monitorType = earlyWarningRuleCondition.getMonitorType();
if (monitorType == 1) { if (monitorType == 1) {
// 按日期 + 员工分组 // 按日期 +门店+ 员工分组
Map<String, List<ItemDetail>> groupByDateAndStaff = itemDetails.stream() Map<String, List<ItemDetail>> groupByDateAndStaff = itemDetails.stream()
.collect(Collectors.groupingBy(item -> item.getStaffId())); .collect(Collectors.groupingBy(item ->
item.getMerchantId() + "_" + item.getStaffId() // 或使用 Pair/自定义 key
));
if(groupByDateAndStaff.isEmpty()){ if(groupByDateAndStaff.isEmpty()){
return null; return null;
} }
...@@ -159,11 +147,14 @@ public interface ConditionStrategy { ...@@ -159,11 +147,14 @@ public interface ConditionStrategy {
return itemDetailByCondition.entrySet().stream() return itemDetailByCondition.entrySet().stream()
.map(entry -> { .map(entry -> {
WarningMsgRuleModel warningMsgRuleModel = new WarningMsgRuleModel(); WarningMsgRuleModel warningMsgRuleModel = new WarningMsgRuleModel();
warningMsgRuleModel.setStaffId(entry.getKey()); warningMsgRuleModel.setStaffId(entry.getValue().get(0).getStaffId());
warningMsgRuleModel.setStaffName(entry.getValue().get(0).getStaffName()); warningMsgRuleModel.setStaffName(entry.getValue().get(0).getStaffName());
warningMsgRuleModel.setStaffPhone(entry.getValue().get(0).getStaffPhone()); warningMsgRuleModel.setStaffPhone(entry.getValue().get(0).getStaffPhone());
warningMsgRuleModel.setMerchantId4s(entry.getValue().get(0).getMerchantId()); warningMsgRuleModel.setMerchantId4s(entry.getValue().get(0).getMerchantId());
warningMsgRuleModel.setMerchantName4s(entry.getValue().get(0).getMerchantName()); warningMsgRuleModel.setMerchantName4s(entry.getValue().get(0).getMerchantName());
warningMsgRuleModel.setConfigValue(entry.getValue().get(0).getConfigValue());
warningMsgRuleModel.setConfigValueOld(entry.getValue().get(0).getConfigValueOld());
warningMsgRuleModel.setItemValue(entry.getValue().get(0).getItemValue());
return warningMsgRuleModel; return warningMsgRuleModel;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -258,9 +249,60 @@ public interface ConditionStrategy { ...@@ -258,9 +249,60 @@ public interface ConditionStrategy {
} }
static QueryParams buildDateParam(EarlyWarningRuleCondition earlyWarningRuleCondition){ static QueryParams buildDateParam(EarlyWarningRuleCondition earlyWarningRuleCondition){
Integer dynamicTimeRangeType = earlyWarningRuleCondition.getDynamicTimeRangeType(); // 获取操作符、阈值和连续天数,如果不等于null,则设置动态时间参数
QueryParams queryParams=new QueryParams();
queryParams.setBizs(Integer.valueOf(earlyWarningRuleCondition.getBussinessType()));
queryParams.setItemCodes(earlyWarningRuleCondition.getFieldName());
queryParams.setMerchantIds(earlyWarningRuleCondition.getMerchantIds());
if (earlyWarningRuleCondition.getStartDate() == null && earlyWarningRuleCondition.getEndDate() == null){
setDynamicTime(earlyWarningRuleCondition);
queryParams.setDateType(bulidDateType(earlyWarningRuleCondition.getTimeUnit()));
}else{
// 指定日期的默认4
queryParams.setDateType(4);
}
queryParams.setStartDate(earlyWarningRuleCondition.getStartDate());
queryParams.setEndDate(earlyWarningRuleCondition.getEndDate());
String brandParam = earlyWarningRuleCondition.getBrandParam();
if (brandParam != null){
queryParams.setBrandIds(brandParam);
}
Byte monitorType = earlyWarningRuleCondition.getMonitorType();
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");
queryParams.setMerchantIds(earlyWarningRuleCondition.getMerchantIds());
}
}
return queryParams;
}
static void setDynamicTime(EarlyWarningRuleCondition earlyWarningRuleCondition) {
Integer continuousDays = earlyWarningRuleCondition.getContinuousDays();
Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue(); Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue();
// TODO sql日期实现 Integer fieldValueType = earlyWarningRuleCondition.getFieldValueType();
if (continuousDays == null && dynamicTimeRangeValue == null ) {
throw new RuntimeException("continuousDays或者dynamicTimeRangeValue是空");
}
if (fieldValueType == null ) {
throw new RuntimeException("fieldValueType是空");
}
Integer dynamicTimeRangeType = earlyWarningRuleCondition.getDynamicTimeRangeType();
LocalDate today = LocalDate.now(); // 当前日期 LocalDate today = LocalDate.now(); // 当前日期
LocalDate endDate; // 结束日期 LocalDate endDate; // 结束日期
...@@ -297,29 +339,6 @@ public interface ConditionStrategy { ...@@ -297,29 +339,6 @@ public interface ConditionStrategy {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
earlyWarningRuleCondition.setStartDate(startDate.format(formatter)); earlyWarningRuleCondition.setStartDate(startDate.format(formatter));
earlyWarningRuleCondition.setEndDate(endDate.format(formatter)); earlyWarningRuleCondition.setEndDate(endDate.format(formatter));
QueryParams queryParams=new QueryParams();
queryParams.setBizs(Integer.valueOf(earlyWarningRuleCondition.getBussinessType()));
queryParams.setItemCodes(earlyWarningRuleCondition.getFieldName());
queryParams.setMerchantIds(earlyWarningRuleCondition.getMerchantIds());
queryParams.setStartDate(earlyWarningRuleCondition.getStartDate());
queryParams.setEndDate(earlyWarningRuleCondition.getEndDate());
String brandParam = earlyWarningRuleCondition.getBrandParam();
if (brandParam != null){
queryParams.setBrandIds(brandParam);
}
queryParams.setDateType(bulidDateType(earlyWarningRuleCondition.getTimeUnit()));
Byte monitorType = earlyWarningRuleCondition.getMonitorType();
if(monitorType!=null){
if(monitorType.intValue()==1){
queryParams.setExts("staffIds");
}
if(monitorType.intValue()==2){
queryParams.setExts("merchantIds");
}
}
return queryParams;
} }
static Integer bulidDateType(String timeUnit) { static Integer bulidDateType(String timeUnit) {
......
...@@ -5,10 +5,12 @@ import cn.com.glsx.dj.mindworkplate.model.WarningMsgRuleModel; ...@@ -5,10 +5,12 @@ import cn.com.glsx.dj.mindworkplate.model.WarningMsgRuleModel;
import cn.com.glsx.dj.mindworkplate.service.warning.DateCountService; import cn.com.glsx.dj.mindworkplate.service.warning.DateCountService;
import cn.com.glsx.dj.mindworkplate.service.warning.DateService.ItemDetail; import cn.com.glsx.dj.mindworkplate.service.warning.DateService.ItemDetail;
import cn.com.glsx.dj.mindworkplate.service.warning.DateService.QueryParams; import cn.com.glsx.dj.mindworkplate.service.warning.DateService.QueryParams;
import cn.com.glsx.dj.mindworkplate.service.warning.EcoCoefficientService;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
/** /**
* 数值类型比较 * 数值类型比较
...@@ -20,6 +22,9 @@ public class NumericConditionStrategy implements ConditionStrategy { ...@@ -20,6 +22,9 @@ public class NumericConditionStrategy implements ConditionStrategy {
@Autowired @Autowired
private DateCountService dateCountService; private DateCountService dateCountService;
@Autowired
private EcoCoefficientService ecoCoefficientService;
@Override @Override
public List<WarningMsgRuleModel> evaluate(EarlyWarningRuleCondition earlyWarningRuleCondition, public List<WarningMsgRuleModel> evaluate(EarlyWarningRuleCondition earlyWarningRuleCondition,
QueryParams prepare) { QueryParams prepare) {
...@@ -33,6 +38,16 @@ public class NumericConditionStrategy implements ConditionStrategy { ...@@ -33,6 +38,16 @@ public class NumericConditionStrategy implements ConditionStrategy {
Integer continuousDays = earlyWarningRuleCondition.getContinuousDays(); Integer continuousDays = earlyWarningRuleCondition.getContinuousDays();
Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue(); Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue();
String ruleType = earlyWarningRuleCondition.getRuleType();
if (("生态系数").equals(ruleType)){
if (!CollectionUtils.isEmpty(itemDetails)){
for (ItemDetail itemDetail : itemDetails) {
BigDecimal coefficient = ecoCoefficientService.getCoefficient(itemDetail.getItemCode(), itemDetail.getItemValue().doubleValue());
itemDetail.setItemValue(coefficient);
itemDetail.setConfigValue(BigDecimal.valueOf(threshold));
}
}
}
// 获取满足条件值 // 获取满足条件值
List<ItemDetail> itemValues = ConditionStrategy.evaluateCondition(itemDetails, operator, BigDecimal.valueOf(threshold),earlyWarningRuleCondition.getFieldValueType()); List<ItemDetail> itemValues = ConditionStrategy.evaluateCondition(itemDetails, operator, BigDecimal.valueOf(threshold),earlyWarningRuleCondition.getFieldValueType());
......
...@@ -6,6 +6,8 @@ import cn.com.glsx.dj.mindworkplate.model.WarningMsgRuleModel; ...@@ -6,6 +6,8 @@ import cn.com.glsx.dj.mindworkplate.model.WarningMsgRuleModel;
import cn.com.glsx.dj.mindworkplate.service.warning.DateCountService; import cn.com.glsx.dj.mindworkplate.service.warning.DateCountService;
import cn.com.glsx.dj.mindworkplate.service.warning.DateService.ItemDetail; import cn.com.glsx.dj.mindworkplate.service.warning.DateService.ItemDetail;
import cn.com.glsx.dj.mindworkplate.service.warning.DateService.QueryParams; import cn.com.glsx.dj.mindworkplate.service.warning.DateService.QueryParams;
import cn.com.glsx.dj.mindworkplate.service.warning.EcoCoefficientService;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -22,6 +24,9 @@ public class SqlConditionStrategy implements ConditionStrategy { ...@@ -22,6 +24,9 @@ public class SqlConditionStrategy implements ConditionStrategy {
@Autowired @Autowired
private DateCountService dateCountService; private DateCountService dateCountService;
@Autowired
private EcoCoefficientService ecoCoefficientService;
@Override @Override
public List<WarningMsgRuleModel> evaluate(EarlyWarningRuleCondition earlyWarningRuleCondition, public List<WarningMsgRuleModel> evaluate(EarlyWarningRuleCondition earlyWarningRuleCondition,
QueryParams prepare) { QueryParams prepare) {
...@@ -36,6 +41,15 @@ public class SqlConditionStrategy implements ConditionStrategy { ...@@ -36,6 +41,15 @@ public class SqlConditionStrategy implements ConditionStrategy {
Integer continuousDays = earlyWarningRuleCondition.getContinuousDays(); Integer continuousDays = earlyWarningRuleCondition.getContinuousDays();
Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue(); Integer dynamicTimeRangeValue = earlyWarningRuleCondition.getDynamicTimeRangeValue();
String ruleType = earlyWarningRuleCondition.getRuleType();
if (("生态系数").equals(ruleType)){
if (!org.springframework.util.CollectionUtils.isEmpty(itemDetails)){
for (ItemDetail itemDetail : itemDetails) {
BigDecimal coefficient = ecoCoefficientService.getCoefficient(itemDetail.getItemCode(), itemDetail.getItemValue().doubleValue());
itemDetail.setConfigValue(coefficient);
}
}
}
// 获取满足条件值 // 获取满足条件值
List<ItemDetail> itemValues = evaluateConditionList(itemDetails, operator, warningMsgRuleModels,earlyWarningRuleCondition.getFieldValueType()); List<ItemDetail> itemValues = evaluateConditionList(itemDetails, operator, warningMsgRuleModels,earlyWarningRuleCondition.getFieldValueType());
......
...@@ -32,4 +32,9 @@ ...@@ -32,4 +32,9 @@
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select * from ai_inspection_request where request_status = 2 and employee_phone = #{phone} and inspection_date=#{time} select * from ai_inspection_request where request_status = 2 and employee_phone = #{phone} and inspection_date=#{time}
</select> </select>
<select id="getAiTutorSuggest" resultType="java.lang.String">
select ai_mentor_suggestion from ai_inspection_request t1
where inspection_date = #{tutorTime} and t1.sence=#{businessType} and employee_phone =(SELECT phone_number from dj_car_life_staff_info where staff_uuid = #{uuid} and deleted_flag='N' limit 1)
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<resultMap id="DTOResultMap" type="cn.com.glsx.dj.mindworkplate.dto.ConversationBatchDTO" extends="BaseResultMap"> <resultMap id="DTOResultMap" type="cn.com.glsx.dj.mindworkplate.dto.ConversationBatchDTO" extends="BaseResultMap">
<result column="customer_name" property="customerName" jdbcType="VARCHAR"/> <result column="customer_name" property="customerName" jdbcType="VARCHAR"/>
<result column="phone_number" property="phoneNumber" jdbcType="VARCHAR"/> <result column="phone_number" property="phoneNumber" jdbcType="VARCHAR"/>
<result column="receptionDate" property="receptionDate" jdbcType="VARCHAR"/>
<result column="car_model" property="carModel" jdbcType="VARCHAR"/> <result column="car_model" property="carModel" jdbcType="VARCHAR"/>
<result column="car_brand" property="carBrand" jdbcType="VARCHAR"/> <result column="car_brand" property="carBrand" jdbcType="VARCHAR"/>
<result column="reception_status" property="receptionStatus" jdbcType="INTEGER"/> <result column="reception_status" property="receptionStatus" jdbcType="INTEGER"/>
...@@ -482,4 +483,92 @@ ...@@ -482,4 +483,92 @@
where t1.id=#{batchId} where t1.id=#{batchId}
and t2.deleted_flag = 'N' and t2.deleted_flag = 'N'
</select> </select>
<select id="getRecordPageListByCondition"
resultMap="DTOResultMap">
select
t2.id as id,
t4.phone_number as phoneNumber,
t4.customer_name as customerName,
t4.car_model as carModel,
t5.staff_name as employeeName,
date_format (t4.reception_start_time,'%Y-%m-%d') as receptionDate,
t2.start_time,
t2.file_url,
t2.end_time,
t2.score as score,
t2.duration as duration,
t3.avg_defence as def_score,
t4.reception_status as receptionStatus,
t1.check_History_Flag as checkHistoryFlag,
t4.merchant_id
from
inspection_badge_recordings t1
left join inspection_conversation_batch t2 on t2.record_id=t1.id
left join inspection_defence t3 on (t3.batch_id=t2.id and t3.deleted_flag = 'N')
left join reception_customer_info t4 on t4.id=t1.reception_id
left join dj_car_life_staff_info t5 on t5.staff_uuid =t4.staff_uuid
where t1.deleted_flag = 'N' and t4.id is not null
<if test="condition.startDate != null">
and date_format (t1.recording_start_time,'%Y-%m-%d') &gt;= #{condition.startDate}
</if>
<if test="condition.receptionDate != null and condition.receptionDate!=''">
and date_format (t1.recording_start_time,'%Y-%m-%d')=#{condition.receptionDate}
</if>
<if test="condition.endDate != null">
and date_format (t1.recording_start_time,'%Y-%m-%d') &lt;= #{condition.endDate}
</if>
<if test="condition.staffName != null and condition.staffName!=''">
and t5.staff_name like concat('%',#{condition.staffName},'%')
</if>
<if test="condition.businessType != null">
and t1.check_type = #{condition.businessType}
</if>
<if test="condition.merchantId != null">
and t4.merchant_id= #{condition.merchantId}
</if>
<if test="condition.staffId != null">
and t4.staff_uuid= #{condition.staffId}
</if>
<if test="condition.recordIdList != null ">
and t2.id in
<foreach close=")" collection="condition.recordIdList" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
order by t1.recording_start_time desc
</select>
<select id="getRecordStaticByCondition"
resultType="cn.com.glsx.dj.mindworkplate.dto.ConversationBatchDTO">
select
CASE
WHEN COUNT(t2.score) > 0 THEN SUM(t2.score) / COUNT(t2.score)
ELSE 0
END AS avgScore,
CASE
WHEN COUNT(t3.avg_defence) > 0 THEN SUM(t3.avg_defence) / COUNT(t3.avg_defence)
ELSE 0
END AS avgDefScore
from
inspection_badge_recordings t1
left join inspection_conversation_batch t2 on t2.record_id=t1.id
left join inspection_defence t3 on (t3.batch_id=t2.id and t3.deleted_flag = 'N')
left join reception_customer_info t4 on t4.id=t1.reception_id
left join dj_car_life_staff_info t5 on t5.staff_uuid =t4.staff_uuid
where t1.deleted_flag = 'N' and t4.id is not null
<if test="condition.startDate != null">
and date_format (t1.recording_start_time,'%Y-%m-%d') &gt;= #{condition.startDate}
</if>
<if test="condition.endDate != null">
and date_format (t1.recording_start_time,'%Y-%m-%d') &lt;= #{condition.endDate}
</if>
<if test="condition.businessType != null">
and t1.check_type = #{condition.businessType}
</if>
<if test="condition.merchantId != null">
and t4.merchant_id= #{condition.merchantId}
</if>
<if test="condition.staffId != null">
and t4.staff_uuid= #{condition.staffId}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<result column="custom_time_expression" jdbcType="LONGVARCHAR" property="customTimeExpression" /> <result column="custom_time_expression" jdbcType="LONGVARCHAR" property="customTimeExpression" />
<result column="field_value_type" jdbcType="INTEGER" property="fieldValueType" /> <result column="field_value_type" jdbcType="INTEGER" property="fieldValueType" />
<result column="brand_param" jdbcType="VARCHAR" property="brandParam" /> <result column="brand_param" jdbcType="VARCHAR" property="brandParam" />
<result column="staff_field_name" jdbcType="VARCHAR" property="staffFieldName" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -27,7 +28,7 @@ ...@@ -27,7 +28,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, field_name, operator, value_type, logical_relation, time_window, rule_id, time_unit, 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> </sql>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.mindworkplate.mapper.EarlyWarningThresholdConfigHistoryMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfigHistory" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="record_year_month" property="recordYearMonth" jdbcType="VARCHAR" />
<result column="merchant_no" property="merchantNo" jdbcType="VARCHAR" />
<result column="ew_con_rate" property="ewConRate" jdbcType="DECIMAL" />
<result column="ew_axb_con_rate" property="ewAxbConRate" jdbcType="DECIMAL" />
<result column="ew_lt_con_rate" property="ewLtConRate" jdbcType="DECIMAL" />
<result column="battery_conversion_rate" property="batteryConversionRate" jdbcType="DECIMAL" />
<result column="ri_con_rate" property="riConRate" jdbcType="DECIMAL" />
<result column="ew_penetration_rate" property="ewPenetrationRate" jdbcType="DECIMAL" />
<result column="ew_axb_penetration_rate" property="ewAxbPenetrationRate" jdbcType="DECIMAL" />
<result column="ew_lt_penetration_rate" property="ewLtPenetrationRate" jdbcType="DECIMAL" />
<result column="battery_penetration_rate" property="batteryPenetrationRate" jdbcType="DECIMAL" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, record_year_month, merchant_no, ew_con_rate, ew_axb_con_rate, ew_lt_con_rate,
battery_conversion_rate, ri_con_rate, ew_penetration_rate, ew_axb_penetration_rate,
ew_lt_penetration_rate, battery_penetration_rate, created_date, deleted_flag
</sql>
<!-- 直接从配置表备份数据到历史表,自动计算上一个月的年月 -->
<insert id="backupConfigToHistory">
INSERT INTO early_warning_threshold_config_history
(record_year_month, merchant_no, ew_con_rate, ew_axb_con_rate, ew_lt_con_rate,
battery_conversion_rate, ri_con_rate, ew_penetration_rate, ew_axb_penetration_rate,
ew_lt_penetration_rate, battery_penetration_rate, created_date, deleted_flag)
SELECT
DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m'),
merchant_no,
ew_con_rate,
ew_axb_con_rate,
ew_lt_con_rate,
battery_conversion_rate,
ri_con_rate,
ew_penetration_rate,
ew_axb_penetration_rate,
ew_lt_penetration_rate,
battery_penetration_rate,
NOW(),
'N'
FROM early_warning_threshold_config
WHERE deleted_flag = 'N'
</insert>
<!-- 根据商户号查询历史指标数据,按月份倒序排列 -->
<select id="selectByMerchantNoOrderByMonthDesc" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM early_warning_threshold_config_history
WHERE merchant_no = #{merchantNo,jdbcType=VARCHAR}
AND deleted_flag = 'N'
ORDER BY record_year_month DESC
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.mindworkplate.mapper.EcoCoefficientRuleMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.EcoCoefficientRule" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="indicator_code" property="indicatorCode" jdbcType="VARCHAR" />
<result column="min_penetration" property="minPenetration" jdbcType="DECIMAL" />
<result column="max_penetration" property="maxPenetration" jdbcType="DECIMAL" />
<result column="coefficient" property="coefficient" jdbcType="DECIMAL" />
<result column="sort_order" property="sortOrder" jdbcType="INTEGER" />
<result column="enabled" property="enabled" jdbcType="BIT" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, indicator_code, min_penetration, max_penetration, coefficient, sort_order, enabled,
create_time, update_time
</sql>
<select id="selectAllEnabledRules"
resultMap="BaseResultMap">
select * from eco_coefficient_rule where enabled = 1 order by sort_order
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.com.glsx.dj.mindworkplate.mapper.MonitorTypeDictMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.MonitorTypeDict" >
<!--
WARNING - @mbg.generated
-->
<id column="type_code" property="typeCode" jdbcType="TINYINT" />
<result column="type_name" property="typeName" jdbcType="VARCHAR" />
<result column="description" property="description" jdbcType="VARCHAR" />
<result column="sort_order" property="sortOrder" jdbcType="INTEGER" />
<result column="enabled" property="enabled" jdbcType="BIT" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<!-- 一对多:ruleList -->
<collection
property="rules" ofType="cn.com.glsx.dj.mindworkplate.model.warning.Rule"
javaType="java.util.ArrayList">
<!-- 子表字段映射 -->
<id property="id" column="id"/>
<result property="rule" column="rule"/>
</collection>
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
type_code, type_name, description, sort_order, enabled, create_time
</sql>
<select id="findMonitorTypeDictList"
resultMap="BaseResultMap">
select
t1.type_code as type_code,
t1.type_name as type_name,
t2.id as id,
t2.rule as rule
from monitor_type_dict t1
left join early_warning_rule t2 on t1.type_code = t2.monitor_type_dict_id
where t1.enabled = 1 and t2.deleted_flag ='N'
<if test="bussinessType!=null">
and t2.business_type = #{bussinessType}
</if>
order by t1.sort_order,t2.sort_id
</select>
<select id="findMerchantIdsByUUidAndType" resultType="java.lang.Integer">
select merchant_id from dj_car_life_shop_merchant_director_config where director_user_id = #{uuid} and director_type = #{typeValue} and deleted_flag = 'N'
</select>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -21,8 +21,14 @@ ...@@ -21,8 +21,14 @@
<result column="read_type" property="readType" jdbcType="INTEGER"/> <result column="read_type" property="readType" jdbcType="INTEGER"/>
<result column="read_count" property="readCount" jdbcType="INTEGER"/> <result column="read_count" property="readCount" jdbcType="INTEGER"/>
<result column="latest_read_time" property="latestReadTime" jdbcType="TIMESTAMP"/> <result column="latest_read_time" property="latestReadTime" jdbcType="TIMESTAMP"/>
<result column="reminder_type" property="reminderType" jdbcType="TINYINT"/>
<result column="msg_title" property="msgTitle" jdbcType="VARCHAR"/>
<result column="task_start_time" property="taskStartTime" jdbcType="TIMESTAMP"/>
<result column="task_end_time" property="taskEndTime" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<resultMap id="newPadMessageBoxDTOMap" type="cn.com.glsx.dj.mindworkplate.dto.messagebox.NewPadMessageBoxDTO" extends="BaseResultMap"/>
<resultMap id="ScriptRecordPadPushDTOMap" extends="BaseResultMap" <resultMap id="ScriptRecordPadPushDTOMap" extends="BaseResultMap"
type="cn.com.glsx.dj.mindworkplate.dto.script.ScriptRecordPadPushDTO" > type="cn.com.glsx.dj.mindworkplate.dto.script.ScriptRecordPadPushDTO" >
<id column="title" property="title"/> <id column="title" property="title"/>
...@@ -71,7 +77,8 @@ ...@@ -71,7 +77,8 @@
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, module_type, business_type, uuid, phone, name, status, created_by, created_time, id, module_type, business_type, uuid, phone, name, status, created_by, created_time,
updated_by, updated_time, del_flag updated_by, updated_time, del_flag, popup_count, read_type, read_count, latest_read_time,
reminder_type, msg_title, task_start_time, task_end_time
</sql> </sql>
<select id="listMessageBoxRecordDetail" parameterType="cn.com.glsx.dj.mindworkplate.dto.script.ScriptSearchDTO" <select id="listMessageBoxRecordDetail" parameterType="cn.com.glsx.dj.mindworkplate.dto.script.ScriptSearchDTO"
...@@ -216,7 +223,7 @@ ...@@ -216,7 +223,7 @@
ROUND(100 * count(case when ssc.status = 5 then ssc.id end) / NULLIF(count(ssc.id), 0), 2) task_progress, ROUND(100 * count(case when ssc.status = 5 then ssc.id end) / NULLIF(count(ssc.id), 0), 2) task_progress,
count(ssc.id) course_total_count, count(ssc.id) course_total_count,
sum(sbc.total_duration) total_duration, sum(sbc.total_duration) total_duration,
pmb.status pmb.status, pmb.module_type
from pad_message_box pmb from pad_message_box pmb
left join dj_car_life_content_manager_task_staff_pad_push dclcmtspp on pmb.id = dclcmtspp.msg_bos_id left join dj_car_life_content_manager_task_staff_pad_push dclcmtspp on pmb.id = dclcmtspp.msg_bos_id
left join ( left join (
...@@ -238,7 +245,22 @@ ...@@ -238,7 +245,22 @@
and dclcmts.phone_number = #{phone} and dclcmts.phone_number = #{phone}
</if> </if>
group by pmb.id group by pmb.id
order by pmb.status asc, pmb.created_time desc union all
select
pmb.id, pmb.id as detail_id,
case when pmb.reminder_type = 1 then '新的长课程学习任务' else '长课程学习提醒' end title,
pmb.reminder_type as task_type, pmb.msg_title as task_name, pmb.task_end_time as finish_time,
pmb.created_time, null as complete_status,null as punish_type, null as task_progress, null as course_total_count, null as total_duration,
pmb.status,pmb.module_type
from pad_message_box pmb
where pmb.del_flag = 'N' and pmb.module_type = 6
<if test="phone != null and phone != ''">
and pmb.phone = #{phone}
</if>
<if test="businessType != null">
and pmb.business_type = #{businessType}
</if>
order by status asc, created_time desc
</select> </select>
<update id="markDeadline"> <update id="markDeadline">
...@@ -254,7 +276,7 @@ ...@@ -254,7 +276,7 @@
FROM pad_message_box FROM pad_message_box
WHERE phone = #{phone} WHERE phone = #{phone}
AND del_flag='N' AND del_flag='N'
and module_type in(1,2,3,4) and module_type in(1,2,3,4,6,7)
<if test="status != null"> <if test="status != null">
AND status = #{status} AND status = #{status}
</if> </if>
...@@ -329,6 +351,30 @@ ...@@ -329,6 +351,30 @@
</where> </where>
</select> </select>
<select id="listExcellentCaseBoxMessage" resultMap="ScriptRecordPadPushDTOMap">
select
pmb.id,
pmb.msg_title as title,
pmb.created_time as created_time,
pmb.status,
pmb.module_type
from pad_message_box pmb
<where>
pmb.del_flag = 'N'
and pmb.module_type = 7
<if test="phone != null and phone != ''">
and pmb.phone = #{phone}
</if>
<if test="businessType != null">
and pmb.business_type = #{businessType}
</if>
<if test="status != null">
and pmb.status = #{status}
</if>
</where>
order by pmb.status asc, pmb.created_time desc
</select>
<select id="getActivityMsgPopUpWindow" <select id="getActivityMsgPopUpWindow"
resultType="cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO"> resultType="cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO">
select select
...@@ -347,4 +393,56 @@ ...@@ -347,4 +393,56 @@
order by t2.`type` desc, t1.created_time desc order by t2.`type` desc, t1.created_time desc
limit 1 limit 1
</select> </select>
<select id="pagePadMessageBox" resultMap="newPadMessageBoxDTOMap">
SELECT
<include refid="Base_Column_List" />
FROM pad_message_box
WHERE del_flag = 'N'
<if test="moduleType != null">
AND module_type = #{moduleType,jdbcType=INTEGER}
</if>
<if test="businessType != null">
AND business_type = #{businessType,jdbcType=INTEGER}
</if>
<if test="uuid != null and uuid != ''">
AND uuid = #{uuid,jdbcType=VARCHAR}
</if>
<if test="phone != null and phone != ''">
AND phone = #{phone,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
AND name = #{name,jdbcType=VARCHAR}
</if>
<if test="status != null">
AND status = #{status,jdbcType=INTEGER}
</if>
ORDER BY status ASC
<if test="createdTimeSortType == null or createdTimeSortType == 1">
, created_time DESC
</if>
<if test="createdTimeSortType != null and createdTimeSortType == 0">
, created_time ASC
</if>
</select>
<select id="listUnreadMessageCountByModuleType" parameterType="cn.com.glsx.dj.mindworkplate.dto.messagebox.ModuleUnreadQueryDTO" resultType="cn.com.glsx.dj.mindworkplate.dto.messagebox.ModuleUnreadCountDTO">
SELECT
module_type as moduleType,
COUNT(*) as unreadCount
FROM pad_message_box
WHERE del_flag = 'N'
AND status = 0
AND phone = #{phone}
<if test="moduleTypes != null and moduleTypes.size() > 0">
AND module_type IN
<foreach item="item" collection="moduleTypes" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="businessType != null">
AND business_type = #{businessType}
</if>
GROUP BY module_type
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
<result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" /> <result column="updated_time" property="updatedTime" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" /> <result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
<result column="field_name" property="fieldName" jdbcType="VARCHAR" />
<result column="sortOrder" property="sortOrder" jdbcType="INTEGER" />
<result column="sort_id" property="sortId" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="MsgResultMap" type="cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg" > <resultMap id="MsgResultMap" type="cn.com.glsx.dj.mindworkplate.model.warning.WarningMsg" >
<result column="staff_id" property="staffId" jdbcType="VARCHAR" /> <result column="staff_id" property="staffId" jdbcType="VARCHAR" />
...@@ -64,4 +67,18 @@ ...@@ -64,4 +67,18 @@
<select id="executePrefixSql" resultMap="MsgModelResultMap"> <select id="executePrefixSql" resultMap="MsgModelResultMap">
${ruleSql} ${ruleSql}
</select> </select>
<select id="selectByTypeAndMetricType"
resultMap="BaseResultMap">
SELECT t1.*,t2.field_name,t3.sort_order as sortOrder FROM early_warning_rule t1
LEFT JOIN early_warning_rule_condition t2 ON t1.id=t2.rule_id
left join monitor_type_dict t3 on t1.monitor_type_dict_id=t3.type_code
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 t1.id=#{metricTypeId}
</if>
group by t1.id
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
tianqi.baseurl=http://192.168.5.4:8021
account.baseurl=http://rop-merchant.beta.glsx.com.cn/rop-merchants/router
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.service; package cn.com.glsx.dj.mindworkplate.service;
import cn.com.glsx.dj.mindworkplate.dto.*; import cn.com.glsx.dj.mindworkplate.dto.*;
import cn.com.glsx.dj.mindworkplate.model.warning.LearningEffectAnalysisRequest;
import cn.com.glsx.dj.mindworkplate.response.warning.WarningMsgStaffRes; import cn.com.glsx.dj.mindworkplate.response.warning.WarningMsgStaffRes;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -157,4 +158,42 @@ public class ConversationBatchServiceTest extends BaseServiceTest { ...@@ -157,4 +158,42 @@ public class ConversationBatchServiceTest extends BaseServiceTest {
System.out.println(s); System.out.println(s);
} }
@Test
public void getRecordPageListByCondition() {
RpcPagination req=new RpcPagination();
req.setPageNum(1);
req.setPageSize(20);
LearningEffectAnalysisRequest request = new LearningEffectAnalysisRequest();
request.setBusinessType(1);
/* request.setStartDate("2025-06-15");
request.setEndDate("2025-06-20");*/
request.setReceptionDate("2025-06-17");
request.setStaffName("员工");
/* request.setLearningEffectType(1);
request.setAnalysisPeriodDays(7);*/
request.setRecordIdList(Arrays.asList(125));
req.setCondition(request);
Page<ConversationBatchDTO> res = conversationBatchService
.getRecordPageListByCondition(req);
System.out.println(JSONObject.toJSONString( res));
}
@Test
public void getRecordStaticByCondition() {
LearningEffectAnalysisRequest request = new LearningEffectAnalysisRequest();
request.setBusinessType(1);
request.setStartDate("2025-12-01");
request.setEndDate("2025-12-30");
request.setLearningEffectType(2);
request.setAnalysisPeriodDays(2);
request.setStaffId("906d783c99a9416788f192ad36db9a03");
ConversationBatchDTO recordStaticByCondition = conversationBatchService.getRecordStaticByCondition(
request);
System.out.println(JSONObject.toJSONString( recordStaticByCondition));
}
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.service; 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; import cn.com.glsx.dj.mindworkplate.model.EarlyWarningThresholdConfig;
import cn.com.glsx.dj.mindworkplate.model.EmployeeWeeklyStatsDTO; 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.WarningNotification;
import cn.com.glsx.dj.mindworkplate.model.WeekRange; 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.request.warning.EmployeeDailyStatsReq;
import cn.com.glsx.dj.mindworkplate.service.monitoring.MonitoringService;
import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService; import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService;
import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO; import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO;
import cn.com.glsx.dj.smartcarlife.enums.ActionReportTypeEnum; import cn.com.glsx.dj.smartcarlife.enums.ActionReportTypeEnum;
...@@ -14,6 +22,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination; ...@@ -14,6 +22,7 @@ import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import java.text.ParseException; import java.text.ParseException;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
...@@ -35,6 +44,9 @@ public class EarlyWarningTest extends BaseServiceTest{ ...@@ -35,6 +44,9 @@ public class EarlyWarningTest extends BaseServiceTest{
@Autowired @Autowired
private WarningNotificationService warningNotificationService; private WarningNotificationService warningNotificationService;
@Autowired
private MonitoringService monitoringService;
@Test @Test
public void addPushRecordRemoteTest() throws Exception { public void addPushRecordRemoteTest() throws Exception {
RecordRequestDTO requestDTO = new RecordRequestDTO(); RecordRequestDTO requestDTO = new RecordRequestDTO();
...@@ -121,4 +133,51 @@ public class EarlyWarningTest extends BaseServiceTest{ ...@@ -121,4 +133,51 @@ public class EarlyWarningTest extends BaseServiceTest{
System.out.println("aa"+JSONObject.toJSONString(warningNotificationPage)); System.out.println("aa"+JSONObject.toJSONString(warningNotificationPage));
} }
@Test
public void findMonitorListPage() throws ParseException {
MonitorFilterRequest request=new MonitorFilterRequest();
request.setStartDate("2025-11-01");
request.setEndDate("2025-12-31");
request.setOnlineOperatorId("8f124a5e2b534760a2947a50c81cf377");
request.setRegionalOperatorId("8f124a5e2b534760a2947a50c81cf377");
request.setRegionId(430000);
request.setFirstbrandIds(Arrays.asList(2125));
request.setBusinessType(1);
List<StoreItemResponse> monitorListPage = monitoringService.findMonitorListPage(request);
System.out.println("aa"+JSONObject.toJSONString(monitorListPage));
}
@Test
public void findMonitorTypeDictList() throws ParseException {
List<MonitorTypeDict> monitorTypeDictList = monitoringService.findMonitorTypeDictList(1);
System.out.println("aa"+JSONObject.toJSONString(monitorTypeDictList));
}
@Test
public void findLearningEffectAnalysis() throws ParseException {
LearningEffectAnalysisRequest request=new LearningEffectAnalysisRequest();
request.setStartDate("2025-12-01");
request.setEndDate("2025-12-31");
request.setBusinessType(1);
request.setAnalysisPeriodDays(30);
request.setMerchantId(44210895);
request.setLearningEffectType(1);
request.setStaffId("7df92a5914ec4be5b5927832daf62126");
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.setBusinessType(1);
request.setPeriodType(2);
request.setFindNextTimeDataFlag( true);
List<MonitoringMsgDTO> monitorListByCondition = monitoringService.getMonitorListByCondition(
request);
System.out.println("aa"+JSONObject.toJSONString(monitorListByCondition));
}
} }
package cn.com.glsx.dj.mindworkplate.service.messagebox;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.NewPadMessageBoxDTO;
import cn.com.glsx.dj.mindworkplate.service.BaseServiceTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Title:
* @Description:
* @Author xiehx
* @Date 2026/1/24
**/
public class ModuleTypeDetailHandlerServiceTest extends BaseServiceTest {
@Autowired
private ModuleTypeDetailHandlerService moduleTypeDetailHandlerService;
@Test
public void testGetMessageBoxDetail() {
NewPadMessageBoxDTO dto = new NewPadMessageBoxDTO();
dto.setId(10579);
dto.setPhone("13603070903");
moduleTypeDetailHandlerService.getMessageBoxDetail(dto);
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.service.script; package cn.com.glsx.dj.mindworkplate.service.script;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.NewPadMessageBoxDTO;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
import cn.com.glsx.dj.mindworkplate.service.BaseServiceTest; import cn.com.glsx.dj.mindworkplate.service.BaseServiceTest;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.junit.Test; import org.junit.Test;
...@@ -91,7 +93,7 @@ public class PadMessageBoxServiceTest extends BaseServiceTest { ...@@ -91,7 +93,7 @@ public class PadMessageBoxServiceTest extends BaseServiceTest {
public void testListMessageSummary() { public void testListMessageSummary() {
ScriptSearchDTO requestDTO = new ScriptSearchDTO(); ScriptSearchDTO requestDTO = new ScriptSearchDTO();
//requestDTO.setStatus(1); //requestDTO.setStatus(1);
requestDTO.setPhone("15626599735"); requestDTO.setPhone("15626599797");
requestDTO.setBusinessType(0); requestDTO.setBusinessType(0);
requestDTO.setPageNum(1); requestDTO.setPageNum(1);
List<PadMessageSummaryDetail> padMessageSummaryDetails = padMessageBoxService.listMessageSummary(requestDTO); List<PadMessageSummaryDetail> padMessageSummaryDetails = padMessageBoxService.listMessageSummary(requestDTO);
...@@ -101,8 +103,8 @@ public class PadMessageBoxServiceTest extends BaseServiceTest { ...@@ -101,8 +103,8 @@ public class PadMessageBoxServiceTest extends BaseServiceTest {
@Test @Test
public void getStaffStudyBoxMessagePageTest(){ public void getStaffStudyBoxMessagePageTest(){
ScriptSearchDTO request = new ScriptSearchDTO(); ScriptSearchDTO request = new ScriptSearchDTO();
request.setPhone("18978849947"); request.setPhone("15626599797");
request.setModuleType(3); request.setModuleType(7);
Page<ScriptRecordPadPushDTO> page = padMessageBoxService.getStaffStudyBoxMessagePage(request); Page<ScriptRecordPadPushDTO> page = padMessageBoxService.getStaffStudyBoxMessagePage(request);
System.out.println(page); System.out.println(page);
System.out.println(JSON.toJSONString(page)); System.out.println(JSON.toJSONString(page));
...@@ -112,4 +114,16 @@ public class PadMessageBoxServiceTest extends BaseServiceTest { ...@@ -112,4 +114,16 @@ public class PadMessageBoxServiceTest extends BaseServiceTest {
System.out.println(JSON.toJSONString(page2)); System.out.println(JSON.toJSONString(page2));
} }
@Test
public void testPagePadMessageBox() {
RpcPagination<NewPadMessageBoxDTO> pagination = new RpcPagination<>();
NewPadMessageBoxDTO condition = new NewPadMessageBoxDTO();
condition.setStatus(0);
condition.setPhone("13714966184");
// condition.setCreatedTimeSortType(1);
pagination.setCondition(condition);
Page<NewPadMessageBoxDTO> newPadMessageBoxDTOS = padMessageBoxService.pagePadMessageBox(pagination);
System.out.println(JSON.toJSONString(newPadMessageBoxDTOS));
}
} }
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</javaClientGenerator> </javaClientGenerator>
<!-- 可配置多个 --> <!-- 可配置多个 -->
<table tableName="recording_tag_config" domainObjectName="Recording_tag_config" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false"> <table tableName="monitor_type_dict" domainObjectName="MonitorTypeDict" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">
<generatedKey column="id" sqlStatement="MySql" identity="true"/> <generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table> </table>
<!-- <table tableName="sop_task_detail_info" domainObjectName="SopTaskDetailInfo" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">--> <!-- <table tableName="sop_task_detail_info" domainObjectName="SopTaskDetailInfo" enableSelectByExample="false" enableCountByExample="false" enableDeleteByExample="false" enableUpdateByExample="false">-->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!