Commit 5daea1c3 by 春觉晓

添加查询预警信息接口

1 parent 3ae76ac4
...@@ -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 = "创建日期")
......
...@@ -32,6 +32,8 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> { ...@@ -32,6 +32,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);
/** /**
......
...@@ -423,6 +423,11 @@ public class PadMessageBoxService { ...@@ -423,6 +423,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 {
...@@ -563,7 +568,11 @@ public class PadMessageBoxService { ...@@ -563,7 +568,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("消息类型错误");
} }
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,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 +238,19 @@ ...@@ -238,7 +238,19 @@
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, null 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.start_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>
order by status asc, created_time desc
</select> </select>
<update id="markDeadline"> <update id="markDeadline">
...@@ -254,7 +266,7 @@ ...@@ -254,7 +266,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,6,7,8) 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>
...@@ -328,4 +340,22 @@ ...@@ -328,4 +340,22 @@
group by module_type group by module_type
</where> </where>
</select> </select>
<select id="listExcellentCaseBoxMessage" resultMap="ScriptRecordPadPushDTOMap">
select
pmb.id,
pmb.msg_title as title,
pmb.created_time as createTime,
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>
</where>
order by pmb.status asc, pmb.created_time desc
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!