/
DeliveredOrder Cron
DeliveredOrder Cron
Steps:
Fetch CreateOrder Service Response having current status as dispatched
Query:
SELECT
orders.customerOrderNumber,
SUBSTRING_INDEX(GROUP_CONCAT(shipment_status_logs.status
ORDER BY
shipment_status_logs.id DESC),
',',
1) AS latestStatus,
orders.channel_id,
shipments.id,
shipments.externalShipmentID
FROM
orders
LEFT JOIN
shipments
ON shipments.order_id = orders.id
LEFT JOIN
shipment_status_logs
ON shipment_status_logs.shipment_id = shipments.id
WHERE
orders.created_at >=(
CURDATE()-INTERVAL 1 MONTH
)
AND orders.channel_id IN (
?, ?
)
GROUP BY
orders.id
HAVING
latestStatus='dispatched'
if OrderItems contains delivered items make an entry in ShipmentStatusLogs
table
ShipmentStatusLogs ss = new ShipmentStatusLogs();
ss.setShipment_id(shipmentId);
ss.setStatus("delivered");
Date d= LocalDateTime.now().toDate();
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.HOUR,5);
cal.add(Calendar.MINUTE, 30);
ss.setExternal_updated_at(d);
ss.setIsForwardTransaction("0");
ss.setRemarks("delivered");
ss.setTrack_payload("delivered");
session.saveOrUpdate(ss);
, multiple selections available,
Related content
Create a POC for delivery delayed tag cron.
Create a POC for delivery delayed tag cron.
More like this
Shipment status update Cron on shopify
Shipment status update Cron on shopify
More like this
Cron implementation for RTS Delayed Reason
Cron implementation for RTS Delayed Reason
More like this
Revised cron logic for Status Mismatch bugs
Revised cron logic for Status Mismatch bugs
More like this
Cron for Old Data Expected Return Pickup Date
Cron for Old Data Expected Return Pickup Date
More like this