|
|
@ -334,11 +334,11 @@ public class AppController extends BaseController
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId);
|
|
|
|
jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId);
|
|
|
|
TRecord tRecord = new TRecord();
|
|
|
|
// TRecord tRecord = new TRecord();
|
|
|
|
tRecord.setId(recordId);
|
|
|
|
// tRecord.setId(recordId);
|
|
|
|
tRecord.setAiResult(jsonObject.toJSONString());
|
|
|
|
// tRecord.setAiResult(jsonObject.toJSONString());
|
|
|
|
tRecord.setAiResult2(jsonObject.toJSONString());
|
|
|
|
// tRecord.setAiResult2(jsonObject.toJSONString());
|
|
|
|
tRecordService.updateTRecord(tRecord);
|
|
|
|
// tRecordService.updateTRecord(tRecord);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return AjaxResult.success(jsonObject);
|
|
|
|
return AjaxResult.success(jsonObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -357,19 +357,19 @@ public class AppController extends BaseController
|
|
|
|
private void saveImage(AiPostReq aiPostReq,Long recordId)
|
|
|
|
private void saveImage(AiPostReq aiPostReq,Long recordId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Base64ResizedRmgSm base64_resized_img_sm = aiPostReq.getBase64_resized_img_sm();
|
|
|
|
Base64ResizedRmgSm base64_resized_img_sm = aiPostReq.getBase64_resized_img_sm();
|
|
|
|
Base64ResizedRmgSm base64_resized_img_sx = aiPostReq.getBase64_resized_img_sx();
|
|
|
|
Base64ResizedRmgSx base64_resized_img_sx = aiPostReq.getBase64_resized_img_sx();
|
|
|
|
Map<String, String> smMap = imageKey(base64_resized_img_sm,"base64_resized_img_sm");
|
|
|
|
Map<String, String> smMap = imageKey(base64_resized_img_sm,"base64_resized_img_sm");
|
|
|
|
Map<String, String> sxMap = imageKey(base64_resized_img_sx, "base64_resized_img_sx");
|
|
|
|
// Map<String, String> sxMap = imageKey(base64_resized_img_sx, "base64_resized_img_sx");
|
|
|
|
smMap.putAll(sxMap);
|
|
|
|
// smMap.putAll(sxMap);
|
|
|
|
sxMap.forEach((name,value)->{
|
|
|
|
// sxMap.forEach((name,value)->{
|
|
|
|
TImage tImage = new TImage();
|
|
|
|
// TImage tImage = new TImage();
|
|
|
|
tImage.setThirdId(recordId);
|
|
|
|
// tImage.setThirdId(recordId);
|
|
|
|
tImage.setCreateTime(new Date());
|
|
|
|
// tImage.setCreateTime(new Date());
|
|
|
|
tImage.setName(name);
|
|
|
|
// tImage.setName(name);
|
|
|
|
String path=GenerateImage(value);
|
|
|
|
// String path=GenerateImage(value);
|
|
|
|
tImage.setPath(path);
|
|
|
|
// tImage.setPath(path);
|
|
|
|
imageService.insertTImage(tImage);
|
|
|
|
// imageService.insertTImage(tImage);
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String,String> imageKey(Base64ResizedRmgSm param,String key){
|
|
|
|
public Map<String,String> imageKey(Base64ResizedRmgSm param,String key){
|
|
|
@ -377,25 +377,25 @@ public class AppController extends BaseController
|
|
|
|
if(!StringUtils.isEmpty(param.getFront())){
|
|
|
|
if(!StringUtils.isEmpty(param.getFront())){
|
|
|
|
map.put(key+"-front",param.getFront());
|
|
|
|
map.put(key+"-front",param.getFront());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!StringUtils.isEmpty(param.getLeft())){
|
|
|
|
// if(!StringUtils.isEmpty(param.getLeft())){
|
|
|
|
map.put(key+"-left",param.getLeft());
|
|
|
|
// map.put(key+"-left",param.getLeft());
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if(!StringUtils.isEmpty(param.getFront())){
|
|
|
|
// if(!StringUtils.isEmpty(param.getFront())){
|
|
|
|
map.put(key+"-right",param.getRight());
|
|
|
|
// map.put(key+"-right",param.getRight());
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if(!CollectionUtils.isEmpty(param.getOther())){
|
|
|
|
// if(!CollectionUtils.isEmpty(param.getOther())){
|
|
|
|
for (int i = 0; i < param.getOther().size(); i++)
|
|
|
|
// for (int i = 0; i < param.getOther().size(); i++)
|
|
|
|
{
|
|
|
|
// {
|
|
|
|
map.put(key+"-other"+i,param.getOther().get(i));
|
|
|
|
// map.put(key+"-other"+i,param.getOther().get(i));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return map;
|
|
|
|
return map;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public JSONObject removeBase64Image(JSONObject jsonObject,Long recordId)
|
|
|
|
public JSONObject removeBase64Image(JSONObject jsonObject,Long recordId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String []keys={"image_sz","image_sz_yudian","image_sz_yuban","image_sz_liewen","image_st","image_sx","image_sx_vein"};
|
|
|
|
String []keys={"img_sz","img_sz_yudian","img_sz_yuban","img_sz_liewen","img_st","img_sx","img_sx_vein"};
|
|
|
|
List<JSONObject> parents=new ArrayList<>();
|
|
|
|
List<JSONObject> parents=new ArrayList<>();
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -413,12 +413,12 @@ public class AppController extends BaseController
|
|
|
|
String imgStr=parents.get(i).getJSONObject(imageKey).getString("v");
|
|
|
|
String imgStr=parents.get(i).getJSONObject(imageKey).getString("v");
|
|
|
|
String path=GenerateImage(imgStr);
|
|
|
|
String path=GenerateImage(imgStr);
|
|
|
|
parents.get(i).getJSONObject(keys[i]).put("v",null);
|
|
|
|
parents.get(i).getJSONObject(keys[i]).put("v",null);
|
|
|
|
TImage tImage = new TImage();
|
|
|
|
// TImage tImage = new TImage();
|
|
|
|
tImage.setName(imageKey);
|
|
|
|
// tImage.setName(imageKey);
|
|
|
|
tImage.setPath(path);
|
|
|
|
// tImage.setPath(path);
|
|
|
|
tImage.setCreateTime(new Date());
|
|
|
|
// tImage.setCreateTime(new Date());
|
|
|
|
tImage.setThirdId(recordId);
|
|
|
|
// tImage.setThirdId(recordId);
|
|
|
|
imageService.insertTImage(tImage);
|
|
|
|
// imageService.insertTImage(tImage);
|
|
|
|
//保存图片到数据库,thirdId(recordId),path,name(imageKey)
|
|
|
|
//保存图片到数据库,thirdId(recordId),path,name(imageKey)
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|