public ConfirmRetModAuditPriceResultModel ConfirmRetAuditPrice(ConfirmRetModAuditPriceModel query) { FltRetModApplyEntity fltRetModApplyEntity = _fltRetModApplyDal.Find <FltRetModApplyEntity>(query.Rmid); if (fltRetModApplyEntity == null) { throw new Exception("查无此申请"); } if (fltRetModApplyEntity.OrderStatus != FltRetApplyStatusEnum.A.ToString()) { throw new Exception("该审核已经提交审批"); } fltRetModApplyEntity.EditOid = query.Cid.ToString(); fltRetModApplyEntity.EditTime = DateTime.Now; fltRetModApplyEntity.OrderStatus = FltRetApplyStatusEnum.D.ToString(); _fltRetModApplyDal.Update(fltRetModApplyEntity, new string[] { "EditOid", "EditTime", "OrderStatus" }); bool isViolatePolicy = false; foreach (var detail in query.DetailList) { FltRetModFlightApplyEntity flightApplyEntity = _fltRetModFlightApplyDal.Query <FltRetModFlightApplyEntity>( n => n.Rmid == query.Rmid && n.Sequence == detail.Sequence && n.Pid == detail.Pid) .FirstOrDefault(); if (flightApplyEntity == null) { continue; } if (!string.IsNullOrEmpty(flightApplyEntity.PolicyDesc)) { isViolatePolicy = true; } flightApplyEntity.OrderStatus = fltRetModApplyEntity.OrderStatus; flightApplyEntity.ChoiceReasonId = detail.ChoiceReasonId; _fltRetModFlightApplyDal.Update(flightApplyEntity, new string[] { "ChoiceReasonId", "OrderStatus" }); } FltRetModApplyLogEntity log = new FltRetModApplyLogEntity() { Rmid = fltRetModApplyEntity.Rmid, LogTime = DateTime.Now, LogType = "修改退票申请", Oid = "sys", Remark = "进行核价" }; _fltRetModApplyLogDal.Insert(log); return(new ConfirmRetModAuditPriceResultModel() { IsSuccess = true, Rmid = fltRetModApplyEntity.Rmid, CorpAduitId = fltRetModApplyEntity.CorpAduitId, CorpPolicyId = fltRetModApplyEntity.CorpPolicyId, OwnCid = fltRetModApplyEntity.Cid, IsViolatePolicy = isViolatePolicy }); }
public bool ConfirmModAuditPrice(ConfirmRetModAuditPriceRequestViewModel request) { ConfirmRetModAuditPriceModel query = new ConfirmRetModAuditPriceModel(); query.Cid = request.Cid; query.Rmid = request.Rmid; query.DetailList = (from n in request.PolicyReasonList select new ConfirmRetModAuditPriceDetailModel() { Sequence = n.Sequence, ChoiceReasonId = n.ChoiceReasonId, Pid = n.Pid }).ToList(); ConfirmRetModAuditPriceResultModel resultModel; using (var transaction = this.Context.Database.BeginTransaction()) { try { //确认核价 resultModel = _confirmModAuditPriceServiceBll.ConfirmModAuditPrice(query); #region 核价完毕后,送审 if (resultModel != null && resultModel.IsSuccess) { SubmitCorpAduitOrderModel submitCorpAduitOrder = new SubmitCorpAduitOrderModel() { OrderInfoList = new List <SubmitCorpAduitOrderDetailModel>() { new SubmitCorpAduitOrderDetailModel() { OrderId = resultModel.Rmid, OrderType = OrderSourceTypeEnum.FltModApply } }, PolicyId = resultModel.CorpPolicyId, AduitConfigId = resultModel.CorpAduitId, Source = request.OrderSource, SubmitCid = request.Cid, SubmitOid = request.Oid, IsViolatePolicy = resultModel.IsViolatePolicy, OrderType = OrderSourceTypeEnum.FltModApply }; _submitCorpAduitOrderServiceBll.Submit(submitCorpAduitOrder); } #endregion transaction.Commit(); } catch (Exception ex) { transaction.Rollback(); throw; } } if (resultModel == null) { return(false); } return(resultModel.IsSuccess); }