Browse Source

Merge remote-tracking branch 'origin/master' into ywx

tags/正式3.3.0
雍文秀 2 years ago
parent
commit
7e5b1e30b4

+ 19
- 2
sapi/src/main/java/com/xhkjedu/sapi/controller/system/ModuleController.java View File

37
     @PostMapping("/list")
37
     @PostMapping("/list")
38
     public ResultVo listModules(@RequestBody TModule module){
38
     public ResultVo listModules(@RequestBody TModule module){
39
         N_Utils.validation(new Object[]{module.getSchoolid(),"学校id",1,module.getModuletype(),"模块归属",1});
39
         N_Utils.validation(new Object[]{module.getSchoolid(),"学校id",1,module.getModuletype(),"模块归属",1});
40
-        List<TModule> lst = moduleService.listModules(module.getSchoolid(), module.getModuletype(), 1);
40
+        List<TModule> lst = moduleService.listModules(module.getSchoolid(), module.getModuletype(), module.getDisplay());
41
         return new ResultVo(0,"获取应用集合成功",lst);
41
         return new ResultVo(0,"获取应用集合成功",lst);
42
     }
42
     }
43
 
43
 
44
     @PostMapping("/list2")
44
     @PostMapping("/list2")
45
     public ResultVo listModules2(@RequestBody TModule module){
45
     public ResultVo listModules2(@RequestBody TModule module){
46
         N_Utils.validation(new Object[]{module.getSchoolid(),"学校id",1,module.getModuletype(),"模块归属",1});
46
         N_Utils.validation(new Object[]{module.getSchoolid(),"学校id",1,module.getModuletype(),"模块归属",1});
47
-        List<TModule> lst = moduleService.listModules(module.getSchoolid(), module.getModuletype(), 1);
47
+        List<TModule> lst = moduleService.listModules(module.getSchoolid(), module.getModuletype(), module.getDisplay());
48
         return new ResultVo(0,"获取应用集合成功",lst);
48
         return new ResultVo(0,"获取应用集合成功",lst);
49
     }
49
     }
50
 
50
 
51
+    //学生网页端模块获取
51
     @PostMapping("/list_stu")
52
     @PostMapping("/list_stu")
52
     public ResultVo listStuModules(@RequestBody TModule module){
53
     public ResultVo listStuModules(@RequestBody TModule module){
53
         N_Utils.validation(new Object[]{module.getSchoolid(),"学校id",1,module.getModuletype(),"模块归属",1});
54
         N_Utils.validation(new Object[]{module.getSchoolid(),"学校id",1,module.getModuletype(),"模块归属",1});
160
         List<Map> list = moduleService.listForSel2(schoolid, moduletype);
161
         List<Map> list = moduleService.listForSel2(schoolid, moduletype);
161
         return new ResultVo(0,"获取模块选择列表成功", list);
162
         return new ResultVo(0,"获取模块选择列表成功", list);
162
     }
163
     }
164
+
165
+    //设置显示
166
+    @PostMapping("/dis")
167
+    public ResultVo updateModuleDisplay(@RequestBody TModule module){
168
+        N_Utils.validation(new Object[]{module.getModuleid(),"模块id",2});
169
+        moduleService.updateModuleDisplay(module.getModuleid(),1);
170
+        return new ResultVo(0,"设置模块显示成功");
171
+    }
172
+
173
+    //设置模块不显示
174
+    @PostMapping("/nodis")
175
+    public ResultVo updateModuleNoDisplay(@RequestBody TModule module){
176
+        N_Utils.validation(new Object[]{module.getModuleid(),"模块id",2});
177
+        moduleService.updateModuleDisplay(module.getModuleid(),10);
178
+        return new ResultVo(0,"设置模块不显示成功");
179
+    }
163
 }
180
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/ModuleMapper.java View File

58
 
58
 
59
     //批量保存
59
     //批量保存
60
     void batchSave(@Param("modules") List<TModule> modules);
60
     void batchSave(@Param("modules") List<TModule> modules);
61
+
62
+    //修改模块状态
63
+    void updateModuleDisplay(@Param("moduleid") String moduleid, @Param("display") Integer display);
61
 }
