服务端的TigerApi 框架,基于.NET6 2024 版本
YangYuGang
2 天以前 e26f91635aa0343f6f5c201c95d20141dc465ed3
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
using Rhea.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tiger.IBusiness;
using Tiger.Model;
using Tiger.Model.Minsun;
 
namespace Tiger.Business.WMS
{
    /// <summary>
    /// 更新领料单状态
    /// </summary>
    public partial class AGV
    {
        public ApiAction UpdateStatus(AgvMRUpdateInput input)
        {
            ApiAction response = new();
            try
            {
                DbClient db = Biz.DataSource["WMS57"].Client;
                BIZ_ERP_PROD_OUT entity = new BIZ_ERP_PROD_OUT();
                BIZ_ERP_PROD_OUT entity_x = db.Queryable<BIZ_ERP_PROD_OUT>().Where(x => x.SOURCECODE.Contains(input.taskId)).First();
 
                if (entity_x != null)
                {
                    entity = entity_x;
                }
                else
                {
                    response.IsSuccessed = false;
                    response.Message = $"任务ID[{input.taskId}]在领料单中查不到记录";
                    return response;
                }
                entity.STATUS = BIZ_ERP_PROD_OUT.STATUSs.COMPLETE.GetValue();
                entity.ERP_BILL_CODE = "手工过账";
 
                //保存数据库
                var dbTran = db.UseTran(() =>
                {
                    db.Updateable(entity).UpdateColumns(x => new { x.STATUS, x.ERP_BILL_CODE }).ExecuteCommand();
                });
                if (!dbTran.IsSuccess)
                {
                    response.GetResponse().CatchExceptionWithLog(dbTran.ErrorException);
                }
                response.Message = $"领料单[{entity.BILLCODE}]更新状态成功,agv可清除";
            }
            catch (Exception ex)
            {
                response.GetResponse().CatchExceptionWithLog(ex);
            }
            return response;
        }
    }
}