개정판 d85fc490
issue #000 DocumentItem, Properties 수정.
Change-Id: I9e9f8bbd89f29b513c76c1936da5c2efc65d3d26
ConvertService/ServiceBase/Markus.Service.DataBase.Dapper/Repositories/DOCUMENTITEMRepository.cs | ||
---|---|---|
20 | 20 |
|
21 | 21 |
public async Task<DOCUMENTITEM> GetFirstAsync(string projectNo, string documentID) |
22 | 22 |
{ |
23 |
string SQL = "SELECT * FROM CDOCUMENT_ITEM WHERE PROJECT_NO = PROJECT_NO AND DOCUMENT_ID = @DOCUMENT_ID";
|
|
23 |
string SQL = "SELECT * FROM DOCUMENT_ITEM WHERE PROJECT_NO = @PROJECT_NO AND DOCUMENT_ID = @DOCUMENT_ID";
|
|
24 | 24 |
|
25 | 25 |
var parameter = new MixParameters(DBMS); |
26 | 26 |
parameter.Add("@PROJECT_NO", projectNo); |
... | ... | |
41 | 41 |
var tran = BeginTransaction(); |
42 | 42 |
var parameter = new MixParameters(DBMS); |
43 | 43 |
|
44 |
parameter.Add("REVISION", documentItem.REVISION);
|
|
45 |
parameter.Add("DOCUMENT_NO", documentItem.DOCUMENT_NO);
|
|
46 |
parameter.Add("DOCUMENT_NAME", documentItem.DOCUMENT_NAME);
|
|
47 |
parameter.Add("ORIGINAL_FILE", documentItem.ORIGINAL_FILE);
|
|
48 |
parameter.Add("DOCUMENT_ID", documentItem.DOCUMENT_ID);
|
|
49 |
parameter.Add("PROJECT_NO", documentItem.PROJECT_NO);
|
|
50 |
parameter.Add("Link", documentItem.PROJECT_NO);
|
|
51 |
parameter.Add("RESULT_FILE", documentItem.RESULT_FILE);
|
|
52 |
parameter.Add("RESULT", documentItem.RESULT);
|
|
53 |
parameter.Add("GROUP_NO", documentItem.GROUP_NO);
|
|
54 |
parameter.Add("NewID", dbType: DbType.String, direction: ParameterDirection.Output, size: 50);
|
|
44 |
parameter.Add("@revision", documentItem.REVISION);
|
|
45 |
parameter.Add("@document_no", documentItem.DOCUMENT_NO);
|
|
46 |
parameter.Add("@document_name", documentItem.DOCUMENT_NAME);
|
|
47 |
parameter.Add("@original_file", documentItem.ORIGINAL_FILE);
|
|
48 |
parameter.Add("@document_id", documentItem.DOCUMENT_ID);
|
|
49 |
parameter.Add("@project_no", documentItem.PROJECT_NO);
|
|
50 |
parameter.Add("@link", documentItem.Link);
|
|
51 |
parameter.Add("@result_file", documentItem.RESULT_FILE);
|
|
52 |
parameter.Add("@result", documentItem.RESULT);
|
|
53 |
parameter.Add("@group_no", documentItem.GROUP_NO);
|
|
54 |
parameter.Add("@newid", direction: ParameterDirection.Output);
|
|
55 | 55 |
|
56 |
await base.ExecuteAsync("CONVERT_INSERT_DOCUMENTITEM", parameter, tran, commandType: CommandType.StoredProcedure);
|
|
56 |
await base.ExecuteAsync("convert_insert_documentitem", parameter, tran, commandType: CommandType.StoredProcedure);
|
|
57 | 57 |
|
58 | 58 |
tran.Commit(); |
59 | 59 |
|
60 |
result = parameter.Get<string>("NewID");
|
|
60 |
result = parameter.Get<string>("newid");
|
|
61 | 61 |
|
62 | 62 |
|
63 | 63 |
return result; |
ConvertService/ServiceBase/Markus.Service.DataBase.Dapper/Repositories/PROPERTIESRepository.cs | ||
---|---|---|
24 | 24 |
|
25 | 25 |
public async Task<PROPERTIES> GetFirstAsync(string PROPERTY, string TYPE) |
26 | 26 |
{ |
27 |
string SQL = "SELECT ID, TYPE, PROPERTY, VALUE FROM PROPERTIES WHERE PROPERTY = PROPERTY AND TYPE = @TYPE"; |
|
27 |
string SQL = "SELECT ID, TYPE, PROPERTY, VALUE FROM PROPERTIES WHERE PROPERTY = @PROPERTY AND TYPE = @TYPE";
|
|
28 | 28 |
|
29 | 29 |
var parameters = new MixParameters(DBMS); |
30 | 30 |
parameters.Add("@PROPERTY", PROPERTY); |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocumentitem.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public class DataBaseDocumentitem : TestBaseMSSQL |
8 | 8 |
{ |
9 |
//[Test, Description("")]
|
|
10 |
public void DocPageInsert()
|
|
9 |
[Test, Description("GetDocumentFirstAsync")]
|
|
10 |
public void GetDocumentFirstAsync()
|
|
11 | 11 |
{ |
12 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype))
|
|
12 |
using (Markus.Service.DataBase.Repositories.DOCUMENTITEMRepository repository = new Repositories.DOCUMENTITEMRepository(ConnectionStr, dbtype))
|
|
13 | 13 |
{ |
14 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>();
|
|
14 |
var result = repository.GetFirstAsync("000000", "4000005").GetAwaiter().GetResult();
|
|
15 | 15 |
|
16 |
for (int i = 0; i < 150000; i++) |
|
16 |
Console.WriteLine($"new id : {result}"); |
|
17 |
} |
|
18 |
} |
|
19 |
|
|
20 |
[Test, Description("CreateOrUPdateAsync")] |
|
21 |
public void CreateOrUPdateAsync() |
|
22 |
{ |
|
23 |
using (Markus.Service.DataBase.Repositories.DOCUMENTITEMRepository repository = new Repositories.DOCUMENTITEMRepository(ConnectionStr, dbtype)) |
|
24 |
{ |
|
25 |
|
|
26 |
var documentItem = new Entities.DOCUMENTITEM() |
|
17 | 27 |
{ |
18 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = "a764548c-9f44-4c4d-4597-f7ac43d2b7c1", PAGE_NUMBER = i+1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 }); |
|
19 |
} |
|
28 |
ID = "CC561E3CD580447E9A9508C563D257DA", |
|
29 |
REVISION = "A", |
|
30 |
DOCUMENT_NO = "PROC_TEST_DOCUMENT_NO", |
|
31 |
DOCUMENT_NAME = "PROC_TEST_DOCUMENT_NAME", |
|
32 |
GROUP_NO = "PROC_GROUP_NO", |
|
33 |
ORIGINAL_FILE = "PROC_TEST_ORIGINAL_FILE", |
|
34 |
DOCUMENT_ID = "0000000001", |
|
35 |
RESULT_FILE = "PROC_RESULT_FILE", |
|
36 |
RESULT = "PROC_RESULT", |
|
37 |
PROJECT_NO = "PROC_RESULT", |
|
38 |
Link = "PROC_TEST_Link" |
|
39 |
}; |
|
40 |
|
|
20 | 41 |
|
21 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult();
|
|
42 |
var result = repository.CreateOrUPdateAsync(documentItem).GetAwaiter().GetResult();
|
|
22 | 43 |
|
23 | 44 |
Console.WriteLine($"new id : {result}"); |
24 | 45 |
} |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocumentitemPG.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public class DataBaseDocumentitemPG : TestBasePG |
8 | 8 |
{ |
9 |
//[Test, Description("")]
|
|
10 |
public void DocPageInsert()
|
|
9 |
[Test, Description("GetDocumentFirstAsync")]
|
|
10 |
public void GetDocumentFirstAsync()
|
|
11 | 11 |
{ |
12 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype))
|
|
12 |
using (Markus.Service.DataBase.Repositories.DOCUMENTITEMRepository repository = new Repositories.DOCUMENTITEMRepository(ConnectionStr, dbtype))
|
|
13 | 13 |
{ |
14 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>(); |
|
14 |
var result = repository.GetFirstAsync("000000", "4000005").GetAwaiter().GetResult(); |
|
15 |
|
|
16 |
Console.WriteLine($"new id : {result}"); |
|
17 |
} |
|
18 |
} |
|
19 |
|
|
20 |
[Test, Description("CreateOrUPdateAsync")] |
|
21 |
public void CreateOrUPdateAsync() |
|
22 |
{ |
|
23 |
using (Markus.Service.DataBase.Repositories.DOCUMENTITEMRepository repository = new Repositories.DOCUMENTITEMRepository(ConnectionStr, dbtype)) |
|
24 |
{ |
|
25 |
var documentItem = new Entities.DOCUMENTITEM() |
|
26 |
{ |
|
27 |
REVISION ="A", |
|
28 |
DOCUMENT_NO= "PROC_TEST_DOCUMENT_NO", |
|
29 |
DOCUMENT_NAME = "PROC_TEST_DOCUMENT_NAME", |
|
30 |
GROUP_NO = "PROC_GROUP_NO", |
|
31 |
ORIGINAL_FILE = "PROC_TEST_ORIGINAL_FILE", |
|
32 |
DOCUMENT_ID = "0000000001", |
|
33 |
RESULT_FILE= "PROC_RESULT_FILE", |
|
34 |
RESULT = "PROC_RESULT", |
|
35 |
PROJECT_NO = "PROC_RESULT", |
|
36 |
Link = "PROC_TEST_Link" |
|
37 |
}; |
|
15 | 38 |
|
16 |
for (int i = 0; i < 150000; i++) |
|
17 |
{ |
|
18 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = "a764548c-9f44-4c4d-4597-f7ac43d2b7c1", PAGE_NUMBER = i+1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 }); |
|
19 |
} |
|
20 | 39 |
|
21 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult();
|
|
40 |
var result = repository.CreateOrUPdateAsync(documentItem).GetAwaiter().GetResult();
|
|
22 | 41 |
|
23 | 42 |
Console.WriteLine($"new id : {result}"); |
24 | 43 |
} |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseProperties.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public class DataBaseProperties : TestBaseMSSQL |
8 | 8 |
{ |
9 |
//[Test, Description("")]
|
|
10 |
public void DocPageInsert()
|
|
9 |
[Test, Description("GetPropertyItem")]
|
|
10 |
public void GetPropertyItem()
|
|
11 | 11 |
{ |
12 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype))
|
|
12 |
using (Markus.Service.DataBase.Repositories.PROPERTIESRepository repository = new Repositories.PROPERTIESRepository(ConnectionStr, dbtype))
|
|
13 | 13 |
{ |
14 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>(); |
|
15 |
|
|
16 |
for (int i = 0; i < 150000; i++) |
|
14 |
var result = repository.GetFirstAsync("000000", "TileSorceStorage").GetAwaiter().GetResult(); |
|
15 |
if (result != null) |
|
17 | 16 |
{ |
18 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = "a764548c-9f44-4c4d-4597-f7ac43d2b7c1", PAGE_NUMBER = i+1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 }); |
|
17 |
Console.WriteLine($"new id : {result.ID}"); |
|
18 |
Assert.Pass(result.ID.ToString()); |
|
19 |
} |
|
20 |
else |
|
21 |
{ |
|
22 |
Console.WriteLine($"new id : null"); |
|
23 |
Assert.Fail(); |
|
19 | 24 |
} |
20 |
|
|
21 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult(); |
|
22 |
|
|
23 |
Console.WriteLine($"new id : {result}"); |
|
24 | 25 |
} |
25 | 26 |
} |
26 | 27 |
} |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBasePropertiesPG.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public class DataBasePropertiesPG : TestBasePG |
8 | 8 |
{ |
9 |
//[Test, Description("")]
|
|
10 |
public void DocPageInsert()
|
|
9 |
[Test, Description("GetPropertyItem")]
|
|
10 |
public void GetPropertyItem()
|
|
11 | 11 |
{ |
12 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype))
|
|
12 |
using (Markus.Service.DataBase.Repositories.PROPERTIESRepository repository = new Repositories.PROPERTIESRepository(ConnectionStr, dbtype))
|
|
13 | 13 |
{ |
14 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>(); |
|
15 |
|
|
16 |
for (int i = 0; i < 150000; i++) |
|
14 |
var result = repository.GetFirstAsync("000000", "TileSorceStorage").GetAwaiter().GetResult(); |
|
15 |
if (result != null) |
|
17 | 16 |
{ |
18 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = "a764548c-9f44-4c4d-4597-f7ac43d2b7c1", PAGE_NUMBER = i+1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 }); |
|
17 |
Console.WriteLine($"new id : {result.ID}"); |
|
18 |
Assert.Pass(result.ID.ToString()); |
|
19 |
} |
|
20 |
else |
|
21 |
{ |
|
22 |
Console.WriteLine($"new id : null"); |
|
23 |
Assert.Fail(); |
|
19 | 24 |
} |
20 |
|
|
21 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult(); |
|
22 |
|
|
23 |
Console.WriteLine($"new id : {result}"); |
|
24 | 25 |
} |
25 | 26 |
} |
26 | 27 |
} |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/Markus.Service.DataBase.Test.csproj | ||
---|---|---|
69 | 69 |
<Reference Include="System.Data" /> |
70 | 70 |
</ItemGroup> |
71 | 71 |
<ItemGroup> |
72 |
<Compile Include="DataBaseProperties.cs" /> |
|
73 |
<Compile Include="DataBasePropertiesPG.cs" /> |
|
74 |
<Compile Include="DataBaseDocumentitem.cs" /> |
|
72 | 75 |
<Compile Include="DataBaseDocInfo.cs" /> |
76 |
<Compile Include="DataBaseDocumentitemPG.cs" /> |
|
73 | 77 |
<Compile Include="DataBaseDocInfoPG.cs" /> |
74 | 78 |
<Compile Include="DataBaseDocPagePG.cs" /> |
75 | 79 |
<Compile Include="DataBaseServiceproperties.cs" /> |
내보내기 Unified diff