64
 }

+ 5
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/system/ModuleService.java View File

194
     public void batchSave(List<TModule> modules) {
194
     public void batchSave(List<TModule> modules) {
195
         moduleMapper.batchSave(modules);
195
         moduleMapper.batchSave(modules);
196
     }
196
     }
197
+
198
+    //修改模块状态
199
+    public void updateModuleDisplay(String moduleid,Integer dispaly){
200
+        moduleMapper.updateModuleDisplay(moduleid,dispaly);
201
+    }
197
 }
202
 }

+ 3
- 1
sapi/src/main/resources/application.properties View File

2
 spring.application.name=sapi
2
 spring.application.name=sapi
3
 #注册到我们本地的eureka注册中心,端口8081
3
 #注册到我们本地的eureka注册中心,端口8081
4
 eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
4
 eureka.client.service-url.defaultZone=http://127.0.0.1:8081/eureka/
5
+#eureka.client.register-with-eureka=false
6
+#eureka.client.fetch-registry=false
5
 #设置eureka输出日志级别
7
 #设置eureka输出日志级别
6
 logging.level.com.netflix=error
8
 logging.level.com.netflix=error
7
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:3306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
9
 spring.datasource.url=jdbc:mysql://dbtest.xhkjedu.com:3306/xhkjedu_school_test?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true&allowMultiQueries=true
98
 #每隔3s清除一下请求地址map
100
 #每隔3s清除一下请求地址map
99
 cron.deleteUriMap=0/3 * * * * ?
101
 cron.deleteUriMap=0/3 * * * * ?
100
 #版本号
102
 #版本号
101
-versionname=Test_v3.2.6
103
+versionname=Test_v3.2.7

+ 5
- 0
sapi/src/main/resources/mapper/system/ModuleMapper.xml View File

73
             ,#{m.minout},#{m.mclass},#{m.level},#{m.mdefault},#{m.display},#{m.defaultid},#{m.createid},#{m.createtime},#{m.schoolid})
73
             ,#{m.minout},#{m.mclass},#{m.level},#{m.mdefault},#{m.display},#{m.defaultid},#{m.createid},#{m.createtime},#{m.schoolid})
74
         </foreach>
74
         </foreach>
75
     </insert>
75
     </insert>
76
+
77
+    <!--修改模块状态-->
78
+    <update id="updateModuleDisplay">
79
+        update t_module set display=#{display} where moduleid=#{moduleid}
80
+    </update>
76
 </mapper>
81
 </mapper>

+ 4
- 4
sstudy/src/main/java/com/xhkjedu/sstudy/controller/resource/GuideController.java View File

11
 import com.xhkjedu.sstudy.vo.paper.AnalyzeSearchVo;
11
 import com.xhkjedu.sstudy.vo.paper.AnalyzeSearchVo;
12
 import com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo;
12
 import com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo;
13
 import com.xhkjedu.sstudy.vo.resource.GuideVo;
13
 import com.xhkjedu.sstudy.vo.resource.GuideVo;
14
+import lombok.extern.slf4j.Slf4j;
14
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.util.CollectionUtils;
16
 import org.springframework.util.CollectionUtils;
16
 import org.springframework.web.bind.annotation.PostMapping;
17
 import org.springframework.web.bind.annotation.PostMapping;
29
  **/
30
  **/
30
 @RequestMapping("/guide")
31
 @RequestMapping("/guide")
31
 @RestController
32
 @RestController
33
+@Slf4j
32
 public class GuideController {
34
 public class GuideController {
33
     @Autowired
35
     @Autowired
34
     private GuideService guideService;
36
     private GuideService guideService;
106
         String lsbid = guide.getLsbid();
108
         String lsbid = guide.getLsbid();
107
         N_Utils.validation(new Object[]{createid,"教师id",1,subjectid,"科目",2,lsbid,"教材",2});
109
         N_Utils.validation(new Object[]{createid,"教师id",1,subjectid,"科目",2,lsbid,"教材",2});
108
 
110
 
109
-        guideService.save(guide);
110
-        return new ResultVo(0, "保存成功");
111
+        return guideService.save(guide);
111
     }
112
     }
