From dc8e301495d8da39f72cf41e3e05857ed9ba60e7 Mon Sep 17 00:00:00 2001 From: liwen Date: Thu, 23 May 2024 14:58:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update:=20=E8=80=83=E8=AF=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=8F=8A=E6=A0=BC=E5=88=86=E8=AE=BE=E7=BD=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzims/safeproduct/entity/TestEntity.java | 10 +++++----- .../hzims/safeproduct/service/impl/TestScoreServiceImpl.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java index 0235e18..27ae3d7 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java @@ -60,11 +60,11 @@ public class TestEntity extends BaseEntity { @ApiModelProperty("考试结束时间") private Date testEndTime; -// @NotNull -// @Min(value = 0, message = "及格分必须大于等于0") -// @Max(value = 100, message = "及格分必须小于等于100") -// @ApiModelProperty("及格分") -// private Integer passingScore; + @NotNull + @Min(value = 0, message = "及格分必须大于等于0") + @Max(value = 100, message = "及格分必须小于等于100") + @ApiModelProperty("及格分") + private Integer passingScore; @NotNull @Size(max = 255, message = "考试地点字段长度不能超过255") diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java index a075bb2..597e48e 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java @@ -126,7 +126,7 @@ public class TestScoreServiceImpl extends ServiceImpl s.getScore() != null).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(list)) { testScoreSumVO.setActualPeopleNum(list.size()); - List passCollect = list.stream().filter(s -> s.getScore() > 60).collect(Collectors.toList()); + List passCollect = list.stream().filter(s -> s.getScore() > testScoreSumVO.getPassingScore()).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(list)&&CollectionUtils.isNotEmpty(passCollect)) { double result = BigDecimal.valueOf(passCollect.size()).divide(BigDecimal.valueOf(list.size()),2, RoundingMode.UP).doubleValue(); testScoreSumVO.setPercentage(result); From 3e3fac67aec56f48d3ad591cbefa3057fad9e858 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 24 May 2024 11:59:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=9F=A5=E8=AF=A2=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InteractiveController.java | 4 ++-- .../service/impl/ExtraResolveStrategyService.java | 17 +++++++++++++---- .../hnac/hzims/bigmodel/interactive/vo/DataVO.java | 3 +-- .../hzims/bigmodel/interactive/vo/RealDataVO.java | 20 ++++++++++++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/RealDataVO.java diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java index a80b2aa..40e79b3 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java @@ -74,7 +74,7 @@ public class InteractiveController { @ApiOperation("下发遥控指令") @ApiOperationSupport(order = 6) @PostMapping("/sendRemoteControl") - public R sendRemoteControl(@RequestBody ControlDTO operate) { - return R.data(interactiveService.sendRemoteControl(operate)); + public R sendRemoteControl(@RequestBody ControlDTO operate) { + return interactiveService.sendRemoteControl(operate); } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java index bcda8cb..9502fec 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java @@ -18,16 +18,15 @@ import com.xxl.job.core.log.XxlJobLogger; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.dto.ControlDTO; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.time.format.DateTimeFormatter; +import java.util.*; import java.util.stream.Collectors; /** @@ -38,6 +37,10 @@ import java.util.stream.Collectors; @AllArgsConstructor public class ExtraResolveStrategyService { + public static final String PATTERN_DATETIME = "yyyy-MM-dd HH:mm:ss.SSS"; + + public static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(PATTERN_DATETIME); + private final IStationClient stationClient; private final IStationVideoTypeClient videoTypeClient; private final JumpRouteJoinStrategy jumpRouteJoinStrategy; @@ -85,6 +88,11 @@ public class ExtraResolveStrategyService { result.setType(FuncRouteEnum.SHOW_PARAM.getType().getType()); Map param = new HashMap(1); DataVO data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")),DataVO.class); + if(Func.isNotEmpty(data) && Func.isNotEmpty(data.getReal()) && Func.isNotEmpty(data.getReal().getTime()) && StringUtil.isNotBlank(data.getReal().getTime())) { + RealDataVO real = data.getReal(); + Date date = DateUtil.parse(real.getTime(), PATTERN_DATETIME); + real.setTime(DateUtil.format(date,DateUtil.PATTERN_DATETIME)); + } param.put("data", data); result.setParams(param); return result; @@ -101,6 +109,7 @@ public class ExtraResolveStrategyService { param.put("control",funcVOR.getData()); param.put("deviceName",remoteParam.getDeviceName()); param.put("projectName",remoteParam.getProjectName()); + param.put("deviceCode",remoteParam.getDeviceId()); param.put("value",remoteParam.getValue()); result.setParams(param); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java index d3ea096..1f2fcfd 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.annotation.JSONField; import lombok.Data; import java.io.Serializable; -import java.util.Map; /** * @Author: huangxing @@ -26,7 +25,7 @@ public class DataVO implements Serializable { private String method; /**实时数据结果集**/ - private Map real; + private RealDataVO real; private DataItemVO item; diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/RealDataVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/RealDataVO.java new file mode 100644 index 0000000..16a5a46 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/RealDataVO.java @@ -0,0 +1,20 @@ +package com.hnac.hzims.bigmodel.interactive.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springblade.core.tool.utils.DateUtil; + +import java.io.Serializable; + +/** + * @Author: huangxing + * @Date: 2024/05/24 10:26 + */ +@Data +public class RealDataVO implements Serializable { + + private String time; + + private String value; + +} From 8252fcf39a2937171ade496d88db66597ce29a8e Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 24 May 2024 12:01:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?add:=E5=AE=89=E5=85=A8=E5=B7=A5=E5=99=A8?= =?UTF-8?q?=E5=85=B7=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/template/SafeToolTemplate.html | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 hzims-service/safeproduct/src/main/resources/template/SafeToolTemplate.html diff --git a/hzims-service/safeproduct/src/main/resources/template/SafeToolTemplate.html b/hzims-service/safeproduct/src/main/resources/template/SafeToolTemplate.html new file mode 100644 index 0000000..8e377ea --- /dev/null +++ b/hzims-service/safeproduct/src/main/resources/template/SafeToolTemplate.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + +
工器具名称${data_1}
创建日期${data_2}
+ +
+ +