From b67bf724fc788cb3b86641c7eb7a35cdbc4c7a93 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 06 五月 2025 20:17:25 +0800
Subject: [PATCH] PO单导入功能优化

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Loc.java |  178 ++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 138 insertions(+), 40 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 017072c..59ad309 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,30 @@
 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.fasterxml.jackson.annotation.JsonFormat;
 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 +44,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 +91,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= "鎺�")
-    private Integer lrow;
+    @TableField("`row`")
+    private Integer row;
+
+    /**
+     * 璁惧鍙�
+     */
+    @ApiModelProperty(value= "璁惧鍙�")
+    private Integer deviceNo;
 
     /**
      * 鍒�
@@ -107,9 +134,10 @@
     private Integer lev;
 
     /**
-     * 閫氶亾
+     * 宸烽亾
      */
-    @ApiModelProperty(value= "閫氶亾")
+    @ApiModelProperty(value= "宸烽亾")
+    @TableField("`channel`")
     private Integer channel;
 
     /**
@@ -123,6 +151,12 @@
      */
     @ApiModelProperty(value= "鏈�澶у寘瑁呮暟")
     private Integer maxPack;
+
+    /**
+     * 搴撲綅浣跨敤鐘舵�� O:  绌哄簱   D:  绌烘澘   R:  棰勭害鍑哄簱   S:  棰勭害鍏ュ簱   X:  绂佺敤  聽 F:  鍦ㄥ簱  
+     */
+    @ApiModelProperty(value= "搴撲綅浣跨敤鐘舵�� O:  绌哄簱   D:  绌烘澘   R:  棰勭害鍑哄簱   S:  棰勭害鍏ュ簱   X:  绂佺敤  聽 F:  鍦ㄥ簱  ")
+    private String useStatus;
 
     /**
      * 鏄惁鏍囩绠$悊
@@ -140,13 +174,13 @@
      * 鐘舵�� 1: 姝e父  0: 鍐荤粨  
      */
     @ApiModelProperty(value= "鐘舵�� 1: 姝e父  0: 鍐荤粨  ")
+    @TableField("`status`")
     private Integer status;
 
     /**
      * 鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  
      */
     @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  ")
-    @TableLogic
     private Integer deleted;
 
     /**
@@ -166,6 +200,7 @@
      */
     @ApiModelProperty(value= "娣诲姞鏃堕棿")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private Date createTime;
 
     /**
@@ -179,6 +214,7 @@
      */
     @ApiModelProperty(value= "淇敼鏃堕棿")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private Date updateTime;
 
     /**
@@ -189,22 +225,25 @@
 
     public Loc() {}
 
-    public Loc(Long areaId,String code,String type,String name,Short flagLogic,String fucAtrrs,String barcode,String unit,String size,Integer lrow,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.lrow = lrow;
+        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 +258,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 +287,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