112
 
113
 
113
     //分享预习
114
     //分享预习
122
         String lsbid = guide.getLsbid();
123
         String lsbid = guide.getLsbid();
123
         N_Utils.validation(new Object[]{resourceid,"资源",2,createid,"教师id",1,subjectid,"科目",2,lsbid,"教材",2});
124
         N_Utils.validation(new Object[]{resourceid,"资源",2,createid,"教师id",1,subjectid,"科目",2,lsbid,"教材",2});
124
 
125
 
125
-        guideService.shareGuide(guide);
126
-        return new ResultVo(0, "分享成功");
126
+        return guideService.shareGuide(guide);
127
     }
127
     }
128
 
128
 
129
     //删除预习
129
     //删除预习

+ 101
- 74
sstudy/src/main/java/com/xhkjedu/sstudy/service/resource/GuideService.java View File

14
 import com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo;
14
 import com.xhkjedu.sstudy.vo.resource.GuideAnalyzeVo;
15
 import com.xhkjedu.sstudy.vo.resource.GuideVo;
15
 import com.xhkjedu.sstudy.vo.resource.GuideVo;
16
 import com.xhkjedu.utils.N_Utils;
16
 import com.xhkjedu.utils.N_Utils;
17
+import com.xhkjedu.vo.ResultVo;
18
+import lombok.extern.slf4j.Slf4j;
17
 import org.apache.commons.lang3.StringUtils;
19
 import org.apache.commons.lang3.StringUtils;
18
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.stereotype.Service;
21
 import org.springframework.stereotype.Service;
20
 import org.springframework.transaction.annotation.Transactional;
22
 import org.springframework.transaction.annotation.Transactional;
23
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
21
 
24
 
22
 import javax.annotation.Resource;
25
 import javax.annotation.Resource;
23
 import java.util.*;
26
 import java.util.*;
30
  * Date 2021/10/20 10:37
33
  * Date 2021/10/20 10:37
31
  **/
34
  **/
32
 @Service
35
 @Service
36
+@Slf4j
33
 public class GuideService {
37
 public class GuideService {
34
     @Resource
38
     @Resource
35
     private GuideMapper guideMapper;
39
     private GuideMapper guideMapper;
90
     }
94
     }
91
 
95
 
92
     //保存学生预习
96
     //保存学生预习
