@@ -128,11 +128,11 @@ namespace BPA.KitChen.StoreManagement.Application.Service.Applet | |||||
[HttpPost("/api/AppletService/MaterialAdd")] | [HttpPost("/api/AppletService/MaterialAdd")] | ||||
public async Task MaterialAdd(AddMiniStorePageMaterialInput input) | 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 ); | |||||
if (res != null) | |||||
{ | |||||
throw Oops.Bah("素材编码重复"); | |||||
} | |||||
MiniStorePageConfig data = input.Adapt<MiniStorePageConfig>(); | MiniStorePageConfig data = input.Adapt<MiniStorePageConfig>(); | ||||
await db.Insertable(data).ExecuteCommandAsync(); | await db.Insertable(data).ExecuteCommandAsync(); | ||||
} | } | ||||
@@ -209,11 +209,11 @@ namespace BPA.KitChen.StoreManagement.Application.Service.Applet | |||||
throw Oops.Bah("没有找到数据"); | 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 ); | |||||
if (data1 != null) | |||||
{ | |||||
throw Oops.Bah("编码重复"); | |||||
} | |||||
data.MaterialName = input.MaterialName; | data.MaterialName = input.MaterialName; | ||||
data.MaterialPath = input.MaterialPath; | data.MaterialPath = input.MaterialPath; | ||||
data.PageId = input.PageId; | data.PageId = input.PageId; | ||||
@@ -263,6 +263,7 @@ namespace BPA.KitChen.StoreManagement.Application.Service.Applet | |||||
try | try | ||||
{ | { | ||||
db.Ado.BeginTran(); | db.Ado.BeginTran(); | ||||
var payTemplate = await db.Insertable(new BPA_PayTemplate() | var payTemplate = await db.Insertable(new BPA_PayTemplate() | ||||
{ | { | ||||
Name = inputDto.Name, | Name = inputDto.Name, | ||||
@@ -37,6 +37,7 @@ namespace BPA.KitChen.StoreManagement.Application.Service.ShopManage.Printer.Dto | |||||
public object IsHost { get; set; } | public object IsHost { get; set; } | ||||
public DateTime? CreateAt { get; set; } | |||||
public List<string> goodsIdList { get; set; } | public List<string> goodsIdList { get; set; } | ||||
@@ -177,7 +177,9 @@ namespace BPA.KitChen.StoreManagement.Application.Service.ShopManage.Printer | |||||
TemplaterId = d.Value, | TemplaterId = d.Value, | ||||
TerminalId = a.TerminalId, | TerminalId = a.TerminalId, | ||||
TerminalKey = a.TerminalKey, | TerminalKey = a.TerminalKey, | ||||
StoreId=b.Value | |||||
StoreId=b.Value, | |||||
CreateAt = a.CreateAt, | |||||
}).ToList(); | }).ToList(); | ||||
var goodsId = db.Queryable<BPA_PrinterConfigure>().Where(x => | var goodsId = db.Queryable<BPA_PrinterConfigure>().Where(x => | ||||
@@ -21,10 +21,11 @@ namespace BPA.KitChen.StoreManagement.Application.Service.ShopManage.StoreAdvert | |||||
/// 广告标题 | /// 广告标题 | ||||
/// </summary> | /// </summary> | ||||
public string Title { get; set; } | public string Title { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 广告内容 | /// 广告内容 | ||||
/// </summary> | /// </summary> | ||||
public string Content { get; set; } | |||||
public string Content { get; set; } = ""; | |||||
/// <summary> | /// <summary> | ||||
/// 广告开始时间 | /// 广告开始时间 | ||||
/// </summary> | /// </summary> | ||||
@@ -36,7 +37,7 @@ namespace BPA.KitChen.StoreManagement.Application.Service.ShopManage.StoreAdvert | |||||
/// <summary> | /// <summary> | ||||
/// 状态 0启用 1停用 | /// 状态 0启用 1停用 | ||||
/// </summary> | /// </summary> | ||||
public string Status { get; set; } | |||||
public int Status { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// 图片存储路径 | /// 图片存储路径 | ||||
/// </summary> | /// </summary> | ||||
@@ -4,6 +4,7 @@ using BPA.KitChen.StoreManagement.Application.Service.ShopManage.StoreDesktopNum | |||||
using BPA.KitChen.StoreManagement.Core.Common; | using BPA.KitChen.StoreManagement.Core.Common; | ||||
using BPA.KitChen.StoreManagement.Core.Common.Const; | using BPA.KitChen.StoreManagement.Core.Common.Const; | ||||
using BPA.KitChen.StoreManagement.Core.Entity; | using BPA.KitChen.StoreManagement.Core.Entity; | ||||
using BPA.KitChen.StoreManagement.Core.Enum; | |||||
using BPA.KitChen.StoreManagement.SqlSugar; | using BPA.KitChen.StoreManagement.SqlSugar; | ||||
using Furion; | using Furion; | ||||
using Furion.DependencyInjection; | using Furion.DependencyInjection; | ||||
@@ -163,7 +164,7 @@ namespace BPA.KitChen.StoreManagement.Application.Service.ShopManage.StoreAdvert | |||||
EndTime = item.EndTime, | EndTime = item.EndTime, | ||||
VideoUrl = item.VideoUrl, | VideoUrl = item.VideoUrl, | ||||
StoreId = item.StoreId, | StoreId = item.StoreId, | ||||
Status = ((int)item.Status).ToString(), | |||||
Status = ((int)item.Status), | |||||
Step = item.Step, | Step = item.Step, | ||||
CreateAt = item.CreateAt, | CreateAt = item.CreateAt, | ||||
ImageUrl = imageUrls, | ImageUrl = imageUrls, | ||||
@@ -244,17 +245,10 @@ namespace BPA.KitChen.StoreManagement.Application.Service.ShopManage.StoreAdvert | |||||
public async Task<bool> UpdateStoreAdvertisementStatusAsync(StoreAdvertisementEntityDto inputDto) | public async Task<bool> UpdateStoreAdvertisementStatusAsync(StoreAdvertisementEntityDto inputDto) | ||||
{ | { | ||||
var data = await db.Queryable<BPA_StoreAdvertisement>().Where(x => x.Id == inputDto.Id).FirstAsync(); | var data = await db.Queryable<BPA_StoreAdvertisement>().Where(x => x.Id == inputDto.Id).FirstAsync(); | ||||
data.Status=(CommonStatus)inputDto.Status; | |||||
if (data != null) | if (data != null) | ||||
{ | { | ||||
var res = await db.Updateable<BPA_StoreAdvertisement>(inputDto.Adapt<BPA_StoreAdvertisement>()).CallEntityMethod(i => i.Modify()) | |||||
.UpdateColumns(x => new | |||||
{ | |||||
x.Status, | |||||
x.UpdateAt, | |||||
x.UpdateBy | |||||
}) | |||||
.Where(x => x.Id == inputDto.Id).ExecuteCommandAsync(); | |||||
var res = await db.Updateable<BPA_StoreAdvertisement>(data).CallEntityMethod(i => i.Modify()).ExecuteCommandAsync(); | |||||
return res > 0; | return res > 0; | ||||
} | } | ||||