|
@@ -9,6 +9,7 @@ import com.xhkjedu.utils.N_Utils;
|
9
|
9
|
import org.springframework.beans.factory.annotation.Autowired;
|
10
|
10
|
import org.springframework.stereotype.Service;
|
11
|
11
|
|
|
12
|
+import java.util.ArrayList;
|
12
|
13
|
import java.util.List;
|
13
|
14
|
import java.util.Map;
|
14
|
15
|
|
|
@@ -28,48 +29,64 @@ public class ResearchUserService {
|
28
|
29
|
private MessageSender messageSender;
|
29
|
30
|
|
30
|
31
|
/**
|
31
|
|
- *功能描述 参与评论集合
|
|
32
|
+ * 功能描述 参与评论集合
|
|
33
|
+ *
|
|
34
|
+ * @param * @param researchid
|
|
35
|
+ * @return java.util.List<com.xhkjedu.model.research.TResearchUser>
|
32
|
36
|
* @author WN
|
33
|
37
|
* @date 2020/6/11
|
34
|
|
- * @param * @param researchid
|
35
|
|
- * @return java.util.List<com.xhkjedu.model.research.TResearchUser>
|
36
|
38
|
*/
|
37
|
|
- public List<Map> listRusersByReaearchid(Integer researchid,Integer schoolid){
|
38
|
|
- return researchUserMapper.listRusersByReaearchid(researchid,schoolid);
|
|
39
|
+ public List<Map> listRusersByReaearchid(Integer researchid, Integer schoolid) {
|
|
40
|
+ return researchUserMapper.listRusersByReaearchid(researchid, schoolid);
|
39
|
41
|
}
|
40
|
42
|
|
41
|
43
|
/**
|
42
|
|
- *功能描述 教师--参与教研集合
|
43
|
|
- * @author WN
|
44
|
|
- * @date 2020/6/12
|
45
|
|
- * @param * @param userid
|
|
44
|
+ * 功能描述 教师--参与教研集合
|
|
45
|
+ *
|
|
46
|
+ * @param * @param userid
|
46
|
47
|
* @param rorder
|
47
|
48
|
* @return java.util.List<com.xhkjedu.vo.research.ResearchVo>
|
|
49
|
+ * @author WN
|
|
50
|
+ * @date 2020/6/12
|
48
|
51
|
*/
|
49
|
|
- public List<Map> listUserResearchs(Integer userid, String rorder, Integer rustate){
|
50
|
|
- return researchUserMapper.listUserResearchs(userid,rorder,rustate,N_Utils.getSecondTimestamp());
|
|
52
|
+ public List<Map> listUserResearchs(Integer userid, String rorder, Integer rustate) {
|
|
53
|
+ return researchUserMapper.listUserResearchs(userid, rorder, rustate, N_Utils.getSecondTimestamp());
|
51
|
54
|
}
|
52
|
55
|
|
53
|
56
|
/**
|
54
|
|
- *功能描述 教师--获取教研详情
|
|
57
|
+ * 功能描述 教师--获取教研详情
|
|
58
|
+ *
|
|
59
|
+ * @param * @param researchid
|
|
60
|
+ * @return com.xhkjedu.model.research.TResearch
|
55
|
61
|
* @author WN
|
56
|
62
|
* @date 2020/6/12
|
57
|
|
- * @param * @param researchid
|
58
|
|
- * @return com.xhkjedu.model.research.TResearch
|
59
|
63
|
*/
|
60
|
|
- public ResearchUserVo getResearchUserDetail(Integer researchid,Integer userid){
|
61
|
|
- ResearchUserVo researchUserVo = researchUserMapper.getResearchUserDetail(researchid,userid);
|
62
|
|
- //更改阅读次数
|
|
64
|
+ public ResearchUserVo getResearchUserDetail(Integer researchid, Integer userid) {
|
|
65
|
+ ResearchUserVo researchUserVo = researchUserMapper.getResearchUserDetail(researchid, userid);
|
|
66
|
+ // 更改阅读次数
|
63
|
67
|
researchMapper.updateReadnum(researchid);
|
64
|
68
|
|
65
|
|
- //视频转换mq
|
|
69
|
+ // 视频转换mq
|
66
|
70
|
if (!researchUserVo.getMp4code().equals("h264")) {
|
67
|
71
|
messageSender.convertVideo(researchUserVo.getResearchid(), researchUserVo.getResearchpath());
|
68
|
72
|
}
|
69
|
73
|
|
70
|
|
- //如果教研是公开的,则获取所有已提交教研
|
71
|
|
- if(researchUserVo.getPubliced() == 0){
|
72
|
|
- List<Map> schools = researchUserMapper.listReaearchSchools(researchid,researchUserVo.getSchoolid());
|
|
74
|
+ // 如果教研是公开的,则获取所有已提交教研
|
|
75
|
+ if (researchUserVo.getPubliced() == 0) {
|
|
76
|
+ List<Map> schools = researchUserMapper.listReaearchSchools(researchid, researchUserVo.getSchoolid());
|
|
77
|
+ // 去除学校中未参与评价教师
|
|
78
|
+ for (int i = 0; i < schools.size(); i++) {
|
|
79
|
+ List<Map> commitRusers = new ArrayList<>();
|
|
80
|
+ List<Map> rusers = (List<Map>) schools.get(i).get("rusers");
|
|
81
|
+ for (int j = 0; j < rusers.size(); j++) {
|
|
82
|
+ Map map = rusers.get(j);
|
|
83
|
+ Integer rustate = Integer.parseInt(map.get("rustate").toString());
|
|
84
|
+ if(rustate!=null && rustate == 1){
|
|
85
|
+ commitRusers.add(map);
|
|
86
|
+ }
|
|
87
|
+ }
|
|
88
|
+ schools.get(i).put("rusers",commitRusers);
|
|
89
|
+ }
|
73
|
90
|
researchUserVo.setSchools(schools);
|
74
|
91
|
}
|
75
|
92
|
|
|
@@ -77,24 +94,26 @@ public class ResearchUserService {
|
77
|
94
|
}
|
78
|
95
|
|
79
|
96
|
/**
|
80
|
|
- *功能描述 教师--保存教研评价
|
|
97
|
+ * 功能描述 教师--保存教研评价
|
|
98
|
+ *
|
|
99
|
+ * @param * @param ru
|
|
100
|
+ * @return java.lang.Integer
|
81
|
101
|
* @author WN
|
82
|
102
|
* @date 2020/6/12
|
83
|
|
- * @param * @param ru
|
84
|
|
- * @return java.lang.Integer
|
85
|
103
|
*/
|
86
|
|
- public Integer updateUserResearch(TResearchUser ru){
|
87
|
|
- ru.setRustate(1);//状态0未评1已评
|
|
104
|
+ public Integer updateUserResearch(TResearchUser ru) {
|
|
105
|
+ ru.setRustate(1);// 状态0未评1已评
|
88
|
106
|
ru.setReviewtime(N_Utils.getSecondTimestamp());
|
89
|
107
|
return researchUserMapper.updateUserResearch(ru);
|
90
|
108
|
}
|
91
|
109
|
|
92
|
110
|
/**
|
93
|
111
|
* 其他教研活动列表
|
|
112
|
+ *
|
|
113
|
+ * @return java.util.List<com.xhkjedu.vo.research.ResearchVo>
|
94
|
114
|
* @Param [research]
|
95
|
115
|
* @Author ywx
|
96
|
116
|
* @Date 2020/6/23 14:24
|
97
|
|
- * @return java.util.List<com.xhkjedu.vo.research.ResearchVo>
|
98
|
117
|
**/
|
99
|
118
|
public List<Map> otherList(TResearchUser research) {
|
100
|
119
|
research.setCreatetime(N_Utils.getSecondTimestamp());
|
|
@@ -103,10 +122,11 @@ public class ResearchUserService {
|
103
|
122
|
|
104
|
123
|
/**
|
105
|
124
|
* 教师未评价教研数量
|
|
125
|
+ *
|
|
126
|
+ * @return java.lang.Integer
|
106
|
127
|
* @Param [userid]
|
107
|
128
|
* @Author ywx
|
108
|
129
|
* @Date 2020/7/24 10:45
|
109
|
|
- * @return java.lang.Integer
|
110
|
130
|
**/
|
111
|
131
|
public Integer noEvaluatedNum(Integer userid) {
|
112
|
132
|
return researchUserMapper.noEvaluatedNum(userid, N_Utils.getSecondTimestamp());
|