Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

guq 6 years ago
parent
commit
0d9efbcfe2
23 changed files with 372 additions and 285 deletions
  1. 78 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/controller/MirrorController.java
  2. 24 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/MirrorService.java
  3. 92 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/impl/MirrorServiceImpl.java
  4. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SubjectMapper.java
  5. 2 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysClazzMapper.java
  6. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysGradeMapper.java
  7. 2 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/SysTeacherMapper.java
  8. 18 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/OutInRecordDO.java
  9. 20 1
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  10. 44 34
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java
  11. 1 14
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxOutInRecordMapper.java
  12. 12 0
      applications/school/school-server/src/main/resources/mapper/SubjectMapper.xml
  13. 12 0
      applications/school/school-server/src/main/resources/mapper/SysClazzMapper.xml
  14. 12 0
      applications/school/school-server/src/main/resources/mapper/SysGradeMapper.xml
  15. 12 0
      applications/school/school-server/src/main/resources/mapper/SysTeacherMapper.xml
  16. 1 88
      applications/school/school-server/src/main/resources/mapper/WxOutInRecordMapper.xml
  17. 0 70
      applications/school/school-server/src/test/java/com/usoftchina/smartschool/school/controller/MessageLogControllerTest.java
  18. 0 71
      applications/school/school-server/src/test/java/com/usoftchina/smartschool/school/service/CurriculumServiceTest.java
  19. 2 2
      applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/service/impl/WxPushServiceImpl.java
  20. 31 0
      frontend/wechat-web/src/index.js
  21. 4 1
      frontend/wechat-web/src/modules/hiPages/changephonenumber/ChangePhoneNumber.js
  22. 1 1
      frontend/wechat-web/src/modules/hiPages/send-vote/SelectItem.js
  23. 0 2
      frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

+ 78 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/controller/MirrorController.java

@@ -0,0 +1,78 @@
+package com.usoftchina.smartschool.school.common.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.page.PageDefault;
+import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.common.service.MirrorService;
+import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.po.Subject;
+import com.usoftchina.smartschool.school.po.SysClazz;
+import com.usoftchina.smartschool.school.po.SysGrade;
+import com.usoftchina.smartschool.school.po.SysTeacher;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 通用放大镜查询
+ * @author zhaoy
+ * @create 2019-03-04 15:31
+ */
+@RestController
+@RequestMapping("/mirror")
+public class MirrorController {
+
+    @Autowired
+    private MirrorService mirrorService;
+
+    /**
+     * 年级查询
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/findGrade")
+    public Result findGrade(@PageDefault PageRequest page, ListReqDTO listReqDTO){
+        PageInfo<SysGrade> pageInfo = mirrorService.getGradeData(page, listReqDTO);
+        return Result.success(pageInfo);
+    }
+
+    /**
+     * 班级查询
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/findClazz")
+    public Result findClazz(@PageDefault PageRequest page, ListReqDTO listReqDTO){
+        PageInfo<SysClazz> pageInfo = mirrorService.getClazzData(page, listReqDTO);
+        return Result.success(pageInfo);
+    }
+
+    /**
+     * 教师查询
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/findTeacher")
+    public Result findTeacher(@PageDefault PageRequest page, ListReqDTO listReqDTO){
+        PageInfo<SysTeacher> pageInfo = mirrorService.getTeacherData(page, listReqDTO);
+        return Result.success(pageInfo);
+    }
+
+    /**
+     * 科目查询
+     * @param page
+     * @param listReqDTO
+     * @return
+     */
+    @GetMapping("/findSubject")
+    public Result findSubject(@PageDefault PageRequest page, ListReqDTO listReqDTO){
+        PageInfo<Subject> pageInfo = mirrorService.getSubjectData(page, listReqDTO);
+        return Result.success(pageInfo);
+    }
+
+}

+ 24 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/MirrorService.java

