diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java index ef5dab1..253dfaf 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java @@ -40,32 +40,32 @@ public class BigViewDataController { @GetMapping("/getLeftSecond") @Operation(summary = "大屏左二数据") - public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { - return bigViewDataService.getLeftSecond(homeSelectVO); + public CommonResult getLeftSecond(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getLeftSecond(homeSelectVO)); } @GetMapping("/getLeftThird") @Operation(summary = "大屏左三数据") - public List getLeftThird(HomeSelectVO homeSelectVO) { - return bigViewDataService.getLeftThird(homeSelectVO); + public CommonResult> getLeftThird(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getLeftThird(homeSelectVO)); } @GetMapping("/getRightFist") @Operation(summary = "大屏右一数据") - public List getRightFist(HomeSelectVO homeSelectVO) { - return bigViewDataService.getRightFist(homeSelectVO); + public CommonResult> getRightFist(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getRightFist(homeSelectVO)); } @GetMapping("/getRightSecond") @Operation(summary = "大屏右二数据") - public List getRightSecond(HomeSelectVO homeSelectVO) { - return bigViewDataService.getRightSecond(homeSelectVO); + public CommonResult> getRightSecond(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getRightSecond(homeSelectVO)); } @GetMapping("/getRightThird") @Operation(summary = "大屏右三数据") - public List getRightThird(HomeSelectVO homeSelectVO) { - return bigViewDataService.getRightThird(homeSelectVO); + public CommonResult> getRightThird(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getRightThird(homeSelectVO)); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/NameCountVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/NameCountVO.java index 7023f31..92edb23 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/NameCountVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/NameCountVO.java @@ -5,5 +5,5 @@ import lombok.Data; @Data public class NameCountVO { private String name; - private Integer count; + private Integer value; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java index 0b6a796..796269f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java @@ -5,5 +5,6 @@ import lombok.Data; @Data public class StatusCountVO { private Integer status; - private Integer count; + private Integer value; + private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java index d883031..bb2ed41 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java @@ -17,7 +17,7 @@ public interface BigViewDataMapper { /* 执法记录状态统计 */ - List selectStatusCount(HomeSelectVO homeSelectVO); + List selectStatusCount(HomeSelectVO homeSelectVO); /* 根据任务类型分组 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/InspectionsSendStartMessageJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/InspectionsSendStartMessageJob.java index b1a3373..cf89bd5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/InspectionsSendStartMessageJob.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/InspectionsSendStartMessageJob.java @@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.system.job; import cn.hutool.core.date.DateUtil; import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; +import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi; +import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; import cn.iocoder.yudao.module.system.api.social.SocialClientApi; import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; import cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsCorrectionVO; @@ -21,6 +23,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import javax.swing.*; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -40,6 +43,8 @@ public class InspectionsSendStartMessageJob implements JobHandler { EnterpriseService enterpriseService; @Resource EnterpriseInspectionsService enterpriseInspectionsService; + @Resource + NotifyMessageSendApi notifyMessageSendApi; @Override public String execute(String param) throws Exception { @@ -49,8 +54,24 @@ public class InspectionsSendStartMessageJob implements JobHandler { if (enterpriseInspectionsCorrectionVOS != null && enterpriseInspectionsCorrectionVOS.size() > 0) { for (final EnterpriseInspectionsCorrectionVO item : enterpriseInspectionsCorrectionVOS) { final InspectionsLogDO inspectionsLogNew = enterpriseInspectionsService.getInspectionsLogNew(item.getInspectionsId()); + //站内信发送通知 + + if (inspectionsLogNew != null && inspectionsLogNew.getStatus() == 3) { + + //站内信发送通知 final EnterpriseDO enterprise = enterpriseService.getEnterprise(item.getEnterpriseId()); + + //站内信发送通知 + NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); + notifyMessage.setUserId(Long.valueOf(item.getCreator())); + notifyMessage.setTemplateCode("correction_time"); + Map templateParams = new HashMap<>(); + templateParams.put("title", enterpriseService.getEnterprise(item.getEnterpriseId()).getEnterprisesName()); + templateParams.put("correctionTime", inspectionsLogNew.getCorrectionTime()); + notifyMessage.setTemplateParams(templateParams); + notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage); + num ++ ; try { SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskExecJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskExecJob.java deleted file mode 100644 index c807a4a..0000000 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskExecJob.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.yudao.module.system.job; - -import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; -import cn.iocoder.yudao.module.system.service.taskinfo.TaskInfoService; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; - -@Component -public class TaskExecJob implements JobHandler { - /** - * 执行任务 - * - * @param param 参数 - * @return 结果 - * @throws Exception 异常 - */ - @Resource - private TaskInfoService taskInfoService; - - @Override - public String execute(String param) throws Exception { - final Long taskId = Long.valueOf(param); - taskInfoService.sendTask(taskId); - return ""; - } -} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java index d3cb141..fd6be11 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java @@ -17,7 +17,7 @@ public interface BigViewDataService { List getRightFist(HomeSelectVO homeSelectVO); - List getRightSecond(HomeSelectVO homeSelectVO); + List getRightSecond(HomeSelectVO homeSelectVO); List getRightThird(HomeSelectVO homeSelectVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java index ffefc04..222abf3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java @@ -33,7 +33,7 @@ public class BigViewDataServiceImpl implements BigViewDataService { List countList = new ArrayList<>(); if (nameCountVOS != null) { nameCountVOS.forEach(item->{ - countList.add(item.getCount()); + countList.add(item.getValue()); }); } final Integer count = countList.stream().reduce(Integer::sum).orElse(0); @@ -53,8 +53,26 @@ public class BigViewDataServiceImpl implements BigViewDataService { } @Override - public List getRightSecond(HomeSelectVO homeSelectVO) { - return bigViewDataMapper.selectStatusCount(homeSelectVO); + public List getRightSecond(HomeSelectVO homeSelectVO) { + + final List statusCountVOS = bigViewDataMapper.selectStatusCount(homeSelectVO); + if (statusCountVOS != null && statusCountVOS.size() > 0) { + statusCountVOS.forEach(item->{ + switch (item.getName()) { + case "1": + item.setName("已签到"); + break; + case "2": + item.setName("已通过"); + break; + case "3": + item.setName("整改中"); + break; + } + }); + } + + return statusCountVOS; } @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java index 7a3f9c0..5860e4c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java @@ -221,6 +221,24 @@ public class EnterpriseServiceImpl implements EnterpriseService { @Override public PageResult getEnterpriseByUserId(EnterprisePageReqVO pageReqVO) { + //根据角色显示不同 + /* + 管理员,局长,查全部 + 检查员,查自己的 + 队长 查本部门 + */ + Long loginUserId = getLoginUserId(); + final AdminUserDO user1 = adminUserService.getUser(loginUserId); + if (user1.getPostIds().contains(1l) || user1.getPostIds().contains(2l)) { + //全部 + } else if (user1.getPostIds().contains(4l)) { + //本部门 + pageReqVO.setDepartmentId(user1.getDeptId()); + + } else if (user1.getPostIds().contains(5l)) { + //自己 + pageReqVO.setUserId(loginUserId); + } final PageResult enterpriseDOPageResult = enterpriseMapper.selectPage(pageReqVO); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java index 951131e..83a7607 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java @@ -257,9 +257,11 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe } //查询企业标签 - final List tagLibraryDOS = tagLibraryService.listByEnterpriseId(enterpriseDO.getId()); - if (tagLibraryDOS != null) { - item.setTagList(tagLibraryDOS.stream().map(TagLibraryDO::getTagName).collect(Collectors.toList())); + final TagLibraryDO tagLibrary = tagLibraryService.getTagLibrary(taskInfoDO.getTaskType()); + if (tagLibrary != null) { + List list = new ArrayList<>(); + list.add(tagLibrary.getTagName()); + item.setTagList(list); } item.setEnterpriseName(enterpriseDO.getEnterprisesName()); item.setEnterpriseAddress(enterpriseDO.getAddress()); @@ -301,10 +303,10 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe if (item.getUserId() != null) { final Long userId = Long.valueOf(item.getUserId()); final AdminUserDO user = adminUserService.getUser(userId); - item.setInspectName(user.getRealName()); if (user == null) { throw exception(USER_NOT_EXISTS); } + item.setInspectName(user.getRealName()); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java index c72807a..a74118d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taskinfo/TaskInfoServiceImpl.java @@ -101,7 +101,6 @@ public class TaskInfoServiceImpl implements TaskInfoService { }); } - //添加企业范围 if (!createReqVO.getEnterpriseIds().isEmpty() && createReqVO.getEnterpriseIds().size() > 0) { List list = new ArrayList<>(); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml index 89d14eb..1266795 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml @@ -14,7 +14,7 @@ resultType="cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO"> select sd.name as name, - count(e.id) as count + count(e.id) as value from enterprises e left join system_dept sd on e.department_id = sd.id @@ -22,10 +22,10 @@ e.department_id