gwbvipvip 11 miesięcy temu
rodzic
commit
286974c61d
12 zmienionych plików z 90 dodań i 44 usunięć
  1. BIN
     
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. BIN
     
  6. +70
    -23
      BPA.KitChen.GroupMeal.Application/Service/Applet/AppletService.cs
  7. +2
    -0
      BPA.KitChen.GroupMeal.Application/Service/Applet/Dtos/MiniStoreConfigurationInput.cs
  8. +2
    -0
      BPA.KitChen.GroupMeal.Application/Service/Device/Dtos/DevicePushRecodeDtoPageInput.cs
  9. +3
    -1
      BPA.KitChen.GroupMeal.Application/Service/Device/Services/DevicePushRecodeService.cs
  10. +11
    -18
      BPA.KitChen.GroupMeal.Application/Service/OneCard/Member/MemberInfo/MemberInfoService.cs
  11. +1
    -1
      BPA.KitChen.GroupMeal/Properties/launchSettings.json
  12. +1
    -1
      BPA.KitChen.GroupMeal/appsettings.json





+ 70
- 23
BPA.KitChen.GroupMeal.Application/Service/Applet/AppletService.cs Wyświetl plik

@@ -129,11 +129,11 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
[HttpPost("/api/AppletService/MaterialAdd")]
public async Task MaterialAdd(AddMiniStorePageMaterialInput input)
{
//var res = await db.Queryable<MiniStorePageConfig>().FirstAsync(x => x.MaterialCode == input.MaterialCode && x.PageId==input.PageId);
//if (res != null)
//{
// throw Oops.Bah("素材编码重复");
//}
var res = await db.Queryable<MiniStorePageConfig>().FirstAsync(x => x.MaterialCode == input.MaterialCode && x.PageId == input.PageId);
if (res != null)
{
throw Oops.Bah("素材编码重复");
}
MiniStorePageConfig data = input.Adapt<MiniStorePageConfig>();
await db.Insertable(data).ExecuteCommandAsync();
}
@@ -210,11 +210,11 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
throw Oops.Bah("没有找到数据");
}
//判断编码重复
//var data1 = await db.Queryable<MiniStorePageConfig>().FirstAsync(x => x.Id != input.Id && x.MaterialCode == input.MaterialCode&& x.PageId != input.PageId);
//if (data1!=null)
//{
// throw Oops.Bah("编码重复");
//}
var data1 = await db.Queryable<MiniStorePageConfig>().FirstAsync(x => x.Id != input.Id && x.MaterialCode == input.MaterialCode && x.PageId == input.PageId);
if (data1 != null)
{
throw Oops.Bah("编码重复");
}
data.MaterialName = input.MaterialName;
data.MaterialPath = input.MaterialPath;
data.PageId = input.PageId;
@@ -229,17 +229,25 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
/// <returns></returns>
[HttpPost("/api/AppletService/MiniStoreMaterial")]
[AllowAnonymous]
public async Task<List<MiniStorePageConfigOutput>> MiniStoreMaterial(QueryMiniStorePageInput input)
public async Task<SqlSugarPagedList<MiniStorePageConfigOutput>> MiniStoreMaterial(QueryMiniStorePageInput input)
{
List<MiniStorePageConfigOutput> outputs = new();
var datas = await db.Queryable<MiniStorePage>().Where(x => x.StoreId == input.StoreId).ToListAsync();
foreach (var item in datas)
var datas = await db.Queryable<MiniStorePage>().Where(x => x.StoreId == input.StoreId && x.Id == input.PageId).ToListAsync();

if (datas.Count > 0)
{
var ids = datas.Select(x => x.Id);

var pageList = await db.Queryable<MiniStorePageConfig>().Where(x => ids.Contains(x.PageId))
.OrderBy(x => x.Id)
.ToPagedListAsync(input.Current, input.PageSize);



MiniStorePageConfigOutput output = new();
output.PageName = item.PageName;
output.PageRoute = item.PageRoute;
var lists = await db.Queryable<MiniStorePageConfig>().Where(x => x.PageId == item.Id).ToListAsync();
foreach (var materialItem in lists)
output.PageName = datas[0]?.PageName ?? "";
output.PageRoute = datas[0]?.PageRoute ?? "";
foreach (var materialItem in pageList.Items)
{
MiniStorePageMaterialOutput material = new();
material.MaterialName = materialItem.MaterialName;
@@ -250,9 +258,23 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
output.List.Add(material);
}
outputs.Add(output);
return new SqlSugarPagedList<MiniStorePageConfigOutput>()
{
Items = outputs,
PageIndex = pageList.PageIndex,
PageSize = pageList.PageSize,
TotalCount = pageList.TotalCount,
TotalPages = pageList.TotalPages,

};
}

return outputs;

return new SqlSugarPagedList<MiniStorePageConfigOutput>()
{
Items = new List<MiniStorePageConfigOutput>()
};

}
#endregion

