陈勇
2026-04-06 9de6c7c6d835ba5161d64114d154bfc7676244a1
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
using AngleSharp.Dom;
using Mapster;
using Masuit.Tools;
using SqlSugar;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq.Expressions;
using WIDESEA_Core;
using WIDESEA_IRecordService;
 
namespace WIDESEA_StorageBasicService;
 
public class VV_StockInfoService : ServiceBase<VV_StockInfo, IVV_StockInfoRepository>, IVV_StockInfoService
{
    private readonly IDt_PalletStockInfoRepository _repository;
    private readonly IStockQuantityChangeRecordService _stockQuantityChangeRecord;
    public VV_StockInfoService(IVV_StockInfoRepository BaseDal, IDt_PalletStockInfoRepository repository, IStockQuantityChangeRecordService stockQuantityChangeRecord) : base(BaseDal)
    {
        _repository = repository;
        _stockQuantityChangeRecord = stockQuantityChangeRecord;
    }
 
    public WebResponseContent stockLock(object[] keys)
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            foreach (var item in keys)
            {
                var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item));
                if (stock.LockOrder != 1){
                    stock.StockStatus = 1;
                    _repository.UpdateData(stock);
                }
 
            }
            return content.OK("锁定成功!");
        }
        catch (Exception e)
        {
            return content.Error(e.Message);
        }
 
    }
 
    public WebResponseContent stockUnLock(object[] keys)
    {
        WebResponseContent content = new WebResponseContent();
        try
        {
            foreach (var item in keys)
            {
                var stock = _repository.QueryFirst(x => x.Id == Convert.ToInt32(item));
                stock.StockStatus = 0;
                _repository.UpdateData(stock);
 
            }
            return content.OK("解锁成功!");
        }
        catch (Exception e)
        {
            return content.Error(e.Message);
        }
 
    }
}