Browse Source

数据大屏接口

master
DX 1 month ago
parent
commit
50ec792f80
  1. 40
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java
  2. 5
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  3. 5
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java
  4. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java
  5. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java
  6. 11
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml

40
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<List<NameCountVO>> 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<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO) {
@Operation(summary = "大屏左三数据")
public List<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO) {
return bigViewDataService.getLeftThird(homeSelectVO);
}
@GetMapping("/getRightFist")
private List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO) {
@Operation(summary = "大屏右一数据")
public List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO) {
return bigViewDataService.getRightFist(homeSelectVO);
}
@GetMapping("/getRightSecond")
private List<StatusCountVO> getRightSecond(HomeSelectVO homeSelectVO) {
@Operation(summary = "大屏右二数据")
public List<StatusCountVO> getRightSecond(HomeSelectVO homeSelectVO) {
return bigViewDataService.getRightSecond(homeSelectVO);
}
@GetMapping("/getRightThird")
private List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO) {
@Operation(summary = "大屏右三数据")
public List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO) {
return bigViewDataService.getRightThird(homeSelectVO);
}
}

5
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<PageResult<EnterpriseRespVO>> getTagLibraryPcPage(EnterprisePageReqVO pageReqVO) {
PageResult<EnterpriseDO> 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));
}

5
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<StatusCountVO> selectStatusCount(HomeSelectVO homeSelectVO);
/*
根据任务类型分组
*/
List<NameCountVO> selectTaskTypeGroupCount(HomeSelectVO homeSelectVO);
}

6
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<StatusCountVO> getRightSecond(HomeSelectVO homeSelectVO);
List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO);
List<NameCountVO> getLeftFirst(HomeSelectVO homeSelectVO);
}

6
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<NameCountVO> 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<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO) {
return null;
}
}

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

@ -39,4 +39,15 @@
) AS latest_records
GROUP BY status;
</select>
<select id="selectTaskTypeGroupCount"
resultType="cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO">
select
tl.tag_name as name,
count(tl.id) as count
from
task_info t
left join tag_library tl on tl.id = t.task_type
group by
tl.id
</select>
</mapper>

Loading…
Cancel
Save