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 253dfaf..419e0da 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 @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.bigviewdata; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewGroupCountCompareVO; +import cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO; +import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeCountResVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -50,9 +53,15 @@ public class BigViewDataController { return success(bigViewDataService.getLeftThird(homeSelectVO)); } - @GetMapping("/getRightFist") + @GetMapping("/getCenter") + @Operation(summary = "大屏中间总数统计") + public CommonResult getCenter(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getCenter(homeSelectVO)); + } + + @GetMapping("/getRightFirst") @Operation(summary = "大屏右一数据") - public CommonResult> getRightFist(HomeSelectVO homeSelectVO) { + public CommonResult> getRightFist(HomeSelectVO homeSelectVO) { return success(bigViewDataService.getRightFist(homeSelectVO)); } @@ -64,8 +73,14 @@ public class BigViewDataController { @GetMapping("/getRightThird") @Operation(summary = "大屏右三数据") - public CommonResult> getRightThird(HomeSelectVO homeSelectVO) { + public CommonResult> getRightThird(HomeSelectVO homeSelectVO) { return success(bigViewDataService.getRightThird(homeSelectVO)); } + @GetMapping("/getRightFourth") + @Operation(summary = "大屏右数据") + public CommonResult> getRightFourth(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getRightFourth(homeSelectVO)); + } + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewGroupCountCompareVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewGroupCountCompareVO.java new file mode 100644 index 0000000..f714209 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewGroupCountCompareVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo; + +import lombok.Data; + +@Data +public class BigViewGroupCountCompareVO { + private String name; + //当前月执法统计 + private Integer currentEnforcementCount; + //上个月执法统计 + private Integer previousEnforcementCount; + //执法环比增长率计算 + private Integer enforcementGrowthRate; + //当前月任务统计 + private Integer currentTaskCount; + //上个月任务统计 + private Integer previousTaskCount; + //任务环比增长率计算 + private Integer taskGrowthRate; +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewQOQVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewQOQVO.java new file mode 100644 index 0000000..82186fb --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewQOQVO.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo; + +import lombok.Data; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Data +public class BigViewQOQVO { + private String currentStartTime; + private String currentEndTime; + private String previousStartTime; + private String previousEndTime; + +} + 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 796269f..09a4ef4 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 @@ -6,5 +6,6 @@ import lombok.Data; public class StatusCountVO { private Integer status; private Integer value; + private Integer taskValue; private String name; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java index 8df633e..be956b4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java @@ -235,7 +235,6 @@ public class EnterpriseController { //企业图片 final List fileList = fileInfoService.getFileList(EnterpriseServiceImpl.DEFAULT_DICT_TYPE, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY, item.getId().toString()); item.setFiles(fileList); - // 企业标签 final List tagLibraryDOS1 = tagLibraryService.listByEnterpriseId(item.getId()); if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsCorrectionVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsCorrectionVO.java index 9a7e92a..f6434c5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsCorrectionVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsCorrectionVO.java @@ -9,5 +9,5 @@ public class EnterpriseInspectionsCorrectionVO { private String correctName; private Long creator; private Long enterpriseId; - + private String feedback; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/qualification/vo/QualificationExpiredVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/qualification/vo/QualificationExpiredVO.java new file mode 100644 index 0000000..d9175b8 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/qualification/vo/QualificationExpiredVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.system.controller.admin.qualification.vo; + +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +public class QualificationExpiredVO { + //公司名称 + private String enterpriseName; + //过期时间 + private LocalDateTime expiryDate; + //用户id + private Long userId; + //企业id + private Long enterpriseId; +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java index d9045f4..8f7ed9e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java @@ -84,9 +84,9 @@ public class TagLibraryController { public CommonResult> getTagLibraryList(String[] codeList) { List pageResult = tagLibraryService.list(codeList); return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class)); - } + @GetMapping("/childrenList") @Operation(summary = "获得标签分页") @PreAuthorize("@ss.hasPermission('system:tag-library:query')") 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 bb2ed41..ecd5315 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 @@ -1,9 +1,12 @@ package cn.iocoder.yudao.module.system.dal.mysql.bigviewdata; +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewGroupCountCompareVO; +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewQOQVO; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Options; import java.util.List; @@ -24,4 +27,14 @@ public interface BigViewDataMapper { */ List selectTaskTypeGroupCount(HomeSelectVO homeSelectVO); + /* + 执法和任务分组统计 + */ + List getInspectionsTaskGroupCount(HomeSelectVO homeSelectVO); + + /* + 执法和任务分组统计同比 + */ + List getInspectionsTaskGroupCountCompare(BigViewQOQVO bigViewQOQVO); + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/qualification/EnterpriseQualificationMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/qualification/EnterpriseQualificationMapper.java index 99419f1..da0281b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/qualification/EnterpriseQualificationMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/qualification/EnterpriseQualificationMapper.java @@ -5,6 +5,7 @@ import java.util.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; import cn.iocoder.yudao.module.system.dal.dataobject.qualification.EnterpriseQualificationDO; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.system.controller.admin.qualification.vo.*; @@ -31,4 +32,7 @@ public interface EnterpriseQualificationMapper extends BaseMapperX expiredList(); + +} 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 cf89bd5..af87a4d 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 @@ -65,10 +65,12 @@ public class InspectionsSendStartMessageJob implements JobHandler { //站内信发送通知 NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); notifyMessage.setUserId(Long.valueOf(item.getCreator())); - notifyMessage.setTemplateCode("correction_time"); + notifyMessage.setTemplateCode("correction_messages"); Map templateParams = new HashMap<>(); templateParams.put("title", enterpriseService.getEnterprise(item.getEnterpriseId()).getEnterprisesName()); templateParams.put("correctionTime", inspectionsLogNew.getCorrectionTime()); + templateParams.put("url", "sub/inspection/detail?id=" + item.getInspectionsId()); + notifyMessage.setTemplateParams(templateParams); notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage); @@ -76,12 +78,13 @@ public class InspectionsSendStartMessageJob implements JobHandler { try { SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); reqDTO.setUserType(1); - reqDTO.setTemplateTitle("整改任务通知"); - reqDTO.setPage("sub/task/detail?id=" + item.getInspectionsId()); + reqDTO.setTemplateTitle("问题整改通知"); + reqDTO.setPage("sub/inspection/detail?id=" + item.getInspectionsId()); reqDTO.setUserId(Long.valueOf(item.getCreator())); Map message = new HashMap<>(); - message.put("thing2", enterprise.getEnterprisesName()); - message.put("time3", DateUtil.format(inspectionsLogNew.getCorrectionTime(), DateUtils.FORMAT_YEAR_MONTH_DAY)); + message.put("thing5", enterprise.getEnterprisesName()); + message.put("time8", DateUtil.format(inspectionsLogNew.getCorrectionTime(), DateUtils.FORMAT_YEAR_MONTH_DAY)); + message.put("time9", item.getFeedback()); reqDTO.setMessages(message); socialClientApi.sendWxaSubscribeMessage(reqDTO); } catch (Exception e) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/QualificationTimeOutSendStartMessageJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/QualificationTimeOutSendStartMessageJob.java index 88e900d..8d3783e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/QualificationTimeOutSendStartMessageJob.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/QualificationTimeOutSendStartMessageJob.java @@ -3,12 +3,16 @@ 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.qualification.vo.QualificationExpiredVO; import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; import cn.iocoder.yudao.module.system.dal.dataobject.inspectionslog.InspectionsLogDO; import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.EnterpriseInspectionsMapper; +import cn.iocoder.yudao.module.system.dal.mysql.qualification.EnterpriseQualificationMapper; import cn.iocoder.yudao.module.system.service.enterprise.EnterpriseService; import cn.iocoder.yudao.module.system.service.inspectionslog.InspectionsLogService; import lombok.extern.slf4j.Slf4j; @@ -16,56 +20,56 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.HashMap; +import java.util.List; import java.util.Map; @Component @Slf4j public class QualificationTimeOutSendStartMessageJob implements JobHandler { - @Resource - InspectionsLogService inspectionsLogService; - @Resource SocialClientApi socialClientApi; @Resource - EnterpriseInspectionsMapper enterpriseInspectionsMapper; + EnterpriseQualificationMapper enterpriseQualificationMapper; @Resource - EnterpriseService enterpriseService; + NotifyMessageSendApi notifyMessageSendApi; @Override public String execute(String param) throws Exception { //要发送的信息 - final Long id = Long.valueOf(param); - final InspectionsLogDO inspectionsLog = inspectionsLogService.getInspectionsLog(id); - if (inspectionsLog != null && inspectionsLog.getCreator() != null) { - - final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(id); - if (enterpriseInspectionsDO != null) { - final EnterpriseDO enterprise = enterpriseService.getEnterprise(enterpriseInspectionsDO.getEnterpriseId()); + final List qualificationExpiredVOS = enterpriseQualificationMapper.expiredList(); + if (qualificationExpiredVOS != null && qualificationExpiredVOS.size() > 0) { + qualificationExpiredVOS.forEach(item->{ try { - Long userId = Long.valueOf(inspectionsLog.getCreator()); - //发送消息); + //发送消息 SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); reqDTO.setUserType(1); - reqDTO.setTemplateTitle("环保任务通知"); - reqDTO.setPage("sub/task/detail?id="+inspectionsLog.getInspectionsId()); - reqDTO.setUserId(userId); + reqDTO.setTemplateTitle("认证到期提醒"); + reqDTO.setPage("sub/enterprise/detail?id="+item.getEnterpriseId()); + reqDTO.setUserId(item.getUserId()); Map message = new HashMap<>(); - message.put("thing2", enterprise.getEnterprisesName()); - message.put("time3", DateUtil.format(inspectionsLog.getCorrectionTime(), DateUtils.FORMAT_YEAR_MONTH_DAY)); -// message.put("thing4", beforeTaskInfo.getDescription()); -// message.put("time5", DateUtil.format(beforeTaskInfo.getEndDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY)); + message.put("phrase1", item.getEnterpriseName()); + message.put("data2", DateUtil.format(item.getExpiryDate(), DateUtils.FORMAT_YEAR_MONTH_DAY)); + reqDTO.setMessages(message); socialClientApi.sendWxaSubscribeMessage(reqDTO); + + //保存站内信 + NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); + notifyMessage.setUserId(Long.valueOf(item.getUserId())); + notifyMessage.setTemplateCode("qualification_expiry_date"); + Map templateParams = new HashMap<>(); + templateParams.put("title", item.getEnterpriseName()); + templateParams.put("expiryDate", item.getExpiryDate()); + notifyMessage.setTemplateParams(templateParams); + notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage); } catch (Exception e){ log.error("任务发送通知错误:",e.toString()); } - - - } + }); } return "发送整个信息成功"; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java index 202ba3b..3fdce35 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.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.taskinfo.vo.TaskInfoRespVO; @@ -31,6 +33,8 @@ public class TaskSendStartMessageJob implements JobHandler { SocialClientApi socialClientApi; @Resource EnterpriseInspectionsMapper enterpriseInspectionsMapper; + @Resource + NotifyMessageSendApi notifyMessageSendApi; @Override public String execute(String param) throws Exception { @@ -39,6 +43,7 @@ public class TaskSendStartMessageJob implements JobHandler { beforeTaskInfoList.forEach(beforeTaskInfo -> { beforeTaskInfo.getEnterpriseIdeTasks().forEach(x ->{ if(x.getUserId()!= null){ + try { //发送消息); SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); @@ -64,6 +69,16 @@ public class TaskSendStartMessageJob implements JobHandler { List enterpriseInspectionsDOList = enterpriseInspectionsMapper.selectList(wrapper); if(enterpriseInspectionsDOList!=null && enterpriseInspectionsDOList.size()>0){ for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) { + //站内信发送通知 + NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO(); + notifyMessage.setUserId(Long.valueOf(enterpriseInspectionsDO.getUserId())); + notifyMessage.setTemplateCode("task_messages"); + Map templateParams = new HashMap<>(); + templateParams.put("title", beforeTaskInfo.getTitle()); + templateParams.put("startTime", beforeTaskInfo.getStartDate()); + notifyMessage.setTemplateParams(templateParams); + notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage); + enterpriseInspectionsDO.setStatus(2); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index d40d2b9..8918e0c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.api.social.dto.SocialUserRespDTO; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.*; import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; +import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO; import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserBindDO; import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; @@ -79,6 +80,8 @@ public class AdminAuthServiceImpl implements AdminAuthService { private SocialUserMapper socialUserMapper; @Resource private SocialUserBindMapper socialUserBindMapper; + @Resource + private UserRoleMapper userRoleMapper; /** * 验证码的开关,默认为 true @@ -327,8 +330,11 @@ public class AdminAuthServiceImpl implements AdminAuthService { user = userService.autoRegisterUser(authUser, reqVO.getUserType()); - //给一个默认的普通用户的角色 -// UserRoleMapper + //给一个默认的专管员角色 + UserRoleDO userRoleDO = new UserRoleDO(); + userRoleDO.setUserId(user.getId()); + userRoleDO.setRoleId(155L); + userRoleMapper.insert(userRoleDO); user.setIsBand(false); 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 fd6be11..bdf1532 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 @@ -1,8 +1,10 @@ package cn.iocoder.yudao.module.system.service.bigviewdata; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewEnterpriseCountGroup; +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewGroupCountCompareVO; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO; +import cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeCountResVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; @@ -15,12 +17,15 @@ public interface BigViewDataService { List getLeftThird(HomeSelectVO homeSelectVO); - List getRightFist(HomeSelectVO homeSelectVO); + List getRightFist(HomeSelectVO homeSelectVO); List getRightSecond(HomeSelectVO homeSelectVO); - List getRightThird(HomeSelectVO homeSelectVO); + List getRightThird(HomeSelectVO homeSelectVO); List getLeftFirst(HomeSelectVO homeSelectVO); + List getRightFourth(HomeSelectVO homeSelectVO); + + HomeCountResVO getCenter(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 222abf3..07171bf 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 @@ -1,34 +1,64 @@ package cn.iocoder.yudao.module.system.service.bigviewdata; -import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewEnterpriseCountGroup; -import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO; -import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO; +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.*; +import cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO; +import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeCountResVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; import cn.iocoder.yudao.module.system.dal.mysql.bigviewdata.BigViewDataMapper; import cn.iocoder.yudao.module.system.dal.mysql.taskinfo.TaskInfoMapper; +import cn.iocoder.yudao.module.system.service.home.HomeService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Service +@Slf4j public class BigViewDataServiceImpl implements BigViewDataService { @Resource private BigViewDataMapper bigViewDataMapper; @Resource private TaskInfoMapper taskInfoMapper; + @Resource + private HomeService homeService; @Override public List getLeftFirst(HomeSelectVO homeSelectVO) { return bigViewDataMapper.selectTaskTypeGroupCount(homeSelectVO); } + @Override + public List getRightFourth(HomeSelectVO homeSelectVO) { + //时间范围 +// LocalDateTime startTime = LocalDateTime.now().minusMonths(1); +// LocalDateTime endTime = LocalDateTime.now(); +// homeSelectVO.setStartTime(startTime); +// homeSelectVO.setEndTime(endTime); +// + BigViewQOQVO bigViewQOQVO = new BigViewQOQVO(); + LocalDate today = LocalDate.now(); + bigViewQOQVO.setCurrentStartTime(today.withDayOfMonth(1).toString()); + bigViewQOQVO.setCurrentEndTime(today.toString()); + bigViewQOQVO.setPreviousStartTime(today.withDayOfMonth(1).minusMonths(1).toString()); + bigViewQOQVO.setPreviousEndTime(today.minusMonths(1).toString()); + + return bigViewDataMapper.getInspectionsTaskGroupCountCompare(bigViewQOQVO); + } + + @Override + public HomeCountResVO getCenter(HomeSelectVO homeSelectVO) { + return homeService.appCount1(homeSelectVO); + } + @Override public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { BigViewEnterpriseCountGroup enterpriseCountGroup = new BigViewEnterpriseCountGroup(); - final List nameCountVOS = bigViewDataMapper.enterpriseCountGroup(homeSelectVO); + final List nameCountVOS = bigViewDataMapper.enterpriseCountGroup(homeSelectVO); enterpriseCountGroup.setEnterpriseCountGroup(nameCountVOS); List countList = new ArrayList<>(); if (nameCountVOS != null) { @@ -48,8 +78,29 @@ public class BigViewDataServiceImpl implements BigViewDataService { } @Override - public List getRightFist(HomeSelectVO homeSelectVO) { - return null; + public List getRightFist(HomeSelectVO homeSelectVO) { + return bigViewDataMapper.getInspectionsTaskGroupCount(homeSelectVO); + } + + public LocalDateTime[] getWeek(HomeSelectVO homeSelectVO) { + if (homeSelectVO.getSelectWeek() != null) { + LocalDateTime[] time = new LocalDateTime[2]; + switch (homeSelectVO.getSelectWeek()) { + case 1: + time[0] = LocalDateTime.now().minusDays(7); + break; + case 2: + time[0] = LocalDateTime.now().minusMonths(1); + break; + case 3: + time[0] = LocalDateTime.now().minusYears(1); + break; + } + time[1] = LocalDateTime.now(); + homeSelectVO.setTime(time); + } + + return homeSelectVO.getTime(); } @Override @@ -76,8 +127,8 @@ public class BigViewDataServiceImpl implements BigViewDataService { } @Override - public List getRightThird(HomeSelectVO homeSelectVO) { - return null; + public List getRightThird(HomeSelectVO homeSelectVO) { + homeSelectVO.setType(1); + return homeService.appCount2(homeSelectVO); } - } 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 83a7607..94be06e 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 @@ -68,10 +68,6 @@ public class EnterpriseInspectionsServiceImpl implements EnterpriseInspectionsSe @Resource private EnterpriseMapper enterpriseMapper; @Resource - private TaskTagMapper taskTagMapper; - @Resource - private TagLibraryMapper tagLibraryMapper; - @Resource private AdminUserService adminUserService; @Resource private DeptService deptService; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java index 6ceb520..bd9f0b5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java @@ -107,6 +107,8 @@ public class TagLibraryServiceImpl implements TagLibraryService { return tagList; } + + @Override public List childrenList(Long id) { QueryWrapper wrapper = new QueryWrapper<>(); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 7bf0687..b24131e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -555,10 +555,13 @@ public class AdminUserServiceImpl implements AdminUserService { AdminUserDO user = new AdminUserDO(); // openid.substring(openid.length() - 10) user.setUsername("wx_" + authUser.getUuid().substring(authUser.getUuid().length() - 5)); // 使用微信 openid 作为用户名 - user.setNickname(authUser.getNickname()); + user.setNickname("wx_" + authUser.getUuid().substring(authUser.getUuid().length() - 5)); user.setAvatar(authUser.getAvatar()); user.setStatus(CommonStatusEnum.ENABLE.getStatus()); user.setUserType(userType); + Set post = new HashSet<>(); + post.add(4l); + user.setPostIds(post); user.setPassword(encodePassword(authUser.getUuid().substring(authUser.getUuid().length() - 10))); // 随机密码 userMapper.insert(user); return user; 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 1266795..880a8d9 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 @@ -18,6 +18,14 @@ from enterprises e left join system_dept sd on e.department_id = sd.id + where + e.deleted = 0 + + AND t.end_time between + + #{i} + + group by e.department_id @@ -37,6 +45,12 @@ ON il.inspections_id = latest.inspections_id AND il.create_time = latest.max_create_time ) AS latest_records where status != 0 + + AND t.end_time between + + #{i} + + GROUP BY status; + + + + + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterpriseinspections/EnterpriseInspections.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterpriseinspections/EnterpriseInspections.xml index 834dae0..af9ce93 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterpriseinspections/EnterpriseInspections.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterpriseinspections/EnterpriseInspections.xml @@ -13,7 +13,7 @@ + select + e.enterprises_name as name, + eq.expiry_date as expiryDate, + e.user_id as userId, + e.id as enterpriseId + from + enterprise_qualification eq + LEFT JOIN enterprises e ON eq.enterprise_id = e.id + WHERE + e.deleted = 0 and eq.deleted = 0 AND expiry_date < NOW() + + diff --git a/yudao-module-system/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml b/yudao-module-system/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml index 990a1d5..a555809 100644 --- a/yudao-module-system/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml +++ b/yudao-module-system/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml @@ -8,5 +8,4 @@ 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> - - \ No newline at end of file +