| @@ -21,7 +21,9 @@ import org.slf4j.Logger | |||||
| import org.slf4j.LoggerFactory | import org.slf4j.LoggerFactory | ||||
| import org.springframework.stereotype.Service | import org.springframework.stereotype.Service | ||||
| import java.time.LocalDateTime | import java.time.LocalDateTime | ||||
| import java.time.format.DateTimeFormatter | |||||
| import kotlin.reflect.full.memberProperties | import kotlin.reflect.full.memberProperties | ||||
| import kotlin.text.substring | |||||
| @Service | @Service | ||||
| open class M18DeliveryOrderService( | open class M18DeliveryOrderService( | ||||
| @@ -54,8 +56,16 @@ open class M18DeliveryOrderService( | |||||
| // Include shop po | // Include shop po | ||||
| open fun getDeliveryOrdersWithType(request: M18CommonRequest): M18PurchaseOrderListResponseWithType? { | open fun getDeliveryOrdersWithType(request: M18CommonRequest): M18PurchaseOrderListResponseWithType? { | ||||
| val deliveryOrders = M18PurchaseOrderListResponseWithType(mutableListOf()) | val deliveryOrders = M18PurchaseOrderListResponseWithType(mutableListOf()) | ||||
| val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") | |||||
| val dateFrom = request.modifiedDateFrom?.let { | |||||
| LocalDateTime.parse(it, formatter).toLocalDate().toString() | |||||
| } | |||||
| val dateTo = request.modifiedDateTo?.let { | |||||
| LocalDateTime.parse(it, formatter).toLocalDate().toString() | |||||
| } | |||||
| val lastModifyDateConds = | val lastModifyDateConds = | ||||
| "lastModifyDate=largerOrEqual=${request.modifiedDateFrom ?: lastModifyDateStart}=and=lastModifyDate=lessOrEqual=${request.modifiedDateTo ?: lastModifyDateEnd}" | |||||
| //"lastModifyDate=largerOrEqual=${request.modifiedDateFrom ?: lastModifyDateStart}=and=lastModifyDate=lessOrEqual=${request.modifiedDateTo ?: lastModifyDateEnd}" | |||||
| "dDate=largerOrEqual=${dateFrom ?: lastModifyDateStart}=and=dDate=lessOrEqual=${dateTo ?: lastModifyDateEnd}" | |||||
| // Shop PO | // Shop PO | ||||
| val shopPoBuyers = commonUtils.listToString(listOf(m18Config.BEID_TOA), "beId=equal=", "=or=") | val shopPoBuyers = commonUtils.listToString(listOf(m18Config.BEID_TOA), "beId=equal=", "=or=") | ||||