20240801_1

usertest
dengyu 4 months ago
parent df51a44825
commit c54f6b33f8

@ -30,11 +30,10 @@ namespace DS.Module.Core.Enums
线 = -1,
}
/// <summary>
/// 箱管 当前业务类型
/// 箱管 箱来源
/// </summary>
public enum CM_CtnBizStateEnum
public enum CM_CtnSourceEnum
{
/// <summary>
/// 自有箱
@ -51,6 +50,28 @@ namespace DS.Module.Core.Enums
/// </summary>
[Description("长租租入")]
= 2,
}
/// <summary>
/// 箱管 当前业务类型
/// </summary>
public enum CM_CtnBizStateEnum
{
///// <summary>
///// 自有箱
///// </summary>
//[Description("自有箱")]
//自有箱 = 0,
/// <summary>
/// 短租租入
/// </summary>
[Description("短租租入")]
= 1,
/// <summary>
/// 长租租入
/// </summary>
[Description("长租租入")]
= 2,
/// <summary>
/// 单程业务
/// </summary>
@ -66,6 +87,16 @@ namespace DS.Module.Core.Enums
/// </summary>
[Description("卖箱")]
= 5,
/// <summary>
/// 短租租出
/// </summary>
[Description("短租租出")]
= 6,
/// <summary>
/// 长租租入
/// </summary>
[Description("长租租出")]
= 7,
}
/// <summary>

@ -68,3 +68,45 @@
2024-08-01 09:37:27.7196 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 09:37:27.7196 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 09:37:27.7340 Info Configuration initialized.
2024-08-01 11:49:29.9055 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-01 11:49:29.9264 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-01 11:49:29.9264 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-01 11:49:29.9484 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-08-01 11:49:29.9484 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 11:49:29.9484 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 11:49:29.9684 Info Configuration initialized.
2024-08-01 13:39:23.4958 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-01 13:39:23.5142 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-01 13:39:23.5142 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-01 13:39:23.5336 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-08-01 13:39:23.5336 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 13:39:23.5437 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 13:39:23.5437 Info Configuration initialized.
2024-08-01 13:57:42.1376 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-01 13:57:42.1552 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-01 13:57:42.1552 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-01 13:57:42.1806 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-08-01 13:57:42.1889 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 13:57:42.1889 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 13:57:42.2000 Info Configuration initialized.
2024-08-01 14:00:00.0741 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-01 14:00:00.0942 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-01 14:00:00.0942 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-01 14:00:00.1696 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-08-01 14:00:00.1696 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 14:00:00.1821 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 14:00:00.1821 Info Configuration initialized.
2024-08-01 14:02:33.5932 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-01 14:02:33.6506 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-01 14:02:33.6561 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-01 14:02:33.6740 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-08-01 14:02:33.6740 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 14:02:33.6840 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 14:02:33.6840 Info Configuration initialized.
2024-08-01 14:34:44.6940 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-08-01 14:34:44.7323 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-08-01 14:34:44.7323 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-08-01 14:34:44.7718 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-08-01 14:34:44.7827 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\ds8-solution-pro\ds-wms-service\DS.WMS.ContainerManagementApi\bin\Debug\net8.0\nlog.config
2024-08-01 14:34:44.7827 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-08-01 14:34:44.7999 Info Configuration initialized.

@ -136,6 +136,10 @@ public class CM_CurrentStateReq
/// </summary>
public decimal? CtnValue_Base { get; set; } = 0;
/// <summary>
/// 箱初期成本
/// </summary>
public decimal? CtnValue_BuyingPrice { get; set; } = 0;
}
/// <summary>

