|
|
@@ -3,6 +3,7 @@ using BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto; |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.Enum; |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Device.Dtos; |
|
|
|
using BPA.SAAS.Manage.Application.AExternalPlatform.Service.Goods.Dtos; |
|
|
|
using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute; |
|
|
|
using BPA.SAAS.Manage.Comm.Const; |
|
|
|
using BPA.SAAS.Manage.Core.Base; |
|
|
|
using BPA.SAAS.Manage.Core.DataBase; |
|
|
@@ -10,11 +11,13 @@ using BPA.SAAS.Manage.Core.Device; |
|
|
|
using BPA.SAAS.Manage.Core.Product; |
|
|
|
using Furion.DependencyInjection; |
|
|
|
using Furion.RemoteRequest.Extensions; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using ResponDataBase = BPA.SAAS.Manage.Application.AExternalPlatform.BaseDto.ResponDataBase; |
|
|
|
|
|
|
|
namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Device.Services |
|
|
|
{ |
|
|
@@ -154,6 +157,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Device.Services |
|
|
|
{ |
|
|
|
groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value |
|
|
|
}).SetHttpMethod(HttpMethod.Get).GetAsStringAsync(); |
|
|
|
var resStop = JsonConvert.DeserializeObject<ResponDataBase>(responseStop); |
|
|
|
if (resStop.statusCode != "200") throw Oops.Oh("获取场景数据失败"); |
|
|
|
var dataStop = JsonConvert.DeserializeObject<List<StopDto>>(resStop.data.ToString()); |
|
|
|
if (dataStop.Count==0) throw Oops.Oh("获取场景数据失败"); |
|
|
|
if(!dataStop.Where(x=>x.Id == dto.StopId).Any()) throw Oops.Oh("场景不存在"); |
|
|
|
|
|
|
|
var checkProduct = SqlSugarDb.Db.Queryable<BPA_Product>().Where(x => x.Id == dto.ProductId).Any(); |
|
|
|
if (!checkProduct) throw Oops.Oh(ErrorCodeEnum.Code10010); |
|
|
|
var checkProductVesion = SqlSugarDb.Db.Queryable<BPA_ProductVesion>().Where(x => x.Id == dto.ProductVersionId).Any(); |
|
|
@@ -172,6 +181,12 @@ namespace BPA.SAAS.Manage.Application.AExternalPlatform.Service.Device.Services |
|
|
|
{ |
|
|
|
groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value |
|
|
|
}).SetHttpMethod(HttpMethod.Get).GetAsStringAsync(); |
|
|
|
var resStop = JsonConvert.DeserializeObject<ResponDataBase>(responseStop); |
|
|
|
if (resStop.statusCode != "200") throw Oops.Oh("获取场景数据失败"); |
|
|
|
var dataStop = JsonConvert.DeserializeObject<List<StopDto>>(resStop.data.ToString()); |
|
|
|
if (dataStop.Count == 0) throw Oops.Oh("获取场景数据失败"); |
|
|
|
if (!dataStop.Where(x => x.Id == dto.StopId).Any()) throw Oops.Oh("场景不存在"); |
|
|
|
|
|
|
|
var checkProduct = SqlSugarDb.Db.Queryable<BPA_Product>().Where(x => x.Id == dto.ProductId).Any(); |
|
|
|
if (!checkProduct) throw Oops.Oh(ErrorCodeEnum.Code10010); |
|
|
|
var checkProductVesion = SqlSugarDb.Db.Queryable<BPA_ProductVesion>().Where(x => x.Id == dto.ProductVersionId).Any(); |
|
|
|