Browse Source

数据大屏, 添加用户

master
DX 1 month ago
parent
commit
c8711f65ae
  1. 21
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java
  2. 20
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewGroupCountCompareVO.java
  3. 16
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/BigViewQOQVO.java
  4. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java
  5. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  6. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterpriseinspections/vo/EnterpriseInspectionsCorrectionVO.java
  7. 17
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/qualification/vo/QualificationExpiredVO.java
  8. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/taglibrary/TagLibraryController.java
  9. 13
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java
  10. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/qualification/EnterpriseQualificationMapper.java
  11. 13
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/InspectionsSendStartMessageJob.java
  12. 52
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/QualificationTimeOutSendStartMessageJob.java
  13. 15
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/job/TaskSendStartMessageJob.java
  14. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java
  15. 9
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java
  16. 69
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java
  17. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsServiceImpl.java
  18. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/taglibrary/TagLibraryServiceImpl.java
  19. 5
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java
  20. 94
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml
  21. 2
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterpriseinspections/EnterpriseInspections.xml
  22. 16
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml
  23. 3
      yudao-module-system/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml

21
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; package cn.iocoder.yudao.module.system.controller.admin.bigviewdata;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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 cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -50,9 +53,15 @@ public class BigViewDataController {
return success(bigViewDataService.getLeftThird(homeSelectVO)); return success(bigViewDataService.getLeftThird(homeSelectVO));
} }
@GetMapping("/getRightFist") @GetMapping("/getCenter")
@Operation(summary = "大屏中间总数统计")
public CommonResult<HomeCountResVO> getCenter(HomeSelectVO homeSelectVO) {
return success(bigViewDataService.getCenter(homeSelectVO));
}
@GetMapping("/getRightFirst")
@Operation(summary = "大屏右一数据") @Operation(summary = "大屏右一数据")
public CommonResult<List<HomeGroupCountVO>> getRightFist(HomeSelectVO homeSelectVO) { public CommonResult<List<StatusCountVO>> getRightFist(HomeSelectVO homeSelectVO) {
return success(bigViewDataService.getRightFist(homeSelectVO)); return success(bigViewDataService.getRightFist(homeSelectVO));
} }
@ -64,8 +73,14 @@ public class BigViewDataController {
@GetMapping("/getRightThird") @GetMapping("/getRightThird")
@Operation(summary = "大屏右三数据") @Operation(summary = "大屏右三数据")
public CommonResult<List<HomeGroupCountVO>> getRightThird(HomeSelectVO homeSelectVO) { public CommonResult<List<EnterpriseNumVO>> getRightThird(HomeSelectVO homeSelectVO) {
return success(bigViewDataService.getRightThird(homeSelectVO)); return success(bigViewDataService.getRightThird(homeSelectVO));
} }
@GetMapping("/getRightFourth")
@Operation(summary = "大屏右数据")
public CommonResult<List<BigViewGroupCountCompareVO>> getRightFourth(HomeSelectVO homeSelectVO) {
return success(bigViewDataService.getRightFourth(homeSelectVO));
}
} }

20
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;
}

16
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;
}

1
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 { public class StatusCountVO {
private Integer status; private Integer status;
private Integer value; private Integer value;
private Integer taskValue;
private String name; private String name;
} }

1
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<InfraFileInfoDTO> fileList = fileInfoService.getFileList(EnterpriseServiceImpl.DEFAULT_DICT_TYPE, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY, item.getId().toString()); final List<InfraFileInfoDTO> fileList = fileInfoService.getFileList(EnterpriseServiceImpl.DEFAULT_DICT_TYPE, EnterpriseServiceImpl.DEFAULT_DICT_DATA_QY, item.getId().toString());
item.setFiles(fileList); item.setFiles(fileList);
// 企业标签 // 企业标签
final List<TagLibraryDO> tagLibraryDOS1 = tagLibraryService.listByEnterpriseId(item.getId()); final List<TagLibraryDO> tagLibraryDOS1 = tagLibraryService.listByEnterpriseId(item.getId());
if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) { if (tagLibraryDOS1 != null && tagLibraryDOS1.size() > 0) {

2
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 String correctName;
private Long creator; private Long creator;
private Long enterpriseId; private Long enterpriseId;
private String feedback;
} }

