From ff8df5b07b34e5a9fb437f3cd330246929f1a82f Mon Sep 17 00:00:00 2001 From: zzc Date: Wed, 23 Apr 2025 12:15:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BA=BA=E4=BD=93=E6=88=90=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3-=E8=8E=B7=E5=8F=96=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3message=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=9B=BA=E5=AE=9A=E4=B8=BAbcaUser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/acupuncture/system/domain/vo/ExternalVo.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java index 2eb43efb..b0b38011 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java @@ -13,15 +13,15 @@ public class ExternalVo { @Data public static class Result{ - private String message; + private String message = "bcaUser"; private String gid; private String memberid; - private String testId; +// private String testId; - private String testDate; +// private String testDate; private String name; @@ -31,7 +31,7 @@ public class ExternalVo { private String birthYear; - private String weight; +// private String weight; private String phone; public String getSex() { From c6635741a33ac7455de795cf9da895cd9b12b43b Mon Sep 17 00:00:00 2001 From: zzc Date: Thu, 24 Apr 2025 15:29:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=8A=E7=96=97?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/web/ExternalController.java | 14 + .../system/domain/vo/ExternalVo.java | 790 +++++++++++++++++- .../service/impl/PmsTreatmentServiceImpl.java | 43 +- .../resources/mapper/dao/PmsPatientDao.xml | 2 +- 4 files changed, 831 insertions(+), 18 deletions(-) diff --git a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java index e26940dd..69661606 100644 --- a/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java +++ b/acupuncture-admin/src/main/java/com/acupuncture/web/controller/web/ExternalController.java @@ -191,4 +191,18 @@ public class ExternalController { public JsonResponse selectReportByMemberId(@RequestBody @Validated ExternalDto.MemberDto dto){ return JsonResponse.ok(externalService.selectReportByMemberId(dto.getId())); } + + @Anonymous + @ApiOperation("2人员信息查询接口") + @GetMapping("/http/getPersonInfo") + @DataSource(DataSourceType.MASTER) + public Object getPersonInfo(@RequestParam("from") String from, @RequestParam("uid") String uid) { + log.info("获取人员信息:{},{}",from, uid); + checkoutData(from); + ExternalVo.Result query = externalService.query(from, uid); + if (query == null) { + return "no person"; + } + return query; + } } diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java index b0b38011..66b52fee 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/domain/vo/ExternalVo.java @@ -1,8 +1,12 @@ package com.acupuncture.system.domain.vo; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiParam; import lombok.Data; +import java.util.List; + /** * @Author zzc * @Package com.acupuncture.system.domain.dto @@ -12,7 +16,7 @@ import lombok.Data; public class ExternalVo { @Data - public static class Result{ + public static class Result { private String message = "bcaUser"; private String gid; @@ -31,7 +35,7 @@ public class ExternalVo { private String birthYear; -// private String weight; + // private String weight; private String phone; public String getSex() { @@ -47,7 +51,7 @@ public class ExternalVo { @Data @ApiModel("人体成分数据上传") - public static class RtcfInfoVo{ + public static class RtcfInfoVo { private Long id; private String message; @@ -216,7 +220,7 @@ public class ExternalVo { @Data @ApiModel("报告图片") - public static class ReportImagVo{ + public static class ReportImagVo { private Long id; private String patientId; @@ -225,4 +229,782 @@ public class ExternalVo { private String filePath; } + + + /* + 运动功能测评数据 + */ + + @Data + public static class UserInfo { + @ApiModelProperty(value = "标题") + private String Title; + @ApiModelProperty(value = "组别代码(可为空)") + private String GID; + @ApiModelProperty(value = "人员编号") + private String UID; + @ApiModelProperty(value = "姓名") + private String Name; + @ApiModelProperty(value = "性别 (男1,女2)") + private String Sex; + @ApiModelProperty(value = "身高(cm)") + private String Height; + @ApiModelProperty(value = "出生年") + private String BirthYear; + @ApiModelProperty(value = "电话(可为空)") + private String Phone; + } + + /** + * 3.1体质测试类数据的实时传输 + */ + public static class RtcfInfo { + @ApiModelProperty("当前测得体质测试类数据标题") + private String Title; + @ApiModelProperty("单位代码(或科室代码、项目代码)") + private String UUID; + @ApiModelProperty("人员编号") + private String UID; + @ApiModelProperty("测试序号(时间戳)") + private String TestID; + @ApiModelProperty("测试日期") + private String TestDate; + @ApiModelProperty("测试者姓名") + private String Name; + @ApiModelProperty("测试者性别,男1女2") + private String Sex; + @ApiModelProperty("测试者出生年份") + private String BirthYear; + + private List data; + private Advice advice; + + //体测结果数据* + + public String getTitle() { + return Title; + } + + public void setTitle(String title) { + Title = title; + } + + public String getUUID() { + return UUID; + } + + public void setUUID(String UUID) { + this.UUID = UUID; + } + + public String getUID() { + return UID; + } + + public void setUID(String UID) { + this.UID = UID; + } + + public String getTestID() { + return TestID; + } + + public void setTestID(String testID) { + TestID = testID; + } + + public String getTestDate() { + return TestDate; + } + + public void setTestDate(String testDate) { + TestDate = testDate; + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getSex() { + return Sex; + } + + public void setSex(String sex) { + Sex = sex; + } + + public String getBirthYear() { + return BirthYear; + } + + public void setBirthYear(String birthYear) { + BirthYear = birthYear; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public Advice getAdvice() { + return advice; + } + + public void setAdvice(Advice advice) { + this.advice = advice; + } + + public static class Detail { + private String Item; + private String Value; + private String Score; + + public String getItem() { + return Item; + } + + public void setItem(String item) { + Item = item; + } + + public String getValue() { + return Value; + } + + public void setValue(String value) { + Value = value; + } + + public String getScore() { + return Score; + } + + public void setScore(String score) { + Score = score; + } + } + + public static class Advice { + private String SportPrinciple; //运动原则 + private String Aerobic; //有氧运动内容 + private String Strength; //力量运动内容 + private String Flexibility; //柔韧运动内容 + private String FunctionExcercise; //功能性练习内容 + private String Caution; //注意事项 + + public String getSportPrinciple() { + return SportPrinciple; + } + + public void setSportPrinciple(String sportPrinciple) { + SportPrinciple = sportPrinciple; + } + + public String getAerobic() { + return Aerobic; + } + + public void setAerobic(String aerobic) { + Aerobic = aerobic; + } + + public String getStrength() { + return Strength; + } + + public void setStrength(String strength) { + Strength = strength; + } + + public String getFlexibility() { + return Flexibility; + } + + public void setFlexibility(String flexibility) { + Flexibility = flexibility; + } + + public String getFunctionExcercise() { + return FunctionExcercise; + } + + public void setFunctionExcercise(String functionExcercise) { + FunctionExcercise = functionExcercise; + } + + public String getCaution() { + return Caution; + } + + public void setCaution(String caution) { + Caution = caution; + } + } + } + + /* + { +"Title: "CURRENT_BCA_DATA", //标题:BCA_DATA指体成分测试类数据 +"UUID": "TFHT", //单位代码(或科室代码、项目代码) +"UID": "123456", //人员编码 +"TestID": "20230124101235", //测试序号(时间戳) +"TestDate": "2023-01-24", //测试日期 +"Name": "张三", //测试者姓名 +"Sex": "1", //测试者性别,男1女2 +"data": +{ +"Weight" : "72.5", //体重 +"Fat": "23.1", //脂肪 +"Bone": "3.8", //骨质 +"Protein": "18.6", //蛋白质 +"Water": "33.5", //水分 +"Muscle": "40.1", //肌肉 +"SMM": "18.5", //骨骼肌 +"PBF": "22.1", //体脂百分比 +"BMI": "22.4", //体质指数 +"BMR": "1665", //基础代谢 +"Edema: "0.33", //水肿系数(2位小数) +"VFI": "12.0", //内脏脂肪指数 +"BodyAge": "23", //身体年龄 +"Score":"78.0", //健康评分 +"BodyType": "4", //体型判定 +"Standard_weight": "70.5", //目标体重 +"Weight_control": "2.0", //体重控制 +"Fat_control": "1.3", //脂肪控制量 +"Muscle_control": "0.7", //肌肉控制量 +"ASMI": "6.5", //四肢骨骼肌指数 + "WeightMax" : "84.5", //体重正常范围的高值 + "WeightMin" : "69.5", //体重正常范围的低值 + "FatMax" : "22.5", //体重正常范围的高值 + "FatMin" : "13.6", //体重正常范围的低值 + "BoneMax" : "3.7", //骨质正常范围的高值 + "BoneMin" : "3.1", //骨质正常范围的低值 + "ProteinMax" : "22.5", //蛋白质正常范围的高值 + "ProteinMin" : "17.5", //蛋白质正常范围的低值 + "WaterMax" : "43.6", //水分正常范围的高值 + "WaterMin" : "32.5", //水分正常范围的低值 + "MuscleMax" : "54.5", //肌肉正常范围的高值 + "MuscleMin" : "36.5", //肌肉正常范围的低值 + "SMMMax" : "32.5", //骨骼肌正常范围的高值 + "SMMMin" : "24.1", //骨骼肌正常范围的低值 + "PBFMax" : "20.0", //体脂率正常范围的高值 + "PBFMin" : "10.0", //体脂率正常范围的低值 + "BMIMax" : "18.5", //体质指数正常范围的高值 + "BMIMin" : "23.9", //体质指数正常范围的低值 + "WHRMax" : "0.7", //腰臀比正常范围的高值 + "WHRMin" : "0.8", //腰臀比正常范围的低值 + "EdemaMax" : "0.3", //水肿系数正常范围的高值 + "EdemaMin" : "0.35", //水肿系数正常范围的低值 + "VFIMax" : "5.0", //内脏脂肪指数正常范围的高值 + "VFIMin" : "10.0", //内脏脂肪指数正常范围的低值 + "Diagnosis": "身体脂肪偏高,无机盐偏低,水分偏低,蛋白质偏低,骨骼肌含量偏低,身体左右均衡" , //诊断结论(UTF-8编码) +}, +"advice": //每日膳食营养建议 +{ + "PersonType": "普通人", //*人员类型 + "DailyEnergy": "2250", //日能量需求(单位:kcal) + "DietPrinciple": "XXXXX", //膳食原则 + "StandardBreakfast": "XXXX", //示范食谱-早餐(使用\n换行,下同) + "StandardLunch": "XXXX", //示范食谱-午餐 + "StandardDinner": "XXXX", //示范食谱-晚餐 + "StandardNutrition": "XXXX", //示范食谱-营养素 } +} + */ + public static class BcaData { + private String Title; + private String UUID; + private String UID; + private String TestID; + private String TestDate; + private String Name; + private String Sex; + private Data data; + private Advice advice; + + + public static class Data { + private String Weight; //体重 + private String Fat; //脂肪 + private String Bone; //骨质 + private String Protein; //蛋白质 + private String Waterx; //水分 + private String Muscle; //肌肉 + private String SMM; //骨骼肌 + private String PBF; //体脂百分比 + private String BMI; //体质指数 + private String BMR; //基础代谢 + private String Edema; //水肿系数(2位小数) + private String VFI; //内脏脂肪指数 + private String BodyAge; //身体年龄 + private String Score; //健康评分 + private String BodyType; //体型判定 + private String Standard_weight; //目标体重 + private String Weight_control; //体重控制 + private String Fat_control; //脂肪控制量 + private String Muscle_control;//肌肉控制量 + private String ASMI; //四肢骨骼肌指数 + private String WeightMax; //体重正常范围的高值 + private String WeightMin; //体重正常范围的低值 + private String FatMax;//体重正常范围的高值 + private String FatMin; //体重正常范围的低值 + private String BoneMax; //骨质正常范围的高值 + private String BoneMin; //骨质正常范围的低值 + private String ProteinMax; //蛋白质正常范围的高值 + private String ProteinMin; //蛋白质正常范围的低值 + private String WaterMax;//水分正常范围的高值 + private String WaterMin; //水分正常范围的低值 + private String MuscleMax; //肌肉正常范围的高值 + private String MuscleMin; //肌肉正常范围的低值 + private String SMMMax;//骨骼肌正常范围的高值 + private String SMMMin;//骨骼肌正常范围的低值 + private String PBFMax; //体脂率正常范围的高值 + private String PBFMin; //体脂率正常范围的低值 + private String BMIMax; //体质指数正常范围的高值 + private String BMIMin; //体质指数正常范围的低值 + private String WHRMax;//腰臀比正常范围的高值 + private String WHRMin;//腰臀比正常范围的低值 + private String EdemaMax; //水肿系数正常范围的高值 + private String EdemaMin; //水肿系数正常范围的低值 + private String VFIMax; //内脏脂肪指数正常范围的高值 + private String VFIMin; //内脏脂肪指数正常范围的低值 + private String Diagnosis; //诊断结论(UTF-8编码) + + public String getWeight() { + return Weight; + } + + public void setWeight(String weight) { + Weight = weight; + } + + public String getFat() { + return Fat; + } + + public void setFat(String fat) { + Fat = fat; + } + + public String getBone() { + return Bone; + } + + public void setBone(String bone) { + Bone = bone; + } + + public String getProtein() { + return Protein; + } + + public void setProtein(String protein) { + Protein = protein; + } + + public String getWaterx() { + return Waterx; + } + + public void setWaterx(String waterx) { + Waterx = waterx; + } + + public String getMuscle() { + return Muscle; + } + + public void setMuscle(String muscle) { + Muscle = muscle; + } + + public String getSMM() { + return SMM; + } + + public void setSMM(String SMM) { + this.SMM = SMM; + } + + public String getPBF() { + return PBF; + } + + public void setPBF(String PBF) { + this.PBF = PBF; + } + + public String getBMI() { + return BMI; + } + + public void setBMI(String BMI) { + this.BMI = BMI; + } + + public String getBMR() { + return BMR; + } + + public void setBMR(String BMR) { + this.BMR = BMR; + } + + public String getEdema() { + return Edema; + } + + public void setEdema(String edema) { + Edema = edema; + } + + public String getVFI() { + return VFI; + } + + public void setVFI(String VFI) { + this.VFI = VFI; + } + + public String getBodyAge() { + return BodyAge; + } + + public void setBodyAge(String bodyAge) { + BodyAge = bodyAge; + } + + public String getScore() { + return Score; + } + + public void setScore(String score) { + Score = score; + } + + public String getBodyType() { + return BodyType; + } + + public void setBodyType(String bodyType) { + BodyType = bodyType; + } + + public String getStandard_weight() { + return Standard_weight; + } + + public void setStandard_weight(String standard_weight) { + Standard_weight = standard_weight; + } + + public String getWeight_control() { + return Weight_control; + } + + public void setWeight_control(String weight_control) { + Weight_control = weight_control; + } + + public String getFat_control() { + return Fat_control; + } + + public void setFat_control(String fat_control) { + Fat_control = fat_control; + } + + public String getMuscle_control() { + return Muscle_control; + } + + public void setMuscle_control(String muscle_control) { + Muscle_control = muscle_control; + } + + public String getASMI() { + return ASMI; + } + + public void setASMI(String ASMI) { + this.ASMI = ASMI; + } + + public String getWeightMax() { + return WeightMax; + } + + public void setWeightMax(String weightMax) { + WeightMax = weightMax; + } + + public String getWeightMin() { + return WeightMin; + } + + public void setWeightMin(String weightMin) { + WeightMin = weightMin; + } + + public String getFatMax() { + return FatMax; + } + + public void setFatMax(String fatMax) { + FatMax = fatMax; + } + + public String getFatMin() { + return FatMin; + } + + public void setFatMin(String fatMin) { + FatMin = fatMin; + } + + public String getBoneMax() { + return BoneMax; + } + + public void setBoneMax(String boneMax) { + BoneMax = boneMax; + } + + public String getBoneMin() { + return BoneMin; + } + + public void setBoneMin(String boneMin) { + BoneMin = boneMin; + } + + public String getProteinMax() { + return ProteinMax; + } + + public void setProteinMax(String proteinMax) { + ProteinMax = proteinMax; + } + + public String getProteinMin() { + return ProteinMin; + } + + public void setProteinMin(String proteinMin) { + ProteinMin = proteinMin; + } + + public String getWaterMax() { + return WaterMax; + } + + public void setWaterMax(String waterMax) { + WaterMax = waterMax; + } + + public String getWaterMin() { + return WaterMin; + } + + public void setWaterMin(String waterMin) { + WaterMin = waterMin; + } + + public String getMuscleMax() { + return MuscleMax; + } + + public void setMuscleMax(String muscleMax) { + MuscleMax = muscleMax; + } + + public String getMuscleMin() { + return MuscleMin; + } + + public void setMuscleMin(String muscleMin) { + MuscleMin = muscleMin; + } + + public String getSMMMax() { + return SMMMax; + } + + public void setSMMMax(String SMMMax) { + this.SMMMax = SMMMax; + } + + public String getSMMMin() { + return SMMMin; + } + + public void setSMMMin(String SMMMin) { + this.SMMMin = SMMMin; + } + + public String getPBFMax() { + return PBFMax; + } + + public void setPBFMax(String PBFMax) { + this.PBFMax = PBFMax; + } + + public String getPBFMin() { + return PBFMin; + } + + public void setPBFMin(String PBFMin) { + this.PBFMin = PBFMin; + } + + public String getBMIMax() { + return BMIMax; + } + + public void setBMIMax(String BMIMax) { + this.BMIMax = BMIMax; + } + + public String getBMIMin() { + return BMIMin; + } + + public void setBMIMin(String BMIMin) { + this.BMIMin = BMIMin; + } + + public String getWHRMax() { + return WHRMax; + } + + public void setWHRMax(String WHRMax) { + this.WHRMax = WHRMax; + } + + public String getWHRMin() { + return WHRMin; + } + + public void setWHRMin(String WHRMin) { + this.WHRMin = WHRMin; + } + + public String getEdemaMax() { + return EdemaMax; + } + + public void setEdemaMax(String edemaMax) { + EdemaMax = edemaMax; + } + + public String getEdemaMin() { + return EdemaMin; + } + + public void setEdemaMin(String edemaMin) { + EdemaMin = edemaMin; + } + + public String getVFIMax() { + return VFIMax; + } + + public void setVFIMax(String VFIMax) { + this.VFIMax = VFIMax; + } + + public String getVFIMin() { + return VFIMin; + } + + public void setVFIMin(String VFIMin) { + this.VFIMin = VFIMin; + } + + public String getDiagnosis() { + return Diagnosis; + } + + public void setDiagnosis(String diagnosis) { + Diagnosis = diagnosis; + } + } + + + public static class Advice { + private String PersonType; //*人员类型 + private String DailyEnergy; //日能量需求(单位:kcal) + private String DietPrinciple; //膳食原则 + private String StandardBreakfast; //示范食谱-早餐(使用\n换行,下同) + private String StandardLunch; //示范食谱-午餐 + private String StandardDinner; //示范食谱-晚餐 + private String StandardNutrition; //示范食谱-营养素 + + public String getPersonType() { + return PersonType; + } + + public void setPersonType(String personType) { + PersonType = personType; + } + + public String getDailyEnergy() { + return DailyEnergy; + } + + public void setDailyEnergy(String dailyEnergy) { + DailyEnergy = dailyEnergy; + } + + public String getDietPrinciple() { + return DietPrinciple; + } + + public void setDietPrinciple(String dietPrinciple) { + DietPrinciple = dietPrinciple; + } + + public String getStandardBreakfast() { + return StandardBreakfast; + } + + public void setStandardBreakfast(String standardBreakfast) { + StandardBreakfast = standardBreakfast; + } + + public String getStandardLunch() { + return StandardLunch; + } + + public void setStandardLunch(String standardLunch) { + StandardLunch = standardLunch; + } + + public String getStandardDinner() { + return StandardDinner; + } + + public void setStandardDinner(String standardDinner) { + StandardDinner = standardDinner; + } + + public String getStandardNutrition() { + return StandardNutrition; + } + + public void setStandardNutrition(String standardNutrition) { + StandardNutrition = standardNutrition; + } + } + } + + +} \ No newline at end of file diff --git a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java index 6fc267f9..2ec6ff97 100644 --- a/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java +++ b/acupuncture-system/src/main/java/com/acupuncture/system/service/impl/PmsTreatmentServiceImpl.java @@ -6,9 +6,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.IoUtil; import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.IdcardUtil; -import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.*; import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.poi.excel.BigExcelWriter; import cn.hutool.poi.excel.ExcelUtil; @@ -42,6 +40,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; +import java.math.BigDecimal; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; @@ -83,7 +82,8 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService { private String profilePath; @Value("${acupuncture.profileUrl}") private String profileUrl; - + //诊疗档案编码默认生成规则 + private static final String MEMBER_ID_PREFIX = "UID"; @Override public void addTreatment(PmsTreatmentDto.TreatmentAdd dto) { @@ -150,22 +150,39 @@ public class PmsTreatmentServiceImpl implements PmsTreatmentService { } } + /** + * 用户编号递增,保证所有库中用户编号唯一 + * 将每天生成的用户编号存到redis + * 如有则+1,放入缓存 + * 没有则创建第一条,放入缓存 + * @return + */ @Override @Synchronized public Long getMemberId() { //编码生成规则: 年+月+日+每天该租户的最大编码+1 //生成最小的编码 Date now = new Date(); - String date = DateUtil.format(now, "yyMMdd") + "0000"; - Long minMemberId = Long.parseLong(date); - PmsTreatmentExample pmsTreatmentExample = new PmsTreatmentExample(); - pmsTreatmentExample.createCriteria().andDelFlagEqualTo((byte) 0).andTenantIdEqualTo(SecurityUtils.getTenantId()).andMemberIdGreaterThan(minMemberId); - pmsTreatmentExample.setOrderByClause("create_time desc"); - List pmsTreatments = treatmentMapper.selectByExample(pmsTreatmentExample); - if (CollectionUtil.isEmpty(pmsTreatments)) { - return minMemberId + 1; + String date = DateUtil.format(now, "yyMMdd"); + Long minMemberId = Long.parseLong(date + "0000"); + + Object o = redisCache.get(MEMBER_ID_PREFIX + "_" + date); + if (ObjectUtil.isEmpty(o)) { + redisCache.set(MEMBER_ID_PREFIX + "_" + date, minMemberId + 1); + return minMemberId; + }else { + long l = NumberUtil.add(o.toString(), "1").longValue(); + redisCache.set(MEMBER_ID_PREFIX + "_" + date, l); + return l; } - return pmsTreatments.get(0).getMemberId() + 1; +// PmsTreatmentExample pmsTreatmentExample = new PmsTreatmentExample(); +// pmsTreatmentExample.createCriteria().andDelFlagEqualTo((byte) 0).andTenantIdEqualTo(SecurityUtils.getTenantId()).andMemberIdGreaterThan(minMemberId); +// pmsTreatmentExample.setOrderByClause("create_time desc"); +// List pmsTreatments = treatmentMapper.selectByExample(pmsTreatmentExample); +// if (CollectionUtil.isEmpty(pmsTreatments)) { +// return minMemberId + 1; +// } +// return pmsTreatments.get(0).getMemberId() + 1; } @Override diff --git a/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml b/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml index 84f1c1f4..ffd907e4 100644 --- a/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml +++ b/acupuncture-system/src/main/resources/mapper/dao/PmsPatientDao.xml @@ -62,7 +62,7 @@ group by p.id - order by p.create_time desc + order by p.update_time desc + + + + insert into + fit_test_main + ( + TestID, + Title, + UUID, + UID, + TestDate, + Name, + Sex, + BirthYear + ) + values + ( + #{rtcfInfoDto.TestID}, + #{rtcfInfoDto.title}, + #{rtcfInfoDto.UUID}, + #{rtcfInfoDto.UID}, + #{rtcfInfoDto.testDate}, + #{rtcfInfoDto.Name}, + #{rtcfInfoDto.Sex}, + #{rtcfInfoDto.BirthYear} + ) + + + + + + INSERT INTO fit_test_data (TestID, ItemCode, TestValue, Score) + VALUES + + (#{item.TestID}, #{item.Item}, #{item.Value}, #{item.Score}) + + + + + insert into + fit_test_advice + ( + TestID, + SportPrinciple, + Aerobic, + Strength, + Flexibility, + FunctionExcercise, + Caution + ) + values + ( + #{dto.TestID}, + #{dto.SportPrinciple}, + #{dto.Aerobic}, + #{dto.Strength}, + #{dto.Flexibility}, + #{dto.FunctionExcercise}, + #{dto.Caution} + ) + + + + insert into fit_test_records + ( + TestID, + UUID, + UID, + TestDate, + Name, + Sex, + Weight, + Fat, + Bone, + Protein, + Water, + Muscle, + SMM, + PBF, + BMI, + BMR, + Edema, + VFI, + BodyAge, + Score, + BodyType, + Standard_weight, + Weight_control, + Fat_control, + Muscle_control, + ASMI, + WeightMax, + WeightMin, + FatMax, + FatMin, + BoneMax, + BoneMin, + ProteinMax, + ProteinMin, + WaterMax, + WaterMin, + MuscleMax, + MuscleMin, + SMMMax, + SMMMin, + PBFMax, + PBFMin, + BMIMax, + BMIMin, + WHRMax, + WHRMin, + EdemaMax, + EdemaMin, + VFIMax, + VFIMin, + Diagnosis) + values ( + #{dto.TestID}, + #{dto.UUID}, + #{dto.UID}, + #{dto.TestDate}, + #{dto.Name}, + #{dto.Sex}, + #{dto.Weight}, + #{dto.Fat}, + #{dto.Bone}, + #{dto.Protein}, + #{dto.Water}, + #{dto.Muscle}, + #{dto.SMM}, + #{dto.PBF}, + #{dto.BMI}, + #{dto.BMR}, + #{dto.Edema}, + #{dto.VFI}, + #{dto.BodyAge}, + #{dto.Score}, + #{dto.BodyType}, + #{dto.Standard_weight}, + #{dto.Weight_control}, + #{dto.Fat_control}, + #{dto.Muscle_control}, + #{dto.ASMI}, + #{dto.WeightMax}, + #{dto.WeightMin}, + #{dto.FatMax}, + #{dto.FatMin}, + #{dto.BoneMax}, + #{dto.BoneMin}, + #{dto.ProteinMax}, + #{dto.ProteinMin}, + #{dto.WaterMax}, + #{dto.WaterMin}, + #{dto.MuscleMax}, + #{dto.MuscleMin}, + #{dto.SMMMax}, + #{dto.SMMMin}, + #{dto.PBFMax}, + #{dto.PBFMin}, + #{dto.BMIMax}, + #{dto.BMIMin}, + #{dto.WHRMax}, + #{dto.WHRMin}, + #{dto.EdemaMax}, + #{dto.EdemaMin}, + #{dto.VFIMax}, + #{dto.VFIMin}, + #{dto.Diagnosis} + ) + + + + insert into + fit_test_main + ( + TestID, + Title, + UUID, + UID, + TestDate, + Name, + Sex + ) + values + ( + #{dto.TestID}, + #{dto.title}, + #{dto.UUID}, + #{dto.UID}, + #{dto.testDate}, + #{dto.Name}, + #{dto.Sex} + ) + + + + insert into fit_bca_advice(TestID, + PersonType, + DailyEnergy, + DietPrinciple, + StandardBreakfast, + StandardLunch, + StandardDinner, + StandardNutrition) + values ( #{dto.TestID}, + #{dto.PersonType}, + #{dto.DailyEnergy}, + #{dto.DietPrinciple}, + #{dto.StandardBreakfast}, + #{dto.StandardLunch}, + #{dto.StandardDinner}, + #{dto.StandardNutrition}) + + + + delete from fit_test_main where UID = #{uId} and Title = #{Title} + + + + delete from fit_test_advice where TestID = #{TestID} + + + + delete from fit_test_data where TestID = #{TestID} + + + + delete from fit_test_records where TestID = #{TestID} + + + + delete from fit_bca_advice where TestID = #{TestID} + + + + + + + + + + + + + +