From cce8b8793ca1466ca1330f3bd62e11ae6551261e Mon Sep 17 00:00:00 2001 From: cpT <1@123> Date: 星期二, 01 七月 2025 13:51:58 +0800 Subject: [PATCH] #改造 --- src/main/java/com/zy/asrs/entity/BasErrLog.java | 94 +++++++++++++++++++++++++++++++++++----------- 1 files changed, 71 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/zy/asrs/entity/BasErrLog.java b/src/main/java/com/zy/asrs/entity/BasErrLog.java index 393439c..3bb2ac0 100644 --- a/src/main/java/com/zy/asrs/entity/BasErrLog.java +++ b/src/main/java/com/zy/asrs/entity/BasErrLog.java @@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.enums.IdType; import com.core.common.Cools; import com.core.common.SpringUtils; +import com.zy.asrs.service.BasWrkIotypeService; +import com.zy.asrs.service.BasWrkStatusService; +import com.zy.core.model.command.CrnCommand; import com.zy.system.entity.User; import com.zy.system.service.UserService; import io.swagger.annotations.ApiModelProperty; @@ -23,159 +26,160 @@ * ID */ @ApiModelProperty(value= "ID") - @TableId(value = "\"id\"", type = IdType.AUTO) + @TableId(value = "ID", type = IdType.AUTO) private Long id; /** * 缂栧彿 */ @ApiModelProperty(value= "缂栧彿") - @TableField("\"uuid\"") + @TableField("UUID") private String uuid; /** * 宸ヤ綔鍙� */ @ApiModelProperty(value= "宸ヤ綔鍙�") - @TableField("\"wrk_no\"") + @TableField("WRK_NO") private Integer wrkNo; /** * 鍙戠敓鏃堕棿 */ @ApiModelProperty(value= "鍙戠敓鏃堕棿") - @TableField("\"start_time\"") + @TableField("START_TIME") private Date startTime; /** * 缁撴潫鏃堕棿 */ @ApiModelProperty(value= "缁撴潫鏃堕棿") - @TableField("\"end_time\"") + @TableField("END_TIME") private Date endTime; /** * 宸ヤ綔鐘舵�� */ @ApiModelProperty(value= "宸ヤ綔鐘舵��") - @TableField("\"wrk_sts\"") + @TableField("WRK_STS") private Long wrkSts; /** * 鍏ュ嚭搴撶被鍨� */ @ApiModelProperty(value= "鍏ュ嚭搴撶被鍨�") - @TableField("\"io_type\"") + @TableField("IO_TYPE") private Integer ioType; /** * 鍫嗗灈鏈� */ @ApiModelProperty(value= "鍫嗗灈鏈�") - @TableField("\"crn_no\"") + @TableField("CRN_NO") private Integer crnNo; /** * plc */ @ApiModelProperty(value= "plc") - @TableField("\"plc_no\"") + @TableField("PLC_NO") private Integer plcNo; /** * 鐩爣搴撲綅 */ @ApiModelProperty(value= "鐩爣搴撲綅") - @TableField("\"loc_no\"") + @TableField("LOC_NO") private String locNo; /** * 鐩爣绔� */ @ApiModelProperty(value= "鐩爣绔�") - @TableField("\"sta_no\"") + @TableField("STA_NO") private Integer staNo; /** * 婧愮珯 */ @ApiModelProperty(value= "婧愮珯") - @TableField("\"source_sta_no\"") + @TableField("SOURCE_STA_NO") private Integer sourceStaNo; /** * 婧愬簱浣� */ @ApiModelProperty(value= "婧愬簱浣�") - @TableField("\"source_loc_no\"") + @TableField("SOURCE_LOC_NO") private String sourceLocNo; /** * 鏉$爜 */ @ApiModelProperty(value= "鏉$爜") - @TableField("\"barcode\"") + @TableField("BARCODE") private String barcode; /** * 寮傚父鐮� */ @ApiModelProperty(value= "寮傚父鐮�") - @TableField("\"err_code\"") + @TableField("ERR_CODE") private Integer errCode; /** * 寮傚父 */ @ApiModelProperty(value= "寮傚父") - @TableField("\"error\"") + @TableField("ERROR") private String error; /** * 寮傚父鎯呭喌 1: 鏈鐞� 2: 宸蹭慨澶� */ @ApiModelProperty(value= "寮傚父鎯呭喌 1: 鏈鐞� 2: 宸蹭慨澶� ") - @TableField("\"status\"") + @TableField("STATUS") private Integer status; /** * 娣诲姞鏃堕棿 */ @ApiModelProperty(value= "娣诲姞鏃堕棿") - @TableField("\"create_time\"") + @TableField("CREATE_TIME") private Date createTime; /** * 娣诲姞浜哄憳 */ @ApiModelProperty(value= "娣诲姞浜哄憳") - @TableField("\"create_by\"") + @TableField("CREATE_BY") private Long createBy; /** * 淇敼鏃堕棿 */ @ApiModelProperty(value= "淇敼鏃堕棿") - @TableField("\"update_time\"") + @TableField("UPDATE_TIME") private Date updateTime; /** * 淇敼浜哄憳 */ @ApiModelProperty(value= "淇敼浜哄憳") - @TableField("\"update_by\"") + @TableField("UPDATE_BY") private Long updateBy; /** * 澶囨敞 */ @ApiModelProperty(value= "澶囨敞") - @TableField("\"memo\"") + @TableField("MEMO") private String memo; public BasErrLog() {} - public BasErrLog(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) { + public BasErrLog(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; @@ -196,6 +200,32 @@ this.createBy = createBy; this.updateTime = updateTime; this.updateBy = updateBy; + this.memo = memo; + } + + + public BasErrLog(CrnCommand command,String error,String memo) { + Date now = new Date(); + this.uuid = now.toString(); + this.wrkNo = command.getTaskNo().intValue(); + this.startTime = now; + this.endTime = now; + this.wrkSts = 0L; + this.ioType = 0; + this.crnNo = command.getLaneNo(); + this.plcNo = command.getCrnNo(); + this.locNo = command.getSourcePosX()+"鎺�"+command.getSourcePosY()+"鍒�"+command.getSourcePosZ()+"灞�"; + this.staNo = 0; + this.sourceStaNo = 0; + this.sourceLocNo = command.getDestinationPosX()+"鎺�"+command.getDestinationPosY()+"鍒�"+command.getDestinationPosY()+"灞�"; + this.barcode = ""; + this.errCode = 0; + this.error = error; + this.status = 0; + this.createTime = now; + this.createBy = null; + this.updateTime = now; + this.updateBy = null; this.memo = memo; } @@ -285,6 +315,15 @@ this.wrkSts = wrkSts; } + public String getWrkSts$(){ + BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class); + BasWrkStatus basWrkStatus = service.selectById(this.wrkSts); + if (!Cools.isEmpty(basWrkStatus)){ + return String.valueOf(basWrkStatus.getWrkDesc()); + } + return null; + } + public Integer getIoType() { return ioType; } @@ -293,6 +332,15 @@ this.ioType = ioType; } + public String getIoType$(){ + BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); + BasWrkIotype basWrkIotype = service.selectById(this.ioType); + if (!Cools.isEmpty(basWrkIotype)){ + return String.valueOf(basWrkIotype.getIoDesc()); + } + return null; + } + public Integer getCrnNo() { return crnNo; } -- Gitblit v1.9.1