From 40068e5974f99a02224a5df09460739addd5e6cf Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期二, 12 八月 2025 10:46:31 +0800
Subject: [PATCH] 输送线异常报警信息记录

---
 src/main/java/com/zy/service/impl/BasDevpErrLogServiceImpl.java |   25 ++
 src/main/java/com/zy/entity/BasDevpErrLog.java                  |  456 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/main/java/com/zy/mapper/BasDevpErrLogMapper.java            |   12 +
 src/main/java/com/zy/service/BasDevpErrLogService.java          |   10 +
 4 files changed, 503 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/entity/BasDevpErrLog.java b/src/main/java/com/zy/entity/BasDevpErrLog.java
new file mode 100644
index 0000000..3954bde
--- /dev/null
+++ b/src/main/java/com/zy/entity/BasDevpErrLog.java
@@ -0,0 +1,456 @@
+package com.zy.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.system.entity.User;
+import com.zy.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@TableName("asr_bas_devp_err_log")
+public class BasDevpErrLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @ApiModelProperty(value= "ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 缂栧彿
+     */
+    @ApiModelProperty(value= "缂栧彿")
+    private String uuid;
+
+    /**
+     * 宸ヤ綔鍙�
+     */
+    @ApiModelProperty(value= "宸ヤ綔鍙�")
+    @TableField("wrk_no")
+    private Integer wrkNo;
+
+    /**
+     * 鍙戠敓鏃堕棿
+     */
+    @ApiModelProperty(value= "鍙戠敓鏃堕棿")
+    @TableField("start_time")
+    private Date startTime;
+
+    /**
+     * 缁撴潫鏃堕棿
+     */
+    @ApiModelProperty(value= "缁撴潫鏃堕棿")
+    @TableField("end_time")
+    private Date endTime;
+
+    /**
+     * 宸ヤ綔鐘舵��
+     */
+    @ApiModelProperty(value= "宸ヤ綔鐘舵��")
+    @TableField("wrk_sts")
+    private Long wrkSts;
+
+    /**
+     * 鍏ュ嚭搴撶被鍨�
+     */
+    @ApiModelProperty(value= "鍏ュ嚭搴撶被鍨�")
+    @TableField("io_type")
+    private Integer ioType;
+
+    /**
+     * 鍫嗗灈鏈�
+     */
+    @ApiModelProperty(value= "鍫嗗灈鏈�")
+    @TableField("crn_no")
+    private Integer crnNo;
+
+    /**
+     * plc
+     */
+    @ApiModelProperty(value= "plc")
+    @TableField("plc_no")
+    private Integer plcNo;
+
+    /**
+     * 鐩爣搴撲綅
+     */
+    @ApiModelProperty(value= "鐩爣搴撲綅")
+    @TableField("loc_no")
+    private String locNo;
+
+    /**
+     * 鐩爣绔�
+     */
+    @ApiModelProperty(value= "鐩爣绔�")
+    @TableField("sta_no")
+    private Integer staNo;
+
+    /**
+     * 婧愮珯
+     */
+    @ApiModelProperty(value= "婧愮珯")
+    @TableField("source_sta_no")
+    private Integer sourceStaNo;
+
+    /**
+     * 婧愬簱浣�
+     */
+    @ApiModelProperty(value= "婧愬簱浣�")
+    @TableField("source_loc_no")
+    private String sourceLocNo;
+
+    /**
+     * 鏉$爜
+     */
+    @ApiModelProperty(value= "鏉$爜")
+    private String barcode;
+
+    /**
+     * 寮傚父鐮�
+     */
+    @ApiModelProperty(value= "寮傚父鐮�")
+    @TableField("err_code")
+    private Integer errCode;
+
+    /**
+     * 寮傚父
+     */
+    @ApiModelProperty(value= "寮傚父")
+    private String error;
+
+    /**
+     * 寮傚父鎯呭喌 1: 鏈鐞�  2: 宸蹭慨澶�
+     */
+    @ApiModelProperty(value= "寮傚父鎯呭喌 1: 鏈鐞�  2: 宸蹭慨澶�  ")
+    private Integer status;
+
+    /**
+     * 娣诲姞鏃堕棿
+     */
+    @ApiModelProperty(value= "娣诲姞鏃堕棿")
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 娣诲姞浜哄憳
+     */
+    @ApiModelProperty(value= "娣诲姞浜哄憳")
+    @TableField("create_by")
+    private Long createBy;
+
+    /**
+     * 淇敼鏃堕棿
+     */
+    @ApiModelProperty(value= "淇敼鏃堕棿")
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 淇敼浜哄憳
+     */
+    @ApiModelProperty(value= "淇敼浜哄憳")
+    @TableField("update_by")
+    private Long updateBy;
+
+    /**
+     * 澶囨敞
+     */
+    @ApiModelProperty(value= "澶囨敞")
+    private String memo;
+
+    public BasDevpErrLog() {}
+
+    public BasDevpErrLog(String uuid, Integer wrkNo, Date startTime, Date endTime, Long wrkSts, Integer ioType, Integer crnNo, Integer plcNo, String locNo, Integer staNo, Integer sourceStaNo, String sourceLocNo, String barcode, Integer errCode, String error, Integer status, Date createTime, Long createBy, Date updateTime, Long updateBy, String memo) {
+        this.uuid = uuid;
+        this.wrkNo = wrkNo;
+        this.startTime = startTime;
+        this.endTime = endTime;
+        this.wrkSts = wrkSts;
+        this.ioType = ioType;
+        this.crnNo = crnNo;
+        this.plcNo = plcNo;
+        this.locNo = locNo;
+        this.staNo = staNo;
+        this.sourceStaNo = sourceStaNo;
+        this.sourceLocNo = sourceLocNo;
+        this.barcode = barcode;
+        this.errCode = errCode;
+        this.error = error;
+        this.status = status;
+        this.createTime = createTime;
+        this.createBy = createBy;
+        this.updateTime = updateTime;
+        this.updateBy = updateBy;
+        this.memo = memo;
+    }
+
+//    BasErrLog basErrLog = new BasErrLog(
+//            null,    // 缂栧彿
+//            null,    // 宸ヤ綔鍙�
+//            null,    // 鍙戠敓鏃堕棿
+//            null,    // 缁撴潫鏃堕棿
+//            null,    // 宸ヤ綔鐘舵��
+//            null,    // 鍏ュ嚭搴撶被鍨�
+//            null,    // 鍫嗗灈鏈�
+//            null,    // plc
+//            null,    // 鐩爣搴撲綅
+//            null,    // 鐩爣绔�
+//            null,    // 婧愮珯
+//            null,    // 婧愬簱浣�
+//            null,    // 鏉$爜
+//            null,    // 寮傚父鐮�
+//            null,    // 寮傚父
+//            null,    // 寮傚父鎯呭喌
+//            null,    // 娣诲姞鏃堕棿
+//            null,    // 娣诲姞浜哄憳
+//            null,    // 淇敼鏃堕棿
+//            null,    // 淇敼浜哄憳
+//            null    // 澶囨敞
+//    );
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+
+    public Integer getWrkNo() {
+        return wrkNo;
+    }
+
+    public void setWrkNo(Integer wrkNo) {
+        this.wrkNo = wrkNo;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public String getStartTime$(){
+        if (Cools.isEmpty(this.startTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.startTime);
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public String getEndTime$(){
+        if (Cools.isEmpty(this.endTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.endTime);
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Long getWrkSts() {
+        return wrkSts;
+    }
+
+    public void setWrkSts(Long wrkSts) {
+        this.wrkSts = wrkSts;
+    }
+
+    public Integer getIoType() {
+        return ioType;
+    }
+
+    public void setIoType(Integer ioType) {
+        this.ioType = ioType;
+    }
+
+    public Integer getCrnNo() {
+        return crnNo;
+    }
+
+    public void setCrnNo(Integer crnNo) {
+        this.crnNo = crnNo;
+    }
+
+    public Integer getPlcNo() {
+        return plcNo;
+    }
+
+    public void setPlcNo(Integer plcNo) {
+        this.plcNo = plcNo;
+    }
+
+    public String getLocNo() {
+        return locNo;
+    }
+
+    public void setLocNo(String locNo) {
+        this.locNo = locNo;
+    }
+
+    public Integer getStaNo() {
+        return staNo;
+    }
+
+    public void setStaNo(Integer staNo) {
+        this.staNo = staNo;
+    }
+
+    public Integer getSourceStaNo() {
+        return sourceStaNo;
+    }
+
+    public void setSourceStaNo(Integer sourceStaNo) {
+        this.sourceStaNo = sourceStaNo;
+    }
+
+    public String getSourceLocNo() {
+        return sourceLocNo;
+    }
+
+    public void setSourceLocNo(String sourceLocNo) {
+        this.sourceLocNo = sourceLocNo;
+    }
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public Integer getErrCode() {
+        return errCode;
+    }
+
+    public void setErrCode(Integer errCode) {
+        this.errCode = errCode;
+    }
+
+    public String getError() {
+        return error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public String getStatus$(){
+        if (null == this.status){ return null; }
+        switch (this.status){
+            case 1:
+                return "鏈鐞�";
+            case 2:
+                return "宸蹭慨澶�";
+            default:
+                return String.valueOf(this.status);
+        }
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public String getCreateTime$(){
+        if (Cools.isEmpty(this.createTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Long getCreateBy() {
+        return createBy;
+    }
+
+    public String getCreateBy$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.createBy);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getUsername());
+        }
+        return null;
+    }
+
+    public void setCreateBy(Long createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public String getUpdateTime$(){
+        if (Cools.isEmpty(this.updateTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Long getUpdateBy() {
+        return updateBy;
+    }
+
+    public String getUpdateBy$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.updateBy);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getUsername());
+        }
+        return null;
+    }
+
+    public void setUpdateBy(Long updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+
+}
diff --git a/src/main/java/com/zy/mapper/BasDevpErrLogMapper.java b/src/main/java/com/zy/mapper/BasDevpErrLogMapper.java
new file mode 100644
index 0000000..5c0bc70
--- /dev/null
+++ b/src/main/java/com/zy/mapper/BasDevpErrLogMapper.java
@@ -0,0 +1,12 @@
+package com.zy.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.entity.BasDevpErrLog;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface BasDevpErrLogMapper extends BaseMapper<BasDevpErrLog> {
+
+}
diff --git a/src/main/java/com/zy/service/BasDevpErrLogService.java b/src/main/java/com/zy/service/BasDevpErrLogService.java
new file mode 100644
index 0000000..d036901
--- /dev/null
+++ b/src/main/java/com/zy/service/BasDevpErrLogService.java
@@ -0,0 +1,10 @@
+package com.zy.service;
+
+import com.baomidou.mybatisplus.service.IService;
+import com.zy.entity.BasDevpErrLog;
+
+public interface BasDevpErrLogService extends IService<BasDevpErrLog> {
+
+    BasDevpErrLog findLatestByTaskNo(Integer sourceStaNo, Integer taskNo);
+
+}
diff --git a/src/main/java/com/zy/service/impl/BasDevpErrLogServiceImpl.java b/src/main/java/com/zy/service/impl/BasDevpErrLogServiceImpl.java
new file mode 100644
index 0000000..5f0adcb
--- /dev/null
+++ b/src/main/java/com/zy/service/impl/BasDevpErrLogServiceImpl.java
@@ -0,0 +1,25 @@
+package com.zy.service.impl;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.zy.entity.BasDevpErrLog;
+import com.zy.mapper.BasDevpErrLogMapper;
+import com.zy.service.BasDevpErrLogService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service("basDevpErrLogService")
+public class BasDevpErrLogServiceImpl extends ServiceImpl<BasDevpErrLogMapper, BasDevpErrLog> implements BasDevpErrLogService {
+
+    @Override
+    public BasDevpErrLog findLatestByTaskNo(Integer sourceStaNo, Integer taskNo) {
+        List<BasDevpErrLog> basErrLogs = this.baseMapper.selectList(new EntityWrapper<BasDevpErrLog>().eq("source_sta_no", sourceStaNo).eq("wrk_no", taskNo).orderBy("start_time", false));
+        if (basErrLogs == null || basErrLogs.size() == 0) {
+            return null;
+        } else {
+            return basErrLogs.get(0);
+        }
+    }
+
+}

--
Gitblit v1.9.1