| | |
| | | oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney) |
| | | 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)"); |
| | | |
| | | //把条码写入日志里面 |
| | | LogService.CustomWriteLog("条码:" + omodel.HBarCode_P + ",工序:"+ HProcID + ",出站时间:" + DateTime.Now, "TM" + DateTime.Now.ToString("yyyy-MM-dd")); |
| | | |
| | | //反写工序出站单的合格数量 |
| | | oCN.RunProc("update Sc_StationOutBillMain set HQty+=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID+ " and HInterID=" + HInterID); |
| | | |
| | | |
| | | ds = oCN.RunProcReturn($@"select (b.HQty -sum(isnull(ou.HQty,0))-sum(isnull(ou.HBadCount,0))) HQty from Sc_ProcessExchangeBillSub b WITH(NOLOCK) |
| | | left join Sc_StationOutBillMain ou WITH(NOLOCK) on b.HInterID=ou.HProcExchInterID and b.HEntryID=ou.HProcExchEntryID |
| | | where b.HInterID={HProcExchInterID} and b.HEntryID={HProcExchEntryID} |
| | | group by b.HInterID,b.HEntryID,b.HQty", "Sc_ProcessExchangeBill_Out"); |
| | | |
| | | if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "出站数量超过流转卡数量!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | |
| | |
| | | { |
| | | if (HBarCode.Length == 29) |
| | | { |
| | | string str1 = HBarCode.Substring(23, 3); |
| | | string str1 = HBarCode.Substring(18, 8); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | |
| | | } |
| | | else { |
| | | |
| | | string str1 = HBarCode.Substring(23, 3); |
| | | string str1 = HBarCode.Substring(18, 8); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn(@"select m.HNumber 物料代码,o.HNumber 组织代码 from Sc_ProcessExchangeBillMain a WITH(NOLOCK) |
| | | left join Gy_Material m WITH(NOLOCK) on a.HMaterID=m.HItemID |
| | |
| | | // } |
| | | |
| | | oCN.RunProc("update Gy_BarCodeBill set HStatus='' where HBarCode='" + model.HBarCode + "'"); |
| | | |
| | | DataSet dataSet = oCN.RunProcReturn($"select top 1 HInterID from Sc_StationOutBillMain where HProcExchInterID={subLsit[0].HProcExchInterID} and HProcExchEntryID={subLsit[0].HProcExchEntryID} and HBadCount>0", "Sc_StationOutBillMain"); |
| | | |
| | | if (dataSet.Tables[0].Rows.Count > 0) |
| | | { |
| | | string HOutInterID = dataSet.Tables[0].Rows[0][0].ToString(); |
| | | |
| | | oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HInterID='" + HOutInterID + "'"); |
| | | } |
| | | else |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败,当前流转卡当前工序的出站单没有不良数量!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败,无结果!"; |