From 162cded138349bd292be4740a31b94b2da58ff97 Mon Sep 17 00:00:00 2001 From: liukewei Date: Thu, 18 Jan 2024 13:25:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E8=B7=9F=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ehs/EhsHiddenDangerController.java | 56 ++- .../ehs/EhsMaterialDetailController.java | 4 + .../ehs/EhsMyMessageController.java | 154 +++++++ .../ehs/EhsNoticeMessageController.java | 8 + .../ehs/EhsNoticeMessageFileController.java | 2 +- .../domain/EhsHiddenDanger.java | 6 + .../mapper/EhsHiddenDangerMapper.java | 1 + .../service/IEhsHiddenDangerService.java | 1 + .../impl/EhsHiddenDangerServiceImpl.java | 3 + .../vo/HiddenDangerStatisticsVo.java | 2 + .../domain/EhsMaterialDetail.java | 9 + .../ehsMyMessage/domain/EhsMyMessage.java | 60 +++ .../mapper/EhsMyMessageMapper.java | 33 ++ .../service/IEhsMyMessageService.java | 34 ++ .../service/impl/EhsMyMessageServiceImpl.java | 83 ++++ .../domain/EhsNoticeMessage.java | 7 + .../domain/EhsRescueTeamWorker.java | 2 + .../mapper/ehs/EhsHiddenDangerMapper.xml | 13 + .../mapper/ehs/EhsIndexStatisticsMapper.xml | 5 +- .../mapper/ehs/EhsMaterialDetailMapper.xml | 5 + .../mapper/ehs/EhsMyMessageMapper.xml | 88 ++++ .../mapper/ehs/EhsNoticeMessageMapper.xml | 12 +- .../mapper/ehs/EhsRescueTeamWorkerMapper.xml | 3 +- ruoyi-ui/src/api/ehs/ehsHiddenDanger.js | 8 + ruoyi-ui/src/api/ehs/ehsMyMessage.js | 52 +++ ruoyi-ui/src/layout/components/Navbar.vue | 308 +++++++------ ruoyi-ui/src/router/index.js | 22 +- ruoyi-ui/src/views/ehs/ehsExamples/index.vue | 18 +- .../src/views/ehs/ehsExamples/indexHD.vue | 425 ++++++++++++++++++ .../src/views/ehs/ehsHiddenDanger/index.vue | 52 ++- ruoyi-ui/src/views/ehs/ehsMaterial/index.vue | 88 +++- ruoyi-ui/src/views/ehs/ehsMyMessage/index.vue | 328 ++++++++++++++ .../src/views/ehs/ehsNoticeMessage/index.vue | 54 ++- .../views/ehs/ehsNoticeMessage/indexDept.vue | 56 ++- .../src/views/ehs/ehsRescueTeam/index.vue | 50 ++- .../views/ehs/ehsRescueTeamWorker/index.vue | 83 ++-- ruoyi-ui/src/views/index.vue | 49 +- 37 files changed, 1974 insertions(+), 210 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/domain/EhsMyMessage.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/mapper/EhsMyMessageMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/IEhsMyMessageService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/ehs/EhsMyMessageMapper.xml create mode 100644 ruoyi-ui/src/api/ehs/ehsMyMessage.js create mode 100644 ruoyi-ui/src/views/ehs/ehsExamples/indexHD.vue create mode 100644 ruoyi-ui/src/views/ehs/ehsMyMessage/index.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java index 4238016..d806e79 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java @@ -4,7 +4,10 @@ import java.util.List; import java.util.Arrays; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.ehsMyMessage.domain.EhsMyMessage; +import com.ruoyi.ehsMyMessage.service.IEhsMyMessageService; import com.ruoyi.ehsRisk.domain.EhsRisk; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +44,8 @@ public class EhsHiddenDangerController extends BaseController { @Autowired private IEhsHiddenDangerService ehsHiddenDangerService; - + @Autowired + private IEhsMyMessageService ehsMyMessageService; /** * 查询隐患信息列表 */ @@ -170,4 +174,54 @@ public class EhsHiddenDangerController extends BaseController String message = ehsHiddenDangerService.importHiddenDanger(list, updateSupport); return AjaxResult.success(message); } + @GetMapping("/getOverTimeId") + public AjaxResult getOverTimeId() + { + //获取临期或超时的隐患id,比较本人的最后一条,如果不一样就插入一条,如果一样就不插入,新插入的是未读 + //如果点检首页弹窗的连接,就设置为已读,并转跳的隐患页面,并查询出所有临期或超时的隐患 + EhsHiddenDanger ehsHiddenDanger = ehsHiddenDangerService.selectOverTimeId(new EhsHiddenDanger()); + EhsMyMessage ehsMyMessage = new EhsMyMessage(); + ehsMyMessage.setMyMessageType("0"); + ehsMyMessage.setMyUserId(SecurityUtils.getUserId()); + EhsMyMessage msg = ehsMyMessageService.selectEhsMyMessageByMyMessageMax(ehsMyMessage); + boolean isNew =false; + if(msg==null ){ + if(StringUtils.isNotEmpty(ehsHiddenDanger.getOverTimeId())) + isNew = true; + else + isNew = false; + }else{ + if(StringUtils.isNotEmpty(ehsHiddenDanger.getOverTimeId())) { + if(!ehsHiddenDanger.getOverTimeId().equals(msg.getMyMessageKey())) {//两者不一致 + String[] newIds = ehsHiddenDanger.getOverTimeId().split(","); + String oldIds = "," + msg.getMyMessageKey() + ","; + for (String id : newIds) { + if (oldIds.indexOf("," + id + ",") == -1) {//不包含,表示有新的id + isNew = true; + break; + } + } + }else{//两者一致 + if(msg.getMyMessageState().equals("N")) { + return success(msg); + }else{ + msg.setMyMessageDesc(""); + return success(msg); + } + } + } + } + if (isNew) {//有新的id,生成一个新记录 + EhsMyMessage msgNew = new EhsMyMessage(); + msgNew.setMyUserId(SecurityUtils.getUserId()); + msgNew.setMyMessageType("0"); + msgNew.setMyMessageDesc("您有新的将要逾期或已逾期的记录,请及及时处理!"); + msgNew.setMyMessageKey(ehsHiddenDanger.getOverTimeId()); + msgNew.setMyMessageState("N"); + ehsMyMessageService.save(msgNew); + return success(msgNew); + } + ehsMyMessage.setMyMessageDesc(""); + return success(ehsMyMessage); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java index 4d8dfc2..b343b27 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java @@ -144,6 +144,10 @@ public class EhsMaterialDetailController extends BaseController md.setOutboundUserId(SecurityUtils.getUserId()); md.setOutboundQuantity(list.get(0).getSendQuantity()); md.setInventory(result2); + md.setReceiveName(ehsMaterialDetail.getReceiveName()); + md.setReceiveTel(ehsMaterialDetail.getReceiveTel()); + md.setHandledBy(ehsMaterialDetail.getHandledBy()); + md.setOutTime(ehsMaterialDetail.getOutTime()); return toAjax(ehsMaterialDetailService.updateById(md)); } return error("未查询到出库指令"); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java new file mode 100644 index 0000000..48658f1 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java @@ -0,0 +1,154 @@ +package com.ruoyi.web.controller.ehs; + +import java.util.List; +import java.util.Arrays; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; +import com.ruoyi.ehsNoticeMessage.service.IEhsNoticeMessageService; +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.ehsMyMessage.domain.EhsMyMessage; +import com.ruoyi.ehsMyMessage.service.IEhsMyMessageService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 我的的消息Controller + * + * @author ruoyi + * @date 2024-01-16 + */ +@Api(tags="我的的消息管理") +@RestController +@RequestMapping("/ehsMyMessage/ehsMyMessage") +public class EhsMyMessageController extends BaseController +{ + @Autowired + private IEhsMyMessageService ehsMyMessageService; + @Autowired + private IEhsNoticeMessageService ehsNoticeMessageService; +/** + * 查询我的的消息列表 + */ +//@PreAuthorize("@ss.hasPermi('ehsMyMessage:ehsMyMessage:list')") +@GetMapping("/list") + public TableDataInfo list(EhsMyMessage ehsMyMessage) + { + startPage(); + List list = ehsMyMessageService.selectEhsMyMessageList(ehsMyMessage); + return getDataTable(list); + } + + /** + * 导出我的的消息列表 + */ + //@PreAuthorize("@ss.hasPermi('ehsMyMessage:ehsMyMessage:export')") + @Log(title = "我的的消息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsMyMessage ehsMyMessage) + { + List list = ehsMyMessageService.selectEhsMyMessageList(ehsMyMessage); + ExcelUtil util = new ExcelUtil(EhsMyMessage.class); + util.exportExcel(response, list, "我的的消息数据"); + } + + /** + * 获取我的的消息详细信息 + */ + //@PreAuthorize("@ss.hasPermi('ehsMyMessage:ehsMyMessage:query')") + @GetMapping(value = "/{myMessageId}") + public AjaxResult getInfo(@PathVariable("myMessageId") Long myMessageId) + { + return success(ehsMyMessageService.selectEhsMyMessageByMyMessageId(myMessageId)); + } + + /** + * 新增我的的消息 + */ + @ApiOperation("新增我的的消息") + //@PreAuthorize("@ss.hasPermi('ehsMyMessage:ehsMyMessage:add')") + @Log(title = "我的的消息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsMyMessage ehsMyMessage) + { + return toAjax(ehsMyMessageService.save(ehsMyMessage)); + } + + /** + * 修改我的的消息 + */ + @ApiOperation("修改我的的消息") + //@PreAuthorize("@ss.hasPermi('ehsMyMessage:ehsMyMessage:edit')") + @Log(title = "我的的消息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsMyMessage ehsMyMessage) + { + return toAjax(ehsMyMessageService.updateById(ehsMyMessage)); + } + + /** + * 删除我的的消息 + */ + @ApiOperation("删除我的的消息") + //@PreAuthorize("@ss.hasPermi('ehsMyMessage:ehsMyMessage:remove')") + @Log(title = "我的的消息", businessType = BusinessType.DELETE) + @DeleteMapping("/{myMessageIds}") + public AjaxResult remove(@PathVariable Long[] myMessageIds) + { + return toAjax(ehsMyMessageService.removeByIds(Arrays.asList(myMessageIds))); + } + @GetMapping("/getUnread") + public AjaxResult getUnread() + { + AjaxResult ajr = new AjaxResult(); + EhsMyMessage ehsMyMessage = new EhsMyMessage(); + ehsMyMessage.setMyMessageType("0"); + ehsMyMessage.setMyUserId(SecurityUtils.getUserId()); + EhsMyMessage msg = ehsMyMessageService.selectEhsMyMessageByMyMessageMax(ehsMyMessage); + if(msg.getMyMessageState().equals("N")) + ajr.put("msgHD","1"); + else + ajr.put("msgHD","0"); + //分析是否有本人的未读消息通知 + //消息通知的每一记录,我的消息都应该有一条记录,如果没有,说明未读,并向我的消息插入一条记录,并设置为未读 + //消息通知模块点击阅读按钮后,需要同时修改我的消息的已读标志 + //统计我的消息类型=1的所有未读数量。 + EhsMyMessage myMsg = new EhsMyMessage(); + myMsg.setNoticeDeptId(SecurityUtils.getDeptId()); + myMsg.setNoticeStatus("1"); + myMsg.setNoticeMesgType(1L); + myMsg.setMyMessageType("1"); + myMsg.setMyUserId(SecurityUtils.getUserId()); + List list = ehsMyMessageService.selectUnReadNotice(myMsg); + if(!list.isEmpty()){ + for(EhsMyMessage emsg :list){ + EhsMyMessage msgNew = new EhsMyMessage(); + msgNew.setMyMessageKey(emsg.getMyMessageId().toString()); + ehsMyMessageService.saveMyMessage(msgNew); + } + } + EhsMyMessage msgQuery = new EhsMyMessage(); + msgQuery.setMyMessageType("1"); + msgQuery.setMyMessageState("N"); + msgQuery.setMyUserId(SecurityUtils.getUserId()); + Long msgCount = ehsMyMessageService.msgCount(msgQuery); + ajr.put("msg",msgCount.toString()); + return ajr; + } +} 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 index 7329f35..dad9d6d 100644 --- 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 @@ -8,6 +8,8 @@ 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.ehsMyMessage.domain.EhsMyMessage; +import com.ruoyi.ehsMyMessage.service.IEhsMyMessageService; import com.ruoyi.system.service.ISysDeptService; import org.apache.commons.lang3.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; @@ -46,6 +48,8 @@ public class EhsNoticeMessageController extends BaseController private IEhsNoticeMessageService ehsNoticeMessageService; @Autowired private ISysDeptService deptService; + @Autowired + private IEhsMyMessageService ehsMyMessageService; /** * 查询内部公告列表 */ @@ -182,6 +186,7 @@ public class EhsNoticeMessageController extends BaseController public AjaxResult issueNews( EhsNoticeMessage ehsNoticeMessage) { ehsNoticeMessage.setStatus("1"); + ehsNoticeMessage.setIssueTime(new Date()); return toAjax(ehsNoticeMessageService.updateById(ehsNoticeMessage)); } @@ -198,6 +203,9 @@ public class EhsNoticeMessageController extends BaseController nm.setNoticeMessageId(noticeMessageId); ehsNoticeMessageService.updateReadCompany(nm); } + EhsMyMessage msgNew = new EhsMyMessage(); + msgNew.setMyMessageKey(noticeMessageId.toString()); + ehsMyMessageService.saveMyMessage(msgNew); 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 index afa54c3..75dee58 100644 --- 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 @@ -151,7 +151,7 @@ public class EhsNoticeMessageFileController extends BaseController for(EhsNoticeMessageFile efile:fileList){ cids= efile.getDeptId()+","; // 避免循环查数据库库 - efile.setDeptName(comMap.get(efile.getDeptId())); + efile.setDeptName(StringUtils.isEmpty(comMap.get(efile.getDeptId()))?"未知部门":comMap.get(efile.getDeptId())); //SysDept sysDept = deptService.selectDeptById(efile.getDeptId()); //efile.setDeptName(sysDept.getDeptName()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/domain/EhsHiddenDanger.java b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/domain/EhsHiddenDanger.java index 609ba6a..ca90314 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/domain/EhsHiddenDanger.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/domain/EhsHiddenDanger.java @@ -143,4 +143,10 @@ public class EhsHiddenDanger extends BaseEntity private String hiddenDangerLabelName;//是否超时未整改 @TableField(exist = false) private Integer overTime;//是否超时未整改 + @Excel(name = "企业详细地址" ) + private String address; + @TableField(exist = false) + private Integer currMonth; + @TableField(exist = false) + private String overTimeId;//超时隐患的id合集 } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/mapper/EhsHiddenDangerMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/mapper/EhsHiddenDangerMapper.java index 47a94a7..5a923e6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/mapper/EhsHiddenDangerMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/mapper/EhsHiddenDangerMapper.java @@ -26,6 +26,7 @@ public interface EhsHiddenDangerMapper extends BaseMapper { * @return 隐患信息集合 */ public List selectEhsHiddenDangerList(EhsHiddenDanger ehsHiddenDanger); + public EhsHiddenDanger selectOverTimeId(EhsHiddenDanger ehsHiddenDanger); /** * 督办 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/IEhsHiddenDangerService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/IEhsHiddenDangerService.java index 097943a..4b1ccb7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/IEhsHiddenDangerService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/IEhsHiddenDangerService.java @@ -44,4 +44,5 @@ public interface IEhsHiddenDangerService extends IService { public String importHiddenDanger(List list, Boolean isUpdateSupport ); public EhsHiddenDanger selectEhsHiddenDangerOverTime(EhsHiddenDanger ehsHiddenDanger); + public EhsHiddenDanger selectOverTimeId(EhsHiddenDanger ehsHiddenDanger); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/impl/EhsHiddenDangerServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/impl/EhsHiddenDangerServiceImpl.java index f08da89..6ebbe99 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/impl/EhsHiddenDangerServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsHiddenDanger/service/impl/EhsHiddenDangerServiceImpl.java @@ -176,4 +176,7 @@ public class EhsHiddenDangerServiceImpl extends ServiceImpl { + /** + * 查询我的的消息 + * + * @param myMessageId 我的的消息主键 + * @return 我的的消息 + */ + public EhsMyMessage selectEhsMyMessageByMyMessageId(Long myMessageId); + + /** + * 查询我的的消息列表 + * + * @param ehsMyMessage 我的的消息 + * @return 我的的消息集合 + */ + public List selectEhsMyMessageList(EhsMyMessage ehsMyMessage); + + public EhsMyMessage selectEhsMyMessageByMyMessageMax(EhsMyMessage ehsMyMessage); + + public List selectUnReadNotice(EhsMyMessage ehsMyMessage); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/IEhsMyMessageService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/IEhsMyMessageService.java new file mode 100644 index 0000000..9bd7263 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/IEhsMyMessageService.java @@ -0,0 +1,34 @@ +package com.ruoyi.ehsMyMessage.service; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsMyMessage.domain.EhsMyMessage; + +/** + * 我的的消息Service接口 + * + * @author ruoyi + * @date 2024-01-16 + */ +public interface IEhsMyMessageService extends IService { + + /** + * 查询我的的消息 + * + * @param myMessageId 我的的消息主键 + * @return 我的的消息 + */ + public EhsMyMessage selectEhsMyMessageByMyMessageId(Long myMessageId); + + /** + * 查询我的的消息列表 + * + * @param ehsMyMessage 我的的消息 + * @return 我的的消息集合 + */ + public List selectEhsMyMessageList(EhsMyMessage ehsMyMessage); + public EhsMyMessage selectEhsMyMessageByMyMessageMax(EhsMyMessage ehsMyMessage); + public Long msgCount(EhsMyMessage query); + public List selectUnReadNotice(EhsMyMessage ehsMyMessage); + public boolean saveMyMessage(EhsMyMessage msgNew); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java new file mode 100644 index 0000000..7951ea3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java @@ -0,0 +1,83 @@ +package com.ruoyi.ehsMyMessage.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 com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.ehsNoticeMessage.domain.EhsNoticeMessage; +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.ehsMyMessage.mapper.EhsMyMessageMapper; +import com.ruoyi.ehsMyMessage.domain.EhsMyMessage; +import com.ruoyi.ehsMyMessage.service.IEhsMyMessageService; + +/** + * 我的的消息Service业务层处理 + * + * @author ruoyi + * @date 2024-01-16 + */ +@Service +public class EhsMyMessageServiceImpl extends ServiceImpl implements IEhsMyMessageService { + + @Autowired + private EhsMyMessageMapper ehsMyMessageMapper; + + /** + * 查询我的的消息 + * + * @param myMessageId 我的的消息主键 + * @return 我的的消息 + */ + @Override + public EhsMyMessage selectEhsMyMessageByMyMessageId(Long myMessageId) + { + return ehsMyMessageMapper.selectEhsMyMessageByMyMessageId(myMessageId); + } + + /** + * 查询我的的消息列表 + * + * @param ehsMyMessage 我的的消息 + * @return 我的的消息 + */ + @Override + public List selectEhsMyMessageList(EhsMyMessage ehsMyMessage) + { + return ehsMyMessageMapper.selectEhsMyMessageList(ehsMyMessage); + } + + + private LambdaQueryWrapper buildQueryWrapper(EhsMyMessage query) { + Map params = query.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(query.getMyMessageKey()), EhsMyMessage::getMyMessageKey, query.getMyMessageKey()); + lqw.eq(StringUtils.isNotBlank(query.getMyMessageType()), EhsMyMessage::getMyMessageType, query.getMyMessageType()); + lqw.eq(StringUtils.isNotBlank(query.getMyMessageDesc()), EhsMyMessage::getMyMessageDesc, query.getMyMessageDesc()); + lqw.eq(StringUtils.isNotBlank(query.getMyMessageState()), EhsMyMessage::getMyMessageState, query.getMyMessageState()); + lqw.eq(query.getMyUserId() != null, EhsMyMessage::getMyUserId, query.getMyUserId()); + lqw.orderByDesc(EhsMyMessage::getCreateTime); + return lqw; + } + public EhsMyMessage selectEhsMyMessageByMyMessageMax(EhsMyMessage ehsMyMessage){ + return ehsMyMessageMapper.selectEhsMyMessageByMyMessageMax(ehsMyMessage); + } + @Override + public Long msgCount(EhsMyMessage query){ + return ehsMyMessageMapper.selectCount(buildQueryWrapper(query)); + } + + public List selectUnReadNotice(EhsMyMessage ehsMyMessage){ + return ehsMyMessageMapper.selectUnReadNotice(ehsMyMessage); + } + public boolean saveMyMessage(EhsMyMessage msgNew){ + msgNew.setMyUserId(SecurityUtils.getUserId()); + msgNew.setMyMessageType("1"); + msgNew.setMyMessageDesc("您有新的消息通知未阅读,请及及时处理!"); + msgNew.setMyMessageState("N"); + return saveOrUpdate(msgNew); + } +} 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 index 3587d6b..eb45535 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/domain/EhsNoticeMessage.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsNoticeMessage/domain/EhsNoticeMessage.java @@ -4,6 +4,7 @@ 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 com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; @@ -11,6 +12,8 @@ import lombok.experimental.Accessors; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import java.util.Date; + /** * 内部公告对象 ehs_notice_message * @@ -92,4 +95,8 @@ public class EhsNoticeMessage extends BaseEntity private String messageFileId; @TableField(exist = false) private Long[] deptListArray; + @Excel(name = "发布时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date issueTime; + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/domain/EhsRescueTeamWorker.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/domain/EhsRescueTeamWorker.java index fb29edf..4bb0ed7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/domain/EhsRescueTeamWorker.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeamWorker/domain/EhsRescueTeamWorker.java @@ -74,6 +74,8 @@ public class EhsRescueTeamWorker extends BaseEntity { */ @Excel(name = "联系方式") private String phone; + @Excel(name = "地址") + private String address; /** 队内职务 */ @Excel(name = "队内职务") diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsHiddenDangerMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsHiddenDangerMapper.xml index c023b25..1720e4a 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsHiddenDangerMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsHiddenDangerMapper.xml @@ -33,6 +33,9 @@ + + + @@ -66,9 +69,11 @@ FROM ehs_hidden_danger h LEFT JOIN sys_dept d ON h.dept_id = d.dept_id and hidden_danger_type = #{hiddenDangerType} and FIND_IN_SET( #{assistDept}, assist_dept ) and area_id = #{areaId} + and DATE_FORMAT(NOW(), '%Y-%m') = DATE_FORMAT( h.check_time, '%Y-%m') and (h.STATUS = 0 or h.STATUS = 5 ) AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) )>3 AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) ) <= 7 and (h.STATUS = 0 or h.STATUS = 5 ) AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) )>=0 AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) ) < 3 and (h.STATUS = 0 or h.STATUS = 5 ) AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) ) < 0 + and (h.STATUS = 0 or h.STATUS = 5 ) AND DATEDIFF(h.rectify_term_time ,ifnull(h.rectify_time,CURDATE()) ) <= 7 AND @@ -77,6 +82,14 @@ FROM ehs_hidden_danger h LEFT JOIN sys_dept d ON h.dept_id = d.dept_id + -select c.dict_label 'name',ifnull(a.thisUnitNum,0) thisUnitNum,ifnull(a.totalUnitNum,0) totalUnitNum,ifnull(a.thisReportNum,0) thisReportNum,ifnull(a.totalReportNum,0) totalReportNum +select c.dict_label 'name',c.dict_value dept_id,ifnull(a.thisUnitNum,0) thisUnitNum,ifnull(a.totalUnitNum,0) totalUnitNum,ifnull(a.thisReportNum,0) thisReportNum,ifnull(a.totalReportNum,0) totalReportNum ,ifnull(a.thisHaveNum,0)thisHaveNum,ifnull(a.totalHaveNum,0)totalHaveNum,ifnull(a.thisNotNum,0)thisNotNum,ifnull(a.totalNotNum,0)totalNotNum,ifnull(a.thisRate,0)thisRate,ifnull(a.totalRate,0)totalRate from sys_dict_data c left join( SELECT @@ -157,7 +157,8 @@ SELECT d.dept_name 'areaName', count(r.dept_id) 'reportHiddenNum' FROM - sys_dept d left join ehs_hidden_danger r on r.dept_id = d.dept_id + sys_dept d left join (select * from ehs_hidden_danger where + DATE_FORMAT(NOW(), '%Y-%m') = DATE_FORMAT( check_time, '%Y-%m')) r on r.dept_id = d.dept_id GROUP BY d.dept_id,d.dept_name ) s diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml index bf0f18d..97448ff 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml @@ -24,6 +24,11 @@ + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsMyMessageMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsMyMessageMapper.xml new file mode 100644 index 0000000..ef0dda0 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsMyMessageMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select my_message_id, my_message_key, my_message_type, my_message_desc, + my_message_state, my_user_id, create_by, create_time, update_by, update_time, remark, dept_id, + create_user_id, update_user_id from ehs_my_message + + + + + + + + + + + \ 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 index 6f3cf07..e074425 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsNoticeMessageMapper.xml @@ -32,6 +32,7 @@ + @@ -39,7 +40,7 @@ diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml index e76d1ce..754d70b 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamWorkerMapper.xml @@ -15,6 +15,7 @@ + @@ -28,7 +29,7 @@ - select id, rescue_team_id, rescue_team_name, worker_name, worker_age, gender, id_card, phone, team_post, work_year, speciality, train_num, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_rescue_team_worker + select id, address,rescue_team_id, rescue_team_name, worker_name, worker_age, gender, id_card, phone, team_post, work_year, speciality, train_num, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_rescue_team_worker update ehs_rescue_team_worker diff --git a/ruoyi-ui/src/api/ehs/ehsHiddenDanger.js b/ruoyi-ui/src/api/ehs/ehsHiddenDanger.js index 8820b7c..13b7233 100644 --- a/ruoyi-ui/src/api/ehs/ehsHiddenDanger.js +++ b/ruoyi-ui/src/api/ehs/ehsHiddenDanger.js @@ -58,3 +58,11 @@ export function assistEhsHiddenDanger(data) { params: data }) } + +// 查询是否有新的逾期 +export function getOverTimeId() { + return request({ + url: '/ehsHiddenDanger/ehsHiddenDanger/getOverTimeId', + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/ehs/ehsMyMessage.js b/ruoyi-ui/src/api/ehs/ehsMyMessage.js new file mode 100644 index 0000000..5fceaa4 --- /dev/null +++ b/ruoyi-ui/src/api/ehs/ehsMyMessage.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询我的的消息列表 +export function listEhsMyMessage(query) { + return request({ + url: '/ehsMyMessage/ehsMyMessage/list', + method: 'get', + params: query + }) +} + +// 查询我的的消息详细 +export function getEhsMyMessage(myMessageId) { + return request({ + url: '/ehsMyMessage/ehsMyMessage/' + myMessageId, + method: 'get' + }) +} + +// 新增我的的消息 +export function addEhsMyMessage(data) { + return request({ + url: '/ehsMyMessage/ehsMyMessage', + method: 'post', + data: data + }) +} + +// 修改我的的消息 +export function updateEhsMyMessage(data) { + return request({ + url: '/ehsMyMessage/ehsMyMessage', + method: 'put', + data: data + }) +} + +// 删除我的的消息 +export function delEhsMyMessage(myMessageId) { + return request({ + url: '/ehsMyMessage/ehsMyMessage/' + myMessageId, + method: 'delete' + }) +} + +// 查询我的的未读消息 +export function getUnread() { + return request({ + url: '/ehsMyMessage/ehsMyMessage/getUnread', + method: 'get' + }) +} diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index e89f269..66a5411 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -9,13 +9,14 @@ + +
+ + +
+ + + + 隐患消息 + + + + + 消息通知 + + + + +
@@ -47,154 +68,185 @@ diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 71907b6..acfe7da 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -87,7 +87,27 @@ export const constantRoutes = [ meta: { title: '个人中心', icon: 'user' } } ] - } + }, + { + path: '/ehs', + component: Layout, + hidden: true, + redirect: 'noredirect', + permissions: ['ehsMyMessage:ehsMyMessage:list','ehsMyMessage:ehsMyMessage:remove'], + children: [ + { + path: 'ehsMyMessage', + component: () => import('@/views/ehs/ehsMyMessage/index'), + permissions: ['ehsMyMessage:ehsMyMessage:list','ehsMyMessage:ehsMyMessage:remove'], + name: 'ehsMyMessage', + meta: { + title: '我的消息', + icon: 'user' , + permissions: ['ehsMyMessage:ehsMyMessage:list','ehsMyMessage:ehsMyMessage:remove'], + } + } + ] + }, ] // 动态路由,基于用户权限动态去加载 diff --git a/ruoyi-ui/src/views/ehs/ehsExamples/index.vue b/ruoyi-ui/src/views/ehs/ehsExamples/index.vue index fdc6b13..fe35dcf 100644 --- a/ruoyi-ui/src/views/ehs/ehsExamples/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsExamples/index.vue @@ -1,5 +1,6 @@ + diff --git a/ruoyi-ui/src/views/ehs/ehsHiddenDanger/index.vue b/ruoyi-ui/src/views/ehs/ehsHiddenDanger/index.vue index ae05430..5887397 100644 --- a/ruoyi-ui/src/views/ehs/ehsHiddenDanger/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsHiddenDanger/index.vue @@ -377,7 +377,8 @@ @click="handleIsSupervise(scope.row)" v-hasPermi="['ehsHiddenDanger:ehsHiddenDanger:supervise']" >督办--> - + + + + @@ -601,16 +605,10 @@ - - - - + + + @@ -628,9 +626,16 @@ - - - + @@ -714,6 +719,7 @@ export default { openAssist:false,//打开协办弹框 assistDeptList:"",//协办部门 currAssistHiddenDangerId :-1,//当前协办隐患id + queryOverTime:null,//调用是传递的参数 statusOptions: [{ value: '0', label: '停业', @@ -745,7 +751,8 @@ export default { hiddenDangerLabel: null, hiddenDangerLabelArray:null, isTowns:null, - overTime:null + overTime:null, + address:null, }, alertState: [{ value: '7', @@ -756,7 +763,10 @@ export default { }, { value: '0', label: '逾期告警' - }], + },{ + value: '10', + label: '全部临期或逾期' + } ], // 表单参数 form: {}, formAssist:{}, @@ -765,6 +775,7 @@ export default { enterpriseName: [ { type: 'string',required: true,message: "单位名称必填", trigger: 'blur'}], enterpriseType: [ { type: 'string',required: true,message: "行业必须选择", trigger: 'blur'}], enterpriseStatus: [ { type: 'string',required: true,message: "企业现状必须选择", trigger: 'blur'}], + address: [ { type: 'string',required: true,message: "企业详细地址必填", trigger: 'blur'}], hiddenDangerDesc: [ { type: 'string',required: true,message: "隐患情况必填", trigger: 'blur'}], checkTime: [ { required: true,message: "排查时间必填", trigger: 'blur'}], rectifyTermTime: [ { required: true,message: "整改期限必填", trigger: 'blur'}], @@ -820,9 +831,13 @@ export default { }; }, created() { + this.queryParams.overTime = this.$route.query.overTime; this.getList(); + this.$route.query.overTime = null; this.getListAllDept(); this.deptShow = this.$store.state.user.parentId==0 ?true :false; + console.log(this.$route.query.overTime); + }, methods: { /** 查询隐患信息列表 */ @@ -897,7 +912,9 @@ export default { resetQuery() { this.daterangeCheckTime = []; this.daterangeRectifyTime = []; + this.resetForm("queryForm"); + this.queryParams.overTime = null; this.handleQuery(); }, // 多选框选中数据 @@ -996,6 +1013,7 @@ export default { handleAssist(row) { this.reset(); this.openAssist = true; + this.assistDeptList = row.assistDept.split(",").map(Number); this.currAssistHiddenDangerId = row.hiddenDangerId; }, /** 协办提交*/ @@ -1076,12 +1094,12 @@ export default { this.getList(); }, tableRowClassName({row, rowIndex}) { - if(row.status==0 ||status==5){ + if(row.status=="0" ||row.status=="5"){ if (row.overTime <0 ) { return 'warning-row'; } else if (row.overTime > 3 && row.overTime <= 7) { return 'warning7-row'; - } else if (row.overTime > 0 && rowIndex <= 3) { + } else if (row.overTime >= 0 && row.overTime <= 3) { return 'warning3-row'; } } diff --git a/ruoyi-ui/src/views/ehs/ehsMaterial/index.vue b/ruoyi-ui/src/views/ehs/ehsMaterial/index.vue index 9604cb5..beee07a 100644 --- a/ruoyi-ui/src/views/ehs/ehsMaterial/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsMaterial/index.vue @@ -341,6 +341,15 @@ + + + + + + + @@ -462,6 +497,9 @@ form: { classFirst:this.$route.query.classFirst }, + outOpen:false, + outMaterialId:null, + outForm:{}, // 表单校验 rules: { materialQuantity: [ @@ -483,6 +521,21 @@ tel: [ { pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: "联系电话必须是手机或固话(区号-固话)", trigger: "change" } ], + receiveName: [ + { required: true, message: "领取人不能为空", trigger: "blur" } + ], + outTime: [ + { required: true, message: "出库时间不能为空", trigger: "blur" } + ], + /*receiveTel: [ + { message: "领取人电话必须是手机或固话(区号-固话)", trigger: "change" } + ],*/ + handledBy: [ + { required: true, message: "经手人不能为空", trigger: "blur" } + ], + receiveTel: [ + { required: true, message: "经手人不能为空", trigger: "blur", pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/ } + ], }, @@ -568,8 +621,20 @@ this.open = false; this.reset(); }, + outCancel() { + this.outOpen = false; + this.outReset(); + }, + outReset() { + this.outForm = { + receiveName: null, + receiveTel: null, + outTime: null, + handledBy: null, + } + }, // 表单重置 - reset() { + reset(){ this.form = { materialId: null, materialType: null, @@ -653,6 +718,20 @@ } }); }, + /** 执行出库提交按钮 */ + submitOutForm() { + this.$refs["outForm"].validate(valid => { + if (valid) { + if (this.outForm.materialId != null) { + updateEhsMaterialDetail(this.outForm).then(response => { + this.$modal.msgSuccess("出库成功"); + this.outOpen = false; + this.getList(); + }); + } + } + }); + }, /** 删除按钮操作 */ handleDelete(row) { const materialIds = row.materialId || this.ids; @@ -708,12 +787,15 @@ this.getListDetail(); },/** */ handleOutbound(row) { - this.$modal.confirm('是否执行出库指令?' ).then(function() { + this.outOpen = true; + this.outForm.materialId = row.materialId; + this.outForm.sendQuantity = row.sendQuantity; + /* this.$modal.confirm('是否执行出库指令?' ).then(function() { return updateEhsMaterialDetail({"materialId":row.materialId}); }).then(() => { this.getList(); this.$modal.msgSuccess("执行成功"); - }).catch(() => {}); + }).catch(() => {});*/ }, /** 入库 */ handleInbound(row) { diff --git a/ruoyi-ui/src/views/ehs/ehsMyMessage/index.vue b/ruoyi-ui/src/views/ehs/ehsMyMessage/index.vue new file mode 100644 index 0000000..4fc0d5e --- /dev/null +++ b/ruoyi-ui/src/views/ehs/ehsMyMessage/index.vue @@ -0,0 +1,328 @@ + + + diff --git a/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue b/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue index a4272d6..1daa385 100644 --- a/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue @@ -9,7 +9,7 @@ @keyup.enter.native="handleQuery" /> - + + + 搜索 @@ -79,6 +92,11 @@ {{ statusList[scope.row.status].label}} + + + - +