中控总览

This commit is contained in:
attiya 2025-10-16 10:15:43 +08:00
parent 186b5a1453
commit 588817096d
4 changed files with 69 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package com.cdzy.operations.controller;
import com.cdzy.common.model.request.PageParam; import com.cdzy.common.model.request.PageParam;
import com.cdzy.common.model.response.JsonResult; import com.cdzy.common.model.response.JsonResult;
import com.cdzy.operations.model.dto.EbikeEcuInOverview;
import com.cdzy.operations.model.entity.EbikeEcuInfo; import com.cdzy.operations.model.entity.EbikeEcuInfo;
import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo; import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo;
import com.cdzy.operations.model.vo.EbikeEcuInfoVo; import com.cdzy.operations.model.vo.EbikeEcuInfoVo;
@ -87,6 +88,18 @@ public class EbikeEcuInfoController {
return JsonResult.success(list); return JsonResult.success(list);
} }
/**
* 中控总览
*
* @return 所有数据
*/
@GetMapping("overview")
public JsonResult<?> overview() {
List<EbikeEcuInOverview> list = ebikeEcuInfoService.overview();
return JsonResult.success(list);
}
/** /**
* 根据中控基本信息主键获取详细信息 * 根据中控基本信息主键获取详细信息
* *

View File

@ -0,0 +1,33 @@
package com.cdzy.operations.model.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 中控总览
*
* @author attiya
* @since 2025-09-15
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EbikeEcuInOverview implements Serializable {
/**
* 运营商ID
*/
private Long operatorId;
/**
* 总数
*/
private Long count;
}

View File

@ -1,10 +1,13 @@
package com.cdzy.operations.service; package com.cdzy.operations.service;
import com.cdzy.operations.model.dto.EbikeEcuInOverview;
import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo; import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo;
import com.cdzy.operations.model.vo.EbikeEcuInfoVo; import com.cdzy.operations.model.vo.EbikeEcuInfoVo;
import com.mybatisflex.core.service.IService; import com.mybatisflex.core.service.IService;
import com.cdzy.operations.model.entity.EbikeEcuInfo; import com.cdzy.operations.model.entity.EbikeEcuInfo;
import java.util.List;
/** /**
* 中控基本信息 服务层 * 中控基本信息 服务层
* *
@ -24,4 +27,10 @@ public interface EbikeEcuInfoService extends IService<EbikeEcuInfo> {
* @param batchVo 入库信息 * @param batchVo 入库信息
*/ */
void batchSave(EbikeEcuInfoBatchVo batchVo); void batchSave(EbikeEcuInfoBatchVo batchVo);
/**
* 总览
* @return 总览数据
*/
List<EbikeEcuInOverview> overview();
} }

View File

@ -2,8 +2,10 @@ package com.cdzy.operations.service.impl;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import com.cdzy.common.ex.EbikeException; import com.cdzy.common.ex.EbikeException;
import com.cdzy.operations.model.dto.EbikeEcuInOverview;
import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo; import com.cdzy.operations.model.vo.EbikeEcuInfoBatchVo;
import com.cdzy.operations.model.vo.EbikeEcuInfoVo; import com.cdzy.operations.model.vo.EbikeEcuInfoVo;
import com.mybatisflex.core.query.QueryMethods;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl; import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cdzy.operations.model.entity.EbikeEcuInfo; import com.cdzy.operations.model.entity.EbikeEcuInfo;
@ -80,4 +82,16 @@ public class EbikeEcuInfoServiceImpl extends ServiceImpl<EbikeEcuInfoMapper, Ebi
} }
saveBatch(list); saveBatch(list);
} }
@Override
public List<EbikeEcuInOverview> overview() {
QueryWrapper queryWrapper = QueryWrapper.create()
.select(
EBIKE_ECU_INFO.OPERATOR_ID,
QueryMethods.count().as(EbikeEcuInOverview::getCount)
)
.from(EBIKE_ECU_INFO)
.groupBy(EBIKE_ECU_INFO.OPERATOR_ID);
return ebikeEcuInfoMapper.selectListByQueryAs(queryWrapper, EbikeEcuInOverview.class);
}
} }