354798ggg
2023-06-30 9f4127383d7283f27b40a76f241bfb12c58db715
更改公告所属工程
已添加1个文件
已修改2个文件
588 ■■■■■ 文件已修改
src/main/java/com/product/administration/config/CmnConst.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/config/SystemCode.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/controller/AnnouncementController.java 564 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/product/administration/config/CmnConst.java
@@ -101,6 +101,9 @@
    public static final String PRODUCT_OA_SIGN_CERTIFICATE = "product_oa_sign_certificate";// ç­¾ç« -证书
    public static final String PRODUCT_OA_SIGN_SEAL = "product_oa_sign_seal";// ç­¾ç« -印章
    public static final String PRODUCT_SYS_ATTACHMENTS = "product_sys_attachments";// é™„ä»¶
    public static final String product_oa_ANNOUNCEMENT = "product_oa_announcement";
    public static final String product_oa_ANNOUNCEMENT_ROLE = "product_oa_announcement_role";
    public static final String COMPARE_TYPE = "compare_type";
@@ -260,6 +263,7 @@
    public static final String NAME = "name";
    public static final String IMAGE = "image";
    public static final String TITLE = "title";
    public static final String ANNOUNCEMENT_TYPE = "announcement_type";
    // ç¼“å­˜
    public static final String CACHE_ALL_TABLE_INFO = "所有表信息";
src/main/java/com/product/administration/config/SystemCode.java
@@ -260,18 +260,24 @@
    
    COMPANY_PUNCH_TIME_NOT_CONFIG("公司打卡时间未配置", ModuleEnum.ADMINISTRAT.getValue()+"185"),
    KNOWLEDGE_SHARING_LIST_FAIL("获取知识共享列表失败", ModuleEnum.ORGCOMMON.getValue() + "186"),
    KNOWLEDGE_SHARING_SAVE_FAIL("知识共享保存失败", ModuleEnum.ORGCOMMON.getValue() + "187"),
    KNOWLEDGE_SHARING_DELETE_FAIL("知识共享删除失败", ModuleEnum.ORGCOMMON.getValue() + "188"),
    KNOWLEDGE_SHARING_GET_INFO_FAIL("获取知识共享详情失败", ModuleEnum.ORGCOMMON.getValue() + "189"),
    KNOWLEDGE_SHARING_GET_TYPE_FAIL("获取知识共享分类失败", ModuleEnum.ORGCOMMON.getValue() + "190"),
    KNOWLEDGE_SHARING_GET_TAG_FAIL("获取知识共享标签失败", ModuleEnum.ORGCOMMON.getValue() + "191"),
    KNOWLEDGE_SHARING_GET_IMAGE_FAIL("获取图片失败", ModuleEnum.ORGCOMMON.getValue() + "192"),
    KNOWLEDGE_SHARING_LIST_FAIL("获取知识共享列表失败", ModuleEnum.ADMINISTRAT.getValue() + "186"),
    KNOWLEDGE_SHARING_SAVE_FAIL("知识共享保存失败", ModuleEnum.ADMINISTRAT.getValue() + "187"),
    KNOWLEDGE_SHARING_DELETE_FAIL("知识共享删除失败", ModuleEnum.ADMINISTRAT.getValue() + "188"),
    KNOWLEDGE_SHARING_GET_INFO_FAIL("获取知识共享详情失败", ModuleEnum.ADMINISTRAT.getValue() + "189"),
    KNOWLEDGE_SHARING_GET_TYPE_FAIL("获取知识共享分类失败", ModuleEnum.ADMINISTRAT.getValue() + "190"),
    KNOWLEDGE_SHARING_GET_TAG_FAIL("获取知识共享标签失败", ModuleEnum.ADMINISTRAT.getValue() + "191"),
    KNOWLEDGE_SHARING_GET_IMAGE_FAIL("获取图片失败", ModuleEnum.ADMINISTRAT.getValue() + "192"),
    CONFERENCE_ROOM_SAVE_FIAL_DUPLICATE_NAME("会议室保存失败,已存在同名称会议室", ModuleEnum.ADMINISTRAT.getValue() + "193"),
    WORK_ATTENDANCE_REPORT_FAIL("考勤报表获取失败!", ModuleEnum.ADMINISTRAT.getValue() + "194"),
    
    ANNOUNCEMENT_FAIL("公告详情", ModuleEnum.ADMINISTRAT.getValue() + "195"),
    ANNOUNCEMENT_ADD("公告新增", ModuleEnum.ADMINISTRAT.getValue() + "196"),
    ANNOUNCEMENT_UPDATE("公告修改", ModuleEnum.ADMINISTRAT.getValue() + "197"),
    ANNOUNCEMENT_DELECT("公告删除", ModuleEnum.ADMINISTRAT.getValue() + "198"),
    ANNOUNCEMENT_REMIND("已读提醒失败", ModuleEnum.ADMINISTRAT.getValue() + "199"),
    EXPORT_FILE_FAIL("导出文件失败", ModuleEnum.ADMINISTRAT.getValue() + "998"),
    IMPORT_FILE_FAIL("导入文件失败", ModuleEnum.ADMINISTRAT.getValue() + "999"),
