千灯镇批量修改
This commit is contained in:
parent
0ff57d952d
commit
a50b3d7dff
|
|
@ -1,13 +1,9 @@
|
||||||
using Furion.DynamicApiController;
|
using Furion.DynamicApiController;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Nirvana.Common;
|
using Nirvana.Common;
|
||||||
using SqlSugar;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Waste.Domain;
|
|
||||||
|
|
||||||
namespace Waste.Application
|
namespace Waste.Application
|
||||||
{
|
{
|
||||||
|
|
@ -17,10 +13,12 @@ namespace Waste.Application
|
||||||
public class DeviceAppService : IDynamicApiController
|
public class DeviceAppService : IDynamicApiController
|
||||||
{
|
{
|
||||||
private readonly IDeviceService _deviceService;
|
private readonly IDeviceService _deviceService;
|
||||||
|
|
||||||
public DeviceAppService(IDeviceService deviceService)
|
public DeviceAppService(IDeviceService deviceService)
|
||||||
{
|
{
|
||||||
_deviceService = deviceService;
|
_deviceService = deviceService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备列表
|
/// 设备列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -31,6 +29,7 @@ namespace Waste.Application
|
||||||
{
|
{
|
||||||
return await _deviceService.GetListAsync(param);
|
return await _deviceService.GetListAsync(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 信息提交
|
/// 信息提交
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -40,6 +39,7 @@ namespace Waste.Application
|
||||||
{
|
{
|
||||||
return await _deviceService.SubmitFormAsync(role);
|
return await _deviceService.SubmitFormAsync(role);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 批量操作
|
/// 批量操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -49,6 +49,7 @@ namespace Waste.Application
|
||||||
{
|
{
|
||||||
return await _deviceService.BatchSetAsync(deviceBatchModel);
|
return await _deviceService.BatchSetAsync(deviceBatchModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备状态修改
|
/// 设备状态修改
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -61,6 +62,7 @@ namespace Waste.Application
|
||||||
{
|
{
|
||||||
return await _deviceService.SetStatusAsync(id, status);
|
return await _deviceService.SetStatusAsync(id, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 配置设备推送信息
|
/// 配置设备推送信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -70,5 +72,15 @@ namespace Waste.Application
|
||||||
{
|
{
|
||||||
return await _deviceService.SetConfigAsync(input);
|
return await _deviceService.SetConfigAsync(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量配置千灯镇商户推送
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task SetQDConfig()
|
||||||
|
{
|
||||||
|
await _deviceService.SetQDConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
using Furion.DependencyInjection;
|
using Furion.DependencyInjection;
|
||||||
using Furion.DistributedIDGenerator;
|
using Furion.DistributedIDGenerator;
|
||||||
using Furion.DynamicApiController;
|
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Nirvana.Common;
|
using Nirvana.Common;
|
||||||
using Nirvana.Common.ApiBase;
|
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Waste.Domain;
|
using Waste.Domain;
|
||||||
|
|
||||||
|
|
@ -30,6 +26,7 @@ namespace Waste.Application.Device
|
||||||
dbClient = repository.Context;
|
dbClient = repository.Context;
|
||||||
_businessService = businessService;
|
_businessService = businessService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备批量操作
|
/// 设备批量操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -46,7 +43,6 @@ namespace Waste.Application.Device
|
||||||
//如果是管理员分配
|
//如果是管理员分配
|
||||||
if (currentUser.AccountType == (int)AccountType.platform)
|
if (currentUser.AccountType == (int)AccountType.platform)
|
||||||
{
|
{
|
||||||
|
|
||||||
await dbClient.Updateable<W_Device>().SetColumns(x => new W_Device
|
await dbClient.Updateable<W_Device>().SetColumns(x => new W_Device
|
||||||
{
|
{
|
||||||
Businessid = deviceBatchModel.BusinessId,
|
Businessid = deviceBatchModel.BusinessId,
|
||||||
|
|
@ -121,6 +117,7 @@ namespace Waste.Application.Device
|
||||||
Id = devicedata.Id
|
Id = devicedata.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备详情数据
|
/// 设备详情数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -149,6 +146,7 @@ namespace Waste.Application.Device
|
||||||
FacEcode = device.FacEcode
|
FacEcode = device.FacEcode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取设备配置详情
|
/// 获取设备配置详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -276,6 +274,7 @@ namespace Waste.Application.Device
|
||||||
limit = param.limit
|
limit = param.limit
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 配置设备推送信息
|
/// 配置设备推送信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -307,6 +306,44 @@ namespace Waste.Application.Device
|
||||||
return new ResultInfo(ResultState.SUCCESS, "配置成功");
|
return new ResultInfo(ResultState.SUCCESS, "配置成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量配置千灯镇商户推送
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task SetQDConfig()
|
||||||
|
{
|
||||||
|
string Body = string.Empty;
|
||||||
|
string Url = "http://36.154.126.138:8817/api/third/postdata";
|
||||||
|
var bid = Guid.Parse("08D99B4B-B02D-4E65-8D56-2FD16EC1716F");
|
||||||
|
var alldevice = await dbClient.Queryable<W_Device>().Where(x => x.Businessid == bid).Select(x => new W_Device
|
||||||
|
{
|
||||||
|
Id = x.Id,
|
||||||
|
FacEcode=x.FacEcode
|
||||||
|
}).ToListAsync();
|
||||||
|
foreach (var item in alldevice)
|
||||||
|
{
|
||||||
|
if (await dbClient.Queryable<W_DeviceConfig>().AnyAsync(x => x.DeviceId == item.Id))
|
||||||
|
{
|
||||||
|
await dbClient.Updateable<W_DeviceConfig>().SetColumns(x => new W_DeviceConfig
|
||||||
|
{
|
||||||
|
Url = Url,
|
||||||
|
Body = Body
|
||||||
|
}).Where(x => x.DeviceId == item.Id).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var insertdata = new W_DeviceConfig
|
||||||
|
{
|
||||||
|
DeviceId = item.Id,
|
||||||
|
Body = Body,
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
Url = Url
|
||||||
|
};
|
||||||
|
await dbClient.Insertable(insertdata).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备状态修改
|
/// 设备状态修改
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
using Nirvana.Common;
|
using Nirvana.Common;
|
||||||
using Nirvana.Common.ApiBase;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Waste.Domain;
|
using Waste.Domain;
|
||||||
|
|
||||||
|
|
@ -20,30 +16,35 @@ namespace Waste.Application
|
||||||
/// <param name="param"></param>
|
/// <param name="param"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<PageParms<DeviceList>> GetListAsync(QueryParams param);
|
Task<PageParms<DeviceList>> GetListAsync(QueryParams param);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备信息提交
|
/// 设备信息提交
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="role"></param>
|
/// <param name="role"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultInfo> SubmitFormAsync(DeviceSubmit role);
|
Task<ResultInfo> SubmitFormAsync(DeviceSubmit role);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详情
|
/// 详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DeviceSubmit> DetailAsync(Guid id);
|
Task<DeviceSubmit> DetailAsync(Guid id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备批量操作
|
/// 设备批量操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="deviceBatchModel"></param>
|
/// <param name="deviceBatchModel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultInfo> BatchSetAsync(DeviceBatchModel deviceBatchModel);
|
Task<ResultInfo> BatchSetAsync(DeviceBatchModel deviceBatchModel);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备详情数据
|
/// 设备详情数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<DeviceDetailS2Dto> DeviceDetailAsync(Guid id);
|
Task<DeviceDetailS2Dto> DeviceDetailAsync(Guid id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备状态修改
|
/// 设备状态修改
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -51,12 +52,20 @@ namespace Waste.Application
|
||||||
/// <param name="status">设备状态,0-停用,1-正常,2-激活</param>
|
/// <param name="status">设备状态,0-停用,1-正常,2-激活</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultInfo> SetStatusAsync(Guid id, int status);
|
Task<ResultInfo> SetStatusAsync(Guid id, int status);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 配置设备推送信息
|
/// 配置设备推送信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<ResultInfo> SetConfigAsync(DeviceConfigC2SDto input);
|
Task<ResultInfo> SetConfigAsync(DeviceConfigC2SDto input);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 批量配置千灯镇商户推送
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task SetQDConfig();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取设备配置详情
|
/// 获取设备配置详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -589,6 +589,12 @@
|
||||||
<param name="input"></param>
|
<param name="input"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.DeviceAppService.SetQDConfig">
|
||||||
|
<summary>
|
||||||
|
批量配置千灯镇商户推送
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="T:Waste.Application.Device.DeviceService">
|
<member name="T:Waste.Application.Device.DeviceService">
|
||||||
<summary>
|
<summary>
|
||||||
设备管理
|
设备管理
|
||||||
|
|
@ -636,6 +642,12 @@
|
||||||
<param name="input"></param>
|
<param name="input"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.Device.DeviceService.SetQDConfig">
|
||||||
|
<summary>
|
||||||
|
批量配置千灯镇商户推送
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:Waste.Application.Device.DeviceService.SetStatusAsync(System.Guid,System.Int32)">
|
<member name="M:Waste.Application.Device.DeviceService.SetStatusAsync(System.Guid,System.Int32)">
|
||||||
<summary>
|
<summary>
|
||||||
设备状态修改
|
设备状态修改
|
||||||
|
|
@ -868,6 +880,12 @@
|
||||||
<param name="input"></param>
|
<param name="input"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Waste.Application.IDeviceService.SetQDConfig">
|
||||||
|
<summary>
|
||||||
|
批量配置千灯镇商户推送
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:Waste.Application.IDeviceService.GetConfigAsync(System.Guid)">
|
<member name="M:Waste.Application.IDeviceService.GetConfigAsync(System.Guid)">
|
||||||
<summary>
|
<summary>
|
||||||
获取设备配置详情
|
获取设备配置详情
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<key id="80becbe4-b8da-478f-8e04-2ee72229ce40" version="1">
|
||||||
|
<creationDate>2023-06-26T04:03:32.1101352Z</creationDate>
|
||||||
|
<activationDate>2023-06-26T04:03:32.0644029Z</activationDate>
|
||||||
|
<expirationDate>2023-09-24T04:03:32.0644029Z</expirationDate>
|
||||||
|
<descriptor deserializerType="Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer, Microsoft.AspNetCore.DataProtection, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
|
||||||
|
<descriptor>
|
||||||
|
<encryption algorithm="AES_256_CBC" />
|
||||||
|
<validation algorithm="HMACSHA256" />
|
||||||
|
<masterKey p4:requiresEncryption="true" xmlns:p4="http://schemas.asp.net/2015/03/dataProtection">
|
||||||
|
<!-- Warning: the key below is in an unencrypted form. -->
|
||||||
|
<value>ANfcQR1Xd4K1vIjHAszafBN+8YUKKjIPVRAtivcWhALy3lpclGIiHHZo0Ya4u2hcIV+3+1yfaeqrBBnIxtzQ6A==</value>
|
||||||
|
</masterKey>
|
||||||
|
</descriptor>
|
||||||
|
</descriptor>
|
||||||
|
</key>
|
||||||
Loading…
Reference in New Issue