| | |
| | | string HSelectBarCodeType = "æçæ¡ç "; |
| | | string CampanyName = "å°å«"; |
| | | string UserName = sArray[2].ToString();//ç¨æ· |
| | | string barCode_middle = sArray[3].ToString();//ä¸ç®±ç |
| | | ClsPub.CurUserName = UserName; |
| | | |
| | | //è·åå
ç |
| | |
| | | else |
| | | { |
| | | //çææ¡ç |
| | | SaveBarCode_xiaowei(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName); |
| | | SaveBarCode_xiaowei(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName, barCode_middle); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | #endregion |
| | | |
| | | #region[æ¡ç çææ¹æ³_xiaowei] |
| | | private object SaveBarCode_xiaowei(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName) |
| | | private object SaveBarCode_xiaowei(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName,string barCode_middle) |
| | | { |
| | | DateTime sDate = DateTime.Now; //æ¥æ |
| | | string HSourceBillType_Temp = ""; //æºåç±»å |
| | |
| | | //æ¡ç æ¼æ¥æéåæ®µ |
| | | string HMaterialName = DBUtility.ClsPub.isStrNull(ordrlist.HMaterName); |
| | | string HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist.HSupNumber).Replace(".", ""); //ä¾åºå代ç ï¼å»æåéç¬¦ï¼ |
| | | int lastDigit = int.Parse(DateTime.Today.Year.ToString().Last().ToString()); |
| | | int currentMonth = DateTime.Now.Month; |
| | | char[] monthToLetter = { |
| | | 'N', 'P', 'Q', 'R', 'S', 'T', |
| | | 'U', 'V', 'W', 'X', 'Y', 'Z' |
| | | }; |
| | | char productionMonth = monthToLetter[currentMonth - 1]; |
| | | char productionDay = DateTime.Today.Month <= 9 |
| | | ? (char)(DateTime.Today.Month + '0') |
| | | : (char)('A' + DateTime.Today.Month - 10); |
| | | if (HMaterialName.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç©æä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | Ds2 = oCN.RunProcReturn("select top 1 HCusRelationNumber from Gy_Material m with(nolock) left join Gy_MateNumRelation_Sec b with(nolock) on m.HMASTERID = b.HMaterID where m.HItemID = " + ordrlist.HMaterID, "Gy_MateNumRelation_Sec"); |
| | | |
| | | string HSKU = "";//ååSKU |
| | | if (Ds2.Tables[0].Rows.Count > 0) |
| | | { |
| | | HSKU = Ds2.Tables[0].Rows[0]["HCusRelationNumber"].ToString(); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æå¹é
å°å¯¹åºçååSKU!"; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet dds= oCN.RunProcReturn("exec h_p_rule_BarCodePack_xiaowei "+ ordrlist.HMaterID+",'"+ barCode_middle+"'", "h_p_rule_BarCodePack_xiaowei"); |
| | | //todo |
| | | if (dds.Tables[0].Rows[0]["HBack"]=="1") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çææ¡ç 失败ï¼" + dds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else if(dds == null || dds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "çææ¡ç å¤±è´¥ï¼æªæ¾å°æ¡ç ï¼" ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //æ¡ç åç¼ = p+ååSKU+ç产年份+ç产æä»½+6使µæ°´å·+ç产工å代ç |
| | | sTMNumber = "P" + HSKU + lastDigit+ productionMonth; |
| | | |
| | | //æ ¹æ®æ¡ç åç¼è·åæå¤§æµæ°´å· |
| | | Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); |
| | | LSH = String.Format("{0:D" + HLen + "}", ClsPub.isInt(Ds.Tables[0].Rows[0][0]) + 1); |
| | | |
| | | //æ¼æ¥æ¡ç |
| | | HBarCode_Temp = sTMNumber + "A" + LSH + "AHW"; |
| | | |
| | | HBarCode_Temp = dds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | |
| | | if (HSumQty - HMinQty > 0) |
| | | { |