개정판 7066b8a9
issue #0000
document 조회 시 Total dwg 갯수 조회(output)
Change-Id: I839ee65e9ced3f97a67cb7e91aa15ddb199fccc3
ID2.Manager/ID2.Manager.Controller/Controllers/DocumentController.cs | ||
---|---|---|
16 | 16 |
|
17 | 17 |
public DocumentController(ID2ProjectInfo id2Info) : base(id2Info) { } |
18 | 18 |
|
19 |
public IEnumerable<Documents> GetAllDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
|
|
19 |
public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
|
|
20 | 20 |
{ |
21 | 21 |
using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR)) |
22 | 22 |
{ |
23 |
return rep.GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult);
|
|
23 |
return rep.GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult); |
|
24 | 24 |
} |
25 | 25 |
} |
26 | 26 |
|
27 |
public IEnumerable<Documents> GetAllDocuments(List<ID2ProjectInfo> id2Infos, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
|
|
27 |
public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(List<ID2ProjectInfo> id2Infos, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
|
|
28 | 28 |
{ |
29 |
IEnumerable<Documents> docs = this.GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult);
|
|
29 |
IEnumerable<Documents> docs = this.GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult).dwgs;
|
|
30 | 30 |
List<ID2Drawings> id2docs = null; |
31 | 31 |
|
32 | 32 |
if (id2Infos.Any()) |
... | ... | |
101 | 101 |
MarkupText = doc.MarkupText |
102 | 102 |
}; |
103 | 103 |
|
104 |
return result;
|
|
104 |
return (result, 0);
|
|
105 | 105 |
|
106 | 106 |
} |
107 |
return docs;
|
|
107 |
return (docs, 0);
|
|
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList) |
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs | ||
---|---|---|
14 | 14 |
{ |
15 | 15 |
public DocumentRepository(string connectionStr) : base(connectionStr) { } |
16 | 16 |
|
17 |
public IEnumerable<Documents> GetAllDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
|
|
17 |
public IEnumerable<Documents> GetAllDocuments() |
|
18 | 18 |
{ |
19 |
string query = $@" |
|
20 |
select doc.*, |
|
21 |
|
|
22 |
( |
|
23 |
select markus.* |
|
24 |
from [markus_SEC].[dbo].[ViewMarkupData] markus where doc.DocumentNo = markus.DOCUMENT_ID |
|
25 |
FOR JSON PATH |
|
26 |
) as MarkupText |
|
27 |
from dbo.Documents doc |
|
28 |
where doc.IsDeleted=0 |
|
29 |
order by doc.Seq;"; |
|
30 |
|
|
31 |
return Query<Documents>(query); |
|
32 |
} |
|
33 |
|
|
34 |
public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult) |
|
35 |
{ |
|
36 |
var dynamicParameters = new DynamicParameters(); |
|
37 |
dynamicParameters.Add("Total", dbType: System.Data.DbType.Int32, direction: System.Data.ParameterDirection.Output); |
|
38 |
|
|
19 | 39 |
StringBuilder sbWhere = new StringBuilder(); |
20 | 40 |
var parameters = new Dictionary<string, object>(); |
21 | 41 |
if (!string.IsNullOrEmpty(projectCode)) |
... | ... | |
89 | 109 |
) as MarkupText |
90 | 110 |
from dbo.Documents doc |
91 | 111 |
where doc.IsDeleted=0 {sbWhere} |
92 |
order by doc.Seq;"; |
|
112 |
order by doc.Seq |
|
113 |
|
|
114 |
select @Total=count(*) from dbo.Documents |
|
115 |
select @Total;"; |
|
93 | 116 |
|
94 | 117 |
if (parameters.Count > 0) |
95 | 118 |
{ |
96 |
var dynamicParameters = new DynamicParameters(parameters); |
|
97 |
return Query<Documents>(query, dynamicParameters); |
|
119 |
dynamicParameters.AddDynamicParams(parameters); |
|
98 | 120 |
} |
99 | 121 |
|
100 |
return Query<Documents>(query); |
|
122 |
var ret = Query<Documents>(query, dynamicParameters); |
|
123 |
|
|
124 |
int totalCount = dynamicParameters.Get<int>("Total"); |
|
125 |
|
|
126 |
return (ret, totalCount); |
|
101 | 127 |
} |
102 | 128 |
|
103 | 129 |
public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList) |
ID2.Manager/ID2.Manager/Main.cs | ||
---|---|---|
523 | 523 |
string prodIsResult = this.radDropDownListProdIsResult.SelectedValue.ToString();// |
524 | 524 |
string clientIsResult = this.radDropDownListClientIsResult.SelectedValue.ToString();// |
525 | 525 |
|
526 |
this.documents = new DocumentController().GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult).ToList(); |
|
526 |
var (dwgs, totalCnt) = new DocumentController().GetDocuments(projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult); |
|
527 |
|
|
528 |
this.documents = dwgs.ToList(); |
|
527 | 529 |
this.orgDocuments = JsonConvert.DeserializeObject<List<Documents>>(JsonConvert.SerializeObject(this.documents)); |
530 |
this.lbSelectAndTotal.Text = totalCnt.ToString(); |
|
528 | 531 |
|
529 | 532 |
List<string> projectCodes = new List<string>(); |
530 | 533 |
|
... | ... | |
561 | 564 |
string clientIsResult = this.radDropDownListClientIsResult.SelectedValue.ToString(); |
562 | 565 |
|
563 | 566 |
var id2Prjs = informations.ProjectList.Where(x => x.GroupID.Equals(informations.ActiveProject.ProjectID)).Select(x => x.ID2Info).ToList(); |
564 |
this.documents = new DocumentController().GetAllDocuments(id2Prjs, projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult).ToList(); |
|
567 |
var(dwgs, totalCnt) = new DocumentController().GetDocuments(id2Prjs, projectCode, personIncharge, jobLevel, documentNo, isToIsDiscussion, isFrReviewStatus, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult); |
|
568 |
this.documents = dwgs.ToList(); |
|
565 | 569 |
this.orgDocuments = JsonConvert.DeserializeObject<List<Documents>>(JsonConvert.SerializeObject(this.documents)); |
570 |
this.lbSelectAndTotal.Text = totalCnt.ToString(); |
|
566 | 571 |
} |
567 | 572 |
} |
568 | 573 |
|
내보내기 Unified diff