@ -139,6 +139,12 @@ public class CM_State_ChangeReq
/// 箱初期成本
/// </summary>
public decimal? CtnValue_Base { get; set; } = 0;
/// <summary>
/// 箱初期成本
/// </summary>
public decimal? CtnValue_BuyingPrice { get; set; } = 0;
}
@ -170,9 +176,12 @@ public class CM_State_ChangeReq_Multi : CM_State_ChangeReq {
if (cntrnoList != null && cntrnoList.Count > 0)
{
foreach (var cntrno in cntrnoList) {
var newrec = this.Adapt<CM_State_ChangeReq>();
newrec.Cntrno = cntrno;
result.Add(newrec);
if (!result.Exists(x => x.Cntrno == cntrno))
{
var newrec = this.Adapt<CM_State_ChangeReq>();
newrec.Cntrno = cntrno;
result.Add(newrec);
}
}
}

@ -49,7 +49,7 @@ public class CM_CurrentState : BaseOrgModel<long>
/// <summary>
/// Desc:箱业务状态: 短租租出 长租租出 单程 卖箱
/// </summary>
[SugarColumn(ColumnDescription = "箱业务状态", DefaultValue = "")]
[SugarColumn(ColumnDescription = "箱业务状态", IsNullable = true, DefaultValue = "")]
public string CtnBizState { get; set; } = "0";
/// <summary>
@ -61,7 +61,7 @@ public class CM_CurrentState : BaseOrgModel<long>
/// <summary>
/// Desc:关联放箱单号
/// </summary>
[SugarColumn(ColumnDescription = "关联放箱单号", Length = 50)]
[SugarColumn(ColumnDescription = "关联放箱单号", IsNullable = true, Length = 50)]
public string CtnReleaseNo { get; set; }
/// <summary>
@ -79,13 +79,13 @@ public class CM_CurrentState : BaseOrgModel<long>
/// <summary>
/// Desc:是否上线(是否管理中)
/// </summary>
[SugarColumn(ColumnDescription = "是否上线", IsNullable = false, DefaultValue = "0")]
[SugarColumn(ColumnDescription = "是否上线", IsNullable = true, DefaultValue = "0")]
public Int16? IsOnline { get; set; } = 0;
/// <summary>
/// Desc:空重箱
/// </summary>
[SugarColumn(ColumnDescription = "空重箱", IsNullable = false, DefaultValue = "0")]
[SugarColumn(ColumnDescription = "空重箱", IsNullable = true, DefaultValue = "0")]
public bool? IsHeavy { get; set; } = false;
/// <summary>

@ -17,6 +17,7 @@ namespace DS.WMS.ContainerManagement.Info.Method
/// </summary>
public abstract class CMServiceBase
{
/// <summary>
/// 人民币代码
/// </summary>

@ -88,6 +88,8 @@ public class CM_State_ChangeService : CMServiceBase, ICM_State_ChangeService
var entity = TenantDb.Insertable(data).ExecuteReturnEntity();
UpdateCM_CurrentStateAsync(data);
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
else
@ -117,19 +119,20 @@ public class CM_State_ChangeService : CMServiceBase, ICM_State_ChangeService
foreach (var item in datalist)
{
item.Id = 0;
item.ChangeSource = "手动批量更新";
item.ChangeTime = DateTime.Now;
TenantDb.Insertable(item).ExecuteReturnEntity();
var _addrec = item.Adapt<CM_State_Change>();
_addrec.Id = 0;
_addrec.ChangeSource = "手动批量更新";
//_addrec.ChangeTime = DateTime.Now;
TenantDb.Insertable(_addrec).ExecuteReturnEntity();
//查找
UpdateCM_CurrentStateAsync(item);
}
return DataResult.Successed("添加成功!", null, MultiLanguageConst.DataCreateSuccess);
}
catch (Exception ex)
{
var msg = JsonConvert.SerializeObject(ex);
var msg = JsonConvert.SerializeObject(ex);
return DataResult.Successed($"更新失败:{msg}", MultiLanguageConst.DataUpdateFailed);
}
}
@ -187,10 +190,10 @@ public class CM_State_ChangeService : CMServiceBase, ICM_State_ChangeService
/// </summary>
/// <param name="change"></param>
/// <returns></returns>
public async Task<DataResult> UpdateCM_CurrentStateAsync(CM_State_Change change)
public async Task<DataResult> UpdateCM_CurrentStateAsync(CM_State_ChangeReq change)
{
//找到该箱号的当前状态 如果没有 新建一条
var CurrState = await TenantDb.Queryable<CM_CurrentState>().Where(x => x.Cntrno == change.Cntrno).FirstAsync();
var CurrState = TenantDb.Queryable<CM_CurrentState>().Where(x => x.Cntrno == change.Cntrno).First();
if (CurrState == null)
{
@ -273,8 +276,15 @@ public class CM_State_ChangeService : CMServiceBase, ICM_State_ChangeService
newCurrState.ETA = change.ETA;
}
newCurrState.StateTime = change.ChangeTime;
var entity = TenantDb.Insertable(newCurrState).ExecuteReturnEntity();
try
{
var entity = TenantDb.Insertable<CM_CurrentState>(newCurrState).ExecuteReturnEntity();
var _r = DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
catch (Exception ex) {
//return DataResult.Failed("添加失败!" + ex.Message);
}
}
else {
@ -358,6 +368,30 @@ public class CM_State_ChangeService : CMServiceBase, ICM_State_ChangeService
await TenantDb.Updateable(CurrState).ExecuteCommandAsync();
}
var ctnbase= TenantDb.Queryable<CM_BaseInfo>().Where(x => x.Cntrno == change.Cntrno).First();
if (ctnbase == null)
{
var newBaseinfo = new CM_BaseInfo();
newBaseinfo.Cntrno = change.Cntrno;
newBaseinfo.Ctnall = change.Ctnall;
newBaseinfo.ProductionDate = null;
newBaseinfo.CtnValue_Base = change.CtnValue_Base==null?0:change.CtnValue_Base;
newBaseinfo.CtnValue_BuyingPrice = change.CtnValue_BuyingPrice == null ? 0 : change.CtnValue_BuyingPrice;
try
{
var entity = TenantDb.Insertable(newBaseinfo).ExecuteReturnEntity();
var _r = DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
catch (Exception ex)
{
//return DataResult.Failed("添加失败!" + ex.Message);
}
}
return DataResult.Success;
}

@ -87,8 +87,7 @@ public class ContainerManagementTest
//tenantDb.CodeFirst.InitTables(typeof(CM_CurrentState));
tenantDb.CodeFirst.InitTables(typeof(CM_BaseInfo));
//tenantDb.CodeFirst.InitTables(typeof(CM_BaseInfo));
tenantDb.CodeFirst.InitTables(typeof(CM_State_Change));
//tenantDb.CodeFirst.InitTables(typeof(BookingStatusLog));

Loading…
Cancel
Save