Browse Source

Merge remote-tracking branch 'origin/dev'

zhaoy 6 years ago
parent
commit
cbb7b87631
15 changed files with 215 additions and 101 deletions
  1. 1 1
      applications/device/device-client/src/main/java/com/usoftchina/smartschool/device/client/service/IcCardService.java
  2. 171 69
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/lib/DahuaLibrary.java
  3. 3 0
      applications/device/device-sdk-dahua/src/main/java/com/usoftchina/smartschool/device/dahua/service/DahuaDataAnalyzeService.java
  4. 12 7
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/IcCardServiceImpl.java
  5. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/ClassServiceImpl.java
  6. 0 9
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/CurriculumServiceImpl.java
  7. 5 3
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java
  8. 5 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/HomeWorkServiceImpl.java
  9. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/exception/BizExceptionCode.java
  10. 1 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java
  11. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysTeacherMapper.java
  12. 3 3
      applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml
  13. 4 0
      applications/school/school-server/src/main/resources/mapper/SysTeacherMapper.xml
  14. 4 1
      applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WechatApi.java
  15. 2 1
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/TransfersController.java

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

@@ -75,7 +75,7 @@ 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();

+ 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 +
+                    '}';
+        }
     }
 
     /**

+ 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));

+ 12 - 7
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,16 +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.beans.factory.annotation.Value;
-import org.springframework.http.*;
 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;
@@ -39,6 +36,9 @@ public class IcCardServiceImpl implements IcCardService {
     @Autowired
     private IcCardMapper icCardMapper;
 
+    @Autowired
+    private WechatApi wechatApi;
+
     @Value("${smartschool.wechat.pushUrl}")
     private String targetURL;
 
@@ -82,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));
@@ -99,7 +104,7 @@ public class IcCardServiceImpl implements IcCardService {
                     String ids = "'" + sb.substring(0, sb.length() - 1).replaceAll(",", "','") + "'";
                     return ids;
                 }
-            }
+            }*/
         }
         return null;
     }

+ 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.getSubject_name(),detail.getTeacher_id());
+            count = sysClazzMapper.teacherClazz(detail.getSubject_name(),clazz.getClazz_id());
             if(count > 0){
                 throw new BizException(BizExceptionCode.REPEAT_SUBJECTS);
             }

+ 0 - 9
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
@@ -306,9 +300,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

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

@@ -197,10 +197,12 @@ public class StudentServiceImpl implements StudentService{
                 json = JSONObject.parseObject(main.getDd_maindata());
                 if (null != json) {
                     if ("男".equals(json.get("stu_sex"))) {
-                        json.put("stu_sex", 1);
+                        json.put("stu_sex", 0);
                     }else if ("女".equals(json.get("stu_sex"))) {
-                        json.put("stu_sex", 2);
-                    };
+                        json.put("stu_sex", 1);
+                    }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);

+ 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 {
             //更新

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

@@ -25,7 +25,7 @@ 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, "学生学号不可重复"),

+ 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("subject_name") String subject_name,@Param("teacher_id") Long teacher_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);
 }

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

@@ -254,9 +254,9 @@
       <if test="subject_name != null">
         subject_name=#{subject_name}
       </if>
-        <if test="teacher_id != null">
-            and teacher_id=#{teacher_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("信息为空");
         }