|
@@ -21,6 +21,7 @@ import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
@@ -117,7 +118,7 @@ public class DotMatrixController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("previewBitmap")
|
|
|
- public ResponseEntity<byte[]> previewBitmap(String typeCode, String DEID, Boolean isDefault) {
|
|
|
+ public ResponseEntity<byte[]> previewBitmap(String typeCode, String DEID, Boolean isDefault, HttpServletRequest request) {
|
|
|
|
|
|
if (isDefault == null || !isDefault) {
|
|
|
if (StringUtils.isEmpty(DEID)) {
|
|
@@ -153,20 +154,25 @@ public class DotMatrixController {
|
|
|
BufferedImage bufferedImage;
|
|
|
|
|
|
BitmapDataVo bitmapDataVo;
|
|
|
- if("test".equals(DEID)){
|
|
|
- Ter020201Vo ter020201Vo = new Ter020201Vo();
|
|
|
+ if(DEID.contains("test")){
|
|
|
+ Ter020201Vo ter020201Vo = new Ter020201Vo();
|
|
|
+ if("test".equals(DEID)){
|
|
|
ter020201Vo.setTer020201InfoVo(Ter020201InfoVo.test3("测试使用"));
|
|
|
- Set<String> typeCodeList = new HashSet<>();
|
|
|
- typeCodeList.add(typeCode);
|
|
|
- ter020201Vo.setType(new Integer[]{0});
|
|
|
+ }else{
|
|
|
+ ter020201Vo.setTer020201InfoVo(Ter020201InfoVo.defaultInit("测试默认"));
|
|
|
+ }
|
|
|
+
|
|
|
+ Set<String> typeCodeList = new HashSet<>();
|
|
|
+ typeCodeList.add(typeCode);
|
|
|
+ ter020201Vo.setType(new Integer[]{0});
|
|
|
|
|
|
|
|
|
- List<BitmapDataVo> bitmapDataVoList = dotMatrixService.getSignageDotMatrix(ter020201Vo);
|
|
|
- Map<String,BitmapDataVo> bitmapDataVoMap = bitmapDataVoList.stream().collect(Collectors.toMap(BitmapDataVo::getTypeCode, Function.identity()));
|
|
|
- bitmapDataVo =bitmapDataVoMap.get(typeCode);
|
|
|
+ List<BitmapDataVo> bitmapDataVoList = dotMatrixService.getSignageDotMatrix(ter020201Vo);
|
|
|
+ Map<String,BitmapDataVo> bitmapDataVoMap = bitmapDataVoList.stream().collect(Collectors.toMap(BitmapDataVo::getTypeCode, Function.identity()));
|
|
|
+ bitmapDataVo =bitmapDataVoMap.get(typeCode);
|
|
|
|
|
|
}else{
|
|
|
- bitmapDataVo = signageFileUtil.getLastBitmapDataVo(DEID, typeCode, isDefault);
|
|
|
+ bitmapDataVo = signageFileUtil.getLastBitmapDataVo(DEID, typeCode, isDefault);
|
|
|
}
|
|
|
|
|
|
if (bitmapDataVo == null) {
|