| | |
| | | } |
| | | try |
| | | { |
| | | oCn.BeginTran();//å¼å§äºç© |
| | | |
| | | WebSoBar = oWebs.get_BarCode(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, ref DBUtility.ClsPub.sErrInfo); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "å®ç" && int.Parse(HBillType) == 1244) |
| | | { |
| | | ds = oCn.RunProcReturn("select HMaterID,HQty,HBatchNo from KF_PonderationBillMain_Temp where HInterID = " + HInterID + "and HBillNo = '" + HBillNo + "'", "KF_PonderationBillMain_Temp"); |
| | | string[] arr = sBarCode.Split('@'); |
| | | string HMaterNumber = arr[0]; //ç©æä»£ç |
| | | string HBatchNo = arr[6]; //æ¹æ¬¡ |
| | | string HMaterQty = arr[4]; //æ°é |
| | | string HMaterID = ""; |
| | | |
| | | //ç¨æååºæ¥çç©æä»£ç æ¥è¯¢ç©æè¡¨éçç©æid |
| | | DataSet ds_material; |
| | | ds_material = oCn.RunProcReturn(" select FMATERIALID from AIS20220914133941..T_BD_MATERIAL where FNumber = '" + HMaterNumber + "' and FUSEORGID = " + HStockOrgID, "T_BD_MATERIAL"); |
| | | |
| | | if (ds_material != null || ds_material.Tables[0].Rows.Count > 0) |
| | | { |
| | | HMaterID = ds_material.Tables[0].Rows[0]["FMATERIALID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | //æ°ç©ç¼ç éæ²¡æè¿åæ°æ®åæ¥è¯¢ç©æè¡¨éçæ§ç©æç¼ç |
| | | DataSet ds_material_old; |
| | | ds_material_old = oCn.RunProcReturn(" select FMATERIALID from AIS20220914133941..T_BD_MATERIAL where FOldNumber = '" + HMaterNumber + "' and FUSEORGID =" + HStockOrgID, "T_BD_MATERIAL"); |
| | | |
| | | if (ds_material_old != null || ds_material_old.Tables[0].Rows.Count > 0) |
| | | { |
| | | HMaterID = ds_material_old.Tables[0].Rows[0]["FMATERIALID"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ¥è¯¢å°ç©æä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | ds = oCn.RunProcReturn("select HMaterID,HQty,HBatchNo from KF_PonderationBillMain_Temp where HInterID = " + HInterID + "and HBillNo = '" + HBillNo + "' and HMaterID = " + HMaterID + " and HBatchNo = '" + HBatchNo + "' and HQty = " + HMaterQty, "KF_PonderationBillMain_Temp"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | for (var i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | for (var j = i + 1; j < ds.Tables[0].Rows.Count; j++) |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HMaterID"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HMaterID"]) && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HQty"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HQty"]) && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HBatchNo"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HBatchNo"])) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åä¸åæ®å·ä¸å·²æ«è¿ä¿¡æ¯ç¸åçæ¡ç "; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åä¸åæ®å·ä¸å·²æ«è¿ä¿¡æ¯ç¸åçæ¡ç "; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | //for (var i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | //{ |
| | | // for (var j = i + 1; j < ds.Tables[0].Rows.Count; j++) |
| | | // { |
| | | // if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HMaterID"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HMaterID"]) && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HQty"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HQty"]) && DBUtility.ClsPub.isLong(ds.Tables[0].Rows[i]["HBatchNo"]) == DBUtility.ClsPub.isLong(ds.Tables[0].Rows[j]["HBatchNo"])) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "åä¸åæ®å·ä¸å·²æ«è¿ä¿¡æ¯ç¸åçæ¡ç "; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | | oCn.Commit();//æäº¤äºç© |
| | | |
| | | WebSoBar = oWebs.get_BarCode(sJXCode, HInterID, HBillType, HBillNo, HMaker, HWhID, HSPID, HQty, HRedBlueFlag, SourceFlag, HSourceBillNo, HSourceBillType, HStockOrgID, HScanStyle, HCustom1, HCustom2, ref DBUtility.ClsPub.sErrInfo); |
| | | |
| | | if (WebSoBar == null) |
| | | { |
| | | objJsonResult.code = "0"; |