|
|
|
@ -2050,7 +2050,7 @@ public class CommonService : ICommonService
|
|
|
|
|
/// 获取最新业务单据编码
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user)
|
|
|
|
|
public async Task<DataResult<string>> GetSequenceNextAsync<T>(SqlSugarScopeProvider tenantDb, IUser user,long saleId = 0)
|
|
|
|
|
{
|
|
|
|
|
//生成编号
|
|
|
|
|
string sequenceNewNo = "";
|
|
|
|
@ -2084,10 +2084,14 @@ public class CommonService : ICommonService
|
|
|
|
|
case "variable": //变量方式 TODO
|
|
|
|
|
if (item.RuleValue == "UserNumber")
|
|
|
|
|
{
|
|
|
|
|
var userInfo = await db.Queryable<SysUser>().FirstAsync(x => x.Id == long.Parse(user.UserId));
|
|
|
|
|
if (saleId == 0)
|
|
|
|
|
{
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("请维护订单揽货人信息!"));
|
|
|
|
|
}
|
|
|
|
|
var userInfo = await db.Queryable<SysUser>().FirstAsync(x => x.Id == saleId);
|
|
|
|
|
if (userInfo.UserNumber.IsNull())
|
|
|
|
|
{
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("该用户编码未维护!"));
|
|
|
|
|
return await Task.FromResult(DataResult<string>.Failed("该揽货人用户编码未维护!"));
|
|
|
|
|
}
|
|
|
|
|
sequenceNewNo += userInfo.UserNumber;
|
|
|
|
|
}
|
|
|
|
|