Commit d98270e22aabecd89cefd018b7f4bbfdb4be7870
1 parent
24425bb1
Enhance LqEventService to include EventType in event creation and update process…
…es; add manual time field settings to preserve time accuracy; implement GetEventTypes endpoint to retrieve event type enumeration; update LqTkjlb DTO to include eventId and eventName for better tracking of related events.
Showing
31 changed files
with
1331 additions
and
607 deletions
[已用]创建金三角统计视图.sql
0 → 100644
| 1 | +-- 创建金三角统计视图 | |
| 2 | +-- 用于统计金三角的订单数量、业绩总额、首次和最后订单日期等信息 | |
| 3 | +-- 按月份和业绩总额降序排列 | |
| 4 | + | |
| 5 | +CREATE VIEW v_jsj_monthly_performance AS | |
| 6 | +SELECT | |
| 7 | + `jsj`.`F_Id` AS `jsj_id`, | |
| 8 | + `jsj`.`jsj` AS `jsj_name`, | |
| 9 | + `jsj`.`yf` AS `month`, | |
| 10 | + `jsj`.`md` AS `store_id`, | |
| 11 | + `md`.`dm` AS `store_name`, | |
| 12 | + count( DISTINCT `jksyj`.`glkdbh` ) AS `order_count`, | |
| 13 | + sum( | |
| 14 | + cast( `jksyj`.`jksyj` AS DECIMAL ( 18, 2 ) ) | |
| 15 | + ) AS `total_performance`, | |
| 16 | + max( `jksyj`.`yjsj` ) AS `last_order_date`, | |
| 17 | + min( `jksyj`.`yjsj` ) AS `first_order_date` | |
| 18 | +FROM | |
| 19 | + ( | |
| 20 | + ( | |
| 21 | + `lq_ycsd_jsj` `jsj` | |
| 22 | + LEFT JOIN `lq_kd_jksyj` `jksyj` ON ( | |
| 23 | + ( | |
| 24 | + ( `jsj`.`F_Id` = `jksyj`.`jsj_id` ) | |
| 25 | + AND ( | |
| 26 | + YEAR ( `jksyj`.`yjsj` ) = substr( `jsj`.`yf`, 1, 4 ) | |
| 27 | + ) | |
| 28 | + AND ( | |
| 29 | + MONTH ( `jksyj`.`yjsj` ) = substr( `jsj`.`yf`, 5, 2 ) | |
| 30 | + ) | |
| 31 | + ) | |
| 32 | + ) | |
| 33 | + ) | |
| 34 | + LEFT JOIN `lq_mdxx` `md` ON ( ( `jsj`.`md` = `md`.`F_Id` ) ) | |
| 35 | + ) | |
| 36 | +WHERE | |
| 37 | + ( | |
| 38 | + ( `jsj`.`yf` IS NOT NULL ) | |
| 39 | + AND ( `jksyj`.`yjsj` IS NOT NULL ) | |
| 40 | + AND ( `jksyj`.`jksyj` IS NOT NULL ) | |
| 41 | + AND ( `jksyj`.`jksyj` <> '' ) | |
| 42 | + AND ( `jksyj`.`jksyj` <> '0' ) | |
| 43 | + ) | |
| 44 | +GROUP BY | |
| 45 | + `jsj`.`F_Id`, | |
| 46 | + `jsj`.`jsj`, | |
| 47 | + `jsj`.`yf`, | |
| 48 | + `jsj`.`md`, | |
| 49 | + `md`.`dm` | |
| 50 | +ORDER BY | |
| 51 | + `jsj`.`yf` DESC, | |
| 52 | + `total_performance` DESC; | |
| 53 | + | |
| 54 | +-- 视图说明: | |
| 55 | +-- jsj_id: 金三角ID | |
| 56 | +-- jsj_name: 金三角名称 | |
| 57 | +-- month: 月份(格式:yyyyMM) | |
| 58 | +-- store_id: 门店ID | |
| 59 | +-- store_name: 门店名称 | |
| 60 | +-- order_count: 订单数量(去重) | |
| 61 | +-- total_performance: 总业绩(转换为DECIMAL类型) | |
| 62 | +-- last_order_date: 最后订单日期 | |
| 63 | +-- first_order_date: 首次订单日期 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEvent/EventTypeEnumOutput.cs
0 → 100644
| 1 | +using System.ComponentModel; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqEvent | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 拓客类型枚举输出 | |
| 7 | + /// </summary> | |
| 8 | + public class EventTypeEnumOutput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 枚举值 | |
| 12 | + /// </summary> | |
| 13 | + public int Value { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 枚举名称 | |
| 17 | + /// </summary> | |
| 18 | + public string Name { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 中文描述 | |
| 22 | + /// </summary> | |
| 23 | + public string Description { get; set; } | |
| 24 | + } | |
| 25 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEvent/LqEventCrInput.cs
| ... | ... | @@ -69,6 +69,15 @@ namespace NCC.Extend.Entitys.Dto.LqEvent |
| 69 | 69 | public string EventNumber { get; set; } |
| 70 | 70 | |
| 71 | 71 | /// <summary> |
| 72 | + /// 活动类型 | |
| 73 | + /// </summary> | |
| 74 | + /// <remarks> | |
| 75 | + /// 活动类型,可选字段 | |
| 76 | + /// 最大长度:255个字符 | |
| 77 | + /// </remarks> | |
| 78 | + public int EventType { get; set; } | |
| 79 | + | |
| 80 | + /// <summary> | |
| 72 | 81 | /// 拓客活动成员列表 |
| 73 | 82 | /// </summary> |
| 74 | 83 | /// <remarks> | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEvent/LqEventInfoOutput.cs
| ... | ... | @@ -40,6 +40,11 @@ namespace NCC.Extend.Entitys.Dto.LqEvent |
| 40 | 40 | public string eventNumber { get; set; } |
| 41 | 41 | |
| 42 | 42 | /// <summary> |
| 43 | + /// 活动类型 | |
| 44 | + /// </summary> | |
| 45 | + public int eventType { get; set; } | |
| 46 | + | |
| 47 | + /// <summary> | |
| 43 | 48 | /// 拓客活动成员列表 |
| 44 | 49 | /// </summary> |
| 45 | 50 | public List<LqEventUserInfoOutput> Members { get; set; } = new List<LqEventUserInfoOutput>(); | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEvent/LqEventListOutput.cs
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEvent/LqEventUserEventOutput.cs
| ... | ... | @@ -66,5 +66,15 @@ namespace NCC.Extend.Entitys.Dto.LqEvent |
| 66 | 66 | /// 创建用户 |
| 67 | 67 | /// </summary> |
| 68 | 68 | public string CreationUser { get; set; } |
| 69 | + | |
| 70 | + /// <summary> | |
| 71 | + /// 门店ID | |
| 72 | + /// </summary> | |
| 73 | + public string StoreId { get; set; } | |
| 74 | + | |
| 75 | + /// <summary> | |
| 76 | + /// 门店名称 | |
| 77 | + /// </summary> | |
| 78 | + public string StoreName { get; set; } | |
| 69 | 79 | } |
| 70 | 80 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqEventUser/LqEventUserInfoOutput.cs
| ... | ... | @@ -41,5 +41,15 @@ namespace NCC.Extend.Entitys.Dto.LqEventUser |
| 41 | 41 | /// 创建用户 |
| 42 | 42 | /// </summary> |
| 43 | 43 | public string creationUser { get; set; } |
| 44 | + | |
| 45 | + /// <summary> | |
| 46 | + /// 目标数量 | |
| 47 | + /// </summary> | |
| 48 | + public int targetCount { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 门店ID | |
| 52 | + /// </summary> | |
| 53 | + public string storeId { get; set; } | |
| 44 | 54 | } |
| 45 | 55 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKdPxmx/LqKdPxmxInfoOutput.cs
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqTkjlb/LqTkjlbInfoOutput.cs
| ... | ... | @@ -12,56 +12,65 @@ namespace NCC.Extend.Entitys.Dto.LqTkjlb |
| 12 | 12 | /// 拓客编号 |
| 13 | 13 | /// </summary> |
| 14 | 14 | public string id { get; set; } |
| 15 | - | |
| 15 | + | |
| 16 | 16 | /// <summary> |
| 17 | 17 | /// 拓客时间 |
| 18 | 18 | /// </summary> |
| 19 | 19 | public DateTime? tksj { get; set; } |
| 20 | - | |
| 20 | + | |
| 21 | 21 | /// <summary> |
| 22 | 22 | /// 拓客人员 |
| 23 | 23 | /// </summary> |
| 24 | 24 | public string tkry { get; set; } |
| 25 | - | |
| 25 | + | |
| 26 | 26 | /// <summary> |
| 27 | 27 | /// 顾客姓名 |
| 28 | 28 | /// </summary> |
| 29 | 29 | public string gkxm { get; set; } |
| 30 | - | |
| 30 | + | |
| 31 | 31 | /// <summary> |
| 32 | 32 | /// 电话号码 |
| 33 | 33 | /// </summary> |
| 34 | 34 | public string dhhm { get; set; } |
| 35 | - | |
| 35 | + | |
| 36 | 36 | /// <summary> |
| 37 | 37 | /// 购买张数 |
| 38 | 38 | /// </summary> |
| 39 | 39 | public int? gmzs { get; set; } |
| 40 | - | |
| 40 | + | |
| 41 | 41 | /// <summary> |
| 42 | 42 | /// 支付方式 |
| 43 | 43 | /// </summary> |
| 44 | 44 | public string zffs { get; set; } |
| 45 | - | |
| 45 | + | |
| 46 | 46 | /// <summary> |
| 47 | 47 | /// 是否加微信 |
| 48 | 48 | /// </summary> |
| 49 | 49 | public string sfjwx { get; set; } |
| 50 | - | |
| 50 | + | |
| 51 | 51 | /// <summary> |
| 52 | 52 | /// 备注 |
| 53 | 53 | /// </summary> |
| 54 | 54 | public string bz { get; set; } |
| 55 | - | |
| 55 | + | |
| 56 | 56 | /// <summary> |
| 57 | 57 | /// 所属门店 |
| 58 | 58 | /// </summary> |
| 59 | 59 | public string ssmd { get; set; } |
| 60 | - | |
| 60 | + | |
| 61 | 61 | /// <summary> |
| 62 | 62 | /// 所属战队 |
| 63 | 63 | /// </summary> |
| 64 | 64 | public string sszd { get; set; } |
| 65 | - | |
| 65 | + | |
| 66 | + /// <summary> | |
| 67 | + /// 拓客活动id | |
| 68 | + /// </summary> | |
| 69 | + public string eventId { get; set; } | |
| 70 | + | |
| 71 | + /// <summary> | |
| 72 | + /// 拓客活动名称 | |
| 73 | + /// </summary> | |
| 74 | + public string eventName { get; set; } | |
| 66 | 75 | } |
| 67 | 76 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqTkjlb/LqTkjlbListOutput.cs
| ... | ... | @@ -11,56 +11,65 @@ namespace NCC.Extend.Entitys.Dto.LqTkjlb |
| 11 | 11 | /// 拓客编号 |
| 12 | 12 | /// </summary> |
| 13 | 13 | public string id { get; set; } |
| 14 | - | |
| 14 | + | |
| 15 | 15 | /// <summary> |
| 16 | 16 | /// 拓客时间 |
| 17 | 17 | /// </summary> |
| 18 | 18 | public DateTime? tksj { get; set; } |
| 19 | - | |
| 19 | + | |
| 20 | 20 | /// <summary> |
| 21 | 21 | /// 拓客人员 |
| 22 | 22 | /// </summary> |
| 23 | 23 | public string tkry { get; set; } |
| 24 | - | |
| 24 | + | |
| 25 | 25 | /// <summary> |
| 26 | 26 | /// 顾客姓名 |
| 27 | 27 | /// </summary> |
| 28 | 28 | public string gkxm { get; set; } |
| 29 | - | |
| 29 | + | |
| 30 | 30 | /// <summary> |
| 31 | 31 | /// 电话号码 |
| 32 | 32 | /// </summary> |
| 33 | 33 | public string dhhm { get; set; } |
| 34 | - | |
| 34 | + | |
| 35 | 35 | /// <summary> |
| 36 | 36 | /// 购买张数 |
| 37 | 37 | /// </summary> |
| 38 | 38 | public int? gmzs { get; set; } |
| 39 | - | |
| 39 | + | |
| 40 | 40 | /// <summary> |
| 41 | 41 | /// 支付方式 |
| 42 | 42 | /// </summary> |
| 43 | 43 | public string zffs { get; set; } |
| 44 | - | |
| 44 | + | |
| 45 | 45 | /// <summary> |
| 46 | 46 | /// 是否加微信 |
| 47 | 47 | /// </summary> |
| 48 | 48 | public string sfjwx { get; set; } |
| 49 | - | |
| 49 | + | |
| 50 | 50 | /// <summary> |
| 51 | 51 | /// 备注 |
| 52 | 52 | /// </summary> |
| 53 | 53 | public string bz { get; set; } |
| 54 | - | |
| 54 | + | |
| 55 | 55 | /// <summary> |
| 56 | 56 | /// 所属门店 |
| 57 | 57 | /// </summary> |
| 58 | 58 | public string ssmd { get; set; } |
| 59 | - | |
| 59 | + | |
| 60 | 60 | /// <summary> |
| 61 | 61 | /// 所属战队 |
| 62 | 62 | /// </summary> |
| 63 | 63 | public string sszd { get; set; } |
| 64 | - | |
| 64 | + | |
| 65 | + /// <summary> | |
| 66 | + /// 拓客活动id | |
| 67 | + /// </summary> | |
| 68 | + public string eventId { get; set; } | |
| 69 | + | |
| 70 | + /// <summary> | |
| 71 | + /// 拓客活动名称 | |
| 72 | + /// </summary> | |
| 73 | + public string eventName { get; set; } | |
| 65 | 74 | } |
| 66 | 75 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqYcsdJsj/LqYcsdJsjByUserMonthInput.cs
0 → 100644
| 1 | +using System; | |
| 2 | +using System.ComponentModel.DataAnnotations; | |
| 3 | + | |
| 4 | +namespace NCC.Extend.Entitys.Dto.LqYcsdJsj | |
| 5 | +{ | |
| 6 | + /// <summary> | |
| 7 | + /// 根据用户和月份获取金三角信息输入参数 | |
| 8 | + /// </summary> | |
| 9 | + public class LqYcsdJsjByUserMonthInput | |
| 10 | + { | |
| 11 | + /// <summary> | |
| 12 | + /// 用户ID | |
| 13 | + /// </summary> | |
| 14 | + [Required(ErrorMessage = "用户ID不能为空")] | |
| 15 | + public string UserId { get; set; } | |
| 16 | + | |
| 17 | + /// <summary> | |
| 18 | + /// 时间(格式:yyyy-MM-dd HH:mm:ss) | |
| 19 | + /// </summary> | |
| 20 | + [Required(ErrorMessage = "时间不能为空")] | |
| 21 | + public DateTime DateTime { get; set; } | |
| 22 | + } | |
| 23 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqYcsdJsj/LqYcsdJsjByUserMonthOutput.cs
0 → 100644
| 1 | +namespace NCC.Extend.Entitys.Dto.LqYcsdJsj | |
| 2 | +{ | |
| 3 | + /// <summary> | |
| 4 | + /// 根据用户和月份获取金三角信息输出参数 | |
| 5 | + /// </summary> | |
| 6 | + public class LqYcsdJsjByUserMonthOutput | |
| 7 | + { | |
| 8 | + /// <summary> | |
| 9 | + /// 金三角ID | |
| 10 | + /// </summary> | |
| 11 | + public string JsjId { get; set; } | |
| 12 | + | |
| 13 | + /// <summary> | |
| 14 | + /// 金三角名称 | |
| 15 | + /// </summary> | |
| 16 | + public string JsjName { get; set; } | |
| 17 | + | |
| 18 | + /// <summary> | |
| 19 | + /// 月份 | |
| 20 | + /// </summary> | |
| 21 | + public string Month { get; set; } | |
| 22 | + | |
| 23 | + /// <summary> | |
| 24 | + /// 门店ID | |
| 25 | + /// </summary> | |
| 26 | + public string StoreId { get; set; } | |
| 27 | + | |
| 28 | + /// <summary> | |
| 29 | + /// 门店名称 | |
| 30 | + /// </summary> | |
| 31 | + public string StoreName { get; set; } | |
| 32 | + | |
| 33 | + /// <summary> | |
| 34 | + /// 用户ID | |
| 35 | + /// </summary> | |
| 36 | + public string UserId { get; set; } | |
| 37 | + | |
| 38 | + /// <summary> | |
| 39 | + /// 用户姓名 | |
| 40 | + /// </summary> | |
| 41 | + public string UserName { get; set; } | |
| 42 | + | |
| 43 | + /// <summary> | |
| 44 | + /// 是否顾问 | |
| 45 | + /// </summary> | |
| 46 | + public int IsLeader { get; set; } | |
| 47 | + | |
| 48 | + /// <summary> | |
| 49 | + /// 状态 | |
| 50 | + /// </summary> | |
| 51 | + public string Status { get; set; } | |
| 52 | + | |
| 53 | + /// <summary> | |
| 54 | + /// 排序 | |
| 55 | + /// </summary> | |
| 56 | + public int SortOrder { get; set; } | |
| 57 | + } | |
| 58 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqYcsdJsj/LqYcsdJsjPerformanceInput.cs
0 → 100644
| 1 | +using System.ComponentModel.DataAnnotations; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqYcsdJsj | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 金三角业绩统计查询输入参数 | |
| 7 | + /// </summary> | |
| 8 | + public class LqYcsdJsjPerformanceInput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 开始月份(格式:yyyyMM) | |
| 12 | + /// </summary> | |
| 13 | + public string StartMonth { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 结束月份(格式:yyyyMM) | |
| 17 | + /// </summary> | |
| 18 | + public string EndMonth { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 金三角ID(可选,用于查询特定金三角) | |
| 22 | + /// </summary> | |
| 23 | + public string JsjId { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 26 | + /// 门店ID(可选,用于查询特定门店) | |
| 27 | + /// </summary> | |
| 28 | + public string StoreId { get; set; } | |
| 29 | + } | |
| 30 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqYcsdJsj/LqYcsdJsjPerformanceOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqYcsdJsj | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 金三角业绩统计输出参数 | |
| 7 | + /// </summary> | |
| 8 | + public class LqYcsdJsjPerformanceOutput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 金三角ID | |
| 12 | + /// </summary> | |
| 13 | + public string JsjId { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 金三角名称 | |
| 17 | + /// </summary> | |
| 18 | + public string JsjName { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 月份 | |
| 22 | + /// </summary> | |
| 23 | + public string Month { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 26 | + /// 门店ID | |
| 27 | + /// </summary> | |
| 28 | + public string StoreId { get; set; } | |
| 29 | + | |
| 30 | + /// <summary> | |
| 31 | + /// 门店名称 | |
| 32 | + /// </summary> | |
| 33 | + public string StoreName { get; set; } | |
| 34 | + | |
| 35 | + /// <summary> | |
| 36 | + /// 订单数量 | |
| 37 | + /// </summary> | |
| 38 | + public int OrderCount { get; set; } | |
| 39 | + | |
| 40 | + /// <summary> | |
| 41 | + /// 总业绩 | |
| 42 | + /// </summary> | |
| 43 | + public decimal TotalPerformance { get; set; } | |
| 44 | + | |
| 45 | + /// <summary> | |
| 46 | + /// 最后订单日期 | |
| 47 | + /// </summary> | |
| 48 | + public DateTime? LastOrderDate { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 首次订单日期 | |
| 52 | + /// </summary> | |
| 53 | + public DateTime? FirstOrderDate { get; set; } | |
| 54 | + | |
| 55 | + /// <summary> | |
| 56 | + /// 统计类型(ACTIVE-活跃金三角业绩,INACTIVE-单人业绩) | |
| 57 | + /// </summary> | |
| 58 | + public string StatisticsType { get; set; } | |
| 59 | + | |
| 60 | + /// <summary> | |
| 61 | + /// 成员姓名(仅单人业绩时使用) | |
| 62 | + /// </summary> | |
| 63 | + public string MemberName { get; set; } | |
| 64 | + } | |
| 65 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_event/LqEventEntity.cs
| ... | ... | @@ -44,5 +44,11 @@ namespace NCC.Extend.Entitys.lq_event |
| 44 | 44 | /// </summary> |
| 45 | 45 | [SugarColumn(ColumnName = "F_EventNumber")] |
| 46 | 46 | public string EventNumber { get; set; } |
| 47 | + | |
| 48 | + /// <summary> | |
| 49 | + /// 活动类型 | |
| 50 | + /// </summary> | |
| 51 | + [SugarColumn(ColumnName = "F_EventType")] | |
| 52 | + public int EventType { get; set; } | |
| 47 | 53 | } |
| 48 | 54 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_kd_jksyj/LqKdJksyjEntity.cs
| 1 | -using NCC.Common.Const; | |
| 1 | +using System; | |
| 2 | +using NCC.Common.Const; | |
| 2 | 3 | using SqlSugar; |
| 3 | -using System; | |
| 4 | 4 | |
| 5 | 5 | namespace NCC.Extend.Entitys.lq_kd_jksyj |
| 6 | 6 | { |
| ... | ... | @@ -16,55 +16,53 @@ namespace NCC.Extend.Entitys.lq_kd_jksyj |
| 16 | 16 | /// </summary> |
| 17 | 17 | [SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)] |
| 18 | 18 | public string Id { get; set; } |
| 19 | - | |
| 19 | + | |
| 20 | 20 | /// <summary> |
| 21 | 21 | /// 关联开单编号 |
| 22 | 22 | /// </summary> |
| 23 | - [SugarColumn(ColumnName = "glkdbh")] | |
| 23 | + [SugarColumn(ColumnName = "glkdbh")] | |
| 24 | 24 | public string Glkdbh { get; set; } |
| 25 | - | |
| 25 | + | |
| 26 | 26 | /// <summary> |
| 27 | 27 | /// 健康师 |
| 28 | 28 | /// </summary> |
| 29 | - [SugarColumn(ColumnName = "jks")] | |
| 29 | + [SugarColumn(ColumnName = "jks")] | |
| 30 | 30 | public string Jks { get; set; } |
| 31 | - | |
| 31 | + | |
| 32 | 32 | /// <summary> |
| 33 | 33 | /// 健康师姓名 |
| 34 | 34 | /// </summary> |
| 35 | - [SugarColumn(ColumnName = "jksxm")] | |
| 35 | + [SugarColumn(ColumnName = "jksxm")] | |
| 36 | 36 | public string Jksxm { get; set; } |
| 37 | - | |
| 37 | + | |
| 38 | 38 | /// <summary> |
| 39 | 39 | /// 健康师账号 |
| 40 | 40 | /// </summary> |
| 41 | - [SugarColumn(ColumnName = "jkszh")] | |
| 41 | + [SugarColumn(ColumnName = "jkszh")] | |
| 42 | 42 | public string Jkszh { get; set; } |
| 43 | - | |
| 43 | + | |
| 44 | 44 | /// <summary> |
| 45 | 45 | /// 健康师业绩 |
| 46 | 46 | /// </summary> |
| 47 | - [SugarColumn(ColumnName = "jksyj")] | |
| 47 | + [SugarColumn(ColumnName = "jksyj")] | |
| 48 | 48 | public string Jksyj { get; set; } |
| 49 | - | |
| 49 | + | |
| 50 | 50 | /// <summary> |
| 51 | 51 | /// 业绩时间 |
| 52 | 52 | /// </summary> |
| 53 | - [SugarColumn(ColumnName = "yjsj")] | |
| 53 | + [SugarColumn(ColumnName = "yjsj")] | |
| 54 | 54 | public DateTime? Yjsj { get; set; } |
| 55 | 55 | |
| 56 | 56 | /// <summary> |
| 57 | 57 | /// 金三角id |
| 58 | 58 | /// </summary> |
| 59 | - [SugarColumn(ColumnName = "jsj_id")] | |
| 59 | + [SugarColumn(ColumnName = "jsj_id")] | |
| 60 | 60 | public string Jsj_id { get; set; } |
| 61 | 61 | |
| 62 | - | |
| 63 | 62 | /// <summary> |
| 64 | 63 | /// 开单品相id |
| 65 | 64 | /// </summary> |
| 66 | - [SugarColumn(ColumnName = "F_kdpxid")] | |
| 65 | + [SugarColumn(ColumnName = "F_kdpxid")] | |
| 67 | 66 | public string Kdpxid { get; set; } |
| 68 | - | |
| 69 | 67 | } |
| 70 | -} | |
| 71 | 68 | \ No newline at end of file |
| 69 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_kd_kdjlb/LqKdKdjlbEntity.cs
| ... | ... | @@ -184,5 +184,17 @@ namespace NCC.Extend.Entitys.lq_kd_kdjlb |
| 184 | 184 | /// </summary> |
| 185 | 185 | [SugarColumn(ColumnName = "F_FIleUrl")] |
| 186 | 186 | public string F_FIleUrl { get; set; } |
| 187 | + | |
| 188 | + /// <summary> | |
| 189 | + /// 创建时间 | |
| 190 | + /// </summary> | |
| 191 | + [SugarColumn(ColumnName = "F_CreateTime")] | |
| 192 | + public DateTime CreateTime { get; set; } | |
| 193 | + | |
| 194 | + /// <summary> | |
| 195 | + /// 修改时间 | |
| 196 | + /// </summary> | |
| 197 | + [SugarColumn(ColumnName = "F_UpdateTime")] | |
| 198 | + public DateTime UpdateTime { get; set; } | |
| 187 | 199 | } |
| 188 | 200 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Entity/lq_xh_hyhk/LqXhHyhkEntity.cs
| 1 | -using NCC.Common.Const; | |
| 1 | +using System; | |
| 2 | +using NCC.Common.Const; | |
| 2 | 3 | using SqlSugar; |
| 3 | -using System; | |
| 4 | 4 | |
| 5 | 5 | namespace NCC.Extend.Entitys.lq_xh_hyhk |
| 6 | 6 | { |
| ... | ... | @@ -16,96 +16,107 @@ namespace NCC.Extend.Entitys.lq_xh_hyhk |
| 16 | 16 | /// </summary> |
| 17 | 17 | [SugarColumn(ColumnName = "F_Id", IsPrimaryKey = true)] |
| 18 | 18 | public string Id { get; set; } |
| 19 | - | |
| 19 | + | |
| 20 | 20 | /// <summary> |
| 21 | 21 | /// 门店 |
| 22 | 22 | /// </summary> |
| 23 | - [SugarColumn(ColumnName = "md")] | |
| 23 | + [SugarColumn(ColumnName = "md")] | |
| 24 | 24 | public string Md { get; set; } |
| 25 | - | |
| 25 | + | |
| 26 | 26 | /// <summary> |
| 27 | 27 | /// 门店编号 |
| 28 | 28 | /// </summary> |
| 29 | - [SugarColumn(ColumnName = "mdbh")] | |
| 29 | + [SugarColumn(ColumnName = "mdbh")] | |
| 30 | 30 | public string Mdbh { get; set; } |
| 31 | - | |
| 31 | + | |
| 32 | 32 | /// <summary> |
| 33 | 33 | /// 门店名称 |
| 34 | 34 | /// </summary> |
| 35 | - [SugarColumn(ColumnName = "mdmc")] | |
| 35 | + [SugarColumn(ColumnName = "mdmc")] | |
| 36 | 36 | public string Mdmc { get; set; } |
| 37 | - | |
| 37 | + | |
| 38 | 38 | /// <summary> |
| 39 | 39 | /// 会员 |
| 40 | 40 | /// </summary> |
| 41 | - [SugarColumn(ColumnName = "hy")] | |
| 41 | + [SugarColumn(ColumnName = "hy")] | |
| 42 | 42 | public string Hy { get; set; } |
| 43 | - | |
| 43 | + | |
| 44 | 44 | /// <summary> |
| 45 | 45 | /// 会员账号 |
| 46 | 46 | /// </summary> |
| 47 | - [SugarColumn(ColumnName = "hyzh")] | |
| 47 | + [SugarColumn(ColumnName = "hyzh")] | |
| 48 | 48 | public string Hyzh { get; set; } |
| 49 | - | |
| 49 | + | |
| 50 | 50 | /// <summary> |
| 51 | 51 | /// 会员名称 |
| 52 | 52 | /// </summary> |
| 53 | - [SugarColumn(ColumnName = "hymc")] | |
| 53 | + [SugarColumn(ColumnName = "hymc")] | |
| 54 | 54 | public string Hymc { get; set; } |
| 55 | - | |
| 55 | + | |
| 56 | 56 | /// <summary> |
| 57 | 57 | /// 顾客类型 |
| 58 | 58 | /// </summary> |
| 59 | - [SugarColumn(ColumnName = "gklx")] | |
| 59 | + [SugarColumn(ColumnName = "gklx")] | |
| 60 | 60 | public string Gklx { get; set; } |
| 61 | - | |
| 61 | + | |
| 62 | 62 | /// <summary> |
| 63 | 63 | /// 消费金额 |
| 64 | 64 | /// </summary> |
| 65 | - [SugarColumn(ColumnName = "xfje")] | |
| 65 | + [SugarColumn(ColumnName = "xfje")] | |
| 66 | 66 | public string Xfje { get; set; } |
| 67 | - | |
| 67 | + | |
| 68 | 68 | /// <summary> |
| 69 | 69 | /// 手工费用 |
| 70 | 70 | /// </summary> |
| 71 | - [SugarColumn(ColumnName = "sgfy")] | |
| 71 | + [SugarColumn(ColumnName = "sgfy")] | |
| 72 | 72 | public string Sgfy { get; set; } |
| 73 | - | |
| 73 | + | |
| 74 | 74 | /// <summary> |
| 75 | 75 | /// 是否有科技部 |
| 76 | 76 | /// </summary> |
| 77 | - [SugarColumn(ColumnName = "sfykjb")] | |
| 77 | + [SugarColumn(ColumnName = "sfykjb")] | |
| 78 | 78 | public string Sfykjb { get; set; } |
| 79 | - | |
| 79 | + | |
| 80 | 80 | /// <summary> |
| 81 | 81 | /// 健康师业绩 |
| 82 | 82 | /// </summary> |
| 83 | - [SugarColumn(ColumnName = "jksyj")] | |
| 83 | + [SugarColumn(ColumnName = "jksyj")] | |
| 84 | 84 | public string Jksyj { get; set; } |
| 85 | - | |
| 85 | + | |
| 86 | 86 | /// <summary> |
| 87 | 87 | /// 科技部业绩 |
| 88 | 88 | /// </summary> |
| 89 | - [SugarColumn(ColumnName = "kjbyj")] | |
| 89 | + [SugarColumn(ColumnName = "kjbyj")] | |
| 90 | 90 | public string Kjbyj { get; set; } |
| 91 | - | |
| 91 | + | |
| 92 | 92 | /// <summary> |
| 93 | 93 | /// 品项信息 |
| 94 | 94 | /// </summary> |
| 95 | - [SugarColumn(ColumnName = "pxxx")] | |
| 95 | + [SugarColumn(ColumnName = "pxxx")] | |
| 96 | 96 | public string Pxxx { get; set; } |
| 97 | - | |
| 97 | + | |
| 98 | 98 | /// <summary> |
| 99 | 99 | /// 耗卡时间 |
| 100 | 100 | /// </summary> |
| 101 | - [SugarColumn(ColumnName = "hksj")] | |
| 101 | + [SugarColumn(ColumnName = "hksj")] | |
| 102 | 102 | public DateTime? Hksj { get; set; } |
| 103 | - | |
| 103 | + | |
| 104 | 104 | /// <summary> |
| 105 | 105 | /// 操作人员 |
| 106 | 106 | /// </summary> |
| 107 | - [SugarColumn(ColumnName = "czry")] | |
| 107 | + [SugarColumn(ColumnName = "czry")] | |
| 108 | 108 | public string Czry { get; set; } |
| 109 | - | |
| 109 | + | |
| 110 | + /// <summary> | |
| 111 | + /// 创建时间 | |
| 112 | + /// </summary> | |
| 113 | + [SugarColumn(ColumnName = "F_CreateTime")] | |
| 114 | + public DateTime CreateTime { get; set; } | |
| 115 | + | |
| 116 | + /// <summary> | |
| 117 | + /// 修改时间 | |
| 118 | + /// </summary> | |
| 119 | + [SugarColumn(ColumnName = "F_UpdateTime")] | |
| 120 | + public DateTime UpdateTime { get; set; } | |
| 110 | 121 | } |
| 111 | -} | |
| 112 | 122 | \ No newline at end of file |
| 123 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Enum/EventType.cs
0 → 100644
| 1 | +using System.ComponentModel; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Enum | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 活动类型 | |
| 7 | + /// </summary> | |
| 8 | + public enum EventType | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 日常拓客 | |
| 12 | + /// </summary> | |
| 13 | + [Description("日常拓客")] | |
| 14 | + 日常拓客 = 1, | |
| 15 | + | |
| 16 | + /// <summary> | |
| 17 | + /// 全员拓客 | |
| 18 | + /// </summary> | |
| 19 | + [Description("全员拓客")] | |
| 20 | + 全员拓客 = 3, | |
| 21 | + } | |
| 22 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/NCC.Extend.Entitys.csproj
| 1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
| 2 | - | |
| 3 | 2 | <PropertyGroup> |
| 4 | 3 | <TargetFramework>net6.0</TargetFramework> |
| 5 | 4 | </PropertyGroup> |
| 6 | - | |
| 7 | 5 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
| 8 | 6 | <OutputPath /> |
| 9 | 7 | <DocumentationFile>bin\Release\NCC.Extend.Entitys.xml</DocumentationFile> |
| 10 | 8 | </PropertyGroup> |
| 11 | - | |
| 12 | - <ItemGroup> | |
| 13 | - <Compile Remove="Enum\**" /> | |
| 14 | - <EmbeddedResource Remove="Enum\**" /> | |
| 15 | - <None Remove="Enum\**" /> | |
| 16 | - </ItemGroup> | |
| 17 | - | |
| 18 | 9 | <ItemGroup> |
| 19 | 10 | <ProjectReference Include="..\..\..\Infrastructure\NCC.Expand.Thirdparty\NCC.Expand.Thirdparty.csproj" /> |
| 20 | 11 | <ProjectReference Include="..\..\Common\NCC.Common\NCC.Common.csproj" /> |
| 21 | 12 | </ItemGroup> |
| 22 | - | |
| 23 | 13 | </Project> | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqEventService.cs
| 1 | 1 | using System; |
| 2 | 2 | using System.Collections.Generic; |
| 3 | +using System.ComponentModel; | |
| 3 | 4 | using System.IO; |
| 4 | 5 | using System.Linq; |
| 6 | +using System.Reflection; | |
| 5 | 7 | using System.Threading.Tasks; |
| 6 | 8 | using Mapster; |
| 7 | 9 | using Microsoft.AspNetCore.Http; |
| ... | ... | @@ -13,6 +15,7 @@ using NCC.Dependency; |
| 13 | 15 | using NCC.DynamicApiController; |
| 14 | 16 | using NCC.Extend.Entitys.Dto.LqEvent; |
| 15 | 17 | using NCC.Extend.Entitys.Dto.LqEventUser; |
| 18 | +using NCC.Extend.Entitys.Enum; | |
| 16 | 19 | using NCC.Extend.Entitys.lq_event; |
| 17 | 20 | using NCC.Extend.Entitys.lq_eventuser; |
| 18 | 21 | using NCC.Extend.Entitys.lq_mdxx; |
| ... | ... | @@ -92,6 +95,7 @@ namespace NCC.Extend.LqEvent |
| 92 | 95 | eventCoordinator = e.EventCoordinator, |
| 93 | 96 | eventNumber = e.EventNumber, |
| 94 | 97 | memberCount = SqlFunc.Subqueryable<LqEventUserEntity>().Where(u => u.EventId == e.Id).Count(), |
| 98 | + eventType = e.EventType, | |
| 95 | 99 | }) |
| 96 | 100 | .MergeTable() |
| 97 | 101 | .OrderBy(sidx + " " + sord) |
| ... | ... | @@ -203,6 +207,10 @@ namespace NCC.Extend.LqEvent |
| 203 | 207 | // 生成新的ID |
| 204 | 208 | entity.Id = YitIdHelper.NextId().ToString(); |
| 205 | 209 | |
| 210 | + // 手动设置时间字段,确保时分秒不丢失 | |
| 211 | + entity.StartTime = input.StartTime; | |
| 212 | + entity.EndTime = input.EndTime; | |
| 213 | + | |
| 206 | 214 | // 插入拓客活动 |
| 207 | 215 | var isOk = await _db.Insertable(entity).ExecuteCommandAsync(); |
| 208 | 216 | if (!(isOk > 0)) |
| ... | ... | @@ -288,6 +296,10 @@ namespace NCC.Extend.LqEvent |
| 288 | 296 | var userInfo = await _userManager.GetUserInfo(); |
| 289 | 297 | var entity = input.Adapt<LqEventEntity>(); |
| 290 | 298 | |
| 299 | + // 手动设置时间字段,确保时分秒不丢失 | |
| 300 | + entity.StartTime = input.StartTime; | |
| 301 | + entity.EndTime = input.EndTime; | |
| 302 | + | |
| 291 | 303 | // 更新拓客活动 |
| 292 | 304 | var isOk = await _db.Updateable(entity).ExecuteCommandAsync(); |
| 293 | 305 | if (!(isOk > 0)) |
| ... | ... | @@ -352,7 +364,7 @@ namespace NCC.Extend.LqEvent |
| 352 | 364 | public async Task Delete(string id) |
| 353 | 365 | { |
| 354 | 366 | // 删除拓客活动成员 |
| 355 | - await _db.Deleteable<LqEventUserEntity>().Where(u => u.EventId == id.ToString()).ExecuteCommandAsync(); | |
| 367 | + await _db.Deleteable<LqEventUserEntity>().Where(u => u.EventId == id).ExecuteCommandAsync(); | |
| 356 | 368 | |
| 357 | 369 | // 删除拓客活动 |
| 358 | 370 | var isOk = await _db.Deleteable<LqEventEntity>().Where(p => p.Id == id).ExecuteCommandAsync(); |
| ... | ... | @@ -475,6 +487,7 @@ namespace NCC.Extend.LqEvent |
| 475 | 487 | EventTarget = eventUser.EventTarget, |
| 476 | 488 | CreationTime = eventUser.CreationTime, |
| 477 | 489 | CreationUser = eventUser.CreationUser, |
| 490 | + StoreId = eventUser.StoreId, | |
| 478 | 491 | } |
| 479 | 492 | ); |
| 480 | 493 | } |
| ... | ... | @@ -737,5 +750,40 @@ namespace NCC.Extend.LqEvent |
| 737 | 750 | } |
| 738 | 751 | |
| 739 | 752 | #endregion |
| 753 | + | |
| 754 | + #region 获取拓客类型枚举内容 | |
| 755 | + | |
| 756 | + /// <summary> | |
| 757 | + /// 获取拓客类型枚举内容 | |
| 758 | + /// </summary> | |
| 759 | + /// <returns>拓客类型枚举列表</returns> | |
| 760 | + [HttpGet("event-types")] | |
| 761 | + public List<EventTypeEnumOutput> GetEventTypes() | |
| 762 | + { | |
| 763 | + var result = new List<EventTypeEnumOutput>(); | |
| 764 | + | |
| 765 | + // 获取所有枚举值 | |
| 766 | + var enumValues = Enum.GetValues<EventType>(); | |
| 767 | + | |
| 768 | + foreach (var enumValue in enumValues) | |
| 769 | + { | |
| 770 | + // 获取枚举的Description特性 | |
| 771 | + var field = enumValue.GetType().GetField(enumValue.ToString()); | |
| 772 | + var descriptionAttribute = field?.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute; | |
| 773 | + | |
| 774 | + result.Add( | |
| 775 | + new EventTypeEnumOutput | |
| 776 | + { | |
| 777 | + Value = (int)enumValue, | |
| 778 | + Name = enumValue.ToString(), | |
| 779 | + Description = descriptionAttribute?.Description ?? enumValue.ToString(), | |
| 780 | + } | |
| 781 | + ); | |
| 782 | + } | |
| 783 | + | |
| 784 | + return result; | |
| 785 | + } | |
| 786 | + | |
| 787 | + #endregion | |
| 740 | 788 | } |
| 741 | 789 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqGzService.cs
| 1 | -using NCC.Common.Core.Manager; | |
| 2 | -using NCC.Common.Enum; | |
| 3 | -using NCC.Common.Extension; | |
| 4 | -using NCC.Common.Filter; | |
| 5 | -using NCC.Dependency; | |
| 6 | -using NCC.DynamicApiController; | |
| 7 | -using NCC.FriendlyException; | |
| 8 | -using NCC.Extend.Interfaces.LqGz; | |
| 9 | -using Mapster; | |
| 10 | -using Microsoft.AspNetCore.Mvc; | |
| 11 | -using SqlSugar; | |
| 12 | -using System; | |
| 1 | +using System; | |
| 13 | 2 | using System.Collections.Generic; |
| 14 | 3 | using System.Linq; |
| 15 | 4 | using System.Threading.Tasks; |
| 16 | -using NCC.Extend.Entitys.lq_gz; | |
| 17 | -using Yitter.IdGenerator; | |
| 5 | +using Mapster; | |
| 6 | +using Microsoft.AspNetCore.Mvc; | |
| 7 | +using Microsoft.Extensions.Logging; | |
| 8 | +using NCC.ClayObject; | |
| 9 | +using NCC.Common.Configuration; | |
| 10 | +using NCC.Common.Core.Manager; | |
| 11 | +using NCC.Common.Enum; | |
| 12 | +using NCC.Common.Extension; | |
| 13 | +using NCC.Common.Filter; | |
| 18 | 14 | using NCC.Common.Helper; |
| 19 | -using NCC.JsonSerialization; | |
| 20 | 15 | using NCC.Common.Model.NPOI; |
| 21 | -using NCC.Common.Configuration; | |
| 22 | 16 | using NCC.DataEncryption; |
| 23 | -using NCC.ClayObject; | |
| 24 | -using NCC.Extend.Entitys.lq_kd_pxmx; | |
| 25 | -using NCC.Extend.Entitys.lq_xmzl; | |
| 17 | +using NCC.Dependency; | |
| 18 | +using NCC.DynamicApiController; | |
| 19 | +using NCC.Extend.Entitys.Dto.LqGz; | |
| 20 | +using NCC.Extend.Entitys.lq_gz; | |
| 26 | 21 | using NCC.Extend.Entitys.lq_jlmxb; |
| 27 | -using NCC.Extend.Entitys.lq_ycsd_jsj; | |
| 28 | -using NCC.Extend.Entitys.lq_mdxx; | |
| 29 | -using NCC.Extend.Entitys.lq_kd_kdjlb; | |
| 30 | 22 | using NCC.Extend.Entitys.lq_kd_jksyj; |
| 23 | +using NCC.Extend.Entitys.lq_kd_kdjlb; | |
| 31 | 24 | using NCC.Extend.Entitys.lq_kd_kjbsyj; |
| 32 | -using Microsoft.Extensions.Logging; | |
| 33 | -using NCC.Extend.Entitys.Dto.LqGz; | |
| 25 | +using NCC.Extend.Entitys.lq_kd_pxmx; | |
| 26 | +using NCC.Extend.Entitys.lq_mdxx; | |
| 27 | +using NCC.Extend.Entitys.lq_xmzl; | |
| 28 | +using NCC.Extend.Entitys.lq_ycsd_jsj; | |
| 29 | +using NCC.Extend.Interfaces.LqGz; | |
| 30 | +using NCC.FriendlyException; | |
| 31 | +using NCC.JsonSerialization; | |
| 32 | +using SqlSugar; | |
| 33 | +using Yitter.IdGenerator; | |
| 34 | 34 | |
| 35 | 35 | namespace NCC.Extend.LqGz |
| 36 | 36 | { |
| 37 | 37 | /// <summary> |
| 38 | 38 | /// 工资全字段服务 |
| 39 | 39 | /// </summary> |
| 40 | - [ApiDescriptionSettings(Tag = "绿纤工资全字段服务",Name = "LqGz", Order = 200)] | |
| 40 | + [ApiDescriptionSettings(Tag = "绿纤工资全字段服务", Name = "LqGz", Order = 200)] | |
| 41 | 41 | [Route("api/Extend/[controller]")] |
| 42 | 42 | public class LqGzService : ILqGzService, IDynamicApiController, ITransient |
| 43 | 43 | { |
| ... | ... | @@ -49,12 +49,9 @@ namespace NCC.Extend.LqGz |
| 49 | 49 | /// <summary> |
| 50 | 50 | /// 初始化一个<see cref="LqGzService"/>类型的新实例 |
| 51 | 51 | /// </summary> |
| 52 | - public LqGzService( | |
| 53 | - ISqlSugarRepository<LqGzEntity> lqGzRepository, | |
| 54 | - IUserManager userManager, | |
| 55 | - ILogger<LqGzService> logger) | |
| 52 | + public LqGzService(ISqlSugarRepository<LqGzEntity> lqGzRepository, IUserManager userManager, ILogger<LqGzService> logger) | |
| 56 | 53 | { |
| 57 | - _lqGzRepository = lqGzRepository; | |
| 54 | + _lqGzRepository = lqGzRepository; | |
| 58 | 55 | _db = _lqGzRepository.Context; |
| 59 | 56 | _userManager = userManager; |
| 60 | 57 | _logger = logger; |
| ... | ... | @@ -74,10 +71,10 @@ namespace NCC.Extend.LqGz |
| 74 | 71 | } |
| 75 | 72 | |
| 76 | 73 | /// <summary> |
| 77 | - /// 获取工资全字段列表 | |
| 78 | - /// </summary> | |
| 79 | - /// <param name="input">请求参数</param> | |
| 80 | - /// <returns></returns> | |
| 74 | + /// 获取工资全字段列表 | |
| 75 | + /// </summary> | |
| 76 | + /// <param name="input">请求参数</param> | |
| 77 | + /// <returns></returns> | |
| 81 | 78 | [HttpGet("")] |
| 82 | 79 | public async Task<dynamic> GetList([FromQuery] LqGzListQueryInput input) |
| 83 | 80 | { |
| ... | ... | @@ -182,109 +179,112 @@ namespace NCC.Extend.LqGz |
| 182 | 179 | .WhereIF(!string.IsNullOrEmpty(input.dzjfe), p => p.Dzjfe.Equals(input.dzjfe)) |
| 183 | 180 | .WhereIF(!string.IsNullOrEmpty(input.bfsy), p => p.Bfsy.Equals(input.bfsy)) |
| 184 | 181 | .WhereIF(!string.IsNullOrEmpty(input.dyzfze), p => p.Dyzfze.Equals(input.dyzfze)) |
| 185 | - .Select(it=> new LqGzListOutput | |
| 182 | + .Select(it => new LqGzListOutput | |
| 186 | 183 | { |
| 187 | 184 | id = it.Id, |
| 188 | - md=it.Md, | |
| 189 | - hsgw=it.Hsgw, | |
| 190 | - xm=it.Xm, | |
| 191 | - jsjzd=it.Jsjzd, | |
| 192 | - zyj=it.Zyj, | |
| 193 | - jcyj=it.Jcyj, | |
| 194 | - hzyj=it.Hzyj, | |
| 195 | - jlyj=it.Jlyj, | |
| 196 | - mdzyj=it.Mdzyj, | |
| 197 | - dwyj=it.Dwyj, | |
| 198 | - zb=it.Zb, | |
| 199 | - xkyj=it.Xkyj, | |
| 200 | - xkcjl=it.Xkcjl, | |
| 201 | - xktd=it.Xktd, | |
| 202 | - sdyj=it.Sdyj, | |
| 203 | - sdtd=it.Sdtd, | |
| 204 | - syyj=it.Syyj, | |
| 205 | - cellyj=it.Cellyj, | |
| 206 | - dxmybyj=it.Dxmybyj, | |
| 207 | - dxmebyj=it.Dxmebyj, | |
| 208 | - dyyj=it.Dyyj, | |
| 209 | - wysd=it.Wysd, | |
| 210 | - mdzc=it.Mdzc, | |
| 211 | - cpwl=it.Cpwl, | |
| 212 | - wdcb=it.Wdcb, | |
| 213 | - qthzcb=it.Qthzcb, | |
| 214 | - xmj=it.Xmj, | |
| 215 | - ml=it.Ml, | |
| 216 | - zjltce=it.Zjltce, | |
| 217 | - jltce=it.Jltce, | |
| 218 | - xh=it.Xh, | |
| 219 | - xms=it.Xms, | |
| 220 | - ddrt=it.Ddrt, | |
| 221 | - zdts=it.Zdts, | |
| 222 | - qjts=it.Qjts, | |
| 223 | - td=it.Td, | |
| 224 | - jcyjtc=it.Jcyjtc, | |
| 225 | - hzyjtc=it.Hzyjtc, | |
| 226 | - gwtc=it.Gwtc, | |
| 227 | - mdtqtc=it.Mdtqtc, | |
| 228 | - dztc1=it.Dztc1, | |
| 229 | - dzzrtc=it.Dzzrtc, | |
| 230 | - zrtc=it.Zrtc, | |
| 231 | - dztc2=it.Dztc2, | |
| 232 | - zjltc=it.Zjltc, | |
| 233 | - jltc=it.Jltc, | |
| 234 | - yjtc=it.Yjtc, | |
| 235 | - xhtc=it.Xhtc, | |
| 236 | - kjbzctc=it.Kjbzctc, | |
| 237 | - sytc=it.Sytc, | |
| 238 | - celltc=it.Celltc, | |
| 239 | - dxmbtc=it.Dxmbtc, | |
| 240 | - tchj=it.Tchj, | |
| 241 | - jksdx=it.Jksdx, | |
| 242 | - dzhudx=it.Dzhudx, | |
| 243 | - dzhangdx=it.Dzhangdx, | |
| 244 | - zrdx=it.Zrdx, | |
| 245 | - dzzrdx=it.Dzzrdx, | |
| 246 | - zjldx=it.Zjldx, | |
| 247 | - jldx=it.Jldx, | |
| 248 | - kjblsdx=it.Kjblsdx, | |
| 249 | - dxmbdx=it.Dxmbdx, | |
| 250 | - dxhj=it.Dxhj, | |
| 251 | - sg=it.Sg, | |
| 252 | - rtjl=it.Rtjl, | |
| 253 | - sjgl=it.Sjgl, | |
| 254 | - cb=it.Cb, | |
| 255 | - sx=it.Sx, | |
| 256 | - qq=it.Qq, | |
| 257 | - hsyfgz=it.Hsyfgz, | |
| 258 | - bd=it.Bd, | |
| 259 | - bdqj=it.Bdqj, | |
| 260 | - bddx=it.Bddx, | |
| 261 | - bdbc=it.Bdbc, | |
| 262 | - zzyfgz=it.Zzyfgz, | |
| 263 | - dypxbt=it.Dypxbt, | |
| 264 | - dyjtbt=it.Dyjtbt, | |
| 265 | - sypxbt=it.Sypxbt, | |
| 266 | - syjtbt=it.Syjtbt, | |
| 267 | - bthj=it.Bthj, | |
| 268 | - qk=it.Qk, | |
| 269 | - cd=it.Cd, | |
| 270 | - qj=it.Qj, | |
| 271 | - ksb=it.Ksb, | |
| 272 | - kcjl=it.Kcjl, | |
| 273 | - kzs=it.Kzs, | |
| 274 | - kxxq=it.Kxxq, | |
| 275 | - kgzf=it.Kgzf, | |
| 276 | - kkhj=it.Kkhj, | |
| 277 | - fjj=it.Fjj, | |
| 278 | - tsjyj=it.Tsjyj, | |
| 279 | - tzsyj=it.Tzsyj, | |
| 280 | - sfgz=it.Sfgz, | |
| 281 | - dysfff=it.Dysfff, | |
| 282 | - zfje=it.Zfje, | |
| 283 | - dzjfe=it.Dzjfe, | |
| 284 | - bfsy=it.Bfsy, | |
| 285 | - dyzfze=it.Dyzfze, | |
| 286 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | |
| 287 | - return PageResult<LqGzListOutput>.SqlSugarPageResult(data); | |
| 185 | + md = it.Md, | |
| 186 | + hsgw = it.Hsgw, | |
| 187 | + xm = it.Xm, | |
| 188 | + jsjzd = it.Jsjzd, | |
| 189 | + zyj = it.Zyj, | |
| 190 | + jcyj = it.Jcyj, | |
| 191 | + hzyj = it.Hzyj, | |
| 192 | + jlyj = it.Jlyj, | |
| 193 | + mdzyj = it.Mdzyj, | |
| 194 | + dwyj = it.Dwyj, | |
| 195 | + zb = it.Zb, | |
| 196 | + xkyj = it.Xkyj, | |
| 197 | + xkcjl = it.Xkcjl, | |
| 198 | + xktd = it.Xktd, | |
| 199 | + sdyj = it.Sdyj, | |
| 200 | + sdtd = it.Sdtd, | |
| 201 | + syyj = it.Syyj, | |
| 202 | + cellyj = it.Cellyj, | |
| 203 | + dxmybyj = it.Dxmybyj, | |
| 204 | + dxmebyj = it.Dxmebyj, | |
| 205 | + dyyj = it.Dyyj, | |
| 206 | + wysd = it.Wysd, | |
| 207 | + mdzc = it.Mdzc, | |
| 208 | + cpwl = it.Cpwl, | |
| 209 | + wdcb = it.Wdcb, | |
| 210 | + qthzcb = it.Qthzcb, | |
| 211 | + xmj = it.Xmj, | |
| 212 | + ml = it.Ml, | |
| 213 | + zjltce = it.Zjltce, | |
| 214 | + jltce = it.Jltce, | |
| 215 | + xh = it.Xh, | |
| 216 | + xms = it.Xms, | |
| 217 | + ddrt = it.Ddrt, | |
| 218 | + zdts = it.Zdts, | |
| 219 | + qjts = it.Qjts, | |
| 220 | + td = it.Td, | |
| 221 | + jcyjtc = it.Jcyjtc, | |
| 222 | + hzyjtc = it.Hzyjtc, | |
| 223 | + gwtc = it.Gwtc, | |
| 224 | + mdtqtc = it.Mdtqtc, | |
| 225 | + dztc1 = it.Dztc1, | |
| 226 | + dzzrtc = it.Dzzrtc, | |
| 227 | + zrtc = it.Zrtc, | |
| 228 | + dztc2 = it.Dztc2, | |
| 229 | + zjltc = it.Zjltc, | |
| 230 | + jltc = it.Jltc, | |
| 231 | + yjtc = it.Yjtc, | |
| 232 | + xhtc = it.Xhtc, | |
| 233 | + kjbzctc = it.Kjbzctc, | |
| 234 | + sytc = it.Sytc, | |
| 235 | + celltc = it.Celltc, | |
| 236 | + dxmbtc = it.Dxmbtc, | |
| 237 | + tchj = it.Tchj, | |
| 238 | + jksdx = it.Jksdx, | |
| 239 | + dzhudx = it.Dzhudx, | |
| 240 | + dzhangdx = it.Dzhangdx, | |
| 241 | + zrdx = it.Zrdx, | |
| 242 | + dzzrdx = it.Dzzrdx, | |
| 243 | + zjldx = it.Zjldx, | |
| 244 | + jldx = it.Jldx, | |
| 245 | + kjblsdx = it.Kjblsdx, | |
| 246 | + dxmbdx = it.Dxmbdx, | |
| 247 | + dxhj = it.Dxhj, | |
| 248 | + sg = it.Sg, | |
| 249 | + rtjl = it.Rtjl, | |
| 250 | + sjgl = it.Sjgl, | |
| 251 | + cb = it.Cb, | |
| 252 | + sx = it.Sx, | |
| 253 | + qq = it.Qq, | |
| 254 | + hsyfgz = it.Hsyfgz, | |
| 255 | + bd = it.Bd, | |
| 256 | + bdqj = it.Bdqj, | |
| 257 | + bddx = it.Bddx, | |
| 258 | + bdbc = it.Bdbc, | |
| 259 | + zzyfgz = it.Zzyfgz, | |
| 260 | + dypxbt = it.Dypxbt, | |
| 261 | + dyjtbt = it.Dyjtbt, | |
| 262 | + sypxbt = it.Sypxbt, | |
| 263 | + syjtbt = it.Syjtbt, | |
| 264 | + bthj = it.Bthj, | |
| 265 | + qk = it.Qk, | |
| 266 | + cd = it.Cd, | |
| 267 | + qj = it.Qj, | |
| 268 | + ksb = it.Ksb, | |
| 269 | + kcjl = it.Kcjl, | |
| 270 | + kzs = it.Kzs, | |
| 271 | + kxxq = it.Kxxq, | |
| 272 | + kgzf = it.Kgzf, | |
| 273 | + kkhj = it.Kkhj, | |
| 274 | + fjj = it.Fjj, | |
| 275 | + tsjyj = it.Tsjyj, | |
| 276 | + tzsyj = it.Tzsyj, | |
| 277 | + sfgz = it.Sfgz, | |
| 278 | + dysfff = it.Dysfff, | |
| 279 | + zfje = it.Zfje, | |
| 280 | + dzjfe = it.Dzjfe, | |
| 281 | + bfsy = it.Bfsy, | |
| 282 | + dyzfze = it.Dyzfze, | |
| 283 | + }) | |
| 284 | + .MergeTable() | |
| 285 | + .OrderBy(sidx + " " + input.sort) | |
| 286 | + .ToPagedListAsync(input.currentPage, input.pageSize); | |
| 287 | + return PageResult<LqGzListOutput>.SqlSugarPageResult(data); | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | /// <summary> |
| ... | ... | @@ -299,14 +299,15 @@ namespace NCC.Extend.LqGz |
| 299 | 299 | var entity = input.Adapt<LqGzEntity>(); |
| 300 | 300 | entity.Id = YitIdHelper.NextId().ToString(); |
| 301 | 301 | var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); |
| 302 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | |
| 302 | + if (!(isOk > 0)) | |
| 303 | + throw NCCException.Oh(ErrorCode.COM1000); | |
| 303 | 304 | } |
| 304 | 305 | |
| 305 | 306 | /// <summary> |
| 306 | - /// 获取工资全字段无分页列表 | |
| 307 | - /// </summary> | |
| 308 | - /// <param name="input">请求参数</param> | |
| 309 | - /// <returns></returns> | |
| 307 | + /// 获取工资全字段无分页列表 | |
| 308 | + /// </summary> | |
| 309 | + /// <param name="input">请求参数</param> | |
| 310 | + /// <returns></returns> | |
| 310 | 311 | [NonAction] |
| 311 | 312 | public async Task<dynamic> GetNoPagingList([FromQuery] LqGzListQueryInput input) |
| 312 | 313 | { |
| ... | ... | @@ -411,116 +412,119 @@ namespace NCC.Extend.LqGz |
| 411 | 412 | .WhereIF(!string.IsNullOrEmpty(input.dzjfe), p => p.Dzjfe.Equals(input.dzjfe)) |
| 412 | 413 | .WhereIF(!string.IsNullOrEmpty(input.bfsy), p => p.Bfsy.Equals(input.bfsy)) |
| 413 | 414 | .WhereIF(!string.IsNullOrEmpty(input.dyzfze), p => p.Dyzfze.Equals(input.dyzfze)) |
| 414 | - .Select(it=> new LqGzListOutput | |
| 415 | + .Select(it => new LqGzListOutput | |
| 415 | 416 | { |
| 416 | 417 | id = it.Id, |
| 417 | - md=it.Md, | |
| 418 | - hsgw=it.Hsgw, | |
| 419 | - xm=it.Xm, | |
| 420 | - jsjzd=it.Jsjzd, | |
| 421 | - zyj=it.Zyj, | |
| 422 | - jcyj=it.Jcyj, | |
| 423 | - hzyj=it.Hzyj, | |
| 424 | - jlyj=it.Jlyj, | |
| 425 | - mdzyj=it.Mdzyj, | |
| 426 | - dwyj=it.Dwyj, | |
| 427 | - zb=it.Zb, | |
| 428 | - xkyj=it.Xkyj, | |
| 429 | - xkcjl=it.Xkcjl, | |
| 430 | - xktd=it.Xktd, | |
| 431 | - sdyj=it.Sdyj, | |
| 432 | - sdtd=it.Sdtd, | |
| 433 | - syyj=it.Syyj, | |
| 434 | - cellyj=it.Cellyj, | |
| 435 | - dxmybyj=it.Dxmybyj, | |
| 436 | - dxmebyj=it.Dxmebyj, | |
| 437 | - dyyj=it.Dyyj, | |
| 438 | - wysd=it.Wysd, | |
| 439 | - mdzc=it.Mdzc, | |
| 440 | - cpwl=it.Cpwl, | |
| 441 | - wdcb=it.Wdcb, | |
| 442 | - qthzcb=it.Qthzcb, | |
| 443 | - xmj=it.Xmj, | |
| 444 | - ml=it.Ml, | |
| 445 | - zjltce=it.Zjltce, | |
| 446 | - jltce=it.Jltce, | |
| 447 | - xh=it.Xh, | |
| 448 | - xms=it.Xms, | |
| 449 | - ddrt=it.Ddrt, | |
| 450 | - zdts=it.Zdts, | |
| 451 | - qjts=it.Qjts, | |
| 452 | - td=it.Td, | |
| 453 | - jcyjtc=it.Jcyjtc, | |
| 454 | - hzyjtc=it.Hzyjtc, | |
| 455 | - gwtc=it.Gwtc, | |
| 456 | - mdtqtc=it.Mdtqtc, | |
| 457 | - dztc1=it.Dztc1, | |
| 458 | - dzzrtc=it.Dzzrtc, | |
| 459 | - zrtc=it.Zrtc, | |
| 460 | - dztc2=it.Dztc2, | |
| 461 | - zjltc=it.Zjltc, | |
| 462 | - jltc=it.Jltc, | |
| 463 | - yjtc=it.Yjtc, | |
| 464 | - xhtc=it.Xhtc, | |
| 465 | - kjbzctc=it.Kjbzctc, | |
| 466 | - sytc=it.Sytc, | |
| 467 | - celltc=it.Celltc, | |
| 468 | - dxmbtc=it.Dxmbtc, | |
| 469 | - tchj=it.Tchj, | |
| 470 | - jksdx=it.Jksdx, | |
| 471 | - dzhudx=it.Dzhudx, | |
| 472 | - dzhangdx=it.Dzhangdx, | |
| 473 | - zrdx=it.Zrdx, | |
| 474 | - dzzrdx=it.Dzzrdx, | |
| 475 | - zjldx=it.Zjldx, | |
| 476 | - jldx=it.Jldx, | |
| 477 | - kjblsdx=it.Kjblsdx, | |
| 478 | - dxmbdx=it.Dxmbdx, | |
| 479 | - dxhj=it.Dxhj, | |
| 480 | - sg=it.Sg, | |
| 481 | - rtjl=it.Rtjl, | |
| 482 | - sjgl=it.Sjgl, | |
| 483 | - cb=it.Cb, | |
| 484 | - sx=it.Sx, | |
| 485 | - qq=it.Qq, | |
| 486 | - hsyfgz=it.Hsyfgz, | |
| 487 | - bd=it.Bd, | |
| 488 | - bdqj=it.Bdqj, | |
| 489 | - bddx=it.Bddx, | |
| 490 | - bdbc=it.Bdbc, | |
| 491 | - zzyfgz=it.Zzyfgz, | |
| 492 | - dypxbt=it.Dypxbt, | |
| 493 | - dyjtbt=it.Dyjtbt, | |
| 494 | - sypxbt=it.Sypxbt, | |
| 495 | - syjtbt=it.Syjtbt, | |
| 496 | - bthj=it.Bthj, | |
| 497 | - qk=it.Qk, | |
| 498 | - cd=it.Cd, | |
| 499 | - qj=it.Qj, | |
| 500 | - ksb=it.Ksb, | |
| 501 | - kcjl=it.Kcjl, | |
| 502 | - kzs=it.Kzs, | |
| 503 | - kxxq=it.Kxxq, | |
| 504 | - kgzf=it.Kgzf, | |
| 505 | - kkhj=it.Kkhj, | |
| 506 | - fjj=it.Fjj, | |
| 507 | - tsjyj=it.Tsjyj, | |
| 508 | - tzsyj=it.Tzsyj, | |
| 509 | - sfgz=it.Sfgz, | |
| 510 | - dysfff=it.Dysfff, | |
| 511 | - zfje=it.Zfje, | |
| 512 | - dzjfe=it.Dzjfe, | |
| 513 | - bfsy=it.Bfsy, | |
| 514 | - dyzfze=it.Dyzfze, | |
| 515 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | |
| 516 | - return data; | |
| 418 | + md = it.Md, | |
| 419 | + hsgw = it.Hsgw, | |
| 420 | + xm = it.Xm, | |
| 421 | + jsjzd = it.Jsjzd, | |
| 422 | + zyj = it.Zyj, | |
| 423 | + jcyj = it.Jcyj, | |
| 424 | + hzyj = it.Hzyj, | |
| 425 | + jlyj = it.Jlyj, | |
| 426 | + mdzyj = it.Mdzyj, | |
| 427 | + dwyj = it.Dwyj, | |
| 428 | + zb = it.Zb, | |
| 429 | + xkyj = it.Xkyj, | |
| 430 | + xkcjl = it.Xkcjl, | |
| 431 | + xktd = it.Xktd, | |
| 432 | + sdyj = it.Sdyj, | |
| 433 | + sdtd = it.Sdtd, | |
| 434 | + syyj = it.Syyj, | |
| 435 | + cellyj = it.Cellyj, | |
| 436 | + dxmybyj = it.Dxmybyj, | |
| 437 | + dxmebyj = it.Dxmebyj, | |
| 438 | + dyyj = it.Dyyj, | |
| 439 | + wysd = it.Wysd, | |
| 440 | + mdzc = it.Mdzc, | |
| 441 | + cpwl = it.Cpwl, | |
| 442 | + wdcb = it.Wdcb, | |
| 443 | + qthzcb = it.Qthzcb, | |
| 444 | + xmj = it.Xmj, | |
| 445 | + ml = it.Ml, | |
| 446 | + zjltce = it.Zjltce, | |
| 447 | + jltce = it.Jltce, | |
| 448 | + xh = it.Xh, | |
| 449 | + xms = it.Xms, | |
| 450 | + ddrt = it.Ddrt, | |
| 451 | + zdts = it.Zdts, | |
| 452 | + qjts = it.Qjts, | |
| 453 | + td = it.Td, | |
| 454 | + jcyjtc = it.Jcyjtc, | |
| 455 | + hzyjtc = it.Hzyjtc, | |
| 456 | + gwtc = it.Gwtc, | |
| 457 | + mdtqtc = it.Mdtqtc, | |
| 458 | + dztc1 = it.Dztc1, | |
| 459 | + dzzrtc = it.Dzzrtc, | |
| 460 | + zrtc = it.Zrtc, | |
| 461 | + dztc2 = it.Dztc2, | |
| 462 | + zjltc = it.Zjltc, | |
| 463 | + jltc = it.Jltc, | |
| 464 | + yjtc = it.Yjtc, | |
| 465 | + xhtc = it.Xhtc, | |
| 466 | + kjbzctc = it.Kjbzctc, | |
| 467 | + sytc = it.Sytc, | |
| 468 | + celltc = it.Celltc, | |
| 469 | + dxmbtc = it.Dxmbtc, | |
| 470 | + tchj = it.Tchj, | |
| 471 | + jksdx = it.Jksdx, | |
| 472 | + dzhudx = it.Dzhudx, | |
| 473 | + dzhangdx = it.Dzhangdx, | |
| 474 | + zrdx = it.Zrdx, | |
| 475 | + dzzrdx = it.Dzzrdx, | |
| 476 | + zjldx = it.Zjldx, | |
| 477 | + jldx = it.Jldx, | |
| 478 | + kjblsdx = it.Kjblsdx, | |
| 479 | + dxmbdx = it.Dxmbdx, | |
| 480 | + dxhj = it.Dxhj, | |
| 481 | + sg = it.Sg, | |
| 482 | + rtjl = it.Rtjl, | |
| 483 | + sjgl = it.Sjgl, | |
| 484 | + cb = it.Cb, | |
| 485 | + sx = it.Sx, | |
| 486 | + qq = it.Qq, | |
| 487 | + hsyfgz = it.Hsyfgz, | |
| 488 | + bd = it.Bd, | |
| 489 | + bdqj = it.Bdqj, | |
| 490 | + bddx = it.Bddx, | |
| 491 | + bdbc = it.Bdbc, | |
| 492 | + zzyfgz = it.Zzyfgz, | |
| 493 | + dypxbt = it.Dypxbt, | |
| 494 | + dyjtbt = it.Dyjtbt, | |
| 495 | + sypxbt = it.Sypxbt, | |
| 496 | + syjtbt = it.Syjtbt, | |
| 497 | + bthj = it.Bthj, | |
| 498 | + qk = it.Qk, | |
| 499 | + cd = it.Cd, | |
| 500 | + qj = it.Qj, | |
| 501 | + ksb = it.Ksb, | |
| 502 | + kcjl = it.Kcjl, | |
| 503 | + kzs = it.Kzs, | |
| 504 | + kxxq = it.Kxxq, | |
| 505 | + kgzf = it.Kgzf, | |
| 506 | + kkhj = it.Kkhj, | |
| 507 | + fjj = it.Fjj, | |
| 508 | + tsjyj = it.Tsjyj, | |
| 509 | + tzsyj = it.Tzsyj, | |
| 510 | + sfgz = it.Sfgz, | |
| 511 | + dysfff = it.Dysfff, | |
| 512 | + zfje = it.Zfje, | |
| 513 | + dzjfe = it.Dzjfe, | |
| 514 | + bfsy = it.Bfsy, | |
| 515 | + dyzfze = it.Dyzfze, | |
| 516 | + }) | |
| 517 | + .MergeTable() | |
| 518 | + .OrderBy(sidx + " " + input.sort) | |
| 519 | + .ToListAsync(); | |
| 520 | + return data; | |
| 517 | 521 | } |
| 518 | 522 | |
| 519 | 523 | /// <summary> |
| 520 | - /// 导出工资全字段 | |
| 521 | - /// </summary> | |
| 522 | - /// <param name="input">请求参数</param> | |
| 523 | - /// <returns></returns> | |
| 524 | + /// 导出工资全字段 | |
| 525 | + /// </summary> | |
| 526 | + /// <param name="input">请求参数</param> | |
| 527 | + /// <returns></returns> | |
| 524 | 528 | [HttpGet("Actions/Export")] |
| 525 | 529 | public async Task<dynamic> Export([FromQuery] LqGzListQueryInput input) |
| 526 | 530 | { |
| ... | ... | @@ -535,7 +539,8 @@ namespace NCC.Extend.LqGz |
| 535 | 539 | { |
| 536 | 540 | exportData = await this.GetNoPagingList(input); |
| 537 | 541 | } |
| 538 | - List<ParamsModel> paramList = "[{\"value\":\"主键\",\"field\":\"id\"},{\"value\":\"门店\",\"field\":\"md\"},{\"value\":\"核算岗位\",\"field\":\"hsgw\"},{\"value\":\"姓名\",\"field\":\"xm\"},{\"value\":\"金山角战队\",\"field\":\"jsjzd\"},{\"value\":\"基础业绩\",\"field\":\"jcyj\"},{\"value\":\"合作业绩\",\"field\":\"hzyj\"},{\"value\":\"奖励业绩\",\"field\":\"jlyj\"},{\"value\":\"门店总业绩\",\"field\":\"mdzyj\"},{\"value\":\"队伍业绩\",\"field\":\"dwyj\"},{\"value\":\"占比\",\"field\":\"zb\"},{\"value\":\"新客业绩\",\"field\":\"xkyj\"},{\"value\":\"新客成交率\",\"field\":\"xkcjl\"},{\"value\":\"新客提点\",\"field\":\"xktd\"},{\"value\":\"升单业绩\",\"field\":\"sdyj\"},{\"value\":\"升单提点\",\"field\":\"sdtd\"},{\"value\":\"溯源业绩\",\"field\":\"syyj\"},{\"value\":\"cell业绩\",\"field\":\"cellyj\"},{\"value\":\"项目一部业绩\",\"field\":\"dxmybyj\"},{\"value\":\"项目二部业绩\",\"field\":\"dxmebyj\"},{\"value\":\"当月业绩\",\"field\":\"dyyj\"},{\"value\":\"物业水电\",\"field\":\"wysd\"},{\"value\":\"门店支出\",\"field\":\"mdzc\"},{\"value\":\"产品物料\",\"field\":\"cpwl\"},{\"value\":\"微雕成本\",\"field\":\"wdcb\"},{\"value\":\"其它合作成本\",\"field\":\"qthzcb\"},{\"value\":\"洗毛巾\",\"field\":\"xmj\"},{\"value\":\"毛利\",\"field\":\"ml\"},{\"value\":\"总经理提成额\",\"field\":\"zjltce\"},{\"value\":\"经理提成额\",\"field\":\"jltce\"},{\"value\":\"消耗\",\"field\":\"xh\"},{\"value\":\"项目数\",\"field\":\"xms\"},{\"value\":\"到店人头\",\"field\":\"ddrt\"},{\"value\":\"在店天数\",\"field\":\"zdts\"},{\"value\":\"请假天数\",\"field\":\"qjts\"},{\"value\":\"提点\",\"field\":\"td\"},{\"value\":\"基础业绩提成\",\"field\":\"jcyjtc\"},{\"value\":\"合作业绩提成\",\"field\":\"hzyjtc\"},{\"value\":\"顾问提成\",\"field\":\"gwtc\"},{\"value\":\"门店T区提成\",\"field\":\"mdtqtc\"},{\"value\":\"店助提成\",\"field\":\"dztc1\"},{\"value\":\"店助主任提成\",\"field\":\"dzzrtc\"},{\"value\":\"主任提成\",\"field\":\"zrtc\"},{\"value\":\"店长提成\",\"field\":\"dztc2\"},{\"value\":\"总经理提成\",\"field\":\"zjltc\"},{\"value\":\"经理提成\",\"field\":\"jltc\"},{\"value\":\"业绩提成\",\"field\":\"yjtc\"},{\"value\":\"消耗提成\",\"field\":\"xhtc\"},{\"value\":\"科技部组长提成\",\"field\":\"kjbzctc\"},{\"value\":\"溯源提成\",\"field\":\"sytc\"},{\"value\":\"cell提成\",\"field\":\"celltc\"},{\"value\":\"大项目部提成\",\"field\":\"dxmbtc\"},{\"value\":\"提成合计\",\"field\":\"tchj\"},{\"value\":\"健康师底薪\",\"field\":\"jksdx\"},{\"value\":\"店助底薪\",\"field\":\"dzhudx\"},{\"value\":\"店长底薪\",\"field\":\"dzhangdx\"},{\"value\":\"主任底薪\",\"field\":\"zrdx\"},{\"value\":\"店助主任底薪\",\"field\":\"dzzrdx\"},{\"value\":\"总经理底薪\",\"field\":\"zjldx\"},{\"value\":\"经理底薪\",\"field\":\"jldx\"},{\"value\":\"科技部底薪\",\"field\":\"kjblsdx\"},{\"value\":\"大项目部底薪\",\"field\":\"dxmbdx\"},{\"value\":\"底薪合计\",\"field\":\"dxhj\"},{\"value\":\"手工\",\"field\":\"sg\"},{\"value\":\"人头奖励\",\"field\":\"rtjl\"},{\"value\":\"手机管理\",\"field\":\"sjgl\"},{\"value\":\"车补\",\"field\":\"cb\"},{\"value\":\"少休\",\"field\":\"sx\"},{\"value\":\"全勤\",\"field\":\"qq\"},{\"value\":\"核算应发工资\",\"field\":\"hsyfgz\"},{\"value\":\"保底\",\"field\":\"bd\"},{\"value\":\"保底请假\",\"field\":\"bdqj\"},{\"value\":\"保底底薪\",\"field\":\"bddx\"},{\"value\":\"保底补差\",\"field\":\"bdbc\"},{\"value\":\"最终应发工资\",\"field\":\"zzyfgz\"},{\"value\":\"当月培训补贴\",\"field\":\"dypxbt\"},{\"value\":\"当月交通补贴\",\"field\":\"dyjtbt\"},{\"value\":\"上月培训补贴\",\"field\":\"sypxbt\"},{\"value\":\"上月交通补贴\",\"field\":\"syjtbt\"},{\"value\":\"补贴合计\",\"field\":\"bthj\"},{\"value\":\"缺卡\",\"field\":\"qk\"},{\"value\":\"迟到\",\"field\":\"cd\"},{\"value\":\"请假\",\"field\":\"qj\"},{\"value\":\"扣社保\",\"field\":\"ksb\"},{\"value\":\"扣除奖励\",\"field\":\"kcjl\"},{\"value\":\"扣住宿\",\"field\":\"kzs\"},{\"value\":\"扣学习期\",\"field\":\"kxxq\"},{\"value\":\"扣工作服\",\"field\":\"kgzf\"},{\"value\":\"扣款合计\",\"field\":\"kkhj\"},{\"value\":\"发奖金\",\"field\":\"fjj\"},{\"value\":\"退手机押金\",\"field\":\"tsjyj\"},{\"value\":\"退住宿押金\",\"field\":\"tzsyj\"},{\"value\":\"实发工资\",\"field\":\"sfgz\"},{\"value\":\"当月是否发放\",\"field\":\"dysfff\"},{\"value\":\"支付金额\",\"field\":\"zfje\"},{\"value\":\"待支付金额\",\"field\":\"dzjfe\"},{\"value\":\"补发上月\",\"field\":\"bfsy\"},{\"value\":\"当月支付总额\",\"field\":\"dyzfze\"},{\"value\":\"总业绩\",\"field\":\"zyj\"},]".ToList<ParamsModel>(); | |
| 542 | + List<ParamsModel> paramList = | |
| 543 | + "[{\"value\":\"主键\",\"field\":\"id\"},{\"value\":\"门店\",\"field\":\"md\"},{\"value\":\"核算岗位\",\"field\":\"hsgw\"},{\"value\":\"姓名\",\"field\":\"xm\"},{\"value\":\"金山角战队\",\"field\":\"jsjzd\"},{\"value\":\"基础业绩\",\"field\":\"jcyj\"},{\"value\":\"合作业绩\",\"field\":\"hzyj\"},{\"value\":\"奖励业绩\",\"field\":\"jlyj\"},{\"value\":\"门店总业绩\",\"field\":\"mdzyj\"},{\"value\":\"队伍业绩\",\"field\":\"dwyj\"},{\"value\":\"占比\",\"field\":\"zb\"},{\"value\":\"新客业绩\",\"field\":\"xkyj\"},{\"value\":\"新客成交率\",\"field\":\"xkcjl\"},{\"value\":\"新客提点\",\"field\":\"xktd\"},{\"value\":\"升单业绩\",\"field\":\"sdyj\"},{\"value\":\"升单提点\",\"field\":\"sdtd\"},{\"value\":\"溯源业绩\",\"field\":\"syyj\"},{\"value\":\"cell业绩\",\"field\":\"cellyj\"},{\"value\":\"项目一部业绩\",\"field\":\"dxmybyj\"},{\"value\":\"项目二部业绩\",\"field\":\"dxmebyj\"},{\"value\":\"当月业绩\",\"field\":\"dyyj\"},{\"value\":\"物业水电\",\"field\":\"wysd\"},{\"value\":\"门店支出\",\"field\":\"mdzc\"},{\"value\":\"产品物料\",\"field\":\"cpwl\"},{\"value\":\"微雕成本\",\"field\":\"wdcb\"},{\"value\":\"其它合作成本\",\"field\":\"qthzcb\"},{\"value\":\"洗毛巾\",\"field\":\"xmj\"},{\"value\":\"毛利\",\"field\":\"ml\"},{\"value\":\"总经理提成额\",\"field\":\"zjltce\"},{\"value\":\"经理提成额\",\"field\":\"jltce\"},{\"value\":\"消耗\",\"field\":\"xh\"},{\"value\":\"项目数\",\"field\":\"xms\"},{\"value\":\"到店人头\",\"field\":\"ddrt\"},{\"value\":\"在店天数\",\"field\":\"zdts\"},{\"value\":\"请假天数\",\"field\":\"qjts\"},{\"value\":\"提点\",\"field\":\"td\"},{\"value\":\"基础业绩提成\",\"field\":\"jcyjtc\"},{\"value\":\"合作业绩提成\",\"field\":\"hzyjtc\"},{\"value\":\"顾问提成\",\"field\":\"gwtc\"},{\"value\":\"门店T区提成\",\"field\":\"mdtqtc\"},{\"value\":\"店助提成\",\"field\":\"dztc1\"},{\"value\":\"店助主任提成\",\"field\":\"dzzrtc\"},{\"value\":\"主任提成\",\"field\":\"zrtc\"},{\"value\":\"店长提成\",\"field\":\"dztc2\"},{\"value\":\"总经理提成\",\"field\":\"zjltc\"},{\"value\":\"经理提成\",\"field\":\"jltc\"},{\"value\":\"业绩提成\",\"field\":\"yjtc\"},{\"value\":\"消耗提成\",\"field\":\"xhtc\"},{\"value\":\"科技部组长提成\",\"field\":\"kjbzctc\"},{\"value\":\"溯源提成\",\"field\":\"sytc\"},{\"value\":\"cell提成\",\"field\":\"celltc\"},{\"value\":\"大项目部提成\",\"field\":\"dxmbtc\"},{\"value\":\"提成合计\",\"field\":\"tchj\"},{\"value\":\"健康师底薪\",\"field\":\"jksdx\"},{\"value\":\"店助底薪\",\"field\":\"dzhudx\"},{\"value\":\"店长底薪\",\"field\":\"dzhangdx\"},{\"value\":\"主任底薪\",\"field\":\"zrdx\"},{\"value\":\"店助主任底薪\",\"field\":\"dzzrdx\"},{\"value\":\"总经理底薪\",\"field\":\"zjldx\"},{\"value\":\"经理底薪\",\"field\":\"jldx\"},{\"value\":\"科技部底薪\",\"field\":\"kjblsdx\"},{\"value\":\"大项目部底薪\",\"field\":\"dxmbdx\"},{\"value\":\"底薪合计\",\"field\":\"dxhj\"},{\"value\":\"手工\",\"field\":\"sg\"},{\"value\":\"人头奖励\",\"field\":\"rtjl\"},{\"value\":\"手机管理\",\"field\":\"sjgl\"},{\"value\":\"车补\",\"field\":\"cb\"},{\"value\":\"少休\",\"field\":\"sx\"},{\"value\":\"全勤\",\"field\":\"qq\"},{\"value\":\"核算应发工资\",\"field\":\"hsyfgz\"},{\"value\":\"保底\",\"field\":\"bd\"},{\"value\":\"保底请假\",\"field\":\"bdqj\"},{\"value\":\"保底底薪\",\"field\":\"bddx\"},{\"value\":\"保底补差\",\"field\":\"bdbc\"},{\"value\":\"最终应发工资\",\"field\":\"zzyfgz\"},{\"value\":\"当月培训补贴\",\"field\":\"dypxbt\"},{\"value\":\"当月交通补贴\",\"field\":\"dyjtbt\"},{\"value\":\"上月培训补贴\",\"field\":\"sypxbt\"},{\"value\":\"上月交通补贴\",\"field\":\"syjtbt\"},{\"value\":\"补贴合计\",\"field\":\"bthj\"},{\"value\":\"缺卡\",\"field\":\"qk\"},{\"value\":\"迟到\",\"field\":\"cd\"},{\"value\":\"请假\",\"field\":\"qj\"},{\"value\":\"扣社保\",\"field\":\"ksb\"},{\"value\":\"扣除奖励\",\"field\":\"kcjl\"},{\"value\":\"扣住宿\",\"field\":\"kzs\"},{\"value\":\"扣学习期\",\"field\":\"kxxq\"},{\"value\":\"扣工作服\",\"field\":\"kgzf\"},{\"value\":\"扣款合计\",\"field\":\"kkhj\"},{\"value\":\"发奖金\",\"field\":\"fjj\"},{\"value\":\"退手机押金\",\"field\":\"tsjyj\"},{\"value\":\"退住宿押金\",\"field\":\"tzsyj\"},{\"value\":\"实发工资\",\"field\":\"sfgz\"},{\"value\":\"当月是否发放\",\"field\":\"dysfff\"},{\"value\":\"支付金额\",\"field\":\"zfje\"},{\"value\":\"待支付金额\",\"field\":\"dzjfe\"},{\"value\":\"补发上月\",\"field\":\"bfsy\"},{\"value\":\"当月支付总额\",\"field\":\"dyzfze\"},{\"value\":\"总业绩\",\"field\":\"zyj\"},]".ToList<ParamsModel>(); | |
| 539 | 544 | ExcelConfig excelconfig = new ExcelConfig(); |
| 540 | 545 | excelconfig.FileName = "工资全字段.xls"; |
| 541 | 546 | excelconfig.HeadFont = "微软雅黑"; |
| ... | ... | @@ -554,11 +559,7 @@ namespace NCC.Extend.LqGz |
| 554 | 559 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; |
| 555 | 560 | ExcelExportHelper<LqGzListOutput>.Export(exportData, excelconfig, addPath); |
| 556 | 561 | var fileName = _userManager.UserId + "|" + addPath + "|xls"; |
| 557 | - var output = new | |
| 558 | - { | |
| 559 | - name = excelconfig.FileName, | |
| 560 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 561 | - }; | |
| 562 | + var output = new { name = excelconfig.FileName, url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") }; | |
| 562 | 563 | return output; |
| 563 | 564 | } |
| 564 | 565 | |
| ... | ... | @@ -578,7 +579,7 @@ namespace NCC.Extend.LqGz |
| 578 | 579 | //开启事务 |
| 579 | 580 | _db.BeginTran(); |
| 580 | 581 | //批量删除工资全字段 |
| 581 | - await _db.Deleteable<LqGzEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | |
| 582 | + await _db.Deleteable<LqGzEntity>().In(d => d.Id, ids).ExecuteCommandAsync(); | |
| 582 | 583 | //关闭事务 |
| 583 | 584 | _db.CommitTran(); |
| 584 | 585 | } |
| ... | ... | @@ -602,7 +603,8 @@ namespace NCC.Extend.LqGz |
| 602 | 603 | { |
| 603 | 604 | var entity = input.Adapt<LqGzEntity>(); |
| 604 | 605 | var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); |
| 605 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | |
| 606 | + if (!(isOk > 0)) | |
| 607 | + throw NCCException.Oh(ErrorCode.COM1001); | |
| 606 | 608 | } |
| 607 | 609 | |
| 608 | 610 | /// <summary> |
| ... | ... | @@ -615,7 +617,8 @@ namespace NCC.Extend.LqGz |
| 615 | 617 | var entity = await _db.Queryable<LqGzEntity>().FirstAsync(p => p.Id == id); |
| 616 | 618 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); |
| 617 | 619 | var isOk = await _db.Deleteable<LqGzEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); |
| 618 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | |
| 620 | + if (!(isOk > 0)) | |
| 621 | + throw NCCException.Oh(ErrorCode.COM1002); | |
| 619 | 622 | } |
| 620 | 623 | |
| 621 | 624 | #region 业绩计算相关方法 |
| ... | ... | @@ -625,14 +628,14 @@ namespace NCC.Extend.LqGz |
| 625 | 628 | /// </summary> |
| 626 | 629 | /// <remarks> |
| 627 | 630 | /// 根据薪酬规则计算个人的基础业绩、合作业绩、奖励业绩、门店总业绩、队伍业绩等 |
| 628 | - /// | |
| 631 | + /// | |
| 629 | 632 | /// 计算逻辑: |
| 630 | 633 | /// 1. 基础业绩:从开单品项明细表中统计,基于项目资料中的基础服务提成 |
| 631 | 634 | /// 2. 合作业绩:从开单品项明细表中统计,基于项目资料中的合作项目设置 |
| 632 | 635 | /// 3. 奖励业绩:从奖励明细表中统计 |
| 633 | 636 | /// 4. 门店总业绩:该员工所在门店的所有业绩总和 |
| 634 | 637 | /// 5. 队伍业绩:该员工所在金三角战队的所有业绩总和 |
| 635 | - /// | |
| 638 | + /// | |
| 636 | 639 | /// 示例请求: |
| 637 | 640 | /// ```json |
| 638 | 641 | /// { |
| ... | ... | @@ -641,7 +644,7 @@ namespace NCC.Extend.LqGz |
| 641 | 644 | /// "calculationMonth": "2025-01" |
| 642 | 645 | /// } |
| 643 | 646 | /// ``` |
| 644 | - /// | |
| 647 | + /// | |
| 645 | 648 | /// 参数说明: |
| 646 | 649 | /// - employeeId: 员工ID(必填) |
| 647 | 650 | /// - storeId: 门店ID(必填) |
| ... | ... | @@ -663,30 +666,29 @@ namespace NCC.Extend.LqGz |
| 663 | 666 | { |
| 664 | 667 | EmployeeId = input.EmployeeId, |
| 665 | 668 | StoreId = input.StoreId, |
| 666 | - CalculationMonth = input.CalculationMonth | |
| 669 | + CalculationMonth = input.CalculationMonth, | |
| 667 | 670 | }; |
| 668 | 671 | |
| 669 | 672 | // 1. 计算基础业绩 |
| 670 | 673 | result.BasicPerformance = await CalculateBasicPerformance(input.EmployeeId, input.StoreId, input.CalculationMonth); |
| 671 | - | |
| 674 | + | |
| 672 | 675 | // 2. 计算合作业绩 |
| 673 | 676 | result.CooperationPerformance = await CalculateCooperationPerformance(input.EmployeeId, input.StoreId, input.CalculationMonth); |
| 674 | - | |
| 677 | + | |
| 675 | 678 | // 3. 计算奖励业绩 |
| 676 | 679 | result.RewardPerformance = await CalculateRewardPerformance(input.EmployeeId, input.StoreId, input.CalculationMonth); |
| 677 | - | |
| 680 | + | |
| 678 | 681 | // 4. 计算总业绩 |
| 679 | 682 | result.TotalPerformance = result.BasicPerformance + result.CooperationPerformance + result.RewardPerformance; |
| 680 | - | |
| 683 | + | |
| 681 | 684 | // 5. 计算门店总业绩 |
| 682 | 685 | result.StoreTotalPerformance = await CalculateStoreTotalPerformance(input.StoreId, input.CalculationMonth); |
| 683 | - | |
| 686 | + | |
| 684 | 687 | // 6. 计算队伍业绩 |
| 685 | 688 | result.TeamPerformance = await CalculateTeamPerformance(input.EmployeeId, input.StoreId, input.CalculationMonth); |
| 686 | - | |
| 689 | + | |
| 687 | 690 | // 7. 计算占比 |
| 688 | - result.PerformanceRatio = result.StoreTotalPerformance > 0 ? | |
| 689 | - Math.Round(result.TotalPerformance / result.StoreTotalPerformance * 100, 2) : 0; | |
| 691 | + result.PerformanceRatio = result.StoreTotalPerformance > 0 ? Math.Round(result.TotalPerformance / result.StoreTotalPerformance * 100, 2) : 0; | |
| 690 | 692 | |
| 691 | 693 | _logger.LogInformation($"业绩计算完成 - 员工ID: {input.EmployeeId}, 总业绩: {result.TotalPerformance}, 门店总业绩: {result.StoreTotalPerformance}"); |
| 692 | 694 | |
| ... | ... | @@ -711,11 +713,7 @@ namespace NCC.Extend.LqGz |
| 711 | 713 | var basicPerformance = await _db.Queryable<LqKdPxmxEntity>() |
| 712 | 714 | .LeftJoin<LqXmzlEntity>((px, xm) => px.Px == xm.Xmbh) |
| 713 | 715 | .LeftJoin<LqKdKdjlbEntity>((px, xm, kd) => px.Glkdbh == kd.Id) |
| 714 | - .Where((px, xm, kd) => | |
| 715 | - kd.Djmd == storeId && | |
| 716 | - kd.Kdrq >= startDate && | |
| 717 | - kd.Kdrq <= endDate && | |
| 718 | - (px.Px == employeeId || px.Px.Contains(employeeId))) // 根据实际情况调整匹配条件 | |
| 716 | + .Where((px, xm, kd) => kd.Djmd == storeId && kd.Kdrq >= startDate && kd.Kdrq <= endDate && (px.Px == employeeId || px.Px.Contains(employeeId))) // 根据实际情况调整匹配条件 | |
| 719 | 717 | .SumAsync((px, xm, kd) => px.Pxjg * xm.Jcfwtc / 100); |
| 720 | 718 | |
| 721 | 719 | return basicPerformance; |
| ... | ... | @@ -733,12 +731,16 @@ namespace NCC.Extend.LqGz |
| 733 | 731 | var cooperationPerformance = await _db.Queryable<LqKdPxmxEntity>() |
| 734 | 732 | .LeftJoin<LqXmzlEntity>((px, xm) => px.Px == xm.Xmbh) |
| 735 | 733 | .LeftJoin<LqKdKdjlbEntity>((px, xm, kd) => px.Glkdbh == kd.Id) |
| 736 | - .Where((px, xm, kd) => | |
| 737 | - kd.Djmd == storeId && | |
| 738 | - kd.Kdrq >= startDate && | |
| 739 | - kd.Kdrq <= endDate && | |
| 740 | - kd.Hgjg != null && kd.Hgjg != "" && // 有合作机构 | |
| 741 | - (px.Px == employeeId || px.Px.Contains(employeeId))) | |
| 734 | + .Where( | |
| 735 | + (px, xm, kd) => | |
| 736 | + kd.Djmd == storeId | |
| 737 | + && kd.Kdrq >= startDate | |
| 738 | + && kd.Kdrq <= endDate | |
| 739 | + && kd.Hgjg != null | |
| 740 | + && kd.Hgjg != "" | |
| 741 | + && // 有合作机构 | |
| 742 | + (px.Px == employeeId || px.Px.Contains(employeeId)) | |
| 743 | + ) | |
| 742 | 744 | .SumAsync((px, xm, kd) => px.Pxjg * 0.65m); // 合作业绩按65%计算 |
| 743 | 745 | |
| 744 | 746 | return cooperationPerformance; |
| ... | ... | @@ -751,10 +753,7 @@ namespace NCC.Extend.LqGz |
| 751 | 753 | { |
| 752 | 754 | // 从奖励明细表中统计奖励业绩 |
| 753 | 755 | var rewardPerformance = await _db.Queryable<LqJlmxbEntity>() |
| 754 | - .Where(jl => | |
| 755 | - jl.Mdbh == storeId && | |
| 756 | - jl.Jks == employeeId && | |
| 757 | - jl.Hj != null && jl.Hj != "") | |
| 756 | + .Where(jl => jl.Mdbh == storeId && jl.Jks == employeeId && jl.Hj != null && jl.Hj != "") | |
| 758 | 757 | .SumAsync(jl => Convert.ToDecimal(jl.Hj)); |
| 759 | 758 | |
| 760 | 759 | return rewardPerformance; |
| ... | ... | @@ -769,12 +768,7 @@ namespace NCC.Extend.LqGz |
| 769 | 768 | var endDate = startDate.AddMonths(1).AddDays(-1); |
| 770 | 769 | |
| 771 | 770 | // 从开单记录表中统计门店总业绩 |
| 772 | - var storeTotalPerformance = await _db.Queryable<LqKdKdjlbEntity>() | |
| 773 | - .Where(kd => | |
| 774 | - kd.Djmd == storeId && | |
| 775 | - kd.Kdrq >= startDate && | |
| 776 | - kd.Kdrq <= endDate) | |
| 777 | - .SumAsync(kd => kd.Zdyj); | |
| 771 | + var storeTotalPerformance = await _db.Queryable<LqKdKdjlbEntity>().Where(kd => kd.Djmd == storeId && kd.Kdrq >= startDate && kd.Kdrq <= endDate).SumAsync(kd => kd.Zdyj); | |
| 778 | 772 | |
| 779 | 773 | return storeTotalPerformance; |
| 780 | 774 | } |
| ... | ... | @@ -785,12 +779,7 @@ namespace NCC.Extend.LqGz |
| 785 | 779 | private async Task<decimal> CalculateTeamPerformance(string employeeId, string storeId, string calculationMonth) |
| 786 | 780 | { |
| 787 | 781 | // 先获取员工所在的金三角战队 |
| 788 | - var goldenTriangle = await _db.Queryable<LqYcsdJsjEntity>() | |
| 789 | - .Where(jsj => | |
| 790 | - jsj.Md == storeId && | |
| 791 | - jsj.Yf == calculationMonth && | |
| 792 | - jsj.Jsj.Contains(employeeId)) | |
| 793 | - .FirstAsync(); | |
| 782 | + var goldenTriangle = await _db.Queryable<LqYcsdJsjEntity>().Where(jsj => jsj.Md == storeId && jsj.Yf == calculationMonth && jsj.Jsj.Contains(employeeId)).FirstAsync(); | |
| 794 | 783 | |
| 795 | 784 | if (goldenTriangle == null) |
| 796 | 785 | { |
| ... | ... | @@ -802,11 +791,7 @@ namespace NCC.Extend.LqGz |
| 802 | 791 | |
| 803 | 792 | // 统计该战队所有成员的业绩 |
| 804 | 793 | var teamPerformance = await _db.Queryable<LqKdKdjlbEntity>() |
| 805 | - .Where(kd => | |
| 806 | - kd.Djmd == storeId && | |
| 807 | - kd.Kdrq >= startDate && | |
| 808 | - kd.Kdrq <= endDate && | |
| 809 | - goldenTriangle.Jsj.Contains(kd.Jsj)) | |
| 794 | + .Where(kd => kd.Djmd == storeId && kd.Kdrq >= startDate && kd.Kdrq <= endDate && goldenTriangle.Jsj.Contains(kd.Jsj)) | |
| 810 | 795 | .SumAsync(kd => kd.Zdyj); |
| 811 | 796 | |
| 812 | 797 | return teamPerformance; |
| ... | ... | @@ -817,7 +802,7 @@ namespace NCC.Extend.LqGz |
| 817 | 802 | /// </summary> |
| 818 | 803 | /// <remarks> |
| 819 | 804 | /// 批量更新指定月份所有员工的业绩数据 |
| 820 | - /// | |
| 805 | + /// | |
| 821 | 806 | /// 示例请求: |
| 822 | 807 | /// ```json |
| 823 | 808 | /// { |
| ... | ... | @@ -825,7 +810,7 @@ namespace NCC.Extend.LqGz |
| 825 | 810 | /// "storeIds": ["门店ID1", "门店ID2"] |
| 826 | 811 | /// } |
| 827 | 812 | /// ``` |
| 828 | - /// | |
| 813 | + /// | |
| 829 | 814 | /// 参数说明: |
| 830 | 815 | /// - calculationMonth: 计算月份,格式:YYYYMM(必填) |
| 831 | 816 | /// - storeIds: 门店ID列表(可选,为空则更新所有门店) |
| ... | ... | @@ -846,9 +831,7 @@ namespace NCC.Extend.LqGz |
| 846 | 831 | var errorCount = 0; |
| 847 | 832 | |
| 848 | 833 | // 获取需要更新的工资记录 |
| 849 | - var salaryRecords = await _db.Queryable<LqGzEntity>() | |
| 850 | - .WhereIF(input.StoreIds != null && input.StoreIds.Any(), gz => input.StoreIds.Contains(gz.Md)) | |
| 851 | - .ToListAsync(); | |
| 834 | + var salaryRecords = await _db.Queryable<LqGzEntity>().WhereIF(input.StoreIds != null && input.StoreIds.Any(), gz => input.StoreIds.Contains(gz.Md)).ToListAsync(); | |
| 852 | 835 | |
| 853 | 836 | foreach (var record in salaryRecords) |
| 854 | 837 | { |
| ... | ... | @@ -859,7 +842,7 @@ namespace NCC.Extend.LqGz |
| 859 | 842 | { |
| 860 | 843 | EmployeeId = record.Xm, // 使用姓名作为员工标识 |
| 861 | 844 | StoreId = record.Md, |
| 862 | - CalculationMonth = input.CalculationMonth | |
| 845 | + CalculationMonth = input.CalculationMonth, | |
| 863 | 846 | }; |
| 864 | 847 | |
| 865 | 848 | var performance = await CalculatePerformance(performanceInput); |
| ... | ... | @@ -874,9 +857,15 @@ namespace NCC.Extend.LqGz |
| 874 | 857 | record.Zb = performance.PerformanceRatio; |
| 875 | 858 | |
| 876 | 859 | await _db.Updateable(record) |
| 877 | - .UpdateColumns(gz => new { | |
| 878 | - gz.Jcyj, gz.Hzyj, gz.Jlyj, gz.Zyj, | |
| 879 | - gz.Mdzyj, gz.Dwyj, gz.Zb | |
| 860 | + .UpdateColumns(gz => new | |
| 861 | + { | |
| 862 | + gz.Jcyj, | |
| 863 | + gz.Hzyj, | |
| 864 | + gz.Jlyj, | |
| 865 | + gz.Zyj, | |
| 866 | + gz.Mdzyj, | |
| 867 | + gz.Dwyj, | |
| 868 | + gz.Zb, | |
| 880 | 869 | }) |
| 881 | 870 | .ExecuteCommandAsync(); |
| 882 | 871 | |
| ... | ... | @@ -896,7 +885,7 @@ namespace NCC.Extend.LqGz |
| 896 | 885 | Success = true, |
| 897 | 886 | UpdatedCount = updatedCount, |
| 898 | 887 | ErrorCount = errorCount, |
| 899 | - Message = $"成功更新 {updatedCount} 条记录,失败 {errorCount} 条记录" | |
| 888 | + Message = $"成功更新 {updatedCount} 条记录,失败 {errorCount} 条记录", | |
| 900 | 889 | }; |
| 901 | 890 | } |
| 902 | 891 | catch (Exception ex) | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqHytkHytkService.cs
netcore/src/Modularity/Extend/NCC.Extend/LqKdKdjlbService.cs
| ... | ... | @@ -252,6 +252,8 @@ namespace NCC.Extend.LqKdKdjlb |
| 252 | 252 | var userInfo = await _userManager.GetUserInfo(); |
| 253 | 253 | var entity = input.Adapt<LqKdKdjlbEntity>(); |
| 254 | 254 | entity.Id = YitIdHelper.NextId().ToString(); |
| 255 | + entity.CreateTime = DateTime.Now; | |
| 256 | + entity.UpdateTime = DateTime.Now; | |
| 255 | 257 | try |
| 256 | 258 | { |
| 257 | 259 | //开启事务 |
| ... | ... | @@ -300,7 +302,7 @@ namespace NCC.Extend.LqKdKdjlb |
| 300 | 302 | Jksxm = ijks_tem.jksxm, |
| 301 | 303 | Jkszh = ijks_tem.jkszh, |
| 302 | 304 | Jksyj = ijks_tem.jksyj, |
| 303 | - Yjsj = DateTime.Now, | |
| 305 | + Yjsj = input.kdrq, | |
| 304 | 306 | Jsj_id = ijks_tem.jsj_id, |
| 305 | 307 | Kdpxid = lqKdPxmxEntity.Id, |
| 306 | 308 | } |
| ... | ... | @@ -322,7 +324,7 @@ namespace NCC.Extend.LqKdKdjlb |
| 322 | 324 | Kjblsxm = ikjbs_tem.kjblsxm, |
| 323 | 325 | Kjblszh = ikjbs_tem.kjblszh, |
| 324 | 326 | Kjblsyj = ikjbs_tem.kjblsyj, |
| 325 | - Yjsj = DateTime.Now, | |
| 327 | + Yjsj = input.kdrq, | |
| 326 | 328 | Kdpxid = lqKdPxmxEntity.Id, |
| 327 | 329 | } |
| 328 | 330 | ); |
| ... | ... | @@ -634,8 +636,8 @@ namespace NCC.Extend.LqKdKdjlb |
| 634 | 636 | CreateTIme = DateTime.Now, |
| 635 | 637 | MemberId = entity.Kdhy, |
| 636 | 638 | IsEnabled = 0, |
| 637 | - ProjectNumber = item.projectNumber ?? 1, | |
| 638 | - TotalPrice = (decimal)(item.pxjg * (item.projectNumber ?? 1)), | |
| 639 | + ProjectNumber = item.projectNumber == 0 ? 1 : item.projectNumber, | |
| 640 | + TotalPrice = (decimal)(item.pxjg * (item.projectNumber == 0 ? 1 : item.projectNumber)), | |
| 639 | 641 | Px = item.px, |
| 640 | 642 | Pxmc = item.pxmc, |
| 641 | 643 | Pxjg = item.pxjg, | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqStatisticsService.cs
| ... | ... | @@ -13,11 +13,15 @@ using NCC.Dependency; |
| 13 | 13 | using NCC.DynamicApiController; |
| 14 | 14 | using NCC.Extend.Entitys.Dto.LqMdxx; |
| 15 | 15 | using NCC.Extend.Entitys.Dto.LqStatistics; |
| 16 | +using NCC.Extend.Entitys.Dto.LqYcsdJsj; | |
| 16 | 17 | using NCC.Extend.Entitys.lq_hytk_kjbsyj; |
| 18 | +using NCC.Extend.Entitys.lq_jinsanjiao_user; | |
| 19 | +using NCC.Extend.Entitys.lq_kd_jksyj; | |
| 17 | 20 | using NCC.Extend.Entitys.lq_kd_kdjlb; |
| 18 | 21 | using NCC.Extend.Entitys.lq_kd_kjbsyj; |
| 19 | 22 | using NCC.Extend.Entitys.lq_mdxx; |
| 20 | 23 | using NCC.Extend.Entitys.lq_xh_kjbsyj; |
| 24 | +using NCC.Extend.Entitys.lq_ycsd_jsj; | |
| 21 | 25 | using NCC.Extend.Entitys.lq_yjmxb; |
| 22 | 26 | using NCC.Extend.Entitys.v_tech_teacher_flow; |
| 23 | 27 | using NCC.Extend.Interfaces.LqStatistics; |
| ... | ... | @@ -1041,6 +1045,140 @@ namespace NCC.Extend.LqStatistics |
| 1041 | 1045 | } |
| 1042 | 1046 | |
| 1043 | 1047 | #endregion |
| 1048 | + | |
| 1049 | + #region 金三角业绩统计 | |
| 1050 | + /// <summary> | |
| 1051 | + /// 查询所有金三角的业绩统计 | |
| 1052 | + /// </summary> | |
| 1053 | + /// <remarks> | |
| 1054 | + /// 根据金三角成员状态进行不同的统计方式: | |
| 1055 | + /// 1. 活跃成员:业绩计入金三角总业绩 | |
| 1056 | + /// 2. 非活跃成员:按单人业绩统计,金三角名称为"门店名+姓名" | |
| 1057 | + /// | |
| 1058 | + /// 示例请求: | |
| 1059 | + /// GET /api/Extend/LqStatistics/GetJsjPerformance?startMonth=202401&endMonth=202412 | |
| 1060 | + /// | |
| 1061 | + /// 参数说明: | |
| 1062 | + /// - startMonth: 开始月份,格式为yyyyMM,可选 | |
| 1063 | + /// - endMonth: 结束月份,格式为yyyyMM,可选 | |
| 1064 | + /// - jsjId: 金三角ID,可选 | |
| 1065 | + /// - storeId: 门店ID,可选 | |
| 1066 | + /// | |
| 1067 | + /// 返回信息包括: | |
| 1068 | + /// - 金三角基本信息(ID、名称、月份、门店) | |
| 1069 | + /// - 业绩统计(订单数量、总业绩、首次/最后订单日期) | |
| 1070 | + /// - 统计类型(ACTIVE-活跃金三角业绩,INACTIVE-单人业绩) | |
| 1071 | + /// - 成员姓名(仅单人业绩时使用) | |
| 1072 | + /// </remarks> | |
| 1073 | + /// <param name="input">查询参数</param> | |
| 1074 | + /// <returns>金三角业绩统计列表</returns> | |
| 1075 | + /// <response code="200">查询成功</response> | |
| 1076 | + /// <response code="400">参数错误</response> | |
| 1077 | + [HttpGet("GetJsjPerformance")] | |
| 1078 | + public async Task<List<LqYcsdJsjPerformanceOutput>> GetJsjPerformance([FromQuery] LqYcsdJsjPerformanceInput input) | |
| 1079 | + { | |
| 1080 | + var result = new List<LqYcsdJsjPerformanceOutput>(); | |
| 1081 | + | |
| 1082 | + try | |
| 1083 | + { | |
| 1084 | + // 1. 查询活跃金三角成员的业绩(计入金三角总业绩) | |
| 1085 | + var activePerformanceQuery = _db.Queryable<LqYcsdJsjEntity>() | |
| 1086 | + .LeftJoin<LqJinsanjiaoUserEntity>((jsj, user) => jsj.Id == user.JsjId && user.Status == "ACTIVE" && user.DeleteMark == 0) | |
| 1087 | + .LeftJoin<LqKdJksyjEntity>((jsj, user, jksyj) => jsj.Id == jksyj.Jsj_id && user.UserId == jksyj.Jkszh) | |
| 1088 | + .LeftJoin<LqMdxxEntity>((jsj, user, jksyj, md) => jsj.Md == md.Id) | |
| 1089 | + .Where((jsj, user, jksyj, md) => jsj.Yf != null && jksyj.Yjsj != null && jksyj.Jksyj != null && jksyj.Jksyj != "" && jksyj.Jksyj != "0") | |
| 1090 | + .WhereIF(!string.IsNullOrEmpty(input.StartMonth), (jsj, user, jksyj, md) => jsj.Yf.CompareTo(input.StartMonth) >= 0) | |
| 1091 | + .WhereIF(!string.IsNullOrEmpty(input.EndMonth), (jsj, user, jksyj, md) => jsj.Yf.CompareTo(input.EndMonth) <= 0) | |
| 1092 | + .WhereIF(!string.IsNullOrEmpty(input.JsjId), (jsj, user, jksyj, md) => jsj.Id == input.JsjId) | |
| 1093 | + .WhereIF(!string.IsNullOrEmpty(input.StoreId), (jsj, user, jksyj, md) => jsj.Md == input.StoreId) | |
| 1094 | + .GroupBy( | |
| 1095 | + (jsj, user, jksyj, md) => | |
| 1096 | + new | |
| 1097 | + { | |
| 1098 | + jsj.Id, | |
| 1099 | + jsj.Jsj, | |
| 1100 | + jsj.Yf, | |
| 1101 | + jsj.Md, | |
| 1102 | + md.Dm, | |
| 1103 | + } | |
| 1104 | + ) | |
| 1105 | + .Select( | |
| 1106 | + (jsj, user, jksyj, md) => | |
| 1107 | + new LqYcsdJsjPerformanceOutput | |
| 1108 | + { | |
| 1109 | + JsjId = jsj.Id, | |
| 1110 | + JsjName = jsj.Jsj, | |
| 1111 | + Month = jsj.Yf, | |
| 1112 | + StoreId = jsj.Md, | |
| 1113 | + StoreName = md.Dm, | |
| 1114 | + OrderCount = SqlFunc.AggregateCount(jksyj.Glkdbh), | |
| 1115 | + TotalPerformance = SqlFunc.AggregateSum(SqlFunc.ToDecimal(jksyj.Jksyj)), | |
| 1116 | + LastOrderDate = SqlFunc.AggregateMax(jksyj.Yjsj), | |
| 1117 | + FirstOrderDate = SqlFunc.AggregateMin(jksyj.Yjsj), | |
| 1118 | + StatisticsType = "ACTIVE", | |
| 1119 | + MemberName = null, | |
| 1120 | + } | |
| 1121 | + ); | |
| 1122 | + | |
| 1123 | + var activeResults = await activePerformanceQuery.ToListAsync(); | |
| 1124 | + result.AddRange(activeResults); | |
| 1125 | + | |
| 1126 | + // 2. 查询非活跃金三角成员的业绩(按单人业绩统计) | |
| 1127 | + var inactivePerformanceQuery = _db.Queryable<LqJinsanjiaoUserEntity>() | |
| 1128 | + .LeftJoin<LqYcsdJsjEntity>((user, jsj) => user.JsjId == jsj.Id) | |
| 1129 | + .LeftJoin<LqKdJksyjEntity>((user, jsj, jksyj) => user.UserId == jksyj.Jkszh) | |
| 1130 | + .LeftJoin<LqMdxxEntity>((user, jsj, jksyj, md) => jsj.Md == md.Id) | |
| 1131 | + .Where( | |
| 1132 | + (user, jsj, jksyj, md) => | |
| 1133 | + user.Status == "INACTIVE" && user.DeleteMark == 0 && jsj.Yf != null && jksyj.Yjsj != null && jksyj.Jksyj != null && jksyj.Jksyj != "" && jksyj.Jksyj != "0" | |
| 1134 | + ) | |
| 1135 | + .WhereIF(!string.IsNullOrEmpty(input.StartMonth), (user, jsj, jksyj, md) => jsj.Yf.CompareTo(input.StartMonth) >= 0) | |
| 1136 | + .WhereIF(!string.IsNullOrEmpty(input.EndMonth), (user, jsj, jksyj, md) => jsj.Yf.CompareTo(input.EndMonth) <= 0) | |
| 1137 | + .WhereIF(!string.IsNullOrEmpty(input.JsjId), (user, jsj, jksyj, md) => jsj.Id == input.JsjId) | |
| 1138 | + .WhereIF(!string.IsNullOrEmpty(input.StoreId), (user, jsj, jksyj, md) => jsj.Md == input.StoreId) | |
| 1139 | + .GroupBy( | |
| 1140 | + (user, jsj, jksyj, md) => | |
| 1141 | + new | |
| 1142 | + { | |
| 1143 | + user.Id, | |
| 1144 | + user.UserName, | |
| 1145 | + jsjId = jsj.Id, | |
| 1146 | + jsj.Yf, | |
| 1147 | + jsj.Md, | |
| 1148 | + md.Dm, | |
| 1149 | + } | |
| 1150 | + ) | |
| 1151 | + .Select( | |
| 1152 | + (user, jsj, jksyj, md) => | |
| 1153 | + new LqYcsdJsjPerformanceOutput | |
| 1154 | + { | |
| 1155 | + JsjId = user.Id, // 使用用户ID作为标识 | |
| 1156 | + JsjName = md.Dm + "-" + user.UserName, // 门店名+姓名 | |
| 1157 | + Month = jsj.Yf, | |
| 1158 | + StoreId = jsj.Md, | |
| 1159 | + StoreName = md.Dm, | |
| 1160 | + OrderCount = SqlFunc.AggregateCount(jksyj.Glkdbh), | |
| 1161 | + TotalPerformance = SqlFunc.AggregateSum(SqlFunc.ToDecimal(jksyj.Jksyj)), | |
| 1162 | + LastOrderDate = SqlFunc.AggregateMax(jksyj.Yjsj), | |
| 1163 | + FirstOrderDate = SqlFunc.AggregateMin(jksyj.Yjsj), | |
| 1164 | + StatisticsType = "INACTIVE", | |
| 1165 | + MemberName = user.UserName, | |
| 1166 | + } | |
| 1167 | + ); | |
| 1168 | + | |
| 1169 | + var inactiveResults = await inactivePerformanceQuery.ToListAsync(); | |
| 1170 | + result.AddRange(inactiveResults); | |
| 1171 | + | |
| 1172 | + // 3. 按月份和业绩排序 | |
| 1173 | + return result.OrderByDescending(x => x.Month).ThenByDescending(x => x.TotalPerformance).ToList(); | |
| 1174 | + } | |
| 1175 | + catch (Exception ex) | |
| 1176 | + { | |
| 1177 | + _logger.LogError(ex, "查询金三角业绩统计时发生错误"); | |
| 1178 | + throw NCCException.Oh(ErrorCode.COM1001, "查询金三角业绩统计失败"); | |
| 1179 | + } | |
| 1180 | + } | |
| 1181 | + #endregion | |
| 1044 | 1182 | } |
| 1045 | 1183 | |
| 1046 | 1184 | /// <summary> | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqTkjlbService.cs
| ... | ... | @@ -16,6 +16,7 @@ using NCC.DataEncryption; |
| 16 | 16 | using NCC.Dependency; |
| 17 | 17 | using NCC.DynamicApiController; |
| 18 | 18 | using NCC.Extend.Entitys.Dto.LqTkjlb; |
| 19 | +using NCC.Extend.Entitys.lq_event; | |
| 19 | 20 | using NCC.Extend.Entitys.lq_eventuser; |
| 20 | 21 | using NCC.Extend.Entitys.lq_khxx; |
| 21 | 22 | using NCC.Extend.Entitys.lq_ryzl; |
| ... | ... | @@ -61,6 +62,7 @@ namespace NCC.Extend.LqTkjlb |
| 61 | 62 | { |
| 62 | 63 | var entity = await _db.Queryable<LqTkjlbEntity>().FirstAsync(p => p.Id == id); |
| 63 | 64 | var output = entity.Adapt<LqTkjlbInfoOutput>(); |
| 65 | + output.eventName = SqlFunc.Subqueryable<LqEventEntity>().Where(u => u.Id == entity.EventId).Select(u => u.EventName); | |
| 64 | 66 | return output; |
| 65 | 67 | } |
| 66 | 68 | #endregion |
| ... | ... | @@ -98,7 +100,6 @@ namespace NCC.Extend.LqTkjlb |
| 98 | 100 | tksj = it.Tksj, |
| 99 | 101 | // tkry=it.Tkry, |
| 100 | 102 | tkry = SqlFunc.Subqueryable<UserEntity>().Where(u => u.MobilePhone == it.Tkry).Select(u => u.RealName), |
| 101 | - | |
| 102 | 103 | gkxm = it.Gkxm, |
| 103 | 104 | dhhm = it.Dhhm, |
| 104 | 105 | gmzs = it.Gmzs, |
| ... | ... | @@ -107,6 +108,8 @@ namespace NCC.Extend.LqTkjlb |
| 107 | 108 | bz = it.Bz, |
| 108 | 109 | ssmd = it.Ssmd, |
| 109 | 110 | sszd = it.Sszd, |
| 111 | + eventId = it.EventId, | |
| 112 | + eventName = SqlFunc.Subqueryable<LqEventEntity>().Where(u => u.Id == it.EventId).Select(u => u.EventName), | |
| 110 | 113 | }) |
| 111 | 114 | .MergeTable() |
| 112 | 115 | .OrderBy(sidx + " " + input.sort) |
| ... | ... | @@ -135,7 +138,12 @@ namespace NCC.Extend.LqTkjlb |
| 135 | 138 | var result = await _db.Ado.UseTranAsync(async () => |
| 136 | 139 | { |
| 137 | 140 | //通过input.eventId去查询拓客活动信息 |
| 138 | - var eventUserInfo = await _db.Queryable<LqEventUserEntity>().Where(u => u.EventId == input.eventId && u.UserId == input.tkry).FirstAsync(); | |
| 141 | + var eventUserInfoList = await _db.Queryable<LqEventUserEntity>().Where(u => u.EventId == input.eventId && u.UserId == input.tkry).ToListAsync(); | |
| 142 | + if (eventUserInfoList == null || eventUserInfoList.Count == 0) | |
| 143 | + { | |
| 144 | + throw NCCException.Oh("未找到对应的拓客活动用户信息,请确认活动ID和用户ID是否正确"); | |
| 145 | + } | |
| 146 | + var eventUserInfo = eventUserInfoList.First(); | |
| 139 | 147 | // 创建拓客记录 |
| 140 | 148 | var entity = input.Adapt<LqTkjlbEntity>(); |
| 141 | 149 | entity.Id = YitIdHelper.NextId().ToString(); | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqXhHyhkService.cs
| 1 | -using NCC.Common.Core.Manager; | |
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using System.Linq; | |
| 4 | +using System.Threading.Tasks; | |
| 5 | +using Mapster; | |
| 6 | +using Microsoft.AspNetCore.Mvc; | |
| 7 | +using Microsoft.Extensions.Logging; | |
| 8 | +using NCC.ClayObject; | |
| 9 | +using NCC.Common.Configuration; | |
| 10 | +using NCC.Common.Core.Manager; | |
| 2 | 11 | using NCC.Common.Enum; |
| 3 | 12 | using NCC.Common.Extension; |
| 4 | 13 | using NCC.Common.Filter; |
| 14 | +using NCC.Common.Helper; | |
| 15 | +using NCC.Common.Model.NPOI; | |
| 16 | +using NCC.DataEncryption; | |
| 5 | 17 | using NCC.Dependency; |
| 6 | 18 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | |
| 8 | -using NCC.Extend.Interfaces.LqXhHyhk; | |
| 9 | 19 | using NCC.Extend.Entitys.Dto.LqXhHyhk; |
| 10 | -using Mapster; | |
| 11 | -using Microsoft.AspNetCore.Mvc; | |
| 12 | -using SqlSugar; | |
| 13 | -using System; | |
| 14 | -using System.Collections.Generic; | |
| 15 | -using System.Linq; | |
| 16 | -using System.Threading.Tasks; | |
| 20 | +using NCC.Extend.Entitys.Dto.LqXhJksyj; | |
| 21 | +using NCC.Extend.Entitys.Dto.LqXhKjbsyj; | |
| 22 | +using NCC.Extend.Entitys.Dto.LqXhPxmx; | |
| 23 | +using NCC.Extend.Entitys.lq_kd_kdjlb; | |
| 24 | +using NCC.Extend.Entitys.lq_kd_pxmx; | |
| 25 | +using NCC.Extend.Entitys.lq_khxx; | |
| 17 | 26 | using NCC.Extend.Entitys.lq_xh_hyhk; |
| 18 | 27 | using NCC.Extend.Entitys.lq_xh_jksyj; |
| 19 | 28 | using NCC.Extend.Entitys.lq_xh_kjbsyj; |
| 20 | 29 | using NCC.Extend.Entitys.lq_xh_pxmx; |
| 21 | -using NCC.Extend.Entitys.lq_kd_pxmx; | |
| 22 | -using NCC.Extend.Entitys.lq_kd_kdjlb; | |
| 23 | -using NCC.Extend.Entitys.lq_khxx; | |
| 24 | -using Microsoft.Extensions.Logging; | |
| 25 | -using Yitter.IdGenerator; | |
| 26 | -using NCC.Common.Helper; | |
| 30 | +using NCC.Extend.Interfaces.LqXhHyhk; | |
| 31 | +using NCC.FriendlyException; | |
| 27 | 32 | using NCC.JsonSerialization; |
| 28 | -using NCC.Common.Model.NPOI; | |
| 29 | -using NCC.Common.Configuration; | |
| 30 | -using NCC.DataEncryption; | |
| 31 | -using NCC.ClayObject; | |
| 32 | -using NCC.Extend.Entitys.Dto.LqXhJksyj; | |
| 33 | -using NCC.Extend.Entitys.Dto.LqXhKjbsyj; | |
| 34 | -using NCC.Extend.Entitys.Dto.LqXhPxmx; | |
| 33 | +using SqlSugar; | |
| 34 | +using Yitter.IdGenerator; | |
| 35 | 35 | |
| 36 | 36 | namespace NCC.Extend.LqXhHyhk |
| 37 | 37 | { |
| ... | ... | @@ -59,7 +59,8 @@ namespace NCC.Extend.LqXhHyhk |
| 59 | 59 | ISqlSugarRepository<LqXhKjbsyjEntity> lqXhKjbsyjRepository, |
| 60 | 60 | ISqlSugarRepository<LqXhPxmxEntity> lqXhPxmxRepository, |
| 61 | 61 | IUserManager userManager, |
| 62 | - ILogger<LqXhHyhkService> logger) | |
| 62 | + ILogger<LqXhHyhkService> logger | |
| 63 | + ) | |
| 63 | 64 | { |
| 64 | 65 | _lqXhHyhkRepository = lqXhHyhkRepository; |
| 65 | 66 | _db = _lqXhHyhkRepository.Context; |
| ... | ... | @@ -77,7 +78,7 @@ namespace NCC.Extend.LqXhHyhk |
| 77 | 78 | /// <remarks> |
| 78 | 79 | /// 获取耗卡记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 |
| 79 | 80 | /// 按照耗卡的完整格式返回数据,不包含汇总信息 |
| 80 | - /// | |
| 81 | + /// | |
| 81 | 82 | /// 返回数据结构: |
| 82 | 83 | /// - 主表信息:耗卡基础信息、门店信息、会员信息等 |
| 83 | 84 | /// - 品项明细列表:每个品项包含完整的项目信息(项目次数、是否有效、来源类型等) |
| ... | ... | @@ -104,19 +105,13 @@ namespace NCC.Extend.LqXhHyhk |
| 104 | 105 | var output = entity.Adapt<LqXhHyhkInfoOutput>(); |
| 105 | 106 | |
| 106 | 107 | // 2. 查询品项明细列表 |
| 107 | - var lqXhPxmxList = await _db.Queryable<LqXhPxmxEntity>() | |
| 108 | - .Where(w => w.Glkdbh == entity.Id) | |
| 109 | - .ToListAsync(); | |
| 108 | + var lqXhPxmxList = await _db.Queryable<LqXhPxmxEntity>().Where(w => w.Glkdbh == entity.Id).ToListAsync(); | |
| 110 | 109 | |
| 111 | 110 | // 3. 查询健康师业绩列表 |
| 112 | - var lqXhJksyjList = await _db.Queryable<LqXhJksyjEntity>() | |
| 113 | - .Where(w => w.Glkdbh == entity.Id) | |
| 114 | - .ToListAsync(); | |
| 111 | + var lqXhJksyjList = await _db.Queryable<LqXhJksyjEntity>().Where(w => w.Glkdbh == entity.Id).ToListAsync(); | |
| 115 | 112 | |
| 116 | 113 | // 4. 查询科技部老师业绩列表 |
| 117 | - var lqXhKjbsyjList = await _db.Queryable<LqXhKjbsyjEntity>() | |
| 118 | - .Where(w => w.Glkdbh == entity.Id) | |
| 119 | - .ToListAsync(); | |
| 114 | + var lqXhKjbsyjList = await _db.Queryable<LqXhKjbsyjEntity>().Where(w => w.Glkdbh == entity.Id).ToListAsync(); | |
| 120 | 115 | |
| 121 | 116 | // 5. 构建品项明细输出,每个品项关联对应的业绩信息 |
| 122 | 117 | var pxmxOutputList = new List<LqXhPxmxInfoOutput>(); |
| ... | ... | @@ -135,7 +130,7 @@ namespace NCC.Extend.LqXhHyhk |
| 135 | 130 | projectNumber = pxmx.ProjectNumber, |
| 136 | 131 | isEnabled = pxmx.IsEnabled, |
| 137 | 132 | sourceType = pxmx.SourceType, |
| 138 | - totalPrice = pxmx.TotalPrice | |
| 133 | + totalPrice = pxmx.TotalPrice, | |
| 139 | 134 | }; |
| 140 | 135 | |
| 141 | 136 | // 关联该品项的健康师业绩 |
| ... | ... | @@ -209,7 +204,10 @@ namespace NCC.Extend.LqXhHyhk |
| 209 | 204 | sfykjb = it.Sfykjb, |
| 210 | 205 | hksj = it.Hksj, |
| 211 | 206 | czry = it.Czry, |
| 212 | - }).MergeTable().OrderBy(sidx + " " + input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | |
| 207 | + }) | |
| 208 | + .MergeTable() | |
| 209 | + .OrderBy(sidx + " " + input.sort) | |
| 210 | + .ToPagedListAsync(input.currentPage, input.pageSize); | |
| 213 | 211 | return PageResult<LqXhHyhkListOutput>.SqlSugarPageResult(data); |
| 214 | 212 | } |
| 215 | 213 | #endregion |
| ... | ... | @@ -220,7 +218,7 @@ namespace NCC.Extend.LqXhHyhk |
| 220 | 218 | /// </summary> |
| 221 | 219 | /// <remarks> |
| 222 | 220 | /// 创建会员耗卡记录及其关联的品项明细、健康师业绩、科技部老师业绩信息 |
| 223 | - /// | |
| 221 | + /// | |
| 224 | 222 | /// 示例请求: |
| 225 | 223 | /// ```json |
| 226 | 224 | /// { |
| ... | ... | @@ -245,7 +243,7 @@ namespace NCC.Extend.LqXhHyhk |
| 245 | 243 | /// ] |
| 246 | 244 | /// } |
| 247 | 245 | /// ``` |
| 248 | - /// | |
| 246 | + /// | |
| 249 | 247 | /// 参数说明: |
| 250 | 248 | /// - hyid: 会员ID |
| 251 | 249 | /// - hkmd: 耗卡门店 |
| ... | ... | @@ -262,8 +260,8 @@ namespace NCC.Extend.LqXhHyhk |
| 262 | 260 | var userInfo = await _userManager.GetUserInfo(); |
| 263 | 261 | var entity = input.Adapt<LqXhHyhkEntity>(); |
| 264 | 262 | entity.Id = YitIdHelper.NextId().ToString(); |
| 265 | - entity.Hksj = DateTime.Now; | |
| 266 | 263 | entity.Czry = _userManager.UserId; |
| 264 | + entity.CreateTime = DateTime.Now; | |
| 267 | 265 | try |
| 268 | 266 | { |
| 269 | 267 | // 开启事务 |
| ... | ... | @@ -296,47 +294,51 @@ namespace NCC.Extend.LqXhHyhk |
| 296 | 294 | SourceType = item.sourceType, |
| 297 | 295 | }; |
| 298 | 296 | allPxmxEntities.Add(lqXhPxmxEntity); |
| 299 | - | |
| 297 | + | |
| 300 | 298 | // 收集该品项关联的健康师业绩 |
| 301 | 299 | if (item.lqXhJksyjList != null && item.lqXhJksyjList.Any()) |
| 302 | 300 | { |
| 303 | 301 | foreach (var ijks_tem in item.lqXhJksyjList) |
| 304 | 302 | { |
| 305 | - allJksyjEntities.Add(new LqXhJksyjEntity | |
| 306 | - { | |
| 307 | - Id = YitIdHelper.NextId().ToString(), | |
| 308 | - Glkdbh = newEntity.Id, | |
| 309 | - Jks = ijks_tem.jks, | |
| 310 | - Jksxm = ijks_tem.jksxm, | |
| 311 | - Jkszh = ijks_tem.jkszh, | |
| 312 | - Jksyj = ijks_tem.jksyj, | |
| 313 | - Yjsj = DateTime.Now, | |
| 314 | - JsjId = ijks_tem.jsjId, | |
| 315 | - Kdpxid = lqXhPxmxEntity.Id, | |
| 316 | - LaborCost = ijks_tem.laborCost, | |
| 317 | - KdpxNumber = ijks_tem.kdpxNumber, | |
| 318 | - }); | |
| 303 | + allJksyjEntities.Add( | |
| 304 | + new LqXhJksyjEntity | |
| 305 | + { | |
| 306 | + Id = YitIdHelper.NextId().ToString(), | |
| 307 | + Glkdbh = newEntity.Id, | |
| 308 | + Jks = ijks_tem.jks, | |
| 309 | + Jksxm = ijks_tem.jksxm, | |
| 310 | + Jkszh = ijks_tem.jkszh, | |
| 311 | + Jksyj = ijks_tem.jksyj, | |
| 312 | + Yjsj = DateTime.Now, | |
| 313 | + JsjId = ijks_tem.jsjId, | |
| 314 | + Kdpxid = lqXhPxmxEntity.Id, | |
| 315 | + LaborCost = ijks_tem.laborCost, | |
| 316 | + KdpxNumber = ijks_tem.kdpxNumber, | |
| 317 | + } | |
| 318 | + ); | |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | - | |
| 321 | + | |
| 322 | 322 | // 收集该品项关联的科技部老师业绩 |
| 323 | 323 | if (item.lqXhKjbsyjList != null && item.lqXhKjbsyjList.Any()) |
| 324 | 324 | { |
| 325 | 325 | foreach (var ikjbs_tem in item.lqXhKjbsyjList) |
| 326 | 326 | { |
| 327 | - allKjbsyjEntities.Add(new LqXhKjbsyjEntity | |
| 328 | - { | |
| 329 | - Id = YitIdHelper.NextId().ToString(), | |
| 330 | - Glkdbh = newEntity.Id, | |
| 331 | - Kjbls = ikjbs_tem.kjbls, | |
| 332 | - Kjblsxm = ikjbs_tem.kjblsxm, | |
| 333 | - Kjblszh = ikjbs_tem.kjblszh, | |
| 334 | - Kjblsyj = ikjbs_tem.kjblsyj, | |
| 335 | - Yjsj = DateTime.Now, | |
| 336 | - Hkpxid = lqXhPxmxEntity.Id, | |
| 337 | - LaborCost = ikjbs_tem.laborCost, | |
| 338 | - HdpxNumber = ikjbs_tem.hdpxNumber, | |
| 339 | - }); | |
| 327 | + allKjbsyjEntities.Add( | |
| 328 | + new LqXhKjbsyjEntity | |
| 329 | + { | |
| 330 | + Id = YitIdHelper.NextId().ToString(), | |
| 331 | + Glkdbh = newEntity.Id, | |
| 332 | + Kjbls = ikjbs_tem.kjbls, | |
| 333 | + Kjblsxm = ikjbs_tem.kjblsxm, | |
| 334 | + Kjblszh = ikjbs_tem.kjblszh, | |
| 335 | + Kjblsyj = ikjbs_tem.kjblsyj, | |
| 336 | + Yjsj = DateTime.Now, | |
| 337 | + Hkpxid = lqXhPxmxEntity.Id, | |
| 338 | + LaborCost = ikjbs_tem.laborCost, | |
| 339 | + HdpxNumber = ikjbs_tem.hdpxNumber, | |
| 340 | + } | |
| 341 | + ); | |
| 340 | 342 | } |
| 341 | 343 | } |
| 342 | 344 | } |
| ... | ... | @@ -413,7 +415,10 @@ namespace NCC.Extend.LqXhHyhk |
| 413 | 415 | sfykjb = it.Sfykjb, |
| 414 | 416 | hksj = it.Hksj, |
| 415 | 417 | czry = it.Czry, |
| 416 | - }).MergeTable().OrderBy(sidx + " " + input.sort).ToListAsync(); | |
| 418 | + }) | |
| 419 | + .MergeTable() | |
| 420 | + .OrderBy(sidx + " " + input.sort) | |
| 421 | + .ToListAsync(); | |
| 417 | 422 | return data; |
| 418 | 423 | } |
| 419 | 424 | #endregion |
| ... | ... | @@ -438,7 +443,8 @@ namespace NCC.Extend.LqXhHyhk |
| 438 | 443 | { |
| 439 | 444 | exportData = await this.GetNoPagingList(input); |
| 440 | 445 | } |
| 441 | - List<ParamsModel> paramList = "[{\"value\":\"耗卡编号\",\"field\":\"id\"},{\"value\":\"门店\",\"field\":\"md\"},{\"value\":\"门店编号\",\"field\":\"mdbh\"},{\"value\":\"门店名称\",\"field\":\"mdmc\"},{\"value\":\"会员\",\"field\":\"hy\"},{\"value\":\"会员账号\",\"field\":\"hyzh\"},{\"value\":\"会员名称\",\"field\":\"hymc\"},{\"value\":\"顾客类型\",\"field\":\"gklx\"},{\"value\":\"消费金额\",\"field\":\"xfje\"},{\"value\":\"手工费用\",\"field\":\"sgfy\"},{\"value\":\"是否有科技部\",\"field\":\"sfykjb\"},{\"value\":\"耗卡时间\",\"field\":\"hksj\"},{\"value\":\"操作人员\",\"field\":\"czry\"},]".ToList<ParamsModel>(); | |
| 446 | + List<ParamsModel> paramList = | |
| 447 | + "[{\"value\":\"耗卡编号\",\"field\":\"id\"},{\"value\":\"门店\",\"field\":\"md\"},{\"value\":\"门店编号\",\"field\":\"mdbh\"},{\"value\":\"门店名称\",\"field\":\"mdmc\"},{\"value\":\"会员\",\"field\":\"hy\"},{\"value\":\"会员账号\",\"field\":\"hyzh\"},{\"value\":\"会员名称\",\"field\":\"hymc\"},{\"value\":\"顾客类型\",\"field\":\"gklx\"},{\"value\":\"消费金额\",\"field\":\"xfje\"},{\"value\":\"手工费用\",\"field\":\"sgfy\"},{\"value\":\"是否有科技部\",\"field\":\"sfykjb\"},{\"value\":\"耗卡时间\",\"field\":\"hksj\"},{\"value\":\"操作人员\",\"field\":\"czry\"},]".ToList<ParamsModel>(); | |
| 442 | 448 | ExcelConfig excelconfig = new ExcelConfig(); |
| 443 | 449 | excelconfig.FileName = "会员耗卡.xls"; |
| 444 | 450 | excelconfig.HeadFont = "微软雅黑"; |
| ... | ... | @@ -457,11 +463,7 @@ namespace NCC.Extend.LqXhHyhk |
| 457 | 463 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; |
| 458 | 464 | ExcelExportHelper<LqXhHyhkListOutput>.Export(exportData, excelconfig, addPath); |
| 459 | 465 | var fileName = _userManager.UserId + "|" + addPath + "|xls"; |
| 460 | - var output = new | |
| 461 | - { | |
| 462 | - name = excelconfig.FileName, | |
| 463 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 464 | - }; | |
| 466 | + var output = new { name = excelconfig.FileName, url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") }; | |
| 465 | 467 | return output; |
| 466 | 468 | } |
| 467 | 469 | #endregion |
| ... | ... | @@ -521,7 +523,7 @@ namespace NCC.Extend.LqXhHyhk |
| 521 | 523 | { |
| 522 | 524 | //开启事务 |
| 523 | 525 | _db.BeginTran(); |
| 524 | - | |
| 526 | + entity.UpdateTime = DateTime.Now; | |
| 525 | 527 | //更新会员耗卡记录 |
| 526 | 528 | await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); |
| 527 | 529 | |
| ... | ... | @@ -559,47 +561,51 @@ namespace NCC.Extend.LqXhHyhk |
| 559 | 561 | SourceType = item.sourceType, |
| 560 | 562 | }; |
| 561 | 563 | allPxmxEntities.Add(lqXhPxmxEntity); |
| 562 | - | |
| 564 | + | |
| 563 | 565 | // 收集该品项关联的健康师业绩 |
| 564 | 566 | if (item.lqXhJksyjList != null && item.lqXhJksyjList.Any()) |
| 565 | 567 | { |
| 566 | 568 | foreach (var ijks_tem in item.lqXhJksyjList) |
| 567 | 569 | { |
| 568 | - allJksyjEntities.Add(new LqXhJksyjEntity | |
| 569 | - { | |
| 570 | - Id = YitIdHelper.NextId().ToString(), | |
| 571 | - Glkdbh = entity.Id, | |
| 572 | - Jks = ijks_tem.jks, | |
| 573 | - Jksxm = ijks_tem.jksxm, | |
| 574 | - Jkszh = ijks_tem.jkszh, | |
| 575 | - Jksyj = ijks_tem.jksyj, | |
| 576 | - Yjsj = DateTime.Now, | |
| 577 | - JsjId = ijks_tem.jsjId, | |
| 578 | - Kdpxid = lqXhPxmxEntity.Id, | |
| 579 | - LaborCost = ijks_tem.laborCost, | |
| 580 | - KdpxNumber = ijks_tem.kdpxNumber, | |
| 581 | - }); | |
| 570 | + allJksyjEntities.Add( | |
| 571 | + new LqXhJksyjEntity | |
| 572 | + { | |
| 573 | + Id = YitIdHelper.NextId().ToString(), | |
| 574 | + Glkdbh = entity.Id, | |
| 575 | + Jks = ijks_tem.jks, | |
| 576 | + Jksxm = ijks_tem.jksxm, | |
| 577 | + Jkszh = ijks_tem.jkszh, | |
| 578 | + Jksyj = ijks_tem.jksyj, | |
| 579 | + Yjsj = DateTime.Now, | |
| 580 | + JsjId = ijks_tem.jsjId, | |
| 581 | + Kdpxid = lqXhPxmxEntity.Id, | |
| 582 | + LaborCost = ijks_tem.laborCost, | |
| 583 | + KdpxNumber = ijks_tem.kdpxNumber, | |
| 584 | + } | |
| 585 | + ); | |
| 582 | 586 | } |
| 583 | 587 | } |
| 584 | - | |
| 588 | + | |
| 585 | 589 | // 收集该品项关联的科技部老师业绩 |
| 586 | 590 | if (item.lqXhKjbsyjList != null && item.lqXhKjbsyjList.Any()) |
| 587 | 591 | { |
| 588 | 592 | foreach (var ikjbs_tem in item.lqXhKjbsyjList) |
| 589 | 593 | { |
| 590 | - allKjbsyjEntities.Add(new LqXhKjbsyjEntity | |
| 591 | - { | |
| 592 | - Id = YitIdHelper.NextId().ToString(), | |
| 593 | - Glkdbh = entity.Id, | |
| 594 | - Kjbls = ikjbs_tem.kjbls, | |
| 595 | - Kjblsxm = ikjbs_tem.kjblsxm, | |
| 596 | - Kjblszh = ikjbs_tem.kjblszh, | |
| 597 | - Kjblsyj = ikjbs_tem.kjblsyj, | |
| 598 | - Yjsj = DateTime.Now, | |
| 599 | - Hkpxid = lqXhPxmxEntity.Id, | |
| 600 | - LaborCost = ikjbs_tem.laborCost, | |
| 601 | - HdpxNumber = ikjbs_tem.hdpxNumber, | |
| 602 | - }); | |
| 594 | + allKjbsyjEntities.Add( | |
| 595 | + new LqXhKjbsyjEntity | |
| 596 | + { | |
| 597 | + Id = YitIdHelper.NextId().ToString(), | |
| 598 | + Glkdbh = entity.Id, | |
| 599 | + Kjbls = ikjbs_tem.kjbls, | |
| 600 | + Kjblsxm = ikjbs_tem.kjblsxm, | |
| 601 | + Kjblszh = ikjbs_tem.kjblszh, | |
| 602 | + Kjblsyj = ikjbs_tem.kjblsyj, | |
| 603 | + Yjsj = DateTime.Now, | |
| 604 | + Hkpxid = lqXhPxmxEntity.Id, | |
| 605 | + LaborCost = ikjbs_tem.laborCost, | |
| 606 | + HdpxNumber = ikjbs_tem.hdpxNumber, | |
| 607 | + } | |
| 608 | + ); | |
| 603 | 609 | } |
| 604 | 610 | } |
| 605 | 611 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqYcsdJsjService.cs
| 1 | 1 | using System; |
| 2 | 2 | using System.Collections.Generic; |
| 3 | +using System.ComponentModel.DataAnnotations; | |
| 3 | 4 | using System.Globalization; |
| 4 | 5 | using System.Linq; |
| 5 | 6 | using System.Threading.Tasks; |
| ... | ... | @@ -81,7 +82,7 @@ namespace NCC.Extend.LqYcsdJsj |
| 81 | 82 | var output = entity.Adapt<LqYcsdJsjInfoOutput>(); |
| 82 | 83 | |
| 83 | 84 | // 获取成员信息 |
| 84 | - var members = await _db.Queryable<LqJinsanjiaoUserEntity>() | |
| 85 | + var members = await _db.Queryable<NCC.Extend.Entitys.lq_jinsanjiao_user.LqJinsanjiaoUserEntity>() | |
| 85 | 86 | .Where(x => x.JsjId == id && x.Status == "ACTIVE") |
| 86 | 87 | .OrderBy(x => x.SortOrder) |
| 87 | 88 | .Select(x => new |
| ... | ... | @@ -194,6 +195,81 @@ namespace NCC.Extend.LqYcsdJsj |
| 194 | 195 | } |
| 195 | 196 | #endregion |
| 196 | 197 | |
| 198 | + #region 根据用户和月份获取金三角信息 | |
| 199 | + /// <summary> | |
| 200 | + /// 根据用户和时间获取金三角信息 | |
| 201 | + /// </summary> | |
| 202 | + /// <remarks> | |
| 203 | + /// 根据指定的用户ID和时间,从时间中提取月份,查询该用户在该月份的金三角信息。 | |
| 204 | + /// | |
| 205 | + /// 示例请求: | |
| 206 | + /// GET /api/Extend/LqYcsdJsj/GetJsjInfoByUserMonth?userId=123456&dateTime=2024-12-15%2014:30:00 | |
| 207 | + /// | |
| 208 | + /// 参数说明: | |
| 209 | + /// - userId: 用户ID,必填 | |
| 210 | + /// - dateTime: 时间,格式为yyyy-MM-dd HH:mm:ss,必填 | |
| 211 | + /// | |
| 212 | + /// 返回信息包括: | |
| 213 | + /// - 金三角基本信息(ID、名称、月份) | |
| 214 | + /// - 门店信息(ID、名称) | |
| 215 | + /// - 用户信息(ID、姓名、是否顾问、状态、排序) | |
| 216 | + /// </remarks> | |
| 217 | + /// <param name="input">查询参数</param> | |
| 218 | + /// <returns>金三角信息</returns> | |
| 219 | + /// <response code="200">查询成功</response> | |
| 220 | + /// <response code="400">参数错误</response> | |
| 221 | + /// <response code="404">未找到相关数据</response> | |
| 222 | + [HttpGet("GetJsjInfoByUserMonth")] | |
| 223 | + public async Task<LqYcsdJsjByUserMonthOutput> GetJsjInfoByUserMonth([FromQuery] LqYcsdJsjByUserMonthInput input) | |
| 224 | + { | |
| 225 | + if (string.IsNullOrEmpty(input.UserId)) | |
| 226 | + { | |
| 227 | + throw NCCException.Oh(ErrorCode.COM1001, "用户ID不能为空"); | |
| 228 | + } | |
| 229 | + | |
| 230 | + if (input.DateTime == default(DateTime)) | |
| 231 | + { | |
| 232 | + throw NCCException.Oh(ErrorCode.COM1001, "时间不能为空"); | |
| 233 | + } | |
| 234 | + | |
| 235 | + // 从时间中提取月份(格式:yyyyMM) | |
| 236 | + var month = input.DateTime.ToString("yyyyMM"); | |
| 237 | + | |
| 238 | + // 先查询用户的金三角关联信息 | |
| 239 | + var jsjUser = await _db.Queryable<NCC.Extend.Entitys.lq_jinsanjiao_user.LqJinsanjiaoUserEntity>().Where(x => x.UserId == input.UserId && x.DeleteMark == 0).FirstAsync(); | |
| 240 | + | |
| 241 | + if (jsjUser == null) | |
| 242 | + { | |
| 243 | + return null; | |
| 244 | + } | |
| 245 | + | |
| 246 | + // 查询金三角信息 | |
| 247 | + var jsj = await _db.Queryable<LqYcsdJsjEntity>().Where(x => x.Id == jsjUser.JsjId && x.Yf == month).FirstAsync(); | |
| 248 | + | |
| 249 | + if (jsj == null) | |
| 250 | + { | |
| 251 | + return null; | |
| 252 | + } | |
| 253 | + | |
| 254 | + // 查询门店信息 | |
| 255 | + var store = await _db.Queryable<LqMdxxEntity>().Where(x => x.Id == jsj.Md).FirstAsync(); | |
| 256 | + | |
| 257 | + return new LqYcsdJsjByUserMonthOutput | |
| 258 | + { | |
| 259 | + JsjId = jsj.Id, | |
| 260 | + JsjName = jsj.Jsj, | |
| 261 | + Month = jsj.Yf, | |
| 262 | + StoreId = jsj.Md, | |
| 263 | + StoreName = store?.Dm, | |
| 264 | + UserId = jsjUser.UserId, | |
| 265 | + UserName = jsjUser.UserName, | |
| 266 | + IsLeader = jsjUser.IsLeader, | |
| 267 | + Status = jsjUser.Status, | |
| 268 | + SortOrder = jsjUser.SortOrder, | |
| 269 | + }; | |
| 270 | + } | |
| 271 | + #endregion | |
| 272 | + | |
| 197 | 273 | #region 新建金三角 |
| 198 | 274 | /// <summary> |
| 199 | 275 | /// 新建金三角 |
| ... | ... | @@ -474,7 +550,7 @@ namespace NCC.Extend.LqYcsdJsj |
| 474 | 550 | } |
| 475 | 551 | |
| 476 | 552 | var query = _db.Queryable<LqYcsdJsjEntity>() |
| 477 | - .LeftJoin<LqKdJksyjEntity>((jsj, jksyj) => jsj.Id == jksyj.Jsj_id) | |
| 553 | + .LeftJoin<NCC.Extend.Entitys.lq_kd_jksyj.LqKdJksyjEntity>((jsj, jksyj) => jsj.Id == jksyj.Jsj_id) | |
| 478 | 554 | .LeftJoin<LqMdxxEntity>((jsj, jksyj, md) => jsj.Md == md.Id) |
| 479 | 555 | .Where((jsj, jksyj, md) => jsj.Yf == month) |
| 480 | 556 | .Where((jsj, jksyj, md) => jksyj.Yjsj != null) |
| ... | ... | @@ -603,12 +679,12 @@ namespace NCC.Extend.LqYcsdJsj |
| 603 | 679 | /// <returns></returns> |
| 604 | 680 | private async Task CreateJsjMembers(string jsjId, List<JsjMemberInput> members, string creatorUserId) |
| 605 | 681 | { |
| 606 | - var memberEntities = new List<LqJinsanjiaoUserEntity>(); | |
| 682 | + var memberEntities = new List<NCC.Extend.Entitys.lq_jinsanjiao_user.LqJinsanjiaoUserEntity>(); | |
| 607 | 683 | |
| 608 | 684 | for (int i = 0; i < members.Count; i++) |
| 609 | 685 | { |
| 610 | 686 | var member = members[i]; |
| 611 | - var memberEntity = new LqJinsanjiaoUserEntity | |
| 687 | + var memberEntity = new NCC.Extend.Entitys.lq_jinsanjiao_user.LqJinsanjiaoUserEntity | |
| 612 | 688 | { |
| 613 | 689 | Id = YitIdHelper.NextId().ToString(), |
| 614 | 690 | JsjId = jsjId, | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqYyjlService.cs
| 1 | -using NCC.Common.Core.Manager; | |
| 1 | +using System; | |
| 2 | +using System.Collections.Generic; | |
| 3 | +using System.Linq; | |
| 4 | +using System.Threading.Tasks; | |
| 5 | +using Mapster; | |
| 6 | +using Microsoft.AspNetCore.Mvc; | |
| 7 | +using NCC.ClayObject; | |
| 8 | +using NCC.Common.Configuration; | |
| 9 | +using NCC.Common.Core.Manager; | |
| 2 | 10 | using NCC.Common.Enum; |
| 3 | 11 | using NCC.Common.Extension; |
| 4 | 12 | using NCC.Common.Filter; |
| 13 | +using NCC.Common.Helper; | |
| 14 | +using NCC.Common.Model.NPOI; | |
| 15 | +using NCC.DataEncryption; | |
| 5 | 16 | using NCC.Dependency; |
| 6 | 17 | using NCC.DynamicApiController; |
| 7 | -using NCC.FriendlyException; | |
| 18 | +using NCC.Extend.Entitys.Dto.LqYyjl; | |
| 19 | +using NCC.Extend.Entitys.lq_yyjl; | |
| 8 | 20 | using NCC.Extend.Interfaces.LqYyjl; |
| 9 | -using Mapster; | |
| 10 | -using Microsoft.AspNetCore.Mvc; | |
| 21 | +using NCC.FriendlyException; | |
| 22 | +using NCC.JsonSerialization; | |
| 11 | 23 | using SqlSugar; |
| 12 | -using System; | |
| 13 | -using System.Collections.Generic; | |
| 14 | -using System.Linq; | |
| 15 | -using System.Threading.Tasks; | |
| 16 | -using NCC.Extend.Entitys.lq_yyjl; | |
| 17 | -using NCC.Extend.Entitys.Dto.LqYyjl; | |
| 18 | 24 | using Yitter.IdGenerator; |
| 19 | -using NCC.Common.Helper; | |
| 20 | -using NCC.JsonSerialization; | |
| 21 | -using NCC.Common.Model.NPOI; | |
| 22 | -using NCC.Common.Configuration; | |
| 23 | -using NCC.DataEncryption; | |
| 24 | -using NCC.ClayObject; | |
| 25 | 25 | |
| 26 | 26 | namespace NCC.Extend.LqYyjl |
| 27 | 27 | { |
| 28 | 28 | /// <summary> |
| 29 | 29 | /// 预约记录服务 |
| 30 | 30 | /// </summary> |
| 31 | - [ApiDescriptionSettings(Tag = "Extend",Name = "LqYyjl", Order = 200)] | |
| 31 | + [ApiDescriptionSettings(Tag = "Extend", Name = "LqYyjl", Order = 200)] | |
| 32 | 32 | [Route("api/Extend/[controller]")] |
| 33 | 33 | public class LqYyjlService : ILqYyjlService, IDynamicApiController, ITransient |
| 34 | 34 | { |
| ... | ... | @@ -39,11 +39,9 @@ namespace NCC.Extend.LqYyjl |
| 39 | 39 | /// <summary> |
| 40 | 40 | /// 初始化一个<see cref="LqYyjlService"/>类型的新实例 |
| 41 | 41 | /// </summary> |
| 42 | - public LqYyjlService( | |
| 43 | - ISqlSugarRepository<LqYyjlEntity> lqYyjlRepository, | |
| 44 | - IUserManager userManager) | |
| 42 | + public LqYyjlService(ISqlSugarRepository<LqYyjlEntity> lqYyjlRepository, IUserManager userManager) | |
| 45 | 43 | { |
| 46 | - _lqYyjlRepository = lqYyjlRepository; | |
| 44 | + _lqYyjlRepository = lqYyjlRepository; | |
| 47 | 45 | _db = _lqYyjlRepository.Context; |
| 48 | 46 | _userManager = userManager; |
| 49 | 47 | } |
| ... | ... | @@ -62,10 +60,10 @@ namespace NCC.Extend.LqYyjl |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | 62 | /// <summary> |
| 65 | - /// 获取预约记录列表 | |
| 66 | - /// </summary> | |
| 67 | - /// <param name="input">请求参数</param> | |
| 68 | - /// <returns></returns> | |
| 63 | + /// 获取预约记录列表 | |
| 64 | + /// </summary> | |
| 65 | + /// <param name="input">请求参数</param> | |
| 66 | + /// <returns></returns> | |
| 69 | 67 | [HttpGet("")] |
| 70 | 68 | public async Task<dynamic> GetList([FromQuery] LqYyjlListQueryInput input) |
| 71 | 69 | { |
| ... | ... | @@ -96,23 +94,26 @@ namespace NCC.Extend.LqYyjl |
| 96 | 94 | .WhereIF(queryYyjs != null, p => p.Yyjs >= new DateTime(startYyjs.ToDate().Year, startYyjs.ToDate().Month, startYyjs.ToDate().Day, 0, 0, 0)) |
| 97 | 95 | .WhereIF(queryYyjs != null, p => p.Yyjs <= new DateTime(endYyjs.ToDate().Year, endYyjs.ToDate().Month, endYyjs.ToDate().Day, 23, 59, 59)) |
| 98 | 96 | .WhereIF(!string.IsNullOrEmpty(input.F_Status), p => p.F_Status.Equals(input.F_Status)) |
| 99 | - .Select(it=> new LqYyjlListOutput | |
| 97 | + .Select(it => new LqYyjlListOutput | |
| 100 | 98 | { |
| 101 | 99 | id = it.Id, |
| 102 | - djmd=it.Djmd, | |
| 103 | - yyr=it.Yyr, | |
| 104 | - gklx=it.Gklx, | |
| 105 | - yytyxm=it.Yytyxm, | |
| 106 | - czr=it.Czr, | |
| 107 | - czsj=it.Czsj, | |
| 108 | - gk=it.Gk, | |
| 109 | - gkxm=it.Gkxm, | |
| 110 | - yyjks=it.Yyjks, | |
| 111 | - yysj=it.Yysj, | |
| 112 | - yyjs=it.Yyjs, | |
| 113 | - F_Status=it.F_Status, | |
| 114 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToPagedListAsync(input.currentPage, input.pageSize); | |
| 115 | - return PageResult<LqYyjlListOutput>.SqlSugarPageResult(data); | |
| 100 | + djmd = it.Djmd, | |
| 101 | + yyr = it.Yyr, | |
| 102 | + gklx = it.Gklx, | |
| 103 | + yytyxm = it.Yytyxm, | |
| 104 | + czr = it.Czr, | |
| 105 | + czsj = it.Czsj, | |
| 106 | + gk = it.Gk, | |
| 107 | + gkxm = it.Gkxm, | |
| 108 | + yyjks = it.Yyjks, | |
| 109 | + yysj = it.Yysj, | |
| 110 | + yyjs = it.Yyjs, | |
| 111 | + F_Status = it.F_Status, | |
| 112 | + }) | |
| 113 | + .MergeTable() | |
| 114 | + .OrderBy(sidx + " " + input.sort) | |
| 115 | + .ToPagedListAsync(input.currentPage, input.pageSize); | |
| 116 | + return PageResult<LqYyjlListOutput>.SqlSugarPageResult(data); | |
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | /// <summary> |
| ... | ... | @@ -127,16 +128,17 @@ namespace NCC.Extend.LqYyjl |
| 127 | 128 | var entity = input.Adapt<LqYyjlEntity>(); |
| 128 | 129 | entity.Id = YitIdHelper.NextId().ToString(); |
| 129 | 130 | entity.Czr = _userManager.UserId; |
| 130 | - entity.Czsj = DateTime.Now; | |
| 131 | + entity.Czsj = DateTime.Now; | |
| 131 | 132 | var isOk = await _db.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandAsync(); |
| 132 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1000); | |
| 133 | + if (!(isOk > 0)) | |
| 134 | + throw NCCException.Oh(ErrorCode.COM1000); | |
| 133 | 135 | } |
| 134 | 136 | |
| 135 | 137 | /// <summary> |
| 136 | - /// 获取预约记录无分页列表 | |
| 137 | - /// </summary> | |
| 138 | - /// <param name="input">请求参数</param> | |
| 139 | - /// <returns></returns> | |
| 138 | + /// 获取预约记录无分页列表 | |
| 139 | + /// </summary> | |
| 140 | + /// <param name="input">请求参数</param> | |
| 141 | + /// <returns></returns> | |
| 140 | 142 | [NonAction] |
| 141 | 143 | public async Task<dynamic> GetNoPagingList([FromQuery] LqYyjlListQueryInput input) |
| 142 | 144 | { |
| ... | ... | @@ -167,30 +169,33 @@ namespace NCC.Extend.LqYyjl |
| 167 | 169 | .WhereIF(queryYyjs != null, p => p.Yyjs >= new DateTime(startYyjs.ToDate().Year, startYyjs.ToDate().Month, startYyjs.ToDate().Day, 0, 0, 0)) |
| 168 | 170 | .WhereIF(queryYyjs != null, p => p.Yyjs <= new DateTime(endYyjs.ToDate().Year, endYyjs.ToDate().Month, endYyjs.ToDate().Day, 23, 59, 59)) |
| 169 | 171 | .WhereIF(!string.IsNullOrEmpty(input.F_Status), p => p.F_Status.Equals(input.F_Status)) |
| 170 | - .Select(it=> new LqYyjlListOutput | |
| 172 | + .Select(it => new LqYyjlListOutput | |
| 171 | 173 | { |
| 172 | 174 | id = it.Id, |
| 173 | - djmd=it.Djmd, | |
| 174 | - yyr=it.Yyr, | |
| 175 | - gklx=it.Gklx, | |
| 176 | - yytyxm=it.Yytyxm, | |
| 177 | - czr=it.Czr, | |
| 178 | - czsj=it.Czsj, | |
| 179 | - gk=it.Gk, | |
| 180 | - gkxm=it.Gkxm, | |
| 181 | - yyjks=it.Yyjks, | |
| 182 | - yysj=it.Yysj, | |
| 183 | - yyjs=it.Yyjs, | |
| 184 | - F_Status=it.F_Status, | |
| 185 | - }).MergeTable().OrderBy(sidx+" "+input.sort).ToListAsync(); | |
| 186 | - return data; | |
| 175 | + djmd = it.Djmd, | |
| 176 | + yyr = it.Yyr, | |
| 177 | + gklx = it.Gklx, | |
| 178 | + yytyxm = it.Yytyxm, | |
| 179 | + czr = it.Czr, | |
| 180 | + czsj = it.Czsj, | |
| 181 | + gk = it.Gk, | |
| 182 | + gkxm = it.Gkxm, | |
| 183 | + yyjks = it.Yyjks, | |
| 184 | + yysj = it.Yysj, | |
| 185 | + yyjs = it.Yyjs, | |
| 186 | + F_Status = it.F_Status, | |
| 187 | + }) | |
| 188 | + .MergeTable() | |
| 189 | + .OrderBy(sidx + " " + input.sort) | |
| 190 | + .ToListAsync(); | |
| 191 | + return data; | |
| 187 | 192 | } |
| 188 | 193 | |
| 189 | 194 | /// <summary> |
| 190 | - /// 导出预约记录 | |
| 191 | - /// </summary> | |
| 192 | - /// <param name="input">请求参数</param> | |
| 193 | - /// <returns></returns> | |
| 195 | + /// 导出预约记录 | |
| 196 | + /// </summary> | |
| 197 | + /// <param name="input">请求参数</param> | |
| 198 | + /// <returns></returns> | |
| 194 | 199 | [HttpGet("Actions/Export")] |
| 195 | 200 | public async Task<dynamic> Export([FromQuery] LqYyjlListQueryInput input) |
| 196 | 201 | { |
| ... | ... | @@ -205,7 +210,8 @@ namespace NCC.Extend.LqYyjl |
| 205 | 210 | { |
| 206 | 211 | exportData = await this.GetNoPagingList(input); |
| 207 | 212 | } |
| 208 | - List<ParamsModel> paramList = "[{\"value\":\"预约编号\",\"field\":\"id\"},{\"value\":\"单据门店\",\"field\":\"djmd\"},{\"value\":\"邀约人\",\"field\":\"yyr\"},{\"value\":\"顾客姓名\",\"field\":\"gkxm\"},{\"value\":\"操作人\",\"field\":\"czr\"},{\"value\":\"操作时间\",\"field\":\"czsj\"},{\"value\":\"预约体验项目\",\"field\":\"yytyxm\"},{\"value\":\"顾客类型\",\"field\":\"gklx\"},{\"value\":\"预约健康师\",\"field\":\"yyjks\"},{\"value\":\"预约开始时间\",\"field\":\"yysj\"},{\"value\":\"预约结束时间\",\"field\":\"yyjs\"},{\"value\":\"顾客\",\"field\":\"gk\"},{\"value\":\"预约状态\",\"field\":\"F_Status\"},]".ToList<ParamsModel>(); | |
| 213 | + List<ParamsModel> paramList = | |
| 214 | + "[{\"value\":\"预约编号\",\"field\":\"id\"},{\"value\":\"单据门店\",\"field\":\"djmd\"},{\"value\":\"邀约人\",\"field\":\"yyr\"},{\"value\":\"顾客姓名\",\"field\":\"gkxm\"},{\"value\":\"操作人\",\"field\":\"czr\"},{\"value\":\"操作时间\",\"field\":\"czsj\"},{\"value\":\"预约体验项目\",\"field\":\"yytyxm\"},{\"value\":\"顾客类型\",\"field\":\"gklx\"},{\"value\":\"预约健康师\",\"field\":\"yyjks\"},{\"value\":\"预约开始时间\",\"field\":\"yysj\"},{\"value\":\"预约结束时间\",\"field\":\"yyjs\"},{\"value\":\"顾客\",\"field\":\"gk\"},{\"value\":\"预约状态\",\"field\":\"F_Status\"},]".ToList<ParamsModel>(); | |
| 209 | 215 | ExcelConfig excelconfig = new ExcelConfig(); |
| 210 | 216 | excelconfig.FileName = "预约记录.xls"; |
| 211 | 217 | excelconfig.HeadFont = "微软雅黑"; |
| ... | ... | @@ -224,11 +230,7 @@ namespace NCC.Extend.LqYyjl |
| 224 | 230 | var addPath = FileVariable.TemporaryFilePath + excelconfig.FileName; |
| 225 | 231 | ExcelExportHelper<LqYyjlListOutput>.Export(exportData, excelconfig, addPath); |
| 226 | 232 | var fileName = _userManager.UserId + "|" + addPath + "|xls"; |
| 227 | - var output = new | |
| 228 | - { | |
| 229 | - name = excelconfig.FileName, | |
| 230 | - url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 231 | - }; | |
| 233 | + var output = new { name = excelconfig.FileName, url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") }; | |
| 232 | 234 | return output; |
| 233 | 235 | } |
| 234 | 236 | |
| ... | ... | @@ -248,7 +250,7 @@ namespace NCC.Extend.LqYyjl |
| 248 | 250 | //开启事务 |
| 249 | 251 | _db.BeginTran(); |
| 250 | 252 | //批量删除预约记录 |
| 251 | - await _db.Deleteable<LqYyjlEntity>().In(d => d.Id,ids).ExecuteCommandAsync(); | |
| 253 | + await _db.Deleteable<LqYyjlEntity>().In(d => d.Id, ids).ExecuteCommandAsync(); | |
| 252 | 254 | //关闭事务 |
| 253 | 255 | _db.CommitTran(); |
| 254 | 256 | } |
| ... | ... | @@ -272,7 +274,8 @@ namespace NCC.Extend.LqYyjl |
| 272 | 274 | { |
| 273 | 275 | var entity = input.Adapt<LqYyjlEntity>(); |
| 274 | 276 | var isOk = await _db.Updateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); |
| 275 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1001); | |
| 277 | + if (!(isOk > 0)) | |
| 278 | + throw NCCException.Oh(ErrorCode.COM1001); | |
| 276 | 279 | } |
| 277 | 280 | |
| 278 | 281 | /// <summary> |
| ... | ... | @@ -285,7 +288,8 @@ namespace NCC.Extend.LqYyjl |
| 285 | 288 | var entity = await _db.Queryable<LqYyjlEntity>().FirstAsync(p => p.Id == id); |
| 286 | 289 | _ = entity ?? throw NCCException.Oh(ErrorCode.COM1005); |
| 287 | 290 | var isOk = await _db.Deleteable<LqYyjlEntity>().Where(d => d.Id == id).ExecuteCommandAsync(); |
| 288 | - if (!(isOk > 0)) throw NCCException.Oh(ErrorCode.COM1002); | |
| 291 | + if (!(isOk > 0)) | |
| 292 | + throw NCCException.Oh(ErrorCode.COM1002); | |
| 289 | 293 | } |
| 290 | 294 | } |
| 291 | 295 | } | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/NCC.Extend.csproj
| 1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
| 2 | - | |
| 3 | - <PropertyGroup> | |
| 4 | - <TargetFramework>net6.0</TargetFramework> | |
| 5 | - </PropertyGroup> | |
| 6 | - | |
| 7 | - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
| 8 | - <DocumentationFile>bin\Debug\$(AssemblyName).xml</DocumentationFile> | |
| 9 | - </PropertyGroup> | |
| 10 | - | |
| 11 | - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |
| 12 | - <DocumentationFile>bin\Release\$(AssemblyName).xml</DocumentationFile> | |
| 13 | - </PropertyGroup> | |
| 14 | - | |
| 15 | - <ItemGroup> | |
| 16 | - <ProjectReference Include="..\..\Common\NCC.Common.Core\NCC.Common.Core.csproj" /> | |
| 17 | - <ProjectReference Include="..\NCC.Extend.Interfaces\NCC.Extend.Interfaces.csproj" /> | |
| 18 | - </ItemGroup> | |
| 19 | - | |
| 20 | - <ItemGroup> | |
| 21 | - <PackageReference Include="EPPlus" Version="6.2.10" /> | |
| 22 | - </ItemGroup> | |
| 23 | - | |
| 2 | + <PropertyGroup> | |
| 3 | + <TargetFramework>net6.0</TargetFramework> | |
| 4 | + </PropertyGroup> | |
| 5 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
| 6 | + <DocumentationFile>bin\Debug\$(AssemblyName).xml</DocumentationFile> | |
| 7 | + </PropertyGroup> | |
| 8 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |
| 9 | + <DocumentationFile>bin\Release\$(AssemblyName).xml</DocumentationFile> | |
| 10 | + </PropertyGroup> | |
| 11 | + <ItemGroup> | |
| 12 | + <ProjectReference Include="..\..\Common\NCC.Common.Core\NCC.Common.Core.csproj" /> | |
| 13 | + <ProjectReference Include="..\NCC.Extend.Interfaces\NCC.Extend.Interfaces.csproj" /> | |
| 14 | + <ProjectReference Include="..\NCC.Extend.Entitys\NCC.Extend.Entitys.csproj" /> | |
| 15 | + </ItemGroup> | |
| 16 | + <ItemGroup> | |
| 17 | + <PackageReference Include="EPPlus" Version="6.2.10" /> | |
| 18 | + </ItemGroup> | |
| 24 | 19 | </Project> | ... | ... |
金三角业绩统计接口说明.md
0 → 100644
| 1 | +# 金三角业绩统计接口说明 | |
| 2 | + | |
| 3 | +## 接口概述 | |
| 4 | +新增了金三角业绩统计查询接口,根据金三角成员状态进行不同的统计方式。 | |
| 5 | + | |
| 6 | +## 接口地址 | |
| 7 | +``` | |
| 8 | +GET /api/Extend/LqYcsdJsj/GetJsjPerformance | |
| 9 | +``` | |
| 10 | + | |
| 11 | +## 功能说明 | |
| 12 | +根据金三角成员状态进行不同的统计方式: | |
| 13 | +1. **活跃成员**:业绩计入金三角总业绩 | |
| 14 | +2. **非活跃成员**:按单人业绩统计,金三角名称为"门店名+姓名" | |
| 15 | + | |
| 16 | +## 请求参数 | |
| 17 | +| 参数名 | 类型 | 必填 | 说明 | | |
| 18 | +|--------|------|------|------| | |
| 19 | +| startMonth | string | 否 | 开始月份,格式:yyyyMM | | |
| 20 | +| endMonth | string | 否 | 结束月份,格式:yyyyMM | | |
| 21 | +| jsjId | string | 否 | 金三角ID,用于查询特定金三角 | | |
| 22 | +| storeId | string | 否 | 门店ID,用于查询特定门店 | | |
| 23 | + | |
| 24 | +## 响应参数 | |
| 25 | +| 字段名 | 类型 | 说明 | | |
| 26 | +|--------|------|------| | |
| 27 | +| JsjId | string | 金三角ID(非活跃成员时为用户ID) | | |
| 28 | +| JsjName | string | 金三角名称(非活跃成员时为"门店名+姓名") | | |
| 29 | +| Month | string | 月份(格式:yyyyMM) | | |
| 30 | +| StoreId | string | 门店ID | | |
| 31 | +| StoreName | string | 门店名称 | | |
| 32 | +| OrderCount | int | 订单数量 | | |
| 33 | +| TotalPerformance | decimal | 总业绩 | | |
| 34 | +| LastOrderDate | DateTime? | 最后订单日期 | | |
| 35 | +| FirstOrderDate | DateTime? | 首次订单日期 | | |
| 36 | +| StatisticsType | string | 统计类型(ACTIVE-活跃金三角业绩,INACTIVE-单人业绩) | | |
| 37 | +| MemberName | string | 成员姓名(仅单人业绩时使用) | | |
| 38 | + | |
| 39 | +## 示例请求 | |
| 40 | +``` | |
| 41 | +GET /api/Extend/LqYcsdJsj/GetJsjPerformance?startMonth=202401&endMonth=202412 | |
| 42 | +``` | |
| 43 | + | |
| 44 | +## 示例响应 | |
| 45 | +```json | |
| 46 | +{ | |
| 47 | + "code": 200, | |
| 48 | + "msg": "操作成功", | |
| 49 | + "data": [ | |
| 50 | + { | |
| 51 | + "jsjId": "123456789", | |
| 52 | + "jsjName": "金三角A组", | |
| 53 | + "month": "202412", | |
| 54 | + "storeId": "store001", | |
| 55 | + "storeName": "绿纤川音店", | |
| 56 | + "orderCount": 15, | |
| 57 | + "totalPerformance": 50000.00, | |
| 58 | + "lastOrderDate": "2024-12-15T14:30:00", | |
| 59 | + "firstOrderDate": "2024-12-01T09:00:00", | |
| 60 | + "statisticsType": "ACTIVE", | |
| 61 | + "memberName": null | |
| 62 | + }, | |
| 63 | + { | |
| 64 | + "jsjId": "987654321", | |
| 65 | + "jsjName": "绿纤川音店-张三", | |
| 66 | + "month": "202412", | |
| 67 | + "storeId": "store001", | |
| 68 | + "storeName": "绿纤川音店", | |
| 69 | + "orderCount": 8, | |
| 70 | + "totalPerformance": 25000.00, | |
| 71 | + "lastOrderDate": "2024-12-14T16:20:00", | |
| 72 | + "firstOrderDate": "2024-12-02T10:15:00", | |
| 73 | + "statisticsType": "INACTIVE", | |
| 74 | + "memberName": "张三" | |
| 75 | + } | |
| 76 | + ] | |
| 77 | +} | |
| 78 | +``` | |
| 79 | + | |
| 80 | +## 业务逻辑 | |
| 81 | +1. **活跃成员统计**: | |
| 82 | + - 查询状态为"ACTIVE"的金三角成员 | |
| 83 | + - 将业绩计入金三角总业绩 | |
| 84 | + - 按金三角分组统计 | |
| 85 | + | |
| 86 | +2. **非活跃成员统计**: | |
| 87 | + - 查询状态为"INACTIVE"的金三角成员 | |
| 88 | + - 按单人业绩统计 | |
| 89 | + - 金三角名称为"门店名+姓名"格式 | |
| 90 | + | |
| 91 | +3. **数据排序**: | |
| 92 | + - 按月份降序(最新的月份在前) | |
| 93 | + - 按总业绩降序(业绩高的在前) | |
| 94 | + | |
| 95 | +## 注意事项 | |
| 96 | +- 所有查询都是只读操作,不会修改数据库数据 | |
| 97 | +- 支持按月统计,可以指定月份范围 | |
| 98 | +- 支持按金三角ID和门店ID进行筛选 | |
| 99 | +- 返回结果包含统计类型标识,便于前端区分处理 | ... | ... |