using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEA_Core;
|
using WIDESEA_Core.BaseRepository;
|
using WIDESEA_Core.BaseServices;
|
using WIDESEA_IStockService;
|
using WIDESEA_Model.Models.Stock;
|
using WIDESEAWCS_Model.Models.TaskInfo;
|
|
namespace WIDESEA_StockService
|
{
|
public class OutstockinfoService : ServiceBase<Dt_Outstockinfo, IRepository<Dt_Outstockinfo>>, IOutstockinfoService
|
{
|
public OutstockinfoService(IRepository<Dt_Outstockinfo> BaseDal) : base(BaseDal)
|
{
|
}
|
|
public IRepository<Dt_Outstockinfo> Repository => BaseDal;
|
|
//刷新首页设置
|
public Dt_Outstockinfo Refresh()
|
{
|
Dt_Outstockinfo Outstockinfo = new Dt_Outstockinfo();
|
Outstockinfo = selectOutstockinfo();
|
return Outstockinfo;
|
}
|
|
//查询设置数据
|
public Dt_Outstockinfo selectOutstockinfo()
|
{
|
Dt_Outstockinfo Outstockinfo = new Dt_Outstockinfo();
|
Outstockinfo = BaseDal.QueryFirst(x => x.Id == 1);
|
return Outstockinfo;
|
}
|
|
//修改首页设置
|
public WebResponseContent UpdateOutstockinfo(int num)
|
{
|
WebResponseContent content = new WebResponseContent();
|
Dt_Outstockinfo Outstockinfo = selectOutstockinfo();
|
|
//出库优先
|
if (num == 1)
|
{
|
if (Outstockinfo.BigOrLittle == 0)
|
{
|
Outstockinfo.BigOrLittle = 1;
|
}
|
else
|
{
|
Outstockinfo.BigOrLittle = 0;
|
}
|
}
|
//入库模式切换
|
else if (num == 2)
|
{
|
if (Outstockinfo.OutMode == 0)
|
{
|
Outstockinfo.OutMode = 1;
|
}
|
else
|
{
|
Outstockinfo.OutMode = 0;
|
}
|
}
|
BaseDal.UpdateData(Outstockinfo);
|
return content;
|
}
|
}
|
}
|