Commit 2642accc authored by wanghao's avatar wanghao

1 接收 aoi 检测结果数据调整。

parent ee45fbd1
......@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* AOI检查结果
* @author geng
......@@ -20,7 +22,7 @@ public class AoiTestResultController extends BaseController{
private AoiTestResultService aoiTestResultService;
@PostMapping("/syncAoiResult")
public AjaxResult syncAoiResult(@RequestBody String result){
return toAjax(aoiTestResultService.syncAoiResult(result));
public Map<String,Object> syncAoiResult(@RequestBody String result){
return aoiTestResultService.syncAoiResult(result);
}
}
package com.zehong.service;
import java.util.Map;
/**
* AOI检查结果
* @author geng
......@@ -10,5 +12,5 @@ public interface AoiTestResultService {
* AOI检查结果同步
* @param result
*/
int syncAoiResult(String result);
Map<String,Object> syncAoiResult(String result);
}
......@@ -11,8 +11,11 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -32,8 +35,9 @@ public class AoiTestResultServiceImpl implements AoiTestResultService{
* AOI检查结果同步
* @param result
*/
public int syncAoiResult(String result){
public Map<String,Object> syncAoiResult(String result){
int insertResult = 0;
Map<String,Object> map = new HashMap<>();
JSONObject resultJson = JSON.parseObject(result);
log.info("aoi检测结果=====" + resultJson);
JSONArray boardData = resultJson.getJSONArray("board_data");
......@@ -51,6 +55,15 @@ public class AoiTestResultServiceImpl implements AoiTestResultService{
}
}
}
return insertResult;
if(insertResult != 0) {
map.put("code",200);
map.put("message","上传成功");
return map;
}
map.put("code",400);
map.put("message","上传失败");
return map;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment