dev
dengyu 1 month ago
parent faf61ea613
commit c9271eab55

@ -1680,6 +1680,9 @@ public static class MultiLanguageConst
[Description("此业务该状态下不能生成费用")]
public const string CM_CanNotMakeFee = "This Bill can not make fee in this state.";
[Description("此业务该状态下不能执行此动作")]
public const string CM_CanNotExecution = "This Bill can not do this in this state.";
[Description("箱号重复")]
public const string CM_CntrnoRepeat = "Cntrno repeat.";

@ -92,4 +92,17 @@ public class CM_BaseInfoController : ApiController
return res;
}
/// <summary>
/// 推进状态
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("CM_PushFormStatus")]
public async Task<DataResult> CM_PushFormStatus([FromBody] CM_PushFormStatusReq model)
{
var res = await _invokeService.CM_PushFormStatus(model);
return res;
}
}

@ -52,3 +52,37 @@ public class CM_BaseInfoReq
/// </summary>
public string Remark { get; set; }
}
/// <summary>
/// 箱管 推进状态 请求实体参数
/// </summary>
public class CM_PushFormStatusReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 模块名称
/// 目前需要此功能的模块:租入(退租)、租出(租出)、卖箱
/// 传 CM_RentIn CM_RentOut CM_SellCtn
/// </summary>
public string FormName { get; set; }
/// <summary>
/// 执行动作 1001提交审核 1000撤回 10001驳回 1100审核通过
/// </summary>
public string Execution { get; set; }
/// <summary>
/// 理由 :驳回时需要传输理由
/// </summary>
public string Reason { get; set; }
/// <summary>
/// 当前状态 前端不需要传输此参数
/// </summary>
public string CurrentState { get; set; }
}

@ -85,7 +85,7 @@ public class CM_Rent_DetailBase
/// Desc:关联放箱单号
/// </summary>
public string? CtnReleaseNo { get; set; }
public string? CtnReleaseNo_In { get; set; }
/// <summary>
/// Desc:租入日期

@ -128,4 +128,9 @@ public class CM_Rent_HeadBase : BussinessStateRes
public string DropoffRemainCtntotal { get; set; }
//public List<CM_Rent_DetailBase> _bodyList { get; set; }
/// <summary>
/// 关联放箱单号
/// </summary>
public string? CtnReleaseNo { get; set; }
}

@ -174,5 +174,11 @@ public class CM_RentOneWay : BaseOrgModelV2<long>
/// </summary>
[SugarColumn(ColumnDescription = "未还箱", IsNullable = true, Length = 200)]
public string DropoffRemainCtntotal { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
[SugarColumn(ColumnDescription = "关联放箱单号", IsNullable = true, Length = 50)]
public string CtnReleaseNo { get; set; }
}

@ -89,6 +89,13 @@ public class CM_RentOneWay_Detail : BaseOrgModelV2<long>
public string CtnReleaseNo { get; set; }
/// <summary>
/// Desc:租入放箱单号
/// </summary>
[SugarColumn(ColumnDescription = "租入放箱单号", IsNullable = true, Length = 50)]
public string CtnReleaseNo_In { get; set; }
/// <summary>
/// Desc:租入日期
/// </summary>

@ -174,5 +174,11 @@ public class CM_RentOneWay_In : BaseOrgModelV2<long>
/// </summary>
[SugarColumn(ColumnDescription = "未还箱", IsNullable = true, Length = 200)]
public string DropoffRemainCtntotal { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
[SugarColumn(ColumnDescription = "关联放箱单号", IsNullable = true, Length = 50)]
public string CtnReleaseNo { get; set; }
}

@ -46,5 +46,12 @@ public interface ICM_BaseInfoService
/// <returns></returns>
public Task<DataResult> CM_DealExcel(CM_DealExcelReq model);
/// <summary>
/// 推进状态
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Task<DataResult> CM_PushFormStatus(CM_PushFormStatusReq model);
}

