dev
dengyu 1 month ago
parent 449baf2dfd
commit 1492a754e3

@ -15,10 +15,17 @@ public class VW_CM_RentOneWay_NeedRent : BaseOrgModelV2<long>
{
/// <summary>
/// 箱当前状态id
/// 单程租入业务明细id
/// </summary>
[SugarColumn(ColumnDescription = "箱当前状态id", IsNullable = false)]
public long Id { get; set; }
[SugarColumn(ColumnDescription = "单程租入业务明细id", IsNullable = false)]
public long Pid { get; set; }
/// <summary>
/// Desc:租箱业务号
/// </summary>
[SugarColumn(ColumnDescription = "租箱业务号", IsNullable = false, Length = 20)]
public string Billno { get; set; }
/// <summary>
/// Desc:箱号
/// </summary>
@ -36,62 +43,147 @@ public class VW_CM_RentOneWay_NeedRent : BaseOrgModelV2<long>
public string Ctnall { get; set; }
/// <summary>
/// Desc:箱主Id
/// Desc:箱主Id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "箱主Id", IsNullable = false, DefaultValue = "0")]
public long CtnOwnerId { get; set; }
[SqlSugar.SugarColumn(ColumnDescription = "原箱主Id", IsNullable = true, DefaultValue = "0")]
public long? OldContainerOwnerId { get; set; }
/// <summary>
/// Desc:箱主
/// Desc:箱主
/// </summary>
[SugarColumn(ColumnDescription = "箱主", IsNullable = true, Length = 50)]
public string CtnOwner { get; set; }
[SugarColumn(ColumnDescription = "原箱主", IsNullable = true, Length = 50)]
public string OldContainerOwner { get; set; }
/// <summary>
/// Desc:是否上线id(是否管理中)
/// Desc:租箱业务 租入 租入退租 租出 租出退租 CMRentDirectEnum
/// </summary>
[SugarColumn(ColumnDescription = "是否上线id", IsNullable = true, DefaultValue = "0")]
public CM_IsOnlineEnum? IsOnlineId { get; set; } = 0;
[SugarColumn(ColumnDescription = "租箱业务Id", IsNullable = false, Length = 20)]
public CMRentDirectEnum? RentDirectId { get; set; }
/// <summary>
/// Desc:箱来源Id: 自有箱/短租租入/长租租入/买箱
/// Desc:租箱类型 1长租 0短租 2单程 CMRentTypeEnum
/// </summary>
[SugarColumn(ColumnDescription = "箱来源Id", IsNullable = true, Length = 20)]
public CM_CtnSourceEnum? CtnSourceId { get; set; }
[SugarColumn(ColumnDescription = "租箱类型Id", IsNullable = true, Length = 20)]
public CMRentTypeEnum? RentTypeId { get; set; }
/// <summary>
/// Desc:业务状态id: 短租租出 长租租出 单程 卖箱
/// Desc:业务状态
/// </summary>
[SugarColumn(ColumnDescription = "箱业务状态Id", IsNullable = true)]
public CM_CtnBizStateEnum? CtnBizStateId { get; set; }
//[SugarColumn(ColumnDescription = "业务状态", IsNullable = true, Length = 20)]
//public string BillState { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
[SugarColumn(ColumnDescription = "关联放箱单号", IsNullable = true, Length = 50)]
public string CtnReleaseNo { get; set; }
/// <summary>
/// Desc:租入日期
/// </summary>
[SugarColumn(ColumnDescription = "业务日期", IsNullable = true)]
public DateTime? Bsdate { get; set; }
/// <summary>
/// Desc:箱状态Id
/// Desc:开始计费日期
/// </summary>
[SugarColumn(ColumnDescription = "箱状态Id", IsNullable = true)]
public CMCtnStateEnum? CtnStateId { get; set; }
[SugarColumn(ColumnDescription = "开始计费日期", IsNullable = true)]
public DateTime? FeeStartDate { get; set; }
/// <summary>
/// Desc:币别
/// </summary>
[SugarColumn(ColumnDescription = "币别", IsNullable = true, Length = 7)]
public string Currency { get; set; } = "USD";
/// <summary>
/// Desc:箱流转状态Id
/// Desc:日租金
/// </summary>
[SugarColumn(ColumnDescription = "箱流转状态Id", IsNullable = true)]
public CMCtnFlowStateEnum? CtnFlowStateId { get; set; }
[SugarColumn(ColumnDescription = "日租金", IsNullable = true, Length = 20)]
public decimal? DailyRate { get; set; } = 0M;
/// <summary>
/// Desc:当前港口代码
/// Desc:提箱费
/// </summary>
[SugarColumn(ColumnDescription = "当前港口代码", IsNullable = true)]
public long? Portid { get; set; }
[SugarColumn(ColumnDescription = "提箱费", IsNullable = true, Length = 20)]
public decimal? PickupFee { get; set; } = 0M;
/// <summary>
/// Desc:当前港口五字码
/// Desc:提箱日期
/// </summary>
[SugarColumn(ColumnDescription = "当前港口五字码", IsNullable = true, Length = 10)]
public string PortCode { get; set; }
[SugarColumn(ColumnDescription = "提箱日期", IsNullable = true)]
public DateTime? PickupDate { get; set; }
/// <summary>
/// Desc:当前港口
/// Desc:还箱费
/// </summary>
[SugarColumn(ColumnDescription = "当前港口", IsNullable = true, Length = 50)]
public string Port { get; set; }
[SugarColumn(ColumnDescription = "还箱费", IsNullable = true, Length = 20)]
public decimal? DropoffFee { get; set; } = 0M;
/// <summary>
/// Desc:还箱日期
/// </summary>
[SugarColumn(ColumnDescription = "还箱日期", IsNullable = true)]
public DateTime? DropoffDate { get; set; }
/// <summary>
/// Desc:起租地点代码
/// </summary>
[SugarColumn(ColumnDescription = "起租地点代码", IsNullable = true, Length = 20)]
public string RentalPortid { get; set; }
/// <summary>
/// Desc:起租地点五字码
/// </summary>
[SugarColumn(ColumnDescription = "起租地点五字码", IsNullable = true, Length = 10)]
public string RentalPortCode { get; set; }
/// <summary>
/// Desc:起租地点
/// </summary>
[SugarColumn(ColumnDescription = "起租地点", IsNullable = true, Length = 100)]
public string RentalPort { get; set; }
/// <summary>
/// Desc:提箱港口代码
/// </summary>
[SugarColumn(ColumnDescription = "提箱港口代码", IsNullable = true, Length = 20)]
public long? PickupPortid { get; set; }
/// <summary>
/// Desc:提箱港口五字码
/// </summary>
[SugarColumn(ColumnDescription = "提箱港口五字码", IsNullable = true, Length = 10)]
public string PickupPortCode { get; set; }
/// <summary>
/// Desc:提箱港口
/// </summary>
[SugarColumn(ColumnDescription = "提箱港口", IsNullable = true, Length = 100)]
public string PickupPort { get; set; }
/// <summary>
/// Desc:还箱港口代码
/// </summary>
[SugarColumn(ColumnDescription = "还箱港口代码", IsNullable = true, Length = 20)]
public long? DropoffPortid { get; set; }
/// <summary>
/// Desc:还箱港口五字码
/// </summary>
[SugarColumn(ColumnDescription = "还箱港口五字码", IsNullable = true, Length = 20)]
public string DropoffPortCode { get; set; }
/// <summary>
/// Desc:还箱港口
/// </summary>
[SugarColumn(ColumnDescription = "还箱港口", IsNullable = true, Length = 100)]
public string DropoffPort { get; set; }
/// <summary>
/// Desc:业务编号/提单号
@ -102,32 +194,50 @@ public class VW_CM_RentOneWay_NeedRent : BaseOrgModelV2<long>
/// <summary>
/// Desc:船名航次
/// </summary>
[SugarColumn(ColumnDescription = "船名航次", IsNullable = true, Length = 100)]
[SugarColumn(ColumnDescription = "船名航次", IsNullable = true, Length = 50)]
public string VesselVoyno { get; set; }
/// <summary>
/// 状态时间
/// Desc:是否上线id(是否管理中)
/// </summary>
[Description("状态时间")]
public DateTime StateTime { get; set; }
[SugarColumn(ColumnDescription = "是否上线id", IsNullable = true, DefaultValue = "0")]
public CM_IsOnlineEnum? IsOnlineId { get; set; } = 0;
/// <summary>
/// 创建时间
/// 箱主Id
/// </summary>
[Description("创建时间")]
public DateTime CreateTime { get; set; }
[SqlSugar.SugarColumn(ColumnDescription = "箱主Id", IsNullable = true, DefaultValue = "0")]
public long CtnOwnerId { get; set; }
/// <summary>
/// Desc:箱主
/// </summary>
[SugarColumn(ColumnDescription = "箱主", IsNullable = true, Length = 50)]
public string CtnOwner { get; set; }
/// <summary>
/// 备注
/// Desc:箱业务状态id: 短租租出 长租租出 单程 卖箱
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "备注", IsNullable = true, Length = 400)]
public string Remark { get; set; }
[SugarColumn(ColumnDescription = "箱业务状态Id", IsNullable = true)]
public CM_CtnBizStateEnum? CtnBizStateId { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// <summary>
/// Desc:箱状态Id
/// </summary>
[SugarColumn(ColumnDescription = "关联放箱单号", IsNullable = true, Length = 50)]
public string CtnReleaseNo { get; set; }
[SugarColumn(ColumnDescription = "箱状态Id", IsNullable = true)]
public CMCtnStateEnum? CtnStateId { get; set; }
/// <summary>
/// Desc:箱流转状态Id
/// </summary>
[SugarColumn(ColumnDescription = "箱流转状态Id", IsNullable = true)]
public CMCtnFlowStateEnum? CtnFlowStateId { get; set; }
/// <summary>
/// 备注
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "备注", IsNullable = true, Length = 400)]
public string Remark { get; set; }
}

