Browse Source

Merge branch 'dev' into feature-cloud

RaoMeng 6 years ago
parent
commit
272ab7634b
100 changed files with 961 additions and 361 deletions
  1. 45 0
      applications/device/device-client/config/inno.iss
  2. 46 4
      applications/device/device-client/pom.xml
  3. 2 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/init/IcCardInitializer.java
  4. 2 0
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/AccessControlService.java
  5. 25 23
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/IcCardService.java
  6. 2 2
      applications/device/device-client/src/main/resources/application.yml
  7. 15 0
      applications/device/device-client/src/main/resources/banner.txt
  8. BIN
      applications/device/device-client/src/main/resources/icon.ico
  9. BIN
      applications/device/device-client/src/main/winserver/deviceclient.exe
  10. 0 14
      applications/device/device-client/src/main/winserver/deviceclient.xml
  11. 13 0
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/config/DahuaProperties.java
  12. 171 69
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaLibrary.java
  13. 40 2
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaSdk.java
  14. 3 0
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java
  15. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libInfra.so
  16. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libNetFramework.so
  17. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStream.so
  18. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStreamSvr.so
  19. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libavnetsdk.so
  20. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhconfigsdk.so
  21. BIN
      applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhnetsdk.so
  22. 1 0
      applications/device/device-sdk-dahua/src/main/resources/win32-x86-64/manifest.txt
  23. 5 5
      applications/device/device-server/pom.xml
  24. 1 1
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/config/RestTemplateConfig.java
  25. 1 1
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/controller/AccessControlController.java
  26. 4 2
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/AccessControlRecordMapper.java
  27. 3 3
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java
  28. 15 8
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/IcCardServiceImpl.java
  29. 4 1
      applications/device/device-server/src/main/resources/application.yml
  30. 4 1
      applications/device/device-server/src/main/resources/config/application-docker-cloud.yml
  31. 4 1
      applications/device/device-server/src/main/resources/config/application-docker-prod.yml
  32. 4 0
      applications/device/device-server/src/main/resources/mapper/AccessControlRecordMapper.xml
  33. 2 2
      applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml
  34. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java
  35. 18 26
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/CurriculumServiceImpl.java
  36. 3 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  37. 2 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java
  38. 5 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/HomeWorkServiceImpl.java
  39. 4 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/exception/BizExceptionCode.java
  40. 1 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/CurriculumMapper.java
  41. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java
  42. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysTeacherMapper.java
  43. 22 14
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxClazzCurriculumServiceImpl.java
  44. 7 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java
  45. 2 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
  46. 7 2
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
  47. 24 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java
  48. 2 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
  49. 8 3
      applications/school/school-server/src/main/resources/mapper/CurriculumMapper.xml
  50. 1 1
      applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml
  51. 5 5
      applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml
  52. 4 0
      applications/school/school-server/src/main/resources/mapper/SysTeacherMapper.xml
  53. 4 1
      applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WechatApi.java
  54. 2 1
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/TransfersController.java
  55. 3 4
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java
  56. 17 15
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/ReceiveService.java
  57. 2 5
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java
  58. 2 2
      frontend/pc-web/app/util/BaseUtil.js
  59. 1 9
      frontend/pc-web/app/view/Interaction/homework/Release.js
  60. 15 0
      frontend/pc-web/app/view/Interaction/homework/ReleaseModel.js
  61. 7 1
      frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js
  62. 15 0
      frontend/pc-web/app/view/Interaction/notice/SchoolNoticeModel.js
  63. 36 6
      frontend/pc-web/app/view/Interaction/timetable/Detail.js
  64. 8 10
      frontend/pc-web/app/view/Interaction/timetable/DetailModel.js
  65. 21 5
      frontend/pc-web/app/view/Interaction/timetable/List.js
  66. 1 1
      frontend/pc-web/app/view/auth/Login.js
  67. 2 2
      frontend/pc-web/app/view/basic/staff/StaffDetail.js
  68. 1 1
      frontend/pc-web/app/view/basic/student/StudentDetail.js
  69. 5 1
      frontend/pc-web/app/view/core/form/field/DetailGridField.js
  70. 1 0
      frontend/pc-web/app/view/core/form/field/FileField.js
  71. 1 1
      frontend/pc-web/app/view/main/Main.js
  72. 8 8
      frontend/pc-web/app/view/main/Main.scss
  73. 2 2
      frontend/pc-web/app/view/main/MainController.js
  74. 6 15
      frontend/pc-web/app/view/setting/operatelog/OperateLog.js
  75. 1 1
      frontend/pc-web/index.html
  76. 53 3
      frontend/pc-web/overrides/form/field/ComboBox.js
  77. BIN
      frontend/pc-web/resources/images/auth-background.jpg
  78. BIN
      frontend/pc-web/resources/images/default/logo-default.png
  79. BIN
      frontend/pc-web/resources/images/favicon.png
  80. BIN
      frontend/pc-web/resources/images/login-text-img.png
  81. BIN
      frontend/pc-web/resources/images/zhihuixiaoyuan.png
  82. 0 4
      frontend/pc-web/resources/json/navigation.json
  83. 2 4
      frontend/wechat-web/src/components/PhonesItem.jsx
  84. 2 2
      frontend/wechat-web/src/configs/api.config.js
  85. 2 1
      frontend/wechat-web/src/configs/router.config.js
  86. 81 8
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.css
  87. 0 3
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.js
  88. 55 0
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail1.jsx
  89. 1 1
      frontend/wechat-web/src/modules/hiPages/approvel-detail/ItemApprovel.js
  90. 6 0
      frontend/wechat-web/src/modules/hiPages/approvel/Approvel.css
  91. 12 3
      frontend/wechat-web/src/modules/hiPages/approvel/Approvel.js
  92. 1 0
      frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js
  93. 4 4
      frontend/wechat-web/src/modules/home/HomePage.jsx
  94. 22 11
      frontend/wechat-web/src/modules/homework/AssignmentDetailPage.js
  95. 1 1
      frontend/wechat-web/src/modules/leave/LeaveAddCPage.js
  96. 2 2
      frontend/wechat-web/src/modules/leave/LeaveItem.js
  97. 7 0
      frontend/wechat-web/src/modules/leave/LeaveListPage.css
  98. 16 11
      frontend/wechat-web/src/modules/leave/LeaveListPage.js
  99. 2 2
      frontend/wechat-web/src/style/css/consume-re.css
  100. 0 1
      frontend/wechat-web/src/style/css/phones.css

+ 45 - 0
applications/device/device-client/config/inno.iss

