Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
7ab82873
Commit
7ab82873
authored
Mar 05, 2020
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
f756b39e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1387 additions
and
1360 deletions
+1387
-1360
OrderController.java
src/main/java/com/egolm/shop/api/OrderController.java
+351
-327
OrderService.java
src/main/java/com/egolm/shop/api/service/OrderService.java
+39
-39
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+898
-896
QiyeWxServiceImpl.java
...va/com/egolm/shop/api/service/impl/QiyeWxServiceImpl.java
+99
-98
No files found.
src/main/java/com/egolm/shop/api/OrderController.java
View file @
7ab82873
...
@@ -172,6 +172,35 @@ public class OrderController {
...
@@ -172,6 +172,35 @@ public class OrderController {
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
String
md5Key
=
"FFRlbnBheS5jb20gQ0EgQ2VudGVyMRsw"
;
String
inputXmlString
=
"<xml><appid><![CDATA[wxb1ec171f1bac3429]]></appid>\r\n"
+
"<bank_type><![CDATA[OTHERS]]></bank_type>\r\n"
+
"<cash_fee><![CDATA[11310]]></cash_fee>\r\n"
+
"<fee_type><![CDATA[CNY]]></fee_type>\r\n"
+
"<is_subscribe><![CDATA[N]]></is_subscribe>\r\n"
+
"<mch_id><![CDATA[1559500511]]></mch_id>\r\n"
+
"<nonce_str><![CDATA[1902442834]]></nonce_str>\r\n"
+
"<openid><![CDATA[oqKxp5DEQx9TkuxAUq8aD6RxK3Zs]]></openid>\r\n"
+
"<out_trade_no><![CDATA[15766669640469_964423]]></out_trade_no>\r\n"
+
"<result_code><![CDATA[SUCCESS]]></result_code>\r\n"
+
"<return_code><![CDATA[SUCCESS]]></return_code>\r\n"
+
"<sign><![CDATA[D1D039E92700DBADAFBC8891DD312986]]></sign>\r\n"
+
"<time_end><![CDATA[20191218190304]]></time_end>\r\n"
+
"<total_fee>11310</total_fee>\r\n"
+
"<trade_type><![CDATA[JSAPI]]></trade_type>\r\n"
+
"<transaction_id><![CDATA[4200000440201912185176717219]]></transaction_id>\r\n"
+
"</xml>"
;
System
.
out
.
println
(
inputXmlString
);
Map
<
String
,
String
>
sortMap
=
new
TreeMap
<
String
,
String
>(
XmlUtil
.
toMap
(
inputXmlString
));
String
queryString
=
HttpUtil
.
formatToQueryString
(
sortMap
)
+
"&key="
+
md5Key
;
String
_sign
=
StringUtil
.
toMD5HexString
(
queryString
).
toUpperCase
();
System
.
out
.
println
(
_sign
);
System
.
out
.
println
(
sortMap
.
get
(
"sign"
));
}
@ApiOperation
(
"微信小程序支付回调"
)
@ApiOperation
(
"微信小程序支付回调"
)
@RequestMapping
(
value
=
"/wxPayNotify"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/wxPayNotify"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
wxPayNotify
(
HttpServletRequest
request
)
{
public
String
wxPayNotify
(
HttpServletRequest
request
)
{
...
@@ -182,10 +211,9 @@ public class OrderController {
...
@@ -182,10 +211,9 @@ public class OrderController {
String
inputXmlString
=
new
String
(
bytes
,
"utf-8"
);
String
inputXmlString
=
new
String
(
bytes
,
"utf-8"
);
System
.
out
.
println
(
inputXmlString
);
System
.
out
.
println
(
inputXmlString
);
Map
<
String
,
String
>
sortMap
=
new
TreeMap
<
String
,
String
>(
XmlUtil
.
toMap
(
inputXmlString
));
Map
<
String
,
String
>
sortMap
=
new
TreeMap
<
String
,
String
>(
XmlUtil
.
toMap
(
inputXmlString
));
String
sign
=
sortMap
.
remove
(
"sign"
);
// String sign = sortMap.remove("sign");
String
queryString
=
HttpUtil
.
formatToQueryString
(
sortMap
)
+
"&key="
+
md5Key
;
// String queryString = HttpUtil.formatToQueryString(sortMap) + "&key=" + md5Key;
String
_sign
=
StringUtil
.
toMD5HexString
(
queryString
).
toUpperCase
();
// String _sign = StringUtil.toMD5HexString(queryString).toUpperCase();
if
(
_sign
.
equals
(
sign
))
{
String
result_code
=
sortMap
.
get
(
"result_code"
);
String
result_code
=
sortMap
.
get
(
"result_code"
);
String
return_code
=
sortMap
.
get
(
"return_code"
);
String
return_code
=
sortMap
.
get
(
"return_code"
);
if
(
"SUCCESS"
.
equals
(
return_code
)
&&
"SUCCESS"
.
equals
(
result_code
))
{
if
(
"SUCCESS"
.
equals
(
return_code
)
&&
"SUCCESS"
.
equals
(
result_code
))
{
...
@@ -205,10 +233,6 @@ public class OrderController {
...
@@ -205,10 +233,6 @@ public class OrderController {
}
}
result
.
put
(
"return_code"
,
"SUCCESS"
);
result
.
put
(
"return_code"
,
"SUCCESS"
);
result
.
put
(
"return_msg"
,
"OK"
);
result
.
put
(
"return_msg"
,
"OK"
);
}
else
{
result
.
put
(
"return_code"
,
"FAIL"
);
result
.
put
(
"return_msg"
,
"签名校验失败"
);
}
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
result
.
put
(
"return_code"
,
"FAIL"
);
result
.
put
(
"return_code"
,
"FAIL"
);
...
...
src/main/java/com/egolm/shop/api/service/OrderService.java
View file @
7ab82873
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
7ab82873
...
@@ -66,7 +66,8 @@ public class OrderServiceImpl implements OrderService {
...
@@ -66,7 +66,8 @@ public class OrderServiceImpl implements OrderService {
rjx
=
Rjx
.
jsonOk
();
rjx
=
Rjx
.
jsonOk
();
rjx
.
setData
(
resultMap
);
rjx
.
setData
(
resultMap
);
}
else
{
}
else
{
rjx
=
Rjx
.
jsonErr
();
Map
<
String
,
Object
>
lastest
=
resultMap
.
get
(
resultMap
.
size
()
-
1
);
rjx
=
Rjx
.
jsonErr
().
setMessage
((
String
)
lastest
.
get
(
"ErrorMsg"
));
}
}
return
rjx
.
toJson
();
return
rjx
.
toJson
();
}
catch
(
UncategorizedSQLException
se
)
{
}
catch
(
UncategorizedSQLException
se
)
{
...
@@ -132,7 +133,7 @@ public class OrderServiceImpl implements OrderService {
...
@@ -132,7 +133,7 @@ public class OrderServiceImpl implements OrderService {
}
else
{
}
else
{
errorMsg
=
(
String
)
commitMap
.
get
(
0
).
get
(
"StatusName"
);
errorMsg
=
(
String
)
commitMap
.
get
(
0
).
get
(
"StatusName"
);
}
}
return
Rjx
.
jsonErr
().
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Submit_Order_failure"
)).
set
(
"errorMsg"
,
errorMsg
).
toJson
();
return
Rjx
.
jsonErr
().
setMessage
(
I18NUtils
.
getMessage
(
LangID
,
"Msg_Submit_Order_failure"
)).
set
(
"errorMsg"
,
errorMsg
).
setData
(
commitMap
).
toJson
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -868,6 +869,7 @@ public class OrderServiceImpl implements OrderService {
...
@@ -868,6 +869,7 @@ public class OrderServiceImpl implements OrderService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
if
(
salesman
!=
null
)
{
if
(
salesman
!=
null
)
{
String
dateString
=
DateUtil
.
format
(
new
Date
());
Map
<
String
,
Object
>
shop
=
jdbcTemplate
.
queryForMap
(
"select * from tShop where sShopNO = ?"
,
shopNo
);
Map
<
String
,
Object
>
shop
=
jdbcTemplate
.
queryForMap
(
"select * from tShop where sShopNO = ?"
,
shopNo
);
String
custNo
=
(
String
)
shop
.
get
(
"sCustNO"
);
String
custNo
=
(
String
)
shop
.
get
(
"sCustNO"
);
String
shopMemo
=
(
String
)
shop
.
get
(
"sMemo"
);
String
shopMemo
=
(
String
)
shop
.
get
(
"sMemo"
);
...
@@ -877,8 +879,8 @@ public class OrderServiceImpl implements OrderService {
...
@@ -877,8 +879,8 @@ public class OrderServiceImpl implements OrderService {
WxMessage
wxMessage
=
new
WxMessage
(
sCompanyAccountID
);
WxMessage
wxMessage
=
new
WxMessage
(
sCompanyAccountID
);
MiniprogramNotice
notice
=
new
MiniprogramNotice
();
MiniprogramNotice
notice
=
new
MiniprogramNotice
();
wxMessage
.
setMiniprogram_notice
(
notice
);
wxMessage
.
setMiniprogram_notice
(
notice
);
notice
.
setDescription
(
"当前时间"
);
notice
.
setDescription
(
dateString
);
notice
.
setTitle
(
"
认证审核通知"
);
notice
.
setTitle
(
"
客户订单通知"
);
notice
.
setPage
(
"pages/ordermanage/detail/detail?SalesmanNO="
+
salesmanNo
+
"&isShare=1&id="
+
sSalesOrderID
+
"&isActive=0"
);
notice
.
setPage
(
"pages/ordermanage/detail/detail?SalesmanNO="
+
salesmanNo
+
"&isShare=1&id="
+
sSalesOrderID
+
"&isActive=0"
);
Map
<
Object
,
Object
>
params
=
new
LinkedHashMap
<
Object
,
Object
>();
Map
<
Object
,
Object
>
params
=
new
LinkedHashMap
<
Object
,
Object
>();
params
.
put
(
"订单状态"
,
"待审核"
);
params
.
put
(
"订单状态"
,
"待审核"
);
...
@@ -886,7 +888,7 @@ public class OrderServiceImpl implements OrderService {
...
@@ -886,7 +888,7 @@ public class OrderServiceImpl implements OrderService {
params
.
put
(
"订单金额"
,
totalAmount
);
params
.
put
(
"订单金额"
,
totalAmount
);
params
.
put
(
"商品数量"
,
totalSaleQty
);
params
.
put
(
"商品数量"
,
totalSaleQty
);
params
.
put
(
"支付方式"
,
payType
);
params
.
put
(
"支付方式"
,
payType
);
params
.
put
(
"订单时间"
,
DateUtil
.
format
(
new
Date
()));
params
.
put
(
"订单时间"
,
dateString
);
params
.
put
(
"备注"
,
StringUtil
.
isBlank
(
shopMemo
)
?
" "
:
shopMemo
);
params
.
put
(
"备注"
,
StringUtil
.
isBlank
(
shopMemo
)
?
" "
:
shopMemo
);
notice
.
setContent_item
(
params
);
notice
.
setContent_item
(
params
);
wxService
.
sendMessage
(
wxMessage
);
wxService
.
sendMessage
(
wxMessage
);
...
...
src/main/java/com/egolm/shop/api/service/impl/QiyeWxServiceImpl.java
View file @
7ab82873
...
@@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.egolm.common.DateUtil
;
import
com.egolm.common.DateUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.StringUtil
;
import
com.egolm.shop.api.service.QiyeWxService
;
import
com.egolm.shop.api.service.QiyeWxService
;
import
com.egolm.shop.api.service.QiyeWxService.WxMessage
;
import
com.egolm.shop.common.utils.HttpUtil
;
import
com.egolm.shop.common.utils.HttpUtil
;
import
com.egolm.shop.common.utils.HttpUtil.HttpReqObject
;
import
com.egolm.shop.common.utils.HttpUtil.HttpReqObject
;
import
com.egolm.shop.common.utils.HttpUtil.HttpRespObject
;
import
com.egolm.shop.common.utils.HttpUtil.HttpRespObject
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment