|
|
|
@ -124,6 +124,12 @@ public class CM_RentOneWay_InService : CMServiceBase, ICM_RentOneWay_InService
|
|
|
|
|
item.Pid = entity.Id;
|
|
|
|
|
item.RentDirectId = CMRentDirectEnum.租入;
|
|
|
|
|
item.RentTypeId = CMRentTypeEnum.单程;
|
|
|
|
|
|
|
|
|
|
if (item.OldContainerOwnerId == null|| item.OldContainerOwnerId == 0) {
|
|
|
|
|
item.OldContainerOwnerId = data.OldContainerOwnerId;
|
|
|
|
|
item.OldContainerOwner = data.OldContainerOwner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var newdetail = item.Adapt<CM_RentOneWay_Detail>();
|
|
|
|
|
await tenantDb.Insertable(newdetail).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
@ -153,12 +159,22 @@ public class CM_RentOneWay_InService : CMServiceBase, ICM_RentOneWay_InService
|
|
|
|
|
item.Pid = info.Id;
|
|
|
|
|
item.RentDirectId = CMRentDirectEnum.租入;
|
|
|
|
|
item.RentTypeId = CMRentTypeEnum.单程;
|
|
|
|
|
if (item.OldContainerOwnerId == null || item.OldContainerOwnerId == 0)
|
|
|
|
|
{
|
|
|
|
|
item.OldContainerOwnerId = info.OldContainerOwnerId;
|
|
|
|
|
item.OldContainerOwner = info.OldContainerOwner;
|
|
|
|
|
}
|
|
|
|
|
var newdetail = item.Adapt<CM_RentOneWay_Detail>();
|
|
|
|
|
await tenantDb.Insertable(newdetail).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var updrec = _BodyList.First(x => x.Id == item.Id);
|
|
|
|
|
if (item.OldContainerOwnerId == null || item.OldContainerOwnerId == 0)
|
|
|
|
|
{
|
|
|
|
|
item.OldContainerOwnerId = info.OldContainerOwnerId;
|
|
|
|
|
item.OldContainerOwner = info.OldContainerOwner;
|
|
|
|
|
}
|
|
|
|
|
updrec = item.Adapt(updrec);
|
|
|
|
|
await tenantDb.Updateable(updrec).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|