From 29aa7746640d7d0c0f01f3e0d3f23ef3250086a7 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期五, 13 六月 2025 16:50:39 +0800 Subject: [PATCH] 数据为空的校验补充 --- zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/AgvDetail.java | 122 ++++++++-------------------------------- 1 files changed, 25 insertions(+), 97 deletions(-) diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/AgvDetail.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/AgvDetail.java index d311e3d..f43ddd7 100644 --- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/AgvDetail.java +++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/entity/AgvDetail.java @@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.zy.acs.common.enums.AgvStatusType; import com.zy.acs.framework.common.Cools; import com.zy.acs.framework.common.SpringUtils; -import com.zy.acs.common.enums.AgvStatusType; +import com.zy.acs.manager.core.constant.MapDataConstant; import com.zy.acs.manager.manager.service.AgvService; import com.zy.acs.manager.manager.service.CodeService; import io.swagger.annotations.ApiModelProperty; @@ -14,6 +15,7 @@ import java.io.Serializable; import java.util.Date; +import java.util.Optional; @Data @TableName("man_agv_detail") @@ -170,13 +172,19 @@ * 鏆傚瓨鏁伴噺 */ @ApiModelProperty(value= "鏆傚瓨鏁伴噺") - private Integer tempQua; + private String backpack; /** - * 瀵嗙爜 + * 鏁呴殰淇℃伅 */ - @ApiModelProperty(value= "瀵嗙爜") - private String password; + @ApiModelProperty(value= "鏁呴殰淇℃伅") + private String error; + + /** + * 鏁呴殰鏃堕棿 + */ + @ApiModelProperty(value= "鏁呴殰鏃堕棿") + private Date errorTime; /** * 鐘舵�� @@ -231,76 +239,6 @@ public AgvDetail() {} - public AgvDetail(String uuid,Long agvId,String title,Long code,Long lastCode,String codeOffsert,Double straightVal,Double agvAngle,Double gyroAngle,Double encoderAngle,Integer high,Long sensorSts,Integer vol,Integer soc,Integer soh,Integer batteryFail,String tempe,String motorFail,String failSign,Integer bootTime,Integer workTime,Double workDistance,Integer tempQua,String password,Integer status,Integer deleted,Long tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { - this.uuid = uuid; - this.agvId = agvId; - this.title = title; - this.code = code; - this.lastCode = lastCode; - this.codeOffsert = codeOffsert; - this.straightVal = straightVal; - this.agvAngle = agvAngle; - this.gyroAngle = gyroAngle; - this.encoderAngle = encoderAngle; - this.high = high; - this.sensorSts = sensorSts; - this.vol = vol; - this.soc = soc; - this.soh = soh; - this.batteryFail = batteryFail; - this.tempe = tempe; - this.motorFail = motorFail; - this.failSign = failSign; - this.bootTime = bootTime; - this.workTime = workTime; - this.workDistance = workDistance; - this.tempQua = tempQua; - this.password = password; - this.status = status; - this.deleted = deleted; - this.tenantId = tenantId; - this.createBy = createBy; - this.createTime = createTime; - this.updateBy = updateBy; - this.updateTime = updateTime; - this.memo = memo; - } - -// AgvDetail agvDetail = new AgvDetail( -// null, // 缂栧彿 -// null, // Agv[闈炵┖] -// null, // 鏍囬 -// null, // 鏉$爜 -// null, // 閭绘帴鏉$爜 -// null, // 鍦伴潰鐮佸亸绉� -// null, // 鐩磋璺濈 -// null, // 褰撳墠瑙掑害 -// null, // 闄�铻轰华瑙掑害 -// null, // 缂栫爜鍣ㄨ搴� -// null, // 褰撳墠楂樺害 -// null, // 浼犳劅鍣ㄧ姸鎬� -// null, // 鐢靛帇 -// null, // 鐢甸噺 -// null, // 鍋ュ悍 -// null, // 鐢垫睜鏁呴殰 -// null, // 娓╁害 -// null, // 鐢垫満鏁呴殰 -// null, // 鏁呴殰鏍囪瘑 -// null, // 寮�鏈烘椂闂� -// null, // 宸ヤ綔鏃堕棿 -// null, // 绱閲岀▼ -// null, // 鏆傚瓨鏁伴噺 -// null, // 瀵嗙爜 -// null, // 鐘舵�乕闈炵┖] -// null, // 鏄惁鍒犻櫎[闈炵┖] -// null, // 绉熸埛 -// null, // 娣诲姞浜哄憳 -// null, // 娣诲姞鏃堕棿[闈炵┖] -// null, // 淇敼浜哄憳 -// null, // 淇敼鏃堕棿 -// null // 澶囨敞 -// ); - public String getAgvId$(){ AgvService service = SpringUtils.getBean(AgvService.class); Agv agv = service.getById(this.agvId); @@ -314,7 +252,7 @@ CodeService service = SpringUtils.getBean(CodeService.class); Code code = service.getById(this.code); if (!Cools.isEmpty(code)){ - return String.valueOf(code.getUuid()); + return String.valueOf(code.getData()); } return null; } @@ -328,15 +266,15 @@ return null; } - public String getPos$(){ + public Boolean getPosBool(){ if (null == this.pos){ return null; } switch (this.pos){ case 1: - return "鏄�"; + return true; case 0: - return "鍚�"; + return false; default: - return String.valueOf(this.status); + return null; } } @@ -345,13 +283,9 @@ this.agvStatus = AgvStatusType.get(status); } - public String getStatus$(){ - if (null == this.status){ return null; } - if (null == this.agvStatus){ return null; } - return this.agvStatus.desc; + public String getStatusDesc(){ + return Optional.ofNullable(this.agvStatus).map(status -> status.desc).orElse(""); } - - public Long getRecentCode() { // if (this.code != null) { @@ -369,18 +303,12 @@ return null; } - public Boolean getStatusBool(){ - if (null == this.status){ return null; } - switch (this.status){ - case 1: - return true; - case 0: - return false; - default: - return null; + public String realError() { + if (!Cools.isEmpty(this.error) && !MapDataConstant.EMPTY_OF_ERROR.equals(this.error)) { + return this.error; + } else { + return ""; } } - - } -- Gitblit v1.9.1