@@ -0,0 +1,24 @@
+package com.usoftchina.smartschool.school.common.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.po.Subject;
+import com.usoftchina.smartschool.school.po.SysClazz;
+import com.usoftchina.smartschool.school.po.SysGrade;
+import com.usoftchina.smartschool.school.po.SysTeacher;
+
+/**
+ * @author zhaoy
+ * @create 2019-03-04 15:29
+ */
+public interface MirrorService {
+
+    PageInfo<SysGrade> getGradeData(PageRequest page, ListReqDTO listReqDTO);
+
+    PageInfo<SysClazz> getClazzData(PageRequest page, ListReqDTO listReqDTO);
+
+    PageInfo<SysTeacher> getTeacherData(PageRequest page, ListReqDTO listReqDTO);
+
+    PageInfo<Subject> getSubjectData(PageRequest page, ListReqDTO listReqDTO);
+}

+ 92 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/common/service/impl/MirrorServiceImpl.java

@@ -0,0 +1,92 @@
+package com.usoftchina.smartschool.school.common.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.smartschool.context.BaseContextHolder;
+import com.usoftchina.smartschool.page.PageRequest;
+import com.usoftchina.smartschool.school.common.service.MirrorService;
+import com.usoftchina.smartschool.school.dto.ListReqDTO;
+import com.usoftchina.smartschool.school.mapper.SubjectMapper;
+import com.usoftchina.smartschool.school.mapper.SysClazzMapper;
+import com.usoftchina.smartschool.school.mapper.SysGradeMapper;
+import com.usoftchina.smartschool.school.mapper.SysTeacherMapper;
+import com.usoftchina.smartschool.school.po.Subject;
+import com.usoftchina.smartschool.school.po.SysClazz;
+import com.usoftchina.smartschool.school.po.SysGrade;
+import com.usoftchina.smartschool.school.po.SysTeacher;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.List;
+
+/**
+ * @author zhaoy
+ * @create 2019-03-04 15:30
+ */
+@Service
+public class MirrorServiceImpl implements MirrorService {
+
+    @Autowired
+    private SysGradeMapper sysGradeMapper;
+    @Autowired
+    private SysClazzMapper sysClazzMapper;
+    @Autowired
+    private SysTeacherMapper sysTeacherMapper;
+    @Autowired
+    private SubjectMapper subjectMapper;
+
+    @Override
+    public PageInfo<SysGrade> getGradeData(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        Long schoolId = BaseContextHolder.getSchoolId();
+        List<SysGrade> sysGrade = sysGradeMapper.selectByGrade(condition,schoolId);
+        PageInfo<SysGrade> pageInfo = new PageInfo<SysGrade>(sysGrade);
+        return pageInfo;
+    }
+
+    @Override
+    public PageInfo<SysClazz> getClazzData(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        Long schoolId = BaseContextHolder.getSchoolId();
+        List<SysClazz> sysClazz = sysClazzMapper.selectByClazz(condition,schoolId);
+        PageInfo<SysClazz> pageInfo = new PageInfo<SysClazz>(sysClazz);
+        return pageInfo;
+    }
+
+    @Override
+    public PageInfo<SysTeacher> getTeacherData(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        Long schoolId = BaseContextHolder.getSchoolId();
+        List<SysTeacher> sysTeacher = sysTeacherMapper.selectByTeacher(condition,schoolId);
+        PageInfo<SysTeacher> pageInfo = new PageInfo<SysTeacher>(sysTeacher);
+        return pageInfo;
+    }
+
+    @Override
+    public PageInfo<Subject> getSubjectData(PageRequest page, ListReqDTO listReqDTO) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //condition语句
+        String condition = listReqDTO.getFinalCondition();
+        if(condition == null){
+            condition = "1=1";
+        }
+        Long schoolId = BaseContextHolder.getSchoolId();
+        List<Subject> subject = subjectMapper.selectBySubject(condition,schoolId);
+        PageInfo<Subject> pageInfo = new PageInfo<Subject>(subject);
+        return pageInfo;
+    }
+}

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

@@ -20,4 +20,6 @@ public interface SubjectMapper {
     int updateByPrimaryKey(Subject record);
 
     List<Subject> selectByConditon(@Param("con") String con, @Param("school_id") Long school_id);
+
+    List<Subject> selectBySubject(@Param("condition") String condition, @Param("school_id") Long schoolId);
 }

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

@@ -2,7 +2,6 @@ package com.usoftchina.smartschool.school.mapper;
 
 import com.usoftchina.smartschool.school.po.SysClazz;
 import com.usoftchina.smartschool.school.po.SysTeacherClazz;