93
-    @Transactional
94
-    public Integer save(TGuide guide){
95
-        Integer timestamp = N_Utils.getSecondTimestamp();
96
-        guide.setCreatetime(timestamp);
97
-        guideMapper.insertUseGeneratedKeys(guide);
98
-        Integer guideid = guide.getId();//预习id
99
-        guide.setGuideid(guideid);
100
-
101
-        //保存资源
102
-        List<TResource> resources = guide.getResources();
103
-        for(TResource r : resources) {
104
-            r.setCreateid(guide.getCreateid());
105
-            r.setCreatetime(guide.getCreatetime());
106
-            r.setLevel(3);
107
-            r.setResourcestate(1);
108
-            r.setResourcetype(10);
109
-            r.setBelong(4);
110
-            r.setSchoolid(guide.getSchoolid());
111
-            r.setSubjectid(guide.getSubjectid());
112
-
113
-            String resourceid = StudyUtil.getId();//资源id
114
-            r.setResourceid(resourceid);
115
-            Integer resourceclass = r.getResourceclass();
116
-            if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
117
-                r.setConverted(1);
118
-            } else if (resourceclass == 5 && (r.getSuffix().equals("flv") || r.getMp4code().equals("h264"))) {
119
-                r.setConverted(1);
97
+    @Transactional(rollbackFor = Exception.class)
98
+    public ResultVo save(TGuide guide){
99
+
100
+        try {
101
+            Integer timestamp = N_Utils.getSecondTimestamp();
102
+            guide.setCreatetime(timestamp);
103
+            guideMapper.insertUseGeneratedKeys(guide);
104
+            Integer guideid = guide.getId();//预习id
105
+            guide.setGuideid(guideid);
106
+
107
+            //保存资源
108
+            List<TResource> resources = guide.getResources();
109
+            for(TResource r : resources) {
110
+                r.setCreateid(guide.getCreateid());
111
+                r.setCreatetime(guide.getCreatetime());
112
+                r.setLevel(3);
113
+                r.setResourcestate(1);
114
+                r.setResourcetype(10);
115
+                r.setBelong(4);
116
+                r.setSchoolid(guide.getSchoolid());
117
+                r.setSubjectid(guide.getSubjectid());
118
+
119
+                String resourceid = StudyUtil.getId();//资源id
120
+                r.setResourceid(resourceid);
121
+                Integer resourceclass = r.getResourceclass();
122
+                if (resourceclass == 3 || resourceclass == 4 || resourceclass == 6) {
123
+                    r.setConverted(1);
124
+                } else if (resourceclass == 5 && (r.getSuffix().equals("flv") || r.getMp4code().equals("h264"))) {
125
+                    r.setConverted(1);
126
+                }
127
+                //保存资源信息
128
+                resourceMapper.insertSelective(r);
129
+                //保存预习资源关联关系
130
+                TGuideResource gr = new TGuideResource();
131
+                gr.setGuideid(guideid);
132
+                gr.setResourceid(resourceid);
133
+                gr.setCreateid(guide.getCreateid());
134
+                gr.setCreatetime(guide.getCreatetime());
135
+                guideResourceMapper.insertUseGeneratedKeys(gr);
136
+
137
+                convertUtil.convertResource(r);//资源转换(word或ppt转为pdf,视频非h264编码转码,压缩包解压)
120
             }
138
             }
121
-            //保存资源信息
122
-            resourceMapper.insertSelective(r);
123
-            //保存预习资源关联关系
124
-            TGuideResource gr = new TGuideResource();
125
-            gr.setGuideid(guideid);
126
-            gr.setResourceid(resourceid);
127
-            gr.setCreateid(guide.getCreateid());
128
-            gr.setCreatetime(guide.getCreatetime());
129
-            guideResourceMapper.insertUseGeneratedKeys(gr);
130
-
131
-            convertUtil.convertResource(r);//资源转换(word或ppt转为pdf,视频非h264编码转码,压缩包解压)
139
+
140
+            //保存预习学生关联信息
141
+            batchSaveGuideStudent(guide);
142
+            return new ResultVo(0,"保存成功");
143
+        }catch (Exception e){
144
+            log.error("保存预习失败:" + e.getMessage());
145
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
146
+            return new ResultVo(1,"保存失败");
132
         }
147
         }
133
 
148
 
134
-        //保存预习学生关联信息
135
-        batchSaveGuideStudent(guide);
136
-        return guideid;
137
     }
149
     }
138
 
150
 
139
     //个人空间分享到学生预习
151
     //个人空间分享到学生预习
140
-    @Transactional
141
-    public void shareGuide(TGuide guide) {
142
-        String resourceid = guide.getResourceid();
143
-        Integer timestamp = N_Utils.getSecondTimestamp();
144
-        guide.setCreatetime(timestamp);
145
-        guideMapper.insertUseGeneratedKeys(guide);
146
-        Integer guideid = guide.getId();//预习id
147
-
148
-        //保存预习资源
149
-        TGuideResource guideResource = new TGuideResource();
150
-        guideResource.setGuideid(guideid);
151
-        guideResource.setResourceid(resourceid);
152
-        guideResource.setCreateid(guide.getCreateid());
153
-        guideResource.setCreatetime(timestamp);
154
-        guideResourceMapper.insert(guideResource);
155
-        guide.setGuideid(guideid);
156
-
157
-        //保存预习学生关联信息
158
-        batchSaveGuideStudent(guide);
152
+    @Transactional(rollbackFor = Exception.class)
153
+    public ResultVo shareGuide(TGuide guide){
154
+
155
+        try {
156
+            String resourceid = guide.getResourceid();
157
+            Integer timestamp = N_Utils.getSecondTimestamp();
158
+            guide.setCreatetime(timestamp);
159
+            guideMapper.insertUseGeneratedKeys(guide);
160
+            Integer guideid = guide.getId();//预习id
161
+
162
+            //保存预习资源
163
+            TGuideResource guideResource = new TGuideResource();
164
+            guideResource.setGuideid(guideid);
165
+            guideResource.setResourceid(resourceid);
166
+            guideResource.setCreateid(guide.getCreateid());
167
+            guideResource.setCreatetime(timestamp);
168
+            guideResourceMapper.insert(guideResource);
169
+            guide.setGuideid(guideid);
170
+
171
+            //保存预习学生关联信息
172
+            batchSaveGuideStudent(guide);
173
+            return new ResultVo(0,"分享成功");
174
+        }catch (Exception e){
175
+            log.error("分享预习失败:" + e.getMessage());
176
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
177
+            return new ResultVo(1,"分享失败");
178
+        }
179
+
159
     }
180
     }