17
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;
}

2
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<List<TagLibraryRespVO>> getTagLibraryList(String[] codeList) { public CommonResult<List<TagLibraryRespVO>> getTagLibraryList(String[] codeList) {
List<TagLibraryDO> pageResult = tagLibraryService.list(codeList); List<TagLibraryDO> pageResult = tagLibraryService.list(codeList);
return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class)); return success(BeanUtils.toBean(pageResult, TagLibraryRespVO.class));
} }
@GetMapping("/childrenList") @GetMapping("/childrenList")
@Operation(summary = "获得标签分页") @Operation(summary = "获得标签分页")
@PreAuthorize("@ss.hasPermission('system:tag-library:query')") @PreAuthorize("@ss.hasPermission('system:tag-library:query')")

13
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; 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.NameCountVO;
import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import java.util.List; import java.util.List;
@ -24,4 +27,14 @@ public interface BigViewDataMapper {
*/ */
List<NameCountVO> selectTaskTypeGroupCount(HomeSelectVO homeSelectVO); List<NameCountVO> selectTaskTypeGroupCount(HomeSelectVO homeSelectVO);
/*
执法和任务分组统计
*/
List<StatusCountVO> getInspectionsTaskGroupCount(HomeSelectVO homeSelectVO);
/*
执法和任务分组统计同比
*/
List<BigViewGroupCountCompareVO> getInspectionsTaskGroupCountCompare(BigViewQOQVO bigViewQOQVO);
} }

6
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.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; 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 cn.iocoder.yudao.module.system.dal.dataobject.qualification.EnterpriseQualificationDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.qualification.vo.*; import cn.iocoder.yudao.module.system.controller.admin.qualification.vo.*;
@ -31,4 +32,7 @@ public interface EnterpriseQualificationMapper extends BaseMapperX<EnterpriseQua
.orderByDesc(EnterpriseQualificationDO::getId)); .orderByDesc(EnterpriseQualificationDO::getId));
} }
} //证书过期的企业查询
List<QualificationExpiredVO> expiredList();
}

