|
|
@@ -25,6 +25,8 @@ import com.fs.his.vo.FsHealthTongueUVO;
|
|
|
import com.qiniu.util.Json;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.fs.his.mapper.FsHealthTongueMapper;
|
|
|
@@ -40,6 +42,8 @@ import com.fs.his.service.IFsHealthTongueService;
|
|
|
@Service
|
|
|
public class FsHealthTongueServiceImpl implements IFsHealthTongueService
|
|
|
{
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(FsHealthTongueServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private FsHealthTongueMapper fsHealthTongueMapper;
|
|
|
@Autowired
|
|
|
@@ -186,6 +190,72 @@ public class FsHealthTongueServiceImpl implements IFsHealthTongueService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R insertFsHealthTongueByImgUrlOld(FsHealthTongueUParam param) {
|
|
|
+
|
|
|
+ QueryQuanXi queryQuanXi = new QueryQuanXi();
|
|
|
+ if (param.getName()!=null&&!param.getName().equals("")) {
|
|
|
+ queryQuanXi.setName(param.getName());
|
|
|
+ } else {
|
|
|
+ queryQuanXi.setName("匿名");
|
|
|
+ }
|
|
|
+ if (param.getAge()!=null) {
|
|
|
+ queryQuanXi.setAge(param.getAge()+"");
|
|
|
+ } else {
|
|
|
+ queryQuanXi.setAge("55");
|
|
|
+ }
|
|
|
+
|
|
|
+ queryQuanXi.setFile(param.getTongueUrl());
|
|
|
+ if (param.getSex()!=null) {
|
|
|
+ queryQuanXi.setMale(param.getSex()==1?"1":"0");
|
|
|
+ } else {
|
|
|
+ queryQuanXi.setMale("0");
|
|
|
+ }
|
|
|
+
|
|
|
+ AITongueResult<TongueData> tongueDataAITongueResult = aiTongueService.quanXiTongue(queryQuanXi);
|
|
|
+
|
|
|
+ if (tongueDataAITongueResult.getCode().equals("40001")) {
|
|
|
+ FsHealthTongue fsHealthTongue = new FsHealthTongue();
|
|
|
+ fsHealthTongue.setAge(param.getAge());
|
|
|
+ fsHealthTongue.setPatientId(param.getPatientId());
|
|
|
+ fsHealthTongue.setName(param.getName());
|
|
|
+ fsHealthTongue.setSex(param.getSex());
|
|
|
+ fsHealthTongue.setStatus(0);
|
|
|
+ fsHealthTongue.setUserId(param.getUserId());
|
|
|
+ fsHealthTongue.setTongueUrl(param.getTongueUrl());
|
|
|
+ TongueData data = tongueDataAITongueResult.getData();
|
|
|
+ fsHealthTongue.setTongueId(data.getId());
|
|
|
+ fsHealthTongue.setCreateTime(new Date());
|
|
|
+ fsHealthTongue.setTypeName(data.getTypeName()+"质");
|
|
|
+
|
|
|
+ fsHealthTongue.setBotai(data.getBotai());
|
|
|
+ fsHealthTongue.setBotaiDesc(data.getBotaiDesc());
|
|
|
+ fsHealthTongue.setChihen(data.getChihen());
|
|
|
+ fsHealthTongue.setChihenDesc(data.getChihenDesc());
|
|
|
+ fsHealthTongue.setLiewen(data.getLiewen());
|
|
|
+ fsHealthTongue.setLiewenDesc(data.getLiewenDesc());
|
|
|
+ fsHealthTongue.setShemianName(data.getShemianName());
|
|
|
+ fsHealthTongue.setShemianDesc(data.getShemianDesc());
|
|
|
+ fsHealthTongue.setTaiseName(data.getTaiseName());
|
|
|
+ fsHealthTongue.setTaiseDesc(data.getTaiseDesc());
|
|
|
+ String json =fsHealthTongueMapper.selectTypeJSON();
|
|
|
+ String typeName = fsHealthTongue.getTypeName();
|
|
|
+ String itemTypeJSonValue="[]";
|
|
|
+ List<Map<String, Object>> itemTypeJsonList = (List<Map<String, Object>>) JSON.parse(json);
|
|
|
+ for (Map<String, Object> stringStringMap : itemTypeJsonList) {
|
|
|
+ String itemType = (String) stringStringMap.get("itemType");
|
|
|
+ if (itemType.equals(typeName)){
|
|
|
+ itemTypeJSonValue= Json.encode(stringStringMap.get("item"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fsHealthTongue.setTypeJson(itemTypeJSonValue);
|
|
|
+ fsHealthTongueMapper.insertFsHealthTongue(fsHealthTongue);
|
|
|
+ return R.ok().put("data",fsHealthTongue);
|
|
|
+ } else {
|
|
|
+ return R.error(tongueDataAITongueResult.getMeta().getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public FsHealthTongueUVO selectFsHealthTongueByUserId(long userId) {
|
|
|
return fsHealthTongueMapper.selectFsHealthTongueByUserId(userId);
|