夏文涛 2 年 前
コミット
4b58d4b578
21 ファイル変更373 行追加109 行削除
  1. 39 43
      .idea/workspace.xml
  2. 4 0
      src/main/java/com/template/api/SmartEvaluateStudentControllerAPI.java
  3. 3 1
      src/main/java/com/template/api/SmartFaceDiscernControllerAPI.java
  4. 6 4
      src/main/java/com/template/api/SmartWarningControllerAPI.java
  5. 5 0
      src/main/java/com/template/api/WechatScanLoginControllerAPI.java
  6. 24 3
      src/main/java/com/template/controller/SmartEvaluateStudentController.java
  7. 33 19
      src/main/java/com/template/controller/SmartWarningController.java
  8. 59 0
      src/main/java/com/template/controller/WechatScanLoginController.java
  9. 2 1
      src/main/java/com/template/mapper/SmartFaceDiscernMapper.java
  10. 2 1
      src/main/java/com/template/mapper/SmartUserMapper.java
  11. 10 0
      src/main/java/com/template/model/dto/WarningDeletePushDto.java
  12. 19 0
      src/main/java/com/template/model/dto/WarningUserDto.java
  13. 18 0
      src/main/java/com/template/model/phoneBook/BookUser.java
  14. 19 0
      src/main/java/com/template/model/phoneBook/ClassBook.java
  15. 19 0
      src/main/java/com/template/model/phoneBook/GradeBook.java
  16. 51 0
      src/main/java/com/template/model/pojo/SmartDataTaskErr.java
  17. 5 2
      src/main/java/com/template/services/SmartUserService.java
  18. 8 8
      src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java
  19. 13 3
      src/main/java/com/template/services/impl/SmartUserServiceImpl.java
  20. 17 12
      src/main/resources/mapper/template/SmartUserMapper.xml
  21. 17 12
      target/classes/mapper/template/SmartUserMapper.xml

+ 39 - 43
.idea/workspace.xml

@@ -5,15 +5,16 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="cb7b6a84-9179-4588-9374-31a70f785e65" name="Default Changelist" comment="">
+<<<<<<< HEAD
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartAttendanceController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartAttendanceController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartUserController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/template/controller/SmartUserController.java" 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/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" />
+>>>>>>> d423a496fa85745d290d803e21cc0f32ea1880a2
     </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="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -36,6 +37,7 @@
   <component name="DefaultGradleProjectSettings">
     <option name="isMigrated" value="true" />
   </component>
+<<<<<<< HEAD
   <component name="FileEditorManager">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
       <file pinned="false" current-in-tab="false">
@@ -96,6 +98,8 @@
       </file>
     </leaf>
   </component>
+=======
+>>>>>>> d423a496fa85745d290d803e21cc0f32ea1880a2
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
       <list>
@@ -212,11 +216,15 @@
       </list>
     </option>
   </component>
+  <component name="MarkdownSettingsMigration">
+    <option name="stateVersion" value="1" />
+  </component>
   <component name="MavenImportPreferences">
     <option name="generalSettings">
       <MavenGeneralSettings>
-        <option name="mavenHome" value="D:/Software/Develop/Maven/apache-maven-3.3.9" />
-        <option name="userSettingsFile" value="D:\Software\Develop\Maven\apache-maven-3.3.9\conf\settings.xml" />
+        <option name="mavenHome" value="D:/soft/maven/apache-maven-3.8.6" />
+        <option name="useMavenConfig" value="true" />
+        <option name="userSettingsFile" value="D:\soft\maven\apache-maven-3.8.6\conf\settings.xml" />
       </MavenGeneralSettings>
     </option>
   </component>
@@ -431,16 +439,16 @@
     <option name="showExcludedFiles" value="false" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent">
-    <property name="RequestMappingsPanelOrder0" value="0" />
-    <property name="RequestMappingsPanelOrder1" value="1" />
-    <property name="RequestMappingsPanelWidth0" value="75" />
-    <property name="RequestMappingsPanelWidth1" value="75" />
-    <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="aspect.path.notification.shown" value="true" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../民宿/mhotel" />
-    <property name="settings.editor.selected.configurable" value="MavenSettings" />
-  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "WebServerToolWindowFactoryState": "false",
+    "project.structure.last.edited": "Project",
+    "project.structure.proportion": "0.0",
+    "project.structure.side.proportion": "0.0",
+    "settings.editor.selected.configurable": "MavenSettings",
+    "spring.configuration.checksum": "64bf9ba214eb006c40cb35e0f61a7d20"
+  }
+}]]></component>
   <component name="RebelAgentSelection">
     <selection>jr</selection>
   </component>
