<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
|
<%Session.CodePage=65001%>
|
<!--#include virtual="/inc/chkadmin.gds"-->
|
<!--#include virtual="/inc/function.gds"-->
|
<%
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
'定时任务相关
|
sql="update ServiceOrder set ServiceOrdOperationRemarks=replace(ServiceOrdOperationRemarks,'[客户未正式提交需求,可不联系]',''),ServiceOrdState=4,ServiceOrd_AP_ID=0,ServiceOrd_AP_Time=getdate(),ServiceOrdCancelReason=9,ServiceOrdCancelReasonTXT='自动取消' where ServiceOrdState not in (4) and ServiceOrdOperationRemarks like '%客户未正式提交需求,可不联系%' and ServiceOrdUserUpdateTime<DATEADD(Minute,-20,GETDATE())"
|
objConn.Execute sql
|
|
NC_OAID=session("adminID")
|
NC_ID=Request("NC_ID")
|
If NC_ID<>"" Then
|
sql="update Notification set NC_Read=1,NC_ReadTime=getdate(),NC_ReadOAID="&NC_OAID&" where (NC_Read=0 or NC_ReadOAID=0) and NC_ID="&NC_ID
|
objConn.Execute sql
|
Response.Write "1"
|
Else
|
'If OAUser(NC_OAID,"DepartmentID")="9" Then
|
' NC_OAID=NC_OAID&",78"
|
'End If
|
If InStr(admin_OrderClass,"BF")>0 Or InStr(admin_OrderClass,"SA")>0 Then '广州总部人员只通知广州本地和小程序相关订单
|
OAClass="BF,SA"
|
CXClassSql=" or NC_Name like '%小程序%'"
|
Else
|
OAClass=admin_OrderClass
|
End If
|
sql="select id from dbo.OA_Competency where OA_CompetencyID=1 and OA_CompetencyUserID="&session("adminID") '查询账号是否有客服权限
|
rs.open sql,objConn,1,1
|
If not rs.Eof And OAClass<>"" Then
|
NCOA_SQL=" (NC_OAID in ("&NC_OAID&")"
|
OAClassSP=SPLIT(OAClass,",")
|
for n = 0 to UBOUND(OAClassSP)
|
If OAClassSP(n)<>"" Then NCOA_SQL=NCOA_SQL&" or NC_OAClass='"&OAClassSP(n)&"'"
|
next
|
NCOA_SQL=NCOA_SQL&CXClassSql&") and "
|
Else
|
NCOA_SQL=" NC_OAID in ("&NC_OAID&") and "
|
End If
|
rs.close()
|
|
If session("adminID")=8 And 1=2 Then
|
sql="select count(NC_ID) from Notification where NC_Read=0 and NC_Time<=GETDATE() and NC_Time>=GETDATE()-1"
|
Else
|
sql="select count(NC_ID) from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and NC_Time>=GETDATE()-1 and NC_Name Not like '%已返回%' and NC_Name Not like '%成功支付%' and NC_Name Not like '%上传%'"
|
End If
|
'Response.Write sql
|
rs.open sql,objConn,1,1
|
UnitOrdInt=rs(0)
|
rs.close()
|
If CInt(UnitOrdInt)=0 Then
|
sql="select count(NC_ID) from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and NC_Time>=GETDATE()-1 and (NC_Name like '%已返回%' or NC_Name like '%成功支付%' or NC_Name like '%上传%')"
|
rs.open sql,objConn,1,1
|
UnitOrdInt=rs(0)
|
rs.close()
|
If CInt(UnitOrdInt)>0 Then UnitOrdInt=-UnitOrdInt
|
End If
|
If UnitOrdInt<>0 Then
|
If CInt(UnitOrdInt)>0 Then
|
sql="select top 1 NC_ID,NC_Name,NC_Content,NC_PageUrl from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and NC_Time>=GETDATE()-1 and NC_Name Not like '%已返回%' and NC_Name Not like '%成功支付%' and NC_Name Not like '%上传%' order by NC_Time desc"
|
Else
|
sql="select top 1 NC_ID,NC_Name,NC_Content,NC_PageUrl from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and NC_Time>=GETDATE()-1 and (NC_Name like '%已返回%' or NC_Name like '%成功支付%' or NC_Name like '%上传%') order by NC_Time desc"
|
End If
|
rs.open sql,objConn,1,1
|
If not rs.Eof then
|
NC_ID = rs("NC_ID")
|
NC_Name = rs("NC_Name")
|
NC_Content = rs("NC_Content")
|
NC_PageUrl = rs("NC_PageUrl")&"&NC_ID="&NC_ID
|
If InStr(NC_Name,"新订单")>0 Then
|
NC_Content=Replace(NC_Content,"服务单号:",NC_Name)
|
End If
|
If InStr(NC_Content,"成功支付")>0 Then
|
NC_Content=Replace(NC_Content,"[1]","[现金]")
|
NC_Content=Replace(NC_Content,"[5]","[POS收款]")
|
NC_Content=Replace(NC_Content,"[2]","[银行转账]")
|
NC_Content=Replace(NC_Content,"[3]","[微信支付]")
|
NC_Content=Replace(NC_Content,"[4]","[支付宝]")
|
NC_Content=Replace(NC_Content,"[6]","[挂账]")
|
NC_Content=Replace(NC_Content,"[7]","[易医通挂账]")
|
NC_Content=Mid(NC_Content,1,InStr(NC_Content,"元")+1)
|
End If
|
End If
|
rs.close()
|
If Abs(UnitOrdInt)>1 Then NC_PageUrl="/Notification.gds"
|
End If
|
If UnitOrdInt="0" Then UnitOrdInt=""
|
|
Response.Write UnitOrdInt&"|"&NC_ID&"|"&NC_Name&"|"&NC_Content&"|"&NC_PageUrl
|
End If
|
%>
|