| | |
| | | ordrlist.HMTONo = dt.Rows[i]["计åè·è¸ªå·"].ToString(); |
| | | ordrlist.HProduceDate = DBUtility.ClsPub.isDate(dt.Rows[i]["çäº§æ¥æ"]); |
| | | ordrlist.HExpiryDate = DBUtility.ClsPub.isDate(dt.Rows[i]["æææè³"]); |
| | | ordrlist.HISKFPERIOD = int.Parse(dt.Rows[i]["HISKFPERIOD"].ToString()); |
| | | //ordrlist.HISKFPERIOD = int.Parse(dt.Rows[i]["HISKFPERIOD"].ToString()); |
| | | ordrlist.HISKFPERIOD = DBUtility.ClsPub.isInt(dt.Rows[i]["HISKFPERIOD"]); |
| | | ordrlist.HEXPUNIT = dt.Rows[i]["HEXPUNIT"].ToString(); //æææåä½(æ¥ãæãå¹´) |
| | | ordrlist.HEXPPERIOD = double.Parse(dt.Rows[i]["HEXPPERIOD"].ToString()); //æææå¼ |
| | | |
| | |
| | | barcode.HCusMaterName2 = ordrlist[i].HCusMaterName; |
| | | barcode.HCheckEmpName2 = ordrlist[i].HCheckEmpName; |
| | | barcode.HReInspectionFlag = ordrlist[i].HReInspectionFlag ? 1 : 0; |
| | | barcode.HInspectionDate = ordrlist[i].HReInspectionFlag? ordrlist[i].HInspectionDate:null; |
| | | barcode.HInspectionDate = ordrlist[i].HInspectionDate; |
| | | barcode.HInspectionCycle = ordrlist[i].HReInspectionFlag ? ordrlist[i].HInspectionCycle : 0; |
| | | barcode.HReInspectionDate = ordrlist[i].HReInspectionFlag ? ordrlist[i].HReInspectionDate : null; |
| | | barcode.HSeOrderBillNo2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HPOOrderBillMTO); |
| | | barcode.HPOOrderBillMTO = DBUtility.ClsPub.isStrNull(ordrlist[i].HPOOrderBillMTO); |
| | | barcode.HSeOrderBillNo2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HSeOrderBillNo); |
| | | barcode.HCusModel2 = DBUtility.ClsPub.isStrNull(ordrlist[i].HCusModel); |
| | | ListRows.Add(barcode); |
| | | |
| | | n += 1; //æ´æ°åæ¹çæçæ¡ç æ° |
| | |
| | | string HReInspectionDate = ListRows[i].HInspectionDate; |
| | | string HCustomBatchNo = ClsPub.isStrNull(ListRows[i].HInspectionDate).Replace("-",""); |
| | | string HBarCodeStatus = "æ£å¸¸"; |
| | | string HPOOrderBillNoMTO = ClsPub.isStrNull(ListRows[i].HPOOrderBillMTO); |
| | | |
| | | string sql_produceBarCode = "insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HBarCodeSubType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" + |
| | | ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus" + |
| | | ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName,HCustomBatchNo,HBarCodeStatus,HOrderBillNo" + |
| | | ",HReInspectionFlag,HInspectionDate,HInspectionCycle,HReInspectionDate " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "','" + HBarCodeSubType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | |
| | | + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + "" |
| | | + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) |
| | | + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "'" |
| | | + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "'" + |
| | | + ",'" + HCoilNO2 + "','" + HFurnaceNO2 + "','" + HFactory2 + "'," + HAuxQty2 + ",'" + HheatNO2 + "','" + HProduceDate + "','" + HExpiryDate + "'," + HEmpID2.ToString() + ",'" + HCusModel2 + "','" + HCusMaterName2 + "','" + HCheckEmpName2 + "','" + HCustomBatchNo + "','" + HBarCodeStatus + "','" + HPOOrderBillNoMTO + "'" + |
| | | "," + HReInspectionFlag + "," + (HInspectionDate == null ? "null" : "'" + HInspectionDate + "'") + "," + HInspectionCycle + "," + (HReInspectionDate == null ? "null" : "'" + HReInspectionDate + "'") + |
| | | ")"; |
| | | |
| | |
| | | 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 sTMNumber = ""; //æ¡ç åç¼ |
| | | string LSH = ""; //æå¤§æµæ°´å· |
| | | int HLen = 6; //æµæ°´å·é¿åº¦ |
| | | |
| | | |
| | | //æ¡ç æ¼æ¥æéåæ®µ |
| | | 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) |
| | | { |