Browse Source

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

chenw 7 years ago
parent
commit
5b2c77eccd

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

@@ -151,8 +151,8 @@ public class NoticeServiceImpl implements NoticeService{
         List<SchoolNoticer> noticerList = new ArrayList<>();
         noticers.forEach(noticer -> {
             MessageInfoDTO msg = new MessageInfoDTO();
-            String endUrl = null;
-            if (!StringUtils.isEmpty(noticer.getPersonId())) {
+            String url = null;
+            if (!StringUtils.isEmpty(noticer.getType()) && !StringUtils.isEmpty(noticer.getPersonId())) {
                 /*if ("1".equals(noticer.getType().split(",")[0])) {
                     endUrl = "/parent/" + id + "?stuId=" + noticer.getPersonId().split(",")[0];
                     noticer.setType("1");
@@ -163,7 +163,8 @@ public class NoticeServiceImpl implements NoticeService{
                     noticer.setPersonId(noticer.getPersonId().split(",")[0]);
                 }*/
 
-                String url = baseWechatUrl + "/notifyDetail/person?noticeId=" + id + "&personId=" + noticer.getPersonId();
+                url = baseWechatUrl + "/notifyDetail/person/" + id + "?personId=" + noticer.getPersonId().split(",")[0] +
+                        "&type=" + noticer.getType().split(",")[0];
                 msg.setUrl(url);
                 msg.setTitle(data.getNotify_title());
                 msg.setKeyword1(school.getSchool_name());

+ 2 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxNotifyController.java

@@ -95,8 +95,8 @@ public class WxNotifyController {
 		if (null == type || null == personId) {
 			throw new BizException(BizExceptionCode.USELESS_DATA);
 		}
-		List<NotifyDO> notifyDOS = notifyService.notifyList(personId, notifyStatus, pageIndex, pageSize, type);
-		return Result.success(notifyDOS);
+		Object data = notifyService.notifyList(personId, notifyStatus, pageIndex, pageSize, type);
+		return Result.success(data);
 	}
 
 /*	*//**

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

@@ -47,7 +47,7 @@ public interface WxNotifyService {
 	 * @param pageIndex
 	 * @param pageSize
 	 */
-	public List<NotifyDO> notifyList(Long stuId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type);
+	public Object notifyList(Long stuId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type);
 
 	/**
 	 * 家长端获取通知详情

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

@@ -171,11 +171,11 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	 * @param pageIndex
 	 * @param pageSize
 	 */
-	public List<NotifyDO> notifyListByTeacher(Long teacherId, Integer notifyStatus, Integer pageIndex, Integer pageSize){
-		//Map<String, Object> hashMap = new HashMap<>();
+	public Map<String, Object> notifyListByTeacher(Long teacherId, Integer notifyStatus, Integer pageIndex, Integer pageSize){
+		Map<String, Object> hashMap = new HashMap<>();
 		Integer pageStart = (pageIndex-1)*pageSize;
-		//List<NotifyDO> notifyDOS = notifyMapper.selectNotifyListByCreator(teacherId, notifyStatus, pageStart, pageSize);
-		/*List<NotifyDO> createList = new ArrayList<>();
+		List<NotifyDO> notifyDOS = notifyMapper.selectNotifyListByCreator(teacherId, notifyStatus, pageStart, pageSize);
+		List<NotifyDO> createList = new ArrayList<>();
 		if (ObjectUtils.isNotEmpty(notifyDOS)){
 			for (NotifyDO nt:notifyDOS) {
 				NotifyDO notifyDO = getNotifyDetail(0L,teacherId, nt);
@@ -183,7 +183,7 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 				createList.add(notifyDO);
 			}
 		}
-		hashMap.put("create",createList);*/
+		hashMap.put("create",createList);
 
 		List<NotifyDO> notifyList = new ArrayList<>();
 		TeacherDO teacherDO = teacherMapper.get(teacherId);
@@ -195,8 +195,8 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 				notifyList.add(notifyDO);
 			}
 		}
-		//hashMap.put("notify",notifyList);
-		return notifyList;
+		hashMap.put("notify",notifyList);
+		return hashMap;
 	}
 
 
@@ -229,20 +229,18 @@ public class WxNotifyServiceImpl implements WxNotifyService {
 	 * @param pageIndex
 	 * @param pageSize
 	 */
-	public List<NotifyDO> notifyList(Long personId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type) {
+	public Object notifyList(Long personId, Integer notifyStatus, Integer pageIndex, Integer pageSize, Integer type) {
 		if (null == pageIndex) {
 			pageIndex = 1;
 		}
 		if (null == pageSize) {
 			pageIndex = 10;
 		}
-		List<NotifyDO> notifyList = null;
 		if (0 == type) {
-			notifyList = notifyListByStu(personId, notifyStatus, pageIndex, pageSize);
+			return notifyListByStu(personId, notifyStatus, pageIndex, pageSize);
 		} else {
-			notifyList = notifyListByTeacher(personId, notifyStatus, pageIndex, pageSize);
+			return notifyListByTeacher(personId, notifyStatus, pageIndex, pageSize);
 		}
-		return notifyList;
 	}
 
 	/**

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

@@ -227,8 +227,9 @@
   </select>
 
   <select id="selectNoticer" parameterType="long" resultType="com.usoftchina.smartschool.school.po.SchoolNoticer">
-    select openid,stu_id personId from sys_parents  left join sys_parents_stu on sys_parents.parent_id = sys_parents_stu.parent_id where sys_parents.school_id=#{schoolId} and ifnull(openid,'') != '' and parents_status=1 union
-	select openid,teacher_id personId from sys_teacher where school_id=#{schoolId} and ifnull(openid,'') != '' and teacher_status=1
+     select openid,noticer,GROUP_CONCAT(personId) personId,GROUP_CONCAT(type) type from (
+      select openid,parents_name noticer,parentstu.stu_id personId,'0' type from sys_parents parent left join sys_parents_stu parentstu on parent.parent_id = parentstu.parent_id where school_id=#{schoolId} and ifnull(openid,'') != '' and parents_status=1  union
+      select openid,teacher_name noticer,teacher_id personId, '1' type from sys_teacher where school_id=#{schoolId} and ifnull(openid,'') != '' and teacher_status=1 ) tab_  GROUP BY openid,noticer
   </select>
 
   <insert id="insertDetailBySelective">

+ 15 - 2
applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml

@@ -23,7 +23,13 @@
   </resultMap>
 
   <select id="selectByConditon" resultMap="BaseResultMap">
-    select * from principal_mailbox
+    select mailbox_id,mailbox_title,is_anonymity,create_date,mailbox_creator,read_date,mailbox_status,notifier,school_id,mb_stuid,
+    case is_anonymity when 1 then '匿名' else mb_student end mb_student,
+    case is_anonymity when 1 then null else mb_grade end mb_grade,
+    case is_anonymity when 1 then null else mb_class end mb_class,
+    case is_anonymity when 1 then '匿名' else mb_creatorname end mb_creatorname,
+    mailbox_context,mailbox_files,mb_reply,mb_ignore
+    from principal_mailbox
     <where>
       <if test="con != null">
         ${con}
@@ -63,7 +69,14 @@
   </insert>
 
   <select id="selectByPrimaryKey" parameterType="long" resultMap="BaseResultMap">
-    select * from principal_mailbox where mailbox_id = #{id}
+    select
+     mailbox_id,mailbox_title,is_anonymity,create_date,mailbox_creator,read_date,mailbox_status,notifier,school_id,mb_stuid,
+    case is_anonymity when 1 then '匿名' else mb_student end mb_student,
+    case is_anonymity when 1 then null else mb_grade end mb_grade,
+    case is_anonymity when 1 then null else mb_class end mb_class,
+    case is_anonymity when 1 then '匿名' else mb_creatorname end mb_creatorname,
+    mailbox_context,mailbox_files,mb_reply,mb_ignore
+     from principal_mailbox where mailbox_id = #{id}
   </select>
 
 </mapper>