@ -427,7 +427,7 @@ public class CM_RentOneWayService : CMServiceBase, ICM_RentOneWayService
//foreach (var _id in ids)
//{
if (await IsLockedAsync(id, BusinessType.CM_RentOneWay))
if (await IsLockedAsync(id, BusinessType.CM_RentIn))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeLocked));
//}
//
@ -437,17 +437,14 @@ public class CM_RentOneWayService : CMServiceBase, ICM_RentOneWayService
var CurrentDetailList = TenantDb.Queryable<CM_RentOneWay_Detail>()
.Where(a => a.Pid == id).ToList();
var quary = CreateCurrentStateQuery();
var AddCurrentStateList = TenantDb.Queryable(quary)
.Where(a => ids.Contains(a.Id))
.Select<CM_CurrentStateRes>().ToList();
var OnAddDetail = TenantDb.Queryable<CM_RentOneWay_Detail>()
.Where(a => ids.Contains(a.Id)).ToList();
var addList = new List<CM_RentOneWay_Detail>();
if (AddCurrentStateList != null && AddCurrentStateList.Count > 0)
if (OnAddDetail != null && OnAddDetail.Count > 0)
{
foreach (var addrec in AddCurrentStateList)
foreach (var addrec in OnAddDetail)
{
if (CurrentDetailList.Exists(x => x.Cntrno == addrec.Cntrno))
{
@ -459,12 +456,9 @@ public class CM_RentOneWayService : CMServiceBase, ICM_RentOneWayService
newrec = addrec.Adapt<CM_RentOneWay_Detail>();
newrec.Id = 0;
newrec.Pid = id;
newrec.RentDirectId = CMRentDirectEnum.;
newrec.RentDirectId = CMRentDirectEnum.退;
newrec.DropoffDate = head.Bsdate;
newrec.RentDetailId = addrec.Id;//
newrec.RentCustomerId = head.RentCustomerId;
newrec.RentCustomerName = head.RentCustomerName;
newrec.RentTypeId = head.RentTypeId;
addList.Add(newrec);
}
@ -481,8 +475,6 @@ public class CM_RentOneWayService : CMServiceBase, ICM_RentOneWayService
head.CntrnoAll = ch.GetCntrTotalStr();
head.Ctntotal = ch.GetCtnTotalStr();
head.PickupCtntotal = ch.GetStr();
head.PickupRemainCtntotal = ch.GetStr();
head.DropoffCtntotal = ch.GetStr();
head.DropoffRemainCtntotal = ch.GetStr();
@ -500,9 +492,6 @@ public class CM_RentOneWayService : CMServiceBase, ICM_RentOneWayService
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
//await WriteBackStatusAsync(model.BusinessId, model.BusinessType);
//return result > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}

Loading…
Cancel
Save