Przeglądaj źródła

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

zhaoy 6 lat temu
rodzic
commit
3d38d7fd1a

+ 33 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/controller/PrincipalMailController.java

@@ -7,7 +7,7 @@ import com.usoftchina.smartschool.page.PageRequest;
 import com.usoftchina.smartschool.school.business.service.PrincipalMailService;
 import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
-import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -25,7 +25,7 @@ public class PrincipalMailController {
 
     @GetMapping("/list")
     public Result getList(@PageDefault PageRequest page, ListReqDTO listReqDTO) {
-        PageInfo<PrincipalMailboxDO> data = principalMailService.getListData(page, listReqDTO);
+        PageInfo<PrincipalMail> data = principalMailService.getListData(page, listReqDTO);
         return Result.success(data);
     }
 
@@ -40,4 +40,35 @@ public class PrincipalMailController {
         return Result.success();
     }
 
+
+    /**
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchIgnore")
+    public Result batchIgnore(@RequestBody BatchDealBaseDTO baseDTOs) {
+        principalMailService.batchIgnore(baseDTOs);
+        return Result.success();
+    }
+
+    /**
+     * @param baseDTOs
+     * @return
+     */
+    @PostMapping("/batchUnIgnore")
+    public Result batchUnIgnore(@RequestBody BatchDealBaseDTO baseDTOs) {
+        principalMailService.batchUnIgnore(baseDTOs);
+        return Result.success();
+    }
+
+
+    /**
+     * @return
+     */
+    @PostMapping("/reply")
+    public Result reply(String msg, Long id) {
+        principalMailService.reply(msg, id);
+        return Result.success();
+    }
+
 }

+ 8 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/PrincipalMailService.java

@@ -4,10 +4,16 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.smartschool.page.PageRequest;
 import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
-import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
 
 public interface PrincipalMailService {
-    PageInfo<PrincipalMailboxDO> getListData(PageRequest page, ListReqDTO listReqDTO);
+    PageInfo<PrincipalMail> getListData(PageRequest page, ListReqDTO listReqDTO);
 
     void batchDelete(BatchDealBaseDTO baseDTOs);
+
+    void batchIgnore(BatchDealBaseDTO baseDTOs);
+
+    void batchUnIgnore(BatchDealBaseDTO baseDTOs);
+
+    void reply(String msg, Long id);
 }

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

@@ -3,16 +3,22 @@ package com.usoftchina.smartschool.school.business.service.impl;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.usoftchina.smartschool.context.BaseContextHolder;
+import com.usoftchina.smartschool.exception.BizException;
 import com.usoftchina.smartschool.page.PageRequest;
 import com.usoftchina.smartschool.school.business.service.PrincipalMailService;
 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.PrincipalMailboxMapper;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
 import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.po.PrincipalReplyDO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -26,7 +32,7 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
     private PrincipalMailboxMapper principalMailboxMapper;
 
     @Override
-    public PageInfo<PrincipalMailboxDO> getListData(PageRequest page, ListReqDTO listReqDTO) {
+    public PageInfo<PrincipalMail> getListData(PageRequest page, ListReqDTO listReqDTO) {
         PageHelper.startPage(page.getNumber(), page.getSize());
         Long schoolId = BaseContextHolder.getSchoolId();
         schoolId = 1l;
@@ -35,8 +41,8 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
         if(condition == null){
             condition = "1=1";
         }
-        List<PrincipalMailboxDO> data = principalMailboxMapper.selectByConditon(condition, schoolId);
-        PageInfo<PrincipalMailboxDO> list = new PageInfo<>(data);
+        List<PrincipalMail> data = principalMailboxMapper.selectByConditon(condition, schoolId);
+        PageInfo<PrincipalMail> list = new PageInfo<>(data);
         return list;
     }
 
@@ -52,7 +58,44 @@ public class PrincipalMailServiceImpl implements PrincipalMailService {
         }
     }
 
