| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region [æ¡ç çææ¥å£-迦å] |
| | | [Route("Sc_BarCode/Sub_SaveBill_JiaNan")] |
| | | [HttpPost] |
| | | public object Sub_SaveBill_JiaNan([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); //ç©æè®°å½ |
| | | string HOrgType = sArray[1].ToString(); //ç»ç»åç§° |
| | | string HSourceBillTypeName = sArray[2].ToString(); //æºåç±»ååç§° |
| | | string HSelectBarCodeType = sArray[3].ToString(); //æ¡ç ç±»å |
| | | string CampanyName = sArray[4].ToString() == "xxx" ? "" : sArray[4].ToString(); //å 工工ååç§° |
| | | string UserName = sArray[5].ToString(); //ç»å½è´¦å· |
| | | ClsPub.CurUserName = UserName; |
| | | |
| | | //è·åå
ç |
| | | HInterID = DBUtility.ClsPub.CreateBillID_Prod(ModName, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | HOrgNumber = ""; |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(HOrgType)) |
| | | { |
| | | HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | HOrgNumber = DBUtility.ClsPub.isStrNull(oClsGy_ORGANIZATIONS_View.omodel.HNumber); |
| | | } |
| | | if (HOrgID == -1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-055]éæ©ç»ç»æé误!"; |
| | | return objJsonResult; |
| | | } |
| | | if (!Sub_AllowSave(msg2, HSelectBarCodeType))//忮宿´æ§å¤æ |
| | | { |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //çææ¡ç |
| | | SaveBarCode_JiaNan(msg2, HSelectBarCodeType, CampanyName, HSourceBillTypeName); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3899-2-006]æ¡ç çæå¤±è´¥!" + e.Message; |
| | | return objJsonResult; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region[æ¡ç çææ¹æ³_迦å] |
| | | private object SaveBarCode_JiaNan(string msg2, string HSelectBarCodeType, string CampanyName, string HSourceBillTypeName) |
| | | { |
| | | DateTime sDate = DateTime.Now; //æ¥æ |
| | | string HSourceBillType_Temp = ""; //æºåç±»å |
| | | int n = 0; //åæ¹çæçæ¡ç ç´¢å¼ |
| | | |
| | | //è·åæç»ä¿¡æ¯ |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | List<HSouceOrderList> ordrlist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HSouceOrderList>>(msg2); |
| | | List<HBarCodeList> ListRows = new List<HBarCodeList>(); |
| | | |
| | | DataSet Ds; |
| | | for (int i = 0; i < ordrlist.Count; i++) |
| | | { |
| | | HSourceBillType_Temp = ordrlist[i].HBillType; |
| | | |
| | | if (ClsPub.isLong(ordrlist[i].HMaterID) != 0) |
| | | { |
| | | if (HSelectBarCodeType == "BarCode") |
| | | { |
| | | //æåæ¯æ¡ç©æè®°å½ä¸ºå¤æ¡æ¡ç è®°å½ |
| | | double HSumQty = ClsPub.isDoule(ordrlist[i].HQty); //äº§åæ°é |
| | | double HQty = ClsPub.isDoule(ordrlist[i].HQty); //æ°é |
| | | double HMinQty = ClsPub.isDoule(ordrlist[i].HMinQty); //æå°å
è£
æ° |
| | | int HBQty = ClsPub.isInt(ordrlist[i].HBQty); //ç®±æ° |
| | | string WeiShu = ""; //å°¾æ° |
| | | |
| | | for (int j = 0; j < HBQty; j++) |
| | | { |
| | | string HBarCode_Temp = ""; //æ¡ç |
| | | string sTMNumber = ""; //æ¡ç åç¼ |
| | | string LSH = ""; //æå¤§æµæ°´å· |
| | | int HLen = 4; //æµæ°´å·é¿åº¦ |
| | | |
| | | //æ¡ç æ¼æ¥æéåæ®µ |
| | | string HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[i].HSupNumber).Replace(".", ""); //ä¾åºå代ç ï¼å»æåéç¬¦ï¼ |
| | | string sDateStr = sDate.ToString("yyMMdd"); //å¯å¨æ¥æï¼YYMMDDï¼ |
| | | |
| | | if (HSupNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¾åºå代ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¡ç åç¼ = R+ä¾åºå代ç ï¼å»æåé符ï¼+å¯å¨æ¥æï¼YYMMDDï¼+å使µæ°´å· |
| | | sTMNumber = "R" + HSupNumber + sDateStr; |
| | | |
| | | //æ ¹æ®æ¡ç åç¼è·åæå¤§æµæ°´å· |
| | | 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 + LSH; |
| | | |
| | | |
| | | if (HSumQty - HMinQty > 0) |
| | | { |
| | | WeiShu = ""; |
| | | HSumQty = HSumQty - HMinQty; |
| | | } |
| | | else |
| | | { |
| | | if (HSumQty == HMinQty) |
| | | { |
| | | WeiShu = ""; |
| | | } |
| | | else |
| | | { |
| | | WeiShu = "å°¾æ°"; |
| | | } |
| | | HMinQty = HSumQty; |
| | | } |
| | | |
| | | HBarCodeList barcode = new HBarCodeList(); |
| | | barcode.HBarCode2 = HBarCode_Temp; |
| | | barcode.HBarCodeType2 = "å¯ä¸æ¡ç "; |
| | | barcode.HBarCodeSubType2 = "å
æ¡ç "; |
| | | barcode.HEntryID2 = ClsPub.isStrNull(i + 1); |
| | | barcode.HMaterID2 = ordrlist[i].HMaterID; |
| | | barcode.HMaterNumber2 = ordrlist[i].HMaterNumber; |
| | | barcode.HMaterName2 = ordrlist[i].HMaterName; |
| | | barcode.HMaterModel2 = ordrlist[i].HMaterModel; |
| | | barcode.HPinfan2 = ordrlist[i].HPinfan; |
| | | barcode.HPinfanBarCode2 = ordrlist[i].HPinfanBarCode; |
| | | barcode.HAuxPropID2 = ordrlist[i].HAuxPropID; |
| | | barcode.HAuxPropNumber2 = ordrlist[i].HAuxPropNumber; |
| | | barcode.HAuxPropName2 = ordrlist[i].HAuxPropName; |
| | | barcode.HUnitID2 = ordrlist[i].HUnitID; |
| | | barcode.HUnitNumber2 = ordrlist[i].HUnitNumber; |
| | | barcode.HUnitName2 = ordrlist[i].HUnitName; |
| | | barcode.HQty2 = ClsPub.isStrNull(HMinQty); |
| | | barcode.HBatchNo2 = ordrlist[i].HBatchNo; |
| | | barcode.HSourceInterID2 = ordrlist[i].HMainID; |
| | | barcode.HSourceEntryID2 = ordrlist[i].HSubID; |
| | | barcode.HSourceBillNo2 = ordrlist[i].HBillNo; |
| | | barcode.HSourceBillType2 = ordrlist[i].HBillType; |
| | | barcode.HPrint = "0"; |
| | | barcode.HWei = WeiShu; |
| | | barcode.HBarcodeNo = ClsPub.isStrNull(n + 1); |
| | | barcode.HBarcodeQtys = ordrlist[i].HBQty; |
| | | barcode.HSupID2 = ordrlist[i].HSupID; |
| | | barcode.HSupNumber2 = ordrlist[i].HSupNumber; |
| | | barcode.HSupName2 = ordrlist[i].HSupName; |
| | | barcode.HDeptID2 = ordrlist[i].HDeptID; |
| | | barcode.HDeptNumber2 = ordrlist[i].HDeptNumber; |
| | | barcode.HDeptName2 = ordrlist[i].HDeptName; |
| | | barcode.HRemark2 = ordrlist[i].HRemark; |
| | | barcode.HDate2 = ordrlist[i].HDate; |
| | | barcode.HShowDate2 = ordrlist[i].HShowDate; |
| | | barcode.HWhID2 = ordrlist[i].HWhID; |
| | | barcode.HWhNumber2 = ordrlist[i].HWhNumber; |
| | | barcode.HWhName2 = ordrlist[i].HWhName; |
| | | barcode.HSPID2 = ordrlist[i].HSPID; |
| | | barcode.HSPNumber2 = ordrlist[i].HSPNumber; |
| | | barcode.HSPName2 = ordrlist[i].HSPName; |
| | | barcode.HMTONo2 = ordrlist[i].HMTONo; |
| | | barcode.HCusID2 = ordrlist[i].HCusID; |
| | | barcode.HCusNumber2 = ordrlist[i].HCusNumber; |
| | | barcode.HCusName2 = ordrlist[i].HCusName; |
| | | barcode.HCusType2 = ordrlist[i].HCusType; |
| | | barcode.HSourceID2 = ordrlist[i].HSourceID; |
| | | barcode.HSourceNumber2 = ordrlist[i].HSourceNumber; |
| | | barcode.HSourceName2 = ordrlist[i].HSourceName; |
| | | barcode.HEndDate2 = ordrlist[i].HEndDate; |
| | | barcode.HSeOrderBillNo2 = ordrlist[i].HSeOrderBillNo; |
| | | barcode.HInnerBillNo2 = ordrlist[i].HInnerBillNo; |
| | | barcode.HMaker2 = ordrlist[i].HMaker; |
| | | barcode.HGiveAwayFlag2 = ordrlist[i].HGiveAwayFlag; |
| | | barcode.HCoilNO = ordrlist[i].HCoilNO; |
| | | barcode.HFurnaceNO = ordrlist[i].HFurnaceNO; |
| | | barcode.HFactory = ordrlist[i].HFactory; |
| | | barcode.HAuxQty = ordrlist[i].HAuxQty; |
| | | barcode.HheatNO = ordrlist[i].HheatNO; |
| | | barcode.HGroupID2 = ordrlist[i].HGroupID; |
| | | barcode.HEmpID2 = ordrlist[i].HEmpID; |
| | | barcode.HCusModel2 = ordrlist[i].HCusModel; |
| | | barcode.HCusMaterName2 = ordrlist[i].HCusMaterName; |
| | | barcode.HCheckEmpName2 = ordrlist[i].HCheckEmpName; |
| | | ListRows.Add(barcode); |
| | | |
| | | n += 1; //æ´æ°åæ¹çæçæ¡ç æ° |
| | | oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); //æ´æ°æå¤§æµæ°´å· |
| | | } |
| | | } |
| | | else if(HSelectBarCodeType == "BarCode_Box") |
| | | { |
| | | int HBQty = ClsPub.isInt(ordrlist[i].HBQty); //ç®±æ° |
| | | |
| | | for (int j = 0; j < HBQty; j++) |
| | | { |
| | | string HBarCode_Temp = ""; //æ¡ç |
| | | string sTMNumber = ""; //æ¡ç åç¼ |
| | | string LSH = ""; //æå¤§æµæ°´å· |
| | | int HLen = 4; //æµæ°´å·é¿åº¦ |
| | | |
| | | //æ¡ç æ¼æ¥æéåæ®µ |
| | | string HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[i].HSupNumber).Replace(".", ""); //ä¾åºå代ç ï¼å»æåéç¬¦ï¼ |
| | | string sDateStr = sDate.ToString("yyMMdd"); //å¯å¨æ¥æï¼YYMMDDï¼ |
| | | |
| | | if (HSupNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¾åºå代ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¡ç åç¼ = R+ä¾åºå代ç ï¼å»æåé符ï¼+å¯å¨æ¥æï¼YYMMDDï¼+å使µæ°´å· |
| | | sTMNumber = "B" + HSupNumber + sDateStr; |
| | | |
| | | //æ ¹æ®æ¡ç åç¼è·åæå¤§æµæ°´å· |
| | | 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 + LSH; |
| | | |
| | | HBarCodeList barcode = new HBarCodeList(); |
| | | barcode.HBarCode2 = HBarCode_Temp; |
| | | barcode.HBarCodeType2 = "æçæ¡ç "; |
| | | barcode.HBarCodeSubType2 = "ç®±æ¡ç "; |
| | | barcode.HEntryID2 = ClsPub.isStrNull(i + 1); |
| | | barcode.HMaterID2 = ordrlist[i].HMaterID; |
| | | barcode.HMaterNumber2 = ordrlist[i].HMaterNumber; |
| | | barcode.HMaterName2 = ordrlist[i].HMaterName; |
| | | barcode.HMaterModel2 = ordrlist[i].HMaterModel; |
| | | barcode.HPinfan2 = ordrlist[i].HPinfan; |
| | | barcode.HPinfanBarCode2 = ordrlist[i].HPinfanBarCode; |
| | | barcode.HAuxPropID2 = ordrlist[i].HAuxPropID; |
| | | barcode.HAuxPropNumber2 = ordrlist[i].HAuxPropNumber; |
| | | barcode.HAuxPropName2 = ordrlist[i].HAuxPropName; |
| | | barcode.HUnitID2 = ordrlist[i].HUnitID; |
| | | barcode.HUnitNumber2 = ordrlist[i].HUnitNumber; |
| | | barcode.HUnitName2 = ordrlist[i].HUnitName; |
| | | barcode.HQty2 = ClsPub.isStrNull(0); |
| | | barcode.HBatchNo2 = ordrlist[i].HBatchNo; |
| | | barcode.HSourceInterID2 = ordrlist[i].HMainID; |
| | | barcode.HSourceEntryID2 = ordrlist[i].HSubID; |
| | | barcode.HSourceBillNo2 = ordrlist[i].HBillNo; |
| | | barcode.HSourceBillType2 = ordrlist[i].HBillType; |
| | | barcode.HPrint = "0"; |
| | | barcode.HWei = ""; |
| | | barcode.HBarcodeNo = ClsPub.isStrNull(n + 1); |
| | | barcode.HBarcodeQtys = ordrlist[i].HBQty; |
| | | barcode.HSupID2 = ordrlist[i].HSupID; |
| | | barcode.HSupNumber2 = ordrlist[i].HSupNumber; |
| | | barcode.HSupName2 = ordrlist[i].HSupName; |
| | | barcode.HDeptID2 = ordrlist[i].HDeptID; |
| | | barcode.HDeptNumber2 = ordrlist[i].HDeptNumber; |
| | | barcode.HDeptName2 = ordrlist[i].HDeptName; |
| | | barcode.HRemark2 = ordrlist[i].HRemark; |
| | | barcode.HDate2 = ordrlist[i].HDate; |
| | | barcode.HShowDate2 = ordrlist[i].HShowDate; |
| | | barcode.HWhID2 = ordrlist[i].HWhID; |
| | | barcode.HWhNumber2 = ordrlist[i].HWhNumber; |
| | | barcode.HWhName2 = ordrlist[i].HWhName; |
| | | barcode.HSPID2 = ordrlist[i].HSPID; |
| | | barcode.HSPNumber2 = ordrlist[i].HSPNumber; |
| | | barcode.HSPName2 = ordrlist[i].HSPName; |
| | | barcode.HMTONo2 = ordrlist[i].HMTONo; |
| | | barcode.HCusID2 = ordrlist[i].HCusID; |
| | | barcode.HCusNumber2 = ordrlist[i].HCusNumber; |
| | | barcode.HCusName2 = ordrlist[i].HCusName; |
| | | barcode.HCusType2 = ordrlist[i].HCusType; |
| | | barcode.HSourceID2 = ordrlist[i].HSourceID; |
| | | barcode.HSourceNumber2 = ordrlist[i].HSourceNumber; |
| | | barcode.HSourceName2 = ordrlist[i].HSourceName; |
| | | barcode.HEndDate2 = ordrlist[i].HEndDate; |
| | | barcode.HSeOrderBillNo2 = ordrlist[i].HSeOrderBillNo; |
| | | barcode.HInnerBillNo2 = ordrlist[i].HInnerBillNo; |
| | | barcode.HMaker2 = ordrlist[i].HMaker; |
| | | barcode.HGiveAwayFlag2 = ordrlist[i].HGiveAwayFlag; |
| | | barcode.HCoilNO = ordrlist[i].HCoilNO; |
| | | barcode.HFurnaceNO = ordrlist[i].HFurnaceNO; |
| | | barcode.HFactory = ordrlist[i].HFactory; |
| | | barcode.HAuxQty = ordrlist[i].HAuxQty; |
| | | barcode.HheatNO = ordrlist[i].HheatNO; |
| | | barcode.HGroupID2 = ordrlist[i].HGroupID; |
| | | barcode.HEmpID2 = ordrlist[i].HEmpID; |
| | | barcode.HCusModel2 = ordrlist[i].HCusModel; |
| | | barcode.HCusMaterName2 = ordrlist[i].HCusMaterName; |
| | | barcode.HCheckEmpName2 = ordrlist[i].HCheckEmpName; |
| | | ListRows.Add(barcode); |
| | | |
| | | n += 1; //æ´æ°åæ¹çæçæ¡ç æ° |
| | | oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); //æ´æ°æå¤§æµæ°´å· |
| | | } |
| | | } |
| | | else if (HSelectBarCodeType == "BarCode_Pack") |
| | | { |
| | | int HBQty = ClsPub.isInt(ordrlist[i].HBQty); //ç®±æ° |
| | | |
| | | for (int j = 0; j < HBQty; j++) |
| | | { |
| | | string HBarCode_Temp = ""; //æ¡ç |
| | | string sTMNumber = ""; //æ¡ç åç¼ |
| | | string LSH = ""; //æå¤§æµæ°´å· |
| | | int HLen = 4; //æµæ°´å·é¿åº¦ |
| | | |
| | | //æ¡ç æ¼æ¥æéåæ®µ |
| | | string HSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[i].HSupNumber).Replace(".", ""); //ä¾åºå代ç ï¼å»æåéç¬¦ï¼ |
| | | string sDateStr = sDate.ToString("yyMMdd"); //å¯å¨æ¥æï¼YYMMDDï¼ |
| | | |
| | | if (HSupNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¾åºå代ç ä¸è½ä¸ºç©ºï¼ä¸è½çææ¡ç ï¼"; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //æ¡ç åç¼ = R+ä¾åºå代ç ï¼å»æåé符ï¼+å¯å¨æ¥æï¼YYMMDDï¼+å使µæ°´å· |
| | | sTMNumber = "P" + HSupNumber + sDateStr; |
| | | |
| | | //æ ¹æ®æ¡ç åç¼è·åæå¤§æµæ°´å· |
| | | 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 + LSH; |
| | | |
| | | HBarCodeList barcode = new HBarCodeList(); |
| | | barcode.HBarCode2 = HBarCode_Temp; |
| | | barcode.HBarCodeType2 = "æçæ¡ç "; |
| | | barcode.HBarCodeSubType2 = "ææ¡ç "; |
| | | barcode.HEntryID2 = ClsPub.isStrNull(i + 1); |
| | | barcode.HMaterID2 = ordrlist[i].HMaterID; |
| | | barcode.HMaterNumber2 = ordrlist[i].HMaterNumber; |
| | | barcode.HMaterName2 = ordrlist[i].HMaterName; |
| | | barcode.HMaterModel2 = ordrlist[i].HMaterModel; |
| | | barcode.HPinfan2 = ordrlist[i].HPinfan; |
| | | barcode.HPinfanBarCode2 = ordrlist[i].HPinfanBarCode; |
| | | barcode.HAuxPropID2 = ordrlist[i].HAuxPropID; |
| | | barcode.HAuxPropNumber2 = ordrlist[i].HAuxPropNumber; |
| | | barcode.HAuxPropName2 = ordrlist[i].HAuxPropName; |
| | | barcode.HUnitID2 = ordrlist[i].HUnitID; |
| | | barcode.HUnitNumber2 = ordrlist[i].HUnitNumber; |
| | | barcode.HUnitName2 = ordrlist[i].HUnitName; |
| | | barcode.HQty2 = ClsPub.isStrNull(0); |
| | | barcode.HBatchNo2 = ordrlist[i].HBatchNo; |
| | | barcode.HSourceInterID2 = ordrlist[i].HMainID; |
| | | barcode.HSourceEntryID2 = ordrlist[i].HSubID; |
| | | barcode.HSourceBillNo2 = ordrlist[i].HBillNo; |
| | | barcode.HSourceBillType2 = ordrlist[i].HBillType; |
| | | barcode.HPrint = "0"; |
| | | barcode.HWei = ""; |
| | | barcode.HBarcodeNo = ClsPub.isStrNull(n + 1); |
| | | barcode.HBarcodeQtys = ordrlist[i].HBQty; |
| | | barcode.HSupID2 = ordrlist[i].HSupID; |
| | | barcode.HSupNumber2 = ordrlist[i].HSupNumber; |
| | | barcode.HSupName2 = ordrlist[i].HSupName; |
| | | barcode.HDeptID2 = ordrlist[i].HDeptID; |
| | | barcode.HDeptNumber2 = ordrlist[i].HDeptNumber; |
| | | barcode.HDeptName2 = ordrlist[i].HDeptName; |
| | | barcode.HRemark2 = ordrlist[i].HRemark; |
| | | barcode.HDate2 = ordrlist[i].HDate; |
| | | barcode.HShowDate2 = ordrlist[i].HShowDate; |
| | | barcode.HWhID2 = ordrlist[i].HWhID; |
| | | barcode.HWhNumber2 = ordrlist[i].HWhNumber; |
| | | barcode.HWhName2 = ordrlist[i].HWhName; |
| | | barcode.HSPID2 = ordrlist[i].HSPID; |
| | | barcode.HSPNumber2 = ordrlist[i].HSPNumber; |
| | | barcode.HSPName2 = ordrlist[i].HSPName; |
| | | barcode.HMTONo2 = ordrlist[i].HMTONo; |
| | | barcode.HCusID2 = ordrlist[i].HCusID; |
| | | barcode.HCusNumber2 = ordrlist[i].HCusNumber; |
| | | barcode.HCusName2 = ordrlist[i].HCusName; |
| | | barcode.HCusType2 = ordrlist[i].HCusType; |
| | | barcode.HSourceID2 = ordrlist[i].HSourceID; |
| | | barcode.HSourceNumber2 = ordrlist[i].HSourceNumber; |
| | | barcode.HSourceName2 = ordrlist[i].HSourceName; |
| | | barcode.HEndDate2 = ordrlist[i].HEndDate; |
| | | barcode.HSeOrderBillNo2 = ordrlist[i].HSeOrderBillNo; |
| | | barcode.HInnerBillNo2 = ordrlist[i].HInnerBillNo; |
| | | barcode.HMaker2 = ordrlist[i].HMaker; |
| | | barcode.HGiveAwayFlag2 = ordrlist[i].HGiveAwayFlag; |
| | | barcode.HCoilNO = ordrlist[i].HCoilNO; |
| | | barcode.HFurnaceNO = ordrlist[i].HFurnaceNO; |
| | | barcode.HFactory = ordrlist[i].HFactory; |
| | | barcode.HAuxQty = ordrlist[i].HAuxQty; |
| | | barcode.HheatNO = ordrlist[i].HheatNO; |
| | | barcode.HGroupID2 = ordrlist[i].HGroupID; |
| | | barcode.HEmpID2 = ordrlist[i].HEmpID; |
| | | barcode.HCusModel2 = ordrlist[i].HCusModel; |
| | | barcode.HCusMaterName2 = ordrlist[i].HCusMaterName; |
| | | barcode.HCheckEmpName2 = ordrlist[i].HCheckEmpName; |
| | | ListRows.Add(barcode); |
| | | |
| | | n += 1; //æ´æ°åæ¹çæçæ¡ç æ° |
| | | oCN.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); //æ´æ°æå¤§æµæ°´å· |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "éè¯¯çæ¡ç ç±»åï¼ä¸è½çææ¡ç ï¼"; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | for (int i = 0; i < ListRows.Count; i++) |
| | | { |
| | | if (ClsPub.isLong(ListRows[i].HMaterID2) != 0) |
| | | { |
| | | string HBarCode = ClsPub.isStrNull(ListRows[i].HBarCode2); |
| | | string HBarCodeType = ClsPub.isStrNull(ListRows[i].HBarCodeType2); |
| | | string HBarCodeSubType = ClsPub.isStrNull(ListRows[i].HBarCodeSubType2); |
| | | Int64 HMaterID = ClsPub.isLong(ListRows[i].HMaterID2); |
| | | Int64 HEntryID = ClsPub.isLong(ListRows[i].HEntryID2); |
| | | Int64 HAuxPropID = ClsPub.isLong(ListRows[i].HAuxPropID2); |
| | | Int64 HUnitID = ClsPub.isLong(ListRows[i].HUnitID2); |
| | | double HQty2 = ClsPub.isDoule(ListRows[i].HQty2); |
| | | string HWei = ClsPub.isStrNull(ListRows[i].HWei); |
| | | string HBatchNo2 = ClsPub.isStrNull(ListRows[i].HBatchNo2); |
| | | Int64 HSourceInterID = ClsPub.isLong(ListRows[i].HSourceInterID2); |
| | | Int64 HSourceEntryID = ClsPub.isLong(ListRows[i].HSourceEntryID2); |
| | | string HSourceBillNo = ClsPub.isStrNull(ListRows[i].HSourceBillNo2); |
| | | string HSourceBillType = ClsPub.isStrNull(ListRows[i].HSourceBillType2); |
| | | Int64 HBarcodeQtys = ClsPub.isLong(ListRows[i].HBarcodeQtys); |
| | | Int64 HBarcodeNo = ClsPub.isLong(ListRows[i].HBarcodeNo); |
| | | Int64 HSupID = ClsPub.isLong(ListRows[i].HSupID2); |
| | | Int64 HDeptID = ClsPub.isLong(ListRows[i].HDeptID2); |
| | | Int64 HWhID = ClsPub.isLong(ListRows[i].HWhID2); |
| | | Int64 HSPID = ClsPub.isLong(ListRows[i].HSPID2); |
| | | string HRemark = ClsPub.isStrNull(ListRows[i].HRemark2); |
| | | string HMaterName = ClsPub.isStrNull(ListRows[i].HMaterName2); |
| | | string HMaterModel = ClsPub.isStrNull(ListRows[i].HMaterModel2); |
| | | string HPinfan = ClsPub.isStrNull(ListRows[i].HPinfan2); |
| | | string HMTONo = ClsPub.isStrNull(ListRows[i].HMTONo2); |
| | | Int64 HCusID = ClsPub.isLong(ListRows[i].HCusID2); |
| | | string HCusType = ClsPub.isStrNull(ListRows[i].HCusType2); |
| | | DateTime HEndDate = ClsPub.isDate(ListRows[i].HEndDate2); |
| | | string HWorkLineName = ClsPub.isStrNull(ListRows[i].HSourceName2); |
| | | string HSeOrderBillNo = ClsPub.isStrNull(ListRows[i].HSeOrderBillNo2); |
| | | string HInnerBillNo = ClsPub.isStrNull(ListRows[i].HInnerBillNo2); |
| | | bool HGiveAwayFlag = ClsPub.isBool(ListRows[i].HGiveAwayFlag2); |
| | | int HPrintQty = ClsPub.isInt(ListRows[i].HPrint); |
| | | |
| | | string HCoilNO2 = ClsPub.isStrNull(ListRows[i].HCoilNO); |
| | | string HFurnaceNO2 = ClsPub.isStrNull(ListRows[i].HFurnaceNO); |
| | | string HFactory2 = ClsPub.isStrNull(ListRows[i].HFactory); |
| | | Int64 HAuxQty2 = ClsPub.isLong(ListRows[i].HAuxQty); |
| | | string HheatNO2 = ClsPub.isStrNull(ListRows[i].HheatNO); |
| | | DateTime HProduceDate = ClsPub.isDate(ListRows[i].HProduceDate); |
| | | DateTime HExpiryDate = ClsPub.isDate(ListRows[i].HExpiryDate); |
| | | int HGroupID2 = ClsPub.isInt(ListRows[i].HGroupID2); |
| | | Int64 HEmpID2 = ClsPub.isLong(ListRows[i].HEmpID2); |
| | | string HCusModel2 = ClsPub.isStrNull(ListRows[i].HCusModel2); |
| | | string HCusMaterName2 = ClsPub.isStrNull(ListRows[i].HCusMaterName2); |
| | | string HCheckEmpName2 = ClsPub.isStrNull(ListRows[i].HCheckEmpName2); |
| | | oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HBarCodeSubType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo" + |
| | | ",HCoilNO,HFurnaceNO,HFactory,HAuxQty,HheatNO,HProduceDate,HExpiryDate,HEmpID,HCusModel,HCusMaterName,HCheckEmpName " + |
| | | ") values (" |
| | | + "'" + HBarCode + "','" + HBarCodeType + "','" + HBarCodeSubType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString() |
| | | + ",'" + HBatchNo2 + "'," + HSupID.ToString() + "," + HGroupID2.ToString() + ",'" + ClsPub.CurUserName + "',getdate()," + HPrintQty.ToString() + "," + HQty2.ToString() |
| | | + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HWei + "'" |
| | | + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'" |
| | | + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'" |
| | | + ", " + 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 + "'" + ")"); |
| | | |
| | | } |
| | | } |
| | | //å¢å æ¡ç è¶
è¿æªçæåè½æ§å¶ |
| | | |
| | | // |
| | | |
| | | oCN.Commit(); |
| | | List<Object> listobj = ListRows.ConvertAll(s => (object)s);//Listå®ä½ç±»è½¬æ¢ä¸ºobject |
| | | //è·åçæçæ¡ç ä¿¡æ¯ |
| | | string sql = string.Format(@"select * from h_v_IF_BarCodeBillList Where HinterID=" + HInterID.ToString() + " order by HItemID"); |
| | | ds = new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_IF_ICMOBillList_Table"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-037]è·åèµæºç»å®æ°æ®æåï¼"; |
| | | objJsonResult.data = JsonConvert.DeserializeObject<DataTable>(JsonConvert.SerializeObject(ds.Tables[0], new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" })); //åºååDataSetä¸çæ¶é´æ ¼å¼ï¼ç¶ååååºåå忥 |
| | | objJsonResult.list = listobj; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-2-020]没æè¿åä»»ä½ç»æ,æ¡ç ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | objJsonResult.list = listobj; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[3899-2-006]æ¡ç çæå¤±è´¥ï¼" + e.Message; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | | } |
| | | } |