AcsApiApp.cs
1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using WebRepository;
namespace WebApp
{
/// <summary>
/// 基础数据接口App
/// </summary>
public partial class AcsApiApp : ApiApp
{
public AcsApiApp(IUnitWork unitWork, IAuth auth, BaseDbContext context) : base(unitWork, auth, context)
{
}
public void TaskRefresh(TaskRefreshModel taskRefreshModel)
{
//_unitWork.Update<TTaskAssign>(u => u.Taskno == taskRefreshModel.TaskNo, u => new TTaskAssign { Status = taskRefreshModel.Status, UpdateTime = DateTime.Now, UpdateBy = "RCS" });
//AcsTask acsTask = _unitWork.FindSingle<AcsTask>(u => u.TaskNo.Equals(taskRefreshModel.TaskNo));
TTaskAssign acsTask = _unitWork.FindSingle<TTaskAssign>(u => u.Taskno.Equals(taskRefreshModel.TaskNo));
if (acsTask != null)
{
acsTask.Status = taskRefreshModel.Status;
_unitWork.Update(acsTask);
//if (taskRefreshModel.Status == 99)
//{
// AcsTaskHis acsTaskHis = acsTask.CopyTo<AcsTaskHis>();
// acsTaskHis.Id = null;
// _unitWork.Add(acsTaskHis);
// _unitWork.Delete(acsTask);
//}
}
}
public void ToWebTaskReturn(ToWebTaskReturnModel toWebTaskReturnModel)
{
TTaskDesign taskDesign = _unitWork.FindSingle<TTaskDesign>(u => u.Taskid.Equals(toWebTaskReturnModel.TaskID));
TTaskAssign taskAssign = new TTaskAssign
{
Taskno = toWebTaskReturnModel.TaskNo,
Taskid = toWebTaskReturnModel.TaskID,
Typename = taskDesign.Typename,
Groupname = toWebTaskReturnModel.TaskGroup,
TaskLevel = toWebTaskReturnModel.TaskLevel,
Status = 1,
CreateBy = "acs",
CreateTime = DateTime.Now,
};
_unitWork.Add(taskAssign);
}
}
}