Commit 023505ba6a5d2507aaa89f697f85dd61cde16d51
1 parent
44e46b3e
Enhance LqEventService to include TargetCount in success data; add debug logging…
… for Excel import process; modify LqEventUser DTO to support TargetCount; update projectNumber type in LqKdPxmx DTO and entity to decimal for consistency.
Showing
5 changed files
with
31 additions
and
6 deletions
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEventUser/LqEventUserCrInput.cs
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdPxmx/LqKdPxmxCrInput.cs
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_kd_pxmx/LqKdPxmxEntity.cs
netcore/src/Modularity/Extend/NCC.Extend/LqEventService.cs
| ... | ... | @@ -604,6 +604,7 @@ namespace NCC.Extend.LqEvent |
| 604 | 604 | DepId = user.OrganizeId, |
| 605 | 605 | TeamName = row.TeamName, |
| 606 | 606 | StoreId = storeId, |
| 607 | + TargetCount = row.TargetCount, | |
| 607 | 608 | }; |
| 608 | 609 | |
| 609 | 610 | result.SuccessData.Add(successData); |
| ... | ... | @@ -656,8 +657,23 @@ namespace NCC.Extend.LqEvent |
| 656 | 657 | // 使用ExcelImportHelper读取Excel文件 |
| 657 | 658 | var dataTable = ExcelImportHelper.ToDataTable(tempFilePath, 0, 0); |
| 658 | 659 | |
| 659 | - // 从第2行开始读取数据(第1行是标题) | |
| 660 | - for (int i = 1; i < dataTable.Rows.Count; i++) | |
| 660 | + // 调试信息:输出总行数和列数 | |
| 661 | + Console.WriteLine($"Excel总行数: {dataTable.Rows.Count}, 总列数: {dataTable.Columns.Count}"); | |
| 662 | + | |
| 663 | + // 调试信息:输出所有行的数据 | |
| 664 | + for (int debugRow = 0; debugRow < dataTable.Rows.Count; debugRow++) | |
| 665 | + { | |
| 666 | + var debugRowData = dataTable.Rows[debugRow]; | |
| 667 | + var debugValues = new List<string>(); | |
| 668 | + for (int debugCol = 0; debugCol < debugRowData.ItemArray.Length; debugCol++) | |
| 669 | + { | |
| 670 | + debugValues.Add(debugRowData[debugCol]?.ToString() ?? "null"); | |
| 671 | + } | |
| 672 | + Console.WriteLine($"调试第{debugRow + 1}行: {string.Join(", ", debugValues)}"); | |
| 673 | + } | |
| 674 | + | |
| 675 | + // 从第1行开始读取数据(没有标题行) | |
| 676 | + for (int i = 0; i < dataTable.Rows.Count; i++) | |
| 661 | 677 | { |
| 662 | 678 | var row = dataTable.Rows[i]; |
| 663 | 679 | var mobilePhone = row[0]?.ToString()?.Trim(); |
| ... | ... | @@ -666,6 +682,9 @@ namespace NCC.Extend.LqEvent |
| 666 | 682 | var storeName = row[3]?.ToString()?.Trim(); |
| 667 | 683 | var targetCountStr = row[4]?.ToString()?.Trim(); |
| 668 | 684 | |
| 685 | + // 调试信息:输出每一行读取的数据 | |
| 686 | + Console.WriteLine($"第{i + 1}行数据: 手机号={mobilePhone}, 姓名={name}, 战队={teamName}, 门店={storeName}, 目标={targetCountStr}"); | |
| 687 | + | |
| 669 | 688 | int? targetCount = null; |
| 670 | 689 | if (!string.IsNullOrEmpty(targetCountStr) && int.TryParse(targetCountStr, out int target)) |
| 671 | 690 | { |
| ... | ... | @@ -675,6 +694,7 @@ namespace NCC.Extend.LqEvent |
| 675 | 694 | // 跳过空行 |
| 676 | 695 | if (string.IsNullOrEmpty(mobilePhone) && string.IsNullOrEmpty(name)) |
| 677 | 696 | { |
| 697 | + Console.WriteLine($"第{i + 1}行被跳过:空行"); | |
| 678 | 698 | continue; |
| 679 | 699 | } |
| 680 | 700 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqKdKdjlbService.cs
| ... | ... | @@ -276,8 +276,8 @@ namespace NCC.Extend.LqKdKdjlb |
| 276 | 276 | CreateTIme = DateTime.Now, |
| 277 | 277 | MemberId = entity.Kdhy, |
| 278 | 278 | IsEnabled = 0, |
| 279 | - ProjectNumber = item.projectNumber ?? 1, | |
| 280 | - TotalPrice = (decimal)(item.pxjg * (item.projectNumber ?? 1)), | |
| 279 | + ProjectNumber = item.projectNumber, | |
| 280 | + TotalPrice = (decimal)(item.pxjg * item.projectNumber), | |
| 281 | 281 | Px = item.px, |
| 282 | 282 | Pxmc = item.pxmc, |
| 283 | 283 | Pxjg = item.pxjg, | ... | ... |