Ver código fonte

修改字段类型

qinchaoyue 3 meses atrás
pai
commit
b14aad86e6

+ 1 - 1
src/Hotline.Api/Controllers/ExportData/ExportDataController.cs

@@ -18,7 +18,7 @@ namespace Hotline.Api.Controllers.ExportData;
 ///        比如: RedPackController.GetRedPackList 就会去查找 RedPackApplication.GetRedPackList 方法
 ///     3. 通过反射调用对应的方法
 ///     4. ApplicationService 的方法返回的必须是 ISugarQueryable
-///     5. ApplicationService 中方法的Description 属性会作为导出的文件名
+///     5. ApplicationService 中方法的ExportExcel属性会作为导出的文件名
 /// </summary>
 [ApiController]
 [Route("{*path:regex(.*export_excel$)}")]

+ 1 - 1
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -389,7 +389,7 @@ public class SnapshotController : BaseController
                 EventType = 0,
                 WorkAddress = order.Address,
                 CreatedTime = order.CreationTime,
-                WorkType = snapshot.JobType.ObjToInt(),
+                WorkType = snapshot.JobType.Value,
                 Source = 1,
                 WorkTimeStart = snapshot.StartWorkTime.Value,
                 WorkTimeStop = snapshot.EndWorkTime.Value,

+ 1 - 1
src/Hotline.Application.Tests/Controller/SnapshotControllerTest.cs

@@ -70,7 +70,7 @@ public class SnapshotControllerTest : TestBase
         inDto.County = "沿滩区";
         inDto.Description = "单元测试添加的时间描述";
         inDto.IsSecret = false;
-        //inDto.JobType = 
+        inDto.JobType = 0;
         foreach (var item in inDto.Files)
         {
             item.FileName = DateTime.Now.ToShortTimeString() + "文件.doc";

+ 1 - 1
src/Hotline.Share/Dtos/Snapshot/OrderDto.cs

@@ -108,7 +108,7 @@ public class AddSnapshotOrderInDto : Position
     /// 1: 气割;
     /// 2: 其他;
     /// </summary>
-    public EJobType? JobType { get; set; }
+    public int? JobType { get; set; }
 
     /// <summary>
     /// 经营单位类别

+ 0 - 29
src/Hotline.Share/Enums/Snapshot/EJobType.cs

@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Hotline.Share.Enums.Snapshot;
-public enum EJobType
-{
-
-    /// <summary>
-    /// 电焊
-    /// </summary>
-    [Description("电焊")]
-    Electric,
-
-    /// <summary>
-    /// 气割
-    /// </summary>
-    [Description("气割")]
-    Gas,
-
-    /// <summary>
-    /// 其他
-    /// </summary>
-    [Description("其他")]
-    Othoer
-}

+ 2 - 2
src/Hotline/SeedData/SystemDicDataSeedData.cs

@@ -120,8 +120,8 @@ public class SystemDicDataSeedData : ISeedData<SystemDicData>
         if (dicTypeCode == SysDicTypeConsts.JobType)
         {
             return [
-                new() { Id = "08dc3c1e-470f-4a7d-8433-3fed9bb59c95", DicDataValue = "dianhan", DicDataName = "电焊"},
-                new() { Id = "08dc3cc4-aa8b-41ad-8807-ba1571e00628", DicDataValue = "qige", DicDataName = "气割"},
+                new() { Id = "08dc3c1e-470f-4a7d-8433-3fed9bb59c95", DicDataValue = "0", DicDataName = "电焊"},
+                new() { Id = "08dc3cc4-aa8b-41ad-8807-ba1571e00628", DicDataValue = "1", DicDataName = "气割"},
                 ];
         }
         if (dicTypeCode == SysDicTypeConsts.BusinessUnitType)

+ 1 - 1
src/Hotline/Snapshot/OrderSnapshot.cs

@@ -45,7 +45,7 @@ public class OrderSnapshot : CreationSoftDeleteEntity
     /// 作业类型
     /// </summary>
     [SugarColumn(ColumnDescription = "作业类型")]
-    public EJobType? JobType { get; set; }
+    public int? JobType { get; set; }
 
     /// <summary>
     /// 经营单位类别