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
80678b52
Commit
80678b52
authored
Apr 25, 2023
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0d98f618
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
32 deletions
+19
-32
OrderController.java
src/main/java/com/egolm/shop/api/OrderController.java
+6
-5
OrderService.java
src/main/java/com/egolm/shop/api/service/OrderService.java
+1
-1
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+12
-26
No files found.
src/main/java/com/egolm/shop/api/OrderController.java
View file @
80678b52
...
...
@@ -180,14 +180,15 @@ public class OrderController {
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sOpenID"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sTransTraceNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"微信支付订单号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sOutTradeNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"商户支付单号"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"PayTypeID"
,
dataType
=
"String"
,
required
=
true
,
value
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
})
@RequestMapping
(
value
=
"/paySuccess"
,
method
=
RequestMethod
.
POST
)
public
String
paySuccess
(
String
sSalesOrderID
,
BigDecimal
nPayAmount
,
String
sOpenID
,
String
sTransTraceNO
,
String
sOutTradeNO
,
String
PayTypeID
,
String
PayType
)
{
public
String
paySuccess
(
String
sSalesOrderID
,
BigDecimal
nPayAmount
,
String
sOpenID
,
String
sTransTraceNO
,
String
sOutTradeNO
,
String
PayTypeID
)
{
try
{
String
[]
ary
=
sOutTradeNO
.
split
(
"_"
,
2
);
List
<
Map
<
String
,
Object
>>
result
=
orderService
.
paySuccess
(
ary
[
0
],
nPayAmount
,
sOpenID
,
sTransTraceNO
,
new
Date
());
List
<
Map
<
String
,
Object
>>
result
=
orderService
.
paySuccess
(
ary
[
0
],
nPayAmount
,
sOpenID
,
sTransTraceNO
,
new
Date
()
,
PayTypeID
);
return
Rjx
.
jsonOk
().
set
(
"list"
,
result
).
toJson
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -224,7 +225,7 @@ public class OrderController {
}
@ApiOperation
(
"微信小程序支付回调"
)
/*
@ApiOperation("微信小程序支付回调")
@RequestMapping(value = "/wxPayNotify",method= {RequestMethod.GET, RequestMethod.POST})
public String wxPayNotify(HttpServletRequest request) {
Map<String, String> result = new HashMap<String, String>();
...
...
@@ -252,7 +253,7 @@ public class OrderController {
String sOutTradeNO = out_trade_no;
Date date = DateUtil.parse(payEndTime, "yyyyMMddHHmmss");
BigDecimal nPayAmount = new BigDecimal(total_fee);
orderService
.
paySuccess
(
sOutTradeNO
,
nPayAmount
,
sOpenID
,
sTransTraceNO
,
date
);
orderService.paySuccess(sOutTradeNO, nPayAmount, sOpenID, sTransTraceNO, date
,"120"
);
}
result.put("return_code", "SUCCESS");
result.put("return_msg", "OK");
...
...
@@ -262,7 +263,7 @@ public class OrderController {
result.put("return_msg", e.getMessage());
}
return XmlUtil.toXml(result);
}
}
*/
@Transactional
@ApiOperation
(
"取消未付款订单"
)
...
...
src/main/java/com/egolm/shop/api/service/OrderService.java
View file @
80678b52
...
...
@@ -22,7 +22,7 @@ public interface OrderService {
public
String
getOrderDetail
(
String
salesOrderId
);
public
List
<
Map
<
String
,
Object
>>
paySuccess
(
String
sOutTradeNO
,
BigDecimal
nPayAmount
,
String
sOpenID
,
String
sTransTraceNO
,
Date
dPayDateTime
);
public
List
<
Map
<
String
,
Object
>>
paySuccess
(
String
sOutTradeNO
,
BigDecimal
nPayAmount
,
String
sOpenID
,
String
sTransTraceNO
,
Date
dPayDateTime
,
String
PayTypeID
);
public
String
getSubOrderDetail
(
String
subOrderID
);
...
...
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
80678b52
...
...
@@ -328,8 +328,15 @@ public class OrderServiceImpl implements OrderService {
@Transactional
public
List
<
Map
<
String
,
Object
>>
paySuccess
(
String
sOutTradeNO
,
BigDecimal
nPayAmount
,
String
sOpenID
,
String
sTransTraceNO
,
Date
dPayDateTime
)
{
List
<
Map
<
String
,
Object
>>
returnMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
String
sTransTraceNO
,
Date
dPayDateTime
,
String
PayTypeID
)
{
String
sql
=
"exec up_B2BSalesOrderPayUpdate '"
+
sOutTradeNO
+
"' ,'"
+
sTransTraceNO
+
"' , '"
+
sOpenID
+
"' , '"
+
nPayAmount
+
"' , '"
+
PayTypeID
+
"' "
;
List
<
Map
<
String
,
Object
>>
returnMap
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
/*List<Map<String, Object>> returnMap = new ArrayList<Map<String, Object>>();
String sSalesOrderID ="";
try {
...
...
@@ -340,28 +347,7 @@ public class OrderServiceImpl implements OrderService {
}
/* Integer nIdx = jdbcTemplate
.queryForInt("select ISNULL(MAX(nIdx),0) from tSalesOrderPay where sSalesOrderID = ?", sSalesOrderID);
nPayAmount = nPayAmount.multiply(new BigDecimal(0.01)).setScale(2, BigDecimal.ROUND_HALF_UP);
Map<String, Object> map = new HashMap<String, Object>();
map.put("sSalesOrderID", sSalesOrderID);
map.put("nIdx", ++nIdx);
map.put("sPayTypeID", "120");
map.put("sPayType", "微信支付(小程序)");
map.put("nPayAmount", nPayAmount);
map.put("sOutTradeNO", sOutTradeNO);
map.put("nPayDisAmount", BigDecimal.ZERO);
map.put("dPayDateTime", dPayDateTime);
map.put("sTransTraceNO", sTransTraceNO);
map.put("sPayCardNO", sOpenID);
map.put("nTag", 0);
map.put("dLastUpdateTime", new Date());
Dialect dialect = jdbcTemplate.getDialect();
Sql sqlDesc = dialect.argsInsert("tSalesOrderPay", map);
String sql = "if not exists (select * from tSalesOrderPay where sTransTraceNO = '" + sTransTraceNO + "') "
+ sqlDesc.getSql();
jdbcTemplate.update(sql, sqlDesc.getArgs());*/
if(StringUtil.isNotBlank(sSalesOrderID)) {
jdbcTemplate.update("UPDATE tSalesOrderPay SET sTransTraceNO = ? , dPayDateTime = ? ,dLastUpdateTime = getdate() WHERE sOutTradeNO = ? ",sTransTraceNO,DateUtil.format(dPayDateTime, DateUtil.FMT_DATE_SECOND),sOutTradeNO);
jdbcTemplate.update("update tSalesOrder set nOrderStatus = nOrderStatus|32 where sSalesOrderID = ?",
...
...
@@ -374,7 +360,7 @@ public class OrderServiceImpl implements OrderService {
}
}else {
logger.info("支付单号:"+sOutTradeNO +"未找到对应的订单号。");
}
}
*/
return
returnMap
;
}
...
...
@@ -1135,7 +1121,7 @@ public class OrderServiceImpl implements OrderService {
returnMap
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
}
else
{
// 普通订单
String
[]
ary
=
OutTradeNO
.
split
(
"_"
,
2
);
returnMap
=
this
.
paySuccess
(
ary
[
0
],
new
BigDecimal
(
PayAmount
),
OpenID
,
TransactionID
,
DateUtil
.
parse
(
paydate
,
DateUtil
.
FMT_DATE_SECOND
));
returnMap
=
this
.
paySuccess
(
ary
[
0
],
new
BigDecimal
(
PayAmount
),
OpenID
,
TransactionID
,
DateUtil
.
parse
(
paydate
,
DateUtil
.
FMT_DATE_SECOND
)
,
"120"
);
}
return
returnMap
;
}
...
...
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