111
zhanghonglin
2026-01-05 f797a0e6d079aa25aee23d7aa4064d144d1efa74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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;
        }
    }
}