-import com.usoftchina.smartschool.school.po.TeacherDetail;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -31,4 +30,6 @@ public interface SysClazzMapper {
     void insertTeacher(SysTeacherClazz teacher);
 
     void updateTeacher(SysTeacherClazz item);
+
+    List<SysClazz> selectByClazz(@Param("condition") String condition, @Param("school_id") Long schoolId);
 }

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

@@ -25,4 +25,6 @@ public interface SysGradeMapper {
     SysGrade selectByName(@Param("grade") String grade, @Param("school_id") Long school_id);
 
     int insertGrade(SysGrade grade);
+
+    List<SysGrade> selectByGrade(@Param("condition") String condition, @Param("school_id") Long schoolId);
 }

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

@@ -30,4 +30,6 @@ public interface SysTeacherMapper {
     SysTeacher selectByPhone(@Param("phone") String phone, @Param("school_id") Long school_id);
 
     void deleteRelation(Long id);
+
+    List<SysTeacher> selectByTeacher(@Param("condition") String condition, @Param("school_id") Long schoolId);
 }

+ 18 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/OutInRecordDO.java

@@ -33,6 +33,24 @@ public class OutInRecordDO implements Serializable {
 	private Long stuId;
 	//学校
 	private Long schoolId;
+	//设备号
+	private String deviceId;
+	//学号
+	private String stuNumber;
+	//学生姓名
+	private String stuName;
+	//年级id
+	private Long gradeId;
+	//年级名
+	private String gradeName;
+	//班级id
+	private Long clazzId;
+	//班级名
+	private String clazzName;
+	//年级-班级
+	private String gradeClazz;
+	//学生性别 1男  2女
+	private Integer stuSex;
 
 
 }

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

@@ -3,8 +3,8 @@ package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.usoftchina.smartschool.school.po.*;
-import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxPrincipalMailboxService;
+import com.usoftchina.smartschool.school.wxschool.mapper.*;
 import com.usoftchina.smartschool.school.wxschool.utils.JavaBeanUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import com.usoftchina.smartschool.wechat.api.WxPushApi;
@@ -42,6 +42,15 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 	@Autowired
 	private WxTemplateMapper wxTemplateMapper;
 
