Commit f6d601f3 authored by 曹盼盼's avatar 曹盼盼

修改管材

parent ea3e37ec
...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.*; ...@@ -11,6 +11,7 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.*;
import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.VerifyMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService; import com.yeejoin.amos.boot.module.ugp.api.service.IVerifyService;
import com.yeejoin.amos.boot.module.ugp.biz.fegin.MaasServiceFeignClient;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
...@@ -21,6 +22,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -21,6 +22,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -68,6 +71,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -68,6 +71,9 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
@Value("${mqtt.topic.weldUpdate}") @Value("${mqtt.topic.weldUpdate}")
private String weldUpdate; private String weldUpdate;
@Autowired
private MaasServiceFeignClient maasServiceFeignClient;
/** /**
* 分页查询 * 分页查询
...@@ -340,7 +346,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -340,7 +346,8 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
verify.setCode(jsonObject.getString("code")); verify.setCode(jsonObject.getString("code"));
//从图片中获取管材编号materialId //从图片中获取管材编号materialId
//管材编号(暂时写死) //管材编号(暂时写死)
String materialCode = "1585520415743176365"; String url = "http://172.16.10.220:9000/"+photo;
String materialCode = getMaterialCodeByOcr(url);
verify.setStage(StageEnum.焊前管材质量.getStage()); verify.setStage(StageEnum.焊前管材质量.getStage());
/**校验*/ /**校验*/
Boolean flag =false; Boolean flag =false;
...@@ -660,6 +667,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper ...@@ -660,6 +667,7 @@ public class VerifyServiceImpl extends BaseService<VerifyDto,Verify,VerifyMapper
return VerifyEnum.已通过.getName(); return VerifyEnum.已通过.getName();
} }
/** cpp /** cpp
* 校验失败需要添加的数据 * 校验失败需要添加的数据
* @param verify * @param verify
...@@ -1219,4 +1227,18 @@ return jsonArray; ...@@ -1219,4 +1227,18 @@ return jsonArray;
objectPage1.setRecords(list2); objectPage1.setRecords(list2);
return objectPage1 ; return objectPage1 ;
} }
public String getMaterialCodeByOcr(String urlPath){
JSONObject param = new JSONObject();
JSONArray urls = new JSONArray();
JSONObject url = new JSONObject();
url.put("url", urlPath);
urls.add(url);
param.put("data", urls);
ResponseModel<Object> result = maasServiceFeignClient.getPatrolDangerInfo(param);
String resultStr = JSONObject.parseObject(JSONObject.toJSONString(result.getResult())).getJSONObject("result1").getJSONArray("rows").getJSONObject(0).getString("ocrResult");
return resultStr;
}
} }
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