|
|
|
@ -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($"");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|