+    @Override
+    public void batchIgnore(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        List<DocBaseDTO> base = baseDTOs.getBaseDTOs();
+        principalMailboxMapper.batchIgnore(base);
+    }
+
+    @Override
+    public void batchUnIgnore(BatchDealBaseDTO baseDTOs) {
+        if (null == baseDTOs || null == baseDTOs.getBaseDTOs() ||
+                baseDTOs.getBaseDTOs().size() == 0) {
+            return;
+        }
+        List<DocBaseDTO> base = baseDTOs.getBaseDTOs();
+        principalMailboxMapper.batchUnIgnore(base);
+    }
+
+    @Override
+    public void reply(String msg, Long id) {
+        if (StringUtils.isEmpty(msg) || StringUtils.isEmpty(id)) {
+            throw new BizException(BizExceptionCode.USELESS_DATA);
+        }
+        //更新主表
+        principalMailboxMapper.updateReply(msg, id);
+
+        PrincipalReplyDO replyDO = new PrincipalReplyDO();
+        replyDO.setMailboxId(id);
+        replyDO.setReplyContent(msg);
+        replyDO.setReplyDate(new Date());
+        //插入从表
+        principalMailboxMapper.insertDetail(replyDO);
+    }
+
     private void singleDelete(Long id) {
         principalMailboxMapper.deleteByPrimaryKey(id);
     }
+
 }

+ 14 - 2
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/mapper/PrincipalMailboxMapper.java

@@ -1,6 +1,8 @@
 package com.usoftchina.smartschool.school.mapper;
 
-import com.usoftchina.smartschool.school.po.PrincipalMailboxDO;
+import com.usoftchina.smartschool.school.dto.DocBaseDTO;
+import com.usoftchina.smartschool.school.po.PrincipalMail;
+import com.usoftchina.smartschool.school.po.PrincipalReplyDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -15,5 +17,15 @@ public interface PrincipalMailboxMapper {
 
     PrincipalMailboxDO selectByPrimaryKey(Long mailbox_id);*/
 
-    List<PrincipalMailboxDO> selectByConditon(@Param("con") String condition, @Param("school_id") Long schoolId);
+    List<PrincipalMail> selectByConditon(@Param("con") String condition, @Param("school_id") Long schoolId);
+
+    //void ignore(Long id);
+
+  void batchIgnore(List<DocBaseDTO> baseDTOs);
+
+  void batchUnIgnore(List<DocBaseDTO> base);
+
+  void updateReply(@Param("msg") String msg, @Param("id") Long id);
+
+  void insertDetail(PrincipalReplyDO replyDO);
 }

+ 49 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/PrincipalMail.java

@@ -0,0 +1,49 @@
+package com.usoftchina.smartschool.school.po;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author: guq
+ * @create: 2019-03-01 09:41
+ **/
+@Data
+public class PrincipalMail implements Serializable{
+    private Long mailbox_id;
+
+    private String mailbox_title;
+
+    private Integer is_anonymity;
+
+    private Date create_date;
+
+    private Long mailbox_creator;
+
+    private Date read_date;
+
+    private Integer mailbox_status;
+
+    private Long notifier;
+
+    private Long school_id;
+
+    private Long mb_stuid;
+
+    private String mb_student;
+
+    private String mb_grade;
+
+    private String mb_class;
+
+    private Integer mb_ignore;
+
+    private String mailbox_context;
+
+    private String mailbox_files;
+
+    private String mb_reply;
+
+    private String mb_creatorname;
+}

+ 40 - 11
applications/school/school-server/src/main/resources/mapper/PrincipalMailboxMapper.xml

@@ -1,18 +1,25 @@
 <?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.school.mapper.PrincipalMailboxMapper" >