13
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(); NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO();
notifyMessage.setUserId(Long.valueOf(item.getCreator())); notifyMessage.setUserId(Long.valueOf(item.getCreator()));
notifyMessage.setTemplateCode("correction_time"); notifyMessage.setTemplateCode("correction_messages");
Map<String, Object> templateParams = new HashMap<>(); Map<String, Object> templateParams = new HashMap<>();
templateParams.put("title", enterpriseService.getEnterprise(item.getEnterpriseId()).getEnterprisesName()); templateParams.put("title", enterpriseService.getEnterprise(item.getEnterpriseId()).getEnterprisesName());
templateParams.put("correctionTime", inspectionsLogNew.getCorrectionTime()); templateParams.put("correctionTime", inspectionsLogNew.getCorrectionTime());
templateParams.put("url", "sub/inspection/detail?id=" + item.getInspectionsId());
notifyMessage.setTemplateParams(templateParams); notifyMessage.setTemplateParams(templateParams);
notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage); notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage);
@ -76,12 +78,13 @@ public class InspectionsSendStartMessageJob implements JobHandler {
try { try {
SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO();
reqDTO.setUserType(1); reqDTO.setUserType(1);
reqDTO.setTemplateTitle("整改任务通知"); reqDTO.setTemplateTitle("问题整改通知");
reqDTO.setPage("sub/task/detail?id=" + item.getInspectionsId()); reqDTO.setPage("sub/inspection/detail?id=" + item.getInspectionsId());
reqDTO.setUserId(Long.valueOf(item.getCreator())); reqDTO.setUserId(Long.valueOf(item.getCreator()));
Map<String, String> message = new HashMap<>(); Map<String, String> message = new HashMap<>();
message.put("thing2", enterprise.getEnterprisesName()); message.put("thing5", enterprise.getEnterprisesName());
message.put("time3", DateUtil.format(inspectionsLogNew.getCorrectionTime(), DateUtils.FORMAT_YEAR_MONTH_DAY)); message.put("time8", DateUtil.format(inspectionsLogNew.getCorrectionTime(), DateUtils.FORMAT_YEAR_MONTH_DAY));
message.put("time9", item.getFeedback());
reqDTO.setMessages(message); reqDTO.setMessages(message);
socialClientApi.sendWxaSubscribeMessage(reqDTO); socialClientApi.sendWxaSubscribeMessage(reqDTO);
} catch (Exception e) { } catch (Exception e) {

52
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.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; 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.SocialClientApi;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; 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.enterprise.EnterpriseDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseinspections.EnterpriseInspectionsDO; 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.dataobject.inspectionslog.InspectionsLogDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseinspections.EnterpriseInspectionsMapper; 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.enterprise.EnterpriseService;
import cn.iocoder.yudao.module.system.service.inspectionslog.InspectionsLogService; import cn.iocoder.yudao.module.system.service.inspectionslog.InspectionsLogService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -16,56 +20,56 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@Component @Component
@Slf4j @Slf4j
public class QualificationTimeOutSendStartMessageJob implements JobHandler { public class QualificationTimeOutSendStartMessageJob implements JobHandler {
@Resource
InspectionsLogService inspectionsLogService;
@Resource @Resource
SocialClientApi socialClientApi; SocialClientApi socialClientApi;
@Resource @Resource
EnterpriseInspectionsMapper enterpriseInspectionsMapper; EnterpriseQualificationMapper enterpriseQualificationMapper;
@Resource @Resource
EnterpriseService enterpriseService; NotifyMessageSendApi notifyMessageSendApi;
@Override @Override
public String execute(String param) throws Exception { public String execute(String param) throws Exception {
//要发送的信息 //要发送的信息
final Long id = Long.valueOf(param); final Long id = Long.valueOf(param);
final InspectionsLogDO inspectionsLog = inspectionsLogService.getInspectionsLog(id); final List<QualificationExpiredVO> qualificationExpiredVOS = enterpriseQualificationMapper.expiredList();
if (inspectionsLog != null && inspectionsLog.getCreator() != null) { if (qualificationExpiredVOS != null && qualificationExpiredVOS.size() > 0) {
final EnterpriseInspectionsDO enterpriseInspectionsDO = enterpriseInspectionsMapper.selectById(id);
if (enterpriseInspectionsDO != null) {
final EnterpriseDO enterprise = enterpriseService.getEnterprise(enterpriseInspectionsDO.getEnterpriseId());
qualificationExpiredVOS.forEach(item->{
try { try {
Long userId = Long.valueOf(inspectionsLog.getCreator()); //发送消息
//发送消息);
SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO();
reqDTO.setUserType(1); reqDTO.setUserType(1);
reqDTO.setTemplateTitle("环保任务通知"); reqDTO.setTemplateTitle("认证到期提醒");
reqDTO.setPage("sub/task/detail?id="+inspectionsLog.getInspectionsId()); reqDTO.setPage("sub/enterprise/detail?id="+item.getEnterpriseId());
reqDTO.setUserId(userId); reqDTO.setUserId(item.getUserId());
Map<String, String> message = new HashMap<>(); Map<String, String> message = new HashMap<>();
message.put("thing2", enterprise.getEnterprisesName()); message.put("phrase1", item.getEnterpriseName());
message.put("time3", DateUtil.format(inspectionsLog.getCorrectionTime(), DateUtils.FORMAT_YEAR_MONTH_DAY)); message.put("data2", DateUtil.format(item.getExpiryDate(), DateUtils.FORMAT_YEAR_MONTH_DAY));
// message.put("thing4", beforeTaskInfo.getDescription());
// message.put("time5", DateUtil.format(beforeTaskInfo.getEndDate().atStartOfDay(), DateUtils.FORMAT_YEAR_MONTH_DAY));
reqDTO.setMessages(message); reqDTO.setMessages(message);
socialClientApi.sendWxaSubscribeMessage(reqDTO); socialClientApi.sendWxaSubscribeMessage(reqDTO);
//保存站内信
NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO();
notifyMessage.setUserId(Long.valueOf(item.getUserId()));
notifyMessage.setTemplateCode("qualification_expiry_date");
Map<String, Object> templateParams = new HashMap<>();
templateParams.put("title", item.getEnterpriseName());
templateParams.put("expiryDate", item.getExpiryDate());
notifyMessage.setTemplateParams(templateParams);
notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage);
} }
catch (Exception e){ catch (Exception e){
log.error("任务发送通知错误:",e.toString()); log.error("任务发送通知错误:",e.toString());
} }
});
}
} }
return "发送整个信息成功"; return "发送整个信息成功";

15
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.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.common.util.date.DateUtils; import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler; 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.SocialClientApi;
import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO; import cn.iocoder.yudao.module.system.api.social.dto.SocialWxaSubscribeMessageSendReqDTO;
import cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo.TaskInfoRespVO; import cn.iocoder.yudao.module.system.controller.admin.taskinfo.vo.TaskInfoRespVO;
@ -31,6 +33,8 @@ public class TaskSendStartMessageJob implements JobHandler {
SocialClientApi socialClientApi; SocialClientApi socialClientApi;
@Resource @Resource
EnterpriseInspectionsMapper enterpriseInspectionsMapper; EnterpriseInspectionsMapper enterpriseInspectionsMapper;
@Resource
NotifyMessageSendApi notifyMessageSendApi;
@Override @Override
public String execute(String param) throws Exception { public String execute(String param) throws Exception {
@ -39,6 +43,7 @@ public class TaskSendStartMessageJob implements JobHandler {
beforeTaskInfoList.forEach(beforeTaskInfo -> { beforeTaskInfoList.forEach(beforeTaskInfo -> {
beforeTaskInfo.getEnterpriseIdeTasks().forEach(x ->{ beforeTaskInfo.getEnterpriseIdeTasks().forEach(x ->{
if(x.getUserId()!= null){ if(x.getUserId()!= null){
try { try {
//发送消息); //发送消息);
SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO(); SocialWxaSubscribeMessageSendReqDTO reqDTO = new SocialWxaSubscribeMessageSendReqDTO();
@ -64,6 +69,16 @@ public class TaskSendStartMessageJob implements JobHandler {
List<EnterpriseInspectionsDO> enterpriseInspectionsDOList = enterpriseInspectionsMapper.selectList(wrapper); List<EnterpriseInspectionsDO> enterpriseInspectionsDOList = enterpriseInspectionsMapper.selectList(wrapper);
if(enterpriseInspectionsDOList!=null && enterpriseInspectionsDOList.size()>0){ if(enterpriseInspectionsDOList!=null && enterpriseInspectionsDOList.size()>0){
for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) { for (EnterpriseInspectionsDO enterpriseInspectionsDO : enterpriseInspectionsDOList) {
//站内信发送通知
NotifySendSingleToUserReqDTO notifyMessage = new NotifySendSingleToUserReqDTO();
notifyMessage.setUserId(Long.valueOf(enterpriseInspectionsDO.getUserId()));
notifyMessage.setTemplateCode("task_messages");
Map<String, Object> templateParams = new HashMap<>();
templateParams.put("title", beforeTaskInfo.getTitle());
templateParams.put("startTime", beforeTaskInfo.getStartDate());
notifyMessage.setTemplateParams(templateParams);
notifyMessageSendApi.sendSingleMessageToAdmin(notifyMessage);
enterpriseInspectionsDO.setStatus(2); enterpriseInspectionsDO.setStatus(2);
} }
} }

10
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.controller.admin.auth.vo.*;
import cn.iocoder.yudao.module.system.convert.auth.AuthConvert; 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.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.SocialUserBindDO;
import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.social.SocialUserDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
@ -79,6 +80,8 @@ public class AdminAuthServiceImpl implements AdminAuthService {
private SocialUserMapper socialUserMapper; private SocialUserMapper socialUserMapper;
@Resource @Resource
private SocialUserBindMapper socialUserBindMapper; private SocialUserBindMapper socialUserBindMapper;
@Resource
private UserRoleMapper userRoleMapper;
/** /**
* 验证码的开关默认为 true * 验证码的开关默认为 true
@ -327,8 +330,11 @@ public class AdminAuthServiceImpl implements AdminAuthService {
user = userService.autoRegisterUser(authUser, reqVO.getUserType()); user = userService.autoRegisterUser(authUser, reqVO.getUserType());
//给一个默认的普通用户的角色 //给一个默认的专管员角色
// UserRoleMapper UserRoleDO userRoleDO = new UserRoleDO();
userRoleDO.setUserId(user.getId());
userRoleDO.setRoleId(155L);
userRoleMapper.insert(userRoleDO);
user.setIsBand(false); user.setIsBand(false);

9
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; 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.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.NameCountVO;
import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO; 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.HomeCountResVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO; 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.controller.admin.home.vo.HomeSelectVO;
@ -15,12 +17,15 @@ public interface BigViewDataService {
List<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO); List<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO);
List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO); List<StatusCountVO> getRightFist(HomeSelectVO homeSelectVO);
List<NameCountVO> getRightSecond(HomeSelectVO homeSelectVO); List<NameCountVO> getRightSecond(HomeSelectVO homeSelectVO);
List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO); List<EnterpriseNumVO> getRightThird(HomeSelectVO homeSelectVO);
List<NameCountVO> getLeftFirst(HomeSelectVO homeSelectVO); List<NameCountVO> getLeftFirst(HomeSelectVO homeSelectVO);
List<BigViewGroupCountCompareVO> getRightFourth(HomeSelectVO homeSelectVO);
HomeCountResVO getCenter(HomeSelectVO homeSelectVO);
} }

69
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; 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.*;
import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO;
import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO; 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.HomeGroupCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; 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.bigviewdata.BigViewDataMapper;
import cn.iocoder.yudao.module.system.dal.mysql.taskinfo.TaskInfoMapper; 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 org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
@Slf4j
public class BigViewDataServiceImpl implements BigViewDataService { public class BigViewDataServiceImpl implements BigViewDataService {
@Resource @Resource
private BigViewDataMapper bigViewDataMapper; private BigViewDataMapper bigViewDataMapper;
@Resource @Resource
private TaskInfoMapper taskInfoMapper; private TaskInfoMapper taskInfoMapper;
@Resource
private HomeService homeService;
@Override @Override
public List<NameCountVO> getLeftFirst(HomeSelectVO homeSelectVO) { public List<NameCountVO> getLeftFirst(HomeSelectVO homeSelectVO) {
return bigViewDataMapper.selectTaskTypeGroupCount(homeSelectVO); return bigViewDataMapper.selectTaskTypeGroupCount(homeSelectVO);
} }
@Override
public List<BigViewGroupCountCompareVO> 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 @Override
public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) {
BigViewEnterpriseCountGroup enterpriseCountGroup = new BigViewEnterpriseCountGroup(); BigViewEnterpriseCountGroup enterpriseCountGroup = new BigViewEnterpriseCountGroup();
final List<NameCountVO> nameCountVOS = bigViewDataMapper.enterpriseCountGroup(homeSelectVO); final List<NameCountVO> nameCountVOS = bigViewDataMapper.enterpriseCountGroup(homeSelectVO);
enterpriseCountGroup.setEnterpriseCountGroup(nameCountVOS); enterpriseCountGroup.setEnterpriseCountGroup(nameCountVOS);
List<Integer> countList = new ArrayList<>(); List<Integer> countList = new ArrayList<>();
if (nameCountVOS != null) { if (nameCountVOS != null) {
@ -48,8 +78,29 @@ public class BigViewDataServiceImpl implements BigViewDataService {
} }
@Override @Override
public List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO) { public List<StatusCountVO> getRightFist(HomeSelectVO homeSelectVO) {
return null; 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 @Override
@ -76,8 +127,8 @@ public class BigViewDataServiceImpl implements BigViewDataService {
} }
@Override @Override
public List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO) { public List<EnterpriseNumVO> getRightThird(HomeSelectVO homeSelectVO) {
return null; homeSelectVO.setType(1);
return homeService.appCount2(homeSelectVO);
} }
} }

4
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 @Resource
private EnterpriseMapper enterpriseMapper; private EnterpriseMapper enterpriseMapper;
@Resource @Resource
private TaskTagMapper taskTagMapper;
@Resource
private TagLibraryMapper tagLibraryMapper;
@Resource
private AdminUserService adminUserService; private AdminUserService adminUserService;
@Resource @Resource
private DeptService deptService; private DeptService deptService;

2
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; return tagList;
} }
@Override @Override
public List<TagLibraryDO> childrenList(Long id) { public List<TagLibraryDO> childrenList(Long id) {
QueryWrapper<TagLibraryDO> wrapper = new QueryWrapper<>(); QueryWrapper<TagLibraryDO> wrapper = new QueryWrapper<>();

5
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(); AdminUserDO user = new AdminUserDO();
// openid.substring(openid.length() - 10) // openid.substring(openid.length() - 10)
user.setUsername("wx_" + authUser.getUuid().substring(authUser.getUuid().length() - 5)); // 使用微信 openid 作为用户名 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.setAvatar(authUser.getAvatar());
user.setStatus(CommonStatusEnum.ENABLE.getStatus()); user.setStatus(CommonStatusEnum.ENABLE.getStatus());
user.setUserType(userType); user.setUserType(userType);
Set<Long> post = new HashSet<>();
post.add(4l);
user.setPostIds(post);
user.setPassword(encodePassword(authUser.getUuid().substring(authUser.getUuid().length() - 10))); // 随机密码 user.setPassword(encodePassword(authUser.getUuid().substring(authUser.getUuid().length() - 10))); // 随机密码
userMapper.insert(user); userMapper.insert(user);
return user; return user;

94
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml

@ -18,6 +18,14 @@
from from
enterprises e enterprises e
left join system_dept sd on e.department_id = sd.id left join system_dept sd on e.department_id = sd.id
where
e.deleted = 0
<if test="time != null and time != ''">
AND t.end_time between
<foreach collection="time" item="i" open="" separator="and" close="">
#{i}
</foreach>
</if>
group by group by
e.department_id e.department_id
</select> </select>
@ -37,6 +45,12 @@
ON il.inspections_id = latest.inspections_id ON il.inspections_id = latest.inspections_id
AND il.create_time = latest.max_create_time AND il.create_time = latest.max_create_time
) AS latest_records where status != 0 ) AS latest_records where status != 0
<if test="time != null and time != ''">
AND t.end_time between
<foreach collection="time" item="i" open=" " separator="and" close=" ">
#{i}
</foreach>
</if>
GROUP BY status; GROUP BY status;
</select> </select>
<select id="selectTaskTypeGroupCount" <select id="selectTaskTypeGroupCount"
@ -47,7 +61,87 @@
from from
task_info t task_info t
left join tag_library tl on tl.id = t.task_type left join tag_library tl on tl.id = t.task_type
where
t.deleted = 0
<if test="time != null and time != ''">
AND t.end_time between
<foreach collection="time" item="i" open=" " separator="and" close=" ">
#{i}
</foreach>
</if>
group by group by
tl.id tl.id
</select> </select>
<select id="getInspectionsTaskGroupCount"
resultType="cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO">
SELECT
sd.`name` as name,
COUNT(DISTINCT ei.id) AS value,
count(DISTINCT ei.task_id) as taskValue
FROM
task_info t
LEFT JOIN enterprise_inspections ei on t.id = ei.task_id
LEFT JOIN
enterprises e ON e.id = ei.enterprise_id
LEFT JOIN
inspections_log il ON ei.id = il.inspections_id
left Join system_users su on su.id = ei.user_id
left Join system_dept sd on sd.id = e.department_id
WHERE
ei.deleted = 0 AND e.deleted = 0 and ei.status = 2 and sd.parent_id = 116
<if test="time != null and time != ''">
AND t.end_time between
<foreach collection="time" item="i" open="" separator="and" close="">
#{i}
</foreach>
</if>
GROUP BY
e.department_id
</select>
<!-- 定义时间范围变量 -->
<select id="getInspectionsTaskGroupCountCompare"
resultType="cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewGroupCountCompareVO">
SELECT
sd.name AS name,
-- 当前月执法统计
COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{currentStartTime} AND #{currentEndTime} THEN ei.id ELSE 0 END) AS currentEnforcementCount,
-- 上个月执法统计
COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{previousStartTime} AND #{previousEndTime} THEN ei.id ELSE 0 END) AS previousEnforcementCount,
-- 执法环比增长率计算
IFNULL(
(COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{currentStartTime} AND #{currentEndTime} THEN ei.id END) -
COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{previousStartTime} AND #{previousEndTime} THEN ei.id END)) /
NULLIF(COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{previousStartTime} AND #{previousEndTime} THEN ei.id END), 0),
0
) * 100 AS enforcementGrowthRate,
-- 当前月任务统计
COUNT(DISTINCT CASE WHEN t.create_time BETWEEN '2025-02-01' AND '2025-02-25' THEN ei.task_id END) AS currentTaskCount,
-- 上个月任务统计
COUNT(DISTINCT CASE WHEN t.create_time BETWEEN '2025-01-01' AND '2025-01-25' THEN ei.task_id END) AS previousTaskCount,
-- 任务环比增长率计算
IFNULL(
(COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{currentStartTime} AND #{currentEndTime} THEN ei.task_id END) -
COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{previousStartTime} AND #{previousEndTime} THEN ei.task_id END)) /
NULLIF(COUNT(DISTINCT CASE WHEN t.create_time BETWEEN #{previousStartTime} AND #{previousEndTime} THEN ei.task_id END), 0),
0
) * 100 AS taskGrowthRate
FROM
task_info t
LEFT JOIN enterprise_inspections ei ON t.id = ei.task_id
LEFT JOIN enterprises e ON e.id = ei.enterprise_id
LEFT JOIN inspections_log il ON ei.id = il.inspections_id
LEFT JOIN system_dept sd ON sd.id = e.department_id
WHERE
ei.deleted = 0
AND e.deleted = 0
AND ei.status = 2
AND sd.parent_id = 116
GROUP BY
sd.name;
</select>
</mapper> </mapper>

2
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/enterpriseinspections/EnterpriseInspections.xml

@ -13,7 +13,7 @@
<select id="inspectionsCorrectionList" <select id="inspectionsCorrectionList"
resultType="cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsCorrectionVO"> resultType="cn.iocoder.yudao.module.system.controller.admin.enterpriseinspections.vo.EnterpriseInspectionsCorrectionVO">
select select
el.*, ei.enterprise_id el.*, ei.enterprise_id,
from from
enterprise_inspections ei enterprise_inspections ei
LEFT JOIN LEFT JOIN

16
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml

@ -8,5 +8,17 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
--> -->
<select id="expiredList"
</mapper> resultType="cn.iocoder.yudao.module.system.controller.admin.qualification.vo.QualificationExpiredVO">
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 &lt; NOW()
</select>
</mapper>

3
yudao-module-system/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/qualification/EnterpriseQualificationMapper.xml

@ -8,5 +8,4 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
--> -->
</mapper>
</mapper>

Loading…
Cancel
Save