@ -22,6 +22,10 @@ using SqlSugar;
using DS.Module;
using DS.Module.ExcelModule;
using DS.Module.ExcelModule.Model;
using System;
using LanguageExt.Pipes;
using DS.WMS.Core.Invoice.Dtos;
using MathNet.Numerics.Distributions;
namespace DS.WMS.ContainerManagement.Info.Method;
@ -32,7 +36,6 @@ public class CM_BaseInfoService : ICM_BaseInfoService
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly IEPPlusService epplusService;
private readonly ICM_State_Change_TemplatImportService templatImportService;
/// <summary>
@ -317,4 +320,147 @@ public class CM_BaseInfoService : ICM_BaseInfoService
//var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
}
/// <summary>
/// 推进状态
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public async Task<DataResult> CM_PushFormStatus(CM_PushFormStatusReq req)
{
//object Head = new object();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.FormName == "CM_RentIn") {
//序列化查询条件
var Head = await tenantDb.Queryable<CM_RentIn>()
.FirstAsync(x => x.Id == req.Id);
req.CurrentState = Head.BillState;
var cando = FormPushStatusHelper(req);
if (cando.Message == "")
{
return DataResult.Failed($"此业务该状态下不能执行此动作!", MultiLanguageConst.CM_CanNotExecution);
}
else {
Head.BillState = cando.Message;
if (Head.BillState == "10001") Head.Remark += "驳回理由:" + req.Reason;
}
tenantDb.Updateable(Head).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed($"执行成功!", MultiLanguageConst.OperationSuccess);
}
if (req.FormName == "CM_RentOut")
{
//序列化查询条件
var Head = await tenantDb.Queryable<CM_RentOut>()
.FirstAsync(x => x.Id == req.Id);
req.CurrentState = Head.BillState;
var cando = FormPushStatusHelper(req);
if (cando.Message == "")
{
return DataResult.Failed($"此业务该状态下不能执行此动作!", MultiLanguageConst.CM_CanNotExecution);
}
else
{
Head.BillState = cando.Message;
if (Head.BillState == "10001") Head.Remark += "驳回理由:" + req.Reason;
}
tenantDb.Updateable(Head).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed($"执行成功!", MultiLanguageConst.OperationSuccess);
}
if (req.FormName == "CM_SellCtn")
{
//序列化查询条件
var Head = await tenantDb.Queryable<CM_SellCtn>()
.FirstAsync(x => x.Id == req.Id);
req.CurrentState = Head.BillState;
var cando = FormPushStatusHelper(req);
if (cando.Message == "")
{
return DataResult.Failed($"此业务该状态下不能执行此动作!", MultiLanguageConst.CM_CanNotExecution);
}
else
{
Head.BillState = cando.Message;
if (Head.BillState == "10001") Head.Remark += "驳回理由:" + req.Reason;
}
tenantDb.Updateable(Head).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed($"执行成功!", MultiLanguageConst.OperationSuccess);
}
return DataResult.Failed($"此业务该状态下不能执行此动作!", MultiLanguageConst.CM_CanNotExecution);
}
public DataResult FormPushStatusHelper(CM_PushFormStatusReq req)
{
//执行动作 1001提交审核 1000撤回 10001驳回 1100审核通过
//状态 "/1000"录入 10001驳回 1001审核中 1100审核通过
if (req.FormName == "CM_RentIn" || req.FormName == "CM_RentOut"|| req.FormName == "CM_SellCtn")
{
//录入/驳回 状态允许提交1001
if (string.IsNullOrWhiteSpace(req.CurrentState) || req.CurrentState == "1000" || req.CurrentState == "10001") {
if (req.Execution == "1001") {
return DataResult.Successed($"1001");
}
}
//提交审核状态 允许: 通过 驳回 撤回
if ( req.CurrentState == "1001")
{
if (req.Execution == "1000")
{
return DataResult.Successed($"1000");
}
if (req.Execution == "10001")
{
return DataResult.Successed($"10001");
}
if (req.Execution == "1100")
{
return DataResult.Successed($"1100");
}
}
//审核通过状态允许 驳回
if (req.CurrentState == "1100")
{
if (req.Execution == "10001")
{
return DataResult.Successed($"10001");
}
}
}
return DataResult.Failed($"");
}
}

@ -125,7 +125,7 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
}
data.Billno = sequence.Data;
data.BillState = "1000";
var ch = new CtnTotalHelper2<List<CM_RentIn_DetailReq>>(req.BodyList);

