WebAPI/Controllers/²Ö´æ¹ÜÀí/ÌõÂëÉú³É/Sc_BarCodeController.cs
@@ -132,6 +132,10 @@
                    list.Add("唯一条码");
                    list.Add("批次条码");
                }
                else if (sCapName == "海诚")
                {
                    list.Add("品种条码");
                }
                else
                {
                    list.Add("唯一条码");
@@ -589,6 +593,10 @@
                            ordrlist.HGiveAwayFlag = 0;
                        }
                    }
                    if (HSourceBillType == "采购订单")
                    {
                        ordrlist.HSourceBillSEQ = dt.Rows[i]["HSEQ"].ToString();
                    }
                }
                if (HSourceBillType == "退货通知单")
                {
@@ -801,12 +809,13 @@
                long HMaterID = DBUtility.ClsPub.isLong(ordrlist[i].HMaterID);              // ç‰©æ–™å†…码
                string HBatchNo = DBUtility.ClsPub.isStrNull(ordrlist[i].HBatchNo);         // æ‰¹å·
                long HAuxPropID = DBUtility.ClsPub.isLong(ordrlist[i].HAuxPropID);          // è¾…助属性ID
                string HMTONo = DBUtility.ClsPub.isStrNull(ordrlist[i].HMTONo);             // è®¡åˆ’跟踪号
                double HSourceQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty);          // æºå•数量
                double HQty = DBUtility.ClsPub.isDoule(ordrlist[i].HQty);                   // æ•°é‡
                double HMinQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty);             // æœ€å°åŒ…装数
                if (HMaterID != 0)
                {
                    DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck");
                    DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck_New " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "'," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck_New");
                    if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
@@ -845,7 +854,7 @@
            int HBQty = 0;              //箱数
            double HQty = 0;            //数量
            string WeiShu = "";         //尾数
            int LSH = 0;                //流水号
            Int64 LSH = 0;              //流水号
            string LSH2 = "";           //流水号转换成字符
            string sDate = "";          //日期
            string sYear = "";          //å¹´
@@ -935,7 +944,7 @@
                            sTMNumber = HNumber + sYear + sPeriod + sDay;
                            Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                            //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                            LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        }
                        else if (CampanyName == "飞龙")
                        {
@@ -952,7 +961,7 @@
                            sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay;
                            Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                            //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                            LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        }
                        else if (CampanyName == "瑞与祺") {
                            var date = DateTime.Now.ToString("yyMMdd");//日期
@@ -977,7 +986,7 @@
                                //sTMNumber = ordrlist[j].HMaterNumber + "-包装标识-" + date + "-" + ordrlist[j].HSupNumber + "-";
                                Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                                LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                            }
                            else if (HSourceBillTypeName == "生产入库单")
                            {
@@ -1011,13 +1020,13 @@
                                //sTMNumber = ordrlist[j].HMaterNumber + "-包装标识-"+ date + "-组织代码-";
                                Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                                LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                            }
                            else
                            {
                                sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
                                Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                                LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                            }
                        }
                        else  //通用方法
@@ -1026,7 +1035,7 @@
                            sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay;
                            Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                            //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                            LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                            LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        }
                    }
                    else if (HSelectBarCodeType == "品种条码")
@@ -1050,7 +1059,7 @@
                        sTMNumber = HMaterNumber + sYear + sPeriod + sDay;
                        Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                                                                                                    //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        LSHlen = 4;
                    }
                    else if (HSelectBarCodeType == "仪器成品条码规则") //另外处理了
@@ -1067,7 +1076,7 @@
                        sTMNumber = HMaterNumber + HBatchNo;
                        Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                                                                                                    //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        LSHlen = 6;
                    }
                    else if (HSelectBarCodeType == "内销机条码")
@@ -1077,7 +1086,7 @@
                        sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00";
                        Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                                                                                                    //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        LSHlen = 5;
                        if (sTMNumber.Length != 16)
                        {
@@ -1094,7 +1103,7 @@
                        sTMNumber = HMaterNumber.Replace(".", "") + HBarCodeDate + HBarCodeBatchNo;
                        Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                                                                                                    //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        LSHlen = 5;
                        if (sTMNumber.Length != 18)
                        {
@@ -1110,7 +1119,7 @@
                        sTMNumber = HICMOBillNo;
                        Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                                                                                                                    //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                        LSHlen = 5;
                    }
                    else if (HSelectBarCodeType == "托盘条码")
@@ -1119,7 +1128,7 @@
                        //条码前缀 = ç‰©æ–™å†…码 + å¹´ + æœˆ + æ—¥
                        sTMNumber = HNumber + sYear + sPeriod + sDay;
                        Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo");    //获取最大流水号
                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                    }
                    else
                    {
@@ -1183,7 +1192,34 @@
                            objJsonResult.Message = "条形码不能为空,不能生成条码!";
                            return objJsonResult;
                        }
                        HBarCodeList barcode = new HBarCodeList();
                        HBarCodeList barcode = new HBarCodeList();
                        if (CampanyName == "海诚") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称
                        {
                            string sHMTONo = "";            //计划跟踪号
                            string sHSourceBillNo = "";     //源单单号
                            string sHSourceBillSEQ = "";    //源单行号
                            string sSupNumber = "";         //供应商代码
                            string sHQty = "";              //数量
                            sHMTONo = DBUtility.ClsPub.isStrNull(ordrlist[j].HMTONo);
                            sHSourceBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo);
                            sHSourceBillSEQ = DBUtility.ClsPub.isStrNull(ordrlist[j].HSourceBillSEQ);
                            sSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber);
                            sHQty = DBUtility.ClsPub.isStrNull(HMinQty);
                            if (DBUtility.ClsPub.isStrNull(ordrlist[j].HBillType) == "1102") //源单:采购订单
                            {
                                //条码规则:采购订单单号@行号@物料代码@MTO@数量@供应商代码
                                TM = sHSourceBillNo + "@" + sHSourceBillSEQ + "@" + HMaterNumber + "@" + sHMTONo + "@" + sHQty + "@" + sSupNumber;
                            }
                            else
                            {
                                //条码规则:物料内码@MTO@数量
                                TM = HNumber + "@" + sHMTONo + "@" + sHQty;
                            }
                        }
                        barcode.HBarCode2 = TM;
                        barcode.HEntryID2 = ClsPub.isStrNull(j + 1);
                        barcode.HMaterID2 = ordrlist[j].HMaterID;