夏文涛 il y a 2 ans
Parent
commit
4da2ca2a58

+ 44 - 17
.idea/workspace.xml

@@ -5,6 +5,7 @@
   </component>
   </component>
   <component name="ChangeListManager">
   <component name="ChangeListManager">
     <list default="true" id="36922be1-416a-4a25-9739-9814e01883a6" name="Default Changelist" comment="">
     <list default="true" id="36922be1-416a-4a25-9739-9814e01883a6" name="Default Changelist" comment="">
+<<<<<<< HEAD
       <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/seewo/ParentServiceRemoveStudentParentConditionParam.java" afterDir="false" />
       <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/seewo/ParentServiceRemoveStudentParentConditionParam.java" afterDir="false" />
       <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/seewo/ParentServiceRemoveStudentParentConditionRequest.java" afterDir="false" />
       <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/seewo/ParentServiceRemoveStudentParentConditionRequest.java" afterDir="false" />
       <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/seewo/ParentServiceRemoveStudentParentConditionResult.java" afterDir="false" />
       <change afterPath="$PROJECT_DIR$/src/main/java/com/template/model/seewo/ParentServiceRemoveStudentParentConditionResult.java" afterDir="false" />
@@ -25,10 +26,14 @@
       <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/target/mybatis_plus-0.0.1-SNAPSHOT.jar.original" afterDir="false" />
+=======
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/api/SmartWarningControllerAPI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/api/SmartWarningControllerAPI.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/common/utils/GetCameraPreviewURL.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/GetCameraPreviewURL.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/common/utils/SendSms.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/common/utils/SendSms.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartWarningController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartWarningController.java" afterDir="false" />
+>>>>>>> 99e86064657b240f40690c523c82aefe70ae08c9
     </list>
     </list>
-    <ignored path="$PROJECT_DIR$/target/" />
-    <ignored path="$PROJECT_DIR$/classes/" />
-    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -37,6 +42,7 @@
   <component name="DefaultGradleProjectSettings">
   <component name="DefaultGradleProjectSettings">
     <option name="isMigrated" value="true" />
     <option name="isMigrated" value="true" />
   </component>
   </component>
+<<<<<<< HEAD
   <component name="FileEditorManager">
   <component name="FileEditorManager">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
       <file pinned="false" current-in-tab="true">
       <file pinned="false" current-in-tab="true">
@@ -181,6 +187,8 @@
       </file>
       </file>
     </leaf>
     </leaf>
   </component>
   </component>
+=======
+>>>>>>> 99e86064657b240f40690c523c82aefe70ae08c9
   <component name="FindInProjectRecents">
   <component name="FindInProjectRecents">
     <findStrings>
     <findStrings>
       <find>queryPageSma</find>
       <find>queryPageSma</find>
@@ -259,6 +267,7 @@
     <option name="generalSettings">
     <option name="generalSettings">
       <MavenGeneralSettings>
       <MavenGeneralSettings>
         <option name="mavenHome" value="D:/Software/Develop/Maven/apache-maven-3.3.9" />
         <option name="mavenHome" value="D:/Software/Develop/Maven/apache-maven-3.3.9" />
+        <option name="useMavenConfig" value="true" />
         <option name="userSettingsFile" value="D:\Software\Develop\Maven\apache-maven-3.3.9\conf\settings.xml" />
         <option name="userSettingsFile" value="D:\Software\Develop\Maven\apache-maven-3.3.9\conf\settings.xml" />
       </MavenGeneralSettings>
       </MavenGeneralSettings>
     </option>
     </option>
@@ -422,6 +431,7 @@
     <option name="showExcludedFiles" value="false" />
     <option name="showExcludedFiles" value="false" />
     <option name="showLibraryContents" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
   </component>
