프로젝트

일반

사용자정보

개정판 14a4fe9e

ID14a4fe9e5cad5394ea05e7b8d0cdfd3a4dc57440
상위 f001add7
하위 e48205a8

김동진이(가) 5년 이상 전에 추가함

issue #000 final service if sign image add , ini add

Change-Id: Ia8215111a4670f2238cdb8501b7fc63e811b60fa

차이점 보기:

FinalService.wxs
154 154
          <!-- Tell WiX to start the Service -->
155 155
          <ServiceControl Id="MonitorServiceController" Start="install" Stop="both" Remove="uninstall" Name="FinalService_Watcher" Wait="yes" />
156 156
      </Component>
157
	  <Component Id="cmpA8E411F92BD54821B9A3CEF8E01BBE63" Directory="MyAppDataFolder" Guid="6BF0D3C5-0684-4E7D-BC53-4CE092A48FFE" Win64='yes'>
158
                <File Id="fil49E6FDC6BDFC49A5AB05A71FB2D3A5AE" KeyPath="yes" Source=".\FinalService\KCOM_FinalService\KCOM_FinalService\FinalService.ini" />
159
            </Component>
157 160
    </ComponentGroup>
158 161
  </Fragment>
159 162
</Wix>
FinalService/KCOM_FinalService/KCOM_FinalService/FinalService.ini
1
[PDFMovePath]
2
URL=\\192.168.0.67\finalpdf\
3
[ApprovedImgPath]
4
URL=\\192.168.0.67\finalpdf\Approved.png
5
[CheckmarkImgPath]
6
URL=\\192.168.0.67\finalpdf\checkmark.png
7
[DebugSavePath]
8
URL=D:\\Develop\\Ensemble\\{0}_app\\VPCS_DOCLIB\\{1}\\{2}\\ToVendor\\
9
[DebugResultUrlPath]
10
URL=http://cloud.devdoftech.co.kr:5977/FinalPDF/{0}_app/VPCS_DOCLIB/{1}/{2}/ToVendor/{3}
11
[FinalServiceName]
12
NAME=FinalService
13
[UpLoadServiceUrl]
14
URL=
FinalService/KCOM_FinalService/KCOM_FinalService/Remoting/RemFinalPDFStation.cs
207 207

  
208 208
                try
