Commit 5e654dc7 authored by tianyiming's avatar tianyiming

调整综合统计查询

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