上料防错单新增流水号回车调用方法,工序进站单新增流水号回车获取工序信息方法,新增系统参数“工序进站时默认带入数量”
7个文件已修改
242 ■■■■■ 已修改文件
DAL/车间管理/ClsSc_MaterToSourceBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/车间管理/ClsSc_MaterToSourceBillMain.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/条码管理/WEBSController.cs 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/StationBill.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/³µ¼ä¹ÜÀí/ClsSc_MaterToSourceBill.cs
@@ -122,6 +122,7 @@
                ",HWorkerID=" + omodel.HWorkerID.ToString() +
                ",HWorkerBarCode='" + omodel.HWorkerBarCode + "'" +
                ",HGroupID=" + omodel.HGroupID.ToString() +
                ",HProcNo=" + omodel.HProcNo.ToString() +
                ",HMainSourceInterID='" + omodel.HMainSourceInterID.ToString() + "'" +
                ",HMainSourceEntryID='" + omodel.HMainSourceEntryID.ToString() + "'" +
                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
@@ -196,14 +197,14 @@
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
                ",HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HICMOInterID,HICMOEntryID,HICMOBillNo" +
                ",HSourceID,HProcID,HMaterID,HSourceBarCode,HEquipID,HWorkerID,HWorkerBarCode" +
                ",HGroupID,HStockOrgID" +
                ",HGroupID,HProcNo,HStockOrgID" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate.ToShortDateString() + "'" +
                ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                "," + omodel.HMainSourceInterID.ToString() + "," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
                "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() + ",'" + omodel.HProcExchBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HICMOEntryID.ToString() + ",'" + omodel.HICMOBillNo + "'" +
                "," + omodel.HSourceID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HMaterID.ToString() + ",'" + omodel.HSourceBarCode + "'," + omodel.HEquipID.ToString() + "," + omodel.HWorkerID.ToString() + ",'" + omodel.HWorkerBarCode + "'" +
                "," + omodel.HGroupID.ToString() +"," + omodel.HSTOCKORGID.ToString() +
                "," + omodel.HGroupID.ToString() + "," + omodel.HProcNo.ToString() + "," + omodel.HSTOCKORGID.ToString() +
                ") ");
                //插入子表
                foreach (Model.ClsSc_MaterToSourceBillSub oSub in DetailColl)