160
 
181
 
161
     //批量维护预习班级和学生信息
182
     //批量维护预习班级和学生信息
162
-    private void batchSaveGuideStudent(TGuide guide) {
183
+    private void batchSaveGuideStudent(TGuide guide) throws Exception {
163
         List<TGuideGroup> guideGroups = guide.getGuideGroups().stream().distinct().collect(Collectors.toList());
184
         List<TGuideGroup> guideGroups = guide.getGuideGroups().stream().distinct().collect(Collectors.toList());
164
         List<TGuideGroup> savegroup = new ArrayList<>();
185
         List<TGuideGroup> savegroup = new ArrayList<>();
165
         List<TGuideGroupStudent> savestus = new ArrayList<>();
186
         List<TGuideGroupStudent> savestus = new ArrayList<>();
172
             g.setCreatetime(guide.getCreatetime());
193
             g.setCreatetime(guide.getCreatetime());
173
             savegroup.add(g);
194
             savegroup.add(g);
174
 
195
 
175
-            //页面选择的学生预习学生集合
176
-            String groupids = StringUtils.join(gg.getGroups(),",");
177
-
178
-            //获取选中班级分组下所有学生
179
-            List<Integer> stus = classMapper.listStudentidsByGroupids(groupids);
180
-            for (Integer studentid : stus) {
181
-                TGuideGroupStudent ggs = new TGuideGroupStudent();
182
-                ggs.setGuideid(guide.getGuideid());
183
-                ggs.setClassid(classid);
184
-                ggs.setStudentid(studentid);
185
-                ggs.setCosttime(0);
186
-                ggs.setCreatetime(N_Utils.getSecondTimestamp());
187
-                savestus.add(ggs);
196
+            if(gg.getGroups() != null && gg.getGroups().size() > 0){
197
+                //页面选择的学生预习学生集合
198
+                String groupids = StringUtils.join(gg.getGroups(),",");
199
+
200
+                //获取选中班级分组下所有学生
201
+                List<Integer> stus = classMapper.listStudentidsByGroupids(groupids);
202
+                for (Integer studentid : stus) {
203
+                    TGuideGroupStudent ggs = new TGuideGroupStudent();
204
+                    ggs.setGuideid(guide.getGuideid());
205
+                    ggs.setClassid(classid);
206
+                    ggs.setStudentid(studentid);
207
+                    ggs.setCosttime(0);
208
+                    ggs.setCreatetime(N_Utils.getSecondTimestamp());
209
+                    savestus.add(ggs);
188
 
210
 
211
+                }
189
             }
212
             }
190
         }
213
         }
191
 
214
 
215
+        if(savestus == null || savestus.size() == 0){
216
+            throw new Exception("未选择学生");
217
+        }
218
+
192
         //保存预习班级、预习学生信息
219
         //保存预习班级、预习学生信息
193
         guideGroupMapper.insertList(savegroup);
220
         guideGroupMapper.insertList(savegroup);
194
         guideGroupStudentMapper.insertList(savestus);
221
         guideGroupStudentMapper.insertList(savestus);

+ 1
- 1
sstudy/src/main/resources/application.properties View File

107
 dbname=xhkjedu_school_test
107
 dbname=xhkjedu_school_test
108
 
