From d10ed72968a41dfc2c963101eaa16276a7f7b1a6 Mon Sep 17 00:00:00 2001
From: hzj <1831054011@qq.com>
Date: 星期一, 13 十月 2025 14:20:51 +0800
Subject: [PATCH] Merge branch 'main' of http://8.134.184.104:10801/r/came
---
API/v1/SendSms.php | 43 ++
alipay-config.properties | 1
SimpleQRCodeGenerator.java | 1
pom.xml | 1
ConfigLoader.java | 1
admin_save_127.asp | 88 ++++++
API/v3/OrderPrice.gds | 12
admin_save_27.gds | 158 ++++++++++++
weixin/upload_file.php | 216 ++++++++++++++++
weixin/upload_test.html | 214 ++++++++++++++++
AlipayQRCodeUtil.java | 1
API/User/index.gds | 30 ++
AlipayQRCodeGenerator.java | 1
13 files changed, 754 insertions(+), 13 deletions(-)
diff --git a/API/User/index.gds b/API/User/index.gds
index 5748770..7d7f0ba 100644
--- a/API/User/index.gds
+++ b/API/User/index.gds
@@ -85,6 +85,16 @@
End If
'绛惧悕楠岃瘉---end
+Function saveCoupon(objConn,Money,UserID,Remarks,Name)
+ CouponNO=DTimeID()&getIDnumbers(6)
+ CouponMoney=Money
+ CouponRemarks=Remarks
+ CouponName=Name
+ If UserID="" Then UserID=0
+ sql="Insert into Coupon (CouponNO,CouponName,CouponMoney,CouponDate_Ent,CouponRemarks,ServiceOrdIDPK,ToUserID) values ('"&CouponNO&"','"&CouponName&"',"&CouponMoney&",getdate()+365*2,'"&CouponRemarks&"',0,"&UserID&")"
+ objConn.Execute sql
+End Function
+
objConn.BeginTrans
If errcode="" then
@@ -163,6 +173,8 @@
ADUser="155"
ElseIf UserSourceSP(i)="Iid166" Then
ADUser="166"
+ ElseIf UserSourceSP(i)="Iid193" Then
+ ADUser="193"
End If
End If
Next
@@ -427,7 +439,21 @@
NewUserCoupon=0
End If
- If (ADUser="153") And NewUser=1 And DateDiff("d",now(),"2023-9-15")<=0 And DateDiff("d",now(),"2024-6-30")>=0 Then
+ if (ADUser="193") And DateDiff("d",now(),"2025-9-5")<=0 And DateDiff("d",now(),"2028-1-1")>=0 Then
+ sql="select * from Coupon where CouponDate_Ent>=getdate() and CouponName like '鍩庡競鏈嶅姟 浼樻儬%' and ToUserID="&UserID
+ rs.open Sql,objConn,1,1
+ If rs.Eof then
+ '鍏氦杞﹀箍鍛婁紭鎯�
+ '鍩庡競鏈嶅姟浼樻儬 鍙戜紭鎯犲埜锛� 甯傚唴50 鐪佸唴200 鐪佸500 楂橀搧1000 鑸┖3000
+ saveCoupon objConn,50,UserID,"","鍩庡競鏈嶅姟 浼樻儬 50鍏冧唬閲戝埜-锛堟湰甯傝鏀垮尯鍩熷唴鏁戞姢杞﹁浆杩愬彲浣跨敤锛�"
+ saveCoupon objConn,50,UserID,"","鍩庡競鏈嶅姟 浼樻儬 50鍏冧唬閲戝埜-锛堟湰甯傝鏀垮尯鍩熷唴鏁戞姢杞﹁浆杩愬彲浣跨敤锛�"
+ saveCoupon objConn,200,UserID,"","鍩庡競鏈嶅姟 浼樻儬 200鍏冧唬閲戝埜-锛堝崟绋嬭窛绂�100鍏噷浠ヤ笂鏁戞姢杞﹁浆杩愬彲浣跨敤锛�"
+ saveCoupon objConn,500,UserID,"","鍩庡競鏈嶅姟 浼樻儬 500鍏冧唬閲戝埜-锛堝崟绋嬭窛绂�500鍏噷浠ヤ笂鏁戞姢杞﹁浆杩愬彲浣跨敤锛�"
+ saveCoupon objConn,1000,UserID,"","鍩庡競鏈嶅姟 浼樻儬 1000鍏冧唬閲戝埜-锛堥珮閾佸尰鐤楄浆杩愬彲浣跨敤锛�"
+ saveCoupon objConn,3000,UserID,"","鍩庡競鏈嶅姟 浼樻儬 3000鍏冧唬閲戝埜-锛堣埅绌哄尰鐤楄浆杩愬彲浣跨敤锛�"
+ End if
+ rs.close()
+ ElseIf (ADUser="153") And NewUser=1 And DateDiff("d",now(),"2023-9-15")<=0 And DateDiff("d",now(),"2024-6-30")>=0 Then
sql="select * from Coupon where CouponDate_Ent>=getdate() and CouponName like '鍩庡競鏈嶅姟浼樻儬%' and ToUserID="&UserID
rs.open Sql,objConn,1,1
If rs.Eof then
@@ -934,6 +960,8 @@
webJson="""UserInformation"":{""Title"":""鐢ㄦ埛浼樻儬鍒�"",""Content"":"""",""PicUrl"":""https://api.966120.com.cn/OA_img/20231013160503.png"",""Url"":""/pages/my/login/login"",""OpenType"":""navigateTo""}"
ElseIf UserID<>"0" And FormIDInt=0 And (InStr(pages,"148")>0 Or InStr(pages,"155")>0 Or InStr(CouponNames,"浠i噾鍒�")>0) Then
webJson="""UserInformation"":{""Title"":""鐢ㄦ埛浼樻儬鍒�"",""Content"":"""",""PicUrl"":""https://api.966120.com.cn/OA_img/ad_20230727.png"",""Url"":"""",""OpenType"":""""}"
+ ElseIf wxOpenid<>"" and FormIDInt=0 and (InStr(pages,"193")>0 or InStr(CouponNames,"浠i噾鍒�")>0) then
+ webJson="""UserInformation"":{""Title"":""鐢ㄦ埛浼樻儬鍒�"",""Content"":""&pages&"",""PicUrl"":""https://api.966120.com.cn/OA_img/ad_0904.png"",""Url"":"""",""OpenType"":""""}"
Else
webJson="""UserInformation"":0"
End If
diff --git a/API/v1/SendSms.php b/API/v1/SendSms.php
index 0694d6c..fe9cb84 100644
--- a/API/v1/SendSms.php
+++ b/API/v1/SendSms.php
@@ -100,8 +100,9 @@
}
function sendPayUrl($phone,$name,$payurl){
- $payurl="wx.966120.com.cn/?n=".$payurl;
- $content='銆愬箍涓滄皯鑸尰鐤椼�戠Щ鍔ㄦ敮浠樻寚寮曪細'.$name.'鎮ㄥソ锛佽鐐瑰嚮浠ヤ笅閾炬帴杩涘叆淇℃伅纭鍜屾敮浠樼晫闈€�傛牳瀵规偍鐨勫嚭杞︿俊鎭棤璇悗锛屽彲閫夋嫨鏀粯瀹濇垨鑰呭井淇℃敮浠橈細' .$payurl;
+ $paycode=$payurl;
+ $payurl="wx.966120.com.cn";
+ $content='銆愬箍涓滄皯鑸尰鐤椼�戠Щ鍔ㄦ敮浠樻寚寮曪細'.$name.'鎮ㄥソ锛佽鐐瑰嚮浠ヤ笅閾炬帴杩涘叆淇℃伅纭鍜屾敮浠樼晫闈€�傛牳瀵规偍鐨勫嚭杞︿俊鎭棤璇悗锛屽彲閫夋嫨鏀粯瀹濇垨鑰呭井淇℃敮浠橈細' .$payurl.' 鐧诲綍鐮侊細'.$paycode;
// echo $content;
require './sms/SmsSend.php';
$sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
@@ -109,6 +110,27 @@
// print_r($result);
return $result;
+}
+function sendValidate($phone,$code){
+ $content='銆愬箍涓滄皯鑸尰鐤椼�戦獙璇佺爜锛�'.$code.'锛屾偍姝e湪鐧诲綍锛岃嫢闈炴湰浜烘搷浣滐紝璇峰嬁娉勯湶.';
+ require './sms/SmsSend.php';
+ $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
+ $result = $sms->sendSmsOne([['phone' => $phone, 'content' => $content]], '');
+ return $result;
+}
+function sendCallCar($phone,$UserName,$CarLicense){
+ $content='銆愬箍涓滄皯鑸尰鐤椼�戞偍棰勮鐨勬晳鎶よ溅宸茬粡鍑哄彂銆傝礋璐d汉'.$UserName.'锛岃溅鐗�'.$CarLicense.'銆傝鎮ㄧ暀鎰忓苟鎻愰槻鍋囧啋銆傛杩庡叧娉ㄢ��966120姘戣埅鍖荤枟蹇嚎鈥濆井淇℃湇鍔″彿锛屽彲鏌ョ湅鏈稛杞繍淇℃伅锛屽苟鍒嗕韩杞﹁締鐨勫疄鏃朵綅缃粰浜插弸銆�';
+ require './sms/SmsSend.php';
+ $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
+ $result = $sms->sendSmsOne([['phone' => $phone, 'content' => $content]], '');
+ return $result;
+}
+function sendPayOK($phone,$name,$m1,$d1,$m2){
+ $content='銆愬箍涓滄皯鑸尰鐤椼��'.$name.'鎮ㄥソ锛佹偍宸叉敮浠樹簡瀹氶噾'.$m1.'鍏冿紝鎴戜滑鐨勬湇鍔″洟闃熷埌杈惧嚭鍙戝湴'.$d1.'鍚庯紝灏嗘敹榻愪綑涓�'.$m2.'鍏冨悗鍐嶅嚭鍙戙�傚闇�鍙戠エ锛岃鍏虫敞鈥�966120姘戣埅鍖荤枟蹇嚎鈥濓紝浠诲姟缁撴潫鍚庡湪鈥滄垜鐨勨��--鈥滃彂绁ㄧ敵璇封�濆鐢宠銆傚鏈嶅姟鍥㈤槦宸茬粡鍑鸿溅锛岃瀹氶噾鏃犳硶閫�鍥烇紝璇风煡鎮夈�傛湁鐤戦棶娆㈣繋闅忔椂鎷ㄦ墦鏈嶅姟鐑嚎 (020) 966120锛岃阿璋紒';
+ require './sms/SmsSend.php';
+ $sms = new SmsSend('gdmhhy', 'lLsZyz3YVYKQ');
+ $result = $sms->sendSmsOne([['phone' => $phone, 'content' => $content]], '');
+ return $result;
}
// 璋冪敤绀轰緥锛�
set_time_limit(0);
@@ -124,7 +146,7 @@
//鏀粯鎸囧紩
$name=empty($_REQUEST['name'])!=false ? "" : addslashes($_REQUEST['name']); //鍐呭--濮撳悕
$payurl=empty($_REQUEST['payurl'])!=false ? "" : addslashes($_REQUEST['payurl']); //鍐呭--鐭摼鎺ラ獙璇佺爜
- $codejson=json_encode(array("name"=>$name,"payurl"=>$payurl), JSON_UNESCAPED_UNICODE);
+ // $codejson=json_encode(array("name"=>$name,"payurl"=>$payurl), JSON_UNESCAPED_UNICODE);
$result=sendPayUrl($Phone,$name,$payurl);
echo json_encode($result);
return;
@@ -133,7 +155,10 @@
//鍑鸿溅鐭俊
$UserName=empty($_REQUEST['UserName'])!=false ? "" : addslashes($_REQUEST['UserName']); //鍐呭--璐熻矗浜�
$CarLicense=empty($_REQUEST['CarLicense'])!=false ? "" : addslashes($_REQUEST['CarLicense']); //鍐呭--杞︾墝
- $codejson=json_encode(array("UserName"=>$UserName,"CarLicense"=>$CarLicense), JSON_UNESCAPED_UNICODE);
+ // $codejson=json_encode(array("UserName"=>$UserName,"CarLicense"=>$CarLicense), JSON_UNESCAPED_UNICODE);
+ $result=sendCallCar($Phone,$UserName,$CarLicense);
+ echo json_encode($result);
+ return;
}elseif ($lateCode=="SMS_219737201") {
//璇勪环鐭俊
$payurl=empty($_REQUEST['payurl'])!=false ? "" : addslashes($_REQUEST['payurl']); //鍐呭--鐭摼鎺ラ獙璇佺爜
@@ -144,10 +169,16 @@
$m1=empty($_REQUEST['m1'])!=false ? "" : addslashes($_REQUEST['m1']); //鍐呭--鏀跺埌瀹氶噾
$m2=empty($_REQUEST['m2'])!=false ? "" : addslashes($_REQUEST['m2']); //鍐呭--鏀堕綈浣欎笅閲戦
$d1=empty($_REQUEST['d1'])!=false ? "" : addslashes($_REQUEST['d1']); //鍐呭--鍑哄彂鍦�
- $codejson=json_encode(array("name"=>$name,"m1"=>$m1,"m2"=>$m2,"d1"=>$d1), JSON_UNESCAPED_UNICODE);
+ // $codejson=json_encode(array("name"=>$name,"m1"=>$m1,"m2"=>$m2,"d1"=>$d1), JSON_UNESCAPED_UNICODE);
+ $result=sendPayOK($Phone,$name,$m1,$d1,$m2);
+ echo json_encode($result);
+ return;
}elseif ($code!=''){
//鍙戦�侀獙璇佺爜
- $codejson=json_encode(array("code"=>$code), JSON_UNESCAPED_UNICODE);
+ // $codejson=json_encode(array("code"=>$code), JSON_UNESCAPED_UNICODE);
+ $result=sendValidate($Phone,$code);
+ echo json_encode($result);
+ return;
}
if ($Phone!='' and $codejson!='' and $lateCode!='') {
$response = SmsDemo::sendSms($Phone,$codejson,$lateCode,$SignName);
diff --git a/API/v3/OrderPrice.gds b/API/v3/OrderPrice.gds
index 8ceb106..8696145 100644
--- a/API/v3/OrderPrice.gds
+++ b/API/v3/OrderPrice.gds
@@ -158,7 +158,7 @@
If StartAddress_lat=0 And errcode=0 Then
appUrl="https://api.map.baidu.com/geocoding/v3/"
- args1="address="&StartAddress&"&output=json&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
+ args1="address="&StartAddress&"&output=json&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
HTMLCODE= GetBody(appUrl,args1)
'Response.Write HTMLCODE
'Response.End
@@ -186,7 +186,7 @@
End If
If EndAddress_lat=0 And errcode=0 Then
appUrl="https://api.map.baidu.com/geocoding/v3/"
- args1="address="&EndAddress&"&output=json&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
+ args1="address="&EndAddress&"&output=json&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
HTMLCODE= GetBody(appUrl,args1)
'Response.Write HTMLCODE
'Response.End
@@ -213,7 +213,7 @@
'鍦板尯鎶ヤ环鏂规
appUrl="https://api.map.baidu.com/reverse_geocoding/v3/"
- args1="location="&Region_lat&","&Region_lng&"&output=json&latest_admin=1&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
+ args1="coordtype=gcj02ll&location="&Region_lat&","&Region_lng&"&output=json&latest_admin=1&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
HTMLCODE= GetBody(appUrl,args1)
json = HTMLCODE
'Response.Write HTMLCODE
@@ -229,7 +229,7 @@
If TraDistance=0 Then
'璺嚎瑙勫垝璺濈(鍏噷)
appUrl="https://api.map.baidu.com/directionlite/v1/driving"
- args1="origin="&StartAddress_lat&","&StartAddress_lng&"&destination="&EndAddress_lat&","&EndAddress_lng&"&coord_type=wgs84&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
+ args1="origin="&StartAddress_lat&","&StartAddress_lng&"&destination="&EndAddress_lat&","&EndAddress_lng&"&coord_type=wgs84&ak=itVkbEKpECSqWgP9u8Po7ZiBkUHR9p2p"
HTMLCODE= GetBody(appUrl,args1)
json = HTMLCODE
@@ -390,7 +390,7 @@
OrderPriceFRM = OrderPriceFRM & "+"&WaitingInt&"*"&IRWaitingCost
OrderPriceTXT = OrderPriceTXT&"绛夊緟璐圭敤:"&WaitingInt*IRWaitingCost&"鍏僜n"
End If
- If ServiceOrdApptDate<>"" Then '闈炲伐浣滄椂闂存湇鍔¤垂鐢�20250812锛屽懆涓�~鍛ㄤ簲鏅氫笂21鐐�30鍒嗗悗鑷虫棭涓�7鐐规暣鍓嶄负1.3鍊�
+ If ServiceOrdApptDate<>"" Then '闈炲伐浣滄椂闂存湇鍔¤垂鐢�20250624锛屽懆涓�~鍛ㄤ簲鏅氫笂22鐐瑰悗鑷虫棭涓�7鐐规暣鍓嶄负1.3鍊�
sql="select SpecialRatio from SpecialDates where SpecialDates='"&formatdatetime(ServiceOrdApptDate,2)&"'"
rs.open sql,objConn,1,1
if not rs.Eof Then
@@ -398,7 +398,7 @@
OrderPriceFRM = OrderPriceFRM & OrderPrice*(SpecialRatio-1)
OrderPriceTXT = OrderPriceTXT&"鑺傚亣鏃ユ椂闂存湇鍔¤垂鐢�:"&OrderPrice*(SpecialRatio-1)&"鍏僜n"
OrderPrice=OrderPrice*SpecialRatio
- ElseIf (hour(ServiceOrdApptDate)>=21 And minute(ServiceOrdApptDate)>=30) Or hour(ServiceOrdApptDate)<7 Then
+ ElseIf (hour(ServiceOrdApptDate)>=22 Or hour(ServiceOrdApptDate)<7) Then
OrderPriceFRM = OrderPriceFRM & OrderPrice*0.3
OrderPriceTXT = OrderPriceTXT&"闈炲伐浣滄椂闂存湇鍔¤垂鐢�:"&OrderPrice*0.3&"鍏僜n"
OrderPrice=OrderPrice*1.3
diff --git a/AlipayQRCodeGenerator.java b/AlipayQRCodeGenerator.java
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/AlipayQRCodeGenerator.java
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/AlipayQRCodeUtil.java b/AlipayQRCodeUtil.java
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/AlipayQRCodeUtil.java
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/ConfigLoader.java b/ConfigLoader.java
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/ConfigLoader.java
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/SimpleQRCodeGenerator.java b/SimpleQRCodeGenerator.java
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/SimpleQRCodeGenerator.java
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin_save_127.asp b/admin_save_127.asp
new file mode 100644
index 0000000..5ab7118
--- /dev/null
+++ b/admin_save_127.asp
@@ -0,0 +1,88 @@
+
+<%
+'-------------------------------------------------------------鍙戠エ鐢宠
+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)
+
+'浼佸井閫氱煡%>
+<!--#include virtual="/weixin/JsonPost_1000006.gds"-->
+<%
+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," '浼佷笟搴旂敤鐨刬d锛屾暣鍨嬨�傚彲鍦ㄥ簲鐢ㄧ殑璁剧疆椤甸潰鏌ョ湅
+ 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
+%>
\ No newline at end of file
diff --git a/admin_save_27.gds b/admin_save_27.gds
new file mode 100644
index 0000000..d3f6155
--- /dev/null
+++ b/admin_save_27.gds
@@ -0,0 +1,158 @@
+<%
+
+
+'鍑鸿溅鐗╁搧鍗曞彿鐢熸垚
+Function NewDispatchMRPOrderID(OrderType,DispatchOrdID,Type1)
+ NewDispatchMRPOrderID="MRP-"&OrderType&"-"&DispatchOrdID&Type1
+End Function
+'鍑鸿溅鐗╁搧鍗曡繑鍥�
+Function DispatchMRPOrderReturn(OrderType,DispatchOrdID)
+ MRP_OrderID_Out=NewDispatchMRPOrderID(OrderType,DispatchOrdID,"Out")
+ MRP_OrderID=NewDispatchMRPOrderID(OrderType,DispatchOrdID,"In")
+ OutWarehouseID=5 '杞嚭浠�(鍑鸿溅浠诲姟)
+ InWarehouseID=2 '杞叆浠�(闆嗙洓鎬婚儴姝e父浠撲竴)
+ Set adminrs = Server.CreateObject("ADODB.Recordset")
+ sql="select MRP_OrderID from MRP_OrderManoeuvre where MRP_OrderID='"&MRP_OrderID&"' and OrderState=3"
+ adminrs.open sql,objConn,1,1
+ if adminrs.Eof Then
+ adminrs.close()
+ sql="select MRP_OrderID from MRP_OrderManoeuvre where MRP_OrderID='"&MRP_OrderID_Out&"' and OrderState=3"
+ adminrs.open sql,objConn,1,1
+ if not adminrs.Eof then
+ '鏂板缓杞粨鍗�
+ sql="insert into MRP_OrderManoeuvre (MRP_OrderID,OutWarehouseID,InWarehouseID,OrderState,OrderTime_OAid,TotalQty,OrderRemarks,AuditTime,AuditTime_OAid,OutTime,OutTime_OAid,InTime,InTime_OAid) select '"&MRP_OrderID&"',"&OutWarehouseID&","&InWarehouseID&",3,"&session("adminID")&",TotalQty,OrderRemarks,getdate(),"&session("adminID")&",getdate(),"&session("adminID")&",getdate(),"&session("adminID")&" from MRP_OrderManoeuvre where MRP_OrderID='"&MRP_OrderID_Out&"' and OrderState=3"
+ objConn.Execute sql
+ sql="insert into MRP_OrderDetail (MRP_OrderIDPK,StItmIDPK,OD_Qty,OD_QtyA,OD_Price,OD_Remarks) select '"&MRP_OrderID&"',StItmIDPK,OD_Qty,OD_QtyA,OD_Price,OD_Remarks from MRP_OrderDetail where MRP_OrderIDPK='"&MRP_OrderID_Out&"'"
+ objConn.Execute sql
+ sql="insert into MRP_Stock (StItmIDPK,StockQty,StockWarehouseID,MRP_OrderIDPK,StockTime_OAid) select StItmIDPK,-StockQty,"&OutWarehouseID&",'"&MRP_OrderID&"',"&session("adminID")&" from MRP_Stock where MRP_OrderIDPK='"&MRP_OrderID_Out&"' and StockWarehouseID="&OutWarehouseID
+ objConn.Execute sql
+ sql="insert into MRP_Stock (StItmIDPK,StockQty,StockWarehouseID,MRP_OrderIDPK,StockTime_OAid) select StItmIDPK,StockQty,"&InWarehouseID&",'"&MRP_OrderID&"',"&session("adminID")&" from MRP_Stock where MRP_OrderIDPK='"&MRP_OrderID_Out&"' and StockWarehouseID="&OutWarehouseID
+ objConn.Execute sql
+ end If
+ End If
+ adminrs.close()
+End Function
+
+Function Get_TritonshAPI(UserUUID,orderStatus,ServiceOrdID,iuid,CoName,CoPhone,orderPrice,orderSource)
+ 'url="https://api.966120.com.cn/v1/cuituAPI.php"
+ 'Origin="OrdID="&ServiceOrdID&"&method="&method&"&iuid="&iuid&"&uuid="&uuid
+ 'HTMLCODE= GetBody(url,Origin)
+ appUrl="https://market.tritonsh.com/order/orderDeal"
+ args1="{"
+ 'args1=args1&"""id"": """&uuid&"""," '瀵规柟璁㈠崟ID
+ args1=args1&"""userId"": """&iuid&"""," '瀵规柟鐢ㄦ埛ID(浠嬬粛浜篒D)
+ args1=args1&"""orderStatus"": """&orderStatus&"""," '璁㈠崟鐘舵�� 0锛氬垵濮嬭鍗� , 1锛氭渶缁堣鍗曠姸鎬�
+ args1=args1&"""orderType"":0," '涓嬪崟绫诲瀷 0:鏈汉涓嬪崟,1:浠d汉涓嬪崟
+ If orderSource="1" Then
+ args1=args1&"""orderSource"":""浠e涓嬪崟"","
+ ElseIf orderSource="2" Then
+ args1=args1&"""orderSource"":""闈㈠闈簩缁寸爜"","
+ ElseIf orderSource="3" Then
+ args1=args1&"""orderSource"":""鎺ㄥ箍娴锋姤"","
+ End If
+ args1=args1&"""orderUserPhone"": """&CoPhone&"""," '瀹㈡埛鎵嬫満鍙�
+ args1=args1&"""userName"": """&CoName&"""," '瀹㈡埛濮撳悕
+ args1=args1&"""orderPrice"": """&orderPrice&"""," '璁㈠崟閲戦
+ args1=args1&"""orderServiceNo"": """&ServiceOrdID&"""" '璁㈠崟鏈嶅姟鍗曞彿
+ args1=args1&"}"
+ 'call PostBody(appUrl,args1)
+ 'Response.Write args1&"<br>"
+ HTMLCODE= PostBody1(appUrl,args1)
+ sql="update ServiceOrder set ToUserUUID="&UserUUID&" where ServiceOrdID="&ServiceOrdID
+ objConn.Execute sql
+ sql="update UserUUID set ToServiceOrdID="&ServiceOrdID&",TritonshJson='"&HTMLCODE&"',TritonshTime=getdate() where id="&UserUUID
+ objConn.Execute sql
+ 'Response.Write HTMLCODE&"<br>"
+ 'Response.end
+ 'HTMLCODE= GetBody(url,Origin)
+End Function
+
+DispatchOrdID = SafeRequest(Request("DispatchOrdID"))'璋冨害鍗曞彿
+ServiceOrdID = SafeRequest(Request("ServiceOrdID")) '瀵瑰簲鏈嶅姟鍗曞彿
+ServiceOrdDel = SafeRequest(Request("ServiceOrdDel"))'鏄惁鍚屾椂鍙栨秷鏈嶅姟鍙�(1鏄�,0鍚�)
+Del = SafeRequest(Request("Del")) '寮哄埗鍙栨秷(YES/NO)
+CancelReason = SafeRequest(Request("CancelReason"))'鍙栨秷鍘熷洜
+CancelReasonTXT = SafeRequest(Request("CancelReasonTXT"))'鍙栨秷鍘熷洜澶囨敞
+CancelReasonTXT = CancelReasonTXT&"[鍙栨秷鎿嶄綔:"&OAUser(session("adminID"),"UserName")&"]"
+Source = SafeRequest(Request("Source")) '鍙栨秷鏉ユ簮(PC/Phone)
+If CancelReason="" Then CancelReason=0
+If ServiceOrdDel="" Then ServiceOrdDel=0
+If Source="Phone" Then SourceURL="m_"
+Set rs = Server.CreateObject("ADODB.Recordset")
+'楠岃瘉璋冨害鍗曟槸鍚﹀彲鍙栨秷
+If DispatchOrdID<>"" Then
+ If Del<>"YES" then
+ sql="select DispatchOrdState,DispatchOrd_AP_Check from DispatchOrd where DispatchOrdID="&DispatchOrdID
+ rs.open sql,objConn,1,1
+ If rs.eof Then
+ Response.Redirect "/DispatchOrder.gds?SystemMessageType=4&SMT=1"
+ Else
+ DispatchOrdState = rs("DispatchOrdState")
+ DispatchOrd_AP_Check= rs("DispatchOrd_AP_Check")
+ If CInt(DispatchOrdState)>=4 Then
+ Response.Redirect "/"&SourceURL&"DispatchOrder.gds?DispatchOrdID="&DispatchOrdID&"&SystemMessageType=4&SMT=10"
+ ElseIf DispatchOrd_AP_Check=1 Then
+ Response.Redirect "/"&SourceURL&"DispatchOrder.gds?DispatchOrdID="&DispatchOrdID&"&SystemMessageType=4&SMT=11"
+ End if
+ End If
+ rs.close()
+ End if
+ sql="update DispatchOrd set DispatchOrdState=10,DispatchOrdStartDate=getdate(),DispatchOrdCancelReason="&CancelReason&",DispatchOrdCancelReasonTXT='"&CancelReasonTXT&"',DispatchOrd_OAName=(SELECT STUFF(( select ',' + OA_Name from DispatchOrd_Entourage,OA_User where OA_User_ID=EntourageOAid and DispatchOrdIDDt=DispatchOrdID and EntourageState<>4 order by EntourageLead desc FOR XML PATH('')), 1, 1, '') AS EntourageName),DispatchOrd_OAEntourage=(SELECT STUFF(( select ',' + vtext from DispatchOrd_Entourage,OA_User,dictionary where OA_User_ID=EntourageOAid and DispatchOrdIDDt=DispatchOrdID and EntourageState<>4 and vtitle='DispatchOrdEntourage' and vID=EntourageID order by EntourageLead desc FOR XML PATH('')), 1, 1, '') AS EntouragePost),DispatchOrdUpdateOAid="&session("adminID")&",DispatchOrdUpdateTime=getdate() where DispatchOrdID="&DispatchOrdID
+ objConn.Execute sql
+ '淇敼鐩稿叧鏈嶅姟鍗曠姸鎬�
+ If ServiceOrdID<>"" then
+ sql="select DispatchOrdID from DispatchOrd where ServiceOrdIDDt="&ServiceOrdID&" and DispatchOrdState<>10"
+ rs.open sql,objConn,1,1
+ If rs.eof Then
+ If ServiceOrdDel="1" Then
+ sql="update ServiceOrder set ServiceOrdState=4,ServiceOrd_AP_ID="&session("adminID")&",ServiceOrd_AP_Time=getdate(),ServiceOrdCancelReason="&CancelReason&",ServiceOrdCancelReasonTXT='"&CancelReasonTXT&"' where ServiceOrdID="&ServiceOrdID
+ else
+ sql="update ServiceOrder set ServiceOrdState=2,ServiceOrdStartDate=getdate(),ServiceOrdCancelReason="&CancelReason&",ServiceOrdCancelReasonTXT='"&CancelReasonTXT&"' where ServiceOrdID="&ServiceOrdID
+ End If
+ objConn.Execute sql
+ End If
+ rs.close()
+ End If
+ '閲嶇偣璁櫒褰掕繕
+ Call DispatchMRPOrderReturn(14,DispatchOrdID)
+ ReturnURL="/"&SourceURL&"DispatchOrder.gds?DispatchOrdID="&DispatchOrdID
+ Call OA_Running("鍙栨秷璋冨害鍗�:"&DispatchOrdID)
+ElseIf ServiceOrdID<>"" Then
+ If Del<>"YES" then
+ sql="select ServiceOrdState,ServiceOrd_AP_Check,ServiceOrdCoName,ServiceOrdCoPhone,ToUserUUID from ServiceOrder where ServiceOrdID="&ServiceOrdID
+ rs.open sql,objConn,1,1
+ If rs.eof Then
+ Response.Redirect "/"&SourceURL&"ServiceOrder_List.gds?SystemMessageType=4&SMT=1"
+ Else
+ ServiceOrdState = rs("ServiceOrdState")
+ ServiceOrdCoName= rs("ServiceOrdCoName")
+ ServiceOrdCoPhone= rs("ServiceOrdCoPhone")
+ ToUserUUID = rs("ToUserUUID")
+ If CInt(ServiceOrdState)=3 Then
+ Response.Redirect "/"&SourceURL&"ServiceOrder.gds?ServiceOrdID="&ServiceOrdID&"&SystemMessageType=4&SMT=10"
+ ElseIf ServiceOrd_AP_Check=1 Then
+ Response.Redirect "/"&SourceURL&"ServiceOrder.gds?ServiceOrdID="&ServiceOrdID&"&SystemMessageType=4&SMT=11"
+ End if
+ End If
+ rs.close()
+ End if
+ sql="update ServiceOrder set ServiceOrdState=4,ServiceOrd_AP_ID="&session("adminID")&",ServiceOrd_AP_Time=getdate(),ServiceOrdCancelReason="&CancelReason&",ServiceOrdCancelReasonTXT='"&CancelReasonTXT&"' where ServiceOrdState<>4 and ServiceOrdID="&ServiceOrdID
+ objConn.Execute sql
+ '钀ラ攢灏忕▼搴忔暟鎹洿鏂�
+ If ToUserUUID<>"0" And ToUserUUID<>"" Then
+ sql="select top 1 id,iuid from UserUUID where id="&ToUserUUID
+ rs.open sql,objConn,1,1
+ if not rs.eof Then
+ iuid=rs("iuid")
+ Call Get_TritonshAPI(ToUserUUID,1,ServiceOrdID,iuid,ServiceOrdCoName,ServiceOrdCoPhone,0)
+ End If
+ rs.close()
+ End If
+ ReturnURL="/"&SourceURL&"ServiceOrder_List.gds?OrdState=0"
+ Call OA_Running("鍙栨秷璋冨害鍗�:"&ServiceOrdID)
+End If
+
+objConn.Execute "exec OrdDataUP "&ServiceOrdID
+rsRollbackTrans(objConn.Errors.count)
+Response.Redirect ReturnURL&"&SystemMessageType=3&SMT=8&h_menu1_1="&session("h_menu1_1")
+Response.End
\ No newline at end of file
diff --git a/alipay-config.properties b/alipay-config.properties
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/alipay-config.properties
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/weixin/upload_file.php b/weixin/upload_file.php
new file mode 100644
index 0000000..1acba43
--- /dev/null
+++ b/weixin/upload_file.php
@@ -0,0 +1,216 @@
+<?php
+header('Content-Type: application/json; charset=utf-8');
+
+// 璁剧疆閿欒鎶ュ憡
+error_reporting(E_ALL);
+ini_set('display_errors', 1);
+
+// 鍏佽璺ㄥ煙璇锋眰锛堝鏋滈渶瑕侊級
+header('Access-Control-Allow-Origin: *');
+header('Access-Control-Allow-Methods: POST');
+header('Access-Control-Allow-Headers: Content-Type');
+
+// 妫�鏌ヨ姹傛柟娉�
+if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
+ echo json_encode([
+ 'success' => false,
+ 'message' => '鍙敮鎸丳OST璇锋眰'
+ ]);
+ exit;
+}
+
+// 鑾峰彇鍙傛暟
+$uploadFileName = isset($_POST['uploadFileName']) ? $_POST['uploadFileName'] : '';
+$file = isset($_FILES['file']) ? $_FILES['file'] : null;
+
+// 楠岃瘉鍙傛暟
+if (empty($uploadFileName)) {
+ echo json_encode([
+ 'success' => false,
+ 'message' => 'uploadFileName鍙傛暟涓嶈兘涓虹┖'
+ ]);
+ exit;
+}
+
+if (!$file || $file['error'] !== UPLOAD_ERR_OK) {
+ $errorMessage = '鏂囦欢涓婁紶澶辫触';
+ if ($file) {
+ switch ($file['error']) {
+ case UPLOAD_ERR_INI_SIZE:
+ $errorMessage = '鏂囦欢澶у皬瓒呰繃php.ini闄愬埗';
+ break;
+ case UPLOAD_ERR_FORM_SIZE:
+ $errorMessage = '鏂囦欢澶у皬瓒呰繃琛ㄥ崟闄愬埗';
+ break;
+ case UPLOAD_ERR_PARTIAL:
+ $errorMessage = '鏂囦欢鍙湁閮ㄥ垎琚笂浼�';
+ break;
+ case UPLOAD_ERR_NO_FILE:
+ $errorMessage = '娌℃湁鏂囦欢琚笂浼�';
+ break;
+ case UPLOAD_ERR_NO_TMP_DIR:
+ $errorMessage = '鎵句笉鍒颁复鏃舵枃浠跺す';
+ break;
+ case UPLOAD_ERR_CANT_WRITE:
+ $errorMessage = '鏂囦欢鍐欏叆澶辫触';
+ break;
+ }
+ }
+ echo json_encode([
+ 'success' => false,
+ 'message' => $errorMessage
+ ]);
+ exit;
+}
+
+// 楠岃瘉鏂囦欢绫诲瀷锛堝彲閫夛級
+$allowedTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'];
+if (!in_array($file['type'], $allowedTypes)) {
+ echo json_encode([
+ 'success' => false,
+ 'message' => '涓嶆敮鎸佺殑鏂囦欢绫诲瀷锛�' . $file['type']
+ ]);
+ exit;
+}
+
+// 楠岃瘉鏂囦欢澶у皬锛堥檺鍒朵负10MB锛�
+$maxFileSize = 10 * 1024 * 1024; // 10MB
+if ($file['size'] > $maxFileSize) {
+ echo json_encode([
+ 'success' => false,
+ 'message' => '鏂囦欢澶у皬瓒呰繃闄愬埗锛堟渶澶�10MB锛�'
+ ]);
+ exit;
+}
+
+try {
+ // 鍒涘缓骞存湀鐩綍
+ $yearMonth = date('Ym');
+ $uploadDir = "../upload/{$yearMonth}/";
+
+ // 濡傛灉鐩綍涓嶅瓨鍦ㄥ垯鍒涘缓
+ if (!is_dir($uploadDir)) {
+ if (!mkdir($uploadDir, 0755, true)) {
+ throw new Exception('鏃犳硶鍒涘缓鐩綍锛�' . $uploadDir);
+ }
+ }
+
+ // 鐢熸垚鍞竴鏂囦欢鍚�
+ $fileExtension = pathinfo($file['name'], PATHINFO_EXTENSION);
+ $uniqueFileName = $uploadFileName . '_' . time() . '_' . uniqid() . '.' . $fileExtension;
+ $filePath = $uploadDir . $uniqueFileName;
+
+ // 绉诲姩涓婁紶鐨勬枃浠�
+ if (!move_uploaded_file($file['tmp_name'], $filePath)) {
+ throw new Exception('鏂囦欢淇濆瓨澶辫触');
+ }
+
+ // 濡傛灉鏄浘鐗囷紝鐢熸垚缂╃暐鍥�
+ $thumbnailPath = '';
+ if (in_array($file['type'], ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'])) {
+ $thumbnailPath = $uploadDir . 's_' . $uniqueFileName;
+ createThumbnail($filePath, $thumbnailPath, 100, 0);
+ }
+
+ // 杩斿洖鎴愬姛淇℃伅
+ $response = [
+ 'success' => true,
+ 'message' => '鏂囦欢涓婁紶鎴愬姛',
+ 'data' => [
+ 'originalName' => $file['name'],
+ 'fileName' => $uniqueFileName,
+ 'filePath' => str_replace('../', 'https://sys.966120.com.cn/', $filePath),
+ 'thumbnailPath' => $thumbnailPath ? str_replace('../', 'https://sys.966120.com.cn/', $thumbnailPath) : '',
+ 'fileSize' => $file['size'],
+ 'fileType' => $file['type'],
+ 'uploadTime' => date('Y-m-d H:i:s')
+ ]
+ ];
+
+ echo json_encode($response);
+
+} catch (Exception $e) {
+ echo json_encode([
+ 'success' => false,
+ 'message' => '涓婁紶澶辫触锛�' . $e->getMessage()
+ ]);
+}
+
+/**
+ * 鍒涘缓缂╃暐鍥�
+ * @param string $sourcePath 婧愬浘鐗囪矾寰�
+ * @param string $targetPath 鐩爣缂╃暐鍥捐矾寰�
+ * @param int $width 瀹藉害
+ * @param int $height 楂樺害锛�0琛ㄧず鎸夋瘮渚嬬缉鏀撅級
+ */
+function createThumbnail($sourcePath, $targetPath, $width, $height) {
+ $imageInfo = getimagesize($sourcePath);
+ if (!$imageInfo) {
+ return false;
+ }
+
+ $sourceWidth = $imageInfo[0];
+ $sourceHeight = $imageInfo[1];
+ $imageType = $imageInfo[2];
+
+ // 璁$畻缂╃暐鍥惧昂瀵�
+ if ($height == 0) {
+ $height = floor($width / $sourceWidth * $sourceHeight);
+ } elseif ($width == 0) {
+ $width = floor($height / $sourceHeight * $sourceWidth);
+ }
+
+ // 鍒涘缓婧愬浘鍍�
+ switch ($imageType) {
+ case IMAGETYPE_GIF:
+ $sourceImage = imagecreatefromgif($sourcePath);
+ break;
+ case IMAGETYPE_JPEG:
+ $sourceImage = imagecreatefromjpeg($sourcePath);
+ break;
+ case IMAGETYPE_PNG:
+ $sourceImage = imagecreatefrompng($sourcePath);
+ break;
+ default:
+ return false;
+ }
+
+ if (!$sourceImage) {
+ return false;
+ }
+
+ // 鍒涘缓缂╃暐鍥�
+ $thumbnailImage = imagecreatetruecolor($width, $height);
+
+ // 淇濇寔PNG閫忔槑搴�
+ if ($imageType == IMAGETYPE_PNG) {
+ imagealphablending($thumbnailImage, false);
+ imagesavealpha($thumbnailImage, true);
+ $transparent = imagecolorallocatealpha($thumbnailImage, 255, 255, 255, 127);
+ imagefilledrectangle($thumbnailImage, 0, 0, $width, $height, $transparent);
+ }
+
+ // 璋冩暣鍥惧儚澶у皬
+ imagecopyresampled($thumbnailImage, $sourceImage, 0, 0, 0, 0, $width, $height, $sourceWidth, $sourceHeight);
+
+ // 淇濆瓨缂╃暐鍥�
+ $result = false;
+ switch ($imageType) {
+ case IMAGETYPE_GIF:
+ $result = imagegif($thumbnailImage, $targetPath);
+ break;
+ case IMAGETYPE_JPEG:
+ $result = imagejpeg($thumbnailImage, $targetPath, 90);
+ break;
+ case IMAGETYPE_PNG:
+ $result = imagepng($thumbnailImage, $targetPath, 9);
+ break;
+ }
+
+ // 閲婃斁鍐呭瓨
+ imagedestroy($sourceImage);
+ imagedestroy($thumbnailImage);
+
+ return $result;
+}
+?>
\ No newline at end of file
diff --git a/weixin/upload_test.html b/weixin/upload_test.html
new file mode 100644
index 0000000..7abe10e
--- /dev/null
+++ b/weixin/upload_test.html
@@ -0,0 +1,214 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>鏂囦欢涓婁紶娴嬭瘯</title>
+ <style>
+ body {
+ font-family: Arial, sans-serif;
+ max-width: 800px;
+ margin: 0 auto;
+ padding: 20px;
+ }
+ .upload-form {
+ border: 2px dashed #ccc;
+ padding: 20px;
+ text-align: center;
+ margin-bottom: 20px;
+ }
+ .upload-form:hover {
+ border-color: #999;
+ }
+ .form-group {
+ margin-bottom: 15px;
+ }
+ label {
+ display: block;
+ margin-bottom: 5px;
+ font-weight: bold;
+ }
+ input[type="text"], input[type="file"] {
+ width: 100%;
+ padding: 8px;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ box-sizing: border-box;
+ }
+ button {
+ background-color: #4CAF50;
+ color: white;
+ padding: 10px 20px;
+ border: none;
+ border-radius: 4px;
+ cursor: pointer;
+ font-size: 16px;
+ }
+ button:hover {
+ background-color: #45a049;
+ }
+ button:disabled {
+ background-color: #cccccc;
+ cursor: not-allowed;
+ }
+ .result {
+ margin-top: 20px;
+ padding: 15px;
+ border-radius: 4px;
+ }
+ .success {
+ background-color: #d4edda;
+ border: 1px solid #c3e6cb;
+ color: #155724;
+ }
+ .error {
+ background-color: #f8d7da;
+ border: 1px solid #f5c6cb;
+ color: #721c24;
+ }
+ .progress {
+ width: 100%;
+ height: 20px;
+ background-color: #f0f0f0;
+ border-radius: 10px;
+ overflow: hidden;
+ margin-top: 10px;
+ }
+ .progress-bar {
+ height: 100%;
+ background-color: #4CAF50;
+ width: 0%;
+ transition: width 0.3s ease;
+ }
+ .file-info {
+ margin-top: 10px;
+ font-size: 14px;
+ color: #666;
+ }
+ </style>
+</head>
+<body>
+ <h1>鏂囦欢涓婁紶娴嬭瘯</h1>
+
+ <div class="upload-form">
+ <form id="uploadForm" enctype="multipart/form-data">
+ <div class="form-group">
+ <label for="uploadFileName">鏂囦欢鍚嶅墠缂�锛�</label>
+ <input type="text" id="uploadFileName" name="uploadFileName" placeholder="渚嬪锛歵est123" required>
+ </div>
+
+ <div class="form-group">
+ <label for="file">閫夋嫨鏂囦欢锛�</label>
+ <input type="file" id="file" name="file" required>
+ <div class="file-info">
+ 鏀寔鐨勬枃浠剁被鍨嬶細JPG, PNG, GIF, PDF, DOC, DOCX<br>
+ 鏈�澶ф枃浠跺ぇ灏忥細10MB
+ </div>
+ </div>
+
+ <button type="submit" id="submitBtn">涓婁紶鏂囦欢</button>
+ </form>
+
+ <div class="progress" id="progress" style="display: none;">
+ <div class="progress-bar" id="progressBar"></div>
+ </div>
+ </div>
+
+ <div id="result"></div>
+
+ <script>
+ document.getElementById('uploadForm').addEventListener('submit', function(e) {
+ e.preventDefault();
+
+ const formData = new FormData();
+ const uploadFileName = document.getElementById('uploadFileName').value;
+ const file = document.getElementById('file').files[0];
+
+ if (!uploadFileName || !file) {
+ showResult('璇峰~鍐欐枃浠跺悕鍓嶇紑骞堕�夋嫨鏂囦欢', false);
+ return;
+ }
+
+ formData.append('uploadFileName', uploadFileName);
+ formData.append('file', file);
+
+ // 鏄剧ず杩涘害鏉�
+ document.getElementById('progress').style.display = 'block';
+ document.getElementById('submitBtn').disabled = true;
+
+ // 妯℃嫙杩涘害
+ let progress = 0;
+ const progressInterval = setInterval(() => {
+ progress += Math.random() * 10;
+ if (progress > 90) progress = 90;
+ document.getElementById('progressBar').style.width = progress + '%';
+ }, 100);
+
+ fetch('upload_file.php', {
+ method: 'POST',
+ body: formData
+ })
+ .then(response => response.json())
+ .then(data => {
+ clearInterval(progressInterval);
+ document.getElementById('progressBar').style.width = '100%';
+
+ setTimeout(() => {
+ document.getElementById('progress').style.display = 'none';
+ document.getElementById('submitBtn').disabled = false;
+
+ if (data.success) {
+ showResult(`
+ <h3>涓婁紶鎴愬姛锛�</h3>
+ <p><strong>鍘熷鏂囦欢鍚嶏細</strong>${data.data.originalName}</p>
+ <p><strong>淇濆瓨鏂囦欢鍚嶏細</strong>${data.data.fileName}</p>
+ <p><strong>鏂囦欢澶у皬锛�</strong>${formatFileSize(data.data.fileSize)}</p>
+ <p><strong>鏂囦欢绫诲瀷锛�</strong>${data.data.fileType}</p>
+ <p><strong>涓婁紶鏃堕棿锛�</strong>${data.data.uploadTime}</p>
+ <p><strong>鏂囦欢璺緞锛�</strong><a href="${data.data.filePath}" target="_blank">${data.data.filePath}</a></p>
+ ${data.data.thumbnailPath ? `<p><strong>缂╃暐鍥撅細</strong><a href="${data.data.thumbnailPath}" target="_blank">${data.data.thumbnailPath}</a></p>` : ''}
+ `, true);
+ } else {
+ showResult('涓婁紶澶辫触锛�' + data.message, false);
+ }
+ }, 500);
+ })
+ .catch(error => {
+ clearInterval(progressInterval);
+ document.getElementById('progress').style.display = 'none';
+ document.getElementById('submitBtn').disabled = false;
+ showResult('缃戠粶閿欒锛�' + error.message, false);
+ });
+ });
+
+ function showResult(message, isSuccess) {
+ const resultDiv = document.getElementById('result');
+ resultDiv.innerHTML = message;
+ resultDiv.className = 'result ' + (isSuccess ? 'success' : 'error');
+ }
+
+ function formatFileSize(bytes) {
+ if (bytes === 0) return '0 Bytes';
+ const k = 1024;
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
+ }
+
+ // 鏂囦欢閫夋嫨鏃舵樉绀烘枃浠朵俊鎭�
+ document.getElementById('file').addEventListener('change', function(e) {
+ const file = e.target.files[0];
+ if (file) {
+ const fileInfo = document.querySelector('.file-info');
+ fileInfo.innerHTML = `
+ 宸查�夋嫨鏂囦欢锛�${file.name}<br>
+ 鏂囦欢澶у皬锛�${formatFileSize(file.size)}<br>
+ 鏂囦欢绫诲瀷锛�${file.type}<br>
+ 鏀寔鐨勬枃浠剁被鍨嬶細JPG, PNG, GIF, PDF, DOC, DOCX<br>
+ 鏈�澶ф枃浠跺ぇ灏忥細10MB
+ `;
+ }
+ });
+ </script>
+</body>
+</html>
\ No newline at end of file
--
Gitblit v1.9.1