智云SRM-WEBAPI(目前客户通用API)
yusijie
2023-10-18 d077c84b9a62a6c148198232154591f0cbd578f5
WebAPI/Controllers/BarCodeController.cs
@@ -628,6 +628,8 @@
                            bar.HSupID = oItemSub.HSupID;
                            bar.HEndQty = WeiShu;
                            bar.HMTONO = oItemSub.HMTONO;
                            bar.HSupBatchNo = oItemSub.HSupBatchNo;
                            bar.HSupMaterNumber = oItemSub.HSupMaterNumber;
                            ls2.Add(bar);
                        }
                    }
@@ -708,6 +710,8 @@
                            bar2.HSupID = oItemSub2.HSupID;
                            bar2.HEndQty = WeiShu1;
                            bar2.HMTONO = oItemSub2.HMTONO;
                            bar2.HSupBatchNo = DBUtility.ClsPub.isStrNull(oItemSub2.HSupBatchNo);
                            bar2.HSupMaterNumber = DBUtility.ClsPub.isStrNull(oItemSub2.HSupMaterNumber);
                            ls3.Add(bar2);
                            //LogService.Write("测试加+++" + oItemSub2.HSupID);
                        }
@@ -732,6 +736,8 @@
                string HKFDQDate = "";
                string HWei = "";
                string HMTONO = "";
                string HSupBatchNo = "";
                string HSupMaterNumber = "";
                oCn.BeginTran();
                foreach (Model.ClsGy_MaterialList_WMS_Model oItemSub in ls)
                {
@@ -760,6 +766,8 @@
                        HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                        HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                        HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                        HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
                        HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
                        if (FCusName.Contains("夏宝"))
                        {
                            HBarCode = $"{oItemSub.HMaterID}";
@@ -767,11 +775,12 @@
                        }
                        string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO,HSupBatchNo,HSupMaterNumber " +
                                    ") values ("
                                    + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                    + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "','" + HSupBatchNo+ "','" + HSupMaterNumber + "'" +
                                    ")";
                        oCn.RunProc(sql);
                        //LogService.Write(sql);
                        sql = "exec setLSH '" + DateTime.Today + "'";
@@ -800,6 +809,8 @@
                        HSourceBillNo = ClsPub.isStrNull(oItemSub.HSourceBillNo);
                        HSourceBillType = ClsPub.isStrNull(oItemSub.HSourceBillType);
                        HWei = ClsPub.isStrNull(oItemSub.HEndQty);
                        HSupBatchNo = ClsPub.isStrNull(oItemSub.HSupBatchNo);
                        HSupMaterNumber = ClsPub.isStrNull(oItemSub.HSupMaterNumber);
                        if (FCusName.Contains("夏宝"))
                        {
                            HBarCode = $"{oItemSub.HMaterID}";
@@ -807,11 +818,12 @@
                        }
                        string sql = "insert into Gy_BarCodeBill (HInterID,HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HKFDate,HKFPeriod,HKFDQDate" +
                                    ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HEndQty,HSupflag" +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO " +
                                    ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HMTONO ,HSupBatchNo,HSupMaterNumber" +
                                    ") values ("
                                    + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                    + "','" + HBatchNo + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
                                    + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO +  "','" +
                                    HSupBatchNo + "','" + HSupMaterNumber + "'" + ")";
                        oCn.RunProc(sql);
                        //LogService.Write(sql);
                    }
@@ -1579,7 +1591,8 @@
                    //检验打印数量(HQTY)和未打印数量
                    string sql = $"select HQty + isnull(HMrbQty,0) - HBarcodeCount as HNotBarcodeCount ,* from Cg_POOrderBillSub where HEntryID = {oItemSub.HSourceEntryID}";
                    DataSet ds = oCn.RunProcReturn(sql, "tables");
                    if (ds.Tables[0].Rows.Count > 0 && Convert.ToInt32(ds.Tables[0].Rows[0][0]) < oItemSub.HQty)
                    if (ds.Tables[0].Rows.Count > 0 && Convert.ToDouble(ds.Tables[0].Rows[0][0]) < oItemSub.HQty)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -1650,7 +1663,7 @@
                            var HSupName_verify = HBarCode_verify[7]; //校验供应商
                            var HSourceBillNo_verify = HBarCode_verify[8]; //校验采购订单号
                            sql = $"select * from Gy_Material where HNumber = '{HMaterNumber_verify}' and HName = '{HMaterName_verify}' and HModel = '{HMaterModel_verify}'";
                            sql = $"select * from Gy_Material where HNumber = '{HMaterNumber_verify}' and HName = '{HMaterName_verify}'";
                            DataSet verifyMatInfo = oCn.RunProcReturn(sql, "tables");
                            sql = $"select * from Cg_POOrderBillMain where HBillNo = '{HSourceBillNo_verify}'";