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

修改八大类树接口

parent 6a5302c8
......@@ -22,9 +22,11 @@ public enum EquipmentClassifityEnum {
YLGDYJ("压力管道元件","7000"),
YLGD("压力管道","8000"),
//树类型
BDLS("八大类树","eightCategory"),
//设备认领状态
SBRLZT("设备认领状态","rlzt");
SBRLZT("设备认领状态","rlzt"),
BDLS("八大类树","eightCategory"),
RENLING("认领","renLing");
private String name;
private String code;
public static Map<String,String> getName=new HashMap<>();
......
......@@ -14,7 +14,7 @@ import java.util.Map;
*/
public interface IEquipmentCategoryService {
List<Map<String,Object>> equipTree();
List<Map<String,Object>> equipTree(String type);
Page equipClaimOverview();
......
......@@ -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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import liquibase.pro.packaged.S;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -161,8 +162,8 @@ public class EquipmentCategoryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备八大类列表树", notes = "设备八大类列表树")
@GetMapping(value = "/equipTree")
public ResponseModel<Object> equipTree() {
return ResponseHelper.buildResponse(equipmentCategoryService.equipTree());
public ResponseModel<Object> equipTree(String type) {
return ResponseHelper.buildResponse(equipmentCategoryService.equipTree(type));
}
/**
......
......@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*;
......@@ -60,15 +61,19 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
}
@Override
public List<Map<String, Object>> equipTree() {
Map<String, List<Map<String, Object>>> resourceJson = JsonUtils.getResourceJson(equipCategory);
List<Map<String, Object>> mapList = resourceJson.get(EquipmentClassifityEnum.BDLS.getCode());
public List<Map<String, Object>> equipTree(String type) {
List<Map<String, Object>> menus = new ArrayList<>();
for (Map map : mapList) {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("instanceName", map.get("name"));
resultMap.put("instanceId", map.get("code"));
menus.add(resultMap);
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) {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("instanceName", map.get("name"));
resultMap.put("instanceId", map.get("code"));
menus.add(resultMap);
}
}
return menus;
}
......
......@@ -40,5 +40,50 @@
"code": "9000",
"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