Commit f834145f authored by 曹盼盼's avatar 曹盼盼

修改八大类树接口

parent 6a5302c8
...@@ -22,9 +22,11 @@ public enum EquipmentClassifityEnum { ...@@ -22,9 +22,11 @@ public enum EquipmentClassifityEnum {
YLGDYJ("压力管道元件","7000"), YLGDYJ("压力管道元件","7000"),
YLGD("压力管道","8000"), YLGD("压力管道","8000"),
//树类型 //树类型
BDLS("八大类树","eightCategory"),
//设备认领状态 //设备认领状态
SBRLZT("设备认领状态","rlzt"); SBRLZT("设备认领状态","rlzt"),
BDLS("八大类树","eightCategory"),
RENLING("认领","renLing");
private String name; private String name;
private String code; private String code;
public static Map<String,String> getName=new HashMap<>(); public static Map<String,String> getName=new HashMap<>();
......
...@@ -14,7 +14,7 @@ import java.util.Map; ...@@ -14,7 +14,7 @@ import java.util.Map;
*/ */
public interface IEquipmentCategoryService { public interface IEquipmentCategoryService {
List<Map<String,Object>> equipTree(); List<Map<String,Object>> equipTree(String type);
Page equipClaimOverview(); Page equipClaimOverview();
......
...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService; ...@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.EquipmentCategoryServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import liquibase.pro.packaged.S;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -161,8 +162,8 @@ public class EquipmentCategoryController extends BaseController { ...@@ -161,8 +162,8 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备八大类列表树", notes = "设备八大类列表树") @ApiOperation(httpMethod = "GET", value = "设备八大类列表树", notes = "设备八大类列表树")
@GetMapping(value = "/equipTree") @GetMapping(value = "/equipTree")
public ResponseModel<Object> equipTree() { public ResponseModel<Object> equipTree(String type) {
return ResponseHelper.buildResponse(equipmentCategoryService.equipTree()); return ResponseHelper.buildResponse(equipmentCategoryService.equipTree(type));
} }
/** /**
......
...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*; import java.util.*;
...@@ -60,16 +61,20 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -60,16 +61,20 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
} }
@Override @Override
public List<Map<String, Object>> equipTree() { public List<Map<String, Object>> equipTree(String type) {
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
List<Map<String, Object>> menus = new ArrayList<>(); List<Map<String, Object>> menus = new ArrayList<>();
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
Map<String, String> getCode = EquipmentClassifityEnum.getCode;
if (!ValidationUtil.isEmpty(type)) {
String code = getCode.get(type);
List<Map<String, Object>> mapList = resourceJson.get(code);
for (Map map : mapList) { for (Map map : mapList) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("instanceName", map.get("name")); resultMap.put("instanceName", map.get("name"));
resultMap.put("instanceId", map.get("code")); resultMap.put("instanceId", map.get("code"));
menus.add(resultMap); menus.add(resultMap);
} }
}
return menus; return menus;
} }
......
...@@ -40,5 +40,50 @@ ...@@ -40,5 +40,50 @@
"code": "9000", "code": "9000",
"image": "upload/tzs/common/image/总览索道.png" "image": "upload/tzs/common/image/总览索道.png"
} }
],
"renLing": [
{
"name": "电梯",
"code": "3000"
},
{
"name": "起重机械",
"code": "4000"
},
{
"name": "场内机动车辆",
"code": "5000"
},
{
"name": "锅炉",
"code": "1000"
},
{
"name": "压力容器",
"code": "2000"
},
{
"name": "压力管道",
"code": "8000"
},
{
"name": "大型游乐设施",
"code": "6000"
},
{
"name": "客运索道",
"code": "9000"
}
] ]
} }
\ No newline at end of file
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