| @@ -29,6 +29,7 @@ data class M18PurchaseOrderMainPo ( | |||||
| val curId: Long, | val curId: Long, | ||||
| /** Business Unit (Shop) */ | /** Business Unit (Shop) */ | ||||
| val virDeptId: Long?, | val virDeptId: Long?, | ||||
| val beId: Long?, | |||||
| ) | ) | ||||
| data class M18PurchaseOrderPot ( | data class M18PurchaseOrderPot ( | ||||
| @@ -44,6 +45,8 @@ data class M18PurchaseOrderPot ( | |||||
| // val seriesId: Long?, | // val seriesId: Long?, | ||||
| val qty: BigDecimal, | val qty: BigDecimal, | ||||
| val amt: BigDecimal, | val amt: BigDecimal, | ||||
| val disc: BigDecimal, | |||||
| val lot: String, | |||||
| ) | ) | ||||
| /** Purchase Order List Response */ | /** Purchase Order List Response */ | ||||
| @@ -244,6 +244,7 @@ open class M18PurchaseOrderService( | |||||
| status = PurchaseOrderStatus.PENDING.value, | status = PurchaseOrderStatus.PENDING.value, | ||||
| type = type.value, | type = type.value, | ||||
| m18DataLogId = saveM18PurchaseOrderLog.id, | m18DataLogId = saveM18PurchaseOrderLog.id, | ||||
| m18BeId = mainpo.beId | |||||
| ) | ) | ||||
| val savePurchaseOrderResponse = | val savePurchaseOrderResponse = | ||||
| @@ -345,6 +346,8 @@ open class M18PurchaseOrderService( | |||||
| status = existingPurchaseOrderLine?.status?.value | status = existingPurchaseOrderLine?.status?.value | ||||
| ?: PurchaseOrderLineStatus.PENDING.value, | ?: PurchaseOrderLineStatus.PENDING.value, | ||||
| m18DataLogId = saveM18PurchaseOrderLineLog.id, | m18DataLogId = saveM18PurchaseOrderLineLog.id, | ||||
| m18Discount = line.disc, | |||||
| m18Lot = line.lot | |||||
| ) | ) | ||||
| val savePurchaseOrderLineResponse = | val savePurchaseOrderLineResponse = | ||||
| @@ -15,7 +15,7 @@ open class M18TokenService( | |||||
| private val m18Config: M18Config | private val m18Config: M18Config | ||||
| ) { | ) { | ||||
| // @Bean | |||||
| @Bean | |||||
| fun run() { | fun run() { | ||||
| // val params: MutableMap<String, String> = mutableMapOf( | // val params: MutableMap<String, String> = mutableMapOf( | ||||
| // "grant_type" to m18Config.GRANT_TYPE, | // "grant_type" to m18Config.GRANT_TYPE, | ||||
| @@ -84,7 +84,7 @@ class M18TestController ( | |||||
| m18MasterDataService.saveVendors(request) | m18MasterDataService.saveVendors(request) | ||||
| m18MasterDataService.saveBusinessUnits(request) | m18MasterDataService.saveBusinessUnits(request) | ||||
| m18MasterDataService.saveCurrencies(request) | m18MasterDataService.saveCurrencies(request) | ||||
| m18MasterDataService.saveBoms(request) | |||||
| // m18MasterDataService.saveBoms(request) | |||||
| } | } | ||||
| @PostMapping("/product") | @PostMapping("/product") | ||||
| @@ -56,4 +56,7 @@ open class PurchaseOrder : BaseEntity<Long>() { | |||||
| @ManyToOne | @ManyToOne | ||||
| @JoinColumn(name = "m18DataLogId", nullable = false) | @JoinColumn(name = "m18DataLogId", nullable = false) | ||||
| open var m18DataLog: M18DataLog? = null | open var m18DataLog: M18DataLog? = null | ||||
| @Column(name = "m18BeId") | |||||
| open var m18BeId: Long? = null | |||||
| } | } | ||||
| @@ -50,4 +50,11 @@ open class PurchaseOrderLine : BaseEntity<Long>() { | |||||
| @ManyToOne | @ManyToOne | ||||
| @JoinColumn(name = "uomId", nullable = false) | @JoinColumn(name = "uomId", nullable = false) | ||||
| open var uom: UomConversion? = null | open var uom: UomConversion? = null | ||||
| @Column(name = "m18Discount", precision = 14, scale = 2) | |||||
| open var m18Discount: BigDecimal? = null | |||||
| @Size(max = 20) | |||||
| @Column(name = "m18Lot", length = 20) | |||||
| open var m18Lot: String? = null | |||||
| } | } | ||||
| @@ -60,6 +60,8 @@ open class PurchaseOrderLineService( | |||||
| // this.currency = currency | // this.currency = currency | ||||
| this.status = status | this.status = status | ||||
| this.m18DataLog = m18DataLog ?: this.m18DataLog | this.m18DataLog = m18DataLog ?: this.m18DataLog | ||||
| m18Discount = request.m18Discount | |||||
| m18Lot = request.m18Lot | |||||
| } | } | ||||
| val savedPurchaseOrderLine = purchaseOrderLineRepository.saveAndFlush(purchaseOrderLine).let { | val savedPurchaseOrderLine = purchaseOrderLineRepository.saveAndFlush(purchaseOrderLine).let { | ||||
| @@ -185,6 +185,7 @@ open class PurchaseOrderService( | |||||
| this.status = status | this.status = status | ||||
| this.type = type | this.type = type | ||||
| this.m18DataLog = m18DataLog | this.m18DataLog = m18DataLog | ||||
| m18BeId = request.m18BeId | |||||
| } | } | ||||
| val savedPurchaseOrder = purchaseOrderRepository.saveAndFlush(purchaseOrder).let { | val savedPurchaseOrder = purchaseOrderRepository.saveAndFlush(purchaseOrder).let { | ||||
| @@ -13,4 +13,6 @@ data class SavePurchaseOrderLineRequest( | |||||
| // val m18CurrencyId: Long? = null, | // val m18CurrencyId: Long? = null, | ||||
| val status: String?, | val status: String?, | ||||
| val m18DataLogId: Long?, | val m18DataLogId: Long?, | ||||
| val m18Discount: BigDecimal?, | |||||
| val m18Lot: String?, | |||||
| ) | ) | ||||
| @@ -18,5 +18,6 @@ data class SavePurchaseOrderRequest ( | |||||
| val completeDate: LocalDateTime?, | val completeDate: LocalDateTime?, | ||||
| val status: String?, | val status: String?, | ||||
| val type: String?, | val type: String?, | ||||
| val m18DataLogId: Long? | |||||
| val m18DataLogId: Long?, | |||||
| val m18BeId: Long? | |||||
| ) | ) | ||||
| @@ -0,0 +1,9 @@ | |||||
| -- liquibase formatted sql | |||||
| -- changeset cyril:update_m18po | |||||
| ALTER TABLE `purchase_order` | |||||
| ADD COLUMN `m18BeId` INT NULL AFTER `m18DataLogId`; | |||||
| ALTER TABLE `purchase_order_line` | |||||
| ADD COLUMN `m18Discount` DECIMAL(14,2) NULL AFTER `m18DataLogId`, | |||||
| ADD COLUMN `m18Lot` VARCHAR(20) NULL AFTER `m18Discount`; | |||||