1
This commit is contained in:
@@ -42,7 +42,7 @@ func LoadingLogistics(paramLogistic []*model.UpdateMaterialLogistic) []error {
|
||||
goodsOrderStatus := 0
|
||||
for _, v := range logisticsList.Info[0].LogisticsTraceDetailList {
|
||||
orderStatusToLocal := &model.OrderStatus{
|
||||
VendorOrderID: logisticsList.OrderNo,
|
||||
VendorOrderID: logisticsList.Info[0].MailNo,
|
||||
VendorID: model.VendorIDTotalWl,
|
||||
OrderType: model.OrderTypeWaybill,
|
||||
RefVendorOrderID: logistics.OrderId,
|
||||
@@ -108,20 +108,21 @@ func LoadingLogistics(paramLogistic []*model.UpdateMaterialLogistic) []error {
|
||||
statusTime := orderStatus[len(orderStatus)-1].StatusTime
|
||||
if len(wayBill) == 0 || wayBill == nil {
|
||||
wayBillObj := &model.Waybill{
|
||||
VendorWaybillID: logistics.LogisticId,
|
||||
WaybillVendorID: model.VendorIDTotalWl,
|
||||
VendorOrderID: logistics.OrderId,
|
||||
OrderVendorID: model.VendorIDJX,
|
||||
CourierName: logisticsList.Info[0].Courier,
|
||||
CourierMobile: logisticsList.Info[0].CourierPhone,
|
||||
Status: status,
|
||||
VendorStatus: vendorStatus,
|
||||
ActualFee: logistics.LogisticFee,
|
||||
DesiredFee: logistics.LogisticFee,
|
||||
DeliveryFlag: model.OrderDeliveryFlagMaskScheduleDisabled,
|
||||
WaybillCreatedAt: time.Now(),
|
||||
StatusTime: statusTime,
|
||||
ModelTimeInfo: model.ModelTimeInfo{CreatedAt: time.Now(), UpdatedAt: time.Now()},
|
||||
VendorWaybillID: logistics.LogisticId,
|
||||
WaybillVendorID: model.VendorIDTotalWl,
|
||||
VendorOrderID: logistics.OrderId,
|
||||
OrderVendorID: model.VendorIDJX,
|
||||
CourierName: logisticsList.Info[0].Courier,
|
||||
CourierMobile: logisticsList.Info[0].CourierPhone,
|
||||
Status: status,
|
||||
VendorStatus: vendorStatus,
|
||||
ActualFee: logistics.LogisticFee,
|
||||
DesiredFee: logistics.LogisticFee,
|
||||
DeliveryFlag: model.OrderDeliveryFlagMaskScheduleDisabled,
|
||||
WaybillCreatedAt: time.Now(),
|
||||
StatusTime: statusTime,
|
||||
ModelTimeInfo: model.ModelTimeInfo{CreatedAt: time.Now(), UpdatedAt: time.Now()},
|
||||
WaybillFinishedAt: time.Now(),
|
||||
}
|
||||
if err := dao.CreateEntity(db, wayBillObj); err != nil {
|
||||
errList = append(errList, err)
|
||||
@@ -132,6 +133,7 @@ func LoadingLogistics(paramLogistic []*model.UpdateMaterialLogistic) []error {
|
||||
wayBill[0].Status = status
|
||||
wayBill[0].VendorStatus = vendorStatus
|
||||
wayBill[0].StatusTime = statusTime
|
||||
wayBill[0].WaybillFinishedAt = time.Now()
|
||||
if _, err := dao.UpdateEntity(db, wayBill[0], "Status", "UpdatedAt", "VendorStatus", "StatusTime"); err != nil {
|
||||
errList = append(errList, err)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user