public async Task <ActionResult> GotoExam(int pkid, string pid, decimal price, int type, decimal?cost, decimal?PurchasePrice, int?totalstock, int?num_week, int?num_month, decimal?guidePrice, decimal nowPrice, string maoliLv, string chaochu, decimal?jdself, decimal?maolie) { var resultExam = BaoYangPriceGuideManager.GotoAudit(type > 0, ThreadIdentity.Operator.Name, pid, cost, PurchasePrice, totalstock, num_week, num_month, guidePrice, nowPrice, maoliLv, chaochu, jdself, maolie); var model = BaoYangPriceGuideManager.FetchPriceAudit(pkid); if (type <= 0) { TuhuMessage.SendEmail("[被驳回]保养品价格修改申请", model.ApplyPerson, $"您于{DateTime.Now}申请将{model.PID}保养品价格修改为{model.ApplyPrice}元,已被{model.AuditPerson}驳回。"); return(Json(resultExam)); } int result = -99; if (resultExam > 0 && type > 0) { result = await UpdatePriceAsync(pid, price, $"通过保养价格指导系统审核通过后修改({model.ApplyReason})"); } return(Json(result)); }
public async Task <ActionResult> GotoExam(int pkid, string pid, decimal price, int type, decimal?cost, decimal?PurchasePrice, int?totalstock, int?num_week, int?num_month, decimal?guidePrice, decimal nowPrice, string maoliLv, string chaochu, decimal?jdself, decimal?maolie) { var resultExam = BaoYangPriceGuideManager.GotoAudit(type > 0, ThreadIdentity.Operator.Name, pid, cost, PurchasePrice, totalstock, num_week, num_month, guidePrice, nowPrice, maoliLv, chaochu, jdself, maolie); var model = BaoYangPriceGuideManager.FetchPriceAudit(pkid); if (type <= 0) { TuhuMessage.SendEmail("[被驳回]保养品价格修改申请", model.ApplyPerson, $"您于{DateTime.Now}申请将{model.PID}保养品价格修改为{model.ApplyPrice}元,已被{model.AuditPerson}驳回。"); return(Json(resultExam)); } int result = -99; if (resultExam > 0 && type > 0) { if (!string.Equals(model.Type, "QPLPrice", StringComparison.CurrentCultureIgnoreCase)) { result = await UpdatePriceAsync(pid, price, $"通过保养价格指导系统审核通过后修改({model.ApplyReason})"); } else { var manager = new BaoYangPriceGuideManager(); var dic = new Dictionary <string, decimal>(); dic.Add(pid, price); var qplprice = manager.GetQPLPriceBypid(pid); var msg = await manager.UpdateQPLProductPriceByPidAsync(dic, User.Identity.Name); if (!string.IsNullOrWhiteSpace(msg)) { PriceManager.InsrtCouponPriceHistory(new CouponPriceHistory() { PID = pid, OldPrice = qplprice, NewPrice = price, ChangeUser = User.Identity.Name, ChangeDateTime = DateTime.Now, ChangeReason = $"通过GLXT审核通过后修改(申请原因:{ model.ApplyReason})" }); result = 1; } else { result = -4; } } } return(Json(result)); }