Commit c8db89cd26ffee2271959a67fcdebcc1d36e56c1
1 parent
a52c7842
123
Showing
8 changed files
with
95 additions
and
12 deletions
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqDailyReport/StorePerformanceCompletionOutput.cs
| ... | ... | @@ -24,7 +24,22 @@ namespace NCC.Extend.Entitys.Dto.LqDailyReport |
| 24 | 24 | public decimal TargetPerformance { get; set; } |
| 25 | 25 | |
| 26 | 26 | /// <summary> |
| 27 | - /// 完成业绩(开单业绩) | |
| 27 | + /// 开单业绩 | |
| 28 | + /// </summary> | |
| 29 | + public decimal BillingPerformance { get; set; } | |
| 30 | + | |
| 31 | + /// <summary> | |
| 32 | + /// 退款业绩(退卡业绩) | |
| 33 | + /// </summary> | |
| 34 | + public decimal RefundPerformance { get; set; } | |
| 35 | + | |
| 36 | + /// <summary> | |
| 37 | + /// 实际业绩(开单业绩 - 退款业绩) | |
| 38 | + /// </summary> | |
| 39 | + public decimal ActualPerformance { get; set; } | |
| 40 | + | |
| 41 | + /// <summary> | |
| 42 | + /// 完成业绩(实际业绩,用于兼容旧版本) | |
| 28 | 43 | /// </summary> |
| 29 | 44 | public decimal CompletedPerformance { get; set; } |
| 30 | 45 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqXhFeedback/LqXhFeedbackCrInput.cs
| ... | ... | @@ -32,5 +32,11 @@ namespace NCC.Extend.Entitys.Dto.LqXhFeedback |
| 32 | 32 | /// </summary> |
| 33 | 33 | [Display(Name = "备注", Description = "反馈备注信息")] |
| 34 | 34 | public string Remark { get; set; } |
| 35 | + | |
| 36 | + /// <summary> | |
| 37 | + /// 科技部备注 | |
| 38 | + /// </summary> | |
| 39 | + [Display(Name = "科技部备注", Description = "科技部备注信息")] | |
| 40 | + public string KjbRemark { get; set; } | |
| 35 | 41 | } |
| 36 | 42 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqXhFeedback/LqXhFeedbackInfoOutput.cs
| ... | ... | @@ -18,6 +18,11 @@ namespace NCC.Extend.Entitys.Dto.LqXhFeedback |
| 18 | 18 | public string consumeId { get; set; } |
| 19 | 19 | |
| 20 | 20 | /// <summary> |
| 21 | + /// 会员ID | |
| 22 | + /// </summary> | |
| 23 | + public string memberId { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 21 | 26 | /// 前图片 |
| 22 | 27 | /// </summary> |
| 23 | 28 | public string beforeImage { get; set; } |
| ... | ... | @@ -33,6 +38,11 @@ namespace NCC.Extend.Entitys.Dto.LqXhFeedback |
| 33 | 38 | public string remark { get; set; } |
| 34 | 39 | |
| 35 | 40 | /// <summary> |
| 41 | + /// 科技部备注 | |
| 42 | + /// </summary> | |
| 43 | + public string kjbRemark { get; set; } | |
| 44 | + | |
| 45 | + /// <summary> | |
| 36 | 46 | /// 添加人ID |
| 37 | 47 | /// </summary> |
| 38 | 48 | public string createUser { get; set; } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqXhFeedback/LqXhFeedbackListOutput.cs
| ... | ... | @@ -18,6 +18,11 @@ namespace NCC.Extend.Entitys.Dto.LqXhFeedback |
| 18 | 18 | public string consumeId { get; set; } |
| 19 | 19 | |
| 20 | 20 | /// <summary> |
| 21 | + /// 会员ID | |
| 22 | + /// </summary> | |
| 23 | + public string memberId { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 21 | 26 | /// 前图片 |
| 22 | 27 | /// </summary> |
| 23 | 28 | public string beforeImage { get; set; } |
| ... | ... | @@ -33,6 +38,11 @@ namespace NCC.Extend.Entitys.Dto.LqXhFeedback |
| 33 | 38 | public string remark { get; set; } |
| 34 | 39 | |
| 35 | 40 | /// <summary> |
| 41 | + /// 科技部备注 | |
| 42 | + /// </summary> | |
| 43 | + public string kjbRemark { get; set; } | |
| 44 | + | |
| 45 | + /// <summary> | |
| 36 | 46 | /// 添加人ID |
| 37 | 47 | /// </summary> |
| 38 | 48 | public string createUser { get; set; } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_xh_feedback/LqXhFeedbackEntity.cs
| ... | ... | @@ -24,6 +24,12 @@ namespace NCC.Extend.Entitys.lq_xh_feedback |
| 24 | 24 | public string ConsumeId { get; set; } |
| 25 | 25 | |
| 26 | 26 | /// <summary> |
| 27 | + /// 会员ID | |
| 28 | + /// </summary> | |
| 29 | + [SugarColumn(ColumnName = "F_MemberId")] | |
| 30 | + public string MemberId { get; set; } | |
| 31 | + | |
| 32 | + /// <summary> | |
| 27 | 33 | /// 前图片 |
| 28 | 34 | /// </summary> |
| 29 | 35 | [SugarColumn(ColumnName = "F_BeforeImage")] |
| ... | ... | @@ -42,6 +48,12 @@ namespace NCC.Extend.Entitys.lq_xh_feedback |
| 42 | 48 | public string Remark { get; set; } |
| 43 | 49 | |
| 44 | 50 | /// <summary> |
| 51 | + /// 科技部备注 | |
| 52 | + /// </summary> | |
| 53 | + [SugarColumn(ColumnName = "F_KjbRemark")] | |
| 54 | + public string KjbRemark { get; set; } | |
| 55 | + | |
| 56 | + /// <summary> | |
| 45 | 57 | /// 添加人ID |
| 46 | 58 | /// </summary> |
| 47 | 59 | [SugarColumn(ColumnName = "F_CreateUser")] | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqDailyReportService.cs
| ... | ... | @@ -192,8 +192,11 @@ namespace NCC.Extend |
| 192 | 192 | /// - StoreId: 门店ID |
| 193 | 193 | /// - StoreName: 门店名称 |
| 194 | 194 | /// - TargetPerformance: 目标业绩(生命线,来自门店信息表) |
| 195 | - /// - CompletedPerformance: 完成业绩(当月1号至统计日期的开单业绩总和) | |
| 196 | - /// - CompletionRate: 完成率(百分比,CompletedPerformance / TargetPerformance * 100) | |
| 195 | + /// - BillingPerformance: 开单业绩(开单业绩总和) | |
| 196 | + /// - RefundPerformance: 退款业绩(退卡业绩总和) | |
| 197 | + /// - ActualPerformance: 实际业绩(开单业绩 - 退款业绩) | |
| 198 | + /// - CompletedPerformance: 完成业绩(实际业绩,用于兼容旧版本) | |
| 199 | + /// - CompletionRate: 完成率(百分比,ActualPerformance / TargetPerformance * 100) | |
| 197 | 200 | /// </remarks> |
| 198 | 201 | /// <param name="input">查询参数</param> |
| 199 | 202 | /// <returns>门店业绩完成情况列表</returns> |
| ... | ... | @@ -222,7 +225,7 @@ namespace NCC.Extend |
| 222 | 225 | store.dm as StoreName, |
| 223 | 226 | -- 目标业绩(生命线) |
| 224 | 227 | COALESCE(store.xsyj, 0) as TargetPerformance, |
| 225 | - -- 完成业绩(开单业绩总和) | |
| 228 | + -- 开单业绩总和 | |
| 226 | 229 | COALESCE(( |
| 227 | 230 | SELECT SUM(billing.sfyj) |
| 228 | 231 | FROM lq_kd_kdjlb billing |
| ... | ... | @@ -230,25 +233,39 @@ namespace NCC.Extend |
| 230 | 233 | AND billing.F_IsEffective = 1 |
| 231 | 234 | AND DATE(billing.kdrq) >= '{startDate:yyyy-MM-dd}' |
| 232 | 235 | AND DATE(billing.kdrq) <= '{endDate:yyyy-MM-dd}' |
| 233 | - ), 0) as CompletedPerformance | |
| 236 | + ), 0) as BillingPerformance, | |
| 237 | + -- 退款业绩总和(退卡业绩) | |
| 238 | + COALESCE(( | |
| 239 | + SELECT SUM(refund.tkje) | |
| 240 | + FROM lq_hytk_hytk refund | |
| 241 | + WHERE refund.md = store.F_Id | |
| 242 | + AND refund.F_IsEffective = 1 | |
| 243 | + AND DATE(refund.tksj) >= '{startDate:yyyy-MM-dd}' | |
| 244 | + AND DATE(refund.tksj) <= '{endDate:yyyy-MM-dd}' | |
| 245 | + ), 0) as RefundPerformance | |
| 234 | 246 | FROM lq_mdxx store |
| 235 | 247 | WHERE 1=1 {storeFilter} |
| 236 | - ORDER BY CompletedPerformance DESC"; | |
| 248 | + ORDER BY (BillingPerformance - RefundPerformance) DESC"; | |
| 237 | 249 | |
| 238 | 250 | var result = await _db.Ado.SqlQueryAsync<dynamic>(sql); |
| 239 | 251 | |
| 240 | 252 | var outputList = result.Select(item => |
| 241 | 253 | { |
| 242 | 254 | var targetPerformance = Convert.ToDecimal(item.TargetPerformance); |
| 243 | - var completedPerformance = Convert.ToDecimal(item.CompletedPerformance); | |
| 244 | - var completionRate = targetPerformance > 0 ? (completedPerformance / targetPerformance * 100m) : 0m; | |
| 255 | + var billingPerformance = Convert.ToDecimal(item.BillingPerformance); | |
| 256 | + var refundPerformance = Convert.ToDecimal(item.RefundPerformance); | |
| 257 | + var actualPerformance = billingPerformance - refundPerformance; | |
| 258 | + var completionRate = targetPerformance > 0 ? (actualPerformance / targetPerformance * 100m) : 0m; | |
| 245 | 259 | |
| 246 | 260 | return new StorePerformanceCompletionOutput |
| 247 | 261 | { |
| 248 | 262 | StoreId = item.StoreId, |
| 249 | 263 | StoreName = item.StoreName, |
| 250 | 264 | TargetPerformance = targetPerformance, |
| 251 | - CompletedPerformance = completedPerformance, | |
| 265 | + BillingPerformance = billingPerformance, | |
| 266 | + RefundPerformance = refundPerformance, | |
| 267 | + ActualPerformance = actualPerformance, | |
| 268 | + CompletedPerformance = actualPerformance, // 保持兼容性 | |
| 252 | 269 | CompletionRate = decimal.Round(completionRate, 2) |
| 253 | 270 | }; |
| 254 | 271 | }).ToList(); | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqTkjlbService.cs
netcore/src/Modularity/Extend/NCC.Extend/LqXhFeedbackService.cs
| ... | ... | @@ -92,17 +92,21 @@ namespace NCC.Extend |
| 92 | 92 | /// ```json |
| 93 | 93 | /// { |
| 94 | 94 | /// "consumeId": "耗卡记录ID", |
| 95 | + /// "memberId": "会员ID", | |
| 95 | 96 | /// "beforeImage": "前图片路径或Base64", |
| 96 | 97 | /// "afterImage": "后图片路径或Base64", |
| 97 | - /// "remark": "反馈备注" | |
| 98 | + /// "remark": "反馈备注", | |
| 99 | + /// "kjbRemark": "科技部备注" | |
| 98 | 100 | /// } |
| 99 | 101 | /// ``` |
| 100 | 102 | /// |
| 101 | 103 | /// 参数说明: |
| 102 | 104 | /// - consumeId: 耗卡记录ID(必填) |
| 105 | + /// - memberId: 会员ID(可选) | |
| 103 | 106 | /// - beforeImage: 前图片(可选) |
| 104 | 107 | /// - afterImage: 后图片(可选) |
| 105 | 108 | /// - remark: 反馈备注(可选) |
| 109 | + /// - kjbRemark: 科技部备注(可选) | |
| 106 | 110 | /// </remarks> |
| 107 | 111 | /// <param name="input">创建参数</param> |
| 108 | 112 | /// <returns>创建的耗卡反馈记录</returns> |
| ... | ... | @@ -125,6 +129,7 @@ namespace NCC.Extend |
| 125 | 129 | entity.CreateUser = _userManager.UserId; |
| 126 | 130 | entity.CreateTime = DateTime.Now; |
| 127 | 131 | entity.UpdateTime = DateTime.Now; |
| 132 | + entity.MemberId = consumeRecord.Hy; | |
| 128 | 133 | await _db.Insertable(entity).ExecuteCommandAsync(); |
| 129 | 134 | return entity.Adapt<LqXhFeedbackInfoOutput>(); |
| 130 | 135 | } |
| ... | ... | @@ -147,18 +152,22 @@ namespace NCC.Extend |
| 147 | 152 | /// { |
| 148 | 153 | /// "id": "反馈记录ID", |
| 149 | 154 | /// "consumeId": "耗卡记录ID", |
| 155 | + /// "memberId": "会员ID", | |
| 150 | 156 | /// "beforeImage": "前图片路径或Base64", |
| 151 | 157 | /// "afterImage": "后图片路径或Base64", |
| 152 | - /// "remark": "反馈备注" | |
| 158 | + /// "remark": "反馈备注", | |
| 159 | + /// "kjbRemark": "科技部备注" | |
| 153 | 160 | /// } |
| 154 | 161 | /// ``` |
| 155 | 162 | /// |
| 156 | 163 | /// 参数说明: |
| 157 | 164 | /// - id: 反馈记录ID(必填) |
| 158 | 165 | /// - consumeId: 耗卡记录ID(必填) |
| 166 | + /// - memberId: 会员ID(可选) | |
| 159 | 167 | /// - beforeImage: 前图片(可选) |
| 160 | 168 | /// - afterImage: 后图片(可选) |
| 161 | 169 | /// - remark: 反馈备注(可选) |
| 170 | + /// - kjbRemark: 科技部备注(可选) | |
| 162 | 171 | /// </remarks> |
| 163 | 172 | /// <param name="input">更新参数</param> |
| 164 | 173 | /// <returns>更新后的耗卡反馈记录</returns> |
| ... | ... | @@ -187,7 +196,9 @@ namespace NCC.Extend |
| 187 | 196 | entity.BeforeImage = input.BeforeImage; |
| 188 | 197 | entity.AfterImage = input.AfterImage; |
| 189 | 198 | entity.Remark = input.Remark; |
| 199 | + entity.KjbRemark = input.KjbRemark; | |
| 190 | 200 | entity.UpdateTime = DateTime.Now; |
| 201 | + entity.MemberId = consumeRecord.Hy; | |
| 191 | 202 | await _db.Updateable(entity).ExecuteCommandAsync(); |
| 192 | 203 | return entity.Adapt<LqXhFeedbackInfoOutput>(); |
| 193 | 204 | } |
| ... | ... | @@ -272,9 +283,11 @@ namespace NCC.Extend |
| 272 | 283 | { |
| 273 | 284 | id = it.Id, |
| 274 | 285 | consumeId = it.ConsumeId, |
| 286 | + memberId = it.MemberId, | |
| 275 | 287 | beforeImage = it.BeforeImage, |
| 276 | 288 | afterImage = it.AfterImage, |
| 277 | 289 | remark = it.Remark, |
| 290 | + kjbRemark = it.KjbRemark, | |
| 278 | 291 | createUser = it.CreateUser, |
| 279 | 292 | createUserName = SqlFunc.Subqueryable<UserEntity>().Where(x => x.Id == it.CreateUser).Select(x => x.RealName), |
| 280 | 293 | createTime = it.CreateTime, | ... | ... |