服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-19 5f5d8997fb860e8554a9bbb4d627715ca66b17cc
变量获取更新,获取出货信息更新
已修改5个文件
66 ■■■■■ 文件已修改
Tiger.Business.MES/BIZ/BIZ_MES_WO.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/Position.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/YadaPacking.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.IBusiness.MES/BIZ/IMES_WO.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/MES/ParameterEntity/BizMesWoParameter.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/BIZ/BIZ_MES_WO.cs
@@ -605,22 +605,34 @@
        /// </summary>
        /// <param name="wo"></param>
        /// <returns></returns>
        public async Task<ApiAction> GetShipList(string wo, string orgCode)
        public async Task<ApiAction<ShippingOutput>> GetShipList(string wo, string orgCode)
        {
            var result = new ApiAction();
            var result = new ApiAction<ShippingOutput>();
            try
            {
                DbClient db = Biz.DataSource["YadaU9C"].Client;
                var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q=>q.ORG_CODE == orgCode).FirstAsync();
                var shipList = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && SqlFunc.DateIsSame(q.BusinessDate, DateTime.Now) && q.Status == 2 && q.Org == org.ID.ToInt64()).ToList();
                if (shipList.Any())
                var org = await Biz.Db.Queryable<SYS_ORGANIZATION>().Where(q => q.ORG_CODE == orgCode).FirstAsync();
                var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && q.Org == org.ID.ToInt64()).First();
                if (!ship.IsNullOrEmpty())
                {
                    result.Data = shipList[0].ShipQty;
                    result.Data = ship.BusinessDate.Date == DateTime.Now.Date ? new()
                    {
                        ShippingQty = ship.ShipQty,
                        Tag = "Customer"
                    } : new()
                    {
                        ShippingQty = ship.ShipQty,
                        Tag = "InStoreLabel"
                    };
                    result.LocaleMsg = new($"出货信息存在!");
                }
                else
                {
                    result.Data = "InStoreLabel";
                    result.Data = new()
                    {
                        ShippingQty = 0,
                        Tag = "InStoreLabel"
                    };
                }
            }
            catch (Exception ex)
Tiger.Business.MES/Transaction/Position.cs
@@ -606,7 +606,7 @@
                                    }
                                    if (curAction is PrintInStoreLabel)
                                    {
                                        qtylist = (curAction as PrintInStoreLabel).CurPkg.Item.GetMinPackageList().Select(q => q.SN).ToList();
                                        qtylist = (curAction as PrintInStoreLabel).CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                    }
                                    return $"{qtylist.Count}";
                                case "GetModel":
@@ -626,7 +626,8 @@
                                    var _orderAction = curAction is PackingAction ? curAction as PackingAction : null;
                                    if (_orderAction != null)
                                    {
                                        var snList = _orderAction.CurPkg.Item.GetMinPackageList().Select(q => q.FLOW_SN).ToList();
                                        //var snList = _orderAction.CurPkg.Item.GetMinPackageList().Select(q => q.FLOW_SN).ToList();
                                        var snList = _orderAction.CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                                        if (!snList.Any())
                                        {
                                            snList.Add(_orderAction.CurPkg.CustSN?.FLOW_SN);
@@ -769,7 +770,8 @@
            if (action is PackingAction)
            {
                var pkg = action as PackingAction;
                minPkgList = pkg.CurPkg.Item.GetMinPackageList().Select(q => q.SN).ToList();
                //minPkgList = pkg.CurPkg.Item.GetMinPackageList().Select(q => q.SN).ToList();
                minPkgList = pkg.CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                itemCode = pkg.CurPkg.CustSN?.ITEM_CODE;
                weight = pkg.CurPkg.WeightInfo.Weight;
                unit = pkg.CurPkg.WeightInfo.Unit?.ToUpper() ?? "kg";
@@ -777,7 +779,8 @@
            if (action is PrintInStoreLabel)
            {
                var print = action as PrintInStoreLabel;
                minPkgList = print.CurPkg.Item.GetMinPackageList().Select(q => q.SN).ToList();
                //minPkgList = print.CurPkg.Item.GetMinPackageList().Select(q => q.SN).ToList();
                minPkgList = print.CurPkg.Item.GetWipSnList().Select(q => q.Value).ToList();
                itemCode = print.CurPkg.CustSN?.ITEM_CODE;
                weight = print.CurPkg.WeightInfo.Weight;
                unit = print.CurPkg.WeightInfo.Unit?.ToUpper() ?? "kg";
Tiger.Business.MES/Transaction/YadaPacking.cs
@@ -50,16 +50,16 @@
            var action = new ApiAction<SubmitOutput>(new SubmitOutput());
            try
            {
                if (input.Qty.ToInt32() <= 0)
                {
                    action.Data.ShortMsg = new("请输入包装数量", ShortMessage.Types.Error);
                    action.Data.OperInfo = new();
                    action.Data.Data = "QtyError";
                    action.IsSuccessed = false;
                    action.LocaleMsg = new($"包装数量[{input.Qty}]不正确,请重新输入数量后继续包装操作");
                    //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.QtyError", input.Qty);
                    return action;
                }
                //if (input.Qty.ToInt32() <= 0)
                //{
                //    action.Data.ShortMsg = new("请输入包装数量", ShortMessage.Types.Error);
                //    action.Data.OperInfo = new();
                //    action.Data.Data = "QtyError";
                //    action.IsSuccessed = false;
                //    action.LocaleMsg = new($"包装数量[{input.Qty}]不正确,请重新输入数量后继续包装操作");
                //    //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.QtyError", input.Qty);
                //    return action;
                //}
                if (input.Options.ContainsKey("IsPrintCustomerLabel"))
                {
                    IsPrintCustomerLabel = input.Options["IsPrintCustomerLabel"].ToBoolean();
Tiger.IBusiness.MES/BIZ/IMES_WO.cs
@@ -21,7 +21,7 @@
        public Task<ApiAction> AddOrEditLabelVarByWorkOrder(BAS_LABEL_VAR_WO input);
        public Task<ApiAction<QueryAble<BAS_LABEL_VAR_WO>>> GetLabelVarByWorkOrder(BizLabelVarWoInput input);
        public Task<ApiAction> GetRePrintInfo(RePrintInput input);
        public Task<ApiAction> GetShipList(string wo, string orgCode);
        public Task<ApiAction<ShippingOutput>> GetShipList(string wo, string orgCode);
        public Task<ApiAction> SavePrintLabelInAct(string code);
        public Task<ApiAction> UnbindWipSnFromWO(UnbindWipSnInput input);
        public Task<ApiAction<InStoreInfo>> GetErpProdInBth(string code);
Tiger.Model.Net/Entitys/MES/ParameterEntity/BizMesWoParameter.cs
@@ -43,4 +43,11 @@
        public string SN { get; set; }
        public string user { get; set; }
    }
    public class ShippingOutput
    {
        public string Tag { get; set; }
        public double ShippingQty { get; set; }
    }
}