|
|
@ -45,14 +45,14 @@ namespace DS.WMS.Core.Code.Method
|
|
|
|
public DataResult EditCodeThirdParty(CodeThirdPartyReq req)
|
|
|
|
public DataResult EditCodeThirdParty(CodeThirdPartyReq req)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
if (req.Id == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == req.AccountType.Trim()&& x.CustomerId == req.CustomerId).Any())
|
|
|
|
if (tenantDb.Queryable<CodeThirdParty>().Where(x => x.AccountType == req.AccountType.Trim() && x.CustomerId == req.CustomerId && x.UserId == req.UserId && x.Id!=req.Id).Any())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return DataResult.Failed("第三方账号已存在!", MultiLanguageConst.CodeThirdPartyExist);
|
|
|
|
return DataResult.Failed("第三方账号已存在!", MultiLanguageConst.CodeThirdPartyExist);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (req.Id == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
var data = req.Adapt<CodeThirdParty>();
|
|
|
|
var data = req.Adapt<CodeThirdParty>();
|
|
|
|
|
|
|
|
|
|
|
|
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
|
|
|
|
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
|
|
|
@ -91,7 +91,7 @@ namespace DS.WMS.Core.Code.Method
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
|
|
var data = await tenantDb.Queryable<CodeThirdParty>()
|
|
|
|
var data = await tenantDb.Queryable<CodeThirdParty>()
|
|
|
|
.Where(a => a.AccountType == AccountType && a.IsCompany == false && a.CreateBy == long.Parse(user.UserId))
|
|
|
|
.Where(a => a.AccountType == AccountType && a.IsCompany == false && a.UserId == long.Parse(user.UserId))
|
|
|
|
.Select<CodeThirdPartyRes>()
|
|
|
|
.Select<CodeThirdPartyRes>()
|
|
|
|
.FirstAsync();
|
|
|
|
.FirstAsync();
|
|
|
|
|
|
|
|
|
|
|
|