From 2dbe2c8b830a3b006b1536c7dac48b5f8c24e00d Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 28 四月 2025 16:53:07 +0800
Subject: [PATCH] #wms端生成任务优化

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java |  170 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 133 insertions(+), 37 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java
index 9253371..5b1f707 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java
@@ -1,27 +1,29 @@
 package com.vincent.rsf.server.manager.entity;
 
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.springframework.format.annotation.DateTimeFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.baomidou.mybatisplus.annotation.TableName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.vincent.rsf.framework.common.Cools;
 import com.vincent.rsf.framework.common.SpringUtils;
-import com.vincent.rsf.server.system.service.UserService;
+import com.vincent.rsf.server.manager.service.LocTypeService;
+import com.vincent.rsf.server.manager.service.WarehouseAreasService;
+import com.vincent.rsf.server.manager.service.WarehouseService;
 import com.vincent.rsf.server.system.entity.User;
+import com.vincent.rsf.server.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.format.annotation.DateTimeFormat;
+
 import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
 import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
 
 @Data
+@Accessors(chain = true)
 @TableName("man_loc")
 public class Loc implements Serializable {
 
@@ -41,22 +43,27 @@
     private Long areaId;
 
     /**
-     * 缂栧彿
+     * 搴撲綅鍙�
      */
-    @ApiModelProperty(value= "缂栧彿")
+    @ApiModelProperty(value= "搴撲綅鍙�")
     private String code;
 
     /**
-     * 搴撲綅绫诲瀷
+     * 浠撳簱鏍囪瘑
      */
-    @ApiModelProperty(value= "搴撲綅绫诲瀷")
-    private String type;
+    @ApiModelProperty(value= "浠撳簱鏍囪瘑")
+    private Long warehouseId;
 
     /**
-     * 鍚嶇О
+     * 搴撲綅绫诲瀷(*) H:  楂樺簱浣�   M:  涓簱浣�   L:  浣庡簱浣�  
      */
-    @ApiModelProperty(value= "鍚嶇О")
-    private String name;
+    @ApiModelProperty(value= "搴撲綅绫诲瀷(*) H:  楂樺簱浣�   M:  涓簱浣�   L:  浣庡簱浣�  ")
+    @TableField("`type`")
+    private String type;
+
+    @ApiModelProperty("搴撲綅绫诲瀷(*)[man_loc_type]")
+    @TableField(exist = false)
+    private List<Long> typeIds;
 
     /**
      * 铏氭嫙搴撲綅
@@ -83,16 +90,35 @@
     private String unit;
 
     /**
-     * 闀�/瀹�/楂�
+     * 闀�
      */
-    @ApiModelProperty(value= "闀�/瀹�/楂�")
-    private String size;
+    @ApiModelProperty(value= "闀�")
+    @TableField("`length`")
+    private Double length;
 
+    /**
+     * 楂�
+     */
+    @ApiModelProperty(value= "楂�")
+    private Double height;
+
+    /**
+     * 瀹�
+     */
+    @ApiModelProperty(value= "瀹�")
+    private Double width;
     /**
      * 鎺�
      */
     @ApiModelProperty(value= "鎺�")
+    @TableField("`row`")
     private Integer row;
+
+    /**
+     * 璁惧鍙�
+     */
+    @ApiModelProperty(value= "璁惧鍙�")
+    private Integer deviceNo;
 
     /**
      * 鍒�
@@ -107,9 +133,10 @@
     private Integer lev;
 
     /**
-     * 閫氶亾
+     * 宸烽亾
      */
-    @ApiModelProperty(value= "閫氶亾")
+    @ApiModelProperty(value= "宸烽亾")
+    @TableField("`channel`")
     private Integer channel;
 
     /**
@@ -123,6 +150,12 @@
      */
     @ApiModelProperty(value= "鏈�澶у寘瑁呮暟")
     private Integer maxPack;
+
+    /**
+     * 搴撲綅浣跨敤鐘舵�� O:  绌哄簱   D:  绌烘澘   R:  棰勭害鍑哄簱   S:  棰勭害鍏ュ簱   X:  绂佺敤  聽 F:  鍦ㄥ簱  
+     */
+    @ApiModelProperty(value= "搴撲綅浣跨敤鐘舵�� O:  绌哄簱   D:  绌烘澘   R:  棰勭害鍑哄簱   S:  棰勭害鍏ュ簱   X:  绂佺敤  聽 F:  鍦ㄥ簱  ")
+    private String useStatus;
 
     /**
      * 鏄惁鏍囩绠$悊
@@ -140,6 +173,7 @@
      * 鐘舵�� 1: 姝e父  0: 鍐荤粨  
      */
     @ApiModelProperty(value= "鐘舵�� 1: 姝e父  0: 鍐荤粨  ")
+    @TableField("`status`")
     private Integer status;
 
     /**
@@ -189,22 +223,25 @@
 
     public Loc() {}
 
-    public Loc(Long areaId,String code,String type,String name,Short flagLogic,String fucAtrrs,String barcode,String unit,String size,Integer row,Integer col,Integer lev,Integer channel,Integer maxParts,Integer maxPack,Short flagLabelMange,String locAttrs,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
+    public Loc(Long areaId, String code, Long warehouseId, String type, Short flagLogic, String fucAtrrs, String barcode, String unit, Double length, Double height, Double width, Integer row, Integer col, Integer lev, Integer channel, Integer maxParts, Integer maxPack, String useStatus, Short flagLabelMange, String locAttrs, Integer status, Integer deleted, Integer tenantId, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo) {
         this.areaId = areaId;
         this.code = code;
+        this.warehouseId = warehouseId;
         this.type = type;
-        this.name = name;
         this.flagLogic = flagLogic;
         this.fucAtrrs = fucAtrrs;
         this.barcode = barcode;
         this.unit = unit;
-        this.size = size;
+        this.length = length;
+        this.height = height;
+        this.width = width;
         this.row = row;
         this.col = col;
         this.lev = lev;
         this.channel = channel;
         this.maxParts = maxParts;
         this.maxPack = maxPack;
+        this.useStatus = useStatus;
         this.flagLabelMange = flagLabelMange;
         this.locAttrs = locAttrs;
         this.status = status;
@@ -219,22 +256,25 @@
 
 //    Loc loc = new Loc(
 //            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,    // 绉熸埛
@@ -245,6 +285,62 @@
 //            null    // 澶囨敞
 //    );
 
+    public String getTypeIds$(){
+        if (null == this.type){ return null; }
+        String[] split = this.type.split(",");
+        List<String> asList = Arrays.asList(split);
+        if (asList.isEmpty()) {
+            return null;
+        }
+        LocTypeService locTypeService = SpringUtils.getBean(LocTypeService.class);
+        List<LocType> locTypes = locTypeService.list(new LambdaQueryWrapper<LocType>().in(LocType::getId, asList));
+        if (locTypes.isEmpty()) {
+            return null;
+        }
+        List<String> strings = locTypes.stream().map(LocType::getName).collect(Collectors.toList());
+        return StringUtils.join(strings, ",");
+    }
+
+    public String getUseStatus$(){
+        if (null == this.useStatus){ return null; }
+        switch (this.useStatus){
+            case  "O":
+                return " 绌哄簱";
+            case  "D":
+                return " 绌烘澘";
+            case  "R":
+                return " 棰勭害鍑哄簱";
+            case  "S":
+                return " 棰勭害鍏ュ簱";
+            case  "X":
+                return " 绂佺敤";
+            case  "F":
+                return " 鍦ㄥ簱";
+            default:
+                return String.valueOf(this.useStatus);
+        }
+    }
+
+    public String getWarehouseId$(){
+        if (null == this.warehouseId){ return null; }
+        WarehouseService service = SpringUtils.getBean(WarehouseService.class);
+        Warehouse warehouse = service.getById(this.warehouseId);
+        if (!Cools.isEmpty(warehouse)){
+            return String.valueOf(warehouse.getName());
+        }
+        return null;
+    }
+
+    public String getAreaId$(){
+        if (null == this.areaId){ return null; }
+        WarehouseAreasService service = SpringUtils.getBean(WarehouseAreasService.class);
+        WarehouseAreas warehouseAreas = service.getById(this.areaId);
+        if (!Cools.isEmpty(warehouseAreas)){
+            return String.valueOf(warehouseAreas.getName());
+        }
+        return null;
+    }
+
     public String getStatus$(){
         if (null == this.status){ return null; }
         switch (this.status){

--
Gitblit v1.9.1