Compare commits
24 Commits
d752188d01
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| de48dec1b4 | |||
| 8610b76a1d | |||
| 80032fa758 | |||
| a128bf7905 | |||
| 12b2cc7e20 | |||
| bcb33f3033 | |||
| 14aa9bf13c | |||
| 0c94099e5a | |||
| c50f63df73 | |||
| 8f522973c7 | |||
| ca4516dd03 | |||
| ef0836d098 | |||
| ef89acbc39 | |||
| 806e438c8c | |||
| 010c96a06d | |||
| a373fdb371 | |||
| f32176a31d | |||
| c5a31075b8 | |||
| 5db2617028 | |||
| 0f7d83e3f8 | |||
| 0580893798 | |||
| c426294c7a | |||
| 53f8ccbadd | |||
| d48028a3b4 |
@@ -16,6 +16,15 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.xingshuangs</groupId>
|
||||
<artifactId>iot-communication</artifactId>
|
||||
<version>1.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
@@ -42,10 +51,7 @@
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- 加密解密工具 opc-->
|
||||
<!-- <dependency>-->
|
||||
@@ -108,12 +114,13 @@
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- OPC UA 集成 -->
|
||||
<!-- OPC UA 集成(读取仍使用) -->
|
||||
<dependency>
|
||||
<groupId>com.kangaroohy</groupId>
|
||||
<artifactId>milo-spring-boot-starter</artifactId>
|
||||
<version>3.1.4.0.6.15</version>
|
||||
</dependency>
|
||||
<!-- iot-communication(写入改造使用) -->
|
||||
|
||||
|
||||
<!-- <dependency>-->
|
||||
@@ -124,4 +131,4 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -5,9 +5,10 @@ import com.fizz.business.constants.enums.OpcMessageType;
|
||||
import com.fizz.business.domain.msg.*;
|
||||
import com.fizz.business.scheduled.BaseSchedule;
|
||||
import com.fizz.business.service.hanle.OpcReceiverHandler;
|
||||
import com.fizz.business.service.ProStoppageService;
|
||||
import com.fizz.business.domain.ProStoppage;
|
||||
import com.kangaroohy.milo.model.ReadWriteEntity;
|
||||
import com.kangaroohy.milo.service.MiloService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -17,6 +18,9 @@ import org.springframework.stereotype.Component;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -25,7 +29,6 @@ import static com.fizz.business.service.manager.OpcMessageIdsManager.*;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
@ConditionalOnProperty(prefix = "kangaroohy.milo", name = "enabled", havingValue = "true")
|
||||
public class MessageReceiveSchedule extends BaseSchedule {
|
||||
|
||||
@@ -34,6 +37,22 @@ public class MessageReceiveSchedule extends BaseSchedule {
|
||||
|
||||
@Resource
|
||||
private OpcReceiverHandler opcReceiverHandler;
|
||||
|
||||
@Resource
|
||||
private ProStoppageService proStoppageService;
|
||||
|
||||
/**
|
||||
* 低速监控状态
|
||||
*/
|
||||
private LocalDateTime lowSpeedStartTime;
|
||||
private boolean stopRecorded = false;
|
||||
private Long currentStopId;
|
||||
|
||||
/**
|
||||
* 恢复监控状态
|
||||
*/
|
||||
private LocalDateTime highSpeedStartTime;
|
||||
|
||||
@Scheduled(fixedDelay = 1000)
|
||||
public void L1L2LineMeasure() {
|
||||
try {
|
||||
@@ -55,6 +74,9 @@ public class MessageReceiveSchedule extends BaseSchedule {
|
||||
msg.setAppMeasureCoatMessage(coat);
|
||||
msg.setAppMeasureFurnaceMessage(fur);
|
||||
msg.setAppMeasureExitMessage(exit);
|
||||
|
||||
monitorStripSpeed(entry);
|
||||
|
||||
opcReceiverHandler.onMessageReceived(OpcMessageType.APP_MEASURE,msg);
|
||||
|
||||
} catch (Exception e) {
|
||||
@@ -86,4 +108,65 @@ public class MessageReceiveSchedule extends BaseSchedule {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* stripSpeed<5 持续5分钟判定停机,>5 持续1分钟结束停机并更新维持时间
|
||||
*/
|
||||
private void monitorStripSpeed(AppMeasureEntryMessage entry) {
|
||||
if (entry == null || entry.getStripSpeed() == null) {
|
||||
resetSpeedFlags();
|
||||
return;
|
||||
}
|
||||
|
||||
boolean lowSpeed = entry.getStripSpeed().compareTo(BigDecimal.valueOf(5)) < 0;
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
if (lowSpeed) {
|
||||
highSpeedStartTime = null; // 重置恢复计时
|
||||
if (lowSpeedStartTime == null) {
|
||||
lowSpeedStartTime = now;
|
||||
}
|
||||
// 低速已持续超过5分钟且尚未入库,则新增停机记录
|
||||
if (!stopRecorded && Duration.between(lowSpeedStartTime, now).toMinutes() >= 5) {
|
||||
ProStoppage stoppage = new ProStoppage();
|
||||
stoppage.setStartDate(lowSpeedStartTime);
|
||||
stoppage.setDuration(BigDecimal.ZERO); // 初始为0,恢复后再更新
|
||||
if (proStoppageService.save(stoppage)) {
|
||||
currentStopId = stoppage.getStopid();
|
||||
stopRecorded = true;
|
||||
log.info("自动新增低速停机记录,stopId={} start={}", currentStopId, lowSpeedStartTime);
|
||||
} else {
|
||||
log.warn("自动新增低速停机记录失败");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lowSpeedStartTime = null;
|
||||
if (stopRecorded) {
|
||||
if (highSpeedStartTime == null) {
|
||||
highSpeedStartTime = now;
|
||||
}
|
||||
if (Duration.between(highSpeedStartTime, now).toMinutes() >= 1 && currentStopId != null) {
|
||||
ProStoppage update = new ProStoppage();
|
||||
update.setStopid(currentStopId);
|
||||
update.setEndDate(now);
|
||||
// duration 以秒存储
|
||||
ProStoppage existing = proStoppageService.getById(currentStopId);
|
||||
LocalDateTime start = existing != null && existing.getStartDate() != null ? existing.getStartDate() : highSpeedStartTime;
|
||||
long seconds = Duration.between(start, now).getSeconds();
|
||||
update.setDuration(BigDecimal.valueOf(seconds));
|
||||
proStoppageService.updateById(update);
|
||||
log.info("低速停机结束更新,stopId={} duration={}s", currentStopId, seconds);
|
||||
resetSpeedFlags();
|
||||
}
|
||||
} else {
|
||||
highSpeedStartTime = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resetSpeedFlags() {
|
||||
lowSpeedStartTime = null;
|
||||
highSpeedStartTime = null;
|
||||
// 不重置 stopRecorded/currentStopId,避免短暂无值时丢失状态
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.fizz.business.service.manager.OpcMessageIdsManager.findIdentifierByFieldName;
|
||||
import static com.fizz.business.service.manager.OpcMessageIdsManager.pdiSetupIds;
|
||||
|
||||
@Service
|
||||
@@ -62,56 +63,116 @@ public class OpcMessageSend {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用写入方法,用于向指定 OPC 节点写入一个值
|
||||
* @param address OPC 节点地址 (e.g., "ns=2;s=ProcessCGL.PLCLine.ExitCut.cutLength")
|
||||
* 通用写数据方法:通过字段名向指定点位写入单个值
|
||||
* @param fieldName 字段名(对象属性名),例如:coilId
|
||||
* @param value 要写入的值
|
||||
* @return 是否写入成功
|
||||
*/
|
||||
public void writeNode(String address, Object value) {
|
||||
public boolean writeDataByFieldName(String fieldName, Object value) {
|
||||
try {
|
||||
String identifier = findIdentifierByFieldName(fieldName);
|
||||
if (identifier == null) {
|
||||
log.error("未找到字段名对应的 OPC 节点路径,fieldName={}", fieldName);
|
||||
return false;
|
||||
}
|
||||
List<ReadWriteEntity> entities = new ArrayList<>();
|
||||
entities.add(ReadWriteEntity.builder()
|
||||
.identifier(address)
|
||||
.identifier(identifier)
|
||||
.value(value)
|
||||
.build());
|
||||
miloService.writeToOpcUa(entities);
|
||||
log.info("写入 OPC 成功, node={}, value={}", address, value);
|
||||
log.info("写入 OPC 数据成功,fieldName={}, identifier={}, value={}", fieldName, identifier, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("写入 OPC 失败, node={}, value={}, 原因: {}", address, value, e.getMessage(), e);
|
||||
// 抛出运行时异常,以便上层调用者(如 SendJobServiceImpl)可以捕获并处理失败状态
|
||||
throw new RuntimeException("写入 OPC 失败: " + e.getMessage(), e);
|
||||
log.error("写入 OPC 数据失败,fieldName={}, value={},原因:{}", fieldName, value, e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入 OPC 节点(增强版):根据字符串值尝试转换为数值/布尔,再写入
|
||||
* 规则:
|
||||
* 1) 先尝试转 Integer
|
||||
* 2) 再尝试转 Double
|
||||
* 3) 再尝试转 Boolean(true/false/1/0)
|
||||
* 4) 都不行则按原字符串写入
|
||||
* 通用写数据方法:向指定点位写入单个值(直接使用节点路径)
|
||||
* @param identifier OPC 点位标识符(节点路径)
|
||||
* @param value 要写入的值
|
||||
* @return 是否写入成功
|
||||
*/
|
||||
public void writeNode(String address, String valueRaw) {
|
||||
Object v = valueRaw;
|
||||
if (valueRaw != null) {
|
||||
String s = valueRaw.trim();
|
||||
// boolean
|
||||
if ("1".equals(s) || "0".equals(s) || "true".equalsIgnoreCase(s) || "false".equalsIgnoreCase(s)) {
|
||||
v = ("1".equals(s) || "true".equalsIgnoreCase(s));
|
||||
} else {
|
||||
// int
|
||||
try {
|
||||
v = Integer.parseInt(s);
|
||||
} catch (Exception ignore) {
|
||||
// double
|
||||
try {
|
||||
v = Double.parseDouble(s);
|
||||
} catch (Exception ignore2) {
|
||||
v = valueRaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean writeData(String identifier, Object value) {
|
||||
try {
|
||||
List<ReadWriteEntity> entities = new ArrayList<>();
|
||||
entities.add(ReadWriteEntity.builder()
|
||||
.identifier(identifier)
|
||||
.value(value)
|
||||
.build());
|
||||
miloService.writeToOpcUa(entities);
|
||||
log.info("写入 OPC 数据成功,identifier={}, value={}", identifier, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("写入 OPC 数据失败,identifier={}, value={},原因:{}", identifier, value, e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量写数据方法:通过字段名向多个点位写入数据
|
||||
* @param fieldDataMap 字段名和值的映射,key 为 fieldName,value 为要写入的值
|
||||
* @return 是否全部写入成功
|
||||
*/
|
||||
public boolean batchWriteDataByFieldName(Map<String, Object> fieldDataMap) {
|
||||
try {
|
||||
if (fieldDataMap == null || fieldDataMap.isEmpty()) {
|
||||
log.warn("批量写数据:数据映射为空,跳过写入");
|
||||
return false;
|
||||
}
|
||||
List<ReadWriteEntity> entities = new ArrayList<>();
|
||||
for (Map.Entry<String, Object> entry : fieldDataMap.entrySet()) {
|
||||
String fieldName = entry.getKey();
|
||||
String identifier = findIdentifierByFieldName(fieldName);
|
||||
if (identifier == null) {
|
||||
log.warn("未找到字段名对应的 OPC 节点路径,fieldName={},跳过该字段", fieldName);
|
||||
continue;
|
||||
}
|
||||
entities.add(ReadWriteEntity.builder()
|
||||
.identifier(identifier)
|
||||
.value(entry.getValue())
|
||||
.build());
|
||||
}
|
||||
if (entities.isEmpty()) {
|
||||
log.warn("批量写数据:没有有效的字段映射,跳过写入");
|
||||
return false;
|
||||
}
|
||||
miloService.writeToOpcUa(entities);
|
||||
log.info("批量写入 OPC 数据成功,共 {} 个点位", entities.size());
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("批量写入 OPC 数据失败,原因:{}", e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量写数据方法:向多个点位写入数据(直接使用节点路径)
|
||||
* @param dataMap 点位标识符和值的映射,key 为 identifier,value 为要写入的值
|
||||
* @return 是否全部写入成功
|
||||
*/
|
||||
public boolean batchWriteData(Map<String, Object> dataMap) {
|
||||
try {
|
||||
if (dataMap == null || dataMap.isEmpty()) {
|
||||
log.warn("批量写数据:数据映射为空,跳过写入");
|
||||
return false;
|
||||
}
|
||||
List<ReadWriteEntity> entities = new ArrayList<>();
|
||||
for (Map.Entry<String, Object> entry : dataMap.entrySet()) {
|
||||
entities.add(ReadWriteEntity.builder()
|
||||
.identifier(entry.getKey())
|
||||
.value(entry.getValue())
|
||||
.build());
|
||||
}
|
||||
miloService.writeToOpcUa(entities);
|
||||
log.info("批量写入 OPC 数据成功,共 {} 个点位", entities.size());
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("批量写入 OPC 数据失败,原因:{}", e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
writeNode(address, v);
|
||||
}
|
||||
|
||||
private List<ReadWriteEntity> getWriteEntities(OpcMessage msg, Map<String,String> msgIds) {
|
||||
@@ -129,7 +190,7 @@ public class OpcMessageSend {
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
// 处理字段不存在或访问异常,可记录日志或设置默认值
|
||||
e.printStackTrace();
|
||||
return new ArrayList<>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
ReadWriteEntity entity = ReadWriteEntity.builder()
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.fizz.business.comm.iot;
|
||||
|
||||
import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
|
||||
import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 基于 iot-communication 的 S7 写入客户端(仅用于写入)。
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@ConditionalOnProperty(prefix = "iot.communication", name = "enabled", havingValue = "true")
|
||||
public class S7WriteClient {
|
||||
|
||||
@Value("${iot.communication.s7.ip:127.0.0.1}")
|
||||
private String ip;
|
||||
|
||||
@Value("${iot.communication.s7.port:102}")
|
||||
private int port;
|
||||
|
||||
@Value("${iot.communication.s7.rack:0}")
|
||||
private int rack;
|
||||
|
||||
@Value("${iot.communication.s7.slot:1}")
|
||||
private int slot;
|
||||
|
||||
@Value("${iot.communication.s7.plc-type:S1200}")
|
||||
private String plcType;
|
||||
|
||||
public S7PLC newClient() {
|
||||
EPlcType type = parsePlcType(plcType);
|
||||
return new S7PLC(type, ip, port, rack, slot);
|
||||
}
|
||||
|
||||
private EPlcType parsePlcType(String value) {
|
||||
try {
|
||||
return EPlcType.valueOf(value.trim().toUpperCase(Locale.ROOT));
|
||||
} catch (Exception e) {
|
||||
log.warn("未知 plc-type: {},回退到 S1200", value);
|
||||
return EPlcType.S1200;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WsTypeEnum {
|
||||
alarm, track_position, track_measure, track_signal, track_matmap,calc_setup_result;
|
||||
alarm, track_position, track_measure, track_signal, track_matmap, calc_setup_result, device_history_trend, device_chart_data, device_field_trend;
|
||||
|
||||
private static final Map<String, WsTypeEnum> MAP = new HashMap<>(8);
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ import com.fizz.business.form.CalcPdiPlanForm;
|
||||
import com.fizz.business.form.CrmPdiPlanForm;
|
||||
import com.fizz.business.form.PlanQueryForm;
|
||||
import com.fizz.business.service.CrmPdiPlanService;
|
||||
import com.fizz.business.service.L3PickupRecommendService;
|
||||
import com.fizz.business.vo.CrmPdiPlanVO;
|
||||
import com.fizz.business.vo.L3PickupRecommendVO;
|
||||
import com.fizz.business.vo.PdiPlanSetupInfoVO;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
@@ -25,6 +27,9 @@ public class CrmPdiPlanController {
|
||||
@Resource
|
||||
private CrmPdiPlanService crmPdiPlanService;
|
||||
|
||||
@Resource
|
||||
private L3PickupRecommendService l3PickupRecommendService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary ="新增计划")
|
||||
public R<Boolean> add(@RequestBody CrmPdiPlan crmPdiPlan) {
|
||||
@@ -55,4 +60,10 @@ public class CrmPdiPlanController {
|
||||
return R.ok(crmPdiPlanService.listAll(form));
|
||||
}
|
||||
|
||||
@GetMapping("/l3PickupRecommend")
|
||||
@Operation(summary ="三级领料推荐")
|
||||
public R<List<L3PickupRecommendVO>> l3PickupRecommend(@RequestParam(required = false, defaultValue = "10") Integer limit) {
|
||||
return R.ok(l3PickupRecommendService.listPickupRecommend(limit));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.fizz.business.domain.CrmPdoExcoil;
|
||||
import com.fizz.business.form.CrmPdoExcoilForm;
|
||||
import com.fizz.business.service.CrmPdoExcoilService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -16,7 +18,7 @@ import java.util.List;
|
||||
@RequestMapping("/api/pdo")
|
||||
@Tag(name ="实绩管理")
|
||||
@Anonymous
|
||||
public class CrmPdoExcoilController {
|
||||
public class CrmPdoExcoilController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private CrmPdoExcoilService crmPdoExcoilService;
|
||||
@@ -48,7 +50,16 @@ public class CrmPdoExcoilController {
|
||||
|
||||
@PostMapping("/list")
|
||||
@Operation(summary ="查询实绩列表")
|
||||
public R<List<CrmPdoExcoil>> list(@RequestBody CrmPdoExcoilForm form) {
|
||||
return R.ok(crmPdoExcoilService.listAll(form));
|
||||
public TableDataInfo list(@RequestBody CrmPdoExcoilForm form) {
|
||||
// 设置分页参数,默认每页20条
|
||||
if (form.getPageNum() == null || form.getPageNum() < 1) {
|
||||
form.setPageNum(1);
|
||||
}
|
||||
if (form.getPageSize() == null || form.getPageSize() < 1) {
|
||||
form.setPageSize(20);
|
||||
}
|
||||
com.github.pagehelper.PageHelper.startPage(form.getPageNum(), form.getPageSize());
|
||||
List<CrmPdoExcoil> list = crmPdoExcoilService.listAll(form);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.fizz.business.constants.enums.DeviceEnum;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/deviceEnum")
|
||||
@Tag(name = "设备枚举")
|
||||
@Anonymous
|
||||
public class DeviceEnumController {
|
||||
|
||||
@GetMapping("/all")
|
||||
@Operation(description = "获取DeviceEnum全量定义(用于前端动态渲染)")
|
||||
public R<List<DeviceDefVO>> all() {
|
||||
List<DeviceDefVO> list = Arrays.stream(DeviceEnum.values())
|
||||
.map(DeviceDefVO::from)
|
||||
.collect(Collectors.toList());
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DeviceDefVO {
|
||||
private String deviceCode; // DeviceEnum.name()
|
||||
private Integer idx;
|
||||
private String desc;
|
||||
private Double basePosition;
|
||||
private String sectionType;
|
||||
private String sourceType;
|
||||
private List<String> paramFields;
|
||||
|
||||
public static DeviceDefVO from(DeviceEnum e) {
|
||||
DeviceDefVO vo = new DeviceDefVO();
|
||||
vo.setDeviceCode(e.name());
|
||||
vo.setIdx(e.getIdx());
|
||||
vo.setDesc(e.getDesc());
|
||||
vo.setBasePosition(e.getBasePosition());
|
||||
vo.setSectionType(e.getSectionType().name());
|
||||
vo.setSourceType(e.getSourceType().name());
|
||||
vo.setParamFields(e.getParamFields());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.fizz.business.domain.msg.AppMeasureCoatMessage;
|
||||
import com.fizz.business.domain.msg.AppMeasureEntryMessage;
|
||||
import com.fizz.business.domain.msg.AppMeasureExitMessage;
|
||||
import com.fizz.business.domain.msg.AppMeasureFurnaceMessage;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/deviceFieldMeta")
|
||||
@Tag(name = "设备字段元数据")
|
||||
@Anonymous
|
||||
public class DeviceFieldMetaController {
|
||||
|
||||
@GetMapping("/all")
|
||||
@Operation(description = "获取测量字段的友好文案(来自 @Schema(description))")
|
||||
public R<Map<String, FieldMetaVO>> all() {
|
||||
Map<String, FieldMetaVO> map = new HashMap<>();
|
||||
// 4个消息类全扫一遍
|
||||
collect(map, AppMeasureEntryMessage.class);
|
||||
collect(map, AppMeasureFurnaceMessage.class);
|
||||
collect(map, AppMeasureCoatMessage.class);
|
||||
collect(map, AppMeasureExitMessage.class);
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
private void collect(Map<String, FieldMetaVO> map, Class<?> clazz) {
|
||||
for (Field f : clazz.getDeclaredFields()) {
|
||||
String fieldName = f.getName();
|
||||
Schema schema = f.getAnnotation(Schema.class);
|
||||
if (schema == null) continue;
|
||||
|
||||
String desc = schema.description();
|
||||
if (desc == null || desc.trim().isEmpty()) continue;
|
||||
|
||||
FieldMetaVO vo = new FieldMetaVO();
|
||||
vo.setLabel(parseLabel(desc));
|
||||
vo.setUnit(parseUnit(desc));
|
||||
vo.setDescription(desc);
|
||||
map.putIfAbsent(fieldName, vo);
|
||||
}
|
||||
}
|
||||
|
||||
// 例:"上层平均涂层重量 (g/m²)" -> label=上层平均涂层重量
|
||||
private String parseLabel(String desc) {
|
||||
int idx = desc.indexOf('(');
|
||||
if (idx > 0) return desc.substring(0, idx).trim();
|
||||
idx = desc.indexOf('(');
|
||||
if (idx > 0) return desc.substring(0, idx).trim();
|
||||
return desc.trim();
|
||||
}
|
||||
|
||||
// 例:"上层平均涂层重量 (g/m²)" -> unit=g/m²
|
||||
private String parseUnit(String desc) {
|
||||
int l = desc.indexOf('(');
|
||||
int r = desc.indexOf(')');
|
||||
if (l >= 0 && r > l) return desc.substring(l + 1, r).trim();
|
||||
l = desc.indexOf('(');
|
||||
r = desc.indexOf(')');
|
||||
if (l >= 0 && r > l) return desc.substring(l + 1, r).trim();
|
||||
return "";
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class FieldMetaVO {
|
||||
private String label;
|
||||
private String unit;
|
||||
private String description;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fizz.business.domain.DeviceSnapshot;
|
||||
import com.fizz.business.mapper.DeviceSnapshotMapper;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/deviceSnapshot")
|
||||
@Tag(name = "设备数据快照")
|
||||
@Anonymous
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceSnapshotController {
|
||||
|
||||
private final DeviceSnapshotMapper deviceSnapshotMapper;
|
||||
|
||||
@GetMapping("/latest")
|
||||
@Operation(description = "获取最新N条设备快照(可按deviceCode过滤)")
|
||||
public R<List<DeviceSnapshot>> latest(@RequestParam(value = "limit", defaultValue = "60") Integer limit,
|
||||
@RequestParam(value = "deviceCode", required = false) String deviceCode) {
|
||||
LambdaQueryWrapper<DeviceSnapshot> qw = new LambdaQueryWrapper<DeviceSnapshot>()
|
||||
.orderByDesc(DeviceSnapshot::getCreateTime)
|
||||
.last("limit " + Math.max(1, Math.min(limit, 500)));
|
||||
|
||||
if (deviceCode != null && !deviceCode.isEmpty()) {
|
||||
qw.eq(DeviceSnapshot::getDeviceCode, deviceCode);
|
||||
}
|
||||
|
||||
return R.ok(deviceSnapshotMapper.selectList(qw));
|
||||
}
|
||||
|
||||
@GetMapping("/range")
|
||||
@Operation(description = "按时间范围查询设备快照(可按deviceCode过滤)")
|
||||
public R<List<DeviceSnapshot>> range(@RequestParam("start") String start,
|
||||
@RequestParam("end") String end,
|
||||
@RequestParam(value = "deviceCode", required = false) String deviceCode) {
|
||||
LocalDateTime startTime = LocalDateTime.parse(start);
|
||||
LocalDateTime endTime = LocalDateTime.parse(end);
|
||||
|
||||
LambdaQueryWrapper<DeviceSnapshot> qw = new LambdaQueryWrapper<DeviceSnapshot>()
|
||||
.between(DeviceSnapshot::getCreateTime, startTime, endTime)
|
||||
.orderByAsc(DeviceSnapshot::getCreateTime);
|
||||
|
||||
if (deviceCode != null && !deviceCode.isEmpty()) {
|
||||
qw.eq(DeviceSnapshot::getDeviceCode, deviceCode);
|
||||
}
|
||||
|
||||
return R.ok(deviceSnapshotMapper.selectList(qw));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import com.fizz.business.form.OpcBatchWriteDataForm;
|
||||
import com.fizz.business.form.OpcWriteDataForm;
|
||||
import com.fizz.business.service.OpcDataService;
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* OPC 数据读写控制器
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/opc/data")
|
||||
@Tag(name = "OPC 数据读写")
|
||||
@ConditionalOnProperty(prefix = "iot.communication", name = "enabled", havingValue = "true")
|
||||
@Anonymous
|
||||
public class OpcDataController {
|
||||
|
||||
private final OpcDataService opcDataService;
|
||||
|
||||
/**
|
||||
* 向单个点位写入数据(通过字段名)
|
||||
*/
|
||||
@Operation(summary = "向单个点位写入数据", description = "通过字段名向指定的 OPC 点位写入数据")
|
||||
@PostMapping("/write")
|
||||
public R<?> writeData(@Valid @RequestBody OpcWriteDataForm form) {
|
||||
try {
|
||||
boolean success = opcDataService.writeData(form);
|
||||
if (success) {
|
||||
return R.ok("写入成功");
|
||||
} else {
|
||||
return R.fail("写入失败,可能是字段名未找到对应的 OPC 节点路径,请查看日志");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("写入 OPC 数据异常", e);
|
||||
return R.fail("写入异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量向多个点位写入数据(通过字段名)
|
||||
*/
|
||||
@Operation(summary = "批量向多个点位写入数据", description = "通过字段名向多个 OPC 点位批量写入数据")
|
||||
@PostMapping("/batchWrite")
|
||||
public R<?> batchWriteData(@Valid @RequestBody OpcBatchWriteDataForm form) {
|
||||
try {
|
||||
boolean success = opcDataService.batchWriteData(form);
|
||||
if (success) {
|
||||
return R.ok("批量写入成功,共 " + form.getDataList().size() + " 个点位");
|
||||
} else {
|
||||
return R.fail("批量写入失败,可能是部分字段名未找到对应的 OPC 节点路径,请查看日志");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量写入 OPC 数据异常", e);
|
||||
return R.fail("批量写入异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fizz.business.service.IPdiSetupService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
@@ -12,7 +11,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.fizz.business.domain.PdiSetups;
|
||||
import com.fizz.business.service.IPdiSetupService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
@@ -53,12 +51,12 @@ public class PdiSetupController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产计划的参数详情详细信息
|
||||
* 获取张力参数详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(pdiSetupService.selectPdiSetupByid(id));
|
||||
return success(pdiSetupService.selectPdiSetupById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,12 +80,12 @@ public class PdiSetupController extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产计划的参数详情
|
||||
* 删除张力参数
|
||||
*/
|
||||
@Log(title = "生产计划的参数详情", businessType = BusinessType.DELETE)
|
||||
@Log(title = "张力参数", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(pdiSetupService.deletePdiSetupByids(ids));
|
||||
return toAjax(pdiSetupService.deletePdiSetupByIds(ids));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionAllLine;
|
||||
import com.fizz.business.service.ISetupTensionAllLineService;
|
||||
|
||||
/**
|
||||
* 全线张力Controller(无权限控制)
|
||||
*
|
||||
* 三主键:steelGrade + thick + yieldStren
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/tension/all-line")
|
||||
@Anonymous
|
||||
public class SetupTensionAllLineController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTensionAllLineService service;
|
||||
|
||||
/**
|
||||
* 查询全线张力列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTensionAllLine query)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTensionAllLine> list = service.selectList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全线张力详细信息(按三主键)
|
||||
*/
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return success(service.selectByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增全线张力
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTensionAllLine entity)
|
||||
{
|
||||
return toAjax(service.insert(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全线张力(按三主键定位)
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTensionAllLine entity)
|
||||
{
|
||||
return toAjax(service.updateByKey(entity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除全线张力(按三主键)
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping
|
||||
public AjaxResult remove(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return toAjax(service.deleteByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionAnnealingFurnace;
|
||||
import com.fizz.business.service.ISetupTensionAnnealingFurnaceService;
|
||||
|
||||
/**
|
||||
* 退火炉张力Controller(无权限控制)
|
||||
*
|
||||
* 三主键:steelGrade + thick + yieldStren
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/tension/annealing-furnace")
|
||||
@Anonymous
|
||||
public class SetupTensionAnnealingFurnaceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTensionAnnealingFurnaceService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTensionAnnealingFurnace query)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTensionAnnealingFurnace> list = service.selectList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return success(service.selectByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
|
||||
@Log(title = "退火炉张力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTensionAnnealingFurnace entity)
|
||||
{
|
||||
return toAjax(service.insert(entity));
|
||||
}
|
||||
|
||||
@Log(title = "退火炉张力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTensionAnnealingFurnace entity)
|
||||
{
|
||||
return toAjax(service.updateByKey(entity));
|
||||
}
|
||||
|
||||
@Log(title = "退火炉张力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping
|
||||
public AjaxResult remove(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return toAjax(service.deleteByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fizz.business.form.TensionDeleteForm;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.fizz.business.domain.SetupTension;
|
||||
import com.fizz.business.service.ISetupTensionService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 全线张力Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/tension")
|
||||
public class SetupTensionController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTensionService setupTensionService;
|
||||
|
||||
/**
|
||||
* 查询全线张力列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTension setupTension)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTension> list = setupTensionService.selectSetupTensionList(setupTension);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出全线张力列表
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SetupTension setupTension)
|
||||
{
|
||||
List<SetupTension> list = setupTensionService.selectSetupTensionList(setupTension);
|
||||
ExcelUtil<SetupTension> util = new ExcelUtil<SetupTension>(SetupTension.class);
|
||||
util.exportExcel(response, list, "全线张力数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全线张力详细信息
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo(@RequestParam(required = false) Long thick ,@RequestParam(required = false) Long yieldStren)
|
||||
{
|
||||
return success(setupTensionService.selectSetupTensionByThick(thick, yieldStren));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增全线张力
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTension setupTension)
|
||||
{
|
||||
return toAjax(setupTensionService.insertSetupTension(setupTension));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全线张力
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTension setupTension)
|
||||
{
|
||||
return toAjax(setupTensionService.updateSetupTension(setupTension));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除全线张力
|
||||
*/
|
||||
@Log(title = "全线张力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/tension") // 建议添加路径区分不同删除接口
|
||||
public AjaxResult removeTension(@RequestBody TensionDeleteForm form) {
|
||||
return toAjax(setupTensionService.deleteSetupTensionByThicks(
|
||||
form.getThicks(),
|
||||
form.getYieldStrens()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionLeveler;
|
||||
import com.fizz.business.service.ISetupTensionLevelerService;
|
||||
|
||||
/**
|
||||
* 平整机张力Controller(无权限控制)
|
||||
*
|
||||
* 三主键:steelGrade + thick + yieldStren
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/tension/leveler")
|
||||
@Anonymous
|
||||
public class SetupTensionLevelerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTensionLevelerService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTensionLeveler query)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTensionLeveler> list = service.selectList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return success(service.selectByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
|
||||
@Log(title = "平整机张力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTensionLeveler entity)
|
||||
{
|
||||
return toAjax(service.insert(entity));
|
||||
}
|
||||
|
||||
@Log(title = "平整机张力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTensionLeveler entity)
|
||||
{
|
||||
return toAjax(service.updateByKey(entity));
|
||||
}
|
||||
|
||||
@Log(title = "平整机张力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping
|
||||
public AjaxResult remove(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return toAjax(service.deleteByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionStraightener;
|
||||
import com.fizz.business.service.ISetupTensionStraightenerService;
|
||||
|
||||
/**
|
||||
* 矫直机张力Controller(无权限控制)
|
||||
*
|
||||
* 三主键:steelGrade + thick + yieldStren
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/tension/straightener")
|
||||
@Anonymous
|
||||
public class SetupTensionStraightenerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTensionStraightenerService service;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTensionStraightener query)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTensionStraightener> list = service.selectList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public AjaxResult getInfo(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return success(service.selectByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
|
||||
@Log(title = "矫直机张力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTensionStraightener entity)
|
||||
{
|
||||
return toAjax(service.insert(entity));
|
||||
}
|
||||
|
||||
@Log(title = "矫直机张力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTensionStraightener entity)
|
||||
{
|
||||
return toAjax(service.updateByKey(entity));
|
||||
}
|
||||
|
||||
@Log(title = "矫直机张力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping
|
||||
public AjaxResult remove(@RequestParam("steelGrade") String steelGrade,
|
||||
@RequestParam("thick") Float thick,
|
||||
@RequestParam("yieldStren") Float yieldStren)
|
||||
{
|
||||
return toAjax(service.deleteByKey(steelGrade, thick, yieldStren));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fizz.business.form.TlDeleteForm;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.fizz.business.domain.SetupTl;
|
||||
import com.fizz.business.service.ISetupTlService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 拉矫机参数Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/tl")
|
||||
public class SetupTlController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTlService setupTlService;
|
||||
|
||||
/**
|
||||
* 查询拉矫机参数列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTl setupTl)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTl> list = setupTlService.selectSetupTlList(setupTl);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出拉矫机参数列表
|
||||
*/
|
||||
@Log(title = "拉矫机参数", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SetupTl setupTl)
|
||||
{
|
||||
List<SetupTl> list = setupTlService.selectSetupTlList(setupTl);
|
||||
ExcelUtil<SetupTl> util = new ExcelUtil<SetupTl>(SetupTl.class);
|
||||
util.exportExcel(response, list, "拉矫机参数数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拉矫机参数详细信息
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo(@RequestParam String steelGrade,
|
||||
@RequestParam Long yieldStren,
|
||||
@RequestParam Long thick)
|
||||
{
|
||||
return success(setupTlService.selectSetupTlBySteelGrade(steelGrade, yieldStren, thick));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增拉矫机参数
|
||||
*/
|
||||
@Log(title = "拉矫机参数", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTl setupTl)
|
||||
{
|
||||
return toAjax(setupTlService.insertSetupTl(setupTl));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改拉矫机参数
|
||||
*/
|
||||
@Log(title = "拉矫机参数", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTl setupTl)
|
||||
{
|
||||
return toAjax(setupTlService.updateSetupTl(setupTl));
|
||||
}
|
||||
|
||||
// 拉矫机参数删除接口
|
||||
@Log(title = "拉矫机参数", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/tl") // 不同路径区分
|
||||
public AjaxResult removeTl(@RequestBody TlDeleteForm form) {
|
||||
return toAjax(setupTlService.deleteSetupTlBySteelGrades(
|
||||
form.getSteelGrades(),
|
||||
form.getYieldStrens(),
|
||||
form.getThicks()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fizz.business.form.TmBendforceDeleteForm;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.fizz.business.domain.SetupTmBendforce;
|
||||
import com.fizz.business.service.ISetupTmBendforceService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 光整机弯辊力Controller
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/bendforce")
|
||||
public class SetupTmBendforceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTmBendforceService setupTmBendforceService;
|
||||
|
||||
/**
|
||||
* 查询光整机弯辊力列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTmBendforce> list = setupTmBendforceService.selectSetupTmBendforceList(setupTmBendforce);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出光整机弯辊力列表
|
||||
*/
|
||||
@Log(title = "光整机弯辊力", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
List<SetupTmBendforce> list = setupTmBendforceService.selectSetupTmBendforceList(setupTmBendforce);
|
||||
ExcelUtil<SetupTmBendforce> util = new ExcelUtil<SetupTmBendforce>(SetupTmBendforce.class);
|
||||
util.exportExcel(response, list, "光整机弯辊力数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取光整机弯辊力详细信息
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo(@RequestParam Long width,
|
||||
@RequestParam Long rollForce)
|
||||
{
|
||||
return success(setupTmBendforceService.selectSetupTmBendforceByWidth(width,rollForce));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增光整机弯辊力
|
||||
*/
|
||||
@Log(title = "光整机弯辊力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
return toAjax(setupTmBendforceService.insertSetupTmBendforce(setupTmBendforce));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改光整机弯辊力
|
||||
*/
|
||||
@Log(title = "光整机弯辊力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
return toAjax(setupTmBendforceService.updateSetupTmBendforce(setupTmBendforce));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除光整机弯辊力
|
||||
*/
|
||||
@Log(title = "光整机弯辊力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/tm/bendforce")
|
||||
public AjaxResult removeTmBendforce(@RequestBody TmBendforceDeleteForm form) {
|
||||
return toAjax(setupTmBendforceService.deleteSetupTmBendforceByWidths(
|
||||
form.getWidths(),
|
||||
form.getRollForces()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fizz.business.form.TmMeshDeleteForm;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.fizz.business.domain.SetupTmMesh;
|
||||
import com.fizz.business.service.ISetupTmMeshService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 光整机插入量Controller
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/mesh")
|
||||
public class SetupTmMeshController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTmMeshService setupTmMeshService;
|
||||
|
||||
/**
|
||||
* 查询光整机插入量列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTmMesh setupTmMesh)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTmMesh> list = setupTmMeshService.selectSetupTmMeshList(setupTmMesh);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出光整机插入量列表
|
||||
*/
|
||||
@Log(title = "光整机插入量", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SetupTmMesh setupTmMesh)
|
||||
{
|
||||
List<SetupTmMesh> list = setupTmMeshService.selectSetupTmMeshList(setupTmMesh);
|
||||
ExcelUtil<SetupTmMesh> util = new ExcelUtil<SetupTmMesh>(SetupTmMesh.class);
|
||||
util.exportExcel(response, list, "光整机插入量数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取光整机插入量详细信息
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo(@RequestParam String steelGrade,
|
||||
@RequestParam Long yieldStren,
|
||||
@RequestParam Long thick)
|
||||
{
|
||||
return success(setupTmMeshService.selectSetupTmMeshBySteelGrade(steelGrade, yieldStren, thick));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增光整机插入量
|
||||
*/
|
||||
@Log(title = "光整机插入量", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTmMesh setupTmMesh)
|
||||
{
|
||||
return toAjax(setupTmMeshService.insertSetupTmMesh(setupTmMesh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改光整机插入量
|
||||
*/
|
||||
@Log(title = "光整机插入量", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTmMesh setupTmMesh)
|
||||
{
|
||||
return toAjax(setupTmMeshService.updateSetupTmMesh(setupTmMesh));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除光整机插入量
|
||||
*/
|
||||
@Log(title = "光整机插入量", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/tm/mesh")
|
||||
public AjaxResult removeTmMesh(@RequestBody TmMeshDeleteForm form) {
|
||||
return toAjax(setupTmMeshService.deleteSetupTmMeshBySteelGrades(
|
||||
form.getSteelGrades(),
|
||||
form.getYieldStrens(),
|
||||
form.getThicks()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package com.fizz.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fizz.business.form.TmRollforceDeleteForm;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.fizz.business.domain.SetupTmRollforce;
|
||||
import com.fizz.business.service.ISetupTmRollforceService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 光整机轧制力Controller
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/business/rollforce")
|
||||
public class SetupTmRollforceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISetupTmRollforceService setupTmRollforceService;
|
||||
|
||||
/**
|
||||
* 查询光整机轧制力列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
startPage();
|
||||
List<SetupTmRollforce> list = setupTmRollforceService.selectSetupTmRollforceList(setupTmRollforce);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出光整机轧制力列表
|
||||
*/
|
||||
@Log(title = "光整机轧制力", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
List<SetupTmRollforce> list = setupTmRollforceService.selectSetupTmRollforceList(setupTmRollforce);
|
||||
ExcelUtil<SetupTmRollforce> util = new ExcelUtil<SetupTmRollforce>(SetupTmRollforce.class);
|
||||
util.exportExcel(response, list, "光整机轧制力数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取光整机轧制力详细信息
|
||||
*/
|
||||
@GetMapping()
|
||||
public AjaxResult getInfo(@RequestParam String steelGrade,
|
||||
@RequestParam Long yieldStren,
|
||||
@RequestParam Long thick,
|
||||
@RequestParam Long elong)
|
||||
{
|
||||
return success(setupTmRollforceService.selectSetupTmRollforceBySteelGrade(steelGrade, yieldStren, thick, elong));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增光整机轧制力
|
||||
*/
|
||||
@Log(title = "光整机轧制力", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
return toAjax(setupTmRollforceService.insertSetupTmRollforce(setupTmRollforce));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改光整机轧制力
|
||||
*/
|
||||
@Log(title = "光整机轧制力", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
return toAjax(setupTmRollforceService.updateSetupTmRollforce(setupTmRollforce));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除光整机轧制力
|
||||
*/
|
||||
@Log(title = "光整机轧制力", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/tm/rollforce")
|
||||
public AjaxResult removeTmRollforce(@RequestBody TmRollforceDeleteForm form) {
|
||||
return toAjax(setupTmRollforceService.deleteSetupTmRollforceBySteelGrades(
|
||||
form.getSteelGrades(),
|
||||
form.getThicks(),
|
||||
form.getYieldStrens(),
|
||||
form.getElongs()
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,9 @@ public class CrmPdiPlan implements Serializable {
|
||||
@Schema(description = "钢卷号")
|
||||
private String coilid;
|
||||
|
||||
@Schema(description = "入场钢卷号")
|
||||
private String enterCoilNo;
|
||||
|
||||
@Schema(description = "机组号")
|
||||
private String unitCode;
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ public class CrmPdoExcoil implements Serializable {
|
||||
@Schema(description = "来料卷")
|
||||
private String entryMatId;
|
||||
|
||||
@Schema(description = "入场钢卷号")
|
||||
private String enterCoilNo;
|
||||
|
||||
@Schema(description = "分切数")
|
||||
private Integer subId;
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("device_snapshot")
|
||||
@Schema(description = "设备数据快照")
|
||||
public class DeviceSnapshot {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "快照时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "设备idx,对应DeviceEnum.idx")
|
||||
private Integer deviceId;
|
||||
|
||||
@Schema(description = "设备枚举名,对应DeviceEnum.name()")
|
||||
private String deviceCode;
|
||||
|
||||
@Schema(description = "设备描述")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "段类型 ENTRY/PROCESS/EXIT")
|
||||
private String sectionType;
|
||||
|
||||
@Schema(description = "来源类型 ENTRY/FURNACE/COAT/EXIT")
|
||||
private String sourceType;
|
||||
|
||||
|
||||
@Schema(description = "快照数据JSON")
|
||||
private String snapshotData;
|
||||
}
|
||||
|
||||
@@ -5,162 +5,95 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 生产计划的参数详情对象 pdi_setup
|
||||
* 张力参数表对象 pdi_setup
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-25
|
||||
* 表主键为自增 id。
|
||||
*/
|
||||
@Data
|
||||
@TableName("pdi_setup")
|
||||
public class PdiSetups implements Serializable
|
||||
{
|
||||
public class PdiSetups implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@TableId(value = "ID", type = IdType.AUTO)
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 钢卷号 */
|
||||
@Excel(name = "钢卷号")
|
||||
@TableField("COILID")
|
||||
private String coilid;
|
||||
|
||||
/** 计划号 */
|
||||
@Excel(name = "计划号")
|
||||
@TableField("PLANID")
|
||||
private String planid;
|
||||
|
||||
/** 钢种 */
|
||||
@Excel(name = "钢种")
|
||||
private String steelGrade;
|
||||
|
||||
/** 厚度 */
|
||||
@Excel(name = "厚度")
|
||||
private BigDecimal thick;
|
||||
|
||||
/** 屈服强度 */
|
||||
@Excel(name = "屈服强度")
|
||||
private BigDecimal yieldStren;
|
||||
|
||||
/** 开卷机张力 */
|
||||
@Excel(name = "开卷机张力")
|
||||
@TableField("POR_TENSION")
|
||||
private Long porTension;
|
||||
private BigDecimal porTension;
|
||||
|
||||
/** 入口活套张力 */
|
||||
@Excel(name = "入口活套张力")
|
||||
@TableField("CEL_TENSION")
|
||||
private Long celTension;
|
||||
private BigDecimal celTension;
|
||||
|
||||
/** 清洗段张力 */
|
||||
@Excel(name = "清洗段张力")
|
||||
@TableField("CLEAN_TENSION")
|
||||
private Long cleanTension;
|
||||
private BigDecimal cleanTension;
|
||||
|
||||
/** 炉区张力 */
|
||||
@Excel(name = "炉区张力")
|
||||
@TableField("FUR_TENSION")
|
||||
private Long furTension;
|
||||
|
||||
/** 冷却塔张力 */
|
||||
@Excel(name = "冷却塔张力")
|
||||
@TableField("TOWER_TENSION")
|
||||
private Long towerTension;
|
||||
|
||||
/** 光整机不投张力 */
|
||||
@Excel(name = "光整机不投张力")
|
||||
@TableField("TM_NONE_TENSION")
|
||||
private Long tmNoneTension;
|
||||
|
||||
/** 光整机入口张力 */
|
||||
@Excel(name = "光整机入口张力")
|
||||
@TableField("TM_ENTRY_TENSION")
|
||||
private Long tmEntryTension;
|
||||
|
||||
/** 光整机出口张力 */
|
||||
@Excel(name = "光整机出口张力")
|
||||
@TableField("TM_EXIT_TENSION")
|
||||
private Long tmExitTension;
|
||||
|
||||
/** 光整机轧制力 */
|
||||
@Excel(name = "光整机轧制力")
|
||||
@TableField("TM_ROLLFORCE")
|
||||
private Long tmRollforce;
|
||||
|
||||
/** 光整机弯辊力 */
|
||||
@Excel(name = "光整机弯辊力")
|
||||
@TableField("TM_BENDFORCE")
|
||||
private Long tmBendforce;
|
||||
|
||||
/** 光整机防皱辊插入量 */
|
||||
@Excel(name = "光整机防皱辊插入量")
|
||||
@TableField("TM_ACR_MESH")
|
||||
private Long tmAcrMesh;
|
||||
|
||||
/** 光整机防颤辊插入量 */
|
||||
@Excel(name = "光整机防颤辊插入量")
|
||||
@TableField("TM_BR_MESH")
|
||||
private Long tmBrMesh;
|
||||
|
||||
/** 拉矫机不投张力 */
|
||||
@Excel(name = "拉矫机不投张力")
|
||||
@TableField("TL_NONE_TENSION")
|
||||
private Long tlNoneTension;
|
||||
|
||||
/** 拉矫机出口张力 */
|
||||
@Excel(name = "拉矫机出口张力")
|
||||
@TableField("TL_EXIT_TENSION")
|
||||
private Long tlExitTension;
|
||||
|
||||
/** 拉矫机延伸率 */
|
||||
@Excel(name = "拉矫机延伸率")
|
||||
@TableField("TL_ELONG")
|
||||
private Long tlElong;
|
||||
|
||||
/** 拉矫机矫直辊插入量1 */
|
||||
@Excel(name = "拉矫机矫直辊插入量1")
|
||||
@TableField("TL_LVL_MESH1")
|
||||
private Long tlLvlMesh1;
|
||||
|
||||
/** 拉矫机矫直辊插入量2 */
|
||||
@Excel(name = "拉矫机矫直辊插入量2")
|
||||
@TableField("TL_LVL_MESH2")
|
||||
private Long tlLvlMesh2;
|
||||
|
||||
/** 拉矫机防横弓插入量 */
|
||||
@Excel(name = "拉矫机防横弓插入量")
|
||||
@TableField("TL_ACB_MESH")
|
||||
private Long tlAcbMesh;
|
||||
|
||||
/** 后处理张力 */
|
||||
@Excel(name = "后处理张力")
|
||||
@TableField("COAT_TENSION")
|
||||
private Long coatTension;
|
||||
/** 钝化段张力 */
|
||||
@Excel(name = "钝化段张力")
|
||||
private BigDecimal passivationTension;
|
||||
|
||||
/** 出口活套张力 */
|
||||
@Excel(name = "出口活套张力")
|
||||
@TableField("CXL_TENSION")
|
||||
private Long cxlTension;
|
||||
private BigDecimal cxlTension;
|
||||
|
||||
/** 卷取机张力 */
|
||||
@Excel(name = "卷取机张力")
|
||||
@TableField("TR_TENSION")
|
||||
private Long trTension;
|
||||
private BigDecimal trTension;
|
||||
|
||||
/** 类型,或可用于记录更改次数 */
|
||||
@Excel(name = "类型,或可用于记录更改次数")
|
||||
@TableField("TYPE")
|
||||
private Long type;
|
||||
/** 平整机入口张力 */
|
||||
@Excel(name = "平整机入口张力")
|
||||
private BigDecimal levelerEntryTension;
|
||||
|
||||
/** 预热段出口板温 */
|
||||
@Excel(name = "预热段出口板温")
|
||||
@TableField("PREHEATING_SECTION")
|
||||
private Float preheatingSection;
|
||||
/** 平整机出口张力 */
|
||||
@Excel(name = "平整机出口张力")
|
||||
private BigDecimal levelerExitTension;
|
||||
|
||||
/** 加热段出口板温 */
|
||||
@Excel(name = "加热段出口板温")
|
||||
@TableField("HEATING_SECTION")
|
||||
private Float heatingSection;
|
||||
/** 矫直机出口张力 */
|
||||
@Excel(name = "矫直机出口张力")
|
||||
private BigDecimal straightenerExitTension;
|
||||
|
||||
/** 冷却段出口板温 */
|
||||
@Excel(name = "冷却段出口板温")
|
||||
@TableField("COOLING_SECTION")
|
||||
private Float coolingSection;
|
||||
/** 炉区张力 */
|
||||
@Excel(name = "炉区张力")
|
||||
private BigDecimal furTension;
|
||||
|
||||
/** 冷却塔张力 */
|
||||
@Excel(name = "冷却塔张力")
|
||||
private BigDecimal towerTension;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 全线张力对象 setup_tension
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@@ -81,156 +81,156 @@ public class SetupTension extends BaseEntity
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long value15;
|
||||
|
||||
public void setThick(Long thick)
|
||||
public void setThick(Long thick)
|
||||
{
|
||||
this.thick = thick;
|
||||
}
|
||||
|
||||
public Long getThick()
|
||||
public Long getThick()
|
||||
{
|
||||
return thick;
|
||||
}
|
||||
public void setYieldStren(Long yieldStren)
|
||||
public void setYieldStren(Long yieldStren)
|
||||
{
|
||||
this.yieldStren = yieldStren;
|
||||
}
|
||||
|
||||
public Long getYieldStren()
|
||||
public Long getYieldStren()
|
||||
{
|
||||
return yieldStren;
|
||||
}
|
||||
public void setValue1(Long value1)
|
||||
public void setValue1(Long value1)
|
||||
{
|
||||
this.value1 = value1;
|
||||
}
|
||||
|
||||
public Long getValue1()
|
||||
public Long getValue1()
|
||||
{
|
||||
return value1;
|
||||
}
|
||||
public void setValue2(Long value2)
|
||||
public void setValue2(Long value2)
|
||||
{
|
||||
this.value2 = value2;
|
||||
}
|
||||
|
||||
public Long getValue2()
|
||||
public Long getValue2()
|
||||
{
|
||||
return value2;
|
||||
}
|
||||
public void setValue3(Long value3)
|
||||
public void setValue3(Long value3)
|
||||
{
|
||||
this.value3 = value3;
|
||||
}
|
||||
|
||||
public Long getValue3()
|
||||
public Long getValue3()
|
||||
{
|
||||
return value3;
|
||||
}
|
||||
public void setValue4(Long value4)
|
||||
public void setValue4(Long value4)
|
||||
{
|
||||
this.value4 = value4;
|
||||
}
|
||||
|
||||
public Long getValue4()
|
||||
public Long getValue4()
|
||||
{
|
||||
return value4;
|
||||
}
|
||||
public void setValue5(Long value5)
|
||||
public void setValue5(Long value5)
|
||||
{
|
||||
this.value5 = value5;
|
||||
}
|
||||
|
||||
public Long getValue5()
|
||||
public Long getValue5()
|
||||
{
|
||||
return value5;
|
||||
}
|
||||
public void setValue6(Long value6)
|
||||
public void setValue6(Long value6)
|
||||
{
|
||||
this.value6 = value6;
|
||||
}
|
||||
|
||||
public Long getValue6()
|
||||
public Long getValue6()
|
||||
{
|
||||
return value6;
|
||||
}
|
||||
public void setValue7(Long value7)
|
||||
public void setValue7(Long value7)
|
||||
{
|
||||
this.value7 = value7;
|
||||
}
|
||||
|
||||
public Long getValue7()
|
||||
public Long getValue7()
|
||||
{
|
||||
return value7;
|
||||
}
|
||||
public void setValue8(Long value8)
|
||||
public void setValue8(Long value8)
|
||||
{
|
||||
this.value8 = value8;
|
||||
}
|
||||
|
||||
public Long getValue8()
|
||||
public Long getValue8()
|
||||
{
|
||||
return value8;
|
||||
}
|
||||
public void setValue9(Long value9)
|
||||
public void setValue9(Long value9)
|
||||
{
|
||||
this.value9 = value9;
|
||||
}
|
||||
|
||||
public Long getValue9()
|
||||
public Long getValue9()
|
||||
{
|
||||
return value9;
|
||||
}
|
||||
public void setValue10(Long value10)
|
||||
public void setValue10(Long value10)
|
||||
{
|
||||
this.value10 = value10;
|
||||
}
|
||||
|
||||
public Long getValue10()
|
||||
public Long getValue10()
|
||||
{
|
||||
return value10;
|
||||
}
|
||||
public void setValue11(Long value11)
|
||||
public void setValue11(Long value11)
|
||||
{
|
||||
this.value11 = value11;
|
||||
}
|
||||
|
||||
public Long getValue11()
|
||||
public Long getValue11()
|
||||
{
|
||||
return value11;
|
||||
}
|
||||
public void setValue12(Long value12)
|
||||
public void setValue12(Long value12)
|
||||
{
|
||||
this.value12 = value12;
|
||||
}
|
||||
|
||||
public Long getValue12()
|
||||
public Long getValue12()
|
||||
{
|
||||
return value12;
|
||||
}
|
||||
public void setValue13(Long value13)
|
||||
public void setValue13(Long value13)
|
||||
{
|
||||
this.value13 = value13;
|
||||
}
|
||||
|
||||
public Long getValue13()
|
||||
public Long getValue13()
|
||||
{
|
||||
return value13;
|
||||
}
|
||||
public void setValue14(Long value14)
|
||||
public void setValue14(Long value14)
|
||||
{
|
||||
this.value14 = value14;
|
||||
}
|
||||
|
||||
public Long getValue14()
|
||||
public Long getValue14()
|
||||
{
|
||||
return value14;
|
||||
}
|
||||
public void setValue15(Long value15)
|
||||
public void setValue15(Long value15)
|
||||
{
|
||||
this.value15 = value15;
|
||||
}
|
||||
|
||||
public Long getValue15()
|
||||
public Long getValue15()
|
||||
{
|
||||
return value15;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 全线张力对象 setup_tension_all_line
|
||||
*
|
||||
* 三主键:steel_grade + thick + yield_stren
|
||||
*/
|
||||
public class SetupTensionAllLine extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 钢种 */
|
||||
@Excel(name = "钢种")
|
||||
private String steelGrade;
|
||||
|
||||
/** 厚度 */
|
||||
@Excel(name = "厚度")
|
||||
private Float thick;
|
||||
|
||||
/** 屈服强度 */
|
||||
@Excel(name = "屈服强度")
|
||||
private Float yieldStren;
|
||||
|
||||
/** 开卷机张力 */
|
||||
@Excel(name = "开卷机张力")
|
||||
private Float value1;
|
||||
|
||||
/** 入口活套张力 */
|
||||
@Excel(name = "入口活套张力")
|
||||
private Float value2;
|
||||
|
||||
/** 清洗段张力 */
|
||||
@Excel(name = "清洗段张力")
|
||||
private Float value3;
|
||||
|
||||
/** 钝化段张力 */
|
||||
@Excel(name = "钝化段张力")
|
||||
private Float value4;
|
||||
|
||||
/** 出口活套张力 */
|
||||
@Excel(name = "出口活套张力")
|
||||
private Float value5;
|
||||
|
||||
/** 卷取机张力 */
|
||||
@Excel(name = "卷取机张力")
|
||||
private Float value6;
|
||||
|
||||
/** 创建时间(表字段) */
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间(表字段) */
|
||||
private Date updateTime;
|
||||
|
||||
public String getSteelGrade() {
|
||||
return steelGrade;
|
||||
}
|
||||
|
||||
public void setSteelGrade(String steelGrade) {
|
||||
this.steelGrade = steelGrade;
|
||||
}
|
||||
|
||||
public Float getThick() {
|
||||
return thick;
|
||||
}
|
||||
|
||||
public void setThick(Float thick) {
|
||||
this.thick = thick;
|
||||
}
|
||||
|
||||
public Float getYieldStren() {
|
||||
return yieldStren;
|
||||
}
|
||||
|
||||
public void setYieldStren(Float yieldStren) {
|
||||
this.yieldStren = yieldStren;
|
||||
}
|
||||
|
||||
public Float getValue1() {
|
||||
return value1;
|
||||
}
|
||||
|
||||
public void setValue1(Float value1) {
|
||||
this.value1 = value1;
|
||||
}
|
||||
|
||||
public Float getValue2() {
|
||||
return value2;
|
||||
}
|
||||
|
||||
public void setValue2(Float value2) {
|
||||
this.value2 = value2;
|
||||
}
|
||||
|
||||
public Float getValue3() {
|
||||
return value3;
|
||||
}
|
||||
|
||||
public void setValue3(Float value3) {
|
||||
this.value3 = value3;
|
||||
}
|
||||
|
||||
public Float getValue4() {
|
||||
return value4;
|
||||
}
|
||||
|
||||
public void setValue4(Float value4) {
|
||||
this.value4 = value4;
|
||||
}
|
||||
|
||||
public Float getValue5() {
|
||||
return value5;
|
||||
}
|
||||
|
||||
public void setValue5(Float value5) {
|
||||
this.value5 = value5;
|
||||
}
|
||||
|
||||
public Float getValue6() {
|
||||
return value6;
|
||||
}
|
||||
|
||||
public void setValue6(Float value6) {
|
||||
this.value6 = value6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 退火炉张力对象 setup_tension_annealing_furnace
|
||||
*
|
||||
* 三主键:steel_grade + thick + yield_stren
|
||||
*/
|
||||
public class SetupTensionAnnealingFurnace extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "钢种")
|
||||
private String steelGrade;
|
||||
|
||||
@Excel(name = "厚度")
|
||||
private Float thick;
|
||||
|
||||
@Excel(name = "屈服强度")
|
||||
private Float yieldStren;
|
||||
|
||||
@Excel(name = "炉区张力")
|
||||
private Float value1;
|
||||
|
||||
@Excel(name = "冷却塔张力")
|
||||
private Float value2;
|
||||
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public String getSteelGrade() { return steelGrade; }
|
||||
public void setSteelGrade(String steelGrade) { this.steelGrade = steelGrade; }
|
||||
|
||||
public Float getThick() { return thick; }
|
||||
public void setThick(Float thick) { this.thick = thick; }
|
||||
|
||||
public Float getYieldStren() { return yieldStren; }
|
||||
public void setYieldStren(Float yieldStren) { this.yieldStren = yieldStren; }
|
||||
|
||||
public Float getValue1() { return value1; }
|
||||
public void setValue1(Float value1) { this.value1 = value1; }
|
||||
|
||||
public Float getValue2() { return value2; }
|
||||
public void setValue2(Float value2) { this.value2 = value2; }
|
||||
|
||||
@Override
|
||||
public Date getCreateTime() { return createTime; }
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
|
||||
@Override
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
|
||||
@Override
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 平整机张力对象 setup_tension_leveler
|
||||
*
|
||||
* 三主键:steel_grade + thick + yield_stren
|
||||
*/
|
||||
public class SetupTensionLeveler extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "钢种")
|
||||
private String steelGrade;
|
||||
|
||||
@Excel(name = "厚度")
|
||||
private Float thick;
|
||||
|
||||
@Excel(name = "屈服强度")
|
||||
private Float yieldStren;
|
||||
|
||||
@Excel(name = "平整机入口张力")
|
||||
private Float value1;
|
||||
|
||||
@Excel(name = "平整机出口张力")
|
||||
private Float value2;
|
||||
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public String getSteelGrade() { return steelGrade; }
|
||||
public void setSteelGrade(String steelGrade) { this.steelGrade = steelGrade; }
|
||||
|
||||
public Float getThick() { return thick; }
|
||||
public void setThick(Float thick) { this.thick = thick; }
|
||||
|
||||
public Float getYieldStren() { return yieldStren; }
|
||||
public void setYieldStren(Float yieldStren) { this.yieldStren = yieldStren; }
|
||||
|
||||
public Float getValue1() { return value1; }
|
||||
public void setValue1(Float value1) { this.value1 = value1; }
|
||||
|
||||
public Float getValue2() { return value2; }
|
||||
public void setValue2(Float value2) { this.value2 = value2; }
|
||||
|
||||
@Override
|
||||
public Date getCreateTime() { return createTime; }
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
|
||||
@Override
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
|
||||
@Override
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fizz.business.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 矫直机张力对象 setup_tension_straightener
|
||||
*
|
||||
* 三主键:steel_grade + thick + yield_stren
|
||||
*/
|
||||
public class SetupTensionStraightener extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Excel(name = "钢种")
|
||||
private String steelGrade;
|
||||
|
||||
@Excel(name = "厚度")
|
||||
private Float thick;
|
||||
|
||||
@Excel(name = "屈服强度")
|
||||
private Float yieldStren;
|
||||
|
||||
@Excel(name = "矫直机出口张力")
|
||||
private Float value1;
|
||||
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public String getSteelGrade() { return steelGrade; }
|
||||
public void setSteelGrade(String steelGrade) { this.steelGrade = steelGrade; }
|
||||
|
||||
public Float getThick() { return thick; }
|
||||
public void setThick(Float thick) { this.thick = thick; }
|
||||
|
||||
public Float getYieldStren() { return yieldStren; }
|
||||
public void setYieldStren(Float yieldStren) { this.yieldStren = yieldStren; }
|
||||
|
||||
public Float getValue1() { return value1; }
|
||||
public void setValue1(Float value1) { this.value1 = value1; }
|
||||
|
||||
@Override
|
||||
public Date getCreateTime() { return createTime; }
|
||||
|
||||
@Override
|
||||
public void setCreateTime(Date createTime) { this.createTime = createTime; }
|
||||
|
||||
@Override
|
||||
public Date getUpdateTime() { return updateTime; }
|
||||
|
||||
@Override
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.fizz.business.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备图表数据 DTO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "设备图表数据")
|
||||
public class DeviceChartDataDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "设备类型分布饼图数据")
|
||||
private PieChartData deviceTypePieChart;
|
||||
|
||||
@Schema(description = "数据来源分布条形图数据")
|
||||
private BarChartData sourceTypeBarChart;
|
||||
|
||||
@Schema(description = "同类型设备对比折线图数据(单位相同)")
|
||||
private LineChartData sameTypeDeviceCompareChart;
|
||||
|
||||
@Schema(description = "设备统计数据")
|
||||
private List<DeviceStatistics> deviceStatistics;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "饼图数据")
|
||||
public static class PieChartData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "数据系列")
|
||||
private List<PieSeries> series;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "饼图系列")
|
||||
public static class PieSeries implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数值")
|
||||
private Double data;
|
||||
|
||||
@Schema(description = "颜色")
|
||||
private String color;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "条形图数据")
|
||||
public static class BarChartData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "分类轴")
|
||||
private List<String> categories;
|
||||
|
||||
@Schema(description = "数据系列")
|
||||
private List<BarSeries> series;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "条形图系列")
|
||||
public static class BarSeries implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "系列名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据值列表")
|
||||
private List<Double> data;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "折线图数据")
|
||||
public static class LineChartData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "时间轴")
|
||||
private List<String> categories;
|
||||
|
||||
@Schema(description = "数据系列")
|
||||
private List<LineSeries> series;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "折线图系列")
|
||||
public static class LineSeries implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "系列名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据值列表")
|
||||
private List<Double> data;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "设备统计数据")
|
||||
public static class DeviceStatistics implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "设备代码")
|
||||
private String deviceCode;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "平均值")
|
||||
private String avg;
|
||||
|
||||
@Schema(description = "最大值")
|
||||
private String max;
|
||||
|
||||
@Schema(description = "最小值")
|
||||
private String min;
|
||||
|
||||
@Schema(description = "当前值")
|
||||
private String current;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.fizz.business.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单设备-单字段的趋势与统计
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "设备字段趋势数据")
|
||||
public class DeviceFieldTrendDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "设备代码")
|
||||
private String deviceCode;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "字段名")
|
||||
private String fieldName;
|
||||
|
||||
@Schema(description = "字段中文名(可选)")
|
||||
private String fieldLabel;
|
||||
|
||||
@Schema(description = "单位(可选)")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "时间轴(HH:mm)")
|
||||
private List<String> categories;
|
||||
|
||||
@Schema(description = "数据点")
|
||||
private List<Double> data;
|
||||
|
||||
@Schema(description = "统计-平均值")
|
||||
private Double avg;
|
||||
|
||||
@Schema(description = "统计-最大值")
|
||||
private Double max;
|
||||
|
||||
@Schema(description = "统计-最小值")
|
||||
private Double min;
|
||||
|
||||
@Schema(description = "统计-最新值")
|
||||
private Double last;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.fizz.business.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* WS 订阅:设备字段趋势
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "设备字段趋势订阅请求")
|
||||
public class DeviceFieldTrendSubscribeReq implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "设备代码列表,为空表示不变")
|
||||
private List<String> deviceCodes;
|
||||
|
||||
@Schema(description = "字段名列表,为空表示不变")
|
||||
private List<String> fieldNames;
|
||||
|
||||
@Schema(description = "是否只推送可见范围(用于懒加载),true=只推 deviceCodes/fieldNames 命中的数据")
|
||||
private Boolean lazy;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.fizz.business.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备历史趋势数据 DTO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "设备历史趋势数据")
|
||||
public class DeviceHistoryTrendDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "设备代码")
|
||||
private String deviceCode;
|
||||
|
||||
@Schema(description = "设备描述")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "时间轴(格式:HH:mm)")
|
||||
private List<String> categories;
|
||||
|
||||
@Schema(description = "数据系列,key为字段名,value为数据值列表")
|
||||
private List<SeriesData> series;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "数据系列")
|
||||
public static class SeriesData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "系列名称(字段标签)")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "字段名")
|
||||
private String fieldName;
|
||||
|
||||
@Schema(description = "数据值列表")
|
||||
private List<Double> data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public class CrmPdiPlanForm {
|
||||
|
||||
private Integer seqid; // 主键ID
|
||||
private String coilid; // 钢卷号
|
||||
private String enterCoilNo; // 入场钢卷号
|
||||
private String unitCode; // 钢卷号
|
||||
private Integer picklingCount; // 酸洗次数
|
||||
private Integer dummyCoilFlag; // 虚卷标识
|
||||
|
||||
@@ -22,4 +22,10 @@ public class CrmPdoExcoilForm {
|
||||
@Schema(description = "锌层厚度")
|
||||
private BigDecimal zincCoatingThickness;
|
||||
|
||||
@Schema(description = "页码", example = "1")
|
||||
private Integer pageNum = 1;
|
||||
|
||||
@Schema(description = "每页数量", example = "20")
|
||||
private Integer pageSize = 20;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.fizz.business.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OPC 批量写数据请求表单
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "OPC 批量写数据请求")
|
||||
public class OpcBatchWriteDataForm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 批量写数据列表
|
||||
*/
|
||||
@Schema(description = "批量写数据列表")
|
||||
@NotEmpty(message = "写数据列表不能为空")
|
||||
@Valid
|
||||
private List<OpcWriteDataForm> dataList;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.fizz.business.form;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* OPC 写数据请求表单
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "OPC 写数据请求")
|
||||
public class OpcWriteDataForm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 字段名(对象属性名),例如:coilId
|
||||
* 系统会自动查找对应的 OPC 节点路径
|
||||
*/
|
||||
@Schema(description = "字段名(对象属性名)", example = "coilId")
|
||||
@NotBlank(message = "字段名不能为空")
|
||||
private String fieldName;
|
||||
|
||||
/**
|
||||
* 要写入的值(支持多种类型:String, Integer, Double, Boolean 等)
|
||||
*/
|
||||
@Schema(description = "要写入的值", example = "COIL001")
|
||||
@NotNull(message = "写入值不能为空")
|
||||
private Object value;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.DeviceSnapshot;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface DeviceSnapshotMapper extends BaseMapper<DeviceSnapshot> {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface L3PickupRecommendMapper {
|
||||
|
||||
@Select("SELECT action_id, coil_id, current_coil_no, priority, scan_time " +
|
||||
"FROM wms_coil_pending_action " +
|
||||
"WHERE action_type = 501 AND action_status = 0 AND del_flag = 0 " +
|
||||
"ORDER BY priority DESC, scan_time ASC, action_id ASC LIMIT #{limit}")
|
||||
List<Map<String, Object>> selectPendingActions(@Param("limit") Integer limit);
|
||||
|
||||
@Select("SELECT coil_id, enter_coil_no FROM wms_material_coil WHERE coil_id = #{coilId} LIMIT 1")
|
||||
Map<String, Object> selectMaterialByCoilId(@Param("coilId") Long coilId);
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fizz.business.domain.PdiSetups;
|
||||
|
||||
@@ -13,51 +11,6 @@ import com.fizz.business.domain.PdiSetups;
|
||||
*/
|
||||
public interface PdiSetupMapper extends BaseMapper<PdiSetups>
|
||||
{
|
||||
/**
|
||||
* 查询生产计划的参数详情
|
||||
*
|
||||
* @param id 生产计划的参数详情主键
|
||||
* @return 生产计划的参数详情
|
||||
*/
|
||||
public PdiSetups selectPdiSetupById(Long id);
|
||||
|
||||
/**
|
||||
* 查询生产计划的参数详情列表
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 生产计划的参数详情集合
|
||||
*/
|
||||
public List<PdiSetups> selectPdiSetupList(PdiSetups pdiSetup);
|
||||
|
||||
/**
|
||||
* 新增生产计划的参数详情
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPdiSetup(PdiSetups pdiSetup);
|
||||
|
||||
/**
|
||||
* 修改生产计划的参数详情
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePdiSetup(PdiSetups pdiSetup);
|
||||
|
||||
/**
|
||||
* 删除生产计划的参数详情
|
||||
*
|
||||
* @param id 生产计划的参数详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePdiSetupById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除生产计划的参数详情
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePdiSetupByIds(Long[] ids);
|
||||
// 使用 MyBatis-Plus BaseMapper 提供基础 CRUD(含按 id 的 selectById/deleteById/updateById 等)。
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.fizz.business.domain.SetupTensionAllLine;
|
||||
|
||||
/**
|
||||
* 全线张力Mapper接口
|
||||
*/
|
||||
public interface SetupTensionAllLineMapper
|
||||
{
|
||||
SetupTensionAllLine selectByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
|
||||
List<SetupTensionAllLine> selectList(SetupTensionAllLine query);
|
||||
|
||||
int insert(SetupTensionAllLine entity);
|
||||
|
||||
int updateByKey(SetupTensionAllLine entity);
|
||||
|
||||
int deleteByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.fizz.business.domain.SetupTensionAnnealingFurnace;
|
||||
|
||||
/**
|
||||
* 退火炉张力Mapper接口
|
||||
*/
|
||||
public interface SetupTensionAnnealingFurnaceMapper
|
||||
{
|
||||
SetupTensionAnnealingFurnace selectByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
|
||||
List<SetupTensionAnnealingFurnace> selectList(SetupTensionAnnealingFurnace query);
|
||||
|
||||
int insert(SetupTensionAnnealingFurnace entity);
|
||||
|
||||
int updateByKey(SetupTensionAnnealingFurnace entity);
|
||||
|
||||
int deleteByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.fizz.business.domain.SetupTensionLeveler;
|
||||
|
||||
/**
|
||||
* 平整机张力Mapper接口
|
||||
*/
|
||||
public interface SetupTensionLevelerMapper
|
||||
{
|
||||
SetupTensionLeveler selectByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
|
||||
List<SetupTensionLeveler> selectList(SetupTensionLeveler query);
|
||||
|
||||
int insert(SetupTensionLeveler entity);
|
||||
|
||||
int updateByKey(SetupTensionLeveler entity);
|
||||
|
||||
int deleteByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTension;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 全线张力Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface SetupTensionMapper
|
||||
{
|
||||
/**
|
||||
* 查询全线张力
|
||||
*
|
||||
* @param thick 全线张力主键
|
||||
* @return 全线张力
|
||||
*/
|
||||
public SetupTension selectSetupTensionByThick(@Param("thick") Long thick,@Param("yieldStren") Long yieldStren);
|
||||
|
||||
/**
|
||||
* 查询全线张力列表
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 全线张力集合
|
||||
*/
|
||||
public List<SetupTension> selectSetupTensionList(SetupTension setupTension);
|
||||
|
||||
/**
|
||||
* 新增全线张力
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTension(SetupTension setupTension);
|
||||
|
||||
/**
|
||||
* 修改全线张力
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTension(SetupTension setupTension);
|
||||
|
||||
/**
|
||||
* 删除全线张力
|
||||
*
|
||||
* @param thick 全线张力主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTensionByThick(Long thick);
|
||||
|
||||
/**
|
||||
* 批量删除全线张力
|
||||
*
|
||||
* @param thicks 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTensionByThicks(@Param("thicks") Long[] thicks,@Param("yieldStrens") Long[] yieldStrens);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.fizz.business.domain.SetupTensionStraightener;
|
||||
|
||||
/**
|
||||
* 矫直机张力Mapper接口
|
||||
*/
|
||||
public interface SetupTensionStraightenerMapper
|
||||
{
|
||||
SetupTensionStraightener selectByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
|
||||
List<SetupTensionStraightener> selectList(SetupTensionStraightener query);
|
||||
|
||||
int insert(SetupTensionStraightener entity);
|
||||
|
||||
int updateByKey(SetupTensionStraightener entity);
|
||||
|
||||
int deleteByKey(@Param("steelGrade") String steelGrade,
|
||||
@Param("thick") Float thick,
|
||||
@Param("yieldStren") Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 拉矫机参数Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface SetupTlMapper
|
||||
{
|
||||
/**
|
||||
* 查询拉矫机参数
|
||||
*
|
||||
* @param steelGrade 拉矫机参数主键
|
||||
* @return 拉矫机参数
|
||||
*/
|
||||
public SetupTl selectSetupTlBySteelGrade(@Param("steelGrade") String steelGrade,@Param("yieldStren") Long yieldStren,@Param("thick") Long thick);
|
||||
|
||||
/**
|
||||
* 查询拉矫机参数列表
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 拉矫机参数集合
|
||||
*/
|
||||
public List<SetupTl> selectSetupTlList(SetupTl setupTl);
|
||||
|
||||
/**
|
||||
* 新增拉矫机参数
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTl(SetupTl setupTl);
|
||||
|
||||
/**
|
||||
* 修改拉矫机参数
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTl(SetupTl setupTl);
|
||||
|
||||
/**
|
||||
* 删除拉矫机参数
|
||||
*
|
||||
* @param steelGrade 拉矫机参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTlBySteelGrade(String steelGrade);
|
||||
|
||||
/**
|
||||
* 批量删除拉矫机参数
|
||||
*
|
||||
* @param steelGrades 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTlBySteelGrades(@Param("steelGrades") String[] steelGrades,@Param("yieldStrens") Long[] yieldStrens,@Param("thicks") Long[] thicks);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTmBendforce;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 光整机弯辊力Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface SetupTmBendforceMapper
|
||||
{
|
||||
/**
|
||||
* 查询光整机弯辊力
|
||||
*
|
||||
* @param width 光整机弯辊力主键
|
||||
* @return 光整机弯辊力
|
||||
*/
|
||||
public SetupTmBendforce selectSetupTmBendforceByWidth(@Param("width") Long width,@Param("rollForce") Long rollForce);
|
||||
|
||||
/**
|
||||
* 查询光整机弯辊力列表
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 光整机弯辊力集合
|
||||
*/
|
||||
public List<SetupTmBendforce> selectSetupTmBendforceList(SetupTmBendforce setupTmBendforce);
|
||||
|
||||
/**
|
||||
* 新增光整机弯辊力
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTmBendforce(SetupTmBendforce setupTmBendforce);
|
||||
|
||||
/**
|
||||
* 修改光整机弯辊力
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTmBendforce(SetupTmBendforce setupTmBendforce);
|
||||
|
||||
/**
|
||||
* 删除光整机弯辊力
|
||||
*
|
||||
* @param width 光整机弯辊力主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmBendforceByWidth(Long width);
|
||||
|
||||
/**
|
||||
* 批量删除光整机弯辊力
|
||||
*
|
||||
* @param widths 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmBendforceByWidths(@Param("widths") Long[] widths,@Param("rollForces") Long[] rollForces);
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTmMesh;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 光整机插入量Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface SetupTmMeshMapper
|
||||
{
|
||||
/**
|
||||
* 查询光整机插入量
|
||||
*
|
||||
* @param steelGrade 光整机插入量主键
|
||||
* @return 光整机插入量
|
||||
*/
|
||||
public SetupTmMesh selectSetupTmMeshBySteelGrade(@Param("steelGrade") String steelGrade,@Param("yieldStren") Long yieldStren,@Param("thick") Long thick);
|
||||
|
||||
/**
|
||||
* 查询光整机插入量列表
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 光整机插入量集合
|
||||
*/
|
||||
public List<SetupTmMesh> selectSetupTmMeshList(SetupTmMesh setupTmMesh);
|
||||
|
||||
/**
|
||||
* 新增光整机插入量
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTmMesh(SetupTmMesh setupTmMesh);
|
||||
|
||||
/**
|
||||
* 修改光整机插入量
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTmMesh(SetupTmMesh setupTmMesh);
|
||||
|
||||
/**
|
||||
* 删除光整机插入量
|
||||
*
|
||||
* @param steelGrade 光整机插入量主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmMeshBySteelGrade(String steelGrade);
|
||||
|
||||
/**
|
||||
* 批量删除光整机插入量
|
||||
*
|
||||
* @param steelGrades 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmMeshBySteelGrades(@Param("steelGrades") String[] steelGrades,
|
||||
@Param("yieldStrens") Long[] yieldStrens,
|
||||
@Param("thicks") Long[] thicks);
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.fizz.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTmRollforce;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 光整机轧制力Mapper接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface SetupTmRollforceMapper
|
||||
{
|
||||
/**
|
||||
* 查询光整机轧制力
|
||||
*
|
||||
* @param steelGrade 光整机轧制力主键
|
||||
* @return 光整机轧制力
|
||||
*/
|
||||
public SetupTmRollforce selectSetupTmRollforceBySteelGrade(@Param("steelGrade") String steelGrade,@Param("yieldStren") Long yieldStren,@Param("thick") Long thick,@Param("elong") Long elong);
|
||||
|
||||
/**
|
||||
* 查询光整机轧制力列表
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 光整机轧制力集合
|
||||
*/
|
||||
public List<SetupTmRollforce> selectSetupTmRollforceList(SetupTmRollforce setupTmRollforce);
|
||||
|
||||
/**
|
||||
* 新增光整机轧制力
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTmRollforce(SetupTmRollforce setupTmRollforce);
|
||||
|
||||
/**
|
||||
* 修改光整机轧制力
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTmRollforce(SetupTmRollforce setupTmRollforce);
|
||||
|
||||
/**
|
||||
* 删除光整机轧制力
|
||||
*
|
||||
* @param steelGrade 光整机轧制力主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmRollforceBySteelGrade(String steelGrade);
|
||||
|
||||
/**
|
||||
* 批量删除光整机轧制力
|
||||
*
|
||||
* @param steelGrades 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmRollforceBySteelGrades(@Param("steelGrades") String[] steelGrades,
|
||||
@Param("thicks") Long[] thicks,
|
||||
@Param("yieldStrens") Long[] yieldStrens,
|
||||
@Param("elongs") Long[] elongs);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.fizz.business.schedule;
|
||||
|
||||
import com.fizz.business.service.DeviceSnapshotService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 设备数据快照定时任务
|
||||
* 每5分钟执行一次设备数据快照
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceSnapshotSchedule {
|
||||
|
||||
private final DeviceSnapshotService deviceSnapshotService;
|
||||
|
||||
/**
|
||||
* 每5分钟执行一次设备数据快照
|
||||
* 使用cron表达式:0 0/5 * * * ?
|
||||
* 表示每5分钟执行一次,在每分钟的0秒触发
|
||||
*/
|
||||
@Scheduled(cron = "0 0/5 * * * ?")
|
||||
public void captureDeviceSnapshots() {
|
||||
try {
|
||||
log.info("========== 开始执行设备数据快照任务 ==========");
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
// 创建设备数据快照
|
||||
deviceSnapshotService.createDeviceSnapshots();
|
||||
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("========== 设备数据快照任务执行完成,耗时:{}ms ==========", (endTime - startTime));
|
||||
} catch (Exception e) {
|
||||
log.error("========== 执行设备数据快照任务失败: {} ==========", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,883 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fizz.business.constants.enums.DeviceEnum;
|
||||
import com.fizz.business.constants.enums.WsTypeEnum;
|
||||
import com.fizz.business.domain.DeviceSnapshot;
|
||||
import com.fizz.business.domain.msg.*;
|
||||
import com.fizz.business.dto.DeviceChartDataDTO;
|
||||
import com.fizz.business.dto.DeviceFieldTrendDTO;
|
||||
import com.fizz.business.dto.DeviceHistoryTrendDTO;
|
||||
import com.fizz.business.mapper.DeviceSnapshotMapper;
|
||||
import com.fizz.business.utils.WebSocketUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 设备数据快照服务
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceSnapshotService {
|
||||
|
||||
// 使用ConcurrentHashMap存储最新的测量数据
|
||||
private final Map<Class<?>, OpcMessage> latestMeasurements = new ConcurrentHashMap<>();
|
||||
private final DeviceSnapshotMapper deviceSnapshotMapper;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* 最近一次成功创建设备快照的时间(用于兜底触发,避免完全依赖调度器)
|
||||
*/
|
||||
private volatile LocalDateTime lastSnapshotTime;
|
||||
|
||||
/**
|
||||
* 更新最新的测量数据
|
||||
* @param message 测量数据消息
|
||||
*/
|
||||
public void updateLatestMeasurement(OpcMessage message) {
|
||||
if (message != null) {
|
||||
latestMeasurements.put(message.getClass(), message);
|
||||
log.trace("更新测量数据缓存: {}", message.getClass().getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 由实时测量处理链路兜底触发快照创建:
|
||||
* - 与定时任务互不冲突
|
||||
* - 仅当距离上次快照 >= 5 分钟时才真正落库
|
||||
*/
|
||||
public void captureSnapshotIfNeeded() {
|
||||
try {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime last = lastSnapshotTime;
|
||||
if (last == null || java.time.Duration.between(last, now).toMinutes() >= 5) {
|
||||
createDeviceSnapshots();
|
||||
lastSnapshotTime = now;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("兜底创建设备数据快照失败: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建当前所有设备的数据快照
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createDeviceSnapshots() {
|
||||
try {
|
||||
// 获取当前时间戳
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
log.info("开始创建设备快照,当前时间: {}, latestMeasurements缓存大小: {}", now, latestMeasurements.size());
|
||||
|
||||
// 获取最新的测量数据
|
||||
AppMeasureEntryMessage entry = (AppMeasureEntryMessage) latestMeasurements.get(AppMeasureEntryMessage.class);
|
||||
AppMeasureFurnaceMessage furnace = (AppMeasureFurnaceMessage) latestMeasurements.get(AppMeasureFurnaceMessage.class);
|
||||
AppMeasureCoatMessage coat = (AppMeasureCoatMessage) latestMeasurements.get(AppMeasureCoatMessage.class);
|
||||
AppMeasureExitMessage exit = (AppMeasureExitMessage) latestMeasurements.get(AppMeasureExitMessage.class);
|
||||
|
||||
log.info("测量数据状态 - entry: {}, furnace: {}, coat: {}, exit: {}",
|
||||
entry != null ? "有数据" : "null",
|
||||
furnace != null ? "有数据" : "null",
|
||||
coat != null ? "有数据" : "null",
|
||||
exit != null ? "有数据" : "null");
|
||||
|
||||
if (entry == null && furnace == null && coat == null && exit == null) {
|
||||
log.warn("没有可用的测量数据,跳过快照创建。latestMeasurements缓存内容: {}", latestMeasurements.keySet());
|
||||
return;
|
||||
}
|
||||
|
||||
// 为每个设备创建快照
|
||||
List<DeviceSnapshot> snapshots = new ArrayList<>();
|
||||
int deviceCount = 0;
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
deviceCount++;
|
||||
try {
|
||||
DeviceSnapshot snapshot = createDeviceSnapshot(device, now, entry, furnace, coat, exit);
|
||||
if (snapshot != null) {
|
||||
snapshots.add(snapshot);
|
||||
log.debug("设备[{}]快照创建成功", device.name());
|
||||
} else {
|
||||
log.debug("设备[{}]快照返回null(可能没有对应数据)", device.name());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("创建设备[{}]快照失败: {}", device.name(), e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
log.info("共处理{}个设备,成功创建{}个快照", deviceCount, snapshots.size());
|
||||
|
||||
// 批量保存快照
|
||||
if (!snapshots.isEmpty()) {
|
||||
int savedCount = 0;
|
||||
for (DeviceSnapshot snapshot : snapshots) {
|
||||
try {
|
||||
int result = deviceSnapshotMapper.insert(snapshot);
|
||||
if (result > 0) {
|
||||
savedCount++;
|
||||
log.debug("设备快照保存成功: deviceCode={}, createTime={}",
|
||||
snapshot.getDeviceCode(), snapshot.getCreateTime());
|
||||
} else {
|
||||
log.warn("设备快照保存失败(insert返回0): deviceCode={}", snapshot.getDeviceCode());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("保存设备快照到数据库失败: deviceCode={}, error={}",
|
||||
snapshot.getDeviceCode(), e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
log.info("成功保存{}个设备数据快照到数据库", savedCount);
|
||||
|
||||
// 推送所有设备的历史趋势数据
|
||||
pushAllDevicesHistoryTrend();
|
||||
|
||||
// 推送设备统计数据
|
||||
pushAllChartData();
|
||||
|
||||
// 推送每个设备每个字段的趋势数据(供前端画"点位趋势小图")
|
||||
pushAllDeviceFieldTrends();
|
||||
} else {
|
||||
log.warn("没有可保存的快照数据,所有设备快照创建都返回null");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("创建设备数据快照失败: {}", e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送所有设备的历史趋势数据(今天一天的数据,10分钟间隔)
|
||||
*/
|
||||
public void pushAllDevicesHistoryTrend() {
|
||||
try {
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
DeviceHistoryTrendDTO trendData = getDeviceHistoryTrend(device.name());
|
||||
if (trendData != null && trendData.getSeries() != null && !trendData.getSeries().isEmpty()) {
|
||||
WebSocketUtil.sendHistoryTrendMessage(trendData);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送设备历史趋势数据失败: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送设备统计数据
|
||||
*/
|
||||
public void pushAllChartData() {
|
||||
try {
|
||||
DeviceChartDataDTO chartData = buildAllChartData();
|
||||
if (chartData != null) {
|
||||
WebSocketUtil.sendChartDataMessage(chartData);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送统计数据失败: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送每个设备每个字段的趋势数据(今天范围,10分钟间隔采样)
|
||||
*/
|
||||
public void pushAllDeviceFieldTrends() {
|
||||
try {
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
List<String> fields = device.getParamFields();
|
||||
if (fields == null || fields.isEmpty()) continue;
|
||||
for (String field : fields) {
|
||||
DeviceFieldTrendDTO dto = getDeviceFieldTrend(device.name(), field);
|
||||
if (dto != null) {
|
||||
WebSocketUtil.sendDeviceFieldTrendMessage(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送设备字段趋势失败: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 单设备-单字段 今日趋势与统计(10分钟采样)
|
||||
*/
|
||||
public DeviceFieldTrendDTO getDeviceFieldTrend(String deviceCode, String fieldName) {
|
||||
try {
|
||||
DeviceEnum device = DeviceEnum.fromName(deviceCode);
|
||||
if (device == null) return null;
|
||||
|
||||
// 今天范围
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDateTime startTime = today.atStartOfDay();
|
||||
LocalDateTime endTime = today.atTime(LocalTime.MAX);
|
||||
|
||||
// 查询今天的快照
|
||||
LambdaQueryWrapper<DeviceSnapshot> qw = new LambdaQueryWrapper<DeviceSnapshot>()
|
||||
.eq(DeviceSnapshot::getDeviceCode, deviceCode)
|
||||
.between(DeviceSnapshot::getCreateTime, startTime, endTime)
|
||||
.orderByAsc(DeviceSnapshot::getCreateTime);
|
||||
|
||||
List<DeviceSnapshot> rows = deviceSnapshotMapper.selectList(qw);
|
||||
if (rows == null || rows.isEmpty()) return null;
|
||||
|
||||
// 10分钟采样
|
||||
List<DeviceSnapshot> sampled = sampleDataByInterval(rows, 10);
|
||||
|
||||
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
List<String> categories = new ArrayList<>(sampled.size());
|
||||
List<Double> data = new ArrayList<>(sampled.size());
|
||||
|
||||
for (DeviceSnapshot s : sampled) {
|
||||
categories.add(s.getCreateTime().format(timeFormatter));
|
||||
double v = 0.0;
|
||||
try {
|
||||
Map<String, Object> json = objectMapper.readValue(s.getSnapshotData(), Map.class);
|
||||
Object raw = json.get(fieldName);
|
||||
if (raw instanceof Number) v = ((Number) raw).doubleValue();
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
data.add(v);
|
||||
}
|
||||
|
||||
// 统计(忽略全0)
|
||||
List<Double> valid = new ArrayList<>();
|
||||
for (Double v : data) {
|
||||
if (v != null && v != 0.0) valid.add(v);
|
||||
}
|
||||
|
||||
Double avg = null, max = null, min = null;
|
||||
if (!valid.isEmpty()) {
|
||||
double sum = 0;
|
||||
max = valid.get(0);
|
||||
min = valid.get(0);
|
||||
for (Double v : valid) {
|
||||
sum += v;
|
||||
if (v > max) max = v;
|
||||
if (v < min) min = v;
|
||||
}
|
||||
avg = sum / valid.size();
|
||||
}
|
||||
|
||||
Double last = data.isEmpty() ? null : data.get(data.size() - 1);
|
||||
|
||||
return DeviceFieldTrendDTO.builder()
|
||||
.deviceCode(deviceCode)
|
||||
.deviceName(device.getDesc())
|
||||
.fieldName(fieldName)
|
||||
// label/unit 目前后端没有统一来源,这里先留空,前端可用 fieldMeta 补齐
|
||||
.fieldLabel(null)
|
||||
.unit(null)
|
||||
.categories(categories)
|
||||
.data(data)
|
||||
.avg(avg)
|
||||
.max(max)
|
||||
.min(min)
|
||||
.last(last)
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("获取设备字段趋势失败, deviceCode={}, fieldName={}, err={}", deviceCode, fieldName, e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建设备图表数据
|
||||
*/
|
||||
private DeviceChartDataDTO buildAllChartData() {
|
||||
try {
|
||||
// 1. 设备类型分布饼图
|
||||
DeviceChartDataDTO.PieChartData pieChartData = buildDeviceTypePieChart();
|
||||
|
||||
// 2. 数据来源分布条形图
|
||||
DeviceChartDataDTO.BarChartData barChartData = buildSourceTypeBarChart();
|
||||
|
||||
// 3. 同类型设备对比折线图(只对比单位相同的设备)
|
||||
DeviceChartDataDTO.LineChartData lineChartData = buildSameTypeDeviceCompareChart();
|
||||
|
||||
// 4. 设备统计数据
|
||||
List<DeviceChartDataDTO.DeviceStatistics> statistics = buildDeviceStatistics();
|
||||
|
||||
return DeviceChartDataDTO.builder()
|
||||
.deviceTypePieChart(pieChartData)
|
||||
.sourceTypeBarChart(barChartData)
|
||||
.sameTypeDeviceCompareChart(lineChartData)
|
||||
.deviceStatistics(statistics)
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
log.error("构建图表数据失败: {}", e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建设备类型分布饼图数据
|
||||
*/
|
||||
private DeviceChartDataDTO.PieChartData buildDeviceTypePieChart() {
|
||||
Map<String, Integer> distribution = new HashMap<>();
|
||||
distribution.put("入口段", 0);
|
||||
distribution.put("处理段", 0);
|
||||
distribution.put("出口段", 0);
|
||||
distribution.put("其他", 0);
|
||||
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
String sectionType = device.getSectionType().name();
|
||||
if ("ENTRY".equals(sectionType)) {
|
||||
distribution.put("入口段", distribution.get("入口段") + 1);
|
||||
} else if ("PROCESS".equals(sectionType)) {
|
||||
distribution.put("处理段", distribution.get("处理段") + 1);
|
||||
} else if ("EXIT".equals(sectionType)) {
|
||||
distribution.put("出口段", distribution.get("出口段") + 1);
|
||||
} else {
|
||||
distribution.put("其他", distribution.get("其他") + 1);
|
||||
}
|
||||
}
|
||||
|
||||
String[] colors = {"#0066cc", "#409eff", "#66b1ff", "#a0cfff"};
|
||||
List<DeviceChartDataDTO.PieSeries> series = new ArrayList<>();
|
||||
int colorIndex = 0;
|
||||
|
||||
for (Map.Entry<String, Integer> entry : distribution.entrySet()) {
|
||||
if (entry.getValue() > 0) {
|
||||
series.add(DeviceChartDataDTO.PieSeries.builder()
|
||||
.name(entry.getKey())
|
||||
.data(entry.getValue().doubleValue())
|
||||
.color(colors[colorIndex % colors.length])
|
||||
.build());
|
||||
colorIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
return DeviceChartDataDTO.PieChartData.builder()
|
||||
.series(series)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建数据来源分布条形图数据
|
||||
*/
|
||||
private DeviceChartDataDTO.BarChartData buildSourceTypeBarChart() {
|
||||
Map<String, Integer> distribution = new HashMap<>();
|
||||
distribution.put("ENTRY", 0);
|
||||
distribution.put("FURNACE", 0);
|
||||
distribution.put("COAT", 0);
|
||||
distribution.put("EXIT", 0);
|
||||
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
String sourceType = device.getSourceType().name();
|
||||
if (distribution.containsKey(sourceType)) {
|
||||
distribution.put(sourceType, distribution.get(sourceType) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> categories = new ArrayList<>();
|
||||
List<Double> data = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, Integer> entry : distribution.entrySet()) {
|
||||
if (entry.getValue() > 0) {
|
||||
categories.add(entry.getKey());
|
||||
data.add(entry.getValue().doubleValue());
|
||||
}
|
||||
}
|
||||
|
||||
return DeviceChartDataDTO.BarChartData.builder()
|
||||
.categories(categories)
|
||||
.series(Collections.singletonList(
|
||||
DeviceChartDataDTO.BarSeries.builder()
|
||||
.name("设备数量")
|
||||
.data(data)
|
||||
.build()
|
||||
))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建同类型设备对比折线图数据(只对比单位相同的设备)
|
||||
*/
|
||||
private DeviceChartDataDTO.LineChartData buildSameTypeDeviceCompareChart() {
|
||||
// 获取今天的数据
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDateTime startTime = today.atStartOfDay();
|
||||
LocalDateTime endTime = today.atTime(LocalTime.MAX);
|
||||
|
||||
// 按数据来源分组,同一来源的设备单位相同,可以对比
|
||||
Map<String, List<DeviceEnum>> devicesBySource = new HashMap<>();
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
if (device.getParamFields() == null || device.getParamFields().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
String sourceType = device.getSourceType().name();
|
||||
devicesBySource.computeIfAbsent(sourceType, k -> new ArrayList<>()).add(device);
|
||||
}
|
||||
|
||||
// 选择设备数量最多的数据源,取前5个设备进行对比
|
||||
String selectedSource = devicesBySource.entrySet().stream()
|
||||
.max(Map.Entry.comparingByValue((a, b) -> Integer.compare(a.size(), b.size())))
|
||||
.map(Map.Entry::getKey)
|
||||
.orElse(null);
|
||||
|
||||
if (selectedSource == null || devicesBySource.get(selectedSource).isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<DeviceEnum> selectedDevices = devicesBySource.get(selectedSource).stream()
|
||||
.limit(5)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<String> categories = new ArrayList<>();
|
||||
List<DeviceChartDataDTO.LineSeries> series = new ArrayList<>();
|
||||
|
||||
// 生成时间轴(最近10个时间点,每10分钟一个)
|
||||
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
for (int i = 9; i >= 0; i--) {
|
||||
LocalDateTime time = now.minusMinutes(i * 10L);
|
||||
categories.add(time.format(timeFormatter));
|
||||
}
|
||||
|
||||
// 为每个设备生成数据系列
|
||||
for (DeviceEnum device : selectedDevices) {
|
||||
if (device.getParamFields() == null || device.getParamFields().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取该设备今天的历史数据
|
||||
LambdaQueryWrapper<DeviceSnapshot> qw = new LambdaQueryWrapper<DeviceSnapshot>()
|
||||
.eq(DeviceSnapshot::getDeviceCode, device.name())
|
||||
.between(DeviceSnapshot::getCreateTime, startTime, endTime)
|
||||
.orderByAsc(DeviceSnapshot::getCreateTime);
|
||||
|
||||
List<DeviceSnapshot> rows = deviceSnapshotMapper.selectList(qw);
|
||||
List<DeviceSnapshot> sampledRows = sampleDataByInterval(rows, 10);
|
||||
|
||||
// 使用第一个字段的数据
|
||||
String firstField = device.getParamFields().get(0);
|
||||
List<Double> data = new ArrayList<>();
|
||||
|
||||
// 填充数据(如果历史数据不足,用0填充)
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (i < sampledRows.size()) {
|
||||
try {
|
||||
Map<String, Object> jsonData = objectMapper.readValue(
|
||||
sampledRows.get(i).getSnapshotData(), Map.class);
|
||||
Object value = jsonData.get(firstField);
|
||||
double numValue = 0.0;
|
||||
if (value instanceof Number) {
|
||||
numValue = ((Number) value).doubleValue();
|
||||
}
|
||||
data.add(numValue);
|
||||
} catch (Exception e) {
|
||||
data.add(0.0);
|
||||
}
|
||||
} else {
|
||||
data.add(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
series.add(DeviceChartDataDTO.LineSeries.builder()
|
||||
.name(device.getDesc())
|
||||
.data(data)
|
||||
.build());
|
||||
}
|
||||
|
||||
if (series.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DeviceChartDataDTO.LineChartData.builder()
|
||||
.categories(categories)
|
||||
.series(series)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建设备统计数据
|
||||
*/
|
||||
private List<DeviceChartDataDTO.DeviceStatistics> buildDeviceStatistics() {
|
||||
List<DeviceChartDataDTO.DeviceStatistics> statistics = new ArrayList<>();
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDateTime startTime = today.atStartOfDay();
|
||||
LocalDateTime endTime = today.atTime(LocalTime.MAX);
|
||||
|
||||
// 获取最新的测量数据
|
||||
AppMeasureEntryMessage entry = (AppMeasureEntryMessage) latestMeasurements.get(AppMeasureEntryMessage.class);
|
||||
AppMeasureFurnaceMessage furnace = (AppMeasureFurnaceMessage) latestMeasurements.get(AppMeasureFurnaceMessage.class);
|
||||
AppMeasureCoatMessage coat = (AppMeasureCoatMessage) latestMeasurements.get(AppMeasureCoatMessage.class);
|
||||
AppMeasureExitMessage exit = (AppMeasureExitMessage) latestMeasurements.get(AppMeasureExitMessage.class);
|
||||
|
||||
for (DeviceEnum device : DeviceEnum.values()) {
|
||||
if (device.getParamFields() == null || device.getParamFields().isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String firstField = device.getParamFields().get(0);
|
||||
|
||||
// 获取当前值
|
||||
double currentValue = 0.0;
|
||||
switch (device.getSourceType()) {
|
||||
case ENTRY:
|
||||
if (entry != null) {
|
||||
currentValue = getFieldValue(entry, firstField);
|
||||
}
|
||||
break;
|
||||
case FURNACE:
|
||||
if (furnace != null) {
|
||||
currentValue = getFieldValue(furnace, firstField);
|
||||
}
|
||||
break;
|
||||
case COAT:
|
||||
if (coat != null) {
|
||||
currentValue = getFieldValue(coat, firstField);
|
||||
}
|
||||
break;
|
||||
case EXIT:
|
||||
if (exit != null) {
|
||||
currentValue = getFieldValue(exit, firstField);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// 从历史数据中计算统计值
|
||||
LambdaQueryWrapper<DeviceSnapshot> qw = new LambdaQueryWrapper<DeviceSnapshot>()
|
||||
.eq(DeviceSnapshot::getDeviceCode, device.name())
|
||||
.between(DeviceSnapshot::getCreateTime, startTime, endTime)
|
||||
.orderByAsc(DeviceSnapshot::getCreateTime);
|
||||
|
||||
List<DeviceSnapshot> rows = deviceSnapshotMapper.selectList(qw);
|
||||
List<Double> values = new ArrayList<>();
|
||||
|
||||
for (DeviceSnapshot snapshot : rows) {
|
||||
try {
|
||||
Map<String, Object> jsonData = objectMapper.readValue(
|
||||
snapshot.getSnapshotData(), Map.class);
|
||||
Object value = jsonData.get(firstField);
|
||||
if (value instanceof Number) {
|
||||
double numValue = ((Number) value).doubleValue();
|
||||
if (numValue > 0) {
|
||||
values.add(numValue);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
String avg = "—";
|
||||
String max = "—";
|
||||
String min = "—";
|
||||
|
||||
if (!values.isEmpty()) {
|
||||
double avgValue = values.stream().mapToDouble(Double::doubleValue).average().orElse(0.0);
|
||||
double maxValue = values.stream().mapToDouble(Double::doubleValue).max().orElse(0.0);
|
||||
double minValue = values.stream().mapToDouble(Double::doubleValue).min().orElse(0.0);
|
||||
|
||||
avg = String.format("%.2f", avgValue);
|
||||
max = String.format("%.2f", maxValue);
|
||||
min = String.format("%.2f", minValue);
|
||||
}
|
||||
|
||||
statistics.add(DeviceChartDataDTO.DeviceStatistics.builder()
|
||||
.deviceCode(device.name())
|
||||
.deviceName(device.getDesc())
|
||||
.avg(avg)
|
||||
.max(max)
|
||||
.min(min)
|
||||
.current(currentValue > 0 ? String.format("%.2f", currentValue) : "—")
|
||||
.build());
|
||||
}
|
||||
|
||||
return statistics;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字段值
|
||||
*/
|
||||
private double getFieldValue(Object message, String fieldName) {
|
||||
try {
|
||||
java.lang.reflect.Field field = message.getClass().getDeclaredField(fieldName);
|
||||
field.setAccessible(true);
|
||||
Object value = field.get(message);
|
||||
if (value instanceof Number) {
|
||||
return ((Number) value).doubleValue();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备今天一天的历史趋势数据(10分钟间隔采样)
|
||||
* @param deviceCode 设备代码
|
||||
* @return 历史趋势数据
|
||||
*/
|
||||
public DeviceHistoryTrendDTO getDeviceHistoryTrend(String deviceCode) {
|
||||
try {
|
||||
// 获取今天开始和结束时间
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDateTime startTime = today.atStartOfDay();
|
||||
LocalDateTime endTime = today.atTime(LocalTime.MAX);
|
||||
|
||||
// 查询今天的所有快照数据
|
||||
LambdaQueryWrapper<DeviceSnapshot> qw = new LambdaQueryWrapper<DeviceSnapshot>()
|
||||
.eq(DeviceSnapshot::getDeviceCode, deviceCode)
|
||||
.between(DeviceSnapshot::getCreateTime, startTime, endTime)
|
||||
.orderByAsc(DeviceSnapshot::getCreateTime);
|
||||
|
||||
List<DeviceSnapshot> rows = deviceSnapshotMapper.selectList(qw);
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 按10分钟间隔采样数据
|
||||
List<DeviceSnapshot> sampledRows = sampleDataByInterval(rows, 10);
|
||||
|
||||
// 获取设备信息
|
||||
DeviceEnum device = DeviceEnum.valueOf(deviceCode);
|
||||
if (device == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 构建历史趋势数据
|
||||
List<String> categories = new ArrayList<>();
|
||||
Map<String, List<Double>> seriesMap = new HashMap<>();
|
||||
List<String> fields = device.getParamFields();
|
||||
|
||||
if (fields == null || fields.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 初始化系列数据
|
||||
for (String field : fields) {
|
||||
seriesMap.put(field, new ArrayList<>());
|
||||
}
|
||||
|
||||
// 处理采样后的数据
|
||||
DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
for (DeviceSnapshot snapshot : sampledRows) {
|
||||
categories.add(snapshot.getCreateTime().format(timeFormatter));
|
||||
|
||||
Map<String, Object> jsonData = new HashMap<>();
|
||||
try {
|
||||
jsonData = objectMapper.readValue(snapshot.getSnapshotData(), Map.class);
|
||||
} catch (Exception e) {
|
||||
log.warn("解析快照数据失败: {}", snapshot.getSnapshotData());
|
||||
}
|
||||
|
||||
for (String field : fields) {
|
||||
Object value = jsonData.get(field);
|
||||
double numValue = 0.0;
|
||||
if (value instanceof Number) {
|
||||
numValue = ((Number) value).doubleValue();
|
||||
}
|
||||
seriesMap.get(field).add(numValue);
|
||||
}
|
||||
}
|
||||
|
||||
// 构建系列数据(最多6个字段)
|
||||
List<DeviceHistoryTrendDTO.SeriesData> series = fields.stream()
|
||||
.limit(6)
|
||||
.map(field -> DeviceHistoryTrendDTO.SeriesData.builder()
|
||||
.fieldName(field)
|
||||
.name(field) // 前端可以根据字段元数据替换为标签
|
||||
.data(seriesMap.get(field))
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return DeviceHistoryTrendDTO.builder()
|
||||
.deviceCode(deviceCode)
|
||||
.deviceName(device.getDesc())
|
||||
.categories(categories)
|
||||
.series(series)
|
||||
.build();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("获取设备[{}]历史趋势数据失败: {}", deviceCode, e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按时间间隔采样数据(每N分钟取一条)
|
||||
* @param rows 原始数据列表
|
||||
* @param intervalMinutes 间隔分钟数
|
||||
* @return 采样后的数据列表
|
||||
*/
|
||||
private List<DeviceSnapshot> sampleDataByInterval(List<DeviceSnapshot> rows, int intervalMinutes) {
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
List<DeviceSnapshot> sampled = new ArrayList<>();
|
||||
LocalDateTime lastTime = null;
|
||||
|
||||
for (DeviceSnapshot row : rows) {
|
||||
LocalDateTime rowTime = row.getCreateTime();
|
||||
|
||||
if (lastTime == null) {
|
||||
// 第一条数据
|
||||
sampled.add(row);
|
||||
lastTime = rowTime;
|
||||
} else {
|
||||
// 计算时间差(分钟)
|
||||
long diffMinutes = java.time.Duration.between(lastTime, rowTime).toMinutes();
|
||||
|
||||
// 如果时间差大于等于间隔,则采样这条数据
|
||||
if (diffMinutes >= intervalMinutes) {
|
||||
sampled.add(row);
|
||||
lastTime = rowTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sampled;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建设备快照
|
||||
*/
|
||||
private DeviceSnapshot createDeviceSnapshot(DeviceEnum device, LocalDateTime timestamp,
|
||||
AppMeasureEntryMessage entry,
|
||||
AppMeasureFurnaceMessage furnace,
|
||||
AppMeasureCoatMessage coat,
|
||||
AppMeasureExitMessage exit) {
|
||||
try {
|
||||
// 创建快照对象
|
||||
DeviceSnapshot snapshot = new DeviceSnapshot();
|
||||
snapshot.setCreateTime(timestamp);
|
||||
snapshot.setDeviceId(device.getIdx());
|
||||
snapshot.setDeviceCode(device.name());
|
||||
snapshot.setDeviceName(device.getDesc());
|
||||
snapshot.setSectionType(device.getSectionType().name());
|
||||
snapshot.setSourceType(device.getSourceType().name());
|
||||
|
||||
List<String> paramFields = device.getParamFields();
|
||||
log.debug("设备[{}]参数字段列表: {}", device.name(), paramFields);
|
||||
|
||||
// 根据设备类型获取对应的测量数据
|
||||
ObjectNode dataNode = objectMapper.createObjectNode();
|
||||
switch (device.getSourceType()) {
|
||||
case ENTRY:
|
||||
if (entry != null) {
|
||||
extractData(entry, paramFields, dataNode);
|
||||
log.debug("设备[{}]从ENTRY提取数据,dataNode大小: {}", device.name(), dataNode.size());
|
||||
} else {
|
||||
log.debug("设备[{}]需要ENTRY数据,但entry为null", device.name());
|
||||
}
|
||||
break;
|
||||
case FURNACE:
|
||||
if (furnace != null) {
|
||||
extractData(furnace, paramFields, dataNode);
|
||||
log.debug("设备[{}]从FURNACE提取数据,dataNode大小: {}", device.name(), dataNode.size());
|
||||
} else {
|
||||
log.debug("设备[{}]需要FURNACE数据,但furnace为null", device.name());
|
||||
}
|
||||
break;
|
||||
case COAT:
|
||||
if (coat != null) {
|
||||
extractData(coat, paramFields, dataNode);
|
||||
log.debug("设备[{}]从COAT提取数据,dataNode大小: {}", device.name(), dataNode.size());
|
||||
} else {
|
||||
log.debug("设备[{}]需要COAT数据,但coat为null", device.name());
|
||||
}
|
||||
break;
|
||||
case EXIT:
|
||||
if (exit != null) {
|
||||
extractData(exit, paramFields, dataNode);
|
||||
log.debug("设备[{}]从EXIT提取数据,dataNode大小: {}", device.name(), dataNode.size());
|
||||
} else {
|
||||
log.debug("设备[{}]需要EXIT数据,但exit为null", device.name());
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// 如果没有数据,则跳过
|
||||
if (dataNode.isEmpty()) {
|
||||
log.debug("设备[{}]快照数据为空,跳过快照创建", device.name());
|
||||
return null;
|
||||
}
|
||||
|
||||
// 设置快照数据
|
||||
snapshot.setSnapshotData(dataNode.toString());
|
||||
log.debug("设备[{}]快照创建成功,数据长度: {}", device.name(), dataNode.toString().length());
|
||||
return snapshot;
|
||||
} catch (Exception e) {
|
||||
log.error("创建设备[{}]快照时发生错误: {}", device.name(), e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从消息对象中提取指定字段的数据
|
||||
*/
|
||||
private void extractData(Object message, List<String> fields, ObjectNode dataNode) {
|
||||
if (message == null || fields == null || fields.isEmpty()) {
|
||||
log.debug("extractData参数无效: message={}, fields={}",
|
||||
message != null ? message.getClass().getSimpleName() : "null",
|
||||
fields != null ? fields.size() : "null");
|
||||
return;
|
||||
}
|
||||
|
||||
int extractedCount = 0;
|
||||
try {
|
||||
for (String field : fields) {
|
||||
try {
|
||||
// 使用反射获取字段值
|
||||
java.lang.reflect.Field declaredField = message.getClass().getDeclaredField(field);
|
||||
declaredField.setAccessible(true);
|
||||
Object value = declaredField.get(message);
|
||||
|
||||
// 处理不同类型的值
|
||||
if (value != null) {
|
||||
if (value instanceof Integer) {
|
||||
dataNode.put(field, (Integer) value);
|
||||
extractedCount++;
|
||||
} else if (value instanceof Long) {
|
||||
dataNode.put(field, (Long) value);
|
||||
extractedCount++;
|
||||
} else if (value instanceof Float) {
|
||||
dataNode.put(field, (Float) value);
|
||||
extractedCount++;
|
||||
} else if (value instanceof Double) {
|
||||
dataNode.put(field, (Double) value);
|
||||
extractedCount++;
|
||||
} else if (value instanceof Boolean) {
|
||||
dataNode.put(field, (Boolean) value);
|
||||
extractedCount++;
|
||||
} else if (value instanceof String) {
|
||||
dataNode.put(field, (String) value);
|
||||
extractedCount++;
|
||||
} else if (value instanceof Enum) {
|
||||
dataNode.put(field, value.toString());
|
||||
extractedCount++;
|
||||
} else if (value instanceof java.math.BigDecimal) {
|
||||
// 处理BigDecimal类型(很多测量字段是BigDecimal)
|
||||
dataNode.put(field, ((java.math.BigDecimal) value).doubleValue());
|
||||
extractedCount++;
|
||||
} else {
|
||||
log.debug("字段[{}]类型[{}]未处理,值: {}", field, value.getClass().getSimpleName(), value);
|
||||
}
|
||||
} else {
|
||||
log.trace("字段[{}]值为null", field);
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
log.trace("字段[{}]在消息[{}]中不存在", field, message.getClass().getSimpleName());
|
||||
} catch (Exception e) {
|
||||
log.warn("获取字段[{}]值失败: {}", field, e.getMessage());
|
||||
}
|
||||
}
|
||||
log.debug("从[{}]提取了{}个字段,共{}个字段",
|
||||
message.getClass().getSimpleName(), extractedCount, fields.size());
|
||||
} catch (Exception e) {
|
||||
log.error("提取数据时发生错误: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fizz.business.domain.PdiSetups;
|
||||
import com.fizz.business.domain.ProStoppage;
|
||||
import com.fizz.business.domain.msg.PdiSetup;
|
||||
|
||||
|
||||
/**
|
||||
* 生产计划的参数详情Service接口
|
||||
@@ -16,50 +15,28 @@ import com.fizz.business.domain.msg.PdiSetup;
|
||||
public interface IPdiSetupService extends IService<PdiSetups>
|
||||
{
|
||||
/**
|
||||
* 查询生产计划的参数详情
|
||||
*
|
||||
* @param id 生产计划的参数详情主键
|
||||
* @return 生产计划的参数详情
|
||||
* 查询张力参数列表
|
||||
*/
|
||||
public PdiSetups selectPdiSetupByid(Long id);
|
||||
List<PdiSetups> selectPdiSetupList(PdiSetups pdiSetup);
|
||||
|
||||
/**
|
||||
* 查询生产计划的参数详情列表
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 生产计划的参数详情集合
|
||||
* 按 id 查询
|
||||
*/
|
||||
public List<PdiSetups> selectPdiSetupList(PdiSetups pdiSetup);
|
||||
PdiSetups selectPdiSetupById(Long id);
|
||||
|
||||
/**
|
||||
* 新增生产计划的参数详情
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 结果
|
||||
* 新增
|
||||
*/
|
||||
public Boolean insertPdiSetup(PdiSetups pdiSetup);
|
||||
Boolean insertPdiSetup(PdiSetups pdiSetup);
|
||||
|
||||
/**
|
||||
* 修改生产计划的参数详情
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 结果
|
||||
* 按 id 更新
|
||||
*/
|
||||
public Boolean updatePdiSetup(PdiSetups pdiSetup);
|
||||
Boolean updatePdiSetup(PdiSetups pdiSetup);
|
||||
|
||||
/**
|
||||
* 批量删除生产计划的参数详情
|
||||
*
|
||||
* @param ids 需要删除的生产计划的参数详情主键集合
|
||||
* @return 结果
|
||||
* 按 id 批量删除
|
||||
*/
|
||||
public Boolean deletePdiSetupByids(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除生产计划的参数详情信息
|
||||
*
|
||||
* @param id 生产计划的参数详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public Boolean deletePdiSetupByid(Long id);
|
||||
Boolean deletePdiSetupByIds(Long[] ids);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTensionAllLine;
|
||||
|
||||
/**
|
||||
* 全线张力Service接口
|
||||
*/
|
||||
public interface ISetupTensionAllLineService
|
||||
{
|
||||
SetupTensionAllLine selectByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
|
||||
List<SetupTensionAllLine> selectList(SetupTensionAllLine query);
|
||||
|
||||
int insert(SetupTensionAllLine entity);
|
||||
|
||||
int updateByKey(SetupTensionAllLine entity);
|
||||
|
||||
int deleteByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTensionAnnealingFurnace;
|
||||
|
||||
/**
|
||||
* 退火炉张力Service接口
|
||||
*/
|
||||
public interface ISetupTensionAnnealingFurnaceService
|
||||
{
|
||||
SetupTensionAnnealingFurnace selectByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
|
||||
List<SetupTensionAnnealingFurnace> selectList(SetupTensionAnnealingFurnace query);
|
||||
|
||||
int insert(SetupTensionAnnealingFurnace entity);
|
||||
|
||||
int updateByKey(SetupTensionAnnealingFurnace entity);
|
||||
|
||||
int deleteByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTensionLeveler;
|
||||
|
||||
/**
|
||||
* 平整机张力Service接口
|
||||
*/
|
||||
public interface ISetupTensionLevelerService
|
||||
{
|
||||
SetupTensionLeveler selectByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
|
||||
List<SetupTensionLeveler> selectList(SetupTensionLeveler query);
|
||||
|
||||
int insert(SetupTensionLeveler entity);
|
||||
|
||||
int updateByKey(SetupTensionLeveler entity);
|
||||
|
||||
int deleteByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTension;
|
||||
|
||||
/**
|
||||
* 全线张力Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface ISetupTensionService
|
||||
{
|
||||
/**
|
||||
* 查询全线张力
|
||||
*
|
||||
* @param thick 全线张力主键
|
||||
* @return 全线张力
|
||||
*/
|
||||
public SetupTension selectSetupTensionByThick(Long thick,Long yieldStren);
|
||||
|
||||
/**
|
||||
* 查询全线张力列表
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 全线张力集合
|
||||
*/
|
||||
public List<SetupTension> selectSetupTensionList(SetupTension setupTension);
|
||||
|
||||
/**
|
||||
* 新增全线张力
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTension(SetupTension setupTension);
|
||||
|
||||
/**
|
||||
* 修改全线张力
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTension(SetupTension setupTension);
|
||||
|
||||
/**
|
||||
* 批量删除全线张力
|
||||
*
|
||||
* @param thicks 需要删除的全线张力主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTensionByThicks(Long[] thicks,Long[] yieldStrens );
|
||||
|
||||
/**
|
||||
* 删除全线张力信息
|
||||
*
|
||||
* @param thick 全线张力主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTensionByThick(Long thick);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTensionStraightener;
|
||||
|
||||
/**
|
||||
* 矫直机张力Service接口
|
||||
*/
|
||||
public interface ISetupTensionStraightenerService
|
||||
{
|
||||
SetupTensionStraightener selectByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
|
||||
List<SetupTensionStraightener> selectList(SetupTensionStraightener query);
|
||||
|
||||
int insert(SetupTensionStraightener entity);
|
||||
|
||||
int updateByKey(SetupTensionStraightener entity);
|
||||
|
||||
int deleteByKey(String steelGrade, Float thick, Float yieldStren);
|
||||
}
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTl;
|
||||
|
||||
/**
|
||||
* 拉矫机参数Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface ISetupTlService
|
||||
{
|
||||
/**
|
||||
* 查询拉矫机参数
|
||||
*
|
||||
* @param steelGrade 拉矫机参数主键
|
||||
* @return 拉矫机参数
|
||||
*/
|
||||
public SetupTl selectSetupTlBySteelGrade(String steelGrade,Long yieldStren,Long thick);
|
||||
|
||||
/**
|
||||
* 查询拉矫机参数列表
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 拉矫机参数集合
|
||||
*/
|
||||
public List<SetupTl> selectSetupTlList(SetupTl setupTl);
|
||||
|
||||
/**
|
||||
* 新增拉矫机参数
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTl(SetupTl setupTl);
|
||||
|
||||
/**
|
||||
* 修改拉矫机参数
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTl(SetupTl setupTl);
|
||||
|
||||
/**
|
||||
* 批量删除拉矫机参数
|
||||
*
|
||||
* @param steelGrades 需要删除的拉矫机参数主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTlBySteelGrades(String[] steelGrades,Long[] yieldStrens,Long[] thicks);
|
||||
|
||||
/**
|
||||
* 删除拉矫机参数信息
|
||||
*
|
||||
* @param steelGrade 拉矫机参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTlBySteelGrade(String steelGrade);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTmBendforce;
|
||||
|
||||
/**
|
||||
* 光整机弯辊力Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface ISetupTmBendforceService
|
||||
{
|
||||
/**
|
||||
* 查询光整机弯辊力
|
||||
*
|
||||
* @param width 光整机弯辊力主键
|
||||
* @return 光整机弯辊力
|
||||
*/
|
||||
public SetupTmBendforce selectSetupTmBendforceByWidth(Long width,Long rollForce);
|
||||
|
||||
/**
|
||||
* 查询光整机弯辊力列表
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 光整机弯辊力集合
|
||||
*/
|
||||
public List<SetupTmBendforce> selectSetupTmBendforceList(SetupTmBendforce setupTmBendforce);
|
||||
|
||||
/**
|
||||
* 新增光整机弯辊力
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTmBendforce(SetupTmBendforce setupTmBendforce);
|
||||
|
||||
/**
|
||||
* 修改光整机弯辊力
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTmBendforce(SetupTmBendforce setupTmBendforce);
|
||||
|
||||
/**
|
||||
* 批量删除光整机弯辊力
|
||||
*
|
||||
* @param widths 需要删除的光整机弯辊力主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmBendforceByWidths(Long[] widths,Long[] rollForces);
|
||||
|
||||
/**
|
||||
* 删除光整机弯辊力信息
|
||||
*
|
||||
* @param width 光整机弯辊力主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmBendforceByWidth(Long width);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTmMesh;
|
||||
|
||||
/**
|
||||
* 光整机插入量Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface ISetupTmMeshService
|
||||
{
|
||||
/**
|
||||
* 查询光整机插入量
|
||||
*
|
||||
* @param steelGrade 光整机插入量主键
|
||||
* @return 光整机插入量
|
||||
*/
|
||||
public SetupTmMesh selectSetupTmMeshBySteelGrade(String steelGrade,Long yildStren,Long thick);
|
||||
|
||||
/**
|
||||
* 查询光整机插入量列表
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 光整机插入量集合
|
||||
*/
|
||||
public List<SetupTmMesh> selectSetupTmMeshList(SetupTmMesh setupTmMesh);
|
||||
|
||||
/**
|
||||
* 新增光整机插入量
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTmMesh(SetupTmMesh setupTmMesh);
|
||||
|
||||
/**
|
||||
* 修改光整机插入量
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTmMesh(SetupTmMesh setupTmMesh);
|
||||
|
||||
/**
|
||||
* 批量删除光整机插入量
|
||||
*
|
||||
* @param steelGrades 需要删除的光整机插入量主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmMeshBySteelGrades(String[] steelGrades,Long[] yildStrens,Long[] thicks);
|
||||
|
||||
/**
|
||||
* 删除光整机插入量信息
|
||||
*
|
||||
* @param steelGrade 光整机插入量主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmMeshBySteelGrade(String steelGrade);
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fizz.business.domain.SetupTmRollforce;
|
||||
|
||||
/**
|
||||
* 光整机轧制力Service接口
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
public interface ISetupTmRollforceService
|
||||
{
|
||||
/**
|
||||
* 查询光整机轧制力
|
||||
*
|
||||
* @param steelGrade 光整机轧制力主键
|
||||
* @return 光整机轧制力
|
||||
*/
|
||||
public SetupTmRollforce selectSetupTmRollforceBySteelGrade(String steelGrade,Long yieldStren,Long thick,Long elong);
|
||||
|
||||
/**
|
||||
* 查询光整机轧制力列表
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 光整机轧制力集合
|
||||
*/
|
||||
public List<SetupTmRollforce> selectSetupTmRollforceList(SetupTmRollforce setupTmRollforce);
|
||||
|
||||
/**
|
||||
* 新增光整机轧制力
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSetupTmRollforce(SetupTmRollforce setupTmRollforce);
|
||||
|
||||
/**
|
||||
* 修改光整机轧制力
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSetupTmRollforce(SetupTmRollforce setupTmRollforce);
|
||||
|
||||
/**
|
||||
* 批量删除光整机轧制力
|
||||
*
|
||||
* @param steelGrades 需要删除的光整机轧制力主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmRollforceBySteelGrades(String[] steelGrades,Long[] yieldStrens,Long[] thicks,Long[] elongs);
|
||||
|
||||
/**
|
||||
* 删除光整机轧制力信息
|
||||
*
|
||||
* @param steelGrade 光整机轧制力主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSetupTmRollforceBySteelGrade(String steelGrade);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.fizz.business.vo.L3PickupRecommendVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface L3PickupRecommendService {
|
||||
|
||||
List<L3PickupRecommendVO> listPickupRecommend(Integer limit);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.fizz.business.service;
|
||||
|
||||
import com.fizz.business.form.OpcBatchWriteDataForm;
|
||||
import com.fizz.business.form.OpcWriteDataForm;
|
||||
|
||||
/**
|
||||
* OPC 数据读写服务接口
|
||||
*/
|
||||
public interface OpcDataService {
|
||||
|
||||
/**
|
||||
* 向单个点位写入数据(通过字段名)
|
||||
* @param form 写数据请求表单
|
||||
* @return 是否写入成功
|
||||
*/
|
||||
boolean writeData(OpcWriteDataForm form);
|
||||
|
||||
/**
|
||||
* 批量向多个点位写入数据(通过字段名)
|
||||
* @param form 批量写数据请求表单
|
||||
* @return 是否全部写入成功
|
||||
*/
|
||||
boolean batchWriteData(OpcBatchWriteDataForm form);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.fizz.business.service.client;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 每个 WS session 的订阅状态(懒加载用)
|
||||
*/
|
||||
@Data
|
||||
public class DeviceFieldTrendSessionState {
|
||||
|
||||
/**
|
||||
* 订阅的 deviceCode 集合;为空代表未订阅任何(不推送)
|
||||
*/
|
||||
private Set<String> deviceCodes = new HashSet<>();
|
||||
|
||||
/**
|
||||
* 订阅的 fieldName 集合;为空代表未订阅任何(不推送)
|
||||
*/
|
||||
private Set<String> fieldNames = new HashSet<>();
|
||||
|
||||
/**
|
||||
* 是否启用懒加载过滤
|
||||
*/
|
||||
private boolean lazy = true;
|
||||
|
||||
public boolean match(String deviceCode, String fieldName) {
|
||||
if (!lazy) return true;
|
||||
if (deviceCodes != null && !deviceCodes.isEmpty() && !deviceCodes.contains(deviceCode)) return false;
|
||||
if (fieldNames != null && !fieldNames.isEmpty() && !fieldNames.contains(fieldName)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static DeviceFieldTrendSessionState emptyLazyOn() {
|
||||
DeviceFieldTrendSessionState s = new DeviceFieldTrendSessionState();
|
||||
s.setLazy(true);
|
||||
s.setDeviceCodes(Collections.emptySet());
|
||||
s.setFieldNames(Collections.emptySet());
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.fizz.business.service.client;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.fizz.business.constants.enums.WsTypeEnum;
|
||||
import com.fizz.business.dto.DeviceFieldTrendSubscribeReq;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.socket.CloseStatus;
|
||||
@@ -7,8 +10,7 @@ import org.springframework.web.socket.TextMessage;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
import org.springframework.web.socket.handler.AbstractWebSocketHandler;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
@@ -19,8 +21,22 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
@Component
|
||||
public class TrackWsHandler extends AbstractWebSocketHandler {
|
||||
|
||||
public static DeviceFieldTrendSessionState getFieldTrendState(String sessionId) {
|
||||
return fieldTrendStates.get(sessionId);
|
||||
}
|
||||
|
||||
public static Map<String, DeviceFieldTrendSessionState> getAllFieldTrendStates() {
|
||||
return fieldTrendStates;
|
||||
}
|
||||
|
||||
private static final ConcurrentHashMap<String, Map<String, WebSocketSession>> clients = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 懒加载订阅状态:只用于 device_field_trend
|
||||
* sessionId -> state
|
||||
*/
|
||||
private static final ConcurrentHashMap<String, DeviceFieldTrendSessionState> fieldTrendStates = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* socket 建立成功事件
|
||||
*
|
||||
@@ -38,6 +54,12 @@ public class TrackWsHandler extends AbstractWebSocketHandler {
|
||||
sessionMap.put(sid, session);
|
||||
// 添加 session
|
||||
clients.put(type, sessionMap);
|
||||
|
||||
// device_field_trend 默认启用懒加载:不主动推送,等前端发送订阅消息
|
||||
if (WsTypeEnum.device_field_trend.name().equals(type)) {
|
||||
fieldTrendStates.put(sid, DeviceFieldTrendSessionState.emptyLazyOn());
|
||||
}
|
||||
|
||||
log.info("[websocket]建立连接:{}", type + sid);
|
||||
} catch (Exception e) {
|
||||
log.error("[websocket]建立连接错误:{}", e.getMessage(), e);
|
||||
@@ -58,6 +80,35 @@ public class TrackWsHandler extends AbstractWebSocketHandler {
|
||||
// 心跳
|
||||
if (payload.equals("ping")) {
|
||||
session.sendMessage(new TextMessage("pong"));
|
||||
return;
|
||||
}
|
||||
|
||||
// device_field_trend 订阅(懒加载)
|
||||
String type = (String) session.getAttributes().get("type");
|
||||
if (WsTypeEnum.device_field_trend.name().equals(type)) {
|
||||
try {
|
||||
DeviceFieldTrendSubscribeReq req = JSONUtil.toBean(payload, DeviceFieldTrendSubscribeReq.class);
|
||||
DeviceFieldTrendSessionState state = fieldTrendStates.get(session.getId());
|
||||
if (state == null) {
|
||||
state = DeviceFieldTrendSessionState.emptyLazyOn();
|
||||
fieldTrendStates.put(session.getId(), state);
|
||||
}
|
||||
if (req.getLazy() != null) {
|
||||
state.setLazy(req.getLazy());
|
||||
}
|
||||
if (req.getDeviceCodes() != null) {
|
||||
state.setDeviceCodes(new HashSet<>(req.getDeviceCodes()));
|
||||
}
|
||||
if (req.getFieldNames() != null) {
|
||||
state.setFieldNames(new HashSet<>(req.getFieldNames()));
|
||||
}
|
||||
log.info("[websocket]device_field_trend订阅更新 sid={}, lazy={}, deviceCodes.size={}, fieldNames.size={}",
|
||||
session.getId(), state.isLazy(),
|
||||
state.getDeviceCodes() == null ? 0 : state.getDeviceCodes().size(),
|
||||
state.getFieldNames() == null ? 0 : state.getFieldNames().size());
|
||||
} catch (Exception e) {
|
||||
log.error("[websocket]解析device_field_trend订阅失败 sid={}, payload={}", session.getId(), payload, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +143,10 @@ public class TrackWsHandler extends AbstractWebSocketHandler {
|
||||
if (webSocketSession != null) {
|
||||
webSocketSession.close();
|
||||
}
|
||||
// 如果是 field_trend 连接,清除订阅状态
|
||||
if (WsTypeEnum.device_field_trend.name().equals(type)) {
|
||||
fieldTrendStates.remove(sid);
|
||||
}
|
||||
}
|
||||
log.info("[websocket]连接关闭:{}", type + "-" + sid);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.fizz.business.anno.OpcMessageHandlerType;
|
||||
import com.fizz.business.constants.enums.OpcMessageType;
|
||||
import com.fizz.business.domain.msg.*;
|
||||
import com.fizz.business.dto.MatmapDTO;
|
||||
import com.fizz.business.service.DeviceSnapshotService;
|
||||
import com.fizz.business.service.LogDataService;
|
||||
import com.fizz.business.service.OpcMessageHandler;
|
||||
import com.fizz.business.service.strip.SegmentTrackerService;
|
||||
@@ -27,6 +28,7 @@ public class AppMeasureHandler implements OpcMessageHandler<AppMeasureMessage> {
|
||||
private final SegmentTrackerService tracker;
|
||||
private final LogDataService logDataService;
|
||||
private final Executor coilTrackExecutor; // 注入线程池接口
|
||||
private final DeviceSnapshotService deviceSnapshotService;
|
||||
|
||||
private static final AtomicInteger LOG_COUNTER = new AtomicInteger(0);
|
||||
|
||||
@@ -39,6 +41,12 @@ public class AppMeasureHandler implements OpcMessageHandler<AppMeasureMessage> {
|
||||
AppMeasureCoatMessage coat = message.getAppMeasureCoatMessage();
|
||||
AppMeasureExitMessage exit = message.getAppMeasureExitMessage();
|
||||
|
||||
// 缓存最新测量数据,供10分钟快照任务使用
|
||||
if (entry != null) deviceSnapshotService.updateLatestMeasurement(entry);
|
||||
if (furnace != null) deviceSnapshotService.updateLatestMeasurement(furnace);
|
||||
if (coat != null) deviceSnapshotService.updateLatestMeasurement(coat);
|
||||
if (exit != null) deviceSnapshotService.updateLatestMeasurement(exit);
|
||||
|
||||
WebSocketUtil.sendMeasureMsg(message);
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ public class CrmPdiPlanServiceImpl extends ServiceImpl<CrmPdiPlanMapper, CrmPdiP
|
||||
*/
|
||||
public boolean addCrmPdiPlan(CrmPdiPlan crmPdiPlan) {
|
||||
crmPdiPlan.setStatus("READY");
|
||||
if (StrUtil.isBlank(crmPdiPlan.getEnterCoilNo())) {
|
||||
crmPdiPlan.setEnterCoilNo(crmPdiPlan.getCoilid());
|
||||
}
|
||||
|
||||
return this.save(crmPdiPlan);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ public class CrmPdoExcoilServiceImpl extends ServiceImpl<CrmPdoExcoilMapper, Crm
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
public boolean addCrmPdoExcoil(CrmPdoExcoil crmPdoExcoil) {
|
||||
if (StringUtils.isEmpty(crmPdoExcoil.getEnterCoilNo())) {
|
||||
crmPdoExcoil.setEnterCoilNo(crmPdoExcoil.getEntryMatId());
|
||||
}
|
||||
return this.save(crmPdoExcoil);
|
||||
}
|
||||
|
||||
@@ -69,7 +72,7 @@ public class CrmPdoExcoilServiceImpl extends ServiceImpl<CrmPdoExcoilMapper, Crm
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
* 查询所有记录(支持分页)
|
||||
*
|
||||
* @return CrmPdoExcoil对象的列表
|
||||
*/
|
||||
@@ -80,8 +83,6 @@ public class CrmPdoExcoilServiceImpl extends ServiceImpl<CrmPdoExcoilMapper, Crm
|
||||
// 根据 exit_coilid 和 encoilid 进行查询
|
||||
if (!StringUtils.isEmpty(form.getCoilid())) {
|
||||
queryWrapper.like("exit_mat_id", form.getCoilid());
|
||||
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(form.getStartDate())&& !StringUtils.isEmpty(form.getEndDate())){
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.fizz.business.mapper.L3PickupRecommendMapper;
|
||||
import com.fizz.business.service.L3PickupRecommendService;
|
||||
import com.fizz.business.vo.L3PickupRecommendVO;
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class L3PickupRecommendServiceImpl implements L3PickupRecommendService {
|
||||
|
||||
@Resource
|
||||
private L3PickupRecommendMapper l3PickupRecommendMapper;
|
||||
|
||||
@Override
|
||||
@DataSource(DataSourceType.L3)
|
||||
public List<L3PickupRecommendVO> listPickupRecommend(Integer limit) {
|
||||
int queryLimit = (limit == null || limit <= 0) ? 10 : Math.min(limit, 50);
|
||||
List<Map<String, Object>> pendingActions = l3PickupRecommendMapper.selectPendingActions(queryLimit);
|
||||
List<L3PickupRecommendVO> result = new ArrayList<>();
|
||||
|
||||
for (Map<String, Object> action : pendingActions) {
|
||||
L3PickupRecommendVO vo = new L3PickupRecommendVO();
|
||||
vo.setActionId(toLong(action.get("action_id")));
|
||||
vo.setSourceCoilId(toLong(action.get("coil_id")));
|
||||
vo.setCoilId(toStringValue(action.get("current_coil_no")));
|
||||
vo.setPriority(toInteger(action.get("priority")));
|
||||
vo.setScanTime(toLocalDateTime(action.get("scan_time")));
|
||||
|
||||
Long sourceCoilId = vo.getSourceCoilId();
|
||||
if (sourceCoilId != null) {
|
||||
Map<String, Object> material = l3PickupRecommendMapper.selectMaterialByCoilId(sourceCoilId);
|
||||
if (material != null) {
|
||||
vo.setEnterCoilNo(toStringValue(material.get("enter_coil_no")));
|
||||
}
|
||||
}
|
||||
result.add(vo);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Long toLong(Object value) {
|
||||
if (value == null) return null;
|
||||
if (value instanceof Number) return ((Number) value).longValue();
|
||||
try {
|
||||
return Long.parseLong(String.valueOf(value));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Integer toInteger(Object value) {
|
||||
if (value == null) return null;
|
||||
if (value instanceof Number) return ((Number) value).intValue();
|
||||
try {
|
||||
return Integer.parseInt(String.valueOf(value));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String toStringValue(Object value) {
|
||||
return value == null ? null : String.valueOf(value);
|
||||
}
|
||||
|
||||
private LocalDateTime toLocalDateTime(Object value) {
|
||||
if (value == null) return null;
|
||||
if (value instanceof LocalDateTime) return (LocalDateTime) value;
|
||||
if (value instanceof Timestamp) return ((Timestamp) value).toLocalDateTime();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import com.fizz.business.comm.iot.S7WriteClient;
|
||||
import com.fizz.business.form.OpcBatchWriteDataForm;
|
||||
import com.fizz.business.form.OpcWriteDataForm;
|
||||
import com.fizz.business.service.OpcDataService;
|
||||
import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* OPC 数据读写服务实现类
|
||||
* <p>
|
||||
* 说明:
|
||||
* 1) 写入逻辑已切换为 iot-communication(S7)
|
||||
* 2) 读取逻辑仍保留在原 OPC 体系(不在本类中)
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = "iot.communication", name = "enabled", havingValue = "true")
|
||||
public class OpcDataServiceImpl implements OpcDataService {
|
||||
|
||||
private final S7WriteClient s7WriteClient;
|
||||
|
||||
@Override
|
||||
public boolean writeData(OpcWriteDataForm form) {
|
||||
|
||||
S7PLC s7PLC = s7WriteClient.newClient();
|
||||
writeByGuessType(s7PLC, form.getFieldName(), form.getValue());
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean batchWriteData(OpcBatchWriteDataForm form) {
|
||||
S7PLC s7PLC = s7WriteClient.newClient();
|
||||
for (OpcWriteDataForm item : form.getDataList()) {
|
||||
writeByGuessType(s7PLC, item.getFieldName(), item.getValue());
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
private void writeByGuessType(S7PLC s7PLC, String address, Object value) {
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException("写入值不能为空");
|
||||
}
|
||||
if (address == null || address.trim().isEmpty()) {
|
||||
throw new IllegalArgumentException("写入地址不能为空");
|
||||
}
|
||||
|
||||
if (value instanceof Boolean) {
|
||||
s7PLC.writeBoolean(address, (Boolean) value);
|
||||
return;
|
||||
}
|
||||
if (value instanceof Byte) {
|
||||
s7PLC.writeByte(address, (Byte) value);
|
||||
return;
|
||||
}
|
||||
if (value instanceof Short) {
|
||||
s7PLC.writeInt16(address, (Short) value);
|
||||
return;
|
||||
}
|
||||
if (value instanceof Integer) {
|
||||
s7PLC.writeInt32(address, (Integer) value);
|
||||
return;
|
||||
}
|
||||
if (value instanceof Float) {
|
||||
s7PLC.writeFloat32(address, (Float) value);
|
||||
return;
|
||||
}
|
||||
if (value instanceof Double) {
|
||||
s7PLC.writeFloat64(address, (Double) value);
|
||||
return;
|
||||
}
|
||||
if (value instanceof byte[]) {
|
||||
s7PLC.writeByte(address, (byte[]) value);
|
||||
return;
|
||||
}
|
||||
|
||||
// 兜底按字符串写入
|
||||
s7PLC.writeString(address, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fizz.business.mapper.PdiSetupMapper;
|
||||
import com.fizz.business.domain.PdiSetups;
|
||||
@@ -21,77 +20,42 @@ import com.fizz.business.service.IPdiSetupService;
|
||||
*/
|
||||
@Service
|
||||
public class PdiSetupServiceImpl extends ServiceImpl<PdiSetupMapper, PdiSetups> implements IPdiSetupService {
|
||||
/**
|
||||
* 查询生产计划的参数详情
|
||||
*
|
||||
* @param id 生产计划的参数详情主键
|
||||
* @return 生产计划的参数详情
|
||||
*/
|
||||
|
||||
@Override
|
||||
public PdiSetups selectPdiSetupByid(Long id)
|
||||
{
|
||||
return baseMapper.selectById(id);
|
||||
public List<PdiSetups> selectPdiSetupList(PdiSetups pdiSetup) {
|
||||
return lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(pdiSetup.getCoilid()), PdiSetups::getCoilid, pdiSetup.getCoilid())
|
||||
.eq(StrUtil.isNotBlank(pdiSetup.getPlanid()), PdiSetups::getPlanid, pdiSetup.getPlanid())
|
||||
.eq(StrUtil.isNotBlank(pdiSetup.getSteelGrade()), PdiSetups::getSteelGrade, pdiSetup.getSteelGrade())
|
||||
.eq(Objects.nonNull(pdiSetup.getThick()), PdiSetups::getThick, pdiSetup.getThick())
|
||||
.eq(Objects.nonNull(pdiSetup.getYieldStren()), PdiSetups::getYieldStren, pdiSetup.getYieldStren())
|
||||
.orderByDesc(PdiSetups::getUpdateTime)
|
||||
.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产计划的参数详情列表
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 生产计划的参数详情
|
||||
*/
|
||||
@Override
|
||||
public List<PdiSetups> selectPdiSetupList(PdiSetups pdiSetup)
|
||||
{
|
||||
QueryWrapper<PdiSetups> queryWrapper = new QueryWrapper<>(pdiSetup);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
public PdiSetups selectPdiSetupById(Long id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产计划的参数详情
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertPdiSetup(PdiSetups pdiSetup)
|
||||
{
|
||||
return this.save(pdiSetup);
|
||||
public Boolean insertPdiSetup(PdiSetups pdiSetup) {
|
||||
pdiSetup.setCreateTime(ObjectUtil.defaultIfNull(pdiSetup.getCreateTime(), new Date()));
|
||||
pdiSetup.setUpdateTime(new Date());
|
||||
return save(pdiSetup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产计划的参数详情
|
||||
*
|
||||
* @param pdiSetup 生产计划的参数详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean updatePdiSetup(PdiSetups pdiSetup)
|
||||
{
|
||||
return this.updateById(pdiSetup);
|
||||
public Boolean updatePdiSetup(PdiSetups pdiSetup) {
|
||||
if (pdiSetup.getId() == null) {
|
||||
throw new IllegalArgumentException("更新张力参数时,id 不能为空");
|
||||
}
|
||||
pdiSetup.setUpdateTime(new Date());
|
||||
return updateById(pdiSetup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产计划的参数详情
|
||||
*
|
||||
* @param ids 需要删除的生产计划的参数详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean deletePdiSetupByids(Long[] ids)
|
||||
{
|
||||
return this.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产计划的参数详情信息
|
||||
*
|
||||
* @param id 生产计划的参数详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean deletePdiSetupByid(Long id)
|
||||
{
|
||||
return this.removeById(id);
|
||||
public Boolean deletePdiSetupByIds(Long[] ids) {
|
||||
return removeByIds(java.util.Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class PdoExCoilServiceImpl implements PdoExCoilService {
|
||||
pdoExCoilDTO.setProcessCode(SYSTEM_MODULE);
|
||||
pdoExCoilDTO.setExitMatId(exitCoil.getExitMatId());
|
||||
pdoExCoilDTO.setEntryMatId(exitCoil.getEntryMatId());
|
||||
pdoExCoilDTO.setEnterCoilNo(plan.getEnterCoilNo());
|
||||
pdoExCoilDTO.setSubId(exitCoil.getSubNum());
|
||||
pdoExCoilDTO.setStartPosition(exitCoil.getStartPos());
|
||||
pdoExCoilDTO.setEndPosition(exitCoil.getEndPos());
|
||||
|
||||
@@ -63,7 +63,8 @@ public class SendJobServiceImpl extends ServiceImpl<BizSendJobMapper, BizSendJob
|
||||
BeanUtils.copyProperties(dto, job);
|
||||
|
||||
// 生成业务唯一键
|
||||
String bizKey = opcMessageIdsManager.generateMessageId("SEND_JOB");
|
||||
// 生成业务唯一键(OpcMessageIdsManager 目前没有 generateMessageId 方法,改用 UUID)
|
||||
String bizKey = "SEND_JOB_" + UUID.randomUUID();
|
||||
job.setBizKey(bizKey);
|
||||
job.setStatus("PENDING");
|
||||
|
||||
@@ -302,7 +303,9 @@ public class SendJobServiceImpl extends ServiceImpl<BizSendJobMapper, BizSendJob
|
||||
boolean success = true;
|
||||
String failMsg = null;
|
||||
try {
|
||||
opcMessageSend.writeNode(last.getAddress(), last.getValueRaw());
|
||||
// OpcMessageSend 没有 writeNode 方法,使用 writeData(identifier, value)
|
||||
// address 字段在本业务里就是 OPC 的 identifier(如:ns=2;s=...)
|
||||
opcMessageSend.writeData(last.getAddress(), last.getValueRaw());
|
||||
} catch (Exception ex) {
|
||||
success = false;
|
||||
allSuccess = false;
|
||||
|
||||
@@ -53,6 +53,10 @@ public class SetupFurTempServiceImpl implements ISetupFurTempService
|
||||
@Override
|
||||
public int insertSetupFurTemp(SetupFurTemp setupFurTemp)
|
||||
{
|
||||
//如果 String steelGrade 存在则不能新增
|
||||
if (setupFurTempMapper.selectSetupFurTempBySteelGrade(setupFurTemp.getSteelGrade()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
setupFurTemp.setCreateTime(DateUtils.getNowDate());
|
||||
return setupFurTempMapper.insertSetupFurTemp(setupFurTemp);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionAllLine;
|
||||
import com.fizz.business.mapper.SetupTensionAllLineMapper;
|
||||
import com.fizz.business.service.ISetupTensionAllLineService;
|
||||
|
||||
/**
|
||||
* 全线张力Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class SetupTensionAllLineServiceImpl implements ISetupTensionAllLineService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTensionAllLineMapper mapper;
|
||||
|
||||
@Override
|
||||
public SetupTensionAllLine selectByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.selectByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SetupTensionAllLine> selectList(SetupTensionAllLine query)
|
||||
{
|
||||
return mapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(SetupTensionAllLine entity)
|
||||
{
|
||||
// 三主键存在则禁止新增
|
||||
if (mapper.selectByKey(entity.getSteelGrade(), entity.getThick(), entity.getYieldStren()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
entity.setCreateTime(DateUtils.getNowDate());
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByKey(SetupTensionAllLine entity)
|
||||
{
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.updateByKey(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.deleteByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionAnnealingFurnace;
|
||||
import com.fizz.business.mapper.SetupTensionAnnealingFurnaceMapper;
|
||||
import com.fizz.business.service.ISetupTensionAnnealingFurnaceService;
|
||||
|
||||
/**
|
||||
* 退火炉张力Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class SetupTensionAnnealingFurnaceServiceImpl implements ISetupTensionAnnealingFurnaceService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTensionAnnealingFurnaceMapper mapper;
|
||||
|
||||
@Override
|
||||
public SetupTensionAnnealingFurnace selectByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.selectByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SetupTensionAnnealingFurnace> selectList(SetupTensionAnnealingFurnace query)
|
||||
{
|
||||
return mapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(SetupTensionAnnealingFurnace entity)
|
||||
{
|
||||
if (mapper.selectByKey(entity.getSteelGrade(), entity.getThick(), entity.getYieldStren()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
entity.setCreateTime(DateUtils.getNowDate());
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByKey(SetupTensionAnnealingFurnace entity)
|
||||
{
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.updateByKey(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.deleteByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionLeveler;
|
||||
import com.fizz.business.mapper.SetupTensionLevelerMapper;
|
||||
import com.fizz.business.service.ISetupTensionLevelerService;
|
||||
|
||||
/**
|
||||
* 平整机张力Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class SetupTensionLevelerServiceImpl implements ISetupTensionLevelerService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTensionLevelerMapper mapper;
|
||||
|
||||
@Override
|
||||
public SetupTensionLeveler selectByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.selectByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SetupTensionLeveler> selectList(SetupTensionLeveler query)
|
||||
{
|
||||
return mapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(SetupTensionLeveler entity)
|
||||
{
|
||||
if (mapper.selectByKey(entity.getSteelGrade(), entity.getThick(), entity.getYieldStren()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
entity.setCreateTime(DateUtils.getNowDate());
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByKey(SetupTensionLeveler entity)
|
||||
{
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.updateByKey(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.deleteByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fizz.business.mapper.SetupTensionMapper;
|
||||
import com.fizz.business.domain.SetupTension;
|
||||
import com.fizz.business.service.ISetupTensionService;
|
||||
|
||||
/**
|
||||
* 全线张力Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Service
|
||||
public class SetupTensionServiceImpl implements ISetupTensionService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTensionMapper setupTensionMapper;
|
||||
|
||||
/**
|
||||
* 查询全线张力
|
||||
*
|
||||
* @param thick 全线张力主键
|
||||
* @return 全线张力
|
||||
*/
|
||||
@Override
|
||||
public SetupTension selectSetupTensionByThick(Long thick,Long yieldStren)
|
||||
{
|
||||
return setupTensionMapper.selectSetupTensionByThick(thick,yieldStren);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全线张力列表
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 全线张力
|
||||
*/
|
||||
@Override
|
||||
public List<SetupTension> selectSetupTensionList(SetupTension setupTension)
|
||||
{
|
||||
return setupTensionMapper.selectSetupTensionList(setupTension);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增全线张力
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSetupTension(SetupTension setupTension)
|
||||
{
|
||||
setupTension.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTensionMapper.insertSetupTension(setupTension);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全线张力
|
||||
*
|
||||
* @param setupTension 全线张力
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSetupTension(SetupTension setupTension)
|
||||
{
|
||||
setupTension.setUpdateTime(DateUtils.getNowDate());
|
||||
return setupTensionMapper.updateSetupTension(setupTension);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除全线张力
|
||||
*
|
||||
* @param thicks 需要删除的全线张力主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTensionByThicks(Long[] thicks,Long[] yieldStrens)
|
||||
{
|
||||
return setupTensionMapper.deleteSetupTensionByThicks(thicks,yieldStrens);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除全线张力信息
|
||||
*
|
||||
* @param thick 全线张力主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTensionByThick(Long thick)
|
||||
{
|
||||
return setupTensionMapper.deleteSetupTensionByThick(thick);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.fizz.business.domain.SetupTensionStraightener;
|
||||
import com.fizz.business.mapper.SetupTensionStraightenerMapper;
|
||||
import com.fizz.business.service.ISetupTensionStraightenerService;
|
||||
|
||||
/**
|
||||
* 矫直机张力Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class SetupTensionStraightenerServiceImpl implements ISetupTensionStraightenerService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTensionStraightenerMapper mapper;
|
||||
|
||||
@Override
|
||||
public SetupTensionStraightener selectByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.selectByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SetupTensionStraightener> selectList(SetupTensionStraightener query)
|
||||
{
|
||||
return mapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(SetupTensionStraightener entity)
|
||||
{
|
||||
if (mapper.selectByKey(entity.getSteelGrade(), entity.getThick(), entity.getYieldStren()) != null) {
|
||||
throw new RuntimeException("该参数已存在");
|
||||
}
|
||||
entity.setCreateTime(DateUtils.getNowDate());
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateByKey(SetupTensionStraightener entity)
|
||||
{
|
||||
entity.setUpdateTime(DateUtils.getNowDate());
|
||||
return mapper.updateByKey(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByKey(String steelGrade, Float thick, Float yieldStren)
|
||||
{
|
||||
return mapper.deleteByKey(steelGrade, thick, yieldStren);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fizz.business.mapper.SetupTlMapper;
|
||||
import com.fizz.business.domain.SetupTl;
|
||||
import com.fizz.business.service.ISetupTlService;
|
||||
|
||||
/**
|
||||
* 拉矫机参数Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Service
|
||||
public class SetupTlServiceImpl implements ISetupTlService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTlMapper setupTlMapper;
|
||||
|
||||
/**
|
||||
* 查询拉矫机参数
|
||||
*
|
||||
* @param steelGrade 拉矫机参数主键
|
||||
* @return 拉矫机参数
|
||||
*/
|
||||
@Override
|
||||
public SetupTl selectSetupTlBySteelGrade(String steelGrade, Long yieldStren, Long thick)
|
||||
{
|
||||
return setupTlMapper.selectSetupTlBySteelGrade(steelGrade, yieldStren, thick);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询拉矫机参数列表
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 拉矫机参数
|
||||
*/
|
||||
@Override
|
||||
public List<SetupTl> selectSetupTlList(SetupTl setupTl)
|
||||
{
|
||||
return setupTlMapper.selectSetupTlList(setupTl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增拉矫机参数
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSetupTl(SetupTl setupTl)
|
||||
{
|
||||
setupTl.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTlMapper.insertSetupTl(setupTl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改拉矫机参数
|
||||
*
|
||||
* @param setupTl 拉矫机参数
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSetupTl(SetupTl setupTl)
|
||||
{
|
||||
setupTl.setUpdateTime(DateUtils.getNowDate());
|
||||
return setupTlMapper.updateSetupTl(setupTl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除拉矫机参数
|
||||
*
|
||||
* @param steelGrades 需要删除的拉矫机参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTlBySteelGrades(String[] steelGrades,Long[] yieldStres,Long[] thicks)
|
||||
{
|
||||
return setupTlMapper.deleteSetupTlBySteelGrades(steelGrades, yieldStres, thicks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除拉矫机参数信息
|
||||
*
|
||||
* @param steelGrade 拉矫机参数主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTlBySteelGrade(String steelGrade)
|
||||
{
|
||||
return setupTlMapper.deleteSetupTlBySteelGrade(steelGrade);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fizz.business.mapper.SetupTmBendforceMapper;
|
||||
import com.fizz.business.domain.SetupTmBendforce;
|
||||
import com.fizz.business.service.ISetupTmBendforceService;
|
||||
|
||||
/**
|
||||
* 光整机弯辊力Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Service
|
||||
public class SetupTmBendforceServiceImpl implements ISetupTmBendforceService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTmBendforceMapper setupTmBendforceMapper;
|
||||
|
||||
/**
|
||||
* 查询光整机弯辊力
|
||||
*
|
||||
* @param width 光整机弯辊力主键
|
||||
* @return 光整机弯辊力
|
||||
*/
|
||||
@Override
|
||||
public SetupTmBendforce selectSetupTmBendforceByWidth(Long width,Long rollForce)
|
||||
{
|
||||
return setupTmBendforceMapper.selectSetupTmBendforceByWidth(width,rollForce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询光整机弯辊力列表
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 光整机弯辊力
|
||||
*/
|
||||
@Override
|
||||
public List<SetupTmBendforce> selectSetupTmBendforceList(SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
return setupTmBendforceMapper.selectSetupTmBendforceList(setupTmBendforce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增光整机弯辊力
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSetupTmBendforce(SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
setupTmBendforce.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTmBendforceMapper.insertSetupTmBendforce(setupTmBendforce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改光整机弯辊力
|
||||
*
|
||||
* @param setupTmBendforce 光整机弯辊力
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSetupTmBendforce(SetupTmBendforce setupTmBendforce)
|
||||
{
|
||||
setupTmBendforce.setUpdateTime(DateUtils.getNowDate());
|
||||
return setupTmBendforceMapper.updateSetupTmBendforce(setupTmBendforce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除光整机弯辊力
|
||||
*
|
||||
* @param widths 需要删除的光整机弯辊力主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTmBendforceByWidths(Long[] widths,Long[] rollForces)
|
||||
{
|
||||
return setupTmBendforceMapper.deleteSetupTmBendforceByWidths(widths,rollForces);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除光整机弯辊力信息
|
||||
*
|
||||
* @param width 光整机弯辊力主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTmBendforceByWidth(Long width)
|
||||
{
|
||||
return setupTmBendforceMapper.deleteSetupTmBendforceByWidth(width);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fizz.business.mapper.SetupTmMeshMapper;
|
||||
import com.fizz.business.domain.SetupTmMesh;
|
||||
import com.fizz.business.service.ISetupTmMeshService;
|
||||
|
||||
/**
|
||||
* 光整机插入量Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Service
|
||||
public class SetupTmMeshServiceImpl implements ISetupTmMeshService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTmMeshMapper setupTmMeshMapper;
|
||||
|
||||
/**
|
||||
* 查询光整机插入量
|
||||
*
|
||||
* @param steelGrade 光整机插入量主键
|
||||
* @return 光整机插入量
|
||||
*/
|
||||
@Override
|
||||
public SetupTmMesh selectSetupTmMeshBySteelGrade(String steelGrade, Long yieldStren, Long thick)
|
||||
{
|
||||
return setupTmMeshMapper.selectSetupTmMeshBySteelGrade(steelGrade, yieldStren, thick);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询光整机插入量列表
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 光整机插入量
|
||||
*/
|
||||
@Override
|
||||
public List<SetupTmMesh> selectSetupTmMeshList(SetupTmMesh setupTmMesh)
|
||||
{
|
||||
return setupTmMeshMapper.selectSetupTmMeshList(setupTmMesh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增光整机插入量
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSetupTmMesh(SetupTmMesh setupTmMesh)
|
||||
{
|
||||
setupTmMesh.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTmMeshMapper.insertSetupTmMesh(setupTmMesh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改光整机插入量
|
||||
*
|
||||
* @param setupTmMesh 光整机插入量
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSetupTmMesh(SetupTmMesh setupTmMesh)
|
||||
{
|
||||
setupTmMesh.setUpdateTime(DateUtils.getNowDate());
|
||||
return setupTmMeshMapper.updateSetupTmMesh(setupTmMesh);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除光整机插入量
|
||||
*
|
||||
* @param steelGrades 需要删除的光整机插入量主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTmMeshBySteelGrades(String[] steelGrades, Long[] yieldStrens, Long[] thicks)
|
||||
{
|
||||
return setupTmMeshMapper.deleteSetupTmMeshBySteelGrades(steelGrades, yieldStrens, thicks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除光整机插入量信息
|
||||
*
|
||||
* @param steelGrade 光整机插入量主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTmMeshBySteelGrade(String steelGrade)
|
||||
{
|
||||
return setupTmMeshMapper.deleteSetupTmMeshBySteelGrade(steelGrade);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
package com.fizz.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fizz.business.mapper.SetupTmRollforceMapper;
|
||||
import com.fizz.business.domain.SetupTmRollforce;
|
||||
import com.fizz.business.service.ISetupTmRollforceService;
|
||||
|
||||
/**
|
||||
* 光整机轧制力Service业务层处理
|
||||
*
|
||||
* @author Joshi
|
||||
* @date 2025-09-26
|
||||
*/
|
||||
@Service
|
||||
public class SetupTmRollforceServiceImpl implements ISetupTmRollforceService
|
||||
{
|
||||
@Autowired
|
||||
private SetupTmRollforceMapper setupTmRollforceMapper;
|
||||
|
||||
/**
|
||||
* 查询光整机轧制力
|
||||
*
|
||||
* @param steelGrade 光整机轧制力主键
|
||||
* @return 光整机轧制力
|
||||
*/
|
||||
@Override
|
||||
public SetupTmRollforce selectSetupTmRollforceBySteelGrade(String steelGrade, Long yieldStren, Long thick, Long elong)
|
||||
{
|
||||
return setupTmRollforceMapper.selectSetupTmRollforceBySteelGrade(steelGrade, yieldStren, thick, elong);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询光整机轧制力列表
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 光整机轧制力
|
||||
*/
|
||||
@Override
|
||||
public List<SetupTmRollforce> selectSetupTmRollforceList(SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
return setupTmRollforceMapper.selectSetupTmRollforceList(setupTmRollforce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增光整机轧制力
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSetupTmRollforce(SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
setupTmRollforce.setCreateTime(DateUtils.getNowDate());
|
||||
return setupTmRollforceMapper.insertSetupTmRollforce(setupTmRollforce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改光整机轧制力
|
||||
*
|
||||
* @param setupTmRollforce 光整机轧制力
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSetupTmRollforce(SetupTmRollforce setupTmRollforce)
|
||||
{
|
||||
setupTmRollforce.setUpdateTime(DateUtils.getNowDate());
|
||||
return setupTmRollforceMapper.updateSetupTmRollforce(setupTmRollforce);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除光整机轧制力
|
||||
*
|
||||
* @param steelGrades 需要删除的光整机轧制力主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTmRollforceBySteelGrades(String[] steelGrades, Long[] thicks, Long[] yieldStrens, Long[] elongs)
|
||||
{
|
||||
return setupTmRollforceMapper.deleteSetupTmRollforceBySteelGrades(steelGrades, thicks, yieldStrens, elongs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除光整机轧制力信息
|
||||
*
|
||||
* @param steelGrade 光整机轧制力主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSetupTmRollforceBySteelGrade(String steelGrade)
|
||||
{
|
||||
return setupTmRollforceMapper.deleteSetupTmRollforceBySteelGrade(steelGrade);
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,6 @@ import java.util.Map;
|
||||
@Component
|
||||
public class OpcMessageIdsManager {
|
||||
|
||||
/**
|
||||
* 生成业务/消息唯一ID(用于发送批次 bizKey 等)
|
||||
* 规则:PREFIX_时间戳_8位随机
|
||||
*/
|
||||
public String generateMessageId(String prefix) {
|
||||
String p = (prefix == null || prefix.trim().isEmpty()) ? "MSG" : prefix.trim();
|
||||
String random = java.util.UUID.randomUUID().toString().replace("-", "").substring(0, 8);
|
||||
return (p + "_" + System.currentTimeMillis() + "_" + random).toUpperCase();
|
||||
}
|
||||
|
||||
public static List<String> msgTriggers = Lists.newArrayList();
|
||||
|
||||
public static Map<String,String> lineMeasureIds = Maps.newHashMap();
|
||||
@@ -168,8 +158,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof1AirFlowControlOutput", "nof1AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof1AirFuelRatioActual", "nof1AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof1AirFuelRatioSet", "nof1AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2FurnaceTemperatureActual", "nof2FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2FurnaceTemperatureSet", "nof2FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof2FurnaceTemperatureActual", "nof2FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof2FurnaceTemperatureSet", "nof2FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2FurnaceTemperatureControlOutput", "nof2FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2GasFlowActual", "nof2GasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2GasFlowSet", "nof2GasFlowSet");
|
||||
@@ -179,8 +169,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2AirFlowControlOutput", "nof2AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2AirFuelRatioActual", "nof2AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof2AirFuelRatioSet", "nof2AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3FurnaceTemperatureActual", "nof3FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3FurnaceTemperatureSet", "nof3FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof3FurnaceTemperatureActual", "nof3FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof3FurnaceTemperatureSet", "nof3FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3FurnaceTemperatureControlOutput", "nof3FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3GasFlowActual", "nof3GasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3GasFlowSet", "nof3GasFlowSet");
|
||||
@@ -190,8 +180,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3AirFlowControlOutput", "nof3AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3AirFuelRatioActual", "nof3AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof3AirFuelRatioSet", "nof3AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4FurnaceTemperatureActual", "nof4FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4FurnaceTemperatureSet", "nof4FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof4FurnaceTemperatureActual", "nof4FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof4FurnaceTemperatureSet", "nof4FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4FurnaceTemperatureControlOutput", "nof4FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4GasFlowActual", "nof4GasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4GasFlowSet", "nof4GasFlowSet");
|
||||
@@ -201,8 +191,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4AirFlowControlOutput", "nof4AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4AirFuelRatioActual", "nof4AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof4AirFuelRatioSet", "nof4AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5FurnaceTemperatureActual", "nof5FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5FurnaceTemperatureSet", "nof5FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof5FurnaceTemperatureActual", "nof5FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.nof5FurnaceTemperatureSet", "nof5FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5FurnaceTemperatureControlOutput", "nof5FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5GasFlowActual", "nof5GasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5GasFlowSet", "nof5GasFlowSet");
|
||||
@@ -212,8 +202,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5AirFlowControlOutput", "nof5AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5AirFuelRatioActual", "nof5AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nof5AirFuelRatioSet", "nof5AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1FurnaceTemperatureActual", "rtf1FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1FurnaceTemperatureSet", "rtf1FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.rtf1FurnaceTemperatureActual", "rtf1FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.rtf1FurnaceTemperatureSet", "rtf1FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1FurnaceTemperatureControlOutput", "rtf1FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1GasFlowActual", "rtf1GasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1GasFlowSet", "rtf1GasFlowSet");
|
||||
@@ -223,8 +213,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1AirFlowControlOutput", "rtf1AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1AirFuelRatioActual", "rtf1AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf1AirFuelRatioSet", "rtf1AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2FurnaceTemperatureActual", "rtf2FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2FurnaceTemperatureSet", "rtf2FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.rtf2FurnaceTemperatureActual", "rtf2FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.rtf2FurnaceTemperatureSet", "rtf2FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2FurnaceTemperatureControlOutput", "rtf2FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2GasFlowActual", "rtf2GasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2GasFlowSet", "rtf2GasFlowSet");
|
||||
@@ -234,8 +224,8 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2AirFlowControlOutput", "rtf2AirFlowControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2AirFuelRatioActual", "rtf2AirFuelRatioActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtf2AirFuelRatioSet", "rtf2AirFuelRatioSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.sfFurnaceTemperatureActual", "sfFurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.sfFurnaceTemperatureSet", "sfFurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.sfFurnaceTemperatureActual", "sfFurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.sfFurnaceTemperatureSet", "sfFurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.sfFurnaceTemperatureControlOutput", "sfFurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.sfGasFlowActual", "sfGasFlowActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.sfGasFlowSet", "sfGasFlowSet");
|
||||
@@ -255,32 +245,32 @@ public class OpcMessageIdsManager {
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.nofFurnacePressureActual", "nofFurnacePressureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.rtfFurnacePressureActual", "rtfFurnacePressureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsFurnacePressureActual", "tdsFurnacePressureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf1FurnaceTemperatureActual", "jcf1FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf1FurnaceTemperatureSet", "jcf1FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.jcf1FurnaceTemperatureActual", "jcf1FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.jcf1FurnaceTemperatureSet", "jcf1FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf1FurnaceTemperatureControlOutput", "jcf1FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf1PhaseACurrent", "jcf1PhaseACurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf1PhaseBCurrent", "jcf1PhaseBCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf1PhaseCCurrent", "jcf1PhaseCCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf2FurnaceTemperatureActual", "jcf2FurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf2FurnaceTemperatureSet", "jcf2FurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.jcf2FurnaceTemperatureActual", "jcf2FurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.jcf2FurnaceTemperatureSet", "jcf2FurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf2FurnaceTemperatureControlOutput", "jcf2FurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf2PhaseACurrent", "jcf2PhaseACurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf2PhaseBCurrent", "jcf2PhaseBCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.jcf2PhaseCCurrent", "jcf2PhaseCCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lthFurnaceTemperatureActual", "lthFurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lthFurnaceTemperatureSet", "lthFurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.lthFurnaceTemperatureActual", "lthFurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.lthFurnaceTemperatureSet", "lthFurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lthFurnaceTemperatureControlOutput", "lthFurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lthPhaseACurrent", "lthPhaseACurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lthPhaseBCurrent", "lthPhaseBCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lthPhaseCCurrent", "lthPhaseCCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsFurnaceTemperatureActual", "tdsFurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsFurnaceTemperatureSet", "tdsFurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.tdsFurnaceTemperatureActual", "tdsFurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.tdsFurnaceTemperatureSet", "tdsFurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsFurnaceTemperatureControlOutput", "tdsFurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsPhaseACurrent", "tdsPhaseACurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsPhaseBCurrent", "tdsPhaseBCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.tdsPhaseCCurrent", "tdsPhaseCCurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lbzFurnaceTemperatureActual", "lbzFurnaceTemperatureActual");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lbzFurnaceTemperatureSet", "lbzFurnaceTemperatureSet");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.lbzFurnaceTemperatureActual", "lbzFurnaceTemperatureActual");
|
||||
furLineMeasureIds.put("ns=2;s=通道 1.PLCFur.FurLineMeasure.lbzFurnaceTemperatureSet", "lbzFurnaceTemperatureSet");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lbzFurnaceTemperatureControlOutput", "lbzFurnaceTemperatureControlOutput");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lbzPhaseACurrent", "lbzPhaseACurrent");
|
||||
// furLineMeasureIds.put("ns=2;s=通道 1.PLCLine.FurLineMeasure.lbzPhaseBCurrent", "lbzPhaseBCurrent");
|
||||
@@ -404,4 +394,43 @@ public class OpcMessageIdsManager {
|
||||
msgTriggers.add(DEVICE_NAME+exitMoveIds.get("trigger"));
|
||||
msgTriggers.add(DEVICE_NAME+exitMeasureIds.get("trigger"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过字段名查找对应的 OPC 节点路径
|
||||
* @param fieldName 字段名,例如:coilId
|
||||
* @return OPC 节点路径,如果未找到返回 null
|
||||
*/
|
||||
public static String findIdentifierByFieldName(String fieldName) {
|
||||
if (fieldName == null || fieldName.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 在所有映射中查找,按优先级顺序查找(pdiSetupIds 优先,因为这是写数据的主要映射)
|
||||
Map<String, String>[] allMaps = new Map[]{
|
||||
pdiSetupIds,
|
||||
entryLineMeasureIds,
|
||||
procLineMeasureIds,
|
||||
furLineMeasureIds,
|
||||
exitLineMeasureIds,
|
||||
entryMoveIds,
|
||||
exitCutIds,
|
||||
exitMoveIds,
|
||||
exitMeasureIds
|
||||
};
|
||||
|
||||
for (Map<String, String> map : allMaps) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
// 跳过 trigger 键
|
||||
if ("trigger".equals(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
// 如果字段名匹配,返回对应的节点路径
|
||||
if (fieldName.equals(entry.getValue())) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ public class SegmentTrackerService {
|
||||
|
||||
if (LogRateLimiter.shouldLog("TRACK:" + coilId, 5000)) {
|
||||
log.info("焊缝位置匹配逻辑,当前焊缝长度{},", headPos);
|
||||
logDataService.logInfo("MATMAP-TRACK", "CoilId=" + coilId + " ...");
|
||||
logDataService.logInfo("MATMAP-TRACK", "CoilId=" + coilId + " 焊缝位置匹配逻辑,当前焊缝长度="+headPos);
|
||||
}
|
||||
|
||||
Set<DeviceEnum> prevReached = coilReachedDevices.computeIfAbsent(coilId,
|
||||
|
||||
@@ -9,6 +9,9 @@ import com.fizz.business.constants.enums.WsTypeEnum;
|
||||
import com.fizz.business.domain.msg.AppMeasureEntryMessage;
|
||||
import com.fizz.business.domain.msg.AppMeasureMessage;
|
||||
import com.fizz.business.dto.CoilPositionDTO;
|
||||
import com.fizz.business.dto.DeviceChartDataDTO;
|
||||
import com.fizz.business.dto.DeviceHistoryTrendDTO;
|
||||
import com.fizz.business.dto.DeviceFieldTrendDTO;
|
||||
import com.fizz.business.dto.L1CoilLineMeasureDTO;
|
||||
import com.fizz.business.dto.MatmapDTO;
|
||||
import com.fizz.business.dto.WsSignalMsgDTO;
|
||||
@@ -17,6 +20,7 @@ import com.fizz.business.form.WebOperateMatForm;
|
||||
import com.fizz.business.service.client.TrackWsHandler;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.var;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.socket.TextMessage;
|
||||
@@ -93,4 +97,52 @@ public class WebSocketUtil {
|
||||
if (CollUtil.isEmpty(list)) return;
|
||||
sendMessage(WsTypeEnum.track_matmap, JSONUtil.toJsonStr(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送设备历史趋势数据
|
||||
* @param trendData 历史趋势数据
|
||||
*/
|
||||
public static void sendHistoryTrendMessage(DeviceHistoryTrendDTO trendData) {
|
||||
if (trendData == null) return;
|
||||
sendMessage(WsTypeEnum.device_history_trend, JSONUtil.toJsonStr(trendData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送图表数据(饼图、条形图、折线图、统计数据)
|
||||
* @param chartData 图表数据
|
||||
*/
|
||||
public static void sendChartDataMessage(DeviceChartDataDTO chartData) {
|
||||
if (chartData == null) return;
|
||||
sendMessage(WsTypeEnum.device_chart_data, JSONUtil.toJsonStr(chartData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送设备-字段趋势数据
|
||||
*/
|
||||
public static void sendDeviceFieldTrendMessage(DeviceFieldTrendDTO dto) {
|
||||
if (dto == null) return;
|
||||
|
||||
// 懒加载:仅推送给订阅了该 deviceCode/fieldName 的客户端
|
||||
Map<String, WebSocketSession> clients = trackWsHandler.getClients().getOrDefault(WsTypeEnum.device_field_trend.name(), Maps.newConcurrentMap());
|
||||
if (clients.isEmpty()) return;
|
||||
|
||||
String payload = JSONUtil.toJsonStr(dto);
|
||||
TextMessage message = new TextMessage(payload);
|
||||
|
||||
clients.values().forEach(s -> {
|
||||
try {
|
||||
var state = TrackWsHandler.getFieldTrendState(s.getId());
|
||||
// 未建立订阅状态时默认不推送(避免全量)
|
||||
if (state == null) {
|
||||
return;
|
||||
}
|
||||
if (!state.match(dto.getDeviceCode(), dto.getFieldName())) {
|
||||
return;
|
||||
}
|
||||
s.sendMessage(message);
|
||||
} catch (IOException e) {
|
||||
log.error("[websocket]向客户端[{}]推送device_field_trend异常", s.getId(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ public class CrmPdiPlanVO {
|
||||
@Schema(description = "钢卷号")
|
||||
private String coilid;
|
||||
|
||||
@Schema(description = "入场钢卷号")
|
||||
private String enterCoilNo;
|
||||
|
||||
@Schema(description = "机组号")
|
||||
private String unitCode;
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.fizz.business.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Schema(description = "三级领料推荐")
|
||||
public class L3PickupRecommendVO {
|
||||
|
||||
@Schema(description = "待操作主键")
|
||||
private Long actionId;
|
||||
|
||||
@Schema(description = "当前钢卷号(回填到计划coilid)")
|
||||
private String coilId;
|
||||
|
||||
@Schema(description = "入场钢卷号(回填到计划enterCoilNo)")
|
||||
private String enterCoilNo;
|
||||
|
||||
@Schema(description = "L3钢卷ID")
|
||||
private Long sourceCoilId;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "扫码时间")
|
||||
private LocalDateTime scanTime;
|
||||
}
|
||||
@@ -4,178 +4,167 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.PdiSetupMapper">
|
||||
|
||||
<resultMap type="PdiSetup" id="PdiSetupResult">
|
||||
<result property="ID" column="ID" />
|
||||
<result property="COILID" column="COILID" />
|
||||
<result property="PLANID" column="PLANID" />
|
||||
<result property="porTension" column="POR_TENSION" />
|
||||
<result property="celTension" column="CEL_TENSION" />
|
||||
<result property="cleanTension" column="CLEAN_TENSION" />
|
||||
<result property="furTension" column="FUR_TENSION" />
|
||||
<result property="towerTension" column="TOWER_TENSION" />
|
||||
<result property="tmNoneTension" column="TM_NONE_TENSION" />
|
||||
<result property="tmEntryTension" column="TM_ENTRY_TENSION" />
|
||||
<result property="tmExitTension" column="TM_EXIT_TENSION" />
|
||||
<result property="tmRollforce" column="TM_ROLLFORCE" />
|
||||
<result property="tmBendforce" column="TM_BENDFORCE" />
|
||||
<result property="tmAcrMesh" column="TM_ACR_MESH" />
|
||||
<result property="tmBrMesh" column="TM_BR_MESH" />
|
||||
<result property="tlNoneTension" column="TL_NONE_TENSION" />
|
||||
<result property="tlExitTension" column="TL_EXIT_TENSION" />
|
||||
<result property="tlElong" column="TL_ELONG" />
|
||||
<result property="tlLvlMesh1" column="TL_LVL_MESH1" />
|
||||
<result property="tlLvlMesh2" column="TL_LVL_MESH2" />
|
||||
<result property="tlAcbMesh" column="TL_ACB_MESH" />
|
||||
<result property="coatTension" column="COAT_TENSION" />
|
||||
<result property="cxlTension" column="CXL_TENSION" />
|
||||
<result property="trTension" column="TR_TENSION" />
|
||||
<result property="createTime" column="CREATE_TIME" />
|
||||
<result property="updateTime" column="UPDATE_TIME" />
|
||||
<result property="TYPE" column="TYPE" />
|
||||
<!--
|
||||
说明:本 Mapper XML 统一以 MyBatis-Plus 实体 com.fizz.business.domain.PdiSetups 为准。
|
||||
旧版 PdiSetup(大写字段/TYPE/TM_*/TL_*) 已与当前实体不一致,继续保留会导致插入/查询字段缺失。
|
||||
-->
|
||||
|
||||
<resultMap id="PdiSetupsResult" type="com.fizz.business.domain.PdiSetups">
|
||||
<id property="id" column="id" />
|
||||
<result property="coilid" column="coilid" />
|
||||
<result property="planid" column="planid" />
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
|
||||
<result property="porTension" column="por_tension" />
|
||||
<result property="celTension" column="cel_tension" />
|
||||
<result property="cleanTension" column="clean_tension" />
|
||||
<result property="passivationTension" column="passivation_tension" />
|
||||
<result property="cxlTension" column="cxl_tension" />
|
||||
<result property="trTension" column="tr_tension" />
|
||||
<result property="levelerEntryTension" column="leveler_entry_tension" />
|
||||
<result property="levelerExitTension" column="leveler_exit_tension" />
|
||||
<result property="straightenerExitTension" column="straightener_exit_tension" />
|
||||
<result property="furTension" column="fur_tension" />
|
||||
<result property="towerTension" column="tower_tension" />
|
||||
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPdiSetupVo">
|
||||
select ID, COILID, PLANID, POR_TENSION, CEL_TENSION, CLEAN_TENSION, FUR_TENSION, TOWER_TENSION, TM_NONE_TENSION, TM_ENTRY_TENSION, TM_EXIT_TENSION, TM_ROLLFORCE, TM_BENDFORCE, TM_ACR_MESH, TM_BR_MESH, TL_NONE_TENSION, TL_EXIT_TENSION, TL_ELONG, TL_LVL_MESH1, TL_LVL_MESH2, TL_ACB_MESH, COAT_TENSION, CXL_TENSION, TR_TENSION, CREATE_TIME, UPDATE_TIME, TYPE from pdi_setup
|
||||
<sql id="Base_Column_List">
|
||||
id,
|
||||
coilid,
|
||||
planid,
|
||||
steel_grade,
|
||||
thick,
|
||||
yield_stren,
|
||||
por_tension,
|
||||
cel_tension,
|
||||
clean_tension,
|
||||
passivation_tension,
|
||||
cxl_tension,
|
||||
tr_tension,
|
||||
leveler_entry_tension,
|
||||
leveler_exit_tension,
|
||||
straightener_exit_tension,
|
||||
fur_tension,
|
||||
tower_tension,
|
||||
create_time,
|
||||
update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectPdiSetupList" parameterType="PdiSetup" resultMap="PdiSetupResult">
|
||||
<include refid="selectPdiSetupVo"/>
|
||||
<!-- 列表查询:支持按 coilid/planid/steelGrade/thick/yieldStren 过滤,按更新时间倒序 -->
|
||||
<select id="selectPdiSetupList" parameterType="com.fizz.business.domain.PdiSetups" resultMap="PdiSetupsResult">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pdi_setup
|
||||
<where>
|
||||
<if test="COILID != null and COILID != ''"> and COILID = #{COILID}</if>
|
||||
<if test="PLANID != null and PLANID != ''"> and PLANID = #{PLANID}</if>
|
||||
<if test="porTension != null "> and POR_TENSION = #{porTension}</if>
|
||||
<if test="celTension != null "> and CEL_TENSION = #{celTension}</if>
|
||||
<if test="cleanTension != null "> and CLEAN_TENSION = #{cleanTension}</if>
|
||||
<if test="furTension != null "> and FUR_TENSION = #{furTension}</if>
|
||||
<if test="towerTension != null "> and TOWER_TENSION = #{towerTension}</if>
|
||||
<if test="tmNoneTension != null "> and TM_NONE_TENSION = #{tmNoneTension}</if>
|
||||
<if test="tmEntryTension != null "> and TM_ENTRY_TENSION = #{tmEntryTension}</if>
|
||||
<if test="tmExitTension != null "> and TM_EXIT_TENSION = #{tmExitTension}</if>
|
||||
<if test="tmRollforce != null "> and TM_ROLLFORCE = #{tmRollforce}</if>
|
||||
<if test="tmBendforce != null "> and TM_BENDFORCE = #{tmBendforce}</if>
|
||||
<if test="tmAcrMesh != null "> and TM_ACR_MESH = #{tmAcrMesh}</if>
|
||||
<if test="tmBrMesh != null "> and TM_BR_MESH = #{tmBrMesh}</if>
|
||||
<if test="tlNoneTension != null "> and TL_NONE_TENSION = #{tlNoneTension}</if>
|
||||
<if test="tlExitTension != null "> and TL_EXIT_TENSION = #{tlExitTension}</if>
|
||||
<if test="tlElong != null "> and TL_ELONG = #{tlElong}</if>
|
||||
<if test="tlLvlMesh1 != null "> and TL_LVL_MESH1 = #{tlLvlMesh1}</if>
|
||||
<if test="tlLvlMesh2 != null "> and TL_LVL_MESH2 = #{tlLvlMesh2}</if>
|
||||
<if test="tlAcbMesh != null "> and TL_ACB_MESH = #{tlAcbMesh}</if>
|
||||
<if test="coatTension != null "> and COAT_TENSION = #{coatTension}</if>
|
||||
<if test="cxlTension != null "> and CXL_TENSION = #{cxlTension}</if>
|
||||
<if test="trTension != null "> and TR_TENSION = #{trTension}</if>
|
||||
<if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
|
||||
<if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
|
||||
<if test="TYPE != null "> and TYPE = #{TYPE}</if>
|
||||
<if test="coilid != null and coilid != ''"> and coilid = #{coilid}</if>
|
||||
<if test="planid != null and planid != ''"> and planid = #{planid}</if>
|
||||
<if test="steelGrade != null and steelGrade != ''"> and steel_grade = #{steelGrade}</if>
|
||||
<if test="thick != null"> and thick = #{thick}</if>
|
||||
<if test="yieldStren != null"> and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectPdiSetupById" parameterType="Long" resultMap="PdiSetupResult">
|
||||
<include refid="selectPdiSetupVo"/>
|
||||
where ID = #{id}
|
||||
<select id="selectPdiSetupById" parameterType="java.lang.Long" resultMap="PdiSetupsResult">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from pdi_setup
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPdiSetup" parameterType="PdiSetup" useGeneratedKeys="true" keyProperty="ID">
|
||||
<!--
|
||||
说明:insert/update 这里保留是为了兼容旧代码可能直接调用 XML 的 SQL。
|
||||
如果你们完全使用 MyBatis-Plus 的 BaseMapper/save/updateById,也可以后续删除这些 SQL。
|
||||
-->
|
||||
<insert id="insertPdiSetup" parameterType="com.fizz.business.domain.PdiSetups" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into pdi_setup
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="COILID != null">COILID,</if>
|
||||
<if test="PLANID != null">PLANID,</if>
|
||||
<if test="porTension != null">POR_TENSION,</if>
|
||||
<if test="celTension != null">CEL_TENSION,</if>
|
||||
<if test="cleanTension != null">CLEAN_TENSION,</if>
|
||||
<if test="furTension != null">FUR_TENSION,</if>
|
||||
<if test="towerTension != null">TOWER_TENSION,</if>
|
||||
<if test="tmNoneTension != null">TM_NONE_TENSION,</if>
|
||||
<if test="tmEntryTension != null">TM_ENTRY_TENSION,</if>
|
||||
<if test="tmExitTension != null">TM_EXIT_TENSION,</if>
|
||||
<if test="tmRollforce != null">TM_ROLLFORCE,</if>
|
||||
<if test="tmBendforce != null">TM_BENDFORCE,</if>
|
||||
<if test="tmAcrMesh != null">TM_ACR_MESH,</if>
|
||||
<if test="tmBrMesh != null">TM_BR_MESH,</if>
|
||||
<if test="tlNoneTension != null">TL_NONE_TENSION,</if>
|
||||
<if test="tlExitTension != null">TL_EXIT_TENSION,</if>
|
||||
<if test="tlElong != null">TL_ELONG,</if>
|
||||
<if test="tlLvlMesh1 != null">TL_LVL_MESH1,</if>
|
||||
<if test="tlLvlMesh2 != null">TL_LVL_MESH2,</if>
|
||||
<if test="tlAcbMesh != null">TL_ACB_MESH,</if>
|
||||
<if test="coatTension != null">COAT_TENSION,</if>
|
||||
<if test="cxlTension != null">CXL_TENSION,</if>
|
||||
<if test="trTension != null">TR_TENSION,</if>
|
||||
<if test="createTime != null">CREATE_TIME,</if>
|
||||
<if test="updateTime != null">UPDATE_TIME,</if>
|
||||
<if test="TYPE != null">TYPE,</if>
|
||||
<if test="coilid != null and coilid != ''">coilid,</if>
|
||||
<if test="planid != null and planid != ''">planid,</if>
|
||||
<if test="steelGrade != null and steelGrade != ''">steel_grade,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
|
||||
<if test="porTension != null">por_tension,</if>
|
||||
<if test="celTension != null">cel_tension,</if>
|
||||
<if test="cleanTension != null">clean_tension,</if>
|
||||
<if test="passivationTension != null">passivation_tension,</if>
|
||||
<if test="cxlTension != null">cxl_tension,</if>
|
||||
<if test="trTension != null">tr_tension,</if>
|
||||
<if test="levelerEntryTension != null">leveler_entry_tension,</if>
|
||||
<if test="levelerExitTension != null">leveler_exit_tension,</if>
|
||||
<if test="straightenerExitTension != null">straightener_exit_tension,</if>
|
||||
<if test="furTension != null">fur_tension,</if>
|
||||
<if test="towerTension != null">tower_tension,</if>
|
||||
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="COILID != null">#{COILID},</if>
|
||||
<if test="PLANID != null">#{PLANID},</if>
|
||||
<if test="coilid != null and coilid != ''">#{coilid},</if>
|
||||
<if test="planid != null and planid != ''">#{planid},</if>
|
||||
<if test="steelGrade != null and steelGrade != ''">#{steelGrade},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
|
||||
<if test="porTension != null">#{porTension},</if>
|
||||
<if test="celTension != null">#{celTension},</if>
|
||||
<if test="cleanTension != null">#{cleanTension},</if>
|
||||
<if test="furTension != null">#{furTension},</if>
|
||||
<if test="towerTension != null">#{towerTension},</if>
|
||||
<if test="tmNoneTension != null">#{tmNoneTension},</if>
|
||||
<if test="tmEntryTension != null">#{tmEntryTension},</if>
|
||||
<if test="tmExitTension != null">#{tmExitTension},</if>
|
||||
<if test="tmRollforce != null">#{tmRollforce},</if>
|
||||
<if test="tmBendforce != null">#{tmBendforce},</if>
|
||||
<if test="tmAcrMesh != null">#{tmAcrMesh},</if>
|
||||
<if test="tmBrMesh != null">#{tmBrMesh},</if>
|
||||
<if test="tlNoneTension != null">#{tlNoneTension},</if>
|
||||
<if test="tlExitTension != null">#{tlExitTension},</if>
|
||||
<if test="tlElong != null">#{tlElong},</if>
|
||||
<if test="tlLvlMesh1 != null">#{tlLvlMesh1},</if>
|
||||
<if test="tlLvlMesh2 != null">#{tlLvlMesh2},</if>
|
||||
<if test="tlAcbMesh != null">#{tlAcbMesh},</if>
|
||||
<if test="coatTension != null">#{coatTension},</if>
|
||||
<if test="passivationTension != null">#{passivationTension},</if>
|
||||
<if test="cxlTension != null">#{cxlTension},</if>
|
||||
<if test="trTension != null">#{trTension},</if>
|
||||
<if test="levelerEntryTension != null">#{levelerEntryTension},</if>
|
||||
<if test="levelerExitTension != null">#{levelerExitTension},</if>
|
||||
<if test="straightenerExitTension != null">#{straightenerExitTension},</if>
|
||||
<if test="furTension != null">#{furTension},</if>
|
||||
<if test="towerTension != null">#{towerTension},</if>
|
||||
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="TYPE != null">#{TYPE},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePdiSetup" parameterType="PdiSetup">
|
||||
<update id="updatePdiSetup" parameterType="com.fizz.business.domain.PdiSetups">
|
||||
update pdi_setup
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="COILID != null">COILID = #{COILID},</if>
|
||||
<if test="PLANID != null">PLANID = #{PLANID},</if>
|
||||
<if test="porTension != null">POR_TENSION = #{porTension},</if>
|
||||
<if test="celTension != null">CEL_TENSION = #{celTension},</if>
|
||||
<if test="cleanTension != null">CLEAN_TENSION = #{cleanTension},</if>
|
||||
<if test="furTension != null">FUR_TENSION = #{furTension},</if>
|
||||
<if test="towerTension != null">TOWER_TENSION = #{towerTension},</if>
|
||||
<if test="tmNoneTension != null">TM_NONE_TENSION = #{tmNoneTension},</if>
|
||||
<if test="tmEntryTension != null">TM_ENTRY_TENSION = #{tmEntryTension},</if>
|
||||
<if test="tmExitTension != null">TM_EXIT_TENSION = #{tmExitTension},</if>
|
||||
<if test="tmRollforce != null">TM_ROLLFORCE = #{tmRollforce},</if>
|
||||
<if test="tmBendforce != null">TM_BENDFORCE = #{tmBendforce},</if>
|
||||
<if test="tmAcrMesh != null">TM_ACR_MESH = #{tmAcrMesh},</if>
|
||||
<if test="tmBrMesh != null">TM_BR_MESH = #{tmBrMesh},</if>
|
||||
<if test="tlNoneTension != null">TL_NONE_TENSION = #{tlNoneTension},</if>
|
||||
<if test="tlExitTension != null">TL_EXIT_TENSION = #{tlExitTension},</if>
|
||||
<if test="tlElong != null">TL_ELONG = #{tlElong},</if>
|
||||
<if test="tlLvlMesh1 != null">TL_LVL_MESH1 = #{tlLvlMesh1},</if>
|
||||
<if test="tlLvlMesh2 != null">TL_LVL_MESH2 = #{tlLvlMesh2},</if>
|
||||
<if test="tlAcbMesh != null">TL_ACB_MESH = #{tlAcbMesh},</if>
|
||||
<if test="coatTension != null">COAT_TENSION = #{coatTension},</if>
|
||||
<if test="cxlTension != null">CXL_TENSION = #{cxlTension},</if>
|
||||
<if test="trTension != null">TR_TENSION = #{trTension},</if>
|
||||
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
|
||||
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
|
||||
<if test="TYPE != null">TYPE = #{TYPE},</if>
|
||||
<if test="coilid != null and coilid != ''">coilid = #{coilid},</if>
|
||||
<if test="planid != null and planid != ''">planid = #{planid},</if>
|
||||
<if test="steelGrade != null and steelGrade != ''">steel_grade = #{steelGrade},</if>
|
||||
<if test="thick != null">thick = #{thick},</if>
|
||||
<if test="yieldStren != null">yield_stren = #{yieldStren},</if>
|
||||
|
||||
<if test="porTension != null">por_tension = #{porTension},</if>
|
||||
<if test="celTension != null">cel_tension = #{celTension},</if>
|
||||
<if test="cleanTension != null">clean_tension = #{cleanTension},</if>
|
||||
<if test="passivationTension != null">passivation_tension = #{passivationTension},</if>
|
||||
<if test="cxlTension != null">cxl_tension = #{cxlTension},</if>
|
||||
<if test="trTension != null">tr_tension = #{trTension},</if>
|
||||
<if test="levelerEntryTension != null">leveler_entry_tension = #{levelerEntryTension},</if>
|
||||
<if test="levelerExitTension != null">leveler_exit_tension = #{levelerExitTension},</if>
|
||||
<if test="straightenerExitTension != null">straightener_exit_tension = #{straightenerExitTension},</if>
|
||||
<if test="furTension != null">fur_tension = #{furTension},</if>
|
||||
<if test="towerTension != null">tower_tension = #{towerTension},</if>
|
||||
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where ID = #{ID}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePdiSetupById" parameterType="Long">
|
||||
delete from pdi_setup where ID = #{id}
|
||||
<delete id="deletePdiSetupById" parameterType="java.lang.Long">
|
||||
delete from pdi_setup where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePdiSetupByIds" parameterType="String">
|
||||
delete from pdi_setup where ID in
|
||||
<foreach item="ID" collection="array" open="(" separator="," close=")">
|
||||
<delete id="deletePdiSetupByIds" parameterType="long">
|
||||
delete from pdi_setup where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTensionAllLineMapper">
|
||||
|
||||
<resultMap type="com.fizz.business.domain.SetupTensionAllLine" id="SetupTensionAllLineResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="value3" column="value3" />
|
||||
<result property="value4" column="value4" />
|
||||
<result property="value5" column="value5" />
|
||||
<result property="value6" column="value6" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTensionAllLineVo">
|
||||
select steel_grade, thick, yield_stren, value1, value2, value3, value4, value5, value6, create_time, update_time from setup_tension_all_line
|
||||
</sql>
|
||||
|
||||
<select id="selectList" parameterType="com.fizz.business.domain.SetupTensionAllLine" resultMap="SetupTensionAllLineResult">
|
||||
<include refid="selectSetupTensionAllLineVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null and steelGrade != ''"> and steel_grade like concat('%', #{steelGrade}, '%')</if>
|
||||
<if test="thick != null "> and thick = #{thick}</if>
|
||||
<if test="yieldStren != null "> and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByKey" resultMap="SetupTensionAllLineResult">
|
||||
<include refid="selectSetupTensionAllLineVo"/>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.fizz.business.domain.SetupTensionAllLine">
|
||||
insert into setup_tension_all_line
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">steel_grade,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="value3 != null">value3,</if>
|
||||
<if test="value4 != null">value4,</if>
|
||||
<if test="value5 != null">value5,</if>
|
||||
<if test="value6 != null">value6,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">#{steelGrade},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="value3 != null">#{value3},</if>
|
||||
<if test="value4 != null">#{value4},</if>
|
||||
<if test="value5 != null">#{value5},</if>
|
||||
<if test="value6 != null">#{value6},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByKey" parameterType="com.fizz.business.domain.SetupTensionAllLine">
|
||||
update setup_tension_all_line
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="value3 != null">value3 = #{value3},</if>
|
||||
<if test="value4 != null">value4 = #{value4},</if>
|
||||
<if test="value5 != null">value5 = #{value5},</if>
|
||||
<if test="value6 != null">value6 = #{value6},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByKey">
|
||||
delete from setup_tension_all_line where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTensionAnnealingFurnaceMapper">
|
||||
|
||||
<resultMap type="com.fizz.business.domain.SetupTensionAnnealingFurnace" id="SetupTensionAnnealingFurnaceResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTensionAnnealingFurnaceVo">
|
||||
select steel_grade, thick, yield_stren, value1, value2, create_time, update_time from setup_tension_annealing_furnace
|
||||
</sql>
|
||||
|
||||
<select id="selectList" parameterType="com.fizz.business.domain.SetupTensionAnnealingFurnace" resultMap="SetupTensionAnnealingFurnaceResult">
|
||||
<include refid="selectSetupTensionAnnealingFurnaceVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null and steelGrade != ''"> and steel_grade like concat('%', #{steelGrade}, '%')</if>
|
||||
<if test="thick != null "> and thick = #{thick}</if>
|
||||
<if test="yieldStren != null "> and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByKey" resultMap="SetupTensionAnnealingFurnaceResult">
|
||||
<include refid="selectSetupTensionAnnealingFurnaceVo"/>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.fizz.business.domain.SetupTensionAnnealingFurnace">
|
||||
insert into setup_tension_annealing_furnace
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">steel_grade,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">#{steelGrade},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByKey" parameterType="com.fizz.business.domain.SetupTensionAnnealingFurnace">
|
||||
update setup_tension_annealing_furnace
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByKey">
|
||||
delete from setup_tension_annealing_furnace where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTensionLevelerMapper">
|
||||
|
||||
<resultMap type="com.fizz.business.domain.SetupTensionLeveler" id="SetupTensionLevelerResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTensionLevelerVo">
|
||||
select steel_grade, thick, yield_stren, value1, value2, create_time, update_time from setup_tension_leveler
|
||||
</sql>
|
||||
|
||||
<select id="selectList" parameterType="com.fizz.business.domain.SetupTensionLeveler" resultMap="SetupTensionLevelerResult">
|
||||
<include refid="selectSetupTensionLevelerVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null and steelGrade != ''"> and steel_grade like concat('%', #{steelGrade}, '%')</if>
|
||||
<if test="thick != null "> and thick = #{thick}</if>
|
||||
<if test="yieldStren != null "> and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByKey" resultMap="SetupTensionLevelerResult">
|
||||
<include refid="selectSetupTensionLevelerVo"/>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.fizz.business.domain.SetupTensionLeveler">
|
||||
insert into setup_tension_leveler
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">steel_grade,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">#{steelGrade},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByKey" parameterType="com.fizz.business.domain.SetupTensionLeveler">
|
||||
update setup_tension_leveler
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByKey">
|
||||
delete from setup_tension_leveler where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTensionMapper">
|
||||
|
||||
<resultMap type="SetupTension" id="SetupTensionResult">
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="value3" column="value3" />
|
||||
<result property="value4" column="value4" />
|
||||
<result property="value5" column="value5" />
|
||||
<result property="value6" column="value6" />
|
||||
<result property="value7" column="value7" />
|
||||
<result property="value8" column="value8" />
|
||||
<result property="value9" column="value9" />
|
||||
<result property="value10" column="value10" />
|
||||
<result property="value11" column="value11" />
|
||||
<result property="value12" column="value12" />
|
||||
<result property="value13" column="value13" />
|
||||
<result property="value14" column="value14" />
|
||||
<result property="value15" column="value15" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTensionVo">
|
||||
select thick, yield_stren, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, value11, value12, value13, value14, value15, create_time, update_time from setup_tension
|
||||
</sql>
|
||||
|
||||
<select id="selectSetupTensionList" parameterType="SetupTension" resultMap="SetupTensionResult">
|
||||
<include refid="selectSetupTensionVo"/>
|
||||
<where>
|
||||
<if test="thick != null "> and thick = #{thick}</if>
|
||||
<if test="yieldStren != null "> and yield_stren = #{yieldStren}</if>
|
||||
<if test="value1 != null "> and value1 = #{value1}</if>
|
||||
<if test="value2 != null "> and value2 = #{value2}</if>
|
||||
<if test="value3 != null "> and value3 = #{value3}</if>
|
||||
<if test="value4 != null "> and value4 = #{value4}</if>
|
||||
<if test="value5 != null "> and value5 = #{value5}</if>
|
||||
<if test="value6 != null "> and value6 = #{value6}</if>
|
||||
<if test="value7 != null "> and value7 = #{value7}</if>
|
||||
<if test="value8 != null "> and value8 = #{value8}</if>
|
||||
<if test="value9 != null "> and value9 = #{value9}</if>
|
||||
<if test="value10 != null "> and value10 = #{value10}</if>
|
||||
<if test="value11 != null "> and value11 = #{value11}</if>
|
||||
<if test="value12 != null "> and value12 = #{value12}</if>
|
||||
<if test="value13 != null "> and value13 = #{value13}</if>
|
||||
<if test="value14 != null "> and value14 = #{value14}</if>
|
||||
<if test="value15 != null "> and value15 = #{value15}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSetupTensionByThick" parameterType="Long" resultMap="SetupTensionResult">
|
||||
<include refid="selectSetupTensionVo"/>
|
||||
<where>
|
||||
<if test="thick != null ">and thick = #{thick}</if>
|
||||
<if test="yieldStren != null ">and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSetupTension" parameterType="SetupTension">
|
||||
insert into setup_tension
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="value3 != null">value3,</if>
|
||||
<if test="value4 != null">value4,</if>
|
||||
<if test="value5 != null">value5,</if>
|
||||
<if test="value6 != null">value6,</if>
|
||||
<if test="value7 != null">value7,</if>
|
||||
<if test="value8 != null">value8,</if>
|
||||
<if test="value9 != null">value9,</if>
|
||||
<if test="value10 != null">value10,</if>
|
||||
<if test="value11 != null">value11,</if>
|
||||
<if test="value12 != null">value12,</if>
|
||||
<if test="value13 != null">value13,</if>
|
||||
<if test="value14 != null">value14,</if>
|
||||
<if test="value15 != null">value15,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="value3 != null">#{value3},</if>
|
||||
<if test="value4 != null">#{value4},</if>
|
||||
<if test="value5 != null">#{value5},</if>
|
||||
<if test="value6 != null">#{value6},</if>
|
||||
<if test="value7 != null">#{value7},</if>
|
||||
<if test="value8 != null">#{value8},</if>
|
||||
<if test="value9 != null">#{value9},</if>
|
||||
<if test="value10 != null">#{value10},</if>
|
||||
<if test="value11 != null">#{value11},</if>
|
||||
<if test="value12 != null">#{value12},</if>
|
||||
<if test="value13 != null">#{value13},</if>
|
||||
<if test="value14 != null">#{value14},</if>
|
||||
<if test="value15 != null">#{value15},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSetupTension" parameterType="SetupTension">
|
||||
update setup_tension
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="value3 != null">value3 = #{value3},</if>
|
||||
<if test="value4 != null">value4 = #{value4},</if>
|
||||
<if test="value5 != null">value5 = #{value5},</if>
|
||||
<if test="value6 != null">value6 = #{value6},</if>
|
||||
<if test="value7 != null">value7 = #{value7},</if>
|
||||
<if test="value8 != null">value8 = #{value8},</if>
|
||||
<if test="value9 != null">value9 = #{value9},</if>
|
||||
<if test="value10 != null">value10 = #{value10},</if>
|
||||
<if test="value11 != null">value11 = #{value11},</if>
|
||||
<if test="value12 != null">value12 = #{value12},</if>
|
||||
<if test="value13 != null">value13 = #{value13},</if>
|
||||
<if test="value14 != null">value14 = #{value14},</if>
|
||||
<if test="value15 != null">value15 = #{value15},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSetupTensionByThick" parameterType="Long">
|
||||
delete from setup_tension where thick = #{thick}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSetupTensionByThicks" parameterType="String">
|
||||
delete from setup_tension
|
||||
where
|
||||
<foreach item="item" index="index" collection="thicks" open="(" separator=") OR (" close=")">
|
||||
thick = #{thicks[${index}]}
|
||||
AND yield_stren = #{yieldStrens[${index}]}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTensionStraightenerMapper">
|
||||
|
||||
<resultMap type="com.fizz.business.domain.SetupTensionStraightener" id="SetupTensionStraightenerResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTensionStraightenerVo">
|
||||
select steel_grade, thick, yield_stren, value1, create_time, update_time from setup_tension_straightener
|
||||
</sql>
|
||||
|
||||
<select id="selectList" parameterType="com.fizz.business.domain.SetupTensionStraightener" resultMap="SetupTensionStraightenerResult">
|
||||
<include refid="selectSetupTensionStraightenerVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null and steelGrade != ''"> and steel_grade like concat('%', #{steelGrade}, '%')</if>
|
||||
<if test="thick != null "> and thick = #{thick}</if>
|
||||
<if test="yieldStren != null "> and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByKey" resultMap="SetupTensionStraightenerResult">
|
||||
<include refid="selectSetupTensionStraightenerVo"/>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.fizz.business.domain.SetupTensionStraightener">
|
||||
insert into setup_tension_straightener
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">steel_grade,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null and steelGrade != ''">#{steelGrade},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateByKey" parameterType="com.fizz.business.domain.SetupTensionStraightener">
|
||||
update setup_tension_straightener
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByKey">
|
||||
delete from setup_tension_straightener where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -1,128 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTlMapper">
|
||||
|
||||
<resultMap type="SetupTl" id="SetupTlResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="value3" column="value3" />
|
||||
<result property="value4" column="value4" />
|
||||
<result property="value5" column="value5" />
|
||||
<result property="value6" column="value6" />
|
||||
<result property="value7" column="value7" />
|
||||
<result property="value8" column="value8" />
|
||||
<result property="value9" column="value9" />
|
||||
<result property="value10" column="value10" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTlVo">
|
||||
select steel_grade, yield_stren, thick, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, update_time, create_time from setup_tl
|
||||
</sql>
|
||||
|
||||
<select id="selectSetupTlList" parameterType="SetupTl" resultMap="SetupTlResult">
|
||||
<include refid="selectSetupTlVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null "> and steel_grade = #{steelGrade}</if>
|
||||
<if test="yieldStren != null "> and yield_stren = #{yieldStren}</if>
|
||||
<if test="thick != null "> and thick = #{thick}</if>
|
||||
<if test="value1 != null "> and value1 = #{value1}</if>
|
||||
<if test="value2 != null "> and value2 = #{value2}</if>
|
||||
<if test="value3 != null "> and value3 = #{value3}</if>
|
||||
<if test="value4 != null "> and value4 = #{value4}</if>
|
||||
<if test="value5 != null "> and value5 = #{value5}</if>
|
||||
<if test="value6 != null "> and value6 = #{value6}</if>
|
||||
<if test="value7 != null "> and value7 = #{value7}</if>
|
||||
<if test="value8 != null "> and value8 = #{value8}</if>
|
||||
<if test="value9 != null "> and value9 = #{value9}</if>
|
||||
<if test="value10 != null "> and value10 = #{value10}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSetupTlBySteelGrade" parameterType="String" resultMap="SetupTlResult">
|
||||
<include refid="selectSetupTlVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null ">and steel_grade = #{steelGrade}</if>
|
||||
<if test="yieldStren != null ">and yield_stren = #{yieldStren}</if>
|
||||
<if test="thick != null ">and thick = #{thick}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSetupTl" parameterType="SetupTl">
|
||||
insert into setup_tl
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null">steel_grade,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="value3 != null">value3,</if>
|
||||
<if test="value4 != null">value4,</if>
|
||||
<if test="value5 != null">value5,</if>
|
||||
<if test="value6 != null">value6,</if>
|
||||
<if test="value7 != null">value7,</if>
|
||||
<if test="value8 != null">value8,</if>
|
||||
<if test="value9 != null">value9,</if>
|
||||
<if test="value10 != null">value10,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null">#{steelGrade},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="value3 != null">#{value3},</if>
|
||||
<if test="value4 != null">#{value4},</if>
|
||||
<if test="value5 != null">#{value5},</if>
|
||||
<if test="value6 != null">#{value6},</if>
|
||||
<if test="value7 != null">#{value7},</if>
|
||||
<if test="value8 != null">#{value8},</if>
|
||||
<if test="value9 != null">#{value9},</if>
|
||||
<if test="value10 != null">#{value10},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSetupTl" parameterType="SetupTl">
|
||||
update setup_tl
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="value3 != null">value3 = #{value3},</if>
|
||||
<if test="value4 != null">value4 = #{value4},</if>
|
||||
<if test="value5 != null">value5 = #{value5},</if>
|
||||
<if test="value6 != null">value6 = #{value6},</if>
|
||||
<if test="value7 != null">value7 = #{value7},</if>
|
||||
<if test="value8 != null">value8 = #{value8},</if>
|
||||
<if test="value9 != null">value9 = #{value9},</if>
|
||||
<if test="value10 != null">value10 = #{value10},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and yield_stren = #{yieldStren} and thick = #{thick}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSetupTlBySteelGrade" parameterType="String">
|
||||
delete from setup_tl where steel_grade = #{steelGrade}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSetupTlBySteelGrades" parameterType="String">
|
||||
DELETE FROM setup_tl
|
||||
WHERE
|
||||
<foreach item="item" index="index" collection="steelGrades" open="(" separator=") OR (" close=")">
|
||||
steel_grade = #{steelGrades[${index}]}
|
||||
AND yield_stren = #{yieldStrens[${index}]}
|
||||
AND thick = #{thicks[${index}]}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTmBendforceMapper">
|
||||
|
||||
<resultMap type="SetupTmBendforce" id="SetupTmBendforceResult">
|
||||
<result property="width" column="width" />
|
||||
<result property="rollForce" column="roll_force" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="value3" column="value3" />
|
||||
<result property="value4" column="value4" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTmBendforceVo">
|
||||
select width, roll_force, value1, value2, value3, value4, update_time, create_time from setup_tm_bendforce
|
||||
</sql>
|
||||
|
||||
<select id="selectSetupTmBendforceList" parameterType="SetupTmBendforce" resultMap="SetupTmBendforceResult">
|
||||
<include refid="selectSetupTmBendforceVo"/>
|
||||
<where>
|
||||
<if test="value1 != null "> and value1 = #{value1}</if>
|
||||
<if test="value2 != null "> and value2 = #{value2}</if>
|
||||
<if test="value3 != null "> and value3 = #{value3}</if>
|
||||
<if test="value4 != null "> and value4 = #{value4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSetupTmBendforceByWidth" parameterType="Long" resultMap="SetupTmBendforceResult">
|
||||
<include refid="selectSetupTmBendforceVo"/>
|
||||
<where>
|
||||
<if test="width != null ">and width = #{width}</if>
|
||||
<if test="rollForce != null ">and roll_force = #{rollForce}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSetupTmBendforce" parameterType="SetupTmBendforce">
|
||||
insert into setup_tm_bendforce
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="width != null">width,</if>
|
||||
<if test="rollForce != null">roll_force,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="value3 != null">value3,</if>
|
||||
<if test="value4 != null">value4,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="width != null">#{width},</if>
|
||||
<if test="rollForce != null">#{rollForce},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="value3 != null">#{value3},</if>
|
||||
<if test="value4 != null">#{value4},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSetupTmBendforce" parameterType="SetupTmBendforce">
|
||||
update setup_tm_bendforce
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="value3 != null">value3 = #{value3},</if>
|
||||
<if test="value4 != null">value4 = #{value4},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where width = #{width} and roll_force = #{rollForce}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSetupTmBendforceByWidth" parameterType="Long">
|
||||
delete from setup_tm_bendforce where width = #{width}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSetupTmBendforceByWidths" parameterType="String">
|
||||
DELETE FROM setup_tm_bendforce
|
||||
WHERE
|
||||
<foreach item="item" index="index" collection="widths" open="(" separator=") OR (" close=")">
|
||||
width = #{widths[${index}]}
|
||||
AND roll_force = #{rollForces[${index}]}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -1,125 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTmMeshMapper">
|
||||
|
||||
<resultMap type="SetupTmMesh" id="SetupTmMeshResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="value3" column="value3" />
|
||||
<result property="value4" column="value4" />
|
||||
<result property="value5" column="value5" />
|
||||
<result property="value6" column="value6" />
|
||||
<result property="value7" column="value7" />
|
||||
<result property="value8" column="value8" />
|
||||
<result property="value9" column="value9" />
|
||||
<result property="value10" column="value10" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTmMeshVo">
|
||||
select steel_grade, yield_stren, thick, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, update_time, create_time from setup_tm_mesh
|
||||
</sql>
|
||||
|
||||
<select id="selectSetupTmMeshList" parameterType="SetupTmMesh" resultMap="SetupTmMeshResult">
|
||||
<include refid="selectSetupTmMeshVo"/>
|
||||
<where>
|
||||
<if test="value1 != null "> and value1 = #{value1}</if>
|
||||
<if test="value2 != null "> and value2 = #{value2}</if>
|
||||
<if test="value3 != null "> and value3 = #{value3}</if>
|
||||
<if test="value4 != null "> and value4 = #{value4}</if>
|
||||
<if test="value5 != null "> and value5 = #{value5}</if>
|
||||
<if test="value6 != null "> and value6 = #{value6}</if>
|
||||
<if test="value7 != null "> and value7 = #{value7}</if>
|
||||
<if test="value8 != null "> and value8 = #{value8}</if>
|
||||
<if test="value9 != null "> and value9 = #{value9}</if>
|
||||
<if test="value10 != null "> and value10 = #{value10}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSetupTmMeshBySteelGrade" parameterType="String" resultMap="SetupTmMeshResult">
|
||||
<include refid="selectSetupTmMeshVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null ">and steel_grade = #{steelGrade}</if>
|
||||
<if test="yieldStren != null ">and yield_stren = #{yieldStren}</if>
|
||||
<if test="thick != null ">and thick = #{thick}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSetupTmMesh" parameterType="SetupTmMesh">
|
||||
insert into setup_tm_mesh
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null">steel_grade,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="value3 != null">value3,</if>
|
||||
<if test="value4 != null">value4,</if>
|
||||
<if test="value5 != null">value5,</if>
|
||||
<if test="value6 != null">value6,</if>
|
||||
<if test="value7 != null">value7,</if>
|
||||
<if test="value8 != null">value8,</if>
|
||||
<if test="value9 != null">value9,</if>
|
||||
<if test="value10 != null">value10,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null">#{steelGrade},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="value3 != null">#{value3},</if>
|
||||
<if test="value4 != null">#{value4},</if>
|
||||
<if test="value5 != null">#{value5},</if>
|
||||
<if test="value6 != null">#{value6},</if>
|
||||
<if test="value7 != null">#{value7},</if>
|
||||
<if test="value8 != null">#{value8},</if>
|
||||
<if test="value9 != null">#{value9},</if>
|
||||
<if test="value10 != null">#{value10},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSetupTmMesh" parameterType="SetupTmMesh">
|
||||
update setup_tm_mesh
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="value3 != null">value3 = #{value3},</if>
|
||||
<if test="value4 != null">value4 = #{value4},</if>
|
||||
<if test="value5 != null">value5 = #{value5},</if>
|
||||
<if test="value6 != null">value6 = #{value6},</if>
|
||||
<if test="value7 != null">value7 = #{value7},</if>
|
||||
<if test="value8 != null">value8 = #{value8},</if>
|
||||
<if test="value9 != null">value9 = #{value9},</if>
|
||||
<if test="value10 != null">value10 = #{value10},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and yield_stren = #{yieldStren} and thick = #{thick}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSetupTmMeshBySteelGrade" parameterType="String">
|
||||
delete from setup_tm_mesh where steel_grade = #{steelGrade}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSetupTmMeshBySteelGrades" parameterType="String">
|
||||
DELETE FROM setup_tm_mesh
|
||||
WHERE
|
||||
<foreach item="item" index="index" collection="steelGrades" open="(" separator=") OR (" close=")">
|
||||
thick = #{thicks[${index}]}
|
||||
AND steel_grade = #{steelGrades[${index}]}
|
||||
AND yield_stren = #{yieldStrens[${index}]}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -1,129 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fizz.business.mapper.SetupTmRollforceMapper">
|
||||
|
||||
<resultMap type="SetupTmRollforce" id="SetupTmRollforceResult">
|
||||
<result property="steelGrade" column="steel_grade" />
|
||||
<result property="thick" column="thick" />
|
||||
<result property="yieldStren" column="yield_stren" />
|
||||
<result property="elong" column="elong" />
|
||||
<result property="value1" column="value1" />
|
||||
<result property="value2" column="value2" />
|
||||
<result property="value3" column="value3" />
|
||||
<result property="value4" column="value4" />
|
||||
<result property="value5" column="value5" />
|
||||
<result property="value6" column="value6" />
|
||||
<result property="value7" column="value7" />
|
||||
<result property="value8" column="value8" />
|
||||
<result property="value9" column="value9" />
|
||||
<result property="value10" column="value10" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSetupTmRollforceVo">
|
||||
select steel_grade, thick, yield_stren, elong, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, update_time, create_time from setup_tm_rollforce
|
||||
</sql>
|
||||
|
||||
<select id="selectSetupTmRollforceList" parameterType="SetupTmRollforce" resultMap="SetupTmRollforceResult">
|
||||
<include refid="selectSetupTmRollforceVo"/>
|
||||
<where>
|
||||
<if test="value1 != null "> and value1 = #{value1}</if>
|
||||
<if test="value2 != null "> and value2 = #{value2}</if>
|
||||
<if test="value3 != null "> and value3 = #{value3}</if>
|
||||
<if test="value4 != null "> and value4 = #{value4}</if>
|
||||
<if test="value5 != null "> and value5 = #{value5}</if>
|
||||
<if test="value6 != null "> and value6 = #{value6}</if>
|
||||
<if test="value7 != null "> and value7 = #{value7}</if>
|
||||
<if test="value8 != null "> and value8 = #{value8}</if>
|
||||
<if test="value9 != null "> and value9 = #{value9}</if>
|
||||
<if test="value10 != null "> and value10 = #{value10}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSetupTmRollforceBySteelGrade" parameterType="String" resultMap="SetupTmRollforceResult">
|
||||
<include refid="selectSetupTmRollforceVo"/>
|
||||
<where>
|
||||
<if test="steelGrade != null">and steel_grade = #{steelGrade}</if>
|
||||
<if test="thick != null">and thick = #{thick}</if>
|
||||
<if test="yieldStren != null">and yield_stren = #{yieldStren}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertSetupTmRollforce" parameterType="SetupTmRollforce">
|
||||
insert into setup_tm_rollforce
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null">steel_grade,</if>
|
||||
<if test="thick != null">thick,</if>
|
||||
<if test="yieldStren != null">yield_stren,</if>
|
||||
<if test="elong != null">elong,</if>
|
||||
<if test="value1 != null">value1,</if>
|
||||
<if test="value2 != null">value2,</if>
|
||||
<if test="value3 != null">value3,</if>
|
||||
<if test="value4 != null">value4,</if>
|
||||
<if test="value5 != null">value5,</if>
|
||||
<if test="value6 != null">value6,</if>
|
||||
<if test="value7 != null">value7,</if>
|
||||
<if test="value8 != null">value8,</if>
|
||||
<if test="value9 != null">value9,</if>
|
||||
<if test="value10 != null">value10,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="steelGrade != null">#{steelGrade},</if>
|
||||
<if test="thick != null">#{thick},</if>
|
||||
<if test="yieldStren != null">#{yieldStren},</if>
|
||||
<if test="elong != null">#{elong},</if>
|
||||
<if test="value1 != null">#{value1},</if>
|
||||
<if test="value2 != null">#{value2},</if>
|
||||
<if test="value3 != null">#{value3},</if>
|
||||
<if test="value4 != null">#{value4},</if>
|
||||
<if test="value5 != null">#{value5},</if>
|
||||
<if test="value6 != null">#{value6},</if>
|
||||
<if test="value7 != null">#{value7},</if>
|
||||
<if test="value8 != null">#{value8},</if>
|
||||
<if test="value9 != null">#{value9},</if>
|
||||
<if test="value10 != null">#{value10},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSetupTmRollforce" parameterType="SetupTmRollforce">
|
||||
update setup_tm_rollforce
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="value1 != null">value1 = #{value1},</if>
|
||||
<if test="value2 != null">value2 = #{value2},</if>
|
||||
<if test="value3 != null">value3 = #{value3},</if>
|
||||
<if test="value4 != null">value4 = #{value4},</if>
|
||||
<if test="value5 != null">value5 = #{value5},</if>
|
||||
<if test="value6 != null">value6 = #{value6},</if>
|
||||
<if test="value7 != null">value7 = #{value7},</if>
|
||||
<if test="value8 != null">value8 = #{value8},</if>
|
||||
<if test="value9 != null">value9 = #{value9},</if>
|
||||
<if test="value10 != null">value10 = #{value10},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where steel_grade = #{steelGrade} and thick = #{thick} and yield_stren = #{yieldStren} and elong = #{elong}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSetupTmRollforceBySteelGrade" parameterType="String">
|
||||
delete from setup_tm_rollforce where steel_grade = #{steelGrade}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSetupTmRollforceBySteelGrades" parameterType="String">
|
||||
DELETE FROM setup_tm_rollforce
|
||||
WHERE
|
||||
<foreach item="item" index="index" collection="steelGrades" open="(" separator=") OR (" close=")">
|
||||
thick = #{thicks[${index}]}
|
||||
AND steel_grade = #{steelGrades[${index}]}
|
||||
AND yield_stren = #{yieldStrens[${index}]}
|
||||
AND elong = #{elongs[${index}]}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.fizz.business.mapper.CrmPdiPlanMapper">
|
||||
</mapper>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user