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 c8c3d47..ef5dab1 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,12 +1,8 @@ package cn.iocoder.yudao.module.system.controller.admin.bigviewdata; -import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewEnterpriseCountGroup; -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.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; -import cn.iocoder.yudao.module.system.service.bigviewdata.BigViewDataService; -import cn.iocoder.yudao.module.system.service.home.HomeService; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; @@ -15,8 +11,17 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; + import java.util.List; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +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.home.vo.HomeGroupCountVO; +import cn.iocoder.yudao.module.system.service.bigviewdata.BigViewDataService; + @Tag(name = "管理后台 - app首页统计") @RestController @RequestMapping("/system/big-view-data") @@ -26,36 +31,41 @@ public class BigViewDataController { @Resource private BigViewDataService bigViewDataService; - @Resource - private HomeService homeService; @GetMapping("/getLeftFirst") - private HomeCountResVO leftFirst(HomeSelectVO homeSelectVO) { - return homeService.appCount1(homeSelectVO); + @Operation(summary = "大屏左一数据") + public CommonResult> leftFirst(HomeSelectVO homeSelectVO) { + return success(bigViewDataService.getLeftFirst(homeSelectVO)); } @GetMapping("/getLeftSecond") - private BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { + @Operation(summary = "大屏左二数据") + public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { return bigViewDataService.getLeftSecond(homeSelectVO); } @GetMapping("/getLeftThird") - private List getLeftThird(HomeSelectVO homeSelectVO) { + @Operation(summary = "大屏左三数据") + public List getLeftThird(HomeSelectVO homeSelectVO) { return bigViewDataService.getLeftThird(homeSelectVO); } @GetMapping("/getRightFist") - private List getRightFist(HomeSelectVO homeSelectVO) { + @Operation(summary = "大屏右一数据") + public List getRightFist(HomeSelectVO homeSelectVO) { return bigViewDataService.getRightFist(homeSelectVO); } @GetMapping("/getRightSecond") - private List getRightSecond(HomeSelectVO homeSelectVO) { + @Operation(summary = "大屏右二数据") + public List getRightSecond(HomeSelectVO homeSelectVO) { return bigViewDataService.getRightSecond(homeSelectVO); } @GetMapping("/getRightThird") - private List getRightThird(HomeSelectVO homeSelectVO) { + @Operation(summary = "大屏右三数据") + public List getRightThird(HomeSelectVO homeSelectVO) { return bigViewDataService.getRightThird(homeSelectVO); } + } 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 c2f9d4c..8d4b93b 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 @@ -195,7 +195,10 @@ public class EnterpriseController { public CommonResult> getTagLibraryPcPage(EnterprisePageReqVO pageReqVO) { PageResult pageResult = enterpriseService.getEnterprisePage(pageReqVO); pageResult.getList().forEach(item->{ - item.setInviterName(adminUserService.getUser(Long.valueOf(item.getUserId())).getNickname()); + final AdminUserDO user = adminUserService.getUser(Long.valueOf(item.getUserId())); + if (user != null) { + item.setInviterName(user.getNickname()); + } }); return success(BeanUtils.toBean(pageResult, EnterpriseRespVO.class)); } 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 7bf7f77..d883031 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 @@ -19,4 +19,9 @@ public interface BigViewDataMapper { */ List selectStatusCount(HomeSelectVO homeSelectVO); + /* + 根据任务类型分组 + */ + List selectTaskTypeGroupCount(HomeSelectVO homeSelectVO); + } 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 4123ff1..d3cb141 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,12 +1,15 @@ 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.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 java.util.List; + public interface BigViewDataService { BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO); @@ -17,4 +20,7 @@ public interface BigViewDataService { List getRightSecond(HomeSelectVO homeSelectVO); List getRightThird(HomeSelectVO homeSelectVO); + + List getLeftFirst(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 599f148..ffefc04 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 @@ -20,6 +20,11 @@ public class BigViewDataServiceImpl implements BigViewDataService { @Resource private TaskInfoMapper taskInfoMapper; + @Override + public List getLeftFirst(HomeSelectVO homeSelectVO) { + return bigViewDataMapper.selectTaskTypeGroupCount(homeSelectVO); + } + @Override public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { BigViewEnterpriseCountGroup enterpriseCountGroup = new BigViewEnterpriseCountGroup(); @@ -56,4 +61,5 @@ public class BigViewDataServiceImpl implements BigViewDataService { public List getRightThird(HomeSelectVO homeSelectVO) { return null; } + } 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 6b5a24c..89d14eb 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 @@ -39,4 +39,15 @@ ) AS latest_records GROUP BY status; +