修改查询抽屉数,由原来ChannelStock改为从ChannelList表查询

This commit is contained in:
maqiao 2023-11-13 15:36:59 +08:00
parent b48f062e32
commit d61d6e9c13
4 changed files with 5 additions and 4 deletions

View File

@ -453,7 +453,7 @@ namespace DM_Weight.ViewModels
public void FindDrawerCount()
{
int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType != 3)
int count = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType != 3)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
Is8Drawer = count < 9;
Is16Drawer = count >= 16;

View File

@ -330,7 +330,7 @@ namespace DM_Weight.ViewModels
public void FindDrawerCount()
{
int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType != 3)
int count = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType != 3)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
Is8Drawer = count < 9;
Is16Drawer = count >= 16;

View File

@ -280,7 +280,8 @@ namespace DM_Weight.ViewModels
public void FindDrawerCount()
{
int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType != 3)
//int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType != 3)
int count = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType != 3)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
Is8Drawer = count < 9;
Is16Drawer = count >= 16;

View File

@ -237,7 +237,7 @@ namespace DM_Weight.ViewModels
public void FindDrawerCount()
{
int count = SqlSugarHelper.Db.Queryable<ChannelStock>().Where(cs => cs.DrawerType != 3)
int count = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerType != 3)
.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count();
Is16Drawer = count == 16;