-  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.PrincipalMailboxDO" >
-    <id column="mailbox_id" property="mailboxId" jdbcType="BIGINT" />
-    <result column="mailbox_title" property="mailboxTitle" jdbcType="VARCHAR" />
-    <result column="is_anonymity" property="isAnonymity" jdbcType="INTEGER" />
-    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
-    <result column="mailbox_creator" property="mailboxCreator" jdbcType="BIGINT" />
-    <result column="read_date" property="readDate" jdbcType="TIMESTAMP" />
-    <result column="mailbox_status" property="mailboxStatus" jdbcType="INTEGER" />
+  <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.PrincipalMail" >
+    <id column="mailbox_id" property="mailbox_id" jdbcType="BIGINT" />
+    <result column="mailbox_title" property="mailbox_title" jdbcType="VARCHAR" />
+    <result column="is_anonymity" property="is_anonymity" jdbcType="INTEGER" />
+    <result column="create_date" property="create_date" jdbcType="TIMESTAMP" />
+    <result column="mailbox_creator" property="mailbox_creator" jdbcType="BIGINT" />
+    <result column="read_date" property="read_date" jdbcType="TIMESTAMP" />
+    <result column="mailbox_status" property="mailbox_status" jdbcType="INTEGER" />
     <result column="notifier" property="notifier" jdbcType="BIGINT" />
-    <result column="school_id" property="schoolId" jdbcType="BIGINT" />
-    <result column="mailbox_context" property="mailboxContext" jdbcType="LONGVARCHAR" />
-    <result column="mailbox_files" property="mailboxFiles" jdbcType="LONGVARCHAR" />
+    <result column="school_id" property="school_id" jdbcType="BIGINT" />
+    <result column="mb_stuid" property="mb_stuid" jdbcType="BIGINT" />
+    <result column="mb_student" property="mb_student" jdbcType="VARCHAR" />
+    <result column="mb_grade" property="mb_grade" jdbcType="VARCHAR" />
+    <result column="mb_class" property="mb_class" jdbcType="VARCHAR" />
+    <result column="mb_ignore" property="mb_ignore" jdbcType="INTEGER" />
+    <result column="mailbox_context" property="mailbox_context" jdbcType="LONGVARCHAR" />
+    <result column="mailbox_files" property="mailbox_files" jdbcType="LONGVARCHAR" />
+    <result column="mb_reply" property="mb_reply" jdbcType="LONGVARCHAR" />
+    <result column="mb_creatorname" property="mb_creatorname" jdbcType="VARCHAR"/>
   </resultMap>
 
   <select id="selectByConditon" resultMap="BaseResultMap">
@@ -33,4 +40,26 @@
     where mailbox_id = #{mailbox_id,jdbcType=BIGINT}
   </delete>
 