+	@Autowired
+	private WxStudentMapper wxStudentMapper;
+
+	@Autowired
+	private WxClazzMapper wxClazzMapper;
+
+	@Autowired
+	private WxGradeMapper wxGradeMapper;
+
 	/**
 	 * 校长信箱创建
 	 * @return
@@ -51,8 +60,18 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 		PrincipalMailboxDO principalMailboxDO = JSONObject.parseObject(mailboxString, PrincipalMailboxDO.class);
 		Long schoolId = parentsMapper.get(principalMailboxDO.getMailboxCreator()).getSchoolId();
 		principalMailboxDO.setNotifier(schoolMapper.get(schoolId).getTeacherId());
+		principalMailboxDO.setMbCreatorname(parentsMapper.get(principalMailboxDO.getMailboxCreator()).getParentsName());
 		principalMailboxDO.setSchoolId(schoolId);
 		principalMailboxDO.setCreateDate(new Date());
+		StudentDO studentDO = wxStudentMapper.get(principalMailboxDO.getMbStuid());
+		if (ObjectUtils.isNotEmpty(studentDO)){
+			principalMailboxDO.setMbStudent(studentDO.getStuName());
+			ClazzDO clazzDO = wxClazzMapper.get(studentDO.getClazzId());
+			principalMailboxDO.setMbClass(clazzDO.getClazzName());
+			principalMailboxDO.setMbGrade(wxGradeMapper.get(clazzDO.getGradeId()).getGradeName());
+		}
+
+
 		int save = principalMailboxMapper.save(principalMailboxDO);
 		if (save>0){
 			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

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

@@ -220,21 +220,26 @@ public class WxUserServiceImpl implements WxUserService {
 		if (ObjectUtils.isNotEmpty(teacherClazzDOS)){
 			for (TeacherClazzDO tc:teacherClazzDOS) {
 				ClazzDO clazzDO = clazzMapper.get(tc.getClazzId());
-				Map<String, Object> clazzMap = JavaBeanUtil.object2Map(clazzDO);
-				clazzMap.put("gradeName",gradeMapper.get(clazzDO.getGradeId()).getGradeName());
-				Map<String, Object> map = new HashMap<>();
-				map.put("clazzId",clazzDO.getClazzId());
-				List<StudentDO> studentDOS = studentMapper.list(map);
-				List<TeacherClazzDO> list = teacherClazzMapper.list(map);
-				List<TeacherDO> teacherDOS = new ArrayList<>();
-				for (TeacherClazzDO teacherClazzDO:list) {
-					TeacherDO teacherDO = teacherMapper.get(teacherClazzDO.getTeacherId());
-					teacherDO.setUserPhone(userMapper.get(teacherDO.getUserId()).getUserPhone());
-					teacherDOS.add(teacherDO);
+				if (ObjectUtils.isNotEmpty(clazzDO)){
+					Map<String, Object> clazzMap = JavaBeanUtil.object2Map(clazzDO);
+					clazzMap.put("gradeName",gradeMapper.get(clazzDO.getGradeId()).getGradeName());
+					Map<String, Object> map = new HashMap<>();
+					map.put("clazzId",clazzDO.getClazzId());
+					List<StudentDO> studentDOS = studentMapper.list(map);
+					List<TeacherClazzDO> list = teacherClazzMapper.list(map);
+					if (ObjectUtils.isNotEmpty(studentDOS)){
+						List<TeacherDO> teacherDOS = new ArrayList<>();
+						for (TeacherClazzDO teacherClazzDO:list) {
+							TeacherDO teacherDO = teacherMapper.get(teacherClazzDO.getTeacherId());
+							teacherDO.setUserPhone(userMapper.get(teacherDO.getUserId()).getUserPhone());
+							teacherDOS.add(teacherDO);
+						}
+						clazzMap.put("studentDOS",removeDuplicate(studentDOS));
+						clazzMap.put("teacherDOS",removeDuplicate(teacherDOS));
+						maps.add(clazzMap);
+					}
 				}
-				clazzMap.put("studentDOS",removeDuplicate(studentDOS));
-				clazzMap.put("teacherDOS",removeDuplicate(teacherDOS));
-				maps.add(clazzMap);
+
 			}
 			return maps;
 		}else {
@@ -410,25 +415,14 @@ public class WxUserServiceImpl implements WxUserService {
 	 * @throws Exception
 	 */
 	public int updatePhone(String userPhone, String openid, String code) throws Exception {
-		Map<String, Object> map = new HashMap<>();
-		map.put("openid",openid);
-		List<ParentsDO> parentsDOS = parentsMapper.list(map);
-		List<TeacherDO> teacherDOS = teacherMapper.list(map);
-		if (ObjectUtils.isNotEmpty(parentsDOS)){
-			UserDO userDO = userMapper.get(parentsDOS.get(0).getUserId());
-			if (ObjectUtils.isNotEmpty(userDO)) {
-				if (code.equals(userDO.getUserCode())) {
-					userDO.setUserPhone(userPhone);
-					return userMapper.update(userDO);
-				}else {
-					throw new Exception("验证码错误,请核实");
-				}
-			}else {
-				throw new Exception("用户不存在,请联系管理员");
-			}
-		}else {
-			if (ObjectUtils.isNotEmpty(teacherDOS)){
-				UserDO userDO = userMapper.get(teacherDOS.get(0).getUserId());
+		UserDO user = userMapper.selectUserByPhone(userPhone);
+		if (ObjectUtils.isEmpty(user)){
+			Map<String, Object> map = new HashMap<>();
+			map.put("openid",openid);
+			List<ParentsDO> parentsDOS = parentsMapper.list(map);
+			List<TeacherDO> teacherDOS = teacherMapper.list(map);
+			if (ObjectUtils.isNotEmpty(parentsDOS)){
+				UserDO userDO = userMapper.get(parentsDOS.get(0).getUserId());
 				if (ObjectUtils.isNotEmpty(userDO)) {
 					if (code.equals(userDO.getUserCode())) {
 						userDO.setUserPhone(userPhone);
@@ -440,8 +434,24 @@ public class WxUserServiceImpl implements WxUserService {
 					throw new Exception("用户不存在,请联系管理员");
 				}
 			}else {
-				throw new Exception("用户不存在,请联系管理员");
+				if (ObjectUtils.isNotEmpty(teacherDOS)){
+					UserDO userDO = userMapper.get(teacherDOS.get(0).getUserId());
+					if (ObjectUtils.isNotEmpty(userDO)) {
+						if (code.equals(userDO.getUserCode())) {
+							userDO.setUserPhone(userPhone);
+							return userMapper.update(userDO);
+						}else {
+							throw new Exception("验证码错误,请核实");
+						}
+					}else {
+						throw new Exception("用户不存在,请联系管理员");
+					}
+				}else {
+					throw new Exception("用户不存在,请联系管理员");
+				}
 			}
+		}else {
+			throw new Exception("该手机号已绑定用户,请联系管理员");
 		}
 	}
 

+ 1 - 14
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxOutInRecordMapper.java

@@ -5,7 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 出入校通知表; InnoDB free: 5120 kB
@@ -17,18 +16,6 @@ import java.util.Map;
 public interface WxOutInRecordMapper {
 
 	OutInRecordDO get(Long recordId);
-	
-	List<OutInRecordDO> list(Map<String, Object> map);
-	
-	int count(Map<String, Object> map);
-	
-	int save(OutInRecordDO outInRecord);
-	
-	int update(OutInRecordDO outInRecord);
-	
-	int remove(Long record_id);
-	
-	int batchRemove(Long[] recordIds);
 
-	public List<OutInRecordDO> selectOutInRecordDOListByStuId(@Param("stuId") Long stuId, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);
+	List<OutInRecordDO> selectOutInRecordDOListByStuId(@Param("stuId") Long stuId, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);
 }

+ 12 - 0
applications/school/school-server/src/main/resources/mapper/SubjectMapper.xml

@@ -88,4 +88,16 @@
   </where>
     order by subject_id DESC
   </select>
+
+  <select id="selectBySubject" resultMap="BaseResultMap">
+    select * from subject
+    <where>
+      <if test="condition != null">
+        ${condition}
+      </if>
+      <if test="school_id != null">
+        and school_id=#{school_id}
+      </if>
+    </where>
+  </select>
 </mapper>

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

@@ -220,4 +220,16 @@
     </set>
     where teacher_clazz_id = #{teacher_clazz_id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectByClazz" resultMap="BaseResultMap">
+    select * from sys_clazz
+    <where>
+      <if test="condition != null">
+        ${condition}
+      </if>
+      <if test="school_id != null">
+        and school_id=#{school_id}
+      </if>
+    </where>
+  </select>
 </mapper>

+ 12 - 0
applications/school/school-server/src/main/resources/mapper/SysGradeMapper.xml

@@ -113,4 +113,16 @@
     not  exists (select 1 from sys_grade where grade_name = #{grade_name} and school_id = #{school_id})
   </insert>
 
+  <select id="selectByGrade" resultMap="BaseResultMap">
+    select * from sys_grade
+    <where>
+      <if test="condition != null">
+        ${condition}
+      </if>
+      <if test="school_id != null">
+        and school_id=#{school_id}
+      </if>
+    </where>
+  </select>
+
 </mapper>

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

@@ -360,4 +360,16 @@ where sys_teacher_clazz.teacher_id=#{id}
   <delete id="deleteRelation">
     delete from sys_teacher_clazz where teacher_id=#{teacher_id}
   </delete>
+
+  <select id="selectByTeacher" resultMap="BaseResultMap">
+    select * from sys_teacher
+    <where>
+      <if test="condition != null">
+        ${condition}
+      </if>
+      <if test="school_id != null">
+        and school_id=#{school_id}
+      </if>
+    </where>
+  </select>
 </mapper>

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

@@ -4,100 +4,13 @@
 <mapper namespace="com.usoftchina.smartschool.school.wxschool.mapper.WxOutInRecordMapper">
 
     <sql id="OutInRecordVo">
-    select `record_id`,`record_name`,`out_date`,`in_date`,`record_details`,`record_remarks`,`stu_id`,`school_id` from out_in_record
+    select `record_id`,`record_name`,`out_date`,`in_date`,`record_details`,`record_remarks`,`stu_id`,`school_id`,`device_id`,`stu_number`,`stu_name`,`grade_id`,`grade_name`,`clazz_id`,`clazz_name`,`grade_clazz`,`stu_sex` from out_in_record
     </sql>
 
 	<select id="get" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">
 		<include refid="OutInRecordVo"/> where record_id = #{value}
 	</select>
 
-	<select id="list" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">
-        <include refid="OutInRecordVo"/>
-        <where>  
-		  		  <if test="recordId != null and recordId != ''"> and record_id = #{recordId} </if>
-		  		  <if test="recordName != null and recordName != ''"> and record_name = #{recordName} </if>
-		  		  <if test="outDate != null and outDate != ''"> and out_date = #{outDate} </if>
-		  		  <if test="inDate != null and inDate != ''"> and in_date = #{inDate} </if>
-		  		  <if test="recordDetails != null and recordDetails != ''"> and record_details = #{recordDetails} </if>
-		  		  <if test="recordRemarks != null and recordRemarks != ''"> and record_remarks = #{recordRemarks} </if>
-		  		  <if test="stuId != null and stuId != ''"> and stu_id = #{stuId} </if>
-		  		  <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
-		  		</where>
-        <choose>
-            <when test="sort != null and sort.trim() != ''">
-                order by ${sort} ${order}
-            </when>
-			<otherwise>
-                order by record_id desc
-			</otherwise>
-        </choose>
-		<if test="offset != null and limit != null">
-			limit #{offset}, #{limit}
-		</if>
-	</select>
-	
- 	<select id="count" resultType="int">
-		select count(*) from out_in_record
-		 <where>  
-		  		  <if test="recordId != null and recordId != ''"> and record_id = #{recordId} </if>
-		  		  <if test="recordName != null and recordName != ''"> and record_name = #{recordName} </if>
-		  		  <if test="outDate != null and outDate != ''"> and out_date = #{outDate} </if>
-		  		  <if test="inDate != null and inDate != ''"> and in_date = #{inDate} </if>
-		  		  <if test="recordDetails != null and recordDetails != ''"> and record_details = #{recordDetails} </if>
-		  		  <if test="recordRemarks != null and recordRemarks != ''"> and record_remarks = #{recordRemarks} </if>
-		  		  <if test="stuId != null and stuId != ''"> and stu_id = #{stuId} </if>
-		  		  <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId} </if>
-		  		</where>
-	</select>
-	 
-	<insert id="save" parameterType="com.usoftchina.smartschool.school.po.OutInRecordDO" useGeneratedKeys="true" keyProperty="recordId">
-		insert into out_in_record
-		(
-			`record_name`, 
-			`out_date`, 
-			`in_date`, 
-			`record_details`, 
-			`record_remarks`, 
-			`stu_id`, 
-			`school_id`
-		)
-		values
-		(
-			#{recordName}, 
-			#{outDate}, 
-			#{inDate}, 
-			#{recordDetails}, 
-			#{recordRemarks}, 
-			#{stuId}, 
-			#{schoolId}
-		)
-	</insert>
-	 
-	<update id="update" parameterType="com.usoftchina.smartschool.school.po.OutInRecordDO">
-		update out_in_record 
-		<set>
-			<if test="recordName != null">`record_name` = #{recordName}, </if>
-			<if test="outDate != null">`out_date` = #{outDate}, </if>
-			<if test="inDate != null">`in_date` = #{inDate}, </if>
-			<if test="recordDetails != null">`record_details` = #{recordDetails}, </if>
-			<if test="recordRemarks != null">`record_remarks` = #{recordRemarks}, </if>
-			<if test="stuId != null">`stu_id` = #{stuId}, </if>
-			<if test="schoolId != null">`school_id` = #{schoolId}</if>
-		</set>
-		where record_id = #{recordId}
-	</update>
-	
-	<delete id="remove">
-		delete from out_in_record where record_id = #{value}
-	</delete>
-	
-	<delete id="batchRemove">
-		delete from out_in_record where record_id in 
-		<foreach item="recordId" collection="array" open="(" separator="," close=")">
-			#{recordId}
-		</foreach>
-	</delete>
-
 	<select id="selectOutInRecordDOListByStuId" resultType="com.usoftchina.smartschool.school.po.OutInRecordDO">
 		<include refid="OutInRecordVo"/> where stu_id = #{stuId}
 		order by record_id desc

+ 0 - 70
applications/school/school-server/src/test/java/com/usoftchina/smartschool/school/controller/MessageLogControllerTest.java

@@ -1,70 +0,0 @@
-package com.usoftchina.smartschool.school.controller;
-
-import com.github.pagehelper.PageInfo;
-import com.usoftchina.smartschool.base.Result;
-import com.usoftchina.smartschool.context.BaseContextHolder;
-import com.usoftchina.smartschool.school.dto.DocBaseDTO;
-import com.usoftchina.smartschool.test.BaseControllerTest;
-import com.usoftchina.smartschool.utils.JsonUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.MvcResult;
-
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-@EnableAutoConfiguration
-public class MessageLogControllerTest extends BaseControllerTest {
-
-    private static final String CODE = "Curriculum";
-    private static final String NAME = "课程表";
-
-    @Test
-    public void testA_getListData() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        MvcResult mvcResult = mockMvc.perform(get("/messagelog/list"))
-                .andExpect(isSuccess())
-                .andReturn();
-        Result<PageInfo> result = result(mvcResult, PageInfo.class);
-        System.out.println(JsonUtils.toJsonString(result.getData()));
-    }
-
-    @Test
-    public void testB_save() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/save", docBaseDTO));
-    }
-
-    @Test
-    public void testC_update() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/update", docBaseDTO));
-    }
-
-    @Test
-    public void testD_delete() throws Exception {
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        BaseContextHolder.setSchoolId(1L);
-        mockMvc.perform(requestBody("/messagelog/delete", docBaseDTO));
-    }
-
-    @Test
-    public void testE_deleteDetail() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/deleteDetail", docBaseDTO));
-    }
-
-    @Test
-    public void testF_customizeLog() throws Exception {
-        BaseContextHolder.setSchoolId(1L);
-        DocBaseDTO docBaseDTO = new DocBaseDTO(1L, CODE, NAME);
-        mockMvc.perform(requestBody("/messagelog/customizeLog", docBaseDTO));
-    }
-
-}