src/main/java/com/product/administration/controller/AnnouncementController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,564 @@
package com.product.administration.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.product.administration.config.CmnConst;
import com.product.administration.config.SystemCode;
import com.product.administration.service.AnnouncementService;
import com.product.core.config.CoreConst;
import com.product.core.controller.support.AbstractBaseController;
import com.product.core.entity.FieldSetEntity;
import com.product.core.entity.RequestParameterEntity;
import com.product.core.exception.BaseException;
import com.product.core.spring.context.SpringMVCContextHolder;
import com.product.module.sys.version.ApiVersion;
import com.product.util.ResultInfo;
@RestController
@RequestMapping("/api/announcement")
public class AnnouncementController extends AbstractBaseController {
    @Autowired
    AnnouncementService announcementService;
    /**
     * æš‚存列表
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/list-announcement/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String announcementList(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return OK_List(announcementService.listAnnouncement(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
    /**
     * å‘布列表
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/list-announcement-release/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String announcementListRelease(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return OK_List(announcementService.listAnnouncementRelease(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
    /**
     * æˆ‘的公告列表
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/list-announcement-receive/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String announcementListReceive(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return OK_List(announcementService.listAnnouncementReceive(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
    /**
     * æˆ‘的公告列表
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/tree-announcement-type/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String treeAnnouncementType(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return ResultInfo.success(announcementService.treeAnnouncementType(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
    /**
     * æƒé™åˆ—表
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/list-announcement-role/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String announcementRoleList(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return OK_List(announcementService.listAnnouncementRelease(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
    /**
     * å·²è¯»æé†’
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/read-announcement-remind/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String readAnnouncementRemind(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            // åˆ¤æ–­uuid是否为空
            if (com.alibaba.druid.util.StringUtils.isEmpty(fse.getString("uuid"))) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_COUNT.getValue(),
                        SystemCode.SYSTEM_FORM_COUNT.getText());
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            boolean update = announcementService.readAnnouncementRemind(fse);
            return update ? OK_Add(fse.getUUID())
                    : error(SystemCode.ANNOUNCEMENT_REMIND.getValue(), SystemCode.ANNOUNCEMENT_REMIND.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            return this.error(e.getMessage());
        }
    }
    @RequestMapping(value = "/get-announcement-find/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String findAnnouncement(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            // åˆ¤æ–­uuid是否为空
            if (com.alibaba.druid.util.StringUtils.isEmpty(fse.getString("uuid"))) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_COUNT.getValue(),
                        SystemCode.SYSTEM_FORM_COUNT.getText());
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            FieldSetEntity findDict = announcementService.findAnnouncement(fse);
            return OK_List(findDict);
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_FAIL.getValue(),
                    SystemCode.ANNOUNCEMENT_FAIL.getText() + e.getMessage());
        }
    }
    /**
     * å…¬å‘Šæš‚å­˜
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/add-announcement/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String addAnnouncement(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            String addRole = announcementService.addAnnouncement(fse);
            return addRole != null ? OK_Add(addRole)
                    : error(SystemCode.ANNOUNCEMENT_ADD.getValue(), SystemCode.ANNOUNCEMENT_ADD.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_ADD.getValue(),
                    SystemCode.ANNOUNCEMENT_ADD.getText() + e.getMessage());
        }
    }
    /**
     * å…¬å‘Šå‘布
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/release-announcement/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String releaseAnnouncement(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            boolean addRole = announcementService.releaseAnnouncement(fse);
            return addRole ? OK()
                    : error(SystemCode.ANNOUNCEMENT_ADD.getValue(), SystemCode.ANNOUNCEMENT_ADD.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_ADD.getValue(),
                    SystemCode.ANNOUNCEMENT_ADD.getText() + e.getMessage());
        }
    }
    /**
     * æé†’查看公告
     *
     * @param request
     * @return
     */
    @RequestMapping(value = "/remind-announcement/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String remindAnnouncement(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            boolean addRole = announcementService.remindAnnouncement(fse);
            return addRole ? OK()
                    : error(SystemCode.ANNOUNCEMENT_ADD.getValue(), SystemCode.ANNOUNCEMENT_ADD.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_ADD.getValue(),
                    SystemCode.ANNOUNCEMENT_ADD.getText() + e.getMessage());
        }
    }
    @RequestMapping(value = "/update-announcement/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String updateAnnouncement(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            // åˆ¤æ–­uuid是否为空
            if (com.alibaba.druid.util.StringUtils.isEmpty(fse.getString("uuid"))) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_COUNT.getValue(),
                        SystemCode.SYSTEM_FORM_COUNT.getText());
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            boolean updateRole = announcementService.updateAnnouncement(fse);
            return updateRole ? OK()
                    : error(SystemCode.ANNOUNCEMENT_UPDATE.getValue(), SystemCode.ANNOUNCEMENT_UPDATE.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_UPDATE.getValue(),
                    SystemCode.ANNOUNCEMENT_UPDATE.getText() + e.getMessage());
        }
    }
    /**
     * åˆ é™¤åŠŸèƒ½æƒé™
     *
     * @return
     */
    @RequestMapping(value = "/delect-announcement/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String delectAnnouncement(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            // åˆ¤æ–­uuid是否为空
            if (com.alibaba.druid.util.StringUtils.isEmpty(fse.getString("uuid"))) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_COUNT.getValue(),
                        SystemCode.SYSTEM_FORM_COUNT.getText());
                return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText());
            }
            boolean delectRole = announcementService.delAnnouncement(fse);
            return delectRole ? OK()
                    : error(SystemCode.ANNOUNCEMENT_DELECT.getValue(), SystemCode.ANNOUNCEMENT_DELECT.getText());
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_DELECT.getValue(),
                    SystemCode.ANNOUNCEMENT_DELECT.getText() + e.getMessage());
        }
    }
    /**
     * æ¶ˆæ¯é—¨æˆ·åˆ—表
     *
     * @return
     */
    @RequestMapping(value = "/list-announcement-gateway/{version}", method = RequestMethod.POST)
    @ApiVersion(1)
    public String listAnnouncementGateway(HttpServletRequest request) {
        try {
            FieldSetEntity fse = null;
            Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA);
            if (bean != null) {
                RequestParameterEntity reqp = (RequestParameterEntity) bean;
                fse = reqp.getFormData();
            }
            // åˆ¤æ–­å‚数是否为空
            if (bean == null || fse == null) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_FORM_NODATA.getValue(),
                        SystemCode.SYSTEM_FORM_NODATA.getText());
                return this.error(SystemCode.SYSTEM_FORM_NODATA.getValue(), SystemCode.SYSTEM_FORM_NODATA.getText());
            }
            // åˆ¤æ–­è¡¨åæ˜¯å¦æ­£å¸¸
            if (!CmnConst.product_oa_ANNOUNCEMENT.equals(fse.getTableName())) {
                SpringMVCContextHolder.getSystemLogger().error(SystemCode.SYSTEM_TABLE_NODATA.getValue(),
                        SystemCode.SYSTEM_TABLE_NODATA.getText());
                return this.error(SystemCode.SYSTEM_TABLE_NODATA.getValue(), SystemCode.SYSTEM_TABLE_NODATA.getText());
            }
            return OK_List(announcementService.listAnnouncementGateway(fse));
        } catch (BaseException e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            return this.error(e.getCode(), e.getMessageInfo());
        } catch (Exception e) {
            e.printStackTrace();
            SpringMVCContextHolder.getSystemLogger().error(e);
            return error(SystemCode.ANNOUNCEMENT_DELECT.getValue(),
                    SystemCode.ANNOUNCEMENT_DELECT.getText() + e.getMessage());
        }
    }
}