| | |
| | | string OrganizationNUM = oCN.RunProcReturn("select HNumber from Xt_ORGANIZATIONS where HItemID=" + OrganizationID, "Xt_ORGANIZATIONS").Tables[0].Rows[0]["HNumber"].ToString(); |
| | | //根据工序汇报单主ID获取工序汇报入库单的数据 |
| | | DataSet ds = oCN.RunProcReturn("select * from h_v_MES_StationOutBillList_LastProc where HInterID=" + InterID, "h_v_MES_StationOutBillList_LastProc"); |
| | | if(ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "生成生产汇报单过程中没有查询到出站单"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DataRow dr = ds.Tables[0].Rows[0]; |
| | | |
| | | //保存 |
| | |
| | | //DataSet ds1 = oCN.RunProcReturn("select * from h_v_TOERPProcduct_LastProc where HLastProc = '是' and hbillno='" + BillNo.ToString() + "'", "h_v_TOERPProcduct_LastProc"); |
| | | DataSet ds1 = oCN.RunProcReturn("exec h_p_TOERPProcduct_LastProc '" + BillNo + "'", "h_p_TOERPProcduct_LastProc"); |
| | | DataRow dr1 = ds1.Tables[0].Rows[0]; |
| | | if (ds1.Tables[0].Rows.Count <= 0) |
| | | if (double.Parse(dr1[0].ToString()) <= 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | //DataRow dr = ds.Tables[0].Rows[0]; |
| | | |
| | | //判断本次报废总数量是否为0 |
| | | var DTable = oCN.RunProcReturn("select sum(HWasterQty) HWasterQty from Sc_StationOutBillMain where HProcExchBillNo='"+ BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0]; |
| | | var DTable = oCN.RunProcReturn("select isnull(sum(HWasterQty),0) HWasterQty from Sc_StationOutBillMain where HProcExchBillNo='"+ BillNo + "' and HBFFlag=0 ", "Sc_StationOutBillMain").Tables[0]; |
| | | |
| | | if (double.Parse(DTable.Rows[0]["HWasterQty"].ToString()) == 0) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 生成金蝶云来料检验单 |
| | | /// </summary> |
| | | /// <param name="InterID">工序汇报单主ID</param> |
| | | /// <returns></returns> |
| | | [Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json")] |
| | | [HttpGet] |
| | | public object set_SaveQCStockInCheckBill_Json(string HZJOrgNumber, string HMaterNumber, string HUnitNumber, |
| | | double HCheckQty, double HRightQty, double HBadQty, |
| | | string HCheckResult, string HSupNumber, |
| | | string HUseResult, Int64 HSeQ, Int64 HSourceInterID, |
| | | Int64 HSourceEntryID, string HSourceBillNo, string user, |
| | | Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID, |
| | | Int64 HMaterID, string HSourceBillType, Int64 HSLInterID, |
| | | Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID,ref string sErrMsg) |
| | | { |
| | | WebS2.WebService1 oWebs1 = new WebS2.WebService1(); |
| | | ///// <summary> |
| | | ///// 生成金蝶云来料检验单 |
| | | ///// </summary> |
| | | ///// <param name="InterID">工序汇报单主ID</param> |
| | | ///// <returns></returns> |
| | | //[Route("QCStockInCheckBill/set_SaveQCStockInCheckBill_Json")] |
| | | //[HttpGet] |
| | | //public object set_SaveQCStockInCheckBill_Json(string HZJOrgNumber, string HMaterNumber, string HUnitNumber, |
| | | // double HCheckQty, double HRightQty, double HBadQty, |
| | | // string HCheckResult, string HSupNumber, |
| | | // string HUseResult, Int64 HSeQ, Int64 HSourceInterID, |
| | | // Int64 HSourceEntryID, string HSourceBillNo, string user, |
| | | // Int64 HWHID, Int64 HSPID, Int64 HSupID, Int64 HKeeperID, |
| | | // Int64 HMaterID, string HSourceBillType, Int64 HSLInterID, |
| | | // Int64 HSLEntryID, string HSLBillNo, Int64 HSLSeQ, string HBillNo, Int64 HInterID,ref string sErrMsg) |
| | | //{ |
| | | // WebS.WebService1 oWebs1 = new WebS.WebService1(); |
| | | |
| | | |
| | | //oWebs1.Url = "http://localhost:9099/WebService1.asmx"; |
| | | //K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/"); |
| | | if (oWebs1.set_SaveQcStockInCheckBill_New(HZJOrgNumber, HMaterNumber, HUnitNumber, HCheckQty, HRightQty, HBadQty |
| | | , HCheckResult, HSupNumber, HUseResult, HSeQ, HSourceInterID |
| | | , HSourceEntryID, HSourceBillNo, user, HWHID, HSPID |
| | | , HSupID, HKeeperID, HMaterID, HSourceBillType, HSLInterID |
| | | , HSLEntryID, HSLBillNo, HSLSeQ, HBillNo, HInterID |
| | | , ref sErrMsg)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "生成单据成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "生成单据失败!"; |
| | | objJsonResult.data = sErrMsg; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | // //oWebs1.Url = "http://localhost:9099/WebService1.asmx"; |
| | | // //K3CloudApiClient client = new K3CloudApiClient("http://192.168.80.90/k3cloud/"); |
| | | // if (oWebs1.set_SaveQcStockInCheckBill_New(HZJOrgNumber, HMaterNumber, HUnitNumber, HCheckQty, HRightQty, HBadQty |
| | | // , HCheckResult, HSupNumber, HUseResult, HSeQ, HSourceInterID |
| | | // , HSourceEntryID, HSourceBillNo, user, HWHID, HSPID |
| | | // , HSupID, HKeeperID, HMaterID, HSourceBillType, HSLInterID |
| | | // , HSLEntryID, HSLBillNo, HSLSeQ, HBillNo, HInterID |
| | | // , ref sErrMsg)) |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "生成单据成功!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | // } |
| | | // else |
| | | // { |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "生成单据失败!"; |
| | | // objJsonResult.data = sErrMsg; |
| | | // return objJsonResult; |
| | | // } |
| | | //} |
| | | #endregion |
| | | |
| | | |