Commit e2b724d5 by 庞善天

修改惩罚状态加上限制录单的条件

1 parent 1d11fcfa
...@@ -38,7 +38,7 @@ public interface SopShortCourseTaskMapper extends OreMapper<SopShortCourseTask> ...@@ -38,7 +38,7 @@ public interface SopShortCourseTaskMapper extends OreMapper<SopShortCourseTask>
String selectMerchantNameByMerchantId(@Param("merchantId") String merchantId); String selectMerchantNameByMerchantId(@Param("merchantId") String merchantId);
/** /**
* 将超时未完成任务置为已结束,并触发处罚状态 * 将超时未完成限制录单任务置为已结束,并触发处罚状态
* @return 影响行数 * @return 影响行数
*/ */
int updateOverdueTaskStatus(@Param("now") Date now, @Param("bussinessType") Integer bussinessType); int updateOverdueTaskStatus(@Param("now") Date now, @Param("bussinessType") Integer bussinessType);
...@@ -47,5 +47,11 @@ public interface SopShortCourseTaskMapper extends OreMapper<SopShortCourseTask> ...@@ -47,5 +47,11 @@ public interface SopShortCourseTaskMapper extends OreMapper<SopShortCourseTask>
* 根据消息盒子id查询短课程任务 * 根据消息盒子id查询短课程任务
*/ */
SopShortCourseTask getByMsgBosId(@Param("msgBosId") Integer msgBosId); SopShortCourseTask getByMsgBosId(@Param("msgBosId") Integer msgBosId);
/**
* 将超时未完成无惩罚任务置为已结束,不触发处罚状态
* @return 影响行数
*/
int updateNonePunishTaskStatus(@Param("now") Date now, @Param("bussinessType") Integer bussinessType);
} }
...@@ -85,9 +85,13 @@ public class SopShortCourseTaskService { ...@@ -85,9 +85,13 @@ public class SopShortCourseTaskService {
Integer bussinessType = SopBusinessTypeEnum.LIGHT_MODIFICATION.getValue(); Integer bussinessType = SopBusinessTypeEnum.LIGHT_MODIFICATION.getValue();
int affected = sopShortCourseTaskMapper.updateOverdueTaskStatus(now, bussinessType); int affected = sopShortCourseTaskMapper.updateOverdueTaskStatus(now, bussinessType);
if (affected > 0) { if (affected > 0) {
log.info("短课程任务状态检查:处理超时任务成功,affected: {}", affected); log.info("短课程限制录单任务状态检查:处理超时任务成功,affected: {}", affected);
} }
return affected; int nonePunishAffected = sopShortCourseTaskMapper.updateNonePunishTaskStatus(now, bussinessType);
if (nonePunishAffected > 0) {
log.info("短课程无惩罚任务状态检查:处理超时任务成功,nonePunishAffected: {}", nonePunishAffected);
}
return affected+nonePunishAffected;
} }
/** /**
......
...@@ -74,6 +74,20 @@ ...@@ -74,6 +74,20 @@
updated_date = #{now} updated_date = #{now}
where task_status = 0 where task_status = 0
and punish_status = 1 and punish_status = 1
and punish_type = 1
and bussiness_type = #{bussinessType}
and deleted_flag = 'N'
and deadline is not null
and deadline &lt;= #{now}
</update>
<update id="updateNonePunishTaskStatus">
update sop_short_course_task
set task_status = 1,
updated_date = #{now}
where task_status = 0
and punish_status = 1
and punish_type = 0
and bussiness_type = #{bussinessType} and bussiness_type = #{bussinessType}
and deleted_flag = 'N' and deleted_flag = 'N'
and deadline is not null and deadline is not null
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!