@@ -463,18 +471,6 @@
       <recent name="D:\Bingo\Desktop\工作内容\万载三中\backend_code\src\main\java\com\template\model\pojo" />
     </key>
   </component>
-  <component name="RunDashboard">
-    <option name="ruleStates">
-      <list>
-        <RuleState>
-          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
-        </RuleState>
-        <RuleState>
-          <option name="name" value="StatusDashboardGroupingRule" />
-        </RuleState>
-      </list>
-    </option>
-  </component>
   <component name="RunManager" selected="Spring Boot.MybatisPlusApplication">
     <configuration name="AesTestOne" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
       <option name="MAIN_CLASS_NAME" value="com.template.common.utils.AesTestOne" />
@@ -558,7 +554,7 @@
       </list>
     </recent_temporary>
   </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="true" />
   <component name="SpringBootOptions">
     <option name="showAdditionalConfigNotification" value="false" />
   </component>
@@ -589,7 +585,12 @@
       <workItem from="1705388695984" duration="51258000" />
       <workItem from="1705885614332" duration="695000" />
       <workItem from="1705886328968" duration="31068000" />
+<<<<<<< HEAD
       <workItem from="1705992981607" duration="28562000" />
+=======
+      <workItem from="1705992981607" duration="24464000" />
+      <workItem from="1706163623253" duration="58000" />
+>>>>>>> d423a496fa85745d290d803e21cc0f32ea1880a2
     </task>
     <servers />
   </component>
@@ -679,21 +680,14 @@
     </layout-to-restore>
   </component>
   <component name="TypeScriptGeneratedFilesManager">
-    <option name="version" value="1" />
+    <option name="version" value="3" />
   </component>
   <component name="Vcs.Log.Tabs.Properties">
     <option name="TAB_STATES">
       <map>
         <entry key="MAIN">
           <value>
-            <State>
-              <option name="RECENTLY_FILTERED_USER_GROUPS">
-                <collection />
-              </option>
-              <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
-                <collection />
-              </option>
-            </State>
+            <State />
           </value>
         </entry>
       </map>
@@ -719,50 +713,52 @@
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/WechatScanLoginController.java</url>
           <line>56</line>
-          <properties />
           <option name="timeStamp" value="57" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartAttendanceController.java</url>
+<<<<<<< HEAD
           <line>84</line>
           <properties />
+=======
+          <line>81</line>
+>>>>>>> d423a496fa85745d290d803e21cc0f32ea1880a2
           <option name="timeStamp" value="59" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartScoreController.java</url>
           <line>494</line>
-          <properties />
           <option name="timeStamp" value="76" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartGradeController.java</url>
           <line>139</line>
-          <properties />
           <option name="timeStamp" value="98" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/common/utils/AesTestOne.java</url>
           <line>52</line>
-          <properties />
           <option name="timeStamp" value="99" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartUserController.java</url>
           <line>1836</line>
-          <properties />
           <option name="timeStamp" value="113" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartApplyController.java</url>
           <line>135</line>
-          <properties />
           <option name="timeStamp" value="114" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/template/controller/SmartUserController.java</url>
           <line>1179</line>
+<<<<<<< HEAD
           <properties />
           <option name="timeStamp" value="117" />
+=======
+          <option name="timeStamp" value="115" />
+>>>>>>> d423a496fa85745d290d803e21cc0f32ea1880a2
         </line-breakpoint>
       </breakpoints>
     </breakpoint-manager>

+ 4 - 0
src/main/java/com/template/api/SmartEvaluateStudentControllerAPI.java

@@ -37,4 +37,8 @@ public interface SmartEvaluateStudentControllerAPI {
     @ApiOperation(value = "学生评分", httpMethod = "POST")
     public CommonResult evaluateScore(@Validated @RequestBody JSONObject jsonObject);
 
+    @RequestMapping(value = "/queryDetailScore")
+    @ApiOperation(value = "查看学生评分详情", httpMethod = "POST")
+    public CommonResult queryDetailScore(Integer id);
+
 }

