服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2025-04-03 e163a27328c805ffec7c894259430f76f0881d00
Tiger.Business.WMS/Transaction/Yada/In_BIZ_U9_RECEIPT.cs
@@ -63,7 +63,7 @@
            catch (Exception ex)
            {
                //取消当前操作
                ResetScan();
                ResetTrans();
                //action.CatchExceptionWithLog(ex, $"扫描[{input.SN}]异常");
                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.Scan.ScanException", input.SN));
            }
@@ -135,11 +135,21 @@
                }
                //从U9获取收货单行信息
                var u9Dtl = Biz.DataSource["YadaU9C"].Client.Queryable<mes_ReturnedDocInfo>().Where(x => x.RcvId == receipt.ID.ToDouble() && x.DocLineNo == receiptDtl.LINE_NO.ToDouble() && x.SplitFlag != 1).First();
                //收货单的状态判断是否已提交IQC审核,未通过IQC不能上架
                if (!u9Dtl.IsNullOrEmpty() && u9Dtl.Status != 3)
                {
                    action.IsSuccessed = false;
                    //action.LocaleMsg = Biz.L("收货单行状态[{0}]异常,请先提交IQC检验结果");
                    action.LocaleMsg = Biz.L("WMS.In_BIZ_U9_RECEIPT.ScanItem.U9StatusException", u9Dtl.StatusName);
                    return SetOutPutMqttMsg(action, input.Locale);
                }
                if (!u9Dtl.IsNullOrEmpty() && u9Dtl.RcvQtyTU != receiptDtl.QTY_OK)
                {
                    receiptDtl.ID = u9Dtl.RcvLineId.ToString();
                    receiptDtl.QTY_OK = u9Dtl.RcvQtyTU;
                    receiptDtl.QTY_NG = receiptDtl.QTY - receiptDtl.QTY_OK;
                    receiptDtl.ERP_STATUS_CODE = u9Dtl.Status.ToString();
                    receiptDtl.ERP_STATUS_NAME = u9Dtl.StatusName;
                }
                var nLocation = new WMS_LOCATION();
@@ -192,7 +202,7 @@
                    action.IsSuccessed = false;
                    //action.LocaleMsg = Biz.L("储位[{0}]只能存放一个物料");
                    action.LocaleMsg = Biz.L("WMS.Default.ScanItem.LocationSingleFailure", nLocation.LOCATION_CODE);
                    ResetScan();
                    ResetTrans();
                    return SetOutPutMqttMsg(action, input.Locale);
                }
@@ -223,7 +233,7 @@
                {
                    action.IsSuccessed = false;
                    action.LocaleMsg = putonResult.LocaleMsg;
                    ResetScan();
                    ResetTrans();
                    return SetOutPutMqttMsg(action, input.Locale);
                }
@@ -289,7 +299,7 @@
                    var db = GetCommitDB();
                    //数据保存逻辑
                    db.Updateable(receipt, UserCode).UpdateColumns(q => new { q.STATUS, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand();
                    db.Updateable(receiptDtl, UserCode).UpdateColumns(q => new { q.ID, q.STATUS, q.QTY_IN, q.QTY_OK, q.QTY_NG, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand();
                    db.Updateable(receiptDtl, UserCode).UpdateColumns(q => new { q.ID, q.STATUS, q.QTY_IN, q.QTY_OK, q.QTY_NG, q.ERP_STATUS_CODE, q.ERP_STATUS_NAME, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand();
                    db.Updateable(receiptSn, UserCode).UpdateColumns(q => new { q.STATUS, q.IS_IN, q.UPDATE_TIME, q.UPDATE_USER }).ExecuteCommand();
                });
@@ -299,7 +309,7 @@
            catch (Exception ex)
            {
                //取消当前操作
                ResetScan();
                ResetTrans();
                //action.CatchExceptionWithLog(ex, $"扫描条码[{input.SN}]复核异常");
                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanItem.ScanException", input.SN));
            }
@@ -390,7 +400,7 @@
            catch (Exception ex)
            {
                //取消当前操作
                ResetScan();
                ResetTrans();
                //action.CatchExceptionWithLog(ex, $"扫描货架/储位[{0}]异常");
                action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanShelf.ScanException", Code));
            }
@@ -431,29 +441,30 @@
            action.LocaleMsg = Biz.L("WMS.Default.ScanItem.PutOnSucceeded", CurInvItem.SN, CurInvItem.Location.LOCATION_CODE);
            //重置工序
            ResetScanInfo();
            ResetScan();
            return SetOutPutMqttMsg(action, locale);
        }
        #endregion
        /// <summary>
        /// 重置当前操作,有需要则重写此方法
        /// 重置事务数据,有需要则重写此方法
        /// </summary>
        public override void ResetScan()
        public override void ResetTrans()
        {
            base.ResetScan();
            ResetScanInfo();
            ResetScan();
            CurScanShelf = null;
            base.ResetTrans();
        }
        /// <summary>
        /// 重置扫码信息
        /// 重置本次扫码信息
        /// </summary>
        public void ResetScanInfo()
        public override void ResetScan()
        {
            Command = null;
            Command = "Normal";
            CurInvItem = null;
            base.ResetScan();
        }
        public override bool Close(bool needSaveHistoryLog = false)