| @@ -5,6 +5,7 @@ import com.ffii.fpsms.api.service.ApiCallerService | |||||
| import com.ffii.fpsms.m18.M18Config | import com.ffii.fpsms.m18.M18Config | ||||
| import com.ffii.fpsms.m18.model.* | import com.ffii.fpsms.m18.model.* | ||||
| import com.ffii.fpsms.m18.utils.CommonUtils | import com.ffii.fpsms.m18.utils.CommonUtils | ||||
| import com.ffii.fpsms.m18.web.models.M18TestMasterDateRequest | |||||
| import com.ffii.fpsms.modules.master.entity.UomConversion | import com.ffii.fpsms.modules.master.entity.UomConversion | ||||
| import com.ffii.fpsms.modules.master.enums.ShopType | import com.ffii.fpsms.modules.master.enums.ShopType | ||||
| import com.ffii.fpsms.modules.master.service.* | import com.ffii.fpsms.modules.master.service.* | ||||
| @@ -35,8 +36,8 @@ open class M18MasterDataService( | |||||
| val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") | val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") | ||||
| // M18 Conditions | // M18 Conditions | ||||
| val lastModifyDate = LocalDate.now().minusDays(1) | |||||
| val lastModifyDateConds = "lastModifyDate=largerThan=$lastModifyDate" | |||||
| // val lastModifyDate = LocalDate.now().minusDays(1) | |||||
| // val lastModifyDateConds = "lastModifyDate=largerThan=$lastModifyDate" | |||||
| val seriesIdList = | val seriesIdList = | ||||
| listOf(m18Config.SERIESID_SC, m18Config.SERIESID_SE, m18Config.SERIESID_SF, m18Config.SERIESID_SR) | listOf(m18Config.SERIESID_SC, m18Config.SERIESID_SE, m18Config.SERIESID_SF, m18Config.SERIESID_SR) | ||||
| val seriesIdConds = | val seriesIdConds = | ||||
| @@ -61,11 +62,21 @@ open class M18MasterDataService( | |||||
| stSearch: String?, | stSearch: String?, | ||||
| params: String? = null, | params: String? = null, | ||||
| conds: String? = null, | conds: String? = null, | ||||
| request: M18TestMasterDateRequest, | |||||
| ): T? { | ): T? { | ||||
| val lastModifyDateFromConds = request.modifiedDateFrom?.let { "lastModifyDate=largerOrEqual=${it}" } | |||||
| val lastModifyDateToConds = request.modifiedDateTo?.let{ "lastModifyDate=lessOrEqual=${it}" } | |||||
| val haveFromAndTo = lastModifyDateFromConds != null && lastModifyDateToConds != null | |||||
| val finalConds = if (lastModifyDateFromConds == null && lastModifyDateToConds == null) { | |||||
| conds | |||||
| } else { | |||||
| conds + "=and=(${lastModifyDateFromConds ?: ""}${if(haveFromAndTo) "=and=" else ""}${lastModifyDateToConds ?: ""})" | |||||
| } | |||||
| val request = M18CommonListRequest( | val request = M18CommonListRequest( | ||||
| stSearch = stSearch, | stSearch = stSearch, | ||||
| params = params, | params = params, | ||||
| conds = conds | |||||
| conds = finalConds | |||||
| ) | ) | ||||
| val response = apiCallerService.get<T, M18CommonListRequest>( | val response = apiCallerService.get<T, M18CommonListRequest>( | ||||
| @@ -95,12 +106,13 @@ open class M18MasterDataService( | |||||
| } | } | ||||
| // --------------------------------------------- Product --------------------------------------------- /// | // --------------------------------------------- Product --------------------------------------------- /// | ||||
| open fun getProducts(): M18ProductListResponse? { | |||||
| open fun getProducts(request: M18TestMasterDateRequest): M18ProductListResponse? { | |||||
| // seems no beId | // seems no beId | ||||
| return getList<M18ProductListResponse>( | return getList<M18ProductListResponse>( | ||||
| stSearch = StSearchType.PRODUCT.value, | stSearch = StSearchType.PRODUCT.value, | ||||
| params = null, | params = null, | ||||
| conds = seriesIdConds | |||||
| conds = seriesIdConds, | |||||
| request = request | |||||
| ) | ) | ||||
| // val itemsParams = M18CommonListRequest( | // val itemsParams = M18CommonListRequest( | ||||
| // stSearch = StSearchType.PRODUCT.value, | // stSearch = StSearchType.PRODUCT.value, | ||||
| @@ -125,9 +137,9 @@ open class M18MasterDataService( | |||||
| ) | ) | ||||
| } | } | ||||
| open fun saveProducts() { | |||||
| open fun saveProducts(request: M18TestMasterDateRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Products / Materials--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Products / Materials--------------------------------------------") | ||||
| val items = getProducts() | |||||
| val items = getProducts(request) | |||||
| val exampleProducts = listOf<Long>(10946L, 3825L) | val exampleProducts = listOf<Long>(10946L, 3825L) | ||||
| val successList = mutableListOf<Long>() | val successList = mutableListOf<Long>() | ||||
| @@ -222,11 +234,12 @@ open class M18MasterDataService( | |||||
| } | } | ||||
| // --------------------------------------------- Vendor --------------------------------------------- /// | // --------------------------------------------- Vendor --------------------------------------------- /// | ||||
| open fun getVendors(): M18VendorListResponse? { | |||||
| open fun getVendors(request: M18TestMasterDateRequest): M18VendorListResponse? { | |||||
| return getList<M18VendorListResponse>( | return getList<M18VendorListResponse>( | ||||
| stSearch = StSearchType.VENDOR.value, | stSearch = StSearchType.VENDOR.value, | ||||
| params = null, | params = null, | ||||
| conds = beIdConds | |||||
| conds = beIdConds, | |||||
| request = request | |||||
| ) | ) | ||||
| } | } | ||||
| @@ -239,9 +252,9 @@ open class M18MasterDataService( | |||||
| ) | ) | ||||
| } | } | ||||
| open fun saveVendors() { | |||||
| open fun saveVendors(request: M18TestMasterDateRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Vendors--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Vendors--------------------------------------------") | ||||
| val vendors = getVendors() | |||||
| val vendors = getVendors(request) | |||||
| val exampleVendors = listOf<Long>(191L) | val exampleVendors = listOf<Long>(191L) | ||||
| val successList = mutableListOf<Long>() | val successList = mutableListOf<Long>() | ||||
| @@ -304,12 +317,13 @@ open class M18MasterDataService( | |||||
| } | } | ||||
| // --------------------------------------------- Unit (UoM) --------------------------------------------- /// | // --------------------------------------------- Unit (UoM) --------------------------------------------- /// | ||||
| open fun getUnits(): M18UnitListResponse? { | |||||
| open fun getUnits(request: M18TestMasterDateRequest): M18UnitListResponse? { | |||||
| // seems no beId | // seems no beId | ||||
| return getList<M18UnitListResponse>( | return getList<M18UnitListResponse>( | ||||
| stSearch = StSearchType.UNIT.value, | stSearch = StSearchType.UNIT.value, | ||||
| params = null, | params = null, | ||||
| conds = null | |||||
| conds = null, | |||||
| request = request | |||||
| ) | ) | ||||
| } | } | ||||
| @@ -322,9 +336,9 @@ open class M18MasterDataService( | |||||
| ) | ) | ||||
| } | } | ||||
| open fun saveUnits() { | |||||
| open fun saveUnits(request: M18TestMasterDateRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Units--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Units--------------------------------------------") | ||||
| val units = getUnits() | |||||
| val units = getUnits(request) | |||||
| val successTransformList = mutableListOf<Long>() | val successTransformList = mutableListOf<Long>() | ||||
| val successSaveList = mutableListOf<Long>() | val successSaveList = mutableListOf<Long>() | ||||
| @@ -387,11 +401,12 @@ open class M18MasterDataService( | |||||
| } | } | ||||
| // --------------------------------------------- Currency --------------------------------------------- /// | // --------------------------------------------- Currency --------------------------------------------- /// | ||||
| open fun getCurrencies(): M18CurrencyListResponse? { | |||||
| open fun getCurrencies(request: M18TestMasterDateRequest): M18CurrencyListResponse? { | |||||
| return getList<M18CurrencyListResponse>( | return getList<M18CurrencyListResponse>( | ||||
| stSearch = StSearchType.CURRENCY.value, | stSearch = StSearchType.CURRENCY.value, | ||||
| params = null, | params = null, | ||||
| conds = null | |||||
| conds = null, | |||||
| request = request | |||||
| ) | ) | ||||
| } | } | ||||
| @@ -404,9 +419,9 @@ open class M18MasterDataService( | |||||
| ) | ) | ||||
| } | } | ||||
| open fun saveCurrencies() { | |||||
| open fun saveCurrencies(request: M18TestMasterDateRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Currencies--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Currencies--------------------------------------------") | ||||
| val currencies = getCurrencies() | |||||
| val currencies = getCurrencies(request) | |||||
| val successList = mutableListOf<Long>() | val successList = mutableListOf<Long>() | ||||
| val failList = mutableListOf<Long>() | val failList = mutableListOf<Long>() | ||||
| @@ -449,11 +464,12 @@ open class M18MasterDataService( | |||||
| } | } | ||||
| // --------------------------------------------- Bom --------------------------------------------- /// | // --------------------------------------------- Bom --------------------------------------------- /// | ||||
| open fun getBoms(): M18BomListResponse? { | |||||
| open fun getBoms(request: M18TestMasterDateRequest): M18BomListResponse? { | |||||
| return getList<M18BomListResponse>( | return getList<M18BomListResponse>( | ||||
| stSearch = StSearchType.BOM.value, | stSearch = StSearchType.BOM.value, | ||||
| params = null, | params = null, | ||||
| conds = beIdConds | |||||
| conds = beIdConds, | |||||
| request = request | |||||
| ) | ) | ||||
| } | } | ||||
| @@ -466,9 +482,9 @@ open class M18MasterDataService( | |||||
| ) | ) | ||||
| } | } | ||||
| open fun saveBoms() { | |||||
| open fun saveBoms(request: M18TestMasterDateRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Boms--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Boms--------------------------------------------") | ||||
| val boms = getBoms() | |||||
| val boms = getBoms(request) | |||||
| val successList = mutableListOf<Long>() | val successList = mutableListOf<Long>() | ||||
| val successDetailList = mutableListOf<Long>() | val successDetailList = mutableListOf<Long>() | ||||
| @@ -561,12 +577,13 @@ open class M18MasterDataService( | |||||
| } | } | ||||
| // --------------------------------------------- Business Unit (Shop) --------------------------------------------- /// | // --------------------------------------------- Business Unit (Shop) --------------------------------------------- /// | ||||
| open fun getBusinessUnits(): M18BusinessUnitListResponse? { | |||||
| open fun getBusinessUnits(request: M18TestMasterDateRequest): M18BusinessUnitListResponse? { | |||||
| // seems no beId | // seems no beId | ||||
| return getList<M18BusinessUnitListResponse>( | return getList<M18BusinessUnitListResponse>( | ||||
| stSearch = StSearchType.BUSINESS_UNIT.value, | stSearch = StSearchType.BUSINESS_UNIT.value, | ||||
| params = null, | params = null, | ||||
| // conds = beIdConds | // conds = beIdConds | ||||
| request = request | |||||
| ) | ) | ||||
| } | } | ||||
| @@ -579,9 +596,9 @@ open class M18MasterDataService( | |||||
| ) | ) | ||||
| } | } | ||||
| open fun saveBusinessUnits() { | |||||
| open fun saveBusinessUnits(request: M18TestMasterDateRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Business Units (Shops)--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Business Units (Shops)--------------------------------------------") | ||||
| val businessUnits = getBusinessUnits() | |||||
| val businessUnits = getBusinessUnits(request) | |||||
| val successList = mutableListOf<Long>() | val successList = mutableListOf<Long>() | ||||
| val failList = mutableListOf<Long>() | val failList = mutableListOf<Long>() | ||||
| @@ -53,7 +53,7 @@ open class M18PurchaseOrderService( | |||||
| open fun getPurchaseOrdersWithType(request: M18TestPoRequest): M18PurchaseOrderListResponseWithType? { | open fun getPurchaseOrdersWithType(request: M18TestPoRequest): M18PurchaseOrderListResponseWithType? { | ||||
| val purchaseOrders = M18PurchaseOrderListResponseWithType(mutableListOf()) | val purchaseOrders = M18PurchaseOrderListResponseWithType(mutableListOf()) | ||||
| val lastModifyDateConds = | val lastModifyDateConds = | ||||
| "lastModifyDate=largerOrEqual=${request.dateFrom ?: lastModifyDateStart}=and=lastModifyDate=lessOrEqual=${request.dateTo ?: lastModifyDateEnd}" | |||||
| "lastModifyDate=largerOrEqual=${request.modifiedDateFrom ?: lastModifyDateStart}=and=lastModifyDate=lessOrEqual=${request.modifiedDateTo ?: lastModifyDateEnd}" | |||||
| // Material PO | // Material PO | ||||
| val materialPoBuyers = | val materialPoBuyers = | ||||
| commonUtils.listToString(listOf(m18Config.BEID_PP, m18Config.BEID_PF), "beId=equal=", "=or=") | commonUtils.listToString(listOf(m18Config.BEID_PP, m18Config.BEID_PF), "beId=equal=", "=or=") | ||||
| @@ -8,6 +8,7 @@ import com.ffii.fpsms.m18.model.M18PurchaseQuotationListResponse | |||||
| import com.ffii.fpsms.m18.model.M18PurchaseQuotationRequest | import com.ffii.fpsms.m18.model.M18PurchaseQuotationRequest | ||||
| import com.ffii.fpsms.m18.model.M18PurchaseQuotationResponse | import com.ffii.fpsms.m18.model.M18PurchaseQuotationResponse | ||||
| import com.ffii.fpsms.m18.utils.CommonUtils | import com.ffii.fpsms.m18.utils.CommonUtils | ||||
| import com.ffii.fpsms.m18.web.models.M18TestPqRequest | |||||
| import com.ffii.fpsms.modules.master.service.ItemUomService | import com.ffii.fpsms.modules.master.service.ItemUomService | ||||
| import com.ffii.fpsms.modules.master.service.ItemsService | import com.ffii.fpsms.modules.master.service.ItemsService | ||||
| import com.ffii.fpsms.modules.purchaseQuotation.service.PurchaseQuotationLineService | import com.ffii.fpsms.modules.purchaseQuotation.service.PurchaseQuotationLineService | ||||
| @@ -30,10 +31,10 @@ open class M18PurchaseQuotationService( | |||||
| val commonUtils = CommonUtils() | val commonUtils = CommonUtils() | ||||
| val logger: Logger = LoggerFactory.getLogger(JwtTokenUtil::class.java) | val logger: Logger = LoggerFactory.getLogger(JwtTokenUtil::class.java) | ||||
| val lastModifyDateStart = "2025-05-14 14:00:00" | |||||
| val lastModifyDateEnd = "2025-05-14 14:30:00" | |||||
| val lastModifyDateConds = | |||||
| "lastModifyDate=largerOrEqual=${lastModifyDateStart}=and=lastModifyDate=lessOrEqual=${lastModifyDateEnd}" | |||||
| // val lastModifyDateStart = "2025-05-14 14:00:00" | |||||
| // val lastModifyDateEnd = "2025-05-14 14:30:00" | |||||
| // val lastModifyDateConds = | |||||
| // "lastModifyDate=largerOrEqual=${lastModifyDateStart}=and=lastModifyDate=lessOrEqual=${lastModifyDateEnd}" | |||||
| // M18 Conditions | // M18 Conditions | ||||
| val beIdList = listOf(m18Config.BEID_PF, m18Config.BEID_PP, m18Config.BEID_TOA) | val beIdList = listOf(m18Config.BEID_PF, m18Config.BEID_PP, m18Config.BEID_TOA) | ||||
| @@ -43,9 +44,18 @@ open class M18PurchaseQuotationService( | |||||
| val M18_LOAD_PURCHASE_QUOTATION_API = "/root/api/read/vqu" | val M18_LOAD_PURCHASE_QUOTATION_API = "/root/api/read/vqu" | ||||
| val M18_FETCH_PURCHASE_QUOTATION_LIST_API = "/search/search" | val M18_FETCH_PURCHASE_QUOTATION_LIST_API = "/search/search" | ||||
| open fun getPurchaseQuotations(): M18PurchaseQuotationListResponse? { | |||||
| open fun getPurchaseQuotations(request: M18TestPqRequest): M18PurchaseQuotationListResponse? { | |||||
| val lastModifyDateFromConds = request.modifiedDateFrom?.let { "lastModifyDate=largerOrEqual=${it}" } | |||||
| val lastModifyDateToConds = request.modifiedDateTo?.let{ "lastModifyDate=lessOrEqual=${it}" } | |||||
| val haveFromAndTo = lastModifyDateFromConds != null && lastModifyDateToConds != null | |||||
| val finalConds = if (lastModifyDateFromConds == null && lastModifyDateToConds == null) { | |||||
| beIdConds | |||||
| } else { | |||||
| beIdConds + "=and=(${lastModifyDateFromConds ?: ""}${if(haveFromAndTo) "=and=" else ""}${lastModifyDateToConds ?: ""})" | |||||
| } | |||||
| val params = M18PurchaseQuotationListRequest( | val params = M18PurchaseQuotationListRequest( | ||||
| conds = beIdConds | |||||
| conds = finalConds | |||||
| ) | ) | ||||
| var purchaseQuotations: M18PurchaseQuotationListResponse? = null | var purchaseQuotations: M18PurchaseQuotationListResponse? = null | ||||
| @@ -84,9 +94,9 @@ open class M18PurchaseQuotationService( | |||||
| return purchaseQuotation | return purchaseQuotation | ||||
| } | } | ||||
| open fun savePurchaseQuotations() { | |||||
| open fun savePurchaseQuotations(request: M18TestPqRequest) { | |||||
| logger.info("--------------------------------------------Start - Saving M18 Purchase Quotations--------------------------------------------") | logger.info("--------------------------------------------Start - Saving M18 Purchase Quotations--------------------------------------------") | ||||
| val purchaseQuotations = getPurchaseQuotations() | |||||
| val purchaseQuotations = getPurchaseQuotations(request) | |||||
| val pqRefType = "Purchase Quotation" | val pqRefType = "Purchase Quotation" | ||||
| val pqLineRefType = "Purchase Quotation Line" | val pqLineRefType = "Purchase Quotation Line" | ||||
| @@ -17,10 +17,19 @@ open class CommonUtils( | |||||
| return localDateTime | return localDateTime | ||||
| } | } | ||||
| @JvmName("listToStringForLongs") | |||||
| fun listToString(numbers: List<Long>?, prefix: String, delimiter: String): String { | fun listToString(numbers: List<Long>?, prefix: String, delimiter: String): String { | ||||
| if (numbers == null) { | if (numbers == null) { | ||||
| return "" | return "" | ||||
| } | } | ||||
| return numbers.joinToString(delimiter) { "$prefix$it" } | return numbers.joinToString(delimiter) { "$prefix$it" } | ||||
| } | } | ||||
| @JvmName("listToStringForStrings") | |||||
| fun listToString(strings: List<String>?, prefix: String, delimiter: String): String { | |||||
| if (strings == null) { | |||||
| return "" | |||||
| } | |||||
| return strings.joinToString(delimiter) { "$prefix$it" } | |||||
| } | |||||
| } | } | ||||
| @@ -5,7 +5,9 @@ import com.ffii.fpsms.m18.M18Config | |||||
| import com.ffii.fpsms.m18.service.M18MasterDataService | import com.ffii.fpsms.m18.service.M18MasterDataService | ||||
| import com.ffii.fpsms.m18.service.M18PurchaseOrderService | import com.ffii.fpsms.m18.service.M18PurchaseOrderService | ||||
| import com.ffii.fpsms.m18.service.M18PurchaseQuotationService | import com.ffii.fpsms.m18.service.M18PurchaseQuotationService | ||||
| import com.ffii.fpsms.m18.web.models.M18TestMasterDateRequest | |||||
| import com.ffii.fpsms.m18.web.models.M18TestPoRequest | import com.ffii.fpsms.m18.web.models.M18TestPoRequest | ||||
| import com.ffii.fpsms.m18.web.models.M18TestPqRequest | |||||
| import com.ffii.fpsms.modules.master.entity.ItemUom | import com.ffii.fpsms.modules.master.entity.ItemUom | ||||
| import com.ffii.fpsms.modules.master.entity.Items | import com.ffii.fpsms.modules.master.entity.Items | ||||
| import com.ffii.fpsms.modules.master.entity.ShopRepository | import com.ffii.fpsms.modules.master.entity.ShopRepository | ||||
| @@ -61,51 +63,51 @@ class M18TestController ( | |||||
| } | } | ||||
| // --------------------------------------------- Master Data --------------------------------------------- /// | // --------------------------------------------- Master Data --------------------------------------------- /// | ||||
| @GetMapping("/master-data") | |||||
| fun m18MasterData() { | |||||
| @PostMapping("/master-data") | |||||
| fun m18MasterData(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| // Master Data | // Master Data | ||||
| m18MasterDataService.saveUnits() | |||||
| m18MasterDataService.saveProducts() | |||||
| m18MasterDataService.saveVendors() | |||||
| m18MasterDataService.saveBusinessUnits() | |||||
| m18MasterDataService.saveCurrencies() | |||||
| m18MasterDataService.saveBoms() | |||||
| m18MasterDataService.saveUnits(request) | |||||
| m18MasterDataService.saveProducts(request) | |||||
| m18MasterDataService.saveVendors(request) | |||||
| m18MasterDataService.saveBusinessUnits(request) | |||||
| m18MasterDataService.saveCurrencies(request) | |||||
| m18MasterDataService.saveBoms(request) | |||||
| } | } | ||||
| @GetMapping("/product") | |||||
| fun m18Products() { | |||||
| @PostMapping("/product") | |||||
| fun m18Products(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18MasterDataService.saveProducts() | |||||
| m18MasterDataService.saveProducts(request) | |||||
| } | } | ||||
| @GetMapping("/vendor") | |||||
| fun m18Vendor() { | |||||
| @PostMapping("/vendor") | |||||
| fun m18Vendor(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18MasterDataService.saveVendors() | |||||
| m18MasterDataService.saveVendors(request) | |||||
| } | } | ||||
| @GetMapping("/unit") | |||||
| fun m18Unit() { | |||||
| @PostMapping("/unit") | |||||
| fun m18Unit(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18MasterDataService.saveUnits() | |||||
| m18MasterDataService.saveUnits(request) | |||||
| } | } | ||||
| @GetMapping("/currency") | |||||
| fun m18Currency() { | |||||
| @PostMapping("/currency") | |||||
| fun m18Currency(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18MasterDataService.saveCurrencies() | |||||
| m18MasterDataService.saveCurrencies(request) | |||||
| } | } | ||||
| @GetMapping("/bom") | |||||
| fun m18Bom() { | |||||
| @PostMapping("/bom") | |||||
| fun m18Bom(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18MasterDataService.saveBoms() | |||||
| m18MasterDataService.saveBoms(request) | |||||
| } | } | ||||
| @GetMapping("/businessUnit") | |||||
| fun m18BusinessUnit() { | |||||
| @PostMapping("/businessUnit") | |||||
| fun m18BusinessUnit(@Valid @RequestBody request: M18TestMasterDateRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18MasterDataService.saveBusinessUnits() | |||||
| m18MasterDataService.saveBusinessUnits(request) | |||||
| } | } | ||||
| // --------------------------------------------- Purchase Order --------------------------------------------- /// | // --------------------------------------------- Purchase Order --------------------------------------------- /// | ||||
| @@ -116,9 +118,9 @@ class M18TestController ( | |||||
| } | } | ||||
| // --------------------------------------------- Purchase Quotation --------------------------------------------- /// | // --------------------------------------------- Purchase Quotation --------------------------------------------- /// | ||||
| @GetMapping("/pq") | |||||
| fun m18PQ() { | |||||
| @PostMapping("/pq") | |||||
| fun m18PQ(@Valid @RequestBody request: M18TestPqRequest) { | |||||
| logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | logger.info("Access token: ${m18Config.ACCESS_TOKEN}") | ||||
| m18PurchaseQuotationService.savePurchaseQuotations() | |||||
| m18PurchaseQuotationService.savePurchaseQuotations(request) | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,16 @@ | |||||
| package com.ffii.fpsms.m18.web.models | package com.ffii.fpsms.m18.web.models | ||||
| data class M18TestPoRequest( | data class M18TestPoRequest( | ||||
| val dateFrom: String?, | |||||
| val dateTo: String?, | |||||
| val modifiedDateFrom: String?, | |||||
| val modifiedDateTo: String?, | |||||
| ) | |||||
| data class M18TestPqRequest( | |||||
| val modifiedDateFrom: String?, | |||||
| val modifiedDateTo: String?, | |||||
| ) | |||||
| data class M18TestMasterDateRequest( | |||||
| val modifiedDateFrom: String?, | |||||
| val modifiedDateTo: String?, | |||||
| ) | ) | ||||