zhaoy před 10 měsíci
rodič
revize
8439926f6d
7 změnil soubory, kde provedl 59 přidání a 5 odebrání
  1. +1
    -1
      BPA.SAAS.Manage.Application/Device/Dtos/Device/DeviceInfoBaseDto.cs
  2. +2
    -0
      BPA.SAAS.Manage.Application/Device/Dtos/Device/DeviceInfoQueryDto.cs
  3. +21
    -0
      BPA.SAAS.Manage.Application/Device/Dtos/Device/StoreDto.cs
  4. +17
    -3
      BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs
  5. +16
    -0
      BPA.SAAS.Manage.Core/Base/ResponDataBase.cs
  6. +1
    -1
      BPA.SAAS.Manage.Core/Device/BPA_DeviceInfo.cs
  7. +1
    -0
      BPA.SAAS.Manage.Web.Entry/appsettings.json

+ 1
- 1
BPA.SAAS.Manage.Application/Device/Dtos/Device/DeviceInfoBaseDto.cs Zobrazit soubor

@@ -22,7 +22,7 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device
/// <summary>
///归属场景(店铺)
/// </summary>
public string OrgId { get; set; }
public string StopId { get; set; }
/// <summary>
/// 所属产品
/// </summary>


+ 2
- 0
BPA.SAAS.Manage.Application/Device/Dtos/Device/DeviceInfoQueryDto.cs Zobrazit soubor

@@ -48,5 +48,7 @@ namespace BPA.SAAS.Manage.Application.Device.Dtos.Device
public string OrgKey { get; set; }
public string ProductVersionName { get; set; }
public int TechnologyOrBom { get; set; }
public string StopId { get; set; }
public string StopName { get; set; }
}
}

+ 21
- 0
BPA.SAAS.Manage.Application/Device/Dtos/Device/StoreDto.cs Zobrazit soubor

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Application.Device.Dtos.Device
{
public class StoreDto
{
public string Id { get; set; }
public string Name { get; set; }
public string OrgId { get; set; }
public string OrgName { get; set; }
public string Phone { get; set; }
public int Sort { get; set; }
public string Description { get; set; }
public string GroupId { get; set; }
public DateTime CreateAt { get; set; }
}
}

+ 17
- 3
BPA.SAAS.Manage.Application/Device/Services/DeviceService.cs Zobrazit soubor

@@ -1,4 +1,5 @@
using BPA.SAAS.Manage.Application.Device.Dtos.Device;
using BPA.SAAS.Manage.Application.DataBase.Dtos.GoodsAttribute;
using BPA.SAAS.Manage.Application.Device.Dtos.Device;
using BPA.SAAS.Manage.Application.Device.Interface;
using BPA.SAAS.Manage.Comm.Const;
using BPA.SAAS.Manage.Comm.Enum;
@@ -10,6 +11,8 @@ using BPA.SAAS.Manage.Core.Org;
using BPA.SAAS.Manage.Core.Product;
using BPA.SAAS.Manage.Core.system;
using Dm;
using Furion.RemoteRequest.Extensions;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -20,6 +23,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
{
public class DeviceService: IDeviceService, ITransient
{
private string BaseServerUrl=App.GetConfig<string>("baseurl");
ISqlSugarClient _db;
public DeviceService(ISqlSugarClient db)
{
@@ -32,10 +36,18 @@ namespace BPA.SAAS.Manage.Application.Device.Services
/// <returns></returns>
public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto)
{
var getStoreurl = BaseServerUrl + "api/goodsattribute/getstorelist_alm";//获取商品属性
var responseGoodsAttribute = await getStoreurl.SetHeaders(new
{
groupId = App.User?.FindFirst(ClaimConst.GroupId)?.Value
}).SetHttpMethod(HttpMethod.Get).GetAsStringAsync();
var resStore = JsonConvert.DeserializeObject<ResponDataBase>(responseGoodsAttribute);
if (resStore.statusCode != "200") throw Oops.Oh("获取场景数据失败");
var dataStore = JsonConvert.DeserializeObject<List<StoreDto>>(resStore.data.ToString());
RefAsync<int> total =0;
var data = await _db.Queryable<BPA_DeviceInfo, BPA_Product>((a, b) => new JoinQueryInfos(JoinType.Left, a.ProductId == b.Id))

.WhereIF(!string.IsNullOrWhiteSpace(inputDto.StoreId), (a, b) => a.OrgId == inputDto.StoreId)
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.StoreId), (a, b) => a.StopId == inputDto.StoreId)
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceName), (a, b) => a.DeviceName.Contains(inputDto.DeviceName))
.WhereIF(!string.IsNullOrWhiteSpace(inputDto.DeviceTypeId), (a, b) => a.DeviceTypeId == inputDto.DeviceTypeId)
.OrderBy((a, b) => a.CreateAt, OrderByType.Desc)
@@ -44,12 +56,14 @@ namespace BPA.SAAS.Manage.Application.Device.Services
Id = a.Id.SelectAll(),
ProductName=b.Name,
ProductCode=b.Code,
StopId=a.StopId,
ProductVersionName = ""
})
.Mapper(x =>
{
var Vesion = _db.Queryable<BPA_ProductVesion>().Where(c => c.Id == x.ProductVersionId).First();
x.ProductVersionName = Vesion?.Vesion;
x.StopName= dataStore?.Where(f=>f.Id==x.StopId).First()?.Name;
})
.ToPageListAsync(inputDto.Current, inputDto.PageSize, total);
return new PageUtil()
@@ -123,7 +137,7 @@ namespace BPA.SAAS.Manage.Application.Device.Services
{
x.DeviceName,
x.DeviceTypeId,
x.OrgId,
x.StopId,
x.ProductId,
x.ProductCode,
x.Status,


+ 16
- 0
BPA.SAAS.Manage.Core/Base/ResponDataBase.cs Zobrazit soubor

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.SAAS.Manage.Core.Base
{
public class ResponDataBase
{
public string statusCode { get; set; }
public object data { get; set; }
public string succeeded { get; set; }
public string errors { get; set; }
}
}

+ 1
- 1
BPA.SAAS.Manage.Core/Device/BPA_DeviceInfo.cs Zobrazit soubor

@@ -26,7 +26,7 @@ namespace BPA.SAAS.Manage.Core.Device
/// <summary>
///归属场景(店铺)
/// </summary>
public string OrgId { get; set; }
public string StopId { get; set; }
/// <summary>
/// 所属产品
/// </summary>


+ 1
- 0
BPA.SAAS.Manage.Web.Entry/appsettings.json Zobrazit soubor

@@ -8,6 +8,7 @@
}
},
"AllowedHosts": "*",
"baseurl": "http://192.168.1.19:5008/",
"ConnectionConfigs": [
{
"ConnectionString": "server=10.2.1.21;Database=bpa_kitchen_kitchenbasemanage;Uid=root;Pwd=cygadmin;Allow Zero Datetime=True;Convert Zero Datetime=True;",


Načítá se…
Zrušit
Uložit