diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/NutritionManagementController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/NutritionManagementController.java new file mode 100644 index 0000000..45862c3 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/NutritionManagementController.java @@ -0,0 +1,40 @@ +package com.lyms.talkonlineweb.controller; + +import com.lyms.talkonlineweb.annotation.TokenRequired; +import com.lyms.talkonlineweb.domain.LymsHisInfo; +import com.lyms.talkonlineweb.domain.LymsNutrition; +import com.lyms.talkonlineweb.result.BaseResponse; +import com.lyms.talkonlineweb.service.LymsHisInfoService; +import com.lyms.talkonlineweb.service.LymsNutritionService; +import com.lyms.talkonlineweb.util.StringUtil; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("nutritionManagement") +@Log4j2 +public class NutritionManagementController { + + @Autowired + private LymsNutritionService lymsNutritionService; + + @PostMapping("upHisInfo") + @TokenRequired + public BaseResponse upHisInfo(@RequestBody @Validated LymsNutrition lymsNutrition){ + BaseResponse baseResponse=new BaseResponse(); + try { + baseResponse.setErrorcode(0); + baseResponse.setErrormsg("患者上传成功"); + lymsNutritionService.upNutritionInfo(lymsNutrition); + } catch (Exception e) { + e.printStackTrace(); + } + return baseResponse; + } + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java index 956931c..fbd2702 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/PatientInfo.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import java.util.Date; +import java.util.Objects; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -160,92 +161,45 @@ public class PatientInfo implements Serializable { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date created; + @TableField(value="height") + private String height;//身高 + + @TableField(value="weight") + private String weight;//体重 @TableField(exist = false) private static final long serialVersionUID = 1L; @Override - public boolean equals(Object that) { - if (this == that) { - return true; - } - if (that == null) { - return false; - } - if (getClass() != that.getClass()) { - return false; - } - PatientInfo other = (PatientInfo) that; - return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getPname() == null ? other.getPname() == null : this.getPname().equals(other.getPname())) - && (this.getIdno() == null ? other.getIdno() == null : this.getIdno().equals(other.getIdno())) - && (this.getPpasswd() == null ? other.getPpasswd() == null : this.getPpasswd().equals(other.getPpasswd())) - && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex())) - && (this.getCcnt() == null ? other.getCcnt() == null : this.getCcnt().equals(other.getCcnt())) - && (this.getHxid() == null ? other.getHxid() == null : this.getHxid().equals(other.getHxid())) - && (this.getCreatedby() == null ? other.getCreatedby() == null : this.getCreatedby().equals(other.getCreatedby())) - && (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid())) - && (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile())) - && (this.getHid() == null ? other.getHid() == null : this.getHid().equals(other.getHid())) - && (this.getHname() == null ? other.getHname() == null : this.getHname().equals(other.getHname())) - && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid())) - && (this.getDname() == null ? other.getDname() == null : this.getDname().equals(other.getDname())) - && (this.getDtid() == null ? other.getDtid() == null : this.getDtid().equals(other.getDtid())) - && (this.getDtname() == null ? other.getDtname() == null : this.getDtname().equals(other.getDtname())) - && (this.getIid() == null ? other.getIid() == null : this.getIid().equals(other.getIid())) - && (this.getIname() == null ? other.getIname() == null : this.getIname().equals(other.getIname())); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getPname() == null) ? 0 : getPname().hashCode()); - result = prime * result + ((getIdno() == null) ? 0 : getIdno().hashCode()); - result = prime * result + ((getPpasswd() == null) ? 0 : getPpasswd().hashCode()); - result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode()); - result = prime * result + ((getCcnt() == null) ? 0 : getCcnt().hashCode()); - result = prime * result + ((getHxid() == null) ? 0 : getHxid().hashCode()); - result = prime * result + ((getCreatedby() == null) ? 0 : getCreatedby().hashCode()); - result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode()); - result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode()); - result = prime * result + ((getHid() == null) ? 0 : getHid().hashCode()); - result = prime * result + ((getHname() == null) ? 0 : getHname().hashCode()); - result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode()); - result = prime * result + ((getDname() == null) ? 0 : getDname().hashCode()); - result = prime * result + ((getDtid() == null) ? 0 : getDtid().hashCode()); - result = prime * result + ((getDtname() == null) ? 0 : getDtname().hashCode()); - result = prime * result + ((getIid() == null) ? 0 : getIid().hashCode()); - result = prime * result + ((getIname() == null) ? 0 : getIname().hashCode()); - return result; - } - - @Override public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(getClass().getSimpleName()); - sb.append(" ["); - sb.append("Hash = ").append(hashCode()); - sb.append(", id=").append(id); - sb.append(", pname=").append(pname); - sb.append(", idno=").append(idno); - sb.append(", ppasswd=").append(ppasswd); - sb.append(", sex=").append(sex); - sb.append(", ccnt=").append(ccnt); - sb.append(", hxid=").append(hxid); - sb.append(", createdby=").append(createdby); - sb.append(", cid=").append(cid); - sb.append(", mobile=").append(mobile); - sb.append(", hid=").append(hid); - sb.append(", hname=").append(hname); - sb.append(", did=").append(did); - sb.append(", dname=").append(dname); - sb.append(", dtid=").append(dtid); - sb.append(", dtname=").append(dtname); - sb.append(", iid=").append(iid); - sb.append(", iname=").append(iname); - sb.append(", serialVersionUID=").append(serialVersionUID); - sb.append("]"); - return sb.toString(); + return "PatientInfo{" + + "id=" + id + + ", pname='" + pname + '\'' + + ", idno='" + idno + '\'' + + ", ppasswd='" + ppasswd + '\'' + + ", sex=" + sex + + ", ccnt=" + ccnt + + ", birth='" + birth + '\'' + + ", hxid='" + hxid + '\'' + + ", createdby=" + createdby + + ", cid=" + cid + + ", mobile='" + mobile + '\'' + + ", enrolmentPhone='" + enrolmentPhone + '\'' + + ", hid=" + hid + + ", hname='" + hname + '\'' + + ", did=" + did + + ", dname='" + dname + '\'' + + ", dtid=" + dtid + + ", dtname='" + dtname + '\'' + + ", iid=" + iid + + ", iname='" + iname + '\'' + + ", ilid=" + ilid + + ", headimg='" + headimg + '\'' + + ", createdtime=" + createdtime + + ", gzopenid='" + gzopenid + '\'' + + ", synthesisQuery='" + synthesisQuery + '\'' + + ", created=" + created + + ", height='" + height + '\'' + + ", weight='" + weight + '\'' + + '}'; } } \ No newline at end of file