|
|
|
@ -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;//前缀
|
|
|
|
|