+<<<<<<< HEAD
   <component name="PropertiesComponent">
   <component name="PropertiesComponent">
     <property name="RequestMappingsPanelOrder0" value="0" />
     <property name="RequestMappingsPanelOrder0" value="0" />
     <property name="RequestMappingsPanelOrder1" value="1" />
     <property name="RequestMappingsPanelOrder1" value="1" />
@@ -456,6 +466,34 @@
     </option>
     </option>
   </component>
   </component>
   <component name="RunManager" selected="Spring Boot.MybatisPlusApplication">
   <component name="RunManager" selected="Spring Boot.MybatisPlusApplication">
+=======
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "node.js.selected.package.tslint": "(autodetect)",
+    "project.structure.last.edited": "Project",
+    "project.structure.proportion": "0.0",
+    "project.structure.side.proportion": "0.0",
+    "settings.editor.selected.configurable": "MavenSettings"
+  }
+}]]></component>
+  <component name="RebelAgentSelection">
+    <selection>jr</selection>
+  </component>
+  <component name="RunManager" selected="Application.GetCameraPreviewURL">
+    <configuration name="GetCameraPreviewURL" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
+      <option name="MAIN_CLASS_NAME" value="com.template.common.utils.GetCameraPreviewURL" />
+      <module name="mybatis_plus" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.template.common.utils.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+>>>>>>> 99e86064657b240f40690c523c82aefe70ae08c9
     <configuration name="SendSms" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
     <configuration name="SendSms" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
       <option name="MAIN_CLASS_NAME" value="com.template.common.utils.SendSms" />
       <option name="MAIN_CLASS_NAME" value="com.template.common.utils.SendSms" />
       <module name="mybatis_plus" />
       <module name="mybatis_plus" />
@@ -478,11 +516,12 @@
     </configuration>
     </configuration>
     <recent_temporary>
     <recent_temporary>
       <list>
       <list>
+        <item itemvalue="Application.GetCameraPreviewURL" />
         <item itemvalue="Application.SendSms" />
         <item itemvalue="Application.SendSms" />
       </list>
       </list>
     </recent_temporary>
     </recent_temporary>
   </component>
   </component>
-  <component name="SpellCheckerSettings" BundledDictionaries="0" Folders="0" CustomDictionaries="0" Dictionaries="0" CorrectionsLimit="5" DefaultDictionary="application-level" UseSingleDictionary="true" />
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="false" />
   <component name="SshConsoleOptionsProvider">
   <component name="SshConsoleOptionsProvider">
     <option name="myEncoding" value="UTF-8" />
     <option name="myEncoding" value="UTF-8" />
   </component>
   </component>
@@ -551,22 +590,12 @@
       <window_info anchor="right" id="Bean Validation" order="10" />
       <window_info anchor="right" id="Bean Validation" order="10" />
     </layout>
     </layout>
   </component>
   </component>
-  <component name="TypeScriptGeneratedFilesManager">
-    <option name="version" value="1" />
-  </component>
   <component name="Vcs.Log.Tabs.Properties">
   <component name="Vcs.Log.Tabs.Properties">
     <option name="TAB_STATES">
     <option name="TAB_STATES">
       <map>
       <map>
         <entry key="MAIN">
         <entry key="MAIN">
           <value>
           <value>
-            <State>
-              <option name="RECENTLY_FILTERED_USER_GROUPS">
-                <collection />
-              </option>
-              <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
-                <collection />
-              </option>
-            </State>
+            <State />
           </value>
           </value>
         </entry>
         </entry>
       </map>
       </map>
@@ -592,13 +621,11 @@
         <line-breakpoint enabled="true" type="java-line">
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartAttendanceController.java</url>
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartAttendanceController.java</url>
           <line>70</line>
           <line>70</line>
-          <properties />
           <option name="timeStamp" value="1" />
           <option name="timeStamp" value="1" />
         </line-breakpoint>
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/WxGzhController.java</url>
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/WxGzhController.java</url>
           <line>137</line>
           <line>137</line>
