|
@@ -88,6 +88,26 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
status = ERedPackAuditStatus.Agree;
|
|
|
var redPackAudit = await _redPackAuditRepository.GetAsync(dto.RedPackAuditId, token) ?? throw UserFriendlyException.SameMessage("审核记录不存在");
|
|
|
if (redPackAudit.Status != ERedPackAuditStatus.Pending) throw UserFriendlyException.SameMessage("已审核, 不可重复审核");
|
|
|
+ var industry = await _industryRepository.Queryable(includeDeleted: true)
|
|
|
+ .LeftJoin<OrderSnapshot>((i, o) => i.Id == o.IndustryId)
|
|
|
+ .Where((i, o) => o.Id == redPackAudit.OrderId)
|
|
|
+ .Select((i, o) => new {
|
|
|
+ i.Id,
|
|
|
+ i.CitizenReadPackAmount,
|
|
|
+ i.ArgeePoints,
|
|
|
+ i.ExtraDeductedPoints,
|
|
|
+ i.RefusePoints,
|
|
|
+ i.IsPoints,
|
|
|
+ o.IsSafetyDepartment,
|
|
|
+ i.Name
|
|
|
+ })
|
|
|
+ .FirstAsync(token);
|
|
|
+ redPackAudit.ApprovedAmount = redPackAudit.ShouldAmount;
|
|
|
+ if (industry.Name == "安全隐患" && industry.IsSafetyDepartment.HasValue && industry.IsSafetyDepartment == true)
|
|
|
+ {
|
|
|
+ redPackAudit.ApprovedAmount = 20;
|
|
|
+ }
|
|
|
+
|
|
|
redPackAudit.SMSTemplateId = dto.SMSTemplateId;
|
|
|
redPackAudit.Status = status;
|
|
|
redPackAudit.AuditRemark = dto.Opinion;
|
|
@@ -97,7 +117,6 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
redPackAudit.AuditTime = DateTime.Now;
|
|
|
redPackAudit.AuditOrgId = _sessionContext.OrgId;
|
|
|
redPackAudit.AuditOrgName = _sessionContext.OrgName;
|
|
|
- redPackAudit.ApprovedAmount = redPackAudit.ShouldAmount;
|
|
|
redPackAudit.Points = dto.Points;
|
|
|
redPackAudit.PointsStatus = dto.PointsStatus;
|
|
|
redPackAudit.PointsOpinion = dto.PointsOpinion;
|
|
@@ -247,9 +266,22 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
var industry = await _industryRepository.Queryable(includeDeleted: true)
|
|
|
.LeftJoin<OrderSnapshot>((i, o) => i.Id == o.IndustryId)
|
|
|
.Where((i, o) => o.Id == id)
|
|
|
- .Select((i, o) => new { i.Id, i.CitizenReadPackAmount, i.ArgeePoints, i.ExtraDeductedPoints, i.RefusePoints, i.IsPoints })
|
|
|
+ .Select((i, o) => new {
|
|
|
+ i.Id,
|
|
|
+ i.CitizenReadPackAmount,
|
|
|
+ i.ArgeePoints,
|
|
|
+ i.ExtraDeductedPoints,
|
|
|
+ i.RefusePoints,
|
|
|
+ i.IsPoints,
|
|
|
+ o.IsSafetyDepartment,
|
|
|
+ i.Name
|
|
|
+ })
|
|
|
.FirstAsync();
|
|
|
outDto.Amount = industry.CitizenReadPackAmount;
|
|
|
+ if (industry.Name == "安全隐患" && industry.IsSafetyDepartment.HasValue && industry.IsSafetyDepartment == true)
|
|
|
+ {
|
|
|
+ outDto.Amount = 20;
|
|
|
+ }
|
|
|
outDto.ArgeePoints = industry.ArgeePoints;
|
|
|
outDto.ExtraDeductedPoints = industry.ExtraDeductedPoints;
|
|
|
outDto.RefusePoints = industry.RefusePoints;
|