系统二维码
This commit is contained in:
@@ -313,6 +313,32 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
|
||||
|
||||
if (adminlist.Any()) await _repository.AsSugarClient().Insertable(adminlist).CallEntityMethod(m => m.Create()).ExecuteReturnEntityAsync();
|
||||
#endregion
|
||||
|
||||
if (input.category != DictConst.RegionCategoryCompanyCode)
|
||||
{
|
||||
var jsonObj = input.propertyJson;
|
||||
var qrcode = jsonObj.GetValue("qrcode");
|
||||
if (qrcode is not null && !string.IsNullOrEmpty(qrcode.ToString()))
|
||||
{
|
||||
if (await _repository.AsSugarClient().Queryable<BasQrcode>().AnyAsync(x => x.code == qrcode.ToString()))
|
||||
{
|
||||
throw Oops.Bah("二维码总表中已存在该二维码");
|
||||
}
|
||||
else
|
||||
{
|
||||
BasQrcode basQrcode = new BasQrcode()
|
||||
{
|
||||
code = qrcode.ToString(),
|
||||
source_id = entity.Id,
|
||||
source_name = "BASE_ORGANIZE",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = _userManager.GetUserInfo().Result.organizeId,
|
||||
};
|
||||
await _repository.AsSugarClient().Insertable<BasQrcode>(basQrcode).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 第三方同步
|
||||
|
||||
@@ -450,6 +476,43 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra
|
||||
|
||||
int isOK = await _repository.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).CallEntityMethod(m => m.LastModify()).ExecuteCommandAsync();
|
||||
if (!(isOK > 0)) throw Oops.Oh(ErrorCode.D2018);
|
||||
|
||||
//modified by zkd on 20230718 处理二维码
|
||||
if (input.category != DictConst.RegionCategoryCompanyCode)
|
||||
{
|
||||
var jsonObj = input.propertyJson;
|
||||
var qrcode = jsonObj.GetValue("qrcode");
|
||||
if (qrcode is not null && !string.IsNullOrEmpty(qrcode.ToString()))
|
||||
{
|
||||
if (await _repository.AsSugarClient().Queryable<BasQrcode>().AnyAsync(x => x.code == qrcode.ToString() && x.source_id!=id))
|
||||
{
|
||||
throw Oops.Bah("二维码总表中已存在该二维码");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (await _repository.AsSugarClient().Queryable<BasQrcode>().AnyAsync(x => x.source_id == id))
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<BasQrcode>()
|
||||
.SetColumns(x => x.code == qrcode.ToString()).Where(x => x.source_id == id)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
BasQrcode basQrcode = new BasQrcode()
|
||||
{
|
||||
code = qrcode.ToString(),
|
||||
source_id = id,
|
||||
source_name = "BASE_ORGANIZE",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = _userManager.GetUserInfo().Result.organizeId,
|
||||
};
|
||||
await _repository.AsSugarClient().Insertable<BasQrcode>(basQrcode).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//modified by ly on 20230426 处理工位信息,将工位插入到设备表
|
||||
if (input.category == DictConst.RegionCategoryStationCode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user