<% '-------------------------------------------------------------发票申请 ServiceOrdID= SafeRequest(request("ServiceOrdID")) DispatchOrdID=SafeRequest(request("DispatchOrdID")) InvoiceID=SafeRequest(request("InvoiceID")) ReturnID = SafeRequest(request("ReturnID")) InvoiceType = SafeRequest(request("InvoiceType")) '发票类型 InvoiceName = SafeRequest(request("InvoiceName")) '发票抬头 InvoiceMakeout = SafeRequest(request("InvoiceMakeout")) '发票备注 InvoiceCompanyPhone= SafeRequest(request("InvoiceCompanyPhone")) '企业电话 InvoiceCompanyID = SafeRequest(request("InvoiceCompanyID")) '纳税识别号 InvoiceCompanyAdd = SafeRequest(request("InvoiceCompanyAdd")) '企业注册地址 InvoiceCompanyBank = SafeRequest(request("InvoiceCompanyBank")) '企业开户银行 InvoiceCompanyBankNo= SafeRequest(request("InvoiceCompanyBankNo")) '企业银行账号 InvoiceZipCode = SafeRequest(request("InvoiceZipCode")) '邮编 Invoice_strAdd = SafeRequest(request("Invoice_strAdd")) '邮寄地址 Invoice_strName = SafeRequest(request("Invoice_strName")) '联系人 Invoice_strPhone = SafeRequest(request("Invoice_strPhone")) '联系电话 Invoice_strEmail = SafeRequest(request("Invoice_strEmail")) '电子邮箱 InvoiceMoney = SafeRequest(request("InvoiceMoney")) '发票金额 If InvoiceMoney="" Or InvoiceMoney="0" Then%> Response.Write "开票金额不可为0!!" Response.End End If If InvoiceMoney="" Or InvoiceMoney="0" Or InvoiceType="" Or ServiceOrdID="" Then Response.Write "参数错误!!" Response.End End If If InvoiceID="0" Or InvoiceID="" Then sql="insert into InvoiceData (ServiceOrderIDPK, InvoiceType, InvoiceName, InvoiceMakeout, InvoiceCompanyPhone, InvoiceCompanyID, InvoiceCompanyAdd, InvoiceCompanyBank, InvoiceCompanyBankNo, InvoiceZipCode, Invoice_strAdd, Invoice_strName, Invoice_strPhone,Invoice_strEmail,InvoiceMoney,ApplyOAID) values ("&ServiceOrdID&","&InvoiceType&",'"&InvoiceName&"','"&InvoiceMakeout&"','"&InvoiceCompanyPhone&"','"&InvoiceCompanyID&"','"&InvoiceCompanyAdd&"','"&InvoiceCompanyBank&"','"&InvoiceCompanyBankNo&"','"&InvoiceZipCode&"','"&Invoice_strAdd&"','"&Invoice_strName&"','"&Invoice_strPhone&"','"&Invoice_strEmail&"',"&InvoiceMoney&","&session("adminID")&")" objConn.Execute sql Else sql="update InvoiceData set InvoiceType="&InvoiceType&",InvoiceName='"&InvoiceName&"',InvoiceMakeout='"&InvoiceMakeout&"',InvoiceCompanyPhone='"&InvoiceCompanyPhone&"',InvoiceCompanyID='"&InvoiceCompanyID&"',InvoiceCompanyAdd='"&InvoiceCompanyAdd&"',InvoiceCompanyBank='"&InvoiceCompanyBank&"',InvoiceCompanyBankNo='"&InvoiceCompanyBankNo&"',InvoiceZipCode='"&InvoiceZipCode&"',Invoice_strAdd='"&Invoice_strAdd&"',Invoice_strEmail='"&Invoice_strEmail&"',Invoice_strName='"&Invoice_strName&"',Invoice_strPhone='"&Invoice_strPhone&"',AuditStatus=0,AuditMakeout='"&AuditMakeout&"',InvoiceNo='"&InvoiceNo&"',InvoiceMoney="&InvoiceMoney&",AuditOAID="&session("adminID")&",AuditTime=getdate() where InvoiceID="&InvoiceID objConn.Execute sql End If Call OA_Running("申请发票:"&ServiceOrdID) rsRollbackTrans(objConn.Errors.count) '企微通知%> <% Set rs = Server.CreateObject("ADODB.Recordset") sql="select InvoiceID from InvoiceData where AuditStatus not in (3,4) and ServiceOrderIDPK="&ServiceOrdID rs.open sql,objConn,1,1 If not rs.Eof then InvoiceID = rs("InvoiceID") end if rs.close() title="新的发票申请(PC后台)" description=InvoiceName&",有一个新的发票申请,请即时处理" sql="SELECT OA_weixinID=STUFF((SELECT '|' + OA_weixinUserID from OA_User where OA_Power like '%030205%' and OA_execLevel>=1 FOR XML PATH('')), 1, 1, '')" rs.open sql,objConn,1,1 If not rs.Eof then touser = rs("OA_weixinID") end if rs.close() 'touser="liaojunliang|ylkx_vicgame" '测试 If touser<>"" And title<>"" Then '微信OA信息下发接口 appUrl="https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="&access_token args1="{" args1=args1&"""touser"": """&touser&"""," '成员ID列表(消息接收者,多个接收者用‘|’分隔,最多支持1000个)。特殊情况:指定为@all,则向关注该企业应用的全部成员发送 |liaojunliang args1=args1&"""toparty"": """"," '部门ID列表,多个接收者用‘|’分隔,最多支持100个。当touser为@all时忽略本参数 args1=args1&"""totag"": """"," '标签ID列表,多个接收者用‘|’分隔。当touser为@all时忽略本参数 args1=args1&"""agentid"": 1000006," '企业应用的id,整型。可在应用的设置页面查看 args1=args1&"""msgtype"": ""news""," args1=args1&"""news"": {" args1=args1&"""articles"":[" args1=args1&"{" args1=args1&"""title"": ""【"&title&"】""," args1=args1&"""description"": """&description&"""," args1=args1&"""url"": ""https://sys.966120.com.cn/m_Invoice.gds?InvoiceID="&InvoiceID&"&ServiceOrdID="&ServiceOrdID&"&order_type=11""" args1=args1&"}" args1=args1&"]" args1=args1&"}" args1=args1&"}" call PostBody(appUrl,args1) End If Response.Write "success" Response.End %>