|
@@ -1,5 +1,6 @@
|
|
package com.jjt.biz.controller;
|
|
package com.jjt.biz.controller;
|
|
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
import com.jjt.biz.service.IApiYrService;
|
|
import com.jjt.biz.service.IApiYrService;
|
|
import com.jjt.biz.vo.YrTwinVO;
|
|
import com.jjt.biz.vo.YrTwinVO;
|
|
import com.jjt.common.constant.CacheConstants;
|
|
import com.jjt.common.constant.CacheConstants;
|
|
@@ -9,19 +10,22 @@ import com.jjt.common.core.redis.RedisCache;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.nio.file.Files;
|
|
|
|
+import java.nio.file.Paths;
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
|
/**
|
|
/**
|
|
* swagger 用户测试方法
|
|
* swagger 用户测试方法
|
|
*
|
|
*
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
*/
|
|
*/
|
|
-@Api(tags = "全厂孪生数据接口")
|
|
|
|
|
|
+@Api(tags = "染整线数字孪生数据接口")
|
|
@RestController
|
|
@RestController
|
|
@Slf4j
|
|
@Slf4j
|
|
public class ApiYrController extends BaseController {
|
|
public class ApiYrController extends BaseController {
|
|
@@ -29,6 +33,8 @@ public class ApiYrController extends BaseController {
|
|
private IApiYrService service;
|
|
private IApiYrService service;
|
|
@Resource
|
|
@Resource
|
|
private RedisCache redisCache;
|
|
private RedisCache redisCache;
|
|
|
|
+ @Value("${local.rzCompare}")
|
|
|
|
+ private String path;
|
|
|
|
|
|
@ApiOperation("染整线数字孪生")
|
|
@ApiOperation("染整线数字孪生")
|
|
@GetMapping("/api/yr/data")
|
|
@GetMapping("/api/yr/data")
|
|
@@ -39,4 +45,13 @@ public class ApiYrController extends BaseController {
|
|
return R.ok(vo);
|
|
return R.ok(vo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation("染整线数AI比对")
|
|
|
|
+ @GetMapping("/api/yr/compare")
|
|
|
|
+ @CrossOrigin(origins = "*")
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public R<?> compare(@RequestParam("line1") Integer line1, @RequestParam("line1") Integer line2, @RequestParam("time1") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime time1, @RequestParam("time2") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime time2) throws IOException {
|
|
|
|
+ String str = new String(Files.readAllBytes(Paths.get(path)));
|
|
|
|
+ return R.ok(JSONUtil.parseArray(str));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|