feat(alert): 添加参数阈值预警检查功能

- 在ProcessAlertService中新增checkThresholdAlerts方法用于检查参数阈值
- 在ProcessAlertController中新增checkThreshold接口用于触发阈值检查
- 实现参数阈值检查逻辑,支持上限和下限预警
- 添加日志记录和异常处理机制
- 移除调试备份相关服务接口和实现代码
master
zangch@mesnac.com 2 months ago
parent 7736ccb69d
commit 12614bd6e3

@ -83,4 +83,15 @@ public class ProcessAlertController extends BaseController {
processAlert.setHandleTime(DateUtils.getNowDate());
return toAjax(processAlertService.updateProcessAlert(processAlert));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:processAlert:add')")
@Log(title = "检查阈值预警", businessType = BusinessType.INSERT)
@PostMapping("/checkThreshold")
public AjaxResult checkThreshold() {
int count = processAlertService.checkThresholdAlerts();
return success("检查完成,生成预警 " + count + " 条");
}
}

@ -1,83 +0,0 @@
package com.aucma.base.controller;
import com.aucma.base.domain.ProcessDebugBackup;
import com.aucma.base.service.IProcessDebugBackupService;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-12-30
*/
@RestController
@RequestMapping("/base/processDebugBackup")
public class ProcessDebugBackupController extends BaseController {
@Autowired
private IProcessDebugBackupService processDebugBackupService;
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:list')")
@GetMapping("/list")
public TableDataInfo list(ProcessDebugBackup processDebugBackup) {
startPage();
List<ProcessDebugBackup> list = processDebugBackupService.selectProcessDebugBackupList(processDebugBackup);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:export')")
@Log(title = "调试备份", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProcessDebugBackup processDebugBackup) {
List<ProcessDebugBackup> list = processDebugBackupService.selectProcessDebugBackupList(processDebugBackup);
ExcelUtil<ProcessDebugBackup> util = new ExcelUtil<ProcessDebugBackup>(ProcessDebugBackup.class);
util.exportExcel(response, list, "调试备份数据");
}
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:query')")
@GetMapping(value = "/{backupId}")
public AjaxResult getInfo(@PathVariable("backupId") Long backupId) {
return success(processDebugBackupService.selectProcessDebugBackupByBackupId(backupId));
}
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:add')")
@Log(title = "调试备份", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProcessDebugBackup processDebugBackup) {
processDebugBackup.setCreateBy(getUsername());
processDebugBackup.setBackupUser(getUsername());
return toAjax(processDebugBackupService.insertProcessDebugBackup(processDebugBackup));
}
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:edit')")
@Log(title = "调试备份", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProcessDebugBackup processDebugBackup) {
processDebugBackup.setUpdateBy(getUsername());
return toAjax(processDebugBackupService.updateProcessDebugBackup(processDebugBackup));
}
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:remove')")
@Log(title = "调试备份", businessType = BusinessType.DELETE)
@DeleteMapping("/{backupIds}")
public AjaxResult remove(@PathVariable Long[] backupIds) {
return toAjax(processDebugBackupService.deleteProcessDebugBackupByBackupIds(backupIds));
}
@PreAuthorize("@ss.hasPermi('base:processDebugBackup:list')")
@GetMapping("/getProcessDebugBackupList")
public AjaxResult getProcessDebugBackupList(ProcessDebugBackup processDebugBackup) {
List<ProcessDebugBackup> list = processDebugBackupService.selectProcessDebugBackupList(processDebugBackup);
return success(list);
}
}

@ -1,78 +0,0 @@
package com.aucma.base.controller;
import com.aucma.base.domain.ProcessParamChange;
import com.aucma.base.service.IProcessParamChangeService;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-12-30
*/
@RestController
@RequestMapping("/base/processParamChange")
public class ProcessParamChangeController extends BaseController {
@Autowired
private IProcessParamChangeService processParamChangeService;
@PreAuthorize("@ss.hasPermi('base:processParamChange:list')")
@GetMapping("/list")
public TableDataInfo list(ProcessParamChange processParamChange) {
startPage();
List<ProcessParamChange> list = processParamChangeService.selectProcessParamChangeList(processParamChange);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('base:processParamChange:export')")
@Log(title = "工艺参数变更记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProcessParamChange processParamChange) {
List<ProcessParamChange> list = processParamChangeService.selectProcessParamChangeList(processParamChange);
ExcelUtil<ProcessParamChange> util = new ExcelUtil<ProcessParamChange>(ProcessParamChange.class);
util.exportExcel(response, list, "工艺参数变更记录数据");
}
@PreAuthorize("@ss.hasPermi('base:processParamChange:query')")
@GetMapping(value = "/{changeId}")
public AjaxResult getInfo(@PathVariable("changeId") Long changeId) {
return success(processParamChangeService.selectProcessParamChangeByChangeId(changeId));
}
@PreAuthorize("@ss.hasPermi('base:processParamChange:add')")
@Log(title = "工艺参数变更记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProcessParamChange processParamChange) {
processParamChange.setCreateBy(getUsername());
if (processParamChange.getChangeUser() == null) {
processParamChange.setChangeUser(getUsername());
}
return toAjax(processParamChangeService.insertProcessParamChange(processParamChange));
}
@PreAuthorize("@ss.hasPermi('base:processParamChange:edit')")
@Log(title = "工艺参数变更记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProcessParamChange processParamChange) {
processParamChange.setUpdateBy(getUsername());
return toAjax(processParamChangeService.updateProcessParamChange(processParamChange));
}
@PreAuthorize("@ss.hasPermi('base:processParamChange:remove')")
@Log(title = "工艺参数变更记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{changeIds}")
public AjaxResult remove(@PathVariable Long[] changeIds) {
return toAjax(processParamChangeService.deleteProcessParamChangeByChangeIds(changeIds));
}
}

@ -1,75 +0,0 @@
package com.aucma.base.controller;
import com.aucma.base.domain.ProcessParamMonitor;
import com.aucma.base.service.IProcessParamMonitorService;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-12-30
*/
@RestController
@RequestMapping("/base/processParamMonitor")
public class ProcessParamMonitorController extends BaseController {
@Autowired
private IProcessParamMonitorService processParamMonitorService;
@PreAuthorize("@ss.hasPermi('base:processParamMonitor:list')")
@GetMapping("/list")
public TableDataInfo list(ProcessParamMonitor processParamMonitor) {
startPage();
List<ProcessParamMonitor> list = processParamMonitorService.selectProcessParamMonitorList(processParamMonitor);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('base:processParamMonitor:export')")
@Log(title = "工艺参数监控", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProcessParamMonitor processParamMonitor) {
List<ProcessParamMonitor> list = processParamMonitorService.selectProcessParamMonitorList(processParamMonitor);
ExcelUtil<ProcessParamMonitor> util = new ExcelUtil<ProcessParamMonitor>(ProcessParamMonitor.class);
util.exportExcel(response, list, "工艺参数监控数据");
}
@PreAuthorize("@ss.hasPermi('base:processParamMonitor:query')")
@GetMapping(value = "/{monitorId}")
public AjaxResult getInfo(@PathVariable("monitorId") Long monitorId) {
return success(processParamMonitorService.selectProcessParamMonitorByMonitorId(monitorId));
}
@PreAuthorize("@ss.hasPermi('base:processParamMonitor:add')")
@Log(title = "工艺参数监控", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProcessParamMonitor processParamMonitor) {
processParamMonitor.setCreateBy(getUsername());
return toAjax(processParamMonitorService.insertProcessParamMonitor(processParamMonitor));
}
@PreAuthorize("@ss.hasPermi('base:processParamMonitor:edit')")
@Log(title = "工艺参数监控", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProcessParamMonitor processParamMonitor) {
processParamMonitor.setUpdateBy(getUsername());
return toAjax(processParamMonitorService.updateProcessParamMonitor(processParamMonitor));
}
@PreAuthorize("@ss.hasPermi('base:processParamMonitor:remove')")
@Log(title = "工艺参数监控", businessType = BusinessType.DELETE)
@DeleteMapping("/{monitorIds}")
public AjaxResult remove(@PathVariable Long[] monitorIds) {
return toAjax(processParamMonitorService.deleteProcessParamMonitorByMonitorIds(monitorIds));
}
}

@ -1,75 +0,0 @@
package com.aucma.base.controller;
import com.aucma.base.domain.ProcessParamTrace;
import com.aucma.base.service.IProcessParamTraceService;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-12-30
*/
@RestController
@RequestMapping("/base/processParamTrace")
public class ProcessParamTraceController extends BaseController {
@Autowired
private IProcessParamTraceService processParamTraceService;
@PreAuthorize("@ss.hasPermi('base:processParamTrace:list')")
@GetMapping("/list")
public TableDataInfo list(ProcessParamTrace processParamTrace) {
startPage();
List<ProcessParamTrace> list = processParamTraceService.selectProcessParamTraceList(processParamTrace);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('base:processParamTrace:export')")
@Log(title = "参数追溯", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProcessParamTrace processParamTrace) {
List<ProcessParamTrace> list = processParamTraceService.selectProcessParamTraceList(processParamTrace);
ExcelUtil<ProcessParamTrace> util = new ExcelUtil<ProcessParamTrace>(ProcessParamTrace.class);
util.exportExcel(response, list, "参数追溯数据");
}
@PreAuthorize("@ss.hasPermi('base:processParamTrace:query')")
@GetMapping(value = "/{traceId}")
public AjaxResult getInfo(@PathVariable("traceId") Long traceId) {
return success(processParamTraceService.selectProcessParamTraceByTraceId(traceId));
}
@PreAuthorize("@ss.hasPermi('base:processParamTrace:add')")
@Log(title = "参数追溯", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProcessParamTrace processParamTrace) {
processParamTrace.setCreateBy(getUsername());
return toAjax(processParamTraceService.insertProcessParamTrace(processParamTrace));
}
@PreAuthorize("@ss.hasPermi('base:processParamTrace:edit')")
@Log(title = "参数追溯", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProcessParamTrace processParamTrace) {
processParamTrace.setUpdateBy(getUsername());
return toAjax(processParamTraceService.updateProcessParamTrace(processParamTrace));
}
@PreAuthorize("@ss.hasPermi('base:processParamTrace:remove')")
@Log(title = "参数追溯", businessType = BusinessType.DELETE)
@DeleteMapping("/{traceIds}")
public AjaxResult remove(@PathVariable Long[] traceIds) {
return toAjax(processParamTraceService.deleteProcessParamTraceByTraceIds(traceIds));
}
}

@ -1,75 +0,0 @@
package com.aucma.base.controller;
import com.aucma.base.domain.ProcessSnapshot;
import com.aucma.base.service.IProcessSnapshotService;
import com.aucma.common.annotation.Log;
import com.aucma.common.core.controller.BaseController;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.core.page.TableDataInfo;
import com.aucma.common.enums.BusinessType;
import com.aucma.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author Yinq
* @date 2025-12-30
*/
@RestController
@RequestMapping("/base/processSnapshot")
public class ProcessSnapshotController extends BaseController {
@Autowired
private IProcessSnapshotService processSnapshotService;
@PreAuthorize("@ss.hasPermi('base:processSnapshot:list')")
@GetMapping("/list")
public TableDataInfo list(ProcessSnapshot processSnapshot) {
startPage();
List<ProcessSnapshot> list = processSnapshotService.selectProcessSnapshotList(processSnapshot);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('base:processSnapshot:export')")
@Log(title = "工艺快照", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProcessSnapshot processSnapshot) {
List<ProcessSnapshot> list = processSnapshotService.selectProcessSnapshotList(processSnapshot);
ExcelUtil<ProcessSnapshot> util = new ExcelUtil<ProcessSnapshot>(ProcessSnapshot.class);
util.exportExcel(response, list, "工艺快照数据");
}
@PreAuthorize("@ss.hasPermi('base:processSnapshot:query')")
@GetMapping(value = "/{snapshotId}")
public AjaxResult getInfo(@PathVariable("snapshotId") Long snapshotId) {
return success(processSnapshotService.selectProcessSnapshotBySnapshotId(snapshotId));
}
@PreAuthorize("@ss.hasPermi('base:processSnapshot:add')")
@Log(title = "工艺快照", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProcessSnapshot processSnapshot) {
processSnapshot.setCreateBy(getUsername());
return toAjax(processSnapshotService.insertProcessSnapshot(processSnapshot));
}
@PreAuthorize("@ss.hasPermi('base:processSnapshot:edit')")
@Log(title = "工艺快照", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProcessSnapshot processSnapshot) {
processSnapshot.setUpdateBy(getUsername());
return toAjax(processSnapshotService.updateProcessSnapshot(processSnapshot));
}
@PreAuthorize("@ss.hasPermi('base:processSnapshot:remove')")
@Log(title = "工艺快照", businessType = BusinessType.DELETE)
@DeleteMapping("/{snapshotIds}")
public AjaxResult remove(@PathVariable Long[] snapshotIds) {
return toAjax(processSnapshotService.deleteProcessSnapshotBySnapshotIds(snapshotIds));
}
}

@ -1,198 +0,0 @@
package com.aucma.base.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* process_debug_backup
*
* @author Yinq
* @date 2025-12-30
*/
public class ProcessDebugBackup extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 备份ID */
private Long backupId;
/** 备份编号 */
@Excel(name = "备份编号")
private String backupCode;
/** 备份名称 */
@Excel(name = "备份名称")
private String backupName;
/** 设备/机台编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 设备/机台名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 模具编码 */
@Excel(name = "模具编码")
private String moldCode;
/** 模具名称 */
@Excel(name = "模具名称")
private String moldName;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 参数数据(JSON格式) */
private String paramData;
/** 备份时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "备份时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date backupTime;
/** 备份人 */
@Excel(name = "备份人")
private String backupUser;
/** 是否有效(1有效/0无效) */
@Excel(name = "是否有效", readConverterExp = "1=有效,0=无效")
private String isFlag;
public void setBackupId(Long backupId) {
this.backupId = backupId;
}
public Long getBackupId() {
return backupId;
}
public void setBackupCode(String backupCode) {
this.backupCode = backupCode;
}
public String getBackupCode() {
return backupCode;
}
public void setBackupName(String backupName) {
this.backupName = backupName;
}
public String getBackupName() {
return backupName;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName() {
return deviceName;
}
public void setMoldCode(String moldCode) {
this.moldCode = moldCode;
}
public String getMoldCode() {
return moldCode;
}
public void setMoldName(String moldName) {
this.moldName = moldName;
}
public String getMoldName() {
return moldName;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setParamData(String paramData) {
this.paramData = paramData;
}
public String getParamData() {
return paramData;
}
public void setBackupTime(Date backupTime) {
this.backupTime = backupTime;
}
public Date getBackupTime() {
return backupTime;
}
public void setBackupUser(String backupUser) {
this.backupUser = backupUser;
}
public String getBackupUser() {
return backupUser;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("backupId", getBackupId())
.append("backupCode", getBackupCode())
.append("backupName", getBackupName())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("moldCode", getMoldCode())
.append("moldName", getMoldName())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("paramData", getParamData())
.append("backupTime", getBackupTime())
.append("backupUser", getBackupUser())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,173 +0,0 @@
package com.aucma.base.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* process_param_change
*
* @author Yinq
* @date 2025-12-30
*/
public class ProcessParamChange extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 变更ID */
private Long changeId;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 参数编码 */
@Excel(name = "参数编码")
private String paramCode;
/** 参数名称 */
@Excel(name = "参数名称")
private String paramName;
/** 原值 */
@Excel(name = "原值")
private String oldValue;
/** 新值 */
@Excel(name = "新值")
private String newValue;
/** 变更时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "变更时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date changeTime;
/** 变更人 */
@Excel(name = "变更人")
private String changeUser;
/** 变更原因 */
@Excel(name = "变更原因")
private String changeReason;
/** 是否有效(1有效/0无效) */
@Excel(name = "是否有效", readConverterExp = "1=有效,0=无效")
private String isFlag;
public void setChangeId(Long changeId) {
this.changeId = changeId;
}
public Long getChangeId() {
return changeId;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName() {
return deviceName;
}
public void setParamCode(String paramCode) {
this.paramCode = paramCode;
}
public String getParamCode() {
return paramCode;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return paramName;
}
public void setOldValue(String oldValue) {
this.oldValue = oldValue;
}
public String getOldValue() {
return oldValue;
}
public void setNewValue(String newValue) {
this.newValue = newValue;
}
public String getNewValue() {
return newValue;
}
public void setChangeTime(Date changeTime) {
this.changeTime = changeTime;
}
public Date getChangeTime() {
return changeTime;
}
public void setChangeUser(String changeUser) {
this.changeUser = changeUser;
}
public String getChangeUser() {
return changeUser;
}
public void setChangeReason(String changeReason) {
this.changeReason = changeReason;
}
public String getChangeReason() {
return changeReason;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("changeId", getChangeId())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("paramCode", getParamCode())
.append("paramName", getParamName())
.append("oldValue", getOldValue())
.append("newValue", getNewValue())
.append("changeTime", getChangeTime())
.append("changeUser", getChangeUser())
.append("changeReason", getChangeReason())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,200 +0,0 @@
package com.aucma.base.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* process_param_monitor
*
* @author Yinq
* @date 2025-12-30
*/
public class ProcessParamMonitor extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 监控ID */
private Long monitorId;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 参数编码 */
@Excel(name = "参数编码")
private String paramCode;
/** 参数名称 */
@Excel(name = "参数名称")
private String paramName;
/** 参数值 */
@Excel(name = "参数值")
private String paramValue;
/** 参数单位 */
@Excel(name = "参数单位")
private String paramUnit;
/** 标准值 */
@Excel(name = "标准值")
private String standardValue;
/** 上限值 */
@Excel(name = "上限值")
private BigDecimal upperLimit;
/** 下限值 */
@Excel(name = "下限值")
private BigDecimal lowerLimit;
/** 参数状态(0正常/1异常) */
@Excel(name = "参数状态", readConverterExp = "0=正常,1=异常")
private String paramStatus;
/** 采集时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date collectTime;
/** 是否有效(1有效/0无效) */
@Excel(name = "是否有效", readConverterExp = "1=有效,0=无效")
private String isFlag;
public void setMonitorId(Long monitorId) {
this.monitorId = monitorId;
}
public Long getMonitorId() {
return monitorId;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName() {
return deviceName;
}
public void setParamCode(String paramCode) {
this.paramCode = paramCode;
}
public String getParamCode() {
return paramCode;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return paramName;
}
public void setParamValue(String paramValue) {
this.paramValue = paramValue;
}
public String getParamValue() {
return paramValue;
}
public void setParamUnit(String paramUnit) {
this.paramUnit = paramUnit;
}
public String getParamUnit() {
return paramUnit;
}
public void setStandardValue(String standardValue) {
this.standardValue = standardValue;
}
public String getStandardValue() {
return standardValue;
}
public void setUpperLimit(BigDecimal upperLimit) {
this.upperLimit = upperLimit;
}
public BigDecimal getUpperLimit() {
return upperLimit;
}
public void setLowerLimit(BigDecimal lowerLimit) {
this.lowerLimit = lowerLimit;
}
public BigDecimal getLowerLimit() {
return lowerLimit;
}
public void setParamStatus(String paramStatus) {
this.paramStatus = paramStatus;
}
public String getParamStatus() {
return paramStatus;
}
public void setCollectTime(Date collectTime) {
this.collectTime = collectTime;
}
public Date getCollectTime() {
return collectTime;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("monitorId", getMonitorId())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("paramCode", getParamCode())
.append("paramName", getParamName())
.append("paramValue", getParamValue())
.append("paramUnit", getParamUnit())
.append("standardValue", getStandardValue())
.append("upperLimit", getUpperLimit())
.append("lowerLimit", getLowerLimit())
.append("paramStatus", getParamStatus())
.append("collectTime", getCollectTime())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,225 +0,0 @@
package com.aucma.base.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* process_param_trace
*
* @author Yinq
* @date 2025-12-30
*/
public class ProcessParamTrace extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 追溯ID */
private Long traceId;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 模具编码 */
@Excel(name = "模具编码")
private String moldCode;
/** 模具名称 */
@Excel(name = "模具名称")
private String moldName;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 批次编码 */
@Excel(name = "批次编码")
private String batchCode;
/** 模次 */
@Excel(name = "模次")
private Long moldCount;
/** 参数编码 */
@Excel(name = "参数编码")
private String paramCode;
/** 参数名称 */
@Excel(name = "参数名称")
private String paramName;
/** 参数值 */
@Excel(name = "参数值")
private String paramValue;
/** 参数单位 */
@Excel(name = "参数单位")
private String paramUnit;
/** 追溯时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "追溯时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date traceTime;
/** 是否有效(1有效/0无效) */
@Excel(name = "是否有效", readConverterExp = "1=有效,0=无效")
private String isFlag;
public void setTraceId(Long traceId) {
this.traceId = traceId;
}
public Long getTraceId() {
return traceId;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName() {
return deviceName;
}
public void setMoldCode(String moldCode) {
this.moldCode = moldCode;
}
public String getMoldCode() {
return moldCode;
}
public void setMoldName(String moldName) {
this.moldName = moldName;
}
public String getMoldName() {
return moldName;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getBatchCode() {
return batchCode;
}
public void setMoldCount(Long moldCount) {
this.moldCount = moldCount;
}
public Long getMoldCount() {
return moldCount;
}
public void setParamCode(String paramCode) {
this.paramCode = paramCode;
}
public String getParamCode() {
return paramCode;
}
public void setParamName(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return paramName;
}
public void setParamValue(String paramValue) {
this.paramValue = paramValue;
}
public String getParamValue() {
return paramValue;
}
public void setParamUnit(String paramUnit) {
this.paramUnit = paramUnit;
}
public String getParamUnit() {
return paramUnit;
}
public void setTraceTime(Date traceTime) {
this.traceTime = traceTime;
}
public Date getTraceTime() {
return traceTime;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("traceId", getTraceId())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("moldCode", getMoldCode())
.append("moldName", getMoldName())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("batchCode", getBatchCode())
.append("moldCount", getMoldCount())
.append("paramCode", getParamCode())
.append("paramName", getParamName())
.append("paramValue", getParamValue())
.append("paramUnit", getParamUnit())
.append("traceTime", getTraceTime())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,224 +0,0 @@
package com.aucma.base.domain;
import com.aucma.common.annotation.Excel;
import com.aucma.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* process_snapshot
*
* @author Yinq
* @date 2025-12-30
*/
public class ProcessSnapshot extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 快照ID */
private Long snapshotId;
/** 快照编号 */
@Excel(name = "快照编号")
private String snapshotCode;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 工单编码 */
@Excel(name = "工单编码")
private String orderCode;
/** 批次编码 */
@Excel(name = "批次编码")
private String batchCode;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 工位编码 */
@Excel(name = "工位编码")
private String stationCode;
/** 工位名称 */
@Excel(name = "工位名称")
private String stationName;
/** 工序步骤 */
@Excel(name = "工序步骤")
private Long processStep;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 参数数据(JSON格式) */
private String paramData;
/** 快照时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "快照时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date snapshotTime;
/** 是否有效(1有效/0无效) */
@Excel(name = "是否有效", readConverterExp = "1=有效,0=无效")
private String isFlag;
public void setSnapshotId(Long snapshotId) {
this.snapshotId = snapshotId;
}
public Long getSnapshotId() {
return snapshotId;
}
public void setSnapshotCode(String snapshotCode) {
this.snapshotCode = snapshotCode;
}
public String getSnapshotCode() {
return snapshotCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}
public String getBatchCode() {
return batchCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceName() {
return deviceName;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationCode() {
return stationCode;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getStationName() {
return stationName;
}
public void setProcessStep(Long processStep) {
this.processStep = processStep;
}
public Long getProcessStep() {
return processStep;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public String getProcessName() {
return processName;
}
public void setParamData(String paramData) {
this.paramData = paramData;
}
public String getParamData() {
return paramData;
}
public void setSnapshotTime(Date snapshotTime) {
this.snapshotTime = snapshotTime;
}
public Date getSnapshotTime() {
return snapshotTime;
}
public void setIsFlag(String isFlag) {
this.isFlag = isFlag;
}
public String getIsFlag() {
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("snapshotId", getSnapshotId())
.append("snapshotCode", getSnapshotCode())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("orderCode", getOrderCode())
.append("batchCode", getBatchCode())
.append("deviceCode", getDeviceCode())
.append("deviceName", getDeviceName())
.append("stationCode", getStationCode())
.append("stationName", getStationName())
.append("processStep", getProcessStep())
.append("processName", getProcessName())
.append("paramData", getParamData())
.append("snapshotTime", getSnapshotTime())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -1,61 +0,0 @@
package com.aucma.base.mapper;
import com.aucma.base.domain.ProcessDebugBackup;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-12-30
*/
public interface ProcessDebugBackupMapper {
/**
*
*
* @param backupId
* @return
*/
public ProcessDebugBackup selectProcessDebugBackupByBackupId(Long backupId);
/**
*
*
* @param processDebugBackup
* @return
*/
public List<ProcessDebugBackup> selectProcessDebugBackupList(ProcessDebugBackup processDebugBackup);
/**
*
*
* @param processDebugBackup
* @return
*/
public int insertProcessDebugBackup(ProcessDebugBackup processDebugBackup);
/**
*
*
* @param processDebugBackup
* @return
*/
public int updateProcessDebugBackup(ProcessDebugBackup processDebugBackup);
/**
*
*
* @param backupId
* @return
*/
public int deleteProcessDebugBackupByBackupId(Long backupId);
/**
*
*
* @param backupIds
* @return
*/
public int deleteProcessDebugBackupByBackupIds(Long[] backupIds);
}

@ -1,61 +0,0 @@
package com.aucma.base.mapper;
import com.aucma.base.domain.ProcessParamChange;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-12-30
*/
public interface ProcessParamChangeMapper {
/**
*
*
* @param changeId
* @return
*/
public ProcessParamChange selectProcessParamChangeByChangeId(Long changeId);
/**
*
*
* @param processParamChange
* @return
*/
public List<ProcessParamChange> selectProcessParamChangeList(ProcessParamChange processParamChange);
/**
*
*
* @param processParamChange
* @return
*/
public int insertProcessParamChange(ProcessParamChange processParamChange);
/**
*
*
* @param processParamChange
* @return
*/
public int updateProcessParamChange(ProcessParamChange processParamChange);
/**
*
*
* @param changeId
* @return
*/
public int deleteProcessParamChangeByChangeId(Long changeId);
/**
*
*
* @param changeIds
* @return
*/
public int deleteProcessParamChangeByChangeIds(Long[] changeIds);
}

@ -1,61 +0,0 @@
package com.aucma.base.mapper;
import com.aucma.base.domain.ProcessParamMonitor;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-12-30
*/
public interface ProcessParamMonitorMapper {
/**
*
*
* @param monitorId
* @return
*/
public ProcessParamMonitor selectProcessParamMonitorByMonitorId(Long monitorId);
/**
*
*
* @param processParamMonitor
* @return
*/
public List<ProcessParamMonitor> selectProcessParamMonitorList(ProcessParamMonitor processParamMonitor);
/**
*
*
* @param processParamMonitor
* @return
*/
public int insertProcessParamMonitor(ProcessParamMonitor processParamMonitor);
/**
*
*
* @param processParamMonitor
* @return
*/
public int updateProcessParamMonitor(ProcessParamMonitor processParamMonitor);
/**
*
*
* @param monitorId
* @return
*/
public int deleteProcessParamMonitorByMonitorId(Long monitorId);
/**
*
*
* @param monitorIds
* @return
*/
public int deleteProcessParamMonitorByMonitorIds(Long[] monitorIds);
}

@ -1,61 +0,0 @@
package com.aucma.base.mapper;
import com.aucma.base.domain.ProcessParamTrace;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-12-30
*/
public interface ProcessParamTraceMapper {
/**
*
*
* @param traceId
* @return
*/
public ProcessParamTrace selectProcessParamTraceByTraceId(Long traceId);
/**
*
*
* @param processParamTrace
* @return
*/
public List<ProcessParamTrace> selectProcessParamTraceList(ProcessParamTrace processParamTrace);
/**
*
*
* @param processParamTrace
* @return
*/
public int insertProcessParamTrace(ProcessParamTrace processParamTrace);
/**
*
*
* @param processParamTrace
* @return
*/
public int updateProcessParamTrace(ProcessParamTrace processParamTrace);
/**
*
*
* @param traceId
* @return
*/
public int deleteProcessParamTraceByTraceId(Long traceId);
/**
*
*
* @param traceIds
* @return
*/
public int deleteProcessParamTraceByTraceIds(Long[] traceIds);
}

@ -1,61 +0,0 @@
package com.aucma.base.mapper;
import com.aucma.base.domain.ProcessSnapshot;
import java.util.List;
/**
* Mapper
*
* @author Yinq
* @date 2025-12-30
*/
public interface ProcessSnapshotMapper {
/**
*
*
* @param snapshotId
* @return
*/
public ProcessSnapshot selectProcessSnapshotBySnapshotId(Long snapshotId);
/**
*
*
* @param processSnapshot
* @return
*/
public List<ProcessSnapshot> selectProcessSnapshotList(ProcessSnapshot processSnapshot);
/**
*
*
* @param processSnapshot
* @return
*/
public int insertProcessSnapshot(ProcessSnapshot processSnapshot);
/**
*
*
* @param processSnapshot
* @return
*/
public int updateProcessSnapshot(ProcessSnapshot processSnapshot);
/**
*
*
* @param snapshotId
* @return
*/
public int deleteProcessSnapshotBySnapshotId(Long snapshotId);
/**
*
*
* @param snapshotIds
* @return
*/
public int deleteProcessSnapshotBySnapshotIds(Long[] snapshotIds);
}

@ -17,4 +17,10 @@ public interface IProcessAlertService {
public int updateProcessAlert(ProcessAlert processAlert);
public int deleteProcessAlertByAlertIds(Long[] alertIds);
public int deleteProcessAlertByAlertId(Long alertId);
/**
*
* @return
*/
public int checkThresholdAlerts();
}

@ -1,20 +0,0 @@
package com.aucma.base.service;
import com.aucma.base.domain.ProcessDebugBackup;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
public interface IProcessDebugBackupService {
public ProcessDebugBackup selectProcessDebugBackupByBackupId(Long backupId);
public List<ProcessDebugBackup> selectProcessDebugBackupList(ProcessDebugBackup processDebugBackup);
public int insertProcessDebugBackup(ProcessDebugBackup processDebugBackup);
public int updateProcessDebugBackup(ProcessDebugBackup processDebugBackup);
public int deleteProcessDebugBackupByBackupIds(Long[] backupIds);
public int deleteProcessDebugBackupByBackupId(Long backupId);
}

@ -1,20 +0,0 @@
package com.aucma.base.service;
import com.aucma.base.domain.ProcessParamChange;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
public interface IProcessParamChangeService {
public ProcessParamChange selectProcessParamChangeByChangeId(Long changeId);
public List<ProcessParamChange> selectProcessParamChangeList(ProcessParamChange processParamChange);
public int insertProcessParamChange(ProcessParamChange processParamChange);
public int updateProcessParamChange(ProcessParamChange processParamChange);
public int deleteProcessParamChangeByChangeIds(Long[] changeIds);
public int deleteProcessParamChangeByChangeId(Long changeId);
}

@ -1,20 +0,0 @@
package com.aucma.base.service;
import com.aucma.base.domain.ProcessParamMonitor;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
public interface IProcessParamMonitorService {
public ProcessParamMonitor selectProcessParamMonitorByMonitorId(Long monitorId);
public List<ProcessParamMonitor> selectProcessParamMonitorList(ProcessParamMonitor processParamMonitor);
public int insertProcessParamMonitor(ProcessParamMonitor processParamMonitor);
public int updateProcessParamMonitor(ProcessParamMonitor processParamMonitor);
public int deleteProcessParamMonitorByMonitorIds(Long[] monitorIds);
public int deleteProcessParamMonitorByMonitorId(Long monitorId);
}

@ -1,20 +0,0 @@
package com.aucma.base.service;
import com.aucma.base.domain.ProcessParamTrace;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
public interface IProcessParamTraceService {
public ProcessParamTrace selectProcessParamTraceByTraceId(Long traceId);
public List<ProcessParamTrace> selectProcessParamTraceList(ProcessParamTrace processParamTrace);
public int insertProcessParamTrace(ProcessParamTrace processParamTrace);
public int updateProcessParamTrace(ProcessParamTrace processParamTrace);
public int deleteProcessParamTraceByTraceIds(Long[] traceIds);
public int deleteProcessParamTraceByTraceId(Long traceId);
}

@ -1,20 +0,0 @@
package com.aucma.base.service;
import com.aucma.base.domain.ProcessSnapshot;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
public interface IProcessSnapshotService {
public ProcessSnapshot selectProcessSnapshotBySnapshotId(Long snapshotId);
public List<ProcessSnapshot> selectProcessSnapshotList(ProcessSnapshot processSnapshot);
public int insertProcessSnapshot(ProcessSnapshot processSnapshot);
public int updateProcessSnapshot(ProcessSnapshot processSnapshot);
public int deleteProcessSnapshotBySnapshotIds(Long[] snapshotIds);
public int deleteProcessSnapshotBySnapshotId(Long snapshotId);
}

@ -1,12 +1,21 @@
package com.aucma.base.service.impl;
import com.aucma.base.domain.BaseDeviceParam;
import com.aucma.base.domain.BaseDeviceParamVal;
import com.aucma.base.domain.ProcessAlert;
import com.aucma.base.mapper.BaseDeviceParamMapper;
import com.aucma.base.mapper.BaseDeviceParamValMapper;
import com.aucma.base.mapper.ProcessAlertMapper;
import com.aucma.base.service.IProcessAlertService;
import com.aucma.common.utils.DateUtils;
import com.aucma.common.utils.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
@ -17,8 +26,16 @@ import java.util.List;
*/
@Service
public class ProcessAlertServiceImpl implements IProcessAlertService {
private static final Logger log = LoggerFactory.getLogger(ProcessAlertServiceImpl.class);
@Autowired
private ProcessAlertMapper processAlertMapper;
@Autowired
private BaseDeviceParamMapper baseDeviceParamMapper;
@Autowired
private BaseDeviceParamValMapper baseDeviceParamValMapper;
@Override
public ProcessAlert selectProcessAlertByAlertId(Long alertId) {
@ -60,4 +77,94 @@ public class ProcessAlertServiceImpl implements IProcessAlertService {
public int deleteProcessAlertByAlertId(Long alertId) {
return processAlertMapper.deleteProcessAlertByAlertId(alertId);
}
@Override
public int checkThresholdAlerts() {
int alertCount = 0;
try {
// 查询所有启用预警的参数
BaseDeviceParam queryParam = new BaseDeviceParam();
queryParam.setAlertEnabled("1");
queryParam.setIsFlag(1L);
List<BaseDeviceParam> paramList = baseDeviceParamMapper.selectBaseDeviceParamList(queryParam);
if (paramList == null || paramList.isEmpty()) {
log.info("没有启用预警的参数配置");
return 0;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
Date now = DateUtils.getNowDate();
for (BaseDeviceParam param : paramList) {
if (param.getUpperLimit() == null && param.getLowerLimit() == null) {
continue;
}
// 查询该参数最新的采集值
BaseDeviceParamVal valQuery = new BaseDeviceParamVal();
valQuery.setParamCode(param.getParamCode());
valQuery.setDeviceCode(param.getDeviceCode());
List<BaseDeviceParamVal> valList = baseDeviceParamValMapper.selectBaseDeviceParamValList(valQuery);
if (valList == null || valList.isEmpty()) {
continue;
}
// 取最新一条记录
BaseDeviceParamVal latestVal = valList.get(0);
String paramValueStr = latestVal.getParamValue();
if (paramValueStr == null || paramValueStr.isEmpty()) {
continue;
}
try {
double paramValue = Double.parseDouble(paramValueStr);
String alertType = null;
String thresholdValue = null;
// 检查是否超上限
if (param.getUpperLimit() != null && paramValue > param.getUpperLimit()) {
alertType = "超上限";
thresholdValue = String.valueOf(param.getUpperLimit());
}
// 检查是否低于下限
else if (param.getLowerLimit() != null && paramValue < param.getLowerLimit()) {
alertType = "低于下限";
thresholdValue = String.valueOf(param.getLowerLimit());
}
if (alertType != null) {
// 生成预警记录
ProcessAlert alert = new ProcessAlert();
alert.setAlertCode("ALERT-" + sdf.format(now) + "-" + (alertCount + 1));
alert.setAlertType("参数超限");
alert.setAlertLevel(param.getAlertLevel() != null ? param.getAlertLevel() : "1");
alert.setDeviceCode(param.getDeviceCode());
alert.setDeviceName(param.getDeviceName());
alert.setParamCode(param.getParamCode());
alert.setParamName(param.getParamName());
alert.setAlertContent(param.getParamName() + alertType + ",当前值:" + paramValueStr + ",阈值:" + thresholdValue);
alert.setAlertValue(paramValueStr);
alert.setThresholdValue(thresholdValue);
alert.setAlertTime(latestVal.getCollectTime() != null ? latestVal.getCollectTime() : now);
alert.setAlertStatus("0");
alert.setIsFlag("1");
alert.setCreateTime(now);
insertProcessAlert(alert);
alertCount++;
log.info("生成预警: {}", alert.getAlertContent());
}
} catch (NumberFormatException e) {
log.warn("参数值无法转换为数字: paramCode={}, value={}", param.getParamCode(), paramValueStr);
}
}
} catch (Exception e) {
log.error("检查阈值预警时发生错误", e);
}
return alertCount;
}
}

@ -1,60 +0,0 @@
package com.aucma.base.service.impl;
import com.aucma.base.domain.ProcessDebugBackup;
import com.aucma.base.mapper.ProcessDebugBackupMapper;
import com.aucma.base.service.IProcessDebugBackupService;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
@Service
public class ProcessDebugBackupServiceImpl implements IProcessDebugBackupService {
@Autowired
private ProcessDebugBackupMapper processDebugBackupMapper;
@Override
public ProcessDebugBackup selectProcessDebugBackupByBackupId(Long backupId) {
return processDebugBackupMapper.selectProcessDebugBackupByBackupId(backupId);
}
@Override
public List<ProcessDebugBackup> selectProcessDebugBackupList(ProcessDebugBackup processDebugBackup) {
return processDebugBackupMapper.selectProcessDebugBackupList(processDebugBackup);
}
@Override
public int insertProcessDebugBackup(ProcessDebugBackup processDebugBackup) {
processDebugBackup.setCreateTime(DateUtils.getNowDate());
if (processDebugBackup.getBackupTime() == null) {
processDebugBackup.setBackupTime(DateUtils.getNowDate());
}
if (processDebugBackup.getIsFlag() == null || processDebugBackup.getIsFlag().isEmpty()) {
processDebugBackup.setIsFlag("1");
}
return processDebugBackupMapper.insertProcessDebugBackup(processDebugBackup);
}
@Override
public int updateProcessDebugBackup(ProcessDebugBackup processDebugBackup) {
processDebugBackup.setUpdateTime(DateUtils.getNowDate());
return processDebugBackupMapper.updateProcessDebugBackup(processDebugBackup);
}
@Override
public int deleteProcessDebugBackupByBackupIds(Long[] backupIds) {
return processDebugBackupMapper.deleteProcessDebugBackupByBackupIds(backupIds);
}
@Override
public int deleteProcessDebugBackupByBackupId(Long backupId) {
return processDebugBackupMapper.deleteProcessDebugBackupByBackupId(backupId);
}
}

@ -1,60 +0,0 @@
package com.aucma.base.service.impl;
import com.aucma.base.domain.ProcessParamChange;
import com.aucma.base.mapper.ProcessParamChangeMapper;
import com.aucma.base.service.IProcessParamChangeService;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
@Service
public class ProcessParamChangeServiceImpl implements IProcessParamChangeService {
@Autowired
private ProcessParamChangeMapper processParamChangeMapper;
@Override
public ProcessParamChange selectProcessParamChangeByChangeId(Long changeId) {
return processParamChangeMapper.selectProcessParamChangeByChangeId(changeId);
}
@Override
public List<ProcessParamChange> selectProcessParamChangeList(ProcessParamChange processParamChange) {
return processParamChangeMapper.selectProcessParamChangeList(processParamChange);
}
@Override
public int insertProcessParamChange(ProcessParamChange processParamChange) {
processParamChange.setCreateTime(DateUtils.getNowDate());
if (processParamChange.getChangeTime() == null) {
processParamChange.setChangeTime(DateUtils.getNowDate());
}
if (processParamChange.getIsFlag() == null || processParamChange.getIsFlag().isEmpty()) {
processParamChange.setIsFlag("1");
}
return processParamChangeMapper.insertProcessParamChange(processParamChange);
}
@Override
public int updateProcessParamChange(ProcessParamChange processParamChange) {
processParamChange.setUpdateTime(DateUtils.getNowDate());
return processParamChangeMapper.updateProcessParamChange(processParamChange);
}
@Override
public int deleteProcessParamChangeByChangeIds(Long[] changeIds) {
return processParamChangeMapper.deleteProcessParamChangeByChangeIds(changeIds);
}
@Override
public int deleteProcessParamChangeByChangeId(Long changeId) {
return processParamChangeMapper.deleteProcessParamChangeByChangeId(changeId);
}
}

@ -1,60 +0,0 @@
package com.aucma.base.service.impl;
import com.aucma.base.domain.ProcessParamMonitor;
import com.aucma.base.mapper.ProcessParamMonitorMapper;
import com.aucma.base.service.IProcessParamMonitorService;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
@Service
public class ProcessParamMonitorServiceImpl implements IProcessParamMonitorService {
@Autowired
private ProcessParamMonitorMapper processParamMonitorMapper;
@Override
public ProcessParamMonitor selectProcessParamMonitorByMonitorId(Long monitorId) {
return processParamMonitorMapper.selectProcessParamMonitorByMonitorId(monitorId);
}
@Override
public List<ProcessParamMonitor> selectProcessParamMonitorList(ProcessParamMonitor processParamMonitor) {
return processParamMonitorMapper.selectProcessParamMonitorList(processParamMonitor);
}
@Override
public int insertProcessParamMonitor(ProcessParamMonitor processParamMonitor) {
processParamMonitor.setCreateTime(DateUtils.getNowDate());
if (processParamMonitor.getCollectTime() == null) {
processParamMonitor.setCollectTime(DateUtils.getNowDate());
}
if (processParamMonitor.getIsFlag() == null || processParamMonitor.getIsFlag().isEmpty()) {
processParamMonitor.setIsFlag("1");
}
return processParamMonitorMapper.insertProcessParamMonitor(processParamMonitor);
}
@Override
public int updateProcessParamMonitor(ProcessParamMonitor processParamMonitor) {
processParamMonitor.setUpdateTime(DateUtils.getNowDate());
return processParamMonitorMapper.updateProcessParamMonitor(processParamMonitor);
}
@Override
public int deleteProcessParamMonitorByMonitorIds(Long[] monitorIds) {
return processParamMonitorMapper.deleteProcessParamMonitorByMonitorIds(monitorIds);
}
@Override
public int deleteProcessParamMonitorByMonitorId(Long monitorId) {
return processParamMonitorMapper.deleteProcessParamMonitorByMonitorId(monitorId);
}
}

@ -1,60 +0,0 @@
package com.aucma.base.service.impl;
import com.aucma.base.domain.ProcessParamTrace;
import com.aucma.base.mapper.ProcessParamTraceMapper;
import com.aucma.base.service.IProcessParamTraceService;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
@Service
public class ProcessParamTraceServiceImpl implements IProcessParamTraceService {
@Autowired
private ProcessParamTraceMapper processParamTraceMapper;
@Override
public ProcessParamTrace selectProcessParamTraceByTraceId(Long traceId) {
return processParamTraceMapper.selectProcessParamTraceByTraceId(traceId);
}
@Override
public List<ProcessParamTrace> selectProcessParamTraceList(ProcessParamTrace processParamTrace) {
return processParamTraceMapper.selectProcessParamTraceList(processParamTrace);
}
@Override
public int insertProcessParamTrace(ProcessParamTrace processParamTrace) {
processParamTrace.setCreateTime(DateUtils.getNowDate());
if (processParamTrace.getTraceTime() == null) {
processParamTrace.setTraceTime(DateUtils.getNowDate());
}
if (processParamTrace.getIsFlag() == null || processParamTrace.getIsFlag().isEmpty()) {
processParamTrace.setIsFlag("1");
}
return processParamTraceMapper.insertProcessParamTrace(processParamTrace);
}
@Override
public int updateProcessParamTrace(ProcessParamTrace processParamTrace) {
processParamTrace.setUpdateTime(DateUtils.getNowDate());
return processParamTraceMapper.updateProcessParamTrace(processParamTrace);
}
@Override
public int deleteProcessParamTraceByTraceIds(Long[] traceIds) {
return processParamTraceMapper.deleteProcessParamTraceByTraceIds(traceIds);
}
@Override
public int deleteProcessParamTraceByTraceId(Long traceId) {
return processParamTraceMapper.deleteProcessParamTraceByTraceId(traceId);
}
}

@ -1,60 +0,0 @@
package com.aucma.base.service.impl;
import com.aucma.base.domain.ProcessSnapshot;
import com.aucma.base.mapper.ProcessSnapshotMapper;
import com.aucma.base.service.IProcessSnapshotService;
import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-12-30
*/
@Service
public class ProcessSnapshotServiceImpl implements IProcessSnapshotService {
@Autowired
private ProcessSnapshotMapper processSnapshotMapper;
@Override
public ProcessSnapshot selectProcessSnapshotBySnapshotId(Long snapshotId) {
return processSnapshotMapper.selectProcessSnapshotBySnapshotId(snapshotId);
}
@Override
public List<ProcessSnapshot> selectProcessSnapshotList(ProcessSnapshot processSnapshot) {
return processSnapshotMapper.selectProcessSnapshotList(processSnapshot);
}
@Override
public int insertProcessSnapshot(ProcessSnapshot processSnapshot) {
processSnapshot.setCreateTime(DateUtils.getNowDate());
if (processSnapshot.getSnapshotTime() == null) {
processSnapshot.setSnapshotTime(DateUtils.getNowDate());
}
if (processSnapshot.getIsFlag() == null || processSnapshot.getIsFlag().isEmpty()) {
processSnapshot.setIsFlag("1");
}
return processSnapshotMapper.insertProcessSnapshot(processSnapshot);
}
@Override
public int updateProcessSnapshot(ProcessSnapshot processSnapshot) {
processSnapshot.setUpdateTime(DateUtils.getNowDate());
return processSnapshotMapper.updateProcessSnapshot(processSnapshot);
}
@Override
public int deleteProcessSnapshotBySnapshotIds(Long[] snapshotIds) {
return processSnapshotMapper.deleteProcessSnapshotBySnapshotIds(snapshotIds);
}
@Override
public int deleteProcessSnapshotBySnapshotId(Long snapshotId) {
return processSnapshotMapper.deleteProcessSnapshotBySnapshotId(snapshotId);
}
}

@ -171,4 +171,5 @@
AND PRODUCT_LINE_CODE NOT IN ('2015', '2009')
ORDER BY EXECUTION_SORT
</select>
</mapper>

@ -1,132 +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.aucma.base.mapper.ProcessDebugBackupMapper">
<resultMap type="ProcessDebugBackup" id="ProcessDebugBackupResult">
<result property="backupId" column="backup_id"/>
<result property="backupCode" column="backup_code"/>
<result property="backupName" column="backup_name"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
<result property="moldCode" column="mold_code"/>
<result property="moldName" column="mold_name"/>
<result property="productCode" column="product_code"/>
<result property="productName" column="product_name"/>
<result property="paramData" column="param_data"/>
<result property="backupTime" column="backup_time"/>
<result property="backupUser" column="backup_user"/>
<result property="isFlag" column="is_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectProcessDebugBackupVo">
select backup_id, backup_code, backup_name, device_code, device_name, mold_code, mold_name,
product_code, product_name, param_data, backup_time, backup_user, is_flag,
remark, create_by, create_time, update_by, update_time
from process_debug_backup
</sql>
<select id="selectProcessDebugBackupList" parameterType="ProcessDebugBackup" resultMap="ProcessDebugBackupResult">
<include refid="selectProcessDebugBackupVo"/>
<where>
<if test="backupCode != null and backupCode != ''">and backup_code like concat(concat('%', #{backupCode}), '%')</if>
<if test="backupName != null and backupName != ''">and backup_name like concat(concat('%', #{backupName}), '%')</if>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="moldCode != null and moldCode != ''">and mold_code = #{moldCode}</if>
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
</where>
order by backup_time desc
</select>
<select id="selectProcessDebugBackupByBackupId" parameterType="Long" resultMap="ProcessDebugBackupResult">
<include refid="selectProcessDebugBackupVo"/>
where backup_id = #{backupId}
</select>
<insert id="insertProcessDebugBackup" parameterType="ProcessDebugBackup">
<selectKey keyProperty="backupId" resultType="long" order="BEFORE">
SELECT PROCESS_DEBUG_BACKUP_SEQ.NEXTVAL as backupId FROM DUAL
</selectKey>
insert into process_debug_backup
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="backupId != null">backup_id,</if>
<if test="backupCode != null and backupCode != ''">backup_code,</if>
<if test="backupName != null">backup_name,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="moldCode != null">mold_code,</if>
<if test="moldName != null">mold_name,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
<if test="paramData != null">param_data,</if>
<if test="backupTime != null">backup_time,</if>
<if test="backupUser != null">backup_user,</if>
<if test="isFlag != null">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="backupId != null">#{backupId},</if>
<if test="backupCode != null and backupCode != ''">#{backupCode},</if>
<if test="backupName != null">#{backupName},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="moldCode != null">#{moldCode},</if>
<if test="moldName != null">#{moldName},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
<if test="paramData != null">#{paramData},</if>
<if test="backupTime != null">#{backupTime},</if>
<if test="backupUser != null">#{backupUser},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateProcessDebugBackup" parameterType="ProcessDebugBackup">
update process_debug_backup
<trim prefix="SET" suffixOverrides=",">
<if test="backupCode != null and backupCode != ''">backup_code = #{backupCode},</if>
<if test="backupName != null">backup_name = #{backupName},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="moldCode != null">mold_code = #{moldCode},</if>
<if test="moldName != null">mold_name = #{moldName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="paramData != null">param_data = #{paramData},</if>
<if test="backupTime != null">backup_time = #{backupTime},</if>
<if test="backupUser != null">backup_user = #{backupUser},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where backup_id = #{backupId}
</update>
<delete id="deleteProcessDebugBackupByBackupId" parameterType="Long">
delete from process_debug_backup where backup_id = #{backupId}
</delete>
<delete id="deleteProcessDebugBackupByBackupIds" parameterType="String">
delete from process_debug_backup where backup_id in
<foreach item="backupId" collection="array" open="(" separator="," close=")">
#{backupId}
</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.aucma.base.mapper.ProcessParamChangeMapper">
<resultMap type="ProcessParamChange" id="ProcessParamChangeResult">
<result property="changeId" column="change_id"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
<result property="paramCode" column="param_code"/>
<result property="paramName" column="param_name"/>
<result property="oldValue" column="old_value"/>
<result property="newValue" column="new_value"/>
<result property="changeTime" column="change_time"/>
<result property="changeUser" column="change_user"/>
<result property="changeReason" column="change_reason"/>
<result property="isFlag" column="is_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectProcessParamChangeVo">
select change_id, device_code, device_name, param_code, param_name, old_value, new_value,
change_time, change_user, change_reason, is_flag, remark, create_by, create_time, update_by, update_time
from process_param_change
</sql>
<select id="selectProcessParamChangeList" parameterType="ProcessParamChange" resultMap="ProcessParamChangeResult">
<include refid="selectProcessParamChangeVo"/>
<where>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="paramCode != null and paramCode != ''">and param_code = #{paramCode}</if>
<if test="paramName != null and paramName != ''">and param_name like concat(concat('%', #{paramName}), '%')</if>
<if test="changeUser != null and changeUser != ''">and change_user = #{changeUser}</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
<if test="params != null and params.beginTime != null and params.endTime != null">
and change_time between #{params.beginTime} and #{params.endTime}
</if>
</where>
order by change_time desc
</select>
<select id="selectProcessParamChangeByChangeId" parameterType="Long" resultMap="ProcessParamChangeResult">
<include refid="selectProcessParamChangeVo"/>
where change_id = #{changeId}
</select>
<insert id="insertProcessParamChange" parameterType="ProcessParamChange">
<selectKey keyProperty="changeId" resultType="long" order="BEFORE">
SELECT PROCESS_PARAM_CHANGE_SEQ.NEXTVAL as changeId FROM DUAL
</selectKey>
insert into process_param_change
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="changeId != null">change_id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="paramCode != null">param_code,</if>
<if test="paramName != null">param_name,</if>
<if test="oldValue != null">old_value,</if>
<if test="newValue != null">new_value,</if>
<if test="changeTime != null">change_time,</if>
<if test="changeUser != null">change_user,</if>
<if test="changeReason != null">change_reason,</if>
<if test="isFlag != null">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="changeId != null">#{changeId},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="paramCode != null">#{paramCode},</if>
<if test="paramName != null">#{paramName},</if>
<if test="oldValue != null">#{oldValue},</if>
<if test="newValue != null">#{newValue},</if>
<if test="changeTime != null">#{changeTime},</if>
<if test="changeUser != null">#{changeUser},</if>
<if test="changeReason != null">#{changeReason},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateProcessParamChange" parameterType="ProcessParamChange">
update process_param_change
<trim prefix="SET" suffixOverrides=",">
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="paramCode != null">param_code = #{paramCode},</if>
<if test="paramName != null">param_name = #{paramName},</if>
<if test="oldValue != null">old_value = #{oldValue},</if>
<if test="newValue != null">new_value = #{newValue},</if>
<if test="changeTime != null">change_time = #{changeTime},</if>
<if test="changeUser != null">change_user = #{changeUser},</if>
<if test="changeReason != null">change_reason = #{changeReason},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where change_id = #{changeId}
</update>
<delete id="deleteProcessParamChangeByChangeId" parameterType="Long">
delete from process_param_change where change_id = #{changeId}
</delete>
<delete id="deleteProcessParamChangeByChangeIds" parameterType="String">
delete from process_param_change where change_id in
<foreach item="changeId" collection="array" open="(" separator="," close=")">
#{changeId}
</foreach>
</delete>
</mapper>

@ -1,131 +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.aucma.base.mapper.ProcessParamMonitorMapper">
<resultMap type="ProcessParamMonitor" id="ProcessParamMonitorResult">
<result property="monitorId" column="monitor_id"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
<result property="paramCode" column="param_code"/>
<result property="paramName" column="param_name"/>
<result property="paramValue" column="param_value"/>
<result property="paramUnit" column="param_unit"/>
<result property="standardValue" column="standard_value"/>
<result property="upperLimit" column="upper_limit"/>
<result property="lowerLimit" column="lower_limit"/>
<result property="paramStatus" column="param_status"/>
<result property="collectTime" column="collect_time"/>
<result property="isFlag" column="is_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectProcessParamMonitorVo">
select monitor_id, device_code, device_name, param_code, param_name, param_value, param_unit,
standard_value, upper_limit, lower_limit, param_status, collect_time, is_flag,
remark, create_by, create_time, update_by, update_time
from process_param_monitor
</sql>
<select id="selectProcessParamMonitorList" parameterType="ProcessParamMonitor" resultMap="ProcessParamMonitorResult">
<include refid="selectProcessParamMonitorVo"/>
<where>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="paramCode != null and paramCode != ''">and param_code = #{paramCode}</if>
<if test="paramName != null and paramName != ''">and param_name like concat(concat('%', #{paramName}), '%')</if>
<if test="paramStatus != null and paramStatus != ''">and param_status = #{paramStatus}</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
</where>
order by collect_time desc
</select>
<select id="selectProcessParamMonitorByMonitorId" parameterType="Long" resultMap="ProcessParamMonitorResult">
<include refid="selectProcessParamMonitorVo"/>
where monitor_id = #{monitorId}
</select>
<insert id="insertProcessParamMonitor" parameterType="ProcessParamMonitor">
<selectKey keyProperty="monitorId" resultType="long" order="BEFORE">
SELECT PROCESS_PARAM_MONITOR_SEQ.NEXTVAL as monitorId FROM DUAL
</selectKey>
insert into process_param_monitor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="monitorId != null">monitor_id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="paramCode != null">param_code,</if>
<if test="paramName != null">param_name,</if>
<if test="paramValue != null">param_value,</if>
<if test="paramUnit != null">param_unit,</if>
<if test="standardValue != null">standard_value,</if>
<if test="upperLimit != null">upper_limit,</if>
<if test="lowerLimit != null">lower_limit,</if>
<if test="paramStatus != null">param_status,</if>
<if test="collectTime != null">collect_time,</if>
<if test="isFlag != null">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="monitorId != null">#{monitorId},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="paramCode != null">#{paramCode},</if>
<if test="paramName != null">#{paramName},</if>
<if test="paramValue != null">#{paramValue},</if>
<if test="paramUnit != null">#{paramUnit},</if>
<if test="standardValue != null">#{standardValue},</if>
<if test="upperLimit != null">#{upperLimit},</if>
<if test="lowerLimit != null">#{lowerLimit},</if>
<if test="paramStatus != null">#{paramStatus},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateProcessParamMonitor" parameterType="ProcessParamMonitor">
update process_param_monitor
<trim prefix="SET" suffixOverrides=",">
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="paramCode != null">param_code = #{paramCode},</if>
<if test="paramName != null">param_name = #{paramName},</if>
<if test="paramValue != null">param_value = #{paramValue},</if>
<if test="paramUnit != null">param_unit = #{paramUnit},</if>
<if test="standardValue != null">standard_value = #{standardValue},</if>
<if test="upperLimit != null">upper_limit = #{upperLimit},</if>
<if test="lowerLimit != null">lower_limit = #{lowerLimit},</if>
<if test="paramStatus != null">param_status = #{paramStatus},</if>
<if test="collectTime != null">collect_time = #{collectTime},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where monitor_id = #{monitorId}
</update>
<delete id="deleteProcessParamMonitorByMonitorId" parameterType="Long">
delete from process_param_monitor where monitor_id = #{monitorId}
</delete>
<delete id="deleteProcessParamMonitorByMonitorIds" parameterType="String">
delete from process_param_monitor where monitor_id in
<foreach item="monitorId" collection="array" open="(" separator="," close=")">
#{monitorId}
</foreach>
</delete>
</mapper>

@ -1,144 +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.aucma.base.mapper.ProcessParamTraceMapper">
<resultMap type="ProcessParamTrace" id="ProcessParamTraceResult">
<result property="traceId" column="trace_id"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
<result property="moldCode" column="mold_code"/>
<result property="moldName" column="mold_name"/>
<result property="productCode" column="product_code"/>
<result property="productName" column="product_name"/>
<result property="batchCode" column="batch_code"/>
<result property="moldCount" column="mold_count"/>
<result property="paramCode" column="param_code"/>
<result property="paramName" column="param_name"/>
<result property="paramValue" column="param_value"/>
<result property="paramUnit" column="param_unit"/>
<result property="traceTime" column="trace_time"/>
<result property="isFlag" column="is_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectProcessParamTraceVo">
select trace_id, device_code, device_name, mold_code, mold_name, product_code, product_name,
batch_code, mold_count, param_code, param_name, param_value, param_unit, trace_time,
is_flag, remark, create_by, create_time, update_by, update_time
from process_param_trace
</sql>
<select id="selectProcessParamTraceList" parameterType="ProcessParamTrace" resultMap="ProcessParamTraceResult">
<include refid="selectProcessParamTraceVo"/>
<where>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="moldCode != null and moldCode != ''">and mold_code = #{moldCode}</if>
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
<if test="batchCode != null and batchCode != ''">and batch_code = #{batchCode}</if>
<if test="paramCode != null and paramCode != ''">and param_code = #{paramCode}</if>
<if test="paramName != null and paramName != ''">and param_name like concat(concat('%', #{paramName}), '%')</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
<if test="params != null and params.beginTime != null and params.endTime != null">
and trace_time between #{params.beginTime} and #{params.endTime}
</if>
</where>
order by trace_time desc
</select>
<select id="selectProcessParamTraceByTraceId" parameterType="Long" resultMap="ProcessParamTraceResult">
<include refid="selectProcessParamTraceVo"/>
where trace_id = #{traceId}
</select>
<insert id="insertProcessParamTrace" parameterType="ProcessParamTrace">
<selectKey keyProperty="traceId" resultType="long" order="BEFORE">
SELECT PROCESS_PARAM_TRACE_SEQ.NEXTVAL as traceId FROM DUAL
</selectKey>
insert into process_param_trace
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="traceId != null">trace_id,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="moldCode != null">mold_code,</if>
<if test="moldName != null">mold_name,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
<if test="batchCode != null">batch_code,</if>
<if test="moldCount != null">mold_count,</if>
<if test="paramCode != null">param_code,</if>
<if test="paramName != null">param_name,</if>
<if test="paramValue != null">param_value,</if>
<if test="paramUnit != null">param_unit,</if>
<if test="traceTime != null">trace_time,</if>
<if test="isFlag != null">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="traceId != null">#{traceId},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="moldCode != null">#{moldCode},</if>
<if test="moldName != null">#{moldName},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
<if test="batchCode != null">#{batchCode},</if>
<if test="moldCount != null">#{moldCount},</if>
<if test="paramCode != null">#{paramCode},</if>
<if test="paramName != null">#{paramName},</if>
<if test="paramValue != null">#{paramValue},</if>
<if test="paramUnit != null">#{paramUnit},</if>
<if test="traceTime != null">#{traceTime},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateProcessParamTrace" parameterType="ProcessParamTrace">
update process_param_trace
<trim prefix="SET" suffixOverrides=",">
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="moldCode != null">mold_code = #{moldCode},</if>
<if test="moldName != null">mold_name = #{moldName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="batchCode != null">batch_code = #{batchCode},</if>
<if test="moldCount != null">mold_count = #{moldCount},</if>
<if test="paramCode != null">param_code = #{paramCode},</if>
<if test="paramName != null">param_name = #{paramName},</if>
<if test="paramValue != null">param_value = #{paramValue},</if>
<if test="paramUnit != null">param_unit = #{paramUnit},</if>
<if test="traceTime != null">trace_time = #{traceTime},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where trace_id = #{traceId}
</update>
<delete id="deleteProcessParamTraceByTraceId" parameterType="Long">
delete from process_param_trace where trace_id = #{traceId}
</delete>
<delete id="deleteProcessParamTraceByTraceIds" parameterType="String">
delete from process_param_trace where trace_id in
<foreach item="traceId" collection="array" open="(" separator="," close=")">
#{traceId}
</foreach>
</delete>
</mapper>

@ -1,145 +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.aucma.base.mapper.ProcessSnapshotMapper">
<resultMap type="ProcessSnapshot" id="ProcessSnapshotResult">
<result property="snapshotId" column="snapshot_id"/>
<result property="snapshotCode" column="snapshot_code"/>
<result property="productCode" column="product_code"/>
<result property="productName" column="product_name"/>
<result property="orderCode" column="order_code"/>
<result property="batchCode" column="batch_code"/>
<result property="deviceCode" column="device_code"/>
<result property="deviceName" column="device_name"/>
<result property="stationCode" column="station_code"/>
<result property="stationName" column="station_name"/>
<result property="processStep" column="process_step"/>
<result property="processName" column="process_name"/>
<result property="paramData" column="param_data"/>
<result property="snapshotTime" column="snapshot_time"/>
<result property="isFlag" column="is_flag"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectProcessSnapshotVo">
select snapshot_id, snapshot_code, product_code, product_name, order_code, batch_code,
device_code, device_name, station_code, station_name, process_step, process_name,
param_data, snapshot_time, is_flag, remark, create_by, create_time, update_by, update_time
from process_snapshot
</sql>
<select id="selectProcessSnapshotList" parameterType="ProcessSnapshot" resultMap="ProcessSnapshotResult">
<include refid="selectProcessSnapshotVo"/>
<where>
<if test="snapshotCode != null and snapshotCode != ''">and snapshot_code like concat(concat('%', #{snapshotCode}), '%')</if>
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
<if test="batchCode != null and batchCode != ''">and batch_code = #{batchCode}</if>
<if test="deviceCode != null and deviceCode != ''">and device_code = #{deviceCode}</if>
<if test="stationCode != null and stationCode != ''">and station_code = #{stationCode}</if>
<if test="processStep != null">and process_step = #{processStep}</if>
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
<if test="params != null and params.beginTime != null and params.endTime != null">
and snapshot_time between #{params.beginTime} and #{params.endTime}
</if>
</where>
order by snapshot_time desc
</select>
<select id="selectProcessSnapshotBySnapshotId" parameterType="Long" resultMap="ProcessSnapshotResult">
<include refid="selectProcessSnapshotVo"/>
where snapshot_id = #{snapshotId}
</select>
<insert id="insertProcessSnapshot" parameterType="ProcessSnapshot">
<selectKey keyProperty="snapshotId" resultType="long" order="BEFORE">
SELECT PROCESS_SNAPSHOT_SEQ.NEXTVAL as snapshotId FROM DUAL
</selectKey>
insert into process_snapshot
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="snapshotId != null">snapshot_id,</if>
<if test="snapshotCode != null and snapshotCode != ''">snapshot_code,</if>
<if test="productCode != null">product_code,</if>
<if test="productName != null">product_name,</if>
<if test="orderCode != null">order_code,</if>
<if test="batchCode != null">batch_code,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceName != null">device_name,</if>
<if test="stationCode != null">station_code,</if>
<if test="stationName != null">station_name,</if>
<if test="processStep != null">process_step,</if>
<if test="processName != null">process_name,</if>
<if test="paramData != null">param_data,</if>
<if test="snapshotTime != null">snapshot_time,</if>
<if test="isFlag != null">is_flag,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="snapshotId != null">#{snapshotId},</if>
<if test="snapshotCode != null and snapshotCode != ''">#{snapshotCode},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productName != null">#{productName},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="batchCode != null">#{batchCode},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceName != null">#{deviceName},</if>
<if test="stationCode != null">#{stationCode},</if>
<if test="stationName != null">#{stationName},</if>
<if test="processStep != null">#{processStep},</if>
<if test="processName != null">#{processName},</if>
<if test="paramData != null">#{paramData},</if>
<if test="snapshotTime != null">#{snapshotTime},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateProcessSnapshot" parameterType="ProcessSnapshot">
update process_snapshot
<trim prefix="SET" suffixOverrides=",">
<if test="snapshotCode != null and snapshotCode != ''">snapshot_code = #{snapshotCode},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="batchCode != null">batch_code = #{batchCode},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="stationCode != null">station_code = #{stationCode},</if>
<if test="stationName != null">station_name = #{stationName},</if>
<if test="processStep != null">process_step = #{processStep},</if>
<if test="processName != null">process_name = #{processName},</if>
<if test="paramData != null">param_data = #{paramData},</if>
<if test="snapshotTime != null">snapshot_time = #{snapshotTime},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where snapshot_id = #{snapshotId}
</update>
<delete id="deleteProcessSnapshotBySnapshotId" parameterType="Long">
delete from process_snapshot where snapshot_id = #{snapshotId}
</delete>
<delete id="deleteProcessSnapshotBySnapshotIds" parameterType="String">
delete from process_snapshot where snapshot_id in
<foreach item="snapshotId" collection="array" open="(" separator="," close=")">
#{snapshotId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save