@ -466,6 +466,13 @@ public class CM_RentOneWayService : CMServiceBase, ICM_RentOneWayService
//newrec.PickupPortCode = null;
//newrec.PickupDate = null;
newrec.CtnReleaseNo_In = addrec.CtnReleaseNo;
newrec.CtnReleaseNo = "";
//if (string.IsNullOrWhiteSpace(head.CtnReleaseNo)) {
//}
addList.Add(newrec);
}

@ -130,6 +130,11 @@ public class CM_RentOneWay_InService : CMServiceBase, ICM_RentOneWay_InService
item.OldContainerOwner = data.OldContainerOwner;
}
if (string.IsNullOrWhiteSpace( item.CtnReleaseNo) && !string.IsNullOrWhiteSpace(data.CtnReleaseNo))
{
item.CtnReleaseNo = data.CtnReleaseNo;
}
var newdetail = item.Adapt<CM_RentOneWay_Detail>();
await tenantDb.Insertable(newdetail).ExecuteCommandAsync();
}
@ -164,6 +169,10 @@ public class CM_RentOneWay_InService : CMServiceBase, ICM_RentOneWay_InService
item.OldContainerOwnerId = info.OldContainerOwnerId;
item.OldContainerOwner = info.OldContainerOwner;
}
if (string.IsNullOrWhiteSpace(item.CtnReleaseNo) && !string.IsNullOrWhiteSpace(info.CtnReleaseNo))
{
item.CtnReleaseNo = info.CtnReleaseNo;
}
var newdetail = item.Adapt<CM_RentOneWay_Detail>();
await tenantDb.Insertable(newdetail).ExecuteCommandAsync();
}
@ -175,6 +184,10 @@ public class CM_RentOneWay_InService : CMServiceBase, ICM_RentOneWay_InService
item.OldContainerOwnerId = info.OldContainerOwnerId;
item.OldContainerOwner = info.OldContainerOwner;
}
if (string.IsNullOrWhiteSpace(item.CtnReleaseNo) && !string.IsNullOrWhiteSpace(info.CtnReleaseNo))
{
item.CtnReleaseNo = info.CtnReleaseNo;
}
updrec = item.Adapt(updrec);
await tenantDb.Updateable(updrec).ExecuteCommandAsync();
}

@ -142,6 +142,7 @@ public class CM_RentOutService : CMServiceBase, ICM_RentOutService
return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
}
data.Billno = sequence.Data;
data.BillState = "1000";
//var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = await tenantDb.Insertable(data).ExecuteReturnEntityAsync();

@ -146,6 +146,7 @@ public class CM_SellCtnService : CMServiceBase, ICM_SellCtnService
return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
}
data.Billno = sequence.Data;
data.BillState = "1000";
//var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
var entity = await tenantDb.Insertable(data).ExecuteReturnEntityAsync();

@ -106,7 +106,7 @@ public class ContainerManagementTest
/// <summary>
/// 初始化单表 多表
/// 注意 海运出口 SeaExport 得手动数据库更新
/// </summary>
/// </summary>d
[Fact]
public void InitAllSaasTableTestByDdlucky()
{
@ -128,9 +128,9 @@ public class ContainerManagementTest
//tenantDb.CodeFirst.InitTables(typeof(CM_RentIn_Detail));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOut));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOut_Detail));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay_Detail));
//tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay_In));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay_Detail));
tenantDb.CodeFirst.InitTables(typeof(CM_RentOneWay_In));
//tenantDb.CodeFirst.InitTables(typeof(CM_BuyCtn));
//tenantDb.CodeFirst.InitTables(typeof(CM_BuyCtn_Detail));
@ -147,7 +147,7 @@ public class ContainerManagementTest
//tenantDb.CodeFirst.InitTables(typeof(CM_State_Change_Templat));
//tenantDb.CodeFirst.InitTables(typeof(CM_State_Change_TemplatDetail));
//tenantDb.CodeFirst.InitTables(typeof(CM_State_Change_TemplatImport));
tenantDb.CodeFirst.InitTables(typeof(CM_State_Change_Temp));
//tenantDb.CodeFirst.InitTables(typeof(CM_State_Change_Temp));
}
Assert.True(true);

Loading…
Cancel
Save