| | |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_Gy_BarCodeBillBomList '" + mainList[0].HProcExchBillNo + "'," + mainList[0].HProcID, "h_p_Gy_BarCodeBillBomList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) { |
| | | |
| | | string jsonstr = JsonConvert.SerializeObject(ds.Tables[0]); |
| | | |
| | | //保存生产组装单主表 |
| | |
| | | ,'',{sub[i].HMaterID},0,0,0,{sub[i].HQty} |
| | | ,0,0,getdate(),'{sub[i].HBarCode}','{mainList[0].HBarCode}','') "; |
| | | oCN.RunProc(sq2); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | string sExeReturnInfo = ""; |
| | | |
| | | ClsSc_AssemblyBillMain omodel = new ClsSc_AssemblyBillMain(); |
| | | omodel = JsonConvert.DeserializeObject<ClsSc_AssemblyBillMain>(sMainStr); |
| | |
| | | |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_QualifiedRecordsList where 产品条码='" + omodel.HBarCode_P + "' and HProcExchInterID="+ omodel .HProcExchInterID+ " and HProcExchEntryID="+ omodel.HProcExchEntryID + " and HProcID="+ omodel.HProcID, "h_v_Gy_QualifiedRecordsList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | double HProcPriceRate = 0;//工价系数 |
| | | int HTemporaryAreaID = 0;//暂放区 |
| | | |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain a left join Sc_StationOutBillSub_SN sn on a.HInterID=sn.HInterID where a.HInterID=" + HInterID + " and HBillNo='" + HBillNo + "'", "Sc_StationOutBillMain"); |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain a left join Sc_StationOutBillSub_SN sn on a.HInterID=sn.HInterID where a.HInterID=" + HInterID + " and HBillNo='" + HBillNo + "' and CONVERT(varchar(10),HDate,20) ='" + DateTime.Now.ToString("yyyy-MM-dd") + "' ", "Sc_StationOutBillMain"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | HInterID = DBUtility.ClsPub.CreateBillID("3791", ref sExeReturnInfo);//递入type得到的单据ID |
| | | HBillNo = DBUtility.ClsPub.CreateBillCode_Prod("3791", ref sExeReturnInfo, true);//递入type得到的单据号 |
| | | |
| | | oCN.RunProc("Insert Into Sc_StationOutBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate,HMouldNum" + |
| | | ",HYear,HPeriod,HRemark,HSourceName,HPieceQty,HWasterQty,HPlanPieceQty,HBadPNL" + |
| | |
| | | ds = oCN.RunProcReturn("select * from Sc_StationOutBillSub_SN where HInterID='" + omodel.HInterID + "' order by HEntryID desc", "Sc_StationOutBillSub_SN"); |
| | | |
| | | oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney) |
| | | values({omodel.HInterID}, '{omodel.HBillNo}', {(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)}, '{omodel.HBarCode_P}', 1, GETDATE(), '', " + HProcExchInterID + ","+ HProcExchEntryID + ", '"+ HProcExchBillNo + "', '', 0, 0)"); |
| | | values({HInterID}, '{HBillNo}', {(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)}, '{omodel.HBarCode_P}', 1, GETDATE(), '', " + HProcExchInterID + ","+ HProcExchEntryID + ", '"+ HProcExchBillNo + "', '', 0, 0)"); |
| | | |
| | | //反写工序出站单的合格数量 |
| | | oCN.RunProc("update Sc_StationOutBillMain set HQty+=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID); |
| | |
| | | string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString(); |
| | | string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString(); |
| | | string HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString(); |
| | | |
| | | string HDate = ds.Tables[0].Rows[0]["日期"].ToString(); |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | |
| | | oCN.RunProc(sql); |
| | | |
| | | //反写工序出站单的不良数量 |
| | | oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID); |
| | | oCN.RunProc(@"update Sc_StationOutBillMain set HBadCount-=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID='" + HProcExchEntryID + "' " + |
| | | "and HBillNo = (select HBillNo from Sc_StationOutBillMain " + |
| | | "where HProcExchInterID = '" + HProcExchInterID + "' and HProcExchEntryID = '" + HProcExchEntryID + "' and convert(varchar(10), HDate, 20) = '" + DateTime.Parse(HDate).ToString("yyyy-MM-dd") + "' and HBadCount > 0)"); |
| | | //反写流转卡状态 |
| | | oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + HBarCode + "'"); |
| | | |