diff --git a/Src/Dlhis.Entity/Canteen/Entities/UserBalanceUploadRecordEntity.cs b/Src/Dlhis.Entity/Canteen/Entities/UserBalanceUploadRecordEntity.cs
index 7d81c52e..dd5ecf42 100644
--- a/Src/Dlhis.Entity/Canteen/Entities/UserBalanceUploadRecordEntity.cs
+++ b/Src/Dlhis.Entity/Canteen/Entities/UserBalanceUploadRecordEntity.cs
@@ -9,24 +9,24 @@ namespace Dlhis.Entity.Canteen.Entities;
[SugarTable(TableName = "UserBalanceUploadRecords", TableDescription = "用户消费上传记录表")]
public class UserBalanceUploadRecordEntity : SugarBaseEntity
{
+ ///
+ /// 学工号
+ ///
+ [SugarColumn(IsNullable = false, ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_UserBalances_useCode" })]
+ public string UserCode { get; set; }
+
///
/// 年份
///
- [SugarColumn(IsNullable = false, ColumnDescription = "年份")]
+ [SugarColumn(IsNullable = false, ColumnDescription = "年份", UniqueGroupNameList = new[] { "idx_UserBalances_useCode" })]
public int Year { get; set; }
///
/// 月份
///
- [SugarColumn(IsNullable = false, ColumnDescription = "月份")]
+ [SugarColumn(IsNullable = false, ColumnDescription = "月份", UniqueGroupNameList = new[] { "idx_UserBalances_useCode" })]
public int Month { get; set; }
- ///
- /// 学工号
- ///
- [SugarColumn(IsNullable = false, ColumnDescription = "学工号", UniqueGroupNameList = new[] { "idx_UserBalances_useCode" })]
- public string UserCode { get; set; }
-
///
/// 消费
///
diff --git a/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs b/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs
index 6695974e..8d18ae87 100644
--- a/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs
+++ b/Src/Dlhis.ScheduledTask/Jobs/CostUploadJob.cs
@@ -23,9 +23,12 @@ public class CostUploadJob : BaseJob
var jipApi = serviceProvider.GetService();
var now = DateTime.Now;
+
+ var year = now.Month == 1 ? now.Year - 1 : now.Year;
var month = now.Month == 1 ? 12 : now.Month - 1;
- var s = new DateTime(2025, month, 1);
- var e = new DateTime(2025, month + 1, 1);
+
+ var s = new DateTime(year, month, 1);
+ var e = new DateTime(year, month + 1, 1);
var endDayOfMonth = e.AddDays(-1);
//从余额找人