Commit 1c95eff1ebffb1ac25bdfc219b34980644110ec7

Authored by “wangming”
1 parent b36af804

更新工资相关服务类和DTO类

- 更新工资服务类和相关DTO输出类
- 涉及店助、总监、事业部经理、大项目总监、大项目老师、健康师、门店、技术总经理、科学老师等工资相关服务
Showing 18 changed files with 176 additions and 39 deletions
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqAssistantSalary/AssistantSalaryOutput.cs
... ... @@ -188,6 +188,11 @@ namespace NCC.Extend.Entitys.Dto.LqAssistantSalary
188 188 public int IsLocked { get; set; }
189 189  
190 190 /// <summary>
  191 + /// 员工确认状态(0=未确认,1=已确认)
  192 + /// </summary>
  193 + public int EmployeeConfirmStatus { get; set; }
  194 +
  195 + /// <summary>
191 196 /// 更新时间
192 197 /// </summary>
193 198 public DateTime UpdateTime { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqBusinessUnitManagerSalary/BusinessUnitManagerSalaryOutput.cs
... ... @@ -233,6 +233,11 @@ namespace NCC.Extend.Entitys.Dto.LqBusinessUnitManagerSalary
233 233 public int IsLocked { get; set; }
234 234  
235 235 /// <summary>
  236 + /// 员工确认状态(0=未确认,1=已确认)
  237 + /// </summary>
  238 + public int EmployeeConfirmStatus { get; set; }
  239 +
  240 + /// <summary>
236 241 /// 更新时间
237 242 /// </summary>
238 243 public DateTime UpdateTime { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqDirectorSalary/DirectorSalaryOutput.cs
... ... @@ -208,6 +208,11 @@ namespace NCC.Extend.Entitys.Dto.LqDirectorSalary
208 208 public int IsLocked { get; set; }
209 209  
210 210 /// <summary>
  211 + /// 员工确认状态(0=未确认,1=已确认)
  212 + /// </summary>
  213 + public int EmployeeConfirmStatus { get; set; }
  214 +
  215 + /// <summary>
211 216 /// 更新时间
212 217 /// </summary>
213 218 public DateTime UpdateTime { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMajorProjectDirectorSalary/MajorProjectDirectorSalaryOutput.cs
... ... @@ -218,6 +218,11 @@ namespace NCC.Extend.Entitys.Dto.LqMajorProjectDirectorSalary
218 218 public int IsLocked { get; set; }
219 219  
220 220 /// <summary>
  221 + /// 员工确认状态(0=未确认,1=已确认)
  222 + /// </summary>
  223 + public int EmployeeConfirmStatus { get; set; }
  224 +
  225 + /// <summary>
221 226 /// 更新时间
222 227 /// </summary>
223 228 public DateTime UpdateTime { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqMajorProjectTeacherSalary/MajorProjectTeacherSalaryOutput.cs
... ... @@ -268,6 +268,11 @@ namespace NCC.Extend.Entitys.Dto.LqMajorProjectTeacherSalary
268 268 public int IsLocked { get; set; }
269 269  
270 270 /// <summary>
  271 + /// 员工确认状态(0=未确认,1=已确认)
  272 + /// </summary>
  273 + public int EmployeeConfirmStatus { get; set; }
  274 +
  275 + /// <summary>
271 276 /// 是否离职
272 277 /// </summary>
273 278 public int IsTerminated { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqSalary/HealthCoachSalaryOutput.cs
... ... @@ -108,6 +108,11 @@ namespace NCC.Extend.Entitys.Dto.LqSalary
108 108 public int IsLocked { get; set; }
109 109  
110 110 /// <summary>
  111 + /// 员工确认状态(0=未确认,1=已确认)
  112 + /// </summary>
  113 + public int EmployeeConfirmStatus { get; set; }
  114 +
  115 + /// <summary>
111 116 /// 更新时间
112 117 /// </summary>
113 118 public DateTime UpdateTime { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqStoreManagerSalary/StoreManagerSalaryOutput.cs
... ... @@ -208,6 +208,11 @@ namespace NCC.Extend.Entitys.Dto.LqStoreManagerSalary
208 208 public int IsLocked { get; set; }
209 209  
210 210 /// <summary>
  211 + /// 员工确认状态(0=未确认,1=已确认)
  212 + /// </summary>
  213 + public int EmployeeConfirmStatus { get; set; }
  214 +
  215 + /// <summary>
211 216 /// 门店类型
212 217 /// </summary>
213 218 public int? StoreType { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqTechGeneralManagerSalary/TechGeneralManagerSalaryOutput.cs
... ... @@ -228,6 +228,11 @@ namespace NCC.Extend.Entitys.Dto.LqTechGeneralManagerSalary
228 228 public int IsLocked { get; set; }
229 229  
230 230 /// <summary>
  231 + /// 员工确认状态(0=未确认,1=已确认)
  232 + /// </summary>
  233 + public int EmployeeConfirmStatus { get; set; }
  234 +
  235 + /// <summary>
231 236 /// 更新时间
232 237 /// </summary>
233 238 public DateTime UpdateTime { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqTechTeacherSalary/TechTeacherSalaryOutput.cs
... ... @@ -288,6 +288,11 @@ namespace NCC.Extend.Entitys.Dto.LqTechTeacherSalary
288 288 public int IsLocked { get; set; }
289 289  
290 290 /// <summary>
  291 + /// 员工确认状态(0=未确认,1=已确认)
  292 + /// </summary>
  293 + public int EmployeeConfirmStatus { get; set; }
  294 +
  295 + /// <summary>
291 296 /// 是否离职
292 297 /// </summary>
293 298 public int IsTerminated { get; set; }
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqAssistantSalaryService.cs
... ... @@ -111,6 +111,7 @@ namespace NCC.Extend
111 111 LastMonthSupplement = x.LastMonthSupplement,
112 112 MonthlyTotalPayment = x.MonthlyTotalPayment,
113 113 IsLocked = x.IsLocked,
  114 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
114 115 UpdateTime = x.UpdateTime,
115 116 StoreType = x.StoreType,
116 117 StoreCategory = x.StoreCategory,
... ... @@ -123,7 +124,7 @@ namespace NCC.Extend
123 124 }
124 125  
125 126 /// <summary>
126   - /// 通过月份和员工ID查询工资
  127 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
127 128 /// </summary>
128 129 [HttpGet("query-by-employee")]
129 130 public async Task<AssistantSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -134,7 +135,7 @@ namespace NCC.Extend
134 135 throw NCCException.Oh("员工ID不能为空");
135 136 var monthStr = $"{input.Year}{input.Month:D2}";
136 137 var salary = await _db.Queryable<LqAssistantSalaryStatisticsEntity>()
137   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  138 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
138 139 .Select(x => new AssistantSalaryOutput
139 140 {
140 141 Id = x.Id,
... ... @@ -173,6 +174,7 @@ namespace NCC.Extend
173 174 LastMonthSupplement = x.LastMonthSupplement,
174 175 MonthlyTotalPayment = x.MonthlyTotalPayment,
175 176 IsLocked = x.IsLocked,
  177 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
176 178 UpdateTime = x.UpdateTime,
177 179 StoreType = x.StoreType,
178 180 StoreCategory = x.StoreCategory,
... ... @@ -1071,7 +1073,9 @@ namespace NCC.Extend
1071 1073 return int.TryParse(cleaned, out int result) ? result : 0;
1072 1074 };
1073 1075  
1074   - for (int i = 1; i < dataTable.Rows.Count; i++)
  1076 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  1077 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  1078 + for (int i = 0; i < dataTable.Rows.Count; i++)
1075 1079 {
1076 1080 try
1077 1081 {
... ... @@ -1248,7 +1252,14 @@ namespace NCC.Extend
1248 1252 }
1249 1253  
1250 1254 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
1251   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1255 + if (recordsToUpdate.Any())
  1256 + {
  1257 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1258 + await _db.Updateable(recordsToUpdate)
  1259 + .IgnoreColumns(x => x.CreateTime)
  1260 + .IgnoreColumns(x => x.CreateUser)
  1261 + .ExecuteCommandAsync();
  1262 + }
1252 1263  
1253 1264 return new
1254 1265 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqBusinessUnitManagerSalaryService.cs
... ... @@ -123,6 +123,7 @@ namespace NCC.Extend
123 123 LastMonthSupplement = x.LastMonthSupplement,
124 124 MonthlyTotalPayment = x.MonthlyTotalPayment,
125 125 IsLocked = x.IsLocked,
  126 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
126 127 UpdateTime = x.UpdateTime
127 128 })
128 129 .ToPagedListAsync(input.currentPage, input.pageSize);
... ... @@ -131,7 +132,7 @@ namespace NCC.Extend
131 132 }
132 133  
133 134 /// <summary>
134   - /// 通过月份和员工ID查询工资
  135 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
135 136 /// </summary>
136 137 [HttpGet("query-by-employee")]
137 138 public async Task<BusinessUnitManagerSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -142,7 +143,7 @@ namespace NCC.Extend
142 143 throw NCCException.Oh("员工ID不能为空");
143 144 var monthStr = $"{input.Year}{input.Month:D2}";
144 145 var salary = await _db.Queryable<LqBusinessUnitManagerSalaryStatisticsEntity>()
145   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  146 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
146 147 .Select(x => new BusinessUnitManagerSalaryOutput
147 148 {
148 149 Id = x.Id,
... ... @@ -190,6 +191,7 @@ namespace NCC.Extend
190 191 LastMonthSupplement = x.LastMonthSupplement,
191 192 MonthlyTotalPayment = x.MonthlyTotalPayment,
192 193 IsLocked = x.IsLocked,
  194 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
193 195 UpdateTime = x.UpdateTime
194 196 })
195 197 .FirstAsync();
... ... @@ -952,7 +954,9 @@ namespace NCC.Extend
952 954 return int.TryParse(cleaned, out int result) ? result : 0;
953 955 };
954 956  
955   - for (int i = 1; i < dataTable.Rows.Count; i++)
  957 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  958 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  959 + for (int i = 0; i < dataTable.Rows.Count; i++)
956 960 {
957 961 try
958 962 {
... ... @@ -1082,7 +1086,14 @@ namespace NCC.Extend
1082 1086 }
1083 1087  
1084 1088 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
1085   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1089 + if (recordsToUpdate.Any())
  1090 + {
  1091 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1092 + await _db.Updateable(recordsToUpdate)
  1093 + .IgnoreColumns(x => x.CreateTime)
  1094 + .IgnoreColumns(x => x.CreateUser)
  1095 + .ExecuteCommandAsync();
  1096 + }
1086 1097  
1087 1098 return new
1088 1099 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqDirectorSalaryService.cs
... ... @@ -119,6 +119,7 @@ namespace NCC.Extend
119 119 LastMonthSupplement = x.LastMonthSupplement,
120 120 MonthlyTotalPayment = x.MonthlyTotalPayment,
121 121 IsLocked = x.IsLocked,
  122 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
122 123 UpdateTime = x.UpdateTime,
123 124 StoreType = x.StoreType,
124 125 StoreCategory = x.StoreCategory,
... ... @@ -131,7 +132,7 @@ namespace NCC.Extend
131 132 }
132 133  
133 134 /// <summary>
134   - /// 通过月份和员工ID查询工资
  135 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
135 136 /// </summary>
136 137 [HttpGet("query-by-employee")]
137 138 public async Task<DirectorSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -142,7 +143,7 @@ namespace NCC.Extend
142 143 throw NCCException.Oh("员工ID不能为空");
143 144 var monthStr = $"{input.Year}{input.Month:D2}";
144 145 var salary = await _db.Queryable<LqDirectorSalaryStatisticsEntity>()
145   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  146 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
146 147 .Select(x => new DirectorSalaryOutput
147 148 {
148 149 Id = x.Id,
... ... @@ -171,6 +172,7 @@ namespace NCC.Extend
171 172 PaidAmount = x.PaidAmount,
172 173 PendingAmount = x.PendingAmount,
173 174 IsLocked = x.IsLocked,
  175 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
174 176 StoreType = x.StoreType,
175 177 StoreCategory = x.StoreCategory,
176 178 IsNewStore = x.IsNewStore,
... ... @@ -992,7 +994,9 @@ namespace NCC.Extend
992 994 return int.TryParse(cleaned, out int result) ? result : 0;
993 995 };
994 996  
995   - for (int i = 1; i < dataTable.Rows.Count; i++)
  997 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  998 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  999 + for (int i = 0; i < dataTable.Rows.Count; i++)
996 1000 {
997 1001 try
998 1002 {
... ... @@ -1153,7 +1157,14 @@ namespace NCC.Extend
1153 1157 }
1154 1158  
1155 1159 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
1156   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1160 + if (recordsToUpdate.Any())
  1161 + {
  1162 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1163 + await _db.Updateable(recordsToUpdate)
  1164 + .IgnoreColumns(x => x.CreateTime)
  1165 + .IgnoreColumns(x => x.CreateUser)
  1166 + .ExecuteCommandAsync();
  1167 + }
1157 1168  
1158 1169 return new
1159 1170 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqMajorProjectDirectorSalaryService.cs
... ... @@ -118,6 +118,7 @@ namespace NCC.Extend
118 118 LastMonthSupplement = x.LastMonthSupplement,
119 119 MonthlyTotalPayment = x.MonthlyTotalPayment,
120 120 IsLocked = x.IsLocked,
  121 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
121 122 UpdateTime = x.UpdateTime
122 123 })
123 124 .ToPagedListAsync(input.currentPage, input.pageSize);
... ... @@ -126,7 +127,7 @@ namespace NCC.Extend
126 127 }
127 128  
128 129 /// <summary>
129   - /// 通过月份和员工ID查询工资
  130 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
130 131 /// </summary>
131 132 [HttpGet("query-by-employee")]
132 133 public async Task<MajorProjectDirectorSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -137,7 +138,7 @@ namespace NCC.Extend
137 138 throw NCCException.Oh("员工ID不能为空");
138 139 var monthStr = $"{input.Year}{input.Month:D2}";
139 140 var salary = await _db.Queryable<LqMajorProjectDirectorSalaryStatisticsEntity>()
140   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  141 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
141 142 .Select(x => new MajorProjectDirectorSalaryOutput
142 143 {
143 144 Id = x.Id,
... ... @@ -182,6 +183,7 @@ namespace NCC.Extend
182 183 LastMonthSupplement = x.LastMonthSupplement,
183 184 MonthlyTotalPayment = x.MonthlyTotalPayment,
184 185 IsLocked = x.IsLocked,
  186 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
185 187 UpdateTime = x.UpdateTime
186 188 })
187 189 .FirstAsync();
... ... @@ -796,7 +798,9 @@ namespace NCC.Extend
796 798 return int.TryParse(cleaned, out int result) ? result : 0;
797 799 };
798 800  
799   - for (int i = 1; i < dataTable.Rows.Count; i++)
  801 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  802 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  803 + for (int i = 0; i < dataTable.Rows.Count; i++)
800 804 {
801 805 try
802 806 {
... ... @@ -929,7 +933,14 @@ namespace NCC.Extend
929 933 }
930 934  
931 935 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
932   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  936 + if (recordsToUpdate.Any())
  937 + {
  938 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  939 + await _db.Updateable(recordsToUpdate)
  940 + .IgnoreColumns(x => x.CreateTime)
  941 + .IgnoreColumns(x => x.CreateUser)
  942 + .ExecuteCommandAsync();
  943 + }
933 944  
934 945 return new
935 946 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqMajorProjectTeacherSalaryService.cs
... ... @@ -128,6 +128,7 @@ namespace NCC.Extend
128 128 LastMonthSupplement = x.LastMonthSupplement,
129 129 MonthlyTotalPayment = x.MonthlyTotalPayment,
130 130 IsLocked = x.IsLocked,
  131 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
131 132 IsTerminated = x.IsTerminated,
132 133 UpdateTime = x.UpdateTime,
133 134 StoreType = x.StoreType,
... ... @@ -141,7 +142,7 @@ namespace NCC.Extend
141 142 }
142 143  
143 144 /// <summary>
144   - /// 通过月份和员工ID查询工资
  145 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
145 146 /// </summary>
146 147 [HttpGet("query-by-employee")]
147 148 public async Task<MajorProjectTeacherSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -152,7 +153,7 @@ namespace NCC.Extend
152 153 throw NCCException.Oh("员工ID不能为空");
153 154 var monthStr = $"{input.Year}{input.Month:D2}";
154 155 var salary = await _db.Queryable<LqMajorProjectTeacherSalaryStatisticsEntity>()
155   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  156 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
156 157 .Select(x => new MajorProjectTeacherSalaryOutput
157 158 {
158 159 Id = x.Id,
... ... @@ -207,6 +208,7 @@ namespace NCC.Extend
207 208 LastMonthSupplement = x.LastMonthSupplement,
208 209 MonthlyTotalPayment = x.MonthlyTotalPayment,
209 210 IsLocked = x.IsLocked,
  211 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
210 212 IsTerminated = x.IsTerminated,
211 213 UpdateTime = x.UpdateTime,
212 214 StoreType = x.StoreType,
... ... @@ -819,7 +821,9 @@ namespace NCC.Extend
819 821 return int.TryParse(cleaned, out int result) ? result : 0;
820 822 };
821 823  
822   - for (int i = 1; i < dataTable.Rows.Count; i++)
  824 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  825 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  826 + for (int i = 0; i < dataTable.Rows.Count; i++)
823 827 {
824 828 try
825 829 {
... ... @@ -977,7 +981,14 @@ namespace NCC.Extend
977 981 }
978 982  
979 983 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
980   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  984 + if (recordsToUpdate.Any())
  985 + {
  986 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  987 + await _db.Updateable(recordsToUpdate)
  988 + .IgnoreColumns(x => x.CreateTime)
  989 + .IgnoreColumns(x => x.CreateUser)
  990 + .ExecuteCommandAsync();
  991 + }
981 992  
982 993 return new
983 994 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqSalaryService.cs
... ... @@ -156,6 +156,7 @@ namespace NCC.Extend
156 156 MonthlyTotalPayment = x.MonthlyTotalPayment,
157 157 StatisticsMonth = x.StatisticsMonth,
158 158 IsLocked = x.IsLocked,
  159 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
159 160 CreateTime = x.CreateTime,
160 161 CreateUser = x.CreateUser,
161 162 UpdateTime = x.UpdateTime,
... ... @@ -174,11 +175,13 @@ namespace NCC.Extend
174 175 }
175 176  
176 177 /// <summary>
177   - /// 通过月份和员工ID查询工资
  178 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
178 179 /// </summary>
179 180 /// <remarks>
180 181 /// 根据年份、月份和员工ID查询对应员工的工资记录
181 182 ///
  183 + /// **重要**:此接口只能查询已锁定(IsLocked=1)的工资记录
  184 + ///
182 185 /// 示例请求:
183 186 /// ```
184 187 /// GET /api/Extend/lqsalary/query-by-employee?Year=2026&amp;Month=1&amp;EmployeeId=员工ID
... ... @@ -209,7 +212,7 @@ namespace NCC.Extend
209 212 var monthStr = $"{input.Year}{input.Month:D2}";
210 213  
211 214 var salary = await _db.Queryable<LqSalaryStatisticsEntity>()
212   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  215 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
213 216 .Select(x => new HealthCoachSalaryOutput
214 217 {
215 218 Id = x.Id,
... ... @@ -289,6 +292,7 @@ namespace NCC.Extend
289 292 MonthlyTotalPayment = x.MonthlyTotalPayment,
290 293 StatisticsMonth = x.StatisticsMonth,
291 294 IsLocked = x.IsLocked,
  295 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
292 296 CreateTime = x.CreateTime,
293 297 CreateUser = x.CreateUser,
294 298 UpdateTime = x.UpdateTime,
... ... @@ -1332,9 +1336,9 @@ namespace NCC.Extend
1332 1336 throw NCCException.Oh("Excel文件中没有数据行");
1333 1337 }
1334 1338  
1335   - // Excel第一列是ID,第二列开始是业务字段
1336   - // 从第1行开始读取数据(跳过标题行)
1337   - for (int i = 1; i < dataTable.Rows.Count; i++)
  1339 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  1340 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  1341 + for (int i = 0; i < dataTable.Rows.Count; i++)
1338 1342 {
1339 1343 try
1340 1344 {
... ... @@ -1666,7 +1670,11 @@ namespace NCC.Extend
1666 1670 // 批量更新现有记录
1667 1671 if (recordsToUpdate.Any())
1668 1672 {
1669   - await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1673 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1674 + await _db.Updateable(recordsToUpdate)
  1675 + .IgnoreColumns(x => x.CreateTime)
  1676 + .IgnoreColumns(x => x.CreateUser)
  1677 + .ExecuteCommandAsync();
1670 1678 }
1671 1679  
1672 1680 return new
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqStoreManagerSalaryService.cs
... ... @@ -120,6 +120,7 @@ namespace NCC.Extend
120 120 PaidAmount = x.PaidAmount,
121 121 PendingAmount = x.PendingAmount,
122 122 IsLocked = x.IsLocked,
  123 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
123 124 StoreType = x.StoreType,
124 125 StoreCategory = x.StoreCategory,
125 126 IsNewStore = x.IsNewStore,
... ... @@ -132,7 +133,7 @@ namespace NCC.Extend
132 133 }
133 134  
134 135 /// <summary>
135   - /// 通过月份和员工ID查询工资
  136 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
136 137 /// </summary>
137 138 [HttpGet("query-by-employee")]
138 139 public async Task<StoreManagerSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -143,7 +144,7 @@ namespace NCC.Extend
143 144 throw NCCException.Oh("员工ID不能为空");
144 145 var monthStr = $"{input.Year}{input.Month:D2}";
145 146 var salary = await _db.Queryable<LqStoreManagerSalaryStatisticsEntity>()
146   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  147 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
147 148 .Select(x => new StoreManagerSalaryOutput
148 149 {
149 150 Id = x.Id,
... ... @@ -186,6 +187,7 @@ namespace NCC.Extend
186 187 PaidAmount = x.PaidAmount,
187 188 PendingAmount = x.PendingAmount,
188 189 IsLocked = x.IsLocked,
  190 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
189 191 StoreType = x.StoreType,
190 192 StoreCategory = x.StoreCategory,
191 193 IsNewStore = x.IsNewStore,
... ... @@ -1041,7 +1043,9 @@ namespace NCC.Extend
1041 1043 return int.TryParse(cleaned, out int result) ? result : 0;
1042 1044 };
1043 1045  
1044   - for (int i = 1; i < dataTable.Rows.Count; i++)
  1046 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  1047 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  1048 + for (int i = 0; i < dataTable.Rows.Count; i++)
1045 1049 {
1046 1050 try
1047 1051 {
... ... @@ -1213,7 +1217,14 @@ namespace NCC.Extend
1213 1217 }
1214 1218  
1215 1219 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
1216   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1220 + if (recordsToUpdate.Any())
  1221 + {
  1222 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1223 + await _db.Updateable(recordsToUpdate)
  1224 + .IgnoreColumns(x => x.CreateTime)
  1225 + .IgnoreColumns(x => x.CreateUser)
  1226 + .ExecuteCommandAsync();
  1227 + }
1217 1228  
1218 1229 return new
1219 1230 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqTechGeneralManagerSalaryService.cs
... ... @@ -122,6 +122,7 @@ namespace NCC.Extend
122 122 LastMonthSupplement = x.LastMonthSupplement,
123 123 MonthlyTotalPayment = x.MonthlyTotalPayment,
124 124 IsLocked = x.IsLocked,
  125 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
125 126 UpdateTime = x.UpdateTime
126 127 })
127 128 .ToPagedListAsync(input.currentPage, input.pageSize);
... ... @@ -130,7 +131,7 @@ namespace NCC.Extend
130 131 }
131 132  
132 133 /// <summary>
133   - /// 通过月份和员工ID查询工资
  134 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
134 135 /// </summary>
135 136 [HttpGet("query-by-employee")]
136 137 public async Task<TechGeneralManagerSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -141,7 +142,7 @@ namespace NCC.Extend
141 142 throw NCCException.Oh("员工ID不能为空");
142 143 var monthStr = $"{input.Year}{input.Month:D2}";
143 144 var salary = await _db.Queryable<LqTechGeneralManagerSalaryStatisticsEntity>()
144   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  145 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
145 146 .Select(x => new TechGeneralManagerSalaryOutput
146 147 {
147 148 Id = x.Id,
... ... @@ -188,6 +189,7 @@ namespace NCC.Extend
188 189 LastMonthSupplement = x.LastMonthSupplement,
189 190 MonthlyTotalPayment = x.MonthlyTotalPayment,
190 191 IsLocked = x.IsLocked,
  192 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
191 193 UpdateTime = x.UpdateTime
192 194 })
193 195 .FirstAsync();
... ... @@ -888,7 +890,9 @@ namespace NCC.Extend
888 890 return int.TryParse(cleaned, out int result) ? result : 0;
889 891 };
890 892  
891   - for (int i = 1; i < dataTable.Rows.Count; i++)
  893 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  894 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  895 + for (int i = 0; i < dataTable.Rows.Count; i++)
892 896 {
893 897 try
894 898 {
... ... @@ -1023,7 +1027,14 @@ namespace NCC.Extend
1023 1027 }
1024 1028  
1025 1029 if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync();
1026   - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1030 + if (recordsToUpdate.Any())
  1031 + {
  1032 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1033 + await _db.Updateable(recordsToUpdate)
  1034 + .IgnoreColumns(x => x.CreateTime)
  1035 + .IgnoreColumns(x => x.CreateUser)
  1036 + .ExecuteCommandAsync();
  1037 + }
1027 1038  
1028 1039 return new
1029 1040 {
... ...
netcore/src/Modularity/Extend/NCC.Extend/LqTechTeacherSalaryService.cs
... ... @@ -131,6 +131,7 @@ namespace NCC.Extend
131 131 LastMonthSupplement = x.LastMonthSupplement,
132 132 MonthlyTotalPayment = x.MonthlyTotalPayment,
133 133 IsLocked = x.IsLocked,
  134 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
134 135 IsTerminated = x.IsTerminated,
135 136 UpdateTime = x.UpdateTime,
136 137 StoreType = x.StoreType,
... ... @@ -144,7 +145,7 @@ namespace NCC.Extend
144 145 }
145 146  
146 147 /// <summary>
147   - /// 通过月份和员工ID查询工资
  148 + /// 通过月份和员工ID查询工资(仅查询已锁定的工资)
148 149 /// </summary>
149 150 [HttpGet("query-by-employee")]
150 151 public async Task<TechTeacherSalaryOutput> GetSalaryByEmployee([FromQuery] SalaryQueryByEmployeeInput input)
... ... @@ -155,7 +156,7 @@ namespace NCC.Extend
155 156 throw NCCException.Oh("员工ID不能为空");
156 157 var monthStr = $"{input.Year}{input.Month:D2}";
157 158 var salary = await _db.Queryable<LqTechTeacherSalaryStatisticsEntity>()
158   - .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId)
  159 + .Where(x => x.StatisticsMonth == monthStr && x.EmployeeId == input.EmployeeId && x.IsLocked == 1)
159 160 .Select(x => new TechTeacherSalaryOutput
160 161 {
161 162 Id = x.Id,
... ... @@ -214,6 +215,7 @@ namespace NCC.Extend
214 215 LastMonthSupplement = x.LastMonthSupplement,
215 216 MonthlyTotalPayment = x.MonthlyTotalPayment,
216 217 IsLocked = x.IsLocked,
  218 + EmployeeConfirmStatus = x.EmployeeConfirmStatus,
217 219 IsTerminated = x.IsTerminated,
218 220 UpdateTime = x.UpdateTime,
219 221 StoreType = x.StoreType,
... ... @@ -1223,8 +1225,9 @@ namespace NCC.Extend
1223 1225 throw NCCException.Oh("Excel文件中没有数据行");
1224 1226 }
1225 1227  
1226   - // Excel第一列是ID,第二列开始是业务字段
1227   - for (int i = 1; i < dataTable.Rows.Count; i++)
  1228 + // ExcelImportHelper.ToDataTable(filePath, 0, 0)会将第一行作为标题行,数据从第二行开始
  1229 + // 所以DataTable.Rows[0]是Excel的第一条数据行,应该从i=0开始循环
  1230 + for (int i = 0; i < dataTable.Rows.Count; i++)
1228 1231 {
1229 1232 try
1230 1233 {
... ... @@ -1517,7 +1520,11 @@ namespace NCC.Extend
1517 1520 // 批量更新现有记录
1518 1521 if (recordsToUpdate.Any())
1519 1522 {
1520   - await _db.Updateable(recordsToUpdate).ExecuteCommandAsync();
  1523 + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新
  1524 + await _db.Updateable(recordsToUpdate)
  1525 + .IgnoreColumns(x => x.CreateTime)
  1526 + .IgnoreColumns(x => x.CreateUser)
  1527 + .ExecuteCommandAsync();
1521 1528 }
1522 1529  
1523 1530 return new
... ...