+ 3 - 1
src/main/java/com/template/api/SmartFaceDiscernControllerAPI.java

@@ -1,6 +1,7 @@
 package com.template.api;
 
 import com.template.model.result.CommonResult;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -8,7 +9,8 @@ import org.springframework.web.bind.annotation.RequestParam;
 @RequestMapping("/api/smartFaceDiscern")
 public interface SmartFaceDiscernControllerAPI {
 
-        @GetMapping(value = "/track")
+    @GetMapping(value = "/track")
+    @ApiOperation(value = "ѧÉú¹ì¼£", notes = "ѧÉú¹ì¼£", httpMethod = "GET")
     CommonResult track(@RequestParam Integer id, @RequestParam int dateTime);
 
 }

+ 6 - 4
src/main/java/com/template/api/SmartWarningControllerAPI.java

@@ -2,6 +2,7 @@ package com.template.api;
 
 import com.baomidou.mybatisplus.extension.api.R;
 import com.template.model.dto.OperationWarningDto;
+import com.template.model.dto.WarningDeletePushDto;
 import com.template.model.dto.WarningSavePushDto;
 import com.template.model.pojo.SmartWarning;
 import com.template.model.result.CommonResult;
@@ -12,6 +13,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * @Author: binguo
@@ -60,7 +62,7 @@ public interface SmartWarningControllerAPI {
 
     @GetMapping(value = "/warningUserList")
     @ApiOperation(value = "预警推送用户分页", notes = "预警推送用户分页", httpMethod = "GET")
-    CommonResult warningUserList(@RequestParam int currentPage, @RequestParam int pageCount,Integer departmentId,String name);
+    CommonResult warningUserList(@RequestParam int currentPage, @RequestParam int pageCount,String name);
 
     @GetMapping(value = "/warningPushList")
     @ApiOperation(value = "可推送用户展示", notes = "预警推送用户分页", httpMethod = "GET")
@@ -70,9 +72,9 @@ public interface SmartWarningControllerAPI {
     @ApiOperation(value = "添加预警可推送用户", notes = "添加预警可推送用户", httpMethod = "POST")
     CommonResult warningSavePush(@RequestBody WarningSavePushDto warningSavePushDto);
 
-    @GetMapping(value = "/warningDeletePush")
-    @ApiOperation(value = "删除预警可推送用户", notes = "删除预警可推送用户", httpMethod = "GET")
-    CommonResult warningDeletePush(Integer id);
+    @PostMapping(value = "/warningDeletePush")
+    @ApiOperation(value = "删除预警可推送用户", notes = "删除预警可推送用户", httpMethod = "POST")
+    CommonResult warningDeletePush(@RequestBody WarningDeletePushDto warningDeletePushDto);
 
 
 }

+ 5 - 0
src/main/java/com/template/api/WechatScanLoginControllerAPI.java

@@ -88,4 +88,9 @@ public interface WechatScanLoginControllerAPI {
     @RequestMapping(value = "/vertifyMessage")
     @ResponseBody
     public CommonResult vertifyMessage(String phone,String code, String wxcode);
+
+    @RequestMapping(value = "/queryPhoneBook")
+    @ResponseBody
+    public CommonResult queryPhoneBook(@RequestParam Integer id);
+    
 }

+ 24 - 3
src/main/java/com/template/controller/SmartEvaluateStudentController.java

@@ -221,7 +221,7 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
                 double min = Double.parseDouble(range[0]);
                 double max = Double.parseDouble(range[1]);
                 if (smartEvaluateSdetail.getScoreNum()>=min && smartEvaluateSdetail.getScoreNum()<=max){
-                    scoreLevel = rule.get(i).getLevel();
+                    scoreLevel = rule.get(j).getLevel();
                     break;
                 }
             }
@@ -234,7 +234,7 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
             }
         }
         student.setScoreComment(smartEvaluateSdetailList.getScoreComment());
-        student.setScoreNum(total);
+        student.setScoreNum(total/scoreList.size());
         String scoreLevel = "";
         QueryWrapper<SmartSubjectRule> queryWrapper2 = new QueryWrapper<>();
         queryWrapper2.eq("deleted", 0);
