瀏覽代碼

update

master
MSI\derek 2 月之前
父節點
當前提交
05dc2a611f
共有 3 個檔案被更改,包括 14 行新增1 行删除
  1. +5
    -1
      src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLine.kt
  2. +2
    -0
      src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt
  3. +7
    -0
      src/main/resources/db/changelog/changes/20250620_01_derek/01_add_lot_line_id_to_stock_in_line.sql

+ 5
- 1
src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLine.kt 查看文件

@@ -69,10 +69,14 @@ open class StockInLine : BaseEntity<Long>() {
@JoinColumn(name = "userId")
open var user: User? = null

@OneToOne
@ManyToOne
@JoinColumn(name = "inventoryLotId")
open var inventoryLot: InventoryLot? = null

@OneToOne
@JoinColumn(name = "inventoryLotLineId")
open var inventoryLotLine: InventoryLotLine? = null

@Column(name = "lotNo")
open var lotNo: String? = null



+ 2
- 0
src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt 查看文件

@@ -251,6 +251,7 @@ open class StockInLineService(
this.status = request.status
this.expiryDate = stockInLine.expiryDate ?: request.expiryDate
this.inventoryLot = stockInLine.inventoryLot ?: savedInventoryLot
this.inventoryLotLine = savedInventoryLotLine
this.lotNo = stockInLine.lotNo ?: savedInventoryLot?.lotNo
}
val savedStockInLine = saveAndFlush(stockInLine)
@@ -320,6 +321,7 @@ open class StockInLineService(
this.acceptedQty = request.acceptedQty
this.status = request.status
this.inventoryLot = savedInventoryLot ?: stockInLine.inventoryLot
this.inventoryLotLine = savedInventoryLotLine
this.lotNo = savedInventoryLot?.lotNo ?: stockInLine.lotNo
this.expiryDate = stockInLine.expiryDate ?: request.expiryDate
this.productLotNo = stockInLine.productLotNo ?: request.productLotNo


+ 7
- 0
src/main/resources/db/changelog/changes/20250620_01_derek/01_add_lot_line_id_to_stock_in_line.sql 查看文件

@@ -0,0 +1,7 @@
-- liquibase formatted sql
-- changeset derek:add_lot_line_id_to_stock_in_line

ALTER TABLE `stock_in_line`
ADD COLUMN `inventoryLotLineId` INT(11) NULL AFTER `inventoryLotId`,
ADD CONSTRAINT FK_STOCK_IN_LINE_ON_LOT_LINE_ID FOREIGN KEY (inventoryLotLineId) REFERENCES inventory_lot_line (id)
;

Loading…
取消
儲存