1
yusijie
2023-05-25 6592e8f84bf7958dd256a33b66e1fa3203296312
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -164,12 +164,53 @@
                    NewBarCode = sBillBarCode.Split(Convert.ToChar("#"));
                    sBillBarCode = NewBarCode[0];
                }
                string sBillNo = sBillBarCode;
                //截取条码类型
                string BillNoType = sBillNo.Substring(0, Math.Min(3, sBillNo.Length));
                //截取内码
                string BillNo = sBillNo.Substring(3, Math.Min(sBillNo.Length - 3,sBillNo.Length));
                string sBillNo = sBillBarCode; //条形码
                string[] arr = sBillNo.Split('&'); //以符号‘&’分割条形码
                string BillNo_PGD = arr[0]; //单据号
                string entryid_PGD = "";//子id
                if(arr.Length > 1)
                {
                    entryid_PGD = arr[1];
                }
                //截取条码类型 前三位
                string BillNoType = BillNo_PGD.Substring(0, Math.Min(3, BillNo_PGD.Length));
                //截取条码类型2 前四位
                string BillNoType2 = BillNo_PGD.Substring(0, Math.Min(4, BillNo_PGD.Length));
                //截取内码
                string BillNo = BillNo_PGD.Substring(3, Math.Min(BillNo_PGD.Length - 3, BillNo_PGD.Length));
                switch (BillNoType2)
                {
                    case "GXLZ"://工序流转派工
                        ds = oCN.RunProcReturn("select * from h_v_Sc_ProcExchSendWorkBill  where 派工单据号 = '" + BillNo_PGD + "'" + " and HEntryID ='" + entryid_PGD + "'", "h_v_Sc_ProcExchSendWorkBill");
                        break;
                    case "GXLX"://流转卡
                        string sErr = "";
                        if (oSystemParameter.ShowBill(ref sErr))
                        {
                            if (oSystemParameter.omodel.WMS_CampanyName == "乔一")
                            { //系统参数是否为只显示当前登录用户关联的工序信息,N为否,Y为是
                                if (oSystemParameter.omodel.MES_StationInBill_ShowUSERProcess == "Y")
                                {
                                    ds = oCN.RunProcReturn($"exec h_p_ProcessExchangeBillLastHProNo '{BillNo_PGD}','{UserID}','{HBillType}'", "h_v_Gy_ProcessList_GetProcNoByUser");
                                }
                                else
                                {
                                    ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                                }
                            }
                            else if (entryid_PGD != "") //如果子id不为空则加入子id过滤;
                            {
                                ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + BillNo_PGD + "'" + " and hsubid ='" + entryid_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                            }
                            else
                            {
                                ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + BillNo_PGD + "'", "h_v_Sc_ProcessExchangeBillList");
                            }
                        }
                        break;
                }
                switch (BillNoType)
                //得到信息
                {
@@ -234,10 +275,7 @@
                        break;
                    case "WLM"://物料码
                        ds = oCN.RunProcReturn("select * from h_v_Gy_MaterialList  where HItemID = '" + BillNo + "'", "h_v_Gy_MaterialList");
                        break;
                    case "GXL"://流转卡
                        ds = oCN.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 单据号= '" + sBillNo + "'", "h_v_Sc_ProcessExchangeBillList");
                        break;
                        break;
                }
                //写入信息