[add] 违规记录
This commit is contained in:
@ -1,591 +0,0 @@
|
||||
package org.dromara.test;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.manager.spartamanager.SpartaManager;
|
||||
import org.dromara.manager.spartamanager.enums.SpartaRecTypeEnum;
|
||||
import org.dromara.manager.spartamanager.vo.ImageStreamResult;
|
||||
import org.dromara.manager.spartamanager.vo.SpartaRecognizeVo;
|
||||
import org.dromara.manager.spartamanager.vo.SpartaTargetVo;
|
||||
import org.dromara.other.domain.dto.ys7deviceimg.OthYs7DeviceImgCreateByCapture;
|
||||
import org.dromara.other.service.IOthYs7DeviceImgService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/6/20 19:40
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
public class SpartaTest {
|
||||
|
||||
@Resource
|
||||
private SpartaManager spartaManager;
|
||||
|
||||
@Resource
|
||||
private IOthYs7DeviceImgService othYs7DeviceImgService;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
String token = spartaManager.getToken();
|
||||
log.info("token: {}", token);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() throws URISyntaxException, IOException {
|
||||
String url = "http://58.17.134.85:9000/xinnengyuan-dev/ys7/device/img/sxt_1750583731809_227.jpg";
|
||||
// List<SpartaRecTypeEnum> hat = List.of(SpartaRecTypeEnum.HAT, SpartaRecTypeEnum.HEAD);
|
||||
// SpartaRecognizeVo recognize = spartaManager.recognize(
|
||||
// url,
|
||||
// hat,
|
||||
// null,
|
||||
// null,
|
||||
// null
|
||||
// );
|
||||
// log.info("识别结果: {}", recognize);
|
||||
SpartaRecognizeVo vo = new SpartaRecognizeVo();
|
||||
vo.setHasTarget(1);
|
||||
vo.setOriginalImgSize(List.of(2560, 1440));
|
||||
|
||||
SpartaTargetVo targets = new SpartaTargetVo();
|
||||
targets.setType("hat");
|
||||
targets.setSize(List.of(59, 78));
|
||||
targets.setLeftTopPoint(List.of(880, 597));
|
||||
targets.setScore(0.41687846183776855);
|
||||
|
||||
vo.setTargets(List.of(targets));
|
||||
// 1. 读取图片
|
||||
URI uri = new URI(url);
|
||||
BufferedImage image = ImageIO.read(uri.toURL());
|
||||
// 2. 创建画布
|
||||
Graphics2D g = image.createGraphics();
|
||||
g.setColor(Color.RED);
|
||||
g.setStroke(new BasicStroke(5));
|
||||
g.setFont(new Font("SansSerif", Font.BOLD, 18));
|
||||
// 3. 遍历目标并画框
|
||||
for (SpartaTargetVo target : vo.getTargets()) {
|
||||
List<Integer> size = target.getSize(); // 宽高
|
||||
List<Integer> leftTop = target.getLeftTopPoint(); // x y
|
||||
|
||||
int x = leftTop.get(0);
|
||||
int y = leftTop.get(1);
|
||||
int width = size.get(0);
|
||||
int height = size.get(1);
|
||||
|
||||
// 画矩形框
|
||||
g.drawRect(x, y, width, height);
|
||||
|
||||
// 写文字(类型 + 置信度)
|
||||
String label = SpartaRecTypeEnum.fromValue(target.getType()).getText() + " (" + String.format("%.2f", target.getScore()) + ")";
|
||||
g.drawString(label, x, y - 5);
|
||||
}
|
||||
|
||||
g.dispose();
|
||||
|
||||
// 4. 保存标记后的图片
|
||||
File outFile = new File("marked_output.jpg");
|
||||
ImageIO.write(image, "jpg", outFile);
|
||||
|
||||
System.out.println("标记完成,保存路径: " + "marked_output.jpg");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
String url = "http://58.17.134.85:9000/xinnengyuan-dev/ys7/device/img/sxt_1750583731809_227.jpg";
|
||||
OthYs7DeviceImgCreateByCapture img = new OthYs7DeviceImgCreateByCapture();
|
||||
img.setCreateTime(new Date());
|
||||
img.setUrl(url);
|
||||
img.setDeviceName("摄像头1");
|
||||
img.setDeviceSerial("sxt_1750583731809_227");
|
||||
log.info("识别结果: {}", img);
|
||||
othYs7DeviceImgService.saveCapturePic(List.of(img));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() throws IOException, URISyntaxException {
|
||||
String url = "http://xny.yj-3d.com:7363/file/tif/20250625160218orthophoto.png";
|
||||
String targetStr = "[\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 344,\n" +
|
||||
" 149\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3787,\n" +
|
||||
" 3241\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9511\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 334,\n" +
|
||||
" 147\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4276,\n" +
|
||||
" 3590\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9498\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 330,\n" +
|
||||
" 149\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3459,\n" +
|
||||
" 3183\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9496\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 353,\n" +
|
||||
" 148\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4226,\n" +
|
||||
" 3714\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9495\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 339,\n" +
|
||||
" 132\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4276,\n" +
|
||||
" 2678\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9486\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 340,\n" +
|
||||
" 145\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4565,\n" +
|
||||
" 2982\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9486\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 335,\n" +
|
||||
" 142\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3695,\n" +
|
||||
" 3360\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9475\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 336,\n" +
|
||||
" 145\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4446,\n" +
|
||||
" 3357\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9473\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 338,\n" +
|
||||
" 140\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4248,\n" +
|
||||
" 2803\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9466\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 343,\n" +
|
||||
" 155\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4565,\n" +
|
||||
" 3769\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9464\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 346,\n" +
|
||||
" 148\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4233,\n" +
|
||||
" 2925\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9462\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 327,\n" +
|
||||
" 159\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4000,\n" +
|
||||
" 2484\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.946\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 336,\n" +
|
||||
" 145\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4906,\n" +
|
||||
" 2908\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9457\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 339,\n" +
|
||||
" 150\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3618,\n" +
|
||||
" 3477\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9456\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 318,\n" +
|
||||
" 147\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 5241,\n" +
|
||||
" 3883\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9448\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 328,\n" +
|
||||
" 147\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4934,\n" +
|
||||
" 3702\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.943\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 312,\n" +
|
||||
" 142\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3633,\n" +
|
||||
" 2557\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9428\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 340,\n" +
|
||||
" 137\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4576,\n" +
|
||||
" 2856\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9406\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 335,\n" +
|
||||
" 138\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4316,\n" +
|
||||
" 2548\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9398\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 345,\n" +
|
||||
" 146\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4890,\n" +
|
||||
" 3829\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9378\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 332,\n" +
|
||||
" 153\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4126,\n" +
|
||||
" 3304\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9371\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 325,\n" +
|
||||
" 137\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3581,\n" +
|
||||
" 2944\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9318\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 320,\n" +
|
||||
" 145\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3879,\n" +
|
||||
" 3123\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9304\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 343,\n" +
|
||||
" 143\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4601,\n" +
|
||||
" 3645\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9258\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 335,\n" +
|
||||
" 142\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4673,\n" +
|
||||
" 3528\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9255\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 312,\n" +
|
||||
" 144\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4800,\n" +
|
||||
" 3411\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.923\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 337,\n" +
|
||||
" 139\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4016,\n" +
|
||||
" 3412\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9225\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 340,\n" +
|
||||
" 141\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4605,\n" +
|
||||
" 2729\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9191\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 298,\n" +
|
||||
" 325\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3249,\n" +
|
||||
" 2576\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9185\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 338,\n" +
|
||||
" 156\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4537,\n" +
|
||||
" 2451\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9118\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 334,\n" +
|
||||
" 143\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4933,\n" +
|
||||
" 2783\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9114\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 339,\n" +
|
||||
" 141\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4464,\n" +
|
||||
" 2308\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9107\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 343,\n" +
|
||||
" 143\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3890,\n" +
|
||||
" 3000\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.9064\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 313,\n" +
|
||||
" 139\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3593,\n" +
|
||||
" 2810\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.902\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 259,\n" +
|
||||
" 131\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 4000,\n" +
|
||||
" 2755\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.8869\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 345,\n" +
|
||||
" 149\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3901,\n" +
|
||||
" 2864\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.8841\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 345,\n" +
|
||||
" 150\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 3945,\n" +
|
||||
" 2610\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.8632\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": \"pho\",\n" +
|
||||
" \"size\": [\n" +
|
||||
" 199,\n" +
|
||||
" 110\n" +
|
||||
" ],\n" +
|
||||
" \"leftTopPoint\": [\n" +
|
||||
" 5166,\n" +
|
||||
" 3661\n" +
|
||||
" ],\n" +
|
||||
" \"score\": 0.8225\n" +
|
||||
" }\n" +
|
||||
" ]";
|
||||
List<SpartaTargetVo> list = JSONUtil.toList(targetStr, SpartaTargetVo.class);
|
||||
log.info("list:{}", list);
|
||||
ImageStreamResult imageStreamResult = spartaManager.drawImageToStream(url, list);
|
||||
log.info("imageStreamResult:{}", imageStreamResult);
|
||||
try (OutputStream outputStream = new FileOutputStream("D:/images/save.png")) {
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = imageStreamResult.getInputStream().read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package org.dromara.test;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordCreateDto;
|
||||
import org.dromara.safety.service.IHseViolationRecordService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/7/22 15:36
|
||||
*/
|
||||
@SpringBootTest
|
||||
public class ViolationRecordTest {
|
||||
|
||||
@Resource
|
||||
private IHseViolationRecordService violationRecordService;
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
List<HseViolationRecordCreateDto> list = new ArrayList<>();
|
||||
HseViolationRecordCreateDto dto1 = new HseViolationRecordCreateDto();
|
||||
dto1.setProjectId(1897160897167638529L);
|
||||
dto1.setRecognizeId(1937451365735419905L);
|
||||
dto1.setViolationType("3");
|
||||
dto1.setViolationTime(new Date());
|
||||
list.add(dto1);
|
||||
HseViolationRecordCreateDto dto2 = new HseViolationRecordCreateDto();
|
||||
dto2.setProjectId(1897160897167638529L);
|
||||
dto2.setRecognizeId(1937451365735419906L);
|
||||
dto2.setViolationType("1,2,3");
|
||||
dto2.setViolationTime(new Date());
|
||||
list.add(dto2);
|
||||
HseViolationRecordCreateDto dto3 = new HseViolationRecordCreateDto();
|
||||
dto3.setProjectId(1897160897167638529L);
|
||||
dto3.setRecognizeId(1937451365735419907L);
|
||||
dto3.setViolationType("2,7,8");
|
||||
dto3.setViolationTime(new Date());
|
||||
list.add(dto3);
|
||||
HseViolationRecordCreateDto dto4 = new HseViolationRecordCreateDto();
|
||||
dto4.setProjectId(1897160897167638529L);
|
||||
dto4.setRecognizeId(1937451365735419908L);
|
||||
dto4.setViolationType("5,8");
|
||||
dto4.setViolationTime(new Date());
|
||||
list.add(dto4);
|
||||
HseViolationRecordCreateDto dto5 = new HseViolationRecordCreateDto();
|
||||
dto5.setProjectId(1897160897167638529L);
|
||||
dto5.setRecognizeId(1937451365735419909L);
|
||||
dto5.setViolationType("3,9");
|
||||
dto5.setViolationTime(new Date());
|
||||
list.add(dto5);
|
||||
violationRecordService.insertByMonitor(list);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user