108
 
109
 #版本号
109
 #版本号
110
-versionname=Test_v3.2.6
110
+versionname=Test_v3.2.7

+ 43
- 8
suser/src/main/java/com/xhkjedu/suser/service/system/UserService.java View File

115
                 }
115
                 }
116
             }
116
             }
117
 
117
 
118
+            //判断用户状态
118
             if(userVo.getUserlock() == 1){
119
             if(userVo.getUserlock() == 1){
119
                 return new ResultVo(1, "此账号已锁定,禁止登录");
120
                 return new ResultVo(1, "此账号已锁定,禁止登录");
120
             }
121
             }
121
 
122
 
123
+            //判断用户有效期
124
+            String usertime = userVo.getUsertime();
125
+            if (N_Utils.isNotEmpty(usertime)) {
126
+                String dayBegin = DatesUtil.getDayBegin();
127
+                if (usertime.compareTo(dayBegin) < 0) {
128
+                    if (usertype == 2) {//学生
129
+                        return new ResultVo(1, "账号已过有效期,请联系老师");
130
+                    } else {
131
+                        return new ResultVo(1, "账号已过有效期,请联系管理员");
132
+                    }
133
+                }
134
+            }
135
+
122
             //进行角色判断
136
             //进行角色判断
123
             if (usertype == 2) {
137
             if (usertype == 2) {
124
                 Integer stuweb = userVo.getStuweb();
138
                 Integer stuweb = userVo.getStuweb();
146
                     return new ResultVo(1, "此账号未分配班级");
160
                     return new ResultVo(1, "此账号未分配班级");
147
                 }
161
                 }
148
 
162
 
149
-                //更新学生硬件绑定信息
150
-                userVo.setMac(mac);
151
-                userVo.setBindmac(sbindmac);
152
-                userMapper.updateBindMac(userVo);
163
+                String device = user.getDevice();//只有学生
164
+                if (device != null && "pad".equals(device)) {
165
+                    //更新学生硬件绑定信息
166
+                    userVo.setMac(mac);
167
+                    userVo.setBindmac(sbindmac);
168
+                    userMapper.updateBindMac(userVo);
169
+                }
170
+
153
                 return new ResultVo(0, "登录成功", userVo);
171
                 return new ResultVo(0, "登录成功", userVo);
154
             } else{
172
             } else{
155
                 return new ResultVo(0, "登录成功", userVo);
173
                 return new ResultVo(0, "登录成功", userVo);
169
             user.setUserid(userVo.getUserid());
187
             user.setUserid(userVo.getUserid());
170
             user.setUsername(userVo.getUsername());
188
             user.setUsername(userVo.getUsername());
171
             user.setSchoolid(userVo.getSchoolid());
189
             user.setSchoolid(userVo.getSchoolid());
172
-            if (!userVo.getLoginpwd().equals(user.getLoginpwd())) {
190
+            user.setUsertype(userVo.getUsertype());
191
+
192
+            //验证用户信息
193
+            resultVo = this.checkLoginUser(user,userVo,1);
194
+
195
+            /*if (!userVo.getLoginpwd().equals(user.getLoginpwd())) {
173
                 resultVo = new ResultVo(1, "密码错误");
196
                 resultVo = new ResultVo(1, "密码错误");
174
             } else {
197
             } else {
175
                 if (userVo.getUsertype() != 1) {
198
                 if (userVo.getUsertype() != 1) {
183
                         resultVo = new ResultVo(0, "登录成功", userVo);
206
                         resultVo = new ResultVo(0, "登录成功", userVo);
184
                     }
207
                     }
185
                 }
208
                 }
186
-            }
209
+            }*/
187
         } else {
210
         } else {
188
             resultVo = new ResultVo(1, "此账号不存在");
211
             resultVo = new ResultVo(1, "此账号不存在");
189
         }
212
         }
210
             user.setUserid(userVo.getUserid());
233
             user.setUserid(userVo.getUserid());
211
             user.setUsername(userVo.getUsername());
234
             user.setUsername(userVo.getUsername());
212
             user.setSchoolid(userVo.getSchoolid());
