| | |
| | | } |
| | | |
| | | //审核前控制================================================================================ |
| | | string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; |
| | | //ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl"); |
| | | //if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 1; |
| | | // objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //================================================================================ |
| | | |
| | | //审核 |
| | |
| | | } |
| | | |
| | | //审核后控制================================================================================ |
| | | string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sReturn = "审核过程中出错,请与网络管理人员联系"; |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCN.RollBack(); |
| | | return false; |
| | | } |
| | | //string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'"; |
| | | //ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl"); |
| | | //if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | //{ |
| | | // sReturn = "审核过程中出错,请与网络管理人员联系"; |
| | | // oCN.RollBack(); |
| | | // return false; |
| | | //} |
| | | //if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | //{ |
| | | // sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | // oCN.RollBack(); |
| | | // return false; |
| | | //} |
| | | //================================================================================ |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | [Route("Cj_StationEntrustOutBill/setOtherProperty")] |
| | | [HttpPost] |
| | | public object setOtherProperty([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = "[" + sArray[0].ToString() + "]"; |
| | | string user = sArray[1].ToString(); |
| | | ////判断是否有编辑权限 |
| | | //if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Edit", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "无编辑权限!"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | List<StationBill> list1 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg2); |
| | | long HInterID = list1[0].HInterID; |
| | | double HQty= list1[0].HQty; |
| | | double HBadCount = list1[0].HBadCount; |
| | | double HWasterQty = list1[0].HWasterQty; |
| | | long HSourceID = list1[0].HSourceID; |
| | | string HSourceName = list1[0].HSourceName; |
| | | long HCenterID = list1[0].HCenterID; |
| | | long HGroupID = list1[0].HGroupID; |
| | | long HEmpID = list1[0].HEmpID; |
| | | |
| | | |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain where HInterID="+ HInterID, "Sc_StationOutBillMain"); |
| | | if(ds.Tables.Count>0) |
| | | { |
| | | if(HQty>0) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc($"update Sc_StationOutBillMain set HQty={HQty},HBadCount='{HBadCount}',HWasterQty='{HWasterQty}',HSourceID='{HSourceID}',HCenterID='{HCenterID}',HGroupID={HGroupID},HEmpID={HEmpID} where HInterID={HInterID} "); |
| | | oCN.Commit(); |
| | | } |
| | | set_CheckBill(Convert.ToInt32(HInterID) , user); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "审核成功!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "单据不存在!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "审核失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | } |