| @@ -201,7 +201,8 @@ open class M18MasterDataService( | |||||
| m18Id = it.id, | m18Id = it.id, | ||||
| m18LastModifyDate = commonUtils.timestampToLocalDateTime(pro.lastModifyDate), | m18LastModifyDate = commonUtils.timestampToLocalDateTime(pro.lastModifyDate), | ||||
| ratioD = it.ratioD, | ratioD = it.ratioD, | ||||
| ratioN = it.ratioN | |||||
| ratioN = it.ratioN, | |||||
| deleted = it.expired | |||||
| ) | ) | ||||
| // logger.info("saved item id: ${savedItem.id}") | // logger.info("saved item id: ${savedItem.id}") | ||||
| @@ -26,11 +26,11 @@ open class M18TokenService( | |||||
| // ) | // ) | ||||
| // | // | ||||
| val params = M18TokenRequest( | val params = M18TokenRequest( | ||||
| grant_type = m18Config.GRANT_TYPE, | |||||
| client_id = m18Config.CLIENT_ID, | |||||
| client_secret = m18Config.CLIENT_SECRET, | |||||
| username = m18Config.USERNAME, | |||||
| password = m18Config.PASSWORD | |||||
| grant_type = m18Config?.GRANT_TYPE ?: "password", | |||||
| client_id = m18Config?.CLIENT_ID ?: "M2Y1OGYxMmQtZDRiOS00OTA4LTgyNTktZDRkNzEzNWVkMzRm", | |||||
| client_secret = m18Config?.CLIENT_SECRET ?: "M2Y2YjQzYzQtZTc2Mi00OTFhLTkwYmItYmJhMzFjZjEyYmY5", | |||||
| username = m18Config?.USERNAME ?:"testingMTMS", | |||||
| password = m18Config?.PASSWORD ?: "db25f2fc14cd2d2b1e7af307241f548fb03c312a" | |||||
| ) | ) | ||||
| apiCallerService | apiCallerService | ||||
| @@ -61,6 +61,21 @@ class M18TestController ( | |||||
| println(response?.uom?.id) | println(response?.uom?.id) | ||||
| return response | return response | ||||
| } | } | ||||
| // --------------------------------------------- Master Data --------------------------------------------- /// | |||||
| @GetMapping("/all") | |||||
| fun m18All() { | |||||
| val mdRequest = M18TestMasterDateRequest() | |||||
| // Master Data | |||||
| m18MasterDataService.saveUnits(mdRequest) | |||||
| m18MasterDataService.saveProducts(mdRequest) | |||||
| m18MasterDataService.saveVendors(mdRequest) | |||||
| m18MasterDataService.saveBusinessUnits(mdRequest) | |||||
| m18MasterDataService.saveCurrencies(mdRequest) | |||||
| m18MasterDataService.saveBoms(mdRequest) | |||||
| val pqRequest = M18TestPqRequest() | |||||
| m18PurchaseQuotationService.savePurchaseQuotations(pqRequest) | |||||
| } | |||||
| // --------------------------------------------- Master Data --------------------------------------------- /// | // --------------------------------------------- Master Data --------------------------------------------- /// | ||||
| @PostMapping("/master-data") | @PostMapping("/master-data") | ||||
| @@ -6,11 +6,11 @@ data class M18TestPoRequest( | |||||
| ) | ) | ||||
| data class M18TestPqRequest( | data class M18TestPqRequest( | ||||
| val modifiedDateFrom: String?, | |||||
| val modifiedDateTo: String?, | |||||
| val modifiedDateFrom: String? = null, | |||||
| val modifiedDateTo: String? = null, | |||||
| ) | ) | ||||
| data class M18TestMasterDateRequest( | data class M18TestMasterDateRequest( | ||||
| val modifiedDateFrom: String?, | |||||
| val modifiedDateTo: String?, | |||||
| val modifiedDateFrom: String? = null, | |||||
| val modifiedDateTo: String? = null, | |||||
| ) | ) | ||||
| @@ -60,6 +60,7 @@ open class ItemUomService( | |||||
| m18LastModifyDate = request.m18LastModifyDate | m18LastModifyDate = request.m18LastModifyDate | ||||
| ratioD = request.ratioD | ratioD = request.ratioD | ||||
| ratioN = request.ratioN | ratioN = request.ratioN | ||||
| deleted = request.deleted | |||||
| } | } | ||||
| val savedItemUom = itemUomRespository.saveAndFlush(itemUom) | val savedItemUom = itemUomRespository.saveAndFlush(itemUom) | ||||
| @@ -26,4 +26,5 @@ data class ItemUomRequest( | |||||
| val m18LastModifyDate: LocalDateTime?, | val m18LastModifyDate: LocalDateTime?, | ||||
| val ratioD: BigDecimal?, | val ratioD: BigDecimal?, | ||||
| val ratioN: BigDecimal?, | val ratioN: BigDecimal?, | ||||
| val deleted: Boolean?, | |||||
| ) | ) | ||||
| @@ -11,11 +11,11 @@ interface InventoryInfo{ | |||||
| val name: String? | val name: String? | ||||
| @get:Value("#{target.item.type}") | @get:Value("#{target.item.type}") | ||||
| val type: String? | val type: String? | ||||
| @get:Value("#{target.qty / (target.item.itemUoms.^[stockUnit == true]?.ratioN / target.item.itemUoms.^[stockUnit == true]?.ratioD)}") | |||||
| @get:Value("#{target.qty / (target.item.itemUoms.^[stockUnit == true && deleted == false]?.ratioN / target.item.itemUoms.^[stockUnit == true && deleted == false]?.ratioD)}") | |||||
| val qty: BigDecimal? | val qty: BigDecimal? | ||||
| @get:Value("#{target.item.itemUoms.^[stockUnit == true]?.uom.code}") | |||||
| @get:Value("#{target.item.itemUoms.^[stockUnit == true && deleted == false]?.uom.code}") | |||||
| val uomCode: String? | val uomCode: String? | ||||
| @get:Value("#{target.item.itemUoms.^[stockUnit == true]?.uom.udfudesc}") | |||||
| @get:Value("#{target.item.itemUoms.^[stockUnit == true && deleted == false]?.uom.udfudesc}") | |||||
| val uomUdfudesc: String? | val uomUdfudesc: String? | ||||
| // @get:Value("#{target.qty * target.uom.gramPerSmallestUnit}") | // @get:Value("#{target.qty * target.uom.gramPerSmallestUnit}") | ||||
| // val germPerSmallestUnit: BigDecimal? | // val germPerSmallestUnit: BigDecimal? | ||||