6 changed files with 348 additions and 0 deletions
@ -0,0 +1,91 @@ |
|||
package com.acupuncture.web.controller.web; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.json.JSONArray; |
|||
import cn.hutool.json.JSONObject; |
|||
import com.acupuncture.common.annotation.Anonymous; |
|||
import com.acupuncture.common.annotation.DataSource; |
|||
import com.acupuncture.common.enums.DataSourceType; |
|||
import com.acupuncture.system.domain.dto.ExternalDto; |
|||
import com.acupuncture.system.domain.dto.JszDto; |
|||
import com.acupuncture.system.domain.vo.ExternalVo; |
|||
import com.acupuncture.system.domain.vo.JszVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zzc |
|||
* @Package com.acupuncture.web.controller.web |
|||
* @Date 2025/6/26 13:40 |
|||
* @description: |
|||
*/ |
|||
@Slf4j |
|||
@Api(tags = "外部接口") |
|||
@RestController |
|||
@RequestMapping("") |
|||
public class JszController { |
|||
|
|||
@Anonymous |
|||
@ApiOperation("获取人员信息") |
|||
@GetMapping("/getUserInfo") |
|||
@DataSource(DataSourceType.MASTER) |
|||
public Object test(@RequestParam("uid") String uid) { |
|||
log.info("获肌少症取人员信息:{}", uid); |
|||
JszVo.MemberResult memberResult = new JszVo.MemberResult(); |
|||
memberResult.setTitle("personInfo"); |
|||
memberResult.setGID("TFHT"); |
|||
memberResult.setUID("1"); |
|||
memberResult.setName("张三"); |
|||
memberResult.setSex("1"); //(男1,女2)
|
|||
memberResult.setHeight("175.6"); |
|||
memberResult.setBirthYear("1990"); |
|||
memberResult.setPhone("123456"); |
|||
if (memberResult == null) { |
|||
return "no person"; |
|||
} |
|||
return memberResult; |
|||
} |
|||
|
|||
@Anonymous |
|||
@ApiOperation("运动机能类数据的实时传输") |
|||
@PostMapping("/ydjnlsj") |
|||
public Object ydjnlsj(@RequestBody String str) { |
|||
log.info("str:{}", str); |
|||
JSONObject object = new JSONObject(str); |
|||
JszDto.Ydjnlsj ydjnlsj = BeanUtil.copyProperties(object, JszDto.Ydjnlsj.class); |
|||
|
|||
log.info("运动机能类数据的实时传输:{}", ydjnlsj); |
|||
// List<ExternalDto.RtcfInfoDto> list = dto.getList();
|
|||
|
|||
return "upload ok"; |
|||
} |
|||
|
|||
@Anonymous |
|||
@ApiOperation("体成分数据的实时上传") |
|||
@PostMapping("/tcfsj") |
|||
public Object tcfsj(@RequestBody String str) { |
|||
log.info("str:{}", str); |
|||
JSONObject object = new JSONObject(str); |
|||
JszDto.Tcfsj tcfsj = BeanUtil.copyProperties(object, JszDto.Tcfsj.class); |
|||
|
|||
log.info("运动机能类数据的实时传输:{}", tcfsj); |
|||
// List<ExternalDto.RtcfInfoDto> list = dto.getList();
|
|||
|
|||
return "upload ok"; |
|||
} |
|||
|
|||
@Anonymous |
|||
@ApiOperation("6.报告图片上传") |
|||
@PostMapping(value = "/uploadFile", consumes = "multipart/form-data") |
|||
public Object uploadFile(MultipartFile image) { |
|||
log.info("报告图片上传"); |
|||
|
|||
return "uploadReport ok"; |
|||
} |
|||
} |
|||
@ -0,0 +1,138 @@ |
|||
package com.acupuncture.system.domain.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author zzc |
|||
* @Package com.acupuncture.system.domain.dto |
|||
* @Date 2025/6/26 14:00 |
|||
* @description: |
|||
*/ |
|||
public class JszDto { |
|||
|
|||
@Data |
|||
@ApiModel("运动机能类数据") |
|||
public static class Ydjnlsj { |
|||
@JsonProperty(value = "Title") |
|||
private String Title; //标题:CURRENT_FIT_DATA指当前体质测试类数据
|
|||
@JsonProperty(value = "UUID") |
|||
private String UUID; //单位代码(或科室代码、项目代码)
|
|||
@JsonProperty(value = "UID") |
|||
private String UID; //人员编号
|
|||
@JsonProperty(value = "TestID") |
|||
private String TestID; //测试序号(时间戳)
|
|||
@JsonProperty(value = "TestDate") |
|||
private String TestDate; //测试日期
|
|||
@JsonProperty(value = "Name") |
|||
private String Name; //测试者姓名
|
|||
@JsonProperty(value = "Sex") |
|||
private String Sex; //测试者性别,男1女2
|
|||
@JsonProperty(value = "BirthYear") |
|||
private String BirthYear; //测试者出生年份
|
|||
@JsonProperty(value = "Item") |
|||
private String Item; //测试项目标识,如"Grip"代表握力
|
|||
@JsonProperty(value = "Value") |
|||
private String Value; //测试值
|
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("体成分数据的实时上传") |
|||
public static class Tcfsj { |
|||
@JsonProperty(value = "Title") |
|||
private String Title; //标题:BCA_DATA指体成分测试类数据
|
|||
@JsonProperty(value = "UUID") |
|||
private String UUID; //单位代码(或科室代码、项目代码)
|
|||
@JsonProperty(value = "UID") |
|||
private String UID; //人员编码
|
|||
@JsonProperty(value = "TestID") |
|||
private String TestID; //测试序号(时间戳)
|
|||
@JsonProperty(value = "TestDate") |
|||
private String TestDate; //测试日期
|
|||
@JsonProperty(value = "Name") |
|||
private String Name; //测试者姓名
|
|||
@JsonProperty(value = "Sex") |
|||
private String Sex; //测试者性别,男1女2
|
|||
@JsonProperty(value = "Weight") |
|||
private String Weight; //体重
|
|||
@JsonProperty(value = "Fat") |
|||
private String Fat; //脂肪
|
|||
@JsonProperty(value = "Bone") |
|||
private String Bone; //骨质
|
|||
@JsonProperty(value = "Protein") |
|||
private String Protein; //蛋白质
|
|||
@JsonProperty(value = "Water") |
|||
private String Water; //水分
|
|||
@JsonProperty(value = "Muscle") |
|||
private String Muscle; //肌肉
|
|||
@JsonProperty(value = "SMM") |
|||
private String SMM; //骨骼肌
|
|||
@JsonProperty(value = "PBF") |
|||
private String PBF; //体脂百分比
|
|||
@JsonProperty(value = "BMI") |
|||
private String BMI; //体质指数
|
|||
@JsonProperty(value = "BMR") |
|||
private String BMR; //基础代谢
|
|||
@JsonProperty(value = "Edema") |
|||
private String Edema; //水肿系数(2位小数)
|
|||
@JsonProperty(value = "VFI") |
|||
private String VFI; //内脏脂肪指数
|
|||
@JsonProperty(value = "BodyAge") |
|||
private String BodyAge; //身体年龄
|
|||
@JsonProperty(value = "Score") |
|||
private String Score; //健康评分
|
|||
@JsonProperty(value = "BodyType") |
|||
private String BodyType; //体型
|
|||
@JsonProperty(value = "Standard_weight") |
|||
private String Standard_weight; //目标体重
|
|||
@JsonProperty(value = "Weight_control") |
|||
private String Weight_control; //体重控制
|
|||
@JsonProperty(value = "Fat_control") |
|||
private String Fat_control; //脂肪控制量
|
|||
@JsonProperty(value = "Muscle_control") |
|||
private String Muscle_control; //肌肉控制量
|
|||
@JsonProperty(value = "ASMI") |
|||
private String ASMI; //四肢骨骼肌指数
|
|||
// @JsonProperty(value = "Value")
|
|||
// private String Edema; //水肿系数(2位小数)
|
|||
@JsonProperty(value = "LBM") |
|||
private String LBM; //瘦体重(去脂体重)
|
|||
@JsonProperty(value = "ICW") |
|||
private String ICW; //细胞内液
|
|||
@JsonProperty(value = "ECW") |
|||
private String ECW; //细胞外液
|
|||
@JsonProperty(value = "LiverRisk") |
|||
private String LiverRisk; //脂肪肝风险系数
|
|||
@JsonProperty(value = "TR_fat") |
|||
private String TR_fat; //躯干脂肪量
|
|||
@JsonProperty(value = "LA_fat") |
|||
private String LA_fat; //左上肢脂肪
|
|||
@JsonProperty(value = "RA_fat") |
|||
private String RA_fat; //右上肢脂肪
|
|||
@JsonProperty(value = "LL_fat") |
|||
private String LL_fat; //左下肢脂肪
|
|||
@JsonProperty(value = "RL_fat") |
|||
private String RL_fat; //右下肢脂肪
|
|||
@JsonProperty(value = "TR_water") |
|||
private String TR_water; //躯干水分量
|
|||
@JsonProperty(value = "LA_water") |
|||
private String LA_water; //左上肢水分
|
|||
@JsonProperty(value = "RA_water") |
|||
private String RA_water; //右上肢水分
|
|||
@JsonProperty(value = "LL_water") |
|||
private String LL_water; //左下肢水分
|
|||
@JsonProperty(value = "RL_water") |
|||
private String RL_water; //右下肢水分
|
|||
@JsonProperty(value = "TR_muscle") |
|||
private String TR_muscle; //躯干肌肉量
|
|||
@JsonProperty(value = "LA_muscle") |
|||
private String LA_muscle; //左上肢肌肉
|
|||
@JsonProperty(value = "RA_muscle") |
|||
private String RA_muscle; //右上肢肌肉
|
|||
@JsonProperty(value = "LL_muscle") |
|||
private String LL_muscle; //左下肢肌肉
|
|||
@JsonProperty(value = "RL_muscle") |
|||
private String RL_muscle; //右下肢肌肉
|
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.acupuncture.system.domain.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Author zzc |
|||
* @Package com.acupuncture.system.domain.vo |
|||
* @Date 2025/6/26 13:45 |
|||
* @description: |
|||
*/ |
|||
public class JszVo { |
|||
|
|||
@Data |
|||
public static class MemberResult { |
|||
@JsonProperty(value = "Title") |
|||
private String Title; //标题
|
|||
@JsonProperty(value = "GID") |
|||
private String GID; //组别代码(可为空)
|
|||
@JsonProperty(value = "UID") |
|||
private String UID; //人员编号
|
|||
@JsonProperty(value = "Name") |
|||
private String Name; //姓名
|
|||
@JsonProperty(value = "Sex") |
|||
private String Sex; //性别 (男1,女2)
|
|||
@JsonProperty(value = "Height") |
|||
private String Height; //身高(cm)
|
|||
@JsonProperty(value = "BirthYear") |
|||
private String BirthYear; //出生年
|
|||
@JsonProperty(value = "Phone") |
|||
private String Phone; //电话(可为空)
|
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue