| | |
| | | // } |
| | | //} |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 首件检验逻辑删除功能 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetQC_FirstPieceCheck")] |
| | | [HttpGet] |
| | | public object DeltetQC_FirstPieceCheck(string HInterID, string user) |
| | | { |
| | | string ModRightNameCheck = "QC_FirstPieceCheckBill_Delete"; |
| | | try |
| | | { |
| | | //删除权限 |
| | | if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "删除失败!无权限!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //开始事物 |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillSub where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillSub_ValueGrid where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From QC_FirstPieceCheckBillSub_Result where HInterID = " + HInterID); |
| | | //提交事务 |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 巡检 |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string user = sArray[2].ToString(); |
| | | string badmsg = sArray[3].ToString(); |
| | | |
| | | |
| | | string UserName = ""; |
| | |
| | | oItem.HBillSubType = "7506"; |
| | | oItem.HBillStatus = 0; |
| | | oItem.HPeriod = 0; |
| | | oItem.HMaker = ""; |
| | | oItem.HMaker = user; |
| | | oItem.HMainSourceInterID = oItem.HInterID; |
| | | |
| | | //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | oItemSub.HRelationQty = 0; |
| | | oItemSub.HRelationMoney = 0; |
| | | oItemSub.HCloseMan = ""; |
| | | oItemSub.HRemark = ""; |
| | | //oItemSub.HRemark = ""; |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | badmsg = badmsg.Substring(1, badmsg.Length - 2); |
| | | badmsg = badmsg.Replace("\\", ""); |
| | | badmsg = badmsg.Replace("\n", ""); //\n |
| | | List<Model.ClsQC_PatrolProcCheckBillSub_BadReason> bs = new List<Model.ClsQC_PatrolProcCheckBillSub_BadReason>(); |
| | | bs = oListModels.getObjectByJson_ClsQC_PatrolProcCheckBillSub_BadReason(badmsg); |
| | | int j = 0; |
| | | foreach (Model.ClsQC_PatrolProcCheckBillSub_BadReason badSub in bs) |
| | | { |
| | | badSub.HBillNo_bak = oBill.omodel.HBillNo;//单据号(备份,以免内码丢失,找不到对应主表) |
| | | j++; |
| | | if (string.IsNullOrWhiteSpace(badSub.HBillNo_bak)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "保存失败!没备份单据号,无法保存!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | badSub.HInterID = oBill.omodel.HInterID; |
| | | badSub.HEntryID = j; |
| | | badSub.HSEQ = j; |
| | | oBill.DetailColl_Bad.Add(badSub); |
| | | } |
| | | |
| | | //保存 |
| | | //保存完毕后处理 |
| | | bool bResult; |