@@ -244,7 +244,7 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
             String[] range = rule.get(i).getScoreRange().split("-");
             double min = Double.parseDouble(range[0]);
             double max = Double.parseDouble(range[1]);
-            if (total>=min && total<=max){
+            if (student.getScoreNum()>=min && student.getScoreNum()<=max){
                 scoreLevel = rule.get(i).getLevel();
                 break;
             }
@@ -253,4 +253,25 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
         smartEvaluateStudentService.updateSmartEvaluateStudent(student);
         return CommonResult.ok();
     }
+
+    @PassToken
+    public CommonResult queryDetailScore(Integer id){
+        if (id==null){
+            return CommonResult.fail("请传入id");
+        }
+        SmartEvaluateStudent smartEvaluateStudent = smartEvaluateStudentService.getSmartEvaluateStudentById(id);
+        if (smartEvaluateStudent==null){
+            return CommonResult.fail("未查询到相关信息");
+        }
+        QueryWrapper<SmartEvaluateSdetail> queryWrapper1 = new QueryWrapper<>();
+        queryWrapper1.eq("deleted", 0);
+        queryWrapper1.eq("term", smartEvaluateStudent.getTerm());
+        queryWrapper1.eq("card_no", smartEvaluateStudent.getCardNo());
+        List<SmartEvaluateSdetail> list = smartEvaluateSdetailService.getSmartEvaluateSdetailByKey(queryWrapper1);
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("id", smartEvaluateStudent.getId());
+        jsonObject.put("scoreComment",smartEvaluateStudent.getScoreComment());
+        jsonObject.put("scoreList", list);
+        return CommonResult.ok(jsonObject);
+    }
 }

+ 33 - 19
src/main/java/com/template/controller/SmartWarningController.java

@@ -10,7 +10,9 @@ import com.template.api.SmartWarningControllerAPI;
 import com.template.common.result.ResponseStatusEnum;
 import com.template.common.utils.*;
 import com.template.model.dto.OperationWarningDto;
+import com.template.model.dto.WarningDeletePushDto;
 import com.template.model.dto.WarningSavePushDto;
+import com.template.model.dto.WarningUserDto;
 import com.template.model.pojo.SmartDepartment;
 import com.template.model.pojo.SmartUser;
 import com.template.model.pojo.SmartWarning;
@@ -23,6 +25,7 @@ import com.template.services.SmartUserService;
 import com.template.services.SmartWarningService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RequestParam;
@@ -239,18 +242,18 @@ public class SmartWarningController implements SmartWarningControllerAPI {
     }
 
     @Override
