{
code: "0",
desc: "查询成功",
data: {
valuelist: [
{
CARCODE: "A39-III-IV049",
ECODE: "A39-Ⅲ",
MANAGER: "高乐红",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A39-III-IV050",
ECODE: "A39-Ⅲ",
MANAGER: "高乐红",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A39-III-IV051",
ECODE: "A39-Ⅲ",
MANAGER: "高乐红",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A39-III-IV052",
ECODE: "A39-Ⅲ",
MANAGER: "高乐红",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A39-III-IV053",
ECODE: "A39-Ⅲ",
MANAGER: "高乐红",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "总拼焊接"
}
],
progress: ""
},
{
CARCODE: "A39-III-IV064",
ECODE: "A39-Ⅲ",
MANAGER: "高乐红",
listValue: [
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV141",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "裸车改制"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "前处理"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "密封胶"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "烘干1"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "烘干2"
}
],
progress: ""
},
{
CARCODE: "A90-IV142",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV144",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "白车身改制"
}
],
progress: ""
},
{
CARCODE: "A90-IV152",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV153",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV154",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV155",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV156",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV157",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV158",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
},
{
CARCODE: "A90-IV210",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "绿",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "绿",
ISCAR: "是",
PNAME: "总拼焊接"
}
],
progress: ""
},
{
CARCODE: "A90-S019",
ECODE: "A90-ET2-2",
MANAGER: "汤立尧",
listValue: [
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "下车体焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "总拼焊接"
},
{
COLORCODE: "红",
ISCAR: "否",
PNAME: "白车身改制"
},
{
COLORCODE: "红",
ISCAR: "是",
PNAME: "装调"
}
],
progress: ""
}
]
}
}
String str = JSONObject.parseObject(boardstr).getJSONObject("Body").getString("listValue");
String head = JSONObject.parseObject(boardstr).getJSONObject("Head").getString("listValue");
List<Valuelist> valuelist = JSONObject.parseArray(str, Valuelist.class);
Map<String, Map<String, Integer>> resultMap = new HashMap<>();
for (Valuelist vlist : valuelist) {
if(!resultMap.containsKey(vlist.getECODE())){
resultMap.put(vlist.getECODE(),new HashMap<>());
}
for (PnameList lvalue : vlist.getListValue()) {
Map<String,Integer> chilsReaultMap = resultMap.get(vlist.getECODE());
if(chilsReaultMap.containsKey(lvalue.getCOLORCODE())){
chilsReaultMap.put(lvalue.getCOLORCODE(),chilsReaultMap.get(lvalue.getCOLORCODE())+1);
}else{
chilsReaultMap.put(lvalue.getCOLORCODE(),1);
}
}
}
for (Valuelist vlist : valuelist) {
red= resultMap.get(vlist.getECODE()).get("红");
green= resultMap.get(vlist.getECODE()).get("绿");
//获取格式化对象
NumberFormat nt = NumberFormat.getPercentInstance();
//设置百分数精确度2即保留两位小数
nt.setMinimumFractionDigits(2);
vlist.setProgress(nt.format(green/(red+green)));
}
addJsonObj("valuelist", valuelist);
addJsonObj("head", head);