瀏覽代碼

update

create_edit_user
MSI\derek 2 月之前
父節點
當前提交
625da9d8f0
共有 4 個檔案被更改,包括 30 行新增1 行删除
  1. +2
    -0
      src/main/java/com/ffii/fpsms/modules/stock/entity/StockInLineRepository.kt
  2. +4
    -1
      src/main/java/com/ffii/fpsms/modules/stock/service/StockInLineService.kt
  3. +4
    -0
      src/main/java/com/ffii/fpsms/modules/stock/web/StockInLineController.kt
  4. +20
    -0
      src/main/java/com/ffii/fpsms/modules/user/web/AuthorityController.kt

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

@@ -4,6 +4,7 @@ import com.ffii.core.support.AbstractRepository
import com.ffii.fpsms.modules.stock.entity.projection.QrCodeInfo
import com.ffii.fpsms.modules.stock.entity.projection.StockInLineInfo
import org.springframework.stereotype.Repository
import java.util.Optional

@Repository
interface StockInLineRepository : AbstractRepository<StockInLine, Long> {
@@ -12,4 +13,5 @@ interface StockInLineRepository : AbstractRepository<StockInLine, Long> {
fun findStockInLineInfoByIdAndDeletedFalse(id: Long): StockInLineInfo
fun findStockInLineInfoByIdInAndDeletedFalse(id: List<Long>): List<StockInLineInfo>
fun findStockInLineInfoByPurchaseOrderLineIdAndStatusNotAndDeletedFalse(purchaseOrderLineId: Long, status: String): List<StockInLineInfo>
fun findStockInLineInfoByIdAndStatusAndDeletedFalse(id: Long, status: String): Optional<StockInLineInfo>
}

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

@@ -58,6 +58,9 @@ open class StockInLineService(
open fun getStockInLineInfo(stockInLineId: Long): StockInLineInfo {
return stockInLineRepository.findStockInLineInfoByIdAndDeletedFalse(stockInLineId)
}
open fun getReceiveedStockInLineInfo(stockInLineId: Long): StockInLineInfo {
return stockInLineRepository.findStockInLineInfoByIdAndStatusAndDeletedFalse(id = stockInLineId, status = StockInLineStatus.RECEIVED.status).orElseThrow()
}
@Throws(IOException::class)
@Transactional
open fun create(request: SaveStockInLineRequest): MessageResponse {
@@ -299,7 +302,7 @@ open class StockInLineService(
this.inventoryLot = savedInventoryLot ?: stockInLine.inventoryLot
this.lotNo = savedInventoryLot?.lotNo ?: stockInLine.lotNo
this.expiryDate = stockInLine.expiryDate ?: request.expiryDate
this.productLotNo = request.productLotNo
this.productLotNo = stockInLine.productLotNo ?: request.productLotNo
}

val stockInLineEntries = listOf(stockInLine, newStockInLine)


+ 4
- 0
src/main/java/com/ffii/fpsms/modules/stock/web/StockInLineController.kt 查看文件

@@ -27,6 +27,10 @@ class StockInLineController(
fun get(@PathVariable stockInLineId: Long): StockInLineInfo {
return stockInLineService.getStockInLineInfo(stockInLineId)
}
@GetMapping("/received/{stockInLineId}")
fun getReceived(@PathVariable stockInLineId: Long): StockInLineInfo {
return stockInLineService.getStockInLineInfo(stockInLineId)
}
@PostMapping("/create")
fun create(@Valid @RequestBody newItem: SaveStockInLineRequest): MessageResponse {
return stockInLineService.create(newItem)


+ 20
- 0
src/main/java/com/ffii/fpsms/modules/user/web/AuthorityController.kt 查看文件

@@ -0,0 +1,20 @@
package com.ffii.fpsms.modules.user.web

import com.ffii.fpsms.modules.stock.service.StockInLineService
import com.ffii.fpsms.modules.user.service.UserAuthorityService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/auths")
class AuthorityController(
private val userAuthorityService: UserAuthorityService
) {
@GetMapping("/by-user/{userId}")
fun getAuthByUser(@PathVariable userId: Long) {

}

}

Loading…
取消
儲存