Browse Source

#曲线分析

zhongwei
yang_shj 3 months ago
parent
commit
8ff12798f4
  1. 5
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/history/vo/HistoryTabulationParamVo.java
  2. 9
      hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/HistoryTemplateController.java
  3. 11
      hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java
  4. 104
      hzims-service/safeproduct/src/main/resources/db/3.0.1.sql

5
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/history/vo/HistoryTabulationParamVo.java

@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* @author ysj
@ -21,8 +22,8 @@ public class HistoryTabulationParamVo {
@ApiModelProperty(value = "站点Id")
private String projectId;
@ApiModelProperty(value = "站点Id")
private List<String> facDeivceAttrIds;
@ApiModelProperty(value = "查询点位")
private Map<String,String> attrs;
@ApiModelProperty(value = "开始时间")
@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)

9
hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/HistoryTemplateController.java

@ -9,11 +9,13 @@ import com.hnac.hzims.safeproduct.train.entity.InstitutionalEntity;
import com.hnac.hzims.safeproduct.train.vo.InstitutionalParamVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
/**
@ -34,6 +36,13 @@ public class HistoryTemplateController extends BladeController {
return R.status(service.save(entity));
}
@PostMapping("/remove")
@ApiOperationSupport(order = 10)
@ApiOperation(value = "删除历史数据模板")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(service.removeByIds(Func.toLongList(ids)));
}
@GetMapping("/pages")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "分页历史数据模板", notes = "查询条件:params、query")

11
hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java

@ -272,7 +272,7 @@ public class HistoryDeviceServiceImpl implements IHistoryDeviceService {
public List<Map<String, Object>> historyTabulation(HistoryTabulationParamVo param) {
HisFacSourceDataDTO source = new HisFacSourceDataDTO();
source.setProjectId(param.getProjectId());
source.setFacDeivceAttrIds(param.getFacDeivceAttrIds());
source.setFacDeivceAttrIds(new ArrayList<>(param.getAttrs().keySet()));
source.setBeginTime(param.getStartTime());
source.setFinishTime(param.getEndTime());
source.setIsPage(true);
@ -282,7 +282,14 @@ public class HistoryDeviceServiceImpl implements IHistoryDeviceService {
if(!tabulations.isSuccess() || CollectionUtil.isEmpty(tabulations.getData())){
return new ArrayList<>();
}
return tabulations.getData();
return tabulations.getData().stream().map(tabulation->{
Map<String,Object> map = JSONObject.parseObject(JSONObject.toJSONString(tabulation.get("attr")),Map.class);
String key = map.get("id").toString();
String name = param.getAttrs().get(key);
map.put("name",name);
tabulation.put("attr",map);
return tabulation;
}).collect(Collectors.toList());
}

104
hzims-service/safeproduct/src/main/resources/db/3.0.1.sql

@ -0,0 +1,104 @@
CREATE TABLE `hzims_institutional_information` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`STATION_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '站点编码',
`STATION_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`DATA_TYPE` tinyint(4) NULL DEFAULT NULL COMMENT '资料类型 : 0-制度 1-资料',
`FILE_PURVIEW` tinyint(4) NULL DEFAULT NULL COMMENT '文档权限范围 : 0-厂站 1- 完全公开',
`FILE_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文档名称',
`FILE_EXPLAIN` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件说明',
`DATA_ATTACHMENT_PATH` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件上传地址',
`DATA_ATTACHMENT_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID',
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`CREATE_USER_ID` bigint(20) NULL DEFAULT NULL COMMENT '添加人ID',
`CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名称',
`UPDATE_USER` bigint(20) NOT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_rectification_supervision` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`STATION_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '站点编码',
`STATION_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`PERSON_LIABLE` bigint(20) NULL DEFAULT NULL COMMENT '责任人ID',
`PERSON_LIABLE_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '责任人名称',
`RECTIFICATION_TYPE` tinyint(4) NULL DEFAULT NULL COMMENT '整改类型: 0-整改闭环 1-会议督办',
`LIMIT_TIME` datetime NULL DEFAULT NULL COMMENT '限时日期',
`REMIND_TIME` datetime NULL DEFAULT NULL COMMENT '提醒日期',
`COMPLETE_TIME` datetime NULL DEFAULT NULL COMMENT '完成日期',
`PROBLEM_MATTERS` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题事项',
`MEASURES` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '措施',
`PROBLEM_ATTACHMENT_PATH` varchar(516) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题附件路径',
`PROBLEM_ATTACHMENT_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题附件名称',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID',
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '添加人名称',
`CREATE_USER_ID` bigint(20) NULL DEFAULT NULL COMMENT '添加人ID',
`UPDATE_USER` bigint(20) NOT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态: 0-未整改 1-已整改',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_safety_train` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`STATION_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '站点编码',
`STATION_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`SPEAKER` bigint(20) NULL DEFAULT NULL COMMENT '主讲人ID',
`SPEAKER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主讲人名称',
`TRAIN_CONTENT` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '培训内容',
`ANSWER_COUNT` tinyint(4) NULL DEFAULT NULL COMMENT '应到人数',
`ACTUAL_COUNT` tinyint(4) NULL DEFAULT NULL COMMENT '实到人数',
`LATE_REASON` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '迟到/缺席人数及原因',
`TRAIN_ATTACHMENT_PATH` varchar(516) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '培训附件上次路径',
`TRAIN_ATTACHMENT_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '培训附件名称',
`TRAIN_START_TIME` datetime NULL DEFAULT NULL COMMENT '培训开始时间',
`TRAIN_END_TIME` datetime NULL DEFAULT NULL COMMENT '培训结束时间',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID',
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`CREATE_USER_ID` bigint(20) NULL DEFAULT NULL COMMENT '添加人ID',
`CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名称',
`UPDATE_USER` bigint(20) NOT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE `hzims_violation_assessment` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`STATION_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '站点编码',
`STATION_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
`DISCOVERER` bigint(20) NULL DEFAULT NULL COMMENT '发现人ID',
`DISCOVERER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发现人名称',
`ASSESSOR_COVER` bigint(20) NULL DEFAULT NULL COMMENT '被考核人ID',
`ASSESSOR_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '被考核人名称',
`DISCOVER_TIME` datetime NULL DEFAULT NULL COMMENT '发现时间',
`PROBLEM_MATTERS` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题事项',
`VIOLATION_LEVEL` tinyint(4) NULL DEFAULT NULL COMMENT '违规级别 : 0-严重 1-一般',
`PROCESSING_RESULTS` varchar(516) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '处理结果',
`NOTICE_ATTACHMENT_PATH` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '通知单附件地址',
`NOTICE_ATTACHMENT_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '通知单附件名称',
`TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '租户ID',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门ID',
`CREATE_TIME` datetime NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_TIME` datetime NULL DEFAULT NULL COMMENT '更新时间',
`CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
`CREATE_USER_ID` bigint(20) NULL DEFAULT NULL COMMENT '添加人ID',
`CREATE_USER_NAME` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人名称',
`UPDATE_USER` bigint(20) NOT NULL COMMENT '更新人',
`IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
Loading…
Cancel
Save