Commit 5e654dc7 authored by tianyiming's avatar tianyiming

调整综合统计查询

parent 3aab2ad9
...@@ -17,10 +17,9 @@ public enum DataQualityScoreEnum { ...@@ -17,10 +17,9 @@ public enum DataQualityScoreEnum {
* *设备等级 * *设备等级
*/ */
I("一级", "3"), I("一级(只有设备名称其他使用登记证上信息无)", "3"),
II("二级", "2"), II("二级(只有设备名称和使用登记证编号其他使用登记证上信息无)", "2"),
III("三级", "1"), III("三级(使用登记证上信息齐全)", "1");
;
private String name; private String name;
private String code; private String code;
......
...@@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@AllArgsConstructor @AllArgsConstructor
...@@ -16,16 +18,17 @@ public enum UnitTypeEnum { ...@@ -16,16 +18,17 @@ public enum UnitTypeEnum {
* *注册单位类型 * *注册单位类型
*/ */
sydw("使用单位", "1232"), sydw("使用单位", "1232", "use"),
czdw("充装单位", "1231"), czdw("充装单位", "1231", "license"),
jyjcjg("检验检测机构", "1233"), jyjcjg("检验检测机构", "1233", "license"),
azgzwxdw("安装改造维修单位", "1234"), azgzwxdw("安装改造维修单位", "1234", "license"),
zzdw("制造单位", "1236"), zzdw("制造单位", "1236", "license"),
sjdw("设计单位", "1235"), sjdw("设计单位", "1235", "license"),
grzt("个人主体", "6599"); grzt("个人主体", "6599", "use");
private String name; private String name;
private String code; private String code;
private String type;
public static Map<String, String> getName = new HashMap<>(); public static Map<String, String> getName = new HashMap<>();
public static Map<String, String> getCode = new HashMap<>(); public static Map<String, String> getCode = new HashMap<>();
...@@ -38,15 +41,43 @@ public enum UnitTypeEnum { ...@@ -38,15 +41,43 @@ public enum UnitTypeEnum {
} }
} }
public static JSONArray getAll(){ public static JSONArray getAll() {
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
for (UnitTypeEnum e : UnitTypeEnum.values()) { for (UnitTypeEnum e : UnitTypeEnum.values()) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("label",e.name); jsonObject.put("label", e.name);
jsonObject.put("value",e.name); jsonObject.put("value", e.name);
jsonObject.put("key",e.code); jsonObject.put("key", e.code);
jsonArray.add(jsonObject); jsonArray.add(jsonObject);
} }
return jsonArray; return jsonArray;
} }
public static List<Map<String, Object>> getUnitTypeByCategory(String category) {
List<Map<String, Object>> list = new ArrayList<>();
for (UnitTypeEnum e : UnitTypeEnum.values()) {
if (e.type.equals(category)) {
Map<String, Object> map = new HashMap<>();
map.put("label", e.name);
map.put("value", e.name);
map.put("key", e.code);
list.add(map);
}
}
return list;
}
public static JSONArray getUnitTypeByType(String category) {
JSONArray jsonArray = new JSONArray();
for (UnitTypeEnum e : UnitTypeEnum.values()) {
if (e.type.equals(category)) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("label", e.name);
jsonObject.put("value", e.name);
jsonObject.put("key", e.code);
jsonArray.add(jsonObject);
}
}
return jsonArray;
}
} }
...@@ -96,8 +96,8 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController { ...@@ -96,8 +96,8 @@ public class ComprehensiveStatisticalAnalysisController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/select/queryUnitType") @GetMapping(value = "/select/queryUnitType")
@ApiOperation(httpMethod = "GET", value = "查询单位类型", notes = "查询单位类型") @ApiOperation(httpMethod = "GET", value = "查询单位类型", notes = "查询单位类型")
public ResponseModel<JSONArray> queryUnitType() { public ResponseModel<JSONArray> queryUnitType(@RequestParam(required = false) String type) {
return ResponseHelper.buildResponse(statisticalAnalysisService.queryUnitType()); return ResponseHelper.buildResponse(statisticalAnalysisService.queryUnitType(type));
} }
/** /**
......
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