xinyb
10 天以前 658898d28cded745ca15ee0a89e3025358356259
CRM邮箱功能调整
1个文件已添加
16个文件已修改
238 ■■■■ 已修改文件
src/com/yc/crm/mail/action/MailBlacklist.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/action/MailController.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/action/MailFolder.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/action/MailQuickText.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/action/MailSignature.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/action/MailTag.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/entity/MailModuleBelowEntity.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/entity/t482101HList.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailBlackListIfc.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailBlackListImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailFolderIfc.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailFolderImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailIfc.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailImpl.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailTagIfc.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/service/MailTagImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/com/yc/crm/mail/action/MailBlacklist.java
@@ -14,7 +14,10 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @BelongsProject: eCoWorksV3
@@ -77,13 +80,13 @@
    public AllBackMsg updateBlackList(@RequestBody T482106Entity BlackList, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if(BlackList.getBlackId()==0){
            if (BlackList.getBlackId() == null || BlackList.getBlackId().equals(0)) {
                msg.setFail("获取不到黑名单ID,请检查");
                return msg;
            }
            HttpSession session = request.getSession();
            String userCode = (String) session.getAttribute(SessionKey.USERCODE);
            if(StringUtils.isBlank(userCode)){
            if (StringUtils.isBlank(userCode)) {
                msg.setFail("登录用户已过期,请检查");
                return msg;
            }
@@ -112,19 +115,19 @@
    public AllBackMsg deleteBlackList(@RequestParam(defaultValue = "0") Integer blackId, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (blackId == 0) {
            if (blackId.equals(0)) {
                msg.setFail("黑名单ID获取不到");
                return msg;
            }
            HttpSession session = request.getSession();
            String userCode = (String) session.getAttribute(SessionKey.USERCODE);
            if(StringUtils.isBlank(userCode)){
            if (StringUtils.isBlank(userCode)) {
                msg.setFail("登录用户已过期,请检查");
                return msg;
            }
            DataSourceEntity dataSource = MultiDataSource.getDataSourceMap(request);//获取数据源
            SpObserver.setDBtoInstance("_" + dataSource.getDbId());
            Integer cont = mailBlackListIfc.deleteBlackList(userCode,blackId);
            Integer cont = mailBlackListIfc.deleteBlackList(userCode, blackId);
            if (cont > 0) {
                msg.setOk("已删除");
            }
@@ -143,19 +146,37 @@
     * @return
     */
    @GetMapping("/getBlackList.do")
    public AllBackMsg getSignature(String search, HttpServletRequest request, HttpServletResponse response) {
    public AllBackMsg getSignature(String search, @RequestParam(defaultValue = "-1") Integer type, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            HttpSession session = request.getSession();
            String userCode = (String) session.getAttribute(SessionKey.USERCODE);
            if(StringUtils.isBlank(userCode)){
            if (StringUtils.isBlank(userCode)) {
                msg.setFail("登录用户已过期,请检查");
                return msg;
            }
            DataSourceEntity dataSource = MultiDataSource.getDataSourceMap(request);//获取数据源
            SpObserver.setDBtoInstance("_" + dataSource.getDbId());
            List<T482106Entity> list = mailBlackListIfc.getBlackList(userCode,search);
            msg.setSuccess("执行成功", list);
            List<T482106Entity> list = mailBlackListIfc.getBlackList(userCode, search, type);
            Map<String, Object> map = new HashMap<>();
            if (list.size() > 0) {
                List<T482106Entity> mail = new ArrayList<>();
                List<T482106Entity> domain = new ArrayList<>();
                for (T482106Entity t482106 : list) {
                    if (t482106.isBlackType()) {//true表示域名
                        domain.add(t482106);
                    } else {//邮箱地址
                        mail.add(t482106);
                    }
                }
                map.put("code", 0);
                map.put("mail", mail);
                map.put("domain", domain);
            } else {
                map.put("code", 0);
                map.put("msg", "数据获取为空");
            }
            msg.setSuccess("执行成功", map);
        } catch (Exception e) {
            msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
        } finally {
src/com/yc/crm/mail/action/MailController.java
@@ -57,7 +57,7 @@
    /**
     * 左边结构层
     * 左边结构上层
     *
     * @return
     */
@@ -82,6 +82,32 @@
        }
        return msg;
    }
    /**
     * 左边结构下层
     *
     * @return
     */
    @GetMapping("/getEmailModuleBelow.do")
    public AllBackMsg getEmailModuleBelow(HttpServletRequest request, HttpServletResponse response) throws Exception {
        AllBackMsg msg = new AllBackMsg();
        try {
            HttpSession session = request.getSession();
            String userCode = (String) session.getAttribute(SessionKey.USERCODE);//当前登录用户
            if (StringUtils.isBlank(userCode)) {//获取不到当前用户直接结束
                msg.setFail("获取不到用户信息");
                return msg;
            }
            DataSourceEntity dataSourceEntity = MultiDataSource.getDataSourceMap(request);//获取数据源信息
            SpObserver.setDBtoInstance("_" + dataSourceEntity.getDbId());//切换数据源
            List<MailModuleBelowEntity> list =emailIfc.getMailModuleBelowList(userCode);
            msg.setSuccess("执行成功", list);
        } catch (Exception e) {
            msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
        } finally {
            SpObserver.setDBtoInstance();
        }
        return msg;
    }
    /**
     * 获取邮件列表(包括草稿箱,收件箱)
src/com/yc/crm/mail/action/MailFolder.java
@@ -16,7 +16,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -30,6 +32,10 @@
@RestController
@RequestMapping("/crm/mail/folder")
public class MailFolder {
    /**
     * 要获取rowId直接调用接口 http://yingchen.onbus.cn:9010/getRowid.do
     */
    @Autowired
    MailFolderIfc mailFolderIfc;
@@ -57,8 +63,17 @@
            folder.setUserName(userName);
            DataSourceEntity dataSource = MultiDataSource.getDataSourceMap(request);//获取数据源
            SpObserver.setDBtoInstance("_" + dataSource.getDbId());
            mailFolderIfc.saveFolder(folder);
            msg.setOk("已保存");
            String rowId = mailFolderIfc.saveFolder(folder);
            Map<String, Object> map = new HashMap<>();
            if (StringUtils.isNotBlank(rowId)) {
                map.put("cod", 0);
                map.put("rowId", rowId);
                msg.setSuccess("已保存", map);
            } else {
                map.put("cod", -1);
                map.put("msg", "保存后返回rowId出错");
                msg.setSuccess("已保存", map);
            }
        } catch (Exception e) {
            msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
        } finally {
@@ -80,7 +95,7 @@
    public AllBackMsg updateFolder(@RequestBody T482107Entity folder, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (folder.getFolderId().equals(0)) {
            if (folder.getFolderId() == null || folder.getFolderId().equals(0)) {
                msg.setFail("缺少文本夹ID值,请检查");
                return msg;
            }
@@ -159,6 +174,7 @@
            SpObserver.setDBtoInstance("_" + dataSource.getDbId());
            List<T482107Entity> t482107Entities = mailFolderIfc.getMailFolder(userCode, search);
            if (t482107Entities.size() > 0) {
                //返回树结构
                msg.setSuccess("执行成功", getFolderList(t482107Entities, ""));
            }
        } catch (Exception e) {
@@ -190,7 +206,7 @@
                            folderEntity.setRowId(y.getRowId());
                            folderEntity.setParentRowId(y.getParentRowId());
                            folderEntity.setTreeControl(y.getTreeControl());
                            folderEntity.setList(getFolderList(fo, y.getRowId()));
                            folderEntity.setList(getFolderList(t482107, y.getRowId()));
                            folder.add(folderEntity);
                        }
                    }
src/com/yc/crm/mail/action/MailQuickText.java
@@ -81,7 +81,7 @@
    public AllBackMsg updateQuickText(@RequestBody T482108Entity quickText, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (quickText.getTextId() == 0) {
            if (quickText.getTextId() == null || quickText.getTextId().equals(0)) {
                msg.setFail("缺少快速文本ID值,请检查");
                return msg;
            }
@@ -116,7 +116,7 @@
    public AllBackMsg deleteQuickText(@RequestParam(defaultValue = "0") Integer textId, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (textId == 0) {
            if (textId.equals(0)) {
                msg.setFail("快速文本编号ID获取不到");
                return msg;
            }
src/com/yc/crm/mail/action/MailSignature.java
@@ -77,7 +77,7 @@
    public AllBackMsg updateSignature(@RequestBody T482109Entity signature, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (signature.getSignId() == null) {
            if (signature.getSignId() == null || signature.getSignId().equals(0)) {
                msg.setFail("缺少SignId值,请检查");
                return msg;
            }
@@ -112,7 +112,7 @@
    public AllBackMsg deleteSignature(@RequestParam(defaultValue = "0") Integer signId, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (signId == 0) {
            if (signId.equals(0)) {
                msg.setFail("签名ID获取不到");
                return msg;
            }
src/com/yc/crm/mail/action/MailTag.java
@@ -1,6 +1,7 @@
package com.yc.crm.mail.action;
//import com.yc.crm.mail.entity.T482115Entity;
import com.yc.crm.base.entity.T482115Entity;
import com.yc.crm.mail.service.MailTagIfc;
import com.yc.crm.mail.util.AllBackMsg;
@@ -78,7 +79,7 @@
    public AllBackMsg updateTag(@RequestBody T482115Entity tag, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (tag.getTagId() == null) {
            if (tag.getTagId() == null || tag.getTagId().equals(0)) {
                msg.setFail("缺少tagId值,请检查");
                return msg;
            }
@@ -113,7 +114,7 @@
    public AllBackMsg deleteTag(@RequestParam(defaultValue = "0") Integer tagId, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            if (tagId == 0) {
            if (tagId.equals(0)) {
                msg.setFail("标签ID获取不到");
                return msg;
            }
@@ -139,13 +140,14 @@
    /**
     * 标签查询
     *
     * @param search   搜索
     * @param request
     * @param response
     * @return
     */
    @GetMapping("/getTagList.do")
    public AllBackMsg getTagList(String search, HttpServletRequest request, HttpServletResponse response) {
    public AllBackMsg getTagList(String search,@RequestParam(defaultValue = "-1") Integer type, HttpServletRequest request, HttpServletResponse response) {
        AllBackMsg msg = new AllBackMsg();
        try {
            HttpSession session = request.getSession();
@@ -156,7 +158,7 @@
            }
            DataSourceEntity dataSource = MultiDataSource.getDataSourceMap(request);//获取数据源
            SpObserver.setDBtoInstance("_" + dataSource.getDbId());
            List<T482115Entity> list = mailTagIfc.getTagList(userCode, search);
            List<T482115Entity> list = mailTagIfc.getTagList(userCode, search,type);
            msg.setSuccess("执行成功", list);
        } catch (Exception e) {
            msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage());
src/com/yc/crm/mail/entity/MailModuleBelowEntity.java
New file
@@ -0,0 +1,38 @@
package com.yc.crm.mail.entity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
 * @BelongsProject: eCoWorksV3
 * @BelongsPackage: com.yc.crm.mail.entity
 * @author: xinyb
 * @CreateTime: 2024-09-23  11:32
 * @Description:
 */
@Data
public class MailModuleBelowEntity {
    private String key;//key
    private String name;//名称
    private Integer number = 0;//数量
    private Object list;//下节点
    public static List<MailModuleBelowEntity> setMailInitial() {
        List<MailModuleBelowEntity> list1 = new ArrayList<>();
        MailModuleBelowEntity a = new MailModuleBelowEntity();
        a.setKey("moduleBelowA");
        a.setName("文件夹");
        list1.add(a);
        MailModuleBelowEntity b = new MailModuleBelowEntity();
        b.setKey("moduleBelowB");
        b.setName("标签邮件");
        list1.add(b);
        MailModuleBelowEntity c = new MailModuleBelowEntity();
        c.setKey("moduleBelowC");
        c.setName("显示更多");
        list1.add(c);
        return list1;
    }
}
src/com/yc/crm/mail/entity/t482101HList.java
@@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @BelongsProject: eCoWorksV3
@@ -21,7 +22,9 @@
    private Integer mailType;// [note: '0:草稿箱1:收件箱2:发件箱']
    private String senderName;//发件人名称
    private String sender;// [note:'发送人']
    private String senderTime;//发送时间
    private List<String> receiver = new ArrayList<>();//收件人集合
    private String receivingTime;//收件时间
    private Integer folderId = 0;// [note:'文件夹id']
    private Integer deleteFlag = 0; //[note:'是否已删除']
    private Integer readFlag = 0;// [note:'是否已读']
@@ -32,6 +35,8 @@
    private String updateTime;
    private String receiveTime;// [note:'回复时间']
    private String plainText;
    private String attachmentList;//附件编码
    private Map attachmentPath;//附件详情
    private String eMail;
    private Integer handle;//是否待处理 1是 0不是
    private String handleTime;//待处理时间
src/com/yc/crm/mail/service/MailBlackListIfc.java
@@ -31,5 +31,5 @@
     * @param name
     * @return
     */
    List<T482106Entity> getBlackList(String userCode,String search);
    List<T482106Entity> getBlackList(String userCode,String search,Integer type);
}
src/com/yc/crm/mail/service/MailBlackListImpl.java
@@ -26,7 +26,7 @@
        try {
            sql += "insert into t482106(companyId,companyName,black_content,userCode,userName,create_time,update_time,black_type) values " +
                    "(" + GridUtils.prossSqlParm(black.getCompanyId()) + "," + GridUtils.prossSqlParm(black.getCompanyName()) + "," +
                    GridUtils.prossSqlParm(black.getBlackContent())+","+GridUtils.prossSqlParm(black.getUserCode()) + "," +
                    GridUtils.prossSqlParm(black.getBlackContent()) + "," + GridUtils.prossSqlParm(black.getUserCode()) + "," +
                    GridUtils.prossSqlParm(black.getUserName()) + ",getdate(),getdate(),'" + black.isBlackType() + "')";
            jdbcTemplate.update(sql);
        } catch (Exception e) {
@@ -50,7 +50,7 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer deleteBlackList(String userCode,Integer blackId) {
    public Integer deleteBlackList(String userCode, Integer blackId) {
        String sql = "set nocount on \n";
        try {
            sql += "delete t482106 where black_id=" + blackId + " and userCode='" + userCode + "'\n";
@@ -62,13 +62,16 @@
    }
    @Override
    public List<T482106Entity> getBlackList(String userCode,String search) {
    public List<T482106Entity> getBlackList(String userCode, String search, Integer type) {
        String sql = "set nocount on \n";
        try {
            sql += "select companyId,companyName,black_id,black_content,userCode,userName,create_time,update_time,black_type,DocVersion " +
                    "from  t482106 where userCode="+GridUtils.prossSqlParm(userCode);
                    "from  t482106 where userCode=" + GridUtils.prossSqlParm(userCode);
            if (!type.equals(-1)) {
                sql += " and black_type=" + type;
            }
            if (StringUtils.isNotBlank(search)) {
                sql += " and black_content like '%" + search+"%'";
                sql += " and black_content like '%" + search + "%'";
            }
            sql += "order by black_id \n";
            return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(T482106Entity.class));
src/com/yc/crm/mail/service/MailFolderIfc.java
@@ -9,7 +9,7 @@
     * 保存邮件文件夹
     * @param quickText
     */
    void saveFolder(T482107Entity folder);
    String saveFolder(T482107Entity folder);
    /**
     * 修改邮件文件夹
src/com/yc/crm/mail/service/MailFolderImpl.java
@@ -21,26 +21,30 @@
public class MailFolderImpl extends BaseService implements MailFolderIfc {
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void saveFolder(T482107Entity folder) {
    public String saveFolder(T482107Entity folder) {
        String sql = "set nocount on\n";
        try {
            sql += "declare @rowId varchar(40),@parentRowId varchar(40) =" + GridUtils.prossSqlParm(folder.getParentRowId()) + "\n";
            sql += "exec getXXXX @rowId output \n";//获取一个rowId
            sql += "insert into t482107(companyId,companyName,folder_name,userCode,userName,sort_id,create_time,update_time,rowId,treeControl,parentRowId) " +
                    "values (" + GridUtils.prossSqlParm(folder.getCompanyId()) + "," + GridUtils.prossSqlParm(folder.getCompanyName()) + "," +
                    GridUtils.prossSqlParm(folder.getFolderName()) + "," + GridUtils.prossSqlParm(folder.getUserCode()) + "," +
                    GridUtils.prossSqlParm(folder.getUserName()) + "," + folder.getSortId() + ",getdate(),getdate()," +
                    GridUtils.prossSqlParm(folder.getRowId()) + "," + GridUtils.prossSqlParm(folder.getTreeControl()) + "," + GridUtils.prossSqlParm(folder.getParentRowId()) + ")";
            jdbcTemplate.update(sql);
                    GridUtils.prossSqlParm(folder.getUserName()) + "," + folder.getSortId() + ",getdate(),getdate(),@rowId," +
                    GridUtils.prossSqlParm(folder.getTreeControl()) + ",@parentRowId)";
            sql += "select @rowId as rowId";
            return jdbcTemplate.queryForObject(sql, String.class);
        } catch (Exception e) {
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer updateFolder(T482107Entity folder) {
        String sql = "set nocount on\n";
        try {
            sql += "update t482107 set folder_name=" + GridUtils.prossSqlParm(folder.getFolderName()) +
                    ",sort_id=" + folder.getSortId() + ",update_time=getdate() " + ",rowId=" + GridUtils.prossSqlParm(folder.getRowId()) +
                    ",sort_id=" + folder.getSortId() + ",update_time=getdate() " + //",rowId=" + GridUtils.prossSqlParm(folder.getRowId()) +
                    ",treeControl=" + GridUtils.prossSqlParm(folder.getTreeControl()) + ",parentRowId=" + GridUtils.prossSqlParm(folder.getParentRowId()) +
                    "where folder_id=" + folder.getFolderId() + " and userCode=" + GridUtils.prossSqlParm(folder.getUserCode()) + "\n";
            sql += "select @@ROWCOUNT";
@@ -49,6 +53,7 @@
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer deleteFolder(String userCode, Integer folderId) {
src/com/yc/crm/mail/service/MailIfc.java
@@ -1,5 +1,6 @@
package com.yc.crm.mail.service;
import com.yc.crm.mail.entity.MailModuleBelowEntity;
import com.yc.crm.mail.entity.MailModuleEntity;
import com.yc.crm.mail.entity.t482101HEntity;
import com.yc.crm.mail.entity.t482101HList;
@@ -134,6 +135,7 @@
     */
    abstract List<MailModuleEntity> getMailModuleList(String userCode);
    abstract List<MailModuleBelowEntity> getMailModuleBelowList(String userCode);
    /**
     * 待处理邮件
     * @param handleTime
src/com/yc/crm/mail/service/MailImpl.java
@@ -1,6 +1,7 @@
package com.yc.crm.mail.service;
import com.yc.action.grid.GridUtils;
import com.yc.crm.mail.action.MailFolder;
import com.yc.crm.mail.entity.*;
import com.yc.entity.AttachmentConfig;
import com.yc.sdk.shopping.service.imagedata.ShoppingImageDataIfc;
@@ -29,6 +30,10 @@
    MailAccountIfc emailAccountIfc;
    @Autowired
    ShoppingImageDataIfc imgData;
    @Autowired
    MailTagIfc mailTagIfc;
    @Autowired
    MailFolderIfc mailFolderIfc;
    final static String shoppingImageServer = AttachmentConfig.get("attachment.server");
@@ -180,7 +185,7 @@
        String sql = "set nocount on\n";
        try {
            sql += "declare @messageId varchar(200) ='" + messageId + "' \n";
            sql += "delete t482101H where messageId in (select list from GetInStr(@messageId))\n";//删除
            sql += "update  t482101H where messageId in (select list from GetInStr(@messageId))\n";//删除
            sql += " select @@ROWCOUNT";
            return jdbcTemplate.queryForObject(sql, Integer.class);
        } catch (Exception e) {
@@ -194,7 +199,7 @@
        try {
            sql += "select top 1 DocCode,companyId,companyName,senderName,senderName,sender,receiver,mailType,subject,content,plain_text,file_unid as fileUNID,messageId," +
                    "read_flag,delete_flag,attach_flag,urgent_flag,receipt_flag,track_flag,userCode,userName,create_time,update_time," +
                    "send_status,receive_time,sign_id,attachment_list,remark,remark," +
                    "send_status,receive_time,sign_id,attachment_list,remark,remark,sender_time,receiving_time," +
                    "(case when (isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate()) then 1 else 0 end) as handle,handle_time," +
                    "DocVersion from t482101H " +
                    "where docCode=" + GridUtils.prossSqlParm(docCode);
@@ -209,9 +214,9 @@
        String sql = "set nocount on\n";
        try {
            sql += "select companyId,companyName,mailType,DocCode,senderName,sender,receiver,subject,plain_text," +
                    "receive_time,update_time,create_time,senderName,sender,userCode,userName,folder_id,delete_Flag, " +
                    "receive_time,update_time,create_time,senderName,sender,userCode,userName,folder_id,delete_Flag,attachment_list," +
                    "read_Flag,(case when (isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate()) then 1 else 0 end) as handle," +
                    "handle_time from t482101H ";
                    "handle_time,sender_time,receiving_time from t482101H ";
            sql += " where userCode=" + GridUtils.prossSqlParm(userCode);
            sql += " and mailType=" + mailType;//0:草稿箱 1:收件箱 2:发件箱
            if (StringUtils.isNotBlank(email)) {
@@ -239,7 +244,7 @@
            sql += "select companyId,companyName,mailType,DocCode,senderName,sender,receiver,subject,plain_text," +
                    "receive_time,update_time,create_time,senderName,sender,userCode,userName,folder_id,delete_Flag, " +
                    "read_Flag,(case when (isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate()) then 1 else 0 end) as handle," +
                    "handle_time from t482101H ";
                    "handle_time,sender_time,receiving_time from t482101H ";
            sql += " where isnull(handle_time,'') <> '' and isnull(handle_time,'') < getdate()";
            sql += " and userCode=" + GridUtils.prossSqlParm(userCode) + " and receiver like '%" + email + "%'";
            sql += " order by docCode asc \n";
@@ -391,6 +396,32 @@
        }
    }
    @Override
    public List<MailModuleBelowEntity> getMailModuleBelowList(String userCode) {
        List<MailModuleBelowEntity> below = MailModuleBelowEntity.setMailInitial();
        try {
            for (MailModuleBelowEntity b : below) {
                String key = b.getKey();
                if (key.equals("moduleBelowA")) {//文件夹
                    List<T482107Entity> t482107 = mailFolderIfc.getMailFolder(userCode, "");
                    b.setList(MailFolder.getFolderList(t482107, ""));
                }
                if (key.equals("moduleBelowB")) {//标签邮件
                    b.setList(mailTagIfc.getTagList(userCode, "", -1));
                }
                if (key.equals("moduleBelowC")) {//显示更多
                    List<MailModuleBelowEntity> CList = new ArrayList<>();
                    MailModuleBelowEntity belowC = new MailModuleBelowEntity();
                }
            }
            return below;
        } catch (Exception e) {
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updateMailHandle(String handleTime, String docCode) {
src/com/yc/crm/mail/service/MailServiceImpl.java
@@ -501,7 +501,7 @@
                textHtmlFound = true;
            }
        }
        return textPlainFound && textHtmlFound;
        return textPlainFound || textHtmlFound;
    }
    /**
src/com/yc/crm/mail/service/MailTagIfc.java
@@ -33,5 +33,5 @@
     * @param name
     * @return
     */
    List<T482115Entity> getTagList(String userCode, String search);
    List<T482115Entity> getTagList(String userCode, String search,Integer type);
}
src/com/yc/crm/mail/service/MailTagImpl.java
@@ -34,6 +34,7 @@
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer updateTag(T482115Entity tag) {
@@ -49,6 +50,7 @@
            throw e;
        }
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer deleteTag(String userCode, Integer tagId) {
@@ -63,11 +65,14 @@
    }
    @Override
    public List<T482115Entity> getTagList(String userCode, String search) {
    public List<T482115Entity> getTagList(String userCode, String search, Integer type) {
        String sql = "set nocount on\n";
        try {
            sql += "select companyId,companyName,tag_id,tag_name,userCode,userName,sort_id,create_time,update_time,tag_desc,system_flag,tag_color,tag_type " +
                    "from t482115 where userCode=" + GridUtils.prossSqlParm(userCode);
            if (!type.equals(-1)) {
                sql += " and system_flag=" + type;
            }
            if (StringUtils.isNotBlank(search)) {
                sql += " and tag_name like '%" + search + "%'";
            }