@@ -264,7 +286,13 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
try
{
db.Ado.BeginTran();
var payTemplate = await db.Insertable(new BPA_PayTemplate()

var payTemplate = db.Queryable<BPA_PayTemplate>().First(x => x.IsDeleted == 0 && x.Name == inputDto.Name);
if (payTemplate != null)
{
throw Oops.Bah("名称重复");
}
payTemplate = await db.Insertable(new BPA_PayTemplate()
{
Name = inputDto.Name,
}).CallEntityMethod(t => t.Create()).ExecuteReturnEntityAsync();
@@ -300,9 +328,10 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
db.Ado.CommitTran();
return result;
}
catch (Exception)
catch (Exception e)
{
db.Ado.RollbackTran();
throw Oops.Bah(e.Message);
return false;
}
}
@@ -345,7 +374,7 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
int total = 0;
var res = db.Queryable<BPA_PayTemplate>()
.Where(x => x.IsDeleted == 0)
.WhereIF(!string.IsNullOrEmpty(inputDto.Name),x=>x.Name.Contains(inputDto.Name))
.WhereIF(!string.IsNullOrEmpty(inputDto.Name), x => x.Name.Contains(inputDto.Name))
.Select(t => new PayTemplateOutDto
{
Id = t.Id.SelectAll(),
@@ -385,10 +414,17 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
[HttpPost("/api/paytemplate/update")]
public async Task<bool> Update(PayTemplateCreateOrUpdateInputDto inputDto)
{
var payTemplate = db.Queryable<BPA_PayTemplate>().First(x => x.Id == inputDto.Id && x.IsDeleted == 0);
var payTemplate = db.Queryable<BPA_PayTemplate>().First(x => x.Id != inputDto.Id && x.IsDeleted == 0 && x.Name == inputDto.Name);
if (payTemplate != null)
{
throw Oops.Bah("名称重复");
}

payTemplate = db.Queryable<BPA_PayTemplate>().First(x => x.Id == inputDto.Id && x.IsDeleted == 0);
if (payTemplate == null) return false;
payTemplate.Name = inputDto.Name;


var payTemplateInfo = db.Queryable<BPA_PayTemplateInfo>().Where(x => x.PayTemplateId == inputDto.Id).ToList();
foreach (var item in payTemplateInfo)
{
@@ -432,6 +468,12 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
[HttpPost("/api/appid/add")]
public async Task<bool> AppidAdd(BPA_AppIdConfig inputDto)
{
var data = db.Queryable<BPA_AppIdConfig>().First(x => x.IsDeleted == 0 && x.AppId == inputDto.AppId);
if (data != null)
{
throw Oops.Bah("AppId重复");
}

try
{
var result = await db.Insertable(inputDto).CallEntityMethod(t => t.Create()).ExecuteCommandAsync() > 0;
@@ -489,7 +531,12 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet
[HttpPost("/api/appid/update")]
public async Task<bool> AppidUpdate(BPA_AppIdConfig inputDto)
{
var data = db.Queryable<BPA_AppIdConfig>().First(x => x.Id == inputDto.Id && x.IsDeleted == 0);
var data= db.Queryable<BPA_AppIdConfig>().First(x => x.Id != inputDto.Id && x.IsDeleted == 0&&x.AppId==inputDto.AppId);
if (data != null)
{
throw Oops.Bah("AppId重复");
}
data = db.Queryable<BPA_AppIdConfig>().First(x => x.Id == inputDto.Id && x.IsDeleted == 0);
if (data == null) return false;
data.AppId = inputDto.AppId;
try


+ 2
- 0
BPA.KitChen.GroupMeal.Application/Service/Applet/Dtos/MiniStoreConfigurationInput.cs Wyświetl plik

@@ -65,6 +65,8 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Applet.Dtos
/// 主键
/// </summary>
public string StoreId { get; set; }

public string PageId { get; set; }
}
#endregion



+ 2
- 0
BPA.KitChen.GroupMeal.Application/Service/Device/Dtos/DevicePushRecodeDtoPageInput.cs Wyświetl plik

@@ -13,5 +13,7 @@ namespace BPA.SAAS.KitChenManage.Application.Device.Dtos
/// 下发类型1商品 2物料 3配方
/// </summary>
public int Type { get; set; }

public string DeviceName { get; set; }
}
}

+ 3
- 1
BPA.KitChen.GroupMeal.Application/Service/Device/Services/DevicePushRecodeService.cs Wyświetl plik

@@ -48,7 +48,9 @@ namespace BPA.KitChen.GroupMeal.Application.Service.Device.Services
public async Task<PageUtil> Page(DevicePushRecodeDtoPageInput input)
{
RefAsync<int> total = 0;
var res = await _db.Queryable<BPA_DevicePushRecode>().Where(x=>x.Type== input.Type)
var res = await _db.Queryable<BPA_DevicePushRecode>()
.WhereIF(!string.IsNullOrEmpty(input.DeviceName),x=>x.DeviceName.Contains(input.DeviceName))
.Where(x=>x.Type== input.Type)
.Select(t => new
{
CreateAt = t.CreateAt,


+ 11
- 18
BPA.KitChen.GroupMeal.Application/Service/OneCard/Member/MemberInfo/MemberInfoService.cs Wyświetl plik

@@ -458,34 +458,27 @@ namespace BPA.KitChen.GroupMeal.Application.Service.OneCard.Member.MemberInfo
{
db.BeginTran();
//查询当前会员绑定的标签
var data = db.Queryable<BPA_MemberTagInfo>().Where(x => x.MemberInfo_Id == inputDto.MemberInfo_Id && inputDto.PlatformType == x.PlatformType).ToList();
var data = db.Queryable<BPA_MemberTagInfo>()
.Where(x => x.MemberInfo_Id == inputDto.MemberInfo_Id
&& inputDto.PlatformType == x.PlatformType
).ToList();
data.ForEach(item =>
{
item.IsDeleted = 1;
});
//全部删除
db.Updateable(data).CallEntityMethod(m => m.Modify()).ExecuteCommand();
db.Deleteable(data).ExecuteCommand();

//添加会员标签
foreach (var item in inputDto.Tags)
{
var thisMemberTagInfo = data.Where(x => x.MemberInfo_Id == inputDto.MemberInfo_Id && x.MemberTag_Id == item).FirstOrDefault();

if (thisMemberTagInfo != null)
{
db.Updateable(new BPA_MemberTagInfo() { IsDeleted = 0 }).UpdateColumns(it => new { it.IsDeleted })
.Where(x => x.MemberInfo_Id == inputDto.MemberInfo_Id && x.MemberTag_Id == item).ExecuteCommand();
}
else
db.Insertable(new BPA_MemberTagInfo()
{
db.Insertable(new BPA_MemberTagInfo()
{
PlatformType = inputDto.PlatformType,
MemberInfo_Id = inputDto.MemberInfo_Id,
MemberTag_Id = item

}).CallEntityMethod(m => m.Create()).ExecuteCommand();
}
PlatformType = inputDto.PlatformType,
MemberInfo_Id = inputDto.MemberInfo_Id,
MemberTag_Id = item

}).CallEntityMethod(m => m.Create()).ExecuteCommand();
}
db.CommitTran();
return await Task.FromResult(true);


+ 1
- 1
BPA.KitChen.GroupMeal/Properties/launchSettings.json Wyświetl plik

@@ -14,7 +14,7 @@
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "api/index.html",
"applicationUrl": "http://localhost:5298",
"applicationUrl": "http://localhost:5002",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}


+ 1
- 1
BPA.KitChen.GroupMeal/appsettings.json Wyświetl plik

@@ -32,7 +32,7 @@
"UserName": "emqx_u_block",
"Password": "emqx_p_admin8765490789"
},
"SAAS_Manage": "http://10.2.1.26:21995/saasbase/",
"SAAS_Manage": "http://localhost:5001/",
"DBConnectionStr": "server=10.2.1.21;Port=3306;Database=bpa_kitchen_groupmeal;Uid=root;Pwd=cygadmin;",
"AllowedHosts": "*"
}

Ładowanie…
Anuluj
Zapisz