|
|
@ -2,6 +2,7 @@ package com.ruoyi.web.controller.nanjing;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
|
|
|
import com.ruoyi.nanjing.domain.Demo;
|
|
|
|
import com.ruoyi.nanjing.domain.ReportData;
|
|
|
|
import com.ruoyi.nanjing.domain.ReportData;
|
|
|
|
import com.ruoyi.nanjing.domain.TBdProductinfo;
|
|
|
|
import com.ruoyi.nanjing.domain.TBdProductinfo;
|
|
|
|
import com.ruoyi.nanjing.service.ITBdProducttypeService;
|
|
|
|
import com.ruoyi.nanjing.service.ITBdProducttypeService;
|
|
|
@ -43,31 +44,57 @@ public class ReportDataController extends BaseController {
|
|
|
|
List<ReportData> reportDataList = producttypeService.selectReport(map);
|
|
|
|
List<ReportData> reportDataList = producttypeService.selectReport(map);
|
|
|
|
|
|
|
|
|
|
|
|
List<String> paraName = new ArrayList<>();
|
|
|
|
List<String> paraName = new ArrayList<>();
|
|
|
|
List<String> barcodelist = new ArrayList<>();
|
|
|
|
List<String> barcodes = new ArrayList<>();
|
|
|
|
|
|
|
|
List<String> stations = new ArrayList<>();
|
|
|
|
//取出参数名
|
|
|
|
//取出参数名
|
|
|
|
reportDataList.forEach(x->barcodelist.add(x.getBarcode()));
|
|
|
|
reportDataList.forEach(x->barcodes.add(x.getBarcode()));
|
|
|
|
reportDataList.forEach(x->paraName.add(x.getParameaning()));
|
|
|
|
reportDataList.forEach(x->paraName.add(x.getParameaning()));
|
|
|
|
|
|
|
|
reportDataList.forEach(x->stations.add(x.getStationName()));
|
|
|
|
//去重
|
|
|
|
//去重
|
|
|
|
List<String> barcodeList = barcodelist.stream().distinct().collect(Collectors.toList());
|
|
|
|
//条码List
|
|
|
|
|
|
|
|
List<String> barcodeList = barcodes.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//参数List
|
|
|
|
List<String> paraNameList = paraName.stream().distinct().collect(Collectors.toList());
|
|
|
|
List<String> paraNameList = paraName.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
//工位名集合
|
|
|
|
|
|
|
|
List<String> stationList = stations.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
//定义结果集合
|
|
|
|
//定义结果集合
|
|
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
|
|
//定义结果集map
|
|
|
|
//定义结果集map
|
|
|
|
Map<String,Object> map1 = new HashMap<>();
|
|
|
|
Map<String,Object> map1 = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
for(String item:barcodeList){
|
|
|
|
for(String item:barcodeList){
|
|
|
|
map1.put("barcode",item);
|
|
|
|
map1.put("barcode",item);
|
|
|
|
for (String param:paraNameList) {
|
|
|
|
for (String station:stationList) {
|
|
|
|
for (ReportData rpd:reportDataList) {
|
|
|
|
for(String param:paraNameList){
|
|
|
|
if (rpd.getBarcode().equals(item)&&rpd.getParameaning().equals(param)){
|
|
|
|
for (ReportData rpd:reportDataList) {
|
|
|
|
if(rpd.getValue()==null){
|
|
|
|
// if (rpd.getBarcode().equals(item)&&rpd.getStationName().equals(station)){
|
|
|
|
rpd.setValue("-");
|
|
|
|
// map1.put(station,rpd.getStationName());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (rpd.getBarcode().equals(item)&&rpd.getStationName().equals(station)&&rpd.getParameaning().equals(param)){
|
|
|
|
|
|
|
|
if(rpd.getValue()==null){
|
|
|
|
|
|
|
|
rpd.setValue("-");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
map1.put(station,param);
|
|
|
|
|
|
|
|
map1.put(param,rpd.getValue());
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
map1.put(param,rpd.getValue());
|
|
|
|
|
|
|
|
// map1.put(param+"value",rpd.getValue());
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// for (String param:paraNameList) {
|
|
|
|
|
|
|
|
// for (ReportData rpd:reportDataList) {
|
|
|
|
|
|
|
|
// if (rpd.getBarcode().equals(item)&&rpd.getParameaning().equals(param)){
|
|
|
|
|
|
|
|
// if(rpd.getValue()==null){
|
|
|
|
|
|
|
|
// rpd.setValue("-");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// map1.put(param,rpd.getValue());
|
|
|
|
|
|
|
|
//// map1.put(param+"value",rpd.getValue());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
//排序的作用
|
|
|
|
//排序的作用
|
|
|
|
TreeMap<String,Object> treeMap = new TreeMap<>(map1);
|
|
|
|
TreeMap<String,Object> treeMap = new TreeMap<>(map1);
|
|
|
|
list.add(treeMap);
|
|
|
|
list.add(treeMap);
|
|
|
|