| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.Cools; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | @TableId(value = "crn_no", type = IdType.INPUT) |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | @ApiModelProperty(value= "深库位排号") |
| | | @TableField("deep_rows") |
| | | private String deepRows; |
| | | |
| | | @ApiModelProperty(value= "堆垛机命令排号映射JSON") |
| | | @TableField("row_map") |
| | | private String rowMap; |
| | | |
| | | /** |
| | | * 入站列表 |
| | |
| | | return rowList; |
| | | } |
| | | |
| | | public Integer getCommandRow(Integer locationRow){ |
| | | if (locationRow == null || Cools.isEmpty(this.rowMap)){ |
| | | return locationRow; |
| | | } |
| | | |
| | | try { |
| | | JSONObject rowMapJson = JSON.parseObject(this.rowMap); |
| | | String locationRowKey = String.valueOf(locationRow); |
| | | Object commandRowValue = rowMapJson.get(locationRowKey); |
| | | if (commandRowValue == null){ |
| | | return locationRow; |
| | | } |
| | | if (commandRowValue instanceof Number){ |
| | | return ((Number) commandRowValue).intValue(); |
| | | } |
| | | return Integer.valueOf(String.valueOf(commandRowValue)); |
| | | } catch (Exception exception) { |
| | | return locationRow; |
| | | } |
| | | } |
| | | |
| | | public String formatMappedLocNo(String locNo){ |
| | | if (Cools.isEmpty(locNo)){ |
| | | return locNo; |
| | | } |
| | | String[] locParts = locNo.split("-"); |
| | | if (locParts.length < 3){ |
| | | return locNo; |
| | | } |
| | | try { |
| | | Integer locationRow = Integer.valueOf(locParts[0]); |
| | | Integer commandRow = getCommandRow(locationRow); |
| | | if (commandRow == null || commandRow.equals(locationRow)){ |
| | | return locNo; |
| | | } |
| | | String mappedLocNo = commandRow + "-" + locParts[1] + "-" + locParts[2]; |
| | | return locNo + "(" + mappedLocNo + ")"; |
| | | } catch (Exception exception) { |
| | | return locNo; |
| | | } |
| | | } |
| | | |
| | | } |