Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 8 months ago
parent
commit
216913c25a
  1. 10
      hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/entity/TestEntity.java
  2. 4
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java
  3. 17
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java
  4. 3
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java
  5. 20
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/RealDataVO.java
  6. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java
  7. 37
      hzims-service/safeproduct/src/main/resources/template/SafeToolTemplate.html

10
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")

4
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<Object> sendRemoteControl(@RequestBody ControlDTO operate) {
return R.data(interactiveService.sendRemoteControl(operate));
public R sendRemoteControl(@RequestBody ControlDTO operate) {
return interactiveService.sendRemoteControl(operate);
}
}

17
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<String,Object> 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);
}

3
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<String,Object> real;
private RealDataVO real;
private DataItemVO item;

20
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;
}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TestScoreServiceImpl.java

@ -126,7 +126,7 @@ public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScore
public TestScoreSumVO testScoreSum(Long testId, String name) {
TestScoreSumVO testScoreSumVO = new TestScoreSumVO();
TestEntity testEntity = testMapper.selectById(testId);
// testScoreSumVO.setPassingScore(testEntity.getPassingScore());
testScoreSumVO.setPassingScore(testEntity.getPassingScore());
String peopleName = testEntity.getPeopleName();
if (StringUtils.isNotBlank(peopleName)) {
String[] split = peopleName.split(",");
@ -138,7 +138,7 @@ public class TestScoreServiceImpl extends ServiceImpl<TestScoreMapper, TestScore
list= list.stream().filter(s -> s.getScore() != null).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(list)) {
testScoreSumVO.setActualPeopleNum(list.size());
List<TestScoreEntity> passCollect = list.stream().filter(s -> s.getScore() > 60).collect(Collectors.toList());
List<TestScoreEntity> 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);

37
hzims-service/safeproduct/src/main/resources/template/SafeToolTemplate.html

@ -0,0 +1,37 @@
<html>
<head>
<style>
table {
border-collapse: collapse;
border: 2px solid #333;
}
table td {
border-collapse: collapse;
border: 1px solid #333;
padding: 5px;
font-size: 14px;
font-weight: bold;
text-align: center;
font-family: SimSun;
}
</style>
</head>
<body>
<table>
<tr>
<td width="100">工器具名称</td>
<td width="200">${data_1}</td>
</tr>
<tr>
<td>创建日期</td>
<td>${data_2}</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<img src="${data_3}" width="250"/>
</td>
</tr>
</table>
</body>
</html>
Loading…
Cancel
Save