209 209
                {
210
                    string soapurl = string.Empty;
211
                    using (KCOMDataModel.DataModel.KCOMEntities _systemEntity = new KCOMDataModel.DataModel.KCOMEntities(KCOMDataModel.Common.ConnectStringBuilder.KCOMConnectionString().ToString()))
212
                    {
213
                        var item = _systemEntity.PROPERTIES.Where(data => data.TYPE == "UpLoadServiceUrl").FirstOrDefault();
214
                        if(item != null)
215
                            soapurl = item.VALUE;
216
                    }
210
                    System.Text.StringBuilder url = new System.Text.StringBuilder(512);
211
                    CommonLib.Common.GetPrivateProfileString("UpLoadServiceUrl", "URL", "", url, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
212
                    string soapurl = url.ToString();
213

  
217 214
                    if(!string.IsNullOrEmpty(soapurl))
218 215
                    {
219 216
                        //Legacy IF
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_Image.cs
1 1
using System;
2 2
using System.Collections.Generic;
3
using System.IO;
3 4
using System.Linq;
4 5
using System.Net;
5 6
using System.Text;
7
using System.Xml;
6 8
using iTextSharp.text;
7 9
using iTextSharp.text.pdf;
8 10
using KCOMDataModel.DataModel;
......
16 18
        public static void DrawSign(System.Windows.Point startPoint, System.Windows.Point endPoint, List<System.Windows.Point> pointSet, PdfContentByte contentByte, string UserID, double Angle, double opac, string projectNo)
17 19
        {
18 20
            contentByte.SaveState();
21
            System.Text.StringBuilder url = new System.Text.StringBuilder(512);
22
            CommonLib.Common.GetPrivateProfileString("UpLoadServiceUrl", "URL", "", url, 512, Path.Combine(CommonLib.Common.AppDataFolder, "FinalService.ini"));
23
            string soapurl = url.ToString();
19 24

  
20
            using (CIEntities _entity = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(projectNo).ToString()))
25
            if (!string.IsNullOrEmpty(soapurl))
21 26
            {
22
                var _sign = _entity.SIGN_INFO.Where(sin => sin.MEMBER_USER_ID == UserID);
27
                var _ifsign = getEnsembleSign(UserID, soapurl);
28
                byte[] imageBytes = System.Convert.FromBase64String(_ifsign);
29
                using (System.IO.MemoryStream ms = new System.IO.MemoryStream(imageBytes))
30
                {
31
                    var midP = MathSet.getMiddlePoint(startPoint, endPoint);
32
                    List<System.Windows.Point> tempPoint = new List<System.Windows.Point>();
33
                    foreach (var item in pointSet)
34
                    {
35
                        tempPoint.Add(MathSet.RotateAbout(midP, item, Angle));
36
                    }
37

  
38
                    var Rect = GetPointsToRectX(tempPoint);
23 39

  
24
                if (_sign.Count() > 0)
40
                    Image img = Image.GetInstance(ms);
41
                    img.ScaleAbsolute(Rect.Width, Rect.Height);
42

  
43
                    img.SetAbsolutePosition(Rect.Left + ((Rect.Width - img.ScaledWidth) / 2), Rect.Bottom + ((Rect.Height - img.ScaledHeight) / 2));
44
                    var x = Rect.Left + ((Rect.Width - img.ScaledWidth) / 2);
45
                    var y = Rect.Bottom + ((Rect.Height - img.ScaledHeight) / 2);
46
                    midP = MathSet.getMiddlePoint(new System.Windows.Point(x, y), new System.Windows.Point(x + img.ScaledWidth, y + img.ScaledHeight));
47
                    System.Drawing.Drawing2D.Matrix mat2 = new System.Drawing.Drawing2D.Matrix();
48
                    mat2.RotateAt((float)Angle * -1, new System.Drawing.PointF((float)midP.X, (float)midP.Y));
49
                    contentByte.Transform(mat2);
50
                    PdfGState gs1 = new PdfGState();
51
                    gs1.FillOpacity = (float)opac;
52
                    contentByte.SetGState(gs1);
53
                    contentByte.AddImage(img);
54
                }
55
            }
56
            else
57
            {
58
                using (CIEntities _entity = new CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString(projectNo).ToString()))
25 59
                {
26
                    byte[] imageBytes = System.Convert.FromBase64String(_sign.First().SIGN_STR);
27
                    using (System.IO.MemoryStream ms = new System.IO.MemoryStream(imageBytes))
60
                    var _sign = _entity.SIGN_INFO.Where(sin => sin.MEMBER_USER_ID == UserID);
61

  
62
                    if (_sign.Count() > 0)
28 63
                    {
29
                         var midP = MathSet.getMiddlePoint(startPoint, endPoint);
30
                        List<System.Windows.Point> tempPoint = new List<System.Windows.Point>();
31
                        foreach (var item in pointSet)
64
                        byte[] imageBytes = System.Convert.FromBase64String(_sign.First().SIGN_STR);
65
                        using (System.IO.MemoryStream ms = new System.IO.MemoryStream(imageBytes))
32 66
                        {
33
                            tempPoint.Add(MathSet.RotateAbout(midP, item, Angle));
34
                        }
67
                            var midP = MathSet.getMiddlePoint(startPoint, endPoint);
68
                            List<System.Windows.Point> tempPoint = new List<System.Windows.Point>();
69
                            foreach (var item in pointSet)
70
                            {
71
                                tempPoint.Add(MathSet.RotateAbout(midP, item, Angle));
72
                            }
73

  
74
                            var Rect = GetPointsToRectX(tempPoint);
35 75

  
36
                        var Rect = GetPointsToRectX(tempPoint);
37

  
38
                        Image img = Image.GetInstance(ms);
39
                        img.ScaleAbsolute(Rect.Width, Rect.Height);
40

  
41
                        img.SetAbsolutePosition(Rect.Left + ((Rect.Width - img.ScaledWidth) / 2), Rect.Bottom + ((Rect.Height - img.ScaledHeight) / 2));
42
                        var x = Rect.Left + ((Rect.Width - img.ScaledWidth) / 2);
43
                        var y = Rect.Bottom + ((Rect.Height - img.ScaledHeight) / 2);
44
                        midP = MathSet.getMiddlePoint(new System.Windows.Point(x, y), new System.Windows.Point(x + img.ScaledWidth, y + img.ScaledHeight));
45
                        System.Drawing.Drawing2D.Matrix mat2 = new System.Drawing.Drawing2D.Matrix();
46
                        mat2.RotateAt((float)Angle * -1, new System.Drawing.PointF((float)midP.X, (float)midP.Y));
47
                        contentByte.Transform(mat2);
48
                        PdfGState gs1 = new PdfGState();
49
                        gs1.FillOpacity = (float)opac;
50
                        contentByte.SetGState(gs1);
51
                        contentByte.AddImage(img);
76
                            Image img = Image.GetInstance(ms);
77
                            img.ScaleAbsolute(Rect.Width, Rect.Height);
78

  
79
                            img.SetAbsolutePosition(Rect.Left + ((Rect.Width - img.ScaledWidth) / 2), Rect.Bottom + ((Rect.Height - img.ScaledHeight) / 2));
80
                            var x = Rect.Left + ((Rect.Width - img.ScaledWidth) / 2);
81
                            var y = Rect.Bottom + ((Rect.Height - img.ScaledHeight) / 2);
82
                            midP = MathSet.getMiddlePoint(new System.Windows.Point(x, y), new System.Windows.Point(x + img.ScaledWidth, y + img.ScaledHeight));
83
                            System.Drawing.Drawing2D.Matrix mat2 = new System.Drawing.Drawing2D.Matrix();
84
                            mat2.RotateAt((float)Angle * -1, new System.Drawing.PointF((float)midP.X, (float)midP.Y));
85
                            contentByte.Transform(mat2);
86
                            PdfGState gs1 = new PdfGState();
87
                            gs1.FillOpacity = (float)opac;
88
                            contentByte.SetGState(gs1);
89
                            contentByte.AddImage(img);
90
                        }
52 91
                    }
53 92
                }
54 93
            }
94
            
55 95
            contentByte.RestoreState();
56 96
        }