Model/³µ¼ä¹ÜÀí/ClsSc_MaterToSourceBillMain.cs
@@ -20,7 +20,7 @@
        public Int64 HWorkerID;//             int             --操作工ID
        public string HWorkerBarCode;//        varchar(50)     --操作工条码
        public Int64 HGroupID;//              int                --生产班组ID
        public Int64 HProcNo;//              int                --流水号(工序号)
        public Int64 HProcID;//              int                --工序ID
        public Int64 HMaterID;//              int                --产品ID
Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -1606,6 +1606,11 @@
                    {
                        omodel.MES_StationInBill_ShowUSERProcess = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //工序进站时默认带入数量(1.流转卡数,2.上道合格数量,3.物料最小包装数量,4.不带入)
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationInBill_DefQty")
                    {
                        omodel.MES_StationInBill_DefQty = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
@@ -3544,6 +3549,11 @@
                    {
                        omodel.MES_StationInBill_PreQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
                    //工序进站时默认带入数量(1.流转卡数,2.上道合格数量,3.物料最小包装数量,4.不带入)
                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationInBill_DefQty")
                    {
                        omodel.MES_StationInBill_DefQty = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                    }
Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -507,7 +507,8 @@
        public string MES_StationInBill_DeleteRelationCtl;              //进站接收单删除时是否进行关联控制
        public string MES_StationInBill_PreQtyCtl;              //本道进站数量不能大于上道出站合格数量
        public string MES_StationInBill_QtyRateCtl;              //本道进站数量汇总数不能大于流转卡数量上限
        public string MES_StationInBill_DyCentralInspectionControl;              //判断工序进站之前是否做过检验单
        public string MES_StationInBill_DyCentralInspectionControl; //判断工序进站之前是否做过检验单
        public string MES_StationInBill_DefQty;                     //工序进站时默认带入数量(1.流转卡数,2.上道合格数量,3.物料最小包装数量,4.不带入)
        //工序出站汇报单
        public string MES_StationOutBill_AutoCheck;                        //保存后是否自动审核
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -119,6 +119,7 @@
                double HPeriod = 1;
                string HRemark = list[0].HRemark;//备注
                long HICMOInterID = list[0].HICMOInterID;//任务单ID
                long HICMOEntryID = list[0].HICMOEntryID;//任务单子ID
                string HICMOBillNo = list[0].HICMOBillNo;//任务单
                long HProcPlanInterID = 0;
                long HProcPlanEntryID = 0;
@@ -144,6 +145,8 @@
                string HOrderProcNO = list[0].HOrderProcNO;//订单跟踪号
                long HPRDOrgID = list[0].HPRDOrgID;//组织ID
                double HmaterOutqty = list[0].HmaterOutqty;//白坯发布
                long HMaterToSourceInterID = list[0].HMaterToSourceInterID;//上料防错单ID
                string HMaterToSourceBillNo = list[0].HMaterToSourceBillNo;//上料防错单单据号
                //单据完整性判断
                if (HMaterID <= 0)
                {
@@ -260,6 +263,29 @@
                    ",'" + HProcNo + "','" + HOrderProcNO + "','" + HMainInterID + "'," + HPRDOrgID +
                    ","+ HmaterOutqty + ") ");
                    if(HMaterToSourceInterID!=0)
                    {
                        //生成上料防错单
                        //插入子表
                        oCN.RunProc("EXEC h_p_Sc_MaterToSourceBillSub_Insert " + HMaterToSourceInterID.ToString() + ",'" + HMaterToSourceBillNo + "'");
                        //插入主表
                        oCN.RunProc("Insert Into Sc_MaterToSourceBillMain   " +
                        "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
                        ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HChecker,HCheckDate" +
                        ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
                        ",HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HICMOInterID,HICMOEntryID,HICMOBillNo" +
                        ",HSourceID,HProcID,HMaterID,HSourceBarCode,HEquipID,HWorkerID,HWorkerBarCode" +
                        ",HGroupID,HProcNo,HStockOrgID" +
                        ") " +
                        " values('3786','3790'," + HMaterToSourceInterID.ToString() + ",'" + HMaterToSourceBillNo + "',convert(varchar(10),getdate(),120)" +
                        ",year(getdate()),month(getdate()),'工序进站绑定生成','" + HMaker + "',getdate(),'" + HMaker + "',getdate()" +
                        "," + HInterID.ToString() + ",0,'" + HBillNo + "','3790'" +
                        "," + HProcExchInterID.ToString() + "," + HProcExchEntryID.ToString() + ",'" + HProcExchBillNo + "'," + HICMOInterID.ToString() + "," + HICMOEntryID.ToString() + ",'" + HICMOBillNo + "'" +
                        "," + HSourceID.ToString() + "," + HProcID.ToString() + "," + HMaterID.ToString() + ",'',0,0,''" +
                        "," + HGroupID.ToString() + "," + HProcNo.ToString() + "," + HPRDOrgID.ToString() +
                        ") ");
                    }
                    //写入日志
                    LogService.Write("用户:" + user + ",日期:" + DateTime.Now + ",新增工序进站单据:" + HBillNo);
                    oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "新增工序进站单据:" + HBillNo + "','LMES-工序进站模块','" + DBUtility.ClsPub.IPAddress + "','新增单据'", ref DBUtility.ClsPub.sExeReturnInfo);
                }
@@ -423,6 +449,67 @@
        }
        #endregion
        #region å·¥åºè¿›ç«™æŽ¥æ”¶å•流水号回车获取工序信息,并根据系统参数判断进站单是否绑定配件清单 20240621
        [Route("Cj_StationInBill/HProcNo_KeyDown")]
        [HttpGet]
        public object HProcNo_KeyDown(string HBillNo, string HProcExchBillNo, Int64 HProcNo, string HMaker)
        {
            try
            {
                if (HProcExchBillNo.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "流转卡没有扫描,或者没有按回车键,请扫描流转卡或在流转卡文本框中按回车键!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //获取系统参数
                string sErrMsg = "";
                if (oSystemParameter.ShowBill(ref sErrMsg) == true)
                {
                    string MES_StationInBill_LineBindCtl = "N"; //进站接收时是否绑定该工序的配件清单(Y是需要绑定,N不需要绑定)
                    string MES_StationInBill_DefQty = "4";      //工序进站时默认带入数量(1.流转卡数,2.上道合格数量,3.物料最小包装数量,4.不带入)
                    MES_StationInBill_LineBindCtl = oSystemParameter.omodel.MES_StationInBill_LineBindCtl;
                    MES_StationInBill_DefQty = oSystemParameter.omodel.MES_StationInBill_DefQty;
                    ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_HProcNo_KeyDown '" + HBillNo + "','" + HProcExchBillNo + "'," + HProcNo.ToString() + ",'" + MES_StationInBill_LineBindCtl + "','" + MES_StationInBill_DefQty + "','" + HMaker + "'", "h_p_MES_StationInBill_HProcNo_KeyDown");
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "工序号错误或者当前工序号不允许进站,请重新输入!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "获取系统参数失败! " + sErrMsg;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "工序进站接收单流水号获取信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¥åºè¿›ç«™æŽ¥æ”¶å•流水号回车获取工序信息
        [Route("Cj_StationInBill/txtHProcNo_KeyDown")]
        [HttpGet]
WebAPI/Controllers/ÌõÂë¹ÜÀí/WEBSController.cs
@@ -987,6 +987,88 @@
        #endregion
        #region å·¥åºèµ„æ–™
        /// <summary>
        /// æ‰«ç è¿”回工序信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetProcess_Json")]
        [HttpGet]
        public object GetProcess_Json(string HBarCode, Int64 HStockOrgID)
        {
            try
            {
                Int64 HProcID = 0;
                HProcID = DBUtility.ClsPub.isLong(HBarCode);
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Process with(nolock) where HStopflag=0 and HItemID=" + HProcID.ToString() + " and HUSEORGID = " + HStockOrgID.ToString(), "Gy_Process");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何记录,请确认所扫工序条码是否属于该组织,且为非禁用状态!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回工序信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// èŽ·å–å·¥åºåˆ—è¡¨ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/GetProcessList_Json")]
        [HttpGet]
        public object GetProcessList_Json(string Process, Int64 HStockOrgID)
        {
            try
            {
                ds = oCn.RunProcReturn("select HItemID,HNumber,HName from Gy_Process with(nolock) where HStopflag=0 and HUSEORGID=" + HStockOrgID.ToString() + " and (HNumber like '%" + Process + "%' or HName like '%" + Process + "%')", "Gy_Process");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有返回任何工序记录!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回工序信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
@@ -3387,6 +3469,8 @@
                BillNew.omodel.HWorkerID = mainList[0].HWorkerID;
                BillNew.omodel.HWorkerBarCode = mainList[0].HWorkerBarCode;
                BillNew.omodel.HGroupID = mainList[0].HGroupID;
                BillNew.omodel.HProcID = mainList[0].HProcID;
                BillNew.omodel.HProcNo = mainList[0].HProcNo;
                BillNew.omodel.HMainSourceBillType = mainList[0].HMainSourceBillType;
                if (mainList[0].HMainSourceBillType == "3772")
                {
@@ -5969,6 +6053,55 @@
        #endregion
        #region ä¸Šæ–™é˜²é”™å•扫码模块  æµæ°´å·å›žè½¦è°ƒç”¨æ–¹æ³•
        /// <summary>
        /// æµæ°´å·å›žè½¦è¿”回信息
        /// </summary>
        /// <returns></returns>
        [Route("WEBSController/get_ProcNo_MaterToSource_Json")]
        [HttpGet]
        public object get_ProcNo_MaterToSource_Json(Int64 HInterID, string HBillNo, string HBillType, string HProcExchBillNo, Int64 HProcNo, string HMaker)
        {
            try
            {
                ds = oCn.RunProcReturn("exec h_p_WMS_AddProcNo_MaterToSource " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HProcExchBillNo + "'," + HProcNo.ToString() + ",'" + HMaker + "'", "h_p_WMS_AddProcNo_MaterToSource");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "流水号回车返回信息判断失败!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HBack"]) == 1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]);
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "成功!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "流水号回车返回信息败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä¸Šæ–™é˜²é”™å•扫码模块  æ‰«æç‰©æ–™æ¡ç è°ƒç”¨æ–¹æ³•
        /// <summary>
        /// æ‰«æç‰©æ–™æ¡ç 
WebAPI/Models/StationBill.cs
@@ -86,5 +86,7 @@
        public double HWasterQty_Mater { get; set; }
        public double HBackWorkQty { get; set; }
        public Int64 HShiftsID { get; set; }
        public long HMaterToSourceInterID { get; set; }
        public string HMaterToSourceBillNo { get; set; }
    }
}