@@ -0,0 +1,45 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#define MyAppName "device-client"
+#define MyAppVersion "1.0.0.0"
+#define MyAppPublisher "usoftchina.com"
+#define MyAppURL "https://www.usoftchina.com/"
+#define MyAppExeName "device-client.exe"
+
+[Setup]
+; NOTE: The value of AppId uniquely identifies this application.
+; Do not use the same AppId value in installers for other applications.
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
+AppId={{B53F1479-C51D-4EC5-9E67-C6A0D6705E75}
+AppName={#MyAppName}
+AppVersion={#MyAppVersion}
+;AppVerName={#MyAppName} {#MyAppVersion}
+AppPublisher={#MyAppPublisher}
+AppPublisherURL={#MyAppURL}
+AppSupportURL={#MyAppURL}
+AppUpdatesURL={#MyAppURL}
+DefaultDirName={pf}\{#MyAppName}
+DisableProgramGroupPage=yes
+OutputBaseFilename=setup
+SetupIconFile=F:\workspace\smartschool-platform\applications\device\device-client\src\main\resources\icon.ico
+Compression=lzma
+SolidCompression=yes
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "F:\workspace\smartschool-platform\applications\device\device-client\target\device-client.exe"; DestDir: "{app}"; Flags: ignoreversion
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+
+[Run]
+Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
+

+ 46 - 4
applications/device/device-client/pom.xml

@@ -39,13 +39,13 @@
         </dependency>
         <!-- JSON -->
         <dependency>
-          <groupId>com.alibaba</groupId>
-          <artifactId>fastjson</artifactId>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
         </dependency>
         <!-- httpClient -->
         <dependency>
-          <groupId>org.apache.httpcomponents</groupId>
-          <artifactId>httpclient</artifactId>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
         </dependency>
     </dependencies>
     <build>
@@ -54,6 +54,48 @@
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
+            <plugin>
+                <groupId>com.akathist.maven.plugins.launch4j</groupId>
+                <artifactId>launch4j-maven-plugin</artifactId>
+                <version>1.7.25</version>
+                <executions>
+                    <execution>
+                        <id>l4j</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>launch4j</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <jar>${project.build.directory}/${artifactId}-${version}.jar</jar>
+                    <headerType>console</headerType>
+                    <outfile>${project.build.directory}/device-client.exe</outfile>
+                    <downloadUrl>http://java.com/download</downloadUrl>
+                    <classPath>
+                        <mainClass>org.springframework.boot.loader.JarLauncher</mainClass>
+                    </classPath>
+                    <icon>src/main/resources/icon.ico</icon>
+                    <stayAlive>true</stayAlive>
+                    <restartOnCrash>true</restartOnCrash>
+                    <jre>
+                        <minVersion>1.8.0</minVersion>
+                        <jdkPreference>preferJre</jdkPreference>
+                    </jre>
+                    <versionInfo>
+                        <fileVersion>1.0.0.0</fileVersion>
+                        <txtFileVersion>${project.version}</txtFileVersion>
+                        <fileDescription>${project.name}</fileDescription>
+                        <copyright>2018 usoftchina.com</copyright>
+                        <productVersion>1.0.0.0</productVersion>
+                        <txtProductVersion>1.0.0.0</txtProductVersion>
+                        <productName>${project.name}</productName>
+                        <companyName>usoftchina.com</companyName>
+                        <internalName>device-client</internalName>
+                        <originalFilename>device-client.exe</originalFilename>
+                    </versionInfo>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>

+ 2 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/init/IcCardInitializer.java

@@ -5,11 +5,13 @@ import com.usoftchina.smartschool.device.client.po.IcCard;
 import com.usoftchina.smartschool.device.client.service.IcCardService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
 
 /**
  * @author yingp
  * @date 2019/3/11
  */
+@Component
 public class IcCardInitializer implements CommandLineRunner {
 
     @Autowired

+ 2 - 0
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/AccessControlService.java

@@ -100,6 +100,8 @@ public class AccessControlService {
      * @param info
      */
     public void saveRecord(AccessControlInfo info) {
+        //去除cardNo末尾中的\u0000...\u0000
+        info.setCardNo(info.getCardNo().trim());
         ResponseEntity<Result> response = restTemplate.postForEntity(
                 deviceServerProperties.getAccessControlEvent(), info, Result.class);
         if (response.getStatusCode() == HttpStatus.OK) {

+ 25 - 23
applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/IcCardService.java

@@ -57,7 +57,7 @@ public class IcCardService {
             + "from XF_AccTransDetail_push left join XF_AccHead on XF_AccTransDetail_push.AccNo=XF_AccHead.AccNo left join Tx_EmpCard on Tx_EmpCard.CardID=XF_AccHead.CardID "
             + "left join RS_EMP ON RS_EMP.EmpSysID=XF_AccHead.EmpSysID where XF_AccTransDetail_push.SendStatus=? order by AccTransDay desc";
 
-    private static final String updateSql = "update XF_AccTransDetail_push set SendStatus = ? where GUID in (?)";
+    private static final String updateSql = "update XF_AccTransDetail_push set SendStatus = ? where GUID in (";
 
     public IcCard find() {
         return icCardRepository.find();
@@ -75,46 +75,48 @@ public class IcCardService {
         dynamicDataSourceRegister.createDataSource(card);
     }
 
-    @Scheduled(fixedRate = 1000 * 60, initialDelay = 5000)
+    @Scheduled(fixedRate = 1000 * 20, initialDelay = 5000)
     public void dataTask() {
         IcCard card = find();
         School school = schoolService.find();
         if (null != card && dynamicDataSourceRegister.contains(card) && null != school) {
             DynamicDataSourceContextHolder.set(card);
             try {
-                doTask();
+                doTask(school.getName());
             } finally {
                 DynamicDataSourceContextHolder.clear();
             }
         }
     }
 
-    private void doTask(){
+    private void doTask(String schoolName){
         //1.准备本次需要传输的数据->转移至中间表
         jdbcTemplate.execute(insertSql);
         //2.获取本次传输的数据
         List<AccTransDetail> resultList = jdbcTemplate.query(getDataSql, new BeanPropertyRowMapper<>(AccTransDetail.class), "待上传");
-        //3.传输
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
-        MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
-        requestEntity.add("data", JSON.toJSONString(resultList));
-        requestEntity.add("school", schoolService.find().getName());
-        HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity<>(requestEntity, headers);
-        ResponseEntity<Result> response = restTemplate.postForEntity(targetURL, resultList, Result.class);
-        if (response.getStatusCode() == HttpStatus.OK) {
-            Result<String> result = response.getBody();
-            if (!result.isSuccess()) {
-                ExceptionCode.ERROR_UNKNOWN.occur(result.getMessage());
-            }else {
-                //更新发送的数据
-                String ids = result.getData();
-                if (!StringUtils.isEmpty(ids)){
-                    jdbcTemplate.update(updateSql, "已上传", ids);
+        if (resultList.size() > 0) {
+            //3.传输
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+            MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
+            requestEntity.add("data", JSON.toJSONString(resultList));
+            requestEntity.add("school", schoolName);
+            HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity<>(requestEntity, headers);
+            ResponseEntity<Result> response = restTemplate.postForEntity(targetURL, httpEntity, Result.class);
+            if (response.getStatusCode() == HttpStatus.OK) {
+                Result<String> result = response.getBody();
+                if (!result.isSuccess()) {
+                    ExceptionCode.ERROR_UNKNOWN.occur(result.getMessage());
+                } else {
+                    //更新发送的数据
+                    String ids = result.getData();
+                    if (!StringUtils.isEmpty(ids)) {
+                        jdbcTemplate.update(updateSql + ids + ")", "已上传");
+                    }
                 }
+            } else {
+                ExceptionCode.ERROR_UNKNOWN.occur("IC卡消费记录发送失败");
             }
-        } else {
-            ExceptionCode.ERROR_UNKNOWN.occur("IC卡消费记录发送失败");
         }
     }
 }

+ 2 - 2
applications/device/device-client/src/main/resources/application.yml

@@ -4,10 +4,10 @@ device:
     connect-time: 10000
   server:
   # 门禁事件的服务端接口
-    accessControlEvent: https://school-api.ydyhz.com/api/device/accesscontrol/event
+    accessControlEvent: https://school-api.ubtob.com/api/device/accesscontrol/event
   # IC卡传输的服务端接口
   icCard:
-    icCardUrl: https://school-api.ydyhz.com/api/device/iccard/consume/record
+    icCardUrl: https://school-api.ubtob.com/api/device/iccard/consume/record
 server:
   tomcat:
     uri-encoding: UTF-8

+ 15 - 0
applications/device/device-client/src/main/resources/banner.txt

@@ -0,0 +1,15 @@
+${AnsiColor.BRIGHT_YELLOW}
+
+88        88   ad88888ba     ,ad8888ba,    88888888888  888888888888  ,ad8888ba,   88        88  88  888b      88         db
+88        88  d8"     "8b   d8"'    `"8b   88                88      d8"'    `"8b  88        88  88  8888b     88        d88b
+88        88  Y8,          d8'        `8b  88                88     d8'            88        88  88  88 `8b    88       d8'`8b
+88        88  `Y8aaaaa,    88          88  88aaaaa           88     88             88aaaaaaaa88  88  88  `8b   88      d8'  `8b
+88        88    `"""""8b,  88          88  88"""""           88     88             88""""""""88  88  88   `8b  88     d8YaaaaY8b
+88        88          `8b  Y8,        ,8P  88                88     Y8,            88        88  88  88    `8b 88    d8""""""""8b
+Y8a.    .a8P  Y8a     a8P   Y8a.    .a8P   88                88      Y8a.    .a8P  88        88  88  88     `8888   d8'        `8b
+ `"Y8888Y"'    "Y88888P"     `"Y8888Y"'    88                88       `"Y8888Y"'   88        88  88  88      `888  d8'          `8b
+
+
+Application Version: ${application.version}${application.formatted-version}
+Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
+${AnsiColor.DEFAULT}

BIN
applications/device/device-client/src/main/resources/icon.ico


BIN
applications/device/device-client/src/main/winserver/deviceclient.exe


+ 0 - 14
applications/device/device-client/src/main/winserver/deviceclient.xml

@@ -1,14 +0,0 @@
-<service>
-    <id>deviceclient</id>
-    <name>device client</name>
-    <description>client server for smart school platform</description>
-    <!-- java环境变量 -->
-    <env name="JAVA_HOME" value="%JAVA_HOME%"/>
-    <executable>java</executable>
-    <arguments>-jar "E:\springboot\ test.jar"</arguments>
-    <!-- 开机启动 -->
-    <startmode>Automatic</startmode>
-    <!-- 日志配置 -->
-    <logpath>%BASE%\log</logpath>
-    <logmode>rotate</logmode>
-</service>

+ 13 - 0
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/config/DahuaProperties.java

@@ -20,6 +20,11 @@ public class DahuaProperties {
      */
     private int connectTime = 10000;
 
+    /**
+     * DLL资源路径
+     */
+    private String library;
+
     public int getWaitTime() {
         return waitTime;
     }
@@ -35,4 +40,12 @@ public class DahuaProperties {
     public void setConnectTime(int connectTime) {
         this.connectTime = connectTime;
     }
+
+    public String getLibrary() {
+        return library;
+    }
+
+    public void setLibrary(String library) {
+        this.library = library;
+    }
 }

+ 171 - 69
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaLibrary.java

@@ -7,10 +7,11 @@ import com.sun.jna.Structure;
 import com.sun.jna.ptr.IntByReference;
 import com.sun.jna.win32.StdCallLibrary;
 
+import java.nio.charset.Charset;
 import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
+import java.util.Arrays;
 import java.util.Date;
 
 /**
@@ -20,6 +21,10 @@ import java.util.Date;
  * @date 2019/3/7
  */
 public interface DahuaLibrary extends Library {
+    /**
+     * 默认编码
+     */
+    Charset DEFAULT_CHARSET = Charset.forName("GBK");
     /**
      * 通用字符串长度4
      */
@@ -283,66 +288,70 @@ public interface DahuaLibrary extends Library {
     /**
      * 登陆网络环境设置
      */
-    @Structure.FieldOrder({"bReserved", "byNetType", "byPlaybackBufSize", "byReserved1", "nConnectBufSize",
-            "nConnectTime", "nConnectTryNum", "nGetConnInfoTime", "nGetDevInfoTime", "nPicBufSize", "nSearchRecordTime",
-            "nWaittime", "nsubConnectSpaceTime", "nsubDisconnetTime"})
+    @Structure.FieldOrder({"nWaittime", "nConnectTime", "nConnectTryNum", "nSubConnectSpaceTime", "nGetDevInfoTime",
+            "nConnectBufSize", "nGetConnInfoTime", "nSearchRecordTime", "nsubDisconnetTime", "byNetType",
+            "byPlaybackBufSize", "bDetectDisconnTime", "bKeepLifeInterval", "nPicBufSize", "bReserved"})
     class NET_PARAM extends Structure {
         /**
-         * 保留字段
+         * 等待超时时间(毫秒为单位),为0默认5000ms
          */
-        public byte[] bReserved = new byte[4];
+        public int nWaittime;
         /**
-         * 网络类型,0-LAN, 1-WAN
+         * 连接超时时间(毫秒为单位),为0默认1500ms
          */
-        public byte byNetType;
+        public int nConnectTime;
         /**
-         * 回放数据接收缓冲大小(M为单位),为0默认为4M
+         * 连接尝试次数,为0默认1次
          */
-        public byte byPlaybackBufSize;
+        public int nConnectTryNum;
         /**
-         * 保留字段
+         * 子连接之间的等待时间(毫秒为单位),为0默认10ms
          */
-        public byte[] byReserved1 = new byte[2];
+        public int nSubConnectSpaceTime;
+        /**
+         * 获取设备信息超时时间,为0默认1000ms
+         */
+        public int nGetDevInfoTime;
         /**
          * 每个连接接收数据缓冲大小(字节为单位),为0默认250*1024
          */
         public int nConnectBufSize;
         /**
-         * 连接超时时间(毫秒为单位),为0默认1500ms
+         * 获取子连接信息超时时间(毫秒为单位),为0默认1000ms
          */
-        public int nConnectTime;
+        public int nGetConnInfoTime;
         /**
-         * 连接尝试次数,为0默认1次
+         * 按时间查询录像文件的超时时间(毫秒为单位),为0默认为3000ms
          */
-        public int nConnectTryNum;
+        public int nSearchRecordTime;
         /**
-         * 获取子连接信息超时时间(毫秒为单位),为0默认1000ms
+         * 检测子链接断线等待时间(毫秒为单位),为0默认为60000ms
          */
-        public int nGetConnInfoTime;
+        public int nsubDisconnetTime;
         /**
-         * 获取设备信息超时时间,为0默认1000ms
+         * 网络类型,0-LAN, 1-WAN
          */
-        public int nGetDevInfoTime;
+        public byte byNetType;
         /**
-         * 实时图片接收缓冲大小(字节为单位),为0默认为2*1024*1024
+         * 回放数据接收缓冲大小(M为单位),为0默认为4M
          */
-        public int nPicBufSize;
+        public byte byPlaybackBufSize;
         /**
-         * 按时间查询录像文件的超时时间(毫秒为单位),为0默认为3000ms
+         * 心跳检测断线时间(单位为秒),为0默认为60s,最小时间为2s
          */
-        public int nSearchRecordTime;
+        public byte bDetectDisconnTime;
         /**
-         * 等待超时时间(毫秒为单位),为0默认5000ms
+         * 心跳包发送间隔(单位为秒),为0默认为10s,最小间隔为2s
          */
-        public int nWaittime;
+        public byte bKeepLifeInterval;
         /**
-         * 子连接之间的等待时间(毫秒为单位),为0默认10ms
+         * 实时图片接收缓冲大小(字节为单位),为0默认为2*1024*1024
          */
-        public int nsubConnectSpaceTime;
+        public int nPicBufSize;
         /**
-         * 检测子链接断线等待时间(毫秒为单位),为0默认为60000ms
+         * 保留字段
          */
-        public int nsubDisconnetTime;
+        public byte[] bReserved = new byte[4];
     }
 
     /**
@@ -704,25 +713,13 @@ public interface DahuaLibrary extends Library {
     /**
      * 设备信息
      */
-    @Structure.FieldOrder({"Reserved", "bReserved", "byLeftLogTimes", "byLimitLoginTime", "nAlarmInPortNum",
-            "nAlarmOutPortNum", "nChanNum", "nDVRType", "nDiskNum", "nLockLeftTime", "sSerialNumber"})
+    @Structure.FieldOrder({"sSerialNumber", "nAlarmInPortNum", "nAlarmOutPortNum", "nDiskNum", "nDVRType",
+            "nChanNum", "byLimitLoginTime", "byLeftLogTimes", "bReserved", "nLockLeftTime", "Reserved"})
     class NET_DEVICEINFO_Ex extends Structure {
         /**
-         * 保留
-         */
-        public byte[] Reserved = new byte[24];
-        /**
-         * 保留字节
-         */
-        public byte[] bReserved = new byte[2];
-        /**
-         * 当登陆失败原因为密码错误时,通过此参数通知用户,剩余登陆次数,为0时表示此参数无效
-         */
-        public byte byLeftLogTimes;
-        /**
-         * 在线超时时间,为0表示不限制登陆,非0表示限制的分钟数
+         * 序列号
          */
-        public byte byLimitLoginTime;
+        public byte[] sSerialNumber = new byte[DH_SERIALNO_LEN];
         /**
          * DVR报警输入个数
          */
@@ -732,9 +729,9 @@ public interface DahuaLibrary extends Library {
          */
         public int nAlarmOutPortNum;
         /**
-         * DVR通道个数
+         * DVR硬盘个数
          */
-        public int nChanNum;
+        public int nDiskNum;
         /**
          * DVR类型
          *
@@ -742,17 +739,46 @@ public interface DahuaLibrary extends Library {
          */
         public int nDVRType;
         /**
-         * DVR硬盘个数
+         * DVR通道个数
          */
-        public int nDiskNum;
+        public int nChanNum;
+        /**
+         * 在线超时时间,为0表示不限制登陆,非0表示限制的分钟数
+         */
+        public byte byLimitLoginTime;
+        /**
+         * 当登陆失败原因为密码错误时,通过此参数通知用户,剩余登陆次数,为0时表示此参数无效
+         */
+        public byte byLeftLogTimes;
+        /**
+         * 保留字节
+         */
+        public byte[] bReserved = new byte[2];
         /**
          * 当登陆失败,用户解锁剩余时间(秒数), -1表示设备未设置该参数
          */
         public int nLockLeftTime;
         /**
-         * 序列号
+         * 保留
          */
-        public byte[] sSerialNumber = new byte[DH_SERIALNO_LEN];
+        public byte[] Reserved = new byte[24];
+
+        @Override
+        public String toString() {
+            return "NET_DEVICEINFO_Ex{" +
+                    "sSerialNumber=" + new String(sSerialNumber) +
+                    ", nAlarmInPortNum=" + nAlarmInPortNum +
+                    ", nAlarmOutPortNum=" + nAlarmOutPortNum +
+                    ", nDiskNum=" + nDiskNum +
+                    ", nDVRType=" + nDVRType +
+                    ", nChanNum=" + nChanNum +
+                    ", byLimitLoginTime=" + (byLimitLoginTime & 0xff) +
+                    ", byLeftLogTimes=" + (byLeftLogTimes & 0xff) +
+                    ", bReserved=" + new String(bReserved) +
+                    ", nLockLeftTime=" + nLockLeftTime +
+                    ", Reserved=" + Arrays.toString(Reserved) +
+                    '}';
+        }
     }
 
     /**
@@ -862,10 +888,10 @@ public interface DahuaLibrary extends Library {
         @Override
         public String toString() {
             return "DH_EVENT_FILE_INFO{" +
-                    "bCount=" + bCount +
-                    ", bIndex=" + bIndex +
-                    ", bFileTag=" + bFileTag +
-                    ", bFileType=" + bFileType +
+                    "bCount=" + (bCount & 0xff) +
+                    ", bIndex=" + (bIndex & 0xff) +
+                    ", bFileTag=" + (bFileTag & 0xff) +
+                    ", bFileType=" + (bFileType & 0xff) +
                     ", stuFileTime=" + stuFileTime +
                     ", nGroupId=" + nGroupId +
                     '}';
@@ -1445,6 +1471,7 @@ public interface DahuaLibrary extends Library {
                     ", PTS=" + PTS +
                     ", UTC=" + UTC +
                     ", nEventID=" + nEventID +
+                    ", stuObject=" + stuObject +
                     ", stuFileInfo=" + stuFileInfo +
                     ", emEventType=" + emEventType +
                     ", bStatus=" + bStatus +
@@ -1463,8 +1490,8 @@ public interface DahuaLibrary extends Library {
                     ", emAttendanceState=" + emAttendanceState +
                     ", szClassNumber=" + new String(szClassNumber) +
                     ", szPhoneNumber=" + new String(szPhoneNumber) +
-                    ", szCardName=" + new String(szCardName) +
-                    ", uSimilarity=" + uSimilarity +
+                    ", szCardName=" + new String(szCardName, DEFAULT_CHARSET) +
+                    ", uSimilarity=" + (uSimilarity & 0x0ffffffff) +
                     '}';
         }
     }
@@ -1474,10 +1501,20 @@ public interface DahuaLibrary extends Library {
      */
     @Structure.FieldOrder({"left", "top", "right", "bottom"})
     class DH_RECT extends Structure {
-        public long left;
-        public long top;
-        public long right;
-        public long bottom;
+        public NativeLong left;
+        public NativeLong top;
+        public NativeLong right;
+        public NativeLong bottom;
+
+        @Override
+        public String toString() {
+            return "DH_RECT{" +
+                    "left=" + left.longValue() +
+                    ", top=" + top.longValue() +
+                    ", right=" + right.longValue() +
+                    ", bottom=" + bottom.longValue() +
+                    '}';
+        }
     }
 
     /**
@@ -1487,6 +1524,14 @@ public interface DahuaLibrary extends Library {
     class DH_POINT extends Structure {
         public short nx;
         public short ny;
+
+        @Override
+        public String toString() {
+            return "DH_POINT{" +
+                    "nx=" + nx +
+                    ", ny=" + ny +
+                    '}';
+        }
     }
 
     /**
@@ -1511,11 +1556,11 @@ public interface DahuaLibrary extends Library {
         /**
          * 图片宽度, 单位:像素
          */
-        public int wWidth;
+        public short wWidth;
         /**
          * 图片高度, 单位:像素
          */
-        public int wHeight;
+        public short wHeight;
         /**
          * 文件路径
          */
@@ -1534,6 +1579,21 @@ public interface DahuaLibrary extends Library {
          * 小图左上角在大图的位置,使用绝对坐标系
          */
         public DH_POINT stuPoint;
+
+        @Override
+        public String toString() {
+            return "DH_PIC_INFO{" +
+                    "dwOffSet=" + dwOffSet +
+                    ", dwFileLenth=" + dwFileLenth +
+                    ", wWidth=" + wWidth +
+                    ", wHeight=" + wHeight +
+                    ", pszFilePath='" + pszFilePath + '\'' +
+                    ", bIsDetected=" + bIsDetected +
+                    ", bReserved=" + new String(bReserved) +
+                    ", nFilePathLen=" + nFilePathLen +
+                    ", stuPoint=" + stuPoint +
+                    '}';
+        }
     }
 
     /**
@@ -1792,11 +1852,11 @@ public interface DahuaLibrary extends Library {
         /**
          * 车辆子品牌 需要通过映射表得到真正的子品牌 映射表详见开发手册
          */
-        public int wColorLogoIndex;
+        public short wColorLogoIndex;
         /**
          * 车辆子品牌 需要通过映射表得到真正的子品牌 映射表详见开发手册
          */
-        public int wSubBrand;
+        public short wSubBrand;
         public byte byReserved1;
         /**
          * 是否有物体对应图片文件信息
@@ -1854,11 +1914,11 @@ public interface DahuaLibrary extends Library {
         /**
          * 开始时文件偏移, 单位: 字节(物体开始出现时,视频帧在原始视频文件中相对于文件起始处的偏移)
          */
-        public int nBeginFileOffset;
+        public long nBeginFileOffset;
         /**
          * 结束时文件偏移, 单位: 字节(物体消逝时,视频帧在原始视频文件中相对于文件起始处的偏移)
          */
-        public int nEndFileOffset;
+        public long nEndFileOffset;
         /**
          * 物体颜色相似度,取值范围:0-100,数组下标值代表某种颜色,详见EM_COLOR_TYPE
          */
@@ -1882,7 +1942,49 @@ public interface DahuaLibrary extends Library {
         /**
          * 车辆品牌年款 需要通过映射表得到真正的年款 映射表详见开发手册
          */
-        public int wBrandYear;
+        public short wBrandYear;
+
+        @Override
+        public String toString() {
+            return "DH_MSG_OBJECT{" +
+                    "nObjectID=" + nObjectID +
+                    ", szObjectType=" + new String(szObjectType) +
+                    ", nConfidence=" + nConfidence +
+                    ", nAction=" + nAction +
+                    ", BoundingBox=" + BoundingBox +
+                    ", Center=" + Center +
+                    ", nPolygonNum=" + nPolygonNum +
+                    ", Contour=" + Arrays.toString(Contour) +
+                    ", rgbaMainColor=" + rgbaMainColor +
+                    ", szText=" + new String(szText) +
+                    ", szObjectSubType=" + new String(szObjectSubType) +
+                    ", wColorLogoIndex=" + wColorLogoIndex +
+                    ", wSubBrand=" + wSubBrand +
+                    ", byReserved1=" + byReserved1 +
+                    ", bPicEnble=" + bPicEnble +
+                    ", stPicInfo=" + stPicInfo +
+                    ", bShotFrame=" + bShotFrame +
+                    ", bColor=" + bColor +
+                    ", byReserved2=" + byReserved2 +
+                    ", byTimeType=" + byTimeType +
+                    ", stuCurrentTime=" + stuCurrentTime +
+                    ", stuStartTime=" + stuStartTime +
+                    ", stuEndTime=" + stuEndTime +
+                    ", stuOriginalBoundingBox=" + stuOriginalBoundingBox +
+                    ", stuSignBoundingBox=" + stuSignBoundingBox +
+                    ", dwCurrentSequence=" + dwCurrentSequence +
+                    ", dwBeginSequence=" + dwBeginSequence +
+                    ", dwEndSequence=" + dwEndSequence +
+                    ", nBeginFileOffset=" + nBeginFileOffset +
+                    ", nEndFileOffset=" + nEndFileOffset +
+                    ", byColorSimilar=" + new String(byColorSimilar) +
+                    ", byUpperBodyColorSimilar=" + new String(byUpperBodyColorSimilar) +
+                    ", byLowerBodyColorSimilar=" + new String(byLowerBodyColorSimilar) +
+                    ", nRelativeID=" + nRelativeID +
+                    ", szSubText=" + new String(szSubText) +
+                    ", wBrandYear=" + wBrandYear +
+                    '}';
+        }
     }
 
     /**

+ 40 - 2
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaSdk.java

@@ -11,9 +11,17 @@ import com.usoftchina.smartschool.device.event.DeviceDisconnectEvent;
 import com.usoftchina.smartschool.device.event.DeviceReconnectEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.util.StreamUtils;
+import org.springframework.util.StringUtils;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
+import java.io.File;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 
 /**
  * @author yingp
@@ -31,10 +39,40 @@ public class DahuaSdk {
      */
     private int tryTimes = 1;
 
+    /**
+     * 拷贝DLL资源到临时目录,解决fat jar无法加载DLL问题
+     *
+     * @return
+     */
+    private String createTempLibraries() {
+        try {
+            String tempDir = Files.createTempDirectory("dahua-lib-").toFile().getCanonicalPath();
+            String manifest = StreamUtils.copyToString(
+                    new ClassPathResource(Platform.RESOURCE_PREFIX + File.separator + "manifest.txt").getInputStream(),
+                    Charset.defaultCharset());
+            String[] names = manifest.split(",");
+            for (String name : names) {
+                if (StringUtils.hasText(name)) {
+                    Path tempLib = Paths.get(tempDir, name);
+                    Files.copy(new ClassPathResource(Platform.RESOURCE_PREFIX + File.separator + name).getInputStream(),
+                            tempLib);
+                }
+            }
+            return tempDir;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return Platform.RESOURCE_PREFIX;
+    }
+
     public DahuaSdk(DahuaProperties properties) {
         this.properties = properties;
-        this.instance = Native.load(Platform.RESOURCE_PREFIX +
-                (Platform.isWindows() ? "/dhnetsdk" : "/libdhnetsdk"), DahuaLibrary.class);
+        String libDir = properties.getLibrary();
+        if (StringUtils.isEmpty(libDir)) {
+            libDir = createTempLibraries();
+        }
+        this.instance = Native.load(libDir + File.separator +
+                (Platform.isWindows() ? "dhnetsdk" : "libdhnetsdk"), DahuaLibrary.class);
     }
 
     public DahuaLibrary getInstance() {

+ 3 - 0
applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java

@@ -63,6 +63,9 @@ public class DahuaDataAnalyzeService {
                  */
                 case DahuaEvents.EVENT_IVS_ACCESS_CTL:
                     DEV_EVENT_ACCESS_CTL_INFO info = new DEV_EVENT_ACCESS_CTL_INFO(pAlarmInfo);
+                    if (logger.isDebugEnabled()) {
+                        logger.debug(info.toString());
+                    }
                     AccessControlInfo accessControlInfo = new AccessControlInfo();
                     if (dwBufSize > 0) {
                         accessControlInfo.setImageData(pBuffer.getByteArray(0, dwBufSize));

BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libInfra.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libNetFramework.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStream.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libStreamSvr.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libavnetsdk.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhconfigsdk.so


BIN
applications/device/device-sdk-dahua/src/main/resources/linux-amd64/libdhnetsdk.so


+ 1 - 0
applications/device/device-sdk-dahua/src/main/resources/win32-x86-64/manifest.txt

@@ -0,0 +1 @@
+aacdec.dll,adpcmdec.dll,amrdec.dll,armenc64.dll,avnetsdk.dll,dhconfigsdk.dll,dhconfigsdk.lib,dhnetsdk.dll,dhnetsdk.lib,dhplay.dll,fisheye.dll,g729dec.dll,g7221dec.dll,h26ldec.dll,h264dec.dll,hevcdec.dll,HWDec.dll,Infra.dll,IvsDrawer.dll,Json.dll,MCL_FPTZ.dll,mjpegdec.dll,mp2dec.dll,mp3dec.dll,mpeg4dec.dll,NetFramework.dll,postproc.dll,Stream.dll,StreamSvr.dll,svac_dec.dll,swscale.dll,VTHStack.dll

+ 5 - 5
applications/device/device-server/pom.xml

@@ -12,13 +12,9 @@
     <artifactId>device-server</artifactId>
 
     <dependencies>
-        <dependency>
-            <groupId>net.java.dev.jna</groupId>
-            <artifactId>jna</artifactId>
-        </dependency>
         <dependency>
             <groupId>com.usoftchina.smartschool</groupId>
-            <artifactId>device-sdk-dahua</artifactId>
+            <artifactId>device-sdk</artifactId>
         </dependency>
         <dependency>
             <groupId>com.usoftchina.smartschool</groupId>
@@ -60,6 +56,10 @@
             <artifactId>test-starter</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>device-core</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 1 - 1
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/config/RestTemplateConfig.java

@@ -1,4 +1,4 @@
-package com.usoftchina.smartschool.device.client.config;
+package com.usoftchina.smartschool.device.config;
 
 import org.apache.http.client.HttpClient;
 import org.apache.http.config.Registry;

+ 1 - 1
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/controller/AccessControlController.java

@@ -58,7 +58,7 @@ public class AccessControlController {
      * @return
      */
     @PostMapping("/event")
-    public Result onAccessControlEvent(AccessControlInfo info) {
+    public Result onAccessControlEvent(@RequestBody AccessControlInfo info) {
         accessControlService.onAccessControlEvent(info);
         return Result.success();
     }

+ 4 - 2
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/mapper/AccessControlRecordMapper.java

@@ -1,7 +1,9 @@
 package com.usoftchina.smartschool.device.mapper;
 
+import com.netflix.ribbon.proxy.annotation.ClientProperties;
 import com.usoftchina.smartschool.device.po.AccessControlRecord;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.Date;
 import java.util.List;
@@ -22,6 +24,6 @@ public interface AccessControlRecordMapper {
      * @param endDate
      * @return
      */
-    List<AccessControlRecord> selectByStuNumberAndDate(String stuNumber, Date beginDate,
-                                                     Date endDate);
+    List<AccessControlRecord> selectByStuNumberAndDate(@Param("name") String stuNumber,@Param("begin") Date beginDate,
+                                                       @Param("end") Date endDate);
 }

+ 3 - 3
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java

@@ -94,7 +94,7 @@ public class AccessControlServiceImpl implements AccessControlService{
         record.setRecord_type(type);
         record.setStu_id(studentInfo.getStuId());
         record.setStu_number(studentInfo.getStuNumber());
-        record.setRecord_name(studentInfo.getStuName() + (type == 1 ? "进" : "出去"));
+        record.setRecord_name(studentInfo.getStuName() + (type == 1 ? "进" : "出去"));
         accessControlRecordMapper.insertRecordSelective(record);
         /**
          * 3、推送消息到消息服务器(微信服务监听此消息发送微信消息)
@@ -104,10 +104,10 @@ public class AccessControlServiceImpl implements AccessControlService{
         msg.setSecret(studentInfo.getSecret());
         msg.setTouser(studentInfo.getOpenId());
         msg.setTemplateId(accessControlTemplateId);
-        msg.setTitle("出入校提醒");
+        msg.setTitle((type == 1 ? "入" : "出") + "校提醒");
         msg.setKeyword1(studentInfo.getStuName());
         msg.setKeyword2(DateUtils.format());
-        msg.setRemark("您好! 你的孩子: " + studentInfo.getStuName() + (type == 1 ? " 进人" : " 出去") + "学校");
+        msg.setRemark("您好! 你的孩子: " + studentInfo.getStuName() + (type == 1 ? " 进入" : " 离开") + "学校");
         wechatApi.sendMsg(msg);
     }
 

+ 15 - 8
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/IcCardServiceImpl.java

@@ -1,7 +1,7 @@
 package com.usoftchina.smartschool.device.service.impl;
 
 import com.alibaba.fastjson.JSON;
-import com.usoftchina.smartschool.device.base.Result;
+import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.device.dto.AccTransDetail;
 import com.usoftchina.smartschool.device.mapper.IcCardMapper;
 import com.usoftchina.smartschool.device.po.Transaction;
@@ -9,15 +9,13 @@ import com.usoftchina.smartschool.device.service.IcCardService;
 import com.usoftchina.smartschool.school.dto.SysSchoolDTO;
 import com.usoftchina.smartschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.utils.http.HmacUtils;
+import com.usoftchina.smartschool.wechat.api.WechatApi;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.*;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.util.LinkedMultiValueMap;
-import org.springframework.util.MultiValueMap;
 import org.springframework.util.StringUtils;
 import org.springframework.web.client.RestTemplate;
-import org.springframework.web.util.DefaultUriBuilderFactory;
 
 import java.net.URI;
 import java.text.SimpleDateFormat;
@@ -38,7 +36,11 @@ public class IcCardServiceImpl implements IcCardService {
     @Autowired
     private IcCardMapper icCardMapper;
 
-    private final String targetURL = "https://school-api.ydyhz.com/api/wechat/send/Messages";
+    @Autowired
+    private WechatApi wechatApi;
+
+    @Value("${smartschool.wechat.pushUrl}")
+    private String targetURL;
 
     public String consumePush(List<AccTransDetail> accTransDetailList, String school){
         List<MessageInfoDTO> messageInfoList = new ArrayList<MessageInfoDTO>();
@@ -80,7 +82,12 @@ public class IcCardServiceImpl implements IcCardService {
                 messageInfoList.add(messageInfo);
             });
             //3.传输
-            HttpHeaders headers = new HttpHeaders();
+            Result result = wechatApi.sendOutMessages(JSON.toJSONString(messageInfoList));
+            if (result.isSuccess()) {
+                String ids = "'" + sb.substring(0, sb.length() - 1).replaceAll(",", "','") + "'";
+                return ids;
+            }
+            /*HttpHeaders headers = new HttpHeaders();
             headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
             MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>();
             requestEntity.add("data", JSON.toJSONString(messageInfoList));
@@ -97,7 +104,7 @@ public class IcCardServiceImpl implements IcCardService {
                     String ids = "'" + sb.substring(0, sb.length() - 1).replaceAll(",", "','") + "'";
                     return ids;
                 }
-            }
+            }*/
         }
         return null;
     }

+ 4 - 1
applications/device/device-server/src/main/resources/application.yml

@@ -73,4 +73,7 @@ hystrix:
                         timeoutInMilliseconds: 4000
 mybatis:
   type-aliases-package: com.usoftchina.smartschool.device.po
-  mapper-locations: classpath:mapper/*.xml
+  mapper-locations: classpath:mapper/*.xml
+smartschool:
+  wechat:
+    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages

+ 4 - 1
applications/device/device-server/src/main/resources/config/application-docker-cloud.yml

@@ -20,4 +20,7 @@ spring:
         maximum-pool-size: 50
         idle-timeout: 30000
         max-lifetime: 1800000
-        connection-timeout: 30000
+        connection-timeout: 30000
+smartschool:
+  wechat:
+    pushUrl: https://school-api.ydyhz.com/api/wechat/send/Messages

+ 4 - 1
applications/device/device-server/src/main/resources/config/application-docker-prod.yml

@@ -12,4 +12,7 @@ spring:
     password: select111***
   redis:
     host: 10.10.100.166
-    port: 6379
+    port: 6379
+smartschool:
+  wechat:
+    pushUrl: https://school-api.ubtob.com/api/wechat/send/Messages

+ 4 - 0
applications/device/device-server/src/main/resources/mapper/AccessControlRecordMapper.xml

@@ -106,4 +106,8 @@
         </trim>
     </insert>
 
+    <select id="selectByStuNumberAndDate" resultType="com.usoftchina.smartschool.device.po.AccessControlRecord">
+        select * from  out_in_record where  stu_name=#{name}
+    </select>
+
 </mapper>

+ 2 - 2
applications/device/device-server/src/main/resources/mapper/StudentInfoMapper.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.usoftchina.smartschool.device.mapper.AccessControlRecordMapper" >
+<mapper namespace="com.usoftchina.smartschool.device.mapper.StudentInfoMapper" >
     <select id="selectInfoByCardNo" parameterType="string" resultMap="studentInfo">
         select school_appid,school_secret,sys_parents.openid,sys_student.stu_name,sys_student.stu_id,sys_school.school_id,
          stu_number,sys_student.clazz_id,stu_class,stu_grade,stu_classnickname,stu_sex from sys_student left join sys_school on sys_student.school_id=sys_school.school_id
         left join sys_parents_stu on sys_student.stu_id=sys_parents_stu.stu_id left join sys_parents on sys_parents.parent_id =
-        sys_parents_stu.parent_id where stu_cardNo = #{cardNo}
+        sys_parents_stu.parent_id where stu_cardNo = #{cardNo} and  ifnull(openid,'') != ''
     </select>
 
     <resultMap id="studentInfo" type="com.usoftchina.smartschool.device.po.StudentInfo" >

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java

@@ -86,7 +86,7 @@ public class ClassServiceImpl implements ClassService{
         for (SysTeacherClazz detail : teachers) {
             detail.setClazz_id(clazz.getClazz_id());
             Integer count = 0;
-            count = sysClazzMapper.teacherClazz(detail.getTeacher_id(),detail.getClazz_id());
+            count = sysClazzMapper.teacherClazz(detail.getSubject_name(),clazz.getClazz_id());
             if(count > 0){
                 throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
             }

+ 18 - 26
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/CurriculumServiceImpl.java

@@ -100,9 +100,6 @@ public class CurriculumServiceImpl implements CurriculumService {
         if (curriculumDetailDTO.getFri().equals(subjectDO.getSubjectId().toString())){
             curriculumDetailDTO.setFri(subjectDO.getSubjectName());
         }
-        if (curriculumDetailDTO.getSat().equals(subjectDO.getSubjectId().toString())){
-            curriculumDetailDTO.setSat(subjectDO.getSubjectName());
-        }
     }
 
     /**
@@ -126,9 +123,6 @@ public class CurriculumServiceImpl implements CurriculumService {
         if (curriculumDetailDTO.getFri().equals(subjectDO.getSubjectName())){
             curriculumDetailDTO.setFri(subjectDO.getSubjectId().toString());
         }
-        if (curriculumDetailDTO.getSat().equals(subjectDO.getSubjectName())){
-            curriculumDetailDTO.setSat(subjectDO.getSubjectId().toString());
-        }
     }
 
     @Override
@@ -175,6 +169,8 @@ public class CurriculumServiceImpl implements CurriculumService {
                     if (curriculumDetailDTO.getId() != null && 0 != curriculumDetailDTO.getId()) {
                         updateList.add(curriculumDetailDTO);
                     } else {
+                        curriculumDetailDTO.setmId(main.getId());
+                        curriculumDetailDTO.setStatus(0);
                         insertList.add(curriculumDetailDTO);
                     }
                 }
@@ -247,7 +243,7 @@ public class CurriculumServiceImpl implements CurriculumService {
                     DataImportDetail singleDataImportDetail = dataImportMapper.selectMainBycode(key, id, schoolId);
                     CurriculumDTO curriculumDTO = JSON.parseObject(singleDataImportDetail.getDd_maindata(), CurriculumDTO.class);
                     //更新数据,将中文转换成ID
-                    curriculumDTO.setStatus("1");
+                    curriculumDTO.setStatus("0");
                     curriculumDTO.setCreateTime(new Date());
                     curriculumDTO.setClazzId(String.valueOf(clazzId));
                     curriculumDTO.setSchoolId(schoolId);
@@ -256,27 +252,25 @@ public class CurriculumServiceImpl implements CurriculumService {
                     //插入主表数据
                     curriculumMapper.insertSelective(curriculumDTO);
                     Long mainId = curriculumDTO.getId();
+                    int detno = 1;
+                    List<CurriculumDetailDTO> curriculumDetailDTOList = new ArrayList<>();
                     for (DataImportDetail dataImportDetail : dataImportDetailList) {
-                        List<CurriculumDetailDTO> curriculumDetailDTOList = JsonUtils.fromJsonArray(dataImportDetail.getDd_detaildata(), CurriculumDetailDTO.class);
+                        CurriculumDetailDTO curriculumDetailDTO = JsonUtils.fromJsonString(dataImportDetail.getDd_detaildata(), CurriculumDetailDTO.class);
                         //插入明细表数据
                         //1. 替换课程名称为ID
                         List<SubjectDO> subjectDOList = curriculumMapper.selectSubject(schoolId);
-                        Iterator<CurriculumDetailDTO> detailIterator = curriculumDetailDTOList.iterator();
-                        int detno = 1;
-                        while (detailIterator.hasNext()){
-                            CurriculumDetailDTO curriculumDetailDTO = detailIterator.next();
-                            curriculumDetailDTO.setmId(mainId);
-                            curriculumDetailDTO.setStatus(1);
-                            curriculumDetailDTO.setSchoolId(schoolId);
-                            curriculumDetailDTO.setClazzId(clazzId);
-                            curriculumDetailDTO.setLessons(detno++);
-                            List<String> subNameList = subjectDOList.stream().map(SubjectDO::getSubjectName).collect(Collectors.toList());
-                            checkExists(curriculumDetailDTO, subNameList);
-                            subjectDOList.forEach(subjectDO -> { convertToId(curriculumDetailDTO, subjectDO); });
-                        }
-                        //2. 插入
-                        curriculumMapper.insertDetailSelective(curriculumDetailDTOList);
+                        curriculumDetailDTO.setmId(mainId);
+                        curriculumDetailDTO.setStatus(1);
+                        curriculumDetailDTO.setSchoolId(schoolId);
+                        curriculumDetailDTO.setClazzId(clazzId);
+                        curriculumDetailDTO.setLessons(detno++);
+                        List<String> subNameList = subjectDOList.stream().map(SubjectDO::getSubjectName).collect(Collectors.toList());
+                        checkExists(curriculumDetailDTO, subNameList);
+                        subjectDOList.forEach(subjectDO -> { convertToId(curriculumDetailDTO, subjectDO); });
+                        curriculumDetailDTOList.add(curriculumDetailDTO);
                     }
+                    //2. 插入
+                    curriculumMapper.insertDetailSelective(curriculumDetailDTOList);
                 }
             }
         }
@@ -304,9 +298,6 @@ public class CurriculumServiceImpl implements CurriculumService {
         if (!subNameList.contains(curriculumDetailDTO.getFri())) {
             throw new BizException(BizExceptionCode.NOT_EXISTS_SUBJECT.getCode(), String.format(BizExceptionCode.NOT_EXISTS_SUBJECT.getMessage(), curriculumDetailDTO.getFri()));
         }
-        if (!subNameList.contains(curriculumDetailDTO.getSat())) {
-            throw new BizException(BizExceptionCode.NOT_EXISTS_SUBJECT.getCode(), String.format(BizExceptionCode.NOT_EXISTS_SUBJECT.getMessage(), curriculumDetailDTO.getSat()));
-        }
     }
 
     @Override
@@ -315,6 +306,7 @@ public class CurriculumServiceImpl implements CurriculumService {
             return;
         }
         curriculumMapper.updateByPublish(id);
+        curriculumMapper.updateByPublishFrom(id);
     }
 
     @Override

+ 3 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java

@@ -200,7 +200,9 @@ public class StudentServiceImpl implements StudentService{
                         json.put("stu_sex", 1);
                     }else if ("女".equals(json.get("stu_sex"))) {
                         json.put("stu_sex", 2);
-                    };
+                    }else if(!"男".equals(json.get("stu_sex")) && !"女".equals(json.get("stu_sex"))){
+                        throw new BizException(BizExceptionCode.ILLEGAL_Gender);
+                    }
                 }
 
                 SysStudent stu = JSONObject.parseObject(json.toJSONString(), SysStudent.class);

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/TeacherServiceImpl.java

@@ -146,9 +146,9 @@ public class TeacherServiceImpl implements TeacherService{
 
                         if ("已婚".equals(json.get("teacher_marriage"))) {
                             json.put("teacher_marriage", 0);
-                        }else if ("".equals(json.get("teacher_marriage"))) {
+                        }else if ("未婚".equals(json.get("teacher_marriage"))) {
                             json.put("teacher_marriage", 1);
-                        }else if (!"已婚".equals(json.get("teacher_marriage")) && !"".equals(json.get("teacher_marriage"))) {
+                        }else if (!"已婚".equals(json.get("teacher_marriage")) && !"未婚".equals(json.get("teacher_marriage"))) {
                             throw new BizException(BizExceptionCode.ILLEGAL_MARRIAGE);
                         }
                     }

+ 5 - 4
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/HomeWorkServiceImpl.java

@@ -10,10 +10,7 @@ import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
 import com.usoftchina.smartschool.school.exception.BizExceptionCode;
-import com.usoftchina.smartschool.school.mapper.HomeWorkMapper;
-import com.usoftchina.smartschool.school.mapper.SysClazzMapper;
-import com.usoftchina.smartschool.school.mapper.SysGradeMapper;
-import com.usoftchina.smartschool.school.mapper.SysStudentMapper;
+import com.usoftchina.smartschool.school.mapper.*;
 import com.usoftchina.smartschool.school.po.HomeWork;
 import com.usoftchina.smartschool.school.po.SysClazz;
 import com.usoftchina.smartschool.school.po.SysGrade;
@@ -40,6 +37,8 @@ public class HomeWorkServiceImpl implements HomeWorkService{
     private SysClazzMapper sysClazzMapper;
     @Autowired
     private SysStudentMapper sysStudentMapper;
+    @Autowired
+    private SysTeacherMapper sysTeacherMapper;
 
     @Override
     public DocBaseDTO save(HomeWork formdata) {
@@ -57,6 +56,8 @@ public class HomeWorkServiceImpl implements HomeWorkService{
             //获取时间
             Calendar calendar= Calendar.getInstance();
             formdata.setCreate_date(calendar.getTime());
+            Long Creator = sysTeacherMapper.taskCreator(formdata.getTask_creator());
+            formdata.setTask_creator(Creator);
             homeWorkMapper.insertSelective(formdata);
         } else {
             //更新

+ 4 - 4
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/exception/BizExceptionCode.java

@@ -17,7 +17,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     NONCLAZZ(500005, "班级名称不存在"),
     REPEAT_TEACHER_NUMBER(500006, "教师工号重复"),
     NONSTU(500006, "学生不存在"),
-    EXISTS_TEACHER(500004,"存在教师,无法删除"),
+    EXISTS_TEACHER(500004,"存在任课教师,无法删除"),
     EXISTS_CURRICULUM(500005,"存在课表,无法删除"),
     EXISTS_TEACHER_CLASS(500006,"存在任课班级,无法删除"),
     TEACHERS_EXISTS_CLASS(500006,"%s存在任课班级,无法删除"),
@@ -25,15 +25,15 @@ public enum BizExceptionCode implements BaseExceptionCode {
     EXISTS_SCORE_PUBLISH(5000013, "存在已发布成绩,禁止删除"),
     EXISTS_CLASS(500011, "存在班级,无法删除"),
     HOMEWORK_RELEASE(500012, "存在发布作业,无法删除"),
-    REPEAT_SUBJECTS(600001, "老师已在这个班任教"),
+    REPEAT_SUBJECTS(600001, "课程已存在"),
     REPEAT_GRADE_NAME(600001, "年级名称重复"),
     REPEAT_CLASS_NAME(600002, "班级名称重复"),
     REPEAT_STUDENT_NUMBER(600003, "学生学号不可重复"),
     TASK_RELEASE_STATUS(600005, "作业已发布无法更改"),
     COURSE_RELEASE_STATUS(600006, "课程表已生效,无法删除"),
-    NOTICE_RELEASE_STATUS(600007, "学校发布已生效,无法删除"),
+    NOTICE_RELEASE_STATUS(600007, "学校通知已生效,无法删除"),
     ILLEGAL_Gender(600007, "无效性别"),
-    ILLEGAL_MARRIAGE(600008, "婚姻状态无效"),
+    ILLEGAL_MARRIAGE(600008, "婚姻状态无效,应为:已婚或未婚"),
     NOT_EXISTS_SUBJECT(60005, "科目<u>%s</u>不存在");
 
 

+ 1 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/CurriculumMapper.java

@@ -91,6 +91,7 @@ public interface CurriculumMapper {
      * @return
      */
     int updateByPublish(Long id);
+    int updateByPublishFrom(Long id);
 
     /**
      * 取消发布

+ 1 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java

@@ -35,5 +35,5 @@ public interface SysClazzMapper {
 
     int countClazz(@Param("clazz_name") String clazz_name, @Param("clazz_grade") String clazz_grade, @Param("school_id") Long school_id);
 
-    Integer teacherClazz(@Param("teacher_id") Long teacher_id,@Param("clazz_id") Long clazz_id );
+    Integer teacherClazz(@Param("subject_name") String subject_name, @Param("clazz_id") Long clazz_id);
 }

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysTeacherMapper.java

@@ -42,4 +42,6 @@ public interface SysTeacherMapper {
     int checkTeacher(@Param("teacher_id") Long teacher_id);
 
     void deleteDetail(@Param("teacher_clazz_id") Long teacher_clazz_id);
+
+    Long taskCreator(@Param("user_id") Long user_id);
 }

+ 22 - 14
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxClazzCurriculumServiceImpl.java

@@ -14,10 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 @Service
@@ -123,23 +120,34 @@ public class WxClazzCurriculumServiceImpl implements WxClazzCurriculumService {
 	private Map<String,Object> getDetail(ClazzCurriculumDO cc,Long subjectId){
 		SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
 		Map<String, Object> hashMap = new HashMap<>();
-		hashMap.put("startTime",dateFormat.format(cc.getCurStartTime()));
-		hashMap.put("endTime",dateFormat.format(cc.getCurEndTime()));
+		Date curStartTime = cc.getCurStartTime();
+		if (ObjectUtils.isNotEmpty(curStartTime)){
+			hashMap.put("startTime",dateFormat.format(curStartTime));
+		}
+		Date curEndTime = cc.getCurEndTime();
+		if (ObjectUtils.isNotEmpty(curEndTime)){
+			hashMap.put("endTime",dateFormat.format(curEndTime));
+		}
+
 		SubjectDO subjectDO = subjectMapper.get(subjectId);
 		if (ObjectUtils.isNotEmpty(subjectDO)){
 			hashMap.put("subjectName",subjectDO.getSubjectName());
 		}
-		TeacherClazzDO teacher1 = wxTeacherClazzMapper.getTeacher(cc.getClazzId(), subjectId);
-		if (ObjectUtils.isNotEmpty(teacher1)){
-			Long teacherId = teacher1.getTeacherId();
-			if (ObjectUtils.isNotEmpty(teacherId)){
-				TeacherDO teacherDO1 = wxTeacherMapper.get(teacherId);
-				if (ObjectUtils.isNotEmpty(teacherDO1)){
-					hashMap.put("teacherName",teacherDO1.getTeacherName());
-					hashMap.put("teacherPhoto",teacherDO1.getTeacherPhoto());
+		Long clazzId = cc.getClazzId();
+		if (ObjectUtils.isNotEmpty(clazzId)){
+			TeacherClazzDO teacher1 = wxTeacherClazzMapper.getTeacher(clazzId, subjectId);
+			if (ObjectUtils.isNotEmpty(teacher1)){
+				Long teacherId = teacher1.getTeacherId();
+				if (ObjectUtils.isNotEmpty(teacherId)){
+					TeacherDO teacherDO1 = wxTeacherMapper.get(teacherId);
+					if (ObjectUtils.isNotEmpty(teacherDO1)){
+						hashMap.put("teacherName",teacherDO1.getTeacherName());
+						hashMap.put("teacherPhoto",teacherDO1.getTeacherPhoto());
+					}
 				}
 			}
 		}
+
 		return hashMap;
 	}
 }

+ 7 - 4
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java

@@ -49,11 +49,14 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	public String createMeeting(String jsonMeeting) throws Exception {
 		JSONObject json = JSONObject.parseObject(jsonMeeting);
 		MeetingDO meetingDO = new MeetingDO();
-		meetingDO.setMeetingName(json.getString("meetingName"));
-		meetingDO.setMeetingDetails(json.getString("meetingDetails"));
+		String meetingName = json.getString("meetingName");
+		meetingDO.setMeetingName(meetingName);
+		String meetingDetails = json.getString("meetingDetails");
+		meetingDO.setMeetingDetails(meetingDetails);
 		Long creator = json.getLong("meetingCreator");
 		meetingDO.setMeetingCreator(creator);
-		meetingDO.setMeetingAddress(json.getString("meetingAddress"));
+		String meetingAddress = json.getString("meetingAddress");
+		meetingDO.setMeetingAddress(meetingAddress);
 		meetingDO.setCreateDate(new Date());
 		Date startDate = DateFormatUtil.string2Date(json.getString("startDate"));
 		meetingDO.setStartDate(startDate);
@@ -98,7 +101,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 							TemplateDO templateDO = wxTemplateMapper.getByAppid(schoolAppid);
 							if (ObjectUtils.isNotEmpty(templateDO)){
 								String temMeeting = templateDO.getTemMeeting();
-								wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , temMeeting, "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情",  wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
+								wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , temMeeting, "您好,您有一条新的会议通知", meetingName, simpleDateFormat.format(meetingDO.getStartDate()), meetingAddress, "-", "点击查看详情",  wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+l);
 
 							}
 

+ 2 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java

@@ -102,6 +102,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 					notifyrecordsMapper.save(notifyrecordsDO);
 					TeacherDO teacherDO = teacherMapper.get(l);
 					SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
+					String schoolName = schoolDO.getSchoolName();
 					String teacherName = teacherMapper.get(notifyCreator).getTeacherName();
 					if (ObjectUtils.isNotEmpty(schoolDO)){
 						String schoolAppid = schoolDO.getSchoolAppid();
@@ -110,7 +111,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 							if (ObjectUtils.isNotEmpty(templateDO)){
 								String temNotify = templateDO.getTemNotify();
 								try {
-									wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), temNotify, "您好,您有一条通知", schoolDO.getSchoolName(),teacherName,format.format(new Date()),notifyDetails, "点击查看详情", wechatUrl + "/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
+									wxPushApi.wxPush(schoolDO.getSchoolAppid(),schoolDO.getSchoolSecret(),teacherDO.getOpenid(), temNotify, "您好,您有一条通知",schoolName ,teacherName,format.format(new Date()),notifyDetails, "点击查看详情", wechatUrl + "/notifyDetail/teacher/"+notifyDO.getNotifyId()+"?teacherId="+l);
 								}catch (Exception e){
 									e.printStackTrace();
 								}

+ 7 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java

@@ -41,6 +41,9 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
     @Autowired
     private WxTemplateMapper wxTemplateMapper;
 
+    @Autowired
+    private WxClazzMapper wxClazzMapper;
+
     @Value("${smartschool.domain.wechat}")
     private String wechatUrl;
 
@@ -87,7 +90,9 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
                 for (Long teacherId : longs) {
                     TeacherDO teacherDO = teacherMapper.get(teacherId);
                     SchoolDO schoolDO = wxSchoolMapper.get(teacherDO.getSchoolId());
-                    String stuName = studentMapper.get(lvProposer).getStuName();
+                    StudentDO studentDO = studentMapper.get(lvProposer);
+                    String stuName = studentDO.getStuName();
+                    String clazzName = wxClazzMapper.get(studentDO.getClazzId()).getClazzName();
                     SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                     String date =format.format(leave.getStartDate())  + "至" + format.format(leave.getEndDate());
                     if (ObjectUtils.isNotEmpty(schoolDO)){
@@ -97,7 +102,7 @@ public class WxOaLeaveServiceImpl implements WxOaLeaveService {
                             if (ObjectUtils.isNotEmpty(templateDO)){
                                 String temLeave = templateDO.getTemLeave();
                                 try {
-                                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(), temLeave,"您好,学生的请假申请", stuName+";", date+";", leave.getLvDetails()+";", "-", "点击查看详情", wechatUrl + "/leavedetail/teacher/" + leave.getLvId());
+                                    wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(), teacherDO.getOpenid(), temLeave,"您好,学生的请假申请", format.format(new Date()),clazzName , stuName, lvDetails, "点击查看详情", wechatUrl + "/leavedetail/teacher/" + leave.getLvId());
                                 }catch (Exception e){
                                     e.printStackTrace();
                                 }

+ 24 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java

@@ -352,6 +352,18 @@ public class WxUserServiceImpl implements WxUserService {
 		hashMap.put("openid",openid);
 		List<TeacherDO> teacherDOS = teacherMapper.list(hashMap);
 		if (ObjectUtils.isNotEmpty(teacherDOS)){
+			Long userId = teacherDOS.get(0).getUserId();
+			HashMap<String, Object> stringObjectHashMap = new HashMap<>();
+			stringObjectHashMap.put("userId",userId);
+			List<ParentsDO> list = parentsMapper.list(stringObjectHashMap);
+			if (ObjectUtils.isNotEmpty(list)){
+				for (ParentsDO pt:list) {
+					if (ObjectUtils.isEmpty(pt.getOpenid())){
+						pt.setOpenid(openid);
+						parentsMapper.update(pt);
+					}
+				}
+			}
 			for (TeacherDO tc:teacherDOS) {
 				tc.setTeacherPhoto(headimgurl);
 				teacherMapper.update(tc);
@@ -368,6 +380,18 @@ public class WxUserServiceImpl implements WxUserService {
 		}
 		List<ParentsDO> parentsDOS = parentsMapper.list(hashMap);
 		if (ObjectUtils.isNotEmpty(parentsDOS)){
+			Long userId = parentsDOS.get(0).getUserId();
+			HashMap<String, Object> stringObjectHashMap = new HashMap<>();
+			stringObjectHashMap.put("userId",userId);
+			List<TeacherDO> list = teacherMapper.list(stringObjectHashMap);
+			if (ObjectUtils.isNotEmpty(list)){
+				for (TeacherDO tc:list) {
+					if (ObjectUtils.isEmpty(tc.getOpenid())){
+						tc.setOpenid(openid);
+						teacherMapper.update(tc);
+					}
+				}
+			}
 			for (ParentsDO pt:parentsDOS) {
 				pt.setParentsPhoto(headimgurl);
 				parentsMapper.update(pt);

+ 2 - 1
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java

@@ -66,6 +66,7 @@ public class RemindTask extends TimerTask {
         String meetingNotifier = meetingDO.getMeetingNotifier();
         List<Long> longs = JSON.parseArray(meetingNotifier, Long.class);
         List<Long> list = removeDuplicate(longs);
+            String meetingName = meetingDO.getMeetingName();
         for (Long teacherId:list) {
             SchoolDO schoolDO = wxSchoolMapper.get(meetingDO.getSchoolId());
             String openid = teacherMapper.get(teacherId).getOpenid();
@@ -76,7 +77,7 @@ public class RemindTask extends TimerTask {
                     if (ObjectUtils.isNotEmpty(byAppid)){
                         String temMeeting = byAppid.getTemMeeting();
                         try {
-                            wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , temMeeting, "您好,您有一条新的会议通知", meetingDO.getMeetingName(), simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
+                            wxPushApi.wxPush(schoolDO.getSchoolAppid(), schoolDO.getSchoolSecret(),openid , temMeeting, "您好,您有一条新的会议通知",meetingName , simpleDateFormat.format(meetingDO.getStartDate()), meetingDO.getMeetingAddress(), "-", "点击查看详情", wechatUrl + "/meet-detail/" + meetingDO.getMeetingId()+"?teacherId="+teacherId);
                         } catch (Exception e) {
                             e.printStackTrace();
                         }

+ 8 - 3
applications/school/school-server/src/main/resources/mapper/CurriculumMapper.xml

@@ -264,10 +264,15 @@
   </select>
 
   <update id="updateByPublish" parameterType="java.lang.Long">
-    update clazz_main_curriculum,clazz_curriculum
-    set clazz_main_curriculum.mcur_status = 1 ,clazz_curriculum.cur_status = 1 ,
+    update clazz_main_curriculum
+    set mcur_status = 1 ,
       createTime = now()
-    where id = #{id,jdbcType=BIGINT} and clazz_curriculum.cur_id=id
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPublishFrom" parameterType="java.lang.Long">
+    update clazz_curriculum
+    set clazz_curriculum.cur_status = 1
+    where cur_mid = #{id,jdbcType=BIGINT}
   </update>
 
   <update id="updateByRepublish" parameterType="java.lang.Long">

+ 1 - 1
applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml

@@ -260,7 +260,7 @@
     </select>
 
     <select id="homeWorkRelease" parameterType="long" resultType="integer">
-      select count(1) from sys_clazz left join task_notify on sys_clazz.clazz_name=task_notify.classz_name
+      select count(1) from sys_clazz left join task_notify on sys_clazz.clazz_nickname= concat (task_notify.grade_name,task_notify.classz_name)
       where sys_clazz.clazz_id = #{id} and task_notify.task_status=1
   </select>
 </mapper>

+ 5 - 5
applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml

@@ -251,12 +251,12 @@
   <select id="teacherClazz" resultType="int">
     select count(*) from sys_teacher_clazz
     <where>
-      <if test="teacher_id != null">
-         teacher_id=#{teacher_id}
+      <if test="subject_name != null">
+        subject_name=#{subject_name}
+      </if>
+      <if test="clazz_id != null">
+        and clazz_id=#{clazz_id}
       </if>
-        <if test="clazz_id != null">
-            and clazz_id=#{clazz_id}
-        </if>
     </where>
   </select>
 

+ 4 - 0
applications/school/school-server/src/main/resources/mapper/SysTeacherMapper.xml

@@ -406,4 +406,8 @@ where sys_teacher_clazz.teacher_id=#{id}
   <delete id="deleteDetail">
     DELETE FROM sys_teacher_clazz where teacher_clazz_id = #{teacher_clazz_id}
   </delete>
+
+  <select id="taskCreator" parameterType="long" resultType="long">
+      select teacher_id from sys_teacher where user_id = #{user_id}
+  </select>
 </mapper>

+ 4 - 1
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WechatApi.java

@@ -10,5 +10,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 public interface WechatApi {
 
     @PostMapping("/send/Message")
-    public Result sendMsg(@RequestBody MessageInfoDTO info);
+    Result sendMsg(@RequestBody MessageInfoDTO info);
+
+    @PostMapping("/send/Messages")
+    Result sendOutMessages(@RequestBody String data);
 }

+ 2 - 1
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/TransfersController.java

@@ -50,7 +50,8 @@ public class TransfersController {
     * @Date: 2019/3/7
     */
     @PostMapping("/Messages")
-    public Result sendOutMessages(String data) throws UnsupportedEncodingException {
+    @IgnoreOpenApiAuth
+    public Result sendOutMessages(@RequestBody String data) throws UnsupportedEncodingException {
         if (StringUtils.isEmpty(data)) {
             return Result.error("信息为空");
         }

+ 3 - 4
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java

@@ -3,10 +3,9 @@ package com.usoftchina.smartschool.wechat.controller;
 import com.usoftchina.smartschool.wechat.auth.annotation.IgnoreOpenApiAuth;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
 import com.usoftchina.smartschool.wechat.service.SendService;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * @author: guq
@@ -29,7 +28,7 @@ public class WxPushController {
         msg.setTouser(openid);
         msg.setTemplateId(templateId);
         msg.setTitle(title);
-        msg.setKeyword2(keyword1);
+        msg.setKeyword1(keyword1);
         msg.setKeyword2(keyword2);
         msg.setKeyword3(keyword3);
         msg.setKeyword4(keyword4);

+ 17 - 15
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/ReceiveService.java

@@ -60,23 +60,25 @@ public class ReceiveService {
         Result result = null;
         //记录发送失败次数
         int count = 0;
-        for (MessageInfo msg : data) {
-            if (!msg.getSend()) {
-                //处理openid,如果不存在openid,则直接忽略
-                //getOpenId(msg);
-                result = wxPushService.wechatPush(msg);
-                if (result.isSuccess()) {
-                    msg.setSend(true);
-                } else {
-                    msg.setReason(result.getMessage());
-                    count ++;
+        if (null != data) {
+            for (MessageInfo msg : data) {
+                if (!msg.getSend()) {
+                    //处理openid,如果不存在openid,则直接忽略
+                    //getOpenId(msg);
+                    result = wxPushService.wechatPush(msg);
+                    if (result.isSuccess()) {
+                        msg.setSend(true);
+                    } else {
+                        msg.setReason(result.getMessage());
+                        count++;
+                    }
                 }
             }
-        }
-        //存在发送失败的消息
-        if (count > 0) {
-            msgPackage.addRetry();
-            sendService.sendDelayMessage(msgPackage);
+            //存在发送失败的消息
+            if (count > 0) {
+                msgPackage.addRetry();
+                sendService.sendDelayMessage(msgPackage);
+            }
         }
         /**
          * Delivery Tag 用来标识信道中投递的消息。RabbitMQ 推送消息给 Consumer 时,会附带一个 Delivery Tag,

+ 2 - 5
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java

@@ -2,14 +2,12 @@ package com.usoftchina.smartschool.wechat.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.github.kevinsawicki.http.HttpRequest;
-import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;
 import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.wechat.po.MessageInfo;
 import com.usoftchina.smartschool.wechat.service.WxPushService;
 import com.usoftchina.smartschool.wechat.wxUtils.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
@@ -28,13 +26,12 @@ public class WxPushServiceImpl implements WxPushService{
      */
     @Override
     public String wxPush(String appId,String secret,String openid, String templateId, String title, String keyword1, String keyword2, String keyword3, String keyword4, String remark, String url) {
-            if (ObjectUtils.isNotEmpty(openid)){
+        if (ObjectUtils.isNotEmpty(openid)){
                 String json="{\"touser\":\""+openid+"\","
                         + "\"template_id\":\""+templateId+"\","
                         + "\"url\":\""+""+url+""+"\","
                         + "\"data\":{"
-                        + "\"first\":{\"value\":\""+title+"\","
-                        +"\"color\":\"#173177\"},"
+                        + "\"first\":{\"value\":\""+title+"\",\"color\":\"#173177\"},"
                         + "\"keyword1\":{\"value\":\""+keyword1+"\",\"color\":\"#173177\"},"
                         + "\"keyword2\":{\"value\":\""+keyword2+"\",\"color\":\"#173177\"},"
                         + "\"keyword3\":{\"value\":\""+keyword3+"\",\"color\":\"#173177\"},"

+ 2 - 2
frontend/pc-web/app/util/BaseUtil.js

@@ -52,8 +52,8 @@ Ext.define('school.util.BaseUtil', {
         refreshTabTitle: function (id, title) {
             var currentTab = this.getCurrentTab();
             currentTab.tabId = id;
-            currentTab.setTitle(title);
-            currentTab.setTooltip(title);
+            currentTab.tab.setText(title);
+            currentTab.tab.setTooltip(title);
         },
 
         /**

+ 1 - 9
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -6,7 +6,7 @@ Ext.define('school.view.interaction.homework.Release', {
     xtype: 'interaction-homework-release',
 
     controller: 'interaction-homework-release',
-    // viewModel: 'purchase-purchase-formpanel',
+    viewModel: 'interaction-homework-release',
 
     //字段属性
     _title: '作业发布',
@@ -121,14 +121,6 @@ Ext.define('school.view.interaction.homework.Release', {
                 name: 'accessory',
                 fieldLabel: '附件'
             }],
-            applyBtns: [{
-                apply: true,
-                text: '保存',
-                bind: {
-                    hidden: '{!showSaveBtn || task_status == 1}',
-                    disabled: '{!base.valid}'
-                }
-            }],
             applyBtns: [{
                 apply: true,
                 text: '删除',

+ 15 - 0
frontend/pc-web/app/view/Interaction/homework/ReleaseModel.js

@@ -0,0 +1,15 @@
+Ext.define('school.view.interaction.homework.SchoolNoticeModel', {
+    extend: 'school.view.core.form.FormPanelModel',
+    alias: 'viewmodel.interaction-homework-release',
+
+    formulas: {
+        task_status_change: {
+            bind: '{task_status}',
+            get: function(v) {
+                let view = this.getView();
+                view.setEditable(v != 1);
+            }
+        }
+    }
+
+});

+ 7 - 1
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -6,7 +6,7 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
     xtype: 'interaction-notice-schoolnotice',
 
     controller: 'interaction-notice-schoolnotice',
-    // viewModel: 'purchase-purchase-formpanel',
+    viewModel: 'interaction-notice-schoolnotice',
 
     //字段属性
     _title: '学校通知',
@@ -85,6 +85,12 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
                     hidden: '{!showSaveBtn || notify_status == 1}',
                     disabled: '{!base.valid}'
                 }
+            }, {
+                apply: true,
+                text: '删除',
+                bind: {
+                    hidden: '{!showDeleteBtn || !notify_id || notify_status == 1}'
+                },
             }],
             toolBtns: [{
                 xtype: 'button',

+ 15 - 0
frontend/pc-web/app/view/Interaction/notice/SchoolNoticeModel.js

@@ -0,0 +1,15 @@
+Ext.define('school.view.interaction.notice.SchoolNoticeModel', {
+    extend: 'school.view.core.form.FormPanelModel',
+    alias: 'viewmodel.interaction-notice-schoolnotice',
+
+    formulas: {
+        notify_status_change: {
+            bind: '{notify_status}',
+            get: function(v) {
+                let view = this.getView();
+                view.setEditable(v != 1);
+            }
+        }
+    }
+
+});

+ 36 - 6
frontend/pc-web/app/view/Interaction/timetable/Detail.js

@@ -35,7 +35,7 @@ Ext.define('school.view.interaction.timetable.Detail', {
                 xtype: 'textfield',
                 name: 'name',
                 fieldLabel: '课表名称',
-                emptyText: '请选择年级',
+                columnWidth: 0.5,
                 bind: {
                     emptyText: '{name_emptyText}'
                 }
@@ -115,10 +115,18 @@ Ext.define('school.view.interaction.timetable.Detail', {
                     let now = new Date();
                     let year = now.getFullYear();
                     let month = now.getMonth() + 1;
-                    let o1, o2;
+                    let o1, o2, termPart;
+                    
                     o1 = [(year - 1) + '-' + year];
                     o2 = [year + '-' + (year + 1)];
-                    return (month < 9) ? o1[0] : o2[0]
+
+                    if((month > 2 && month < 8) || (month == 2 && date > 15) || (month == 8 && date < 15)) {
+                        termPart = o1[0];
+                    }else {
+                        termPart = o2[0];
+                    }
+
+                    return termPart;
                 })()
             }, {
                 xtype: "combobox",
@@ -133,9 +141,17 @@ Ext.define('school.view.interaction.timetable.Detail', {
                     data: [['第一学期'], ['第二学期']]
                 }),
                 defaultValue: (function() {
-                    let now = new Date();
-                    let month = now.getMonth() + 1;
-                    return (month < 9) ? '第一学期' : '第二学期'
+                    let now = new Date(),
+                    month = now.getMonth() + 1,
+                    date = now.getDate(),
+                    term;
+
+                    if((month > 2 && month < 8) || (month == 2 && date > 15) || (month == 8 && date < 15)) {
+                        term = '第二学期';
+                    }else {
+                        term = '第一学期'
+                    }
+                    return term;
                 })()
             }, {
                 xtype: "textfield",
@@ -357,6 +373,20 @@ Ext.define('school.view.interaction.timetable.Detail', {
                     hidden: true
                 }]
             }],
+            applyBtns: [{
+                apply: true,
+                text: '删除',
+                bind: {
+                    hidden: '{!showDeleteBtn || !id || status == 1}'
+                },
+            }, {
+                apply: true,
+                text: '保存',
+                bind: {
+                    hidden: '{!showSaveBtn || status == 1}',
+                    disabled: '{!base.valid}'
+                }
+            }],
             toolBtns: [{
                 xtype: 'button',
                 text: '启用',

+ 8 - 10
frontend/pc-web/app/view/Interaction/timetable/DetailModel.js

@@ -11,19 +11,17 @@ Ext.define('school.view.interaction.timetable.DetailModel', {
             text;
 
             if(!!gradeName && !!clazzName && !!termPart && !!termName) {
-                text =  gradeName + clazzName + termPart.split('-')[0].substring(2, 4) + '年' + termName + '课表';
-                this.set('name', text);
-            }else if(!gradeName) {
-                text = '请选择年级';
-            }else if(!clazzName) {
-                text = '请选择班级';
-            }else if(!termPart) {
-                text = '请选择学年';
-            }else if(!termName) {
-                text = '请选择学期';
+                text =  gradeName + clazzName + termPart.split('-')[0] + '学年' + termName + '课表';
             }
 
             return text;
+        },
+        status_change: {
+            bind: '{status}',
+            get: function(v) {
+                let view = this.getView();
+                view.setEditable(v != 1);
+            }
         }
     }
 

+ 21 - 5
frontend/pc-web/app/view/Interaction/timetable/List.js

@@ -77,10 +77,18 @@ Ext.define('school.view.interaction.timetable.List', {
                     let now = new Date();
                     let year = now.getFullYear();
                     let month = now.getMonth() + 1;
-                    let o1, o2;
+                    let o1, o2, termPart;
+                    
                     o1 = [(year - 1) + '-' + year];
                     o2 = [year + '-' + (year + 1)];
-                    return (month < 9) ? o1[0] : o2[0]
+
+                    if((month > 2 && month < 8) || (month == 2 && date > 15) || (month == 8 && date < 15)) {
+                        termPart = o1[0];
+                    }else {
+                        termPart = o2[0];
+                    }
+
+                    return termPart;
                 })()
             }, {
                 xtype: "combobox",
@@ -96,9 +104,17 @@ Ext.define('school.view.interaction.timetable.List', {
                     data: [['第一学期'], ['第二学期']]
                 }),
                 value: (function() {
-                    let now = new Date();
-                    let month = now.getMonth() + 1;
-                    return (month < 9) ? '第一学期' : '第二学期'
+                    let now = new Date(),
+                    month = now.getMonth() + 1,
+                    date = now.getDate(),
+                    term;
+
+                    if((month > 2 && month < 8) || (month == 2 && date > 15) || (month == 8 && date < 15)) {
+                        term = '第二学期';
+                    }else {
+                        term = '第一学期'
+                    }
+                    return term;
                 })()
             }, {
                 xtype: 'combobox',

+ 1 - 1
frontend/pc-web/app/view/auth/Login.js

@@ -43,7 +43,7 @@ Ext.define('school.view.auth.Login', {
                 {
                     xtype: 'component',
                     height: 50,
-                    html:'<div class="auth-title"><img class="x-logo-text" style="" src="resources/images/zhihuixiaoyuan.png" alt=""><div>',
+                    html:'<div class="auth-title"><img class="x-logo-text" style="" src="resources/images/login-text-img.png" alt=""><div>',
                 },
                 {
                     xtype: 'label',

+ 2 - 2
frontend/pc-web/app/view/basic/staff/StaffDetail.js

@@ -84,7 +84,7 @@ Ext.define('school.view.basic.staff.StaffDetail', {
                 fieldLabel: '政治面貌',
                 displayField: 'name',
                 valueField: 'name',
-                editable: false,
+                editable: true,
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name'],
                     data: [['中共党员'], ['中共预备党员'], ['共青团员'], ['群众']]
@@ -101,7 +101,7 @@ Ext.define('school.view.basic.staff.StaffDetail', {
                 fieldLabel: '学历',
                 displayField: 'name',
                 valueField: 'name',
-                editable: false,
+                editable: true,
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name'],
                     data: [['博士后'], ['博士'], ['硕士'], ['研究生'], ['本科(统招)'], ['本科(成人高考)'], ['本科(专升本)'], ['大专'], ['高中'], ['职高'], ['初中'], ['小学']]

+ 1 - 1
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -64,7 +64,7 @@ Ext.define('school.view.basic.student.StudentDetail', {
                 fieldLabel: '政治面貌',
                 displayField: 'name',
                 valueField: 'name',
-                editable: false,
+                editable: true,
                 store: Ext.create('Ext.data.ArrayStore', {
                     fields: ['name'],
                     data: [

+ 5 - 1
frontend/pc-web/app/view/core/form/field/DetailGridField.js

@@ -64,7 +64,7 @@ Ext.define('school.view.core.form.field.DetailGridField', {
                     y: true
                 },
                 deferEmptyText: false,
-                emptyText: '<div style="width: 100%; text-align: center; cursor: pointer; color: green;" class="fa fa-plus" title="新增行" onclick="addRows(\'' + me.id + '\')"></div>',
+                emptyText: (me.readOnly || !me.editable) ? '' : '<div style="width: 100%; text-align: center; cursor: pointer; color: green;" class="fa fa-plus" title="新增行" onclick="addRows(\'' + me.id + '\')"></div>',
             },
             listeners: {
                 boxready: function(g) {
@@ -395,6 +395,10 @@ Ext.define('school.view.core.form.field.DetailGridField', {
 
         me.editable = able;
 
+        lockGridEmptyText = !me.readOnly && able ? '<div style="width: 100%; text-align: center; cursor: pointer; color: green;" class="fa fa-plus" title="新增行" onclick="addRows(\'' + me.id + '\')"></div>' : '';
+
+        me.lockedGrid.setEmptyText(lockGridEmptyText)
+
         Ext.Array.each(columns, function(c) {
             if(typeof c.getEditor != 'undefined'){
                 var e = c.getEditor();

+ 1 - 0
frontend/pc-web/app/view/core/form/field/FileField.js

@@ -8,6 +8,7 @@ Ext.define('school.view.core.form.field.FileField', {
 	collapsible: true,
 	multi: true,
 	allowBlank:true,
+	isFormField: true,
 	initComponent: function() {
 		this.columnWidth = 1;//强制占一行
 		this.cls = '';

+ 1 - 1
frontend/pc-web/app/view/main/Main.js

@@ -30,7 +30,7 @@ Ext.define('school.view.main.Main', {
                     xtype: 'component',
                     reference: 'mainLogo',
                     cls: 'main-logo-wrap',
-                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">智慧校园</div></div>',
+                    html: '<div class="main-logo"><img src="resources/images/default/logo-default.png"/><div class="logo-text">云平安校园</div></div>',
                     bind: {
                         width: '{navWidth}'
                     }

+ 8 - 8
frontend/pc-web/app/view/main/Main.scss

@@ -79,21 +79,21 @@ $treelist-nav-ui: (
         background: #34BAF6;
 
         img {
-            width: 32px;
-            height: 32px;
-            top: 8px;
-            left: 28px;
+            width: 45px;
+            height: 30px;
+            top: 10px;
+            left: 10px;
             position: relative;
         }
 
         .logo-text {
-            // font-family: 'pingFangSC-Regular';
             font-size: 18px;
-            color: #FFFFFF;
+            color: #fff;
             text-align: left;
-            top: 22px;
+            top: 16px;
             position: absolute;
-            left: 64px;
+            left: 60px;
+            white-space: nowrap;
         }
     }
 }

+ 2 - 2
frontend/pc-web/app/view/main/MainController.js

@@ -14,10 +14,10 @@ Ext.define('school.view.main.MainController', {
         navigationList = refs.navigationTreeList,
         navCollapsed = !navigationList.navCollapsed,
         new_width = navCollapsed ? viewModel.get('smallNavWidth') : viewModel.get('navWidth'),
-        newLogoImgStyle = navCollapsed ? { width: 36, height: 36, top: 6, left: 12 } : { width: 32, height: 32, top: 8, left: 28 },
+        newLogoImgStyle = navCollapsed ? { width: 51, height: 32, top: 8, left: 6 } : { width: 45, height: 30, top: 10, left: 10 },
         newLogoTextStyle = navCollapsed ? {
             0: { opacity: 0 },
-            100: { opacity: 0, display: 'none' }
+            70: { opacity: 0 }
         } : {
             10: { opacity: 0 },
             90: { opacity: 1 }

+ 6 - 15
frontend/pc-web/app/view/setting/operatelog/OperateLog.js

@@ -11,19 +11,14 @@ Ext.define('school.view.setting.operatelog.OperateLog', {
         var me = this;
         Ext.apply(this, {
             searchField: [{
-                width: 110,
-                name: 'obj',
-                xtype: 'textfield',
-                emptyText : '对象',
+                columnWidth: 0.5,
+                name: 'createTime',
+                xtype: 'condatefield',
+                fieldLabel : '时间',
+                labelWidth: 50
             }, {
-            //     // columnWidth: 0.5,
-            //     // name: 'time',
-            //     // xtype: 'condatefield',
-            //     // fieldLabel : '时间',
-            //     // labelWidth: 50
-            // }, {
                 width: 110,
-                name: 'man',
+                name: 'ml_man',
                 xtype: 'textfield',
                 emptyText : '操作人员',
             }],
@@ -45,10 +40,6 @@ Ext.define('school.view.setting.operatelog.OperateLog', {
                     text:'单据类型',
                     dataIndex : "ml_name",
                     width : 110.0, 
-                }, {
-                    text : "单据编号", 
-                    width : 150.0, 
-                    dataIndex : "ml_code", 
                 }, {
                     text : "操作", 
                     dataIndex : "ml_content", 

+ 1 - 1
frontend/pc-web/index.html

@@ -6,7 +6,7 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">
 
-    <title>智慧校园</title>
+    <title>云平安校园</title>
     <link rel="icon" href="./resources/images/favicon.png" type="image/x-icon">
     <!-- The line below must be kept intact for Sencha Cmd to build your application -->
     <script id="microloader" data-app="a20e1670-7932-41f6-8e9c-55b77cba3f26" type="text/javascript" src="bootstrap.js"></script>

+ 53 - 3
frontend/pc-web/overrides/form/field/ComboBox.js

@@ -9,18 +9,21 @@ Ext.define("school.override.form.field.ComboBox", {
                 weight: -1,
                 cls: 'fa-times',
                 hidden: true,
+                lazyVisible: true,
                 onFieldFocus: function() {
-                    if(this.field.clearable) {
+                    var field = this.field;
+                    if(!field.readOnly && field.clearable) {
                         this.setHidden(false);
                     }
                 },
                 onFieldBlur: function() {
-                    if(this.field.clearable) {
+                    var field = this.field;
+                    if(!field.readOnly && field.clearable) {
                         this.setHidden(true);
                     }
                 },
                 handler: function() {
-                    if(this.clearable) {
+                    if(!this.readOnly && this.clearable) {
                         this.setValue(null)
                         this.triggers.clear.setHidden(true)
                         this.fireEvent('clear', this);
@@ -35,4 +38,51 @@ Ext.define("school.override.form.field.ComboBox", {
         }
     },
 
+    setReadOnly: function(readOnly) {
+        var me = this,
+            triggers = me.getTriggers(),
+            hideTriggers = me.getHideTrigger(),
+            oVisible = {},
+            trigger,
+            id;
+ 
+        readOnly = !!readOnly;
+ 
+        if (triggers) {
+            for (id in triggers) {
+                oVisible[id] = triggers[id].isVisible();
+            }
+        }
+
+        me.callParent([readOnly]);
+        if (me.rendered) {
+            me.setReadOnlyAttr(readOnly || !me.editable);
+        }
+ 
+        if (triggers) {
+            for (id in triggers) {
+                trigger = triggers[id];
+
+                /**
+                 * if trigger's 'lazyVisible' is true,this trigger's 'visible' will not controlled beed 'setReadOnly'
+                 */
+                if(trigger.lazyVisible) {
+                    trigger.setVisible(oVisible[id]);
+                    continue;
+                }
+
+                /*
+                 * Controlled trigger visibility state is only managed fully when 'hideOnReadOnly' is falsy.
+                 * Truth table:
+                 *   - If the trigger is configured/defaulted as 'hideOnReadOnly : true', it's readOnly-visibility
+                 *     is determined solely by readOnly state of the Field.
+                 *   - If 'hideOnReadOnly : false/undefined', the Fields.{link #hideTrigger hideTrigger} is honored.
+                 */
+                if (trigger.hideOnReadOnly === true || (trigger.hideOnReadOnly !== false && !hideTriggers)) {
+                    trigger.setVisible(!readOnly);
+                }
+            }
+        }
+    },
+
 });

BIN
frontend/pc-web/resources/images/auth-background.jpg


BIN
frontend/pc-web/resources/images/default/logo-default.png


BIN
frontend/pc-web/resources/images/favicon.png


BIN
frontend/pc-web/resources/images/login-text-img.png


BIN
frontend/pc-web/resources/images/zhihuixiaoyuan.png


+ 0 - 4
frontend/pc-web/resources/json/navigation.json

@@ -54,10 +54,6 @@
     "text": "系统设置",
     "iconCls": "x-ss ss-nav-setting",
     "items": [{
-        "id": "setting-access-roleaccess",
-        "text": "角色授权",
-        "view": "setting-access-roleaccess"
-    }, {
         "id": "setting-device-list",
         "text": "设备参数",
         "view": "setting-device-list"

+ 2 - 4
frontend/wechat-web/src/components/PhonesItem.jsx

@@ -44,13 +44,11 @@ export default class PhonesItem extends Component {
                             phonesBean.phone.length <= 1 ?
                                 <a href={'tel:' + phonesBean.phone[0]} style={{display: 'flex', alignItems: 'center'}}>
                                     <div className='phones-item-phone'>{phonesBean.phone[0]}</div>
-                                    <span style={{widths:10,background:'#FFFFFF',color:'#FFFFFF'}}>22</span>
-                                    <img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/>
+                                    <div><img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/></div>
                                 </a> :
                                 <div style={{display: 'flex', alignItems: 'center'}} onClick={this.onPhoneSelect}>
                                     <div className='phones-item-phone'>{phonesBean.phone[0]}</div>
-                                    <span style={{widths:10,background:'#FFFFFF',color:'#FFFFFF'}}>22</span>
-                                    <img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/>
+                                   <div> <img style={{height:14,height:14,marginLeft:10}} src={phone_img} alt=""/></div>
                                 </div>)}
                     </div>
 

+ 2 - 2
frontend/wechat-web/src/configs/api.config.js

@@ -138,7 +138,7 @@ export const API = {
     //出入校单次记录详情
 
     //更改手机号是获取验证码
-    SEND_CODEUPDATE:_baseURL +'/wxSchool/user/sendCodeUpdate',
+    SEND_CODEUPDATE: _baseURL + '/wxSchool/user/sendCodeUpdate',
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //获取用户是否绑定
@@ -163,7 +163,7 @@ export const API = {
     //获取学生班级列表
     GET_STU_CLASS_LIST: _baseURL + '/wxSchool/clazz/selectClazzByStu',
     //文件上传地址
-    UPLOAD_FILE: _baseURL + '/wxSchool/file/uploadFile',
+    UPLOAD_FILE: 'https://school-api.ubtob.com/api/file/upload',
     //新建相册
     NEW_CLASS_ALBUM: _baseURL + '/wxSchool/clazzAlbum/createAlbum',
     //修改相册

+ 2 - 1
frontend/wechat-web/src/configs/router.config.js

@@ -63,6 +63,7 @@ import ScoreNotification from '../modules/hiPages/scorenotification/ScoreNotific
 import AccessNoticeDetail from '../modules/hiPages/accessnoticedetail/AccessNoticeDetail';
 import ChartDemo from "../modules/chart/ChartDemo";
 import {connect} from "react-redux";
+import AccessNoticeDetail1 from "../modules/hiPages/accessnoticedetail/AccessNoticeDetail1";
 
 class RouteConfig extends Component {
 
@@ -137,7 +138,7 @@ class RouteConfig extends Component {
                         <Route path='/leavedetail/:role/:lvId' component={LeaveDetail}/> {/*学生请假详情*/}
                         <Route path="/changephonenumber" component={ChangePhoneNumber}/> {/*更换手机号码*/}
                         <Route path="/scorenotification/:stuId?" component={ScoreNotification}/> {/*成绩通知*/}
-                        <Route path="/accessnoticedetail/:stuId/:anId?" component={AccessNoticeDetail}/> {/*出入校通知详情*/}
+                        <Route path="/accessnoticedetail/:stuId/:anId?" component={AccessNoticeDetail1}/> {/*出入校通知详情*/}
                         {/*<Route path="/accessnoticedetail" component={AccessNoticeDetail}/> /!*出入校通知详情*!/*/}
                         <Route path='/leaveAddC' component={LeaveAddCPage}/>{/*老师请假*/}
                         <Route path='/leaveAdd' component={LeaveAddPage}/> {/*学生请假*/}

+ 81 - 8
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.css

@@ -1,17 +1,90 @@
-.an_student_name{
+.an_student_name {
     font-family: PingFangSC-Regular;
     color: #222222;
-    margin:20px 40px 10px 40px;text-align: left;
+    margin: 20px 40px 10px 40px;
+    text-align: left;
 }
-.an_student_photo{
-    height: 199px;border-radius: 10px;width: 300px;
+
+.an_student_photo {
+    height: 199px;
+    border-radius: 10px;
+    width: 300px;
 }
-.an_student_type{
+
+.an_student_type {
     font-family: PingFangSC-Regular;
     font-size: 15px;
     color: #666666;
-    letter-spacing: 1.25px;text-align: left;margin: 30px;
+    letter-spacing: 1.25px;
+    text-align: left;
+    margin: 30px;
 }
-.an_student_foot_time{
-    background-color: #F7F7F7;text-align: left;padding-left: 25px;
+
+.an_student_foot_time {
+    background-color: #F7F7F7;
+    text-align: left;
+    padding-left: 25px;
+}
+
+.access-notice-top-layout {
+    display: flex;
+    flex-direction: row;
+    padding: 15px;
+    background: white;
+    align-items: center;
+}
+
+.access-notice-icon-in, .access-notice-icon-out {
+    color: white;
+    font-size: 14px;
+    width: 36px;
+    height: 36px;
+    display: inline-block;
+    border-radius: 50%;
+    text-align: center;
+    line-height: 34px;
+    padding-bottom: 2px;
+}
+
+.access-notice-icon-in {
+    background: #43CEAF;
+}
+
+.access-notice-icon-out {
+    background: #589CFE;
+}
+
+.access-notice-name {
+    font-family: MicrosoftYaHei;
+    font-size: 18px;
+    color: #333333;
+    letter-spacing: 2.25px;
+    padding-left: 10px;
+}
+
+.access-notice-time {
+    font-family: MicrosoftYaHei;
+    font-size: 22px;
+    color: #222222;
+    letter-spacing: 2px;
+}
+
+.access-notice-date {
+    font-family: MicrosoftYaHei;
+    font-size: 12px;
+    color: #999999;
+    letter-spacing: 1px;
+    padding-left: 10px;
+}
+
+.access-notice-img-layout {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 10px 15px;
+}
+
+.access-notice-img {
+    max-width: 100%;
+    max-height: 200px;
 }

+ 0 - 3
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.js

@@ -28,15 +28,12 @@ class AccessNoticeDetail extends Component {
 
     componentDidMount() {
         let stuId = this.props.match.params.stuId
-        let role = this.props.match.params.role
         let anId = this.props.match.params.anId
 
-        console.log("stuId", stuId)
         if (!isObjEmpty(stuId)) {
             this.getANDetail(stuId, anId)
         }
 
-
         let curDay = new Date().getDay()
         if (curDay == 1) {
             curDay = '星期一'

+ 55 - 0
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail1.jsx

@@ -0,0 +1,55 @@
+/**
+ * Created by RaoMeng on 2019/3/13
+ * Desc:出入校通知详情
+ */
+
+import React, {Component} from 'react'
+import {connect} from 'react-redux';
+
+class AccessNoticeDetail1 extends Component {
+
+    constructor() {
+        super()
+
+        this.state = {}
+    }
+
+    componentDidMount() {
+        document.title = '出入校通知'
+    }
+
+    componentWillUnmount() {
+
+    }
+
+    render() {
+        return (
+            <div className='common-flex-column' style={{background: 'white'}}>
+                <div className='access-notice-top-layout'>
+                    <div className='access-notice-icon-in'>进</div>
+                    <span className='access-notice-name'>陈小龙</span>
+                </div>
+
+                <div style={{padding: '6px 15px', background: '#f7f7f7'}}>
+                    <span className='access-notice-time'>12:07:06</span>
+                    <span className='access-notice-date'>2019-1-30</span>
+                    <span className='access-notice-date'>星期天</span>
+                </div>
+
+                <div className='access-notice-img-layout'>
+                    <img className='access-notice-img'
+                         src='http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark'/>
+                </div>
+            </div>
+        )
+    }
+}
+
+
+let mapStateToProps = (state) => ({
+    userInfo: {...state.redUserInfo}
+})
+
+let mapDispatchToProps = (dispatch) => ({})
+
+export default connect(mapStateToProps, mapDispatchToProps)(AccessNoticeDetail1)

+ 1 - 1
frontend/wechat-web/src/modules/hiPages/approvel-detail/ItemApprovel.js

@@ -21,7 +21,7 @@ export default class ItemApprovel extends Component{
                     <div style={{width:10,height:10,background:'#BDBDBD',borderRadius:'30px'}}></div>
                     <div style={{marginLeft:10,width:"62%"}}>
                         <div ><span style={{color:'#000000',fontSize:15}}>{this.props.itemdata.value }</span><span style={{color:'#666666',fontSize:12,marginLeft:10}}>{this.props.approveDate}</span></div>
-                        <div style={{color:"#666666",fontSize:12,marginTop:5,wordWrap:'break-word'}}><span>{this.props.suggest.value==null?"":"(审批语:"+this.props.suggest.value+")"}</span></div>
+                        <div style={{color:"#666666",fontSize:12,marginTop:5,wordWrap:'break-word'}}><span>{(this.props.suggest.value==null || this.props.suggest.value==undefined)?"":"(审批语:"+this.props.suggest.value+")"}</span></div>
                     </div>
                     <div style={{fontSize:12,textAlign:'right'}} className={this.props.approveStatus == 1?'doing':'done'}>
                         {this.props.approveStatus == 1 ? '等待审批' : (this.props.approveStatus == 2 ? '已同意' : '已拒绝')}</div>

+ 6 - 0
frontend/wechat-web/src/modules/hiPages/approvel/Approvel.css

@@ -13,4 +13,10 @@
 }
 .done{
     color: #666666;
+}
+.no_data{
+    background: #F4F4F4;
+    background-size: 100% 100%;
+    height: 100vh;
+    text-align: center;
 }

+ 12 - 3
frontend/wechat-web/src/modules/hiPages/approvel/Approvel.js

@@ -20,7 +20,7 @@ import RefreshLayout from "../../../components/RefreshLayout";
 import {Skeleton, List} from 'antd';
 import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
 import {saveListState} from "../../../redux/actions/listState";
-
+import nodata_img from '../../../style/imgs/no_data.png';
 let myApplypageIndex = 0;
 let myApprovepageIndex = 0;
 const mPageSize = 10
@@ -169,10 +169,19 @@ class Approvel extends Component {
                      }}>
                     <div className="swiper-wrapper">
                         <div className="swiper-slide" >
-                            {isMyapplyItems}
+                            {
+                                this.state.applyList.length > 0 ? isMyapplyItems
+                                    :
+                                    <div className="no_data"><img src={nodata_img} alt="" style={{width:'100%',height:'100%'}}/></div>
+                            }
                         </div>
                         <div className="swiper-slide">
-                            {isMyapproveItems}
+                            {
+                                this.state.approvelList.length > 0 ? isMyapproveItems
+                                    :
+                                    <div className="no_data"><img src={nodata_img} alt=""
+                                                                  style={{width: '100%', height: 'auto'}}/></div>
+                            }
                         </div>
                     </div>
                 </div>

+ 1 - 0
frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

@@ -175,6 +175,7 @@ class SendVote extends Component {
                 </div>
 
                 <div className="comhline_sty"></div>
+
                 <div className="common-column-layout">
                     <Picker
                         data={this.state.typeVote} title='投票类型' extra='请选择'

+ 4 - 4
frontend/wechat-web/src/modules/home/HomePage.jsx

@@ -20,7 +20,7 @@ import 'css/home-page.css'
 import {fetchGet, fetchPost} from "../../utils/fetchRequest";
 import {_baseURL, API} from "../../configs/api.config";
 import icon_home_change from "../../style/imgs/icon_home_change.png";
-
+let holly = 0
 const operation = Modal.operation;
 
 class HomePage extends Component {
@@ -35,7 +35,6 @@ class HomePage extends Component {
     }
 
     componentWillMount() {
-
     }
 
     componentDidMount() {
@@ -74,7 +73,8 @@ class HomePage extends Component {
             this.props.userInfo.parent.students.forEach((item, index) => {
                 if (this.props.userInfo.parent.student.stuId == item.stuId) {
                     this.setState({
-                        studentIndex: index
+                        studentIndex: index,
+                        selectStuName:this.props.userInfo.parent.student.stuName
                     })
                 }
             })
@@ -320,7 +320,7 @@ class HomePage extends Component {
                 {
                     userInfo.userRole === 1 ?
                         <div className='home-student-layout-root' style={{display:'flex',flexDirection:'column'}}>
-                            <div  className='home-top-msg-text'>{userName +' | ' + schoolName}</div>
+                            <div  className='home-top-msg-text'>{this.state.selectStuName +' | ' + schoolName}</div>
                         </div>
                         :
                         <div className='home-top-msg-root' style={{paddingBottom:10}}>

+ 22 - 11
frontend/wechat-web/src/modules/homework/AssignmentDetailPage.js

@@ -9,7 +9,7 @@ import '../../style/css/app-gloal.css'
 import {List, Input, Button} from 'antd';
 import {fetchPost, fetchGet} from '../../utils/fetchRequest';
 import {API, _baseURL} from '../../configs/api.config';
-import {getIntValue, getStrValue, isObjEmpty} from '../../utils/common';
+import {getIntValue, getSearchParams, getStrValue, isObjEmpty} from '../../utils/common';
 import ImagesViewer from "../../components/imagesVIewer/ImagesViewer";
 import {Toast} from 'antd-mobile'
 import {Avatar} from 'antd'
@@ -48,6 +48,17 @@ class AssignmentDetailPage extends React.Component {
     }
 
     componentDidMount() {
+        this.searchParams = getSearchParams(this.props.location.search)
+        this.stuId = this.props.userInfo.user.student.stuId
+        this.parentId = this.props.userInfo.user.userFunId
+        if (this.searchParams) {
+            if (this.searchParams.stuId) {
+                this.stuId = this.searchParams.stuId
+            }
+            if (this.searchParams.parentId) {
+                this.parentId = this.searchParams.parentId
+            }
+        }
         Toast.show('', 0)
         this.getHomeworkDetail()
     }
@@ -65,7 +76,7 @@ class AssignmentDetailPage extends React.Component {
     getHomeworkDetail = () => {
         fetchPost(API.HOMEWORK_DETAIL, {
             taskId: this.state.id,
-            stuId: this.props.userInfo.user.student.stuId
+            stuId: this.stuId
         }).then((response) => {
             Toast.hide()
             if (response && response.data) {
@@ -142,8 +153,8 @@ class AssignmentDetailPage extends React.Component {
             taskId: this.state.id,
             replyTitle: '这是作业的回复',
             replyContext: this.state.messageContent,
-            parentId: this.props.userInfo.user.userFunId,
-            stuId: this.props.userInfo.user.student.stuId
+            parentId: this.parentId,
+            stuId: this.stuId
         }
         fetchPost(API.HOMEWORK_REPLY, {
             taskRepayString: JSON.stringify(params)
@@ -194,7 +205,7 @@ class AssignmentDetailPage extends React.Component {
                         <div className="homework-detail-top-name">{this.state.teachName}老师</div>
                         <div className='homework-detail-top-time'>
                             <span>截止时间:</span>
-                            <span >{this.state.endTime}</span>
+                            <span>{this.state.endTime}</span>
                         </div>
                     </div>
                 </div>
@@ -213,9 +224,9 @@ class AssignmentDetailPage extends React.Component {
 
                 </div>
                 <div className="margin_top_bottom_10 homework-detail-leave-caption">
-                    <img src={leave_img} style={{height:18,width:21,marginRight:10}}/>
+                    <img src={leave_img} style={{height: 18, width: 21, marginRight: 10}}/>
                     {this.state.data.length != 0 ? (
-                    <span>
+                        <span>
                         ({this.state.data.length}条)
                     </span>) : (<div></div>)}</div>
                 <div id="page_horizontal_line"></div>
@@ -227,10 +238,10 @@ class AssignmentDetailPage extends React.Component {
                     locale={{emptyText: '暂无留言'}}
                     dataSource={this.state.data}
                     renderItem={item => (
-                            <div style={{display: 'flex',paddingTop:5,paddingBottom:5}}>
-                                <div className="homework-detail-leave-name">{item.name}:</div>
-                                <div className='homework-detail-leave-content'>{item.content}</div>
-                            </div>
+                        <div style={{display: 'flex', paddingTop: 5, paddingBottom: 5}}>
+                            <div className="homework-detail-leave-name">{item.name}:</div>
+                            <div className='homework-detail-leave-content'>{item.content}</div>
+                        </div>
                     )}/>
             </div>
             {this.state.role === "teacher" ? "" :

+ 1 - 1
frontend/wechat-web/src/modules/leave/LeaveAddCPage.js

@@ -96,7 +96,7 @@ class LeaveAddCPage extends Component {
                         dismissText: '取消'
                     }}
                     onChange={date => this.setState({startValue: date})}>
-                    <List.Item arrow="horizontal"></List.Item>
+                    <List.Item arrow="horizontal">开始时间</List.Item>
                 </DatePicker>
 
                 <div className="comhline_sty1"></div>

+ 2 - 2
frontend/wechat-web/src/modules/leave/LeaveItem.js

@@ -29,8 +29,8 @@ export default class LeaveItem extends Component {
                                         <div>
                                             {
                                                 item.leaveMessages.length == 0 ?
-                                                    <div style={{fontSize: 12, color: "#FA5200"}}>未查阅</div>
-                                                    : <div style={{fontSize: 12, color: "##686868"}}>已查阅</div>
+                                                    <div style={{fontSize: 12, color: "#FA5200"}}>未回复</div>
+                                                    : <div style={{fontSize: 12, color: "##686868"}}>已回复</div>
                                             }
                                         </div>
                                 }

+ 7 - 0
frontend/wechat-web/src/modules/leave/LeaveListPage.css

@@ -12,4 +12,11 @@
     margin: 5px;
     border: #f5f5f5;
     background-color: #0098FD
+}
+
+.no_data{
+    background: #F4F4F4;
+    background-size: 100% 100%;
+    height: 100vh;
+    text-align: center;
 }

+ 16 - 11
frontend/wechat-web/src/modules/leave/LeaveListPage.js

@@ -20,6 +20,7 @@ import RefreshLayout from "../../components/RefreshLayout";
 import {saveListState} from "../../redux/actions/listState";
 import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
 import {Toast} from 'antd-mobile';
+import nodata_img from '../../style/imgs/no_data.png';
 
 let LEAVE_LIST_URL = ''
 let mPageIndex = 0
@@ -67,25 +68,29 @@ class LeaveListPage extends React.Component{
 
     render(){
         return <div   style={{background: '#F2F2F2'}}>
-
-            <RefreshLayout
+            {
+                this.state.data.length > 0 ?
+                    <RefreshLayout
                         refreshing={this.state.isRefreshing}
-                         ref={el => {
-                             this.container = el
+                        ref={el => {
+                            this.container = el
                         }}
                         onRefresh={this.getListData}>
                         <Skeleton loading={this.state.isLoading} active paragraph={{rows: 3}}>
-                            {/*{this.state.selectContentArray.map((itemata,index) => <UserItem index ={index} itemata = {itemata} handelRItem={this.handelRItem} removeSItem={this.removeSItem}></UserItem>)}*/}
                             {this.state.data.map((itemdata,index) =>  <LeaveItem itemdata={itemdata} role={this.state.role} index = {index} onItemClick={this.onItemClick.bind(this)}></LeaveItem>
                             )}
-                            {/*<List dataSource={this.state.data}*/}
-                                  {/*renderItem={(itemdata,index) =>(*/}
-                                      {/*<List.Item  >*/}
-                                          {/*<LeaveItem itemdata={itemdata} role={this.state.role} index = {index} onItemClick={this.onItemClick.bind(this)}></LeaveItem>*/}
-                                      {/*</List.Item>*/}
-                                  {/*)}/>*/}
+                            {/*  <List dataSource={this.state.data}
+                                  renderItem={(itemdata,index) =>(
+                                      <List.Item  >
+                                          <LeaveItem itemdata={itemdata} role={this.state.role} index = {index} onItemClick={this.onItemClick.bind(this)}></LeaveItem>
+                                      </List.Item>
+                                  )}/>*/}
                         </Skeleton>
                     </RefreshLayout>
+                    :
+                    <div className="no_data"><img src={nodata_img} alt="" style={{width:'100%',height:'100%'}}/></div>
+            }
+
                     {
                         this.state.role=="teacher"?(""):(<Icon type="plus-circle" theme='filled' className='common-add-icon'
                                                                onClick={this.onAddAction} />)

+ 2 - 2
frontend/wechat-web/src/style/css/consume-re.css

@@ -154,8 +154,8 @@
 }
 
 .notify-item-caption {
-    width: 70px;
-    margin: 0 10px;
+    width:80px;
+    margin: 0 0 0 10px;
     font-family: PingFangSC-Regular;
     font-size: 14px;
     color: #999999;

+ 0 - 1
frontend/wechat-web/src/style/css/phones.css

@@ -61,7 +61,6 @@
 }
 
 .phones-item-phone {
-    width: 100px;
     font-family: PingFangSC-Regular;
     font-size: 15px;
     color: #666666;

Some files were not shown because too many files changed in this diff