+  <update id="batchIgnore" parameterType="com.usoftchina.smartschool.school.dto.DocBaseDTO">
+    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+      update principal_mailbox set mb_ignore = 1 where mailbox_id = #{item.id}
+    </foreach>
+  </update>
+
+
+  <update id="batchUnIgnore" parameterType="com.usoftchina.smartschool.school.dto.DocBaseDTO">
+    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+      update principal_mailbox set mb_ignore = 0 where mailbox_id = #{item.id}
+    </foreach>
+  </update>
+  
+  <update id="updateReply">
+    update principal_mailbox set mailbox_status=3,mb_reply=#{msg} where mailbox_id=#{id}
+  </update>
+
+  <insert id="insertDetail" parameterType="com.usoftchina.smartschool.school.po.PrincipalReplyDO">
+    insert into principal_reply (mailbox_id,reply_content,reply_date)
+    values (#{mailboxId,jdbcType=BIGINT}, #{replyContent,jdbcType=VARCHAR}, #{replyDate,jdbcType=TIMESTAMP})
+  </insert>
+
 </mapper>

+ 34 - 0
frontend/pc-web/app/view/Interaction/access/List.js

@@ -5,6 +5,7 @@ Ext.define('school.view.interaction.access.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-access-list',
 
+    // dataUrl: 'http://10.1.80.180:9520/api/school/record/list',
     dataUrl: '/api/school/record/list',
     initComponent: function () {
         var me = this;
@@ -13,6 +14,39 @@ Ext.define('school.view.interaction.access.List', {
                 xtype: 'textfield',
                 name: 'keyword',
                 fieldLabel: '姓名'
+            }, {
+                xtype: 'gradecombo',
+                name: 'grade_name',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('clazz_name').setValue(null);
+                    }
+                }
+            }, {
+                xtype: 'classcombo',
+                name: 'clazz_name',
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade_name');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                }
             }],
 
             caller: null,

+ 33 - 4
frontend/pc-web/app/view/Interaction/homework/List.js

@@ -5,7 +5,7 @@ Ext.define('school.view.interaction.homework.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-homework-list',
 
-    // dataUrl: 'http://10.1.80.47:9560/homework/list',
+    // dataUrl: 'http://10.1.80.180:9520/api/school/homework/list',
     dataUrl: '/api/school/homework/list',
     _title: '作业发布',
 
@@ -20,9 +20,38 @@ Ext.define('school.view.interaction.homework.List', {
                     return ' (task_title like\'%' + value + '%\' or task_context like \'%' + value + '%\') ';
                 }
             }, {
-                xtype: 'textfield',
-                name: 'bj',
-                fieldLabel: '班级'
+                xtype: 'gradecombo',
+                name: 'grade_name',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('classz_name').setValue(null);
+                    }
+                }
+            }, {
+                xtype: 'classcombo',
+                name: 'classz_name',
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('grade_name');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('grade_name').setValue(record.get('gradeName'));
+                    }
+                }
             }, {
                 xtype: 'textfield',
                 name: 'task_creator',

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

@@ -12,9 +12,9 @@ Ext.define('school.view.interaction.homework.Release', {
     _title: '作业发布',
     _idField: 'task_id',
     _codeField: null,
-    // _readUrl: 'http://10.1.80.47:9560/homework/read',
+    // _readUrl: 'http://10.1.80.47:9520/api/school/homework/read',
     _readUrl: '/api/school/homework/read',
-    // _saveUrl: 'http://10.1.80.47:9560/homework/save',
+    // _saveUrl: 'http://10.1.80.180:9520/api/school/homework/save',
     _saveUrl: '/api/school/homework/save',
     _deleteUrl: '/api/school/homework/delete',
     initId: 0,

+ 131 - 74
frontend/pc-web/app/view/Interaction/mailbox/List.js

@@ -5,6 +5,9 @@ Ext.define('school.view.interaction.mailbox.List', {
     extend: 'school.view.core.base.BasePanel',
     xtype: 'interaction-mailbox-list',
 
+    controller: 'interaction-mailbox-list',
+
+    // dataUrl: 'http://10.1.80.47:9520/api/school/principal/list',
     dataUrl: '/api/school/principal/list',
     initComponent: function() {
         var me = this;
@@ -12,11 +15,80 @@ Ext.define('school.view.interaction.mailbox.List', {
             searchField: [{
                 xtype: 'textfield',
                 name: 'keyword',
-                fieldLabel: '关键字'
+                fieldLabel: '关键字',
+                getCondition: function (value) {
+                    return ' (mailbox_title like\'%' + value + '%\' or mailbox_context like \'%' + value + '%\') ';
+                }
+            }, {
+                xtype: 'gradecombo',
+                name: 'mb_grade',
+                fieldLabel: '年级',
+                listeners: {
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('mb_class').setValue(null);
+                    }
+                }
+            }, {
+                xtype: 'classcombo',
+                name: 'mb_class',
+                fieldLabel: '班级',
+                listeners: {
+                    expand: function (combo, eOpts) {
+                        combo.store.clearFilter();
+
+                        var gradeCombo = combo.up('form').getForm().findField('mb_grade');
+                        var gradeName = gradeCombo.getValue();
+
+                        var filter = new Ext.util.Filter({
+                            property: 'gradeName',
+                            value: gradeName
+                        });
+
+                        if (!!gradeName) {
+                            combo.store.setFilters([filter]);
+                        }
+                    },
+                    select: function (combo, record, eOpts) {
+                        combo.up('form').getForm().findField('mb_grade').setValue(record.get('gradeName'));
+                    }
+                }
+            }, {
+                xtype: 'combobox',
+                fieldLabel: '回复状态',
+                name: 'mb_reply',
+                displayField: 'name',
+                valueField: 'value',
+                editable: true,
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [['已回复', 3], ['未回复', 0]]
+                }),
+                minChars: 0,
+                queryMode: 'local',
+                getCondition: function(v) {
+                    return v == 3 ? ('mailbox_status = 3') : ('mailbox_status != 3 or mailbox_status is null')
+                }
+            }, {
+                xtype: 'combobox',
+                fieldLabel: '忽略状态',
+                name: 'mb_ignore',
+                displayField: 'name',
+                valueField: 'value',
+                editable: false,
+                value: '0',
+                store: Ext.create('Ext.data.ArrayStore', {
+                    fields: ['name', 'value'],
+                    data: [['已忽略', 1], ['正常', 0]]
+                }),
+                minChars: 0,
+                queryMode: 'local',
+                getCondition: function(v) {
+                    return v == 1 ? ('mb_ignore = 1') : ('mb_ignore != 1 or mb_ignore is null')
+                }
             }],
 
             gridConfig: {
-                idField: null,
+                idField: 'mailbox_id',
                 codeField: null,
                 statusCodeField: null,
                 dataUrl: me.dataUrl,
@@ -25,103 +97,88 @@ Ext.define('school.view.interaction.mailbox.List', {
                 totalProperty: 'data.total',
                 actionColumn: [],
                 selModel: {
-                    type: 'cellmodel'
+                    checkOnly: true,
+                    type: 'checkboxmodel',
+                    mode: "MULTI",
+                    ignoreRightMouseSelection: false
                 },
                 hiddenTools: false,
                 disableDetail: true,
                 toolBtns: [{
                     xtype: 'button',
-                    text: '导出'
+                    text: '忽略',
+                    handler: 'onIgnoreClick'
                 }, {
                     xtype: 'button',
-                    text: '批量回复'
+                    text: '取消忽略',
+                    handler: 'onUnIgnoreClick'
                 }, {
                     xtype: 'button',
                     text: '删除'
                 }],
                 columns : [{
+                    text: 'ID',
+                    dataIndex: 'mailbox_id',
+                    hidden: true
+                }, {
                     text: '标题',
-                    dataIndex: 'mailboxTitle',
+                    dataIndex: 'mailbox_title',
                     width: 120
                 }, {
                     text: '内容',
-                    dataIndex: 'mailboxContext',
+                    dataIndex: 'mailbox_context',
                     width: 300
                 }, {
                     xtype: 'datecolumn',
                     text: '日期',
-                    dataIndex: 'createDate'
+                    dataIndex: 'create_date',
+                    width: 150
                 }, {
                     text: '提出人',
-                    dataIndex: 'mailboxCreator',
+                    dataIndex: 'mb_creatorname',
                     width: 120
+                }, {
+                    text: '年级',
+                    dataIndex: 'mb_grade'
+                }, {
+                    text: '班级',
+                    dataIndex: 'mb_class'
+                }, {
+                    text: '学生',
+                    dataIndex: 'mb_student'
+                }, {
+                    text: '回复状态',
+                    dataIndex: 'mailbox_status',
+                    renderer: function(v, m, r) {
+                        return v == 3 ? '已回复' : '未回复';
+                    }
+                }, {
+                    text: '忽略状态',
+                    dataIndex: 'mb_ignore',
+                    renderer: function(v, m, r) {
+                        return v == 1 ? '已忽略' : '正常';
+                    }
+                }, {
+                    text: '回复信息',
+                    dataIndex: 'mb_reply',
+                    width: 250
+                }, {
+                    xtype:'actioncolumn',
+                    width:70,
+                    dataIndex:'actioncolumn',
+                    text:'操作',
+                    align: 'center',
+                    items: [{
+                        tooltip: '回复',
+                        iconCls: 'x-fa fa-pencil fa-fw',
+                        scope:this
+                    }],
+                    listeners: {
+                        click: 'onActionClick'
+                    }
                 }]
             },
         });
         this.callParent(arguments);
-    },
-
-    /**
-     * 处理部分字段值
-     */
-    getConditionValue: function (field, value) {
-        var me = this,
-            xtypes = field.getXTypes().split('/'),
-            conditionValue;
-        if (me.isContainsAny(xtypes, ['datefield'])) {
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = from + ',' + to;
-        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
-            var from = value.from,
-                to = value.to;
-
-            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
-        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
-            conditionValue = value;
-        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
-            conditionValue = value.map ? value.map(function (v) {
-                return v.value;
-            }).join(',') : '';
-        } else {
-            conditionValue = value;
-        }
-
-        return conditionValue;
-    },
-
-    getExtraParams: function(store, op, condition) {
-        var temp = {};
-
-        for(let x = 0; x < condition.length; x++) {
-            let c = condition[x];
-            if(c.field == 'keyword') {
-                temp.keyword = c.value;
-            }else if(c.field == 'date') {
-                temp.fromDate = new Date(c.value.split(',')[0]).getTime();
-                temp.endDate = new Date(c.value.split(',')[1]).getTime();
-            }else if(c.field == 'quoted') {
-                temp.quoted = c.value == 'all' ? null : c.value;
-            }else if(c.field == 'closed') {
-                // temp.endDate = c.value == 'all' ? null : (
-                //     c.value == '0' ? 
-                // );
-            }
-        }
-        let obj = {
-            pageNumber: store.exportNumber?store.exportNumber:op._page,
-            pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
-        };
-        for(let k in temp) {
-            if(!!temp[k]) {
-                obj[k] = temp[k];
-            }
-        }
-        return obj;
-     },
+    }
 });

+ 195 - 0
frontend/pc-web/app/view/Interaction/mailbox/ListController.js

@@ -0,0 +1,195 @@
+Ext.define('school.view.interaction.mailbox.ListController', {
+    extend: 'school.view.core.base.BasePanelController',
+    alias: 'controller.interaction-mailbox-list',
+
+    onActionClick: function(tableView, td, row, col, e, record, tr) {
+        let me = this;
+        me.onReply(record.data);
+        // let targetCls = event.target.classList;
+        // if(targetCls.contains('fa-pencil')) {
+        //     me.modifyClick(record.data);
+        // }else if(targetCls.contains('fa-trash-o')) {
+        //     me.onDeleteClick(record.data.subject_id);
+        // }
+    },
+
+    onReply: function (data) {
+        let me = this,
+        tab = school.util.BaseUtil.getCurrentTab(),
+        view = me.getView(),
+        win = Ext.getCmp('reply-win');
+
+        if (!win) {
+            win = Ext.create('Ext.window.Window', {
+                title: '回复',
+                width: tab.getBox().width * 0.8,
+                height: tab.getBox().height * 0.8,
+                id: 'reply-win',
+                constrain: true,
+                modal: true,
+                bodyPadding: 10,
+                layout: 'fit',
+                scrollable: true,
+                items: [{
+                    xtype: 'form',
+                    layout: 'column',
+                    defaults: {
+                        margin: '0 0 10 0',
+                        columnWidth: 1
+                    },
+                    items: [{
+                        xtype: 'hidden',
+                        name: 'id',
+                    }, {
+                        xtype: 'textareafield',
+                        name: 'content',
+                        fieldLabel: '内容',
+                        readOnly: true,
+                    }, {
+                        xtype: 'textareafield',
+                        name: 'text',
+                        fieldLabel: '回复',
+                        allowBlank: false,
+                        maxLength: 500
+                    }],
+                    buttonAlign: 'center',
+                    buttons: [{
+                        text: '确定',
+                        formBind: true,
+                        handler: function () {
+                            let form = this.up('form');
+                            let id = form.getValues().id;
+                            let text = form.getValues().text;
+                            let url, params, headers;
+                            
+                            params = {
+                                id: id,
+                                msg: text
+                            };
+
+                            headers = {
+                                "Content-Type": 'application/x-www-form-urlencoded; charset=UTF-8'
+                            }
+
+                            view.setLoading(true);
+                            school.util.BaseUtil.request({
+                                // url: 'http://10.1.80.47:9520/api/school/principal/reply',
+                                url: '/api/school/principal/reply',
+                                method: 'POST',
+                                params: params,
+                                headers: headers
+                            }).then(function (res) {
+                                view.setLoading(false);
+                                win.close();
+                                school.util.BaseUtil.showSuccessToast('添加成功');
+                                view.refresh();
+                            }).catch(function (e) {
+                                view.setLoading(false);
+                                school.util.BaseUtil.showErrorToast('添加失败: ' + e.message);
+                            });
+                        }
+                    }]
+                }]
+            });
+            tab.add(win);
+            win.setTitle(data.mailbox_title);
+            win.down('form').getForm().findField('id').setValue(data.mailbox_id);
+            win.down('form').getForm().findField('content').setValue(data.mailbox_context);
+            win.down('form').getForm().findField('text').setValue(data.mb_reply);
+        }
+        win.show();
+    },
+
+    onIgnoreClick: function() {
+        let me = this,
+        view = me.getView();
+
+        let grid = view.down('grid'),
+        selectedRecords = grid.getSelection();
+        let data, flag = false;
+
+        data = selectedRecords.map(function(r) {
+            if(r.get('mb_ignore') == 1) {
+                flag = true;
+                return;
+            }
+            return {
+                id: r.get('mailbox_id')
+            };
+        });
+
+        if(data.length == 0) {
+            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+            return;
+        }
+
+        if(flag) {
+            school.util.BaseUtil.showErrorToast('不可包含已忽略记录');
+            return;
+        }
+
+        grid.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.47:9520/api/school/principal/batchIgnore',
+            url: '/api/school/principal/batchIgnore',
+            method: 'POST',
+            params: JSON.stringify({
+                baseDTOs: data
+            })
+        }).then(function(res) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('已忽略' + data.length + '条记录');
+            grid.store.loadPage(grid.store.currentPage);
+        }).catch(function(e) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showErrorToast('添加忽略失败: ' + e.message);
+        });
+    },
+
+    onUnIgnoreClick: function() {
+        let me = this,
+        view = me.getView();
+
+        let grid = view.down('grid'),
+        selectedRecords = grid.getSelection();
+        let data, flag = false;
+
+        data = selectedRecords.map(function(r) {
+            if(r.get('mb_ignore') != 1) {
+                flag = true;
+                return;
+            }
+            return {
+                id: r.get('mailbox_id')
+            };
+        });
+
+        if(data.length == 0) {
+            school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
+            return;
+        }
+
+        if(!!flag) {
+            school.util.BaseUtil.showErrorToast('不可包含未忽略记录');
+            return;
+        }
+
+        grid.setLoading(true);
+        school.util.BaseUtil.request({
+            // url: 'http://10.1.80.47:9520/api/school/principal/batchUnIgnore',
+            url: '/api/school/principal/batchUnIgnore',
+            method: 'POST',
+            params: JSON.stringify({
+                baseDTOs: data
+            })
+        }).then(function(res) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showSuccessToast('取消忽略' + data.length + '条记录');
+            grid.store.loadPage(grid.store.currentPage);
+        }).catch(function(e) {
+            grid.setLoading(false);
+            school.util.BaseUtil.showErrorToast('添加忽略失败: ' + e.message);
+        });
+    },
+
+});

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

@@ -27,6 +27,13 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
             }, {
                 xtype: "textfield",
                 name: "notify_creator",
+                fieldLabel: "发布人id",
+                columnWidth: 0.5,
+                defaultValue: school.util.BaseUtil.getCurrentUser().id,
+                hidden: true
+            }, {
+                xtype: "textfield",
+                name: "notify_creator_name",
                 fieldLabel: "发布人",
                 columnWidth: 0.5,
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,

+ 1 - 1
frontend/pc-web/app/view/core/base/BasePanel.js

@@ -134,7 +134,7 @@ Ext.define('school.view.core.base.BasePanel', {
             value = item.value,
             condition;
 
-            if(value&&value!=''){
+            if(value !== undefined && value !== null && value !== ''){
                 if(typeof func == 'function') {
                     condition = {
                         type: 'condition',