프로젝트

일반

사용자정보

개정판 fe57f64a

IDfe57f64a54d81fc3ac2e3959e4441149cb7b9ee7
상위 9646e768
하위 29aa5251, f26557b1

유성호이(가) 일년 이상 전에 추가함

issue #0000
ID2 DB 별 접속을 위한 BaseController 수정
Document 의 ID2 수정날짜 조회 적용(수정필요) - Main 화면에 ID2 ID2 완료일 적용버튼 추가
ID2 DB 별 접속 조회 개발
ID2 Drawings 모델 생성

Change-Id: I2e2a6dd06fec30688dce33f0c4d25f3d0385fa8c

차이점 보기:

ID2.Manager/ID2.Manager.Controller/Controllers/DocumentController.cs
4 4
using System.Text;
5 5
using System.Threading.Tasks;
6 6

  
7
using ID2.Manager.Dapper;
7 8
using ID2.Manager.Data.Models;
8 9
using ID2.Manager.Dapper.Repository;
9 10

  
......
11 12
{
12 13
    public class DocumentController : BaseController
13 14
    {
15
        public DocumentController() { }
16

  
17
        public DocumentController(ID2ProjectInfo id2Info) : base(id2Info) { }
18

  
14 19
        public IEnumerable<Documents> GetAllDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
15 20
        {
16
            using (DocumentRepository rep = new DocumentRepository(this._DbConnectionStr))
21
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
17 22
            {
18 23
                return rep.GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult);
19 24
            }
20 25
        }
21 26

  
27
        public IEnumerable<Documents> GetAllDocuments(List<ID2ProjectInfo> id2Infos, string projectCode, string personIncharge, string jobLevel, string documentNo, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
28
        {
29
            IEnumerable<Documents> docs = this.GetAllDocuments(projectCode, personIncharge, jobLevel, documentNo, isID2Work, id2Status, avevaStatus, prodIsResult, clientIsResult);
30
            List<ID2Drawings> id2docs = null;
31

  
32
            if (id2Infos.Any())
33
            {
34
                id2docs = new List<ID2Drawings>();
35
                id2Infos.ForEach(x =>
36
                {
37
                    id2docs.AddRange(new DocumentController(x).GetID2DrawingsByProject(x));
38
                });
39
            }
40

  
41
            if (docs != null && id2docs != null && docs.Any() && id2docs.Any())
42
            {
43
                var result = from doc in docs
44
                             join id2 in id2docs on new { projCd = doc.RefProjectCode, DocNo = doc.DocumentNo } equals new { projCd = id2.PROJECTNAME, DocNo = id2.DOCNAME } into gj
45
                             from dw in gj.DefaultIfEmpty()
46
                             select new Documents()
47
                             {
48
                                 Seq = doc.Seq,
49
                                 DocID = doc.DocID,
50
                                 DocumentNo = doc.DocumentNo,
51
                                 RevisonNo = doc.RevisonNo,
52
                                 RefProjectCode = doc.RefProjectCode,
53
                                 IsLatest = doc.IsLatest,
54
                                 AutoCADFilie = doc.AutoCADFilie,
55
                                 PDFFile = doc.PDFFile,
56
                                 MarkupLink = doc.MarkupLink,
57
                                 AVEVALink = doc.AVEVALink,
58
                                 DocFilePath = doc.DocFilePath,
59
                                 DocFileName = doc.DocFileName,
60
                                 JobLevel = doc.JobLevel,
61
                                 IsTypical = doc.IsTypical,
62
                                 PersonInCharge = doc.PersonInCharge,
63
                                 IsDeleted = doc.IsDeleted,
64
                                 RegisteredDate = doc.RegisteredDate,
65
                                 ModifiedDate = doc.ModifiedDate,
66
                                 DeletedDate = doc.DeletedDate,
67
                                 ToIsDiscussion = doc.ToIsDiscussion,
68
                                 ToRemarks = doc.ToRemarks,
69
                                 ToCreator = doc.ToCreator,
70
                                 ToCapturePath = doc.ToCapturePath,
71
                                 ToIsMarkup = doc.ToIsMarkup,
72
                                 FrReviewStatus = doc.FrReviewStatus,
73
                                 FrRemarks = doc.FrRemarks,
74
                                 FrCreator = doc.FrCreator,
75
                                 FrCapturePath = doc.FrCapturePath,
76
                                 FrIsMarkup = doc.FrIsMarkup,
77
                                 IsID2Work = doc.IsID2Work,
78
                                 ID2Connection = doc.ID2Connection,
79
                                 ID2StartDate = doc.ID2StartDate,
80
                                 ID2EndDate = dw?.DATETIME == null ? (DateTime?)null : Convert.ToDateTime(dw?.DATETIME),
81
                                 ID2JobTime = doc.ID2JobTime,
82
                                 ID2Status = doc.ID2Status,
83
                                 ID2Issues = doc.ID2Issues,
84
                                 AVEVAConnection = doc.AVEVAConnection,
85
                                 AVEVAConvertDate = doc.AVEVAConvertDate,
86
                                 AVEVAReviewDate = doc.AVEVAReviewDate,
87
                                 AVEVAStatus = doc.AVEVAStatus,
88
                                 AVEVAIssues = doc.AVEVAIssues,
89
                                 ReviewFilePath = doc.ReviewFilePath,
90
                                 ReviewFileName = doc.ReviewFileName,
91
                                 ProdReviewer = doc.ProdReviewer,
92
                                 ProdIsResult = doc.ProdIsResult,
93
                                 ProdRemarks = doc.ProdRemarks,
94
                                 ClientReviewer = doc.ClientReviewer,
95
                                 ClientIsResult = doc.ClientIsResult,
96
                                 ClientRemarks = doc.ClientRemarks,
97
                                 DTIsGateWay = doc.DTIsGateWay,
98
                                 DTIsImport = doc.DTIsImport,
99
                                 DTIsRegSystem = doc.DTIsRegSystem,
100
                                 DTRemarks = doc.DTRemarks,
101
                                 MarkupText = doc.MarkupText
102
                             };
103

  
104
                return result;
105

  
106
            }
107
            return docs;
108
        }
109

  
22 110
        public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList)
23 111
        {
24
            using (DocumentRepository rep = new DocumentRepository(this._DbConnectionStr))
112
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
25 113
            {
26 114
                return rep.SetDocumentData(docList, delDocList);
27 115
            }
......
29 117

  
30 118
        public Documents SetDocumentDataField(Documents doc, string userId)
31 119
        {
32
            using (DocumentRepository rep = new DocumentRepository(this._DbConnectionStr))
120
            using (DocumentRepository rep = new DocumentRepository(this._MSSQLCONNSTR))
33 121
            {
34 122
                return rep.SetDocumentDataField(doc, userId);
35 123
            }
36 124
        }
125

  
126

  
127
        //ID2
128
        public IEnumerable<ID2Drawings> GetID2DrawingsByProject(ID2ProjectInfo id2Info)
129
        {
130
            using (DocumentRepository rep = new DocumentRepository(this._ID2CONNSTR))
131
            {
132
                return rep.GetID2DrawingsByProject(id2Info);
133
            }
134
        }
37 135
    }
38 136
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)