From 4fa04e0324dfc788c238d9a9cbd09acea4ff0e8e Mon Sep 17 00:00:00 2001 From: liukewei Date: Fri, 8 Dec 2023 11:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/pom.xml | 2 +- .../ehs/EhsNoticeMessageController.java | 194 ++++++++ .../ehs/EhsNoticeMessageFileController.java | 158 ++++++ .../src/main/resources/application.yml | 6 +- .../common/core/domain/entity/SysDept.java | 15 +- .../domain/EhsNoticeMessage.java | 89 ++++ .../mapper/EhsNoticeMessageMapper.java | 32 ++ .../service/IEhsNoticeMessageService.java | 34 ++ .../impl/EhsNoticeMessageServiceImpl.java | 79 +++ .../domain/EhsNoticeMessageFile.java | 62 +++ .../mapper/EhsNoticeMessageFileMapper.java | 29 ++ .../service/IEhsNoticeMessageFileService.java | 31 ++ .../impl/EhsNoticeMessageFileServiceImpl.java | 67 +++ .../mapper/ehs/EhsNoticeMessageFileMapper.xml | 52 ++ .../mapper/ehs/EhsNoticeMessageMapper.xml | 97 ++++ .../resources/mapper/system/SysDeptMapper.xml | 6 + ruoyi-ui/.env.production | 2 +- ruoyi-ui/README.md | 2 +- ruoyi-ui/src/api/ehs/ehsNoticeMessage.js | 65 +++ ruoyi-ui/src/api/ehs/ehsNoticeMessageFile.js | 53 ++ ruoyi-ui/src/api/system/dept.js | 8 + .../components/FileUploadNoFileType/index.vue | 216 +++++++++ ruoyi-ui/src/views/ehs/ehsMaterial/index.vue | 2 +- .../src/views/ehs/ehsNoticeMessage/index.vue | 391 +++++++++++++++ .../views/ehs/ehsNoticeMessage/indexDept.vue | 456 ++++++++++++++++++ ruoyi-ui/vue.config.js | 3 +- 26 files changed, 2142 insertions(+), 9 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageFileController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/domain/EhsNoticeMessage.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/mapper/EhsNoticeMessageMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/IEhsNoticeMessageService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/impl/EhsNoticeMessageServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/domain/EhsNoticeMessageFile.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/mapper/EhsNoticeMessageFileMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/IEhsNoticeMessageFileService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/impl/EhsNoticeMessageFileServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageFileMapper.xml create mode 100644 ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageMapper.xml create mode 100644 ruoyi-ui/src/api/ehs/ehsNoticeMessage.js create mode 100644 ruoyi-ui/src/api/ehs/ehsNoticeMessageFile.js create mode 100644 ruoyi-ui/src/components/FileUploadNoFileType/index.vue create mode 100644 ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue create mode 100644 ruoyi-ui/src/views/ehs/ehsNoticeMessage/indexDept.vue diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 1436d6d..b8acd6e 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -8,7 +8,7 @@ 3.8.6 4.0.0 - jar + war ruoyi-admin diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java new file mode 100644 index 0000000..bc1ae66 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java @@ -0,0 +1,194 @@ +package com.ruoyi.web.controller.ehs; + +import java.util.*; +import javax.servlet.http.HttpServletResponse; + +import com.github.pagehelper.util.StringUtil; +import com.ruoyi.common.constant.Constants; +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.system.service.ISysDeptService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; +import com.ruoyi.ehsNoticeMessage.service.IEhsNoticeMessageService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 内部公告Controller + * + * @author ruoyi + * @date 2023-12-06 + */ +@Api(tags="内部公告管理") +@RestController +@RequestMapping("/ehsNoticeMessage/ehsNoticeMessage") +public class EhsNoticeMessageController extends BaseController +{ + @Autowired + private IEhsNoticeMessageService ehsNoticeMessageService; + @Autowired + private ISysDeptService deptService; +/** + * 查询内部公告列表 + */ +@PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:list')") +@GetMapping("/list") + public TableDataInfo list(EhsNoticeMessage ehsNoticeMessage) + { + startPage(); + ehsNoticeMessage.setDeptId(SecurityUtils.getDeptId()); + ehsNoticeMessage.setStatus("1"); + ehsNoticeMessage.setFileDeptId(SecurityUtils.getDeptId()); + List list = ehsNoticeMessageService.selectEhsNoticeMessageList(ehsNoticeMessage); + return getDataTable(list); + } + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:listAdmin')") + @GetMapping("/listAdmin") + public TableDataInfo listAdmin(EhsNoticeMessage ehsNoticeMessage) + { + startPage(); + ehsNoticeMessage.setCreateDeptId(SecurityUtils.getDeptId()); + List list = ehsNoticeMessageService.selectEhsNoticeMessageListAdmin(ehsNoticeMessage); + return getDataTable(list); + } + /** + * 导出内部公告列表 + */ + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:export')") + @Log(title = "内部公告", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsNoticeMessage ehsNoticeMessage) + { + List list = ehsNoticeMessageService.selectEhsNoticeMessageList(ehsNoticeMessage); + ExcelUtil util = new ExcelUtil(EhsNoticeMessage.class); + util.exportExcel(response, list, "内部公告数据"); + } + + /** + * 获取内部公告详细信息 + */ + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:query')") + @GetMapping(value = "/{noticeMessageId}") + public AjaxResult getInfo(@PathVariable("noticeMessageId") Long noticeMessageId) + { + return success(ehsNoticeMessageService.selectEhsNoticeMessageByNoticeMessageId(noticeMessageId)); + } + + /** + * 新增内部公告 + */ + @ApiOperation("新增内部公告") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:add')") + @Log(title = "内部公告", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsNoticeMessage ehsNoticeMessage) + { + if (ehsNoticeMessage.getAllDept() == 0 && StringUtil.isEmpty(ehsNoticeMessage.getDeptList())) { + return error("未选择部门!"); + } else { + ehsNoticeMessage.setStatus("0"); + ehsNoticeMessage.setCreateUserId(SecurityUtils.getUserId()); + ehsNoticeMessage.setCreateDeptId(SecurityUtils.getDeptId()); + if (ehsNoticeMessage.getAllDept() == 1) { + List deptList = new ArrayList<>(); + SysDept dept = new SysDept(); + dept.setParentId(0L); + List depts = deptService.selectAllDeptList(dept); + for (SysDept dd : depts) { + deptList.add(dd.getDeptId().toString()); + } + ehsNoticeMessage.setDeptList(StringUtils.join(deptList, ",")); + } + return toAjax(ehsNoticeMessageService.save(ehsNoticeMessage)); + } + } + + /** + * 修改内部公告 + */ + @ApiOperation("修改内部公告") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:edit')") + @Log(title = "内部公告", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsNoticeMessage ehsNoticeMessage) + { + if (ehsNoticeMessage.getAllDept() == 0 && StringUtil.isEmpty(ehsNoticeMessage.getDeptList())) { + return error("未选择部门!"); + } else { + ehsNoticeMessage.setStatus("0"); + ehsNoticeMessage.setCreateUserId(SecurityUtils.getUserId()); + ehsNoticeMessage.setCreateDeptId(SecurityUtils.getDeptId()); + if (ehsNoticeMessage.getAllDept() == 1) { + List deptList = new ArrayList<>(); + SysDept dept = new SysDept(); + dept.setParentId(0L); + List depts = deptService.selectAllDeptList(dept); + for (SysDept dd : depts) { + deptList.add(dd.getDeptId().toString()); + } + ehsNoticeMessage.setDeptList(StringUtils.join(deptList, ",")); + } + return toAjax(ehsNoticeMessageService.updateById(ehsNoticeMessage)); + } + + } + + /** + * 删除内部公告 + */ + @ApiOperation("删除内部公告") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:remove')") + @Log(title = "内部公告", businessType = BusinessType.DELETE) + @DeleteMapping("/{noticeMessageIds}") + public AjaxResult remove(@PathVariable Long[] noticeMessageIds) + { + return toAjax(ehsNoticeMessageService.removeByIds(Arrays.asList(noticeMessageIds))); + } + + /** + *发布 + */ + @ApiOperation("发布公告") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:issueNews')") + @Log(title = "发布公告", businessType = BusinessType.UPDATE) + @GetMapping("/issueNews") + public AjaxResult issueNews( EhsNoticeMessage ehsNoticeMessage) + { + ehsNoticeMessage.setStatus("1"); + return toAjax(ehsNoticeMessageService.updateById(ehsNoticeMessage)); + } + + @ApiOperation("阅读公告") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessage:ehsNoticeMessage:detail')") + @Log(title = "阅读公告", businessType = BusinessType.UPDATE) + @GetMapping(value = "/detail/{noticeMessageId}") + public AjaxResult detail(@PathVariable("noticeMessageId") Long noticeMessageId) + { + EhsNoticeMessage ehsNoticeMessage = ehsNoticeMessageService.selectEhsNoticeMessageByNoticeMessageId(noticeMessageId); + EhsNoticeMessage nm = new EhsNoticeMessage(); + if (StringUtils.isEmpty(ehsNoticeMessage.getReadDeptId()) || ehsNoticeMessage.getReadDeptId().indexOf(SecurityUtils.getDeptId()+ ",") < 0) { + nm.setReadDeptId(SecurityUtils.getDeptId() + ","); + nm.setNoticeMessageId(noticeMessageId); + ehsNoticeMessageService.updateReadCompany(nm); + } + return success(ehsNoticeMessage); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageFileController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageFileController.java new file mode 100644 index 0000000..68fa235 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageFileController.java @@ -0,0 +1,158 @@ +package com.ruoyi.web.controller.ehs; + +import java.util.HashMap; +import java.util.List; +import java.util.Arrays; +import java.util.Map; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; +import com.ruoyi.ehsNoticeMessage.service.IEhsNoticeMessageService; +import com.ruoyi.system.service.ISysDeptService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ehsNoticeMessageFile.domain.EhsNoticeMessageFile; +import com.ruoyi.ehsNoticeMessageFile.service.IEhsNoticeMessageFileService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 通知公告附件Controller + * + * @author ruoyi + * @date 2023-12-07 + */ +@Api(tags="通知公告附件管理") +@RestController +@RequestMapping("/ehsNoticeMessageFile/ehsNoticeMessageFile") +public class EhsNoticeMessageFileController extends BaseController +{ + @Autowired + private IEhsNoticeMessageFileService ehsNoticeMessageFileService; + @Autowired + private ISysDeptService deptService; + @Autowired + private IEhsNoticeMessageService ehsNoticeMessageService; +/** + * 查询通知公告附件列表 + */ +@PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:list')") +@GetMapping("/list") + public TableDataInfo list(EhsNoticeMessageFile ehsNoticeMessageFile) + { + startPage(); + List list = ehsNoticeMessageFileService.selectEhsNoticeMessageFileList(ehsNoticeMessageFile); + return getDataTable(list); + } + + /** + * 导出通知公告附件列表 + */ + @PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:export')") + @Log(title = "通知公告附件", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsNoticeMessageFile ehsNoticeMessageFile) + { + List list = ehsNoticeMessageFileService.selectEhsNoticeMessageFileList(ehsNoticeMessageFile); + ExcelUtil util = new ExcelUtil(EhsNoticeMessageFile.class); + util.exportExcel(response, list, "通知公告附件数据"); + } + + /** + * 获取通知公告附件详细信息 + */ + @PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(ehsNoticeMessageFileService.selectEhsNoticeMessageFileById(id)); + } + + /** + * 新增通知公告附件 + */ + @ApiOperation("新增通知公告附件") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:add')") + @Log(title = "通知公告附件", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsNoticeMessageFile ehsNoticeMessageFile) + { + return toAjax(ehsNoticeMessageFileService.save(ehsNoticeMessageFile)); + } + + /** + * 修改通知公告附件 + */ + @ApiOperation("修改通知公告附件") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:edit')") + @Log(title = "通知公告附件", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsNoticeMessageFile ehsNoticeMessageFile) + { + return toAjax(ehsNoticeMessageFileService.updateById(ehsNoticeMessageFile)); + } + + /** + * 删除通知公告附件 + */ + @ApiOperation("删除通知公告附件") + @PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:remove')") + @Log(title = "通知公告附件", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(ehsNoticeMessageFileService.removeByIds(Arrays.asList(ids))); + } + + /** + * 文件列表,并按企业是否上传 + */ + @PreAuthorize("@ss.hasPermi('ehsNoticeMessageFile:ehsNoticeMessageFile:listFile')") + @GetMapping("/listFile") + public TableDataInfo listFile(EhsNoticeMessageFile ehsNoticeMessageFile) + { + + EhsNoticeMessage ehsNoticeMessage =ehsNoticeMessageService.getById(ehsNoticeMessageFile.getNoticeMessageId()); + SysDept dept = new SysDept(); + dept.setDeptIds(ehsNoticeMessage.getDeptList()); + List depts = deptService.selectDeptList(dept); + Map comMap = new HashMap() ; + Long[] cidsTemp = new Long[depts.size()]; + int j=0; + for(SysDept bas :depts){ + comMap.put(bas.getDeptId(),bas.getDeptName()); + cidsTemp[j]=bas.getDeptId(); + j++; + } + List fileList = ehsNoticeMessageFileService.selectEhsNoticeMessageFileList(ehsNoticeMessageFile); + String cids=","; + for(EhsNoticeMessageFile efile:fileList){ + cids= efile.getDeptId()+","; + } + //String[] cc = ehsNoticeMessageFile.getCompaynList().split(","); + for(int i=0;i children = new ArrayList(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/domain/EhsNoticeMessage.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/domain/EhsNoticeMessage.java new file mode 100644 index 0000000..24bb376 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/domain/EhsNoticeMessage.java @@ -0,0 +1,89 @@ +package com.ruoyi.ehsNoticeMessage.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 内部公告对象 ehs_notice_message + * + * @author ruoyi + * @date 2023-12-06 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_notice_message") +public class EhsNoticeMessage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(type= IdType.AUTO) + private Long noticeMessageId; + + /** 标题 */ + @Excel(name = "标题") + private String title; + + /** 内容 */ + @Excel(name = "内容") + private String displayContent; + + /** 文件下载列表 */ + @Excel(name = "文件下载列表") + private String fileName; + + /** 1:未发布 2:已发布 */ + @Excel(name = "0:未发布 1:已发布") + private String status; + + /** 已阅读企业id */ + @Excel(name = "已阅读企业id") + private String readDeptId; + + /** 0临时任务,1通知公告 */ + @Excel(name = "0临时任务,1通知公告") + private Long mesgType; + + /** 需要接收消息的企业列表 */ + @Excel(name = "需要接收消息的企业列表") + private String deptList; + + /** 0不是全部,1全部企业 */ + @Excel(name = "0不是全部,1全部企业") + private Integer allDept; + + /** 创建的部门,主要区别二级监管 */ + @Excel(name = "创建的部门,主要区别二级监管") + private Long createDeptId; + @Excel(name = "已上传数") + @TableField(exist = false) + private Integer fileCount; + + @TableField(exist = false) + private String fileState; + + @TableField(exist = false) + private Long fileDeptId; + + @TableField(exist = false) + private Long isRead; + + @TableField(exist = false) + private Long noticeMessageFileId; + + @TableField(exist = false) + private String originalName; + + @TableField(exist = false) + private String messageFileId; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/mapper/EhsNoticeMessageMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/mapper/EhsNoticeMessageMapper.java new file mode 100644 index 0000000..55efad6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/mapper/EhsNoticeMessageMapper.java @@ -0,0 +1,32 @@ +package com.ruoyi.ehsNoticeMessage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; +import java.util.List; + +/** + * 内部公告Mapper接口 + * + * @author ruoyi + * @date 2023-12-06 + */ +public interface EhsNoticeMessageMapper extends BaseMapper { + /** + * 查询内部公告 + * + * @param noticeMessageId 内部公告主键 + * @return 内部公告 + */ + public EhsNoticeMessage selectEhsNoticeMessageByNoticeMessageId(Long noticeMessageId); + + /** + * 查询内部公告列表 + * + * @param ehsNoticeMessage 内部公告 + * @return 内部公告集合 + */ + public List selectEhsNoticeMessageList(EhsNoticeMessage ehsNoticeMessage); + + public List selectEhsNoticeMessageListAdmin(EhsNoticeMessage ehsNoticeMessage); + public int updateReadCompany(EhsNoticeMessage ehsNoticeMessage); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/IEhsNoticeMessageService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/IEhsNoticeMessageService.java new file mode 100644 index 0000000..c5b6e39 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/IEhsNoticeMessageService.java @@ -0,0 +1,34 @@ +package com.ruoyi.ehsNoticeMessage.service; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; + +/** + * 内部公告Service接口 + * + * @author ruoyi + * @date 2023-12-06 + */ +public interface IEhsNoticeMessageService extends IService { + + /** + * 查询内部公告 + * + * @param noticeMessageId 内部公告主键 + * @return 内部公告 + */ + public EhsNoticeMessage selectEhsNoticeMessageByNoticeMessageId(Long noticeMessageId); + + /** + * 查询内部公告列表 + * + * @param ehsNoticeMessage 内部公告 + * @return 内部公告集合 + */ + public List selectEhsNoticeMessageList(EhsNoticeMessage ehsNoticeMessage); + + + public List selectEhsNoticeMessageListAdmin(EhsNoticeMessage ehsNoticeMessage); + public int updateReadCompany(EhsNoticeMessage ehsNoticeMessage); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/impl/EhsNoticeMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/impl/EhsNoticeMessageServiceImpl.java new file mode 100644 index 0000000..10deee1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/service/impl/EhsNoticeMessageServiceImpl.java @@ -0,0 +1,79 @@ +package com.ruoyi.ehsNoticeMessage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; +import java.util.List; +import java.util.Map; +import com.ruoyi.ehsNoticeMessage.mapper.EhsNoticeMessageMapper; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; +import com.ruoyi.ehsNoticeMessage.service.IEhsNoticeMessageService; + +/** + * 内部公告Service业务层处理 + * + * @author ruoyi + * @date 2023-12-06 + */ +@Service +public class EhsNoticeMessageServiceImpl extends ServiceImpl implements IEhsNoticeMessageService { + + @Autowired + private EhsNoticeMessageMapper ehsNoticeMessageMapper; + + /** + * 查询内部公告 + * + * @param noticeMessageId 内部公告主键 + * @return 内部公告 + */ + @Override + public EhsNoticeMessage selectEhsNoticeMessageByNoticeMessageId(Long noticeMessageId) + { + return ehsNoticeMessageMapper.selectEhsNoticeMessageByNoticeMessageId(noticeMessageId); + } + + /** + * 查询内部公告列表 + * + * @param ehsNoticeMessage 内部公告 + * @return 内部公告 + */ + @Override + public List selectEhsNoticeMessageList(EhsNoticeMessage ehsNoticeMessage) + { + return ehsNoticeMessageMapper.selectEhsNoticeMessageList(ehsNoticeMessage); + } + @Override + public List selectEhsNoticeMessageListAdmin(EhsNoticeMessage ehsNoticeMessage) + { + return ehsNoticeMessageMapper.selectEhsNoticeMessageListAdmin(ehsNoticeMessage); + } + @Override + public int updateReadCompany(EhsNoticeMessage ehsNoticeMessage) + { + return ehsNoticeMessageMapper.updateReadCompany(ehsNoticeMessage); + } + + private LambdaQueryWrapper buildQueryWrapper(EhsNoticeMessage query) { + Map params = query.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(query.getTitle()), EhsNoticeMessage::getTitle, query.getTitle()); + lqw.eq(StringUtils.isNotBlank(query.getDisplayContent()), EhsNoticeMessage::getDisplayContent, query.getDisplayContent()); + lqw.like(StringUtils.isNotBlank(query.getFileName()), EhsNoticeMessage::getFileName, query.getFileName()); + lqw.eq(StringUtils.isNotBlank(query.getStatus()), EhsNoticeMessage::getStatus, query.getStatus()); + lqw.eq(StringUtils.isNotBlank(query.getReadDeptId()), EhsNoticeMessage::getReadDeptId, query.getReadDeptId()); + lqw.eq(query.getMesgType() != null, EhsNoticeMessage::getMesgType, query.getMesgType()); + lqw.eq(StringUtils.isNotBlank(query.getDeptList()), EhsNoticeMessage::getDeptList, query.getDeptList()); + lqw.eq(query.getAllDept() != null, EhsNoticeMessage::getAllDept, query.getAllDept()); + lqw.orderByDesc(EhsNoticeMessage::getCreateTime); + lqw.eq(query.getDeptId() != null, EhsNoticeMessage::getDeptId, query.getDeptId()); + lqw.eq(query.getCreateUserId() != null, EhsNoticeMessage::getCreateUserId, query.getCreateUserId()); + lqw.eq(query.getUpdateUserId() != null, EhsNoticeMessage::getUpdateUserId, query.getUpdateUserId()); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/domain/EhsNoticeMessageFile.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/domain/EhsNoticeMessageFile.java new file mode 100644 index 0000000..3c0b6e3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/domain/EhsNoticeMessageFile.java @@ -0,0 +1,62 @@ +package com.ruoyi.ehsNoticeMessageFile.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 通知公告附件对象 ehs_notice_message_file + * + * @author ruoyi + * @date 2023-12-07 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_notice_message_file") +public class EhsNoticeMessageFile extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(type= IdType.AUTO) + private Long id; + + /** 消息表主键 */ + @Excel(name = "消息表主键") + private Long noticeMessageId; + + /** 上传文件名,只能保存一个文件 */ + @Excel(name = "上传文件名,只能保存一个文件") + private String fileName; + + /** 0已上传未提交 1已提交,同一个消息的状态应该是一致的 */ + @Excel(name = "0已上传未提交 1已提交,同一个消息的状态应该是一致的") + private Integer state; + + /** 上传文件的原始文件名,多个文件需要多个记录 */ + @Excel(name = "上传文件的原始文件名,多个文件需要多个记录") + private String originalName; + + /** 附件大小 */ + @Excel(name = "附件大小") + private String fileSize; + + /** 提交时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date submitTime; + + @TableField(exist = false) + private String deptIName; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/mapper/EhsNoticeMessageFileMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/mapper/EhsNoticeMessageFileMapper.java new file mode 100644 index 0000000..04a33ec --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/mapper/EhsNoticeMessageFileMapper.java @@ -0,0 +1,29 @@ +package com.ruoyi.ehsNoticeMessageFile.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsNoticeMessageFile.domain.EhsNoticeMessageFile; +import java.util.List; + +/** + * 通知公告附件Mapper接口 + * + * @author ruoyi + * @date 2023-12-07 + */ +public interface EhsNoticeMessageFileMapper extends BaseMapper { + /** + * 查询通知公告附件 + * + * @param id 通知公告附件主键 + * @return 通知公告附件 + */ + public EhsNoticeMessageFile selectEhsNoticeMessageFileById(String id); + + /** + * 查询通知公告附件列表 + * + * @param ehsNoticeMessageFile 通知公告附件 + * @return 通知公告附件集合 + */ + public List selectEhsNoticeMessageFileList(EhsNoticeMessageFile ehsNoticeMessageFile); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/IEhsNoticeMessageFileService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/IEhsNoticeMessageFileService.java new file mode 100644 index 0000000..21a78e1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/IEhsNoticeMessageFileService.java @@ -0,0 +1,31 @@ +package com.ruoyi.ehsNoticeMessageFile.service; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsNoticeMessageFile.domain.EhsNoticeMessageFile; + +/** + * 通知公告附件Service接口 + * + * @author ruoyi + * @date 2023-12-07 + */ +public interface IEhsNoticeMessageFileService extends IService { + + /** + * 查询通知公告附件 + * + * @param id 通知公告附件主键 + * @return 通知公告附件 + */ + public EhsNoticeMessageFile selectEhsNoticeMessageFileById(String id); + + /** + * 查询通知公告附件列表 + * + * @param ehsNoticeMessageFile 通知公告附件 + * @return 通知公告附件集合 + */ + public List selectEhsNoticeMessageFileList(EhsNoticeMessageFile ehsNoticeMessageFile); + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/impl/EhsNoticeMessageFileServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/impl/EhsNoticeMessageFileServiceImpl.java new file mode 100644 index 0000000..8d587f7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessageFile/service/impl/EhsNoticeMessageFileServiceImpl.java @@ -0,0 +1,67 @@ +package com.ruoyi.ehsNoticeMessageFile.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; +import java.util.List; +import java.util.Map; +import com.ruoyi.ehsNoticeMessageFile.mapper.EhsNoticeMessageFileMapper; +import com.ruoyi.ehsNoticeMessageFile.domain.EhsNoticeMessageFile; +import com.ruoyi.ehsNoticeMessageFile.service.IEhsNoticeMessageFileService; + +/** + * 通知公告附件Service业务层处理 + * + * @author ruoyi + * @date 2023-12-07 + */ +@Service +public class EhsNoticeMessageFileServiceImpl extends ServiceImpl implements IEhsNoticeMessageFileService { + + @Autowired + private EhsNoticeMessageFileMapper ehsNoticeMessageFileMapper; + + /** + * 查询通知公告附件 + * + * @param id 通知公告附件主键 + * @return 通知公告附件 + */ + @Override + public EhsNoticeMessageFile selectEhsNoticeMessageFileById(String id) + { + return ehsNoticeMessageFileMapper.selectEhsNoticeMessageFileById(id); + } + + /** + * 查询通知公告附件列表 + * + * @param ehsNoticeMessageFile 通知公告附件 + * @return 通知公告附件 + */ + @Override + public List selectEhsNoticeMessageFileList(EhsNoticeMessageFile ehsNoticeMessageFile) + { + return ehsNoticeMessageFileMapper.selectEhsNoticeMessageFileList(ehsNoticeMessageFile); + } + + + private LambdaQueryWrapper buildQueryWrapper(EhsNoticeMessageFile query) { + Map params = query.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(query.getFileName()), EhsNoticeMessageFile::getFileName, query.getFileName()); + lqw.eq(query.getState() != null, EhsNoticeMessageFile::getState, query.getState()); + lqw.like(StringUtils.isNotBlank(query.getOriginalName()), EhsNoticeMessageFile::getOriginalName, query.getOriginalName()); + lqw.eq(StringUtils.isNotBlank(query.getFileSize()), EhsNoticeMessageFile::getFileSize, query.getFileSize()); + lqw.eq(query.getSubmitTime() != null, EhsNoticeMessageFile::getSubmitTime, query.getSubmitTime()); + lqw.orderByDesc(EhsNoticeMessageFile::getCreateTime); + lqw.eq(query.getDeptId() != null, EhsNoticeMessageFile::getDeptId, query.getDeptId()); + lqw.eq(query.getCreateUserId() != null, EhsNoticeMessageFile::getCreateUserId, query.getCreateUserId()); + lqw.eq(query.getUpdateUserId() != null, EhsNoticeMessageFile::getUpdateUserId, query.getUpdateUserId()); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageFileMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageFileMapper.xml new file mode 100644 index 0000000..a17efa7 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageFileMapper.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + select id, notice_message_id, file_name, state, original_name, file_size, submit_time, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_notice_message_file + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageMapper.xml new file mode 100644 index 0000000..f3cab22 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageMapper.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select notice_message_id, title, display_content, file_name, status, read_dept_id, mesg_type, dept_list, all_dept, create_dept_id, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_notice_message + + + + + + + + update ehs_notice_message + + read_Dept_id =CONCAT(read_Dept_id,#{readDeptId}) + + where notice_message_id = #{noticeMessageId} + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index cdee1a4..5a12433 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -42,6 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND status = #{status} + + and dept_id in ( ${deptIds} ) + ${params.dataScope} order by d.parent_id, d.order_num @@ -60,6 +63,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"