|
@@ -12,6 +12,7 @@ import com.xhkjedu.utils.N_Utils;
|
12
|
12
|
import com.xhkjedu.sapi.vo.notice.NoticeTeacherVo;
|
13
|
13
|
import lombok.extern.slf4j.Slf4j;
|
14
|
14
|
import org.springframework.stereotype.Service;
|
|
15
|
+import org.springframework.transaction.annotation.Transactional;
|
15
|
16
|
|
16
|
17
|
import javax.annotation.Resource;
|
17
|
18
|
import java.util.*;
|
|
@@ -56,8 +57,10 @@ public class ResearchService {
|
56
|
57
|
* @author WN
|
57
|
58
|
* @date 2020/6/11
|
58
|
59
|
*/
|
|
60
|
+ @Transactional(rollbackFor = Exception.class)
|
59
|
61
|
public Integer save(TResearch research) {
|
60
|
|
- research.setCreatetime(N_Utils.getSecondTimestamp());
|
|
62
|
+ int timestamp = N_Utils.getSecondTimestamp();
|
|
63
|
+ research.setCreatetime(timestamp);
|
61
|
64
|
research.setReadnum(0);
|
62
|
65
|
|
63
|
66
|
List<TResearchUser> rslist = new ArrayList<>();
|
|
@@ -73,7 +76,7 @@ public class ResearchService {
|
73
|
76
|
ru.setUserid(teacherid);
|
74
|
77
|
ru.setRustate(0);
|
75
|
78
|
ru.setSchoolid(u.get("schoolid"));
|
76
|
|
- ru.setCreatetime(N_Utils.getSecondTimestamp());
|
|
79
|
+ ru.setCreatetime(timestamp);
|
77
|
80
|
|
78
|
81
|
rslist.add(ru);
|
79
|
82
|
}
|
|
@@ -103,7 +106,7 @@ public class ResearchService {
|
103
|
106
|
}
|
104
|
107
|
|
105
|
108
|
//批量保存教研老师关联信息
|
106
|
|
- researchUserMapper.saveBatchResearchUser(rslist, N_Utils.getSecondTimestamp());
|
|
109
|
+ researchUserMapper.saveBatchResearchUser(rslist, research.getId());
|
107
|
110
|
research.setResearchid(research.getId());
|
108
|
111
|
convertVideo(research);//视频转换mq
|
109
|
112
|
return research.getId();
|