|
|
|
@ -14,6 +14,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -67,20 +69,34 @@ public class ApiController {
|
|
|
|
|
public AjaxResult queryPramList(Date beginTime, Date endTime) {
|
|
|
|
|
return success(iApiService.queryPramList(beginTime, endTime));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(tags = {"60脱水机"}, value = "导出数据记录")
|
|
|
|
|
@PostMapping("/home/exportParamList")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public AjaxResult export(String name ,String type,String colms,Date beginTime, Date endTime)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
System.out.println(name);
|
|
|
|
|
System.out.println(type);
|
|
|
|
|
System.out.println(colms);
|
|
|
|
|
public AjaxResult export(String name, String type, String colms, Date beginTime, Date endTime) {
|
|
|
|
|
System.out.println("显示列:"+colms);
|
|
|
|
|
List<RecordRaramData> list = iApiService.queryPramList(beginTime, endTime);
|
|
|
|
|
ExcelUtil_2<RecordRaramData> util = new ExcelUtil_2(RecordRaramData.class);
|
|
|
|
|
util.hideColumn("time");
|
|
|
|
|
return util.exportExcel(list, "数据记录","12312");
|
|
|
|
|
if (colms != null) {
|
|
|
|
|
List<String> tags = Arrays.asList(colms.split(","));
|
|
|
|
|
List<String> tagsF = new ArrayList<>(Arrays.asList(
|
|
|
|
|
"采集时间", "一体机A转速", "一体机A电流",
|
|
|
|
|
"一体机A切刀转速", "一体机A切刀电流",
|
|
|
|
|
"一体机A机头温度", "一体机A机头压力"));
|
|
|
|
|
for (String s : tags) {
|
|
|
|
|
tagsF.remove(s);
|
|
|
|
|
}
|
|
|
|
|
if (!tagsF.isEmpty()) {
|
|
|
|
|
String[] columnsArray = tagsF.toArray(new String[tagsF.size()]);
|
|
|
|
|
util.hideColumn(columnsArray);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return util.exportExcel(list, "数据记录", name + "," + type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ApiOperation(tags = {"60脱水机"}, value = "设备介绍")
|
|
|
|
|
@GetMapping("/home/deviceInfo")
|
|
|
|
|
public AjaxResult deviceInfo() {
|
|
|
|
|