|
@@ -42,6 +42,8 @@ import com.huimv.core.pojo.page.PageResult;
|
|
|
import com.huimv.core.pojo.response.ErrorResponseData;
|
|
|
import com.huimv.core.pojo.response.ResponseData;
|
|
|
import com.huimv.core.pojo.response.SuccessResponseData;
|
|
|
+import com.huimv.core.util.PoiUtil;
|
|
|
+import com.huimv.modular.alarmvalueset.entity.AlarmValueSet;
|
|
|
import com.huimv.modular.collectorregister.entity.CollectorRegister;
|
|
|
import com.huimv.modular.collectorregister.mapper.CollectorRegisterMapper;
|
|
|
import com.huimv.modular.collectorregister.param.CollectorRegisterParam;
|
|
@@ -64,10 +66,7 @@ import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.junit.Test;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
@@ -132,20 +131,27 @@ public class EartagRegisterController{
|
|
|
}
|
|
|
return strId.toString();
|
|
|
}
|
|
|
- @PostMapping ("/test/listWarning")
|
|
|
- public ResponseData listWarning(@RequestBody Map<String,Integer> map, HttpServletResponse response) throws IOException {
|
|
|
- Integer starId = map.get("starId");
|
|
|
- Integer endId = map.get("endId");
|
|
|
- Integer minCountTime = map.get("minCountTime");
|
|
|
- Integer maxCountTime = map.get("maxCountTime");
|
|
|
- Integer minEarTemp = map.get("minEarTemp");
|
|
|
- Integer maxEarTemp = map.get("maxEarTemp");
|
|
|
+ @GetMapping("/test/listWarning")
|
|
|
+ public void listWarning( @RequestParam(name = "startId") Integer starId ,
|
|
|
+ @RequestParam(name = "endId") Integer endId ,
|
|
|
+ @RequestParam(name = "minCountTime") Integer minCountTime ,
|
|
|
+ @RequestParam(name = "maxCountTime") Integer maxCountTime ,
|
|
|
+ @RequestParam(name = "minEarTemp") Integer minEarTemp ,
|
|
|
+ @RequestParam(name = "maxEarTemp") Integer maxEarTemp ,
|
|
|
+// @RequestBody Map<String ,Integer> map,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+// Integer starId = map.get("starId");
|
|
|
+// Integer endId = map.get("endId");
|
|
|
+// Integer minCountTime = map.get("minCountTime");
|
|
|
+// Integer maxCountTime = map.get("maxCountTime");
|
|
|
+// Integer minEarTemp = map.get("minEarTemp");
|
|
|
+// Integer maxEarTemp = map.get("maxEarTemp");
|
|
|
List<EartagRegisterWarningVo> eartagRegisters = eartagRegisterMapper.listWarning(starId, endId, minCountTime, maxCountTime, minEarTemp, maxEarTemp);
|
|
|
|
|
|
- ExcelWriter writer = ExcelUtil.getWriter(true);
|
|
|
- // 一次性写出list内的对象到excel,使用默认样式,强制输出标题
|
|
|
+ ExcelWriter writer = ExcelUtil.getWriter("C:/"+starId+"--"+endId +".xls");
|
|
|
+// // 一次性写出list内的对象到excel,使用默认样式,强制输出标题
|
|
|
writer.write(eartagRegisters, true);
|
|
|
- // 设置浏览器响应的格式
|
|
|
+// // 设置浏览器响应的格式
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
|
|
String fileName = URLEncoder.encode("预警表", "UTF-8");
|
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
|
|
@@ -154,8 +160,8 @@ public class EartagRegisterController{
|
|
|
writer.flush(out, true);
|
|
|
out.close();
|
|
|
writer.close();
|
|
|
-
|
|
|
- return ResponseData.success(eartagRegisters);
|
|
|
+// PoiUtil.exportExcelWithStream(starId+"--"+endId +".xls", EartagRegisterWarningVo.class, eartagRegisters);
|
|
|
+// return ResponseData.success(eartagRegisters);
|
|
|
}
|
|
|
|
|
|
//增加增删改查的功能 删除的时候删除所有的耳标:
|