海运出口编码规则按开船日期取值

dev
cjy 2 months ago
parent 693f960b56
commit 39db6f1d1e

@ -227,7 +227,7 @@ public partial class SeaExportService : ISeaExportService
// return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
//}
//
var sequence = await commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user,req.SaleId);
var sequence = await commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user,req.SaleId,req.ETD);
if (!sequence.Succeeded)
{
return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));
@ -374,7 +374,7 @@ public partial class SeaExportService : ISeaExportService
#region 复制单据单号重新赋值
if (string.IsNullOrEmpty(info.CustomerNo))
{
var sequence = await commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user, req.SaleId);
var sequence = await commonService.GetSequenceNextAsync<SeaExport>(tenantDb, user, req.SaleId, req.ETD);
if (!sequence.Succeeded)
{
return await Task.FromResult(DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist));

@ -209,7 +209,7 @@ public interface ICommonService
/// 获取最新业务单据编码
/// </summary>
/// <returns></returns>
public Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0);
public Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0, DateTime? date = null);
/// <summary>
/// 获取字典明细

@ -2152,7 +2152,7 @@ public class CommonService : ICommonService
/// 获取最新业务单据编码
/// </summary>
/// <returns></returns>
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0)
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user, long saleId = 0,DateTime? date = null)
{
//生成编号
string sequenceNewNo = "";
@ -2199,19 +2199,19 @@ public class CommonService : ICommonService
}
break;
case "shortdate": //短日期 年2位月2位日期2位
sequenceNewNo += DateTime.Now.ToString("yyyyMMdd").Substring(2);
sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd").Substring(2) : DateTime.Now.ToString("yyyyMMdd").Substring(2) ;
break;
case "date": //日期年4位
sequenceNewNo += DateTime.Now.ToString("yyyyMMdd");
sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd") : DateTime.Now.ToString("yyyyMMdd");
break;
case "ydate": //年月年4位月2位
sequenceNewNo += DateTime.Now.ToString("yyyyMMdd").Substring(0, 6);
sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd").Substring(0, 6) : DateTime.Now.ToString("yyyyMMdd").Substring(0, 6);
break;
case "sydate": //年月年2位月2位
sequenceNewNo += DateTime.Now.ToString("yyyyMMdd").Substring(2, 4);
sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMdd").Substring(2, 4) : DateTime.Now.ToString("yyyyMMdd").Substring(2, 4);
break;
case "timestamp": //日期时间精确到毫秒
sequenceNewNo += DateTime.Now.ToString("yyyyMMddHHmmssffff");
sequenceNewNo += date.HasValue ? date.Value.ToString("yyyyMMddHHmmssffff") : DateTime.Now.ToString("yyyyMMddHHmmssffff");
break;
case "number": //计数,流水号
var prefix = sequenceNewNo;//前缀

Loading…
Cancel
Save