Sfoglia il codice sorgente

Merge branch 'master' of https://e.coding.net/chuanghaikeji/smartCampus/backend_code

夏文涛 2 anni fa
parent
commit
dbd3255ddf

+ 22 - 6
src/main/java/com/template/controller/SmartAuthorGroupController.java

@@ -407,16 +407,32 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
     @PassToken
     @DESRespondSecret(validated = true)
     public CommonResult delSmartAuthorGroup(Integer id) {
+        QueryWrapper<SmartAuthorGroup> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.eq("parent_id", id);
+        queryWrapper1.eq("deleted",0);
+        List<SmartAuthorGroup> list1 = smartAuthorGroupService.getAuthorGroupByKey(queryWrapper1);
         SmartAuthorGroup rns = new SmartAuthorGroup();
         rns.setId(id);
         rns.setDeleted(1);
         int result = smartAuthorGroupService.updateSmartAuthorGroup(rns);
         SmartAuthority smartAuthority = new SmartAuthority();
         smartAuthority.setDeleted(1);
-        QueryWrapper<SmartAuthority> queryWrapperA = new QueryWrapper<>();
-        queryWrapperA.eq("group_id", id);
-        boolean m = smartAuthorityService.update(smartAuthority,queryWrapperA);
-        return result > 0 && m ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
+        QueryWrapper<SmartAuthority> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("group_id", id);
+        boolean m = smartAuthorityService.update(smartAuthority,queryWrapper2);
+        SmartAuthorGroup rns2 = new SmartAuthorGroup();
+        rns2.setDeleted(1);
+        QueryWrapper<SmartAuthorGroup> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.eq("parent_id", id);
+        boolean result2 = smartAuthorGroupService.update(rns2, queryWrapper3);
+        SmartAuthority smartAuthority2 = new SmartAuthority();
+        smartAuthority2.setDeleted(1);
+        QueryWrapper<SmartAuthority> queryWrapper4 = new QueryWrapper<>();
+        List<Integer> gid = list1.stream().map(SmartAuthorGroup::getId).collect(Collectors.toList());
+        queryWrapper4.in("group_id", gid);
+        queryWrapper4.eq("deleted",0);
+        boolean m2 = smartAuthorityService.update(smartAuthority2,queryWrapper4);
+        return result > 0 && result2 && m && m2 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
     }
 
     /**
@@ -464,7 +480,7 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
         queryWrapperB.in("id", users);
         queryWrapperB.eq("deleted", 0);
         List<SmartUser> ulist = smartUserService.list(queryWrapperB);
-        if (ulist.isEmpty() || ulist.size()!=newUserId.length){
+        if (!userId.equals("") && (ulist.isEmpty() || ulist.size()!=newUserId.length)){
             return CommonResult.fail("有用户已删除");
         }
         for (int i = 0; i < oldUserId.length; i++) {
@@ -596,7 +612,7 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
 
     @PassToken
     @Override
-    @DESRespondSecret(validated = true)
+    @DESRespondSecret(validated = false)
     public CommonResult queryUserAuthor(String userId) {
         String[] userids = userId.split(",");
         QueryWrapper<SmartAuthority> queryWrapper1 = new QueryWrapper<>();

+ 3 - 0
src/main/java/com/template/model/evaluate/student/SmartEvaluateStudent.java

@@ -20,6 +20,9 @@ public class SmartEvaluateStudent {
     @ApiModelProperty(value = "年级")
     public String gradeName;
 
+    @ApiModelProperty(value = "年级")
+    public String examType;
+
     @ApiModelProperty(value = "班级")
     public String className;
 

+ 1 - 1
src/main/resources/mapper/template/SmartAuthorGroupMapper.xml

@@ -38,6 +38,6 @@
     <select id="getSmartAuthorGroupManager" resultType="com.template.model.pojo.SmartAuthorGroupManager" resultMap="smartAuthorGroupManager">
         select a.`id`,a.`group_id`,a.`user_id`,b.card_no,b.`name` as user_name,a.`department_manage`,a.`department_view`
             from `smart_authority` a left join `smart_user` b on a.`user_id`=b.id
-            where group_id=#{groupId}
+            where group_id=#{groupId} and a.deleted=0 and b.deleted=0
     </select>
 </mapper>