57 97

  
98
        static string getEnsembleSign(string user_id, string soapurl)
99
        {
100
            string result = string.Empty;
101

  
102
            try
103
            {
104
                WebClient webClient = new WebClient();
105
                string data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ens=\"http://EnsemblePlus.Webservice\"> <soapenv:Header/> <soapenv:Body> <ens:checkoutSignImage>"
106
                    + "<ens:sUserNo>" + user_id + "</ens:sUserNo>"
107
                    + "</ens:checkoutSignImage> </soapenv:Body></soapenv:Envelope>";
108
                webClient.Headers.Add(HttpRequestHeader.ContentType, "text/xml");
109
                webClient.Headers.Add("SOAPAction", "http://EnsemblePlus.Webservice");
110
                var _result = webClient.UploadString(new Uri(soapurl), data);
111
                XmlDocument xmlDoc = new XmlDocument();
112
                xmlDoc.LoadXml(_result);
113
                XmlNodeList list = xmlDoc.GetElementsByTagName("checkoutSignImageResponse");
114
                foreach (XmlNode xn in list)
115
                {
116
                    result = xn["checkoutSignImageReturn"].InnerText;
117
                }
118
                if (!result.Contains("No business object"))
119
                {
120
                    return result;
121
                }
122
                else
123
                {
124
                    return null;
125
                }
126
            }
127
            catch (Exception ex)
128
            {
129
                throw ex;
130
            }
131

  
132

  
133
        }
58 134
        public static void DrawImage(System.Windows.Point startPoint, System.Windows.Point endPoint, List<System.Windows.Point> pointSet, PdfContentByte contentByte, string filePath, double Angle, double opac)
59 135
        {
60 136
            contentByte.SaveState();
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.csproj
162 162
    </Page>
163 163
  </ItemGroup>
164 164
  <ItemGroup>
165
    <ProjectReference Include="..\CommonLib\CommonLib.csproj">
166
      <Project>{ee9aaabc-1678-43a4-878e-cedbb577cf01}</Project>
167
      <Name>CommonLib</Name>
168
    </ProjectReference>
165 169
    <ProjectReference Include="..\IFinalPDF\IFinalPDF.csproj">
166 170
      <Project>{784438BE-2074-41AE-A692-24E1A4A67FE3}</Project>
167 171
      <Name>IFinalPDF</Name>

내보내기 Unified diff

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