|
@@ -4,6 +4,7 @@ package com.yeechart.dotMatrix.module.DotMatrix.controller;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyuncs.utils.StringUtils;
|
|
|
import com.yeechart.dotMatrix.canvas.DotMatrixImageUtil;
|
|
|
+import com.yeechart.dotMatrix.module.DotMatrix.model.bean.GetNotMatrixByTypeCodeRequest;
|
|
|
import com.yeechart.dotMatrix.module.DotMatrix.model.bean.ResultBean;
|
|
|
import com.yeechart.dotMatrix.module.DotMatrix.service.DotMatrixService;
|
|
|
import com.yeechart.dotMatrix.signage.SignageFileUtil;
|
|
@@ -23,10 +24,7 @@ import javax.imageio.ImageIO;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -58,6 +56,28 @@ public class DotMatrixController {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("getDotMatrixByTypeCode")
|
|
|
+ public ResultBean getDotMatrixByTypeCode(@RequestBody GetNotMatrixByTypeCodeRequest req) {
|
|
|
+ if (StringUtils.isEmpty(req.getDeId())) {
|
|
|
+ return ResultBean.defeated("非法设备ID");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(req.getTypeCode())) {
|
|
|
+ return ResultBean.defeated("非法设备typeCode");
|
|
|
+ }
|
|
|
+ String[] typeCodesArr = req.getTypeCode().split(",");
|
|
|
+ List<BitmapDataVo> bitmapDataVoList = new ArrayList<>();
|
|
|
+ for (String typeCode : typeCodesArr) {
|
|
|
+ if (req.getIsDefault() != null && req.getIsDefault()) {
|
|
|
+ if (!typeCode.startsWith("D")) {
|
|
|
+ return ResultBean.defeated("预览初始图时,点阵图类型编号不正确,必须为D开头");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ BitmapDataVo bitmapDataVo = signageFileUtil.getLastBitmapDataVo(req.getDeId(), typeCode, req.getIsDefault());
|
|
|
+ bitmapDataVoList.add(bitmapDataVo);
|
|
|
+ }
|
|
|
+ return ResultBean.succeed(bitmapDataVoList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取自检图
|
|
|
*
|
|
@@ -80,7 +100,7 @@ public class DotMatrixController {
|
|
|
*/
|
|
|
@GetMapping("delDotMatrix")
|
|
|
public ResultBean delDotMatrix(String deID) {
|
|
|
-
|
|
|
+ logger.info("delete dotmatrix for device: {}", deID);
|
|
|
dotMatrixService.delDotMatrix(deID);
|
|
|
|
|
|
return ResultBean.succeed();
|