diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java index bf3d2358..1c79efb3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java @@ -59,7 +59,8 @@ public class ReportDataController extends BaseController { map.put("begin", begin); map.put("end", end); map.put("barcode", barcode); - List reportDataList = producttypeService.selectReport(map); +// List> mapList=producttypeService.selectReport(map); + List> reportDataList = producttypeService.selectReport(map); // List list = new ArrayList<>(); // for (ReportData data : reportDataList) { @@ -101,47 +102,101 @@ public class ReportDataController extends BaseController { // } // JSONObject jsonObject=new JSONObject(); // System.out.println(jsonObject.toJSONString(list)); - List paraName = new ArrayList<>(); - List barcodes = new ArrayList<>(); - List stations = new ArrayList<>(); - //取出参数名 - reportDataList.forEach(x->barcodes.add(x.getBarcode())); - reportDataList.forEach(x->paraName.add(x.getParameaning())); - reportDataList.forEach(x->stations.add(x.getStationName())); - //去重 - //条码List - List barcodeList = barcodes.stream().distinct().collect(Collectors.toList()); - //参数List - List paraNameList = paraName.stream().distinct().collect(Collectors.toList()); - //工位名集合 - List stationList = stations.stream().distinct().collect(Collectors.toList()); +// List paraName = new ArrayList<>(); +// List barcodes = new ArrayList<>(); +// List stations = new ArrayList<>(); +// //取出参数名 +// for (int i = 0; i < mapList.size(); i++) { +// barcodes.add((String) mapList.get(i).get("Barcode")); +//// mapList.forEach(x->barcodes.add()); +// } +// +// for (int i = 0; i < mapList.size(); i++) { +// paraName.add((String) mapList.get(i).get("parameaning")); +// } +// +// for (int i = 0; i < mapList.size(); i++) { +// stations.add((String) mapList.get(i).get("stationname")); +// } +//// reportDataList.forEach(x->paraName.add(x.getParameaning())); +//// reportDataList.forEach(x->stations.add(x.getStationName())); +// //去重 +// //条码List +// List barcodeList = barcodes.stream().distinct().collect(Collectors.toList()); +// //参数List +// List paraNameList = paraName.stream().distinct().collect(Collectors.toList()); +// //工位名集合 +// List stationList = stations.stream().distinct().collect(Collectors.toList()); +//// +//// //定义结果集合 +// List> list = new ArrayList<>(); +//// //定义结果集map +// Map map1 = new HashMap<>(); +// System.out.println(barcodeList); +// int number=0; +// +// for (String item:barcodeList) { +// for (String station : stationList) { +// for (String param : paraNameList) { +// for (Map map2:mapList){ +// System.out.println(map2.get("Barcode")); +//// if (map2.get("Barcode").equals(item) && map2.get("stationname").equals(station)&& map2.get("parameaning").equals(param)){ +//// String paramName = map2.get("stationname") + "-" + map2.get("parameaning"); +//// map1.put(paramName, map2.get("value")); +//// break; +//// } +// } +// } +// } +// +// +// } +// for(String item:barcodeList) { + - //定义结果集合 - List> list = new ArrayList<>(); - //定义结果集map - Map map1 = new HashMap<>(); - int number=0; - for(String item:barcodeList){ - number=number+1; - map1.put("产品条码",item); - map1.put("序号",number); - for (String station:stationList) { - for(String param:paraNameList){ - for (ReportData rpd:reportDataList) { - map1.put("时间",rpd.getBeginTime()); - map1.put("状态",rpd.getState()); - if (rpd.getBarcode().equals(item)&&rpd.getStationName().equals(station)&&rpd.getParameaning().equals(param)){ - if(rpd.getValue()==null){ - rpd.setValue("-"); - } - String paramName = rpd.getStationName()+"-"+rpd.getParameaning(); -// map1.put(station,param); - map1.put(paramName,rpd.getValue()); - break; - } - } - } - } +// number = number + 1; +// map1.put("产品条码", item); +// map1.put("序号", number); +// for (String station : stationList) { +// for (String param : paraNameList) { +// for (Map map2 : mapList) { +// map1.put("时间", map2.get("begintime")); +// map1.put("状态", map2.get("stationname")); +// if (map2.get("Barcode").equals(item) && map2.get("stationname").equals(station) && map2.get("parameaning").equals(param)) { +// if (map2.get("value") == null) { +// map2.put("value", "-"); +// +// } +// String paramName = map2.get("stationname") + "-" + map2.get("parameaning"); +// map1.put(paramName, map2.get("value")); +// break; +// } +// } +// } +// } +// } +// int number=0; +// for(String item:barcodeList){ +// number=number+1; +// map1.put("产品条码",item); +// map1.put("序号",number); +// for (String station:stationList) { +// for(String param:paraNameList){ +// for (ReportData rpd:reportDataList) { +// map1.put("时间",rpd.getBeginTime()); +// map1.put("状态",rpd.getState()); +// if (rpd.getBarcode().equals(item)&&rpd.getStationName().equals(station)&&rpd.getParameaning().equals(param)){ +// if(rpd.getValue()==null){ +// rpd.setValue("-"); +// } +// String paramName = rpd.getStationName()+"-"+rpd.getParameaning(); +//// map1.put(station,param); +// map1.put(paramName,rpd.getValue()); +// break; +// } +// } +// } +// } // for (String param:paraNameList) { // for (ReportData rpd:reportDataList) { // if (rpd.getBarcode().equals(item)&&rpd.getParameaning().equals(param)){ @@ -155,126 +210,126 @@ public class ReportDataController extends BaseController { // } // } //排序的作用 - TreeMap treeMap = new TreeMap<>(map1); - list.add(treeMap); - } - String info = JSONArray.toJSONString(list); -// System.out.println(info); - System.out.println("条码信息查询Json格式:"+info); - return getDataTable(list); +// TreeMap treeMap = new TreeMap<>(map1); +// list.add(treeMap); +// } +// String info = JSONArray.toJSONString(list); +//// System.out.println(info); +// System.out.println("条码信息查询Json格式:"+info); + return getDataTable(reportDataList); } - @PostMapping("/export") - @ResponseBody - public AjaxResult export(String begin, String end, String barcode){ - Map map = new HashMap(); - map.put("begin", begin); - map.put("end", end); - map.put("barcode", barcode); - AjaxResult ajaxResult=new AjaxResult(); - List reportDataList = producttypeService.selectReport(map); - List paraName = new ArrayList<>(); - List barcodes = new ArrayList<>(); - List stations = new ArrayList<>(); - //取出参数名 - reportDataList.forEach(x->barcodes.add(x.getBarcode())); - reportDataList.forEach(x->paraName.add(x.getParameaning())); - reportDataList.forEach(x->stations.add(x.getStationName())); - //去重 - //条码List - List barcodeList = barcodes.stream().distinct().collect(Collectors.toList()); - //参数List - List paraNameList = paraName.stream().distinct().collect(Collectors.toList()); - //工位名集合 - List stationList = stations.stream().distinct().collect(Collectors.toList()); - - //定义结果集合 - List> list = new ArrayList<>(); - //定义结果集map - Map map1 = new HashMap<>(); - - int number=0; - for(String item:barcodeList){ - number=number+1; - map1.put("序号",String.valueOf(number)); - map1.put("产品条码",item); - for (String station:stationList) { - for(String param:paraNameList){ - for (ReportData rpd:reportDataList) { - map1.put("时间",rpd.getBeginTime()); - if (rpd.getBarcode().equals(item)&&rpd.getStationName().equals(station)&&rpd.getParameaning().equals(param)){ - if(rpd.getValue()==null){ - rpd.setValue("-"); - } - String paramName = rpd.getStationName()+"-"+rpd.getParameaning(); -// map1.put(station,param); - map1.put(paramName,rpd.getValue()); - break; - } - } - } - } - //排序的作用 - TreeMap treeMap = new TreeMap<>(map1); - list.add(treeMap); - - } - List arrayList=new ArrayList(); - if (list!=null) { - Set k = list.get(0).keySet(); - Iterator it = k.iterator(); - while (it.hasNext()) { - String key = it.next(); - - //有了键,就可以通过map集合的get方法获取对应的值 -// if (key=="barcode"){ -// key="产品条码"; -// }if (key=="beginTime"){ -// key="时间"; +// @PostMapping("/export") +// @ResponseBody +// public AjaxResult export(String begin, String end, String barcode){ +// Map map = new HashMap(); +// map.put("begin", begin); +// map.put("end", end); +// map.put("barcode", barcode); +// AjaxResult ajaxResult=new AjaxResult(); +// List reportDataList = producttypeService.selectReport(map); +// List paraName = new ArrayList<>(); +// List barcodes = new ArrayList<>(); +// List stations = new ArrayList<>(); +// //取出参数名 +// reportDataList.forEach(x->barcodes.add(x.getBarcode())); +// reportDataList.forEach(x->paraName.add(x.getParameaning())); +// reportDataList.forEach(x->stations.add(x.getStationName())); +// //去重 +// //条码List +// List barcodeList = barcodes.stream().distinct().collect(Collectors.toList()); +// //参数List +// List paraNameList = paraName.stream().distinct().collect(Collectors.toList()); +// //工位名集合 +// List stationList = stations.stream().distinct().collect(Collectors.toList()); +// +// //定义结果集合 +// List> list = new ArrayList<>(); +// //定义结果集map +// Map map1 = new HashMap<>(); +// +// int number=0; +// for(String item:barcodeList){ +// number=number+1; +// map1.put("序号",String.valueOf(number)); +// map1.put("产品条码",item); +// for (String station:stationList) { +// for(String param:paraNameList){ +// for (ReportData rpd:reportDataList) { +// map1.put("时间",rpd.getBeginTime()); +// if (rpd.getBarcode().equals(item)&&rpd.getStationName().equals(station)&&rpd.getParameaning().equals(param)){ +// if(rpd.getValue()==null){ +// rpd.setValue("-"); +// } +// String paramName = rpd.getStationName()+"-"+rpd.getParameaning(); +//// map1.put(station,param); +// map1.put(paramName,rpd.getValue()); +// break; +// } +// } // } - arrayList.add(key); - - } - } -// ExcelUtil.createWorkBook(list,list1); - XSSFWorkbook wb = new XSSFWorkbook(); - XSSFSheet sheet = wb.createSheet("First sheet"); - sheet.setDefaultRowHeight((short) (2 * 256)); - XSSFFont font = wb.createFont(); - font.setFontName("宋体"); - font.setFontHeightInPoints((short) 16); - XSSFRow row = sheet.createRow(0); - String targetFile=null; - for (int s=0;s treeMap = new TreeMap<>(map1); +// list.add(treeMap); +// +// } +// List arrayList=new ArrayList(); +// if (list!=null) { +// Set k = list.get(0).keySet(); +// Iterator it = k.iterator(); +// while (it.hasNext()) { +// String key = it.next(); +// +// //有了键,就可以通过map集合的get方法获取对应的值 +//// if (key=="barcode"){ +//// key="产品条码"; +//// }if (key=="beginTime"){ +//// key="时间"; +//// } +// arrayList.add(key); +// +// } +// } +//// ExcelUtil.createWorkBook(list,list1); +// XSSFWorkbook wb = new XSSFWorkbook(); +// XSSFSheet sheet = wb.createSheet("First sheet"); +// sheet.setDefaultRowHeight((short) (2 * 256)); +// XSSFFont font = wb.createFont(); +// font.setFontName("宋体"); +// font.setFontHeightInPoints((short) 16); +// XSSFRow row = sheet.createRow(0); +// String targetFile=null; +// for (int s=0;s> list = tracestateService.selectStationPara(map); + List> list=tracestateService.selectStationPara(map); +// List> list = tracestateService.selectStationPara(map); +// Map newMAP=new HashMap(); +// for(Map map1 : list){ +// if (map1.containsKey("产品码")){ +// newMAP.put("产品码",map1.get("产品码")); +// } +// } for (int i = 0; i < list.size(); i++) { if (list.get(i).containsKey("产品码")) { continue; @@ -66,6 +72,27 @@ public class StationParaInfoController extends BaseController { return getDataTable(list); } +// public static void main(String[] args) { +// List> maps=new ArrayList<>(); +// Map map=new HashMap(); +// map.put("测试","1552"); +// map.put("测试2","58146"); +// map.put("产品码","58533"); +// maps.add(map); +// Map newMAP=new HashMap(); +// List> newListMap=new ArrayList<>(); +// for (Map map1 : maps){ +// if (map1.containsKey("产品码")){ +// newMAP.put("产品码",map1.get("产品码")); +// }else { +// newMAP.put(); +// } +// newListMap.add(newMAP); +// } +// System.out.println(maps); +// } + + // @RequiresPermissions("nanjing:StationPara:export") // @Log(title = "产品码查询", businessType = BusinessType.EXPORT) diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/groupHeader.html b/ruoyi-admin/src/main/resources/templates/demo/table/groupHeader.html index 27d2b8d6..3034ba43 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/groupHeader.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/groupHeader.html @@ -1,80 +1,84 @@ - - - - - - -
-
-
-
-
-
-
-
- - + + + + + + +
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html b/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html index 3429d44a..fc322b6f 100644 --- a/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html +++ b/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html @@ -30,6 +30,7 @@
+
@@ -56,24 +57,13 @@ contentType: false, success: function (json) { console.log(json) - - // var coulmnsData = []; var columnsArray = []; - columnsArray.push({field : "序号",title : "序号",colspan: 1,rowspan: 1}); - columnsArray.push({field : "产品条码",title : "产品条码",colspan: 1,rowspan: 1}); - columnsArray.push({field : "状态",title : "状态",colspan: 1,rowspan: 1, - formatter: function (value, row, index) { - return $.table.selectDictLabel(stateDatas, value); - } - }); - columnsArray.push({field : "时间",title : "开始时间",colspan: 1,rowspan: 1}); - // columnsArray.push({field : "barCode",title : "产品条码",colspan: 1,rowspan: 1}); - // var columns = []; - console.log(json.total) + columnsArray.push({field : "Barcode",title : "产品条码",colspan: 1,rowspan: 1}); if(json.total>0){ for (var i = 0; i < (Object.keys(json.rows[0])).length; i++) {//Object.keys(obj) 获取key名称 var property = (Object.keys(json.rows[0]))[i]; - if(property!='产品条码'&&property!='时间'&&property!='序号'&&property!='状态'){ + console.log(property) + if(property!='Barcode'){ columnsArray.push({ "title": property, "field": property, @@ -81,37 +71,13 @@ align:"center", } ); - } } - // for (var i = 0;i selectAllQs(Map map); - List selectReport(Map map); + List> selectReport(Map map); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/ITBdProducttypeService.java b/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/ITBdProducttypeService.java index 4a04bf4f..394c165f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/ITBdProducttypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/ITBdProducttypeService.java @@ -40,5 +40,5 @@ public interface ITBdProducttypeService List selectNodeQs(Map map); - List selectReport(Map map); + List> selectReport(Map map); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/impl/TBdProducttypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/impl/TBdProducttypeServiceImpl.java index 75e417c0..14953ce5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/impl/TBdProducttypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/nanjing/service/impl/TBdProducttypeServiceImpl.java @@ -83,7 +83,7 @@ public class TBdProducttypeServiceImpl implements ITBdProducttypeService } @Override - public List selectReport(Map map) { + public List> selectReport(Map map) { return tBdProducttypeMapper.selectReport(map); } } diff --git a/ruoyi-system/src/main/resources/mapper/nanjing/TBdProducttypeMapper.xml b/ruoyi-system/src/main/resources/mapper/nanjing/TBdProducttypeMapper.xml index adce0242..fa3d349e 100644 --- a/ruoyi-system/src/main/resources/mapper/nanjing/TBdProducttypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/nanjing/TBdProducttypeMapper.xml @@ -151,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" } - { call begin_date5 ( diff --git a/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml b/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml index e4bf4536..42a33038 100644 --- a/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/nanjing/TSyTracestateMapper.xml @@ -121,7 +121,7 @@ ) } - { call pro_SelectSemiStationParaData (