235
             user.setSchoolid(userVo.getSchoolid());
236
+            user.setUsertype(userVo.getUsertype());
213
             //验证学生登录系列问题
237
             //验证学生登录系列问题
214
             resultVo = checkLoginStudent(user,userVo);
238
             resultVo = checkLoginStudent(user,userVo);
215
         } else {
239
         } else {
226
         } else {
250
         } else {
227
             Integer sbindmac = userVo.getSbindmac();//学校是否绑定设备0未绑定1绑定
251
             Integer sbindmac = userVo.getSbindmac();//学校是否绑定设备0未绑定1绑定
228
             String mac = user.getMac();
252
             String mac = user.getMac();
253
+            String usertime = userVo.getUsertime();
229
 
254
 
230
             if (userVo.getUsertype() != 2) {
255
             if (userVo.getUsertype() != 2) {
231
                 return new ResultVo(1, "登录失败,仅允许学生登录");
256
                 return new ResultVo(1, "登录失败,仅允许学生登录");
240
                         return new ResultVo(1, "登录失败,该设备已与其他账号关联");
265
                         return new ResultVo(1, "登录失败,该设备已与其他账号关联");
241
                     }
266
                     }
242
                 }
267
                 }
268
+            } else if (N_Utils.isNotEmpty(usertime)){
269
+                String dayBegin = DatesUtil.getDayBegin();
270
+                if (usertime.compareTo(dayBegin) < 0) {
271
+                    return new ResultVo(1, "账号已过有效期,请联系老师");
272
+                }
273
+            } else if (userVo.getUserlock() == 1) {
274
+                return new ResultVo(1, "此账号已锁定,禁止登录");
243
             }
275
             }
276
+
244
             //更新学生硬件绑定信息
277
             //更新学生硬件绑定信息
245
             userVo.setMac(mac);
278
             userVo.setMac(mac);
246
             userVo.setBindmac(sbindmac);
279
             userVo.setBindmac(sbindmac);
267
             user.setUsername(userVo.getUsername());
300
             user.setUsername(userVo.getUsername());
268
             user.setSchoolid(userVo.getSchoolid());
301
             user.setSchoolid(userVo.getSchoolid());
269
             user.setLoginname(userVo.getLoginname());
302
             user.setLoginname(userVo.getLoginname());
303
+            user.setUsertype(userVo.getUsertype());
270
 
304
 
271
             resultVo = checkLoginUser(user,userVo,2);
305
             resultVo = checkLoginUser(user,userVo,2);
272
         } else {
306
         } else {
291
         Integer usertype = user.getUsertype();
325
         Integer usertype = user.getUsertype();
292
         if (result.getCode() == 0) {
326
         if (result.getCode() == 0) {
293
             UserVo userVo = (UserVo) result.getObj();
327
             UserVo userVo = (UserVo) result.getObj();
294
-            if (userVo.getUserlock() == 1) {
328
+            //以下代码登录的时候进行判断
329
+            /*if (userVo.getUserlock() == 1) {
295
                 result.setCode(1);
330
                 result.setCode(1);
296
                 result.setMsg("此账号已锁定,禁止登录");
331
                 result.setMsg("此账号已锁定,禁止登录");
297
                 return result;
332
                 return result;
308
                     }
343
                     }
309
                     return result;
344
                     return result;
310
                 }
345
                 }
311
-            }
346
+            }*/
312
 
347
 
313
             //redis
348
             //redis
314
             String ticketKey = UUID.randomUUID().toString().replace("-", "");
349
             String ticketKey = UUID.randomUUID().toString().replace("-", "");

+ 1
- 1
suser/src/main/resources/application.properties View File

57
 #郑州管城大数据SSO认证鉴权接口
57
 #郑州管城大数据SSO认证鉴权接口
58
 ssourl=http://gcdsj.zzgcjy.cn/portal/sso/api/agent
58
 ssourl=http://gcdsj.zzgcjy.cn/portal/sso/api/agent
59
 #版本号
59
 #版本号
60
-versionname=Test_v3.2.10
60
+versionname=Test_v3.2.11

Loading…
Cancel
Save