-    public CommonResult warningUserList(int currentPage, int pageCount, Integer departmentId, String name) {
+    public CommonResult warningUserList(int currentPage, int pageCount, String name) {
         //获取该部门下的所有子级部门ID
-        List<Integer> childDepartmentIds = new ArrayList<>();
-        List<SmartDepartment> departments = smartDepartmentService.list(null);
-        childDepartmentIds.add(departmentId);
-        QueryDepartmentTreeRecords(departmentId, departments, childDepartmentIds);
-
-        if (departmentId == null) {
-            childDepartmentIds = null;
-        }
+//        List<Integer> childDepartmentIds = new ArrayList<>();
+//        List<SmartDepartment> departments = smartDepartmentService.list(null);
+//        childDepartmentIds.add(departmentId);
+//        QueryDepartmentTreeRecords(departmentId, departments, childDepartmentIds);
+//
+//        if (departmentId == null) {
+//            childDepartmentIds = null;
+//        }
 
-        PageUtils<UserVo> result = smartUserService.warningUserList(currentPage, pageCount, childDepartmentIds, name);
+        PageUtils<WarningUserDto> result = smartUserService.warningUserList(currentPage, pageCount, name);
         return CommonResult.ok(result);
     }
 
@@ -274,7 +277,7 @@ public class SmartWarningController implements SmartWarningControllerAPI {
         for (SmartUser smartUser : smartUsers) {
             String gzhOpenId = smartUser.getGzhOpenId();
             if (ObjectUtils.isEmpty(gzhOpenId)) {
-                return CommonResult.fail(smartUser.getName()+ "未关联公众号");
+                return CommonResult.fail(smartUser.getName() + "未关联公众号");
             }
             smartUser.setIsPush(1);
             smartUserService.updateSmartUser(smartUser);
@@ -284,20 +287,31 @@ public class SmartWarningController implements SmartWarningControllerAPI {
     }
 
     @Override
-    public CommonResult warningDeletePush(Integer id) {
+    public CommonResult warningDeletePush(WarningDeletePushDto warningDeletePushDto) {
+        List<Integer> ids = warningDeletePushDto.getIds();
 
-        if (ObjectUtils.isEmpty(id)) {
+        if (ObjectUtils.isEmpty(ids) && ids.size() == 0) {
             return CommonResult.fail();
         }
 
-        SmartUser smartById = smartUserService.getSmartById(id);
+        List<SmartUser> smartUserList = smartUserService.getSmartUserList(ids);
 
-        if (ObjectUtils.isEmpty(smartById)) {
-            return CommonResult.fail();
+        if (ObjectUtils.isEmpty(smartUserList)&&smartUserList.size()==0 ) {
+            return CommonResult.fail("无该用户");
         }
-        smartById.setIsPush(0);
-        int result = smartUserService.updateSmartUser(smartById);
-        return result > 0 ? CommonResult.ok("删除成功") : CommonResult.fail("删除失败");
+        ArrayList<SmartUser> smartUsers = new ArrayList<>();
+
+        for (SmartUser smartUser : smartUserList) {
+            smartUser.setIsPush(0);
+            smartUsers.add(smartUser);
+        }
+
+
+        boolean b = smartUserService.updateBatchById(smartUsers);
+        if (b) {
+            return CommonResult.ok("删除成功");
+        }
+        return CommonResult.fail("删除失败");
     }
 
 

+ 59 - 0
src/main/java/com/template/controller/WechatScanLoginController.java

@@ -520,4 +520,63 @@ public class WechatScanLoginController implements WechatScanLoginControllerAPI {
         jsonObject.put("userhead", AesUtils.encrypt(String.valueOf(user.get(0).getId())));
         return CommonResult.ok(jsonObject);
     }
+
+    @Override
+	@PassToken
+	public CommonResult queryPhoneBook(Integer id){
+		if (id==null){
+			return CommonResult.fail("请传入id");
+		}
+		SmartUser user = smartUserService.getSmartById(id);
+		if (user==null){
+			return CommonResult.fail("未查到用户信息");
+		}
+		if (user.getId()<3){
+			return CommonResult.fail("无权限查询");
+		}
+		QueryWrapper<SmartGrade> queryWrapper1 = new QueryWrapper<>();
+		queryWrapper1.eq("deleted", 0);
+        List<SmartGrade> grades = smartGradeService.list(queryWrapper1);
+		List<GradeBook> gradeBookList = new ArrayList<>();
+		for (int i = 0; i < grades.size(); i++) {
+			GradeBook gradeBook = new GradeBook();
+			gradeBook.setGradeName(grades.get(i).getName());
+			QueryWrapper<SmartClass> queryWrapper2 = new QueryWrapper<>();
+			queryWrapper2.eq("deleted", 0);
+			queryWrapper2.eq("grade_id", grades.get(i).getId());
+			List<SmartClass> classes = smartClassService.list(queryWrapper2);
+			List<ClassBook> classBookList = new ArrayList<>();
+			for (int j = 0; j < classes.size(); j++) {
+				ClassBook classBook = new ClassBook();
+				classBook.setClassName(classes.get(j).getName());
+				QueryWrapper<SmartUser> queryWrapper3 = new QueryWrapper<>();
+				queryWrapper3.eq("deleted", 0);
+				queryWrapper3.eq("is_cancel", 0);
+				queryWrapper3.eq("school_class", classes.get(j).getId());
+				queryWrapper3.eq("identity_id", 2);
+				List<SmartUser> users = smartUserService.list(queryWrapper3);
+				List<BookUser> bookUserList = new ArrayList<>();
+				for (int k = 0; k < users.size(); k++) {
+					if (Objects.equals(users.get(k).getSchoolClass(), user.getSchoolClass())){
+						String ob = JSONObject.toJSONString(users.get(k));
+						BookUser bookUser = JSONObject.parseObject(ob, BookUser.class);;
+						QueryWrapper<SmartUser> queryWrapper4 = new QueryWrapper<>();
+						queryWrapper4.eq("deleted", 0);
+						queryWrapper4.eq("is_cancel", 0);
+						queryWrapper4.eq("affiliate", users.get(k).getId());
+						queryWrapper4.eq("identity_id", 1);
+						List<SmartUser> usersPrarent = smartUserService.list(queryWrapper4);
+						bookUser.setUserParents(usersPrarent);
+						bookUserList.add(bookUser);
+					}
+				}
+				classBook.setBookUserList(bookUserList);
+				classBookList.add(classBook);
+			}
+			gradeBook.setClassBookList(classBookList);
+			gradeBookList.add(gradeBook);
+		}
+		return CommonResult.ok(gradeBookList);
+	}
+    
 }

+ 2 - 1
src/main/java/com/template/mapper/SmartFaceDiscernMapper.java

@@ -3,6 +3,7 @@ package com.template.mapper;
 import com.template.model.pojo.SmartFaceDiscern;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
 
 /**
  * <p>
@@ -12,7 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
  * @author ceshi
  * @since 2024-01-18
  */
-@Mapper
+@Repository
 public interface SmartFaceDiscernMapper extends BaseMapper<SmartFaceDiscern> {
 
 }

+ 2 - 1
src/main/java/com/template/mapper/SmartUserMapper.java

@@ -1,6 +1,7 @@
 package com.template.mapper;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.template.model.dto.WarningUserDto;
 import com.template.model.pojo.SmartUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -31,7 +32,7 @@ public interface SmartUserMapper extends BaseMapper<SmartUser> {
 
     IPage<GradeVo> querySmartSecordPage(IPage<GradeVo> page, @Param("name") String name);
 
-    IPage<UserVo> warningUserList(Page<UserVo> page,@Param("departmentIds") List<Integer> departmentIds,@Param("name") String name);
+    IPage<WarningUserDto> warningUserList(Page<UserVo> page, @Param("name") String name);
 
     List<SmartUser> warningPushList();
 

+ 10 - 0
src/main/java/com/template/model/dto/WarningDeletePushDto.java

@@ -0,0 +1,10 @@
+package com.template.model.dto;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class WarningDeletePushDto {
+    private List<Integer> ids;
+}

+ 19 - 0
src/main/java/com/template/model/dto/WarningUserDto.java

@@ -0,0 +1,19 @@
+package com.template.model.dto;
+
+import lombok.Data;
+
+@Data
+public class WarningUserDto {
+
+    private Integer id;
+
+    private String cardNo;
+
+    private String name;
+
+    private String departmentName;
+
+
+
+
+}

+ 18 - 0
src/main/java/com/template/model/phoneBook/BookUser.java

@@ -0,0 +1,18 @@
+package com.template.model.phoneBook;
+
+import com.template.model.pojo.SmartUser;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="classBook对象", description="")
+public class BookUser extends SmartUser {
+    
+    public List<SmartUser> userParents;
+}

+ 19 - 0
src/main/java/com/template/model/phoneBook/ClassBook.java

@@ -0,0 +1,19 @@
+package com.template.model.phoneBook;
+
+import com.template.model.pojo.SmartUser;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="classBook对象", description="")
+public class ClassBook {
+
+    public String className;
+    public List<BookUser> bookUserList;
+}

+ 19 - 0
src/main/java/com/template/model/phoneBook/GradeBook.java

@@ -0,0 +1,19 @@
+package com.template.model.phoneBook;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.List;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="gradeBook对象", description="")
+public class GradeBook {
+
+    public String gradeName;
+    public List<ClassBook> classBookList;
+
+}

+ 51 - 0
src/main/java/com/template/model/pojo/SmartDataTaskErr.java

@@ -0,0 +1,51 @@
+package com.template.model.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 数据源操作日志
+ * </p>
+ *
+ * @author ceshi
+ * @since 2023-12-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="SmartDataTaskErr对象", description="数据源任务错误管理")
+public class SmartDataTaskErr implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "主键id")
+    @TableId(value = "e_id", type = IdType.AUTO)
+    private Integer eId;
+
+    @ApiModelProperty(value = "出错的任务id")
+    private Integer eTaskId;
+
+    @ApiModelProperty(value = "错误文本")
+    private String eMsg;
+
+    @ApiModelProperty(value = "发生错误次数")
+    private Integer eNum;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "发生错误时间")
+    private String eDateTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "创建时间")
+    private Date eCreateTime;
+}

