linux

efgp

外掛發單

try
{
    WorkflowServiceService ws = new WorkflowServiceService();
    string FID = ws.findFormOIDsOfProcess("PKG16962271523731");
    //string gpFormFieldTemplate = ws.getFormFieldTemplate(FID);

    string UserID = userInfo.SelectedItem.Value;
    string DeptID = userInfo.SelectedItem.Text;

    string[] values = new string[] {
        qctype.SelectedValue,
        qcd01.SelectedItem.Text,
        qcd01.SelectedItem.Value
    };
    string sample_xml = @"<AQ0003>
        <Dropdown30 id='Dropdown30' dataType='java.lang.String'>{0}</Dropdown30>
        <DialogInputLabel32 id='DialogInputLabel32' dataType='java.lang.String' lbl='{1}' txt='{2}' hdn=''></DialogInputLabel32>
    </AQ0003>";
    string send_xml = String.Format(sample_xml, values);

    string a = ws.invokeProcess("PKG16962271523731", UserID, DeptID, FID, send_xml, "SUBJECT");


    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alertSuccess('送單完成');", true);

}
catch (Exception ex)
{
    string errMsg = String.Format("alertErr('{0}','{1}');", "發生錯誤", ex.Message.Replace("\"", "").Replace("'", "").Replace("\r", "").Replace("\n", ""));
    ScriptManager.RegisterStartupScript(this, this.GetType(), "", errMsg, true);
}

#抓發單人員資料

<div style="display: none;">
	<label class="ui-input-label">部門*</label>
	<asp:DropDownList ID="userInfo" runat="server" DataSourceID="SqlDataSource_GetUserDept" DataTextField="DeptID" DataValueField="UserID"></asp:DropDownList>
</div>
<asp:SqlDataSource ID="SqlDataSource_GetUserDept" runat="server" ConnectionString="<%$ ConnectionStrings:BPMConnectionString %>" SelectCommand="SELECT DISTINCT Users.id UserID,
    Users.userName,
    OrganizationUnit.id DeptID,
    OrganizationUnit.organizationUnitName
    FROM Users
    INNER JOIN Functions ON Functions.occupantOID = Users.OID
    INNER JOIN OrganizationUnit ON OrganizationUnit.OID = Functions.organizationUnitOID
    WHERE Users.leaveDate is NULL and Functions.isMain = 1 and OrganizationUnit.organizationUnitType = 0 and Users.id = @uid">
    <SelectParameters>
        <asp:SessionParameter Name="uid" SessionField="uid" />
    </SelectParameters>
</asp:SqlDataSource>

nginx反向代理範本

server {
        listen 8086 ssl;

        ssl_certificate /etc/letsencrypt/live/www.tscs.com.tw/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/www.tscs.com.tw/privkey.pem;
        server_name www.tscs.com.tw;

        error_page 497 https://$host:$server_port$request_uri;

        location / {
                proxy_pass http://10.3.1.26:8086;

                proxy_set_header Host $host:$server_port;
                #proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto https;
        }
}

GP的webservice 編譯成DLL手法

wsdl http://10.3.1.26:8086/NaNaWeb/services/Version?wsdl /out:WS1.cs
csc /t:library WS1.cs

webservice範本

<%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="WebService" %>
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

/// <summary>
/// WebService 的摘要描述
/// </summary>
[WebService(Namespace = "http://10.3.1.32/")]
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
//[SoapRpcService(RoutingStyle = SoapServiceRoutingStyle.SoapAction)]
[SoapRpcService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]


public class WebService : System.Web.Services.WebService
{

    public WebService()
    {
        //如果使用設計的元件,請取消註解下列一行
        //InitializeComponent(); 
    }

    [WebMethod]
    public int HelloWorld(string a,string b)
    {

        using (System.IO.StreamWriter l_file = new System.IO.StreamWriter(@"C:\test\txt.txt", false, System.Text.Encoding.Default))
        {
            l_file.Write(a + "@" + b);
            return 7;
        }        


    }

}

#javascript版本

const soapRequest = `<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
    <findFormOIDsOfProcess>
      <pProcessPackageId>PKG16691687811770</pProcessPackageId>
    </findFormOIDsOfProcess>
  </soapenv:Body>
</soapenv:Envelope>`;

const url = '/NaNaWeb/services/WorkflowService';
fetch(url, {
    method: 'POST',
    headers: {
        'SOAPAction': 'application/soap+xml; charset=utf-8'
    },
    body: soapRequest,
})
.then(response => response.text())
.then(responseData => {
    document.getElementById('d').innerHTML= responseData;
})
catch(error => {
    alert(error);
});

WEBAPP

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EFGP_WEBAPP01.aspx.cs" Inherits="EFGP_WEBAPP01" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class EFGP_WEBAPP01 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string a = Request.QueryString["get01"];
        string b = Request.QueryString["get02"];

        using (System.IO.StreamWriter l_file = new System.IO.StreamWriter(@"C:\test\txt.txt", false, System.Text.Encoding.Default))
        {
            l_file.Write(a + "@" + b);
        }

    }
}
ALTER TRIGGER [dbo].[TRIGER_TEST]
   ON [dbo].[ConnectedUserInfo]
   AFTER INSERT
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	UPDATE [ConnectedUserInfo] SET isVip=1
	WHERE isVip=0

END

反向代理(3步驟)

D:\BPM\wildfly-15.0.0.Final\standalone\configuration\standalone-full.xml

<location name="/NaNaWeb/cylinder" handler="my-app-proxy"/>
<reverse-proxy name="my-app-proxy">
    <host name="keycloak-host" outbound-socket-binding="remote-host" path="/cylinder"/>
</reverse-proxy>
<outbound-socket-binding name="remote-host">
    <remote-destination host="10.3.1.32" port="80"/>
</outbound-socket-binding>
;WITH dep AS (
	--root
	SELECT OID,
	1 AS [Level],
	organizationUnitName,
	CAST('1' AS VARCHAR(MAX)) PartLevel,
	CAST('/'+organizationUnitName AS VARCHAR(MAX)) PartPath
	FROM [OrganizationUnit] WHERE superUnitOID IS NULL
	
	UNION ALL
	
	SELECT A.OID,
	[Level] + 1,
	A.organizationUnitName,
	CAST(B.PartLevel+'.'+  CAST([Level] AS VARCHAR(MAX)) AS VARCHAR(MAX)) PartLevel,
	CAST(B.PartPath+'/'+A.organizationUnitName AS VARCHAR(MAX)) PartPath
	FROM [OrganizationUnit] A
	INNER JOIN dep B ON A.superUnitOID = B.OID
)
SELECT * FROM dep
ALTER TRIGGER [dbo].[TRIGER_TEST]
   ON [dbo].[ConnectedUserInfo]
   AFTER INSERT
AS 
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    UPDATE [ConnectedUserInfo] SET isVip=1
    WHERE isVip=0

END

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。