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
2045babd
Commit
2045babd
authored
Sep 27, 2024
by
张永
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
957e7cd5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
0 deletions
+130
-0
OrderController.java
src/main/java/com/egolm/shop/api/OrderController.java
+36
-0
OrderService.java
src/main/java/com/egolm/shop/api/service/OrderService.java
+2
-0
OrderServiceImpl.java
...ava/com/egolm/shop/api/service/impl/OrderServiceImpl.java
+92
-0
No files found.
src/main/java/com/egolm/shop/api/OrderController.java
View file @
2045babd
...
...
@@ -176,6 +176,42 @@ public class OrderController {
return
orderService
.
paySubmitV2
(
map
);
}
@ApiOperation
(
"B2B订单补款(分账支付170)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"terminal"
,
dataType
=
"String"
,
required
=
true
,
value
=
"终端标识"
,
defaultValue
=
"wechat"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"shopNO"
,
dataType
=
"String"
,
required
=
true
,
value
=
"店铺编码"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"subOrderID"
,
dataType
=
"String"
,
required
=
true
,
value
=
"子订单号"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"langID"
,
dataType
=
"String"
,
required
=
false
,
value
=
"语言"
,
defaultValue
=
"936"
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"sign"
,
dataType
=
"String"
,
required
=
true
,
value
=
"签名"
,
defaultValue
=
""
),
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"timestamp"
,
dataType
=
"String"
,
required
=
true
,
value
=
"时间戳"
,
defaultValue
=
""
)
})
@RequestMapping
(
value
=
"/payDebtSubmit"
,
method
=
RequestMethod
.
POST
)
@IDCLogResource
(
name
=
"B2B订单补款(分账支付170)"
)
public
String
payDebtSubmit
(
HttpServletRequest
request
)
{
String
langID
=
request
.
getParameter
(
"langID"
);
String
shopNO
=
request
.
getParameter
(
"shopNO"
);
String
subOrderID
=
request
.
getParameter
(
"subOrderID"
);
String
trace_id
=
request
.
getAttribute
(
"trace_id"
)+
""
;
if
(!
StringUtil
.
isNotEmpty
(
shopNO
,
subOrderID
))
{
return
Rjx
.
json
().
setCode
(-
1
).
setMessage
(
I18NUtils
.
getMessage
(
langID
,
"Msg_Parameter_empty"
)).
toJson
();
}
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"shopNO"
,
shopNO
);
map
.
put
(
"subOrderID"
,
subOrderID
);
map
.
put
(
"ipaddress"
,
ServletUtil
.
remoteIp
(
request
));
map
.
put
(
"trace_id"
,
trace_id
);
return
orderService
.
payDebtSubmit
(
map
);
}
@ApiOperation
(
"获取主订单列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"query"
,
name
=
"orgNo"
,
dataType
=
"String"
,
required
=
true
),
...
...
src/main/java/com/egolm/shop/api/service/OrderService.java
View file @
2045babd
...
...
@@ -20,6 +20,8 @@ public interface OrderService {
public
String
paySubmitV2
(
Map
<
String
,
Object
>
map
);
public
String
payDebtSubmit
(
Map
<
String
,
Object
>
map
);
public
String
queryOrderList
(
String
orgNo
,
String
shopNo
,
String
agentID
,
Integer
status
,
String
[]
orderType
,
String
langID
,
Page
page
);
public
String
queryOrderDetailList
(
String
salesOrderId
,
String
agentID
);
...
...
src/main/java/com/egolm/shop/api/service/impl/OrderServiceImpl.java
View file @
2045babd
...
...
@@ -1969,4 +1969,96 @@ public class OrderServiceImpl implements OrderService {
return
Rjx
.
jsonErr
().
setMessage
(
"订单错误"
).
set
(
"errorMsg"
,
"订单错误"
).
toJson
();
}
//补款170
public
String
payDebtSubmit
(
Map
<
String
,
Object
>
map
)
{
String
shopNO
=
map
.
get
(
"shopNO"
)+
""
;
String
trace_id
=
map
.
get
(
"trace_id"
)+
""
;
String
subOrderID
=
map
.
get
(
"subOrderID"
)+
""
;
String
resultSql
=
"select OrderStatus = nOrderStatus, \r\n"
+
" OrderStatusName = nOrderStatusName, \r\n"
+
" DebtAmount = nDebtAmount, \r\n"
+
" Status = case when nOrderStatus&1=1 then -2 when nOrderStatus&8192=8192 then -2 else 0 end, \r\n"
+
" ErrorMsg = case when nOrderStatus&1=1 then '该订单已被取消!' when nOrderStatus&8192=8192 then '该订单已付款!' else '未付款' end \r\n"
+
" from tSalesOrderSub \r\n"
+
" where sSubOrderID = ?"
;
String
sqlAll
=
"exec up_B2BQuerySalesOrderPay '"
+
subOrderID
+
"'"
;
List
<
Map
<
String
,
Object
>>
resultMap
=
jdbcTemplate
.
executeMutil
(
sqlAll
).
getDatas
().
get
(
0
);
String
lcswcbdkTimesSql
=
"SELECT sValue4 FROM tSystemCtrl WHERE sCode = 'LcswCBKMasterAccount'"
;
//扫呗分账重试次数
int
cbkTimes
=
3
;
try
{
cbkTimes
=
jdbcTemplate
.
queryForInt
(
lcswcbdkTimesSql
);
}
catch
(
Exception
e
)
{
}
if
(
resultMap
!=
null
&&
resultMap
.
size
()
>
0
)
{
for
(
Map
<
String
,
Object
>
pmap
:
resultMap
)
{
String
payTypeID
=
pmap
.
get
(
"PayTypeID"
)+
""
;
String
transTraceNO
=
pmap
.
get
(
"TransTraceNO"
)+
""
;
if
(
payTypeID
.
equals
(
"170"
)
&&
StringUtil
.
isEmpty
(
transTraceNO
))
{
String
account_out
=
pmap
.
get
(
"CBKAccountOut"
)+
""
;
//出账方
String
account_in
=
pmap
.
get
(
"CBKAccountIn"
)+
""
;
//入账方
String
come_from
=
"shop"
;
String
appId
=
pmap
.
get
(
"AppID"
)+
""
;
String
agentID
=
pmap
.
get
(
"AgentID"
)+
""
;
String
outTradeNO
=
pmap
.
get
(
"OutTradeNO"
)+
""
;
BigDecimal
PayAmount
=
(
BigDecimal
)
pmap
.
get
(
"PayAmount"
);
BigDecimal
pay_bd
=
new
BigDecimal
(
"100"
);
//表里为正数
int
total_fee
=
PayAmount
.
multiply
(
pay_bd
).
intValue
();
//支付金额分
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"trade_no"
,
outTradeNO
);
params
.
put
(
"total_fee"
,
total_fee
);
params
.
put
(
"appId"
,
appId
);
params
.
put
(
"order_body"
,
"补款支付分账"
);
params
.
put
(
"account_in"
,
account_in
);
params
.
put
(
"account_out"
,
account_out
);
params
.
put
(
"come_from"
,
come_from
);
params
.
put
(
"agentID"
,
agentID
);
params
.
put
(
"onlinePayTypeId"
,
payTypeID
);
for
(
int
ii
=
1
;
ii
<=
cbkTimes
;
ii
++)
{
//需求 #17427 失败了遍历100次,
logger
.
info
(
"订单号:{},第:{} 次进行扫呗补款分账支付 ,请求:{} "
,
subOrderID
,
ii
,
GsonUtil
.
toJson
(
pmap
));
String
cbkResult
=
payClient
.
post
(
"/lcsw/fz_cbk_dotrans_f"
,
params
,
map
.
get
(
"trace_id"
)+
""
);
logger
.
info
(
"订单号:{},第:{} 次进行扫呗补款分账支付 ,结果:{} "
,
subOrderID
,
ii
,
cbkResult
);
JSONObject
cbkJsonResult
=
JSONObject
.
parseObject
(
cbkResult
);
if
(
cbkJsonResult
.
getBooleanValue
(
"isValid"
))
{
String
cbk_out_trade_no
=
cbkJsonResult
.
getString
(
"out_trade_no"
);
//CBK的支付结果单号
String
finish_time
=
cbkJsonResult
.
getString
(
"finish_time"
);
//完成时间
String
sql
=
"exec up_B2BSalesOrderDebtPayCallBack '"
+
outTradeNO
+
"' ,'"
+
cbk_out_trade_no
+
"' ,'', '"
+
PayAmount
+
"' , '"
+
finish_time
+
"' , '"
+
payTypeID
+
"' ,0,'' "
;
List
<
Map
<
String
,
Object
>>
returnMap
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
String
returnStr
=
GsonUtil
.
toJson
(
returnMap
);
logger
.
info
(
"订单号:{},第:{} 次进行扫呗补款分账支付成功 ,回写结果:{} "
,
subOrderID
,
ii
,
returnStr
);
break
;
}
else
{
try
{
String
statusName
=
cbkJsonResult
.
containsKey
(
"err_code_des"
)?
cbkJsonResult
.
getString
(
"err_code_des"
):
cbkJsonResult
.
getString
(
"message"
);
if
(
StringUtil
.
isBlank
(
statusName
))
{
statusName
=
"补款分账支付失败."
;
}
//支付失败
String
sql
=
"exec up_B2BSalesOrderDebtPayCallBack '"
+
subOrderID
+
"' ,'','', '0' , '' , '"
+
payTypeID
+
"' ,1,'"
+
statusName
+
"' "
;
List
<
Map
<
String
,
Object
>>
returnMap
=
jdbcTemplate
.
executeMutil
(
sql
).
getDatas
().
get
(
0
);
String
returnStr
=
GsonUtil
.
toJson
(
returnMap
);
logger
.
info
(
"订单号:{},第:{} 次进行扫呗分账支付失败 ,回写结果:{} "
,
subOrderID
,
ii
,
returnStr
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"订单号:{},第:{} 次进行扫呗分账支付失败 ,回写结果异常:{} "
,
subOrderID
,
ii
,
e
);
}
}
}
}
}
}
return
Rjx
.
jsonOk
().
setData
(
jdbcTemplate
.
queryForMap
(
resultSql
,
subOrderID
)).
toJson
();
}
}
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