From c46d1d8c3b9875f051a6ec3c4a1d3fa7bd32e5db Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 15 五月 2025 17:15:21 +0800
Subject: [PATCH] 新增库存管理 新增库存明细

---
 rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Stock.java |  149 +++++++++++++++++++++----------------------------
 1 files changed, 63 insertions(+), 86 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Stock.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Stock.java
index 670c7d5..608d388 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Stock.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Stock.java
@@ -1,7 +1,14 @@
 package com.vincent.rsf.server.manager.entity;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.util.*;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.vincent.rsf.server.system.constant.DictTypeCode;
+import com.vincent.rsf.server.system.entity.DictData;
+import com.vincent.rsf.server.system.service.DictDataService;
+import lombok.experimental.Accessors;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import java.text.SimpleDateFormat;
@@ -24,9 +31,9 @@
 import java.util.Date;
 
 @Data
+@Accessors(chain = true)
 @TableName("man_stock")
 public class Stock implements Serializable {
-
     private static final long serialVersionUID = 1L;
 
     /**
@@ -37,59 +44,40 @@
     private Long id;
 
     /**
-     * ASN鍗曟嵁锛� 甯﹀嚭PO鍗�
+     * 缂栧彿
      */
-    @ApiModelProperty(value= "ASN鍗曟嵁锛� 甯﹀嚭PO鍗�")
-    private String asnOrder;
+    @ApiModelProperty(value= "缂栧彿")
+    private String code;
 
     /**
-     * ERP鍑瘉
+     * 婧愬崟鎹紪鐮�
      */
-    @ApiModelProperty(value= "ERP鍑瘉")
-    private String erpToken;
+    @ApiModelProperty(value= "婧愬崟鎹紪鐮�")
+    private String sourceCode;
 
     /**
-     * ERP鍗曞彿
+     * 婧愬崟鎹甀D
      */
-    @ApiModelProperty(value= "ERP鍗曞彿")
-    private String erpOrder;
+    @ApiModelProperty(value= "婧愬崟鎹甀D")
+    private Long sourceId;
 
     /**
-     * ERP搴撳瓨鍦板潃
+     * 鍗曟嵁绫诲瀷
      */
-    @ApiModelProperty(value= "ERP搴撳瓨鍦板潃")
-    private String erpStkAdr;
+    @ApiModelProperty(value= "鍗曟嵁绫诲瀷")
+    private String type;
 
     /**
-     * 鍚堝悓鏍囪瘑
+     * 涓氬姟绫诲瀷
      */
-    @ApiModelProperty(value= "鍚堝悓鏍囪瘑")
-    private String contractId;
+    @ApiModelProperty(value= "涓氬姟绫诲瀷")
+    private Short wkType;
 
     /**
-     * 閿佸畾鍘熷洜
+     * 搴撳瓨鏁伴噺
      */
-    @ApiModelProperty(value= "閿佸畾鍘熷洜")
-    private String lockReason;
-
-    /**
-     * 閿佸畾鐘舵��
-     */
-    @ApiModelProperty(value= "閿佸畾鐘舵��")
-    private Short lockStatus;
-
-    /**
-     * 閿佸畾浜�
-     */
-    @ApiModelProperty(value= "閿佸畾浜�")
-    private String locker;
-
-    /**
-     * 閿佸畾鏃堕棿
-     */
-    @ApiModelProperty(value= "閿佸畾鏃堕棿")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    private Date lockedTime;
+    @ApiModelProperty(value= "搴撳瓨鏁伴噺")
+    private Double anfme;
 
     /**
      * 鐘舵�� 1: 姝e父  0: 鍐荤粨  
@@ -101,7 +89,6 @@
      * 鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  
      */
     @ApiModelProperty(value= "鏄惁鍒犻櫎 1: 鏄�  0: 鍚�  ")
-    @TableLogic
     private Integer deleted;
 
     /**
@@ -121,6 +108,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;
 
     /**
@@ -134,6 +122,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;
 
     /**
@@ -144,16 +133,13 @@
 
     public Stock() {}
 
-    public Stock(String asnOrder,String erpToken,String erpOrder,String erpStkAdr,String contractId,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
-        this.asnOrder = asnOrder;
-        this.erpToken = erpToken;
-        this.erpOrder = erpOrder;
-        this.erpStkAdr = erpStkAdr;
-        this.contractId = contractId;
-        this.lockReason = lockReason;
-        this.lockStatus = lockStatus;
-        this.locker = locker;
-        this.lockedTime = lockedTime;
+    public Stock(String code,String sourceCode,Long sourceId,String type,Short wkType,Double anfme,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
+        this.code = code;
+        this.sourceCode = sourceCode;
+        this.sourceId = sourceId;
+        this.type = type;
+        this.wkType = wkType;
+        this.anfme = anfme;
         this.status = status;
         this.deleted = deleted;
         this.tenantId = tenantId;
@@ -164,31 +150,36 @@
         this.memo = memo;
     }
 
-//    Stock stock = new Stock(
-//            null,    // ASN鍗曟嵁锛� 甯﹀嚭PO鍗昜闈炵┖]
-//            null,    // ERP鍑瘉
-//            null,    // ERP鍗曞彿
-//            null,    // ERP搴撳瓨鍦板潃
-//            null,    // 鍚堝悓鏍囪瘑
-//            null,    // 閿佸畾鍘熷洜
-//            null,    // 閿佸畾鐘舵�乕闈炵┖]
-//            null,    // 閿佸畾浜�
-//            null,    // 閿佸畾鏃堕棿
-//            null,    // 鐘舵�乕闈炵┖]
-//            null,    // 鏄惁鍒犻櫎[闈炵┖]
-//            null,    // 绉熸埛
-//            null,    // 娣诲姞浜哄憳
-//            null,    // 娣诲姞鏃堕棿[闈炵┖]
-//            null,    // 淇敼浜哄憳
-//            null,    // 淇敼鏃堕棿[闈炵┖]
-//            null    // 澶囨敞
-//    );
 
-    public String getLockedTime$(){
-        if (Cools.isEmpty(this.lockedTime)){
+//    public String getLockedTime$(){
+//        if (Cools.isEmpty(this.lockedTime)){
+//            return "";
+//        }
+//        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime);
+//    }
+
+    public String getType$(){
+        if (Cools.isEmpty(this.type)){
             return "";
         }
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.lockedTime);
+        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
+        DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_ORDER_TYPE).eq(DictData::getValue, this.type));
+        if (Objects.isNull(dictData)) {
+            return null;
+        }
+        return dictData.getLabel();
+    }
+
+    public String getWkType$(){
+        if (Cools.isEmpty(this.wkType)){
+            return "";
+        }
+        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
+        DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_BUSINESS_TYPE).eq(DictData::getValue, this.wkType));
+        if (Objects.isNull(dictData)) {
+            return null;
+        }
+        return dictData.getLabel();
     }
 
     public String getStatus$(){
@@ -233,20 +224,6 @@
             return "";
         }
         return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
-    }
-
-
-
-    public Boolean getStatusBool(){
-        if (null == this.status){ return null; }
-        switch (this.status){
-            case 1:
-                return true;
-            case 0:
-                return false;
-            default:
-                return null;
-        }
     }
 
 }

--
Gitblit v1.9.1