+ 5 - 2
src/main/java/com/template/services/SmartUserService.java

@@ -1,5 +1,6 @@
 package com.template.services;
 
+import com.template.model.dto.WarningUserDto;
 import com.template.model.pojo.SmartUser;
 import com.template.model.pojo.SmartUser;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -38,7 +39,7 @@ public interface SmartUserService extends IService<SmartUser> {
 
     int deleteSmartUserByIds(List<Integer> ids);
 
-    SmartUser getSmartById(int id);
+    List<SmartUser> getSmartUserList(List<Integer> ids);
 
     List<AffiliateUserVo> queryAffiliateUserById(@Param("id") Integer id);
 
@@ -51,7 +52,7 @@ public interface SmartUserService extends IService<SmartUser> {
     List<SmartUser> queryStudentDatas();
 	List<SmartUser> queryStudentBySchoolClass(Integer schoolClass);
 
-    PageUtils<UserVo> warningUserList(int currentPage, int pageCount, List<Integer> departmentIds, String name);
+    PageUtils<WarningUserDto> warningUserList(int currentPage, int pageCount, String name);
 
     List<SmartUser> warningPushList();
 
@@ -65,4 +66,6 @@ public interface SmartUserService extends IService<SmartUser> {
      * @return
      */
     SmartUser queryUserInfo(String name,String cardNo,String idCard);
+
+    SmartUser getSmartById(Integer id);
 }

+ 8 - 8
src/main/java/com/template/services/impl/SmartFaceDiscernServiceImpl.java

@@ -52,7 +52,7 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
     private Integer size = 20;
 
 //    @Scheduled(cron = "0 0/30 * * * ? ")
-    public void baiS()  {
+    public void baiS() {
         try {
             getFaceDiscern(page, size);
         } catch (Exception e) {
@@ -82,12 +82,13 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
         LocalDateTime endTime = now.withHour(23).withMinute(59).withSecond(59);
 //        开始时间
         data.put("record_begintime", stateTime.format(dateTimeFormatter1));
+//        data.put("record_begintime", "2024-01-22 00:00:00");
 //        结束时间
         data.put("record_endtime", endTime.format(dateTimeFormatter1));
-
+//        data.put("record_endtime", "2024-01-22 23:59:59");
 
         String dataString = data.toJSONString();
-        System.out.println(dataString);
+
 //        加密
         String aesStr = URLEncoder.encode(AesTestOne.encrypt(dataString, appSecret), "UTF-8");
 
@@ -159,14 +160,13 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
 //                    判断是否已经添加
                     LambdaQueryWrapper<SmartFaceDiscern> wrapperFD = new LambdaQueryWrapper<>();
                     wrapperFD.eq(SmartFaceDiscern::getDateTime, recordAddtime)
-                            .eq(SmartFaceDiscern::getId, smartUser.getId());
+                            .eq(SmartFaceDiscern::getUserId, smartUser.getId());
                     SmartFaceDiscern one = this.getOne(wrapperFD);
 
                     if (ObjectUtils.isEmpty(one)) {
                         this.save(smartFaceDiscern);
                     }
 
-
                 }
 
             }
@@ -177,9 +177,9 @@ public class SmartFaceDiscernServiceImpl extends ServiceImpl<SmartFaceDiscernMap
     @Override
     public List<SmartFaceDiscern> track(String stateTime, String endTime, Integer id) {
 
-        LambdaQueryWrapper<SmartFaceDiscern> wrapper=new LambdaQueryWrapper<>();
-        wrapper.between(SmartFaceDiscern::getDateTime,stateTime,endTime)
-                .eq(SmartFaceDiscern::getUserId,id)
+        LambdaQueryWrapper<SmartFaceDiscern> wrapper = new LambdaQueryWrapper<>();
+        wrapper.between(SmartFaceDiscern::getDateTime, stateTime, endTime)
+                .eq(SmartFaceDiscern::getUserId, id)
                 .orderByDesc(SmartFaceDiscern::getDateTime);
 
         List<SmartFaceDiscern> list = this.list(wrapper);

+ 13 - 3
src/main/java/com/template/services/impl/SmartUserServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.template.mapper.SmartUserMapper;
+import com.template.model.dto.WarningUserDto;
 import com.template.model.enumModel.eIdentityStatu;
 import com.template.model.pojo.SmartUser;
 import com.template.model.result.PageUtils;
@@ -144,7 +145,7 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
     }
 
     @Override
-    public SmartUser getSmartById(int id) {
+    public SmartUser getSmartById(Integer id) {
         QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
         queryWrapper.eq("is_cancel", 0);
         queryWrapper.eq("id", id);
@@ -168,11 +169,11 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
     }
 
     @Override
-    public PageUtils<UserVo> warningUserList(int currentPage, int pageCount, List<Integer> departmentIds, String name) {
+    public PageUtils<WarningUserDto> warningUserList(int currentPage, int pageCount, String name) {
         Page<UserVo> page = new Page<>();
         page.setCurrent(currentPage);
         page.setSize(pageCount);
-        IPage<UserVo> result = smartUserMapper.warningUserList(page, departmentIds, name);
+        IPage<WarningUserDto> result = smartUserMapper.warningUserList(page, name);
         return new PageUtils(result);
     }
 
@@ -197,4 +198,13 @@ public class SmartUserServiceImpl extends ServiceImpl<SmartUserMapper, SmartUser
         return result;
     }
 
+    @Override
+    public List<SmartUser> getSmartUserList(List<Integer> ids) {
+        QueryWrapper<SmartUser> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("is_cancel", 0);
+        queryWrapper.in("id", ids);
+        List<SmartUser> result = smartUserMapper.selectList(queryWrapper);
+        return result;
+    }
+
 }

+ 17 - 12
src/main/resources/mapper/template/SmartUserMapper.xml

@@ -117,22 +117,27 @@
         </if>
     </select>
 
-    <select id="warningUserList" resultType="com.template.model.vo.UserVo">
-        select *
-        from smart_user
-        where deleted = 0 and is_cancel = 0
-        <if test="departmentIds != null and departmentIds.size() > 0">
-            and department_id in
-            <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
-                ${departmentId}
-            </foreach>
-        </if>
+    <select id="warningUserList" resultType="com.template.model.dto.WarningUserDto">
+        SELECT
+        su.id AS id,
+        su.`name` AS `name`,
+        su.card_no AS cardNo,
+        sd.`name` AS departmentName
+        FROM
+        `smart_user` su
+        LEFT JOIN smart_department sd ON sd.id = su.department_id and sd.deleted=0
+        where su.deleted = 0 and su.is_cancel = 0
         <if test="name != null and name != ''">
-            and name like '%' #{name} '%'
+            and su.`name` like '%' #{name} '%'
         </if>
     </select>
+
     <select id="warningPushList" resultType="com.template.model.pojo.SmartUser">
-        SELECT * FROM `smart_user` WHERE is_push=1 and is_cancel=0 and deleted = 0
+        SELECT *
+        FROM `smart_user`
+        WHERE is_push = 1
+          and is_cancel = 0
+          and deleted = 0
     </select>
 
 

+ 17 - 12
target/classes/mapper/template/SmartUserMapper.xml

@@ -117,22 +117,27 @@
         </if>
     </select>
 
-    <select id="warningUserList" resultType="com.template.model.vo.UserVo">
-        select *
-        from smart_user
-        where deleted = 0 and is_cancel = 0
-        <if test="departmentIds != null and departmentIds.size() > 0">
-            and department_id in
-            <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
-                ${departmentId}
-            </foreach>
-        </if>
+    <select id="warningUserList" resultType="com.template.model.dto.WarningUserDto">
+        SELECT
+        su.id AS id,
+        su.`name` AS `name`,
+        su.card_no AS cardNo,
+        sd.`name` AS departmentName
+        FROM
+        `smart_user` su
+        LEFT JOIN smart_department sd ON sd.id = su.department_id and sd.deleted=0
+        where su.deleted = 0 and su.is_cancel = 0
         <if test="name != null and name != ''">
-            and name like '%' #{name} '%'
+            and su.`name` like '%' #{name} '%'
         </if>
     </select>
+
     <select id="warningPushList" resultType="com.template.model.pojo.SmartUser">
-        SELECT * FROM `smart_user` WHERE is_push=1 and is_cancel=0 and deleted = 0
+        SELECT *
+        FROM `smart_user`
+        WHERE is_push = 1
+          and is_cancel = 0
+          and deleted = 0
     </select>