-          <properties />
           <option name="timeStamp" value="2" />
           <option name="timeStamp" value="2" />
         </line-breakpoint>
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
         <line-breakpoint enabled="true" type="java-line">

+ 3 - 0
src/main/java/com/template/api/SmartWarningControllerAPI.java

@@ -76,5 +76,8 @@ public interface SmartWarningControllerAPI {
     @ApiOperation(value = "删除预警可推送用户", notes = "删除预警可推送用户", httpMethod = "POST")
     @ApiOperation(value = "删除预警可推送用户", notes = "删除预警可推送用户", httpMethod = "POST")
     CommonResult warningDeletePush(@RequestBody WarningDeletePushDto warningDeletePushDto);
     CommonResult warningDeletePush(@RequestBody WarningDeletePushDto warningDeletePushDto);
 
 
+    @GetMapping(value = "/behaviour")
+    @ApiOperation(value = "行为分析", notes = "行为分析", httpMethod = "GET")
+    CommonResult behaviourList();
 
 
 }
 }

+ 2 - 2
src/main/java/com/template/common/utils/GetCameraPreviewURL.java

@@ -87,9 +87,9 @@ public class GetCameraPreviewURL {
 
 
 //        区域入侵,进入区域,离开区域,倒地
 //        区域入侵,进入区域,离开区域,倒地
         int[] ingArr=new int[]{131588,131586,131587,131605};
         int[] ingArr=new int[]{131588,131586,131587,131605};
-        String url = "http://192.168.161.224:8080/wanzai/eventRcv/subscription";
+//        String url = "http://192.168.161.224:8080/wanzai/eventRcv/subscription";
 //        String url = "https://www.campussmartlife.com/smartApi/wanzai/eventRcv/subscription";
 //        String url = "https://www.campussmartlife.com/smartApi/wanzai/eventRcv/subscription";
-//        String url = "http://122.51.35.116:8080/wanzai/eventRcv/subscription";
+        String url = "http://122.51.35.116:8080/wanzai/eventRcv/subscription";
 
 
 //        重点人员识别事件
 //        重点人员识别事件
 //        int[] ingArr = new int[]{1644175361};
 //        int[] ingArr = new int[]{1644175361};

+ 1 - 1
src/main/java/com/template/common/utils/SendSms.java

@@ -44,7 +44,7 @@ public class SendSms {
 
 
     //模板Id
     //模板Id
 //    private static String templateId="1770016";
 //    private static String templateId="1770016";
-    private static String templateId = "2060673";
+    private static String templateId = "2065770";
 
 
     //验证码有效时长
     //验证码有效时长
     private static String smsMin = "1";
     private static String smsMin = "1";

+ 25 - 10
src/main/java/com/template/controller/SmartAuthorGroupController.java

@@ -8,17 +8,13 @@ import com.template.api.SmartAuthorGroupControllerAPI;
 import com.template.common.utils.TimeExchange2;
 import com.template.common.utils.TimeExchange2;
 import com.template.common.utils.TreeRecordsUtil;
 import com.template.common.utils.TreeRecordsUtil;
 import com.template.common.utils.UUIDUtil;
 import com.template.common.utils.UUIDUtil;
-import com.template.model.pojo.SmartAuthorGroup;
-import com.template.model.pojo.SmartAuthority;
-import com.template.model.pojo.SmartUser;
+import com.template.model.pojo.*;
 import com.template.model.result.CommonResult;
 import com.template.model.result.CommonResult;
 import com.template.model.weixin.AuthorAndGroup;
 import com.template.model.weixin.AuthorAndGroup;
 import com.template.model.weixin.AuthorAndGroup2;
 import com.template.model.weixin.AuthorAndGroup2;
 import com.template.model.weixin.AuthorListGroup;
 import com.template.model.weixin.AuthorListGroup;
 import com.template.model.weixin.userAuthor;
 import com.template.model.weixin.userAuthor;
-import com.template.services.SmartAuthorGroupService;
-import com.template.services.SmartAuthorityService;
-import com.template.services.SmartUserService;
+import com.template.services.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 
 
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
@@ -44,6 +40,10 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
     public SmartAuthorityService smartAuthorityService;
     public SmartAuthorityService smartAuthorityService;
     @Autowired
     @Autowired
     public SmartUserService smartUserService;
     public SmartUserService smartUserService;
+    @Autowired
+    public SmartDepartmentService smartDepartmentService;
+    @Autowired
+    public SmartMenuService smartMenuService;
 
 
     /**
     /**
      * 新增权限组
      * 新增权限组
@@ -375,10 +375,25 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
             return CommonResult.ok(new ArrayList<>());
             return CommonResult.ok(new ArrayList<>());
         }
         }
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("departmentViewAuthor", smartAuthority.getDepartmentView());
-        jsonObject.put("departmentManageAuthor", smartAuthority.getDepartmentManage());
+        QueryWrapper<SmartDepartment> queryWrapper2 = new QueryWrapper<>();
+        queryWrapper2.eq("deleted", 0);
+        List<String> viewDepart = Arrays.asList(smartAuthority.getDepartmentView().split(","));
+        queryWrapper2.in("id", viewDepart);
+        List<SmartDepartment> list1 = smartDepartmentService.list(queryWrapper2);
+        QueryWrapper<SmartDepartment> queryWrapper3 = new QueryWrapper<>();
+        queryWrapper3.eq("deleted", 0);
+        List<String> manageDepart = Arrays.asList(smartAuthority.getDepartmentManage().split(","));
+        queryWrapper3.in("id", manageDepart);
+        List<SmartDepartment> list2 = smartDepartmentService.list(queryWrapper3);
+        jsonObject.put("departmentViewAuthor", list1);
+        jsonObject.put("departmentManageAuthor", list2);
         if (smartAuthorGroup.getDeleted()==0){
         if (smartAuthorGroup.getDeleted()==0){
-            jsonObject.put("treAuthor", smartAuthorGroup.getApplyId());
+            QueryWrapper<SmartMenu> queryWrapper4 = new QueryWrapper<>();
+            queryWrapper4.eq("deleted", 0);
+            List<String> menuList = Arrays.asList(smartAuthorGroup.getApplyId().split(","));
+            queryWrapper4.in("id", menuList);
+            List<SmartMenu> list3 = smartMenuService.list(queryWrapper4);
+            jsonObject.put("treAuthor", list3);
         }
         }
         return CommonResult.ok(jsonObject);
         return CommonResult.ok(jsonObject);
     }
     }
@@ -392,7 +407,7 @@ public class SmartAuthorGroupController implements SmartAuthorGroupControllerAPI
         List<SmartAuthorGroup> smartAuthorGroups = smartAuthorGroupService.getAuthorGroupList();
         List<SmartAuthorGroup> smartAuthorGroups = smartAuthorGroupService.getAuthorGroupList();
         List<AuthorListGroup> authorListGroupList = null;
         List<AuthorListGroup> authorListGroupList = null;
         if (smartAuthorGroups.size()>0) {
         if (smartAuthorGroups.size()>0) {
-            authorListGroupList = TreeRecordsUtil.queryCommentTreeRecords(authorGroupId, smartAuthorGroups);
+            authorListGroupList = smartAuthorGroupService.queryCommentTreeRecords(authorGroupId, smartAuthorGroups);
         }
         }
         return CommonResult.ok(authorListGroupList);
         return CommonResult.ok(authorListGroupList);
     }
     }

+ 7 - 0
src/main/java/com/template/controller/SmartWarningController.java

@@ -355,6 +355,13 @@ public class SmartWarningController implements SmartWarningControllerAPI {
         return CommonResult.fail("删除失败");
         return CommonResult.fail("删除失败");
     }
     }
 
 
+    @Override
+    public CommonResult behaviourList() {
+
+
+        return null;
+    }
+
 
 
     /**
     /**
      * 根据父级ID获取树形数据
      * 根据父级ID获取树形数据

+ 1 - 1
src/main/java/com/template/controller/WxGzhController.java

@@ -99,7 +99,7 @@ public class WxGzhController implements WxGzhControllerAPI {
         queryWrapper1.ge("expiration_time", new Date());
         queryWrapper1.ge("expiration_time", new Date());
         List<SmsCode> listc = smsCodeService.getSmsCodeByKey(queryWrapper1);
         List<SmsCode> listc = smsCodeService.getSmsCodeByKey(queryWrapper1);
         if (listc.isEmpty()) {
         if (listc.isEmpty()) {
-            return CommonResult.ok("验证码已失效");
+            return CommonResult.fail("验证码已失效");
         }
         }
 
 
         for (SmsCode smsCode : listc) {
         for (SmsCode smsCode : listc) {

+ 3 - 0
src/main/java/com/template/services/SmartAuthorGroupService.java

@@ -5,6 +5,7 @@ import com.template.model.pojo.SmartAuthorGroup;
 import com.template.model.pojo.SmartAuthorGroup;
 import com.template.model.pojo.SmartAuthorGroup;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
+import com.template.model.weixin.AuthorListGroup;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -32,4 +33,6 @@ public interface SmartAuthorGroupService extends IService<SmartAuthorGroup> {
     List<SmartAuthorGroup> getAuthorGroupByKey(QueryWrapper<SmartAuthorGroup> queryWrapper);
     List<SmartAuthorGroup> getAuthorGroupByKey(QueryWrapper<SmartAuthorGroup> queryWrapper);
 
 
     List<SmartAuthorGroup> smartAuthorGroup(Integer userId);
     List<SmartAuthorGroup> smartAuthorGroup(Integer userId);
+
+    public List<AuthorListGroup> queryCommentTreeRecords(Integer pid, List<SmartAuthorGroup> lists);
 }
 }

+ 54 - 2
src/main/java/com/template/services/impl/SmartAuthorGroupServiceImpl.java

@@ -1,21 +1,27 @@
 package com.template.services.impl;
 package com.template.services.impl;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.template.mapper.SmartAuthorGroupMapper;
-import com.template.mapper.SmartAuthorityMapper;
+import com.template.mapper.*;
+import com.template.model.pojo.SmartApply;
 import com.template.model.pojo.SmartAuthorGroup;
 import com.template.model.pojo.SmartAuthorGroup;
 import com.template.model.pojo.SmartAuthorGroup;
 import com.template.model.pojo.SmartAuthorGroup;
 import com.template.mapper.SmartAuthorGroupMapper;
 import com.template.mapper.SmartAuthorGroupMapper;
+import com.template.model.pojo.SmartUser;
 import com.template.model.result.PageUtils;
 import com.template.model.result.PageUtils;
+import com.template.model.weixin.AuthorListGroup;
 import com.template.services.SmartAuthorGroupService;
 import com.template.services.SmartAuthorGroupService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 import org.springframework.util.StringUtils;
 
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -29,6 +35,10 @@ import java.util.List;
 public class SmartAuthorGroupServiceImpl extends ServiceImpl<SmartAuthorGroupMapper, SmartAuthorGroup> implements SmartAuthorGroupService {
 public class SmartAuthorGroupServiceImpl extends ServiceImpl<SmartAuthorGroupMapper, SmartAuthorGroup> implements SmartAuthorGroupService {
     @Autowired
     @Autowired
     private SmartAuthorGroupMapper smartAuthorGroupMapper;
     private SmartAuthorGroupMapper smartAuthorGroupMapper;
+    @Autowired
+    public SmartUserMapper smartUserMapper;
+    @Autowired
+    public SmartApplyMapper smartApplyMapper;
 
 
     @Override
     @Override
     public int insertSmartAuthorGroup(SmartAuthorGroup sa) {
     public int insertSmartAuthorGroup(SmartAuthorGroup sa) {
@@ -83,4 +93,46 @@ public class SmartAuthorGroupServiceImpl extends ServiceImpl<SmartAuthorGroupMap
         List<SmartAuthorGroup> result = smartAuthorGroupMapper.smartAuthorGroup(userId);
         List<SmartAuthorGroup> result = smartAuthorGroupMapper.smartAuthorGroup(userId);
         return result;
         return result;
     }
     }
+
+    @Override
+    public List<AuthorListGroup> queryCommentTreeRecords(Integer pid, List<SmartAuthorGroup> lists) {
+        List<AuthorListGroup> newTrees = new ArrayList<>();
+        List<SmartAuthorGroup> datas = lists.stream().filter(e -> e.getParentId().equals(pid)).collect(Collectors.toList());
+        for (SmartAuthorGroup data : datas) {
+            QueryWrapper<SmartUser> queryWrapper1 = new QueryWrapper<>();
+            queryWrapper1.eq("deleted", 0);
+            List<String> userIds = Arrays.asList(data.getUserId().split(","));
+            queryWrapper1.in("id", userIds);
+            List<SmartUser> list1 = smartUserMapper.selectList(queryWrapper1);
+            JSONObject jsonObject1 = new JSONObject();
+            jsonObject1.put("data", list1);
+            QueryWrapper<SmartApply> queryWrapper2 = new QueryWrapper<>();
+            queryWrapper2.eq("deleted", 0);
+            List<String> applyIds = Arrays.asList(data.getApplyId().split(","));
+            queryWrapper2.in("id", applyIds);
+            List<SmartApply> list2 = smartApplyMapper.selectList(queryWrapper2);
+            JSONObject jsonObject2 = new JSONObject();
+            jsonObject2.put("data", list2);
+            AuthorListGroup item = AuthorListGroup.builder()
+                    .id(data.getId())
+                    .parentId(data.getParentId())
+                    .name(data.getName())
+                    .userId(jsonObject1.toJSONString())
+                    .applyId(jsonObject2.toJSONString())
+                    .updateTime(data.getUpdateTime())
+                    .createUser(data.getCreateUser())
+                    .updateUser(data.getUpdateUser())
+                    .deleted(data.getDeleted())
+                    .build();
+            List<AuthorListGroup> news = queryCommentTreeRecords(item.getId(), lists);
+            if (news == null || news.size() == 0) {
+                newTrees.add(item);
+                continue;
+            } else {
+                item.setAuthorListGroups(news);
+                newTrees.add(item);
+            }
+        }
+        return newTrees;
+    }
 }
 }

+ 2 - 1
src/main/java/com/template/services/impl/SmartWarningServiceImpl.java

@@ -52,7 +52,8 @@ public class SmartWarningServiceImpl extends ServiceImpl<SmartWarningMapper, Sma
         Page<SmartWarning> page = new Page<>(currentPage, pageCount);
         Page<SmartWarning> page = new Page<>(currentPage, pageCount);
         LambdaQueryWrapper<SmartWarning> queryWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<SmartWarning> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.like(ObjectUtils.isNotEmpty(name),SmartWarning::getLocation,name)
         queryWrapper.like(ObjectUtils.isNotEmpty(name),SmartWarning::getLocation,name)
-                .eq(ObjectUtils.isNotEmpty(state),SmartWarning::getStatu,state);
+                .eq(ObjectUtils.isNotEmpty(state),SmartWarning::getStatu,state)
+                .orderByDesc(SmartWarning::getDateTime);
         IPage<SmartWarning> result = smartWarningMapper.selectPage(page, queryWrapper);
         IPage<SmartWarning> result = smartWarningMapper.selectPage(page, queryWrapper);
         return new PageUtils<>(result);
         return new PageUtils<>(result);
     }
     }