Browse Source

修改身高体重对接

new
ccsens_zhengzhichuan 6 days ago
parent
commit
1fb8b12961
  1. 4
      acupuncture-admin/src/main/resources/application-dev.yml
  2. 2
      acupuncture-admin/src/main/resources/application.yml
  3. 16
      acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java

4
acupuncture-admin/src/main/resources/application-dev.yml

@ -13,7 +13,7 @@ spring:
slave:
# 从数据源开关/默认关闭
enabled: true
url: jdbc:mysql://localhost:3306/acupuncture_yfyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://localhost:3306/acupuncture_prod_yy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: q7510327
# 初始连接数
@ -67,3 +67,5 @@ file:
screenQrCodeTemplate: /home/acupuncture/server/profile/screenQrCodeTemplate.docx
hbTemplate: /home/acupuncture/server/profile/screenHbQrCodeTemplate.docx
screenPath: http://test.tall.wiki/acupuncture/web-admin/screening/H5?hospitalId=hosId&hospitalName=hosName&centerId=cId
pgTemplate: /home/acupuncture/server/profile/TreamtmentPgTemplate.docx
jmrsUrl: /home/acupuncture/server/profile/uploads/jmrsTemplate.docx

2
acupuncture-admin/src/main/resources/application.yml

@ -58,7 +58,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: stage
active: dev
# 文件上传
servlet:
multipart:

16
acupuncture-system/src/main/java/com/acupuncture/system/service/impl/ExternalServiceImpl.java

@ -251,8 +251,16 @@ public class ExternalServiceImpl implements ExternalService {
// String wValue = matcher.group(1); // 提取 W 的数值部分
// String hValue = matcher.group(2); // 提取 H 的数值部分
// 提取ID部分(去掉开头的"RD")
String testId = input.substring(2, input.indexOf("W:"));
HmsWeightHeight hmsWeightHeight = new HmsWeightHeight();
try {
String testId = input.substring(2, input.indexOf("W:"));
hmsWeightHeight.setTestId(testId);
System.out.println("id: " + testId);
}catch (Exception e) {
hmsWeightHeight.setTestId("");
System.out.println("未找到testId");
}
// 提取体重和身高
String width = input.substring(input.indexOf("W:") + 2, input.indexOf(" H:"));
String height = input.substring(input.indexOf("H:") + 2);
@ -261,17 +269,17 @@ public class ExternalServiceImpl implements ExternalService {
// double width = Double.parseDouble(wValue);
// double height = Double.parseDouble(hValue);
HmsWeightHeight hmsWeightHeight = new HmsWeightHeight();
hmsWeightHeight.setHeight(new BigDecimal(height).toString());
hmsWeightHeight.setWeight(new BigDecimal(width) + "");
hmsWeightHeight.setId(IdUtil.getSnowflakeNextId());
hmsWeightHeight.setTestId(testId);
hmsWeightHeightMapper.insertSelective(hmsWeightHeight);
// 输出结果(或按需处理)
System.out.println("W: " + width); // 输出: W: 66.5
System.out.println("H: " + height); // 输出: H: 173.5
System.out.println("id: " + testId);
// } else {
// System.out.println("未找到有效的 W 或 H 值");
// }

Loading…
Cancel
Save