+ 0 - 71
applications/school/school-server/src/test/java/com/usoftchina/smartschool/school/service/CurriculumServiceTest.java

@@ -1,71 +0,0 @@
-package com.usoftchina.smartschool.school.service;
-
-import com.github.pagehelper.PageInfo;
-import com.usoftchina.smartschool.context.BaseContextHolder;
-import com.usoftchina.smartschool.page.PageRequest;
-import com.usoftchina.smartschool.school.basic.service.CurriculumService;
-import com.usoftchina.smartschool.school.dto.CurriculumFormDTO;
-import com.usoftchina.smartschool.school.dto.CurriculumListDTO;
-import com.usoftchina.smartschool.school.dto.ListReqDTO;
-import com.usoftchina.smartschool.utils.JsonUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-/**
- * @Description
- * @Author chenwei
- * @Date 2019/02/19
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringBootTest
-@EnableAutoConfiguration
-public class CurriculumServiceTest {
-
-    @Autowired
-    private CurriculumService curriculumService;
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(CurriculumServiceTest.class);
-
-    @Test
-    public void testA_selectAll(){
-        LOGGER.info("===============test selectAll start==============");
-        PageRequest pageRequest = new PageRequest(1, 8);
-        BaseContextHolder.setSchoolId(1);
-        PageInfo<CurriculumListDTO> pageInfo = curriculumService.selectAll(pageRequest, new ListReqDTO());
-        LOGGER.info("pageInfo={}", JsonUtils.toJsonString(pageInfo));
-        LOGGER.info("===============test selectAll end================");
-
-    }
-
-    @Test
-    public void testB_read(){
-        LOGGER.info("===============test read start==============");
-        CurriculumFormDTO curriculumFormDTO = curriculumService.read(1L);
-        LOGGER.info("curriculumFormDTO={}", JsonUtils.toJsonString(curriculumFormDTO));
-        LOGGER.info("===============test read end================");
-    }
-
-    @Test
-    public void testC_save(){
-        LOGGER.info("===============test save start==============");
-        LOGGER.info("===============test save end================");
-    }
-
-    @Test
-    public void testE_delete(){
-        LOGGER.info("===============test delete start==============");
-        LOGGER.info("===============test delete end================");
-    }
-
-    @Test
-    public void testF_deleteDetail(){
-        LOGGER.info("===============test deleteDetail start==============");
-        LOGGER.info("===============test deleteDetail end================");
-    }
-}

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

@@ -36,14 +36,14 @@ public class WxPushServiceImpl implements WxPushService{
                 params.put("grant_type", "client_credential");
                 HttpRequest httpRequest= HttpRequest.get("https://api.weixin.qq.com/cgi-bin/token",params,false);
                 String content=httpRequest.body();
-                //System.err.println("getWxAccessTokenContent======"+content);
+                System.err.println("getWxAccessTokenContent======"+content);
                 String token= JSON.parseObject(content).getString("access_token");
                 //System.err.println("getWxAccessTokenToken====="+ token);
                 HttpRequest hRequest=  HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token)
                         .header("Content-Type", "application/json")
                         .send(json.getBytes());
                 String result= hRequest.body();
-                //System.err.println("WxPushResult======="+result);
+                System.err.println("WxPushResult======="+result);
 
 			/*if(JSON.parseObject(result).getInteger("errcode")==0&&JSON.parseObject(result).getString("errmsg").equals("ok")){
 				return "推送成功!";

+ 31 - 0
frontend/wechat-web/src/index.js

@@ -15,6 +15,37 @@ import 'moment/locale/zh-cn';
 
 moment.locale('zh-cn');
 
+//解决在某些内核版本较低的浏览器上会出现的Object.assign is not a function错误
+if (typeof Object.assign != 'function') {
+    // Must be writable: true, enumerable: false, configurable: true
+    Object.defineProperty(Object, "assign", {
+        value: function assign(target, varArgs) { // .length of function is 2
+            'use strict';
+            if (target == null) { // TypeError if undefined or null
+                throw new TypeError('Cannot convert undefined or null to object');
+            }
+
+            var to = Object(target);
+
+            for (var index = 1; index < arguments.length; index++) {
+                var nextSource = arguments[index];
+
+                if (nextSource != null) { // Skip over if undefined or null
+                    for (var nextKey in nextSource) {
+                        // Avoid bugs when hasOwnProperty is shadowed
+                        if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
+                            to[nextKey] = nextSource[nextKey];
+                        }
+                    }
+                }
+            }
+            return to;
+        },
+        writable: true,
+        configurable: true
+    });
+}
+
 ReactDOM.render(<LocaleProvider locale={zh_CN}>
         <Provider store={store}>
             <PersistGate loading={null} persistor={persistor}>

+ 4 - 1
frontend/wechat-web/src/modules/hiPages/changephonenumber/ChangePhoneNumber.js

@@ -77,16 +77,19 @@ let mSeconds = 0;
              openid:this.props.userInfo.user.userOpenid,
              code:this.state.vCode,
          }
-         fetchPost(API.updatePhone,{params},{})
+         fetchPost(API.updatePhone,params,{})
              .then((response)=>{
                  console.log('response',response)
                  if(response.success){
+                     Toast.show("绑定成功")
                      this.setState({
                          changeSuccess:true
                      },function () {
                          // this.props.history.push('/homepage/')
                          this.props.history.goBack()
                      })
+                 }else {
+                     Toast.show("绑定失败")
                  }
              })
              .catch((error) =>{

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

@@ -22,7 +22,7 @@ export default class SelectItem extends Component {
                     <textarea rows="1" ref='itemContent' type="text"
                               placeholder="请输入选项内容" value={this.props.itemata == null ? '' : this.props.itemata}
                               className="textarea_sty" style={{resize: 'none', width: '90%'}}/>
-                    {(this.props.index != 0 && this.props.index != 1) ?
+                    {(this.props.index > 1 ) ?
                         <Icon type="minus-circle" style={{fontSize: '17px', color: '#ff0a0a'}}
                               onClick={this.itemEmpty}/> : ''}
                 </div>

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

@@ -19,8 +19,6 @@ import UploadEnclosure from '../../../components/UploadEnclosure';
 import {connect} from 'react-redux';
 import {clearListState} from "../../../redux/actions/listState";
 
-const Option = Select.Option;
-const {TextArea} = Input;
 
 class SendVote extends Component {
     componentWillMount() {