Commit 6d167314 authored by tianyiming's avatar tianyiming

feat(api): 新增综合统计分析API筛选设备种类接口添加

parent bf9f9ceb
...@@ -675,7 +675,7 @@ public class CommonController extends BaseController { ...@@ -675,7 +675,7 @@ public class CommonController extends BaseController {
public ResponseModel<Object> permissionTreeV2(@RequestParam String menuAgent, public ResponseModel<Object> permissionTreeV2(@RequestParam String menuAgent,
@RequestParam String permissionType, @RequestParam String permissionType,
@RequestParam(required = false) String path, @RequestParam(required = false) String path,
@RequestBody JSONArray params) { @RequestParam JSONArray params) {
return ResponseHelper.buildResponse(commonService.getPermissionTreeWithCompanyV2(menuAgent, permissionType, path, getSelectedOrgInfo().getCompany(), params)); return ResponseHelper.buildResponse(commonService.getPermissionTreeWithCompanyV2(menuAgent, permissionType, path, getSelectedOrgInfo().getCompany(), params));
} }
......
package com.yeejoin.amos.boot.module.statistics.api.mapper; package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzsCustomFilter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.statistics.api.entity.TzsCustomFilter;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* 自定义筛选字段基础数据表 Mapper 接口 * 自定义筛选字段基础数据表 Mapper 接口
...@@ -11,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface TzsCustomFilterMapper extends BaseMapper<TzsCustomFilter> { public interface TzsCustomFilterMapper extends BaseMapper<TzsCustomFilter> {
@MapKey("key")
List<Map<String, Object>> selectEquipmentCategoryByParentId(@Param("parentId") String parentId);
} }
...@@ -2,4 +2,12 @@ ...@@ -2,4 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.statistics.api.mapper.TzsCustomFilterMapper"> <mapper namespace="com.yeejoin.amos.boot.module.statistics.api.mapper.TzsCustomFilterMapper">
<select id="selectEquipmentCategoryByParentId" resultType="java.util.Map">
select
id as key,
code as value,
name as label
from tz_equipment_category
where parent_id = #{parentId}
</select>
</mapper> </mapper>
package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.ComprehensiveStatisticalAnalysisServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* 综合统计分析API
*
* @author system_generator
* @date 2025-06-24
*/
@RestController
@Api(tags = "综合统计分析API")
@RequestMapping(value = "/comprehensiveStatisticalAnalysis")
public class ComprehensiveStatisticalAnalysisController extends BaseController {
@Autowired
private ComprehensiveStatisticalAnalysisServiceImpl comprehensiveStatisticalAnalysisServiceImpl;
/**
* @param key 筛选key
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/select/equipmentCategory")
@ApiOperation(httpMethod = "GET", value = "查询设备分类", notes = "查询设备分类")
public ResponseModel<List<Map<String, Object>>> queryEquipmentCategory(@RequestParam(value = "key", required = false) String key) {
return ResponseHelper.buildResponse(comprehensiveStatisticalAnalysisServiceImpl.queryEquipmentCategory(key));
}
}
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.yeejoin.amos.boot.module.statistcs.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.statistics.api.mapper.TzsCustomFilterMapper;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 综合统计分析服务实现类
*
* @author system_generator
* @date 2025-06-24
*/
@Service
public class ComprehensiveStatisticalAnalysisServiceImpl {
@Value("classpath:/json/equipCategory.json")
private Resource equipCategory;
@Autowired
private TzsCustomFilterMapper tzsCustomFilterMapper;
public List<Map<String, Object>> queryEquipmentCategory(String key) {
List<Map<String, Object>> list;
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
if (key == null) {
list = resourceJson.get(EquipmentClassifityEnum.ZHTJFX.getCode());
} else {
list = tzsCustomFilterMapper.selectEquipmentCategoryByParentId(key);
}
return list;
}
}
\ No newline at end of file
...@@ -390,5 +390,48 @@ ...@@ -390,5 +390,48 @@
"sum": "0", "sum": "0",
"type": "elevator" "type": "elevator"
} }
],
"__statistical__": "综合统计分析筛选项使用",
"statistical": [
{
"key": "26",
"label": "电梯",
"value": "3000"
},
{
"key": "41",
"label": "起重机械",
"value": "4000"
},
{
"key": "1",
"label": "锅炉",
"value": "1000"
},
{
"key": "7",
"label": "压力容器",
"value": "2000"
},
{
"key": "133",
"label": "压力管道",
"value": "8000"
},
{
"key": "80",
"label": "大型游乐设施",
"value": "6000"
},
{
"key": "144",
"label": "客运索道",
"value": "9000"
},
{
"key": "76",
"label": "场(厂)内专用机动车辆",
"value": "5000"
}
] ]
} }
\ No newline at end of file
...@@ -24,6 +24,8 @@ public enum EquipmentClassifityEnum { ...@@ -24,6 +24,8 @@ public enum EquipmentClassifityEnum {
KYSD("客运索道", "9000"), KYSD("客运索道", "9000"),
//树类型 //树类型
ZHTJFX("综合统计分析","statistical"),
//设备认领状态 //设备认领状态
SBRLZT("设备认领状态", "rlzt"), SBRLZT("设备认领状态", "rlzt"),
BDLS("八大类树", "eightCategory"), BDLS("八大类树", "eightCategory"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment