Przeglądaj źródła

作业定时任务UNIX_TIMESTAMP改为调用工具类获取参数

tags/正式版本
雍文秀 2 lat temu
rodzic
commit
531ec7e8af

+ 2
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperstudent/PaperStudentMapper.java Wyświetl plik

@@ -143,9 +143,10 @@ public interface PaperStudentMapper extends TkMapper<TPaperStudent> {
143 143
      * @author WN
144 144
      * @date 2020/10/13
145 145
      * @param  * @param
146
+     * @param stoptime
146 147
      * @return void
147 148
      */
148
-    void updateShowanswer();
149
+    void updateShowanswer(@Param("stoptime") int stoptime);
149 150
 
150 151
 
151 152
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////

+ 2
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java Wyświetl plik

@@ -788,7 +788,8 @@ public class PaperStudentService {
788 788
      * @return void
789 789
      */
790 790
     public void updateShowanswer(){
791
-        paperStudentMapper.updateShowanswer();
791
+        int timestamp = N_Utils.getSecondTimestamp();
792
+        paperStudentMapper.updateShowanswer(timestamp);
792 793
     }
793 794
 
794 795
 

+ 1
- 1
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml Wyświetl plik

@@ -179,7 +179,7 @@
179 179
 
180 180
     <update id="updateShowanswer">
181 181
         update t_paper_student ps left join t_paper_group pg on ps.paperid=pg.paperid
182
-        set ps.showanswer=1 where pg.pgstate=22 AND pg.showtype=1 and ps.showanswer=0 and pg.stoptime <![CDATA[ <= ]]> UNIX_TIMESTAMP(NOW())
182
+        set ps.showanswer=1 where pg.pgstate=22 AND pg.showtype=1 and ps.showanswer=0 and pg.stoptime <![CDATA[ <= ]]> #{stoptime}
183 183
     </update>
184 184
 
185 185
 

Ładowanie…
Anuluj
Zapisz